summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/drawable-hdpi/account_spinner_icon.pngbin324 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/account_spinner_icon.pngbin4076 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/account_spinner_icon.pngbin4051 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/account_spinner_icon.pngbin4133 -> 0 bytes
-rw-r--r--res/drawable-mdpi/account_spinner_icon.pngbin303 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/account_spinner_icon.pngbin364 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/account_spinner_icon.pngbin1146 -> 0 bytes
-rw-r--r--res/layout/item_photo_editor.xml95
-rw-r--r--res/values/dimens.xml12
-rw-r--r--res/values/strings.xml12
-rw-r--r--res/values/styles.xml5
11 files changed, 85 insertions, 39 deletions
diff --git a/res/drawable-hdpi/account_spinner_icon.png b/res/drawable-hdpi/account_spinner_icon.png
deleted file mode 100644
index 956638633..000000000
--- a/res/drawable-hdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/account_spinner_icon.png b/res/drawable-ldrtl-hdpi/account_spinner_icon.png
deleted file mode 100644
index ec1f26718..000000000
--- a/res/drawable-ldrtl-hdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/account_spinner_icon.png b/res/drawable-ldrtl-mdpi/account_spinner_icon.png
deleted file mode 100644
index 11b1a3e4d..000000000
--- a/res/drawable-ldrtl-mdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/account_spinner_icon.png b/res/drawable-ldrtl-xhdpi/account_spinner_icon.png
deleted file mode 100644
index 2c1c59f11..000000000
--- a/res/drawable-ldrtl-xhdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/account_spinner_icon.png b/res/drawable-mdpi/account_spinner_icon.png
deleted file mode 100644
index e159d59d4..000000000
--- a/res/drawable-mdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/account_spinner_icon.png b/res/drawable-xhdpi/account_spinner_icon.png
deleted file mode 100644
index d3d3cacc9..000000000
--- a/res/drawable-xhdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/account_spinner_icon.png b/res/drawable-xxhdpi/account_spinner_icon.png
deleted file mode 100644
index 5f90fbc3b..000000000
--- a/res/drawable-xxhdpi/account_spinner_icon.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/item_photo_editor.xml b/res/layout/item_photo_editor.xml
index e73f4e387..ebf122d1a 100644
--- a/res/layout/item_photo_editor.xml
+++ b/res/layout/item_photo_editor.xml
@@ -4,9 +4,9 @@
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.
@@ -14,40 +14,71 @@
limitations under the License.
-->
-<view
- class="com.android.contacts.editor.PhotoEditorView"
+<view class="com.android.contacts.editor.PhotoEditorView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <FrameLayout
- android:layout_width="72dp"
- android:layout_height="72dp"
- >
- <ImageView
- android:id="@+id/photo"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:cropToPadding="true"
- android:scaleType="centerCrop"
- android:gravity="start"
- />
- <View
- android:id="@+id/frame"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:clickable="true"
- android:focusable="true"
- android:contentDescription="@string/description_contact_photo"
- android:background="?android:attr/selectableItemBackground"
- />
- </FrameLayout>
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/kind_icon"
+ android:src="@drawable/ic_camera_alt_black_24dp"
+ android:layout_marginTop="8dp"
+ android:contentDescription="@string/photo_section"
+ style="@style/EditKindIconStyle" />
+
+ <!-- Needs 10dp of top padding, in order get a total of 32dp of padding between this view
+ and the previous DataKindSection. Note that EditTexts in other editor.xml files have this
+ padding built in. Similarly, we need to add 4dp of start margin to make up for the padding
+ that an EditText would have in this image's place. -->
<ImageView
- android:id="@+id/photo_triangle_affordance"
- android:src="@drawable/account_spinner_icon"
+ android:id="@+id/photo"
+ android:layout_width="72dip"
+ android:layout_height="72dip"
+ android:cropToPadding="true"
+ android:scaleType="centerCrop"
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="4dp"
+ android:contentDescription="@string/description_contact_photo"
+ android:layout_marginBottom="@dimen/editor_padding_below_photo"
+ android:gravity="start" />
+
+ <!-- We want 16dp for the effective marginStart. So we set 12dp, since the private
+ @android:dimen/control_inset_material already includes 4dp of padding. -->
+ <LinearLayout
+ android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- />
+ android:layout_marginStart="12dp" >
+
+ <!-- The values applied to this button are complicated:
+ 1) We want 16dp internal padding in the button. The background drawable is inset
+ by private @android:dimen/button_inset_horizontal_material=4dp. Therefore,
+ we need paddingStart/End of 20dp.
+ 2) In order to leave enough room for the 32dp RadioButton, this can only be 46dp.
+ This is 2dp less than the default touch target size.
+ 3) This button will appear to be offset by the private
+ @android:dimen/button_inset_vertical_material amount. Therefore, in order to achieve
+ 10dp of apparent top margin, we only need to apply 4dp. -->
+ <Button
+ android:id="@+id/change_button"
+ android:layout_width="wrap_content"
+ android:layout_height="46dp"
+ android:textSize="@dimen/editor_form_text_size"
+ android:textColor="@color/primary_text_color"
+ android:layout_marginTop="4dp"
+ android:paddingStart="20dp"
+ android:paddingEnd="20dp"
+ android:text="@string/change_photo" />
+
+ <!-- Don't explicitly set the layout_height in case we need to rely on text wrapping.
+ For one line, we can expect the height to be 32dp with 16dp text size. -->
+ <RadioButton
+ android:id="@+id/primary_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="48dp"
+ android:textSize="@dimen/editor_form_text_size"
+ android:text="@string/primary_photo" />
+ </LinearLayout>
</view>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 53855ba05..df01b1a0a 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -58,10 +58,16 @@
<dimen name="editor_kind_icon_size">24dp</dimen>
<!-- Total width of data-kind icon, including its start and end padding -->
- <dimen name="editor_kind_icon_total_width">72dp</dimen>
+ <dimen name="editor_kind_icon_total_width">68dp</dimen>
- <!-- Padding below every editor view, such as LabeledEditorView -->
- <dimen name="editor_padding_between_editor_views">24dp</dimen>
+ <!-- Padding below every editor view, such as LabeledEditorView. This value is chosen
+ to give 32dp of apparent padding between EditText's in the Raw Contact Editor. -->
+ <dimen name="editor_padding_between_editor_views">20dp</dimen>
+
+ <!-- Padding below the photo editor. This value is larger than
+ editor_padding_between_editor_views, since ImageView's don't have space between the bottom
+ of their visual bottom, like an EditText does. -->
+ <dimen name="editor_padding_below_photo">22dp</dimen>
<!-- Width of the Type-Label in the Editor -->
<dimen name="editor_type_label_width">150dip</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bd0391746..0ce47866b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -373,9 +373,6 @@
<!-- String describing which account a contact came from when editing it -->
<string name="from_account_format"><xliff:g id="source" example="user@gmail.com">%1$s</xliff:g></string>
- <!-- Checkbox asking the user if they want to display a particular photo for a contact -->
- <string name="use_photo_as_primary">Use this photo</string>
-
<!-- Text used to explain that a contact cannot be edited from the People application since the data is read only [CHAR LIMIT=40] -->
<string name="contact_read_only">Not editable from this app.</string>
@@ -438,6 +435,15 @@
<!-- The button to add an organization field to a contact in the Raw Contact Editor [CHAR LIMIT=15] -->
<string name="group_edit_field_hint_text">Group name</string>
+ <!-- Button used for changing a photo in the Raw Contact Editor [CHAR LIMIT=15] -->
+ <string name="change_photo">Change</string>
+
+ <!-- Content description for the camera icon beside the photo section in the Raw Contact Editor [CHAR LIMIT=NONE] -->
+ <string name="photo_section">Photo section</string>
+
+ <!-- RadioButton that determines whether a raw contact's photo should be used for the entire contact [CHAR LIMIT=15] -->
+ <string name="primary_photo">Primary photo</string>
+
<!-- String describing the Star/Favorite checkbox
Used by AccessibilityService to announce the purpose of the view.
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 1261a7a25..06f1afe76 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -29,6 +29,7 @@
<style name="EditorActivityTheme" parent="@style/PeopleTheme">
<item name="android:listViewStyle">@style/ListViewStyle</item>
<item name="android:actionBarStyle">@style/EditorActionBarStyle</item>
+ <item name="android:colorButtonNormal">@color/background_primary</item>
</style>
<style name="Theme">
@@ -317,7 +318,9 @@
<item name="android:layout_height">24dp</item>
<item name="android:tint">@color/editor_icon_color</item>
<item name="android:layout_marginStart">16dp</item>
- <item name="android:layout_marginEnd">32dp</item>
+ <!-- We want 32dp of padding between these icon's and EditText's. Since EditText's have
+ 4dp of starting padding built in, we set this as 28dp. -->
+ <item name="android:layout_marginEnd">28dp</item>
<item name="android:layout_marginTop">@dimen/editor_kind_icon_top_margin</item>
</style>
</resources>