Add resource for EditUserPhotoController
- Add string and dimens for EditUserPhotoController.
- Direct copy restricted_popup_menu_item.xml from Settings, used by
EditUserPhotoController.
Test: Manually
Bug: 112168722
Bug: 111967295
Change-Id: I27cd968145b62aac36c21e0d6cfee82ad23fa4ef
Merged-In: I27cd968145b62aac36c21e0d6cfee82ad23fa4ef
diff --git a/res/drawable/ic_info.xml b/res/drawable/ic_info.xml
new file mode 100644
index 0000000..afe7e6b
--- /dev/null
+++ b/res/drawable/ic_info.xml
@@ -0,0 +1,25 @@
+<!--
+ Copyright (C) 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?android:attr/colorAccent">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
+</vector>
diff --git a/res/layout/restricted_popup_menu_item.xml b/res/layout/restricted_popup_menu_item.xml
new file mode 100644
index 0000000..f644c12
--- /dev/null
+++ b/res/layout/restricted_popup_menu_item.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2018, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:gravity="center_vertical"
+ android:paddingStart="16dip"
+ android:paddingEnd="16dip">
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:attr/textColorAlertDialogListItem"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
+ android:ellipsize="marquee"
+ android:layout_alignParentLeft="true" />
+ <ImageView
+ android:id="@+id/restricted_icon"
+ android:layout_width="@dimen/config_restricted_icon_size"
+ android:layout_height="@dimen/config_restricted_icon_size"
+ android:scaleType="centerInside"
+ android:tint="?android:attr/colorAccent"
+ android:src="@drawable/ic_info"
+ android:layout_alignParentRight="true"
+ android:visibility="gone" />
+</RelativeLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0dc7852..5cf9561 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -20,4 +20,10 @@
<dimen name="tab_elevation">4dp</dimen>
<dimen name="action_bar_size">56dp</dimen>
<dimen name="tab_height">48dp</dimen>
+
+ <!-- Minimum width for the popup for updating a user's photo. -->
+ <dimen name="update_user_photo_popup_min_width">300dip</dimen>
+
+ <!-- Size of icon shown beside a preference locked by admin -->
+ <dimen name="config_restricted_icon_size">16dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 114de18..3db5ee1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -218,4 +218,8 @@
<!-- Explanatory text for a suggestion to a user to set up their emergency information [CHAR_LIMIT=55] -->
<string name="settings_suggestion_body">Let first responders see your information</string>
+ <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
+ <string name="user_image_take_photo">Take photo</string>
+ <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
+ <string name="user_image_choose_photo">Choose photo from Gallery</string>
</resources>