Merge "Remove the tint from taskbar themed icons for dark mode." into main
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
index 7692760..14d46d1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
@@ -206,19 +206,12 @@
if (mDeferUpdatesForSUW) {
ItemInfo[] finalHotseatItemInfos = hotseatItemInfos;
- mDeferredUpdates = () -> {
- updateHotseatItemsAndBackground(finalHotseatItemInfos);
- };
+ mDeferredUpdates = () -> mContainer.updateHotseatItems(finalHotseatItemInfos);
} else {
- updateHotseatItemsAndBackground(hotseatItemInfos);
+ mContainer.updateHotseatItems(hotseatItemInfos);
}
}
- private void updateHotseatItemsAndBackground(ItemInfo[] hotseatItemInfos) {
- mContainer.updateHotseatItems(hotseatItemInfos);
- mControllers.taskbarViewController.updateIconsBackground();
- }
-
/**
* This is used to defer UI updates after SUW builds the unstash animation.
* @param defer if true, defers updates to the UI
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index d9e2330..367bf6c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -52,7 +52,6 @@
import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.PreviewBackground;
-import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -60,7 +59,6 @@
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
-import com.android.launcher3.views.DoubleShadowBubbleTextView;
import com.android.launcher3.views.IconButtonView;
import java.util.function.Predicate;
@@ -410,21 +408,6 @@
}
/**
- * Traverse all the child views and change the background of themeIcons
- **/
- public void setThemedIconsBackgroundColor(int color) {
- for (View icon : getIconViews()) {
- if (icon instanceof DoubleShadowBubbleTextView) {
- DoubleShadowBubbleTextView textView = ((DoubleShadowBubbleTextView) icon);
- if (textView.getIcon() != null
- && textView.getIcon() instanceof ThemedIconDrawable) {
- ((ThemedIconDrawable) textView.getIcon()).changeBackgroundColor(color);
- }
- }
- }
- }
-
- /**
* Sets OnClickListener and OnLongClickListener for the given view.
*/
public void setClickAndLongClickListenersForIcon(View icon) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 5494853..4b1963b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -45,7 +45,6 @@
import android.view.animation.Interpolator;
import androidx.annotation.Nullable;
-import androidx.core.graphics.ColorUtils;
import androidx.core.view.OneShotPreDrawListener;
import com.android.app.animation.Interpolators;
@@ -62,7 +61,6 @@
import com.android.launcher3.anim.RevealOutlineAnimation;
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.ItemInfoMatcher;
@@ -93,8 +91,6 @@
public static final int ALPHA_INDEX_SMALL_SCREEN = 6;
private static final int NUM_ALPHA_CHANNELS = 7;
- private static final float TASKBAR_DARK_THEME_ICONS_BACKGROUND_LUMINANCE = 0.30f;
-
private final TaskbarActivityContext mActivity;
private final TaskbarView mTaskbarView;
private final MultiValueAlpha mTaskbarIconAlpha;
@@ -125,12 +121,6 @@
private int mTaskbarBottomMargin;
private final int mStashedHandleHeight;
- private final int mLauncherThemedIconsBackgroundColor;
- private final int mTaskbarThemedIconsBackgroundColor;
-
- /** Progress from {@code 0} for Launcher's color to {@code 1} for Taskbar's color. */
- private final AnimatedFloat mThemedIconsBackgroundProgress = new AnimatedFloat(
- this::updateIconsBackground);
private final TaskbarModelCallbacks mModelCallbacks;
@@ -173,16 +163,7 @@
mTaskbarBottomMargin = activity.getDeviceProfile().taskbarBottomMargin;
mStashedHandleHeight = activity.getResources()
.getDimensionPixelSize(R.dimen.taskbar_stashed_handle_height);
- mLauncherThemedIconsBackgroundColor = ThemedIconDrawable.getColors(mActivity)[0];
- if (!Utilities.isDarkTheme(mActivity)) {
- mTaskbarThemedIconsBackgroundColor = mLauncherThemedIconsBackgroundColor;
- } else {
- // Increase luminance for dark themed icons given they are on a dark Taskbar background.
- float[] colorHSL = new float[3];
- ColorUtils.colorToHSL(mLauncherThemedIconsBackgroundColor, colorHSL);
- colorHSL[2] = TASKBAR_DARK_THEME_ICONS_BACKGROUND_LUMINANCE;
- mTaskbarThemedIconsBackgroundColor = ColorUtils.HSLToColor(colorHSL);
- }
+
mIsRtl = Utilities.isRtl(mTaskbarView.getResources());
mTaskbarLeftRightMargin = mActivity.getResources().getDimensionPixelSize(
R.dimen.transient_taskbar_padding);
@@ -470,18 +451,6 @@
return taskbarIconTranslationYForPinningValue;
}
- /**
- * Updates the Taskbar's themed icons background according to the progress between in-app/home.
- */
- protected void updateIconsBackground() {
- mTaskbarView.setThemedIconsBackgroundColor(
- ColorUtils.blendARGB(
- mLauncherThemedIconsBackgroundColor,
- mTaskbarThemedIconsBackgroundColor,
- mThemedIconsBackgroundProgress.value
- ));
- }
-
private ValueAnimator createRevealAnimForView(View view, boolean isStashed, float newWidth,
boolean isQsb, boolean dispatchOnAnimationStart) {
Rect viewBounds = new Rect(0, 0, view.getWidth(), view.getHeight());
@@ -679,10 +648,6 @@
setter.setFloat(mTaskbarNavButtonTranslationY, VALUE, -offsetY, interpolator);
setter.setFloat(mTaskbarNavButtonTranslationYForInAppDisplay, VALUE, offsetY, interpolator);
- if (Utilities.isDarkTheme(mTaskbarView.getContext())) {
- setter.addFloat(mThemedIconsBackgroundProgress, VALUE, 1f, 0f, LINEAR);
- }
-
int collapsedHeight = mActivity.getDefaultTaskbarWindowSize();
int expandedHeight = Math.max(collapsedHeight, taskbarDp.taskbarHeight + offsetY);
setter.addOnFrameListener(anim -> mActivity.setTaskbarWindowSize(