diff options
author | Tobias Thierer <tobiast@google.com> | 2017-06-09 14:16:05 +0000 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2017-06-09 14:16:05 +0000 |
commit | cded3beaf28a703e1ef8f71bbc6836e6806c3736 (patch) | |
tree | c1b5e8199b5996fc848e7455d04126b9cdbb3c39 /java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java | |
parent | c67d658e7daa453fe9ad9fd1a37f81eaf2048c44 (diff) | |
download | android_packages_apps_Dialer-cded3beaf28a703e1ef8f71bbc6836e6806c3736.tar.gz android_packages_apps_Dialer-cded3beaf28a703e1ef8f71bbc6836e6806c3736.tar.bz2 android_packages_apps_Dialer-cded3beaf28a703e1ef8f71bbc6836e6806c3736.zip |
Revert "Update AOSP Dialer source from internal google3 repository at cl/158012278. am: 91ce7d2a47"
This reverts commit c67d658e7daa453fe9ad9fd1a37f81eaf2048c44.
Reason for revert: This CL broke the sailfish-userdebug_javac-all target on master.
Change-Id: I9b54333a654c00154ca84f4ece84bea4f07cc19b
Diffstat (limited to 'java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java b/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java index 04927cf7a..537f488d5 100644 --- a/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java +++ b/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java @@ -19,7 +19,6 @@ package com.android.dialer.app.list; import android.content.Context; import android.content.res.Resources; import android.database.Cursor; -import android.graphics.drawable.Drawable; import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; @@ -30,6 +29,7 @@ import com.android.contacts.common.list.PhoneNumberListAdapter; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.dialer.app.R; import com.android.dialer.location.GeoUtil; +import com.android.dialer.util.CallUtil; /** * {@link PhoneNumberListAdapter} with the following added shortcuts, that are displayed as list @@ -50,6 +50,7 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { private final boolean[] mShortcutEnabled = new boolean[SHORTCUT_COUNT]; private final BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); + private final boolean mVideoCallingEnabled; private final String mCountryIso; private String mFormattedQueryString; @@ -58,6 +59,7 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { super(context); mCountryIso = GeoUtil.getCurrentCountryIso(context); + mVideoCallingEnabled = CallUtil.isVideoEnabled(context); } @Override @@ -108,7 +110,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { return convertView; } else { final ContactListItemView v = - new ContactListItemView(getContext(), null, mIsImsVideoEnabled); + new ContactListItemView( + getContext(), null, mVideoCallingEnabled, isCallAndShareEnabled()); assignShortcutToView(v, shortcutType); return v; } @@ -122,7 +125,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { Context context, int partition, Cursor cursor, int position, ViewGroup parent) { final ContactListItemView view = super.newView(context, partition, cursor, position, parent); - view.setSupportVideoCallIcon(mIsImsVideoEnabled); + view.setSupportVideoCallIcon(mVideoCallingEnabled); + view.setSupportCallAndShareIcon(isCallAndShareEnabled()); return view; } @@ -167,7 +171,7 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { private void assignShortcutToView(ContactListItemView v, int shortcutType) { final CharSequence text; - final Drawable drawable; + final int drawableId; final Resources resources = getContext().getResources(); final String number = getFormattedQueryString(); switch (shortcutType) { @@ -177,39 +181,34 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { resources, R.string.search_shortcut_call_number, mBidiFormatter.unicodeWrap(number, TextDirectionHeuristics.LTR)); - drawable = getContext().getResources().getDrawable(R.drawable.quantum_ic_call_vd_theme_24); + drawableId = R.drawable.ic_search_phone; break; case SHORTCUT_CREATE_NEW_CONTACT: text = resources.getString(R.string.search_shortcut_create_new_contact); - drawable = - getContext().getResources().getDrawable(R.drawable.quantum_ic_person_add_vd_theme_24); - drawable.setAutoMirrored(true); + drawableId = R.drawable.ic_search_add_contact; break; case SHORTCUT_ADD_TO_EXISTING_CONTACT: text = resources.getString(R.string.search_shortcut_add_to_contact); - drawable = - getContext().getResources().getDrawable(R.drawable.quantum_ic_person_add_vd_theme_24); + drawableId = R.drawable.quantum_ic_person_white_24; break; case SHORTCUT_SEND_SMS_MESSAGE: text = resources.getString(R.string.search_shortcut_send_sms_message); - drawable = - getContext().getResources().getDrawable(R.drawable.quantum_ic_message_vd_theme_24); + drawableId = R.drawable.quantum_ic_message_white_24; break; case SHORTCUT_MAKE_VIDEO_CALL: text = resources.getString(R.string.search_shortcut_make_video_call); - drawable = - getContext().getResources().getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24); + drawableId = R.drawable.quantum_ic_videocam_white_24; break; case SHORTCUT_BLOCK_NUMBER: text = resources.getString(R.string.search_shortcut_block_number); - drawable = - getContext().getResources().getDrawable(R.drawable.ic_not_interested_googblue_24dp); + drawableId = R.drawable.ic_not_interested_googblue_24dp; break; default: throw new IllegalArgumentException("Invalid shortcut type"); } - v.setDrawable(drawable); + v.setDrawableResource(drawableId); v.setDisplayName(text); + v.setPhotoPosition(super.getPhotoPosition()); v.setAdjustSelectionBoundsEnabled(false); } |