summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2015-11-20 22:10:55 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-11-20 22:10:55 +0000
commit035815d7756c3830682e54cf2acd166098d92428 (patch)
treed4320fedb24fbc4e1b968f2b3e495b16be435f76
parentbedb473d77d4fe7bc7c33bdbbfba2706141e6a9b (diff)
parent795946c8524ad73dfb1a26c204576d13eabfad20 (diff)
Changing to use compat classes for getColor calls
am: d24baa4156 * commit 'd24baa4156c9483a1d0cc0b1b2cfbb4c57073e15': Changing to use compat classes for getColor calls
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java4
-rw-r--r--InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java8
2 files changed, 9 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index de563f5e7..33e4e5ace 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -1661,7 +1661,9 @@ public class InCallPresenter implements CallList.Listener,
final Resources resources = mInCallActivity.getResources();
final int color;
if (resources.getBoolean(R.bool.is_layout_landscape)) {
- color = resources.getColor(R.color.statusbar_background_color, null);
+ // TODO use ResourcesCompat.getColor(Resources, int, Resources.Theme) when available
+ // {@link Resources#getColor(int)} used for compatibility
+ color = resources.getColor(R.color.statusbar_background_color);
} else {
color = mThemeColors.mSecondaryColor;
}
diff --git a/InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java b/InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java
index d65580efe..44b035f30 100644
--- a/InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java
+++ b/InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java
@@ -44,9 +44,13 @@ public class InCallUIMaterialColorMapUtils extends MaterialColorMapUtils {
return super.calculatePrimaryAndSecondaryColor(color);
}
+ /**
+ * {@link Resources#getColor(int) used for compatibility
+ */
+ @SuppressWarnings("deprecation")
public static MaterialPalette getDefaultPrimaryAndSecondaryColors(Resources resources) {
- final int primaryColor = resources.getColor(R.color.dialer_theme_color, null);
- final int secondaryColor = resources.getColor(R.color.dialer_theme_color_dark, null);
+ final int primaryColor = resources.getColor(R.color.dialer_theme_color);
+ final int secondaryColor = resources.getColor(R.color.dialer_theme_color_dark);
return new MaterialPalette(primaryColor, secondaryColor);
}
} \ No newline at end of file