Don't tint smart actions in shelf UI
Adds a parameter to the ActionButtonAppearance to allow disabling
tinting of action button icons.
Bug: 339598339
Bug: 339757074
Test: manual (visual change)
Flag: ACONFIG com.android.systemui.screenshot_shelf_ui2 TEAMFOOD
Change-Id: I266cebb06815f3ea169a68998d177b14c1440649
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
index 8efc66d..e345836 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
@@ -66,11 +66,11 @@
import com.android.systemui.screenshot.ui.viewmodel.ActionButtonAppearance;
import com.android.systemui.screenshot.ui.viewmodel.ActionButtonViewModel;
-import java.util.ArrayList;
-
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
+import java.util.ArrayList;
+
/**
* Handles the visual elements and animations for the clipboard overlay.
*/
@@ -159,7 +159,8 @@
R.drawable.ic_baseline_devices_24).loadDrawable(
mContext),
null,
- mContext.getString(R.string.clipboard_send_nearby_description)),
+ mContext.getString(R.string.clipboard_send_nearby_description),
+ true),
new Function0<>() {
@Override
public Unit invoke() {
@@ -174,7 +175,9 @@
new ActionButtonAppearance(
Icon.createWithResource(mContext,
R.drawable.ic_screenshot_share).loadDrawable(mContext),
- null, mContext.getString(com.android.internal.R.string.share)),
+ null,
+ mContext.getString(com.android.internal.R.string.share),
+ true),
new Function0<>() {
@Override
public Unit invoke() {
@@ -514,7 +517,7 @@
R.layout.shelf_action_chip, mActionContainer, false);
ActionButtonViewBinder.INSTANCE.bind(chip, ActionButtonViewModel.Companion.withNextId(
new ActionButtonAppearance(action.getIcon().loadDrawable(mContext),
- action.getTitle(), action.getTitle()), new Function0<>() {
+ action.getTitle(), action.getTitle(), false), new Function0<>() {
@Override
public Unit invoke() {
try {
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt
index 2243ade..ccd7a68 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt
@@ -36,6 +36,10 @@
// Note we never re-bind a view to a different ActionButtonViewModel, different view
// models would remove/create separate views.
drawable?.setIcon(viewModel.appearance.icon)
+ iconView.setImageDrawable(viewModel.appearance.icon)
+ if (!viewModel.appearance.tint) {
+ iconView.setImageTintList(null)
+ }
textView.text = viewModel.appearance.label
viewModel.appearance.customBackground?.also {
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt
index 2982ea0..42ad326 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt
@@ -25,5 +25,6 @@
val icon: Drawable?,
val label: CharSequence?,
val description: CharSequence,
+ val tint: Boolean = true,
val customBackground: Drawable? = null,
)