diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index db584d82fc..38351a991d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -47,6 +47,7 @@ import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.LauncherBindableItemsContainer; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.DoubleShadowBubbleTextView; +import com.android.launcher3.views.IconButtonView; import java.util.function.Predicate; @@ -80,7 +81,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar private @Nullable FolderIcon mLeaveBehindFolderIcon; // Only non-null when device supports having an All Apps button. - private @Nullable View mAllAppsButton; + private @Nullable IconButtonView mAllAppsButton; // Only non-null when device supports having an All Apps button. private @Nullable View mTaskbarDivider; @@ -125,10 +126,14 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get() && !mActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) { - mAllAppsButton = LayoutInflater.from(context) + mAllAppsButton = (IconButtonView) LayoutInflater.from(context) .inflate(R.layout.taskbar_all_apps_button, this, false); mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding); mAllAppsButton.setScaleX(mIsRtl ? -1 : 1); + mAllAppsButton.setForegroundTint(mActivityContext.getColor( + DisplayController.isTransientTaskbar(mActivityContext) + ? R.color.all_apps_button_color + : R.color.all_apps_button_color_dark)); if (FeatureFlags.ENABLE_TASKBAR_PINNING.get()) { mTaskbarDivider = LayoutInflater.from(context).inflate(R.layout.taskbar_divider, diff --git a/res/values-night-v31/colors.xml b/res/values-night-v31/colors.xml index 54d6d8876f..2c1bc90074 100644 --- a/res/values-night-v31/colors.xml +++ b/res/values-night-v31/colors.xml @@ -24,6 +24,4 @@ @android:color/system_neutral2_300 @android:color/system_accent2_700 @android:color/system_neutral1_700 - - ?android:attr/textColorSecondary \ No newline at end of file diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml index 17fe419a8c..4ba77fa055 100644 --- a/res/values-night/colors.xml +++ b/res/values-night/colors.xml @@ -17,5 +17,5 @@ --> - #BFC8CC + @color/all_apps_button_color_dark \ No newline at end of file diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index cf4f000340..63a5454ca1 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -62,5 +62,6 @@ @android:color/system_accent1_300 @android:color/system_neutral2_700 - ?android:attr/textColorSecondary + @android:color/system_neutral2_700 + @android:color/system_neutral2_200 diff --git a/res/values/colors.xml b/res/values/colors.xml index 9d6927b99a..ef7bf91a11 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -80,7 +80,9 @@ #ff8df5e3 #ff3d665f - #40484B + @color/all_apps_button_color_light + #40484B + #BFC8CC #00668B #B5CAD7 diff --git a/src/com/android/launcher3/views/IconButtonView.java b/src/com/android/launcher3/views/IconButtonView.java index dd48c99c7d..64e9327dfa 100644 --- a/src/com/android/launcher3/views/IconButtonView.java +++ b/src/com/android/launcher3/views/IconButtonView.java @@ -30,6 +30,8 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.util.AttributeSet; +import androidx.annotation.ColorInt; + import com.android.launcher3.BubbleTextView; import com.android.launcher3.icons.BaseIconFactory; import com.android.launcher3.icons.FastBitmapDrawable; @@ -68,6 +70,14 @@ public class IconButtonView extends BubbleTextView { } } + /** Updates the color of the icon's foreground layer. */ + public void setForegroundTint(@ColorInt int tintColor) { + FastBitmapDrawable icon = getIcon(); + if (icon instanceof IconDrawable) { + ((IconDrawable) icon).mFg.setTint(tintColor); + } + } + private static class IconDrawable extends FastBitmapDrawable { private final Drawable mFg;