Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e7ab733 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

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
parent 9e267f72
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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 {
+4 −0
Original line number Diff line number Diff line
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -25,5 +25,6 @@ constructor(
    val icon: Drawable?,
    val label: CharSequence?,
    val description: CharSequence,
    val tint: Boolean = true,
    val customBackground: Drawable? = null,
)