summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-06-05 13:35:02 -0700
committerEric Erfanian <erfanian@google.com>2017-06-07 20:44:54 +0000
commit91ce7d2a476bd04fe525049a37a2f8b2824e9724 (patch)
treeb9bbc285430ffb5363a70eb27e382c38f5a85b7a /java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java
parent75233ff03785f24789b32039ac2c208805b7e506 (diff)
downloadandroid_packages_apps_Dialer-91ce7d2a476bd04fe525049a37a2f8b2824e9724.tar.gz
android_packages_apps_Dialer-91ce7d2a476bd04fe525049a37a2f8b2824e9724.tar.bz2
android_packages_apps_Dialer-91ce7d2a476bd04fe525049a37a2f8b2824e9724.zip
Update AOSP Dialer source from internal google3 repository at
cl/158012278. Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/152373142 (4/06/2017) to cl/158012278 (6/05/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: I4d3f14b5140e2e51bead9497bc118a205b3ebe76
Diffstat (limited to 'java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java')
-rw-r--r--java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java b/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java
index 537f488d5..04927cf7a 100644
--- a/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java
+++ b/java/com/android/dialer/app/list/DialerPhoneNumberListAdapter.java
@@ -19,6 +19,7 @@ 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;
@@ -29,7 +30,6 @@ 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,7 +50,6 @@ 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;
@@ -59,7 +58,6 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter {
super(context);
mCountryIso = GeoUtil.getCurrentCountryIso(context);
- mVideoCallingEnabled = CallUtil.isVideoEnabled(context);
}
@Override
@@ -110,8 +108,7 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter {
return convertView;
} else {
final ContactListItemView v =
- new ContactListItemView(
- getContext(), null, mVideoCallingEnabled, isCallAndShareEnabled());
+ new ContactListItemView(getContext(), null, mIsImsVideoEnabled);
assignShortcutToView(v, shortcutType);
return v;
}
@@ -125,8 +122,7 @@ 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(mVideoCallingEnabled);
- view.setSupportCallAndShareIcon(isCallAndShareEnabled());
+ view.setSupportVideoCallIcon(mIsImsVideoEnabled);
return view;
}
@@ -171,7 +167,7 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter {
private void assignShortcutToView(ContactListItemView v, int shortcutType) {
final CharSequence text;
- final int drawableId;
+ final Drawable drawable;
final Resources resources = getContext().getResources();
final String number = getFormattedQueryString();
switch (shortcutType) {
@@ -181,34 +177,39 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter {
resources,
R.string.search_shortcut_call_number,
mBidiFormatter.unicodeWrap(number, TextDirectionHeuristics.LTR));
- drawableId = R.drawable.ic_search_phone;
+ drawable = getContext().getResources().getDrawable(R.drawable.quantum_ic_call_vd_theme_24);
break;
case SHORTCUT_CREATE_NEW_CONTACT:
text = resources.getString(R.string.search_shortcut_create_new_contact);
- drawableId = R.drawable.ic_search_add_contact;
+ drawable =
+ getContext().getResources().getDrawable(R.drawable.quantum_ic_person_add_vd_theme_24);
+ drawable.setAutoMirrored(true);
break;
case SHORTCUT_ADD_TO_EXISTING_CONTACT:
text = resources.getString(R.string.search_shortcut_add_to_contact);
- drawableId = R.drawable.quantum_ic_person_white_24;
+ drawable =
+ getContext().getResources().getDrawable(R.drawable.quantum_ic_person_add_vd_theme_24);
break;
case SHORTCUT_SEND_SMS_MESSAGE:
text = resources.getString(R.string.search_shortcut_send_sms_message);
- drawableId = R.drawable.quantum_ic_message_white_24;
+ drawable =
+ getContext().getResources().getDrawable(R.drawable.quantum_ic_message_vd_theme_24);
break;
case SHORTCUT_MAKE_VIDEO_CALL:
text = resources.getString(R.string.search_shortcut_make_video_call);
- drawableId = R.drawable.quantum_ic_videocam_white_24;
+ drawable =
+ getContext().getResources().getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
break;
case SHORTCUT_BLOCK_NUMBER:
text = resources.getString(R.string.search_shortcut_block_number);
- drawableId = R.drawable.ic_not_interested_googblue_24dp;
+ drawable =
+ getContext().getResources().getDrawable(R.drawable.ic_not_interested_googblue_24dp);
break;
default:
throw new IllegalArgumentException("Invalid shortcut type");
}
- v.setDrawableResource(drawableId);
+ v.setDrawable(drawable);
v.setDisplayName(text);
- v.setPhotoPosition(super.getPhotoPosition());
v.setAdjustSelectionBoundsEnabled(false);
}