diff options
author | Brandon Maxwell <maxwelb@google.com> | 2015-11-20 22:10:55 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-11-20 22:10:55 +0000 |
commit | 035815d7756c3830682e54cf2acd166098d92428 (patch) | |
tree | d4320fedb24fbc4e1b968f2b3e495b16be435f76 | |
parent | bedb473d77d4fe7bc7c33bdbbfba2706141e6a9b (diff) | |
parent | 795946c8524ad73dfb1a26c204576d13eabfad20 (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.java | 4 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallUIMaterialColorMapUtils.java | 8 |
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 |