summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2017-08-02 14:50:47 -0700
committerEric Erfanian <erfanian@google.com>2017-08-03 08:30:34 -0700
commit7a97c62e649e367f9b275119c3b0773a8a7a7ead (patch)
treeaf6eb9502868ce6fa89c89dd54e0c412abdc1f74
parent286a785c6f0ec653b1876e7532c79e15785c99ff (diff)
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
-rw-r--r--java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java7
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java5
2 files changed, 5 insertions, 7 deletions
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())) {