From 0a4327e6bfeedc23ddefb4df9f6e8041ebc87b59 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 10 Jun 2014 15:09:46 -0700 Subject: Update empty list assets and text. - Add new assets for empty lists, delete old no favorites banner. - Adapt phone_no_favorites.xml into generic container shown when a list is empty. - Add helper to DialerUtils to configure empty list view with a provided image and message. - Configure empty list view in relevant fragments. - Some text styling/margin/padding to get things to spec. A minimum height is used on the message so that the icons and text will be laid out in a consistent manner. Bug: 15513399 Change-Id: I52337a4544065a991d3b8084d96b01516a458c42 --- res/drawable-hdpi/empty_call_log.png | Bin 0 -> 3538 bytes res/drawable-hdpi/empty_contacts.png | Bin 0 -> 2461 bytes res/drawable-hdpi/empty_speed_dial.png | Bin 0 -> 6041 bytes res/drawable-hdpi/no_favorites_banner.png | Bin 7788 -> 0 bytes res/drawable-mdpi/empty_call_log.png | Bin 0 -> 2463 bytes res/drawable-mdpi/empty_contacts.png | Bin 0 -> 1778 bytes res/drawable-mdpi/empty_speed_dial.png | Bin 0 -> 4119 bytes res/drawable-mdpi/no_favorites_banner.png | Bin 5129 -> 0 bytes res/drawable-xhdpi/empty_call_log.png | Bin 0 -> 4860 bytes res/drawable-xhdpi/empty_contacts.png | Bin 0 -> 3352 bytes res/drawable-xhdpi/empty_speed_dial.png | Bin 0 -> 8689 bytes res/drawable-xhdpi/no_favorites_banner.png | Bin 11886 -> 0 bytes res/drawable-xxhdpi/empty_call_log.png | Bin 0 -> 6226 bytes res/drawable-xxhdpi/empty_contacts.png | Bin 0 -> 3686 bytes res/drawable-xxhdpi/empty_speed_dial.png | Bin 0 -> 11039 bytes res/drawable-xxhdpi/no_favorites_banner.png | Bin 16342 -> 0 bytes res/layout/call_log_fragment.xml | 14 ++--- res/layout/empty_list_view.xml | 56 ++++++++++++++++++++ res/layout/phone_no_favorites.xml | 57 --------------------- res/layout/show_all_contacts_fragment.xml | 7 +++ res/layout/speeddial_fragment.xml | 9 ++-- res/values/colors.xml | 3 +- res/values/dimens.xml | 10 ++-- .../android/dialer/calllog/CallLogFragment.java | 17 +++--- .../android/dialer/list/AllContactsFragment.java | 9 +++- src/com/android/dialer/list/SpeedDialFragment.java | 7 ++- src/com/android/dialer/util/DialerUtils.java | 25 +++++++++ 27 files changed, 129 insertions(+), 85 deletions(-) create mode 100644 res/drawable-hdpi/empty_call_log.png create mode 100644 res/drawable-hdpi/empty_contacts.png create mode 100644 res/drawable-hdpi/empty_speed_dial.png delete mode 100644 res/drawable-hdpi/no_favorites_banner.png create mode 100644 res/drawable-mdpi/empty_call_log.png create mode 100644 res/drawable-mdpi/empty_contacts.png create mode 100644 res/drawable-mdpi/empty_speed_dial.png delete mode 100644 res/drawable-mdpi/no_favorites_banner.png create mode 100644 res/drawable-xhdpi/empty_call_log.png create mode 100644 res/drawable-xhdpi/empty_contacts.png create mode 100644 res/drawable-xhdpi/empty_speed_dial.png delete mode 100644 res/drawable-xhdpi/no_favorites_banner.png create mode 100644 res/drawable-xxhdpi/empty_call_log.png create mode 100644 res/drawable-xxhdpi/empty_contacts.png create mode 100644 res/drawable-xxhdpi/empty_speed_dial.png delete mode 100644 res/drawable-xxhdpi/no_favorites_banner.png create mode 100644 res/layout/empty_list_view.xml delete mode 100644 res/layout/phone_no_favorites.xml diff --git a/res/drawable-hdpi/empty_call_log.png b/res/drawable-hdpi/empty_call_log.png new file mode 100644 index 000000000..d6f6daaab Binary files /dev/null and b/res/drawable-hdpi/empty_call_log.png differ diff --git a/res/drawable-hdpi/empty_contacts.png b/res/drawable-hdpi/empty_contacts.png new file mode 100644 index 000000000..d3c0378f5 Binary files /dev/null and b/res/drawable-hdpi/empty_contacts.png differ diff --git a/res/drawable-hdpi/empty_speed_dial.png b/res/drawable-hdpi/empty_speed_dial.png new file mode 100644 index 000000000..3e9232fc9 Binary files /dev/null and b/res/drawable-hdpi/empty_speed_dial.png differ diff --git a/res/drawable-hdpi/no_favorites_banner.png b/res/drawable-hdpi/no_favorites_banner.png deleted file mode 100644 index a4b09c0a9..000000000 Binary files a/res/drawable-hdpi/no_favorites_banner.png and /dev/null differ diff --git a/res/drawable-mdpi/empty_call_log.png b/res/drawable-mdpi/empty_call_log.png new file mode 100644 index 000000000..3cd59b35b Binary files /dev/null and b/res/drawable-mdpi/empty_call_log.png differ diff --git a/res/drawable-mdpi/empty_contacts.png b/res/drawable-mdpi/empty_contacts.png new file mode 100644 index 000000000..2ce7eae37 Binary files /dev/null and b/res/drawable-mdpi/empty_contacts.png differ diff --git a/res/drawable-mdpi/empty_speed_dial.png b/res/drawable-mdpi/empty_speed_dial.png new file mode 100644 index 000000000..98152e0d3 Binary files /dev/null and b/res/drawable-mdpi/empty_speed_dial.png differ diff --git a/res/drawable-mdpi/no_favorites_banner.png b/res/drawable-mdpi/no_favorites_banner.png deleted file mode 100644 index ac080b9e1..000000000 Binary files a/res/drawable-mdpi/no_favorites_banner.png and /dev/null differ diff --git a/res/drawable-xhdpi/empty_call_log.png b/res/drawable-xhdpi/empty_call_log.png new file mode 100644 index 000000000..14ec04ba1 Binary files /dev/null and b/res/drawable-xhdpi/empty_call_log.png differ diff --git a/res/drawable-xhdpi/empty_contacts.png b/res/drawable-xhdpi/empty_contacts.png new file mode 100644 index 000000000..65b1de333 Binary files /dev/null and b/res/drawable-xhdpi/empty_contacts.png differ diff --git a/res/drawable-xhdpi/empty_speed_dial.png b/res/drawable-xhdpi/empty_speed_dial.png new file mode 100644 index 000000000..a3a76751b Binary files /dev/null and b/res/drawable-xhdpi/empty_speed_dial.png differ diff --git a/res/drawable-xhdpi/no_favorites_banner.png b/res/drawable-xhdpi/no_favorites_banner.png deleted file mode 100644 index bae4e99b8..000000000 Binary files a/res/drawable-xhdpi/no_favorites_banner.png and /dev/null differ diff --git a/res/drawable-xxhdpi/empty_call_log.png b/res/drawable-xxhdpi/empty_call_log.png new file mode 100644 index 000000000..501d7f1e2 Binary files /dev/null and b/res/drawable-xxhdpi/empty_call_log.png differ diff --git a/res/drawable-xxhdpi/empty_contacts.png b/res/drawable-xxhdpi/empty_contacts.png new file mode 100644 index 000000000..407d78c9c Binary files /dev/null and b/res/drawable-xxhdpi/empty_contacts.png differ diff --git a/res/drawable-xxhdpi/empty_speed_dial.png b/res/drawable-xxhdpi/empty_speed_dial.png new file mode 100644 index 000000000..fb2ea5f15 Binary files /dev/null and b/res/drawable-xxhdpi/empty_speed_dial.png differ diff --git a/res/drawable-xxhdpi/no_favorites_banner.png b/res/drawable-xxhdpi/no_favorites_banner.png deleted file mode 100644 index 0e2a4fa3b..000000000 Binary files a/res/drawable-xxhdpi/no_favorites_banner.png and /dev/null differ diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml index fb7ed2a16..bb50730e8 100644 --- a/res/layout/call_log_fragment.xml +++ b/res/layout/call_log_fragment.xml @@ -72,14 +72,14 @@ android:divider="@null" android:nestedScrollingEnabled="true" /> - + layout="@layout/empty_list_view" + android:visibility="gone"/> + + diff --git a/res/layout/empty_list_view.xml b/res/layout/empty_list_view.xml new file mode 100644 index 000000000..be4dbf5af --- /dev/null +++ b/res/layout/empty_list_view.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + diff --git a/res/layout/phone_no_favorites.xml b/res/layout/phone_no_favorites.xml deleted file mode 100644 index b95afd197..000000000 --- a/res/layout/phone_no_favorites.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - diff --git a/res/layout/show_all_contacts_fragment.xml b/res/layout/show_all_contacts_fragment.xml index 91fb3228c..fe188bddd 100644 --- a/res/layout/show_all_contacts_fragment.xml +++ b/res/layout/show_all_contacts_fragment.xml @@ -46,4 +46,11 @@ android:nestedScrollingEnabled="true" /> + + diff --git a/res/layout/speeddial_fragment.xml b/res/layout/speeddial_fragment.xml index f025e6179..58a7b2410 100644 --- a/res/layout/speeddial_fragment.xml +++ b/res/layout/speeddial_fragment.xml @@ -45,13 +45,10 @@ + diff --git a/res/values/colors.xml b/res/values/colors.xml index 9264e3093..2bc1b5794 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -69,8 +69,7 @@ #4d4d4d - - #777777 + #b2b2b2 #ffffff diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 3533abd29..a01be9c0d 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -96,6 +96,10 @@ 64dp + 43dp + 2dp + + 107dp 8dp @@ -119,10 +123,6 @@ 8dp 2dp - - 43dp - 2dp - 8dp 40dp + + 16sp diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index ad86e240d..4f5c35518 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -40,6 +40,7 @@ import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.View.OnClickListener; import android.view.ViewGroup.LayoutParams; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -50,6 +51,7 @@ import com.android.contacts.common.util.PhoneNumberHelper; import com.android.contacts.common.util.ViewUtil; import com.android.dialer.R; import com.android.dialer.list.ListsFragment.HostInterface; +import com.android.dialer.util.DialerUtils; import com.android.dialer.util.EmptyLoader; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelper.StatusMessage; @@ -298,9 +300,11 @@ public class CallLogFragment extends ListFragment @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - updateEmptyMessage(mCallTypeFilter); + getListView().setEmptyView(view.findViewById(R.id.empty_list_view)); getListView().setItemsCanFocus(true); maybeAddFooterView(); + + updateEmptyMessage(mCallTypeFilter); } /** @@ -413,22 +417,23 @@ public class CallLogFragment extends ListFragment } private void updateEmptyMessage(int filterType) { - final String message; + final int messageId; switch (filterType) { case Calls.MISSED_TYPE: - message = getString(R.string.recentMissed_empty); + messageId = R.string.recentMissed_empty; break; case Calls.VOICEMAIL_TYPE: - message = getString(R.string.recentVoicemails_empty); + messageId = R.string.recentVoicemails_empty; break; case CallLogQueryHandler.CALL_TYPE_ALL: - message = getString(R.string.recentCalls_empty); + messageId = R.string.recentCalls_empty; break; default: throw new IllegalArgumentException("Unexpected filter type in CallLogFragment: " + filterType); } - ((TextView) getListView().getEmptyView()).setText(message); + DialerUtils.configureEmptyListView( + getListView().getEmptyView(), R.drawable.empty_call_log, messageId, getResources()); } public void callSelectedEntry() { diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java index a796680e9..ddcb15df4 100644 --- a/src/com/android/dialer/list/AllContactsFragment.java +++ b/src/com/android/dialer/list/AllContactsFragment.java @@ -23,8 +23,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; -import android.widget.ListView; -import android.widget.QuickContactBadge; import com.android.contacts.common.list.ContactEntryListAdapter; import com.android.contacts.common.list.ContactEntryListFragment; @@ -32,6 +30,7 @@ import com.android.contacts.common.list.ContactListFilter; import com.android.contacts.common.list.DefaultContactListAdapter; import com.android.contacts.common.util.ViewUtil; import com.android.dialer.R; +import com.android.dialer.util.DialerUtils; /** * Fragments to show all contacts with phone numbers. @@ -50,6 +49,12 @@ public class AllContactsFragment extends ContactEntryListFragment