diff options
author | Yorke Lee <yorkelee@google.com> | 2013-01-07 14:31:20 -0800 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-01-07 15:56:55 -0800 |
commit | 9639effec08d6e8fd31370a2e9abd7dc1df5b3f8 (patch) | |
tree | 0392f4fd7234825e1249da58a91c4c39b20d8600 /src | |
parent | e197811b1a96d722f2c41db0c840e54c604fa3ed (diff) |
Add a "No contacts" description to PhoneFavoriteFragment
Add an additional "No contacts" view to the sub-header view
returned by PhoneFavoriteMergedAdapter. This is required because
the empty view functionality provided by a simple list view does
not work because PhoneFavoriteMergedAdapter is a combination of
two adapters. This "No contacts" view provides the illusion of
an empty view for the 2nd adapter that displays all contacts
without phone numbers, even if the first adapter does contain
contacts.
Bug: 5522729
Change-Id: I7dcc4cd7b4b2b28fefea4be384de40318654e165
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteMergedAdapter.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteMergedAdapter.java b/src/com/android/dialer/list/PhoneFavoriteMergedAdapter.java index aa5ded58d..ba291a00f 100644 --- a/src/com/android/dialer/list/PhoneFavoriteMergedAdapter.java +++ b/src/com/android/dialer/list/PhoneFavoriteMergedAdapter.java @@ -218,6 +218,12 @@ public class PhoneFavoriteMergedAdapter extends BaseAdapter implements SectionIn mAccountFilterHeaderContainer.getPaddingTop(), mItemPaddingRight, mAccountFilterHeaderContainer.getPaddingBottom()); + + // Show a single "No Contacts" label under the "all" section account header + // if no contacts are displayed. + mAccountFilterHeaderContainer.findViewById( + R.id.contact_list_all_empty).setVisibility( + contactEntryListAdapterCount == 0 ? View.VISIBLE : View.GONE); return mAccountFilterHeaderContainer; } else { // For "all" section if (mContactEntryListAdapter.isLoading()) { // "All" section is being loaded. |