diff options
author | Andrew Lee <anwlee@google.com> | 2014-06-10 15:09:46 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-06-10 16:37:10 -0700 |
commit | 0a4327e6bfeedc23ddefb4df9f6e8041ebc87b59 (patch) | |
tree | 3fb090bcdcab68a17e4539b22241b4b28f9614c0 /src/com/android/dialer/calllog/CallLogFragment.java | |
parent | a6d7bd355e37674b4982525227bc969ea3a0c738 (diff) |
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
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogFragment.java')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 17 |
1 files changed, 11 insertions, 6 deletions
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() { |