diff options
| author | 2024-05-13 11:31:06 -0400 | |
|---|---|---|
| committer | 2024-05-14 18:47:41 +0000 | |
| commit | 2e7ab733fecf628b53f05cde7787ab01a57345a8 (patch) | |
| tree | 379c390d54130d0ad003356c3d585eb2371b7770 | |
| parent | 9e267f728dd333608052dd827f3f1a5f91058ad7 (diff) | |
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
3 files changed, 13 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java index 8efc66de24cd..e34583617679 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.binder.ActionButtonViewBinder; 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 @@ public class ClipboardOverlayView extends DraggableConstraintLayout { 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 @@ public class ClipboardOverlayView extends DraggableConstraintLayout { 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 @@ public class ClipboardOverlayView extends DraggableConstraintLayout { 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 2243ade27b2e..ccd7a680c47d 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 @@ object ActionButtonViewBinder { // 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 2982ea011825..42ad326c6b45 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 @@ constructor( val icon: Drawable?, val label: CharSequence?, val description: CharSequence, + val tint: Boolean = true, val customBackground: Drawable? = null, ) |