Loading core/java/android/app/Notification.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; Loading Loading @@ -2773,6 +2774,14 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.progress, View.VISIBLE); contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); contentView.setProgressBackgroundTintList( R.id.progress, ColorStateList.valueOf(mContext.getResources().getColor( R.color.notification_progress_background_color))); if (mColor != COLOR_DEFAULT) { ColorStateList colorStateList = ColorStateList.valueOf(mColor); contentView.setProgressTintList(R.id.progress, colorStateList); contentView.setProgressIndeterminateTintList(R.id.progress, colorStateList); } showLine2 = true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); Loading core/java/android/widget/ProgressBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -604,6 +604,7 @@ public class ProgressBar extends View { * @see #getIndeterminateTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setIndeterminateTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading Loading @@ -842,6 +843,7 @@ public class ProgressBar extends View { * @see #getProgressTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setProgressTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading Loading @@ -923,6 +925,7 @@ public class ProgressBar extends View { * @see #getProgressBackgroundTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setProgressBackgroundTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading core/java/android/widget/RemoteViews.java +50 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.content.IntentSender; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; Loading Loading @@ -1069,6 +1070,7 @@ public class RemoteViews implements Parcelable, Filter { static final int BITMAP = 12; static final int BUNDLE = 13; static final int INTENT = 14; static final int COLOR_STATE_LIST = 15; String methodName; int type; Loading Loading @@ -1142,6 +1144,11 @@ public class RemoteViews implements Parcelable, Filter { this.value = Intent.CREATOR.createFromParcel(in); } break; case COLOR_STATE_LIST: if (in.readInt() != 0) { this.value = ColorStateList.CREATOR.createFromParcel(in); } break; default: break; } Loading Loading @@ -1212,6 +1219,11 @@ public class RemoteViews implements Parcelable, Filter { ((Intent)this.value).writeToParcel(out, flags); } break; case COLOR_STATE_LIST: out.writeInt(this.value != null ? 1 : 0); if (this.value != null) { ((ColorStateList)this.value).writeToParcel(out, flags); } default: break; } Loading Loading @@ -1247,6 +1259,8 @@ public class RemoteViews implements Parcelable, Filter { return Bundle.class; case INTENT: return Intent.class; case COLOR_STATE_LIST: return ColorStateList.class; default: return null; } Loading Loading @@ -2206,6 +2220,42 @@ public class RemoteViews implements Parcelable, Filter { colorFilter, mode, level)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setProgressTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setProgressTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setProgressBackgroundTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressBackgroundTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setProgressBackgroundTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setIndeterminateTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressIndeterminateTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setIndeterminateTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * Equivalent to calling {@link android.widget.TextView#setTextColor(int)}. * Loading core/res/res/values/colors.xml +2 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ <color name="notification_media_primary_color">@color/primary_text_material_dark</color> <color name="notification_media_secondary_color">@color/secondary_text_material_dark</color> <color name="notification_progress_background_color">@color/secondary_text_material_light</color> <!-- Keyguard colors --> <color name="keyguard_avatar_frame_color">#ffffffff</color> <color name="keyguard_avatar_frame_shadow_color">#80000000</color> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1782,6 +1782,7 @@ <java-symbol type="drawable" name="notification_icon_legacy_bg" /> <java-symbol type="color" name="notification_media_primary_color" /> <java-symbol type="color" name="notification_media_secondary_color" /> <java-symbol type="color" name="notification_progress_background_color" /> <java-symbol type="id" name="media_actions" /> <!-- From SystemUI --> Loading Loading
core/java/android/app/Notification.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; Loading Loading @@ -2773,6 +2774,14 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.progress, View.VISIBLE); contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); contentView.setProgressBackgroundTintList( R.id.progress, ColorStateList.valueOf(mContext.getResources().getColor( R.color.notification_progress_background_color))); if (mColor != COLOR_DEFAULT) { ColorStateList colorStateList = ColorStateList.valueOf(mColor); contentView.setProgressTintList(R.id.progress, colorStateList); contentView.setProgressIndeterminateTintList(R.id.progress, colorStateList); } showLine2 = true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); Loading
core/java/android/widget/ProgressBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -604,6 +604,7 @@ public class ProgressBar extends View { * @see #getIndeterminateTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setIndeterminateTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading Loading @@ -842,6 +843,7 @@ public class ProgressBar extends View { * @see #getProgressTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setProgressTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading Loading @@ -923,6 +925,7 @@ public class ProgressBar extends View { * @see #getProgressBackgroundTintList() * @see Drawable#setTintList(ColorStateList) */ @RemotableViewMethod public void setProgressBackgroundTintList(@Nullable ColorStateList tint) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); Loading
core/java/android/widget/RemoteViews.java +50 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.content.IntentSender; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; Loading Loading @@ -1069,6 +1070,7 @@ public class RemoteViews implements Parcelable, Filter { static final int BITMAP = 12; static final int BUNDLE = 13; static final int INTENT = 14; static final int COLOR_STATE_LIST = 15; String methodName; int type; Loading Loading @@ -1142,6 +1144,11 @@ public class RemoteViews implements Parcelable, Filter { this.value = Intent.CREATOR.createFromParcel(in); } break; case COLOR_STATE_LIST: if (in.readInt() != 0) { this.value = ColorStateList.CREATOR.createFromParcel(in); } break; default: break; } Loading Loading @@ -1212,6 +1219,11 @@ public class RemoteViews implements Parcelable, Filter { ((Intent)this.value).writeToParcel(out, flags); } break; case COLOR_STATE_LIST: out.writeInt(this.value != null ? 1 : 0); if (this.value != null) { ((ColorStateList)this.value).writeToParcel(out, flags); } default: break; } Loading Loading @@ -1247,6 +1259,8 @@ public class RemoteViews implements Parcelable, Filter { return Bundle.class; case INTENT: return Intent.class; case COLOR_STATE_LIST: return ColorStateList.class; default: return null; } Loading Loading @@ -2206,6 +2220,42 @@ public class RemoteViews implements Parcelable, Filter { colorFilter, mode, level)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setProgressTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setProgressTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setProgressBackgroundTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressBackgroundTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setProgressBackgroundTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * @hide * Equivalent to calling {@link android.widget.ProgressBar#setIndeterminateTintList}. * * @param viewId The id of the view whose tint should change * @param tint the tint to apply, may be {@code null} to clear tint */ public void setProgressIndeterminateTintList(int viewId, ColorStateList tint) { addAction(new ReflectionAction(viewId, "setIndeterminateTintList", ReflectionAction.COLOR_STATE_LIST, tint)); } /** * Equivalent to calling {@link android.widget.TextView#setTextColor(int)}. * Loading
core/res/res/values/colors.xml +2 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ <color name="notification_media_primary_color">@color/primary_text_material_dark</color> <color name="notification_media_secondary_color">@color/secondary_text_material_dark</color> <color name="notification_progress_background_color">@color/secondary_text_material_light</color> <!-- Keyguard colors --> <color name="keyguard_avatar_frame_color">#ffffffff</color> <color name="keyguard_avatar_frame_shadow_color">#80000000</color> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1782,6 +1782,7 @@ <java-symbol type="drawable" name="notification_icon_legacy_bg" /> <java-symbol type="color" name="notification_media_primary_color" /> <java-symbol type="color" name="notification_media_secondary_color" /> <java-symbol type="color" name="notification_progress_background_color" /> <java-symbol type="id" name="media_actions" /> <!-- From SystemUI --> Loading