diff options
author | Gilles Franck Mevaa <gillesd@google.com> | 2016-03-02 12:08:03 -0800 |
---|---|---|
committer | Gilles Franck Mevaa <gillesd@google.com> | 2016-03-02 15:48:50 -0800 |
commit | 9228d4a260961807329cc9187d21ab35ae2c097e (patch) | |
tree | 6f3c265b108a32c206a16b299d4d06b2aa20af6e /src/com/android/dialer/calllog | |
parent | 24c02ee4ecee7607ce014022b9a3950350c7cad9 (diff) |
CallLogListItemViewHolder distinguishes block/spam numbers
A new method is added to show the appropriate photo and label
if the number is either blocked or spam. This occurs after the
normal photo and labels are rendered. Because of that, there is
a flickering if the photo and labels should be changed.
b/27295728 will help track the fix of the flickering bug.
Change-Id: I639c0c0d4167b48956892f2b955d4e1f0cc8e8eb
Diffstat (limited to 'src/com/android/dialer/calllog')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViewHolder.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index 1c2744073..6c252758a 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -27,11 +27,9 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.telecom.PhoneAccountHandle; -import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; -import android.util.Log; import android.view.ContextMenu; import android.view.MenuItem; import android.view.View; @@ -66,8 +64,6 @@ import com.android.dialerbind.ObjectFactory; import com.google.common.collect.Lists; import java.util.List; -import java.util.Map; -import java.util.Set; /** * This is an object containing references to views contained by the call log list item. This @@ -625,13 +621,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder public void updatePhoto() { quickContactView.assignContactUri(info.lookupUri); - if (isBlocked && !TextUtils.isEmpty(number) /* maybe a private number ? */) { - quickContactView.setImageDrawable(mContext.getDrawable(R.drawable.blocked_contact)); - phoneCallDetailsViews.callLocationAndDate.setText( - mContext.getString(R.string.blocked_number_call_log_label)); - return; - } - final boolean isVoicemail = mCallLogCache.isVoicemailNumber(accountHandle, number); int contactType = ContactPhotoManager.TYPE_DEFAULT; if (isVoicemail) { @@ -653,6 +642,14 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder ContactPhotoManager.getInstance(mContext).loadThumbnail(quickContactView, info.photoId, false /* darkTheme */, true /* isCircular */, request); } + + if (mExtendedBlockingButtonRenderer != null) { + mExtendedBlockingButtonRenderer.updatePhotoAndLabelIfNecessary( + number, + countryIso, + quickContactView, + phoneCallDetailsViews.callLocationAndDate); + } } @Override |