diff options
author | Brian Attwell <brianattwell@google.com> | 2014-12-09 14:23:02 -0800 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-12-09 22:27:48 +0000 |
commit | ba4d58427d46bae91326529e5dc5a8bf867ef94e (patch) | |
tree | 5b69710e7e450389519b5c6fa21015d05544f66f | |
parent | 97b5a683a1abc4f17eb86d40e5270ab342edda05 (diff) | |
download | packages_apps_Contacts-ba4d58427d46bae91326529e5dc5a8bf867ef94e.tar.gz packages_apps_Contacts-ba4d58427d46bae91326529e5dc5a8bf867ef94e.tar.bz2 packages_apps_Contacts-ba4d58427d46bae91326529e5dc5a8bf867ef94e.zip |
Switch readonly editor to textviews
Switch the readonly editor to use TextViews instead of EditTexts
again. UX decided it liked this better.
Screenshot: go/ba_screen_captures/contacts/b18004959_edit_screen_material/readonly_editor_textview.png
Bug: 18004959
Change-Id: Ic70639fb10eee1688cb622f8f07ab0463a206a28
-rw-r--r-- | res/layout/item_photo_editor_readonly.xml | 17 | ||||
-rw-r--r-- | res/layout/item_read_only_field.xml | 9 | ||||
-rw-r--r-- | res/layout/raw_contact_readonly_editor_view.xml | 16 | ||||
-rw-r--r-- | res/values/dimens.xml | 8 |
4 files changed, 28 insertions, 22 deletions
diff --git a/res/layout/item_photo_editor_readonly.xml b/res/layout/item_photo_editor_readonly.xml index 1e998098f..edb6f6162 100644 --- a/res/layout/item_photo_editor_readonly.xml +++ b/res/layout/item_photo_editor_readonly.xml @@ -24,24 +24,23 @@ <ImageView android:id="@+id/kind_icon" android:src="@drawable/ic_camera_alt_black_24dp" - android:layout_marginTop="8dp" + android:layout_marginTop="0dp" android:contentDescription="@string/header_photo_entry" 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. --> + <!-- We need to add 2dp of start margin to make up for the padding that a TextView would + have in this image's place. We add 2dp of top margin, so that icon drawable is a little + below the top of this ImageView. --> <ImageView 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:layout_marginTop="2dp" + android:layout_marginStart="2dp" android:contentDescription="@string/description_contact_photo" - android:layout_marginBottom="@dimen/editor_padding_below_photo" + android:layout_marginBottom="@dimen/editor_padding_around_read_only_photo_editor" android:gravity="start" /> @@ -53,7 +52,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/editor_delete_button_width" - android:layout_marginTop="10dp" + android:layout_marginTop="2dp" android:textSize="@dimen/editor_form_text_size" android:text="@string/primary_photo" /> </view> diff --git a/res/layout/item_read_only_field.xml b/res/layout/item_read_only_field.xml index 7a7854b8c..ec75e1a71 100644 --- a/res/layout/item_read_only_field.xml +++ b/res/layout/item_read_only_field.xml @@ -19,11 +19,12 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/editor_delete_button_width" - android:layout_marginBottom="@dimen/editor_padding_between_editor_views" + android:layout_marginBottom="@dimen/editor_padding_between_read_only_editor_views" android:orientation="horizontal"> <ImageView android:id="@+id/kind_icon" + android:layout_marginTop="2dp" style="@style/EditKindIconStyle" /> <LinearLayout @@ -32,24 +33,22 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <EditText + <TextView android:id="@+id/data" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="@dimen/editor_min_line_item_height" android:textSize="@dimen/editor_form_text_size" android:textColor="?android:attr/textColorSecondary" android:singleLine="true" android:saveEnabled="false" android:enabled="false"/> - <EditText + <TextView android:id="@+id/type" android:layout_width="@dimen/editor_type_label_width" android:layout_height="wrap_content" android:textSize="@dimen/editor_form_text_size" android:textColor="?android:attr/textColorSecondary" - android:minHeight="@dimen/editor_min_line_item_height" android:singleLine="true" android:saveEnabled="false" android:enabled="false"/> diff --git a/res/layout/raw_contact_readonly_editor_view.xml b/res/layout/raw_contact_readonly_editor_view.xml index f85971f9c..99ed2366f 100644 --- a/res/layout/raw_contact_readonly_editor_view.xml +++ b/res/layout/raw_contact_readonly_editor_view.xml @@ -29,26 +29,26 @@ android:layout_height="wrap_content" android:orientation="vertical" > - <!-- Want 16dp of apparent top padding. Since EditText has 10dp of inset/padding built in, - only set marginTop=6dp. --> + <!-- Want 16dp of apparent top padding. Since TextView has 4dp of inset/padding built in, + only set marginTop=12dp. --> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="@dimen/editor_min_line_item_height" - android:layout_marginBottom="@dimen/editor_padding_between_editor_views" - android:layout_marginTop="6dp" + android:layout_marginBottom="@dimen/editor_padding_around_read_only_photo_editor" + android:layout_marginTop="12dp" android:orientation="horizontal"> <ImageView android:id="@+id/kind_icon" + android:layout_marginTop="2dp" android:src="@drawable/ic_person_black_24dp" android:contentDescription="@string/header_name_entry" style="@style/EditKindIconStyle" /> - <EditText + <TextView android:id="@+id/read_only_name" android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:layout_marginRight="@dimen/editor_delete_button_width" android:singleLine="true" android:textSize="@dimen/editor_form_text_size" @@ -66,7 +66,7 @@ android:text="@string/edit_contact" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="10dp" + android:layout_marginTop="4dp" android:layout_marginBottom="@dimen/editor_padding_below_photo" android:layout_marginEnd="13dip" android:layout_marginStart="13dip"/> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index d9e541af2..1626ce982 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -72,6 +72,14 @@ 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 every readonly editor view. This value is chosen to give 32dp of apparent padding + between TextView's in the readonly Raw Contact Editor. --> + <dimen name="editor_padding_between_read_only_editor_views">25dp</dimen> + + <!-- Padding above and below the photo editor. This value is chosen to give 32dp of apparent + padding between TextView's and the photo's ImageView. --> + <dimen name="editor_padding_around_read_only_photo_editor">28dp</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. --> |