diff options
| author | Andrew Lee <anwlee@google.com> | 2014-06-11 10:26:49 -0700 |
|---|---|---|
| committer | Andrew Lee <anwlee@google.com> | 2014-06-11 10:26:49 -0700 |
| commit | 8466615413eb7d0feb23ab33288caac104dfd41e (patch) | |
| tree | cf5844135f19920c3e6611700e2b5c8d435df12c /src/com/android/dialer/util | |
| parent | 2bd4f7a892e22d41f4055027c7f0b21b3b4db03b (diff) | |
| parent | 0a4327e6bfeedc23ddefb4df9f6e8041ebc87b59 (diff) | |
| download | packages_apps_Dialer-8466615413eb7d0feb23ab33288caac104dfd41e.tar.gz packages_apps_Dialer-8466615413eb7d0feb23ab33288caac104dfd41e.tar.bz2 packages_apps_Dialer-8466615413eb7d0feb23ab33288caac104dfd41e.zip | |
resolved conflicts for merge of 0a4327e6 to master
Change-Id: I98b24e23d9d3283223f8db0c58930977b7a8fd35
Diffstat (limited to 'src/com/android/dialer/util')
| -rw-r--r-- | src/com/android/dialer/util/DialerUtils.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java index 584caa9a1..f1dfe20e0 100644 --- a/src/com/android/dialer/util/DialerUtils.java +++ b/src/com/android/dialer/util/DialerUtils.java @@ -21,8 +21,12 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.content.res.Resources; import android.net.Uri; import android.provider.Telephony; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; import android.widget.Toast; import com.android.contacts.common.CallUtil; @@ -82,4 +86,25 @@ public class DialerUtils { } return null; } + + /** + * Sets the image asset and text for an empty list view (see empty_list_view.xml). + * + * @param emptyListView The empty list view. + * @param imageResId The resource id for the drawable to set as the image. + * @param strResId The resource id for the string to set as the message. + * @param res The resources to obtain the image and string from. + */ + public static void configureEmptyListView( + View emptyListView, int imageResId, int strResId, Resources res) { + ImageView emptyListViewImage = + (ImageView) emptyListView.findViewById(R.id.emptyListViewImage); + + emptyListViewImage.setImageDrawable(res.getDrawable(imageResId)); + emptyListViewImage.setContentDescription(res.getString(strResId)); + + TextView emptyListViewMessage = + (TextView) emptyListView.findViewById(R.id.emptyListViewMessage); + emptyListViewMessage.setText(res.getString(strResId)); + } } |
