diff options
author | Tyler Gunn <tgunn@google.com> | 2015-12-18 13:57:37 -0800 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2015-12-18 13:57:37 -0800 |
commit | b31f5d16deb442c7aae2fe232f4799948dd7195d (patch) | |
tree | 6a9794415c01eacfa7adc1f7ddb4b5f72b5003a9 /src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | |
parent | 524d87169becc3137963d1c7ebba3493d0fa5e1d (diff) |
Support carrier presence-based video calling icon.
- Update SmartDial database to track carrier presence.
- Add video call style elements to dialer stylesheet.
- Tore out hair in frustration tracing through code.
- Add listeners to allow dialing of video calls from search results.
Bug: 20257833
Change-Id: I476cccb8c2805ae6f9949366fc5c2ce2669b7734
Diffstat (limited to 'src/com/android/dialer/list/DialerPhoneNumberListAdapter.java')
-rw-r--r-- | src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java index 488bb33f9..7164de2d7 100644 --- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java @@ -2,12 +2,15 @@ package com.android.dialer.list; import android.content.Context; import android.content.res.Resources; +import android.database.Cursor; import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; +import android.util.Log; import android.view.View; import android.view.ViewGroup; +import com.android.contacts.common.CallUtil; import com.android.contacts.common.GeoUtil; import com.android.contacts.common.list.ContactListItemView; import com.android.contacts.common.list.PhoneNumberListAdapter; @@ -41,11 +44,13 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { private final boolean[] mShortcutEnabled = new boolean[SHORTCUT_COUNT]; private final BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); + private boolean mVideoCallingEnabled = false; public DialerPhoneNumberListAdapter(Context context) { super(context); mCountryIso = GeoUtil.getCurrentCountryIso(context); + mVideoCallingEnabled = CallUtil.isVideoEnabled(context); } @Override @@ -95,7 +100,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { assignShortcutToView((ContactListItemView) convertView, shortcutType); return convertView; } else { - final ContactListItemView v = new ContactListItemView(getContext(), null); + final ContactListItemView v = new ContactListItemView(getContext(), null, + mVideoCallingEnabled); assignShortcutToView(v, shortcutType); return v; } @@ -104,6 +110,16 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { } } + @Override + protected ContactListItemView newView( + Context context, int partition, Cursor cursor, int position, ViewGroup parent) { + final ContactListItemView view = super.newView(context, partition, cursor, position, + parent); + + view.setSupportVideoCallIcon(mVideoCallingEnabled); + return view; + } + /** * @param position The position of the item * @return The enabled shortcut type matching the given position if the item is a |