diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index 24aac10a26..87afd6bc52 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -17,9 +17,11 @@ */ --> + @android:color/system_neutral1_0 @android:color/system_neutral1_50 @android:color/system_neutral2_100 @android:color/system_neutral2_300 + @android:color/system_neutral1_1000 @android:color/system_neutral1_800 @android:color/system_neutral1_900 @android:color/system_neutral2_700 diff --git a/res/values/attrs.xml b/res/values/attrs.xml index dbb40d591c..7fe53d5ae7 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -22,6 +22,7 @@ + diff --git a/res/values/colors.xml b/res/values/colors.xml index 7d48adfc6c..8a2cada827 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -41,9 +41,11 @@ #FF000000 #B7F29F + #FFF #FFF #F1F3F4 #E0E0E0 + #3C4043 #3C4043 #202124 #757575 diff --git a/res/values/styles.xml b/res/values/styles.xml index 37b7e2d14f..bae1485a93 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -35,6 +35,7 @@ 46 #66FFFFFF @style/AllAppsTheme + @color/popup_color_neutral_light @color/popup_color_primary_light @color/popup_color_secondary_light @color/popup_color_tertiary_light @@ -99,6 +100,7 @@ 102 #80000000 @style/AllAppsTheme.Dark + @color/popup_color_neutral_dark @color/popup_color_primary_dark @color/popup_color_secondary_dark @color/popup_color_tertiary_dark diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index 373653829b..c19dfe9300 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -16,6 +16,7 @@ package com.android.launcher3.popup; +import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; @@ -48,12 +49,14 @@ import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.LauncherAnimUtils; +import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.shortcuts.DeepShortcutView; +import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.util.Themes; import com.android.launcher3.views.BaseDragLayer; @@ -65,7 +68,8 @@ import java.util.Collections; * * @param The activity on with the popup shows */ -public abstract class ArrowPopup extends AbstractFloatingView { +public abstract class ArrowPopup> + extends AbstractFloatingView { // +1 for system shortcut view private static final int MAX_NUM_CHILDREN = MAX_SHORTCUTS + 1; @@ -139,14 +143,21 @@ public abstract class ArrowPopup extends Abstrac mRoundedBottom.setCornerRadii(new float[] { smallerRadius, smallerRadius, smallerRadius, smallerRadius, mOutlineRadius, mOutlineRadius, mOutlineRadius, mOutlineRadius}); - int primaryColor = Themes.getAttrColor(context, R.attr.popupColorPrimary); - int secondaryColor = Themes.getAttrColor(context, R.attr.popupColorSecondary); - ArgbEvaluator argb = new ArgbEvaluator(); - mColors = new int[MAX_NUM_CHILDREN]; - // Interpolate between the two colors, exclusive. - float step = 1f / (MAX_NUM_CHILDREN + 1); - for (int i = 0; i < mColors.length; ++i) { - mColors[i] = (int) argb.evaluate((i + 1) * step, primaryColor, secondaryColor); + boolean isAboveAnotherSurface = getTopOpenViewWithType(mLauncher, TYPE_FOLDER) != null + || mLauncher.getStateManager().getState() == LauncherState.ALL_APPS; + if (isAboveAnotherSurface) { + mColors = new int[] { Themes.getAttrColor(context, R.attr.popupColorNeutral) }; + } else { + int primaryColor = Themes.getAttrColor(context, R.attr.popupColorPrimary); + int secondaryColor = Themes.getAttrColor(context, R.attr.popupColorSecondary); + ArgbEvaluator argb = new ArgbEvaluator(); + mColors = new int[MAX_NUM_CHILDREN]; + // Interpolate between the two colors, exclusive. + float step = 1f / (MAX_NUM_CHILDREN + 1); + for (int i = 0; i < mColors.length; ++i) { + mColors[i] = + (int) argb.evaluate((i + 1) * step, primaryColor, secondaryColor); + } } } diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index c282ae8287..1659e6d9cf 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -46,6 +46,7 @@ import com.android.launcher3.DragSource; import com.android.launcher3.DropTarget; import com.android.launcher3.DropTarget.DragObject; import com.android.launcher3.Launcher; +import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.accessibility.LauncherAccessibilityDelegate; import com.android.launcher3.accessibility.ShortcutMenuAccessibilityDelegate; @@ -60,10 +61,10 @@ import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.notification.NotificationInfo; import com.android.launcher3.notification.NotificationItemView; import com.android.launcher3.notification.NotificationKeyData; -import com.android.launcher3.notification.NotificationMainView; import com.android.launcher3.popup.PopupDataProvider.PopupDataChangeListener; import com.android.launcher3.shortcuts.DeepShortcutView; import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; +import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.ShortcutUtil; @@ -81,8 +82,8 @@ import java.util.stream.Collectors; * * @param The activity on with the popup shows */ -public class PopupContainerWithArrow extends ArrowPopup - implements DragSource, DragController.DragListener { +public class PopupContainerWithArrow> + extends ArrowPopup implements DragSource, DragController.DragListener { private final List mShortcuts = new ArrayList<>(); private final PointF mInterceptTouchDown = new PointF();