diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/Notification.java | 10 | ||||
-rw-r--r-- | core/java/android/content/res/Resources.java | 4 | ||||
-rw-r--r-- | core/java/android/content/res/StringBlock.java | 2 | ||||
-rw-r--r-- | core/java/android/text/Html.java | 2 | ||||
-rw-r--r-- | core/java/android/view/PhoneWindow.java | 8 | ||||
-rw-r--r-- | core/java/android/widget/SuggestionsAdapter.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/TabHost.java | 4 | ||||
-rw-r--r-- | core/java/com/android/internal/util/UserIcons.java | 4 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternView.java | 6 |
9 files changed, 21 insertions, 21 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 55d6ac8..b824e97 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -2870,7 +2870,7 @@ public class Notification implements Parcelable contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); contentView.setProgressBackgroundTintList( - R.id.progress, ColorStateList.valueOf(mContext.getResources().getColor( + R.id.progress, ColorStateList.valueOf(mContext.getColor( R.color.notification_progress_background_color))); if (mColor != COLOR_DEFAULT) { ColorStateList colorStateList = ColorStateList.valueOf(mColor); @@ -3044,7 +3044,7 @@ public class Notification implements Parcelable private void processLegacyAction(Action action, RemoteViews button) { if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, action.icon)) { button.setTextViewCompoundDrawablesRelativeColorFilter(R.id.action0, 0, - mContext.getResources().getColor(R.color.notification_action_color_filter), + mContext.getColor(R.color.notification_action_color_filter), PorterDuff.Mode.MULTIPLY); } } @@ -3142,7 +3142,7 @@ public class Notification implements Parcelable private int resolveColor() { if (mColor == COLOR_DEFAULT) { - return mContext.getResources().getColor(R.color.notification_icon_bg_color); + return mContext.getColor(R.color.notification_icon_bg_color); } return mColor; } @@ -4321,9 +4321,9 @@ public class Notification implements Parcelable * Applies the special text colors for media notifications to all text views. */ private void styleText(RemoteViews contentView) { - int primaryColor = mBuilder.mContext.getResources().getColor( + int primaryColor = mBuilder.mContext.getColor( R.color.notification_media_primary_color); - int secondaryColor = mBuilder.mContext.getResources().getColor( + int secondaryColor = mBuilder.mContext.getColor( R.color.notification_media_secondary_color); contentView.setTextColor(R.id.title, primaryColor); if (mBuilder.showsTimeOrChronometer()) { diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 5dc9ef9..95ad57e 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -927,6 +927,7 @@ public class Resources { * @deprecated Use {@link #getColor(int, Theme)} instead. */ @ColorInt + @Deprecated public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } @@ -996,6 +997,7 @@ public class Resources { * @deprecated Use {@link #getColorStateList(int, Theme)} instead. */ @Nullable + @Deprecated public ColorStateList getColorStateList(@ColorRes int id) throws NotFoundException { final ColorStateList csl = getColorStateList(id, null); if (csl != null && csl.canApplyTheme()) { @@ -1049,8 +1051,6 @@ public class Resources { return res; } - - /** * Return a boolean associated with a particular resource ID. This can be * used with any integral resource value, and will return true if it is diff --git a/core/java/android/content/res/StringBlock.java b/core/java/android/content/res/StringBlock.java index 9652db7..5cfc41f 100644 --- a/core/java/android/content/res/StringBlock.java +++ b/core/java/android/content/res/StringBlock.java @@ -328,7 +328,7 @@ final class StringBlock { String name = color.substring(1); int colorRes = res.getIdentifier(name, "color", "android"); if (colorRes != 0) { - ColorStateList colors = res.getColorStateList(colorRes); + ColorStateList colors = res.getColorStateList(colorRes, null); if (foreground) { return new TextAppearanceSpan(null, 0, 0, colors, null); } else { diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java index dc93bc2..8cf1b4b 100644 --- a/core/java/android/text/Html.java +++ b/core/java/android/text/Html.java @@ -672,7 +672,7 @@ class HtmlToSpannedConverter implements ContentHandler { String name = f.mColor.substring(1); int colorRes = res.getIdentifier(name, "color", "android"); if (colorRes != 0) { - ColorStateList colors = res.getColorStateList(colorRes); + ColorStateList colors = res.getColorStateList(colorRes, null); text.setSpan(new TextAppearanceSpan(null, 0, 0, colors, null), where, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); diff --git a/core/java/android/view/PhoneWindow.java b/core/java/android/view/PhoneWindow.java index 543021e..05796bb 100644 --- a/core/java/android/view/PhoneWindow.java +++ b/core/java/android/view/PhoneWindow.java @@ -2981,8 +2981,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mStatusGuard == null) { mStatusGuard = new View(mContext); - mStatusGuard.setBackgroundColor(mContext.getResources() - .getColor(R.color.input_method_navigation_guard)); + mStatusGuard.setBackgroundColor(mContext.getColor( + R.color.input_method_navigation_guard)); addView(mStatusGuard, indexOfChild(mStatusColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, mlp.topMargin, Gravity.START | Gravity.TOP)); @@ -3041,8 +3041,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // position the navigation guard view, creating it if necessary if (mNavigationGuard == null) { mNavigationGuard = new View(mContext); - mNavigationGuard.setBackgroundColor(mContext.getResources() - .getColor(R.color.input_method_navigation_guard)); + mNavigationGuard.setBackgroundColor(mContext.getColor( + R.color.input_method_navigation_guard)); addView(mNavigationGuard, indexOfChild(mNavigationColorViewState.view), new LayoutParams(LayoutParams.MATCH_PARENT, insets.getSystemWindowInsetBottom(), diff --git a/core/java/android/widget/SuggestionsAdapter.java b/core/java/android/widget/SuggestionsAdapter.java index 4323851..aad0625 100644 --- a/core/java/android/widget/SuggestionsAdapter.java +++ b/core/java/android/widget/SuggestionsAdapter.java @@ -378,7 +378,7 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene // Lazily get the URL color from the current theme. TypedValue colorValue = new TypedValue(); context.getTheme().resolveAttribute(R.attr.textColorSearchUrl, colorValue, true); - mUrlColor = context.getResources().getColorStateList(colorValue.resourceId); + mUrlColor = context.getColorStateList(colorValue.resourceId); } SpannableString text = new SpannableString(url); diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java index 110d79b..c521f72 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -603,7 +603,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) { // Donut apps get old color scheme tabIndicator.setBackgroundResource(R.drawable.tab_indicator_v4); - tv.setTextColor(context.getResources().getColorStateList(R.color.tab_indicator_text_v4)); + tv.setTextColor(context.getColorStateList(R.color.tab_indicator_text_v4)); } return tabIndicator; @@ -648,7 +648,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) { // Donut apps get old color scheme tabIndicator.setBackgroundResource(R.drawable.tab_indicator_v4); - tv.setTextColor(context.getResources().getColorStateList(R.color.tab_indicator_text_v4)); + tv.setTextColor(context.getColorStateList(R.color.tab_indicator_text_v4)); } return tabIndicator; diff --git a/core/java/com/android/internal/util/UserIcons.java b/core/java/com/android/internal/util/UserIcons.java index c69d14f..daf745f 100644 --- a/core/java/com/android/internal/util/UserIcons.java +++ b/core/java/com/android/internal/util/UserIcons.java @@ -70,8 +70,8 @@ public class UserIcons { // Return colored icon instead colorResId = USER_ICON_COLORS[userId % USER_ICON_COLORS.length]; } - Drawable icon = Resources.getSystem().getDrawable(R.drawable.ic_account_circle).mutate(); - icon.setColorFilter(Resources.getSystem().getColor(colorResId), Mode.SRC_IN); + Drawable icon = Resources.getSystem().getDrawable(R.drawable.ic_account_circle, null).mutate(); + icon.setColorFilter(Resources.getSystem().getColor(colorResId, null), Mode.SRC_IN); icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight()); return icon; } diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java index 52bbabf..8be34e7 100644 --- a/core/java/com/android/internal/widget/LockPatternView.java +++ b/core/java/com/android/internal/widget/LockPatternView.java @@ -269,9 +269,9 @@ public class LockPatternView extends View { mPathPaint.setAntiAlias(true); mPathPaint.setDither(true); - mRegularColor = getResources().getColor(R.color.lock_pattern_view_regular_color); - mErrorColor = getResources().getColor(R.color.lock_pattern_view_error_color); - mSuccessColor = getResources().getColor(R.color.lock_pattern_view_success_color); + mRegularColor = context.getColor(R.color.lock_pattern_view_regular_color); + mErrorColor = context.getColor(R.color.lock_pattern_view_error_color); + mSuccessColor = context.getColor(R.color.lock_pattern_view_success_color); mRegularColor = a.getColor(R.styleable.LockPatternView_regularColor, mRegularColor); mErrorColor = a.getColor(R.styleable.LockPatternView_errorColor, mErrorColor); mSuccessColor = a.getColor(R.styleable.LockPatternView_successColor, mSuccessColor); |