Set empty label view to new spec
Bug 30420455
Change-Id: I6406944af849457e90027aa9253bb417ad9df18c
diff --git a/res/layout/empty_group_view.xml b/res/layout/empty_group_view.xml
index 6f6e3a8..76b06d7 100644
--- a/res/layout/empty_group_view.xml
+++ b/res/layout/empty_group_view.xml
@@ -10,8 +10,9 @@
<ImageView
android:id="@+id/empty_group_image"
- android:layout_width="@dimen/empty_group_view_image_width"
- android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/empty_group_view_image_height"
+ android:paddingTop="@dimen/empty_group_view_image_padding_top"
android:scaleType="centerInside"
android:adjustViewBounds="true"
android:src="@drawable/label_empty"/>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 6404cf2..e66ab0d 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -19,9 +19,13 @@
<dimen name="dialpad_digits_margin_bottom">50dip</dimen>
<dimen name="editor_type_label_width">120dip</dimen>
- <!-- Top padding for the text for empty group view-->
- <dimen name="empty_group_view_text_padding_top">20dp</dimen>
+ <!-- Top padding for the image for empty group view-->
+ <dimen name="empty_group_view_image_padding_top">0dp</dimen>
- <!-- Width for the image for empty group view-->
- <dimen name="empty_group_view_image_width">176dp</dimen>
+ <!-- Height for the image for empty group view-->
+ <dimen name="empty_group_view_image_height">150dp</dimen>
+
+ <!-- Top and Bottom padding for the text for empty group view-->
+ <dimen name="empty_group_view_text_padding_top">14dp</dimen>
+ <dimen name="empty_group_view_text_padding_bottom">10dp</dimen>
</resources>
diff --git a/res/values-land/integers.xml b/res/values-land/integers.xml
index 3e7643d..f6e9ef6 100644
--- a/res/values-land/integers.xml
+++ b/res/values-land/integers.xml
@@ -16,4 +16,7 @@
<resources>
<!-- Number of lines the QuickContact title can have -->
<integer name="quickcontact_title_lines">2</integer>
+
+ <!-- Top margin ratio for the image for empty group view-->
+ <integer name="empty_group_view_image_margin">12</integer>
</resources>
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
index b4b5259..b5db99d 100644
--- a/res/values-sw600dp-land/dimens.xml
+++ b/res/values-sw600dp-land/dimens.xml
@@ -18,4 +18,11 @@
<dimen name="quick_contact_photo_container_height">180dip</dimen>
<dimen name="detail_contact_photo_size">192dip</dimen>
<dimen name="detail_contact_photo_margin">16dip</dimen>
+
+ <!-- Height for the image for empty group view-->
+ <dimen name="empty_group_view_image_height">180dp</dimen>
+
+ <!-- Top and Bottom padding for the text for empty group view-->
+ <dimen name="empty_group_view_text_padding_top">32dp</dimen>
+ <dimen name="empty_group_view_text_padding_bottom">16dp</dimen>
</resources>
diff --git a/res/values-sw600dp-land/integers.xml b/res/values-sw600dp-land/integers.xml
index 0ee0135..f5f713a 100644
--- a/res/values-sw600dp-land/integers.xml
+++ b/res/values-sw600dp-land/integers.xml
@@ -20,4 +20,7 @@
<!-- Layout weight of ListViews in PeopleActivityfor tile favorites list and all
contacts list in PeopleActivity -->
<integer name="contact_list_card_layout_weight">6</integer>
+
+ <!-- Top margin ratio for the image for empty group view-->
+ <integer name="empty_group_view_image_margin">8</integer>
</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 0d4d820..65f75e1 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -48,4 +48,7 @@
<!-- End margin of edit group title -->
<dimen name="edit_group_end_margin">80dp</dimen>
+
+ <!-- Top padding for the image for empty group view-->
+ <dimen name="empty_group_view_image_padding_top">0dp</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a3b097f..0a8d4f1 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -280,13 +280,16 @@
<dimen name="nav_activity_horizontal_margin">16dp</dimen>
<dimen name="nav_activity_vertical_margin">16dp</dimen>
+ <!-- Top padding for the image for empty group view-->
+ <dimen name="empty_group_view_image_padding_top">8dp</dimen>
+
+ <!-- Height for the image for empty group view-->
+ <dimen name="empty_group_view_image_height">180dp</dimen>
+
<!-- Top and Bottom padding for the text for empty group view-->
<dimen name="empty_group_view_text_padding_top">32dp</dimen>
<dimen name="empty_group_view_text_padding_bottom">16dp</dimen>
- <!-- Width for the image for empty group view-->
- <dimen name="empty_group_view_image_width">232dp</dimen>
-
<!-- End margin of edit group title -->
<dimen name="edit_group_end_margin">72dp</dimen>
diff --git a/res/values/integers.xml b/res/values/integers.xml
index c1d0e11..26e72a5 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -28,4 +28,6 @@
<!-- Fade in/out duration of search and selection -->
<integer name="action_bar_animation_duration">195</integer>
+ <!-- Top margin ratio for the image for empty group view-->
+ <integer name="empty_group_view_image_margin">6</integer>
</resources>
diff --git a/src/com/android/contacts/group/GroupMembersFragment.java b/src/com/android/contacts/group/GroupMembersFragment.java
index a187510..276a7e9 100644
--- a/src/com/android/contacts/group/GroupMembersFragment.java
+++ b/src/com/android/contacts/group/GroupMembersFragment.java
@@ -370,11 +370,9 @@
final Resources resources = getContext().getResources();
final DisplayMetrics metrics = resources.getDisplayMetrics();
final int height = metrics.heightPixels;
- if (resources.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
- params.setMargins(0, height / 8, 0, 0);
- } else {
- params.setMargins(0, height / 6, 0, 0);
- }
+
+ params.setMargins(0,
+ height / getResources().getInteger(R.integer.empty_group_view_image_margin), 0, 0);
params.gravity = Gravity.CENTER_HORIZONTAL;
image.setLayoutParams(params);