Style priority modes items in aggregator
* Different color if active. * Trigger description / "ON" / "Paused" / "Tap to set up" depending on enabled and active status (strings may be revised later). This CL also adds a helper class to create ZenModes, reducing boilerplate in unit tests. Bug: 346575288 Test: atest com.android.settings.notification.modes Flag: android.app.modes_ui Change-Id: Ia0e16b8be5284d13bed4366cbee0f92748bf2f85
This commit is contained in:
@@ -24,6 +24,7 @@ import android.graphics.drawable.LayerDrawable;
|
||||
import android.graphics.drawable.ShapeDrawable;
|
||||
import android.graphics.drawable.shapes.OvalShape;
|
||||
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -32,10 +33,18 @@ import com.android.settingslib.Utils;
|
||||
|
||||
class IconUtil {
|
||||
|
||||
static Drawable applyTint(@NonNull Context context, @NonNull Drawable icon) {
|
||||
static Drawable applyNormalTint(@NonNull Context context, @NonNull Drawable icon) {
|
||||
return applyTint(context, icon, android.R.attr.colorControlNormal);
|
||||
}
|
||||
|
||||
static Drawable applyAccentTint(@NonNull Context context, @NonNull Drawable icon) {
|
||||
return applyTint(context, icon, android.R.attr.colorAccent);
|
||||
}
|
||||
|
||||
private static Drawable applyTint(@NonNull Context context, @NonNull Drawable icon,
|
||||
@AttrRes int colorAttr) {
|
||||
icon = icon.mutate();
|
||||
icon.setTintList(
|
||||
Utils.getColorAttr(context, android.R.attr.colorControlNormal));
|
||||
icon.setTintList(Utils.getColorAttr(context, colorAttr));
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user