summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Casey <mrcasey@google.com> 2024-05-15 14:31:54 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-05-15 14:31:54 +0000
commit9ae3f701a580f155451d21e8002f15ca0b54c104 (patch)
tree1389ca1733e8414beef3e3d4aeff558e7ee432fc
parentd048683bee307a6f6fea12359bd0539e8f11a8ed (diff)
parent1e646eabc55059cbc944e21b94584ca3b0366807 (diff)
Merge "Don't tint smart actions in shelf UI" into 24D1-dev am: 1e646eabc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/27322962 Change-Id: Iedc7b5046413e3e472bc843779b7c6541d46992c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ActionButtonViewBinder.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/ui/viewmodel/ActionButtonAppearance.kt1
3 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
index a2afcac87c74..ba236ba016ff 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayView.java
@@ -160,7 +160,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() {
@@ -175,7 +176,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() {
@@ -515,7 +518,7 @@ public class ClipboardOverlayView extends DraggableConstraintLayout {
R.layout.shelf_action_chip, mActionContainer, false);
mActionButtonViewBinder.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 2a98068543ce..36aa39fa9fe4 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
@@ -37,6 +37,10 @@ class ActionButtonViewBinder @Inject constructor() {
// 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,
)