Merge "Bump up AOSP Contacts app version to 1.5.10." into ub-contactsdialer-f-dev
diff --git a/res/layout/empty_group_view.xml b/res/layout/empty_group_view.xml
index 76b06d7..cc583bd 100644
--- a/res/layout/empty_group_view.xml
+++ b/res/layout/empty_group_view.xml
@@ -23,7 +23,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="@dimen/empty_group_view_text_padding_top"
- android:paddingBottom="@dimen/empty_group_view_text_padding_bottom"
android:text="@string/emptyGroup"
style="@style/EmptyStateTextStyle"/>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index e66ab0d..7763fd5 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -25,7 +25,6 @@
<!-- 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-->
+ <!-- Top 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 f6e9ef6..83bd77f 100644
--- a/res/values-land/integers.xml
+++ b/res/values-land/integers.xml
@@ -17,6 +17,6 @@
<!-- 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>
+ <!-- Top margin ratio for the image for empty group view -->
+ <integer name="empty_group_view_image_margin_divisor">12</integer>
</resources>
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
index b5db99d..a8e37e8 100644
--- a/res/values-sw600dp-land/dimens.xml
+++ b/res/values-sw600dp-land/dimens.xml
@@ -22,7 +22,6 @@
<!-- 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-->
+ <!-- Top 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 f5f713a..394abdd 100644
--- a/res/values-sw600dp-land/integers.xml
+++ b/res/values-sw600dp-land/integers.xml
@@ -21,6 +21,6 @@
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>
+ <!-- Top margin ratio for the image for empty group view -->
+ <integer name="empty_group_view_image_margin_divisor">8</integer>
</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 349d628..b6d1aa9 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -48,6 +48,6 @@
<!-- End margin of edit group title -->
<dimen name="edit_group_end_margin">80dp</dimen>
- <!-- Top padding for the image for empty group view-->
+ <!-- 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-sw600dp/integers.xml b/res/values-sw600dp/integers.xml
new file mode 100644
index 0000000..4eb0061
--- /dev/null
+++ b/res/values-sw600dp/integers.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <!-- Top margin ratio for the image for empty group view -->
+ <integer name="empty_group_view_image_margin_divisor">4</integer>
+</resources>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index f9111d3..6c411ce 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -276,15 +276,14 @@
<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-->
+ <!-- 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-->
+ <!-- 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-->
+ <!-- Top 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>
<!-- 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 26e72a5..136aa33 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -28,6 +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>
+ <!-- Top margin ratio for the image for empty group view -->
+ <integer name="empty_group_view_image_margin_divisor">6</integer>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ed97687..709d002 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -420,11 +420,10 @@
</style>
<!-- Add contacts button style for empty states. -->
- <style name="AddContactsButtonStyle" parent="android:Widget.Holo.Button.Borderless">
+ <style name="AddContactsButtonStyle" parent="@style/Widget.AppCompat.Button.Borderless">
<item name="android:textSize">16sp</item>
<item name="android:textColor">#0288d1</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textAllCaps">true</item>
- <item name="android:minHeight">0dp</item>
</style>
</resources>
diff --git a/src/com/android/contacts/group/GroupMembersFragment.java b/src/com/android/contacts/group/GroupMembersFragment.java
index 276a7e9..f2b89e0 100644
--- a/src/com/android/contacts/group/GroupMembersFragment.java
+++ b/src/com/android/contacts/group/GroupMembersFragment.java
@@ -19,14 +19,11 @@
import android.app.LoaderManager.LoaderCallbacks;
import android.content.CursorLoader;
import android.content.Loader;
-import android.content.res.Configuration;
-import android.content.res.Resources;
import android.database.Cursor;
import android.database.CursorWrapper;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract.Contacts;
-import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -363,16 +360,13 @@
protected View inflateView(LayoutInflater inflater, ViewGroup container) {
final View view = inflater.inflate(R.layout.contact_list_content, /* root */ null);
final View emptyGroupView = inflater.inflate(R.layout.empty_group_view, null);
+
final ImageView image = (ImageView) emptyGroupView.findViewById(R.id.empty_group_image);
final LinearLayout.LayoutParams params =
(LinearLayout.LayoutParams) image.getLayoutParams();
-
- final Resources resources = getContext().getResources();
- final DisplayMetrics metrics = resources.getDisplayMetrics();
- final int height = metrics.heightPixels;
-
- params.setMargins(0,
- height / getResources().getInteger(R.integer.empty_group_view_image_margin), 0, 0);
+ final int screenHeight = getResources().getDisplayMetrics().heightPixels;
+ params.setMargins(0, screenHeight /
+ getResources().getInteger(R.integer.empty_group_view_image_margin_divisor), 0, 0);
params.gravity = Gravity.CENTER_HORIZONTAL;
image.setLayoutParams(params);