Merge "Add screen record to FallbackRecentsTest#goToOverviewFromHome" into tm-dev
diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml
index 8deb58e..6b36b5a 100644
--- a/quickstep/res/values-ru/strings.xml
+++ b/quickstep/res/values-ru/strings.xml
@@ -76,8 +76,7 @@
<string name="allset_title" msgid="5021126669778966707">"Готово!"</string>
<string name="allset_hint" msgid="2384632994739392447">"Чтобы перейти на главный экран, проведите вверх."</string>
<string name="allset_description" msgid="6350320429953234580">"Теперь вы можете использовать телефон."</string>
- <!-- no translation found for allset_description_tablet (7332070270570039247) -->
- <skip />
+ <string name="allset_description_tablet" msgid="7332070270570039247">"Теперь вы можете использовать планшет."</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Системные настройки навигации"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Поделиться"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Скриншот"</string>
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 0b537e2..8291475 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -28,6 +28,7 @@
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.core.graphics.ColorUtils;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.Insettable;
@@ -35,6 +36,7 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderIcon;
+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;
@@ -43,14 +45,17 @@
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.AllAppsButton;
+import com.android.launcher3.views.DoubleShadowBubbleTextView;
/**
* Hosts the Taskbar content such as Hotseat and Recent Apps. Drawn on top of other apps.
*/
public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconParent, Insettable {
- private final int[] mTempOutLocation = new int[2];
+ private static final float TASKBAR_BACKGROUND_LUMINANCE = 0.30f;
+ public int mThemeIconsBackground;
+ private final int[] mTempOutLocation = new int[2];
private final Rect mIconLayoutBounds = new Rect();
private final int mIconTouchSize;
private final int mItemMarginLeftRight;
@@ -103,6 +108,8 @@
// Needed to draw folder leave-behind when opening one.
setWillNotDraw(false);
+ mThemeIconsBackground = calculateThemeIconsBackground();
+
if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) {
mAllAppsButton = new AllAppsButton(context);
mAllAppsButton.setLayoutParams(
@@ -111,6 +118,21 @@
}
}
+ private int getColorWithGivenLuminance(int color, float luminance) {
+ float[] colorHSL = new float[3];
+ ColorUtils.colorToHSL(color, colorHSL);
+ colorHSL[2] = luminance;
+ return ColorUtils.HSLToColor(colorHSL);
+ }
+
+ private int calculateThemeIconsBackground() {
+ int color = ThemedIconDrawable.getColors(mContext)[0];
+ if (Utilities.isDarkTheme(mContext)) {
+ return getColorWithGivenLuminance(color, TASKBAR_BACKGROUND_LUMINANCE);
+ }
+ return color;
+ }
+
protected void init(TaskbarViewController.TaskbarViewCallbacks callbacks) {
mControllerCallbacks = callbacks;
mIconClickListener = mControllerCallbacks.getIconOnClickListener();
@@ -219,6 +241,24 @@
int index = Utilities.isRtl(getResources()) ? 0 : getChildCount();
addView(mAllAppsButton, index);
}
+
+ mThemeIconsBackground = calculateThemeIconsBackground();
+ setThemedIconsBackgroundColor(mThemeIconsBackground);
+ }
+
+ /**
+ * 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);
+ }
+ }
+ }
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index a89061b..f5c382d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -27,6 +27,7 @@
import android.view.MotionEvent;
import android.view.View;
+import androidx.core.graphics.ColorUtils;
import androidx.core.view.OneShotPreDrawListener;
import com.android.launcher3.BubbleTextView;
@@ -37,6 +38,7 @@
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
@@ -71,6 +73,9 @@
this::updateTranslationY);
private AnimatedFloat mTaskbarNavButtonTranslationY;
+ private final AnimatedFloat mThemeIconsBackground = new AnimatedFloat(
+ this::updateIconsBackground);
+
private final TaskbarModelCallbacks mModelCallbacks;
// Initialized in init.
@@ -81,6 +86,8 @@
private AnimatorPlaybackController mIconAlignControllerLazy = null;
private Runnable mOnControllerPreCreateCallback = NO_OP;
+ private int mThemeIconsColor;
+
public TaskbarViewController(TaskbarActivityContext activity, TaskbarView taskbarView) {
mActivity = activity;
mTaskbarView = taskbarView;
@@ -93,6 +100,7 @@
mControllers = controllers;
mTaskbarView.init(new TaskbarViewCallbacks());
mTaskbarView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarSize;
+ mThemeIconsColor = ThemedIconDrawable.getColors(mTaskbarView.getContext())[0];
mTaskbarIconScaleForStash.updateValue(1f);
@@ -182,6 +190,15 @@
+ mTaskbarIconTranslationYForStash.value);
}
+ private void updateIconsBackground() {
+ mTaskbarView.setThemedIconsBackgroundColor(
+ ColorUtils.blendARGB(
+ mThemeIconsColor,
+ mTaskbarView.mThemeIconsBackground,
+ mThemeIconsBackground.value
+ ));
+ }
+
/**
* Sets the taskbar icon alignment relative to Launcher hotseat icons
* @param alignmentRatio [0, 1]
@@ -217,6 +234,10 @@
setter.setFloat(mTaskbarIconTranslationYForHome, VALUE, -offsetY, LINEAR);
setter.setFloat(mTaskbarNavButtonTranslationY, VALUE, -offsetY, LINEAR);
+ if (Utilities.isDarkTheme(mTaskbarView.getContext())) {
+ setter.addFloat(mThemeIconsBackground, VALUE, 0f, 1f, LINEAR);
+ }
+
int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight();
int expandedHeight = Math.max(collapsedHeight,
mActivity.getDeviceProfile().taskbarSize + offsetY);
diff --git a/res/color-v31/overview_scrim_dark.xml b/res/color-v31/overview_scrim_dark.xml
index 2ab8ecd..487b9f8 100644
--- a/res/color-v31/overview_scrim_dark.xml
+++ b/res/color-v31/overview_scrim_dark.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="35" />
+ <item android:color="@android:color/system_neutral1_500" android:lStar="15" />
</selector>
diff --git a/src/com/android/launcher3/settings/NotificationDotsPreference.java b/src/com/android/launcher3/settings/NotificationDotsPreference.java
index 0ee2744..f2a052d 100644
--- a/src/com/android/launcher3/settings/NotificationDotsPreference.java
+++ b/src/com/android/launcher3/settings/NotificationDotsPreference.java
@@ -89,7 +89,8 @@
// Update intent
Bundle extras = new Bundle();
extras.putString(EXTRA_FRAGMENT_ARG_KEY, "notification_badging");
- setIntent(new Intent("android.settings.NOTIFICATION_SETTINGS")
+
+ setIntent(new Intent("android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY")
.putExtra(EXTRA_SHOW_FRAGMENT_ARGS, extras));
}