From 7a97c62e649e367f9b275119c3b0773a8a7a7ead Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Wed, 2 Aug 2017 14:50:47 -0700 Subject: Getting network color in call details now assumes a hexidecimal value Previously when setting the color of a network in call details, we assumed the values were stored as String resource values when in fact they were hexidecimal integer values. Now we directly set the color instead of doing a resource lookup. screenshot: http://screen/d3tQNGBkKNX Bug: 64300111 Test: CallDetailsActivityTest PiperOrigin-RevId: 164042030 Change-Id: I858e3665253139b8aab4e4c063bfc4c419f33cc9 --- java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 7 +------ .../android/dialer/calldetails/CallDetailsHeaderViewHolder.java | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'java/com/android/dialer') diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 01f13b975..f7ea63c90 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -944,12 +944,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder String accountLabel = mCallLogCache.getAccountLabel(accountHandle); if (!TextUtils.isEmpty(accountLabel)) { SimDetails.Builder simDetails = SimDetails.newBuilder().setNetwork(accountLabel); - int color = mCallLogCache.getAccountColor(accountHandle); - if (color == PhoneAccount.NO_HIGHLIGHT_COLOR) { - simDetails.setColor(R.color.secondary_text_color); - } else { - simDetails.setColor(color); - } + simDetails.setColor(mCallLogCache.getAccountColor(accountHandle)); contact.setSimDetails(simDetails.build()); } return contact.build(); diff --git a/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java index 7d5757bbd..410a3a012 100644 --- a/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java +++ b/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java @@ -19,6 +19,7 @@ package com.android.dialer.calldetails; import android.content.Context; import android.net.Uri; import android.support.v7.widget.RecyclerView; +import android.telecom.PhoneAccount; import android.text.TextUtils; import android.view.View; import android.view.View.OnClickListener; @@ -93,7 +94,9 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder if (!TextUtils.isEmpty(contact.getSimDetails().getNetwork())) { networkView.setVisibility(View.VISIBLE); networkView.setText(contact.getSimDetails().getNetwork()); - networkView.setTextColor(context.getResources().getColor(contact.getSimDetails().getColor())); + if (contact.getSimDetails().getColor() != PhoneAccount.NO_HIGHLIGHT_COLOR) { + networkView.setTextColor(contact.getSimDetails().getColor()); + } } if (TextUtils.isEmpty(contact.getNumber())) { -- cgit v1.2.3