summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/ThemeColorManager.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-10-27 00:18:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-10-27 00:18:53 +0000
commit4f6214ee55f6d286db36d970e2c60c9402c34d60 (patch)
tree47eefa3a9b9b172df2db32e2f1b6246bad885a57 /java/com/android/incallui/ThemeColorManager.java
parent9b99b22391a92fe20a74076bf5e47d36eb9b4ab4 (diff)
parent8d662cae2c05b5e256e7bb826abf05fb9ace133d (diff)
Merge "Set incall button color to match sim color."
Diffstat (limited to 'java/com/android/incallui/ThemeColorManager.java')
-rw-r--r--java/com/android/incallui/ThemeColorManager.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/java/com/android/incallui/ThemeColorManager.java b/java/com/android/incallui/ThemeColorManager.java
index a88ae33cd..1d4c287be 100644
--- a/java/com/android/incallui/ThemeColorManager.java
+++ b/java/com/android/incallui/ThemeColorManager.java
@@ -57,14 +57,16 @@ public class ThemeColorManager {
public void onForegroundCallChanged(Context context, @Nullable DialerCall newForegroundCall) {
if (newForegroundCall == null) {
- updateThemeColors(context, pendingPhoneAccountHandle, false);
+ updateThemeColors(context, getHighlightColor(context, pendingPhoneAccountHandle), false);
} else {
- updateThemeColors(context, newForegroundCall.getAccountHandle(), newForegroundCall.isSpam());
+ updateThemeColors(
+ context,
+ getHighlightColor(context, newForegroundCall.getAccountHandle()),
+ newForegroundCall.isSpam());
}
}
- private void updateThemeColors(
- Context context, @Nullable PhoneAccountHandle handle, boolean isSpam) {
+ private void updateThemeColors(Context context, @ColorInt int highlightColor, boolean isSpam) {
MaterialPalette palette;
if (isSpam) {
palette =
@@ -74,7 +76,6 @@ public class ThemeColorManager {
backgroundColorBottom = context.getColor(R.color.incall_background_gradient_spam_bottom);
backgroundColorSolid = context.getColor(R.color.incall_background_multiwindow_spam);
} else {
- @ColorInt int highlightColor = getHighlightColor(context, handle);
palette = colorMap.calculatePrimaryAndSecondaryColor(highlightColor);
backgroundColorTop = context.getColor(R.color.incall_background_gradient_top);
backgroundColorMiddle = context.getColor(R.color.incall_background_gradient_middle);
@@ -95,7 +96,7 @@ public class ThemeColorManager {
}
@ColorInt
- private static int getHighlightColor(Context context, @Nullable PhoneAccountHandle handle) {
+ private int getHighlightColor(Context context, @Nullable PhoneAccountHandle handle) {
if (handle != null) {
PhoneAccount account = context.getSystemService(TelecomManager.class).getPhoneAccount(handle);
if (account != null) {