Merge "Revert "Add screenrecord and demote TaplTestsTrackpad#switchToOverview"" into main
diff --git a/Android.bp b/Android.bp
index 13a926b..b205d0c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -19,6 +19,17 @@
min_launcher3_sdk_version = "30"
+// Targets that don't inherit framework aconfig libs (i.e., those that don't set
+// `platform_apis: true`) must manually link them.
+java_defaults {
+ name: "launcher-non-platform-apis-defaults",
+ static_libs: [
+ "android.os.flags-aconfig-java",
+ "android.appwidget.flags-aconfig-java",
+ "com.android.window.flags.window-aconfig-java",
+ ],
+}
+
// Common source files used to build launcher (java and kotlin)
// All sources are split so they can be reused in many other libraries/apps in other folders
@@ -31,6 +42,24 @@
],
}
+// Main Launcher source for compose, excluding the build config
+filegroup {
+ name: "launcher-compose-enabled-src",
+ srcs: [
+ "compose/facade/enabled/*.kt",
+ "compose/facade/core/*.kt",
+ "compose/features/**/*.kt",
+ ],
+}
+
+filegroup {
+ name: "launcher-compose-disabled-src",
+ srcs: [
+ "compose/facade/core/*.kt",
+ "compose/facade/disabled/*.kt",
+ ],
+}
+
// Source code for quickstep build, on top of launcher-src
filegroup {
name: "launcher-quickstep-src",
@@ -40,6 +69,24 @@
],
}
+// Source code for quickstep build with compose enabled, on top of launcher-src
+filegroup {
+ name: "launcher-quickstep-compose-enabled-src",
+ srcs: [
+ "quickstep/compose/facade/core/*.kt",
+ "quickstep/compose/facade/enabled/*.kt",
+ "quickstep/compose/features/**/*.kt",
+ ],
+}
+
+filegroup {
+ name: "launcher-quickstep-compose-disabled-src",
+ srcs: [
+ "quickstep/compose/facade/core/*.kt",
+ "quickstep/compose/facade/disabled/*.kt",
+ ],
+}
+
// Alternate source when quickstep is not included
filegroup {
name: "launcher-src_no_quickstep",
@@ -63,6 +110,114 @@
srcs: ["proguard.flags"],
}
+// Opt-in configuration for Launcher3 code depending on Jetpack Compose.
+soong_config_module_type {
+ name: "launcher_compose_java_defaults",
+ module_type: "java_defaults",
+ config_namespace: "ANDROID",
+ bool_variables: ["release_enable_compose_in_launcher"],
+ properties: [
+ "srcs",
+ "static_libs",
+ ],
+}
+
+// Opt-in configuration for Launcher Quickstep code depending on Jetpack Compose.
+soong_config_bool_variable {
+ name: "release_enable_compose_in_launcher",
+}
+
+soong_config_module_type {
+ name: "quickstep_compose_java_defaults",
+ module_type: "java_defaults",
+ config_namespace: "ANDROID",
+ bool_variables: ["release_enable_compose_in_launcher"],
+ properties: [
+ "srcs",
+ "static_libs",
+ ],
+}
+
+soong_config_module_type {
+ name: "launcher_compose_tests_java_defaults",
+ module_type: "java_defaults",
+ config_namespace: "ANDROID",
+ bool_variables: ["release_enable_compose_in_launcher"],
+ properties: [
+ "static_libs",
+ ],
+}
+
+launcher_compose_java_defaults {
+ name: "launcher_compose_defaults",
+ soong_config_variables: {
+ release_enable_compose_in_launcher: {
+ srcs: [
+ ":launcher-compose-enabled-src",
+ ],
+
+ // Compose dependencies
+ static_libs: [
+ "androidx.compose.runtime_runtime",
+ "androidx.compose.material3_material3",
+ ],
+
+ // By default, Compose is disabled and we compile the ComposeFacade
+ // in compose/launcher3/facade/disabled/.
+ conditions_default: {
+ srcs: [
+ ":launcher-compose-disabled-src",
+ ],
+ static_libs: [],
+ },
+ },
+ },
+}
+
+quickstep_compose_java_defaults {
+ name: "quickstep_compose_defaults",
+ soong_config_variables: {
+ release_enable_compose_in_launcher: {
+ srcs: [
+ ":launcher-quickstep-compose-enabled-src",
+ ],
+
+ // Compose dependencies
+ static_libs: [
+ "androidx.compose.runtime_runtime",
+ "androidx.compose.material3_material3",
+ ],
+
+ // By default, Compose is disabled and we compile the ComposeFacade
+ // in compose/quickstep/facade/disabled/.
+ conditions_default: {
+ srcs: [
+ ":launcher-quickstep-compose-disabled-src",
+ ],
+ static_libs: [],
+ },
+ },
+ },
+}
+
+launcher_compose_tests_java_defaults {
+ name: "launcher_compose_tests_defaults",
+ soong_config_variables: {
+ release_enable_compose_in_launcher: {
+ // Compose dependencies
+ static_libs: [
+ "androidx.compose.runtime_runtime",
+ "androidx.compose.ui_ui-test-junit4",
+ "androidx.compose.ui_ui-test-manifest",
+ ],
+
+ conditions_default: {
+ static_libs: [],
+ },
+ },
+ },
+}
+
android_library {
name: "launcher-aosp-tapl",
libs: [
@@ -76,6 +231,7 @@
"androidx.preference_preference",
"SystemUISharedLib",
"//frameworks/libs/systemui:animationlib",
+ "//frameworks/libs/systemui:contextualeducationlib",
"launcher-testing-shared",
],
srcs: [
@@ -136,12 +292,14 @@
// Library with all the dependencies for building Launcher3
android_library {
name: "Launcher3ResLib",
+ defaults: [
+ "launcher_compose_defaults",
+ ],
srcs: [],
resource_dirs: ["res"],
static_libs: [
"LauncherPluginLib",
"launcher_quickstep_log_protos_lite",
- "android.os.flags-aconfig-java",
"androidx-constraintlayout_constraintlayout",
"androidx.recyclerview_recyclerview",
"androidx.dynamicanimation_dynamicanimation",
@@ -154,6 +312,7 @@
"//frameworks/libs/systemui:iconloader_base",
"//frameworks/libs/systemui:view_capture",
"//frameworks/libs/systemui:animationlib",
+ "//frameworks/libs/systemui:contextualeducationlib",
"SystemUI-statsd",
"launcher-testing-shared",
"androidx.lifecycle_lifecycle-common-java8",
@@ -163,8 +322,9 @@
"kotlinx_coroutines",
"com_android_launcher3_flags_lib",
"com_android_wm_shell_flags_lib",
- "android.appwidget.flags-aconfig-java",
- "com.android.window.flags.window-aconfig-java",
+ "dagger2",
+ "jsr330",
+
],
manifest: "AndroidManifest-common.xml",
sdk_version: "current",
@@ -179,6 +339,7 @@
//
android_app {
name: "Launcher3",
+ defaults: ["launcher-non-platform-apis-defaults"],
static_libs: [
"Launcher3ResLib",
@@ -190,7 +351,7 @@
],
optimize: {
- proguard_flags_files: ["proguard.flags"],
+ proguard_flags_files: [":launcher-proguard-rules"],
// Proguard is disable for testing. Derivarive prjects to keep proguard enabled
enabled: false,
},
@@ -198,6 +359,7 @@
sdk_version: "current",
min_sdk_version: min_launcher3_sdk_version,
target_sdk_version: "current",
+ plugins: ["dagger2-compiler"],
privileged: true,
system_ext_specific: true,
@@ -233,6 +395,7 @@
"lottie",
"SystemUISharedLib",
"SettingsLibSettingsTheme",
+ "dagger2",
],
manifest: "quickstep/AndroidManifest.xml",
min_sdk_version: "current",
@@ -241,6 +404,10 @@
// Library with all the source code and dependencies for building Launcher Go
android_library {
name: "Launcher3GoLib",
+ defaults: [
+ "launcher_compose_defaults",
+ "quickstep_compose_defaults",
+ ],
srcs: [
":launcher-src",
":launcher-quickstep-src",
@@ -258,7 +425,10 @@
"QuickstepResLib",
"androidx.room_room-runtime",
],
- plugins: ["androidx.room_room-compiler-plugin"],
+ plugins: [
+ "androidx.room_room-compiler-plugin",
+ "dagger2-compiler",
+ ],
manifest: "quickstep/AndroidManifest.xml",
additional_manifests: [
"go/AndroidManifest.xml",
@@ -272,6 +442,10 @@
// Library with all the source code and dependencies for building Quickstep
android_library {
name: "Launcher3QuickStepLib",
+ defaults: [
+ "launcher_compose_defaults",
+ "quickstep_compose_defaults",
+ ],
srcs: [
":launcher-src",
":launcher-quickstep-src",
@@ -291,6 +465,7 @@
],
manifest: "quickstep/AndroidManifest.xml",
platform_apis: true,
+ plugins: ["dagger2-compiler"],
min_sdk_version: "current",
// TODO(b/319712088): re-enable use_resource_processor
use_resource_processor: false,
@@ -299,10 +474,11 @@
// Build rule for Quickstep app.
android_app {
name: "Launcher3QuickStep",
-
static_libs: ["Launcher3QuickStepLib"],
optimize: {
- enabled: false,
+ proguard_flags_files: [":launcher-proguard-rules"],
+ enabled: true,
+ shrink_resources: true,
},
platform_apis: true,
@@ -332,13 +508,11 @@
}
-
// Build rule for Launcher3 Go app with quickstep for Android Go devices.
// Note that the following two rules are exactly same, and should
// eventually be merged into a single target
android_app {
name: "Launcher3Go",
-
static_libs: ["Launcher3GoLib"],
resource_dirs: [],
@@ -349,6 +523,7 @@
optimize: {
proguard_flags_files: ["proguard.flags"],
enabled: true,
+ shrink_resources: true,
},
privileged: true,
@@ -372,9 +547,9 @@
include_filter: ["com.android.launcher3.*"],
},
}
+
android_app {
name: "Launcher3QuickStepGo",
-
static_libs: ["Launcher3GoLib"],
resource_dirs: [],
@@ -385,6 +560,7 @@
optimize: {
proguard_flags_files: ["proguard.flags"],
enabled: true,
+ shrink_resources: true,
},
privileged: true,
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index edbea88..80d2eac 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -179,7 +179,7 @@
</intent-filter>
</activity>
- <!-- [b/197780098] Disable eager initialization of Jetpack libraries. -->
+ <!-- Disable eager initialization of Jetpack libraries. See bug 197780098. -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
diff --git a/OWNERS b/OWNERS
index 654493f..22efa33 100644
--- a/OWNERS
+++ b/OWNERS
@@ -28,6 +28,9 @@
tracyzhou@google.com
peanutbutter@google.com
jeremysim@google.com
+atsjenk@google.com
+brianji@google.com
+hwwang@google.com
# Overview eng team
alexchau@google.com
@@ -48,3 +51,6 @@
per-file DeviceConfigWrapper.java, globs = set noparent
per-file DeviceConfigWrapper.java = sunnygoyal@google.com, winsonc@google.com, adamcohen@google.com, hyunyoungs@google.com
+
+# Predictive Back
+per-file LauncherBackAnimationController.java = shanh@google.com, gallmann@google.com
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 3d15e77..9051ca8 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -1,6 +1,13 @@
+[Builtin Hooks]
+ktfmt = true
+
+[Builtin Hooks Options]
+ktfmt = --kotlinlang-style
+
+[Tool Paths]
+ktfmt = ${REPO_ROOT}/external/ktfmt/ktfmt.sh
+
[Hook Scripts]
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --config_xml tools/checkstyle.xml --sha ${PREUPLOAD_COMMIT}
-ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check ${PREUPLOAD_FILES}
-
flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PATH}
diff --git a/aconfig/launcher.aconfig b/aconfig/launcher.aconfig
index 5df29bd..40c3797 100644
--- a/aconfig/launcher.aconfig
+++ b/aconfig/launcher.aconfig
@@ -23,13 +23,6 @@
}
flag {
- name: "enable_grid_only_overview"
- namespace: "launcher"
- description: "Enable a grid-only overview without a focused task."
- bug: "257950105"
-}
-
-flag {
name: "enable_cursor_hover_states"
namespace: "launcher"
description: "Enables cursor hover states for certain elements."
@@ -44,13 +37,6 @@
}
flag {
- name: "enable_overview_icon_menu"
- namespace: "launcher"
- description: "Enable updated overview icon and menu within task."
- bug: "257950105"
-}
-
-flag {
name: "enable_focus_outline"
namespace: "launcher"
description: "Enables focus states outline for launcher."
@@ -79,6 +65,13 @@
}
flag {
+ name: "enable_taskbar_customization"
+ namespace: "launcher"
+ description: "Enables taskbar customization framework."
+ bug: "347281365"
+}
+
+flag {
name: "enable_unfolded_two_pane_picker"
namespace: "launcher"
description: "Enables two pane widget picker for unfolded foldables"
@@ -231,13 +224,6 @@
}
flag {
- name: "enable_refactor_task_thumbnail"
- namespace: "launcher"
- description: "Enables rewritten version of TaskThumbnailViews in Overview"
- bug: "331753115"
-}
-
-flag {
name: "enable_handle_delayed_gesture_callbacks"
namespace: "launcher"
description: "Enables additional handling for delayed mid-gesture callbacks"
@@ -267,3 +253,110 @@
description: "Enables smartspace removal toggle"
bug: "303471576"
}
+
+flag {
+ name: "enable_additional_home_animations"
+ namespace: "launcher"
+ description: "Enables custom home animations for non-running tasks"
+ bug: "237638627"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "enabled_folders_in_all_apps"
+ namespace: "launcher"
+ description: "Enables folders in all apps"
+ bug: "341582436"
+}
+
+flag {
+ name: "enable_recents_in_taskbar"
+ namespace: "launcher"
+ description: "Replace hybrid hotseat app predictions with strictly Recent Apps"
+ bug: "315354060"
+}
+
+flag {
+ name: "enable_first_screen_broadcast_archiving_extras"
+ namespace: "launcher"
+ description: "adds Extras to first screen broadcast for archived apps"
+ bug: "322314760"
+ is_fixed_read_only: true
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "enable_container_return_animations"
+ namespace: "launcher"
+ description: "Enables the container return animation mirroring launches."
+ bug: "341017746"
+}
+
+flag {
+ name: "floating_search_bar"
+ namespace: "launcher"
+ description: "Search bar persists at the bottom of the screen across Launcher states"
+ bug: "346408388"
+}
+
+flag {
+ name: "multiline_search_bar"
+ namespace: "launcher"
+ description: "Search bar can wrap to multi-line"
+ bug: "341795751"
+}
+
+flag {
+ name: "enable_multi_instance_menu_taskbar"
+ namespace: "launcher"
+ description: "Menu in Taskbar with options to launch and manage multiple instances of the same app"
+ bug: "355237285"
+}
+
+flag {
+ name: "navigate_to_child_preference"
+ namespace: "launcher"
+ description: "Settings screen supports navigating to child preference if the key is not on the screen"
+ bug: "293390881"
+}
+
+flag {
+ name: "use_new_icon_for_archived_apps"
+ namespace: "launcher"
+ description: "Archived apps will use new cloud icon in app title instead of overlay"
+ bug: "350758155"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "letter_fast_scroller"
+ namespace: "launcher"
+ description: "Change fast scroller to a lettered list"
+ bug: "358673724"
+}
+
+flag {
+ name: "enable_desktop_task_alpha_animation"
+ namespace: "launcher"
+ description: "Enables the animation of the desktop task's background view"
+ bug: "320307666"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "ignore_three_finger_trackpad_for_nav_handle_long_press"
+ namespace: "launcher"
+ description: "Ignore three finger trackpad event for nav handle long press"
+ bug: "342143522"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/aconfig/launcher_overview.aconfig b/aconfig/launcher_overview.aconfig
new file mode 100644
index 0000000..e11b00c
--- /dev/null
+++ b/aconfig/launcher_overview.aconfig
@@ -0,0 +1,41 @@
+package: "com.android.launcher3"
+container: "system_ext"
+
+flag {
+ name: "enable_grid_only_overview"
+ namespace: "launcher_overview"
+ description: "Enable a grid-only overview without a focused task."
+ bug: "257950105"
+}
+
+flag {
+ name: "enable_overview_icon_menu"
+ namespace: "launcher_overview"
+ description: "Enable updated overview icon and menu within task."
+ bug: "257950105"
+}
+
+flag {
+ name: "enable_refactor_task_thumbnail"
+ namespace: "launcher_overview"
+ description: "Enables rewritten version of TaskThumbnailViews in Overview"
+ bug: "331753115"
+}
+
+flag {
+ name: "enable_hover_of_child_elements_in_taskview"
+ namespace: "launcher_overview"
+ description: "Enables child elements to receive hover events in TaskView and respond visually to those hover events."
+ bug: "342594235"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "enable_large_desktop_windowing_tile"
+ namespace: "launcher_overview"
+ description: "Makes the desktop tiles larger and moves them to the front of the list in Overview."
+ bug: "353947137"
+}
+
diff --git a/aconfig/launcher_search.aconfig b/aconfig/launcher_search.aconfig
index 31d8d34..b98eee6 100644
--- a/aconfig/launcher_search.aconfig
+++ b/aconfig/launcher_search.aconfig
@@ -42,3 +42,14 @@
description: "This flag disables drag and drop for Private Space Items."
bug: "289223923"
}
+
+
+flag {
+ name: "private_space_add_floating_mask_view"
+ namespace: "launcher_search"
+ description: "This flag enables the floating mask view as part of the Private Space animation. "
+ bug: "339850589"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/compose/facade/core/BaseComposeFacade.kt b/compose/facade/core/BaseComposeFacade.kt
new file mode 100644
index 0000000..bc7ba47
--- /dev/null
+++ b/compose/facade/core/BaseComposeFacade.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compose.core
+
+import android.content.Context
+import android.view.View
+
+interface BaseComposeFacade {
+ fun isComposeAvailable(): Boolean
+
+ fun initComposeView(appContext: Context): View
+}
diff --git a/compose/facade/disabled/ComposeFacade.kt b/compose/facade/disabled/ComposeFacade.kt
new file mode 100644
index 0000000..c1cbfff
--- /dev/null
+++ b/compose/facade/disabled/ComposeFacade.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compose
+
+import android.content.Context
+import android.view.View
+import com.android.launcher3.compose.core.BaseComposeFacade
+
+object ComposeFacade : BaseComposeFacade {
+ override fun isComposeAvailable(): Boolean = false
+
+ override fun initComposeView(appContext: Context): View {
+ error(
+ "Compose is not available. Make sure to check isComposeAvailable() before calling any" +
+ " other function on ComposeFacade."
+ )
+ }
+}
diff --git a/compose/facade/enabled/ComposeFacade.kt b/compose/facade/enabled/ComposeFacade.kt
new file mode 100644
index 0000000..d98a979f
--- /dev/null
+++ b/compose/facade/enabled/ComposeFacade.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compose
+
+import android.content.Context
+import android.view.View
+import androidx.compose.ui.platform.ComposeView
+import com.android.launcher3.compose.core.BaseComposeFacade
+
+object ComposeFacade : BaseComposeFacade {
+ override fun isComposeAvailable(): Boolean = true
+
+ override fun initComposeView(appContext: Context): View = ComposeView(appContext)
+}
diff --git a/go/quickstep/res/layout/overview_actions_container.xml b/go/quickstep/res/layout/overview_actions_container.xml
index df09124..e31f462 100644
--- a/go/quickstep/res/layout/overview_actions_container.xml
+++ b/go/quickstep/res/layout/overview_actions_container.xml
@@ -121,15 +121,18 @@
android:layout_weight="1"
android:visibility="gone" />
- <Button
- android:id="@+id/action_save_app_pair"
- style="@style/GoOverviewActionButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableStart="@drawable/ic_save_app_pair_up_down"
- android:text="@string/action_save_app_pair"
- android:theme="@style/ThemeControlHighlightWorkspaceColor"
- android:visibility="gone" />
</LinearLayout>
+ <!-- Unused. Included only for compatibility with parent class. -->
+ <Button
+ android:id="@+id/action_save_app_pair"
+ style="@style/GoOverviewActionButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|center_horizontal"
+ android:drawableStart="@drawable/ic_save_app_pair_up_down"
+ android:text="@string/action_save_app_pair"
+ android:theme="@style/ThemeControlHighlightWorkspaceColor"
+ android:visibility="gone" />
+
</com.android.quickstep.views.GoOverviewActionsView>
\ No newline at end of file
diff --git a/go/quickstep/res/values-be/strings.xml b/go/quickstep/res/values-be/strings.xml
index 83374bb..de8766f 100644
--- a/go/quickstep/res/values-be/strings.xml
+++ b/go/quickstep/res/values-be/strings.xml
@@ -4,7 +4,7 @@
<string name="app_share_drop_target_label" msgid="5804774105974539508">"Абагуліць праграму"</string>
<string name="action_listen" msgid="2370304050784689486">"Праслухаць"</string>
<string name="action_translate" msgid="8028378961867277746">"Перакласці"</string>
- <string name="action_search" msgid="6269564710943755464">"Аб\'ектыў"</string>
+ <string name="action_search" msgid="6269564710943755464">"Аб’ектыў"</string>
<string name="dialog_acknowledge" msgid="2804025517675853172">"ЗРАЗУМЕЛА"</string>
<string name="dialog_cancel" msgid="6464336969134856366">"СКАСАВАЦЬ"</string>
<string name="dialog_settings" msgid="6564397136021186148">"НАЛАДЫ"</string>
diff --git a/go/quickstep/res/values-fa/strings.xml b/go/quickstep/res/values-fa/strings.xml
index 47786e9..8453d4e 100644
--- a/go/quickstep/res/values-fa/strings.xml
+++ b/go/quickstep/res/values-fa/strings.xml
@@ -14,7 +14,7 @@
<string name="assistant_not_selected_text" msgid="3244613673884359276">"برای گوش کردن به نوشتار در صفحهنمایشتان یا ترجمه کردن آن، یکی از برنامههای دستیار دیجیتالی را در «تنظیمات» انتخاب کنید"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"برای استفاده از این ویژگی، دستیارتان را تغییر دهید"</string>
<string name="assistant_not_supported_text" msgid="1708031078549268884">"برای گوش کردن به نوشتار در صفحهنمایشتان یا ترجمه کردن آن، برنامه دستیار دیجیتالیتان را در «تنظیمات» تغییر دهید"</string>
- <string name="tooltip_listen" msgid="7634466447860989102">"برای گوش کردن به نوشتار در این صفحه، اینجا ضربه بزنید"</string>
- <string name="tooltip_translate" msgid="4184845868901542567">"برای ترجمه نوشتار در این صفحه، اینجا ضربه بزنید"</string>
+ <string name="tooltip_listen" msgid="7634466447860989102">"برای گوش کردن به نوشتار در این صفحه، اینجا تکضرب بزنید"</string>
+ <string name="tooltip_translate" msgid="4184845868901542567">"برای ترجمه نوشتار در این صفحه، اینجا تکضرب بزنید"</string>
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"نمیتوان این برنامه را همرسانی کرد"</string>
</resources>
diff --git a/go/quickstep/res/values-fr-rCA/strings.xml b/go/quickstep/res/values-fr-rCA/strings.xml
index 2cc9d8f..e48faeb 100644
--- a/go/quickstep/res/values-fr-rCA/strings.xml
+++ b/go/quickstep/res/values-fr-rCA/strings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_share_drop_target_label" msgid="5804774105974539508">"Partager application"</string>
+ <string name="app_share_drop_target_label" msgid="5804774105974539508">"Partager appli"</string>
<string name="action_listen" msgid="2370304050784689486">"Écouter"</string>
<string name="action_translate" msgid="8028378961867277746">"Traduire"</string>
<string name="action_search" msgid="6269564710943755464">"Lentille"</string>
@@ -9,12 +9,12 @@
<string name="dialog_cancel" msgid="6464336969134856366">"ANNULER"</string>
<string name="dialog_settings" msgid="6564397136021186148">"PARAMÈTRES"</string>
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Traduire ou écouter le texte à l\'écran"</string>
- <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Des renseignements comme du texte sur votre écran, des adresses Web et des captures d\'écran peuvent être partagés avec Google.\n\nPour modifier les renseignements que vous partagez, accédez à "<b>"Paramètres > Applications > Applications par défaut > Application d\'assistant numérique"</b>"."</string>
+ <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Des renseignements comme du texte sur votre écran, des adresses Web et des captures d\'écran peuvent être partagés avec Google.\n\nPour modifier les renseignements que vous partagez, accédez à "<b>"Paramètres > Applis > Applis par défaut > Appli d\'assistant numérique"</b>"."</string>
<string name="assistant_not_selected_title" msgid="5017072974603345228">"Choisir un assistant pour utiliser cette fonctionnalité"</string>
- <string name="assistant_not_selected_text" msgid="3244613673884359276">"Pour écouter ou traduire le texte affiché sur votre écran, choisissez l\'application d\'un assistant numérique dans les paramètres"</string>
+ <string name="assistant_not_selected_text" msgid="3244613673884359276">"Pour écouter ou traduire le texte affiché sur votre écran, choisissez l\'appli d\'un assistant numérique dans les paramètres"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"Modifier votre assistant pour utiliser cette fonctionnalité"</string>
- <string name="assistant_not_supported_text" msgid="1708031078549268884">"Pour écouter ou traduire le texte affiché sur votre écran, modifiez l\'application de votre assistant numérique dans les paramètres"</string>
+ <string name="assistant_not_supported_text" msgid="1708031078549268884">"Pour écouter ou traduire le texte affiché sur votre écran, modifiez l\'appli de votre assistant numérique dans les paramètres"</string>
<string name="tooltip_listen" msgid="7634466447860989102">"Touchez ce bouton pour écouter le texte affiché sur cet écran"</string>
<string name="tooltip_translate" msgid="4184845868901542567">"Touchez ce bouton pour traduire le texte affiché sur cet écran"</string>
- <string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Cette application ne peut pas être partagée"</string>
+ <string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Cette appli ne peut pas être partagée"</string>
</resources>
diff --git a/go/quickstep/res/values-nb/strings.xml b/go/quickstep/res/values-nb/strings.xml
index 662b544..6299cc8 100644
--- a/go/quickstep/res/values-nb/strings.xml
+++ b/go/quickstep/res/values-nb/strings.xml
@@ -9,7 +9,7 @@
<string name="dialog_cancel" msgid="6464336969134856366">"AVBRYT"</string>
<string name="dialog_settings" msgid="6564397136021186148">"INNSTILLINGER"</string>
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Oversett eller lytt til tekst på skjermen"</string>
- <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informasjon som tekst på skjermen, nettadresser og skjermdumper kan deles med Google.\n\nFor å endre hvilken informasjon du deler, gå til "<b>"Innstillinger > Apper > Standardapper > Digital assistent-app"</b>"."</string>
+ <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informasjon som tekst på skjermen, nettadresser og skjermbilder kan deles med Google.\n\nFor å endre hvilken informasjon du deler, gå til "<b>"Innstillinger > Apper > Standardapper > Digital assistent-app"</b>"."</string>
<string name="assistant_not_selected_title" msgid="5017072974603345228">"Velg en assistent for å bruke denne funksjonen"</string>
<string name="assistant_not_selected_text" msgid="3244613673884359276">"For å høre eller oversette tekst på skjermen, velg en digital assistent-app i innstillingene"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"Endre assistenten for å bruke denne funksjonen"</string>
diff --git a/go/quickstep/res/values/styles.xml b/go/quickstep/res/values/styles.xml
index c659331..2524c76 100644
--- a/go/quickstep/res/values/styles.xml
+++ b/go/quickstep/res/values/styles.xml
@@ -16,7 +16,7 @@
-->
<resources>
<!-- App themes -->
- <style name="LauncherTheme" parent="@style/BaseLauncherTheme">
+ <style name="LauncherTheme" parent="@style/DynamicColorsBaseLauncherTheme">
<item name="overviewButtonTextColor">@color/go_overview_text_color</item>
<item name="overviewButtonIconColor">@color/go_overview_text_color</item>
<item name="overviewButtonBackgroundColor">@color/go_overview_button_color</item>
diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
index 0eb8775..0fb9718 100644
--- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
+++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
@@ -31,6 +31,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.drawable.ColorDrawable;
@@ -47,6 +48,7 @@
import android.widget.TextView;
import androidx.annotation.IntDef;
+import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.BaseActivity;
@@ -56,9 +58,8 @@
import com.android.quickstep.util.AssistContentRequester;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.views.GoOverviewActionsView;
-import com.android.quickstep.views.TaskThumbnailViewDeprecated;
+import com.android.quickstep.views.TaskContainer;
import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.recents.model.ThumbnailData;
import java.lang.annotation.Retention;
@@ -101,8 +102,8 @@
/**
* Create a new overlay instance for the given View
*/
- public TaskOverlayGo createOverlay(TaskThumbnailViewDeprecated thumbnailView) {
- return new TaskOverlayGo(thumbnailView, mContentRequester);
+ public TaskOverlayGo createOverlay(TaskContainer taskContainer) {
+ return new TaskOverlayGo(taskContainer, mContentRequester);
}
/**
@@ -120,9 +121,9 @@
private OverlayDialogGo mDialog;
private ArrowTipView mArrowTipView;
- private TaskOverlayGo(TaskThumbnailViewDeprecated taskThumbnailView,
+ private TaskOverlayGo(TaskContainer taskContainer,
AssistContentRequester assistContentRequester) {
- super(taskThumbnailView);
+ super(taskContainer);
mFactoryContentRequester = assistContentRequester;
mSharedPreferences = LauncherPrefs.getPrefs(mApplicationContext);
}
@@ -131,7 +132,7 @@
* Called when the current task is interactive for the user
*/
@Override
- public void initOverlay(Task task, ThumbnailData thumbnail, Matrix matrix,
+ public void initOverlay(Task task, @Nullable Bitmap thumbnail, Matrix matrix,
boolean rotated) {
if (mDialog != null && mDialog.isShowing()) {
// Redraw the dialog in case the layout changed
@@ -148,7 +149,8 @@
// Disable Overview Actions for Work Profile apps
boolean isManagedProfileTask =
UserManager.get(mApplicationContext).isManagedProfile(task.key.userId);
- boolean isAllowedByPolicy = mThumbnailView.isRealSnapshot() && !isManagedProfileTask;
+ boolean isAllowedByPolicy = mTaskContainer.getThumbnailViewDeprecated().isRealSnapshot()
+ && !isManagedProfileTask;
getActionsView().setCallbacks(new OverlayUICallbacksGoImpl(isAllowedByPolicy, task));
mTaskPackageName = task.key.getPackageName();
mSharedPreferences = LauncherPrefs.getPrefs(mApplicationContext);
@@ -162,8 +164,7 @@
int taskId = task.key.id;
mFactoryContentRequester.requestAssistContent(taskId, this::onAssistContentReceived);
- RecentsOrientedState orientedState =
- mThumbnailView.getTaskView().getRecentsView().getPagedViewOrientedState();
+ RecentsOrientedState orientedState = mTaskContainer.getTaskView().getOrientedState();
boolean isInLandscape = orientedState.getDisplayRotation() != ROTATION_0;
// show tooltips in portrait mode only
diff --git a/protos/launcher_atom.proto b/protos/launcher_atom.proto
index 7c648b6..823c821 100644
--- a/protos/launcher_atom.proto
+++ b/protos/launcher_atom.proto
@@ -121,6 +121,20 @@
}
message TaskSwitcherContainer {
+ /**
+ * Indicates the current OrientationHandler in use in Overview.
+ * In fake landscape, the value will be
+ * {@link com.android.quickstep.orientation.LandscapePagedViewHandler} and in real landscape,
+ * the value will be {@link com.android.quickstep.orientation.PortraitPagedViewHandler} for
+ * example.
+ */
+ optional OrientationHandler orientation_handler = 1;
+
+ enum OrientationHandler {
+ PORTRAIT = 0;
+ LANDSCAPE = 1;
+ SEASCAPE = 2;
+ }
}
// Container for taskbar.
diff --git a/quickstep/Android.bp b/quickstep/Android.bp
index f14cebd..1b9c661 100644
--- a/quickstep/Android.bp
+++ b/quickstep/Android.bp
@@ -52,6 +52,14 @@
"tests/src/com/android/quickstep/TaplOverviewIconTest.java",
"tests/src/com/android/quickstep/TaplTestsQuickstep.java",
"tests/src/com/android/quickstep/TaplTestsSplitscreen.java",
- "tests/src/com/android/launcher3/testcomponent/ExcludeFromRecentsTestActivity.java"
+ "tests/src/com/android/launcher3/testcomponent/ExcludeFromRecentsTestActivity.java",
+ ],
+}
+
+filegroup {
+ name: "launcher3-quickstep-screenshot-tests-src",
+ path: "tests/multivalentScreenshotTests",
+ srcs: [
+ "tests/multivalentScreenshotTests/src/**/*.kt",
],
}
diff --git a/quickstep/compose/facade/core/QuickstepComposeFeatures.kt b/quickstep/compose/facade/core/QuickstepComposeFeatures.kt
new file mode 100644
index 0000000..ca9e5c9
--- /dev/null
+++ b/quickstep/compose/facade/core/QuickstepComposeFeatures.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.compose.core
+
+interface QuickstepComposeFeatures
diff --git a/quickstep/compose/facade/disabled/QuickstepComposeFacade.kt b/quickstep/compose/facade/disabled/QuickstepComposeFacade.kt
new file mode 100644
index 0000000..0a4345a
--- /dev/null
+++ b/quickstep/compose/facade/disabled/QuickstepComposeFacade.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.compose
+
+import android.content.Context
+import com.android.launcher3.compose.ComposeFacade
+import com.android.launcher3.compose.core.BaseComposeFacade
+import com.android.quickstep.compose.core.QuickstepComposeFeatures
+
+object QuickstepComposeFacade : BaseComposeFacade, QuickstepComposeFeatures {
+
+ override fun isComposeAvailable() = ComposeFacade.isComposeAvailable()
+
+ override fun initComposeView(appContext: Context) = ComposeFacade.initComposeView(appContext)
+}
diff --git a/quickstep/compose/facade/enabled/QuickstepComposeFacade.kt b/quickstep/compose/facade/enabled/QuickstepComposeFacade.kt
new file mode 100644
index 0000000..97cd300
--- /dev/null
+++ b/quickstep/compose/facade/enabled/QuickstepComposeFacade.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.compose
+
+import android.content.Context
+import com.android.launcher3.compose.ComposeFacade
+import com.android.launcher3.compose.core.BaseComposeFacade
+import com.android.quickstep.compose.core.QuickstepComposeFeatures
+
+object QuickstepComposeFacade : BaseComposeFacade, QuickstepComposeFeatures {
+ override fun isComposeAvailable() = ComposeFacade.isComposeAvailable()
+
+ override fun initComposeView(appContext: Context) = ComposeFacade.initComposeView(appContext)
+}
diff --git a/quickstep/res/color/all_set_bg_primary.xml b/quickstep/res/color/all_set_bg_primary.xml
index 4cf857d..013de7a 100644
--- a/quickstep/res/color/all_set_bg_primary.xml
+++ b/quickstep/res/color/all_set_bg_primary.xml
@@ -15,5 +15,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorPrimaryContainer"/>
+ <item android:color="?attr/materialColorPrimaryContainer"/>
</selector>
diff --git a/quickstep/res/color/all_set_bg_tertiary.xml b/quickstep/res/color/all_set_bg_tertiary.xml
index e62b094..b58d61c 100644
--- a/quickstep/res/color/all_set_bg_tertiary.xml
+++ b/quickstep/res/color/all_set_bg_tertiary.xml
@@ -15,5 +15,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorTertiary"/>
+ <item android:color="?attr/materialColorTertiary"/>
</selector>
diff --git a/quickstep/res/color/bubblebar_drop_target_bg_color.xml b/quickstep/res/color/bubblebar_drop_target_bg_color.xml
index ca37c7f..bae8c4e 100644
--- a/quickstep/res/color/bubblebar_drop_target_bg_color.xml
+++ b/quickstep/res/color/bubblebar_drop_target_bg_color.xml
@@ -15,5 +15,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:alpha="0.35" android:color="?androidprv:attr/materialColorPrimaryContainer" />
+ <item android:alpha="0.35" android:color="?attr/materialColorPrimaryContainer" />
</selector>
\ No newline at end of file
diff --git a/quickstep/res/color/menu_item_hover_state_color.xml b/quickstep/res/color/menu_item_hover_state_color.xml
index 1dd7654..3c68789 100644
--- a/quickstep/res/color/menu_item_hover_state_color.xml
+++ b/quickstep/res/color/menu_item_hover_state_color.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:state_hovered="false" android:color="?androidprv:attr/materialColorSurfaceBright" />
- <item android:state_hovered="true" android:color="?androidprv:attr/materialColorSurfaceVariant" />
+ <item android:state_hovered="false" android:color="?attr/materialColorSurfaceBright" />
+ <item android:state_hovered="true" android:color="?attr/materialColorSurfaceVariant" />
</selector>
\ No newline at end of file
diff --git a/quickstep/res/drawable-hdpi/nav_background.9.png b/quickstep/res/drawable-hdpi/nav_background.9.png
new file mode 100644
index 0000000..a09e654
--- /dev/null
+++ b/quickstep/res/drawable-hdpi/nav_background.9.png
Binary files differ
diff --git a/quickstep/res/drawable-mdpi/nav_background.9.png b/quickstep/res/drawable-mdpi/nav_background.9.png
new file mode 100644
index 0000000..aa74153
--- /dev/null
+++ b/quickstep/res/drawable-mdpi/nav_background.9.png
Binary files differ
diff --git a/quickstep/res/drawable-xhdpi/nav_background.9.png b/quickstep/res/drawable-xhdpi/nav_background.9.png
new file mode 100644
index 0000000..3b52195
--- /dev/null
+++ b/quickstep/res/drawable-xhdpi/nav_background.9.png
Binary files differ
diff --git a/quickstep/res/drawable-xxhdpi/nav_background.9.png b/quickstep/res/drawable-xxhdpi/nav_background.9.png
new file mode 100644
index 0000000..b35183c
--- /dev/null
+++ b/quickstep/res/drawable-xxhdpi/nav_background.9.png
Binary files differ
diff --git a/quickstep/res/drawable/bg_bubble_bar_drop_target.xml b/quickstep/res/drawable/bg_bubble_bar_drop_target.xml
index 79e4318..f597cb5 100644
--- a/quickstep/res/drawable/bg_bubble_bar_drop_target.xml
+++ b/quickstep/res/drawable/bg_bubble_bar_drop_target.xml
@@ -20,5 +20,5 @@
<solid android:color="@color/bubblebar_drop_target_bg_color" />
<stroke
android:width="1dp"
- android:color="?androidprv:attr/materialColorPrimaryContainer" />
+ android:color="?attr/materialColorPrimaryContainer" />
</shape>
diff --git a/quickstep/res/drawable/bg_bubble_expanded_view_drop_target.xml b/quickstep/res/drawable/bg_bubble_expanded_view_drop_target.xml
new file mode 100644
index 0000000..169e396
--- /dev/null
+++ b/quickstep/res/drawable/bg_bubble_expanded_view_drop_target.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:inset="@dimen/bubble_expanded_view_drop_target_padding">
+ <shape
+ android:shape="rectangle">
+ <corners android:radius="@dimen/bubble_expanded_view_drop_target_corner_radius" />
+ <solid android:color="@color/bubblebar_drop_target_bg_color" />
+ <stroke
+ android:width="1dp"
+ android:color="?attr/materialColorPrimaryContainer" />
+ </shape>
+</inset>
diff --git a/quickstep/res/drawable/bg_floating_desktop_select.xml b/quickstep/res/drawable/bg_floating_desktop_select.xml
index d7df338..6481be4 100644
--- a/quickstep/res/drawable/bg_floating_desktop_select.xml
+++ b/quickstep/res/drawable/bg_floating_desktop_select.xml
@@ -19,5 +19,5 @@
android:shape="rectangle">
<corners android:radius="@dimen/rounded_button_radius" />
- <solid android:color="?androidprv:attr/materialColorPrimaryContainer" />
+ <solid android:color="?attr/materialColorPrimaryContainer" />
</shape>
\ No newline at end of file
diff --git a/quickstep/res/drawable/bg_overview_clear_all_button.xml b/quickstep/res/drawable/bg_overview_clear_all_button.xml
index 143761f..0d12274 100644
--- a/quickstep/res/drawable/bg_overview_clear_all_button.xml
+++ b/quickstep/res/drawable/bg_overview_clear_all_button.xml
@@ -21,7 +21,7 @@
<shape android:shape="rectangle"
android:tint="?colorButtonNormal">
<corners android:radius="@dimen/recents_clear_all_outline_radius" />
- <solid android:color="?androidprv:attr/materialColorSurfaceBright"/>
+ <solid android:color="?attr/materialColorSurfaceBright"/>
</shape>
</item>
</ripple>
\ No newline at end of file
diff --git a/quickstep/res/drawable/bg_taskbar_edu_tooltip.xml b/quickstep/res/drawable/bg_taskbar_edu_tooltip.xml
index 20c524d..9e9bb2b 100644
--- a/quickstep/res/drawable/bg_taskbar_edu_tooltip.xml
+++ b/quickstep/res/drawable/bg_taskbar_edu_tooltip.xml
@@ -18,5 +18,5 @@
android:shape="rectangle">
<corners android:radius="@dimen/dialogCornerRadius" />
- <solid android:color="?androidprv:attr/materialColorSurfaceBright"/>
+ <solid android:color="?attr/materialColorSurfaceBright"/>
</shape>
\ No newline at end of file
diff --git a/quickstep/res/drawable/bg_wellbeing_toast.xml b/quickstep/res/drawable/bg_wellbeing_toast.xml
index 0b66849..418caae 100644
--- a/quickstep/res/drawable/bg_wellbeing_toast.xml
+++ b/quickstep/res/drawable/bg_wellbeing_toast.xml
@@ -16,6 +16,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?androidprv:attr/materialColorSecondaryFixed" />
+ <solid android:color="?attr/materialColorSecondaryFixed" />
<corners android:radius="?android:attr/dialogCornerRadius" />
</shape>
\ No newline at end of file
diff --git a/quickstep/res/drawable/ic_chevron_down.xml b/quickstep/res/drawable/ic_chevron_down.xml
index f246cbc..b586e50 100644
--- a/quickstep/res/drawable/ic_chevron_down.xml
+++ b/quickstep/res/drawable/ic_chevron_down.xml
@@ -19,7 +19,7 @@
android:width="48dp"
android:height="48dp"
android:autoMirrored="true"
- android:tint="?androidprv:attr/materialColorOnSurface"
+ android:tint="?attr/materialColorOnSurface"
android:viewportHeight="48"
android:viewportWidth="48">
<group
diff --git a/quickstep/res/drawable/ic_desktop.xml b/quickstep/res/drawable/ic_desktop.xml
index 8de275d..11feca5 100644
--- a/quickstep/res/drawable/ic_desktop.xml
+++ b/quickstep/res/drawable/ic_desktop.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2023 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,17 +14,13 @@
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="32.0dp"
- android:height="32.0dp"
- android:viewportWidth="32.0"
- android:viewportHeight="32.0"
- >
- <group android:scaleX="0.5"
- android:scaleY="0.5"
- android:translateX="6.0"
- android:translateY="6.0">
- <path
- android:fillColor="@android:color/black"
- android:pathData="M5.958,37.708Q4.458,37.708 3.354,36.604Q2.25,35.5 2.25,34V18.292Q2.25,16.792 3.354,15.688Q4.458,14.583 5.958,14.583H9.5V5.958Q9.5,4.458 10.625,3.354Q11.75,2.25 13.208,2.25H34Q35.542,2.25 36.646,3.354Q37.75,4.458 37.75,5.958V21.667Q37.75,23.167 36.646,24.271Q35.542,25.375 34,25.375H30.5V34Q30.5,35.5 29.396,36.604Q28.292,37.708 26.792,37.708ZM5.958,34H26.792Q26.792,34 26.792,34Q26.792,34 26.792,34V21.542H5.958V34Q5.958,34 5.958,34Q5.958,34 5.958,34ZM30.5,21.667H34Q34,21.667 34,21.667Q34,21.667 34,21.667V9.208H13.208V14.583H26.833Q28.375,14.583 29.438,15.667Q30.5,16.75 30.5,18.25Z"/>
- </group>
+ android:width="24dp"
+ android:height="24dp"
+ android:autoMirrored="true"
+ android:tint="?attr/colorControlNormal"
+ android:viewportHeight="960"
+ android:viewportWidth="960">
+ <path
+ android:fillColor="@android:color/black"
+ android:pathData="M240,640L600,640L600,440L240,440L240,640ZM660,520L720,520L720,320L360,320L360,380L660,380L660,520ZM160,800Q127,800 103.5,776.5Q80,753 80,720L80,240Q80,207 103.5,183.5Q127,160 160,160L800,160Q833,160 856.5,183.5Q880,207 880,240L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800ZM160,720L800,720Q800,720 800,720Q800,720 800,720L800,240Q800,240 800,240Q800,240 800,240L160,240Q160,240 160,240Q160,240 160,240L160,720Q160,720 160,720Q160,720 160,720ZM160,720Q160,720 160,720Q160,720 160,720L160,240Q160,240 160,240Q160,240 160,240L160,240Q160,240 160,240Q160,240 160,240L160,720Q160,720 160,720Q160,720 160,720Z" />
</vector>
diff --git a/quickstep/res/drawable/keyboard_quick_switch_overview_button_background.xml b/quickstep/res/drawable/keyboard_quick_switch_overview_button_background.xml
index 2a4f087..8180293 100644
--- a/quickstep/res/drawable/keyboard_quick_switch_overview_button_background.xml
+++ b/quickstep/res/drawable/keyboard_quick_switch_overview_button_background.xml
@@ -17,6 +17,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?androidprv:attr/materialColorSurfaceBright" />
+ <solid android:color="?attr/materialColorSurfaceBright" />
<corners android:radius="@dimen/keyboard_quick_switch_task_view_radius" />
</shape>
diff --git a/quickstep/res/drawable/rotate_tutorial_warning.xml b/quickstep/res/drawable/rotate_tutorial_warning.xml
index d1117a4..90b7d64 100644
--- a/quickstep/res/drawable/rotate_tutorial_warning.xml
+++ b/quickstep/res/drawable/rotate_tutorial_warning.xml
@@ -21,6 +21,6 @@
android:viewportHeight="960"
android:viewportWidth="960">
<path
- android:fillColor="?androidprv:attr/materialColorOnSurface"
+ android:fillColor="?attr/materialColorOnSurface"
android:pathData="M40,840L480,80L920,840L40,840ZM178,760L782,760L480,240L178,760ZM480,720Q497,720 508.5,708.5Q520,697 520,680Q520,663 508.5,651.5Q497,640 480,640Q463,640 451.5,651.5Q440,663 440,680Q440,697 451.5,708.5Q463,720 480,720ZM440,600L520,600L520,400L440,400L440,600ZM480,500L480,500L480,500L480,500Z" />
</vector>
diff --git a/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml b/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml
index 38df756..613edac 100644
--- a/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml
+++ b/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml
@@ -23,7 +23,7 @@
android:importantForAccessibility="yes"
android:background="@drawable/keyboard_quick_switch_task_view_background"
android:clipToOutline="true"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline">
+ launcher:focusBorderColor="?attr/materialColorOutline">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content"
diff --git a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
index e4942ae..40d2322 100644
--- a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
+++ b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
@@ -20,7 +20,7 @@
android:theme="@style/GestureTutorialActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?androidprv:attr/materialColorSurfaceContainer"
+ android:background="?attr/materialColorSurfaceContainer"
android:fitsSystemWindows="true">
<androidx.constraintlayout.widget.ConstraintLayout
@@ -163,7 +163,7 @@
android:layout_marginVertical="16dp"
android:text="@string/gesture_tutorial_action_button_label"
android:background="@drawable/gesture_tutorial_action_button_background"
- android:backgroundTint="?androidprv:attr/materialColorPrimary"
+ android:backgroundTint="?attr/materialColorPrimary"
android:stateListAnimator="@null"
app:layout_constraintTop_toBottomOf="@id/guideline"
diff --git a/quickstep/res/layout/bubble_expanded_view_drop_target.xml b/quickstep/res/layout/bubble_expanded_view_drop_target.xml
new file mode 100644
index 0000000..3bd5d31
--- /dev/null
+++ b/quickstep/res/layout/bubble_expanded_view_drop_target.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!-- TODO(b/330585402): replace 600dp height with calculated value -->
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="@dimen/bubble_expanded_view_drop_target_default_width"
+ android:layout_height="@dimen/bubble_expanded_view_drop_target_default_height"
+ android:layout_margin="@dimen/bubble_expanded_view_drop_target_margin"
+ android:background="@drawable/bg_bubble_expanded_view_drop_target"
+ android:elevation="@dimen/bubblebar_elevation" />
\ No newline at end of file
diff --git a/quickstep/res/layout/customizable_taskbar.xml b/quickstep/res/layout/customizable_taskbar.xml
new file mode 100644
index 0000000..e1a80ae
--- /dev/null
+++ b/quickstep/res/layout/customizable_taskbar.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<com.android.launcher3.taskbar.TaskbarDragLayer
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/taskbar_container"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clipChildren="false">
+
+ <!-- TODO(b/349885828) : to be removed in future cl. -->
+ <com.android.launcher3.taskbar.TaskbarView
+ android:id="@+id/taskbar_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:focusable="true"
+ android:importantForAccessibility="yes"
+ android:forceHasOverlappingRendering="false"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="@dimen/transient_taskbar_bottom_margin"
+ android:clipChildren="false" />
+
+ <com.android.launcher3.taskbar.customization.CustomizableTaskbarView
+ android:id="@+id/customizable_taskbar_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:focusable="true"
+ android:importantForAccessibility="yes"
+ android:forceHasOverlappingRendering="false"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="@dimen/transient_taskbar_bottom_margin"
+ android:clipChildren="false" />
+
+ <com.android.launcher3.taskbar.TaskbarScrimView
+ android:id="@+id/taskbar_scrim"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
+ <com.android.launcher3.taskbar.bubbles.BubbleBarView
+ android:id="@+id/taskbar_bubbles"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/bubblebar_size_with_pointer"
+ android:layout_gravity="bottom|end"
+ android:layout_marginHorizontal="@dimen/transient_taskbar_bottom_margin"
+ android:paddingTop="@dimen/bubblebar_pointer_visible_size"
+ android:paddingEnd="@dimen/taskbar_icon_spacing"
+ android:paddingStart="@dimen/taskbar_icon_spacing"
+ android:visibility="gone"
+ android:gravity="center"
+ android:clipChildren="false"
+ android:elevation="@dimen/bubblebar_elevation"
+ />
+
+ <com.android.launcher3.taskbar.navbutton.NearestTouchFrame
+ android:id="@+id/navbuttons_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" >
+
+ <FrameLayout
+ android:id="@+id/start_contextual_buttons"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingStart="@dimen/taskbar_contextual_button_padding"
+ android:paddingEnd="@dimen/taskbar_contextual_button_padding"
+ android:paddingTop="@dimen/taskbar_contextual_padding_top"
+ android:gravity="center_vertical"
+ android:layout_gravity="start"/>
+
+ <LinearLayout
+ android:id="@+id/end_nav_buttons"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:layout_gravity="end"/>
+
+ <FrameLayout
+ android:id="@+id/end_contextual_buttons"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingTop="@dimen/taskbar_contextual_padding_top"
+ android:gravity="center_vertical"
+ android:layout_gravity="end"/>
+ </com.android.launcher3.taskbar.navbutton.NearestTouchFrame>
+
+ <com.android.launcher3.taskbar.StashedHandleView
+ android:id="@+id/stashed_handle"
+ tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@color/taskbar_stashed_handle_dark_color"
+ android:clipToOutline="true"
+ android:layout_gravity="bottom"/>
+
+ <com.android.launcher3.taskbar.StashedHandleView
+ android:id="@+id/stashed_bubble_handle"
+ tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:background="@color/taskbar_stashed_handle_dark_color"
+ android:clipToOutline="true"
+ android:layout_gravity="bottom"/>
+
+</com.android.launcher3.taskbar.TaskbarDragLayer>
\ No newline at end of file
diff --git a/quickstep/res/layout/customizable_taskbar_view.xml b/quickstep/res/layout/customizable_taskbar_view.xml
new file mode 100644
index 0000000..f55e1d0
--- /dev/null
+++ b/quickstep/res/layout/customizable_taskbar_view.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <com.android.launcher3.taskbar.customization.TaskbarAllAppsButtonContainer
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintLeft_toLeftOf="@id/guideline1"/>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/guideline1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_percent="0.1" />
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/guideline2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_percent="0.5" />
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/guideline3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_percent="0.7" />
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/guideline4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_percent="0.9" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/digital_wellbeing_toast.xml b/quickstep/res/layout/digital_wellbeing_toast.xml
index 42cddbf..6a99a3b 100644
--- a/quickstep/res/layout/digital_wellbeing_toast.xml
+++ b/quickstep/res/layout/digital_wellbeing_toast.xml
@@ -19,12 +19,12 @@
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
style="@style/TextTitle"
android:layout_width="match_parent"
- android:layout_height="48dp"
+ android:layout_height="@dimen/digital_wellbeing_toast_height"
android:background="@drawable/bg_wellbeing_toast"
android:forceHasOverlappingRendering="false"
android:gravity="center"
android:importantForAccessibility="noHideDescendants"
- android:textColor="?androidprv:attr/materialColorOnSecondaryFixed"
+ android:textColor="?attr/materialColorOnSecondaryFixed"
android:textSize="14sp"
android:autoSizeTextType="uniform"
android:autoSizeMaxTextSize="14sp"/>
\ No newline at end of file
diff --git a/quickstep/res/layout/floating_desktop_app_select.xml b/quickstep/res/layout/floating_desktop_app_select.xml
deleted file mode 100644
index 375fc44..0000000
--- a/quickstep/res/layout/floating_desktop_app_select.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright (C) 2023 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<com.android.quickstep.views.DesktopAppSelectView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/desktop_mode_floating_app_select_height"
- android:layout_gravity="top|center_horizontal"
- android:background="@drawable/bg_floating_desktop_select"
- android:elevation="@dimen/desktop_mode_floating_app_select_elevation"
- android:gravity="center_vertical"
- android:orientation="horizontal">
-
- <TextView
- android:id="@+id/desktop_app_select_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/desktop_mode_floating_app_select_text_margin"
- android:layout_marginStart="@dimen/desktop_mode_floating_app_select_margin"
- android:drawablePadding="@dimen/desktop_mode_floating_app_select_text_margin"
- android:drawableStart="@drawable/ic_desktop"
- android:drawableTint="?androidprv:attr/materialColorOnPrimaryContainer"
- android:fontFamily="google-sans-medium"
- android:gravity="center_vertical"
- android:text="@string/desktop_select_app_toast"
- android:textColor="?androidprv:attr/materialColorOnPrimaryContainer"
- android:textSize="@dimen/desktop_mode_floating_app_select_text_size" />
-
- <Button
- android:id="@+id/close_button"
- style="@android:style/Widget.DeviceDefault.Button.Borderless"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/desktop_mode_floating_app_select_margin"
- android:minWidth="0dp"
- android:fontFamily="google-sans-medium"
- android:text="@string/desktop_button_close_app_toast"
- android:textAllCaps="false"
- android:textColor="?androidprv:attr/materialColorPrimary"
- android:textSize="@dimen/desktop_mode_floating_app_select_text_size" />
-
-</com.android.quickstep.views.DesktopAppSelectView>
diff --git a/quickstep/res/layout/gesture_tutorial_step_menu.xml b/quickstep/res/layout/gesture_tutorial_step_menu.xml
index 668a2e1..7feb882 100644
--- a/quickstep/res/layout/gesture_tutorial_step_menu.xml
+++ b/quickstep/res/layout/gesture_tutorial_step_menu.xml
@@ -20,7 +20,7 @@
android:theme="@style/GestureTutorialActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?androidprv:attr/materialColorSurfaceContainer"
+ android:background="?attr/materialColorSurfaceContainer"
android:fitsSystemWindows="true">
<androidx.constraintlayout.widget.ConstraintLayout
@@ -161,7 +161,7 @@
android:layout_marginVertical="16dp"
android:text="@string/gesture_tutorial_action_button_label"
android:background="@drawable/gesture_tutorial_action_button_background"
- android:backgroundTint="?androidprv:attr/materialColorPrimary"
+ android:backgroundTint="?attr/materialColorPrimary"
android:stateListAnimator="@null"
app:layout_constraintTop_toBottomOf="@id/guideline"
diff --git a/quickstep/res/layout/icon_app_chip_view.xml b/quickstep/res/layout/icon_app_chip_view.xml
index fb9bf99..36ece2a 100644
--- a/quickstep/res/layout/icon_app_chip_view.xml
+++ b/quickstep/res/layout/icon_app_chip_view.xml
@@ -26,7 +26,7 @@
android:importantForAccessibility="no"
android:autoMirrored="true"
android:elevation="@dimen/task_thumbnail_icon_menu_elevation"
- android:background="?androidprv:attr/materialColorSurfaceBright">
+ android:background="?attr/materialColorSurfaceBright">
<!-- ignoring warning because the user of the anchor is a Rect where RTL is not needed -->
<!-- This anchor's bounds is in the expected location after rotations and translations are
diff --git a/quickstep/res/layout/keyboard_quick_switch_taskview.xml b/quickstep/res/layout/keyboard_quick_switch_taskview.xml
index c0ace9a..8f09176 100644
--- a/quickstep/res/layout/keyboard_quick_switch_taskview.xml
+++ b/quickstep/res/layout/keyboard_quick_switch_taskview.xml
@@ -23,7 +23,7 @@
android:importantForAccessibility="yes"
android:background="@drawable/keyboard_quick_switch_task_view_background"
android:clipToOutline="true"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline">
+ launcher:focusBorderColor="?attr/materialColorOutline">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content"
diff --git a/quickstep/res/layout/keyboard_quick_switch_textonly_taskview.xml b/quickstep/res/layout/keyboard_quick_switch_textonly_taskview.xml
index e48794e..c76a2e3 100644
--- a/quickstep/res/layout/keyboard_quick_switch_textonly_taskview.xml
+++ b/quickstep/res/layout/keyboard_quick_switch_textonly_taskview.xml
@@ -22,7 +22,7 @@
android:layout_height="@dimen/keyboard_quick_switch_taskview_height"
android:clipToOutline="true"
android:importantForAccessibility="yes"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline">
+ launcher:focusBorderColor="?attr/materialColorOutline">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content"
@@ -40,7 +40,7 @@
android:layout_width="@dimen/keyboard_quick_switch_recents_icon_size"
android:layout_height="@dimen/keyboard_quick_switch_recents_icon_size"
android:layout_marginBottom="8dp"
- android:tint="?androidprv:attr/materialColorOnSurface"
+ android:tint="?attr/materialColorOnSurface"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent"
diff --git a/quickstep/res/layout/keyboard_quick_switch_view.xml b/quickstep/res/layout/keyboard_quick_switch_view.xml
index 2bba788..2420a46 100644
--- a/quickstep/res/layout/keyboard_quick_switch_view.xml
+++ b/quickstep/res/layout/keyboard_quick_switch_view.xml
@@ -43,7 +43,7 @@
android:layout_height="@dimen/keyboard_quick_switch_no_recent_items_icon_size"
android:layout_marginBottom="@dimen/keyboard_quick_switch_no_recent_items_icon_margin"
android:src="@drawable/view_carousel"
- android:tint="?androidprv:attr/materialColorOnSurface"
+ android:tint="?attr/materialColorOnSurface"
android:importantForAccessibility="no"
app:layout_constraintVertical_chainStyle="packed"
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index d086da4..fcd2e54 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -45,14 +45,18 @@
android:theme="@style/ThemeControlHighlightWorkspaceColor"
android:visibility="gone" />
- <Button
- android:id="@+id/action_save_app_pair"
- style="@style/OverviewActionButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/action_save_app_pair"
- android:theme="@style/ThemeControlHighlightWorkspaceColor"
- android:visibility="gone" />
</LinearLayout>
+ <!-- Currently, the only "group action button" is this save app pair button. If more are added,
+ a new LinearLayout may be needed to contain them, but beware of increased memory usage. -->
+ <Button
+ android:id="@+id/action_save_app_pair"
+ style="@style/OverviewActionButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action_save_app_pair"
+ android:theme="@style/ThemeControlHighlightWorkspaceColor"
+ android:layout_gravity="bottom|center_horizontal"
+ android:visibility="gone" />
+
</com.android.quickstep.views.OverviewActionsView>
\ No newline at end of file
diff --git a/quickstep/res/layout/overview_clear_all_button.xml b/quickstep/res/layout/overview_clear_all_button.xml
index 3380ea4..40f38f4 100644
--- a/quickstep/res/layout/overview_clear_all_button.xml
+++ b/quickstep/res/layout/overview_clear_all_button.xml
@@ -23,6 +23,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recents_clear_all"
- android:textColor="?androidprv:attr/materialColorOnSurface"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline"
+ android:textColor="?attr/materialColorOnSurface"
+ launcher:focusBorderColor="?attr/materialColorOutline"
android:textSize="14sp" />
\ No newline at end of file
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
index a1bcad0..b004dfd 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
@@ -134,11 +134,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
+ android:layout_above="@id/gesture_tutorial_fragment_action_button"
android:layout_centerHorizontal="true"
android:background="@android:color/transparent"
- android:paddingEnd="24dp"
- android:paddingStart="24dp"
- android:paddingTop="24dp">
+ android:paddingTop="24dp"
+ android:paddingHorizontal="24dp"
+ android:layout_marginBottom="16dp">
<TextView
android:id="@+id/gesture_tutorial_fragment_feedback_title"
@@ -169,7 +170,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- app:layout_constraintBottom_toBottomOf="@id/gesture_tutorial_fragment_action_button"
+ app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -193,7 +194,7 @@
android:id="@+id/checkmark_animation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="44dp"
+ android:layout_marginBottom="28dp"
android:gravity="center"
android:scaleType="centerCrop"
app:lottie_loop="false"
@@ -204,19 +205,6 @@
app:layout_constraintTop_toBottomOf="@id/gesture_tutorial_fragment_feedback_subtitle"
app:layout_constraintBottom_toBottomOf="parent" />
- <Button
- android:id="@+id/gesture_tutorial_fragment_action_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/gesture_tutorial_action_button_background"
- android:stateListAnimator="@null"
- android:text="@string/gesture_tutorial_action_button_label"
- android:visibility="invisible"
- android:layout_marginBottom="60dp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/checkmark_animation" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -228,4 +216,18 @@
android:src="@drawable/gesture_tutorial_finger_dot"
android:visibility="gone" />
+ <Button
+ android:id="@+id/gesture_tutorial_fragment_action_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/gesture_tutorial_done_button_end_margin"
+ android:layout_marginBottom="@dimen/gesture_tutorial_done_button_bottom_margin"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:background="@drawable/gesture_tutorial_action_button_background"
+ android:stateListAnimator="@null"
+ android:text="@string/gesture_tutorial_action_button_label"
+ android:visibility="invisible"
+ />
+
</com.android.quickstep.interaction.RootSandboxLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/split_instructions_view.xml b/quickstep/res/layout/split_instructions_view.xml
index 1115ff2..a11974c 100644
--- a/quickstep/res/layout/split_instructions_view.xml
+++ b/quickstep/res/layout/split_instructions_view.xml
@@ -29,6 +29,7 @@
android:id="@+id/split_instructions_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:maxWidth="@dimen/split_instructions_view_max_width"
android:textColor="?androidprv:attr/textColorOnAccent"
android:text="@string/toast_split_select_app" />
@@ -36,8 +37,10 @@
android:id="@+id/split_instructions_text_cancel"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
android:textColor="?androidprv:attr/textColorOnAccent"
android:layout_marginStart="@dimen/split_instructions_start_margin_cancel"
android:text="@string/toast_split_select_app_cancel"
+ android:textStyle="bold"
android:visibility="gone"/>
</com.android.quickstep.views.SplitInstructionsView>
\ No newline at end of file
diff --git a/quickstep/res/layout/task.xml b/quickstep/res/layout/task.xml
index 9f648a7..34193d3 100644
--- a/quickstep/res/layout/task.xml
+++ b/quickstep/res/layout/task.xml
@@ -19,19 +19,16 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
- android:id="@+id/task"
+ android:id="@+id/task_view_single"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:defaultFocusHighlightEnabled="false"
android:focusable="true"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline"
- launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary">
+ launcher:focusBorderColor="?attr/materialColorOutline"
+ launcher:hoverBorderColor="?attr/materialColorPrimary">
- <com.android.quickstep.views.TaskThumbnailViewDeprecated
- android:id="@+id/snapshot"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ <include layout="@layout/task_thumbnail_deprecated" />
<!-- Filtering affects only alpha instead of the visibility since visibility can be altered
separately through RecentsView#resetFromSplitSelectionState() -->
diff --git a/quickstep/res/layout/task_desktop.xml b/quickstep/res/layout/task_desktop.xml
index 36d7f86..1564653 100644
--- a/quickstep/res/layout/task_desktop.xml
+++ b/quickstep/res/layout/task_desktop.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,20 +14,19 @@
limitations under the License.
-->
-<com.android.quickstep.views.DesktopTaskView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+<com.android.quickstep.views.DesktopTaskView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
- android:id="@+id/task"
+ android:id="@+id/task_view_desktop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="true"
+ android:clipToPadding="true"
+ android:contentDescription="@string/recent_task_desktop"
android:defaultFocusHighlightEnabled="false"
android:focusable="true"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline"
- launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary"
- android:clipToPadding="true"
- android:padding="0.1dp">
+ android:padding="0.1dp"
+ launcher:focusBorderColor="?attr/materialColorOutline"
+ launcher:hoverBorderColor="?attr/materialColorPrimary">
<!-- Setting a padding of 0.1 dp since android:clipToPadding needs a non-zero value for
padding to work-->
<View
@@ -36,22 +34,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
- <!--
- TODO(b249371338): DesktopTaskView extends from TaskView. TaskView expects TaskThumbnailView
- and IconView with these ids to be present. Need to refactor RecentsView to accept child
- views that do not inherint from TaskView only or create a generic TaskView that have
- N number of tasks.
- -->
- <com.android.quickstep.views.TaskThumbnailViewDeprecated
- android:id="@+id/snapshot"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone" />
-
<ViewStub
android:id="@+id/icon"
- android:inflatedId="@id/icon"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_width="wrap_content" />
+ android:inflatedId="@id/icon" />
</com.android.quickstep.views.DesktopTaskView>
diff --git a/quickstep/res/layout/task_grouped.xml b/quickstep/res/layout/task_grouped.xml
index ec657bd..cb4b98f 100644
--- a/quickstep/res/layout/task_grouped.xml
+++ b/quickstep/res/layout/task_grouped.xml
@@ -24,24 +24,19 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
- android:id="@+id/task"
+ android:id="@+id/task_view_grouped"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:defaultFocusHighlightEnabled="false"
android:focusable="true"
- launcher:focusBorderColor="?androidprv:attr/materialColorOutline"
- launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary">
+ launcher:focusBorderColor="?attr/materialColorOutline"
+ launcher:hoverBorderColor="?attr/materialColorPrimary">
- <com.android.quickstep.views.TaskThumbnailViewDeprecated
- android:id="@+id/snapshot"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ <include layout="@layout/task_thumbnail_deprecated"/>
- <com.android.quickstep.views.TaskThumbnailViewDeprecated
- android:id="@+id/bottomright_snapshot"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ <include layout="@layout/task_thumbnail_deprecated"
+ android:id="@+id/bottomright_snapshot" />
<!-- Filtering affects only alpha instead of the visibility since visibility can be altered
separately through RecentsView#resetFromSplitSelectionState() -->
diff --git a/quickstep/res/layout/task_thumbnail.xml b/quickstep/res/layout/task_thumbnail.xml
new file mode 100644
index 0000000..d90d916
--- /dev/null
+++ b/quickstep/res/layout/task_thumbnail.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<com.android.quickstep.task.thumbnail.TaskThumbnailView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <com.android.quickstep.views.FixedSizeImageView
+ android:id="@+id/task_thumbnail"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:importantForAccessibility="no"
+ android:scaleType="matrix"
+ android:visibility="invisible"/>
+
+ <com.android.quickstep.task.thumbnail.LiveTileView
+ android:id="@+id/task_thumbnail_live_tile"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="invisible"/>
+
+ <View
+ android:id="@+id/task_thumbnail_scrim"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/overview_foreground_scrim_color"
+ android:alpha="0" />
+
+ <View
+ android:id="@+id/splash_background"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black"
+ android:alpha="0"
+ android:importantForAccessibility="no" />
+
+ <com.android.quickstep.views.FixedSizeImageView
+ android:id="@+id/splash_icon"
+ android:layout_width="@dimen/task_thumbnail_splash_icon_size"
+ android:layout_height="@dimen/task_thumbnail_splash_icon_size"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ android:scaleType="fitCenter"
+ android:alpha="0"
+ android:importantForAccessibility="no" />
+</com.android.quickstep.task.thumbnail.TaskThumbnailView>
\ No newline at end of file
diff --git a/quickstep/res/layout/task_thumbnail_deprecated.xml b/quickstep/res/layout/task_thumbnail_deprecated.xml
new file mode 100644
index 0000000..f1a3d62
--- /dev/null
+++ b/quickstep/res/layout/task_thumbnail_deprecated.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<com.android.quickstep.views.TaskThumbnailViewDeprecated
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/snapshot"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
\ No newline at end of file
diff --git a/quickstep/res/layout/task_view_menu_option.xml b/quickstep/res/layout/task_view_menu_option.xml
index ffe2401..5218de0 100644
--- a/quickstep/res/layout/task_view_menu_option.xml
+++ b/quickstep/res/layout/task_view_menu_option.xml
@@ -31,7 +31,7 @@
android:layout_height="@dimen/system_shortcut_icon_size"
android:layout_marginStart="@dimen/task_menu_option_start_margin"
android:layout_gravity="center_horizontal"
- android:backgroundTint="?androidprv:attr/materialColorOnSurface"/>
+ android:backgroundTint="?attr/materialColorOnSurface"/>
<TextView
style="@style/BaseIcon"
@@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/task_menu_option_text_start_margin"
android:textSize="14sp"
- android:textColor="?androidprv:attr/materialColorOnSurface"
+ android:textColor="?attr/materialColorOnSurface"
android:focusable="false"
android:gravity="start"
android:ellipsize="end" />
diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index 736706a..e8f3d9d 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -35,6 +35,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
+ <com.android.launcher3.taskbar.bubbles.BubbleBarView
+ android:id="@+id/taskbar_bubbles"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/bubblebar_size_with_pointer"
+ android:layout_marginHorizontal="@dimen/transient_taskbar_bottom_margin"
+ android:paddingTop="@dimen/bubblebar_pointer_visible_size"
+ android:visibility="gone"
+ android:gravity="center"
+ android:layout_gravity="bottom"
+ android:clipChildren="false"
+ android:elevation="@dimen/bubblebar_elevation" />
+
<com.android.launcher3.taskbar.navbutton.NearestTouchFrame
android:id="@+id/navbuttons_view"
android:layout_width="match_parent"
diff --git a/quickstep/res/layout/taskbar_divider_popup_menu.xml b/quickstep/res/layout/taskbar_divider_popup_menu.xml
index 7f4f76c..b184191 100644
--- a/quickstep/res/layout/taskbar_divider_popup_menu.xml
+++ b/quickstep/res/layout/taskbar_divider_popup_menu.xml
@@ -16,8 +16,9 @@
-->
<com.android.launcher3.taskbar.TaskbarDividerPopupView
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/taskbar_pinning_popup_menu_width"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:minWidth="@dimen/taskbar_pinning_popup_menu_width"
android:focusable="true"
android:background="@drawable/popup_background"
android:orientation="vertical">
@@ -51,14 +52,13 @@
android:layout_height="wrap_content"
android:id="@+id/taskbar_pinning_switch"
android:background="@null"
- android:clickable="false"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
android:paddingStart="12dp"
+ android:switchPadding="12dp"
android:layout_weight="1"
android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
android:lines="1"
- android:ellipsize="end"
android:textSize="14sp"
android:textColor="?android:attr/textColorPrimary"
android:text="@string/always_show_taskbar" />
diff --git a/quickstep/res/layout/taskbar_nav_button.xml b/quickstep/res/layout/taskbar_nav_button.xml
index aea4885..8f1c904 100644
--- a/quickstep/res/layout/taskbar_nav_button.xml
+++ b/quickstep/res/layout/taskbar_nav_button.xml
@@ -19,6 +19,7 @@
android:layout_width="@dimen/taskbar_nav_buttons_size"
android:layout_height="@dimen/taskbar_nav_buttons_size"
android:background="@drawable/taskbar_icon_click_feedback_roundrect"
+ android:focusable="false"
android:scaleType="center"
android:tint="@color/taskbar_nav_icon_light_color"
tools:ignore="UseAppTint" />
\ No newline at end of file
diff --git a/quickstep/res/layout/transient_taskbar.xml b/quickstep/res/layout/transient_taskbar.xml
index 7c55bf8..f3c3383 100644
--- a/quickstep/res/layout/transient_taskbar.xml
+++ b/quickstep/res/layout/transient_taskbar.xml
@@ -45,8 +45,6 @@
android:layout_gravity="bottom|end"
android:layout_marginHorizontal="@dimen/transient_taskbar_bottom_margin"
android:paddingTop="@dimen/bubblebar_pointer_visible_size"
- android:paddingEnd="@dimen/taskbar_icon_spacing"
- android:paddingStart="@dimen/taskbar_icon_spacing"
android:visibility="gone"
android:gravity="center"
android:clipChildren="false"
diff --git a/quickstep/res/raw-sw600dp-land/all_set_page_bg.json b/quickstep/res/raw-sw600dp-land/all_set_page_bg.json
deleted file mode 100644
index 63b64da..0000000
--- a/quickstep/res/raw-sw600dp-land/all_set_page_bg.json
+++ /dev/null
@@ -1 +0,0 @@
-{"v":"5.8.1","fr":60,"ip":0,"op":181,"w":841,"h":701,"nm":"SUW_WelcomeScreen_FoldableOpen_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":".primary","cl":"primary","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[55]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.939},"o":{"x":0.167,"y":0.167},"t":0,"s":[140.975,228.318,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.045},"t":95,"s":[140.975,47.65,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[140.975,228.318,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[18,18,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[100.594,-128.921],[118.85,-93.491],[148.984,-67.406],[148.684,-27.55],[163.244,9.552],[144.457,44.702],[140.106,84.321],[107.136,106.715],[84.872,139.773],[45.271,144.279],[10.194,163.205],[-26.964,148.792],[-66.818,149.249],[-93.023,119.218],[-128.524,101.101],[-137.771,62.332],[-160.786,29.793],[-150.957,-8.833],[-156.215,-48.341],[-129.561,-77.974],[-115.856,-115.401],[-78.484,-129.253],[-48.956,-156.023],[-9.427,-150.921],[29.159,-160.903],[61.789,-138.015]],"o":[[-100.594,128.921],[-118.85,93.491],[-148.984,67.406],[-148.684,27.55],[-163.244,-9.552],[-144.456,-44.702],[-140.106,-84.321],[-107.136,-106.715],[-84.872,-139.773],[-45.271,-144.279],[-10.194,-163.205],[26.964,-148.792],[66.818,-149.249],[93.023,-119.218],[128.524,-101.101],[137.771,-62.332],[160.786,-29.793],[150.957,8.833],[156.215,48.341],[129.561,77.974],[115.856,115.4],[78.484,129.253],[48.956,156.023],[9.427,150.921],[-29.159,160.903],[-61.789,138.015]],"v":[[975.226,761.299],[707.165,899.424],[509.8,1127.42],[208.253,1125.148],[-72.46,1235.308],[-338.41,1093.162],[-638.164,1060.25],[-807.592,810.792],[-1057.715,642.348],[-1091.808,342.727],[-1235.002,77.338],[-1125.948,-203.807],[-1129.407,-505.342],[-902.191,-703.604],[-765.123,-972.207],[-471.796,-1042.166],[-225.603,-1216.305],[66.637,-1141.935],[365.557,-1181.715],[589.761,-980.053],[872.928,-876.361],[977.734,-593.606],[1180.277,-370.197],[1141.675,-71.124],[1217.196,220.821],[1044.029,467.699]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":1,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.713725490196,0.556862745098,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[11.111],"t":0,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[11.111],"t":180,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":181,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".tertiary","cl":"tertiary","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[0.619]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[67]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[-0.263]},"t":95,"s":[82]},{"t":180,"s":[67]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[0.913]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[639]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[-0.06]},"t":95,"s":[704]},{"t":180,"s":[639]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.12]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[527.25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.083]},"t":95,"s":[471]},{"t":180,"s":[527.25]}],"ix":4}},"a":{"k":[{"s":[164.438,1433.781,0],"t":0,"i":{"x":1,"y":1},"o":{"x":0,"y":0}},{"s":[164.438,1433.781,0],"t":180,"i":{"x":1,"y":1},"o":{"x":0,"y":0}}],"l":2},"s":{"a":0,"k":[-25,25,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[2361.125,4541.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":1,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.901960784314,0.764705882353,0.423529411765,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[6],"t":0,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[6],"t":180,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":181,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".black","cl":"black","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[420.5,350.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[420.5,-350.5],[-420.5,-350.5],[-420.5,350.5],[420.5,350.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Vector","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":181,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-sw600dp/all_set_page_bg.json b/quickstep/res/raw-sw600dp/all_set_page_bg.json
deleted file mode 100644
index f2998a0..0000000
--- a/quickstep/res/raw-sw600dp/all_set_page_bg.json
+++ /dev/null
@@ -1 +0,0 @@
-{"v":"5.8.1","fr":60,"ip":0,"op":181,"w":701,"h":841,"nm":"SUW_WelcomeScreen_FoldableOpen_Portrait_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":".primary","cl":"primary","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[55]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.949},"o":{"x":0.167,"y":0.167},"t":0,"s":[181.172,148.425,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.038},"t":95,"s":[181.172,-68.377,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[181.172,148.425,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[21.6,21.6,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[100.594,-128.921],[118.85,-93.491],[148.984,-67.406],[148.684,-27.55],[163.244,9.552],[144.457,44.702],[140.106,84.321],[107.136,106.715],[84.872,139.773],[45.271,144.279],[10.194,163.205],[-26.964,148.792],[-66.818,149.249],[-93.023,119.218],[-128.524,101.101],[-137.771,62.332],[-160.786,29.793],[-150.957,-8.833],[-156.215,-48.341],[-129.561,-77.974],[-115.856,-115.401],[-78.484,-129.253],[-48.956,-156.023],[-9.427,-150.921],[29.159,-160.903],[61.789,-138.015]],"o":[[-100.594,128.921],[-118.85,93.491],[-148.984,67.406],[-148.684,27.55],[-163.244,-9.552],[-144.456,-44.702],[-140.106,-84.321],[-107.136,-106.715],[-84.872,-139.773],[-45.271,-144.279],[-10.194,-163.205],[26.964,-148.792],[66.818,-149.249],[93.023,-119.218],[128.524,-101.101],[137.771,-62.332],[160.786,-29.793],[150.957,8.833],[156.215,48.341],[129.561,77.974],[115.856,115.4],[78.484,129.253],[48.956,156.023],[9.427,150.921],[-29.159,160.903],[-61.789,138.015]],"v":[[975.226,761.299],[707.165,899.424],[509.8,1127.42],[208.253,1125.148],[-72.46,1235.308],[-338.41,1093.162],[-638.164,1060.25],[-807.592,810.792],[-1057.715,642.348],[-1091.808,342.727],[-1235.002,77.338],[-1125.948,-203.807],[-1129.407,-505.342],[-902.191,-703.604],[-765.123,-972.207],[-471.796,-1042.166],[-225.603,-1216.305],[66.637,-1141.935],[365.557,-1181.715],[589.761,-980.053],[872.928,-876.361],[977.734,-593.606],[1180.277,-370.197],[1141.675,-71.124],[1217.196,220.821],[1044.029,467.699]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":1,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.713725490196,0.556862745098,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":9.3,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":181,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".tertiary","cl":"tertiary","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[0.619]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[67]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[-0.263]},"t":95,"s":[82]},{"t":180,"s":[67]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[0.927]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[458.803]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[-0.05]},"t":95,"s":[536.803]},{"t":180,"s":[458.803]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.1]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[707.143]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.069]},"t":95,"s":[639.643]},{"t":180,"s":[707.143]}],"ix":4}},"a":{"k":[{"s":[164.438,1433.781,0],"t":0,"i":{"x":1,"y":1},"o":{"x":0,"y":0}},{"s":[164.438,1433.781,0],"t":180,"i":{"x":1,"y":1},"o":{"x":0,"y":0}}],"l":2},"s":{"a":0,"k":[-30,30,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[2361.125,4541.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":1,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.901960784314,0.764705882353,0.423529411765,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":5,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":181,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".black","cl":"black","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":90,"ix":10},"p":{"a":0,"k":[350.5,420.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[420.5,-350.5],[-420.5,-350.5],[-420.5,350.5],[420.5,350.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Vector","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":181,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-sw720dp-land/all_set_page_bg.json b/quickstep/res/raw-sw720dp-land/all_set_page_bg.json
deleted file mode 100644
index a994b0f..0000000
--- a/quickstep/res/raw-sw720dp-land/all_set_page_bg.json
+++ /dev/null
@@ -1 +0,0 @@
-{"v":"5.8.1","fr":60,"ip":0,"op":180,"w":1280,"h":800,"nm":"SUW_WelcomeScreen_Tablet_Landscape_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[288,540,0],"ix":2,"l":2},"a":{"a":0,"k":[50,50,0],"ix":1,"l":2},"s":{"a":0,"k":[25,25,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":600,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".primary","cl":"primary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[56]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.986},"o":{"x":0.167,"y":0.167},"t":0,"s":[375.832,-1006.545,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.01},"t":95,"s":[375.832,-1811,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[375.832,-1006.545,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[110,110,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[75.615,-96.908],[89.338,-70.276],[111.99,-50.668],[111.764,-20.709],[122.709,7.18],[108.586,33.602],[105.316,63.383],[80.533,80.216],[63.797,105.066],[34.03,108.453],[7.663,122.679],[-20.269,111.845],[-50.226,112.189],[-69.924,89.614],[-96.61,75.997],[-103.56,46.854],[-120.861,22.395],[-113.472,-6.639],[-117.425,-36.337],[-97.389,-58.612],[-87.087,-86.745],[-58.996,-97.158],[-36.8,-117.281],[-7.086,-113.445],[21.918,-120.948],[46.446,-103.744]],"o":[[-75.615,96.909],[-89.338,70.276],[-111.99,50.668],[-111.764,20.709],[-122.709,-7.18],[-108.586,-33.602],[-105.316,-63.383],[-80.533,-80.216],[-63.797,-105.066],[-34.03,-108.453],[-7.663,-122.679],[20.269,-111.845],[50.226,-112.188],[69.924,-89.614],[96.61,-75.997],[103.56,-46.854],[120.861,-22.395],[113.472,6.64],[117.425,36.337],[97.389,58.612],[87.088,86.745],[58.995,97.158],[36.8,117.281],[7.087,113.445],[-21.918,120.948],[-46.446,103.744]],"v":[[733.209,572.105],[531.711,675.932],[383.354,847.313],[156.685,845.606],[-54.323,928.412],[-254.235,821.562],[-479.555,796.823],[-606.913,609.309],[-794.927,482.691],[-820.554,257.47],[-928.191,57.981],[-846.217,-153.353],[-848.817,-380.013],[-678.021,-529.044],[-574.99,-730.949],[-354.499,-783.537],[-169.439,-914.435],[50.234,-858.532],[274.928,-888.434],[443.46,-736.847],[656.313,-658.903],[735.094,-446.359],[887.344,-278.426],[858.327,-53.616],[915.095,165.835],[784.928,351.409]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.956862745098,0.729411764706,0.619607843137,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":720,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".tertiary","cl":"tertiary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.248]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[57]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.172]},"t":95,"s":[75]},{"t":180,"s":[57]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.032]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[2618]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.022]},"t":95,"s":[2442]},{"t":180,"s":[2618]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.034]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[891]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.024]},"t":95,"s":[694]},{"t":180,"s":[891]}],"ix":4}},"a":{"a":0,"k":[164.438,1433.781,0],"ix":1,"l":2},"s":{"a":0,"k":[120,120,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[3079.125,4685.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.752941176471,0.788235294118,0.752941176471,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-sw720dp/all_set_page_bg.json b/quickstep/res/raw-sw720dp/all_set_page_bg.json
deleted file mode 100644
index 1030ffa..0000000
--- a/quickstep/res/raw-sw720dp/all_set_page_bg.json
+++ /dev/null
@@ -1 +0,0 @@
-{"v":"5.8.1","fr":60,"ip":0,"op":180,"w":800,"h":1280,"nm":"SUW_WelcomeScreen_Tablet_Portrait_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[288,528,0],"ix":2,"l":2},"a":{"a":0,"k":[50,50,0],"ix":1,"l":2},"s":{"a":0,"k":[25,25,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":600,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".primary","cl":"primary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[56]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.986},"o":{"x":0.167,"y":0.167},"t":0,"s":[999.832,-2238.545,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.01},"t":95,"s":[999.832,-3043,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[999.832,-2238.545,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[200,200,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[75.615,-96.908],[89.338,-70.276],[111.99,-50.668],[111.764,-20.709],[122.709,7.18],[108.586,33.602],[105.316,63.383],[80.533,80.216],[63.797,105.066],[34.03,108.453],[7.663,122.679],[-20.269,111.845],[-50.226,112.189],[-69.924,89.614],[-96.61,75.997],[-103.56,46.854],[-120.861,22.395],[-113.472,-6.639],[-117.425,-36.337],[-97.389,-58.612],[-87.087,-86.745],[-58.996,-97.158],[-36.8,-117.281],[-7.086,-113.445],[21.918,-120.948],[46.446,-103.744]],"o":[[-75.615,96.909],[-89.338,70.276],[-111.99,50.668],[-111.764,20.709],[-122.709,-7.18],[-108.586,-33.602],[-105.316,-63.383],[-80.533,-80.216],[-63.797,-105.066],[-34.03,-108.453],[-7.663,-122.679],[20.269,-111.845],[50.226,-112.188],[69.924,-89.614],[96.61,-75.997],[103.56,-46.854],[120.861,-22.395],[113.472,6.64],[117.425,36.337],[97.389,58.612],[87.088,86.745],[58.995,97.158],[36.8,117.281],[7.087,113.445],[-21.918,120.948],[-46.446,103.744]],"v":[[733.209,572.105],[531.711,675.932],[383.354,847.313],[156.685,845.606],[-54.323,928.412],[-254.235,821.562],[-479.555,796.823],[-606.913,609.309],[-794.927,482.691],[-820.554,257.47],[-928.191,57.981],[-846.217,-153.353],[-848.817,-380.013],[-678.021,-529.044],[-574.99,-730.949],[-354.499,-783.537],[-169.439,-914.435],[50.234,-858.532],[274.928,-888.434],[443.46,-736.847],[656.313,-658.903],[735.094,-446.359],[887.344,-278.426],[858.327,-53.616],[915.095,165.835],[784.928,351.409]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.956862745098,0.729411764706,0.619607843137,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":720,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".tertiary","cl":"tertiary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.248]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[-39]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.172]},"t":95,"s":[-21]},{"t":180,"s":[-39]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.032]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[1490]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.022]},"t":95,"s":[1314]},{"t":180,"s":[1490]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.034]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[2967]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.024]},"t":95,"s":[2770]},{"t":180,"s":[2967]}],"ix":4}},"a":{"a":0,"k":[164.438,1433.781,0],"ix":1,"l":2},"s":{"a":0,"k":[168,168,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[3079.125,4685.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.752941176471,0.788235294118,0.752941176471,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-w600dp-h900dp/all_set_page_bg.json b/quickstep/res/raw-w600dp-h900dp/all_set_page_bg.json
new file mode 100644
index 0000000..b1a3bbe
--- /dev/null
+++ b/quickstep/res/raw-w600dp-h900dp/all_set_page_bg.json
@@ -0,0 +1 @@
+{"v":"5.8.1","fr":60,"ip":0,"op":180,"w":800,"h":1280,"nm":"SUW_WelcomeScreen_Portrait_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[288,528,0],"ix":2,"l":2},"a":{"a":0,"k":[50,50,0],"ix":1,"l":2},"s":{"a":0,"k":[25,25,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":600,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".primary","cl":"primary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[56]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.986},"o":{"x":0.167,"y":0.167},"t":0,"s":[999.832,-2238.545,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.01},"t":95,"s":[999.832,-3043,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[999.832,-2238.545,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[200,200,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[75.615,-96.908],[89.338,-70.276],[111.99,-50.668],[111.764,-20.709],[122.709,7.18],[108.586,33.602],[105.316,63.383],[80.533,80.216],[63.797,105.066],[34.03,108.453],[7.663,122.679],[-20.269,111.845],[-50.226,112.189],[-69.924,89.614],[-96.61,75.997],[-103.56,46.854],[-120.861,22.395],[-113.472,-6.639],[-117.425,-36.337],[-97.389,-58.612],[-87.087,-86.745],[-58.996,-97.158],[-36.8,-117.281],[-7.086,-113.445],[21.918,-120.948],[46.446,-103.744]],"o":[[-75.615,96.909],[-89.338,70.276],[-111.99,50.668],[-111.764,20.709],[-122.709,-7.18],[-108.586,-33.602],[-105.316,-63.383],[-80.533,-80.216],[-63.797,-105.066],[-34.03,-108.453],[-7.663,-122.679],[20.269,-111.845],[50.226,-112.188],[69.924,-89.614],[96.61,-75.997],[103.56,-46.854],[120.861,-22.395],[113.472,6.64],[117.425,36.337],[97.389,58.612],[87.088,86.745],[58.995,97.158],[36.8,117.281],[7.087,113.445],[-21.918,120.948],[-46.446,103.744]],"v":[[733.209,572.105],[531.711,675.932],[383.354,847.313],[156.685,845.606],[-54.323,928.412],[-254.235,821.562],[-479.555,796.823],[-606.913,609.309],[-794.927,482.691],[-820.554,257.47],[-928.191,57.981],[-846.217,-153.353],[-848.817,-380.013],[-678.021,-529.044],[-574.99,-730.949],[-354.499,-783.537],[-169.439,-914.435],[50.234,-858.532],[274.928,-888.434],[443.46,-736.847],[656.313,-658.903],[735.094,-446.359],[887.344,-278.426],[858.327,-53.616],[915.095,165.835],[784.928,351.409]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.956862745098,0.729411764706,0.619607843137,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":720,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".tertiary","cl":"tertiary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.248]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[-39]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.172]},"t":95,"s":[-21]},{"t":180,"s":[-39]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.032]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[1490]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.022]},"t":95,"s":[1314]},{"t":180,"s":[1490]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.034]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[2967]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.024]},"t":95,"s":[2770]},{"t":180,"s":[2967]}],"ix":4}},"a":{"a":0,"k":[164.438,1433.781,0],"ix":1,"l":2},"s":{"a":0,"k":[168,168,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[3079.125,4685.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.752941176471,0.788235294118,0.752941176471,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-w840dp-h480dp/all_set_page_bg.json b/quickstep/res/raw-w840dp-h480dp/all_set_page_bg.json
new file mode 100644
index 0000000..81de7a2
--- /dev/null
+++ b/quickstep/res/raw-w840dp-h480dp/all_set_page_bg.json
@@ -0,0 +1 @@
+{"v":"5.8.1","fr":60,"ip":0,"op":180,"w":1280,"h":800,"nm":"SUW_WelcomeScreen_Landscape_Dynamic","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[288,540,0],"ix":2,"l":2},"a":{"a":0,"k":[50,50,0],"ix":1,"l":2},"s":{"a":0,"k":[25,25,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":600,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":".primary","cl":"primary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":180,"s":[56]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.07,"y":0.986},"o":{"x":0.167,"y":0.167},"t":0,"s":[375.832,-1006.545,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.773,"y":0.01},"t":95, "s":[375.832,-1811,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[375.832,-1006.545,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-3514.717,-358.642,0],"ix":1,"l":2},"s":{"a":0,"k":[110,110,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[75.615,-96.908],[89.338,-70.276],[111.99,-50.668],[111.764,-20.709],[122.709,7.18],[108.586,33.602],[105.316,63.383],[80.533,80.216],[63.797,105.066],[34.03,108.453],[7.663,122.679],[-20.269,111.845],[-50.226,112.189],[-69.924,89.614],[-96.61,75.997],[-103.56,46.854],[-120.861,22.395],[-113.472,-6.639],[-117.425,-36.337],[-97.389,-58.612],[-87.087,-86.745],[-58.996,-97.158],[-36.8,-117.281],[-7.086,-113.445],[21.918,-120.948],[46.446,-103.744]],"o":[[-75.615,96.909],[-89.338,70.276],[-111.99,50.668],[-111.764,20.709],[-122.709,-7.18],[-108.586,-33.602],[-105.316,-63.383],[-80.533,-80.216],[-63.797,-105.066],[-34.03,-108.453],[-7.663,-122.679],[20.269,-111.845],[50.226,-112.188],[69.924,-89.614],[96.61,-75.997],[103.56,-46.854],[120.861,-22.395],[113.472,6.64],[117.425,36.337],[97.389,58.612],[87.088,86.745],[58.995,97.158],[36.8,117.281],[7.087,113.445],[-21.918,120.948],[-46.446,103.744]],"v":[[733.209,572.105],[531.711,675.932],[383.354,847.313],[156.685,845.606],[-54.323,928.412],[-254.235,821.562],[-479.555,796.823],[-606.913,609.309],[-794.927,482.691],[-820.554,257.47],[-928.191,57.981],[-846.217,-153.353],[-848.817,-380.013],[-678.021,-529.044],[-574.99,-730.949],[-354.499,-783.537],[-169.439,-914.435],[50.234,-858.532],[274.928,-888.434],[443.46,-736.847],[656.313,-658.903],[735.094,-446.359],[887.344,-278.426],[858.327,-53.616],[915.095,165.835],[784.928,351.409]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.956862745098,0.729411764706,0.619607843137,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-3509.952,-363.731],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":720,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":".tertiary","cl":"tertiary","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.248]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[57]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.172]},"t":95,"s":[75]},{"t":180,"s":[57]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.032]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[2618]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.022]},"t":95,"s":[2442]},{"t":180,"s":[2618]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.07],"y":[1.034]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[891]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.719],"y":[0.024]},"t":95,"s":[694]},{"t":180,"s":[891]}],"ix":4}},"a":{"a":0,"k":[164.438,1433.781,0],"ix":1,"l":2},"s":{"a":0,"k":[120,120,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[3079.125,4685.989],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.752941176471,0.788235294118,0.752941176471,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[164.438,1481.781],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/quickstep/res/raw-land/all_set_page_bg.json b/quickstep/res/raw-w840dp/all_set_page_bg.json
similarity index 100%
rename from quickstep/res/raw-land/all_set_page_bg.json
rename to quickstep/res/raw-w840dp/all_set_page_bg.json
diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml
index f347eae..c146b51 100644
--- a/quickstep/res/values-af/strings.xml
+++ b/quickstep/res/values-af/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Speld vas"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Vormvry"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Rekenaar"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Werkskerm"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Geen onlangse items nie"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Programgebruikinstellings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Vee alles uit"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Stoor app-paar"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tik op ’n ander app om verdeelde skerm te gebruik"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Kies ’n ander app as jy verdeelde skerm wil gebruik"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Kanselleer"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Kanselleer"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Verlaat verdeeldeskermkeuse"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Kies nog ’n app as jy verdeelde skerm wil gebruik"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Jou organisasie laat nie hierdie program toe nie"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Doen meer met die Taakbalk"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Wys altyd die Taakbalk"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Raak en hou die verdeler in om altyd die Taakbalk onderaan jou skerm te wys"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Raak en hou die handelingsleutel om te soek wat op jou skerm is"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Hierdie produk gebruik die gekose deel van jou skerm om te soek. Google se <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>privaatheidsbeleid<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> en <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>diensbepalings<xliff:g id="END_TOS_LINK"></a></xliff:g> geld."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Maak toe"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Klaar"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Tuis"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Kitsinstellings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taakbalk"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taakbalk word gewys"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taakbalk en borrels wys links"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taakbalk en borrels wys regs"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taakbalk is versteek"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taakbalk en borrels is versteek"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigasiebalk"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Wys altyd Taakbalk"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Verander navigasiemodus"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Wys nog # app.}other{Wys nog # apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Wys # rekenaarapp.}other{Wys # rekenaarapps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> en <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Voeg nou app by werkskerm"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Kanselleer"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Borrel"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Oorvloei"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> vanaf <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> en nog <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Skuif links"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Skuif regs"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Maak almal toe"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"vou <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> uit"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"vou <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> in"</string>
</resources>
diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml
index 342fd96..4ed1836 100644
--- a/quickstep/res/values-am/strings.xml
+++ b/quickstep/res/values-am/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ሰካ"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ነፃ ቅጽ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ዴስክቶፕ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ዴስክቶፕ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ምንም የቅርብ ጊዜ ንጥሎች የሉም"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"የመተግበሪያ አጠቃቀም ቅንብሮች"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ሁሉንም አጽዳ"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"የመተግበሪያ ጥምረትን አስቀምጥ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"የተከፈለ ማያ ገጽን ለመጠቀም ሌላ መተግበሪያ መታ ያድርጉ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"የተከፈለ ማያ ገጽን ለመጠቀም ሌላ መተግበሪያ ይምረጡ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ይቅር"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ይቅር"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ከተከፈለ ማያ ገፅ ምርጫ ይውጡ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"የተከፈለ ማያ ገጽን ለመቀበል ሌላ መተግበሪያ ይምረጡ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ይህ ድርጊት በመተግበሪያው ወይም በእርስዎ ድርጅት አይፈቀድም"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ፈጣን ቅንብሮች"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"የተግባር አሞሌ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"የተግባር አሞሌ ይታያል"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"የተግባር አሞሌ እና አረፋዎች በግራ በኩል ይታያሉ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"የተግባር አሞሌ እና አረፋዎች በቀኝ በኩል ይታያሉ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"የተግባር አሞሌ ተደብቋል"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"የተግባር አሞሌ እና አረፋዎች ተደብቀዋል"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"የአሰሳ አሞሌ"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ሁልጊዜ የተግባር አሞሌ ያሳዩ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"የአሰሳ ሁነታን ይለውጡ"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"ወደ ላይ/ግራ ይውሰዱ"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"ወደ ታች/ቀኝ ይውሰዱ"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{ተጨማሪ # መተግበሪያ አሳይ።}one{ተጨማሪ # መተግበሪያ አሳይ።}other{ተጨማሪ # መተግበሪያዎች አሳይ።}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# የዴስክቶፕ መተግበሪያ አሳይ።}one{# የዴስክቶፕ መተግበሪያ አሳይ።}other{# የዴስክቶፕ መተግበሪያዎች አሳይ።}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> እና <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"መተግበሪያን ወደ ዴስክቶፕ በማከል ላይ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ይቅር"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"አረፋ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ትርፍ ፍሰት"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ከ<xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> እና <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ተጨማሪ"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ወደ ግራ ያንቀሳቅሱ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ወደ ቀኝ ያንቀሳቅሱ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ሁሉንም አሰናብት"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ን ዘርጋ"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ን ሰብስብ"</string>
</resources>
diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml
index 7e1e6b9..74509ac 100644
--- a/quickstep/res/values-ar/strings.xml
+++ b/quickstep/res/values-ar/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"تثبيت"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"شكل مجاني"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"الكمبيوتر المكتبي"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"كمبيوتر مكتبي"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ما مِن عناصر تم استخدامها مؤخرًا"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"إعدادات استخدام التطبيق"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"محو الكل"</string>
@@ -88,9 +89,9 @@
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"أحسنت"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"الدليل التوجيهي <xliff:g id="CURRENT">%1$d</xliff:g> من إجمالي <xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"اكتملت عملية الإعداد"</string>
- <string name="allset_hint" msgid="459504134589971527">"يمكنك التمرير السريع إلى الأعلى للانتقال إلى الشاشة الرئيسية."</string>
+ <string name="allset_hint" msgid="459504134589971527">"يمكنك التمرير سريعًا إلى الأعلى للانتقال إلى الشاشة الرئيسية"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"انقر على زر الشاشة الرئيسية للانتقال إلى الشاشة الرئيسية."</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"يمكنك الآن بدء استخدام \"<xliff:g id="DEVICE">%1$s</xliff:g>\"."</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"يمكنك الآن بدء استخدام <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"الجهاز"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"إعدادات التنقّل داخل النظام"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"مشاركة"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"حفظ استخدام التطبيقين معًا"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"انقر على تطبيق آخر لاستخدام وضع تقسيم الشاشة."</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"اختَر تطبيقًا آخر لاستخدام \"وضع تقسيم الشاشة\""</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"إلغاء"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"إلغاء"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"الخروج من وضع تقسيم الشاشة"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"اختَر تطبيقًا آخر لاستخدام \"وضع تقسيم الشاشة\""</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"لا يسمح التطبيق أو لا تسمح مؤسستك بهذا الإجراء."</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"إعدادات سريعة"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"شريط التطبيقات"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"تم إظهار شريط التطبيقات"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"يتم عرض \"شريط التطبيقات\" و\"فقاعات المحادثات\" يمينًا"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"يتم عرض \"شريط التطبيقات\" و\"فقاعات المحادثات\" يسارًا"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"تم إخفاء شريط التطبيقات"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"تم إخفاء \"شريط التطبيقات\" و\"فقاعات المحادثات\""</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"شريط التنقل"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"إظهار شريط التطبيقات دائمًا"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"تغيير وضع التنقل"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{إظهار تطبيق واحد آخر}zero{إظهار # تطبيق آخر}two{إظهار تطبيقَين آخرَين}few{إظهار # تطبيقات أخرى}many{إظهار # تطبيقًا آخر}other{إظهار # تطبيق آخر}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{عرض تطبيق واحد متوافق مع الكمبيوتر المكتبي}zero{عرض # تطبيق متوافق مع الكمبيوتر المكتبي}two{عرض تطبيقَين متوافقين مع الكمبيوتر المكتبي}few{عرض # تطبيقات متوافقة مع الكمبيوتر المكتبي}many{عرض # تطبيقًا متوافقًا مع الكمبيوتر المكتبي}other{عرض # تطبيق متوافق مع الكمبيوتر المكتبي}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"\"<xliff:g id="APP_NAME_1">%1$s</xliff:g>\" و\"<xliff:g id="APP_NAME_2">%2$s</xliff:g>\""</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"إضافة تطبيق إلى سطح المكتب"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"إلغاء"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"فقاعة"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"القائمة الكاملة"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"\"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>\" من \"<xliff:g id="APP_NAME">%2$s</xliff:g>\""</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"\"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>\" و<xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> غيرها"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"نقل لليسار"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"نقل لليمين"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"إغلاق الكل"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"توسيع <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"تصغير <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml
index dbdbc8e..ea8268e 100644
--- a/quickstep/res/values-as/strings.xml
+++ b/quickstep/res/values-as/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"পিন"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ডেস্কটপ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ডেস্কটপ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"কোনো শেহতীয়া বস্তু নাই"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"এপে ব্যৱহাৰ কৰা ডেটাৰ ছেটিং"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"আটাইবোৰ মচক"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"এপৰ পেয়াৰ ছেভ কৰক"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"বিভাজিত স্ক্ৰীন ব্যৱহাৰ কৰিবলৈ অন্য এটা এপত টিপক"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"বিভাজিত স্ক্ৰীন ব্যৱহাৰ কৰিবলৈ অন্য এটা এপ্ বাছনি কৰক"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"বাতিল কৰক"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"বাতিল কৰক"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"বিভাজিত স্ক্ৰীনৰ বাছনিৰ পৰা বাহিৰ হওক"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"বিভাজিত স্ক্ৰীন ব্যৱহাৰ কৰিবলৈ অন্য এটা এপ্ বাছক"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"এপ্টোৱে অথবা আপোনাৰ প্ৰতিষ্ঠানে এই কাৰ্যটোৰ অনুমতি নিদিয়ে"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ক্ষিপ্ৰ ছেটিং"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"টাস্কবাৰ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"টাস্কবাৰ দেখুওৱা হৈছে"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"টাস্কবাৰ আৰু বাবল বাওঁফালে দেখুওৱা হৈছে"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"টাস্কবাৰ আৰু বাবল সোঁফালে দেখুওৱা হৈছে"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"টাস্কবাৰ লুকুৱাই থোৱা হৈছে"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"টাস্কবাৰ আৰু বাবল লুকুওৱা হৈছে"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"নেভিগেশ্বনৰ দণ্ড"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"টাস্কবাৰ সদায় দেখুৱাওক"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"নেভিগেশ্বন ম’ড সলনি কৰক"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"ওপৰৰ বাঁওফাললৈ নিয়ক"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"তলৰ সোঁফাললৈ নিয়ক"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{আৰু # টা এপ্ দেখুৱাওক।}one{আৰু # টা এপ্ দেখুৱাওক।}other{আৰু # টা এপ্ দেখুৱাওক।}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# টা ডেস্কটপ এপ্ দেখুৱাওক।}one{# টা ডেস্কটপ এপ্ দেখুৱাওক।}other{# টা ডেস্কটপ এপ্ দেখুৱাওক।}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> আৰু <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ডেস্কটপত এপ্ যোগ দি থকা হৈছে"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"বাতিল কৰক"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"বাবল"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"অ’ভাৰফ্ল’"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g>ৰ পৰা <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> আৰু <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> টা"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"বাওঁফাললৈ নিয়ক"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"সোঁফাললৈ নিয়ক"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"সকলো অগ্ৰাহ্য কৰক"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> বিস্তাৰ কৰক"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> সংকোচন কৰক"</string>
</resources>
diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml
index 409490f..13b2c11 100644
--- a/quickstep/res/values-az/strings.xml
+++ b/quickstep/res/values-az/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Sancın"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Sərbəst rejim"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Masaüstü"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Masaüstü"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Son elementlər yoxdur"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Tətbiq istifadə ayarları"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Hamısını silin"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Tətbiq cütünü saxla"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Bölünmüş ekran üçün başqa tətbiqə toxunun"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Bölünmüş ekrandan istifadə üçün başqa tətbiq seçin"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Ləğv edin"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Ləğv edin"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Bölünmüş ekran seçimindən çıxın"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Bölünmüş ekrandan istifadə üçün başqa tətbiq seçin"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Bu əməliyyata tətbiq və ya təşkilatınız tərəfindən icazə verilmir"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Tapşırıq paneli ilə daha çox şey edin"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"İşləmə panelini həmişə göstərin"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"İşləmə panelini həmişə ekranın aşağısında göstərmək üçün ayırıcı üzərinə toxunun və saxlayın"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Ekranda axtarış etmək üçün fəaliyyət açarına toxunub saxlayın"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Bu məhsul axtarış üçün ekranın seçilmiş hissəsindən istifadə edir. Google <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Məxfilik Siyasəti<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> və <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Xidmət Şərtləri<xliff:g id="END_TOS_LINK"></a></xliff:g> tətbiq edilir."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Bağlayın"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Hazırdır"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Ev"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Sürətli Ayarlar"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Tapşırıq paneli"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"İşləmə paneli göstərilir"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"İşləmə paneli, yumrucuqlar solda göstərilir"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"İşləmə paneli, yumrucuqlar sağda göstərilir"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"İşləmə paneli gizlədilib"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"İşləmə paneli, yumrucuqlar gizlədilib"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Naviqasiya paneli"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"İşləmə paneli həmişə görünsün"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Naviqasiya rejimini dəyişin"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Daha # tətbiqi göstərin.}other{Daha # tətbiqi göstərin.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# masaüstü tətbiqini göstərin.}other{# masaüstü tətbiqini göstərin.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> və <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Tətbiqin masaüstünə əlavə edilməsi"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Ləğv edin"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Yumrucuq"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Kənara çıxma"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>, <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> və daha <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> yumrucuq"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Sola köçürün"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Sağa köçürün"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Hamısını kənarlaşdırın"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"genişləndirin: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"yığcamlaşdırın: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml
index b88f710..2a19691 100644
--- a/quickstep/res/values-b+sr+Latn/strings.xml
+++ b/quickstep/res/values-b+sr+Latn/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Zakači"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Slobodni oblik"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Računar"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Računari"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nema nedavnih stavki"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Podešavanja korišćenja aplikacije"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Obriši sve"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Sačuvaj par aplikacija"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Dodirnite drugu aplikaciju za podeljeni ekran"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Odaberite drugu aplikaciju da biste koristili podeljeni ekran"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Otkaži"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Otkaži"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Izlazak iz biranja podeljenog ekrana"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Odaberite drugu aplikaciju za podeljeni ekran"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ili organizacija ne dozvoljavaju ovu radnju"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Brza podešavanja"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Traka zadataka"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Traka zadataka je prikazana"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Prikaz zadataka/oblačića levo"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Prikaz zadataka/oblačića desno"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Traka zadataka je skrivena"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Skriveni zadaci/oblačići"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Traka za navigaciju"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Uvek prikazuj traku zadataka"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Promeni režim navigacije"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Premesti gore levo"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Premesti dole desno"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Prikaži još # aplikaciju.}one{Prikaži još # aplikaciju.}few{Prikaži još # aplikacije.}other{Prikaži još # aplikacija.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Prikaži # aplikaciju za računare.}one{Prikaži # aplikaciju za računare.}few{Prikaži # aplikacije za računare.}other{Prikaži # aplikacija za računare.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> i <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Dodaje se aplikacija na radnu povrršinu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Otkaži"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Oblačić"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Preklopni"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> – <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> i još <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Pomeri nalevo"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Pomeri nadesno"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Odbaci sve"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"proširite oblačić <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"skupite oblačić <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml
index 6a9fa06..7b99a6f 100644
--- a/quickstep/res/values-be/strings.xml
+++ b/quickstep/res/values-be/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Замацаваць"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Адвольная форма"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Працоўны стол"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Працоўны стол"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Няма новых элементаў"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Налады выкарыстання праграмы"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Ачысціць усё"</string>
@@ -39,7 +40,7 @@
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Атрымліваць прапановы праграм"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не, дзякуй"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Налады"</string>
- <string name="hotseat_auto_enrolled" msgid="522100018967146807">"Тут з\'яўляюцца праграмы, якімі вы карыстаецеся найбольш часта. Гэты спіс змяняецца на падставе вашых дзеянняў"</string>
+ <string name="hotseat_auto_enrolled" msgid="522100018967146807">"Тут з’яўляюцца праграмы, якімі вы карыстаецеся найбольш часта. Гэты спіс змяняецца на падставе вашых дзеянняў"</string>
<string name="hotseat_tip_no_empty_slots" msgid="1325212677738179185">"Перацягніце праграмы з ніжняга радка, каб атрымліваць прапановы праграм"</string>
<string name="hotseat_tip_gaps_filled" msgid="3035673010274223538">"Прапановы праграм дададзены на свабоднае месца"</string>
<string name="hotsaet_tip_prediction_enabled" msgid="2233554377501347650">"Прапановы праграм уключаны"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Захаваць спалучэнне"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Каб падзяліць экран, націсніце на іншую праграму"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Каб карыстацца рэжымам падзеленага экрана, выберыце другую праграму"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Скасаваць"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Скасаваць"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Выйсці з рэжыму падзеленага экрана"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Каб падзяліць экран, выберыце іншую праграму"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Гэта дзеянне не дазволена праграмай ці вашай арганізацыяй"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Выкарыстоўвайце магчымасці панэлі задач"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Замацуйце панэль задач унізе экрана"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Для гэтага націсніце на раздзяляльнік і ўтрымлівайце яго"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Для пошуку па змесціве экрана націсніце і ўтрымлівайце клавішу дзеяння"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Гэты прадукт выконвае пошук па змесціве выбранай часткі экрана. Прымяняюцца <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Умовы выкарыстання<xliff:g id="END_TOS_LINK"></a></xliff:g> і <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Палітыка прыватнасці<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрыць"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Гатова"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Галоўны экран"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Хуткія налады"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Панэль задач"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Панэль задач паказана"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Панэль задач і ўсплывальныя чаты паказваюцца злева"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Панэль задач і ўсплывальныя чаты паказваюцца справа"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Панэль задач схавана"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Панэль задач і ўсплывальныя чаты схаваны"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Панэль навігацыі"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Заўсёды паказваць панэль задач"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Змяніць рэжым навігацыі"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Перамясціць уверх/улева"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Перамясціць уніз/управа"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Паказаць ячшэ # праграму.}one{Паказаць ячшэ # праграму.}few{Паказаць ячшэ # праграмы.}many{Паказаць ячшэ # праграм.}other{Паказаць ячшэ # праграмы.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Паказаць # праграму для ПК.}one{Паказаць # праграму для ПК.}few{Паказаць # праграмы для ПК.}many{Паказаць # праграм для ПК.}other{Паказаць # праграмы для ПК.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> і <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Дадаванне праграмы на камп\'ютар"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Скасаваць"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Бурбалкі"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Меню з пашырэннем"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>, крыніца: <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> і яшчэ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Перамясціць улева"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Перамясціць управа"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Закрыць усе"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>: разгарнуць"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>: згарнуць"</string>
</resources>
diff --git a/quickstep/res/values-bg/strings.xml b/quickstep/res/values-bg/strings.xml
index 78de684..2ed92c3 100644
--- a/quickstep/res/values-bg/strings.xml
+++ b/quickstep/res/values-bg/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Фиксиране"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Свободна форма"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"За компютър"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Настолен компютър"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Няма скорошни елементи"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Настройки за използването на приложенията"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Изчистване на всички"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Запис на двойка приложения"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Докоснете друго прил., за да ползвате разд. екран"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"За разделен екран изберете още едно приложение"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Отказ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Отказ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Изход от избора на разделен екран"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"За разделен екран изберете още едно приложение"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Това действие не е разрешено от приложението или организацията ви"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Бързи настройки"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Лента на задачите"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Лентата на задачите се показва"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Лентата и балончетата са вляво"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Лентата и балончетата са вдясно"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Лентата на задачите е скрита"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Лентата и балончетата са скрити"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Лента за навигация"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Лентата на задачите винаги да се показва"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Промяна на режима на навигация"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Преместване горе/вляво"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Преместване долу/вдясно"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Показване на още # приложение.}other{Показване на още # приложения.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Показване на # настолно приложение.}other{Показване на # настолни приложения.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> и <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Приложението се добавя на настолния компютър"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Отказ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Балонче"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Препълване"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> от <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> и още <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Преместване наляво"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Преместване надясно"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Отхвърляне на всички"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"разгъване на <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"свиване на <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml
index de0c613..0762805 100644
--- a/quickstep/res/values-bn/strings.xml
+++ b/quickstep/res/values-bn/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"পিন করুন"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ফ্রি-ফর্ম"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ডেস্কটপ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ডেস্কটপ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"কোনও সাম্প্রতিক আইটেম নেই"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"অ্যাপ ব্যবহারের সেটিংস"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"সবকিছু খালি করুন"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"অ্যাপ পেয়ার সেভ করুন"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"স্প্লিট স্ক্রিন ব্যবহারের জন্য অ্যাপে ট্যাপ করুন"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"স্প্লিট স্ক্রিন ব্যবহার করতে অন্য অ্যাপ বেছে নিন"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"বাতিল করুন"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"বাতিল করুন"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"স্প্লিট স্ক্রিন বেছে নেওয়ার বিকল্প থেকে বেরিয়ে আসুন"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"স্প্লিট স্ক্রিন ব্যবহার করতে অন্য অ্যাপ বেছে নিন"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"এই অ্যাপ বা আপনার প্রতিষ্ঠান এই অ্যাকশনটি পারফর্ম করার অনুমতি দেয়নি"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"\'টাস্কবার\' ফিচারের সাহায্যে আরও অনেক কিছু করুন"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"টাস্কবার সবসময় দেখানো"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"স্ক্রিনের নিচে টাস্কবার সবসময় দেখাতে ডিভাইডার টাচ করে ধরে থাকুন"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"আপনার স্ক্রিনে দেখতে পাওয়া কন্টেন্ট সার্চ করতে অ্যাকশন কী স্পর্শ করে ধরে রাখুন"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"সার্চ করার জন্য এই প্রোডাক্ট স্ক্রিনের বেছে নেওয়া অংশটুকু ব্যবহার করে। Google-এর <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>গোপনীয়তা নীতি<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> এবং <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>পরিষেবার শর্তাবলী<xliff:g id="END_TOS_LINK"></a></xliff:g> প্রযোজ্য।"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"বন্ধ করুন"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"হয়ে গেছে"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"হোম"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"দ্রুত সেটিংস"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"টাস্কবার"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"\'টাস্কবার\' দেখানো হয়েছে"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"টাস্কবার ও বাবল বাঁদিকে দেখানো হয়েছে"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"টাস্কবার ও বাবল ডানদিকে দেখানো হয়েছে"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"\'টাস্কবার\' লুকানো রয়েছে"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"টাস্কবার ও বাবল লুকানো হয়েছে"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"নেভিগেশন বার"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"সবসময় টাস্কবার দেখুন"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"\'নেভিগেশন\' মোড পরিবর্তন করুন"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"উপরে/বাঁদিকে সরান"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"নিচে/ডানদিকে সরান"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{আরও #টি অ্যাপ দেখুন।}one{আরও #টি অ্যাপ দেখুন।}other{আরও #টি অ্যাপ দেখুন।}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{#টি ডেস্কটপ অ্যাপ দেখুন।}one{#টি ডেস্কটপ অ্যাপ দেখুন।}other{#টি ডেস্কটপ অ্যাপ দেখুন।}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ও <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ডেস্কটপে অ্যাপ যোগ করা হচ্ছে"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"বাতিল করুন"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"বাবল"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ওভারফ্লো"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> থেকে <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> এবং আরও <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>টি"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"বাঁদিকে সরান"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ডানদিকে সরান"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"সব বাতিল করুন"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> বড় করুন"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> আড়াল করুন"</string>
</resources>
diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml
index 6be4fb7..283cb67 100644
--- a/quickstep/res/values-bs/strings.xml
+++ b/quickstep/res/values-bs/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Zakači"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Slobodan oblik"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Radna površina"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Radna površina"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nema nedavnih stavki"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Postavke korištenja aplikacije"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Obriši sve"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Predviđena aplikacija: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"Rotirajte uređaj"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"Rotirajte uređaj da završite vodič za navigaciju pokretima"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Prevucite s krajnjeg desnog ili krajnjeg lijevog ruba"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Prevucite s krajnjeg desnog ili lijevog ruba"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"Prevucite s desnog ili lijevog ruba prema sredini ekrana i pustite"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Naučili ste kako prevući zdesna da se vratite. Sljedeće naučite kako prebacivati između aplikacija."</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Savladali ste pokret za vraćanje. Sljedeće naučite kako prebacivati između aplikacija."</string>
@@ -73,7 +74,7 @@
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Vodite računa da prevučete s donjeg ruba ekrana prema gore"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Pokušajte zadržati prozor duže prije puštanja"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Prevucite ravno nagore, a zatim zastanite"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili ste kako koristiti pokrete. Idite u Postavke da isključite pokrete."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili ste kako koristiti pokrete. Da ih isključite, idite u Postavke."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Savladali ste pokret za prebacivanje između aplikacija"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Prevucite da prebacujete između aplikacija"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Da se prebacujete između aplikacija, prevucite s dna ekrana nagore, zadržite, a zatim pustite."</string>
@@ -92,14 +93,14 @@
<string name="allset_button_hint" msgid="2395219947744706291">"Dodirnite dugme za početni ekran da odete napočetni ekran"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"Spremni ste da počnete koristiti <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"uređaj"</string>
- <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Postavke navigiranja sistemom"</annotation></string>
+ <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Postavke navigacije sistemom"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Dijeli"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snimak ekrana"</string>
<string name="action_split" msgid="2098009717623550676">"Podijeli"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Sačuvaj par aplikacija"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Dodirnite drugu apl. da koristite podijeljeni ekran"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Odaberite drugu aplikaciju da koristite podijeljeni ekran"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Otkaži"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Otkaži"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Izlaz iz odabira podijeljenog ekrana"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Odaberite drugu apl. da koristite podijeljeni ekran"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Ovu radnju ne dozvoljava aplikacija ili vaša organizacija"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Uradite više pomoću trake zadataka"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Stalni prikaz trake zadataka"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Da se traka zadataka uvijek prikazuje na dnu ekrana, dodirnite i zadržite razdjelnik"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Dodirnite i zadržite tipku radnji da pretražite sadržaj na ekranu"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ovaj proizvod koristi odabrani dio ekrana za pretraživanje. Primjenjuju se Googleova <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Pravila privatnosti<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> i <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Uslovi korištenja usluge<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gotovo"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Dom"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Brze postavke"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Traka zadataka"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Traka zadataka je prikazana"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Traka zadataka/oblačići prik. lijevo"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Traka zadataka/oblačići prik. desno"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Traka zadataka je sakrivena"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Traka zadataka/oblačići sakriveni"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigaciona traka"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Uvijek prikaži traku zadataka"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Promijeni način navigacije"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Premjesti gore lijevo"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Premjesti dolje desno"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Prikaži još # aplikaciju.}one{Prikaži još # aplikaciju.}few{Prikaži još # aplikacije.}other{Prikaži još # aplikacija.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Prikaži # aplikaciju za računar.}one{Prikaži # aplikaciju za računar.}few{Prikaži # aplikacije za računar.}other{Prikaži # aplikacija za računar.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> i <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Dodavanje aplikacije na radnu površinu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Otkaži"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Oblačić"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Preklopni meni"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> iz aplikacije <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> i još <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Pomjeranje ulijevo"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Pomjeranje udesno"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Odbacivanje svega"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"proširivanje oblačića <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"sužavanje oblačića <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml
index e7fe6df..460f2fc 100644
--- a/quickstep/res/values-ca/strings.xml
+++ b/quickstep/res/values-ca/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixa"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Format lliure"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Ordinador"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Escriptori"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Escriptori"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No hi ha cap element recent"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Configuració d\'ús d\'aplicacions"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Esborra-ho tot"</string>
@@ -59,7 +60,7 @@
<string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Per tornar a la pantalla anterior, llisca amb dos dits des de l\'extrem esquerre o dret cap al centre de la pantalla."</string>
<string name="back_gesture_tutorial_title" msgid="1944737946101059789">"Torna enrere"</string>
<string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Llisca des de la vora esquerra o dreta cap al centre de la pantalla."</string>
- <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Assegura\'t de lliscar cap amunt des de la part inferior de la pantalla"</string>
+ <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Assegura\'t de lliscar cap amunt des de la part inferior de la pantalla."</string>
<string name="home_gesture_feedback_overview_detected" msgid="5177627157303895077">"Assegura\'t de no aturar-te abans de deixar anar."</string>
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="8328465201424027148">"Assegura\'t de lliscar recte cap amunt."</string>
<string name="home_gesture_feedback_complete_with_follow_up" msgid="8766981412895888417">"Has completat el gest per anar a la pantalla d\'inici. Ara, descobreix com pots tornar enrere."</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Ben fet!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Assegura\'t de lliscar cap amunt des de la part inferior de la pantalla."</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Prova de mantenir premuda la finestra durant més temps abans de deixar-la anar"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Assegura\'t de lliscar directament cap amunt i després aturar-te"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Assegura\'t de lliscar directament cap amunt i després aturar-te."</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Has après a utilitzar els gestos. Per desactivar-los, ves a Configuració."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Has completat el gest per canviar d\'aplicació"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Llisca per canviar d\'aplicació"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Desa la parella d\'apps"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Toca una altra app per utilitzar pantalla dividida"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Tria una altra aplicació per utilitzar la pantalla dividida"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancel·la"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel·la"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Surt de la selecció de pantalla dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Tria una altra app per utilitzar pantalla dividida"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"L\'aplicació o la teva organització no permeten aquesta acció"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Treu més partit de la Barra de tasques"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostra sempre la Barra de tasques"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Perquè es mostri sempre la Barra de tasques a la part inferior de la pantalla, mantén premut el separador"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Mantén premuda la tecla d\'acció per cercar què es mostra a la pantalla"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Aquest producte utilitza la part seleccionada de la pantalla per fer cerques. S\'apliquen la <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>política de privadesa<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> i les <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>condicions del servei<xliff:g id="END_TOS_LINK"></a></xliff:g> de Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tanca"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Fet"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Inici"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Config. ràpida"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tasques"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Es mostra la Barra de tasques"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra i bombolles a l\'esquerra"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra i bombolles a la dreta"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"S\'ha amagat la Barra de tasques"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra i bombolles amagades"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegació"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Barra de tasques sempre visible"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Canvia el mode de navegació"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mou a la part superior o a l\'esquerra"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mou a la part inferior o a la dreta"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostra # aplicació més.}other{Mostra # aplicacions més.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostra # aplicació per a ordinadors.}other{Mostra # aplicacions per a ordinadors.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> i <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"S\'està afegint l\'aplicació a l\'ordinador"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel·la"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bombolla"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Desbordament"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> i <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> més"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mou cap a l\'esquerra"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mou cap a la dreta"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Ignora-ho tot"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"desplega <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"replega <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml
index 1170e50..1e5df41 100644
--- a/quickstep/res/values-cs/strings.xml
+++ b/quickstep/res/values-cs/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Připnout"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Neomezený režim"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Počítač"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Počítač"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Žádné položky z nedávné doby"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Nastavení využití aplikací"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Vymazat vše"</string>
@@ -73,7 +74,7 @@
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Přejeďte prstem nahoru z dolního okraje obrazovky"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Zkuste podržet okno delší dobu, než ho uvolníte"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Přejeďte prstem přímo nahoru a pak udělejte pauzu"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili jste se používat gesta. Vypnout je můžete v nastavení."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili jste se používat gesta. Vypnout je můžete v Nastavení."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Dokončili jste gesto pro přepínání aplikací"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Přepínání aplikací přejetím prstem"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Přejeďte nahoru z dolního okraje obrazovky, podržte obrazovku a uvolněte."</string>
@@ -91,7 +92,7 @@
<string name="allset_hint" msgid="459504134589971527">"Přejetím nahoru se vrátíte na plochu"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Klepnutím na tlačítko plochy se vrátíte na plochu"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> můžete začít používat"</string>
- <string name="default_device_name" msgid="6660656727127422487">"zařízení"</string>
+ <string name="default_device_name" msgid="6660656727127422487">"Zařízení"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Nastavení navigace v systému"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Sdílet"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snímek obrazovky"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Uložit dvojici aplikací"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Obrazovku rozdělíte klepnutím na jinou aplikaci"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Výběrem další aplikace rozdělíte obrazovku"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Zrušit"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Zrušit"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Výběr opuštění rozdělené obrazovky"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Vyberte podporovanou aplikaci"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikace nebo organizace zakazuje tuto akci"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Rychlé nastavení"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Panel aplikací"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Panel aplikací je zobrazen"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Panel a bubliny vlevo zobr."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Panel a bubliny vpravo zobr."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Panel aplikací je skrytý"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Panel a bubliny jsou skryty"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigační panel"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Vždy zobrazovat panel aplikací"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Změnit režim navigace"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Přesunout doleva nahoru"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Přesunout doprava dolů"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Zobrazit # další aplikaci.}few{Zobrazit # další aplikace.}many{Zobrazit # další aplikace.}other{Zobrazit # dalších aplikací.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Zobrazit # aplikaci pro počítač.}few{Zobrazit # aplikace pro počítač.}many{Zobrazit # aplikace pro počítač.}other{Zobrazit # aplikací pro počítač.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> a <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Přidání aplikace na plochu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Zrušit"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bublina"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Rozbalovací nabídka"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> z aplikace <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> a ještě <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Přesunout doleva"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Přesunout doprava"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Zavřít vše"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"rozbalit <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"sbalit <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml
index 9d002f01..4f61b86 100644
--- a/quickstep/res/values-da/strings.xml
+++ b/quickstep/res/values-da/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fastgør"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Frit format"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Computertilstand"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Computer"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Ingen nye elementer"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Indstillinger for appforbrug"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Ryd alt"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Gem appsammenknytning"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tryk på en anden app for at bruge opdelt skærm"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Vælg en anden app for at bruge opdelt skærm"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Annuller"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Annuller"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Luk valg af opdelt skærm"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Vælg en anden app for at bruge opdelt skærm"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller din organisation tillader ikke denne handling"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Få mere fra hånden med proceslinjen"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Vis altid proceslinjen"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Hvis du vil have, at proceslinjen altid vises nederst på din skærm, skal du holde fingeren på skillelinjen"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Hold fingeren på handlingstasten for at søge efter det, der vises på din skærm"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Dette produkt bruger den valgte del af din skærm til at søge. Googles <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>privatlivspolitik<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> og <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>servicevilkår<xliff:g id="END_TOS_LINK"></a></xliff:g> er gældende."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Luk"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Luk"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Hjem"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Kvikmenu"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Proceslinje"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Proceslinjen vises"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Proceslinje og bobler til venstre"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Proceslinje og bobler til højre"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Proceslinjen er skjult"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Proceslinje og bobler skjult"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigationslinje"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Vis altid proceslinjen"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Skift navigationstilstand"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Flyt til toppen eller venstre side"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Flyt til bunden eller højre side"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Vis # app mere.}one{Vis # app mere.}other{Vis # apps mere.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Vis # computerprogram.}one{Vis # computerprogram.}other{Vis # computerprogrammer.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> og <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Appen føjes til computeren"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Annuller"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Boble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overløb"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> fra <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> og <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> mere"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Flyt til venstre"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Flyt til højre"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Afvis alle"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"udvid <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"skjul <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml
index bef87b6..ac5e7aa 100644
--- a/quickstep/res/values-de/strings.xml
+++ b/quickstep/res/values-de/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixieren"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform-Modus"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktopmodus"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktopmodus"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Keine kürzlich verwendeten Elemente"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Einstellungen zur App-Nutzung"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Alle Apps schließen"</string>
@@ -95,11 +96,11 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Einstellungen der Systemsteuerung"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Teilen"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
- <string name="action_split" msgid="2098009717623550676">"Teilen"</string>
+ <string name="action_split" msgid="2098009717623550676">"Splitscreen"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"App-Paar speichern"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Für Splitscreen auf weitere App tippen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Für Splitscreen andere App auswählen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Abbrechen"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Abbrechen"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Splitscreen-Auswahl beenden"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Für Splitscreen andere App auswählen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Die App oder deine Organisation lässt diese Aktion nicht zu"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Schnelleinstellungen"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskleiste"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskleiste eingeblendet"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskleiste & Bubbles links eingeblendet"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskleiste & Bubbles rechts eingeblendet"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskleiste ausgeblendet"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskleiste & Bubbles ausgeblendet"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigationsleiste"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Taskleiste immer anzeigen"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Navigationsmodus ändern"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Nach oben / Nach links verschieben"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Nach unten / Nach rechts verschieben"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# weitere App anzeigen}other{# weitere Apps anzeigen}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# Desktop-App anzeigen.}other{# Desktop-Apps anzeigen.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> und <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Hinzufügen einer App zum Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Abbrechen"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Weitere Optionen"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"„<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>“ aus <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> und <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> weitere"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Nach links bewegen"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Nach rechts bewegen"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Alle schließen"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"„<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>“ maximieren"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"„<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>“ minimieren"</string>
</resources>
diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml
index 169d0ec..ddd81d2 100644
--- a/quickstep/res/values-el/strings.xml
+++ b/quickstep/res/values-el/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Καρφίτσωμα"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Ελεύθερη μορφή"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Υπολογιστής"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Υπολογιστής"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Δεν υπάρχουν πρόσφατα στοιχεία"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Ρυθμίσεις χρήσης εφαρμογής"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Διαγραφή όλων"</string>
@@ -67,7 +68,7 @@
<string name="home_gesture_intro_title" msgid="836590312858441830">"Σύρετε για μετάβαση στην αρχική οθόνη"</string>
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Σύρετε προς τα πάνω από το κάτω μέρος της οθόνης. Αυτή η κίνηση σάς μεταφέρει πάντα στην αρχ. οθόνη."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Σύρετε από το κάτω άκρο προς τα πάνω με 2 δάχτ. Αυτή η κίνηση σάς μεταφέρει πάντα στην αρχική οθόνη."</string>
- <string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Αρχική"</string>
+ <string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Μετάβαση στην αρχική οθόνη"</string>
<string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Σύρετε προς τα επάνω από το κάτω μέρος της οθόνης"</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Μπράβο!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Φροντίστε να σύρετε προς τα επάνω από το κάτω άκρο της οθόνης"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"Όλα έτοιμα!"</string>
<string name="allset_hint" msgid="459504134589971527">"Σύρετε προς τα επάνω για να μεταβείτε στην αρχική σελίδα"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Πατήστε το κουμπί αρχικής οθόνης για να μεταβείτε στην αρχική οθόνη"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"Είστε έτοιμοι να ξεκινήσετε να χρησιμοποιείτε το/τη <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"Είστε έτοιμοι να ξεκινήσετε να χρησιμοποιείτε τη <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"συσκευή"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Ρυθμίσεις πλοήγησης συστήματος"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Κοινοποίηση"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Αποθήκ. ζεύγ. εφαρμ."</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Πατήστε άλλη εφαρμογή για διαχωρισμό οθόνης"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Επιλέξτε άλλη εφαρμογή για διαχωρισμό οθόνης"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Ακύρωση"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Ακύρωση"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Έξοδος από την επιλογή διαχωρισμού οθόνης"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Επιλέξτε άλλη εφαρμογή για διαχωρισμό οθόνης"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Αυτή η ενέργεια δεν επιτρέπεται από την εφαρμογή ή τον οργανισμό σας."</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Γρήγορες ρυθμ."</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Γραμμή εργαλείων"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Η γραμμή εργαλείων εμφανίζεται"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Εμφάν. αριστ. γρ. εργ. και συν."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Εμφάν. δεξιάς γρ. εργ. και συν."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Η γραμμή εργαλείων είναι κρυφή"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Απόκρυψη εργαλείων και συννεφ."</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Γραμμή πλοήγησης"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Εμφάνιση Γραμμής εργαλείων"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Αλλαγή τρόπου πλοήγησης"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Μετακίνηση επάνω/αριστερά"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Μετακίνηση κάτω/δεξιά"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Εμφάνιση # ακόμα εφαρμογής.}other{Εμφάνιση # ακόμα εφαρμογών.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Εμφάνιση # εφαρμογής υπολογιστή.}other{Εμφάνιση # εφαρμογών υπολογιστή.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> και <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Γίνεται προσθήκη εφαρμογής στον υπολογιστή"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Ακύρωση"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Συννεφάκι"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Υπερχείλιση"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> από <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> και <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ακόμα"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Μετακίνηση αριστερά"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Μετακίνηση δεξιά"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Παράβλεψη όλων"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"ανάπτυξη <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"σύμπτυξη <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml
index 0ecf772..bc2f91a 100644
--- a/quickstep/res/values-en-rAU/strings.xml
+++ b/quickstep/res/values-en-rAU/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No recent items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"App usage settings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Clear all"</string>
@@ -87,7 +88,7 @@
<string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
- <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+ <string name="allset_title" msgid="5021126669778966707">"All set!"</string>
<string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Tap the home button to go to your home screen"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"You’re ready to start using your <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Save app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tap another app to use split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choose another app to use split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancel"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Exit split screen selection"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choose another app to use split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Do more with the Taskbar"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Always show the Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"To always show the Taskbar on the bottom of your screen, touch and hold the divider"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Touch and hold the action key to search what\'s on your screen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"This product uses the selected part of your screen to search. Google\'s <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Privacy Policy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> and <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Terms of Service<xliff:g id="END_TOS_LINK"></a></xliff:g> apply."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Home"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar and bubbles left shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar and bubbles right shown"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar hidden"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar and bubbles hidden"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Always show Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Change navigation mode"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Show # more app.}other{Show # more apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Show # desktop app.}other{Show # desktop apps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> and <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adding app to desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> from <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> and <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> more"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Move left"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Move right"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dismiss all"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expand <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"collapse <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml
index 9539da6..f4396fa 100644
--- a/quickstep/res/values-en-rCA/strings.xml
+++ b/quickstep/res/values-en-rCA/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No recent items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"App usage settings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Clear all"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Save app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tap another app to use split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choose another app to use split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancel"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Exit split screen selection"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choose another app to use split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organization"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar & bubbles left shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar & bubbles right shown"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar hidden"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar & bubbles hidden"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Always show Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Change navigation mode"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Show # more app.}other{Show # more apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Show # desktop app.}other{Show # desktop apps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> and <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adding app to Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> from <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> and <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> more"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Move left"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Move right"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dismiss all"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expand <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"collapse <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml
index 0ecf772..bc2f91a 100644
--- a/quickstep/res/values-en-rGB/strings.xml
+++ b/quickstep/res/values-en-rGB/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No recent items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"App usage settings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Clear all"</string>
@@ -87,7 +88,7 @@
<string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
- <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+ <string name="allset_title" msgid="5021126669778966707">"All set!"</string>
<string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Tap the home button to go to your home screen"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"You’re ready to start using your <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Save app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tap another app to use split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choose another app to use split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancel"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Exit split screen selection"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choose another app to use split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Do more with the Taskbar"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Always show the Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"To always show the Taskbar on the bottom of your screen, touch and hold the divider"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Touch and hold the action key to search what\'s on your screen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"This product uses the selected part of your screen to search. Google\'s <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Privacy Policy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> and <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Terms of Service<xliff:g id="END_TOS_LINK"></a></xliff:g> apply."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Home"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar and bubbles left shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar and bubbles right shown"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar hidden"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar and bubbles hidden"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Always show Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Change navigation mode"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Show # more app.}other{Show # more apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Show # desktop app.}other{Show # desktop apps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> and <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adding app to desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> from <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> and <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> more"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Move left"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Move right"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dismiss all"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expand <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"collapse <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml
index 0ecf772..bc2f91a 100644
--- a/quickstep/res/values-en-rIN/strings.xml
+++ b/quickstep/res/values-en-rIN/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No recent items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"App usage settings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Clear all"</string>
@@ -87,7 +88,7 @@
<string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
- <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+ <string name="allset_title" msgid="5021126669778966707">"All set!"</string>
<string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Tap the home button to go to your home screen"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"You’re ready to start using your <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Save app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tap another app to use split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choose another app to use split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancel"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Exit split screen selection"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choose another app to use split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Do more with the Taskbar"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Always show the Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"To always show the Taskbar on the bottom of your screen, touch and hold the divider"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Touch and hold the action key to search what\'s on your screen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"This product uses the selected part of your screen to search. Google\'s <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Privacy Policy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> and <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Terms of Service<xliff:g id="END_TOS_LINK"></a></xliff:g> apply."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Home"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar and bubbles left shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar and bubbles right shown"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar hidden"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar and bubbles hidden"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Always show Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Change navigation mode"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Show # more app.}other{Show # more apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Show # desktop app.}other{Show # desktop apps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> and <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adding app to desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> from <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> and <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> more"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Move left"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Move right"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dismiss all"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expand <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"collapse <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-en-rXC/strings.xml b/quickstep/res/values-en-rXC/strings.xml
index f3499e1..65f0d39 100644
--- a/quickstep/res/values-en-rXC/strings.xml
+++ b/quickstep/res/values-en-rXC/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No recent items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"App usage settings"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Clear all"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Save app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tap another app to use split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choose another app to use split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639">""<b>"Cancel"</b>""</string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancel"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Exit split screen selection"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choose another app to use split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organization"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar & bubbles left shown"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar & bubbles right shown"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar hidden"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar & bubbles hidden"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Always show Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Change navigation mode"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Show # more app.}other{Show # more apps.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Show # desktop app.}other{Show # desktop apps.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> and <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adding app to Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancel"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> from <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> and <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> more"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Move left"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Move right"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dismiss all"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expand <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"collapse <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml
index 8b221cc..87a05ef 100644
--- a/quickstep/res/values-es-rUS/strings.xml
+++ b/quickstep/res/values-es-rUS/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fijar"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Formato libre"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Escritorio"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Computadoras"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No hay elementos recientes"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Configuración de uso de la app"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Cerrar todo"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Guardar vinculación"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Presiona otra app para usar la pantalla dividida"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Elige otra app para usar la pantalla dividida"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancelar"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancelar"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Salir de la selección de pantalla dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Elige otra app para usar la pantalla dividida"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"La app o tu organización no permiten realizar esta acción"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Aprovecha mejor la Barra de tareas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostrar siempre la Barra de tareas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Mantén presionado el divisor para mostrar siempre la Barra de tareas en la parte inferior de la pantalla"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Mantén presionada la tecla de acción para buscar qué hay en la pantalla"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Este producto usa la parte seleccionada de la pantalla para buscar. Se aplican la <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Política de Privacidad<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> y las <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Condiciones del Servicio<xliff:g id="END_TOS_LINK"></a></xliff:g> de Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Cerrar"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Listo"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Botón de inicio"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Config. rápida"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tareas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barra de tareas visible"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra tareas y burb. a la izq."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra tareas y burb. a la der."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barra de tareas oculta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra tareas y burb. ocultas"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegación"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Barra de tareas visible"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Cambiar el modo de navegación"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mover a la parte superior o izquierda"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mover a la parte inferior o derecha"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostrar # app más.}other{Mostrar # apps más.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostrar # app para computadoras.}other{Mostrar # apps para computadoras.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> y <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Agregando app al escritorio"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancelar"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbuja"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Ampliada"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> y <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> más"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mover hacia la izquierda"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mover hacia la derecha"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Descartar todo"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expandir <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"contraer <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml
index 5093400..8bd5fb8 100644
--- a/quickstep/res/values-es/strings.xml
+++ b/quickstep/res/values-es/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fijar"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Formato libre"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Ordenador"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Escritorio"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Ordenador"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"No hay nada reciente"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Ajustes de uso de la aplicación"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Borrar todo"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Guardar apps emparejadas"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Toca otra aplicación para usar la pantalla dividida"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Elige otra app para usar la pantalla dividida."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancelar"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancelar"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Salir de la selección de pantalla dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Elige otra app para usar la pantalla dividida."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"No puedes hacerlo porque la aplicación o tu organización no lo permiten"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Sácale más partido a la barra de tareas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostrar siempre la barra de tareas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Para mostrar siempre la barra de tareas en la parte inferior, mantén pulsada la línea divisoria"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Mantén pulsada la tecla de acción para buscar lo que ves en pantalla"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Este producto usa la parte seleccionada de tu pantalla para hacer búsquedas. Se aplican la <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Política de Privacidad<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> y los <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Términos del Servicio<xliff:g id="END_TOS_LINK"></a></xliff:g> de Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Cerrar"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Hecho"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Inicio"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Ajustes rápidos"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tareas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barra de tareas visible"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Tareas y burbujas a izquierda"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Tareas y burbujas a derecha"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barra de tareas oculta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Tareas y burbujas ocultas"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegación"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Barra de tareas visible"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Cambiar el modo de navegación"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mover arriba/a la izquierda"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mover abajo/a la derecha"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostrar # aplicación más.}other{Mostrar # aplicaciones más.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostrar # aplicación para ordenadores.}other{Mostrar # aplicaciones para ordenadores.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> y <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Añadiendo aplicación al ordenador"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancelar"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbuja"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Menú adicional"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> y <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> más"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mover hacia la izquierda"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mover hacia la derecha"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Cerrar todo"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"desplegar <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"contraer <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml
index e704e21..32d29c8 100644
--- a/quickstep/res/values-et/strings.xml
+++ b/quickstep/res/values-et/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Kinnita"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Vabavorm"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Lauaarvuti režiim"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Töölaud"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Hiljutisi üksusi pole"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Rakenduse kasutuse seaded"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Sule kõik"</string>
@@ -72,8 +73,8 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Väga hea!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Pühkige kindlasti ekraani alumisest servast üles."</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Hoidke sõrme aknal pisut kauem, enne kui vabastate"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pühkige kindlasti otse üles, seejärel peatuge"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Õppisite liigutusi kasutama. Liigutuste väljalülitamiseks avage seaded."</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pühkige kindlasti otse üles, seejärel peatuge."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Õppisite liigutusi kasutama. Liigutuste väljalülitamiseks avage Seaded."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Tegite rakenduste vahel vahetamise liigutuse"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Pühkige rakenduste vahetamiseks"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Rakenduste vahel vahetamiseks pühkige ekraanikuva alaosast üles, hoidke ja seejärel vabastage."</string>
@@ -90,16 +91,16 @@
<string name="allset_title" msgid="5021126669778966707">"Valmis!"</string>
<string name="allset_hint" msgid="459504134589971527">"Avalehele liikumiseks pühkige üles"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Avakuvale liikumiseks puudutage avakuva nuppu"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"Olete valmis oma seadet <xliff:g id="DEVICE">%1$s</xliff:g> kasutama"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> on nüüd kasutamiseks valmis"</string>
<string name="default_device_name" msgid="6660656727127422487">"seade"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Süsteemi navigeerimisseaded"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Jaga"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Ekraanipilt"</string>
- <string name="action_split" msgid="2098009717623550676">"Eralda"</string>
+ <string name="action_split" msgid="2098009717623550676">"Jaga pooleks"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Salvesta rakendusepaar"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Jagatud ekraanikuva kasutamiseks puudutage muud rakendust"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Valige jagatud ekraanikuva jaoks muu rakendus."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Tühista"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Tühista"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Jagatud ekraanikuva valikust väljumine"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Valige jagatud ekraanikuva jaoks muu rakendus."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Rakendus või teie organisatsioon on selle toimingu keelanud"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Tehke tegumiriba abil enamat"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Alati kuvatud tegumiriba"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Puudutage pikalt jaoturit, et tegumiriba oleks ekraani allosas alati kuvatud"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Puudutage pikalt toiminguklahvi, et ekraanil kuvatut otsida"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"See toode kasutab otsingu jaoks ekraani valitud osa. Kehtivad Google\'i <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>privaatsuseeskirjad<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> ja <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>teenusetingimused<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Sule"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Valmis"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Avaleht"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Kiirseaded"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Tegumiriba"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Tegumiriba on kuvatud"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Tegumiriba ja mullid kuvatakse"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Tegumiriba ja mullid kuvatakse paremal"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Tegumiriba on peidetud"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Tegumiriba ja mullid on peidetud"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigeerimisriba"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Kuva tegumiriba alati"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Navigeerimisrežiimi muutmine"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Kuva veel # rakendus.}other{Kuva veel # rakendust.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Kuva # töölauarakendus.}other{Kuva # töölauarakendust.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ja <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Rakenduse lisamine arvutisse"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Tühista"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Mull"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Ületäide"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> – <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ja veel <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> mulli"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Liigu vasakule"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Liigu paremale"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Loobu kõigist"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"Toiminguriba <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> laiendamine"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"Toiminguriba <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ahendamine"</string>
</resources>
diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml
index 690603b..210e2a2 100644
--- a/quickstep/res/values-eu/strings.xml
+++ b/quickstep/res/values-eu/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Ainguratu"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Modu librea"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Ordenagailua"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Mahaigaina"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Ez dago azkenaldi honetako ezer"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Aplikazioen erabileraren ezarpenak"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Garbitu guztiak"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Gorde aplikazio parea"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Sakatu beste aplikazio bat pantaila zatitzeko"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Pantaila zatitua erabiltzeko, aukeratu beste aplikazio bat"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Utzi"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Utzi"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Irten pantaila zatituaren hautapenetik"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Pantaila zatitzeko, aukeratu beste aplikazio bat"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikazioak edo erakundeak ez du eman ekintza hori gauzatzeko baimena"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Egin gauza gehiago zereginen barrarekin"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Erakutsi beti zereginen barra"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Pantailaren behealdeko zereginen barra beti erakusteko, eduki sakatuta zatitzailea"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Eduki sakatuta ekintza-tekla pantailan dagoena bilatzeko"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Produktu honek pantailan hautatutako zatia erabiltzen du bilaketa egiteko. Google-ren <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Pribatutasun-gidalerroak<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> eta <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Zerbitzu-baldintzak<xliff:g id="END_TOS_LINK"></a></xliff:g> aplikatzen dira."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Itxi"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Eginda"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Hasiera"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Ezarpen bizkorrak"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Zereginen barra"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Zereginen barra ikusgai dago"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Zereginen barra eta burbuilak ezkerrean ikusgai"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Zereginen barra eta burbuilak eskuinean ikusgai"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Zereginen barra itxita dago"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Zereginen barra eta burbuilak ezkutatuta"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Nabigazio-barra"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Erakutsi beti zereginen barra"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Aldatu nabigazio modua"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Eraman gora, ezkerretara"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Eraman behera, eskuinetara"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Erakutsi beste # aplikazio.}other{Erakutsi beste # aplikazio.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Erakutsi ordenagailuetarako # aplikazio.}other{Erakutsi ordenagailuetarako # aplikazio.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> eta <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Aplikazioa mahaigainean gehitzen"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Utzi"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbuila"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Luzapena"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> (<xliff:g id="APP_NAME">%2$s</xliff:g>)"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> eta beste <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Eraman ezkerrera"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Eraman eskuinera"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Baztertu guztiak"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"zabaldu <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"tolestu <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml
index 5900538..ef21402 100644
--- a/quickstep/res/values-fa/strings.xml
+++ b/quickstep/res/values-fa/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"پین"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"رایانه"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"حالت رایانه"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"رایانه"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"چیز جدیدی اینجا نیست"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"تنظیمات استفاده از برنامه"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"پاک کردن همه"</string>
@@ -89,7 +90,7 @@
<string name="gesture_tutorial_step" msgid="1279786122817620968">"آموزش گامبهگام <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"همه چیز آماده است!"</string>
<string name="allset_hint" msgid="459504134589971527">"برای رفتن به صفحه اصلی، تند بهبالا بکشید"</string>
- <string name="allset_button_hint" msgid="2395219947744706291">"برای رفتن به صفحه اصلی، روی دکمه صفحه اصلی ضربه بزنید"</string>
+ <string name="allset_button_hint" msgid="2395219947744706291">"برای رفتن به صفحه اصلی، روی دکمه صفحه اصلی تکضرب بزنید"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"آمادهاید از <xliff:g id="DEVICE">%1$s</xliff:g> خود استفاده کنید"</string>
<string name="default_device_name" msgid="6660656727127422487">"دستگاه"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"تنظیمات پیمایش سیستم"</annotation></string>
@@ -99,11 +100,11 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ذخیره جفت برنامه"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"زدن روی برنامهای دیگر برای استفاده از صفحه دونیمه"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"انتخاب برنامهای دیگر برای استفاده از صفحه دونیمه"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"لغو کردن"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"لغو کردن"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"خروج از انتخاب صفحهٔ دونیمه"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"انتخاب برنامهای دیگر برای استفاده از صفحه دونیمه"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"برنامه یا سازمان شما اجازه نمیدهد این کنش انجام شود."</string>
- <string name="split_widgets_not_supported" msgid="1355743038053053866">"درحالحاضر از ابزارکها پشتیبانی نمیشود، لطفاً برنامه دیگری را انتخاب کنید"</string>
+ <string name="split_widgets_not_supported" msgid="1355743038053053866">"درحالحاضر از ابزارهها پشتیبانی نمیشود، لطفاً برنامه دیگری را انتخاب کنید"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"آموزش گامبهگام پیمایش رد شود؟"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"میتوانید آن را بعداً در برنامه <xliff:g id="NAME">%1$s</xliff:g> پیدا کنید"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"لغو"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"تنظیمات فوری"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"نوار وظیفه"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"نوار وظیفه نمایان است"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"نمایش نوار وظیفه و حبابکها در چپ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"نمایش نوار وظیفه و حبابکها در راست"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"نوار وظیفه پنهان است"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"نوار وظیفه و حبابکها پنهان هستند"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"نوار پیمایش"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"نوار وظیفه همیشه نشان داده شود"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"تغییر حالت پیمایش"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"انتقال به بالا/ چپ"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"انتقال به پایین/ راست"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{نمایش # برنامه دیگر.}one{نمایش # برنامه دیگر.}other{نمایش # برنامه دیگر.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{نمایش # برنامه رایانه.}one{نمایش # برنامه رایانه.}other{نمایش # برنامه رایانه.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> و <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"درحال افزودن برنامه به رایانه"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"لغو"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"حبابک"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"سرریز"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> از <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> و <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> حبابک دیگر"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"انتقال به چپ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"انتقال به راست"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"رد کردن همه"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"ازهم باز کردن <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"جمع کردن <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml
index e6befd6..8288cb5 100644
--- a/quickstep/res/values-fi/strings.xml
+++ b/quickstep/res/values-fi/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Kiinnitä"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Vapaamuotoinen"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Tietokone"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Tietokone"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Ei viimeaikaisia kohteita"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Sovelluksen käyttöasetukset"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Poista kaikki"</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Hienoa!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Pyyhkäise ylös näytön alareunasta"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Kokeile pitää ikkunaa painettuna pidempään ennen kuin päästät irti"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Muista pyyhkäistä suoraan ylöspäin ja pysähdy sitten"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pyyhkäise suoraan ylöspäin ja pysähdy sitten"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Olet oppinut käyttämään eleitä. Jos haluat laittaa eleet pois päältä, avaa Asetukset."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Olet oppinut sovellusten vaihtamiseleen"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Vaihda sovellusta pyyhkäisemällä"</string>
@@ -95,11 +96,11 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Järjestelmän navigointiasetukset"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Jaa"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Kuvakaappaus"</string>
- <string name="action_split" msgid="2098009717623550676">"Jaa"</string>
+ <string name="action_split" msgid="2098009717623550676">"Jaettu näyttö"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Tallenna pari"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Avaa jaettu näyttö napauttamalla toista sovellusta"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Käytä jaettua näyttöä valitsemalla toinen sovellus"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Peruuta"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Peru"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Poistu jaetun näytön valinnasta"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Käytä jaettua näyttöä valitsemalla toinen sovellus"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Sovellus tai organisaatio ei salli tätä toimintoa"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Vinkkejä tehtäväpalkin tehokkaampaan käyttöön"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Näytä tehtäväpalkki aina"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Jos haluat tehtäväpalkin näkyvän aina näytön alaosassa, kosketa jakajaa pitkään"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Kosketa toimintonäppäintä pitkään, niin voit hakea näytöltä"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Tämä tuote käyttää hakuun valittua näytön osaa. Tähän sovelletaan Googlen <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>tietosuojakäytäntöä<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> ja <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>käyttöehtoja<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Sulje"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Valmis"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Etusivu"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Pika-asetukset"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Tehtäväpalkki"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Tehtäväpalkki näkyvissä"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Vas. palkki ja kuplat näkyvissä"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Oik. palkki ja kuplat näkyvissä"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Tehtäväpalkki piilotettu"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Palkki ja kuplat piilotettu"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigointipalkki"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Näytä tehtäväpalkki aina"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Vaihda navigointitilaa"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Siirrä ylös tai vasemmalle"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Siirrä alas tai oikealle"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Näytä # muu sovellus.}other{Näytä # muuta sovellusta.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Näytä # työpöytäsovellus.}other{Näytä # työpöytäsovellusta.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ja <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Sovelluksen lisääminen työpöydälle"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Peru"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Kupla"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Ylivuoto"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>: <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ja <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> muuta"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Siirrä vasemmalle"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Siirrä oikealle"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Hylkää kaikki"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"laajenna <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"tiivistä <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml
index cd35afb..e3089b6 100644
--- a/quickstep/res/values-fr-rCA/strings.xml
+++ b/quickstep/res/values-fr-rCA/strings.xml
@@ -22,35 +22,36 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Épingler"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Forme libre"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Ordinateur de bureau"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Ordinateur de bureau"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Aucun élément récent"</string>
- <string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Paramètres d\'utilisation de l\'application"</string>
+ <string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Paramètres d\'utilisation de l\'appli"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Tout effacer"</string>
- <string name="accessibility_recent_apps" msgid="4058661986695117371">"Applications récentes"</string>
+ <string name="accessibility_recent_apps" msgid="4058661986695117371">"Applis récentes"</string>
<string name="task_view_closed" msgid="9170038230110856166">"Tâche fermée"</string>
<string name="task_contents_description_with_remaining_time" msgid="4479688746574672685">"<xliff:g id="TASK_DESCRIPTION">%1$s</xliff:g> : <xliff:g id="REMAINING_TIME">%2$s</xliff:g>"</string>
<string name="shorter_duration_less_than_one_minute" msgid="4722015666335015336">"< 1 min"</string>
<string name="time_left_for_app" msgid="3111996412933644358">"Il reste <xliff:g id="TIME">%1$s</xliff:g> aujourd\'hui"</string>
- <string name="title_app_suggestions" msgid="4185902664111965088">"Suggestions d\'applications"</string>
- <string name="all_apps_prediction_tip" msgid="2672336544844936186">"Vos prédictions d\'applications"</string>
- <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"Obtenir des suggestions d\'applications dans la rangée du bas de votre écran d\'accueil"</string>
- <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Retrouvez des suggestions d\'applications dans la rangée des favoris de votre écran d\'accueil"</string>
- <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accédez facilement aux applications que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applications dans la rangée du bas seront déplacées vers votre écran d\'accueil."</string>
- <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accédez facilement aux applications que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applications dans la rangée des favoris seront déplacées vers votre écran d\'accueil."</string>
- <string name="hotseat_edu_accept" msgid="1611544083278999837">"Obtenir des suggestions d\'applications"</string>
+ <string name="title_app_suggestions" msgid="4185902664111965088">"Suggestions d\'applis"</string>
+ <string name="all_apps_prediction_tip" msgid="2672336544844936186">"Vos prédictions d\'applis"</string>
+ <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"Obtenir des suggestions d\'applis dans la rangée du bas de votre écran d\'accueil"</string>
+ <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Retrouvez des suggestions d\'applis dans la rangée des favoris de votre écran d\'accueil"</string>
+ <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accédez facilement aux applis que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applis dans la rangée du bas seront déplacées vers votre écran d\'accueil."</string>
+ <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accédez facilement aux applis que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applis dans la rangée des favoris seront déplacées vers votre écran d\'accueil."</string>
+ <string name="hotseat_edu_accept" msgid="1611544083278999837">"Obtenir des suggestions d\'applis"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Non merci"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Paramètres"</string>
- <string name="hotseat_auto_enrolled" msgid="522100018967146807">"Les applications les plus utilisées s\'affichent ici et changent en fonction des habitudes"</string>
- <string name="hotseat_tip_no_empty_slots" msgid="1325212677738179185">"Faites glisser des applications hors de la rangée du bas pour obtenir des suggestions d\'applications"</string>
- <string name="hotseat_tip_gaps_filled" msgid="3035673010274223538">"Applications suggérées ajoutées à l\'espace vide"</string>
- <string name="hotsaet_tip_prediction_enabled" msgid="2233554377501347650">"Les suggestions d\'applications sont activées"</string>
- <string name="hotsaet_tip_prediction_disabled" msgid="1506426298884658491">"Les suggestions d\'applications sont désactivées"</string>
- <string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Application prédite : <xliff:g id="TITLE">%1$s</xliff:g>"</string>
+ <string name="hotseat_auto_enrolled" msgid="522100018967146807">"Les applis les plus utilisées s\'affichent ici et changent en fonction des habitudes"</string>
+ <string name="hotseat_tip_no_empty_slots" msgid="1325212677738179185">"Faites glisser des applis hors de la rangée du bas pour obtenir des suggestions d\'applis"</string>
+ <string name="hotseat_tip_gaps_filled" msgid="3035673010274223538">"Applis suggérées ajoutées à l\'espace vide"</string>
+ <string name="hotsaet_tip_prediction_enabled" msgid="2233554377501347650">"Les suggestions d\'applis sont activées"</string>
+ <string name="hotsaet_tip_prediction_disabled" msgid="1506426298884658491">"Les suggestions d\'applis sont désactivées"</string>
+ <string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Appli prédite : <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"Faites pivoter votre appareil"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"Veuillez faire pivoter votre appareil pour terminer le tutoriel de navigation par gestes"</string>
<string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Assurez-vous de balayer l\'écran à partir de l\'extrémité droite ou gauche"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"Assurez-vous de balayer l\'écran à partir de l\'extrémité droite ou gauche vers le centre, puis allons-y"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Vous avez appris à balayer de la droite pour revenir en arrière. Apprenez comment changer d\'appli."</string>
- <string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Vous avez appris le geste de retour en arrière. Maintenant, apprenez comment changer d\'application."</string>
+ <string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Vous avez appris le geste de retour en arrière. Maintenant, apprenez comment changer d\'appli."</string>
<string name="back_gesture_feedback_complete_without_follow_up" msgid="197189945858268342">"Vous avez appris le geste de retour en arrière"</string>
<string name="back_gesture_feedback_swipe_in_nav_bar" msgid="9157480023651452969">"Assurez-vous de ne pas balayer trop près du bas de l\'écran"</string>
<string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"Modifiez la sensibilité du geste de retour dans Paramètres"</string>
@@ -74,11 +75,11 @@
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Essayez de tenir la fenêtre plus longtemps avant de relâcher"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Assurez-vous de balayer l\'écran vers le haut, puis de faire une pause"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Vous avez appris à utiliser les gestes. Pour les désactiver, accédez au menu Paramètres."</string>
- <string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Vous avez appris le geste de changement d\'application"</string>
- <string name="overview_gesture_intro_title" msgid="2902054412868489378">"Balayez pour basculer entre les applications"</string>
- <string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Pour changer d\'application, balayez l\'écran de bas en haut, maintenez le doigt dessus, puis relâchez-le."</string>
+ <string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Vous avez appris le geste de changement d\'appli"</string>
+ <string name="overview_gesture_intro_title" msgid="2902054412868489378">"Balayez pour basculer entre les applis"</string>
+ <string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Pour changer d\'appli, balayez l\'écran de bas en haut, maintenez le doigt dessus, puis relâchez-le."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Pour changer d\'appli, balayez l\'écran de bas en haut avec deux doigts, maintenez-les et relâchez-les."</string>
- <string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Changer d\'application"</string>
+ <string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Changer d\'appli"</string>
<string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Balayez l\'écran de bas en haut, maintenez le doigt en place, puis relâchez-le"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"Bien joué!"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Terminé"</string>
@@ -98,14 +99,14 @@
<string name="action_split" msgid="2098009717623550676">"Partager"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Enr. paire d\'applis"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Toucher une autre appli pour partager l\'écran"</string>
- <string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choisir une autre application pour utiliser l\'Écran divisé"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Annuler"</b></string>
+ <string name="toast_contextual_split_select_app" msgid="433510957123687090">"Choisir une autre appli pour utiliser l\'Écran divisé"</string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Annuler"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Quitter la sélection d\'écran divisé"</string>
- <string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choisir une autre application pour utiliser l\'écran partagé"</string>
- <string name="blocked_by_policy" msgid="2071401072261365546">"L\'application ou votre organisation n\'autorise pas cette action"</string>
- <string name="split_widgets_not_supported" msgid="1355743038053053866">"Les widgets ne sont actuellement pas pris en charge. Veuillez sélectionner une autre application"</string>
+ <string name="toast_split_app_unsupported" msgid="2360229567007828914">"Choisir une autre appli pour utiliser l\'écran partagé"</string>
+ <string name="blocked_by_policy" msgid="2071401072261365546">"L\'appli ou votre organisation n\'autorise pas cette action"</string>
+ <string name="split_widgets_not_supported" msgid="1355743038053053866">"Les widgets ne sont actuellement pas pris en charge. Veuillez sélectionner une autre appli"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Ignorer le tutoriel sur la navigation?"</string>
- <string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Vous trouverez le tutoriel dans l\'application <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Vous trouverez le tutoriel dans l\'appli <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Annuler"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ignorer"</string>
<string name="accessibility_rotate_button" msgid="4771825231336502943">"Faire pivoter l\'écran"</string>
@@ -130,16 +131,26 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Paramètres rapides"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barre des tâches"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barre des tâches affichée"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barre des tâches/bulles à gauche"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barre des tâches/bulles à droite"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barre des tâches masquée"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barre des tâches/bulles masquées"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barre de navigation"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Tjrs afficher barre des tâches"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Changer de mode de navigation"</string>
<string name="taskbar_divider_a11y_title" msgid="6608690309720242080">"Séparateur de la barre des tâches"</string>
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Déplacer vers le coin supérieur gauche de l\'écran"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Déplacer vers le coin inférieur droit de l\'écran"</string>
- <string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Afficher # autre application.}one{Afficher # autre application.}other{Afficher # autres applications.}}"</string>
- <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Afficher # application de bureau.}one{Afficher # application de bureau.}other{Afficher # applications de bureau.}}"</string>
+ <string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Afficher # autre appli.}one{Afficher # autre appli.}other{Afficher # autres applis.}}"</string>
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Afficher # appli de bureau.}one{Afficher # appli de bureau.}other{Afficher # applis de bureau.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> et <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Ajout de l\'application au bureau en cours…"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Annuler"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bulle"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Bulle à développer"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> et <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> autres"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Déplacer vers la gauche"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Déplacer vers la droite"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Tout ignorer"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"Développer <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"Réduire <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml
index 1d82277..b68378b 100644
--- a/quickstep/res/values-fr/strings.xml
+++ b/quickstep/res/values-fr/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Épingler"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Format libre"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Ordinateur"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Ordinateur"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Aucun élément récent"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Paramètres de consommation de l\'application"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Tout effacer"</string>
@@ -88,7 +89,7 @@
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"Bravo !"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutoriel <xliff:g id="CURRENT">%1$d</xliff:g> sur <xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"Tout est prêt !"</string>
- <string name="allset_hint" msgid="459504134589971527">"Balayez l\'écran vers le haut pour revenir à l\'accueil"</string>
+ <string name="allset_hint" msgid="459504134589971527">"Balayez vers le haut pour revenir à l\'accueil"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Appuyez sur le bouton d\'accueil pour accéder à votre écran d\'accueil"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"Vous pouvez maintenant utiliser votre <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"appareil"</string>
@@ -96,10 +97,10 @@
<string name="action_share" msgid="2648470652637092375">"Partager"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Capture d\'écran"</string>
<string name="action_split" msgid="2098009717623550676">"Partager"</string>
- <string name="action_save_app_pair" msgid="5974823919237645229">"Enregistrer la paire d\'applis"</string>
+ <string name="action_save_app_pair" msgid="5974823919237645229">"Enregistrer une paire d\'applis"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Appuyez sur autre appli pour l\'écran partagé"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Sélectionnez une autre appli pour utiliser l\'écran partagé."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Annuler"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Annuler"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Quitter la sélection de l\'écran partagé"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Sélect. autre appli pour utiliser l\'écran partagé"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Cette action n\'est pas autorisée par l\'application ou par votre organisation"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Faites-en plus avec la barre des tâches"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Toujours afficher la barre des tâches"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Pour toujours afficher la barre des tâches en bas de votre écran, appuyez sur le séparateur de manière prolongée."</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Appuyez de manière prolongée sur la touche d\'action pour rechercher ce qui se trouve à l\'écran"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ce produit utilise la zone sélectionnée de l\'écran pour rechercher. Les <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Règles de confidentialité<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> et les <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Conditions d\'utilisation<xliff:g id="END_TOS_LINK"></a></xliff:g> de Google s\'appliquent."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fermer"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"OK"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Accueil"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Réglages rapides"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barre des tâches"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barre des tâches affichée"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barre des tâches et bulles affichées à gauche"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barre des tâches et bulles affichées à droite"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barre des tâches masquée"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barre des tâches et bulles masquées"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barre de navigation"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Barre des tâches tjs visible"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Modifier le mode de navigation"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Déplacer en haut ou à gauche"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Déplacer en bas ou à droite"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Afficher # autre appli}one{Afficher # autre appli}other{Afficher # autre applis}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Afficher # application de bureau.}one{Afficher # application de bureau.}other{Afficher # applications de bureau.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> et <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Ajout de l\'appli au bureau"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Annuler"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bulle"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Dépassement"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> (<xliff:g id="APP_NAME">%2$s</xliff:g>)"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> et <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> autre(s)"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Déplacer vers la gauche"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Déplacer vers la droite"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Tout fermer"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"Développer <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"Réduire <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml
index 096709c..b4c91ba 100644
--- a/quickstep/res/values-gl/strings.xml
+++ b/quickstep/res/values-gl/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixar"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Forma libre"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Escritorio"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Ordenador"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Non hai elementos recentes"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Configuración do uso de aplicacións"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Borrar todo"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"Todo listo"</string>
<string name="allset_hint" msgid="459504134589971527">"Pasa o dedo cara arriba para ir á pantalla de inicio"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Toca o botón de inicio para ir á pantalla de inicio"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"Xa podes comezar a utilizar o teu dispositivo (<xliff:g id="DEVICE">%1$s</xliff:g>)"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> xa está dispoñible para comezar a utilizar"</string>
<string name="default_device_name" msgid="6660656727127422487">"dispositivo"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Configuración da navegación do sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Compartir"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Gardar parella apps"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Para usar a pantalla dividida, toca outra app"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Escolle outra aplicación para usar a pantalla dividida."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancelar"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancelar"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Saír da selección de pantalla dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Escolle outra app para usar a pantalla dividida"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"A aplicación ou a túa organización non permite realizar esta acción"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Tira máis proveito da barra de tarefas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostrar sempre a barra de tarefas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Para fixar a barra de tarefas na parte inferior, mantén premida a liña divisoria"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Mantén premida a tecla de acción para buscar o que hai na pantalla"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Este produto utiliza a parte seleccionada da pantalla para facer buscas. Aplícanse as <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Condicións de servizo<xliff:g id="END_TOS_LINK"></a></xliff:g> e a <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Política de privacidade<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> de Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Pechar"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Listo"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Inicio"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Configuración rápida"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tarefas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Estase mostrando a barra de tarefas"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra e burbullas á esquerda"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra e burbullas á dereita"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Non se está mostrando a barra de tarefas"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra e burbullas ocultas"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegación"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Ver sempre a barra de tarefas"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Cambiar modo de navegación"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mover á parte superior ou á esquerda"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mover á parte inferior ou á dereita"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostrar # aplicación máis.}other{Mostrar # aplicacións máis.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostrar # aplicación para ordenadores.}other{Mostrar # aplicacións para ordenadores.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> e <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Engadindo aplicación ao ordenador"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancelar"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbulla"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Menú adicional"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> e <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> máis"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mover cara á esquerda"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mover cara á dereita"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Pechar todo"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"despregar <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"contraer <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml
index f1eb638..dcbcd58 100644
--- a/quickstep/res/values-gu/strings.xml
+++ b/quickstep/res/values-gu/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"પિન કરો"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ફ્રિફોર્મ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ડેસ્કટૉપ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ડેસ્કટૉપ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"તાજેતરની કોઈ આઇટમ નથી"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ઍપ વપરાશનું સેટિંગ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"બધું સાફ કરો"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ઍપની જોડી સાચવો"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"વિભાજિત સ્ક્રીન વાપરવા, કોઈ અન્ય ઍપ પર ટૅપ કરો"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"વિભાજિત સ્ક્રીનની સુવિધાનો ઉપયોગ કરવા કોઈ અન્ય ઍપ પસંદ કરો"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"રદ કરો"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"રદ કરો"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"\'સ્ક્રીનને વિભાજિત કરો\' પસંદગીમાંથી બહાર નીકળો"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"સ્ક્રીન વિભાજનનો ઉપયોગ કરવા કોઈ અન્ય ઍપ પસંદ કરો"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ઍપ કે તમારી સંસ્થા દ્વારા આ ક્રિયા કરવાની મંજૂરી નથી"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"ટાસ્કબાર વડે બીજું ઘણું કરો"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"ટાસ્કબાર હંમેશાં બતાવો"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"ટાસ્કબાર હંમેશાં તમારી સ્ક્રીનમાં સૌથી નીચે દેખાય તે માટે વિભાજકને ટચ કરીને થોડીવાર દબાવી રાખો"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"તમારી સ્ક્રીન પર જે હોય તે શોધવા માટે, ઍક્શન કી ટચ કરીને દબાવી રાખો"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"શોધવા માટે, આ પ્રોડક્ટ તમારી સ્ક્રીનના પસંદ કરેલા ભાગનો ઉપયોગ કરે છે. Googleની <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>પ્રાઇવસી પૉલિસી<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> અને <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>સેવાની શરતો<xliff:g id="END_TOS_LINK"></a></xliff:g> લાગુ થાય છે."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"બંધ કરો"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"થઈ ગયું"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"હોમ"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ઝડપી સેટિંગ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ટાસ્કબાર"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ટાસ્કબાર બતાવવામાં આવ્યો"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ટાસ્કબાર અને બબલ ડાબે બતાવ્યા"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ટાસ્કબાર અને બબલ જમણે બતાવ્યા"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ટાસ્કબાર છુપાવવામાં આવ્યો"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ટાસ્કબાર અને બબલ છુપાવેલા છે"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"નૅવિગેશન બાર"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"હંમેશાં ટાસ્કબાર બતાવો"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"નૅવિગેશન મોડ બદલો"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{વધુ # ઍપ બતાવો.}one{વધુ # ઍપ બતાવો.}other{વધુ # ઍપ બતાવો.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ડેસ્કટૉપ ઍપ બતાવો.}one{# ડેસ્કટૉપ ઍપ બતાવો.}other{# ડેસ્કટૉપ ઍપ બતાવો.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> અને <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ડેસ્કટૉપ પર ઍપ ઉમેરી રહ્યાં છીએ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"રદ કરો"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"બબલ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ઓવરફ્લો"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g>થી <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> અને વધુ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ડાબે ખસેડો"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"જમણે ખસેડો"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"તમામ છોડી દો"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> મોટો કરો"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> નાનો કરો"</string>
</resources>
diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml
index d40b0b4..137f809c 100644
--- a/quickstep/res/values-hi/strings.xml
+++ b/quickstep/res/values-hi/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"पिन करें"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"फ़्रीफ़ॉर्म"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"डेस्कटॉप"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"डेस्कटॉप"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"हाल ही का कोई आइटम नहीं है"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ऐप्लिकेशन इस्तेमाल की सेटिंग"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"सभी हटाएं"</string>
@@ -92,14 +93,14 @@
<string name="allset_button_hint" msgid="2395219947744706291">"होम स्क्रीन पर जाने के लिए, होम बटन पर टैप करें"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"अब <xliff:g id="DEVICE">%1$s</xliff:g> इस्तेमाल के लिए तैयार है"</string>
<string name="default_device_name" msgid="6660656727127422487">"डिवाइस"</string>
- <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"सिस्टम नेविगेशन सेटिंग"</annotation></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>
<string name="action_split" msgid="2098009717623550676">"स्प्लिट स्क्रीन मोड"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"ऐप पेयर सेव करें"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"स्प्लिट स्क्रीन के लिए दूसरे ऐप्लिकेशन पर टैप करें"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"स्प्लिट स्क्रीन इस्तेमाल करने के लिए, दूसरा ऐप्लिकेशन चुनें"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"अभी नहीं"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"अभी नहीं"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"स्प्लिट स्क्रीन मोड से बाहर निकलें"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"स्प्लिट स्क्रीन के लिए, दूसरा ऐप्लिकेशन चुनें"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ऐप्लिकेशन या आपका संगठन इस कार्रवाई की अनुमति नहीं देता"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"फटाफट सेटिंग"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"टास्कबार"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"टास्कबार दिखाया गया"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"टास्कबार और बबल बाईं ओर हैं"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"टास्कबार और बबल दाईं ओर हैं"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"टास्कबार छिपाया गया"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"टास्कबार और बबल छिपाए गए"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"नेविगेशन बार"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"टास्कबार हमेशा दिखाएं"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"नेविगेशन का मोड बदलें"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# और ऐप्लिकेशन दिखाएं.}one{# और ऐप्लिकेशन दिखाएं.}other{# और ऐप्लिकेशन दिखाएं.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# डेस्कटॉप ऐप्लिकेशन दिखाएं.}one{# डेस्कटॉप ऐप्लिकेशन दिखाएं.}other{# डेस्कटॉप ऐप्लिकेशन दिखाएं.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> और <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"डेस्कटॉप पर ऐप्लिकेशन जोड़ा जा रहा है"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"रद्द करें"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"बबल"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ओवरफ़्लो"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> की <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> वाली सूचना"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> और <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> अन्य"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"बाईं ओर ले जाएं"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"दाईं ओर ले जाएं"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"सभी खारिज करें"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> को बड़ा करें"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> को छोटा करें"</string>
</resources>
diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml
index cc4db5b..6178570 100644
--- a/quickstep/res/values-hr/strings.xml
+++ b/quickstep/res/values-hr/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Prikvači"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Slobodni oblik"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Računalo"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Radna površina"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nema nedavnih stavki"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Postavke upotrebe aplikacija"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Izbriši sve"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Predviđena aplikacija: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"Zakrenite uređaj"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"Zakrenite uređaj da biste dovršili vodič o navigaciji pokretima"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Pazite da prijeđete prstom od krajnjeg desnog ili krajnjeg lijevog ruba"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Prijeđite prstom od krajnjeg desnog ili krajnjeg lijevog ruba"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"Pazite da prijeđete prstom od desnog ili lijevog ruba do sredine zaslona i podignite prst"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Naučili ste kako prijeći prstom zdesna da biste se vratili. Sad saznajte kako promijeniti aplikaciju."</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Izvršili ste pokret za povratak. Sad saznajte kako promijeniti aplikaciju."</string>
@@ -70,9 +71,9 @@
<string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Otvaranje početnog zaslona"</string>
<string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Prijeđite prstom od dna zaslona prema gore"</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Sjajno!"</string>
- <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Pazite da prijeđete prstom prema gore od donjeg ruba zaslona"</string>
+ <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Prijeđite prstom prema gore od donjeg ruba zaslona"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Pokušajte zadržati prozor dulje prije podizanja prsta"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pazite da prijeđete prstom ravno prema gore, a zatim zastanete"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Prijeđite prstom ravno prema gore, a zatim zastanite"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili ste koristiti pokrete. Pokrete možete isključiti u postavkama."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Izvršili ste pokret za promjenu aplikacije"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Povlačenje prstom za promjenu aplikacije"</string>
@@ -90,16 +91,16 @@
<string name="allset_title" msgid="5021126669778966707">"Sve je spremno!"</string>
<string name="allset_hint" msgid="459504134589971527">"Prijeđite prstom prema gore da biste otvorili početni zaslon"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Dodirnite gumb početnog zaslona da biste prešli na početni zaslon"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"Spremni ste za početak upotrebe uređaja <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
- <string name="default_device_name" msgid="6660656727127422487">"uređaj"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> je spreman za početak upotrebe"</string>
+ <string name="default_device_name" msgid="6660656727127422487">"Uređaj"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Postavke navigacije sustavom"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Podijeli"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snimka zaslona"</string>
- <string name="action_split" msgid="2098009717623550676">"Podijeli"</string>
+ <string name="action_split" msgid="2098009717623550676">"Podjela"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Spremi par apl."</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Dodirnite drugu aplikaciju za podijeljeni zaslon"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Odaberite drugu aplikaciju za upotrebu podijeljenog zaslona"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Odustani"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Odustani"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Zatvori odabir podijeljenog zaslona"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Odaberite drugu aplikaciju za upotrebu podijeljenog zaslona"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ili vaša organizacija ne dopuštaju ovu radnju"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Učinite više pomoću trake sa zadacima"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Uvijek prikazuj traku sa zadacima"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Da bi se traka prikazivala, dodirnite i držite razdjelnik"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Dodirnite i zadržite tipku za radnju da biste pretražili što se nalazi na zaslonu"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ovaj proizvod upotrebljava odabrani dio zaslona za pretraživanje. Primjenjuju se Googleova <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>pravila o privatnosti<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> i <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>uvjeti pružanja usluge<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gotovo"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Početna"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Brze postavke"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Traka sa zadacima"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Traka sa zadacima prikazana"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Traka sa zadacima/oblačići prikazani lijevo"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Traka sa zadacima/oblačići prikazani desno"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Traka sa zadacima skrivena"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Traka sa zadacima/oblačići skriveni"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigacijska traka"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Uvijek prikaži traku zadataka"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Promijeni način navigacije"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Premjesti gore/lijevo"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Premjesti dolje/desno"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Prikaži još # aplikaciju}one{Prikaži još # aplikaciju}few{Prikaži još # aplikacije}other{Prikaži još # aplikacija}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Prikaži # računalnu aplikaciju.}one{Prikaži # računalnu aplikaciju.}few{Prikaži # računalne aplikacije.}other{Prikaži # računalnih aplikacija.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> i <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Dodavanje aplikacije na radnu površinu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Odustani"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Oblačić"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Dodatni izbornik"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>, <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> i još <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Pomakni ulijevo"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Pomakni udesno"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Odbaci sve"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"proširite oblačić <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"sažmite oblačić <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml
index b0e0d39..99c39f1 100644
--- a/quickstep/res/values-hu/strings.xml
+++ b/quickstep/res/values-hu/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Kitűzés"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Szabad forma"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Asztali"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Asztali"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nincsenek mostanában használt elemek"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Alkalmazáshasználati beállítások"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Összes törlése"</string>
@@ -59,7 +60,7 @@
<string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Ha vissza szeretne térni a legutóbbi képernyőre, csúsztasson gyorsan két ujjal a képernyő bal vagy jobb széléről a közepe felé."</string>
<string name="back_gesture_tutorial_title" msgid="1944737946101059789">"Vissza"</string>
<string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Csúsztasson bal vagy jobb szélről a képernyő közepe felé."</string>
- <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Csúsztasson felfelé a képernyő aljától."</string>
+ <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Csúsztasson felfelé a képernyő alsó szélétől."</string>
<string name="home_gesture_feedback_overview_detected" msgid="5177627157303895077">"Ne álljon meg, mielőtt elengedi a képernyőt."</string>
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="8328465201424027148">"Csúsztasson egyenesen felfelé."</string>
<string name="home_gesture_feedback_complete_with_follow_up" msgid="8766981412895888417">"Teljesítette a kezdőképernyőre lépés kézmozdulatát. Most megtanulhatja, hogyan léphet vissza."</string>
@@ -68,9 +69,9 @@
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Csúsztassa ujját felfelé a képernyő aljától. Ez a mozdulat mindig a kezdőképernyőre visz."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Csúsztasson felfelé két ujjal a képernyő aljáról. Ez a kézmozdulat mindig a kezdőképernyőre viszi."</string>
<string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Ugrás a kezdőképernyőre"</string>
- <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Húzza ujját felfelé a képernyő aljától."</string>
+ <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Csúsztasson felfelé a képernyő aljától."</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Kiváló!"</string>
- <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Csúsztasson felfelé a képernyő aljától."</string>
+ <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Csúsztasson felfelé a képernyő alsó szélétől."</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Próbálja tovább lenyomva tartani az ablakot, mielőtt elengedi a képernyőt."</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Csúsztasson egyenesen felfelé, majd várjon egy kicsit"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Eddig megismerhette a kézmozdulatok használatát. A kézmozdulatokat a Beállításokban kapcsolhatja ki."</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"App-pár mentése"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Koppintson másik appra az osztott képernyőhöz"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Válasszon másik appot a képernyő felosztásához"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Mégse"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Mégse"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Kilépés az osztott képernyő elemeinek kiválasztásából"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Válasszon másik appot a képernyő felosztásához"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Az alkalmazás vagy az Ön szervezete nem engedélyezi ezt a műveletet"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Jobban kihasználhatja a Feladatsávot"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mindig jelenjen meg a Feladatsáv"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Ahhoz, hogy a Feladatsáv mindig megjelenjen a képernyő alján, érintse meg és tartsa lenyomva az elválasztót"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"A műveletbillentyűt lenyomva tartva kereshet a képernyőn található tartalmak között"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ez a termék a képernyő kiválasztott részét használja a kereséshez. A Google <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Adatvédelmi irányelvei<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> és <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Általános Szerződési Feltételei<xliff:g id="END_TOS_LINK"></a></xliff:g> érvényesek."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Bezárás"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Kész"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Kezdőlap"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Gyorsbeállítások"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Tálca"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Feladatsáv megjelenítve"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Feladatsáv és buborék balra"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Feladatsáv és buborék jobbra"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Feladatsáv elrejtve"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Rejtett feladatsáv és buborék"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigációs sáv"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Mindig megjelenő Feladatsáv"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Navigációs mód módosítása"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mozgatás felülre vagy a bal oldalra"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mozgatás alulra vagy a jobb oldalra"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# további alkalmazás megjelenítése.}other{# további alkalmazás megjelenítése.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# asztali alkalmazás megjelenítése.}other{# asztali alkalmazás megjelenítése.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> és <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Alkalmazás hozzáadása az asztalhoz"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Mégse"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Buborék"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Túlcsordulás"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>, forrás: <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> és <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> további"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mozgatás balra"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mozgatás jobbra"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Az összes elvetése"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> kibontása"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> összecsukása"</string>
</resources>
diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml
index 0d1f5cd..0dda363 100644
--- a/quickstep/res/values-hy/strings.xml
+++ b/quickstep/res/values-hy/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Ամրացնել"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Կամայական ձև"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Համակարգիչ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Համակարգիչ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Այստեղ դեռ ոչինչ չկա"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Հավելվածի օգտագործման կարգավորումներ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Փակել բոլորը"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Պահել հավելվ․ զույգը"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Հպեք այլ հավելվածի՝ տրոհված էկրանից օգտվելու համար"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Ընտրեք այլ հավելված՝ տրոհված էկրանից օգտվելու համար"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Չեղարկել"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Չեղարկել"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Դուրս գալ տրոհված էկրանի ռեժիմից"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Ընտրեք այլ հավելված՝ տրոհված էկրանից օգտվելու համար"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Այս գործողությունն արգելված է հավելվածի կամ ձեր կազմակերպության կողմից"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Օգտվեք հավելվածների վահանակի բոլոր հնարավորություններից"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Ամրացրեք հավելվածների վահանակը"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Հավելվածների վահանակն էկրանի ներքևում ամրացնելու համար հպեք և պահեք բաժանիչը"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Սեղմած պահեք գործողության ստեղնը՝ էկրանին բովանդակություն որոնելու համար"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Այս պրոդուկտն օգտագործում է էկրանի ընտրված հատվածը որոնման համար։ Կիրառվում են Google-ի <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Գաղտնիության քաղաքականությունը<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> և <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Օգտագործման պայմանները<xliff:g id="END_TOS_LINK"></a></xliff:g>։"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Փակել"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Պատրաստ է"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Սկիզբ"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Արագ կարգավորումներ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Խնդրագոտի"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Խնդրագոտին ցուցադրվում է"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Հավելվածների վահանակն ու ամպիկները տեսանելի են ձախ կողմում"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Հավելվածների վահանակն ու ամպիկները տեսանելի են աջ կողմում"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Խնդրագոտին թաքցված է"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Հավելվածների վահանակն ու ամպիկները թաքցված են"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Նավիգացիայի գոտի"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Միշտ ցույց տալ վահանակը"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Փոխել նավիգացիայի ռեժիմը"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Տեղափոխել վերևի ձախ անկյուն"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Տեղափոխել ներքևի աջ անկյուն"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Ցուցադրել ևս # հավելված։}one{Ցուցադրել ևս # հավելված։}other{Ցուցադրել ևս # հավելված։}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Ցույց տալ # համակարգչային հավելված։}one{Ցույց տալ # համակարգչային հավելված։}other{Ցույց տալ # համակարգչային հավելված։}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> և <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Հավելվածն ավելացվում է աշխատասեղանին"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Չեղարկել"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Ամպիկ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Լրացուցիչ ընտրացանկ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>՝ <xliff:g id="APP_NAME">%2$s</xliff:g> հավելվածից"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ու ևս <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ամպիկ"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Տեղափոխել ձախ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Տեղափոխել աջ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Փակել բոլորը"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>. ծավալել"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>. ծալել"</string>
</resources>
diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml
index 16aa8c4..b6e492d 100644
--- a/quickstep/res/values-in/strings.xml
+++ b/quickstep/res/values-in/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Sematkan"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Format bebas"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Tidak ada item yang baru dibuka"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Setelan penggunaan aplikasi"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Hapus semua"</string>
@@ -79,7 +80,7 @@
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Untuk beralih dari satu aplikasi ke aplikasi lain, geser ke atas dari bagian bawah layar, tahan, lalu lepaskan."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Untuk beralih antar-aplikasi, geser ke atas dengan 2 jari dari bawah layar, tahan, lalu lepaskan."</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Beralih aplikasi"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Geser ke atas dari bagian bawah layar, tahan, kemudian lepaskan"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Geser ke atas dari bagian bawah layar, tahan, kemudian lepas"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"Bagus."</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Semua siap"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"Selesai"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Simpan pasangan apl"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Ketuk aplikasi lain untuk memakai layar terpisah"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Pilih aplikasi lain untuk dibuka di layar terpisah"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Batal"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Batal"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Keluar dari pemilihan layar terpisah"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Pilih aplikasi lain untuk dibuka di layar terpisah"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Tindakan ini tidak diizinkan oleh aplikasi atau organisasi Anda"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Lakukan lebih banyak hal dengan Taskbar"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Selalu tampilkan Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Untuk selalu menampilkan Taskbar di bagian bawah layar Anda, sentuh & tahan pembatasnya"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Sentuh & tahan tombol tindakan untuk mencari konten di layar Anda"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Produk ini menggunakan bagian layar terpilih untuk menelusuri. <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Kebijakan Privasi<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> dan <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Persyaratan Layanan<xliff:g id="END_TOS_LINK"></a></xliff:g> Google berlaku."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tutup"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Selesai"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Layar utama"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Setelan Cepat"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar ditampilkan"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar & balon kiri ditampilkan"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar & bubbles kanan ditampilkan"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar disembunyikan"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar & balon disembunyikan"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Menu navigasi"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Selalu tampilkan Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Ubah mode navigasi"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Pindahkan ke atas/kiri"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Pindahkan ke bawah/kanan"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Tampilkan # aplikasi lainnya.}other{Tampilkan # aplikasi lainnya.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Tampilkan # aplikasi desktop.}other{Tampilkan # aplikasi desktop.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> dan <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Menambahkan aplikasi ke Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Batalkan"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Balon"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Tambahan"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> dari <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> dan <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> lainnya"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Pindahkan ke kiri"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Pindahkan ke kanan"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Tutup semua"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"luaskan <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"ciutkan <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml
index bed6542..ad388c0 100644
--- a/quickstep/res/values-is/strings.xml
+++ b/quickstep/res/values-is/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Festa"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Frjálst snið"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Tölva"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Tölva"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Engin nýleg atriði"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Notkunarstillingar forrits"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Hreinsa allt"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Vista forritapar"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Ýttu á annað forrit til að nota skjáskiptingu"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Veldu annað forrit til að nota skjáskiptingu"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Hætta við"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Hætta við"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Loka skjáskiptingu"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Veldu annað forrit til að nota skjáskiptingu"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Forritið eða fyrirtækið leyfir ekki þessa aðgerð"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Nýttu forritastikuna betur"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Halda forritastikunni sýnilegri"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Haltu skjáskiptingunni neðst á skjánum inni til að halda forritastikunni sýnilegri"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Haltu aðgerðalyklinum inni til að leita að því sem er á skjánum"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Þessi vara notar valinn hluta skjásins til að leita. <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Persónuverndarstefna<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> og <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>þjónustuskilmálar<xliff:g id="END_TOS_LINK"></a></xliff:g> Google gilda."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Loka"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Lokið"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Heim"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Flýtistillingar"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Verkstika"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Forritastika sýnd"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Verkstika og blöðrur sýndar til vinstri"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Verkstika og blöðrur sýndar til hægri"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Forritastika falin"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Verkstika og blöðrur eru faldar"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Yfirlitsstika"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Alltaf sýna forritastiku"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Breyta leiðsagnarstillingu"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Færa efst/til vinstri"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Færa neðst/til hægri"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Sýna # forrit í viðbót.}one{Sýna # forrit í viðbót.}other{Sýna # forrit í viðbót.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Sýna # skjáborðsforrit.}one{Sýna # skjáborðsforrit.}other{Sýna # skjáborðsforrit.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> og <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Forriti bætt við skjáborð"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Hætta við"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Blaðra"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Yfirflæði"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> frá <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> og <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> í viðbót"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Færa til vinstri"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Færa til hægri"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Hunsa allt"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"stækka <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"minnka <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml
index 663b334..9ddd4da 100644
--- a/quickstep/res/values-it/strings.xml
+++ b/quickstep/res/values-it/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Blocca su schermo"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Forma libera"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nessun elemento recente"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Impostazioni di utilizzo delle app"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Cancella tutto"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Salva coppia di app"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tocca un\'altra app per usare lo schermo diviso"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Scegli un\'altra app per usare lo schermo diviso"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Annulla"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Annulla"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Esci dalla selezione dello schermo diviso"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Scegli un\'altra app per usare lo schermo diviso"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Questa azione non è consentita dall\'app o dall\'organizzazione"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Fai di più con la barra delle app"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostra sempre la barra delle app"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Per mostrare sempre la barra delle app in basso, tocca e tieni premuto il divisore"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Tocca e tieni premuto il tasto azione per cercare gli elementi sullo schermo"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Il prodotto usa la parte selezionata dello schermo per cercare. Si applicano le <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Norme sulla privacy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> e i <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Termini di servizio<xliff:g id="END_TOS_LINK"></a></xliff:g> di Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Chiudi"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Fine"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Home"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Impostazioni rapide"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra delle applicazioni"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barra delle app visualizzata"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra app e bolle most. sinis."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra app e bolle most. destr."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barra delle app nascosta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra app e bolle nascoste"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra di navigazione"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Mostra sempre barra app"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Cambia modalità di navigazione"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Sposta in alto/a sinistra"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Sposta in basso/a destra"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostra # altra app.}other{Mostra altre # app.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostra # app desktop.}other{Mostra # app desktop.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> e <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Aggiunta app a desktop in corso…"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Annulla"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Fumetto"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Extra"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> da <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> e altri <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Sposta a sinistra"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Sposta a destra"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Ignora tutte"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"espandi <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"comprimi <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml
index 97e27e1..c5c7145 100644
--- a/quickstep/res/values-iw/strings.xml
+++ b/quickstep/res/values-iw/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"הצמדה"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"מצב חופשי"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"במחשב"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"מחשב"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"אין פריטים אחרונים"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"הגדרות שימוש באפליקציה"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ניקוי הכול"</string>
@@ -72,8 +73,8 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"מעולה!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"חשוב להחליק למעלה מהקצה התחתון של המסך"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"כדאי לנסות להחזיק את החלון זמן רב יותר לפני שחרור האצבע"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"חשוב להחליק ישר למעלה ואז להמתין"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"למדת איך להשתמש בתנועות. ניתן להשבית את התנועות ב\'הגדרות\'."</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"חשוב להחליק למעלה בקו ישר ואז לעצור"</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"למדת איך להשתמש בתנועות. אפשר להשבית את התנועות ב\'הגדרות\'."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"השלמת את תנועת המעבר בין האפליקציות"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"יש להחליק כדי לעבור בין אפליקציות"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"כדי לעבור בין אפלקציות, יש להחליק למעלה מתחתית המסך, להחזיק ולאחר מכן לשחרר."</string>
@@ -88,8 +89,8 @@
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"יפה!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"מדריך <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"הכול מוכן!"</string>
- <string name="allset_hint" msgid="459504134589971527">"כדי לחזור לדף הבית, מחליקים כלפי מעלה"</string>
- <string name="allset_button_hint" msgid="2395219947744706291">"כדי לעבור אל מסך הבית יש להקיש על הלחצן הראשי"</string>
+ <string name="allset_hint" msgid="459504134589971527">"כדי לחזור לדף הבית, צריך להחליק למעלה"</string>
+ <string name="allset_button_hint" msgid="2395219947744706291">"כדי לעבור אל מסך הבית צריך להקיש על הלחצן הראשי"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"הכול מוכן ואפשר להתחיל להשתמש ב<xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"מכשיר"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"הגדרות הניווט של המערכת"</annotation></string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"שמירת צמד אפליקציות"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"צריך להקיש על אפליקציה אחרת כדי להשתמש במסך מפוצל"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"כדי להשתמש במסך מפוצל צריך לבחור אפליקציה אחרת"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ביטול"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ביטול"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"יציאה מתצוגת מסך מפוצל"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"כדי להשתמש במסך מפוצל צריך לבחור אפליקציה אחרת"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"האפליקציה או הארגון שלך אינם מתירים את הפעולה הזאת"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"הגדרות מהירות"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"סרגל האפליקציות"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"סרגל האפליקציות מוצג"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"סרגל האפליקציות והבועות מוצגים משמאל"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"סרגל האפליקציות והבועות מוצגים מימין"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"סרגל האפליקציות מוסתר"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"סרגל האפליקציות והבועות הוסתרו"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"סרגל הניווט"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"סרגל האפליקציות מוצג תמיד"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"שינוי מצב הניווט"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"העברה לפינה השמאלית/העליונה"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"העברה לפינה הימנית/התחתונה"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{הצגת אפליקציה אחת (#) נוספת.}one{הצגת # אפליקציות נוספות.}two{הצגת # אפליקציות נוספות.}other{הצגת # אפליקציות נוספות.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{הצגת אפליקציה אחת (#) למחשב.}one{הצגת # אפליקציות למחשב.}two{הצגת # אפליקציות למחשב.}other{הצגת # אפליקציות למחשב.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ו-<xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"האפליקציה מתווספת לשולחן העבודה"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ביטול"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"בועה"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"אפשרויות נוספות"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> מתוך <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ועוד <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"הזזה שמאלה"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"הזזה ימינה"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ביטול של הכול"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"הרחבה של <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"כיווץ של <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ja/strings.xml b/quickstep/res/values-ja/strings.xml
index 084f2b2..b2732a6 100644
--- a/quickstep/res/values-ja/strings.xml
+++ b/quickstep/res/values-ja/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"固定"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"フリーフォーム"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"パソコン"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"デスクトップ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"パソコン"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"最近のアイテムはありません"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"アプリの使用状況の設定"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"すべてクリア"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"アプリのペア設定保存"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"分割画面を使用するには、他のアプリをタップします"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"分割画面を使用するには別のアプリを選択してください"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"キャンセル"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"キャンセル"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"分割画面の選択を終了します"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"分割画面にするには、別のアプリを選択してください"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"この操作はアプリまたは組織で許可されていません"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"クイック設定"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"タスクバー"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"タスクバー表示"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"タスクバーとバブルを表示"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"タスクバーとバブルを右側に表示"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"タスクバー非表示"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"タスクバーとバブルを非表示"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ナビゲーション バー"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"常にタスクバーを表示する"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ナビゲーション モードを変更"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{他 # 件のアプリを表示できます。}other{他 # 件のアプリを表示できます。}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# 個のデスクトップ アプリが表示されます。}other{# 個のデスクトップ アプリが表示されます。}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> と <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"アプリをデスクトップに追加する"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"キャンセル"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ふきだし"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"オーバーフロー"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>(<xliff:g id="APP_NAME">%2$s</xliff:g>)"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>、他 <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> 件"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"左に移動"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"右に移動"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"すべて解除"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>を開きます"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>を閉じます"</string>
</resources>
diff --git a/quickstep/res/values-ka/strings.xml b/quickstep/res/values-ka/strings.xml
index 47ff8a3..a23201d 100644
--- a/quickstep/res/values-ka/strings.xml
+++ b/quickstep/res/values-ka/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ჩამაგრება"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"თავისუფალი ფორმა"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"დესკტოპი"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"დესკტოპი"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ბოლოს გამოყენებული ერთეულები არ არის"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"აპების გამოყენების პარამეტრები"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ყველას გასუფთავება"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"აპთა წყვილის შენახვა"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"შეეხეთ სხვა აპს ეკრანის გასაყოფად"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"აირჩიეთ სხვა აპი ეკრანის გასაყოფად"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"გაუქმება"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"გაუქმება"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ეკრანის გაყოფის არჩევანიდან გასვლა"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"აირჩიეთ სხვა აპი ეკრანის გასაყოფად"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ეს მოქმედება არ არის დაშვებული აპის ან თქვენი ორგანიზაციის მიერ"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"გააკეთეთ მეტი ამოცანათა ზოლის მეშვეობით"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"ამოცანათა ზოლის მუდმივად ჩვენება"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"თქვენი ეკრანის ქვედა ნაწილში ამოცანათა ზოლის მუდმივად საჩვენებლად, ხანგრძლივად შეეხეთ გამყოფს"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"შეეხეთ და გეჭიროთ მოქმედების ღილაკი, რათა მოძებნოთ ის, რაც თქვენს ეკრანზეა"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"ეს პროდუქტი ძიებისთვის იყენებს თქვენი ეკრანის არჩეულ ნაწილს. მოქმედებს Google-ის <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>კონფიდენციალურობის დებულება<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> და <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>მომსახურებს პირობები<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"დახურვა"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"მზადაა"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"მთავარი"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"სწრაფი პარამეტრები"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ამოცანათა ზოლი"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ამოცანათა ზოლი ნაჩვენებია"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ამოცანათა ზოლი და ბუშტები ჩანს მარცხნივ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ამოცანათა ზოლი და ბუშტები ჩანს მარჯვნივ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ამოცანათა ზოლი დამალულია"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ამოცანათა ზოლი და ბუშტები დამალულია"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ნავიგაციის ზოლი"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ამოცანათა ზოლის მუდამ ჩვენება"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"შეცვალეთ ნავიგაციის რეჟიმი"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{#-ით მეტი აპის ჩენება}other{#-ით მეტი აპის ჩვენება.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# დესკტოპის აპის ჩვენება.}other{# დესკტოპის აპის ჩვენება.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> და <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"მიმდინარეობს აპის დესკტოპზე დამატება"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"გაუქმება"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ბუშტი"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"გადავსება"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>: <xliff:g id="APP_NAME">%2$s</xliff:g>-იდან"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> და <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> სხვა"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"მარცხნივ გადატანა"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"მარჯვნივ გადატანა"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ყველას დახურვა"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>-ის გაფართოება"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>-ის ჩაკეცვა"</string>
</resources>
diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml
index d610fc8..a7b3d6f 100644
--- a/quickstep/res/values-kk/strings.xml
+++ b/quickstep/res/values-kk/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Бекіту"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Еркін форма"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Компьютер"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Жұмыс үстелі"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Соңғы элементтер жоқ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Қолданбаны пайдалану параметрлері"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Барлығын өшіру"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Қолданбаларды жұптауды сақтау"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Экранды бөлу режимін пайдалану үшін басқа қолданбаны түртіңіз."</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Экранды бөлу үшін басқа қолданбаны таңдаңыз."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Бас тарту"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Бас тарту"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Экранды бөлу режимінен шығу"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Экранды бөлу үшін басқа қолданбаны таңдаңыз."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Бұл әрекетке қолданба не ұйым рұқсат етпейді."</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Тапсырмалар жолағында мүмкіндік көп"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Тапсырмалар жолағын әрдайым көрсету"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Экранның төменгі жағында тапсырмалар жолағы әрдайым көрсетілуі үшін, бөлгішті басып тұрыңыз."</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Экраннан іздеу үшін әрекет пернесін басып тұрыңыз"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Бұл өнім іздеу үшін экранның таңдалған бөлігін пайдаланады. Google <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Құпиялық саясаты<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> мен <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Қызмет көрсету шарттары<xliff:g id="END_TOS_LINK"></a></xliff:g> қолданылады."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Жабу"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Дайын"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Негізгі экран"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Жылдам параметрлер"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Тапсырмалар жолағы"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Тапсырмалар жолағы көрсетілді"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Тапсырмалар жолағы мен қалқыма терезелер сол жақта көрсетілген"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Тапсырмалар жолағы мен қалқыма терезелер оң жақта көрсетілген"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Тапсырмалар жолағы жасырылды"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Тапсырмалар жолағы мен қалқыма терезелер жасырылған"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Навигация жолағы"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Тапсырма жолағын үнемі көрсету"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Навигация режимін өзгерту"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Жоғары/солға жылжыту"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Төмен/оңға жылжыту"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Тағы # қолданбаны көрсету.}other{Тағы # қолданбаны көрсету.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Компьютерге арналған # қолданбаны көрсету}other{Компьютерге арналған # қолданбаны көрсету}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> және <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Жұмыс үстеліне қолданба қосу"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Бас тарту"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Қалқыма терезе"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Қосымша мәзір"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> ұсынатын <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> және тағы <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Солға жылжыту"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Оңға жылжыту"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Барлығын жабу"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>: жаю"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>: жию"</string>
</resources>
diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml
index 98a97e7..f83b09b 100644
--- a/quickstep/res/values-km/strings.xml
+++ b/quickstep/res/values-km/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"ខ្ទាស់"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"មុខងារទម្រង់សេរី"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"កុំព្យូទ័រ"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"ដែសថប"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"អេក្រង់ដើម"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"មិនមានធាតុថ្មីៗទេ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ការកំណត់ការប្រើប្រាស់កម្មវិធី"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"សម្អាតទាំងអស់"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"រក្សាទុកគូកម្មវិធី"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"ចុចកម្មវិធីផ្សេងទៀត ដើម្បីប្រើមុខងារបំបែកអេក្រង់"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"ជ្រើសរើសកម្មវិធីផ្សេងទៀត ដើម្បីប្រើមុខងារបំបែកអេក្រង់"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"បោះបង់"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"បោះបង់"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ចាកចេញពីការជ្រើសរើសរបស់មុខងារបំបែកអេក្រង់"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"ជ្រើសរើសកម្មវិធីផ្សេងទៀត ដើម្បីប្រើមុខងារបំបែកអេក្រង់"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"សកម្មភាពនេះមិនត្រូវបានអនុញ្ញាតដោយកម្មវិធី ឬស្ថាប័នរបស់អ្នកទេ"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ការកំណត់រហ័ស"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"របារកិច្ចការ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"បានបង្ហាញរបារកិច្ចការ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"បានបង្ហាញរបារកិច្ចការ និងផ្ទាំងអណ្ដែតនៅខាងឆ្វេង"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"បានបង្ហាញរបារកិច្ចការ និងផ្ទាំងអណ្ដែតនៅខាងស្ដាំ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"បានលាក់របារកិច្ចការ"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"បានលាក់របារកិច្ចការ និងផ្ទាំងអណ្ដែត"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"របាររុករក"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"បង្ហាញរបារកិច្ចការជានិច្ច"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ប្ដូរមុខងាររុករក"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{បង្ហាញកម្មវិធី # ទៀត។}other{បង្ហាញកម្មវិធី # ទៀត។}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{បង្ហាញកម្មវិធីកុំព្យូទ័រ #។}other{បង្ហាញកម្មវិធីកុំព្យូទ័រ #។}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> និង <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"កំពុងបញ្ចូលកម្មវិធីទៅកុំព្យូទ័រ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"បោះបង់"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ផ្ទាំងសារ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ម៉ឺនុយបន្ថែម"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ពី <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> និង <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> នាក់ទៀត"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ផ្លាស់ទីទៅឆ្វេង"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ផ្លាស់ទីទៅស្ដាំ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ច្រានចោលទាំងអស់"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"ពង្រីក <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"បង្រួម <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml
index 7b1241f..48093b3 100644
--- a/quickstep/res/values-kn/strings.xml
+++ b/quickstep/res/values-kn/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ಪಿನ್ ಮಾಡಿ"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ಮುಕ್ತಸ್ವರೂಪ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ಡೆಸ್ಕ್ಟಾಪ್"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ಡೆಸ್ಕ್ಟಾಪ್"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ಯಾವುದೇ ಇತ್ತೀಚಿನ ಐಟಂಗಳಿಲ್ಲ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ಆ್ಯಪ್ ಬಳಕೆಯ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ಎಲ್ಲವನ್ನೂ ತೆರವುಗೊಳಿಸಿ"</string>
@@ -73,13 +74,13 @@
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"ಸ್ಕ್ರೀನ್ನ ಕೆಳಗಿನ ಅಂಚಿನಿಂದ ನೀವು ಸ್ವೈಪ್ ಮಾಡುತ್ತಿದ್ದೀರಿ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"ಬೆರಳನ್ನು ಮೇಲೆತ್ತುವ ಮೊದಲು ವಿಂಡೋವನ್ನು ಹೆಚ್ಚು ಸಮಯ ಹಿಡಿದಿಡಲು ಪ್ರಯತ್ನಿಸಿ"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"ನೀವು ನೇರವಾಗಿ ಸ್ವೈಪ್ ಮಾಡಿದ್ದೀರಿ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ, ನಂತರ ವಿರಾಮಗೊಳಿಸಿ"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"ಗೆಶ್ಚರ್ಗಳನ್ನು ಬಳಸುವುದು ಹೇಗೆಂದು ನೀವು ತಿಳಿದುಕೊಂಡಿರುವಿರಿ. ಗೆಶ್ಚರ್ಗಳನ್ನು ಆಫ್ ಮಾಡಲು, ಸೆಟ್ಟಿಂಗ್ಗಳಿಗೆ ಹೋಗಿ."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"ಜೆಶ್ಚರ್ಗಳನ್ನು ಬಳಸುವುದು ಹೇಗೆಂದು ನೀವು ತಿಳಿದುಕೊಂಡಿರುವಿರಿ. ಜೆಶ್ಚರ್ಗಳನ್ನು ಆಫ್ ಮಾಡಲು, ಸೆಟ್ಟಿಂಗ್ಗಳಿಗೆ ಹೋಗಿ."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"ನೀವು ಆ್ಯಪ್ಗಳನ್ನು ಬದಲಾಯಿಸುವ ಗೆಸ್ಚರ್ ಅನ್ನು ಪೂರ್ಣಗೊಳಿಸಿದ್ದೀರಿ"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"ಆ್ಯಪ್ಗಳನ್ನು ಬದಲಾಯಿಸಲು ಸ್ವೈಪ್ ಮಾಡಿ"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"ಆ್ಯಪ್ಗಳ ನಡುವೆ ಬದಲಿಸಲು, ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನ ಕೆಳಭಾಗದಿಂದ ಮೇಲಕ್ಕೆ ಸ್ವೈಪ್ ಮಾಡಿ, ಹಿಡಿದಿಟ್ಟುಕೊಳ್ಳಿ, ನಂತರ ಬಿಟ್ಟುಬಿಡಿ."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"ಆ್ಯಪ್ಗಳ ನಡುವೆ ಬದಲಿಸಲು, 2 ಬೆರಳುಗಳಿಂದ ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನ ಕೆಳಭಾಗದಿಂದ ಮೇಲಕ್ಕೆ ಸ್ವೈಪ್ ಮಾಡಿ, ಹಿಡಿದಿಟ್ಟುಕೊಳ್ಳಿ, ನಂತರ ಬಿಟ್ಟುಬಿಡಿ."</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"ಆ್ಯಪ್ಗಳನ್ನು ಬದಲಿಸಿ"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನ ಕೆಳಭಾಗದಿಂದ ಮೇಲಕ್ಕೆ ಸ್ವೈಪ್ ಮಾಡಿ, ಹೋಲ್ಡ್ ಮಾಡಿ, ನಂತರ ಬಿಡುಗಡೆ ಮಾಡಿ"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನ ಕೆಳಭಾಗದಿಂದ ಮೇಲಕ್ಕೆ ಸ್ವೈಪ್ ಮಾಡಿ, ಹೋಲ್ಡ್ ಮಾಡಿ, ನಂತರ ಬಿಟ್ಟುಬಿಡಿ"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"ಭೇಷ್!"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"ಸಂಪೂರ್ಣ ಸಿದ್ಧವಾಗಿದೆ"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"ಮುಗಿದಿದೆ"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ಆ್ಯಪ್ ಪೇರ್ ಸೇವ್ ಮಾಡಿ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್ ಬಳಸಲು ಬೇರೆ ಆ್ಯಪ್ ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್ ಬಳಸಲು ಇನ್ನೊಂದು ಆ್ಯಪ್ ಆಯ್ಕೆಮಾಡಿ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ರದ್ದುಮಾಡಿ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ರದ್ದುಮಾಡಿ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್ ಆಯ್ಕೆಯಿಂದ ನಿರ್ಗಮಿಸಿ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"\"ಪರದೆ ಬೇರ್ಪಡಿಸಿ\" ಬಳಸಲು ಬೇರೆ ಆ್ಯಪ್ ಅನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ಆ್ಯಪ್ ಅಥವಾ ನಿಮ್ಮ ಸಂಸ್ಥೆಯು ಈ ಕ್ರಿಯೆಯನ್ನು ಅನುಮತಿಸುವುದಿಲ್ಲ"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ತ್ವರಿತ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ಟಾಸ್ಕ್ಬಾರ್"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ಟಾಸ್ಕ್ಬಾರ್ ತೋರಿಸಲಾಗಿದೆ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ಟಾಸ್ಕ್ಬಾರ್ & ಬಬಲ್ಸ್ ತೋರಿಸಲಾಗಿದೆ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ಟಾಸ್ಕ್ಬಾರ್ & ಬಬಲ್ಸ್ ಬಲಭಾಗದಲ್ಲಿ ತೋರಿಸಲಾಗಿದೆ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ಟಾಸ್ಕ್ಬಾರ್ ಮರೆಮಾಡಲಾಗಿದೆ"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ಟಾಸ್ಕ್ಬಾರ್ & ಬಬಲ್ಸ್ ಮರೆಮಾಡಲಾಗಿದೆ"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ನ್ಯಾವಿಗೇಷನ್ ಬಾರ್"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ಯಾವಾಗಲೂ ಟಾಸ್ಕ್ಬಾರ್ ತೋರಿಸಿ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ನ್ಯಾವಿಗೇಶನ್ ಮೋಡ್ ಬದಲಾಯಿಸಿ"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{ಇನ್ನೂ # ಆ್ಯಪ್ ಅನ್ನು ತೋರಿಸಿ.}one{ಇನ್ನೂ # ಆ್ಯಪ್ಗಳನ್ನು ತೋರಿಸಿ.}other{ಇನ್ನೂ # ಆ್ಯಪ್ಗಳನ್ನು ತೋರಿಸಿ.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ಡೆಸ್ಕ್ಟಾಪ್ ಆ್ಯಪ್ ತೋರಿಸಿ.}one{# ಡೆಸ್ಕ್ಟಾಪ್ ಆ್ಯಪ್ಗಳನ್ನು ತೋರಿಸಿ.}other{# ಡೆಸ್ಕ್ಟಾಪ್ ಆ್ಯಪ್ಗಳನ್ನು ತೋರಿಸಿ.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ಮತ್ತು <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ಡೆಸ್ಕ್ಟಾಪ್ಗೆ ಆ್ಯಪ್ ಅನ್ನು ಸೇರಿಸಲಾಗುತ್ತಿದೆ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ರದ್ದುಮಾಡಿ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ಬಬಲ್"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ಓವರ್ಫ್ಲೋ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> ನಿಂದ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ಮತ್ತು ಇನ್ನೂ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ಎಡಕ್ಕೆ ಸರಿಸಿ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ಬಲಕ್ಕೆ ಸರಿಸಿ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ಎಲ್ಲವನ್ನು ವಜಾಗೊಳಿಸಿ"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ಅನ್ನು ವಿಸ್ತೃತಗೊಳಿಸಿ"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ಅನ್ನು ಕುಗ್ಗಿಸಿ"</string>
</resources>
diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml
index 91b9924..1aca7a2 100644
--- a/quickstep/res/values-ko/strings.xml
+++ b/quickstep/res/values-ko/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"고정"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"자유 형식"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"데스크톱"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"데스크톱"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"최근 항목이 없습니다."</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"앱 사용 설정"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"모두 삭제"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"설정 완료"</string>
<string name="allset_hint" msgid="459504134589971527">"위로 스와이프하여 홈으로 이동"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"홈 화면으로 이동하려면 홈 버튼을 탭하세요."</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g>을(를) 사용할 준비가 되었습니다."</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> 사용 준비가 완료되었습니다."</string>
<string name="default_device_name" msgid="6660656727127422487">"기기"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"시스템 탐색 설정"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"공유"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"앱 페어링 저장"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"다른 앱을 탭하여 화면 분할 사용"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"화면 분할을 사용하려면 다른 앱을 선택하세요."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"취소"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"취소"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"화면 분할 선택 종료"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"화면 분할을 사용하려면 다른 앱을 선택하세요."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"이 작업은 앱 또는 조직에서 허용되지 않습니다."</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"태스크 바 최대한 활용하기"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"태스크 바 항상 표시"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"화면 하단에 태스크 바를 항상 표시하려면 구분선을 길게 터치하세요."</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"화면 내용을 검색하려면 작업 키 길게 터치"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"이 제품은 사용자가 화면에서 선택한 부분을 사용하여 검색하며, Google <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>개인정보처리방침<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> 및 <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>서비스 약관<xliff:g id="END_TOS_LINK"></a></xliff:g>이 적용됩니다."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"닫기"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"완료"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"홈"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"빠른 설정"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"태스크 바"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"태스크 바 표시"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"태스크 바와 대화창을 왼쪽에 표시"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"태스크 바와 대화창을 오른쪽에 표시"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"태스크 바 숨김"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"태스크 바 및 대화창 숨김"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"탐색 메뉴"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"태스크 바 항상 표시"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"탐색 모드 변경"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"상단/왼쪽으로 이동"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"하단/오른쪽으로 이동"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{앱 #개 더 표시}other{앱 #개 더 표시}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{데스크톱 앱 #개를 표시합니다.}other{데스크톱 앱 #개를 표시합니다.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> 및 <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"데스크톱에 앱 추가하기"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"취소"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"풍선"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"더보기"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g>의 <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> 외 <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>개"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"왼쪽으로 이동"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"오른쪽으로 이동"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"모두 닫기"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> 펼치기"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> 접기"</string>
</resources>
diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml
index df82b1a..e440b40 100644
--- a/quickstep/res/values-ky/strings.xml
+++ b/quickstep/res/values-ky/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Кадап коюу"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Эркин форма режими"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Компьютер"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Компьютер"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Акыркы колдонмолор жок"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Колдонмону пайдалануу параметрлери"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Баарын тазалоо"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"Бүттү!"</string>
<string name="allset_hint" msgid="459504134589971527">"Башкы бетке өтүү үчүн экранды өйдө сүрүңүз"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Башкы экранга өтүү үчүн башкы бет баскычын таптап коюңуз"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> түзмөгүн колдоно берсеңиз болот"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> колдоно берсеңиз болот"</string>
<string name="default_device_name" msgid="6660656727127422487">"түзмөк"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Өтүү аракетинин системалык параметрлери"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Бөлүшүү"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Колдонмолорду сактап коюу"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Экранды бөлүү үчүн башка колдонмону таптап коюңуз"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Экранды бөлүү үчүн башка колдонмону тандаңыз"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Жокко чыгаруу"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Жокко чыгаруу"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Тандалган экранды бөлүүдөн чыгуу"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Экранды бөлүү үчүн башка колдонмону тандаңыз"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Бул аракетти аткарууга колдонмо же ишканаңыз тыюу салган"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Тапшырмалар тактасы менен көбүрөөк иш бүтүрөсүз"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Тапшырмалар панелин ар дайым көрсөтүү"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Тапшырмалар панелин экрандын ылдый жагында ар дайым көрсөтүү үчүн бөлгүчтү коё бербей басыңыз"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Экрандагы нерсени издөө үчүн аракет баскычын коё бербей кармап туруңуз"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Бул кызмат издөө үчүн экранда тандалган бөлүктү колдонот. Google\'дун <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Купуялык эрежелери<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> жана <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Тейлөө шарттары<xliff:g id="END_TOS_LINK"></a></xliff:g> колдонулат."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Жабуу"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Бүттү"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Башкы бет"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Ыкчам параметрлер"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Тапшырмалар тактасы"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Тапшырмалар панели көрсөтүлдү"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Тапшырмалар панели, калкыма билдирмелер сол жакта көрсөтүлдү"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Тапшырмалар панели, калкыма билдирмелер оң жакта көрсөтүлгөн"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Тапшырмалар панели жашырылды"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Тапшырмалар панели жана калкып чыкма билдирмелер жашырылган"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Чабыттоо тилкеси"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Такта ар дайым көрүнсүн"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Өтүү режимин өзгөртүү"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Жогорку/сол бурчка жылдыруу"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Төмөнкү/оң бурчка жылдыруу"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Дагы # колдонмону көрсөтүү.}other{Дагы # колдонмону көрсөтүү.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# иш такта колдонмосун көрсөтүү.}other{# иш такта колдонмосун көрсөтүү.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> жана <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Колдонмону иш тактага кошуу"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Жокко чыгаруу"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Көбүкчө"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Кошумча меню"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> колдонмосунан <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> жана дагы <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Солго жылдыруу"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Оңго жылдыруу"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Баарын четке кагуу"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> жайып көрсөтүү"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> жыйыштыруу"</string>
</resources>
diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml
index 2d5a5cc..a2ba90c 100644
--- a/quickstep/res/values-lo/strings.xml
+++ b/quickstep/res/values-lo/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ປັກໝຸດ"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ຮູບແບບອິດສະຫລະ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ເດັສທັອບ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ເດັສທັອບ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ບໍ່ມີລາຍການຫຼ້າສຸດ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ການຕັ້ງຄ່າການນຳໃຊ້ແອັບ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ລຶບລ້າງທັງໝົດ"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ບັນທຶກຈັບຄູ່ແອັບ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"ແຕະແອັບອື່ນເພື່ອໃຊ້ໜ້າຈໍແຍກ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"ເລືອກແອັບອື່ນເພື່ອໃຊ້ການແບ່ງໜ້າຈໍ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ຍົກເລີກ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ຍົກເລີກ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ອອກຈາກາກນເລືອກການແບ່ງໜ້າຈໍ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"ເລືອກແອັບອື່ນເພື່ອໃຊ້ການແບ່ງໜ້າຈໍ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ແອັບ ຫຼື ອົງການຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ໃຊ້ຄຳສັ່ງນີ້"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ການຕັ້ງຄ່າດ່ວນ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ແຖບໜ້າວຽກ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ແຖບໜ້າວຽກທີ່ສະແດງຢູ່"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ແຖບໜ້າວຽກ ແລະ ຟອງສະແດງຢູ່ເບື້ອງຊ້າຍ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ແຖບໜ້າວຽກ ແລະ ຟອງສະແດງຢູ່ເບື້ອງຂວາ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ແຖບໜ້າວຽກທີ່ເຊື່ອງໄວ້ຢູ່"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ແຖບໜ້າວຽກ ແລະ ຟອງຖືກເຊື່ອງໄວ້"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ແຖບການນຳທາງ"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ສະແດງແຖບໜ້າວຽກສະເໝີ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ປ່ຽນໂໝດການນຳທາງ"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{ສະແດງອີກ # ແອັບ.}other{ສະແດງອີກ # ແອັບ.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{ສະແດງແອັບເດັສທັອບ # ລາຍການ.}other{ສະແດງແອັບເດັສທັອບ # ລາຍການ.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ແລະ <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ການເພີ່ມແອັບໄປໃສ່ເດັສທັອບ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ຍົກເລີກ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ຟອງ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ລາຍການເພີ່ມເຕີມ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ຈາກ <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ແລະ ອີກ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ລາຍການ"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ຍ້າຍໄປຊ້າຍ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ຍ້າຍໄປຂວາ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ປິດທັງໝົດ"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"ຂະຫຍາຍ <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"ຫຍໍ້ <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ລົງ"</string>
</resources>
diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml
index 232e7e7..a70f1bd 100644
--- a/quickstep/res/values-lt/strings.xml
+++ b/quickstep/res/values-lt/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Prisegti"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Laisva forma"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Stalinis kompiuteris"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Stalinis kompiuteris"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nėra jokių naujausių elementų"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Programos naudojimo nustatymai"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Išvalyti viską"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Išsaug. progr. porą"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Išskaidyto ekrano režimas palietus kitą programą"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Išskaidyto ekrano režimą naudokite kita programa"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Atšaukti"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Atšaukti"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Išeiti iš išskaidyto ekrano pasirinkimo"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Išskaidyto ekrano režimą naudokite kita programa"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Jūsų organizacijoje arba naudojant šią programą neleidžiama atlikti šio veiksmo"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Spartieji nustatymai"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Užduočių juosta"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Užduočių juosta rodoma"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Užduočių juosta ir burbulai rodomi kairėje"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Užduočių juosta ir burbulai rodomi dešinėje"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Užduočių juosta paslėpta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Užduočių juosta ir burbulai paslėpti"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Naršymo juosta"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Visada rodyti užduočių juostą"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Keisti naršymo režimą"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Rodyti dar # programą.}one{Rodyti dar # programą.}few{Rodyti dar # programas.}many{Rodyti dar # programos.}other{Rodyti dar # programų.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Rodyti # darbalaukio programą.}one{Rodyti # darbalaukio programą.}few{Rodyti # darbalaukio programas.}many{Rodyti # darbalaukio programos.}other{Rodyti # darbalaukio programų.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"„<xliff:g id="APP_NAME_1">%1$s</xliff:g>“ ir „<xliff:g id="APP_NAME_2">%2$s</xliff:g>“"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Pridedama programa prie darbalaukio"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Atšaukti"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbulas"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Perpildymas"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"„<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>“ iš „<xliff:g id="APP_NAME">%2$s</xliff:g>“"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"„<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>“ ir dar <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Perkelti kairėn"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Perkelti dešinėn"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Atsisakyti visų"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"išskleisti „<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>“"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"sutraukti „<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>“"</string>
</resources>
diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml
index d855f6f..b3d9c01 100644
--- a/quickstep/res/values-lv/strings.xml
+++ b/quickstep/res/values-lv/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Piespraust"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Brīva forma"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Dators"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Darbvirsma"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nav nesenu vienumu."</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Lietotņu izmantošanas iestatījumi"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Notīrīt visu"</string>
@@ -67,7 +68,7 @@
<string name="home_gesture_intro_title" msgid="836590312858441830">"Vilkšana, lai pārietu uz sākumu"</string>
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Velciet augšup no ekrāna apakšdaļas. Ar šo žestu vienmēr varat atvērt sākuma ekrānu."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Ar 2 pirkstiem velciet augšup no ekrāna apakšdaļas. Ar šo žestu vienmēr varat atvērt sākuma ekrānu."</string>
- <string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Došanās uz sākuma ekrānu"</string>
+ <string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Doties uz sākuma ekrānu"</string>
<string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Velciet augšup no ekrāna apakšdaļas."</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Lieliski!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Jāvelk augšup no ekrāna apakšmalas."</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Saglabāt pāri"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Lai sadalītu ekrānu, pieskarieties citai lietotnei"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Izvēlieties citu lietotni, lai sadalītu ekrānu"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Atcelt"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Atcelt"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Izejiet no ekrāna sadalīšanas režīma atlases."</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Izvēlieties citu lietotni, lai sadalītu ekrānu"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Lietotne vai jūsu organizācija neatļauj veikt šo darbību."</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Plašākas iespējas, izmantojot uzdevumu joslu"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Vienmēr rādīt uzdevumu joslu"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Lai uzdevumu joslu rādītu apakšdaļā, pieskarieties atdalītājam un turiet"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Pieskarieties darbību taustiņam un turiet to, lai meklētu ekrānā redzamo saturu"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Šajā produktā atlasītā ekrāna daļa tiek izmantota meklēšanai. Ir spēkā Google <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>konfidencialitātes politika<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> un <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>pakalpojumu sniegšanas noteikumi<xliff:g id="END_TOS_LINK"></a></xliff:g>."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Aizvērt"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gatavs"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Sākums"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Ātrie iestatīj."</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Uzdevumu josla"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Uzdevumu josla tiek rādīta"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Uzdevumu josla/burbuļi pa kreisi"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Uzdevumu josla/burbuļi pa labi"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Uzdevumu josla paslēpta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Uzdevumu josla/burbuļi paslēpti"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigācijas josla"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Vienmēr rādīt uzdevumu joslu"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Mainīt navigācijas režīmu"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Pārvietot uz augšējo/kreiso stūri"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Pārvietot uz apakšējo/labo stūri"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Rādīt vēl # lietotni}zero{Rādīt vēl # lietotnes}one{Rādīt vēl # lietotni}other{Rādīt vēl # lietotnes}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Rādīt # datora lietotni.}zero{Rādīt # datora lietotnes.}one{Rādīt # datora lietotni.}other{Rādīt # datora lietotnes.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"“<xliff:g id="APP_NAME_1">%1$s</xliff:g>” un “<xliff:g id="APP_NAME_2">%2$s</xliff:g>”"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Notiek lietotnes pievienošana datoram"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Atcelt"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Burbulis"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Pārpilde"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> no lietotnes <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> un vēl <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Pārvietot pa kreisi"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Pārvietot pa labi"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Nerādīt nevienu"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"izvērst “<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>”"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"sakļaut “<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>”"</string>
</resources>
diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml
index 495aaaa..2cd67c2 100644
--- a/quickstep/res/values-mk/strings.xml
+++ b/quickstep/res/values-mk/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Закачи"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Компјутер"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Работна површина"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"За компјутер"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Нема неодамнешни ставки"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Поставки за користење на апликациите"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Избриши ги сите"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Зачувај го паров"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Допрете друга аплик. за да користите поделен екран"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Изберете друга апликација за да користите поделен екран"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Откажи"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Откажи"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Излези од изборот на поделен екран"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Изберете друга апликација за да користите поделен екран"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Апликацијата или вашата организација не го дозволува дејствово"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Правете сешто со „Лентата со задачи“"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Како секогаш да се прикажува „Лентата со задачи“"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Допрете и задржете го разделникот за да може „Лентата со задачи“ секогаш да се прикажува на дното на екранот"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Допрете и задржете го копчето за дејство за да пребарувате на екранот"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Производов го користи избраниот дел од екранот за пребарување. Важат <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Политиката за приватност<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> и <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Условите за користење<xliff:g id="END_TOS_LINK"></a></xliff:g> на Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Затвори"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Дома"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Брзи поставки"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Лента со задачи"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Лентата со задачи е прикажана"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Лен. со зад. и бал. се лево"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Лен. со зад. и бал. се десно"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Лентата со задачи е скриена"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Лен. со зад. и бал. се скриени"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Лента за навигација"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Секогаш прикажувај „Лента“"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Променете режим на навигација"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Премести горе лево"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Премести долу десно"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Прикажи уште # апликација.}one{Прикажи уште # апликација.}other{Прикажи уште # апликации.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Прикажи # апликација за компјутер.}one{Прикажи # апликација за компјутер.}other{Прикажи # апликации за компјутер.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> и <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Додавање на апликацијата во „Работна површина“"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Откажи"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Балонче"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Проширено балонче"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> од <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> и уште <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Премести налево"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Премести надесно"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Отфрли ги сите"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"прошири <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"собери <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml
index 8194897..74271a6 100644
--- a/quickstep/res/values-ml/strings.xml
+++ b/quickstep/res/values-ml/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"പിൻ ചെയ്യുക"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ഫ്രീഫോം"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ഡെസ്ക്ടോപ്പ്"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ഡെസ്ക്ടോപ്പ്"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"സമീപകാല ഇനങ്ങൾ ഒന്നുമില്ല"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ആപ്പ് ഉപയോഗ ക്രമീകരണം"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"എല്ലാം മായ്ക്കുക"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ആപ്പ് ജോടി സംരക്ഷിക്കൂ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"സ്പ്ലിറ്റ് സ്ക്രീനിന് മറ്റൊരു ആപ്പിൽ ടാപ്പ് ചെയ്യൂ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"സ്ക്രീൻ വിഭജന മോഡ് ഉപയോഗിക്കാൻ മറ്റൊരു ആപ്പ് തിരഞ്ഞെടുക്കൂ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"റദ്ദാക്കുക"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"റദ്ദാക്കുക"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"സ്ക്രീൻ വിഭജന തിരഞ്ഞെടുപ്പിൽ നിന്ന് പുറത്തുകടക്കുക"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"സ്ക്രീൻ വിഭജന മോഡിന് മറ്റൊരു ആപ്പ് തിരഞ്ഞെടുക്കൂ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ഈ നടപടി എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ദ്രുത ക്രമീകരണം"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ടാസ്ക്ബാർ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ടാസ്ക്ബാർ കാണിച്ചിരിക്കുന്നു"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ടാസ്ക്ബാറും ബബിളും ഇടതുവശത്ത്"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ടാസ്ക്ബാറും ബബിളും വലതുവശത്ത്"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ടാസ്ക്ബാർ മറച്ചിരിക്കുന്നു"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ടാസ്ക്ബാറും ബബിളും മറച്ചു"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"നാവിഗേഷൻ ബാർ"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ടാസ്ക്ബാർ എപ്പോഴും കാണിക്കൂ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"നാവിഗേഷൻ മോഡ് മാറ്റുക"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# ആപ്പ് കൂടി കാണിക്കുക.}other{# ആപ്പുകൾ കൂടി കാണിക്കുക.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ഡെസ്ക്ടോപ്പ് ആപ്പ് കാണിക്കുക.}other{# ഡെസ്ക്ടോപ്പ് ആപ്പുകൾ കാണിക്കുക.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g>, <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ആപ്പ് ഡെസ്ക്ടോപ്പിലേക്ക് ചേർക്കുന്നു"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"റദ്ദാക്കുക"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ബബിൾ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ഓവർഫ്ലോ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> എന്നതിൽ നിന്നുള്ള <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> എന്നതും മറ്റ് <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> എണ്ണവും"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ഇടത്തേക്ക് നീക്കുക"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"വലത്തേക്ക് നീക്കുക"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"എല്ലാം ഡിസ്മിസ് ചെയ്യുക"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> വികസിപ്പിക്കുക"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ചുരുക്കുക"</string>
</resources>
diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml
index 79acca3..fd71823 100644
--- a/quickstep/res/values-mn/strings.xml
+++ b/quickstep/res/values-mn/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Бэхлэх"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Чөлөөтэй хувьсах"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Компьютер"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Дэлгэц"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Сүүлийн үеийн зүйл алга"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Апп ашиглалтын тохиргоо"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Бүгдийг арилгах"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Апп хослуулалт хадгал"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Дэлгэцийг хуваахыг ашиглахын тулд өөр аппыг товш"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Дэлгэц хуваахыг ашиглахын тулд өөр апп сонгоно уу"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Цуцлах"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Цуцлах"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Дэлгэцийг хуваах сонголтоос гарах"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Дэлгэцийг хуваах горим ашиглах өөр апп сонгоно уу"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Энэ үйлдлийг апп эсвэл танай байгууллага зөвшөөрдөггүй"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Ажлын хэсгийн тусламжтай илүү ихийг хийгээрэй"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Ажлын хэсгийг үргэлж харуулах"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Дэлгэцийнхээ доод талд Ажлын хэсгийг үргэлж харуулахын тулд хуваагч дээр хүрээд удаан дарна уу"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Дэлгэц дээрээ байгаа зүйлийг хайхын тулд тусгай товчлуурыг удаан дарна уу"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Энэ бүтээгдэхүүн хайхын тулд таны дэлгэцийн сонгосон хэсгийг ашигладаг. Google-н <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>нууцлалын бодлого<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> болон <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>үйлчилгээний нөхцөл<xliff:g id="END_TOS_LINK"></a></xliff:g> хэрэгжинэ."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Хаах"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Дууссан"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Гэр"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Шуурхай тохиргоо"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Ажлын хэсэг"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Ажлын хэсгийг харуулсан"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Ажлын хэсэг, бөмбөлгийг зүүн талд харуулсан"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Ажлын хэсэг, бөмбөлгийг баруун талд харуулсан"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Ажлын хэсгийг нуусан"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Ажлын хэсэг, бөмбөлгийг нуусан"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Навигацын самбар"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Ажлын хэсгийг үргэлж харуулах"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Навигацын горимыг өөрчлөх"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Зүүн дээд хэсэг рүү зөөх"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Баруун доод хэсэг рүү зөөх"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Өөр # аппыг харуулна уу.}other{Өөр # аппыг харуулна уу.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Компьютерын # аппыг харуулна уу.}other{Компьютерын # аппыг харуулна уу.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> болон <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Компьютерт апп нэмж байна"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Цуцлах"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Бөмбөлөг"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Илүү хэсэг"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g>-с ирсэн <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> болон бусад <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Зүүн тийш зөөх"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Баруун тийш зөөх"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Бүгдийг үл хэрэгсэх"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>-г дэлгэх"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>-г хураах"</string>
</resources>
diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml
index 453de89..685b38d 100644
--- a/quickstep/res/values-mr/strings.xml
+++ b/quickstep/res/values-mr/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"पिन करा"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"फ्रीफॉर्म"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"डेस्कटॉप"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"डेस्कटॉप"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"कोणतेही अलीकडील आयटम नाहीत"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"अॅप वापर सेटिंग्ज"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"सर्व साफ करा"</string>
@@ -95,11 +96,11 @@
<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>
- <string name="action_split" msgid="2098009717623550676">"स्प्लिट"</string>
+ <string name="action_split" msgid="2098009717623550676">"स्प्लिट करा"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"ॲपची जोडी सेव्ह करा"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"स्प्लिट स्क्रीन वापरण्यासाठी दुसऱ्या ॲपवर टॅप करा"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"स्प्लिट स्क्रीन वापरण्यासाठी दुसरे ॲप निवडा"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"रद्द करा"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"रद्द करा"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"स्प्लिट स्क्रीन निवडीतून बाहेर पडा"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"स्प्लिट स्क्रीन वापरण्यासाठी दुसरे ॲप निवडा"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"अॅप किंवा तुमच्या संस्थेद्वारे ही क्रिया करण्याची अनुमती नाही"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"क्विक सेटिंग्ज"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"टास्कबार"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"टास्कबार दाखवलेला आहे"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"टास्कबार आणि डावे बबल दाखवले"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"टास्कबार आणि उजवे बबल लपवले"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"टास्कबार लपवलेले आहे"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"टास्कबार आणि बबल लपवले आहेत"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"नेव्हिगेशन बार"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"नेहमी टास्कबार दाखवा"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"नेव्हिगेशन मोड बदला"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{आणखी # अॅप दाखवा.}other{आणखी # अॅप्स दाखवा.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# डेस्कटॉप अॅप दाखवा.}other{# डेस्कटॉप अॅप्स दाखवा.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> आणि <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"डेस्कटॉपवर ॲप जोडत आहे"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"रद्द करा"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"बबल"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ओव्हरफ्लो"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> वरील <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> आणि आणखी <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"डावीकडे हलवा"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"उजवीकडे हलवा"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"सर्व डिसमिस करा"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> चा विस्तार करा"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> कोलॅप्स करा"</string>
</resources>
diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml
index e4a6351..cb72b82 100644
--- a/quickstep/res/values-ms/strings.xml
+++ b/quickstep/res/values-ms/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Semat"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Bentuk bebas"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Tiada item terbaharu"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Tetapan penggunaan apl"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Kosongkan semua"</string>
@@ -68,18 +69,18 @@
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Leret ke atas dari bahagian bawah skrin. Gerak isyarat ini sentiasa membawa anda ke Skrin utama."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Leret ke atas dengan 2 jari dari bawah skrin. Gerak isyarat ini sentiasa bawa anda ke Skrin utama."</string>
<string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Pergi ke skrin utama"</string>
- <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Leret ke atas dari bahagian bawah skrin anda"</string>
+ <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Leret ke atas dari bahagian bawah skrin"</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Syabas!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Pastikan anda meleret ke atas dari sisi bahagian bawah skrin"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Cuba tahan tetingkap untuk tempoh yang lebih lama sebelum melepaskan"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pastikan anda meleret terus ke atas, kemudian menjeda"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Pastikan anda meleret lurus ke atas, kemudian berhenti seketika"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Anda sudah belajar cara menggunakan gerak isyarat. Untuk mematikan gerak isyarat, pergi ke Tetapan."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Anda telah melengkapkan gerak isyarat menukar apl"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Leret untuk menukar apl"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Untuk beralih antara apl, leret ke atas dari bahagian bawah skrin anda, tahan, kemudian lepaskan."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Untuk beralih antara apl, leret ke atas dengan 2 jari dari bawah skrin, tahan, kemudian lepaskan."</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Beralih antara apl"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Leret ke atas dari bahagian bawah skrin anda, tahan, kemudian lepaskan"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Leret ke atas dari bahagian bawah skrin, tahan, kemudian lepas"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"Syabas!"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Selesai"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"Selesai"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Simpan gandingan apl"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Ketik apl lain untuk menggunakan skrin pisah"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Pilih apl lain untuk menggunakan skrin pisah"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Batal"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Batal"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Keluar daripada pilihan skrin pisah"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Pilih apl lain untuk menggunakan skrin pisah"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Tindakan ini tidak dibenarkan oleh apl atau organisasi anda"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Lakukan lebih banyak perkara dengan Bar Tugas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Sentiasa paparkan Bar Tugas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Untuk sentiasa memaparkan Bar Tugas pada bahagian bawah skrin, sentuh & tahan pembahagi"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Sentuh & tahan kekunci tindakan untuk mencari kandungan yang dipaparkan pada skrin anda"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Produk ini menggunakan bahagian yang dipilih pada skrin anda untuk membuat carian. <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Dasar Privasi<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> dan <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Syarat Perkhidmatan<xliff:g id="END_TOS_LINK"></a></xliff:g> Google digunakan."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tutup"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Selesai"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Laman Utama"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Tetapan Pantas"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Bar Tugas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Bar Tugas dipaparkan"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Bar Tugas & gelembung dipaparkan di sebelah kiri"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Bar Tugas & gelembung dipaparkan di sebelah kanan"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Bar Tugas disembunyikan"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Bar Tugas & gelembung disembunyikan"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Bar navigasi"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Papar Bar Tugas selalu"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Tukar mod navigasi"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Tunjukkan # lagi apl.}other{Tunjukkan # lagi apl.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Tunjukkan # apl desktop.}other{Tunjukkan # apl desktop.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> dan <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Menambahkan apl pada Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Batal"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Gelembung"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Limpahan"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> daripada <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> dan <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> lagi"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Alih ke kiri"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Alih ke kanan"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Ketepikan semua"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"kembangkan <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"kuncupkan <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml
index 64afeed..a3c462d 100644
--- a/quickstep/res/values-my/strings.xml
+++ b/quickstep/res/values-my/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ပင်ထိုးရန်"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"အလွတ်ပုံစံ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ဒက်စ်တော့"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ဒက်စ်တော့"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"မကြာမီကဖွင့်ထားသည်များ မရှိပါ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"အက်ပ်အသုံးပြုမှု ဆက်တင်များ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"အားလုံးရှင်းရန်"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"ကြိုတင်မှန်းဆထားသော အက်ပ်− <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"သင့်စက်ကို လှည့်ပါ"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"လက်ဟန်ဖြင့် လမ်းညွှန်ခြင်း ရှင်းလင်းပို့ချချက်အား အပြီးသတ်ရန် သင့်စက်ကို လှည့်ပါ"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ညာ (သို့) ဘယ်အစွန်း၏ ခပ်လှမ်းလှမ်းမှ ပွတ်ဆွဲကြောင်း သေချာပါစေ"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ညာ (သို့) ဘယ်ဘက်အစွန်ဆုံးမှ ပွတ်ဆွဲကြောင်း သေချာပါစေ"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"ဖန်သားပြင်၏ ညာ (သို့) ဘယ်အစွန်းမှ အလယ်သို့ ပွတ်ဆွဲပြီး လွှတ်လိုက်ကြောင်း သေချာပါစေ"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"နောက်ပြန်သွားရန် ညာဘက်မှပွတ်ဆွဲနည်းကို သိသွားပါပြီ။ နောက်အဆင့်တွင် အက်ပ်များပြောင်းနည်းကို လေ့လာပါ။"</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"နောက်ဆုတ်လက်ဟန် ရှင်းလင်းပို့ချချက် ပြီးပါပြီ။ နောက်အဆင့်တွင် အက်ပ်များပြောင်းနည်းကို လေ့လာပါ။"</string>
@@ -95,11 +96,11 @@
<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>
- <string name="action_split" msgid="2098009717623550676">"ခွဲထုတ်ရန်"</string>
+ <string name="action_split" msgid="2098009717623550676">"ခွဲရန်"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"အက်ပ်အတွဲ သိမ်းရန်"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"မျက်နှာပြင် ခွဲ၍ပြသရန် အက်ပ်နောက်တစ်ခုကို တို့ပါ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"မျက်နှာပြင် ခွဲ၍ပြသခြင်းသုံးရန် နောက်အက်ပ်တစ်ခုရွေးပါ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"မလုပ်တော့"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"မလုပ်တော့"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"မျက်နှာပြင် ခွဲ၍ပြသခြင်း ရွေးချယ်မှုမှ ထွက်ရန်"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"မျက်နှာပြင်ခွဲ၍ပြသခြင်းသုံးရန် နောက်အက်ပ်တစ်ခုရွေးပါ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ဤလုပ်ဆောင်ချက်ကို အက်ပ် သို့မဟုတ် သင်၏အဖွဲ့အစည်းက ခွင့်မပြုပါ"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Taskbar ဖြင့် ပိုမိုလုပ်ဆောင်နိုင်ခြင်း"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Taskbar ကို အမြဲပြပါ"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Taskbar ကို စခရင်အောက်ခြေတွင် အမြဲပြရန် ခွဲခြားမျဉ်းကို တို့ထိ၍ ဖိထားပါ"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"သင့်စခရင်ပေါ်ရှိအရာကို ရှာရန် လုပ်ဆောင်ချက်ကီးကို ထိ၍ဖိထားပါ"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"ဤကုန်ပစ္စည်းသည် သင့်စခရင်၌ ရွေးထားသောအပိုင်းကိုသုံး၍ ရှာဖွေသည်။ Google ၏ <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>ကိုယ်ရေးအချက်အလက်လုံခြုံမှုဆိုင်ရာ မူဝါဒ<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> နှင့် <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>ဝန်ဆောင်မှုစည်းမျဉ်းများ<xliff:g id="END_TOS_LINK"></a></xliff:g> အကျုံးဝင်သည်။"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ပိတ်ရန်"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"ပြီးပြီ"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"ပင်မစာမျက်နှာ"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"အမြန်ဆက်တင်များ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"လုပ်ဆောင်စရာဘား"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taskbar ပြထားသည်"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ဘယ်ဘက်၌ Taskbar နှင့် ပူဖောင်းကွက် ပြထားသည်"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ညာဘက်၌ Taskbar နှင့် ပူဖောင်းကွက် ပြထားသည်"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taskbar ဖျောက်ထားသည်"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taskbar နှင့် ပူဖောင်းကွက် ဖျောက်ထားသည်"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"လမ်းညွှန်ဘား"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Taskbar အမြဲပြရန်"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ရွှေ့ကြည့်သည့်မုဒ် ပြောင်းရန်"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"အပေါ်/ဘယ်ဘက်သို့ ရွှေ့ရန်"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"အောက်ခြေ/ညာဘက်သို့ ရွှေ့ရန်"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{နောက်ထပ်အက်ပ် # ခု ပြပါ။}other{နောက်ထပ်အက်ပ် # ခု ပြပါ။}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{ဒက်စတော့ အက်ပ် # ခု ပြပါ။}other{ဒက်စတော့ အက်ပ် # ခု ပြပါ။}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> နှင့် <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"‘ဒက်စ်တော့’ တွင် အက်ပ်ကို ထည့်ခြင်း"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"မလုပ်တော့"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ပူဖောင်းကွက်"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"မီနူးအပို"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> မှ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> နှင့် နောက်ထပ် <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ခု"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ဘယ်သို့ရွှေ့ရန်"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ညာသို့ရွှေ့ရန်"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"အားလုံးကို ပယ်ရန်"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ကို ပိုပြပါ"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ကို လျှော့ပြပါ"</string>
</resources>
diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml
index 6c5eed9..e486ad8 100644
--- a/quickstep/res/values-nb/strings.xml
+++ b/quickstep/res/values-nb/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fest"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Fritt format"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Skrivebord"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Skrivebord"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Ingen nylige elementer"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Innstillinger for appbruk"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Fjern alt"</string>
@@ -94,12 +95,12 @@
<string name="default_device_name" msgid="6660656727127422487">"enheten"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Innstillinger for systemnavigasjon"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Del"</string>
- <string name="action_screenshot" msgid="8171125848358142917">"Skjermdump"</string>
+ <string name="action_screenshot" msgid="8171125848358142917">"Skjermbilde"</string>
<string name="action_split" msgid="2098009717623550676">"Del opp"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Lagre apptilkobling"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Trykk på en annen app for å bruke delt skjerm"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Velg en annen app for å bruke delt skjerm"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Avbryt"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Avbryt"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Avslutt valg av delt skjerm"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Velg en annen app for å bruke delt skjerm"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller organisasjonen din tillater ikke denne handlingen"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Gjør mer med oppgavelinjen"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Vis alltid oppgavelinjen"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"For å alltid vise oppgavelinjen nederst på skjermen, trykk og hold på skillelinjen"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Trykk og hold på handlingstasten for å søke etter det som er på skjermen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Dette produktet bruker den merkede delen av skjermen til å søke. Googles <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>personvernregler<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> og <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>vilkår for bruk<xliff:g id="END_TOS_LINK"></a></xliff:g> gjelder."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Lukk"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Ferdig"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Hjem"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Hurtiginnst."</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Oppgavelinje"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Oppgavelinjen vises"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Venstre oppgavelinje/boble vises"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Høyre oppgavelinje/bobler vises"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Oppgavelinjen er skjult"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Oppgavelinje og bobler skjult"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigasjonsrad"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Vis alltid oppgavelinjen"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Endre navigasjonsmodus"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Flytt til øverst/venstre"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Flytt til nederst/høyre"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Vis # app til.}other{Vis # apper til.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Vis # datamaskinprogram.}other{Vis # datamaskinprogrammer.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> og <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Legg til apper på datamaskin"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Avbryt"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Boble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflyt"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> fra <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> og <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> andre"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Flytt til venstre"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Flytt til høyre"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Lukk alle"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"vis <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"skjul <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml
index 5b93475..25c5901 100644
--- a/quickstep/res/values-ne/strings.xml
+++ b/quickstep/res/values-ne/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"पिन गर्नुहोस्"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"फ्रिफर्म"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"डेस्कटप"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"डेस्कटप"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"हालसालैको कुनै पनि वस्तु छैन"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"एपको उपयोगका सेटिङहरू"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"सबै मेटाउनुहोस्"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"एपको पेयर सेभ गर्नुहोस्"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"स्प्लिटस्क्रिन प्रयोग गर्न अर्को एपमा ट्याप गर्नु…"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"स्प्लिट स्क्रिन प्रयोग गर्न अर्को एप रोज्नुहोस्"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"रद्द गर्नुहोस्"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"रद्द गर्नुहोस्"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"स्प्लिट स्क्रिन मोडबाट बाहिरिनुहोस्"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"स्प्लिट स्क्रिन प्रयोग गर्न अर्को एप रोज्नुहोस्"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"यो एप वा तपाईंको सङ्गठनले यो कारबाही गर्ने अनुमति दिँदैन"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"टास्कबार प्रयोग गरेर अझ धेरै कार्य गर्नुहोस्"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"टास्कबार सधैँ देखाउनुहोस्"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"आफ्नो स्क्रिनको पुछारमा टास्कबार सधैँ देखाइराख्न डिभाइडर टच एन्ड होल्ड गर्नुहोस्"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"आफ्नो स्क्रिनमा भएका कुराहरू खोज्न एक्सन कीमा टच एन्ड होल्ड गर्नुहोस्"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"यो उत्पादनले तपाईंले चयन गर्नुभएको स्क्रिनको भाग प्रयोग गरेर खोजी गर्छ। Google को <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>गोपनीयता नीति<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> र <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>सेवाका सर्तहरू<xliff:g id="END_TOS_LINK"></a></xliff:g> लागू हुन्छन्।"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"बन्द गर्नुहोस्"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"सम्पन्न भयो"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"होम"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"द्रुत सेटिङ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"टास्कबार"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"टास्कबार देखाइएको छ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"टास्कबार र बबल बार बायाँतिर देखाइएका छन्"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"टास्कबार र बबल बार दायाँतिर देखाइएका छन्"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"टास्कबार लुकाइएको छ"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"टास्कबार र बबल बार लुकाइएका छन्"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"नेभिगेसन बार"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"टास्कबार सधैँ देखाउनुहोस्"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"नेभिगेसन मोड बदल्नुहोस्"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{थप # एप देखाउनुहोस्।}other{थप # वटा एप देखाउनुहोस्।}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# डेस्कटप एप देखाउनुहोस्।}other{# वटा डेस्कटप एप देखाउनुहोस्।}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> र <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"डेस्कटपमा एप हालिँदै छ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"रद्द गर्नुहोस्"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"बबल"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ओभरफ्लो"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> मा देखाइएका <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> र थप <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"बायाँतिर सार्नुहोस्"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"दायाँतिर सार्नुहोस्"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"सबै हटाउनुहोस्"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> एक्स्पान्ड गर्नुहोस्"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> कोल्याप्स गर्नुहोस्"</string>
</resources>
diff --git a/quickstep/res/values-night/colors.xml b/quickstep/res/values-night/colors.xml
index 8d03ce6..2052446 100644
--- a/quickstep/res/values-night/colors.xml
+++ b/quickstep/res/values-night/colors.xml
@@ -22,10 +22,10 @@
<color name="mock_webpage_url_bar">#202124</color>
<color name="mock_webpage_url_bar_item">#3c4043</color>
- <color name="all_set_page_background">#FF000000</color>
+ <color name="all_set_page_background">@android:color/system_neutral1_900</color>
<!-- Turn on work apps button -->
<color name="work_turn_on_stroke">?androidprv:attr/colorAccentSecondaryVariant</color>
- <color name="work_fab_bg_color">?androidprv:attr/materialColorPrimaryFixedDim</color>
- <color name="work_fab_icon_color">?androidprv:attr/materialColorOnPrimaryFixed</color>
+ <color name="work_fab_bg_color">?attr/materialColorPrimaryFixedDim</color>
+ <color name="work_fab_icon_color">?attr/materialColorOnPrimaryFixed</color>
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values-night/styles.xml b/quickstep/res/values-night/styles.xml
index 401351f..2cb633a 100644
--- a/quickstep/res/values-night/styles.xml
+++ b/quickstep/res/values-night/styles.xml
@@ -82,16 +82,16 @@
<style name="GestureTutorialActivity" parent="@style/AppTheme">
<item name="background">@android:color/transparent</item>
<item name="tutorialSubtitle">@android:color/white</item>
- <item name="surfaceContainer">?androidprv:attr/materialColorSurfaceContainer</item>
- <item name="onSurfaceHome">?androidprv:attr/materialColorPrimaryFixedDim</item>
- <item name="surfaceHome">?androidprv:attr/materialColorOnPrimaryFixedVariant</item>
- <item name="secondaryHome">?androidprv:attr/materialColorOnPrimaryFixed</item>
- <item name="onSurfaceBack">?androidprv:attr/materialColorTertiaryFixedDim</item>
- <item name="surfaceBack">?androidprv:attr/materialColorOnTertiaryFixedVariant</item>
- <item name="secondaryBack">?androidprv:attr/materialColorOnTertiaryFixed</item>
- <item name="onSurfaceOverview">?androidprv:attr/materialColorPrimaryFixed</item>
- <item name="surfaceOverview">?androidprv:attr/materialColorOnSecondaryFixedVariant</item>
- <item name="secondaryOverview">?androidprv:attr/materialColorOnSecondaryFixed</item>
+ <item name="surfaceContainer">?attr/materialColorSurfaceContainer</item>
+ <item name="onSurfaceHome">?attr/materialColorPrimaryFixedDim</item>
+ <item name="surfaceHome">?attr/materialColorOnPrimaryFixedVariant</item>
+ <item name="secondaryHome">?attr/materialColorOnPrimaryFixed</item>
+ <item name="onSurfaceBack">?attr/materialColorTertiaryFixedDim</item>
+ <item name="surfaceBack">?attr/materialColorOnTertiaryFixedVariant</item>
+ <item name="secondaryBack">?attr/materialColorOnTertiaryFixed</item>
+ <item name="onSurfaceOverview">?attr/materialColorPrimaryFixed</item>
+ <item name="surfaceOverview">?attr/materialColorOnSecondaryFixedVariant</item>
+ <item name="secondaryOverview">?attr/materialColorOnSecondaryFixed</item>
</style>
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml
index 6e7cff5..2b5bd49 100644
--- a/quickstep/res/values-nl/strings.xml
+++ b/quickstep/res/values-nl/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Vastzetten"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Vrije vorm"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Geen recente items"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Instellingen voor app-gebruik"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Alles wissen"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"App-paar opslaan"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tik op nog een app om je scherm te splitsen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Kies een andere app om gesplitst scherm te gebruiken"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Annuleren"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Annuleren"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Sluit de selectie voor gesplitst scherm"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Kies andere app om gesplitst scherm te gebruiken"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Deze actie wordt niet toegestaan door de app of je organisatie"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Snelle instellingen"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taakbalk"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Taakbalk wordt getoond"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taakbalk en bubbels links getoond"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taakbalk en bubbels rechts getoond"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Taakbalk is verborgen"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Taakbalk en bubbels verborgen"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigatiebalk"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Taakbalk altijd tonen"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Navigatiemodus wijzigen"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Naar boven/links verplaatsen"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Naar beneden/rechts verplaatsen"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Nog # app tonen.}other{Nog # apps tonen.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# desktop-app tonen.}other{# desktop-apps tonen.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> en <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"App toevoegen aan desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Annuleren"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubbel"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overloop"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> van <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> en nog <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Naar links verplaatsen"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Naar rechts verplaatsen"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Alles sluiten"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> uitvouwen"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> samenvouwen"</string>
</resources>
diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml
index 17238c1..6628826 100644
--- a/quickstep/res/values-or/strings.xml
+++ b/quickstep/res/values-or/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ପିନ୍"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ଫ୍ରିଫର୍ମ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ଡେସ୍କଟପ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ଡେସ୍କଟପ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ବର୍ତ୍ତମାନର କୌଣସି ଆଇଟମ ନାହିଁ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ଆପ ବ୍ୟବହାର ସେଟିଂସ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ସବୁ ଖାଲି କରନ୍ତୁ"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"ପୂର୍ବାନୁମାନ କରାଯାଇଥିବା ଆପ୍: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"ଆପଣଙ୍କ ଡିଭାଇସକୁ ରୋଟେଟ କରନ୍ତୁ"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"ଜେଶ୍ଚର ନାଭିଗେସନ ଟ୍ୟୁଟୋରିଆଲ ସମ୍ପୂର୍ଣ୍ଣ କରିବାକୁ ଦୟାକରି ଆପଣଙ୍କ ଡିଭାଇସ ରୋଟେଟ କରନ୍ତୁ"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ଆପଣ ସ୍କ୍ରିନର ଏକଦମ୍-ଡାହାଣ ବା ବାମ ଧାରରୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ଆପଣ ସ୍କ୍ରିନର ଏକଦମ-ଡାହାଣ ବା ବାମ ଧାରରୁ ସ୍ୱାଇପ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"ଆପଣ ସ୍କ୍ରିନର ଡାହାଣ ବା ବାମ ଧାରରୁ ମଝିକୁ ସ୍ୱାଇପ କରି ଛାଡ଼ି ଦେଉଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"ଆପଣ ଡାହାଣରୁ ସ୍ୱାଇପ୍ କରି ପଛକୁ କିପରି ଫେରିବେ ତାହା ଜାଣିଲେ। ତା\'ପରେ, ଆପକୁ କିପରି ସ୍ୱିଚ୍ କରିବେ ତାହା ଜାଣନ୍ତୁ।"</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"ଆପଣ \'ପଛକୁ ଫେରନ୍ତୁ\' ଜେଶ୍ଚର୍ ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି। ତା\'ପରେ, ଆପଗୁଡ଼ିକୁ କିପରି ସ୍ୱିଚ୍ କରିବେ ତାହା ଜାଣନ୍ତୁ।"</string>
@@ -72,14 +73,14 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"ବଢ଼ିଆ କାମ!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"ଆପଣ ସ୍କ୍ରିନର ତଳ ଧାରରୁ ଉପରକୁ ସ୍ୱାଇପ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"ୱିଣ୍ଡୋକୁ ରିଲିଜ୍ କରିବା ପୂର୍ବରୁ ଅଧିକ ସମୟ ଧରି ରଖିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ।"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"ଆପଣ ସିଧା ଉପରକୁ ସ୍ୱାଇପ୍ କରି ତା\'ପରେ ବିରତ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"ଆପଣ ସିଧା ଉପରକୁ ସ୍ୱାଇପ କରି ତା\'ପରେ ବିରତ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"ଜେଶ୍ଚରଗୁଡ଼ିକୁ କିପରି ବ୍ୟବହାର କରାଯିବ ଆପଣ ତାହା ଶିଖିଛନ୍ତି। ଜେଶ୍ଚରଗୁଡ଼ିକୁ ବନ୍ଦ କରିବାକୁ, ସେଟିଂସକୁ ଯାଆନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"ଆପଣ \'ଆପଗୁଡ଼ିକୁ ସ୍ୱିଚ୍ କରନ୍ତୁ\' ଜେଶ୍ଚର୍ ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି।"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"ଆପଗୁଡ଼ିକୁ ସ୍ୱିଚ୍ କରିବା ପାଇଁ ସ୍ୱାଇପ୍ କରନ୍ତୁ"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"ଆପ୍ସ ମଧ୍ୟରେ ସୁଇଚ କରିବାକୁ, ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ, ଧରି ରଖନ୍ତୁ, ତା\'ପରେ ରିଲିଜ କରନ୍ତୁ।"</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"ଆପ୍ସ ମଧ୍ୟରେ ସ୍ୱିଚ କରିବାକୁ, 2ଟି ଆଙ୍ଗୁଠିରେ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରି ଧରି ରଖନ୍ତୁ, ତା\'ପରେ ରିଲିଜ କର।"</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"ଆପ୍ସ ସୁଇଚ କରନ୍ତୁ"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"ଆପଣଙ୍କ ସ୍କ୍ରିନ୍ର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରି ଧରି ରଖନ୍ତୁ, ତା\'ପରେ ରିଲିଜ୍ କରନ୍ତୁ"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"ଆପଣଙ୍କ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରି ଧରି ରଖନ୍ତୁ, ତା\'ପରେ ରିଲିଜ କରନ୍ତୁ"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"ବହୁତ ବଢ଼ିଆ!"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"ସବୁ ପ୍ରସ୍ତୁତ"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"ହୋଇଗଲା"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ଆପ ପେୟାର ସେଭ କରନ୍ତୁ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"ସ୍ପ୍ଲିଟସ୍କ୍ରିନ ବ୍ୟବହାର କରିବାକୁ ଅନ୍ୟ ଏକ ଆପରେ ଟାପ କର"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"ସ୍ପ୍ଲିଟ ସ୍କ୍ରିନ ବ୍ୟବହାର କରିବାକୁ ଅନ୍ୟ ଏକ ଆପ ବାଛନ୍ତୁ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ବାତିଲ କରନ୍ତୁ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ବାତିଲ କରନ୍ତୁ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ସ୍ପ୍ଲିଟ ସ୍କ୍ରିନ ଚୟନରୁ ବାହାରି ଯାଆନ୍ତୁ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"ସ୍ପ୍ଲିଟ ସ୍କ୍ରିନ ବ୍ୟବହାର କରିବାକୁ ଅନ୍ୟ ଏକ ଆପ ବାଛନ୍ତୁ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ଆପ୍ କିମ୍ବା ଆପଣଙ୍କ ସଂସ୍ଥା ଦ୍ୱାରା ଏହି କାର୍ଯ୍ୟକୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"କୁଇକ ସେଟିଂସ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ଟାସ୍କବାର"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ଟାସ୍କବାର ଦେଖାଯାଇଛି"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ଟାସ୍କବାର ଓ ବବଲ ବାମରେ ଦେଖାଯାଇଛି"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ଟାସ୍କବାର ଓ ବବଲ ଡାହାଣରେ ଦେଖାଯାଇଛି"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ଟାସ୍କବାର ଲୁଚାଯାଇଛି"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ଟାସ୍କବାର ଓ ବବଲ ଲୁଚାଯାଇଛି"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ନାଭିଗେସନ ବାର"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ସର୍ବଦା ଟାସ୍କବାର ଦେଖାନ୍ତୁ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ନାଭିଗେସନ ମୋଡ ପରିବର୍ତ୍ତନ କରନ୍ତୁ"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"ଶୀର୍ଷ/ବାମକୁ ମୁଭ କରନ୍ତୁ"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"ନିମ୍ନ/ଡାହାଣକୁ ମୁଭ କରନ୍ତୁ"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{ଅଧିକ #ଟି ଆପ ଦେଖାନ୍ତୁ।}other{ଅଧିକ #ଟି ଆପ୍ସ ଦେଖାନ୍ତୁ।}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ଡେସ୍କଟପ ଆପ ଦେଖାନ୍ତୁ।}other{# ଡେସ୍କଟପ ଆପ୍ସ ଦେଖାନ୍ତୁ।}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ଏବଂ <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ଡେସ୍କଟପରେ ଆପ ଯୋଗ କରାଯାଉଛି"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ବାତିଲ କରନ୍ତୁ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ବବଲ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ଓଭରଫ୍ଲୋ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g>ରୁ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ଏବଂ ଅଧିକ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ବାମକୁ ମୁଭ କରନ୍ତୁ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ଡାହାଣକୁ ମୁଭ କରନ୍ତୁ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ସବୁ ଖାରଜ କରନ୍ତୁ"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ବିସ୍ତାର କରନ୍ତୁ"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ସଙ୍କୁଚିତ କରନ୍ତୁ"</string>
</resources>
diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml
index e761c5d..6d4d287 100644
--- a/quickstep/res/values-pa/strings.xml
+++ b/quickstep/res/values-pa/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ਪਿੰਨ ਕਰੋ"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ਫ੍ਰੀਫਾਰਮ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ਡੈਸਕਟਾਪ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ਡੈਸਕਟਾਪ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ਕੋਈ ਹਾਲੀਆ ਆਈਟਮ ਨਹੀਂ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ਐਪ ਵਰਤੋਂ ਦੀਆਂ ਸੈਟਿੰਗਾਂ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ਸਭ ਕਲੀਅਰ ਕਰੋ"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ਐਪ ਜੋੜਾਬੱਧ ਰੱਖਿਅਤ ਕਰੋ"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਨੂੰ ਵਰਤਣ ਲਈ ਕਿਸੇ ਹੋਰ ਐਪ \'ਤੇ ਟੈਪ ਕਰੋ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਵਰਤਣ ਲਈ ਕਿਸੇ ਹੋਰ ਐਪ ਨੂੰ ਚੁਣੋ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ਰੱਦ ਕਰੋ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ਰੱਦ ਕਰੋ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਦੀ ਚੋਣ ਤੋਂ ਬਾਹਰ ਜਾਓ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਵਰਤਣ ਲਈ ਕਿਸੇ ਹੋਰ ਐਪ ਨੂੰ ਚੁਣੋ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ਐਪ ਜਾਂ ਤੁਹਾਡੀ ਸੰਸਥਾ ਵੱਲੋਂ ਇਸ ਕਾਰਵਾਈ ਦੀ ਇਜਾਜ਼ਤ ਨਹੀਂ ਹੈ"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ਤਤਕਾਲ ਸੈਟਿੰਗਾਂ"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ਟਾਸਕਬਾਰ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ਟਾਸਕਬਾਰ ਨੂੰ ਦਿਖਾਇਆ ਗਿਆ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ਟਾਸਕਬਾਰ ਤੇ ਬਬਲ ਨੂੰ ਖੱਬੇ ਦਿਖਾਇਆ"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ਟਾਸਕਬਾਰ ਤੇ ਬਬਲ ਨੂੰ ਸੱਜੇ ਦਿਖਾਇਆ"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ਟਾਸਕਬਾਰ ਨੂੰ ਲੁਕਾਇਆ ਗਿਆ"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ਟਾਸਕਬਾਰ ਅਤੇ ਬਬਲ ਨੂੰ ਲੁਕਾਇਆ ਗਿਆ"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"ਨੈਵੀਗੇਸ਼ਨ ਵਾਲੀ ਪੱਟੀ"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ਹਮੇਸ਼ਾਂ ਟਾਸਕਬਾਰ ਦਿਖਾਓ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"ਨੈਵੀਗੇਸ਼ਨ ਮੋਡ ਬਦਲੋ"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"ਸਿਖਰਲੇ/ਖੱਬੇ ਪਾਸੇ ਲੈ ਕੇ ਜਾਓ"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"ਹੇਠਾਂ/ਸੱਜੇ ਪਾਸੇ ਲੈ ਕੇ ਜਾਓ"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# ਹੋਰ ਐਪ ਦਿਖਾਓ।}one{# ਹੋਰ ਐਪ ਦਿਖਾਓ।}other{# ਹੋਰ ਐਪਾਂ ਦਿਖਾਓ।}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ਡੈਸਕਟਾਪ ਐਪ ਦਿਖਾਓ।}one{# ਡੈਸਕਟਾਪ ਐਪ ਦਿਖਾਓ।}other{# ਡੈਸਕਟਾਪ ਐਪਾਂ ਦਿਖਾਓ।}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ਅਤੇ <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ਐਪ ਨੂੰ ਡੈਸਕਟਾਪ \'ਤੇ ਸ਼ਾਮਲ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ਰੱਦ ਕਰੋ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ਬਬਲ"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ਓਵਰਫ਼ਲੋ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> ਤੋਂ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ਅਤੇ <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> ਹੋਰ"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ਖੱਬੇ ਲਿਜਾਓ"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ਸੱਜੇ ਲਿਜਾਓ"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ਸਭ ਖਾਰਜ ਕਰੋ"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ਦਾ ਵਿਸਤਾਰ ਕਰੋ"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ਨੂੰ ਸਮੇਟੋ"</string>
</resources>
diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml
index 22e650f..f001a88 100644
--- a/quickstep/res/values-pl/strings.xml
+++ b/quickstep/res/values-pl/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Przypnij"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Tryb dowolny"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Pulpit"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Pulpit"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Brak ostatnich elementów"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Ustawienia użycia aplikacji"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Wyczyść wszystko"</string>
@@ -90,8 +91,8 @@
<string name="allset_title" msgid="5021126669778966707">"Wszystko gotowe"</string>
<string name="allset_hint" msgid="459504134589971527">"Aby przejść na stronę główną, przesuń w górę"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Kliknij przycisk ekranu głównego, aby otworzyć ekran główny"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"Teraz możesz zacząć używać urządzenia <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
- <string name="default_device_name" msgid="6660656727127422487">"urządzenie"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> jest gotowe – możesz zacząć z niego korzystać"</string>
+ <string name="default_device_name" msgid="6660656727127422487">"Urządzenie"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Ustawienia nawigacji w systemie"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Udostępnij"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Zrzut ekranu"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Zapisz parę"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Aby podzielić ekran, kliknij drugą aplikację"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Aby podzielić ekran, wybierz drugą aplikację"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Anuluj"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Anuluj"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Wyjdź z wyboru podzielonego ekranu"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Wybierz drugą aplikację, aby podzielić ekran"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Nie możesz wykonać tego działania, bo nie zezwala na to aplikacja lub Twoja organizacja"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Wykorzystaj potencjał paska aplikacji"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Zawsze wyświetlaj pasek aplikacji"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Aby zawsze wyświetlać pasek aplikacji u dołu ekranu, naciśnij i przytrzymaj linię dzielenia ekranu"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Aby rozpocząć wyszukiwanie na podstawie zawartości ekranu, naciśnij i przytrzymaj klawisz działania"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Usługa przy wyszukiwaniu używa zaznaczonego fragmentu ekranu. Obowiązują zapisy <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Polityki prywatności<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> i <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Warunków korzystania z usług<xliff:g id="END_TOS_LINK"></a></xliff:g> Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zamknij"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gotowe"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Ekran główny"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Szybkie ustawienia"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Pasek aplikacji"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Pasek aplikacji widoczny"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Pasek i dymki po lewej"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Pasek i dymki po prawej"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Pasek aplikacji ukryty"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Pasek i dymki są ukryte"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Pasek nawigacyjny"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Zawsze pokazuj pasek aplikacji"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Zmień tryb nawigacji"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Pokaż jeszcze # aplikację.}few{Pokaż jeszcze # aplikacje.}many{Pokaż jeszcze # aplikacji.}other{Pokaż jeszcze # aplikacji.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Pokaż # aplikację komputerową.}few{Pokaż # aplikacje komputerowe.}many{Pokaż # aplikacji komputerowych.}other{Pokaż # aplikacji komputerowej.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> i <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Dodaję aplikację do komputera"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Anuluj"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Dymek"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Rozwijany"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> z aplikacji <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> i jeszcze <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Przenieś w lewo"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Przenieś w prawo"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Zamknij wszystkie"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"rozwiń dymek: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"zwiń dymek: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml
index fa47374..1d65cce 100644
--- a/quickstep/res/values-pt-rPT/strings.xml
+++ b/quickstep/res/values-pt-rPT/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixar"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Forma livre"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Computador"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Computador"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nenhum item recente"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Definições de utilização de aplicações"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Limpar tudo"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"App prevista: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"Rode o dispositivo"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"Rode o seu dispositivo para concluir o tutorial de navegação por gestos"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Deslize rapidamente a partir da extremidade mais à direita ou mais à esquerda"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Deslize a partir da extremidade mais à direita ou mais à esquerda"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"Deslize rapidamente a partir da extremidade esquerda ou direita até ao centro do ecrã e solte"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Aprendeu a deslizar a partir da direita para retroceder. A seguir, saiba como alternar entre apps."</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Concluiu o gesto para retroceder. A seguir, saiba como alternar entre apps."</string>
@@ -57,9 +58,9 @@
<string name="back_gesture_intro_title" msgid="19551256430224428">"Deslize rapidamente com o dedo para retroceder"</string>
<string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"Para voltar ao último ecrã, deslize rapidamente do limite esquerdo ou direito até ao centro do ecrã."</string>
<string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Para voltar ao último ecrã, deslize rapidamente com 2 dedos a partir da extremidade esquerda ou direita até ao centro do ecrã."</string>
- <string name="back_gesture_tutorial_title" msgid="1944737946101059789">"Voltar"</string>
- <string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Deslize rapidamente a partir da extremidade esquerda ou direita para o meio do ecrã"</string>
- <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Deslize rapidamente com o dedo a partir do limite inferior do ecrã"</string>
+ <string name="back_gesture_tutorial_title" msgid="1944737946101059789">"Retroceder"</string>
+ <string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Deslize a partir da extremidade esquerda ou direita até ao centro do ecrã"</string>
+ <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Deslize a partir do limite inferior do ecrã"</string>
<string name="home_gesture_feedback_overview_detected" msgid="5177627157303895077">"Não faça uma pausa antes de soltar"</string>
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="8328465201424027148">"Deslize rapidamente com o dedo para cima"</string>
<string name="home_gesture_feedback_complete_with_follow_up" msgid="8766981412895888417">"Concluiu o gesto para aceder ao ecrã principal. A seguir, saiba como retroceder."</string>
@@ -68,18 +69,18 @@
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Deslize rapidamente para cima a partir da parte inferior. Este gesto abre sempre o ecrã principal."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Deslize rapidamente para cima com 2 dedos no fundo do ecrã. Este gesto abre sempre o ecrã principal."</string>
<string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Aceda ao ecrã principal"</string>
- <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Deslize rapidamente para cima a partir da parte inferior do ecrã"</string>
+ <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Deslize para cima a partir da parte inferior do ecrã"</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Muito bem!"</string>
- <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Deslize rapidamente com o dedo a partir do limite inferior do ecrã"</string>
+ <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Deslize a partir do limite inferior do ecrã"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Experimente premir a janela durante mais tempo antes de soltar"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Garanta que desliza rapidamente com o dedo para cima e, em seguida, faz uma pausa"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Deslize para cima e pause"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Aprendeu a utilizar gestos. Para desativar os gestos, aceda às Definições."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Concluiu o gesto para alternar entre apps"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Deslize rapidamente com o dedo para alternar entre apps"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Para alternar entre apps, deslize para cima sem soltar a partir da parte inferior do ecrã e solte."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Para mudar de app, deslize rapidamente para cima com 2 dedos sem soltar no fundo do ecrã e solte."</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Mude de app"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Deslize rapidamente para cima a partir da parte inferior do ecrã sem soltar e, em seguida, solte"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Deslize para cima a partir da parte inferior do ecrã , detenha o gesto e solte"</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"Muito bem!"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Está tudo pronto"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"Concluído"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Guardar par de apps"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Toque noutra app para usar o ecrã dividido"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Escolha outra app para usar o ecrã dividido"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancelar"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancelar"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Saia da seleção de ecrã dividido"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Escolher outra app para usar o ecrã dividido"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Esta ação não é permitida pela app ou a sua entidade."</string>
@@ -113,7 +114,7 @@
<string name="taskbar_edu_splitscreen" msgid="5605512479258053350">"Arraste uma app para o lado para usar 2 apps em simultâneo"</string>
<string name="taskbar_edu_stashing" msgid="5645461372669217294">"Deslize lentamente para cima para ver a Barra de tarefas"</string>
<string name="taskbar_edu_suggestions" msgid="8215044496435527982">"Receba sugestões de apps baseadas na sua rotina"</string>
- <string name="taskbar_edu_pinning" msgid="6708550858580071558">"Mantenha o divisor premido para fixar a Barra de tarefas"</string>
+ <string name="taskbar_edu_pinning" msgid="6708550858580071558">"Mantenha o divisor pressionado para fixar a Barra de tarefas"</string>
<string name="taskbar_edu_features" msgid="3320337287472848162">"Faça mais com a Barra de tarefas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Mostre sempre a Barra de tarefas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Para mostrar sempre a Barra de tarefas no fundo do ecrã, toque sem soltar no divisor"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Definiç. rápidas"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tarefas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barra de tarefas apresentada"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra de tarefas/balões à esq."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra de tarefas/balões à dir."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barra de tarefas ocultada"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra tarefas/balões ocultos"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegação"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Ver sempre Barra de tarefas"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Alterar modo de navegação"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mover para a parte superior esquerda"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mover para a part superior direita"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostrar mais # app.}other{Mostrar mais # apps.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostrar # app para computador.}other{Mostrar # apps para computador.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> e <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"A adicionar a app ao computador"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancelar"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Balão"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Menu adicional"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> da app <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> e mais <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> pessoas"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mover para a esquerda"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mover para a direita"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Ignorar tudo"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"expandir <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"reduzir <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml
index 5e0a62e..e094908 100644
--- a/quickstep/res/values-pt/strings.xml
+++ b/quickstep/res/values-pt/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixar"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Forma livre"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Computador"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Modo área de trabalho"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Computador"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nenhum item recente"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Configurações de uso do app"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Remover tudo"</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Muito bem!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Deslize da borda inferior da tela para cima"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Mantenha a janela pressionada por mais tempo antes de soltar"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Deslize para cima e pare"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Deslize para cima em linha reta e pare"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Você aprendeu. Para desativar os gestos, acesse as Configurações."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Você concluiu o gesto para mudar de app"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Deslizar para trocar de app"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Salvar par de apps"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Toque em outro app para usar a tela dividida"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Escolha outro app para usar na tela dividida"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Cancelar"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Cancelar"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Sair da seleção de tela dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Escolha outro app para usar na tela dividida"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Essa ação não é permitida pelo app ou pela organização"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Aproveite ainda mais a Barra de tarefas"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Sempre mostrar a Barra de tarefas"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Toque e pressione o divisor para sempre mostrar a Barra de tarefas na parte de baixo da tela"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Toque na tecla de ação e pressione para pesquisar o que está na tela"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"O produto usa a parte selecionada da tela para pesquisar. O uso desses dados está sujeito à <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Política de Privacidade<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> e aos <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Termos de Serviço<xliff:g id="END_TOS_LINK"></a></xliff:g> do Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fechar"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Concluído"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Início"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Config. rápidas"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Barra de tarefas"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Barra de tarefas visível"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Barra de tar. e balões à esq."</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Barra de tar. e balões à dir."</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Barra de tarefas oculta"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Barra de tar. e balões ocultos"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Barra de navegação"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Sempre mostrar a Barra de tarefas"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Mudar o modo de navegação"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mover para cima/para a esquerda"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mover para baixo/para a direita"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Mostrar mais # app.}one{Mostrar mais # app.}other{Mostrar mais # apps.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Mostrar # app para computador.}one{Mostrar # app para computador.}other{Mostrar # apps para computador.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> e <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Adicionando app ao computador"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Cancelar"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Balão"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Balão flutuante"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> do app <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> e mais <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Mover para esquerda"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Mover para direita"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Dispensar todos"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"abrir <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"fechar <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml
index 10b8b95..be813d5 100644
--- a/quickstep/res/values-ro/strings.xml
+++ b/quickstep/res/values-ro/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fixează"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Formă liberă"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Computer"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Computer"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Niciun element recent"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Setări de utilizare a aplicației"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Șterge tot"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Salvează perechea de aplicații"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Atinge altă aplicație pentru ecranul împărțit"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Alege altă aplicație pentru a folosi ecranul împărțit"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Anulează"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Anulează"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Ieși din selecția cu ecran împărțit"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Alege altă aplicație pentru ecranul împărțit"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Această acțiune nu este permisă de aplicație sau de organizația ta"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Fă mai multe din Bara de activități"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Afișează întotdeauna Bara de activități"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Pentru a afișa mereu Bara de activități în partea de jos a ecranului, atinge lung separatorul"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Atinge lung tasta de acțiuni ca să cauți pe ecran"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Acest produs folosește partea selectată a ecranului pentru a căuta. Se aplică <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Politica de confidențialitate<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> și <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Termenii și condițiile<xliff:g id="END_TOS_LINK"></a></xliff:g> Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Închide"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gata"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Ecran de pornire"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Setări rapide"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Bară de activități"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Bara de activități este afișată"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Bară și baloane stânga afișate"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Bară & baloane dreapta afișate"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Bara de activități este ascunsă"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Bară și baloane ascunse"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Bară de navigare"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Afișează mereu bara"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Schimbă modul de navigare"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mută în stânga sus"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mută în dreapta jos"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Afișează încă # aplicație}few{Afișează încă # aplicații}other{Afișează încă # de aplicații}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Afișează # aplicație pentru computer.}few{Afișează # aplicații pentru computer.}other{Afișează # de aplicații pentru computer.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> și <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Se adaugă aplicația pe computer"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Anulează"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Balon"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Suplimentar"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> de la <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> și încă <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Deplasează spre stânga"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Deplasează spre dreapta"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Închide-le pe toate"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"extinde <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"restrânge <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml
index 50097b2..5e1c79d 100644
--- a/quickstep/res/values-ru/strings.xml
+++ b/quickstep/res/values-ru/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Закрепить"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Произвольная форма"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Включить режим для ПК"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Мультиоконный режим"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Мультиоконный режим"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Здесь пока ничего нет."</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Настройки использования приложения"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Очистить все"</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"У вас получилось!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Проведите снизу вверх от самого края экрана."</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Прежде чем отпустить палец, задержите его на экране немного дольше."</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Проведите по экрану ровно вверх и задержите палец в конце."</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Проведите по экрану вверх и задержите палец."</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Теперь вы знаете, как использовать жесты. Чтобы отключить их, перейдите в настройки."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Вы выполнили жест для переключения между приложениями."</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Переключение между приложениями"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Сохранить приложения"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Для разделения экрана выберите другое приложение."</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Чтобы использовать разделенный экран, выберите другое приложение."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Отмена"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Отмена"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Выйдите из режима разделения экрана."</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Выберите другое приложение для разделения экрана."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Это действие заблокировано приложением или организацией."</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Используйте все возможности панели задач"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Закрепите панель задач внизу экрана"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Для этого нажмите на разделитель и удерживайте его."</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Чтобы найти информацию об объекте на экране, нажмите и удерживайте клавишу действия"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Этот продукт использует выделенную часть экрана для поиска. При этом действуют <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Политика конфиденциальности<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> и <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Условия использования<xliff:g id="END_TOS_LINK"></a></xliff:g> Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрыть"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Главный экран"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Быстрые настройки"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Панель задач"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Панель задач показана"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Слева панель задач, подсказки"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Справа панель задач, подсказки"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Панель задач скрыта"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Скрыты панель задач, подсказки"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Панель навигации"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Всегда показывать панель задач"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Изменить режим навигации"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Переместить вверх или влево"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Переместить вниз или вправо"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Показать ещё # приложение}one{Показать ещё # приложение}few{Показать ещё # приложения}many{Показать ещё # приложений}other{Показать ещё # приложения}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Показать # компьютерное приложение.}one{Показать # компьютерное приложение.}few{Показать # компьютерных приложения.}many{Показать # компьютерных приложений.}other{Показать # компьютерного приложения.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> и <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Добавление приложения на компьютер"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Отмена"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Всплывающая подсказка"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Дополнительное меню"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"\"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>\" из приложения \"<xliff:g id="APP_NAME">%2$s</xliff:g>\""</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> и ещё <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Переместить влево"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Переместить вправо"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Закрыть все"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"Развернуто: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"Свернуто: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml
index fc804d2..1b6ec0f 100644
--- a/quickstep/res/values-si/strings.xml
+++ b/quickstep/res/values-si/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"අමුණන්න"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ඩෙස්ක්ටොපය"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ඩෙස්ක්ටොපය"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"මෑත අයිතම නැත"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"යෙදුම් භාවිත සැකසීම්"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"සියල්ල හිස් කරන්න"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"යෙදුම් යුගල සුරකින්න"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"බෙදුම් තිරය භාවිතා කිරීමට තවත් යෙදුමක් තට්ටු කරන්න"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"බෙදුම් තිරය භාවිත කිරීමට වෙනත් යෙදුමක් තෝරා ගන්න"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"අවලංගු කරන්න"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"අවලංගු කරන්න"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"බෙදීම් තිර තේරීමෙන් පිටවන්න"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"බෙදීම් තිරය භාවිතා කිරීමට වෙනත් යෙදුමක් තෝරා ගන්න"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"මෙම ක්රියාව යෙදුම හෝ ඔබේ සංවිධානය මගින් ඉඩ නොදේ"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"කාර්ය තීරුව සමග තවත් කරන්න"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"සෑම විටම කාර්ය තීරුව පෙන්වන්න"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"සෑම විටම ඔබේ තිරයේ පතුලේ ඇති කාර්ය තීරුව පෙන්වීමට, බෙදුම්කරු ස්පර්ශ කර අල්ලාගෙන සිටින්න"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"ඔබේ තිරයෙහි ඇති දේ සෙවීමට ක්රියා යතුර ස්පර්ශ කර සිටින්න"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"මෙම නිෂ්පාදනය සෙවීමට ඔබේ තිරයෙහි තෝරන ලද කොටස භාවිතා කරයි. Google හි <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>පෞද්ගලිකත්ව ප්රතිපත්තිය<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> සහ <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>සේවා නියමයන්<xliff:g id="END_TOS_LINK"></a></xliff:g> අදාළ වේ."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"වසන්න"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"නිමයි"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"මුල් පිටුව"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"ඉක්මන් සැකසීම්"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"කාර්ය තීරුව"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"කාර්ය තීරුව පෙන්වා ඇත"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"කාර්ය තීරුව සහ බුබුළු පෙන්වා ඇත"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"කාර්ය තීරුව සහ බුබුළු දකුණට පෙන්වා ඇත"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"කාර්ය තීරුව සඟවා ඇත"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"කාර්ය තීරුව සහ බුබුළු සඟවා ඇත"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"සංචලන තීරුව"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"සෑම විටම කාර්ය තීරුව පෙන්වන්න"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"සංචාලන ප්රකාරය වෙනස් කරන්න"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{තවත් # යෙදුමක් පෙන්වන්න.}one{තවත් යෙදුම් #ක් පෙන්වන්න.}other{තවත් යෙදුම් #ක් පෙන්වන්න.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ඩෙස්ක්ටොප් යෙදුමක් පෙන්වන්න.}one{ඩෙස්ක්ටොප් යෙදුම් # ක් පෙන්වන්න.}other{ඩෙස්ක්ටොප් යෙදුම් # ක් පෙන්වන්න.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> සහ <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ඩෙස්ක්ටොප් වෙත යෙදුම එක් කිරීම"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"අවලංගු කරන්න"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"බුබුළු"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"පිටාර යාම"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> සිට <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> හා තව <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>ක්"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"වමට ගෙන යන්න"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"දකුණට ගෙන යන්න"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"සියල්ල ඉවතලන්න"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> දිග හරින්න"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> හකුළන්න"</string>
</resources>
diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml
index 42a3adf..12a00a3 100644
--- a/quickstep/res/values-sk/strings.xml
+++ b/quickstep/res/values-sk/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pripnúť"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Voľný režim"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Počítač"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Počítač"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Žiadne nedávne položky"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Nastavenia využívania aplikácie"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Vymazať všetko"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Predpovedaná aplikácia: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"Otočte zariadenie"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"Otočte zariadenie a dokončite tak návod, ako navigovať gestami"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Musíte potiahnuť úplne z pravého alebo ľavého okraja"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"Musíte potiahnuť úplne z pravého alebo ľavého okraja."</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"Musíte potiahnuť z pravého alebo ľavého okraja do stredu obrazovky a potom uvoľniť"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Naučili ste sa prejsť späť potiahnutím sprava. V ďalšom kroku sa naučíte prepínať aplikácie."</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"Dokončili ste gesto na prechod späť. V ďalšom kroku sa naučíte, ako prepínať aplikácie."</string>
@@ -58,8 +59,8 @@
<string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"Na poslednú obrazovku prejdete potiahnutím z ľavého alebo pravého okraja do stredu obrazovky."</string>
<string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Na poslednú obrazovku sa vrátite potiahnutím dvoma prstami z ľavého alebo pravého okraja do stredu obrazovky."</string>
<string name="back_gesture_tutorial_title" msgid="1944737946101059789">"Prechod späť"</string>
- <string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Potiahnite z ľavého alebo pravého okraja do stredu obrazovky"</string>
- <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Musíte potiahnuť nahor z dolného okraja obrazovky"</string>
+ <string name="back_gesture_tutorial_subtitle" msgid="6639993416000920142">"Potiahnite z ľavého alebo pravého okraja do stredu obrazovky."</string>
+ <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="4816365433160895458">"Musíte potiahnuť nahor z dolného okraja obrazovky."</string>
<string name="home_gesture_feedback_overview_detected" msgid="5177627157303895077">"Pred uvoľnením nesmiete zastať"</string>
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="8328465201424027148">"Musíte potiahnuť priamo nahor"</string>
<string name="home_gesture_feedback_complete_with_follow_up" msgid="8766981412895888417">"Dokončili ste gesto prechodu na plochu. Teraz sa naučíte, ako sa vrátiť späť."</string>
@@ -68,18 +69,18 @@
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Potiahnite nahor zdola obrazovky. Týmto gestom sa vždy vrátite na plochu."</string>
<string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Postiahnite dvoma prstami z dolnej časti obrazovky. Týmto gestom sa vždy vrátite na plochu."</string>
<string name="home_gesture_tutorial_title" msgid="3126834347496917376">"Prechod na plochu"</string>
- <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Potiahnite z dolnej časti obrazovky nahor"</string>
+ <string name="home_gesture_tutorial_subtitle" msgid="7245995490408668778">"Potiahnite z dolnej časti obrazovky nahor."</string>
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"Skvelé!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"Musíte potiahnuť nahor z dolného okraja obrazovky"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"Skúste okno pred uvoľnením podržať dlhšie"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Musite potiahnuť priamo nahor a potom zastať"</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili ste sa používať gestá. Gestá môžete vypnúť v nastaveniach."</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"Musite potiahnuť priamo nahor a potom zastať."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Naučili ste sa používať gestá. Gestá môžete vypnúť v Nastaveniach."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"Dokončili ste gesto na prepnutie aplikácií"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"Prepínanie aplikácií potiahnutím"</string>
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Aplikácie môžete prepínať potiahnutím obrazovky zdola nahor, pridržaním a následným uvoľnením."</string>
<string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Aplikácie prepnete potiahnutím dvoma prstami z dolnej časti obrazovky, ich pridržaním a uvoľnením."</string>
<string name="overview_gesture_tutorial_title" msgid="4125835002668708720">"Prepnutie aplikácií"</string>
- <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Potiahnite nahor z dolného okraja obrazovky, pridržte a uvoľnite"</string>
+ <string name="overview_gesture_tutorial_subtitle" msgid="5253549754058973071">"Potiahnite nahor z dolného okraja obrazovky, pridržte a uvoľnite."</string>
<string name="overview_gesture_tutorial_success" msgid="1910267697807973076">"Výborne"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Hotovo"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"Hotovo"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"Hotovo"</string>
<string name="allset_hint" msgid="459504134589971527">"Potiahnutím nahor prejdete na plochu"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Na plochu prejdete klepnutím na tlačidlo plochy"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> môžete začať používať"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"Môžete <xliff:g id="DEVICE">%1$s</xliff:g> začať používať"</string>
<string name="default_device_name" msgid="6660656727127422487">"zariadenie"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Nastavenia navigácie systémom"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Zdieľať"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Uložiť pár aplikácií"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Obrazovku rozdelíte klepnutím na inú aplikáciu"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Na použitie rozdelenej obrazovky vyberte ďalšiu aplikáciu"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Zrušiť"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Zrušiť"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Ukončite výber rozdelenej obrazovky"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Na použitie rozd. obrazovky vyberte inú aplikáciu"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikácia alebo vaša organizácia túto akciu nepovoľuje"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Panel aplikácií vám ponúka ďalšie možnosti"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Vždy zobrazovať panel aplikácií"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Ak chcete, aby sa panel aplikácií vždy zobrazoval v dolnej časti obrazovky, pridržte rozdeľovač"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Ak chcete vyhľadávať, čo je na obrazovke, pridržte akčný kláves"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Táto služba používa na účely vyhľadávania vybranú časť obrazovky. Uplatňujú sa <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>pravidlá ochrany súkromia<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> a <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>zmluvné podmienky<xliff:g id="END_TOS_LINK"></a></xliff:g> spoločnosti Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zavrieť"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Hotovo"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Plocha"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Rýchle nastavenia"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Panel aplikácií"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Panel aplikácií je zobrazený"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Panel aplik. a bubl. sú vľavo"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Panel aplik. a bubl. sú vpravo"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Panel aplikácií je skrytý"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Panel aplik. a bubl. sú skryté"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigačný panel"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Zobrazovať panel aplikácií"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Zmeniť režim navigácie"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Zobraziť # ďalšiu aplikáciu.}few{Zobraziť # ďalšie aplikácie.}many{Show # more apps.}other{Zobraziť # ďalších aplikácií.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Zobraziť # aplikáciu pre počítač.}few{Zobraziť # aplikácie pre počítač.}many{Show # desktop apps.}other{Zobraziť # aplikácií pre počítač.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> a <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Pridanie aplikácie na plochu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Zrušiť"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bublina"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Rozbaľovacia ponuka"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> z aplikácie <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> a ešte <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Posunúť doľava"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Posunúť doprava"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Zavrieť všetko"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"rozbaliť <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"zbaliť <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml
index da290fc..912ef83 100644
--- a/quickstep/res/values-sl/strings.xml
+++ b/quickstep/res/values-sl/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Pripni"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Prosta oblika"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Namizni računalnik"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Namizni način"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Ni nedavnih elementov"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Nastavitve uporabe aplikacij"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Počisti vse"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Shrani par aplikacij"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Za razdeljeni zaslon se dotaknite še 1 aplikacije"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Izberite drugo aplikacijo za uporabo razdeljenega zaslona."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Prekliči"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Prekliči"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Zapri izbiro razdeljenega zaslona"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Izberite drugo aplikacijo za uporabo razdeljenega zaslona."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ali vaša organizacija ne dovoljuje tega dejanja"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Hitre nastavitve"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Opravilna vrstica"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Opravilna vrstica je prikazana"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Prikazani so opravilna vrstica in oblački na levi"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Prikazani so opravilna vrstica in oblački na desni"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Opravilna vrstica je skrita"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Opravilna vrstica in oblački so skriti"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Vrstica za krmarjenje"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Stalen prikaz oprav. vrstice"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Spreminjanje načina navigacije"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Pokaži še # aplikacijo.}one{Pokaži še # aplikacijo.}two{Pokaži še # aplikaciji.}few{Pokaži še # aplikacije.}other{Pokaži še # aplikacij.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Prikaz # aplikacije za namizni računalnik.}one{Prikaz # aplikacije za namizni računalnik.}two{Prikaz # aplikacij za namizni računalnik.}few{Prikaz # aplikacij za namizni računalnik.}other{Prikaz # aplikacij za namizni računalnik.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> in <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Dodajanje aplikacije na namizje"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Prekliči"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Oblaček"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Oblaček z dodatnimi elementi"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> iz aplikacije <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> in še <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Premik v levo"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Premik v desno"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Opusti vse"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"razširitev oblačka <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"strnitev oblačka <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml
index b11f413..2be5e2b 100644
--- a/quickstep/res/values-sq/strings.xml
+++ b/quickstep/res/values-sq/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Gozhdo"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Formë e lirë"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktopi"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktopi"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Nuk ka asnjë artikull të fundit"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Cilësimet e përdorimit të aplikacionit"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Pastroji të gjitha"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Ruaj çiftin e aplikacioneve"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Trokit një apl. tjetër; përdor ekranin e ndarë"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Zgjidh një aplikacion tjetër për të përdorur ekranin e ndarë"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Anulo"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Anulo"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Dil nga zgjedhja e ekranit të ndarë"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Zgjidh një aplikacion tjetër për të përdorur ekranin e ndarë"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Ky veprim nuk lejohet nga aplikacioni ose organizata jote"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Bëj më shumë me \"Shiritin e detyrave\""</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Shfaq gjithmonë \"Shiritin e detyrave\""</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Prek e mbaj ndarësin dhe shfaq gjithmonë \"Shiritin e detyrave\" në fund të ekranit"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Prek dhe mbaj shtypur tastin e veprimit për të kërkuar për gjërat në ekran"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ky produkt përdor pjesën e zgjedhur të ekranit tënd për të kërkuar. Zbatohen <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Politika e privatësisë<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> dhe <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Kushtet e shërbimit<xliff:g id="END_TOS_LINK"></a></xliff:g> të Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Mbyll"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"U krye"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Faqja kryesore"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Cilësimet shpejt"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Shiriti i detyrave"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Shiriti i detyrave i shfaqur"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Shiriti i detyrave dhe flluskat majtas janë shfaqur"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Shiriti i detyrave dhe flluskat djathtas janë shfaqur"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Shiriti i detyrave i fshehur"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Shiriti i detyrave dhe flluskat janë fshehur"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Shiriti i navigimit"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Shfaq gjithmonë shiritin e detyrave"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Ndrysho modalitetin e navigimit"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Lëviz në krye/majtas"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Lëviz në fund/djathtas"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Shfaq # aplikacion tjetër.}other{Shfaq # aplikacione të tjera.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Shfaq # aplikacion për desktop.}other{Shfaq # aplikacione për desktop.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> dhe <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Shtimi i aplikacionit te desktopi"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Anulo"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Flluska"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Tejkalimi"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"\"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>\" nga <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"\"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>\" dhe <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> të tjera"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Lëviz majtas"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Lëviz djathtas"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Hiqi të gjitha"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"zgjero <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"palos <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml
index 6c70079..88e58f3 100644
--- a/quickstep/res/values-sr/strings.xml
+++ b/quickstep/res/values-sr/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Закачи"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Слободни облик"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Рачунар"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Рачунари"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Нема недавних ставки"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Подешавања коришћења апликације"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Обриши све"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Сачувај пар апликација"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Додирните другу апликацију за подељени екран"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Одаберите другу апликацију да бисте користили подељени екран"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Откажи"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Откажи"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Излазак из бирања подељеног екрана"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Одаберите другу апликацију за подељени екран"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Апликација или организација не дозвољавају ову радњу"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Брза подешавања"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Трака задатака"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Трака задатака је приказана"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Приказ задатака/облачића лево"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Приказ задатака/облачића десно"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Трака задатака је скривена"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Скривени задаци/облачићи"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Трака за навигацију"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Увек приказуј траку задатака"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Промени режим навигације"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Премести горе лево"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Премести доле десно"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Прикажи још # апликацију.}one{Прикажи још # апликацију.}few{Прикажи још # апликације.}other{Прикажи још # апликација.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Прикажи # апликацију за рачунаре.}one{Прикажи # апликацију за рачунаре.}few{Прикажи # апликације за рачунаре.}other{Прикажи # апликација за рачунаре.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> и <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Додаје се апликација на радну поврршину"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Откажи"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Облачић"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Преклопни"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> – <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> и још <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Помери налево"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Помери надесно"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Одбаци све"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"проширите облачић <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"скупите облачић <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml
index 82b0f00..bc58772 100644
--- a/quickstep/res/values-sv/strings.xml
+++ b/quickstep/res/values-sv/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Fäst"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Fritt format"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Dator"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Dator"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Listan är tom"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Inställningar för appanvändning"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Rensa alla"</string>
@@ -95,11 +96,11 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Systemnavigeringsinställningar"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Dela"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Skärmbild"</string>
- <string name="action_split" msgid="2098009717623550676">"Delat"</string>
+ <string name="action_split" msgid="2098009717623550676">"Delad skärm"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Spara app-par"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Tryck på en annan app för att använda delad skärm"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Välj en annan app för att använda delad skärm"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Avbryt"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Avbryt"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Avsluta val av delad skärm"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Välj en annan app för att använda delad skärm"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller organisationen tillåter inte den här åtgärden"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Gör mer med aktivitetsfältet"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Visa alltid aktivitetsfältet"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Tryck länge på avgränsaren för att alltid visa aktivitetsfältet längst ned på skärmen"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Tryck länge på åtgärdstangenten för att söka efter det som finns på skärmen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Den här produkten använder den valda delen av skärmen för att söka. Googles <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>integritetspolicy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> och <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>användarvillkor<xliff:g id="END_TOS_LINK"></a></xliff:g> gäller."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Stäng"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Klar"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Startsida"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Snabbinställn."</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Aktivitetsfält"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Aktivitetsfältet visas"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Vänster fält och bubblor visas"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Höger fält och bubblor visas"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Aktivitetsfältet är dolt"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Fält och bubblor dolda"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigeringsfält"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Visa alltid aktivitetsfältet"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Ändra navigeringsläge"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Flytta högst upp/till vänster"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Flytta längst ned/till höger"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Visa # app till.}other{Visa # appar till.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Visa # datorapp.}other{Visa # datorappar.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> och <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Lägger till appen på skrivbordet"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Avbryt"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubbla"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Fler alternativ"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> från <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> och <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> till"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Flytta åt vänster"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Flytta åt höger"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Stäng alla"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"utöka <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"komprimera <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml
index 5c4a871..f2935b5 100644
--- a/quickstep/res/values-sw/strings.xml
+++ b/quickstep/res/values-sw/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Bandika"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Muundo huru"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Kompyuta ya mezani"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Kompyuta ya Mezani"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Hakuna vipengee vya hivi karibuni"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Mipangilio ya matumizi ya programu"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Ondoa zote"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Hifadhi jozi ya programu"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Gusa programu nyingine ili utumie kipengele cha kugawa skrini"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Chagua programu nyingine ili utumie hali ya kugawa skrini"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Ghairi"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Acha"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Ondoka kwenye hali ya skrini iliyogawanywa"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Chagua programu nyingine ili utumie hali ya kugawa skrini"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Kitendo hiki hakiruhusiwi na programu au shirika lako"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Mipangilio ya Haraka"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Upauzana"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Upauzana umeonyeshwa"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Upauzana na viputo vinaonyeshwa kushoto"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Upauzana na viputo vinaonyeshwa kulia"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Upauzana umefichwa"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Upauzana na viputo vimefichwa"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Sehemu ya viungo muhimu"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Onyesha Zana kila wakati"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Badilisha hali ya usogezaji"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Sogeza juu/kushoto"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Sogeza chini/kulia"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Onyesha programu # zaidi.}other{Onyesha programu # zaidi.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Onyesha programu # ya kompyuta ya mezani.}other{Onyesha programu # za kompyuta ya mezani.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> na <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Kuweka programu kwenye Eneo-kazi"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Ghairi"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Kiputo"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Kiputo cha vipengee vya ziada"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> kutoka <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> na vingine <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Sogeza kushoto"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Sogeza kulia"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Ondoa vyote"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"panua <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"kunja <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-sw600dp/dimens.xml b/quickstep/res/values-sw600dp/dimens.xml
index f9528b3..e24d8fe 100644
--- a/quickstep/res/values-sw600dp/dimens.xml
+++ b/quickstep/res/values-sw600dp/dimens.xml
@@ -45,4 +45,8 @@
<dimen name="allset_page_allset_text_size">38sp</dimen>
<dimen name="allset_page_swipe_up_text_size">15sp</dimen>
+ <!-- Splitscreen -->
+ <!-- Max width of the split instructions view -->
+ <dimen name="split_instructions_view_max_width">300dp</dimen>
+
</resources>
diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml
index 191b89d..28585a4 100644
--- a/quickstep/res/values-ta/strings.xml
+++ b/quickstep/res/values-ta/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"பின் செய்தல்"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"குறிப்பிட்ட வடிவமில்லாத பயன்முறை"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"டெஸ்க்டாப்"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"டெஸ்க்டாப்"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"சமீபத்தியவை எதுவுமில்லை"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ஆப்ஸ் உபயோக அமைப்புகள்"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"எல்லாம் அழி"</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"அருமை!"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"திரையின் கீழ் ஓரத்திலிருந்து மேல்நோக்கி ஸ்வைப் செய்வதை உறுதிசெய்துகொள்ளுங்கள்"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"விடுவிப்பதற்கு முன்பாக நீண்டநேரம் சாளரத்தை அழுத்திப் பிடித்திருங்கள்"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"மேல்நோக்கி நேராக ஸ்வைப் செய்தபிறகு இடைநிறுத்துவதை உறுதிசெய்துகொள்ளுங்கள்"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"மேல்நோக்கி நேராக ஸ்வைப் செய்தபிறகு சற்றுநேரம் அழுத்திபடியே வைத்திருங்கள்"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"சைகைகளை எப்படி உபயோகிப்பது என்று கற்றுக்கொண்டீர்கள். சைகைகளை முடக்க அமைப்புகளுக்குச் செல்லுங்கள்."</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"ஆப்ஸுக்கிடையே மாறும் சைகைப் பயிற்சியை நிறைவுசெய்துவிட்டீர்கள்"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"ஆப்ஸுக்கிடையே மாற ஸ்வைப் செய்யுங்கள்"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"அனைத்தையும் அமைத்துவிட்டீர்கள்!"</string>
<string name="allset_hint" msgid="459504134589971527">"முகப்புக்குச் செல்ல மேல்நோக்கி ஸ்வைப் செய்யுங்கள்"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"முகப்புத் திரைக்குச் செல்வதற்கு முகப்பு பட்டனைத் தட்டவும்"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"உங்கள் <xliff:g id="DEVICE">%1$s</xliff:g> சாதனத்தைப் பயன்படுத்தத் தயாராகிவிட்டீர்கள்"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"உங்கள் <xliff:g id="DEVICE">%1$s</xliff:g> ஐப் பயன்படுத்தத் தயாராகிவிட்டீர்கள்"</string>
<string name="default_device_name" msgid="6660656727127422487">"சாதனம்"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"சிஸ்டம் வழிசெலுத்தல் அமைப்புகள்"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"பகிர்"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ஆப்ஸ் ஜோடியைச் சேமி"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"திரைப் பிரிப்பைப் பயன்படுத்த வேறு ஆப்ஸைத் தட்டவும்"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"திரைப் பிரிப்பைப் பயன்படுத்த வேறு ஆப்ஸைத் தேர்வுசெய்யுங்கள்"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ரத்துசெய்"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ரத்துசெய்"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"திரைப் பிரிப்பு தேர்வில் இருந்து வெளியேறும்"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"திரைப் பிரிப்பை பயன்படுத்த வேறு ஆப்ஸை தேர்வுசெய்க"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ஆப்ஸோ உங்கள் நிறுவனமோ இந்த செயலை அனுமதிப்பதில்லை"</string>
@@ -117,14 +118,12 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"செயல் பட்டி மூலம் மேலும் பலவற்றைச் செய்யுங்கள்"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"செயல் பட்டியை எப்போதும் காட்டுதல்"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"திரையின் கீழ்ப்பகுதியில் செயல் பட்டியை எப்போதும் காட்டுவதற்கு, பிரிப்பானைத் தொட்டுப் பிடித்திருக்கவும்"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"உங்கள் திரையில் உள்ளவற்றைத் தேடுவதற்கு ஆக்ஷன் பட்டனைத் தொட்டுப் பிடியுங்கள்"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"தேடுவதற்கு உங்கள் திரையின் தேர்ந்தெடுக்கப்பட்ட பகுதியை இந்தத் தயாரிப்பு பயன்படுத்துகிறது. Googleளின் <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>தனியுரிமைக் கொள்கையும்<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>சேவை விதிமுறைகளும்<xliff:g id="END_TOS_LINK"></a></xliff:g> பொருந்தும்."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"மூடுக"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"முடிந்தது"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"முகப்பு"</string>
- <string name="taskbar_button_a11y" msgid="5241161324875094465">"அணுகல்தன்மை"</string>
+ <string name="taskbar_button_a11y" msgid="5241161324875094465">"மாற்றுத்திறன் வசதி"</string>
<string name="taskbar_button_back" msgid="8558862226461164514">"பின்செல்லும்"</string>
<string name="taskbar_button_ime_switcher" msgid="1730244360907588541">"IME சுவிட்ச்சர்"</string>
<string name="taskbar_button_recents" msgid="7273376136216613134">"சமீபத்தியவை"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"விரைவு அமைப்புகள்"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"செயல் பட்டி"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"செயல் பட்டி காட்டப்படுகிறது"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"செயல் பட்டி & குமிழை இடதுபுறம் காட்டும்"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"செயல் பட்டி & குமிழை வலதுபுறம் காட்டும்"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"செயல் பட்டி மறைக்கப்பட்டுள்ளது"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"செயல் பட்டி & குமிழை மறைக்கும்"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"வழிசெலுத்தல் பட்டி"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"செயல் பட்டியை எப்போதும் காட்டு"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"வழிசெலுத்தல் பயன்முறையை மாற்று"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"மேலே/இடதுபுறம் நகர்த்தும்"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"கீழே/வலதுபுறம் நகர்த்தும்"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{மேலும் # ஆப்ஸைக் காட்டு.}other{மேலும் # ஆப்ஸைக் காட்டு.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# டெஸ்க்டாப் ஆப்ஸைக் காட்டு.}other{# டெஸ்க்டாப் ஆப்ஸைக் காட்டு.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> மற்றும் <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ஆப்ஸை டெஸ்க்டாப்பில் சேர்க்கிறது"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ரத்துசெய்"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"குமிழ்"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"கூடுதல் விருப்பங்களைக் காட்டும்"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> வழங்கும் <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> மற்றும் <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"இடதுபுறம் நகர்த்தும்"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"வலதுபுறம் நகர்த்தும்"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"அனைத்தையும் மூடும்"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ஐ விரிவாக்கும்"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> ஐச் சுருக்கும்"</string>
</resources>
diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml
index 49d2b9b..6255cfc 100644
--- a/quickstep/res/values-te/strings.xml
+++ b/quickstep/res/values-te/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"పిన్ చేయండి"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"సంప్రదాయేతర"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"డెస్క్టాప్"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"డెస్క్టాప్"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ఇటీవలి ఐటెమ్లు ఏవీ లేవు"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"యాప్ వినియోగ సెట్టింగ్లు"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"అన్నీ తీసివేయండి"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"యాప్ పెయిర్ను సేవ్ చేయండి"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"స్ప్లిట్ స్క్రీన్ కోసం మరొక యాప్ను ట్యాప్ చేయండి"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"స్ప్లిట్ స్క్రీన్ను ఉపయోగించడానికి మరొక యాప్ ఎంచుకోండి"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"రద్దు చేయండి"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"రద్దు చేయండి"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"స్ప్లిట్ స్క్రీన్ ఎంపిక నుండి ఎగ్జిట్ అవ్వండి"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"స్ప్లిట్ స్క్రీన్ ఉపయోగానికి మరొక యాప్ ఎంచుకోండి"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ఈ చర్యను యాప్ గానీ, మీ సంస్థ గానీ అనుమతించవు"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"క్విక్ సెట్టింగ్లు"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"టాస్క్బార్"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"టాస్క్బార్ చూపబడింది"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"టాస్క్బార్, బబుల్స్ ఎడమవైపున చూపబడ్డాయి"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"టాస్క్బార్, బబుల్స్ కుడివైపున చూపబడ్డాయి"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"టాస్క్బార్ దాచబడింది"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"టాస్క్బార్, బబుల్స్ దాచబడినవి"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"నావిగేషన్ బార్"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"టాస్క్బార్ను నిరంతరం చూపండి"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"నావిగేషన్ మోడ్ను మార్చండి"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{మరో # యాప్ను చూడండి.}other{మరో # యాప్లను చూడండి.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# డెస్క్టాప్ యాప్ను చూపండి.}other{# డెస్క్టాప్ యాప్లను చూపండి.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g>, <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"డెస్క్టాప్నకు యాప్ను జోడిస్తోంది"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"రద్దు చేయండి"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"బబుల్"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"ఓవర్ఫ్లో"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> నుండి <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>, మరో <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ఎడమ వైపుగా జరపండి"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"కుడి వైపుగా జరపండి"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"అన్నింటినీ విస్మరించండి"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ను విస్తరించండి"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ను కుదించండి"</string>
</resources>
diff --git a/quickstep/res/values-th/strings.xml b/quickstep/res/values-th/strings.xml
index 72ff989..f47e34d 100644
--- a/quickstep/res/values-th/strings.xml
+++ b/quickstep/res/values-th/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"ปักหมุด"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"รูปแบบอิสระ"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"เดสก์ท็อป"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"เดสก์ท็อป"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"ไม่มีรายการล่าสุด"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"การตั้งค่าการใช้แอป"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ล้างทั้งหมด"</string>
@@ -47,7 +48,7 @@
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"แอปที่คาดว่าจะใช้: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_rotation_prompt_title" msgid="7537946781362766964">"หมุนอุปกรณ์ของคุณ"</string>
<string name="gesture_tutorial_rotation_prompt" msgid="1664493449851960691">"โปรดหมุนอุปกรณ์เพื่อทำตามบทแนะนำการนำทางด้วยท่าทางสัมผัสให้เสร็จสมบูรณ์"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ตรวจสอบว่าปัดจากขอบด้านขวาสุดหรือซ้ายสุด"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="4175100312909721217">"ปัดจากขอบด้านขวาสุดหรือซ้ายสุด"</string>
<string name="back_gesture_feedback_cancelled" msgid="762621530959111290">"ตรวจสอบว่าปัดจากขอบด้านขวาหรือซ้ายไปตรงกลางหน้าจอ แล้วยกนิ้วขึ้น"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"คุณรู้วิธีปัดจากด้านขวาเพื่อย้อนกลับแล้ว ต่อไปดูวิธีสลับแอป"</string>
<string name="back_gesture_feedback_complete_with_follow_up" msgid="8653374779579748392">"คุณทำท่าทางสัมผัสเพื่อย้อนกลับเสร็จแล้ว ต่อไปดูวิธีสลับแอป"</string>
@@ -72,7 +73,7 @@
<string name="home_gesture_tutorial_success" msgid="1736295017642244751">"เก่งมาก"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="6402349235265407385">"ปัดขึ้นจากขอบด้านล่างของหน้าจอ"</string>
<string name="overview_gesture_feedback_home_detected" msgid="663432226180397138">"ลองแตะหน้าต่างค้างไว้นานขึ้นก่อนปล่อยนิ้ว"</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"ตรวจสอบว่าปัดขึ้นในแนวตรง แล้วหยุดชั่วคราว"</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="1191055451018584958">"ปัดขึ้นในแนวตรง แล้วหยุดชั่วคราว"</string>
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"คุณรู้วิธีใช้ท่าทางสัมผัสแล้ว หากต้องการปิดท่าทางสัมผัส ให้ไปที่การตั้งค่า"</string>
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="2903050864432331629">"คุณทำท่าทางสัมผัสเพื่อสลับแอปเสร็จแล้ว"</string>
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"ปัดเพื่อสลับแอป"</string>
@@ -92,14 +93,14 @@
<string name="allset_button_hint" msgid="2395219947744706291">"แตะปุ่มหน้าแรกเพื่อไปที่หน้าจอหลัก"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"คุณเริ่มใช้<xliff:g id="DEVICE">%1$s</xliff:g>ได้แล้ว"</string>
<string name="default_device_name" msgid="6660656727127422487">"อุปกรณ์"</string>
- <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"การตั้งค่าการนำทางของระบบ"</annotation></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>
<string name="action_split" msgid="2098009717623550676">"แยก"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"บันทึกคู่แอป"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"แตะแอปอื่นเพื่อใช้การแยกหน้าจอ"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"เลือกแอปอื่นเพื่อใช้การแยกหน้าจอ"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"ยกเลิก"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"ยกเลิก"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"ออกจากการเลือกโหมดแยกหน้าจอ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"เลือกแอปอื่นเพื่อใช้การแยกหน้าจอ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"แอปหรือองค์กรของคุณไม่อนุญาตการดำเนินการนี้"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"การตั้งค่าด่วน"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"แถบงาน"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"แถบงานแสดงอยู่"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"แถบงานและบับเบิลแสดงไว้ทางซ้าย"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"แถบงานและบับเบิลแสดงไว้ทางขวา"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"แถบงานซ่อนอยู่"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"แถบงานและบับเบิลซ่อนอยู่"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"แถบนำทาง"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"แสดงแถบงานเสมอ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"เปลี่ยนโหมดการนําทาง"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"ย้ายไปที่ด้านบนหรือด้านซ้าย"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"ย้ายไปที่ด้านล่างหรือด้านขวา"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{แสดงเพิ่มเติมอีก # แอป}other{แสดงเพิ่มเติมอีก # แอป}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{แสดงแอปบนเดสก์ท็อป # รายการ}other{แสดงแอปบนเดสก์ท็อป # รายการ}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> และ <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"การเพิ่มแอปไปยังเดสก์ท็อป"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"ยกเลิก"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"บับเบิล"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"การดำเนินการเพิ่มเติม"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> จาก <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> และอีก <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> รายการ"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"ย้ายไปทางซ้าย"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"ย้ายไปทางขวา"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"ปิดทั้งหมด"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"ขยาย <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"ยุบ <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-tl/strings.xml b/quickstep/res/values-tl/strings.xml
index 1cbb70d..582b756 100644
--- a/quickstep/res/values-tl/strings.xml
+++ b/quickstep/res/values-tl/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"I-pin"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Walang kamakailang item"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Mga setting ng paggamit ng app"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"I-clear lahat"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"I-save ang app pair"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Mag-tap ng ibang app para gamitin ang split screen"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Pumili ng ibang app para gamitin ang split screen"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Kanselahin"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Kanselahin"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Lumabas sa pagpili ng split screen"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Pumili ng ibang app para gamitin ang split screen"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Hindi pinapayagan ng app o ng iyong organisasyon ang pagkilos na ito"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Mas maraming magawa gamit ang Taskbar"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Palaging ipakita ang Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Para palaging ipakita ang Taskbar sa ibaba ng iyong screen, pindutin nang matagal ang divider"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Pindutin nang matagal ang action key para hanapin kung ano ang nasa iyong screen"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Ginagamit ng produktong ito ang piniling bahagi ng iyong screen para maghanap. Nalalapat ang <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Patakaran sa Privacy<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> at <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Mga Tuntunin ng Serbisyo<xliff:g id="END_TOS_LINK"></a></xliff:g> ng Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Isara"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Tapos na"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Home"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Quick Settings"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Ipinapakita ang taskbar"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Taskbar at bubble sa kaliwa"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Taskbar at bubble sa kanan"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Nakatago ang taskbar"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Nakatago ang taskbar at bubble"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigation bar"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Ipakita lagi ang Taskbar"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Magpalit ng navigation mode"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Ilipat sa itaas/kaliwa"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Ilipat sa ibaba/kanan"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Magpakita ng # pang app.}one{Magpakita ng # pang app.}other{Magpakita ng # pang app.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Ipakita ang # desktop app.}one{Ipakita ang # desktop app.}other{Ipakita ang # na desktop app.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> at <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Idinaragdag ang app sa Desktop"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Kanselahin"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bubble"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Overflow"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> mula sa <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> at <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> pa"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Ilipat pakaliwa"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Ilipat pakanan"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"I-dismiss lahat"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"i-expand ang <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"i-collapse ang <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml
index 5c7f7e8..9842ebc 100644
--- a/quickstep/res/values-tr/strings.xml
+++ b/quickstep/res/values-tr/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Sabitle"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Serbest çalışma"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Masaüstü"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Masaüstü"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Yeni öğe yok"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Uygulama kullanım ayarları"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Tümünü temizle"</string>
@@ -90,7 +91,7 @@
<string name="allset_title" msgid="5021126669778966707">"İşlem tamam!"</string>
<string name="allset_hint" msgid="459504134589971527">"Ana ekrana gitmek için yukarı kaydırın"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Ana ekranınıza gitmek için ana sayfa düğmesine dokunun"</string>
- <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> cihazınızı kullanmaya hazırsınız"</string>
+ <string name="allset_description_generic" msgid="5385500062202019855">"<xliff:g id="DEVICE">%1$s</xliff:g> adlı cihazınızı kullanmaya hazırsınız"</string>
<string name="default_device_name" msgid="6660656727127422487">"cihaz"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sistem gezinme ayarları"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Paylaş"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Uygulama çiftini kaydet"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Bölünmüş ekran için başka bir uygulamaya dokunun"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Bölünmüş ekran kullanmak için başka bir uygulama seçin"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"İptal"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"İptal"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Bölünmüş ekran seçiminden çıkın"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Bölünmüş ekran kullanmak için başka bir uygulama seçin"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Uygulamanız veya kuruluşunuz bu işleme izin vermiyor"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Görev çubuğuyla daha fazla şey yapın"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Görev çubuğunu sabitleyin"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Ayırıcıya dokunup basılı tuttuğunuzda görev çubuğu ekranın alt kısmına sabitlenir"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Ekranınızda bulunan içerikleri aramak için eylem tuşuna dokunup basılı tutun"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Bu ürün, ekranınızın seçilen bölümünü kullanarak arama yapar. Google\'ın <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Gizlilik Politikası<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> ve <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Hizmet Şartları<xliff:g id="END_TOS_LINK"></a></xliff:g> geçerlidir."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Kapat"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Bitti"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Ana ekran"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Hızlı Ayarlar"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Görev çubuğu."</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Görev çubuğu gösteriliyor"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Görev çubuğu ve baloncuklar solda gösteriliyor"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Görev çubuğu ve baloncuklar sağda gösteriliyor"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Görev çubuğu gizlendi"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Görev çubuğu ve baloncuklar gizli"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Gezinme çubuğu"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Görev çubuğunu daima göster"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Gezinme modunu değiştir"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Sol üste taşı"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Sağ alta taşı"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# uygulama daha göster.}other{# uygulama daha göster}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# masaüstü uygulamasını göster.}other{# masaüstü uygulamasını göster.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> ve <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Uygulama Masaüstü\'ne ekleniyor"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"İptal"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Balon"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Taşma"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> uygulamasından <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> ve <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> tane daha"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Sola taşı"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Sağa taşı"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Tümünü kapat"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"genişlet: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"daralt: <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml
index 2c89609..20564c3 100644
--- a/quickstep/res/values-uk/strings.xml
+++ b/quickstep/res/values-uk/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"Закріпити"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Довільна форма"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"Комп’ютер"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"Робочий стіл"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Комп’ютер"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Немає нещодавніх додатків"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Налаштування використання додатка"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Очистити все"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Зберегти пару"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Щоб розділити екран, виберіть ще один додаток."</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Щоб розділити екран, виберіть ще один додаток."</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Скасувати"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Скасувати"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Вийти з режиму розділення екрана"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Щоб розділити екран, виберіть ще один додаток."</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Ця дія заборонена додатком або адміністратором організації"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Більше можливостей завдяки панелі завдань"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Завжди показувати панель завдань"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Щоб завжди показувати панель завдань унизу екрана, натисніть і втримуйте роздільник"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Для пошуку інформації, що відображається на екрані, натисніть і втримуйте клавішу дії"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Цей продукт використовує для пошуку вибрану частину екрана. Застосовуються <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Політика конфіденційності<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> та <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Загальні положення й умови<xliff:g id="END_TOS_LINK"></a></xliff:g> Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрити"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Головний екран"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Швидкі налаштув."</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Панель завдань"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Панель завдань показано"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Панель завдань і чати – зліва"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Панель завдань і чати – справа"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Панель завдань приховано"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Панель і чати приховано"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Панель навігації"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Завжди показув. панель завдань"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Змінити режим навігації"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Перемістити вгору або вліво"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Перемістити вниз або вправо"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Показати ще # додаток.}one{Показати ще # додаток.}few{Показати ще # додатки.}many{Показати ще # додатків.}other{Показати ще # додатка.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Показати # комп’ютерну програму.}one{Показати # комп’ютерну програму.}few{Показати # комп’ютерні програми.}many{Показати # комп’ютерних програм.}other{Показати # комп’ютерної програми.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> та <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Встановлення додатка на комп’ютер"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Скасувати"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Повідомлення"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Додаткове повідомлення"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> з додатка <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> і ще <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Перемістити вліво"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Перемістити вправо"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Закрити все"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"розгорнути \"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>\""</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"згорнути \"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>\""</string>
</resources>
diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml
index 16b1370..7c3a41f 100644
--- a/quickstep/res/values-ur/strings.xml
+++ b/quickstep/res/values-ur/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"پن کریں"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"فری فارم"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"ڈیسک ٹاپ"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"ڈیسک ٹاپ"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"کوئی حالیہ آئٹم نہیں"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ایپ کے استعمال کی ترتیبات"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"سبھی کو صاف کریں"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"ایپس کے جوڑے کو محفوظ کریں"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"اسپلٹ اسکرین کا استعمال کرنے کیلئے دوسری ایپ پر تھپتھپائیں"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"اسپلٹ اسکرین کے استعمال کیلئے دوسری ایپ منتخب کریں"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"منسوخ کریں"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"منسوخ کریں"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"اسپلٹ اسکرین کے انتخاب سے باہر نکلیں"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"اسپلٹ اسکرین کے استعمال کیلئے دوسری ایپ منتخب کریں"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ایپ یا آپ کی تنظیم کی جانب سے اس کارروائی کی اجازت نہیں ہے"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"ٹاسک بار سے بہت کچھ کریں"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"ہمیشہ ٹاسک بار دکھائیں"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"ٹاسک بار کو ہمیشہ اپنی اسکرین کے نیچے دکھانے کے لیے، ڈیوائیڈر کو ٹچ کریں اور دبائے رکھیں"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"آپ کی اسکرین پر جو کچھ ہے اسے تلاش کرنے کے لیے ایکشن کلید کو ٹچ کریں اور دبائے رکھیں"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"یہ پروڈکٹ تلاش کرنے کے لیے آپ کی اسکرین کا منتخب حصہ استعمال کرتا ہے۔ Google کی <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>رازداری کی پالیسی<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> اور <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>سروس کی شرائط<xliff:g id="END_TOS_LINK"></a></xliff:g> لاگو ہوتی ہیں۔"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"بند کریں"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"ہو گیا"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"ہوم"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"فوری ترتیبات"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"ٹاسک بار"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"ٹاشک بار دکھایا گیا"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ٹاسک بار و بلبلے بائیں طرف ہیں"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ٹاسک بار و بلبلے دائیں طرف ہیں"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"ٹاسک بار چھپایا گیا"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ٹاسک بار اور بلبلے پوشیدہ ہیں"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"نیویگیشن بار"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"ہمیشہ ٹاسک بار دکھائیں"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"نیویگیشن موڈ تبدیل کریں"</string>
@@ -142,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{# مزید ایپ دکھائیں۔}other{# مزید ایپس دکھائیں۔}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ڈیسک ٹاپ ایپ دکھائیں۔}other{# ڈیسک ٹاپ ایپس دکھائیں۔}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> اور <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"ڈیسک ٹاپ پر ایپ شامل کرنا"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"منسوخ کریں"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"ببل"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"اوورفلو"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> سے <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> اور <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> مزید"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"بائیں منتقل کریں"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"دائیں منتقل کریں"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"سبھی کو برخاست کریں"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> کو پھیلائیں"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g> کو سکیڑیں"</string>
</resources>
diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml
index 0f1d17a..ac02413 100644
--- a/quickstep/res/values-uz/strings.xml
+++ b/quickstep/res/values-uz/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Qadash"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Erkin shakl"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Desktop"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Desktop"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Yaqinda ishlatilgan ilovalar yo‘q"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Ilovadan foydalanish sozlamalari"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Hammasini tozalash"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Ilova juftini saqlash"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Ekranni ikkiga ajratish uchun boshqa ilovani bosing"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Ekranni ikkiga ajratish uchun boshqa ilovani tanlang"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Bekor qilish"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Bekor qilish"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Ekranni ikkiga ajratish tanlovidan chiqish"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Ekranni ikkiga ajratish uchun boshqa ilovani tanlang"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Bu amal ilova yoki tashkilotingiz tomonidan taqiqlangan"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Tezkor sozlamalar"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Vazifalar paneli"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Vazifalar paneli ochiq"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Panel va bulutchalar chapda"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Panel va bulutchalar oʻngda"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Vazifalar paneli yopiq"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Panel va bulutchalar berk"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Navigatsiya paneli"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Vazifalar paneli doim chiqarilsin"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Navigatsiya rejimini oʻzgartirish"</string>
@@ -138,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Yuqoriga yoki chapga oʻtkazish"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Pastga yoki oʻngga oʻtkazish"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Yana # ta ilovani chiqarish}other{Yana # ta ilovani chiqarish}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{# ta desktop ilovani chiqarish.}other{# ta desktop ilovani chiqarish.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> va <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Ilova kompyuterga qoʻshilmoqda"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Bekor qilish"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Pufak"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Kengaytirish"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> (<xliff:g id="APP_NAME">%2$s</xliff:g>)"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> va yana <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> kishi"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Chapga siljitish"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Oʻngga siljitish"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Hammasini yopish"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ni yoyish"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>ni yigʻish"</string>
</resources>
diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml
index acc2011..4c11957 100644
--- a/quickstep/res/values-vi/strings.xml
+++ b/quickstep/res/values-vi/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Ghim"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Dạng tự do"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Máy tính"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Máy tính"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Không có mục gần đây nào"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Cài đặt mức sử dụng ứng dụng"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Xóa tất cả"</string>
@@ -92,14 +93,14 @@
<string name="allset_button_hint" msgid="2395219947744706291">"Nhấn vào nút màn hình chính để chuyển đến màn hình chính"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"Bạn có thể bắt đầu sử dụng <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
<string name="default_device_name" msgid="6660656727127422487">"thiết bị"</string>
- <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Chế độ cài đặt di chuyển trên hệ thống"</annotation></string>
+ <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Cài đặt cách thao tác trên hệ thống"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Chia sẻ"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Chụp ảnh màn hình"</string>
<string name="action_split" msgid="2098009717623550676">"Chia đôi màn hình"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"Lưu cặp ứng dụng"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Nhấn vào ứng dụng khác để chia đôi màn hình"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Chọn một ứng dụng khác để dùng chế độ chia đôi màn hình"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Huỷ"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Huỷ"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Thoát khỏi lựa chọn chia đôi màn hình"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Chọn một ứng dụng khác để dùng chế độ chia đôi màn hình"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Ứng dụng hoặc tổ chức của bạn không cho phép thực hiện hành động này"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"Làm nhiều việc hơn qua Thanh tác vụ"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"Luôn hiện Taskbar"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"Để luôn hiện Taskbar ở cuối màn hình, hãy nhấn và giữ đường phân chia"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"Chạm và giữ phím hành động để tìm nội dung trên màn hình của bạn"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"Sản phẩm này dùng phần được chọn trên màn hình để tìm kiếm. Có áp dụng <xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>Chính sách quyền riêng tư<xliff:g id="END_PRIVACY_LINK"></a></xliff:g> và <xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>Điều khoản dịch vụ<xliff:g id="END_TOS_LINK"></a></xliff:g> của Google."</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Đóng"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Xong"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Màn hình chính"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Cài đặt nhanh"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"Thanh tác vụ"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Đã hiện thanh thao tác"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"Hiện thanh tác vụ, b.bóng trái"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"Hiện thanh tác vụ, b.bóng phải"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Đã ẩn thanh thao tác"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"Đã ẩn thanh tác vụ & bong bóng"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Thanh điều hướng"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Luôn hiện Thanh tác vụ"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Thay đổi chế độ điều hướng"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Chuyển lên trên cùng/sang bên trái"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Chuyển xuống dưới cùng/sang bên phải"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Hiện thêm # ứng dụng.}other{Hiện thêm # ứng dụng.}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Hiện # ứng dụng dành cho máy tính.}other{Hiện # ứng dụng dành cho máy tính.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g> và <xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Đang thêm ứng dụng vào máy tính"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Huỷ"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Bong bóng"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Bong bóng bổ sung"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> từ <xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> và <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> bong bóng khác"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Di chuyển sang trái"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Di chuyển sang phải"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Đóng tất cả"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"mở rộng <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"thu gọn <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml
index ea721ac..bdc99df 100644
--- a/quickstep/res/values-zh-rCN/strings.xml
+++ b/quickstep/res/values-zh-rCN/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"固定"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"自由窗口"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"桌面设备"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"桌面"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"桌面设备"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"近期没有任何内容"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"应用使用设置"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"全部清除"</string>
@@ -95,11 +96,11 @@
<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>
- <string name="action_split" msgid="2098009717623550676">"拆分"</string>
+ <string name="action_split" msgid="2098009717623550676">"分屏"</string>
<string name="action_save_app_pair" msgid="5974823919237645229">"保存应用组合"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"点按另一个应用即可使用分屏"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"另外选择一个应用才可使用分屏模式"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"取消"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"取消"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"退出分屏选择模式"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"另外选择一个应用才可使用分屏模式"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"该应用或您所在的单位不允许执行此操作"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"体验任务栏的更多功能"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"始终显示任务栏"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"若要始终在屏幕底部显示任务栏,请轻触并按住分隔线"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"轻触并按住操作键,即可根据屏幕上的内容进行搜索"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"此产品会根据屏幕上的所选内容进行搜索。Google 的<xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>《隐私权政策》<xliff:g id="END_PRIVACY_LINK"></a></xliff:g>和<xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>《服务条款》<xliff:g id="END_TOS_LINK"></a></xliff:g>适用。"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"关闭"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"主屏幕"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"快捷设置"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"任务栏"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"任务栏已显示"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"已显示任务栏和左侧消息气泡"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"已显示任务栏和右侧消息气泡"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"任务栏已隐藏"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"已隐藏任务栏和消息气泡"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"导航栏"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"始终显示任务栏"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"更改导航模式"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"移到顶部/左侧"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"移到底部/右侧"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{显示另外 # 个应用。}other{显示另外 # 个应用。}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{显示 # 款桌面应用。}other{显示 # 款桌面应用。}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"<xliff:g id="APP_NAME_1">%1$s</xliff:g>和<xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"将应用添加到桌面"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"取消"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"气泡框"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"溢出式气泡框"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"来自“<xliff:g id="APP_NAME">%2$s</xliff:g>”的<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>以及另外 <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> 个"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"左移"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"右移"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"全部关闭"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"展开“<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>”"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"收起“<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>”"</string>
</resources>
diff --git a/quickstep/res/values-zh-rHK/strings.xml b/quickstep/res/values-zh-rHK/strings.xml
index e4be958..abdb91c 100644
--- a/quickstep/res/values-zh-rHK/strings.xml
+++ b/quickstep/res/values-zh-rHK/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"固定"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"自由形式"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"桌面"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"桌面"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"最近沒有任何項目"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"應用程式使用情況設定"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"全部清除"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"儲存應用程式組合"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"輕按其他應用程式以使用分割螢幕"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"選擇其他應用程式才能使用分割螢幕"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"取消"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"取消"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"退出分割螢幕選取頁面"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"選擇其他應用程式才能使用分割螢幕"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"應用程式或你的機構不允許此操作"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"工作列助你事半功倍"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"一律顯示工作列"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"如要持續在畫面底部顯示工作列,請按住分隔線"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"按住快捷操作鍵即可搜尋畫面上的內容"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"此產品使用螢幕的特定部分進行搜尋。須受 Google 的《<xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>私隱權政策<xliff:g id="END_PRIVACY_LINK"></a></xliff:g>》和《<xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>服務條款<xliff:g id="END_TOS_LINK"></a></xliff:g>》約束。"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"關閉"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"住宅"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"快速設定"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"工作列"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"顯示咗工作列"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"工作列和對話氣泡在左邊顯示"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"工作列和對話氣泡在右邊顯示"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"隱藏咗工作列"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"工作列和對話氣泡已隱藏"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"導覽列"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"一律顯示工作列"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"變更導覽模式"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"移至上方/左側"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"移至底部/右側"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{顯示另外 # 個應用程式。}other{顯示另外 # 個應用程式。}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{顯示 # 個桌面應用程式。}other{顯示 # 個桌面應用程式。}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"「<xliff:g id="APP_NAME_1">%1$s</xliff:g>」和「<xliff:g id="APP_NAME_2">%2$s</xliff:g>」"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"正在新增應用程式至桌面"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"取消"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"對話氣泡"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"展開式"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="APP_NAME">%2$s</xliff:g> 的「<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>」通知"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>和其他 <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> 則通知"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"向左移"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"向右移"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"全部關閉"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"打開<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"收埋<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values-zh-rTW/strings.xml b/quickstep/res/values-zh-rTW/strings.xml
index b2784b7..91da74e 100644
--- a/quickstep/res/values-zh-rTW/strings.xml
+++ b/quickstep/res/values-zh-rTW/strings.xml
@@ -21,7 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"固定"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"自由形式"</string>
- <string name="recent_task_option_desktop" msgid="8280879717125435668">"電腦"</string>
+ <string name="recent_task_option_desktop" msgid="8280879717125435668">"桌面"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"電腦"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"最近沒有任何項目"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"應用程式使用情況設定"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"全部清除"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"儲存應用程式配對"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"輕觸另一個應用程式即可使用分割畫面"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"選擇要在分割畫面中使用的另一個應用程式"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"取消"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"取消"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"退出分割畫面選擇器"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"必須選擇另一個應用程式才能使用分割畫面"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"這個應用程式或貴機構不允許執行這個動作"</string>
@@ -117,10 +118,8 @@
<string name="taskbar_edu_features" msgid="3320337287472848162">"充分發揮工作列的功用"</string>
<string name="taskbar_edu_pinning_title" msgid="210102174154211712">"一律顯示工作列"</string>
<string name="taskbar_edu_pinning_standalone" msgid="2636919474366410467">"如要一律在畫面底部顯示工作列,請按住分隔線"</string>
- <!-- no translation found for taskbar_search_edu_title (5569194922234364530) -->
- <skip />
- <!-- no translation found for taskbar_edu_search_disclosure (8734536088447779686) -->
- <skip />
+ <string name="taskbar_search_edu_title" msgid="5569194922234364530">"按住快捷操作鍵即可搜尋畫面上的內容"</string>
+ <string name="taskbar_edu_search_disclosure" msgid="8734536088447779686">"這項產品會搜尋你在畫面上選取的內容 (適用 Google 的《<xliff:g id="BEGIN_PRIVACY_LINK"><a href="%1$s"></xliff:g>隱私權政策<xliff:g id="END_PRIVACY_LINK"></a></xliff:g>》和《<xliff:g id="BEGIN_TOS_LINK"><a href="%2$s"></xliff:g>服務條款<xliff:g id="END_TOS_LINK"></a></xliff:g>》)。"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"關閉"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"主畫面"</string>
@@ -132,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"快速設定"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"工作列"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"已顯示工作列"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"工作列和對話框顯示在左側"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"工作列和對話框顯示在右側"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"已隱藏工作列"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"已隱藏工作列和對話框"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"導覽列"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"一律顯示工作列"</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"變更操作模式"</string>
@@ -140,9 +142,15 @@
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"移到上方/左側"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"移到底部/右側"</string>
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{再多顯示 # 個應用程式。}other{再多顯示 # 個應用程式。}}"</string>
- <!-- no translation found for quick_switch_desktop (4834587349322698616) -->
- <skip />
+ <string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{顯示 # 個電腦版應用程式。}other{顯示 # 個電腦版應用程式。}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"「<xliff:g id="APP_NAME_1">%1$s</xliff:g>」和「<xliff:g id="APP_NAME_2">%2$s</xliff:g>」"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"新增應用程式至桌面"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"取消"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"泡泡"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"溢位"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"「<xliff:g id="APP_NAME">%2$s</xliff:g>」的「<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>」通知"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g>和另外 <xliff:g id="BUBBLE_COUNT">%2$d</xliff:g> 則通知"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"向左移"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"向右移"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"全部關閉"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"展開「<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>」"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"收合「<xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>」"</string>
</resources>
diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml
index 9028210..718400d 100644
--- a/quickstep/res/values-zu/strings.xml
+++ b/quickstep/res/values-zu/strings.xml
@@ -22,6 +22,7 @@
<string name="recent_task_option_pin" msgid="7929860679018978258">"Phina"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"I-Freeform"</string>
<string name="recent_task_option_desktop" msgid="8280879717125435668">"Ideskithophu"</string>
+ <string name="recent_task_desktop" msgid="8081113562549637334">"Ideskithophu"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Azikho izinto zakamuva"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Izilungiselelo zokusetshenziswa kohlelo lokusebenza"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"Sula konke"</string>
@@ -99,7 +100,7 @@
<string name="action_save_app_pair" msgid="5974823919237645229">"Londoloza ukubhangqa i-app"</string>
<string name="toast_split_select_app" msgid="8464310533320556058">"Thepha enye i-app ukuze usebenzise isikrini sokuhlukanisa"</string>
<string name="toast_contextual_split_select_app" msgid="433510957123687090">"Khetha enye i-app ukuze usebenzise ukuhlukanisa isikrini"</string>
- <string name="toast_split_select_app_cancel" msgid="1532690483356445639"><b>"Khansela"</b></string>
+ <string name="toast_split_select_app_cancel" msgid="1939025102486630426">"Khansela"</string>
<string name="toast_split_select_cont_desc" msgid="2119685056059607602">"Phuma ekukhetheni ukuhlukaniswa kwesikrini"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Khetha enye i-app ukuze usebenzise ukuhlukanisa isikrini"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Lesi senzo asivunyelwanga uhlelo lokusebenza noma inhlangano yakho"</string>
@@ -130,7 +131,10 @@
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Amasethingi Asheshayo"</string>
<string name="taskbar_a11y_title" msgid="6432169809852243110">"I-Taskbar"</string>
<string name="taskbar_a11y_shown_title" msgid="6842833581088937713">"Ibha yomsebenzi ibonisiwe"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_left_title" msgid="4242431789851790046">"ITaskbar namabhamuza aboniswe kwesokunxele"</string>
+ <string name="taskbar_a11y_shown_with_bubbles_right_title" msgid="8219065376188180113">"ITaskbar namabhamuza aboniswe kwesokudla"</string>
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Ibha yomsebenzi ifihliwe"</string>
+ <string name="taskbar_a11y_hidden_with_bubbles_title" msgid="7397395993149508087">"ITaskbar namabhamuza afihliwe"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Ibha yokufuna"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Bonisa i-Taskbar njalo."</string>
<string name="change_navigation_mode" msgid="9088393078736808968">"Shintsha imodi yokufuna"</string>
@@ -140,6 +144,13 @@
<string name="quick_switch_overflow" msgid="6935266023013283353">"{count,plural, =1{Bonisa i-app e-# ngaphezulu.}one{Bonisa ama-app angu-# ngaphezulu.}other{Bonisa ama-app angu-# ngaphezulu.}}"</string>
<string name="quick_switch_desktop" msgid="4834587349322698616">"{count,plural, =1{Bonisa i-app engu-# yedeskithophu.}one{Bonisa ama-app angu-# wedeskithophu.}other{Bonisa ama-app angu-# wedeskithophu.}}"</string>
<string name="quick_switch_split_task" msgid="5598194724255333896">"I-<xliff:g id="APP_NAME_1">%1$s</xliff:g> ne-<xliff:g id="APP_NAME_2">%2$s</xliff:g>"</string>
- <string name="desktop_select_app_toast" msgid="2306057322833956910">"Yengeza i-app ku-Deskithophu"</string>
- <string name="desktop_button_close_app_toast" msgid="5283096349579408560">"Khansela"</string>
+ <string name="bubble_bar_bubble_fallback_description" msgid="7811684548953452009">"Ibhamuza"</string>
+ <string name="bubble_bar_overflow_description" msgid="8617628132733151708">"Ukugcwala kakhulu"</string>
+ <string name="bubble_bar_bubble_description" msgid="1882466152448446446">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> kusuka ku-<xliff:g id="APP_NAME">%2$s</xliff:g>"</string>
+ <string name="bubble_bar_description_multiple_bubbles" msgid="3922207715357143648">"<xliff:g id="BUBBLE_BAR_BUBBLE_DESCRIPTION">%1$s</xliff:g> nokunye okungu-<xliff:g id="BUBBLE_COUNT">%2$d</xliff:g>"</string>
+ <string name="bubble_bar_action_move_left" msgid="3306922475737714758">"Iya kwesokunxele"</string>
+ <string name="bubble_bar_action_move_right" msgid="3455099638571411251">"Iya kwesokudla"</string>
+ <string name="bubble_bar_action_dismiss_all" msgid="3290722022983403060">"Chitha konke"</string>
+ <string name="bubble_bar_accessibility_announce_expand" msgid="1503192695527477102">"nweba <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
+ <string name="bubble_bar_accessibility_announce_collapse" msgid="928284600086798791">"goqa <xliff:g id="BUBBLE_DESCRIPTION">%1$s</xliff:g>"</string>
</resources>
diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml
index 14a916f..0bb971e 100644
--- a/quickstep/res/values/colors.xml
+++ b/quickstep/res/values/colors.xml
@@ -76,7 +76,7 @@
<color name="mock_webpage_top_bar_item">#80868b</color>
<color name="mock_webpage_page_text">#bdc1c6</color>
- <color name="all_set_page_background">#FFFFFFFF</color>
+ <color name="all_set_page_background">@android:color/system_neutral1_50</color>
<!-- Recents overview -->
<color name="recents_filter_icon">#333333</color>
@@ -95,6 +95,6 @@
<!-- Turn on work apps button -->
<color name="work_turn_on_stroke">?androidprv:attr/colorAccentPrimaryVariant</color>
- <color name="work_fab_bg_color">?androidprv:attr/materialColorPrimaryFixedDim</color>
- <color name="work_fab_icon_color">?androidprv:attr/materialColorOnPrimaryFixed</color>
+ <color name="work_fab_bg_color">?attr/materialColorPrimaryFixedDim</color>
+ <color name="work_fab_icon_color">?attr/materialColorOnPrimaryFixed</color>
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml
index b3502db..e8cb5d5 100644
--- a/quickstep/res/values/config.xml
+++ b/quickstep/res/values/config.xml
@@ -17,8 +17,7 @@
<string name="overscroll_plugin_factory_class" translatable="false" />
<string name="task_overlay_factory_class" translatable="false"/>
- <!-- Activities which block home gesture -->
- <string-array name="gesture_blocking_activities" translatable="false">
+ <string-array name="back_gesture_blocking_activities" translatable="false">
<item>com.android.launcher3/com.android.quickstep.interaction.GestureSandboxActivity</item>
</string-array>
@@ -36,7 +35,7 @@
<string name="launcher_restore_event_logger_class" translatable="false">com.android.quickstep.LauncherRestoreEventLoggerImpl</string>
<string name="plugin_manager_wrapper_class" translatable="false">com.android.launcher3.uioverrides.plugins.PluginManagerWrapperImpl</string>
<string name="taskbar_edu_tooltip_controller_class" translatable="false">com.android.launcher3.taskbar.TaskbarEduTooltipController</string>
-
+ <string name="contextual_edu_manager_class" translatable="false">com.android.quickstep.contextualeducation.SystemContextualEduStatsManager</string>
<string name="nav_handle_long_press_handler_class" translatable="false"></string>
<string name="assist_utils_class" translatable="false"></string>
<string name="assist_state_manager_class" translatable="false"></string>
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index b862d7c..d981882 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -41,6 +41,8 @@
<dimen name="task_thumbnail_icon_size">48dp</dimen>
<!-- The icon size for the focused task, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The splash icon size on in Overview when a task is settled in the list -->
+ <dimen name="task_thumbnail_splash_icon_size">52dp</dimen>
<!-- The border width shown when task is hovered -->
<dimen name="task_hover_border_width">4dp</dimen>
<!-- The space under the focused task icon -->
@@ -177,6 +179,8 @@
<dimen name="gesture_tutorial_menu_done_button_top_spacing">0dp</dimen>
<dimen name="gesture_tutorial_menu_back_shape_bottom_margin">0dp</dimen>
<dimen name="gesture_tutorial_menu_done_button_spacing">72dp</dimen>
+ <dimen name="gesture_tutorial_done_button_bottom_margin">40dp</dimen>
+ <dimen name="gesture_tutorial_done_button_end_margin">24dp</dimen>
<!-- Gesture Tutorial mock conversations -->
<dimen name="gesture_tutorial_message_icon_size">44dp</dimen>
@@ -356,18 +360,23 @@
<dimen name="taskbar_running_app_indicator_height">4dp</dimen>
<dimen name="taskbar_running_app_indicator_width">14dp</dimen>
<dimen name="taskbar_running_app_indicator_top_margin">2dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_height">2dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_width">12dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_top_margin">2dp</dimen>
<!-- Transient taskbar -->
<dimen name="transient_taskbar_padding">12dp</dimen>
<dimen name="transient_taskbar_min_width">150dp</dimen>
<dimen name="transient_taskbar_bottom_margin">24dp</dimen>
<dimen name="transient_taskbar_shadow_blur">40dp</dimen>
+ <dimen name="transient_taskbar_stroke_width">1dp</dimen>
<dimen name="transient_taskbar_key_shadow_distance">10dp</dimen>
<dimen name="transient_taskbar_stashed_height">32dp</dimen>
<dimen name="transient_taskbar_all_apps_button_translation_x_offset">8dp</dimen>
<dimen name="transient_taskbar_stash_spring_velocity_dp_per_s">400dp</dimen>
<dimen name="taskbar_tooltip_vertical_padding">8dp</dimen>
<dimen name="taskbar_tooltip_horizontal_padding">16dp</dimen>
+ <dimen name="taskbar_tooltip_y_offset">4dp</dimen>
<!-- An additional touch slop to prevent x-axis movement during the swipe up to show taskbar -->
<dimen name="transient_taskbar_clamped_offset_bound">16dp</dimen>
@@ -379,6 +388,11 @@
<!-- Taskbar swipe down threshold -->
<dimen name="taskbar_to_nav_threshold">24dp</dimen>
+ <!-- Taskbar variables that help determine when to animate the Taskbar background -->
+ <!-- Velocity defined as dp per s. Negative because the gesture is an upwards motion. -->
+ <dimen name="taskbar_slow_velocity_y_threshold">-288dp</dimen>
+ <integer name="taskbar_background_duration">80</integer>
+
<!-- Taskbar swipe up threshold multipliers -->
<item name="taskbar_nav_threshold_mult" format="float" type="dimen">4.5</item>
<item name="taskbar_app_window_threshold_mult" format="float" type="dimen">10</item>
@@ -434,14 +448,17 @@
<dimen name="bubblebar_elevation">1dp</dimen>
<dimen name="bubblebar_drag_elevation">2dp</dimen>
<dimen name="bubblebar_hotseat_adjustment_threshold">90dp</dimen>
+ <dimen name="bubblebar_bounce_distance">20dp</dimen>
<dimen name="bubblebar_icon_size_small">32dp</dimen>
<dimen name="bubblebar_icon_size">36dp</dimen>
+ <dimen name="bubblebar_icon_size_persistent_taskbar">28dp</dimen>
<dimen name="bubblebar_badge_size">24dp</dimen>
<dimen name="bubblebar_icon_overlap">12dp</dimen>
<dimen name="bubblebar_overflow_inset">16dp</dimen>
<dimen name="bubblebar_icon_spacing">6dp</dimen>
<dimen name="bubblebar_icon_spacing_large">8dp</dimen>
+ <dimen name="bubblebar_icon_spacing_persistent_taskbar">@dimen/bubblebar_icon_spacing</dimen>
<dimen name="bubblebar_expanded_icon_spacing">12dp</dimen>
<dimen name="bubblebar_icon_elevation">1dp</dimen>
@@ -456,6 +473,11 @@
<!-- Bubble bar drop target -->
<dimen name="bubblebar_drop_target_corner_radius">36dp</dimen>
+ <dimen name="bubble_expanded_view_drop_target_default_width">412dp</dimen>
+ <dimen name="bubble_expanded_view_drop_target_default_height">600dp</dimen>
+ <dimen name="bubble_expanded_view_drop_target_corner_radius">28dp</dimen>
+ <dimen name="bubble_expanded_view_drop_target_padding">24dp</dimen>
+ <dimen name="bubble_expanded_view_drop_target_margin">16dp</dimen>
<!-- Launcher splash screen -->
<!-- Note: keep this value in sync with the WindowManager/Shell dimens.xml -->
@@ -477,11 +499,11 @@
<dimen name="keyboard_quick_switch_no_recent_items_icon_size">24dp</dimen>
<dimen name="keyboard_quick_switch_no_recent_items_icon_margin">8dp</dimen>
- <!-- Desktop mode -->
- <dimen name="desktop_mode_floating_app_select_height">56dp</dimen>
- <dimen name="desktop_mode_floating_app_select_elevation">4dp</dimen>
- <dimen name="desktop_mode_floating_app_select_margin">16dp</dimen>
- <dimen name="desktop_mode_floating_app_select_text_size">14sp</dimen>
- <dimen name="desktop_mode_floating_app_select_text_margin">8dp</dimen>
+ <!-- Digital Wellbeing -->
+ <dimen name="digital_wellbeing_toast_height">48dp</dimen>
+
+ <!-- Splitscreen -->
+ <!-- Max width of the split instructions view -->
+ <dimen name="split_instructions_view_max_width">220dp</dimen>
</resources>
diff --git a/quickstep/res/drawable/bg_circle.xml b/quickstep/res/values/ids.xml
similarity index 68%
rename from quickstep/res/drawable/bg_circle.xml
rename to quickstep/res/values/ids.xml
index 506177b..3091d9e 100644
--- a/quickstep/res/drawable/bg_circle.xml
+++ b/quickstep/res/values/ids.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2020 The Android Open Source Project
+ Copyright (C) 2024 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <solid android:color="#FFFFFFFF" />
-</shape>
\ No newline at end of file
+<resources>
+ <!-- Used for A11y actions for bubble bar -->
+ <item type="id" name="action_move_left" />
+ <item type="id" name="action_move_right" />
+ <item type="id" name="action_dismiss_all" />
+</resources>
\ No newline at end of file
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 278c66a..d0f474f 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -26,9 +26,12 @@
<string name="recent_task_option_pin">Pin</string>
<!-- Title for an option to enter freeform mode for a given app -->
<string name="recent_task_option_freeform">Freeform</string>
- <!-- Title for an option to enter desktop windowing mode for a given app -->
+ <!-- Title and content description for an option to enter desktop windowing mode for a given app -->
<string name="recent_task_option_desktop">Desktop</string>
+ <!-- Title and content description for Desktop tile in Recents screen that contains apps opened inside desktop windowing mode [CHAR LIMIT=NONE] -->
+ <string name="recent_task_desktop">Desktop</string>
+
<!-- Recents: The empty recents string. [CHAR LIMIT=NONE] -->
<string name="recents_empty_message">No recent items</string>
@@ -237,7 +240,7 @@
<!-- Label for toast with instructions for split screen selection mode. [CHAR_LIMIT=50] -->
<string name="toast_split_select_app">Tap another app to use split screen</string>
<string name="toast_contextual_split_select_app">Choose another app to use split screen</string>
- <string name="toast_split_select_app_cancel"><b>Cancel</b></string>
+ <string name="toast_split_select_app_cancel">Cancel</string>
<string name="toast_split_select_cont_desc">Exit split screen selection</string>
<!-- Label for toast when app selected for split isn't supported. [CHAR_LIMIT=50] -->
<string name="toast_split_app_unsupported">Choose another app to use split screen</string>
@@ -299,10 +302,16 @@
<string name="taskbar_button_quick_settings">Quick Settings</string>
<!-- Accessibility title for the Taskbar window. [CHAR_LIMIT=NONE] -->
<string name="taskbar_a11y_title">Taskbar</string>
- <!-- Accessibility title for the Taskbar window appeared. [CHAR_LIMIT=NONE] -->
+ <!-- Accessibility title for the Taskbar window appeared. [CHAR_LIMIT=30] -->
<string name="taskbar_a11y_shown_title">Taskbar shown</string>
- <!-- Accessibility title for the Taskbar window being close. [CHAR_LIMIT=NONE] -->
+ <!-- Accessibility title for the Taskbar window appearing together with bubble bar on left. [CHAR_LIMIT=30] -->
+ <string name="taskbar_a11y_shown_with_bubbles_left_title">Taskbar & bubbles left shown</string>
+ <!-- Accessibility title for the Taskbar window appearing together with bubble bar on right. [CHAR_LIMIT=30] -->
+ <string name="taskbar_a11y_shown_with_bubbles_right_title">Taskbar & bubbles right shown</string>
+ <!-- Accessibility title for the Taskbar window being closed. [CHAR_LIMIT=30] -->
<string name="taskbar_a11y_hidden_title">Taskbar hidden</string>
+ <!-- Accessibility title for the Taskbar window being closed together with bubble bar. [CHAR_LIMIT=30] -->
+ <string name="taskbar_a11y_hidden_with_bubbles_title">Taskbar & bubbles hidden</string>
<!-- Accessibility title for the Taskbar window on phones. [CHAR_LIMIT=NONE] -->
<string name="taskbar_phone_a11y_title">Navigation bar</string>
<!-- Text in popup dialog for user to switch between always showing Taskbar or not. [CHAR LIMIT=30] -->
@@ -333,9 +342,23 @@
<!-- Accessibility label for quick switch tiles showing split tasks [CHAR LIMIT=NONE] -->
<string name="quick_switch_split_task"><xliff:g id="app_name_1" example="Chrome">%1$s</xliff:g> and <xliff:g id="app_name_2" example="Gmail">%2$s</xliff:g></string>
- <!-- ******* Desktop ******* -->
- <!-- Text shown in popup to choose a desktop app. [CHAR LIMIT=60] -->
- <string name="desktop_select_app_toast">Adding app to Desktop</string>
- <!-- Text shown on a button that closes the popup for choosing a desktop app. [CHAR_LIMIT=40] -->
- <string name="desktop_button_close_app_toast">Cancel</string>
+ <!-- Strings for bubble bar -->
+ <!-- Fallback name for a bubble if it does have a title [CHAR_LIMIT=none] -->
+ <string name="bubble_bar_bubble_fallback_description">Bubble</string>
+ <!-- content description for the overflow bubble [CHAR_LIMIT=none] -->
+ <string name="bubble_bar_overflow_description">Overflow</string>
+ <!-- Content description for a bubble bar bubble. [CHAR_LIMIT=none] -->
+ <string name="bubble_bar_bubble_description"><xliff:g id="notification_title" example="some title">%1$s</xliff:g> from <xliff:g id="app_name" example="YouTube">%2$s</xliff:g></string>
+ <!-- Content description for bubble bar when it has multiple bubbles. [CHAR_LIMIT=NONE] -->
+ <string name="bubble_bar_description_multiple_bubbles"><xliff:g id="bubble_bar_bubble_description" example="some title from YouTube">%1$s</xliff:g> and <xliff:g id="bubble_count" example="4">%2$d</xliff:g> more</string>
+ <!-- Action in accessibility menu to move the bubble bar to the left side of the screen. [CHAR_LIMIT=30] -->
+ <string name="bubble_bar_action_move_left">Move left</string>
+ <!-- Action in accessibility menu to move the bubble bar to the right side of the screen. [CHAR_LIMIT=30] -->
+ <string name="bubble_bar_action_move_right">Move right</string>
+ <!-- Action in accessibility menu to dismiss all bubbles. [CHAR_LIMIT=30] -->
+ <string name="bubble_bar_action_dismiss_all">Dismiss all</string>
+ <!-- Accessibility announcement when the bubble bar expands. [CHAR LIMIT=NONE]-->
+ <string name="bubble_bar_accessibility_announce_expand">expand <xliff:g id="bubble_description" example="some title from Messages">%1$s</xliff:g></string>
+ <!-- Accessibility announcement when the bubble bar collapses. [CHAR LIMIT=NONE]-->
+ <string name="bubble_bar_accessibility_announce_collapse">collapse <xliff:g id="bubble_description" example="some title from Messages">%1$s</xliff:g></string>
</resources>
diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml
index 952505a..1f4720c 100644
--- a/quickstep/res/values/styles.xml
+++ b/quickstep/res/values/styles.xml
@@ -124,7 +124,7 @@
<style name="TextAppearance.GestureTutorial.ButtonLabel"
parent="TextAppearance.GestureTutorial.CallToAction">
<item name="android:gravity">center</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnPrimary</item>
+ <item name="android:textColor">?attr/materialColorOnPrimary</item>
<item name="android:letterSpacing">0.02</item>
<item name="android:textSize">16sp</item>
<item name="android:textAllCaps">false</item>
@@ -268,53 +268,59 @@
<style name="KeyboardQuickSwitchText">
<item name="fontFamily">google-sans-text</item>
<item name="android:textSize">14sp</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">?attr/materialColorOnSurface</item>
<item name="lineHeight">20sp</item>
</style>
<style name="KeyboardQuickSwitchText.OnBackground" parent="KeyboardQuickSwitchText">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">?attr/materialColorOnSurface</item>
</style>
<style name="GestureTutorialActivity" parent="@style/AppTheme">
<item name="background">@android:color/transparent</item>
<item name="tutorialSubtitle">@android:color/black</item>
- <item name="surfaceContainer">?androidprv:attr/materialColorSurfaceContainer</item>
- <item name="onSurfaceHome">?androidprv:attr/materialColorPrimaryFixed</item>
+ <item name="surfaceContainer">?attr/materialColorSurfaceContainer</item>
+ <item name="onSurfaceHome">?attr/materialColorPrimaryFixed</item>
<item name="surfaceHome">@android:color/system_accent1_300</item>
- <item name="secondaryHome">?androidprv:attr/materialColorOnPrimaryFixedVariant</item>
- <item name="onSurfaceBack">?androidprv:attr/materialColorTertiaryFixed</item>
+ <item name="secondaryHome">?attr/materialColorOnPrimaryFixedVariant</item>
+ <item name="onSurfaceBack">?attr/materialColorTertiaryFixed</item>
<item name="surfaceBack">@android:color/system_accent3_300</item>
- <item name="secondaryBack">?androidprv:attr/materialColorOnTertiaryFixedVariant</item>
- <item name="onSurfaceOverview">?androidprv:attr/materialColorPrimaryFixed</item>
+ <item name="secondaryBack">?attr/materialColorOnTertiaryFixedVariant</item>
+ <item name="onSurfaceOverview">?attr/materialColorPrimaryFixed</item>
<item name="surfaceOverview">@android:color/system_accent2_300</item>
- <item name="secondaryOverview">?androidprv:attr/materialColorOnSecondaryFixedVariant</item>
+ <item name="secondaryOverview">?attr/materialColorOnSecondaryFixedVariant</item>
</style>
<style name="rotate_prompt_title" parent="TextAppearance.GestureTutorial.Dialog.Title">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">?attr/materialColorOnSurface</item>
</style>
<style name="rotate_prompt_subtitle" parent="TextAppearance.GestureTutorial.Dialog.Subtitle">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurfaceVariant</item>
+ <item name="android:textColor">?attr/materialColorOnSurfaceVariant</item>
</style>
<style name="ArrowTipTaskbarStyle">
- <item name="arrowTipBackground">?androidprv:attr/materialColorSurfaceContainer</item>
- <item name="arrowTipTextColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="arrowTipBackground">?attr/materialColorSurfaceContainer</item>
+ <item name="arrowTipTextColor">?attr/materialColorOnSurface</item>
</style>
<style name="IconAppChipMenuTextStyle">
<item name="android:fontFamily">google-sans-text-medium</item>
<item name="android:textSize">@dimen/task_thumbnail_icon_menu_text_size</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">?attr/materialColorOnSurface</item>
<item name="android:letterSpacing">0.025</item>
<item name="android:lineHeight">20sp</item>
</style>
- <style name="WidgetPickerActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
- <item name="widgetsTheme">@style/WidgetContainerTheme</item>
+ <style name="WidgetPickerActivityTheme" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowIsTranslucent">true</item>
+ <item name="android:windowAnimationStyle">@android:style/Animation</item>
+
+ <item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="pageIndicatorDotColor">@color/page_indicator_dot_color_light</item>
</style>
</resources>
diff --git a/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java b/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java
index 15180ef..e940553 100644
--- a/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java
+++ b/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java
@@ -27,6 +27,7 @@
import android.content.Context;
import android.os.Handler;
import android.os.RemoteException;
+import android.util.Log;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.RemoteAnimationTarget;
@@ -196,6 +197,7 @@
if (skipFirstFrame) {
// Because t=0 has the app icon in its original spot, we can skip the
// first frame and have the same movement one frame earlier.
+ Log.d("b/311077782", "LauncherAnimationRunner.setAnimation");
mAnimator.setCurrentPlayTime(
Math.min(getSingleFrameMs(context), mAnimator.getTotalDuration()));
}
@@ -238,5 +240,12 @@
@Override
@UiThread
default void onAnimationCancelled() {}
+
+ /**
+ * Returns whether this animation factory supports a tightly coupled return animation.
+ */
+ default boolean supportsReturnTransition() {
+ return false;
+ }
}
}
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 0697f47..4a1035f 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -43,6 +43,7 @@
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_APP_TRANSITIONS;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS;
import static com.android.launcher3.BaseActivity.PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
+import static com.android.launcher3.Flags.enableContainerReturnAnimations;
import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR;
@@ -58,6 +59,7 @@
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.testing.shared.TestProtocol.WALLPAPER_OPEN_ANIMATION_FINISHED_MESSAGE;
import static com.android.launcher3.util.DisplayController.isTransientTaskbar;
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.ORDERED_BG_EXECUTOR;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
@@ -67,6 +69,7 @@
import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch;
import static com.android.quickstep.util.AnimUtils.clampToDuration;
import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
+import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary;
import static com.android.systemui.shared.system.QuickStepContract.getWindowCornerRadius;
import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows;
@@ -150,6 +153,7 @@
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.RectFSpringAnim.DefaultSpringConfig;
import com.android.quickstep.util.RectFSpringAnim.TaskbarHotseatSpringConfig;
+import com.android.quickstep.util.ScalingWorkspaceRevealAnim;
import com.android.quickstep.util.StaggeredWorkspaceAnim;
import com.android.quickstep.util.SurfaceTransaction;
import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties;
@@ -173,13 +177,15 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map.Entry;
/**
* Manages the opening and closing app transitions from Launcher
*/
public class QuickstepTransitionManager implements OnDeviceProfileChangeListener {
+ private static final String TRANSITION_COOKIE_PREFIX =
+ "com.android.launcher3.QuickstepTransitionManager_activityLaunch";
+
private static final boolean ENABLE_SHELL_STARTING_SURFACE =
SystemProperties.getBoolean("persist.debug.shell_starting_surface", true);
@@ -332,17 +338,7 @@
restartedListener.register(onEndCallback::executeAllAndDestroy);
onEndCallback.add(restartedListener::unregister);
- mAppLaunchRunner = new AppLaunchAnimationRunner(v, onEndCallback);
- ItemInfo tag = (ItemInfo) v.getTag();
- if (tag != null && tag.shouldUseBackgroundAnimation()) {
- ContainerAnimationRunner containerAnimationRunner = ContainerAnimationRunner.from(
- v, mLauncher, mStartingWindowListener, onEndCallback);
- if (containerAnimationRunner != null) {
- mAppLaunchRunner = containerAnimationRunner;
- }
- }
- RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(
- mHandler, mAppLaunchRunner, true /* startAtFrontOfQueue */);
+ RemoteAnimationRunnerCompat runner = createAppLaunchRunner(v, onEndCallback);
// Note that this duration is a guess as we do not know if the animation will be a
// recents launch or not for sure until we know the opening app targets.
@@ -359,10 +355,95 @@
IRemoteCallback endCallback = completeRunnableListCallback(onEndCallback);
options.setOnAnimationAbortListener(endCallback);
options.setOnAnimationFinishedListener(endCallback);
+
+ IBinder cookie = mAppLaunchRunner.supportsReturnTransition()
+ ? ((ContainerAnimationRunner) mAppLaunchRunner).getCookie() : null;
+ addLaunchCookie(cookie, (ItemInfo) v.getTag(), options);
+
+ // Register the return animation so it can be triggered on back from the app to home.
+ maybeRegisterAppReturnTransition(v);
+
return new ActivityOptionsWrapper(options, onEndCallback);
}
/**
+ * Selects the appropriate type of launch runner for the given view, builds it, and returns it.
+ * {@link QuickstepTransitionManager#mAppLaunchRunner} is updated as a by-product of this
+ * method.
+ */
+ private RemoteAnimationRunnerCompat createAppLaunchRunner(View v, RunnableList onEndCallback) {
+ ItemInfo tag = (ItemInfo) v.getTag();
+ ContainerAnimationRunner containerRunner = null;
+ if (tag != null && tag.shouldUseBackgroundAnimation()) {
+ // The cookie should only override the default used by launcher if container return
+ // animations are enabled.
+ ActivityTransitionAnimator.TransitionCookie cookie =
+ checkReturnAnimationsFlags()
+ ? new ActivityTransitionAnimator.TransitionCookie(
+ TRANSITION_COOKIE_PREFIX + tag.id)
+ : null;
+ ContainerAnimationRunner launchAnimationRunner =
+ ContainerAnimationRunner.fromView(
+ v, cookie, true /* forLaunch */, mLauncher, mStartingWindowListener,
+ onEndCallback);
+
+ if (launchAnimationRunner != null) {
+ containerRunner = launchAnimationRunner;
+ }
+ }
+
+ mAppLaunchRunner = containerRunner != null
+ ? containerRunner : new AppLaunchAnimationRunner(v, onEndCallback);
+ return new LauncherAnimationRunner(
+ mHandler, mAppLaunchRunner, true /* startAtFrontOfQueue */);
+ }
+
+ /**
+ * If container return animations are enabled and the current launch runner is itself a
+ * {@link ContainerAnimationRunner}, registers a matching return animation that de-registers
+ * itself after it has run once or is made obsolete by the view going away.
+ */
+ private void maybeRegisterAppReturnTransition(View v) {
+ if (!checkReturnAnimationsFlags() || !mAppLaunchRunner.supportsReturnTransition()) {
+ return;
+ }
+
+ ActivityTransitionAnimator.TransitionCookie cookie =
+ ((ContainerAnimationRunner) mAppLaunchRunner).getCookie();
+ RunnableList onEndCallback = new RunnableList();
+ ContainerAnimationRunner runner =
+ ContainerAnimationRunner.fromView(
+ v, cookie, false /* forLaunch */, mLauncher, mStartingWindowListener,
+ onEndCallback);
+ RemoteTransition transition =
+ new RemoteTransition(
+ new LauncherAnimationRunner(
+ mHandler, runner, true /* startAtFrontOfQueue */
+ ).toRemoteTransition()
+ );
+
+ SystemUiProxy.INSTANCE.get(mLauncher).registerRemoteTransition(
+ transition, ContainerAnimationRunner.buildBackToHomeFilter(cookie, mLauncher));
+ ContainerAnimationRunner.setUpRemoteAnimationCleanup(
+ v, transition, onEndCallback, mLauncher);
+ }
+
+ /**
+ * Adds a new launch cookie for the activity launch if supported.
+ * Prioritizes the explicitly provided cookie, falling back on extracting one from the given
+ * {@link ItemInfo} if necessary.
+ */
+ private void addLaunchCookie(IBinder cookie, ItemInfo info, ActivityOptions options) {
+ if (cookie == null) {
+ cookie = mLauncher.getLaunchCookie(info);
+ }
+
+ if (cookie != null) {
+ options.setLaunchCookie(cookie);
+ }
+ }
+
+ /**
* Whether the launch is a recents app transition and we should do a launch animation
* from the recents view. Note that if the remote animation targets are not provided, this
* may not always be correct as we may resolve the opening app to a task when the animation
@@ -374,7 +455,7 @@
*/
protected boolean isLaunchingFromRecents(@NonNull View v,
@Nullable RemoteAnimationTarget[] targets) {
- return mLauncher.getStateManager().getState().overviewUi
+ return mLauncher.getStateManager().getState().isRecentsViewVisible
&& findTaskViewToLaunch(mLauncher.getOverviewPanel(), v, targets) != null;
}
@@ -1163,15 +1244,25 @@
TransitionFilter homeCheck = new TransitionFilter();
// No need to handle the transition that also dismisses keyguard.
homeCheck.mNotFlags = TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
+
homeCheck.mRequirements =
new TransitionFilter.Requirement[]{new TransitionFilter.Requirement(),
+ new TransitionFilter.Requirement(),
new TransitionFilter.Requirement()};
+
homeCheck.mRequirements[0].mActivityType = ACTIVITY_TYPE_HOME;
homeCheck.mRequirements[0].mTopActivity = mLauncher.getComponentName();
homeCheck.mRequirements[0].mModes = new int[]{TRANSIT_OPEN, TRANSIT_TO_FRONT};
homeCheck.mRequirements[0].mOrder = CONTAINER_ORDER_TOP;
+
homeCheck.mRequirements[1].mActivityType = ACTIVITY_TYPE_STANDARD;
homeCheck.mRequirements[1].mModes = new int[]{TRANSIT_CLOSE, TRANSIT_TO_BACK};
+
+ homeCheck.mRequirements[2].mNot = true;
+ homeCheck.mRequirements[2].mCustomAnimation = true;
+ homeCheck.mRequirements[2].mMustBeTask = true;
+ homeCheck.mRequirements[2].mMustBeIndependent = true;
+
SystemUiProxy.INSTANCE.get(mLauncher)
.registerRemoteTransition(mLauncherOpenTransition, homeCheck);
if (mBackAnimationController != null) {
@@ -1563,7 +1654,15 @@
}
private void addCujInstrumentation(Animator anim, int cuj) {
- anim.addListener(new AnimationSuccessListener() {
+ anim.addListener(getCujAnimationSuccessListener(cuj));
+ }
+
+ private void addCujInstrumentation(RectFSpringAnim anim, int cuj) {
+ anim.addAnimatorListener(getCujAnimationSuccessListener(cuj));
+ }
+
+ private AnimationSuccessListener getCujAnimationSuccessListener(int cuj) {
+ return new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
mDragLayer.getViewTreeObserver().addOnDrawListener(
@@ -1597,7 +1696,7 @@
public void onAnimationSuccess(Animator animator) {
InteractionJankMonitorWrapper.end(cuj);
}
- });
+ };
}
/**
@@ -1629,10 +1728,15 @@
anim.play(getUnlockWindowAnimator(appTargets, wallpaperTargets));
} else if (ENABLE_BACK_SWIPE_HOME_ANIMATION.get()
&& !playFallBackAnimation) {
- // Use a fixed velocity to start the animation.
- float velocityPxPerS = DynamicResource.provider(mLauncher)
- .getDimension(R.dimen.unlock_staggered_velocity_dp_per_s);
- PointF velocity = new PointF(0, -velocityPxPerS);
+ PointF velocity;
+ if (enableScalingRevealHomeAnimation()) {
+ velocity = new PointF();
+ } else {
+ // Use a fixed velocity to start the animation.
+ float velocityPxPerS = DynamicResource.provider(mLauncher)
+ .getDimension(R.dimen.unlock_staggered_velocity_dp_per_s);
+ velocity = new PointF(0, -velocityPxPerS);
+ }
rectFSpringAnim = getClosingWindowAnimators(
anim, appTargets, launcherView, velocity, startRect,
startWindowCornerRadius);
@@ -1641,8 +1745,15 @@
// layout bounds.
skipAllAppsScale = true;
} else if (!fromPredictiveBack) {
- anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y,
- true /* animateOverviewScrim */, launcherView).getAnimators());
+ if (enableScalingRevealHomeAnimation()) {
+ anim.play(
+ new ScalingWorkspaceRevealAnim(
+ mLauncher, rectFSpringAnim,
+ rectFSpringAnim.getTargetRect()).getAnimators());
+ } else {
+ anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y,
+ true /* animateOverviewScrim */, launcherView).getAnimators());
+ }
if (!areAllTargetsTranslucent(appTargets)) {
anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController().stateDepth,
@@ -1666,10 +1777,6 @@
// invisibility on touch down, and only reset it after the animation to home
// is initialized.
if (launcherIsForceInvisibleOrOpening || fromPredictiveBack) {
- addCujInstrumentation(anim, playFallBackAnimation
- ? Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK
- : Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME);
-
AnimatorListenerAdapter endListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -1679,6 +1786,14 @@
}
};
+ if (rectFSpringAnim != null && anim.getChildAnimations().isEmpty()) {
+ addCujInstrumentation(rectFSpringAnim, Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME);
+ } else {
+ addCujInstrumentation(anim, playFallBackAnimation
+ ? Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK
+ : Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME);
+ }
+
if (fromPredictiveBack && rectFSpringAnim != null) {
rectFSpringAnim.addAnimatorListener(endListener);
} else {
@@ -1715,6 +1830,10 @@
}
}
+ private static boolean checkReturnAnimationsFlags() {
+ return enableContainerReturnAnimations() && returnAnimationFrameworkLibrary();
+ }
+
/**
* Remote animation runner for animation from the app to Launcher, including recents.
*/
@@ -1831,38 +1950,45 @@
/** The delegate runner that handles the actual animation. */
private final RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> mDelegate;
+ @Nullable
+ private final ActivityTransitionAnimator.TransitionCookie mCookie;
+
private ContainerAnimationRunner(
- RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> delegate) {
+ RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> delegate,
+ ActivityTransitionAnimator.TransitionCookie cookie) {
mDelegate = delegate;
+ mCookie = cookie;
}
@Nullable
- private static ContainerAnimationRunner from(View v, Launcher launcher,
- StartingWindowListener startingWindowListener, RunnableList onEndCallback) {
- View viewToUse = findLaunchableViewWithBackground(v);
- if (viewToUse == null) {
- return null;
+ ActivityTransitionAnimator.TransitionCookie getCookie() {
+ return mCookie;
+ }
+
+ @Nullable
+ static ContainerAnimationRunner fromView(
+ View v,
+ ActivityTransitionAnimator.TransitionCookie cookie,
+ boolean forLaunch,
+ Launcher launcher,
+ StartingWindowListener startingWindowListener,
+ RunnableList onEndCallback) {
+ if (!forLaunch && !checkReturnAnimationsFlags()) {
+ throw new IllegalStateException(
+ "forLaunch cannot be false when the enableContainerReturnAnimations or "
+ + "returnAnimationFrameworkLibrary flag is disabled");
}
- // The CUJ is logged by the click handler, so we don't log it inside the animation
- // library.
- ActivityTransitionAnimator.Controller controllerDelegate =
- ActivityTransitionAnimator.Controller.fromView(viewToUse, null /* cujType */);
-
- if (controllerDelegate == null) {
- return null;
- }
-
- // This wrapper allows us to override the default value, telling the controller that the
- // current window is below the animating window.
+ // First the controller is created. This is used by the runner to animate the
+ // origin/target view.
ActivityTransitionAnimator.Controller controller =
- new DelegateTransitionAnimatorController(controllerDelegate) {
- @Override
- public boolean isBelowAnimatingWindow() {
- return true;
- }
- };
+ buildController(v, cookie, forLaunch);
+ if (controller == null) {
+ return null;
+ }
+ // The callback is used to make sure that we use the right color to fade between view
+ // and the window.
ActivityTransitionAnimator.Callback callback = task -> {
final int backgroundColor =
startingWindowListener.mBackgroundColor == Color.TRANSPARENT
@@ -1881,7 +2007,52 @@
return new ContainerAnimationRunner(
new ActivityTransitionAnimator.AnimationDelegate(
- controller, callback, listener));
+ MAIN_EXECUTOR, controller, callback, listener),
+ cookie);
+ }
+
+ /**
+ * Constructs a {@link ActivityTransitionAnimator.Controller} that can be used by a
+ * {@link ContainerAnimationRunner} to animate a view into an opening window or from a
+ * closing one.
+ */
+ @Nullable
+ private static ActivityTransitionAnimator.Controller buildController(
+ View v, ActivityTransitionAnimator.TransitionCookie cookie, boolean isLaunching) {
+ View viewToUse = findLaunchableViewWithBackground(v);
+ if (viewToUse == null) {
+ return null;
+ }
+
+ // The CUJ is logged by the click handler, so we don't log it inside the animation
+ // library. TODO: figure out return CUJ.
+ ActivityTransitionAnimator.Controller controllerDelegate =
+ ActivityTransitionAnimator.Controller.fromView(viewToUse, null /* cujType */);
+
+ if (controllerDelegate == null) {
+ return null;
+ }
+
+ // This wrapper allows us to override the default value, telling the controller that the
+ // current window is below the animating window as well as information about the return
+ // animation.
+ return new DelegateTransitionAnimatorController(controllerDelegate) {
+ @Override
+ public boolean isLaunching() {
+ return isLaunching;
+ }
+
+ @Override
+ public boolean isBelowAnimatingWindow() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public ActivityTransitionAnimator.TransitionCookie getTransitionCookie() {
+ return cookie;
+ }
+ };
}
/**
@@ -1903,6 +2074,67 @@
return (T) current;
}
+ /**
+ * Builds the filter used by WM Shell to match app closing transitions (only back, no home
+ * button/gesture) to the given launch cookie.
+ */
+ static TransitionFilter buildBackToHomeFilter(
+ ActivityTransitionAnimator.TransitionCookie cookie, Launcher launcher) {
+ // Closing activity must include the cookie in its list of launch cookies.
+ TransitionFilter.Requirement appRequirement = new TransitionFilter.Requirement();
+ appRequirement.mActivityType = ACTIVITY_TYPE_STANDARD;
+ appRequirement.mLaunchCookie = cookie;
+ appRequirement.mModes = new int[]{TRANSIT_CLOSE, TRANSIT_TO_BACK};
+ // Opening activity must be Launcher.
+ TransitionFilter.Requirement launcherRequirement = new TransitionFilter.Requirement();
+ launcherRequirement.mActivityType = ACTIVITY_TYPE_HOME;
+ launcherRequirement.mModes = new int[]{TRANSIT_OPEN, TRANSIT_TO_FRONT};
+ launcherRequirement.mTopActivity = launcher.getComponentName();
+ // Transition types CLOSE and TO_BACK match the back button/gesture but not the home
+ // button/gesture.
+ TransitionFilter filter = new TransitionFilter();
+ filter.mTypeSet = new int[]{TRANSIT_CLOSE, TRANSIT_TO_BACK};
+ filter.mRequirements =
+ new TransitionFilter.Requirement[]{appRequirement, launcherRequirement};
+ return filter;
+ }
+
+ /**
+ * Creates various conditions to ensure that the given transition is cleaned up correctly
+ * when necessary:
+ * - if the transition has run, it is the callback that unregisters it;
+ * - if the associated view is detached before the transition has had an opportunity to run,
+ * a {@link View.OnAttachStateChangeListener} allows us to do the same (and removes
+ * itself).
+ */
+ static void setUpRemoteAnimationCleanup(
+ View v, RemoteTransition transition, RunnableList callback, Launcher launcher) {
+ View.OnAttachStateChangeListener listener = new View.OnAttachStateChangeListener() {
+ @Override
+ public void onViewAttachedToWindow(@NonNull View v) {}
+
+ @Override
+ public void onViewDetachedFromWindow(@NonNull View v) {
+ SystemUiProxy.INSTANCE.get(launcher)
+ .unregisterRemoteTransition(transition);
+ v.removeOnAttachStateChangeListener(this);
+ }
+ };
+
+ // Remove the animation as soon as it has run once.
+ callback.add(() -> {
+ SystemUiProxy.INSTANCE.get(launcher).unregisterRemoteTransition(transition);
+ if (v != null) {
+ v.removeOnAttachStateChangeListener(listener);
+ }
+ });
+
+ // Remove the animation when the view is detached from the hierarchy.
+ // This is so that if back is not invoked (e.g. if we go back home through the home
+ // gesture) we don't have obsolete transitions staying registered.
+ v.addOnAttachStateChangeListener(listener);
+ }
+
@Override
public void onAnimationStart(int transit, RemoteAnimationTarget[] appTargets,
RemoteAnimationTarget[] wallpaperTargets, RemoteAnimationTarget[] nonAppTargets,
@@ -1915,6 +2147,11 @@
public void onAnimationCancelled() {
mDelegate.onAnimationCancelled();
}
+
+ @Override
+ public boolean supportsReturnTransition() {
+ return true;
+ }
}
/**
diff --git a/quickstep/src/com/android/launcher3/WidgetPickerActivity.java b/quickstep/src/com/android/launcher3/WidgetPickerActivity.java
index 23cb8e9..e925af6 100644
--- a/quickstep/src/com/android/launcher3/WidgetPickerActivity.java
+++ b/quickstep/src/com/android/launcher3/WidgetPickerActivity.java
@@ -20,6 +20,7 @@
import static android.view.WindowInsets.Type.navigationBars;
import static android.view.WindowInsets.Type.statusBars;
+import static com.android.launcher3.Flags.enablePredictiveBackGesture;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -33,6 +34,9 @@
import android.view.View;
import android.view.WindowInsetsController;
import android.view.WindowManager;
+import android.window.BackEvent;
+import android.window.OnBackAnimationCallback;
+import android.window.OnBackInvokedDispatcher;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -42,20 +46,21 @@
import com.android.launcher3.model.WidgetPredictionsRequester;
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.popup.PopupDataProvider;
-import com.android.launcher3.util.PackageUserKey;
-import com.android.launcher3.widget.BaseWidgetSheet;
+import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.widget.WidgetCell;
+import com.android.launcher3.widget.model.WidgetsListBaseEntriesBuilder;
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
-import com.android.launcher3.widget.model.WidgetsListHeaderEntry;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
+import java.util.function.Predicate;
import java.util.regex.Pattern;
-import java.util.stream.Collectors;
/** An Activity that can host Launcher's widget picker. */
public class WidgetPickerActivity extends BaseActivity {
@@ -78,6 +83,15 @@
*/
private static final String EXTRA_ADDED_APP_WIDGETS = "added_app_widgets";
/**
+ * Intent extra for the string representing the title displayed within the picker header.
+ */
+ private static final String EXTRA_PICKER_TITLE = "picker_title";
+ /**
+ * Intent extra for the string representing the description displayed within the picker header.
+ */
+ private static final String EXTRA_PICKER_DESCRIPTION = "picker_description";
+
+ /**
* A unique identifier of the surface hosting the widgets;
* <p>"widgets" is reserved for home screen surface.</p>
* <p>"widgets_hub" is reserved for glanceable hub surface.</p>
@@ -85,11 +99,18 @@
private static final String EXTRA_UI_SURFACE = "ui_surface";
private static final Pattern UI_SURFACE_PATTERN =
Pattern.compile("^(widgets|widgets_hub)$");
+
+ /**
+ * User ids that should be filtered out of the widget lists created by this activity.
+ */
+ private static final String EXTRA_USER_ID_FILTER = "filtered_user_ids";
+
private SimpleDragLayer<WidgetPickerActivity> mDragLayer;
private WidgetsModel mModel;
private LauncherAppState mApp;
private WidgetPredictionsRequester mWidgetPredictionsRequester;
- private final PopupDataProvider mPopupDataProvider = new PopupDataProvider(i -> {});
+ private final WidgetPickerDataProvider mWidgetPickerDataProvider =
+ new WidgetPickerDataProvider();
private int mDesiredWidgetWidth;
private int mDesiredWidgetHeight;
@@ -99,6 +120,30 @@
// Widgets existing on the host surface.
@NonNull
private List<AppWidgetProviderInfo> mAddedWidgets = new ArrayList<>();
+ @Nullable
+ private String mTitle;
+ @Nullable
+ private String mDescription;
+
+ /** A set of user ids that should be filtered out from the selected widgets. */
+ @NonNull
+ Set<Integer> mFilteredUserIds = new HashSet<>();
+
+ @Nullable
+ private WidgetsFullSheet mWidgetSheet;
+
+ private final Predicate<WidgetItem> mWidgetsFilter = widget -> {
+ final WidgetAcceptabilityVerdict verdict =
+ isWidgetAcceptable(widget, /* applySizeFilter=*/ false);
+ verdict.maybeLogVerdict();
+ return verdict.isAcceptable;
+ };
+ private final Predicate<WidgetItem> mDefaultWidgetsFilter = widget -> {
+ final WidgetAcceptabilityVerdict verdict =
+ isWidgetAcceptable(widget, /* applySizeFilter=*/ true);
+ verdict.maybeLogVerdict();
+ return verdict.isAcceptable;
+ };
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -119,15 +164,26 @@
WindowInsetsController wc = mDragLayer.getWindowInsetsController();
wc.hide(navigationBars() + statusBars());
- BaseWidgetSheet widgetSheet = WidgetsFullSheet.show(this, true);
- widgetSheet.disableNavBarScrim(true);
- widgetSheet.addOnCloseListener(this::finish);
-
parseIntentExtras();
refreshAndBindWidgets();
}
+ @Override
+ protected void registerBackDispatcher() {
+ if (!enablePredictiveBackGesture()) {
+ super.registerBackDispatcher();
+ return;
+ }
+
+ getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
+ OnBackInvokedDispatcher.PRIORITY_DEFAULT,
+ new BackAnimationCallback());
+ }
+
private void parseIntentExtras() {
+ mTitle = getIntent().getStringExtra(EXTRA_PICKER_TITLE);
+ mDescription = getIntent().getStringExtra(EXTRA_PICKER_DESCRIPTION);
+
// A value of 0 for either size means that no filtering will occur in that dimension. If
// both values are 0, then no size filtering will occur.
mDesiredWidgetWidth =
@@ -148,12 +204,18 @@
if (addedWidgets != null) {
mAddedWidgets = addedWidgets;
}
+ ArrayList<Integer> filteredUsers = getIntent().getIntegerArrayListExtra(
+ EXTRA_USER_ID_FILTER);
+ mFilteredUserIds.clear();
+ if (filteredUsers != null) {
+ mFilteredUserIds.addAll(filteredUsers);
+ }
}
@NonNull
@Override
- public PopupDataProvider getPopupDataProvider() {
- return mPopupDataProvider;
+ public WidgetPickerDataProvider getWidgetPickerDataProvider() {
+ return mWidgetPickerDataProvider;
}
@Override
@@ -194,6 +256,11 @@
return false;
}
+ View dragView = widgetCell.getDragAndDropView();
+ if (dragView == null) {
+ return false;
+ }
+
ClipData clipData = new ClipData(
new ClipDescription(
/* label= */ "", // not displayed anywhere; so, set to empty.
@@ -209,51 +276,62 @@
.putExtra(EXTRA_IS_PENDING_WIDGET_DRAG, true));
// DRAG_FLAG_GLOBAL permits dragging data beyond app window.
- return view.startDragAndDrop(
+ return dragView.startDragAndDrop(
clipData,
- new View.DragShadowBuilder(view),
+ new View.DragShadowBuilder(dragView),
/* myLocalState= */ null,
View.DRAG_FLAG_GLOBAL
);
};
}
- /** Updates the model with widgets and provides them after applying the provided filter. */
+ /**
+ * Updates the model with widgets, applies filters and launches the widgets sheet once
+ * widgets are available
+ */
private void refreshAndBindWidgets() {
MODEL_EXECUTOR.execute(() -> {
LauncherAppState app = LauncherAppState.getInstance(this);
mModel.update(app, null);
- final List<WidgetsListBaseEntry> allWidgets =
- mModel.getFilteredWidgetsListForPicker(
- app.getContext(),
- /*widgetItemFilter=*/ widget -> {
- final WidgetAcceptabilityVerdict verdict =
- isWidgetAcceptable(widget);
- verdict.maybeLogVerdict();
- return verdict.isAcceptable;
- }
- );
- bindWidgets(allWidgets);
+ bindWidgets(mModel.getWidgetsByPackageItem());
+ // Open sheet once widgets are available, so that it doesn't interrupt the open
+ // animation.
+ openWidgetsSheet();
if (mUiSurface != null) {
- Map<PackageUserKey, List<WidgetItem>> allWidgetsMap = allWidgets.stream()
- .filter(WidgetsListHeaderEntry.class::isInstance)
- .collect(Collectors.toMap(
- entry -> PackageUserKey.fromPackageItemInfo(entry.mPkgItem),
- entry -> entry.mWidgets)
- );
mWidgetPredictionsRequester = new WidgetPredictionsRequester(app.getContext(),
- mUiSurface, allWidgetsMap);
+ mUiSurface, mModel.getWidgetsByComponentKey());
mWidgetPredictionsRequester.request(mAddedWidgets, this::bindRecommendedWidgets);
}
});
}
- private void bindWidgets(List<WidgetsListBaseEntry> widgets) {
- MAIN_EXECUTOR.execute(() -> mPopupDataProvider.setAllWidgets(widgets));
+ private void bindWidgets(Map<PackageItemInfo, List<WidgetItem>> widgets) {
+ WidgetsListBaseEntriesBuilder builder = new WidgetsListBaseEntriesBuilder(
+ mApp.getContext());
+
+ final List<WidgetsListBaseEntry> allWidgets = builder.build(widgets, mWidgetsFilter);
+ final List<WidgetsListBaseEntry> defaultWidgets =
+ shouldShowDefaultWidgets() ? builder.build(widgets,
+ mDefaultWidgetsFilter) : List.of();
+
+ MAIN_EXECUTOR.execute(
+ () -> mWidgetPickerDataProvider.setWidgets(allWidgets, defaultWidgets));
+ }
+
+ private void openWidgetsSheet() {
+ MAIN_EXECUTOR.execute(() -> {
+ mWidgetSheet = WidgetsFullSheet.show(this, true);
+ mWidgetSheet.mayUpdateTitleAndDescription(mTitle, mDescription);
+ mWidgetSheet.disableNavBarScrim(true);
+ mWidgetSheet.addOnCloseListener(this::finish);
+ });
}
private void bindRecommendedWidgets(List<ItemInfo> recommendedWidgets) {
- MAIN_EXECUTOR.execute(() -> mPopupDataProvider.setRecommendedWidgets(recommendedWidgets));
+ // Bind recommendations once picker has finished open animation.
+ MAIN_EXECUTOR.getHandler().postDelayed(
+ () -> mWidgetPickerDataProvider.setWidgetRecommendations(recommendedWidgets),
+ mDeviceProfile.bottomSheetOpenDuration);
}
@Override
@@ -264,12 +342,70 @@
}
}
- private WidgetAcceptabilityVerdict isWidgetAcceptable(WidgetItem widget) {
+ /**
+ * Animation callback for different predictive back animation states for the widget picker.
+ */
+ private class BackAnimationCallback implements OnBackAnimationCallback {
+ @Nullable
+ OnBackAnimationCallback mActiveOnBackAnimationCallback;
+
+ @Override
+ public void onBackStarted(@NonNull BackEvent backEvent) {
+ if (mActiveOnBackAnimationCallback != null) {
+ mActiveOnBackAnimationCallback.onBackCancelled();
+ }
+ if (mWidgetSheet != null) {
+ mActiveOnBackAnimationCallback = mWidgetSheet;
+ mActiveOnBackAnimationCallback.onBackStarted(backEvent);
+ }
+ }
+
+ @Override
+ public void onBackInvoked() {
+ if (mActiveOnBackAnimationCallback == null) {
+ return;
+ }
+ mActiveOnBackAnimationCallback.onBackInvoked();
+ mActiveOnBackAnimationCallback = null;
+ }
+
+ @Override
+ public void onBackProgressed(@NonNull BackEvent backEvent) {
+ if (mActiveOnBackAnimationCallback == null) {
+ return;
+ }
+ mActiveOnBackAnimationCallback.onBackProgressed(backEvent);
+ }
+
+ @Override
+ public void onBackCancelled() {
+ if (mActiveOnBackAnimationCallback == null) {
+ return;
+ }
+ mActiveOnBackAnimationCallback.onBackCancelled();
+ mActiveOnBackAnimationCallback = null;
+ }
+ }
+
+ private boolean shouldShowDefaultWidgets() {
+ // If optional filters such as size filter are present, we display them as default widgets.
+ return mDesiredWidgetWidth != 0 || mDesiredWidgetHeight != 0;
+ }
+
+ private WidgetAcceptabilityVerdict isWidgetAcceptable(WidgetItem widget,
+ boolean applySizeFilter) {
final AppWidgetProviderInfo info = widget.widgetInfo;
if (info == null) {
return rejectWidget(widget, "shortcut");
}
+ if (mFilteredUserIds.contains(widget.user.getIdentifier())) {
+ return rejectWidget(
+ widget,
+ "widget user: %d is being filtered",
+ widget.user.getIdentifier());
+ }
+
if (mWidgetCategoryFilter > 0 && (info.widgetCategory & mWidgetCategoryFilter) == 0) {
return rejectWidget(
widget,
@@ -278,61 +414,63 @@
info.widgetCategory);
}
- if (mDesiredWidgetWidth == 0 && mDesiredWidgetHeight == 0) {
- // Accept the widget if the desired dimensions are unspecified.
- return acceptWidget(widget);
- }
-
- final boolean isHorizontallyResizable =
- (info.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0;
- if (mDesiredWidgetWidth > 0 && isHorizontallyResizable) {
- if (info.maxResizeWidth > 0
- && info.maxResizeWidth >= info.minWidth
- && info.maxResizeWidth < mDesiredWidgetWidth) {
- return rejectWidget(
- widget,
- "maxResizeWidth[%d] < mDesiredWidgetWidth[%d]",
- info.maxResizeWidth,
- mDesiredWidgetWidth);
+ if (applySizeFilter) {
+ if (mDesiredWidgetWidth == 0 && mDesiredWidgetHeight == 0) {
+ // Accept the widget if the desired dimensions are unspecified.
+ return acceptWidget(widget);
}
- final int minWidth = Math.min(info.minResizeWidth, info.minWidth);
- if (minWidth > mDesiredWidgetWidth) {
- return rejectWidget(
- widget,
- "min(minWidth[%d], minResizeWidth[%d]) > mDesiredWidgetWidth[%d]",
- info.minWidth,
- info.minResizeWidth,
- mDesiredWidgetWidth);
- }
- }
+ final boolean isHorizontallyResizable =
+ (info.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0;
+ if (mDesiredWidgetWidth > 0 && isHorizontallyResizable) {
+ if (info.maxResizeWidth > 0
+ && info.maxResizeWidth >= info.minWidth
+ && info.maxResizeWidth < mDesiredWidgetWidth) {
+ return rejectWidget(
+ widget,
+ "maxResizeWidth[%d] < mDesiredWidgetWidth[%d]",
+ info.maxResizeWidth,
+ mDesiredWidgetWidth);
+ }
- final boolean isVerticallyResizable =
- (info.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0;
- if (mDesiredWidgetHeight > 0 && isVerticallyResizable) {
- if (info.maxResizeHeight > 0
- && info.maxResizeHeight >= info.minHeight
- && info.maxResizeHeight < mDesiredWidgetHeight) {
- return rejectWidget(
- widget,
- "maxResizeHeight[%d] < mDesiredWidgetHeight[%d]",
- info.maxResizeHeight,
- mDesiredWidgetHeight);
+ final int minWidth = Math.min(info.minResizeWidth, info.minWidth);
+ if (minWidth > mDesiredWidgetWidth) {
+ return rejectWidget(
+ widget,
+ "min(minWidth[%d], minResizeWidth[%d]) > mDesiredWidgetWidth[%d]",
+ info.minWidth,
+ info.minResizeWidth,
+ mDesiredWidgetWidth);
+ }
}
- final int minHeight = Math.min(info.minResizeHeight, info.minHeight);
- if (minHeight > mDesiredWidgetHeight) {
- return rejectWidget(
- widget,
- "min(minHeight[%d], minResizeHeight[%d]) > mDesiredWidgetHeight[%d]",
- info.minHeight,
- info.minResizeHeight,
- mDesiredWidgetHeight);
- }
- }
+ final boolean isVerticallyResizable =
+ (info.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0;
+ if (mDesiredWidgetHeight > 0 && isVerticallyResizable) {
+ if (info.maxResizeHeight > 0
+ && info.maxResizeHeight >= info.minHeight
+ && info.maxResizeHeight < mDesiredWidgetHeight) {
+ return rejectWidget(
+ widget,
+ "maxResizeHeight[%d] < mDesiredWidgetHeight[%d]",
+ info.maxResizeHeight,
+ mDesiredWidgetHeight);
+ }
- if (!isHorizontallyResizable || !isVerticallyResizable) {
- return rejectWidget(widget, "not resizeable");
+ final int minHeight = Math.min(info.minResizeHeight, info.minHeight);
+ if (minHeight > mDesiredWidgetHeight) {
+ return rejectWidget(
+ widget,
+ "min(minHeight[%d], minResizeHeight[%d]) > mDesiredWidgetHeight[%d]",
+ info.minHeight,
+ info.minResizeHeight,
+ mDesiredWidgetHeight);
+ }
+ }
+
+ if (!isHorizontallyResizable || !isVerticallyResizable) {
+ return rejectWidget(widget, "not resizeable");
+ }
}
return acceptWidget(widget);
diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
index 84c2ed2..7a8b58e 100644
--- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
@@ -31,12 +31,12 @@
import android.view.accessibility.AccessibilityManager;
import androidx.annotation.ColorInt;
-import androidx.core.content.ContextCompat;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderView;
+import com.android.launcher3.util.Themes;
/**
* A view which shows a horizontal divider
@@ -84,10 +84,9 @@
getResources().getDimensionPixelSize(R.dimen.all_apps_divider_height)
};
- mStrokeColor = ContextCompat.getColor(context, R.color.material_color_outline_variant);
+ mStrokeColor = Themes.getAttrColor(context, R.attr.materialColorOutlineVariant);
- mAllAppsLabelTextColor = ContextCompat.getColor(context,
- R.color.material_color_on_surface_variant);
+ mAllAppsLabelTextColor = Themes.getAttrColor(context, R.attr.materialColorOnSurfaceVariant);
mAccessibilityManager = AccessibilityManager.getInstance(context);
setShowAllAppsLabel(!ALL_APPS_VISITED_COUNT.hasReachedMax(context));
diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
index 70e01f5..92d9516 100644
--- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
@@ -286,10 +286,13 @@
}
public void dump(String prefix, PrintWriter writer) {
- writer.println(prefix + this.getClass().getSimpleName());
+ writer.println(prefix + "PredictionRowView");
writer.println(prefix + "\tmPredictionsEnabled: " + mPredictionsEnabled);
writer.println(prefix + "\tmPredictionUiUpdatePaused: " + mPredictionUiUpdatePaused);
writer.println(prefix + "\tmNumPredictedAppsPerRow: " + mNumPredictedAppsPerRow);
- writer.println(prefix + "\tmPredictedApps: " + mPredictedApps);
+ writer.println(prefix + "\tmPredictedApps: " + mPredictedApps.size());
+ for (WorkspaceItemInfo info : mPredictedApps) {
+ writer.println(prefix + "\t\t" + info);
+ }
}
}
diff --git a/quickstep/src/com/android/launcher3/dagger/LauncherAppComponent.java b/quickstep/src/com/android/launcher3/dagger/LauncherAppComponent.java
new file mode 100644
index 0000000..dab2582
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/dagger/LauncherAppComponent.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.dagger;
+
+import dagger.Component;
+
+import javax.inject.Singleton;
+
+/**
+ * Root component for Dagger injection for Launcher Quickstep.
+ */
+@Singleton
+@Component
+public interface LauncherAppComponent extends LauncherBaseAppComponent {
+ /** Builder for quickstep LauncherAppComponent. */
+ @Component.Builder
+ interface Builder extends LauncherBaseAppComponent.Builder {
+ LauncherAppComponent build();
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt b/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
index 3ef8e54..f7da34a 100644
--- a/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
+++ b/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
@@ -30,11 +30,12 @@
import com.android.quickstep.SystemUiProxy
import com.android.quickstep.TaskViewUtils
import com.android.quickstep.views.DesktopTaskView
+import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource
import java.util.function.Consumer
/** Manage recents related operations with desktop tasks */
class DesktopRecentsTransitionController(
- private val stateManager: StateManager<*>,
+ private val stateManager: StateManager<*, *>,
private val systemUiProxy: SystemUiProxy,
private val appThread: IApplicationThread,
private val depthController: DepthController?
@@ -43,11 +44,13 @@
/** Launch desktop tasks from recents view */
fun launchDesktopFromRecents(
desktopTaskView: DesktopTaskView,
+ animated: Boolean,
callback: Consumer<Boolean>? = null
) {
val animRunner =
RemoteDesktopLaunchTransitionRunner(
desktopTaskView,
+ animated,
stateManager,
depthController,
callback
@@ -57,13 +60,14 @@
}
/** Launch desktop tasks from recents view */
- fun moveToDesktop(taskId: Int) {
- systemUiProxy.moveToDesktop(taskId)
+ fun moveToDesktop(taskId: Int, transitionSource: DesktopModeTransitionSource) {
+ systemUiProxy.moveToDesktop(taskId, transitionSource)
}
private class RemoteDesktopLaunchTransitionRunner(
private val desktopTaskView: DesktopTaskView,
- private val stateManager: StateManager<*>,
+ private val animated: Boolean,
+ private val stateManager: StateManager<*, *>,
private val depthController: DepthController?,
private val successCallback: Consumer<Boolean>?
) : RemoteTransitionStub() {
@@ -83,16 +87,21 @@
}
MAIN_EXECUTOR.execute {
- TaskViewUtils.composeRecentsDesktopLaunchAnimator(
- desktopTaskView,
- stateManager,
- depthController,
- info,
- t
- ) {
- errorHandlingFinishCallback.run()
- successCallback?.accept(true)
+ val animator =
+ TaskViewUtils.composeRecentsDesktopLaunchAnimator(
+ desktopTaskView,
+ stateManager,
+ depthController,
+ info,
+ t
+ ) {
+ errorHandlingFinishCallback.run()
+ successCallback?.accept(true)
+ }
+ if (!animated) {
+ animator.setDuration(0)
}
+ animator.start()
}
}
}
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
index 1c5a75d..c50e82d 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
@@ -29,6 +29,7 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.ComponentName;
+import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.View;
import android.view.ViewGroup;
@@ -80,6 +81,7 @@
SystemShortcut.Factory<QuickstepLauncher>, DeviceProfile.OnDeviceProfileChangeListener,
DragSource, ViewGroup.OnHierarchyChangeListener {
+ private static final String TAG = "HotseatPredictionController";
private static final int FLAG_UPDATE_PAUSED = 1 << 0;
private static final int FLAG_DRAG_IN_PROGRESS = 1 << 1;
private static final int FLAG_FILL_IN_PROGRESS = 1 << 2;
@@ -292,6 +294,16 @@
}
/**
+ * Ensures that if the flag FLAG_UPDATE_PAUSED is active we set it to false.
+ */
+ public void verifyUIUpdateNotPaused() {
+ if ((mPauseFlags & FLAG_UPDATE_PAUSED) != 0) {
+ setPauseUIUpdate(false);
+ Log.e(TAG, "FLAG_UPDATE_PAUSED should not be set to true (see b/339700174)");
+ }
+ }
+
+ /**
* Sets or updates the predicted items
*/
public void setPredictedItems(FixedContainerItems items) {
@@ -521,9 +533,12 @@
}
public void dump(String prefix, PrintWriter writer) {
- writer.println(prefix + this.getClass().getSimpleName());
+ writer.println(prefix + "HotseatPredictionController");
writer.println(prefix + "\tFlags: " + getStateString(mPauseFlags));
writer.println(prefix + "\tmHotSeatItemsCount: " + mHotSeatItemsCount);
- writer.println(prefix + "\tmPredictedItems: " + mPredictedItems);
+ writer.println(prefix + "\tmPredictedItems: " + mPredictedItems.size());
+ for (ItemInfo info : mPredictedItems) {
+ writer.println(prefix + "\t\t" + info);
+ }
}
}
diff --git a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
index 2fcbe4e..d604742 100644
--- a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
+++ b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
@@ -15,8 +15,8 @@
*/
package com.android.launcher3.model;
-import static com.android.launcher3.LauncherPrefs.nonRestorableItem;
import static com.android.launcher3.EncryptionType.ENCRYPTED;
+import static com.android.launcher3.LauncherPrefs.nonRestorableItem;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.quickstep.InstantAppResolverImpl.COMPONENT_CLASS_MARKER;
@@ -32,6 +32,7 @@
import com.android.launcher3.ConstantItem;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.QuickstepModelDelegate.PredictorState;
@@ -47,7 +48,7 @@
/**
* Task to update model as a result of predicted apps update
*/
-public class PredictionUpdateTask extends BaseModelUpdateTask {
+public class PredictionUpdateTask implements ModelUpdateTask {
public static final ConstantItem<Boolean> LAST_PREDICTION_ENABLED =
nonRestorableItem("last_prediction_enabled_state", true, ENCRYPTED);
@@ -61,8 +62,9 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
+ LauncherAppState app = taskController.getApp();
Context context = app.getContext();
// TODO: remove this
@@ -119,7 +121,7 @@
FixedContainerItems fci = new FixedContainerItems(mPredictorState.containerId, items);
dataModel.extraItems.put(fci.containerId, fci);
- bindExtraContainerItems(fci);
+ taskController.bindExtraContainerItems(fci);
usersForChangedShortcuts.forEach(
u -> dataModel.updateShortcutPinnedState(app.getContext(), u));
diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
index 65a49bd..6af5a30 100644
--- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
+++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
@@ -73,6 +73,7 @@
import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.IntSparseArrayMap;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.PersistedItemArray;
import com.android.quickstep.logging.SettingsChangeLogger;
import com.android.quickstep.logging.StatsLogCompatManager;
@@ -150,7 +151,8 @@
// TODO: Implement caching and preloading
WorkspaceItemFactory factory =
- new WorkspaceItemFactory(mApp, ums, pinnedShortcuts, numColumns, state.containerId);
+ new WorkspaceItemFactory(mApp, ums, mPmHelper, pinnedShortcuts, numColumns,
+ state.containerId);
FixedContainerItems fci = new FixedContainerItems(state.containerId,
state.storage.read(mApp.getContext(), factory, ums.allUsers::get));
if (FeatureFlags.CHANGE_MODEL_DELEGATE_LOADING_ORDER.get()) {
@@ -203,6 +205,7 @@
mActive = true;
}
+ @WorkerThread
@Override
public void workspaceLoadComplete() {
super.workspaceLoadComplete();
@@ -321,6 +324,7 @@
}
}
+ @WorkerThread
@Override
public void destroy() {
super.destroy();
@@ -530,6 +534,7 @@
private final LauncherAppState mAppState;
private final UserManagerState mUMS;
+ private final PackageManagerHelper mPmHelper;
private final Map<ShortcutKey, ShortcutInfo> mPinnedShortcuts;
private final int mMaxCount;
private final int mContainer;
@@ -537,9 +542,11 @@
private int mReadCount = 0;
protected WorkspaceItemFactory(LauncherAppState appState, UserManagerState ums,
- Map<ShortcutKey, ShortcutInfo> pinnedShortcuts, int maxCount, int container) {
+ PackageManagerHelper pmHelper, Map<ShortcutKey, ShortcutInfo> pinnedShortcuts,
+ int maxCount, int container) {
mAppState = appState;
mUMS = ums;
+ mPmHelper = pmHelper;
mPinnedShortcuts = pinnedShortcuts;
mMaxCount = maxCount;
mContainer = container;
@@ -563,6 +570,7 @@
lai,
UserCache.INSTANCE.get(mAppState.getContext()).getUserInfo(user),
ApiWrapper.INSTANCE.get(mAppState.getContext()),
+ mPmHelper,
mUMS.isUserQuiet(user));
info.container = mContainer;
mAppState.getIconCache().getTitleAndIcon(info, lai, false);
diff --git a/quickstep/src/com/android/launcher3/model/WellbeingModel.java b/quickstep/src/com/android/launcher3/model/WellbeingModel.java
index a7c9652..fb17f15 100644
--- a/quickstep/src/com/android/launcher3/model/WellbeingModel.java
+++ b/quickstep/src/com/android/launcher3/model/WellbeingModel.java
@@ -83,10 +83,8 @@
private final Handler mWorkerHandler;
private final ContentObserver mContentObserver;
- private final SimpleBroadcastReceiver mWellbeingAppChangeReceiver =
- new SimpleBroadcastReceiver(t -> restartObserver());
- private final SimpleBroadcastReceiver mAppAddRemoveReceiver =
- new SimpleBroadcastReceiver(this::onAppPackageChanged);
+ private final SimpleBroadcastReceiver mWellbeingAppChangeReceiver;
+ private final SimpleBroadcastReceiver mAppAddRemoveReceiver;
private final Object mModelLock = new Object();
// Maps the action Id to the corresponding RemoteAction
@@ -101,6 +99,11 @@
mWorkerHandler = new Handler(TextUtils.isEmpty(mWellbeingProviderPkg)
? Executors.UI_HELPER_EXECUTOR.getLooper()
: Executors.getPackageExecutor(mWellbeingProviderPkg).getLooper());
+ mWellbeingAppChangeReceiver =
+ new SimpleBroadcastReceiver(mWorkerHandler, t -> restartObserver());
+ mAppAddRemoveReceiver =
+ new SimpleBroadcastReceiver(mWorkerHandler, this::onAppPackageChanged);
+
mContentObserver = new ContentObserver(mWorkerHandler) {
@Override
@@ -111,6 +114,7 @@
mWorkerHandler.post(this::initializeInBackground);
}
+ @WorkerThread
private void initializeInBackground() {
if (!TextUtils.isEmpty(mWellbeingProviderPkg)) {
mContext.registerReceiver(
diff --git a/quickstep/src/com/android/launcher3/model/WidgetPredictionsRequester.java b/quickstep/src/com/android/launcher3/model/WidgetPredictionsRequester.java
index 8431396..8c98bab 100644
--- a/quickstep/src/com/android/launcher3/model/WidgetPredictionsRequester.java
+++ b/quickstep/src/com/android/launcher3/model/WidgetPredictionsRequester.java
@@ -40,7 +40,6 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.widget.PendingAddWidgetInfo;
import com.android.launcher3.widget.picker.WidgetRecommendationCategoryProvider;
@@ -60,25 +59,31 @@
public class WidgetPredictionsRequester {
private static final int NUM_OF_RECOMMENDED_WIDGETS_PREDICATION = 20;
private static final String BUNDLE_KEY_ADDED_APP_WIDGETS = "added_app_widgets";
+ // container/screenid/[positionx,positiony]/[spanx,spany]
+ // Matches the format passed used by PredictionHelper; But, position and size values aren't
+ // used, so, we pass default values.
+ @VisibleForTesting
+ static final String LAUNCH_LOCATION = "workspace/1/[0,0]/[2,2]";
@Nullable
private AppPredictor mAppPredictor;
private final Context mContext;
@NonNull
private final String mUiSurface;
+ private boolean mPredictionsAvailable;
@NonNull
- private final Map<PackageUserKey, List<WidgetItem>> mAllWidgets;
+ private final Map<ComponentKey, WidgetItem> mAllWidgets;
public WidgetPredictionsRequester(Context context, @NonNull String uiSurface,
- @NonNull Map<PackageUserKey, List<WidgetItem>> allWidgets) {
+ @NonNull Map<ComponentKey, WidgetItem> allWidgets) {
mContext = context;
mUiSurface = uiSurface;
mAllWidgets = Collections.unmodifiableMap(allWidgets);
}
/**
- * Requests predictions from the app predictions manager and registers the provided callback to
- * receive updates when predictions are available.
+ * Requests one time predictions from the app predictions manager and invokes provided callback
+ * once predictions are available.
*
* @param existingWidgets widgets that are currently added to the surface;
* @param callback consumer of prediction results to be called when predictions are
@@ -86,7 +91,7 @@
*/
public void request(List<AppWidgetProviderInfo> existingWidgets,
Consumer<List<ItemInfo>> callback) {
- Bundle bundle = buildBundleForPredictionSession(existingWidgets, mUiSurface);
+ Bundle bundle = buildBundleForPredictionSession(existingWidgets);
Predicate<WidgetItem> filter = notOnUiSurfaceFilter(existingWidgets);
MODEL_EXECUTOR.execute(() -> {
@@ -112,17 +117,14 @@
* Returns a bundle that can be passed in a prediction session
*
* @param addedWidgets widgets that are already added by the user in the ui surface
- * @param uiSurface a unique identifier of the surface hosting widgets; format
- * "widgets_xx"; note - "widgets" is reserved for home screen surface.
*/
@VisibleForTesting
- static Bundle buildBundleForPredictionSession(List<AppWidgetProviderInfo> addedWidgets,
- String uiSurface) {
+ static Bundle buildBundleForPredictionSession(List<AppWidgetProviderInfo> addedWidgets) {
Bundle bundle = new Bundle();
ArrayList<AppTargetEvent> addedAppTargetEvents = new ArrayList<>();
for (AppWidgetProviderInfo info : addedWidgets) {
ComponentName componentName = info.provider;
- AppTargetEvent appTargetEvent = buildAppTargetEvent(uiSurface, info, componentName);
+ AppTargetEvent appTargetEvent = buildAppTargetEvent(info, componentName);
addedAppTargetEvents.add(appTargetEvent);
}
bundle.putParcelableArrayList(BUNDLE_KEY_ADDED_APP_WIDGETS, addedAppTargetEvents);
@@ -134,13 +136,13 @@
* predictor.
* Also see {@link PredictionHelper}
*/
- private static AppTargetEvent buildAppTargetEvent(String uiSurface, AppWidgetProviderInfo info,
+ private static AppTargetEvent buildAppTargetEvent(AppWidgetProviderInfo info,
ComponentName componentName) {
AppTargetId appTargetId = new AppTargetId("widget:" + componentName.getPackageName());
AppTarget appTarget = new AppTarget.Builder(appTargetId, componentName.getPackageName(),
/*user=*/ info.getProfile()).setClassName(componentName.getClassName()).build();
- return new AppTargetEvent.Builder(appTarget, AppTargetEvent.ACTION_PIN)
- .setLaunchLocation(uiSurface).build();
+ return new AppTargetEvent.Builder(appTarget, AppTargetEvent.ACTION_PIN).setLaunchLocation(
+ LAUNCH_LOCATION).build();
}
/**
@@ -160,10 +162,14 @@
@WorkerThread
private void bindPredictions(List<AppTarget> targets, Predicate<WidgetItem> filter,
Consumer<List<ItemInfo>> callback) {
- List<WidgetItem> filteredPredictions = filterPredictions(targets, mAllWidgets, filter);
- List<ItemInfo> mappedPredictions = mapWidgetItemsToItemInfo(filteredPredictions);
+ if (!mPredictionsAvailable) {
+ mPredictionsAvailable = true;
+ List<WidgetItem> filteredPredictions = filterPredictions(targets, mAllWidgets, filter);
+ List<ItemInfo> mappedPredictions = mapWidgetItemsToItemInfo(filteredPredictions);
- MAIN_EXECUTOR.execute(() -> callback.accept(mappedPredictions));
+ MAIN_EXECUTOR.execute(() -> callback.accept(mappedPredictions));
+ MODEL_EXECUTOR.execute(this::clear);
+ }
}
/**
@@ -172,33 +178,19 @@
*/
@VisibleForTesting
static List<WidgetItem> filterPredictions(List<AppTarget> predictions,
- Map<PackageUserKey, List<WidgetItem>> allWidgets, Predicate<WidgetItem> filter) {
+ Map<ComponentKey, WidgetItem> allWidgets, Predicate<WidgetItem> filter) {
List<WidgetItem> servicePredictedItems = new ArrayList<>();
- List<WidgetItem> localFilteredWidgets = new ArrayList<>();
for (AppTarget prediction : predictions) {
- List<WidgetItem> widgetsInPackage = allWidgets.get(
- new PackageUserKey(prediction.getPackageName(), prediction.getUser()));
- if (widgetsInPackage == null || widgetsInPackage.isEmpty()) {
- continue;
- }
String className = prediction.getClassName();
if (!TextUtils.isEmpty(className)) {
- WidgetItem item = widgetsInPackage.stream()
- .filter(w -> className.equals(w.componentName.getClassName()))
- .filter(filter)
- .findFirst().orElse(null);
- if (item != null) {
- servicePredictedItems.add(item);
- continue;
+ WidgetItem widgetItem = allWidgets.get(
+ new ComponentKey(new ComponentName(prediction.getPackageName(), className),
+ prediction.getUser()));
+ if (widgetItem != null && filter.test(widgetItem)) {
+ servicePredictedItems.add(widgetItem);
}
}
- // No widget was added by the service, try local filtering
- widgetsInPackage.stream().filter(filter).findFirst()
- .ifPresent(localFilteredWidgets::add);
- }
- if (servicePredictedItems.isEmpty()) {
- servicePredictedItems.addAll(localFilteredWidgets);
}
return servicePredictedItems;
@@ -229,5 +221,6 @@
mAppPredictor.destroy();
mAppPredictor = null;
}
+ mPredictionsAvailable = false;
}
}
diff --git a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
index f4cbf17..0395d32 100644
--- a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
+++ b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
@@ -19,17 +19,17 @@
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION;
import android.app.prediction.AppTarget;
+import android.content.ComponentName;
import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.NonNull;
-import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.QuickstepModelDelegate.PredictorState;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.widget.PendingAddWidgetInfo;
import com.android.launcher3.widget.picker.WidgetRecommendationCategoryProvider;
@@ -41,7 +41,7 @@
import java.util.stream.Collectors;
/** Task to update model as a result of predicted widgets update */
-public final class WidgetsPredictionUpdateTask extends BaseModelUpdateTask {
+public final class WidgetsPredictionUpdateTask implements ModelUpdateTask {
private final PredictorState mPredictorState;
private final List<AppTarget> mTargets;
@@ -58,47 +58,35 @@
* workspace.
*/
@Override
- public void execute(@NonNull final LauncherAppState appState,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
Set<ComponentKey> widgetsInWorkspace = dataModel.appWidgets.stream().map(
widget -> new ComponentKey(widget.providerName, widget.user)).collect(
Collectors.toSet());
Predicate<WidgetItem> notOnWorkspace = w -> !widgetsInWorkspace.contains(w);
- Map<PackageUserKey, List<WidgetItem>> allWidgets =
- dataModel.widgetsModel.getAllWidgetsWithoutShortcuts();
+ Map<ComponentKey, WidgetItem> allWidgets =
+ dataModel.widgetsModel.getWidgetsByComponentKey();
List<WidgetItem> servicePredictedItems = new ArrayList<>();
- List<WidgetItem> localFilteredWidgets = new ArrayList<>();
for (AppTarget app : mTargets) {
- PackageUserKey packageUserKey = new PackageUserKey(app.getPackageName(), app.getUser());
- List<WidgetItem> widgets = allWidgets.get(packageUserKey);
- if (widgets == null || widgets.isEmpty()) {
+ ComponentKey componentKey = new ComponentKey(
+ new ComponentName(app.getPackageName(), app.getClassName()), app.getUser());
+ WidgetItem widget = allWidgets.get(componentKey);
+ if (widget == null) {
continue;
}
String className = app.getClassName();
if (!TextUtils.isEmpty(className)) {
- WidgetItem item = widgets.stream()
- .filter(w -> className.equals(w.componentName.getClassName()))
- .filter(notOnWorkspace)
- .findFirst()
- .orElse(null);
- if (item != null) {
- servicePredictedItems.add(item);
- continue;
+ if (notOnWorkspace.test(widget)) {
+ servicePredictedItems.add(widget);
}
}
- // No widget was added by the service, try local filtering
- widgets.stream().filter(notOnWorkspace).findFirst()
- .ifPresent(localFilteredWidgets::add);
- }
- if (servicePredictedItems.isEmpty()) {
- servicePredictedItems.addAll(localFilteredWidgets);
}
List<ItemInfo> items;
if (enableCategorizedWidgetSuggestions()) {
- Context context = appState.getContext();
+ Context context = taskController.getApp().getContext();
WidgetRecommendationCategoryProvider categoryProvider =
WidgetRecommendationCategoryProvider.newInstance(context);
items = servicePredictedItems.stream()
@@ -115,7 +103,7 @@
new FixedContainerItems(mPredictorState.containerId, items);
dataModel.extraItems.put(mPredictorState.containerId, fixedContainerItems);
- bindExtraContainerItems(fixedContainerItems);
+ taskController.bindExtraContainerItems(fixedContainerItems);
// Don't store widgets prediction to disk because it is not used frequently.
}
diff --git a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
index 184ea71..fe9ade9 100644
--- a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
+++ b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
@@ -25,7 +25,7 @@
/** {@link SystemShortcut.Factory} implementation to create workspace split shortcuts */
public interface QuickstepSystemShortcut {
- String TAG = QuickstepSystemShortcut.class.getSimpleName();
+ String TAG = "QuickstepSystemShortcut";
static SystemShortcut.Factory<QuickstepLauncher> getSplitSelectShortcutByPosition(
SplitPositionOption position) {
diff --git a/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt b/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt
index 2b6f77f..c94edce 100644
--- a/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt
+++ b/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt
@@ -45,7 +45,7 @@
) : SystemShortcut<T>(iconResId, labelResId, target, itemInfo, originalView) where
T : Context?,
T : ActivityContext? {
- private val TAG = SystemShortcut::class.java.simpleName
+ private val TAG = "SplitShortcut"
// Initiate splitscreen from the Home screen or Home All Apps
protected val splitSelectSource: SplitSelectSource?
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
index 882682d..4c24d95 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -19,6 +19,7 @@
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import android.animation.Animator;
@@ -74,8 +75,9 @@
mOnAttachListener = new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
- CrossWindowBlurListeners.getInstance().addListener(mLauncher.getMainExecutor(),
- mCrossWindowBlurListener);
+ UI_HELPER_EXECUTOR.execute(() ->
+ CrossWindowBlurListeners.getInstance().addListener(
+ mLauncher.getMainExecutor(), mCrossWindowBlurListener));
mLauncher.getScrimView().addOpaquenessListener(mOpaquenessListener);
// To handle the case where window token is invalid during last setDepth call.
@@ -108,7 +110,9 @@
private void removeSecondaryListeners() {
if (mCrossWindowBlurListener != null) {
- CrossWindowBlurListeners.getInstance().removeListener(mCrossWindowBlurListener);
+ UI_HELPER_EXECUTOR.execute(() ->
+ CrossWindowBlurListeners.getInstance()
+ .removeListener(mCrossWindowBlurListener));
}
if (mOpaquenessListener != null) {
mLauncher.getScrimView().removeOpaquenessListener(mOpaquenessListener);
@@ -182,7 +186,7 @@
}
public void dump(String prefix, PrintWriter writer) {
- writer.println(prefix + this.getClass().getSimpleName());
+ writer.println(prefix + "DepthController");
writer.println(prefix + "\tmMaxBlurRadius=" + mMaxBlurRadius);
writer.println(prefix + "\tmCrossWindowBlursEnabled=" + mCrossWindowBlursEnabled);
writer.println(prefix + "\tmSurface=" + mSurface);
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
index 9eabb55..e31b1d4 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
@@ -19,13 +19,13 @@
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
+import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;
import android.os.Debug;
-import android.os.SystemProperties;
import android.util.Log;
import android.view.View;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.Launcher;
@@ -35,8 +35,8 @@
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.GestureState;
import com.android.quickstep.SystemUiProxy;
-import com.android.quickstep.views.DesktopAppSelectView;
import com.android.wm.shell.desktopmode.IDesktopTaskListener;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import java.util.HashSet;
import java.util.Set;
@@ -49,10 +49,9 @@
private static final String TAG = "DesktopVisController";
private static final boolean DEBUG = false;
- private static final boolean IS_STASHING_ENABLED = SystemProperties.getBoolean(
- "persist.wm.debug.desktop_stashing", false);
private final Launcher mLauncher;
private final Set<DesktopVisibilityListener> mDesktopVisibilityListeners = new HashSet<>();
+ private final Set<TaskbarDesktopModeListener> mTaskbarDesktopModeListeners = new HashSet<>();
private int mVisibleDesktopTasksCount;
private boolean mInOverviewState;
@@ -60,8 +59,7 @@
private boolean mGestureInProgress;
@Nullable
- private IDesktopTaskListener mDesktopTaskListener;
- private DesktopAppSelectView mSelectAppToast;
+ private DesktopTaskListenerImpl mDesktopTaskListener;
public DesktopVisibilityController(Launcher launcher) {
mLauncher = launcher;
@@ -71,38 +69,7 @@
* Register a listener with System UI to receive updates about desktop tasks state
*/
public void registerSystemUiListener() {
- mDesktopTaskListener = new IDesktopTaskListener.Stub() {
- @Override
- public void onTasksVisibilityChanged(int displayId, int visibleTasksCount) {
- MAIN_EXECUTOR.execute(() -> {
- if (displayId == mLauncher.getDisplayId()) {
- if (DEBUG) {
- Log.d(TAG, "desktop visible tasks count changed=" + visibleTasksCount);
- }
- setVisibleDesktopTasksCount(visibleTasksCount);
- }
- });
- }
-
- @Override
- public void onStashedChanged(int displayId, boolean stashed) {
- if (!IS_STASHING_ENABLED) {
- return;
- }
- MAIN_EXECUTOR.execute(() -> {
- if (displayId == mLauncher.getDisplayId()) {
- if (DEBUG) {
- Log.d(TAG, "desktop stashed changed value=" + stashed);
- }
- if (stashed) {
- showSelectAppToast();
- } else {
- hideSelectAppToast();
- }
- }
- });
- }
- };
+ mDesktopTaskListener = new DesktopTaskListenerImpl(this, mLauncher.getDisplayId());
SystemUiProxy.INSTANCE.get(mLauncher).setDesktopTaskListener(mDesktopTaskListener);
}
@@ -111,6 +78,8 @@
*/
public void unregisterSystemUiListener() {
SystemUiProxy.INSTANCE.get(mLauncher).setDesktopTaskListener(null);
+ mDesktopTaskListener.release();
+ mDesktopTaskListener = null;
}
/**
@@ -142,6 +111,16 @@
mDesktopVisibilityListeners.remove(listener);
}
+ /** Registers a listener for Taskbar changes in Desktop Mode. */
+ public void registerTaskbarDesktopModeListener(TaskbarDesktopModeListener listener) {
+ mTaskbarDesktopModeListeners.add(listener);
+ }
+
+ /** Removes a previously registered listener for Taskbar changes in Desktop Mode. */
+ public void unregisterTaskbarDesktopModeListener(TaskbarDesktopModeListener listener) {
+ mTaskbarDesktopModeListeners.remove(listener);
+ }
+
/**
* Sets the number of desktop windows that are visible and updates launcher visibility based on
* it.
@@ -162,7 +141,7 @@
notifyDesktopVisibilityListeners(areDesktopTasksVisibleNow);
}
- if (!enableDesktopWindowingWallpaperActivity() && wasVisible != isVisible) {
+ if (!WALLPAPER_ACTIVITY.isEnabled(mLauncher) && wasVisible != isVisible) {
// TODO: b/333533253 - Remove after flag rollout
if (mVisibleDesktopTasksCount > 0) {
setLauncherViewsVisibility(View.INVISIBLE);
@@ -190,7 +169,7 @@
}
setBackgroundStateEnabled(state == BACKGROUND_APP);
// Desktop visibility tracks overview and background state separately
- setOverviewStateEnabled(state != BACKGROUND_APP && state.overviewUi);
+ setOverviewStateEnabled(state != BACKGROUND_APP && state.isRecentsViewVisible);
}
private void setOverviewStateEnabled(boolean overviewStateEnabled) {
@@ -206,7 +185,7 @@
notifyDesktopVisibilityListeners(areDesktopTasksVisibleNow);
}
- if (enableDesktopWindowingWallpaperActivity()) {
+ if (WALLPAPER_ACTIVITY.isEnabled(mLauncher)) {
return;
}
// TODO: b/333533253 - Clean up after flag rollout
@@ -233,6 +212,16 @@
DisplayController.handleInfoChangeForDesktopMode(mLauncher);
}
+ private void notifyTaskbarDesktopModeListeners(boolean doesAnyTaskRequireTaskbarRounding) {
+ if (DEBUG) {
+ Log.d(TAG, "notifyTaskbarDesktopModeListeners: doesAnyTaskRequireTaskbarRounding="
+ + doesAnyTaskRequireTaskbarRounding);
+ }
+ for (TaskbarDesktopModeListener listener : mTaskbarDesktopModeListeners) {
+ listener.onTaskbarCornerRoundingUpdate(doesAnyTaskRequireTaskbarRounding);
+ }
+ }
+
/**
* TODO: b/333533253 - Remove after flag rollout
*/
@@ -303,19 +292,10 @@
}
/**
- * Handle launcher moving to home due to home gesture or home button press.
- */
- public void onHomeActionTriggered() {
- if (IS_STASHING_ENABLED && areDesktopTasksVisible()) {
- SystemUiProxy.INSTANCE.get(mLauncher).stashDesktopApps(mLauncher.getDisplayId());
- }
- }
-
- /**
* TODO: b/333533253 - Remove after flag rollout
*/
private void setLauncherViewsVisibility(int visibility) {
- if (enableDesktopWindowingWallpaperActivity()) {
+ if (WALLPAPER_ACTIVITY.isEnabled(mLauncher)) {
return;
}
if (DEBUG) {
@@ -340,7 +320,7 @@
* TODO: b/333533253 - Remove after flag rollout
*/
private void markLauncherPaused() {
- if (enableDesktopWindowingWallpaperActivity()) {
+ if (WALLPAPER_ACTIVITY.isEnabled(mLauncher)) {
return;
}
if (DEBUG) {
@@ -357,7 +337,7 @@
* TODO: b/333533253 - Remove after flag rollout
*/
private void markLauncherResumed() {
- if (enableDesktopWindowingWallpaperActivity()) {
+ if (WALLPAPER_ACTIVITY.isEnabled(mLauncher)) {
return;
}
if (DEBUG) {
@@ -373,30 +353,6 @@
}
}
- private void showSelectAppToast() {
- if (mSelectAppToast != null) {
- return;
- }
- if (DEBUG) {
- Log.d(TAG, "show toast to select desktop apps");
- }
- Runnable onCloseCallback = () -> {
- SystemUiProxy.INSTANCE.get(mLauncher).hideStashedDesktopApps(mLauncher.getDisplayId());
- };
- mSelectAppToast = DesktopAppSelectView.show(mLauncher, onCloseCallback);
- }
-
- private void hideSelectAppToast() {
- if (mSelectAppToast == null) {
- return;
- }
- if (DEBUG) {
- Log.d(TAG, "hide toast to select desktop apps");
- }
- mSelectAppToast.hide();
- mSelectAppToast = null;
- }
-
/** A listener for when the user enters/exits Desktop Mode. */
public interface DesktopVisibilityListener {
/**
@@ -406,4 +362,65 @@
*/
void onDesktopVisibilityChanged(boolean visible);
}
+
+ /**
+ * Wrapper for the IDesktopTaskListener stub to prevent lingering references to the launcher
+ * activity via the controller.
+ */
+ private static class DesktopTaskListenerImpl extends IDesktopTaskListener.Stub {
+
+ private DesktopVisibilityController mController;
+ private final int mDisplayId;
+
+ DesktopTaskListenerImpl(@NonNull DesktopVisibilityController controller, int displayId) {
+ mController = controller;
+ mDisplayId = displayId;
+ }
+
+ /**
+ * Clears any references to the controller.
+ */
+ void release() {
+ mController = null;
+ }
+
+ @Override
+ public void onTasksVisibilityChanged(int displayId, int visibleTasksCount) {
+ MAIN_EXECUTOR.execute(() -> {
+ if (mController != null && displayId == mDisplayId) {
+ if (DEBUG) {
+ Log.d(TAG, "desktop visible tasks count changed=" + visibleTasksCount);
+ }
+ mController.setVisibleDesktopTasksCount(visibleTasksCount);
+ }
+ });
+ }
+
+ @Override
+ public void onStashedChanged(int displayId, boolean stashed) {
+ Log.w(TAG, "DesktopTaskListenerImpl: onStashedChanged is deprecated");
+ }
+
+ @Override
+ public void onTaskbarCornerRoundingUpdate(boolean doesAnyTaskRequireTaskbarRounding) {
+ MAIN_EXECUTOR.execute(() -> {
+ if (mController != null && DesktopModeStatus.useRoundedCorners()) {
+ Log.d(TAG, "DesktopTaskListenerImpl: doesAnyTaskRequireTaskbarRounding= "
+ + doesAnyTaskRequireTaskbarRounding);
+ mController.notifyTaskbarDesktopModeListeners(
+ doesAnyTaskRequireTaskbarRounding);
+ }
+ });
+ }
+ }
+
+ /** A listener for Taskbar in Desktop Mode. */
+ public interface TaskbarDesktopModeListener {
+ /**
+ * Callback for when task is resized in desktop mode.
+ *
+ * @param doesAnyTaskRequireTaskbarRounding whether task requires taskbar corner roundness.
+ */
+ void onTaskbarCornerRoundingUpdate(boolean doesAnyTaskRequireTaskbarRounding);
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java b/quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java
index c201236..a833ccf 100644
--- a/quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java
@@ -16,19 +16,24 @@
package com.android.launcher3.taskbar;
import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ShortcutInfo;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
+import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
+import com.android.quickstep.SystemUiProxy;
import java.util.ArrayList;
import java.util.List;
// TODO(b/218912746): Share more behavior to avoid all apps context depending directly on taskbar.
/** Base for common behavior between taskbar window contexts. */
-public abstract class BaseTaskbarContext extends ContextThemeWrapper implements ActivityContext {
+public abstract class BaseTaskbarContext extends ContextThemeWrapper implements ActivityContext,
+ SystemShortcut.BubbleActivityStarter {
protected final LayoutInflater mLayoutInflater;
private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
@@ -48,6 +53,18 @@
return mDPChangeListeners;
}
+ @Override
+ public void showShortcutBubble(ShortcutInfo info) {
+ if (info == null) return;
+ SystemUiProxy.INSTANCE.get(this).showShortcutBubble(info);
+ }
+
+ @Override
+ public void showAppBubble(Intent intent) {
+ if (intent == null || intent.getPackage() == null) return;
+ SystemUiProxy.INSTANCE.get(this).showAppBubble(intent);
+ }
+
/** Callback invoked when a drag is initiated within this context. */
public abstract void onDragStart();
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsController.kt b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsController.kt
deleted file mode 100644
index 3649c4e..0000000
--- a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsController.kt
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.taskbar
-
-import android.app.ActivityManager.RunningTaskInfo
-import android.app.WindowConfiguration
-import android.util.Log
-import android.util.SparseArray
-import androidx.annotation.VisibleForTesting
-import androidx.core.util.valueIterator
-import com.android.launcher3.model.data.AppInfo
-import com.android.launcher3.model.data.ItemInfo
-import com.android.launcher3.model.data.WorkspaceItemInfo
-import com.android.launcher3.statehandlers.DesktopVisibilityController
-import com.android.quickstep.RecentsModel
-import kotlin.collections.filterNotNull
-
-/**
- * Shows running apps when in Desktop Mode.
- *
- * Users can enter and exit Desktop Mode at run-time, meaning this class falls back to the default
- * recent-apps behaviour when outside of Desktop Mode.
- *
- * This class should only be used if
- * [com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps] is enabled.
- */
-class DesktopTaskbarRunningAppsController(
- private val recentsModel: RecentsModel,
- // Pass a provider here instead of the actual DesktopVisibilityController instance since that
- // instance might not be available when this constructor is called.
- private val desktopVisibilityControllerProvider: () -> DesktopVisibilityController?,
-) : TaskbarRecentAppsController() {
-
- private var apps: Array<AppInfo>? = null
- private var allRunningDesktopAppInfos: List<AppInfo>? = null
-
- private val desktopVisibilityController: DesktopVisibilityController?
- get() = desktopVisibilityControllerProvider()
-
- private val isInDesktopMode: Boolean
- get() = desktopVisibilityController?.areDesktopTasksVisible() ?: false
-
- override fun onDestroy() {
- super.onDestroy()
- apps = null
- }
-
- @VisibleForTesting
- public override fun setApps(apps: Array<AppInfo>?) {
- this.apps = apps
- }
-
- override fun isEnabled() = true
-
- @VisibleForTesting
- public override fun updateHotseatItemInfos(hotseatItems: Array<ItemInfo?>): Array<ItemInfo?> {
- if (!isInDesktopMode) {
- Log.d(TAG, "updateHotseatItemInfos: not in Desktop Mode")
- return hotseatItems
- }
- val newHotseatItemInfos =
- hotseatItems
- .filterNotNull()
- // Ignore predicted apps - we show running apps instead
- .filter { itemInfo -> !itemInfo.isPredictedItem }
- .toMutableList()
- val runningDesktopAppInfos =
- allRunningDesktopAppInfos?.let {
- getRunningDesktopAppInfosExceptHotseatApps(it, newHotseatItemInfos.toList())
- }
- if (runningDesktopAppInfos != null) {
- newHotseatItemInfos.addAll(runningDesktopAppInfos)
- }
- return newHotseatItemInfos.toTypedArray()
- }
-
- override fun getRunningApps(): Set<String> {
- if (!isInDesktopMode) {
- return emptySet()
- }
- return allRunningDesktopAppInfos?.mapNotNull { it.targetPackage }?.toSet() ?: emptySet()
- }
-
- @VisibleForTesting
- public override fun updateRunningApps() {
- if (!isInDesktopMode) {
- Log.d(TAG, "updateRunningApps: not in Desktop Mode")
- mControllers.taskbarViewController.commitRunningAppsToUI()
- return
- }
- allRunningDesktopAppInfos = getRunningDesktopAppInfos()
- mControllers.taskbarViewController.commitRunningAppsToUI()
- }
-
- private fun getRunningDesktopAppInfosExceptHotseatApps(
- allRunningDesktopAppInfos: List<AppInfo>,
- hotseatItems: List<ItemInfo>
- ): List<ItemInfo> {
- val hotseatPackages = hotseatItems.map { it.targetPackage }
- return allRunningDesktopAppInfos
- .filter { appInfo -> !hotseatPackages.contains(appInfo.targetPackage) }
- .map { WorkspaceItemInfo(it) }
- }
-
- private fun getRunningDesktopAppInfos(): List<AppInfo> {
- return getAppInfosFromRunningTasks(
- recentsModel.runningTasks
- .filter { taskInfo: RunningTaskInfo ->
- taskInfo.windowingMode == WindowConfiguration.WINDOWING_MODE_FREEFORM
- }
- .toList()
- )
- }
-
- // TODO(b/335398876) fetch app icons from Tasks instead of AppInfos
- private fun getAppInfosFromRunningTasks(tasks: List<RunningTaskInfo>): List<AppInfo> {
- // Early return if apps is empty, since we then have no AppInfo to compare to
- if (apps == null) {
- return emptyList()
- }
- val packageNames = tasks.map { it.realActivity?.packageName }.distinct().filterNotNull()
- return packageNames
- .map { packageName -> apps?.find { app -> packageName == app.targetPackage } }
- .filterNotNull()
- }
-
- private fun <E> SparseArray<E>.toList(): List<E> {
- return valueIterator().asSequence().toList()
- }
-
- companion object {
- private const val TAG = "TabletDesktopTaskbarRunningAppsController"
- }
-}
diff --git a/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java
index c0ecc61..06d9ee6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java
@@ -133,4 +133,9 @@
protected TISBindHelper getTISBindHelper() {
return mRecentsActivity.getTISBindHelper();
}
+
+ @Override
+ protected String getTaskbarUIControllerName() {
+ return "FallbackTaskbarUIController";
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
index b213203..46501c4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
@@ -148,7 +148,7 @@
});
}
- private void processLoadedTasks(ArrayList<GroupTask> tasks) {
+ private void processLoadedTasks(List<GroupTask> tasks) {
// Only store MAX_TASK tasks, from most to least recent
Collections.reverse(tasks);
mTasks = tasks.stream()
@@ -157,7 +157,7 @@
mNumHiddenTasks = Math.max(0, tasks.size() - MAX_TASKS);
}
- private void processLoadedTasksOnDesktop(ArrayList<GroupTask> tasks) {
+ private void processLoadedTasksOnDesktop(List<GroupTask> tasks) {
// Find the single desktop task that contains a grouping of desktop tasks
DesktopTask desktopTask = findDesktopTask(tasks);
@@ -173,7 +173,7 @@
}
@Nullable
- private DesktopTask findDesktopTask(ArrayList<GroupTask> tasks) {
+ private DesktopTask findDesktopTask(List<GroupTask> tasks) {
return (DesktopTask) tasks.stream()
.filter(t -> t instanceof DesktopTask)
.findFirst()
@@ -245,11 +245,20 @@
}
void updateThumbnailInBackground(Task task, Consumer<ThumbnailData> callback) {
- mModel.getThumbnailCache().updateThumbnailInBackground(task, callback);
+ mModel.getThumbnailCache().getThumbnailInBackground(task,
+ thumbnailData -> {
+ task.thumbnail = thumbnailData;
+ callback.accept(thumbnailData);
+ });
}
void updateIconInBackground(Task task, Consumer<Task> callback) {
- mModel.getIconCache().updateIconInBackground(task, callback);
+ mModel.getIconCache().getIconInBackground(task, (icon, contentDescription, title) -> {
+ task.icon = icon;
+ task.titleDescription = contentDescription;
+ task.title = title;
+ callback.accept(task);
+ });
}
void onCloseComplete() {
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java
index 48fc7d1..39b4f77 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java
@@ -186,7 +186,7 @@
@NonNull ImageView thumbnailView,
@ColorInt int backgroundColor,
@Nullable ThumbnailData thumbnailData) {
- Bitmap bm = thumbnailData == null ? null : thumbnailData.thumbnail;
+ Bitmap bm = thumbnailData == null ? null : thumbnailData.getThumbnail();
if (thumbnailView.getVisibility() != VISIBLE) {
thumbnailView.setVisibility(VISIBLE);
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java
index 5d47212..dbd9c73 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java
@@ -46,6 +46,7 @@
import androidx.core.content.res.ResourcesCompat;
import com.android.app.animation.Interpolators;
+import com.android.internal.jank.Cuj;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat;
@@ -53,6 +54,8 @@
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.util.DesktopTask;
import com.android.quickstep.util.GroupTask;
+import com.android.systemui.shared.recents.model.Task;
+import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import java.util.HashMap;
import java.util.List;
@@ -211,9 +214,16 @@
resources.getString(R.string.quick_switch_desktop),
Locale.getDefault()).format(args));
} else {
+ final boolean firstTaskIsLeftTopTask =
+ groupTask.mSplitBounds == null
+ || groupTask.mSplitBounds.leftTopTaskId == groupTask.task1.key.id;
+ final Task leftTopTask = firstTaskIsLeftTopTask
+ ? groupTask.task1 : groupTask.task2;
+ final Task rightBottomTask = firstTaskIsLeftTopTask
+ ? groupTask.task2 : groupTask.task1;
currentTaskView.setThumbnails(
- groupTask.task1,
- groupTask.task2,
+ leftTopTask,
+ rightBottomTask,
updateTasks ? mViewCallbacks::updateThumbnailInBackground : null,
updateTasks ? mViewCallbacks::updateIconInBackground : null);
}
@@ -331,6 +341,8 @@
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
+ InteractionJankMonitorWrapper.begin(
+ KeyboardQuickSwitchView.this, Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_OPEN);
setClipToPadding(false);
setOutlineProvider(new ViewOutlineProvider() {
@Override
@@ -366,12 +378,19 @@
}
@Override
+ public void onAnimationCancel(Animator animation) {
+ super.onAnimationCancel(animation);
+ InteractionJankMonitorWrapper.cancel(Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_OPEN);
+ }
+
+ @Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
setClipToPadding(true);
setOutlineProvider(outlineProvider);
invalidateOutline();
mOpenAnimation = null;
+ InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_OPEN);
}
});
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
index d6ee92f..d411ba6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
@@ -15,12 +15,8 @@
*/
package com.android.launcher3.taskbar;
-import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_UNDEFINED;
-
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-
import android.animation.Animator;
-import android.app.ActivityOptions;
+import android.animation.AnimatorListenerAdapter;
import android.view.KeyEvent;
import android.view.animation.AnimationUtils;
import android.window.RemoteTransition;
@@ -28,16 +24,15 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.internal.jank.Cuj;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext;
-import com.android.quickstep.SystemUiProxy;
-import com.android.quickstep.util.DesktopTask;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.SlideInRemoteTransition;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.QuickStepContract;
import java.io.PrintWriter;
@@ -101,18 +96,28 @@
protected void closeQuickSwitchView(boolean animate) {
if (isCloseAnimationRunning()) {
- // Let currently-running animation finish.
if (!animate) {
mCloseAnimation.end();
}
+ // Let currently-running animation finish.
return;
}
if (!animate) {
+ InteractionJankMonitorWrapper.begin(
+ mKeyboardQuickSwitchView, Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_CLOSE);
onCloseComplete();
return;
}
mCloseAnimation = mKeyboardQuickSwitchView.getCloseAnimation();
+ mCloseAnimation.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ super.onAnimationStart(animation);
+ InteractionJankMonitorWrapper.begin(
+ mKeyboardQuickSwitchView, Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_CLOSE);
+ }
+ });
mCloseAnimation.addListener(AnimatorListeners.forEndCallback(this::onCloseComplete));
mCloseAnimation.start();
}
@@ -150,36 +155,26 @@
return -1;
}
+ Runnable onStartCallback = () -> InteractionJankMonitorWrapper.begin(
+ mKeyboardQuickSwitchView, Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_APP_LAUNCH);
+ Runnable onFinishCallback = () -> InteractionJankMonitorWrapper.end(
+ Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_APP_LAUNCH);
TaskbarActivityContext context = mControllers.taskbarActivityContext;
RemoteTransition remoteTransition = new RemoteTransition(new SlideInRemoteTransition(
Utilities.isRtl(mControllers.taskbarActivityContext.getResources()),
context.getDeviceProfile().overviewPageSpacing,
QuickStepContract.getWindowCornerRadius(context),
AnimationUtils.loadInterpolator(
- context, android.R.interpolator.fast_out_extra_slow_in)),
+ context, android.R.interpolator.fast_out_extra_slow_in),
+ onStartCallback,
+ onFinishCallback),
"SlideInTransition");
- if (task instanceof DesktopTask) {
- UI_HELPER_EXECUTOR.execute(() ->
- SystemUiProxy.INSTANCE.get(mKeyboardQuickSwitchView.getContext())
- .showDesktopApps(
- mKeyboardQuickSwitchView.getDisplay().getDisplayId(),
- remoteTransition));
- } else if (mOnDesktop) {
- UI_HELPER_EXECUTOR.execute(() ->
- SystemUiProxy.INSTANCE.get(mKeyboardQuickSwitchView.getContext())
- .showDesktopApp(task.task1.key.id));
- } else if (task.task2 == null) {
- UI_HELPER_EXECUTOR.execute(() -> {
- ActivityOptions activityOptions = mControllers.taskbarActivityContext
- .makeDefaultActivityOptions(SPLASH_SCREEN_STYLE_UNDEFINED).options;
- activityOptions.setRemoteTransition(remoteTransition);
-
- ActivityManagerWrapper.getInstance().startActivityFromRecents(
- task.task1.key, activityOptions);
- });
- } else {
- mControllers.uiController.launchSplitTasks(task, remoteTransition);
- }
+ mControllers.taskbarActivityContext.handleGroupTaskLaunch(
+ task,
+ remoteTransition,
+ mOnDesktop,
+ onStartCallback,
+ onFinishCallback);
return -1;
}
@@ -187,6 +182,7 @@
mCloseAnimation = null;
mOverlayContext.getDragLayer().removeView(mKeyboardQuickSwitchView);
mControllerCallbacks.onCloseComplete();
+ InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_CLOSE);
}
protected void onDestroy() {
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 2c2311a..96a6d28 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -20,14 +20,11 @@
import static com.android.launcher3.taskbar.TaskbarEduTooltipControllerKt.TOOLTIP_STEP_FEATURES;
import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_VISIBLE;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
-import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
+import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;
import android.animation.Animator;
import android.animation.AnimatorSet;
-import android.os.RemoteException;
-import android.util.Log;
-import android.view.TaskTransitionSpec;
-import android.view.WindowManagerGlobal;
+import android.graphics.Rect;
import android.window.RemoteTransition;
import androidx.annotation.NonNull;
@@ -37,7 +34,6 @@
import com.android.launcher3.Flags;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
-import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.logging.InstanceId;
@@ -56,6 +52,7 @@
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.TISBindHelper;
import com.android.quickstep.views.RecentsView;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -139,7 +136,11 @@
mLauncher.setTaskbarUIController(null);
mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
mHomeState.removeListener(mVisibilityChangeListener);
- updateTaskTransitionSpec(true);
+ }
+
+ /** Returns {@code true} if launcher is currently presenting the home screen. */
+ public boolean isOnHome() {
+ return mTaskbarLauncherStateController.isOnHome();
}
private void onInAppDisplayProgressChanged() {
@@ -185,6 +186,24 @@
}
/**
+ * Returns the bounds of launcher's hotseat.
+ */
+ public void getHotseatBounds(Rect hotseatBoundsOut) {
+ DeviceProfile launcherDP = mLauncher.getDeviceProfile();
+ if (launcherDP.isQsbInline) {
+ // Not currently supported.
+ hotseatBoundsOut.setEmpty();
+ return;
+ }
+ int left = (launcherDP.widthPx - launcherDP.getHotseatWidthPx()
+ - mLauncher.getHotseat().getUnusedHorizontalSpace()) / 2;
+ int right = left + launcherDP.getHotseatWidthPx();
+ int bottom = launcherDP.getHotseatLayoutPadding(mLauncher).bottom;
+ int top = bottom - launcherDP.hotseatCellHeightPx;
+ hotseatBoundsOut.set(left, top, right, bottom);
+ }
+
+ /**
* Should be called from onResume() and onPause(), and animates the Taskbar accordingly.
*/
@Override
@@ -210,15 +229,18 @@
// Launcher is resumed during the swipe-to-overview gesture under shell-transitions, so
// avoid updating taskbar state in that situation (when it's non-interactive -- or
// "background") to avoid premature animations.
- if (ENABLE_SHELL_TRANSITIONS && isVisible
- && mLauncher.getStateManager().getState().hasFlag(FLAG_NON_INTERACTIVE)
- && !mLauncher.getStateManager().getState().isTaskbarAlignedWithHotseat(mLauncher)) {
+ LauncherState state = mLauncher.getStateManager().getState();
+ boolean nonInteractiveState = state.hasFlag(FLAG_NON_INTERACTIVE)
+ && !state.isTaskbarAlignedWithHotseat(mLauncher);
+ if ((ENABLE_SHELL_TRANSITIONS
+ && isVisible
+ && (nonInteractiveState || mSkipLauncherVisibilityChange))) {
return null;
}
DesktopVisibilityController desktopController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
- if (!enableDesktopWindowingWallpaperActivity()
+ if (!WALLPAPER_ACTIVITY.isEnabled(mLauncher)
&& desktopController != null
&& desktopController.areDesktopTasksVisible()) {
// TODO: b/333533253 - Remove after flag rollout
@@ -226,7 +248,7 @@
}
mTaskbarLauncherStateController.updateStateForFlag(FLAG_VISIBLE, isVisible);
- if (fromInit) {
+ if (fromInit || mControllers == null) {
duration = 0;
}
return mTaskbarLauncherStateController.applyState(duration, startAnimation);
@@ -267,7 +289,12 @@
}
public boolean isDraggingItem() {
- return mControllers.taskbarDragController.isDragging();
+ boolean bubblesDragging = false;
+ if (mControllers.bubbleControllers.isPresent()) {
+ bubblesDragging =
+ mControllers.bubbleControllers.get().bubbleDragController.isDragging();
+ }
+ return mControllers.taskbarDragController.isDragging() || bubblesDragging;
}
@Override
@@ -278,26 +305,6 @@
private void onStashedInAppChanged(DeviceProfile deviceProfile) {
boolean taskbarStashedInApps = mControllers.taskbarStashController.isStashedInApp();
deviceProfile.isTaskbarPresentInApps = !taskbarStashedInApps;
- updateTaskTransitionSpec(taskbarStashedInApps);
- }
-
- private void updateTaskTransitionSpec(boolean taskbarIsHidden) {
- try {
- if (taskbarIsHidden) {
- // Clear custom task transition settings when the taskbar is stashed
- WindowManagerGlobal.getWindowManagerService().clearTaskTransitionSpec();
- } else {
- // Adjust task transition spec to account for taskbar being visible
- WindowManagerGlobal.getWindowManagerService().setTaskTransitionSpec(
- new TaskTransitionSpec(
- mLauncher.getColor(R.color.taskbar_background)));
- }
- } catch (RemoteException e) {
- // This shouldn't happen but if it does task animations won't look good until the
- // taskbar stashing state is changed.
- Log.e(TAG, "Failed to update task transition spec to account for new taskbar state",
- e);
- }
}
/**
@@ -405,7 +412,7 @@
}
@Override
- public void updateStateForSysuiFlags(int sysuiFlags) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long sysuiFlags) {
mTaskbarLauncherStateController.updateStateForSysuiFlags(sysuiFlags);
}
@@ -472,4 +479,9 @@
mTaskbarLauncherStateController.dumpLogs(prefix + "\t", pw);
}
+
+ @Override
+ protected String getTaskbarUIControllerName() {
+ return "LauncherTaskbarUIController";
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index d5306fb..a979d58 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -41,10 +41,12 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SHORTCUT_HELPER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
import android.animation.ArgbEvaluator;
@@ -61,7 +63,6 @@
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region.Op;
-import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.PaintDrawable;
import android.graphics.drawable.RotateDrawable;
@@ -72,11 +73,10 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnAttachStateChangeListener;
-import android.view.View.OnClickListener;
-import android.view.View.OnHoverListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
+import android.view.inputmethod.Flags;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -103,8 +103,9 @@
import com.android.systemui.shared.navigationbar.KeyButtonRipple;
import com.android.systemui.shared.rotation.FloatingRotationButton;
import com.android.systemui.shared.rotation.RotationButton;
-import com.android.systemui.shared.rotation.RotationButtonController;
+import com.android.systemui.shared.statusbar.phone.BarTransitions;
import com.android.systemui.shared.system.QuickStepContract;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -133,6 +134,7 @@
private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12;
private static final int FLAG_SMALL_SCREEN = 1 << 13;
private static final int FLAG_SLIDE_IN_VIEW_VISIBLE = 1 << 14;
+ private static final int FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING = 1 << 15;
/**
* Flags where a UI could be over Taskbar surfaces, so the color override should be disabled.
@@ -150,6 +152,8 @@
public static final int ALPHA_INDEX_SUW = 2;
private static final int NUM_ALPHA_CHANNELS = 3;
+ private static final long AUTODIM_TIMEOUT_MS = 2250;
+
private final ArrayList<StatePropertyHolder> mPropertyHolders = new ArrayList<>();
private final ArrayList<ImageView> mAllButtons = new ArrayList<>();
private int mState;
@@ -158,6 +162,7 @@
private final @Nullable Context mNavigationBarPanelContext;
private final WindowManagerProxy mWindowManagerProxy;
private final NearestTouchFrame mNavButtonsView;
+ private final Handler mHandler;
private final LinearLayout mNavButtonContainer;
// Used for IME+A11Y buttons
private final ViewGroup mEndContextualContainer;
@@ -179,7 +184,7 @@
this::updateNavButtonInAppDisplayProgressForSysui);
/** Expected nav button dark intensity communicated via the framework. */
private final AnimatedFloat mTaskbarNavButtonDarkIntensity = new AnimatedFloat(
- this::updateNavButtonColor);
+ this::onDarkIntensityChanged);
/** {@code 1} if the Taskbar background color is fully opaque. */
private final AnimatedFloat mOnTaskbarBackgroundNavButtonColorOverride = new AnimatedFloat(
this::updateNavButtonColor);
@@ -197,7 +202,8 @@
private TaskbarControllers mControllers;
private boolean mIsImeRenderingNavButtons;
private ImageView mA11yButton;
- private int mSysuiStateFlags;
+ @SystemUiStateFlags
+ private long mSysuiStateFlags;
private ImageView mBackButton;
private ImageView mHomeButton;
private MultiValueAlpha mBackButtonAlpha;
@@ -214,12 +220,19 @@
private ImageView mRecentsButton;
private Space mSpace;
+ private TaskbarTransitions mTaskbarTransitions;
+ private @BarTransitions.TransitionMode int mTransitionMode;
+
+ private final Runnable mAutoDim = () -> mTaskbarTransitions.setAutoDim(true);
+
public NavbarButtonsViewController(TaskbarActivityContext context,
- @Nullable Context navigationBarPanelContext, NearestTouchFrame navButtonsView) {
+ @Nullable Context navigationBarPanelContext, NearestTouchFrame navButtonsView,
+ Handler handler) {
mContext = context;
mNavigationBarPanelContext = navigationBarPanelContext;
mWindowManagerProxy = WindowManagerProxy.INSTANCE.get(mContext);
mNavButtonsView = navButtonsView;
+ mHandler = handler;
mNavButtonContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
mEndContextualContainer = mNavButtonsView.findViewById(R.id.end_contextual_buttons);
mStartContextualContainer = mNavButtonsView.findViewById(R.id.start_contextual_buttons);
@@ -229,6 +242,10 @@
mOnBackgroundIconColor = Utilities.isDarkTheme(context)
? context.getColor(R.color.taskbar_nav_icon_light_color)
: context.getColor(R.color.taskbar_nav_icon_dark_color);
+
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions = new TaskbarTransitions(mContext, mNavButtonsView);
+ }
}
/**
@@ -243,17 +260,28 @@
boolean isThreeButtonNav = mContext.isThreeButtonNav();
DeviceProfile deviceProfile = mContext.getDeviceProfile();
Resources resources = mContext.getResources();
- Point p = !mContext.isUserSetupComplete()
- ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowSize())
- : DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources,
- mContext.isPhoneMode());
- mNavButtonsView.getLayoutParams().height = p.y;
+
+ int setupSize = mControllers.taskbarActivityContext.getSetupWindowSize();
+ Point p = DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources,
+ mContext.isPhoneMode(), mContext.isGestureNav());
+ ViewGroup.LayoutParams navButtonsViewLayoutParams = mNavButtonsView.getLayoutParams();
+ navButtonsViewLayoutParams.width = p.x;
+ if (!mContext.isUserSetupComplete()) {
+ // Setup mode in phone mode uses gesture nav.
+ navButtonsViewLayoutParams.height = setupSize;
+ } else {
+ navButtonsViewLayoutParams.height = p.y;
+ }
+ mNavButtonsView.setLayoutParams(navButtonsViewLayoutParams);
mIsImeRenderingNavButtons =
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
if (!mIsImeRenderingNavButtons) {
// IME switcher
- mImeSwitcherButton = addButton(R.drawable.ic_ime_switcher, BUTTON_IME_SWITCH,
+ final int switcherResId = Flags.imeSwitcherRevamp()
+ ? com.android.internal.R.drawable.ic_ime_switcher_new
+ : R.drawable.ic_ime_switcher;
+ mImeSwitcherButton = addButton(switcherResId, BUTTON_IME_SWITCH,
isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(mImeSwitcherButton,
@@ -272,8 +300,13 @@
.get(ALPHA_INDEX_SMALL_SCREEN),
flags -> (flags & FLAG_SMALL_SCREEN) == 0));
- mPropertyHolders.add(new StatePropertyHolder(mControllers.taskbarDragLayerController
- .getKeyguardBgTaskbar(), flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0));
+ if (!mContext.isPhoneMode()) {
+ mPropertyHolders.add(new StatePropertyHolder(mControllers.taskbarDragLayerController
+ .getKeyguardBgTaskbar(), flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0));
+ }
+
+ // Start at 1 because relevant flags are unset at init.
+ mOnBackgroundNavButtonColorOverrideMultiplier.value = 1;
// Force nav buttons (specifically back button) to be visible during setup wizard.
boolean isInSetup = !mContext.isUserSetupComplete();
@@ -284,39 +317,42 @@
// - Notification shade is expanded
// - IME is showing (add separate translation for IME)
// - VoiceInteractionWindow (assistant) is showing
- int flagsToRemoveTranslation = FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_IME_VISIBLE
- | FLAG_VOICE_INTERACTION_WINDOW_SHOWING;
- mPropertyHolders.add(new StatePropertyHolder(mNavButtonInAppDisplayProgressForSysui,
- flags -> (flags & flagsToRemoveTranslation) != 0, AnimatedFloat.VALUE,
- 1, 0));
- // Center nav buttons in new height for IME.
- float transForIme = (mContext.getDeviceProfile().taskbarHeight
- - mControllers.taskbarInsetsController.getTaskbarHeightForIme()) / 2f;
- // For gesture nav, nav buttons only show for IME anyway so keep them translated down.
- float defaultButtonTransY = alwaysShowButtons ? 0 : transForIme;
- mPropertyHolders.add(new StatePropertyHolder(mTaskbarNavButtonTranslationYForIme,
- flags -> (flags & FLAG_IME_VISIBLE) != 0 && !isInKidsMode, AnimatedFloat.VALUE,
- transForIme, defaultButtonTransY));
+ // - Keyboard shortcuts helper is showing
+ if (!mContext.isPhoneMode()) {
+ int flagsToRemoveTranslation = FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_IME_VISIBLE
+ | FLAG_VOICE_INTERACTION_WINDOW_SHOWING | FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING;
+ mPropertyHolders.add(new StatePropertyHolder(mNavButtonInAppDisplayProgressForSysui,
+ flags -> (flags & flagsToRemoveTranslation) != 0, AnimatedFloat.VALUE,
+ 1, 0));
+ // Center nav buttons in new height for IME.
+ float transForIme = (mContext.getDeviceProfile().taskbarHeight
+ - mControllers.taskbarInsetsController.getTaskbarHeightForIme()) / 2f;
+ // For gesture nav, nav buttons only show for IME anyway so keep them translated down.
+ float defaultButtonTransY = alwaysShowButtons ? 0 : transForIme;
+ mPropertyHolders.add(new StatePropertyHolder(mTaskbarNavButtonTranslationYForIme,
+ flags -> (flags & FLAG_IME_VISIBLE) != 0 && !isInKidsMode, AnimatedFloat.VALUE,
+ transForIme, defaultButtonTransY));
- // Start at 1 because relevant flags are unset at init.
- mOnBackgroundNavButtonColorOverrideMultiplier.value = 1;
- mPropertyHolders.add(new StatePropertyHolder(
- mOnBackgroundNavButtonColorOverrideMultiplier,
- flags -> (flags & FLAGS_ON_BACKGROUND_COLOR_OVERRIDE_DISABLED) == 0));
+ mPropertyHolders.add(new StatePropertyHolder(
+ mOnBackgroundNavButtonColorOverrideMultiplier,
+ flags -> (flags & FLAGS_ON_BACKGROUND_COLOR_OVERRIDE_DISABLED) == 0));
- mPropertyHolders.add(new StatePropertyHolder(
- mSlideInViewVisibleNavButtonColorOverride,
- flags -> (flags & FLAG_SLIDE_IN_VIEW_VISIBLE) != 0));
+ mPropertyHolders.add(new StatePropertyHolder(
+ mSlideInViewVisibleNavButtonColorOverride,
+ flags -> (flags & FLAG_SLIDE_IN_VIEW_VISIBLE) != 0));
+ }
if (alwaysShowButtons) {
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);
updateButtonLayoutSpacing();
- updateStateForFlag(FLAG_SMALL_SCREEN, mContext.isPhoneButtonNavMode());
+ updateStateForFlag(FLAG_SMALL_SCREEN, mContext.isPhoneMode());
- mPropertyHolders.add(new StatePropertyHolder(
- mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(),
- flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
+ if (!mContext.isPhoneMode()) {
+ mPropertyHolders.add(new StatePropertyHolder(
+ mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(),
+ flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
+ }
} else if (!mIsImeRenderingNavButtons) {
View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
mStartContextualContainer, mControllers.navButtonController, R.id.back);
@@ -339,12 +375,15 @@
R.bool.floating_rotation_button_position_left);
mControllers.rotationButtonController.setRotationButton(mFloatingRotationButton,
mRotationButtonListener);
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.init();
+ }
applyState();
mPropertyHolders.forEach(StatePropertyHolder::endAnimation);
// Initialize things needed to move nav buttons to separate window.
- mSeparateWindowParent = new BaseDragLayer<TaskbarActivityContext>(mContext, null, 0) {
+ mSeparateWindowParent = new BaseDragLayer<>(mContext, null, 0) {
@Override
public void recreateControllers() {
mControllers = new TouchController[0];
@@ -376,8 +415,15 @@
(flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 ||
(flags & FLAG_KEYGUARD_OCCLUDED) != 0;
return (flags & FLAG_DISABLE_BACK) == 0
+ && (!mContext.isGestureNav() || !mContext.isUserSetupComplete())
&& ((flags & FLAG_KEYGUARD_VISIBLE) == 0 || showingOnKeyguard);
}));
+ // Hide back button in SUW if keyboard is showing (IME draws its own back).
+ if (mIsImeRenderingNavButtons) {
+ mPropertyHolders.add(new StatePropertyHolder(
+ mBackButtonAlpha.get(ALPHA_INDEX_SUW),
+ flags -> (flags & FLAG_IME_VISIBLE) == 0));
+ }
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
flags -> (flags & FLAG_IME_VISIBLE) != 0,
ROTATION_DRAWABLE_PERCENT, 1f, 0f));
@@ -400,8 +446,8 @@
mPropertyHolders.add(
new StatePropertyHolder(mHomeButtonAlpha.get(
ALPHA_INDEX_KEYGUARD_OR_DISABLE),
- flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
- (flags & FLAG_DISABLE_HOME) == 0));
+ flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0
+ && (flags & FLAG_DISABLE_HOME) == 0 && !mContext.isGestureNav()));
// Recents button
mRecentsButton = addButton(R.drawable.ic_sysbar_recent, BUTTON_RECENTS,
@@ -419,7 +465,7 @@
});
mPropertyHolders.add(new StatePropertyHolder(mRecentsButton,
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 && (flags & FLAG_DISABLE_RECENTS) == 0
- && !mContext.isNavBarKidsModeActive()));
+ && !mContext.isNavBarKidsModeActive() && !mContext.isGestureNav()));
// A11y button
mA11yButton = addButton(R.drawable.ic_sysbar_accessibility_button, BUTTON_A11Y,
@@ -435,7 +481,7 @@
navButtonController.onButtonLongClick(BUTTON_SPACE, view));
}
- private void parseSystemUiFlags(int sysUiStateFlags) {
+ private void parseSystemUiFlags(@SystemUiStateFlags long sysUiStateFlags) {
mSysuiStateFlags = sysUiStateFlags;
boolean isImeVisible = (sysUiStateFlags & SYSUI_STATE_IME_SHOWING) != 0;
boolean isImeSwitcherShowing = (sysUiStateFlags & SYSUI_STATE_IME_SWITCHER_SHOWING) != 0;
@@ -443,12 +489,14 @@
boolean isHomeDisabled = (sysUiStateFlags & SYSUI_STATE_HOME_DISABLED) != 0;
boolean isRecentsDisabled = (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0;
boolean isBackDisabled = (sysUiStateFlags & SYSUI_STATE_BACK_DISABLED) != 0;
- int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
+ long shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
boolean isNotificationShadeExpanded = (sysUiStateFlags & shadeExpandedFlags) != 0;
boolean isScreenPinningActive = (sysUiStateFlags & SYSUI_STATE_SCREEN_PINNING) != 0;
boolean isVoiceInteractionWindowShowing =
(sysUiStateFlags & SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING) != 0;
+ boolean isKeyboardShortcutHelperShowing =
+ (sysUiStateFlags & SYSUI_STATE_SHORTCUT_HELPER_SHOWING) != 0;
// TODO(b/202218289) we're getting IME as not visible on lockscreen from system
updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
@@ -460,6 +508,7 @@
updateStateForFlag(FLAG_NOTIFICATION_SHADE_EXPANDED, isNotificationShadeExpanded);
updateStateForFlag(FLAG_SCREEN_PINNING_ACTIVE, isScreenPinningActive);
updateStateForFlag(FLAG_VOICE_INTERACTION_WINDOW_SHOWING, isVoiceInteractionWindowShowing);
+ updateStateForFlag(FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING, isKeyboardShortcutHelperShowing);
if (mA11yButton != null) {
// Only used in 3 button
@@ -470,7 +519,8 @@
}
}
- public void updateStateForSysuiFlags(int systemUiStateFlags, boolean skipAnim) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags,
+ boolean skipAnim) {
if (systemUiStateFlags == mSysuiStateFlags) {
return;
}
@@ -588,6 +638,48 @@
mBackButton.setAccessibilityDelegate(accessibilityDelegate);
}
+ public void setWallpaperVisible(boolean isVisible) {
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.setWallpaperVisibility(isVisible);
+ }
+ }
+
+ public void onTransitionModeUpdated(int barMode, boolean checkBarModes) {
+ mTransitionMode = barMode;
+ if (checkBarModes) {
+ checkNavBarModes();
+ }
+ }
+
+ public void checkNavBarModes() {
+ if (mContext.isPhoneMode()) {
+ boolean isBarHidden = (mSysuiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) != 0;
+ mTaskbarTransitions.transitionTo(mTransitionMode, !isBarHidden);
+ }
+ }
+
+ public void finishBarAnimations() {
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.finishAnimations();
+ }
+ }
+
+ public void touchAutoDim(boolean reset) {
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.setAutoDim(false);
+ mHandler.removeCallbacks(mAutoDim);
+ if (reset) {
+ mHandler.postDelayed(mAutoDim, AUTODIM_TIMEOUT_MS);
+ }
+ }
+ }
+
+ public void transitionTo(@BarTransitions.TransitionMode int barMode, boolean animate) {
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.transitionTo(barMode, animate);
+ }
+ }
+
/** Use to set the translationY for the all nav+contextual buttons */
public AnimatedFloat getTaskbarNavButtonTranslationY() {
return mTaskbarNavButtonTranslationY;
@@ -622,7 +714,7 @@
private void applyState() {
int count = mPropertyHolders.size();
for (int i = 0; i < count; i++) {
- mPropertyHolders.get(i).setState(mState);
+ mPropertyHolders.get(i).setState(mState, mContext.isGestureNav());
}
}
@@ -662,14 +754,18 @@
mLightIconColorOnHome,
mDarkIconColorOnHome);
- // Override the color from framework if nav buttons are over an opaque Taskbar surface.
- final int iconColor = (int) argbEvaluator.evaluate(
- mOnBackgroundNavButtonColorOverrideMultiplier.value
- * Math.max(
- mOnTaskbarBackgroundNavButtonColorOverride.value,
- mSlideInViewVisibleNavButtonColorOverride.value),
- sysUiNavButtonIconColorOnHome,
- mOnBackgroundIconColor);
+ final int iconColor;
+ if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mContext.isPhoneMode()) {
+ iconColor = sysUiNavButtonIconColorOnHome;
+ } else {
+ // Override the color from framework if nav buttons are over an opaque Taskbar surface.
+ iconColor = (int) argbEvaluator.evaluate(
+ mOnBackgroundNavButtonColorOverrideMultiplier.value * Math.max(
+ mOnTaskbarBackgroundNavButtonColorOverride.value,
+ mSlideInViewVisibleNavButtonColorOverride.value),
+ sysUiNavButtonIconColorOnHome,
+ mOnBackgroundIconColor);
+ }
for (ImageView button : mAllButtons) {
button.setImageTintList(ColorStateList.valueOf(iconColor));
@@ -681,6 +777,13 @@
}
}
+ private void onDarkIntensityChanged() {
+ updateNavButtonColor();
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.onDarkIntensityChanged(mTaskbarNavButtonDarkIntensity.value);
+ }
+ }
+
protected ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType,
ViewGroup parent, TaskbarNavButtonController navButtonController, @IdRes int id) {
return addButton(drawableId, buttonType, parent, navButtonController, id,
@@ -791,13 +894,6 @@
if (isInSetup) {
handleSetupUi();
-
- // Hide back button in SUW if keyboard is showing (IME draws its own back).
- if (mIsImeRenderingNavButtons) {
- mPropertyHolders.add(new StatePropertyHolder(
- mBackButtonAlpha.get(ALPHA_INDEX_SUW),
- flags -> (flags & FLAG_IME_VISIBLE) == 0));
- }
} else if (isInKidsMode) {
int iconSize = res.getDimensionPixelSize(
R.dimen.taskbar_icon_size_kids);
@@ -1033,6 +1129,9 @@
+ mOnBackgroundNavButtonColorOverrideMultiplier.value);
mNavButtonsView.dumpLogs(prefix + "\t", pw);
+ if (mContext.isPhoneMode()) {
+ mTaskbarTransitions.dumpLogs(prefix + "\t", pw);
+ }
}
private static String getStateString(int flags) {
@@ -1053,6 +1152,8 @@
appendFlag(str, flags, FLAG_SCREEN_PINNING_ACTIVE, "FLAG_SCREEN_PINNING_ACTIVE");
appendFlag(str, flags, FLAG_VOICE_INTERACTION_WINDOW_SHOWING,
"FLAG_VOICE_INTERACTION_WINDOW_SHOWING");
+ appendFlag(str, flags, FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING,
+ "FLAG_KEYBOARD_SHORTCUT_HELPER_SHOWING");
return str.toString();
}
@@ -1079,83 +1180,6 @@
}
}
- private class RotationButtonImpl implements RotationButton {
-
- private final ImageView mButton;
- private AnimatedVectorDrawable mImageDrawable;
-
- RotationButtonImpl(ImageView button) {
- mButton = button;
- }
-
- @Override
- public void setRotationButtonController(RotationButtonController rotationButtonController) {
- // TODO(b/187754252) UI polish, different icons based on light/dark context, etc
- mImageDrawable = (AnimatedVectorDrawable) mButton.getContext()
- .getDrawable(rotationButtonController.getIconResId());
- mButton.setImageDrawable(mImageDrawable);
- mButton.setContentDescription(mButton.getResources()
- .getString(R.string.accessibility_rotate_button));
- mImageDrawable.setCallback(mButton);
- }
-
- @Override
- public View getCurrentView() {
- return mButton;
- }
-
- @Override
- public boolean show() {
- mButton.setVisibility(View.VISIBLE);
- mState |= FLAG_ROTATION_BUTTON_VISIBLE;
- applyState();
- return true;
- }
-
- @Override
- public boolean hide() {
- mButton.setVisibility(View.GONE);
- mState &= ~FLAG_ROTATION_BUTTON_VISIBLE;
- applyState();
- return true;
- }
-
- @Override
- public boolean isVisible() {
- return mButton.getVisibility() == View.VISIBLE;
- }
-
- @Override
- public void updateIcon(int lightIconColor, int darkIconColor) {
- // TODO(b/187754252): UI Polish
- }
-
- @Override
- public void setOnClickListener(OnClickListener onClickListener) {
- mButton.setOnClickListener(onClickListener);
- }
-
- @Override
- public void setOnHoverListener(OnHoverListener onHoverListener) {
- mButton.setOnHoverListener(onHoverListener);
- }
-
- @Override
- public AnimatedVectorDrawable getImageDrawable() {
- return mImageDrawable;
- }
-
- @Override
- public void setDarkIntensity(float darkIntensity) {
- // TODO(b/187754252) UI polish
- }
-
- @Override
- public boolean acceptRotationProposal() {
- return mButton.isAttachedToWindow();
- }
- }
-
private static class StatePropertyHolder {
private final float mEnabledValue, mDisabledValue;
@@ -1186,13 +1210,16 @@
mAnimator = ObjectAnimator.ofFloat(target, property, enabledValue, disabledValue);
}
- public void setState(int flags) {
+ public void setState(int flags, boolean skipAnimation) {
boolean isEnabled = mEnableCondition.test(flags);
if (mIsEnabled != isEnabled) {
mIsEnabled = isEnabled;
mAnimator.cancel();
mAnimator.setFloatValues(mIsEnabled ? mEnabledValue : mDisabledValue);
mAnimator.start();
+ if (skipAnimation) {
+ mAnimator.end();
+ }
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java
index 83e4571..caf3320 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java
@@ -15,9 +15,12 @@
*/
package com.android.launcher3.taskbar;
+import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Rect;
@@ -44,6 +47,7 @@
private final int[] mTmpArr = new int[2];
private @Nullable ObjectAnimator mColorChangeAnim;
+ private Boolean mIsRegionDark;
public StashedHandleView(Context context) {
this(context, null);
@@ -92,7 +96,11 @@
* @param animate Whether to animate the change, or apply it immediately.
*/
public void updateHandleColor(boolean isRegionDark, boolean animate) {
+ if (mIsRegionDark != null && mIsRegionDark == isRegionDark) {
+ return;
+ }
int newColor = isRegionDark ? mStashedHandleLightColor : mStashedHandleDarkColor;
+ mIsRegionDark = isRegionDark;
if (mColorChangeAnim != null) {
mColorChangeAnim.cancel();
}
@@ -111,4 +119,17 @@
setBackgroundColor(newColor);
}
}
+
+ /**
+ * Updates the handle scale.
+ *
+ * @param scale target scale to animate towards (starting from current scale)
+ * @param durationMs milliseconds for the animation to take
+ */
+ public void animateScale(float scale, long durationMs) {
+ ObjectAnimator scaleAnim = ObjectAnimator.ofPropertyValuesHolder(this,
+ PropertyValuesHolder.ofFloat(SCALE_PROPERTY, scale));
+ scaleAnim.setDuration(durationMs).setAutoCancel(true);
+ scaleAnim.start();
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index f258b47..475b516 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -42,6 +42,7 @@
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.NavHandle;
import com.android.systemui.shared.navigationbar.RegionSamplingHelper;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
@@ -57,6 +58,10 @@
public static final int ALPHA_INDEX_HIDDEN_WHILE_DREAMING = 3;
private static final int NUM_ALPHA_CHANNELS = 4;
+ // Values for long press animations, picked to most closely match navbar spec.
+ private static final float SCALE_TOUCH_ANIMATION_SHRINK = 0.85f;
+ private static final float SCALE_TOUCH_ANIMATION_EXPAND = 1.18f;
+
/**
* The SharedPreferences key for whether the stashed handle region is dark.
*/
@@ -113,7 +118,7 @@
mControllers = controllers;
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
Resources resources = mActivity.getResources();
- if (mActivity.isPhoneGestureNavMode()) {
+ if (mActivity.isPhoneGestureNavMode() || mActivity.isTinyTaskbar()) {
mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_phone_size);
mStashedHandleWidth =
resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen);
@@ -202,9 +207,12 @@
* Creates and returns a {@link RevealOutlineAnimation} Animator that updates the stashed handle
* shape and size. When stashed, the shape is a thin rounded pill. When unstashed, the shape
* morphs into the size of where the taskbar icons will be.
+ *
+ * @param taskbarToHotseatOffsets A Rect of offsets used to transform the bounds of the
+ * stashed handle to wrap around the hotseat items.
*/
- public Animator createRevealAnimToIsStashed(boolean isStashed) {
- Rect visualBounds = new Rect(mControllers.taskbarViewController.getIconLayoutBounds());
+ public Animator createRevealAnimToIsStashed(boolean isStashed, Rect taskbarToHotseatOffsets) {
+ Rect visualBounds = mControllers.taskbarViewController.getIconLayoutVisualBounds();
float startRadius = mStashedHandleRadius;
if (DisplayController.isTransientTaskbar(mActivity)) {
@@ -214,6 +222,13 @@
visualBounds.bottom += heightDiff;
startRadius = visualBounds.height() / 2f;
+
+ // We use these offsets to create a larger stashed handle to wrap around the items
+ // of the hotseat. This is only used for certain animations.
+ visualBounds.top += taskbarToHotseatOffsets.top;
+ visualBounds.bottom += taskbarToHotseatOffsets.bottom;
+ visualBounds.left += taskbarToHotseatOffsets.left;
+ visualBounds.right += taskbarToHotseatOffsets.right;
}
final RevealOutlineAnimation handleRevealProvider = new RoundedRectRevealOutlineProvider(
@@ -299,7 +314,7 @@
homeDisabled ? 0 : 1);
}
- public void updateStateForSysuiFlags(int systemUiStateFlags) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags) {
mTaskbarHidden = (systemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) != 0;
updateRegionSamplingWindowVisibility();
}
@@ -324,7 +339,13 @@
@Override
public void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) {
- // TODO(b/308693847): Animate similarly to NavigationHandle.java (SysUI).
+ float targetScale;
+ if (isTouchDown) {
+ targetScale = shrink ? SCALE_TOUCH_ANIMATION_SHRINK : SCALE_TOUCH_ANIMATION_EXPAND;
+ } else {
+ targetScale = 1f;
+ }
+ mStashedHandleView.animateScale(targetScale, durationMs);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 8845813..0c1235c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -25,9 +25,11 @@
import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_UNDEFINED;
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
+import static com.android.launcher3.AbstractFloatingView.TYPE_ON_BOARD_POPUP;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY;
import static com.android.launcher3.Flags.enableCursorHoverStates;
+import static com.android.launcher3.Flags.enableTaskbarCustomization;
import static com.android.launcher3.Utilities.calculateTextHeight;
import static com.android.launcher3.Utilities.isRunningInTestHarness;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
@@ -37,11 +39,13 @@
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN;
import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-import static com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps;
+import static com.android.wm.shell.Flags.enableTinyTaskbar;
+
+import static java.lang.invoke.MethodHandles.Lookup.PROTECTED;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
@@ -62,12 +66,12 @@
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
-import android.view.RoundedCorner;
import android.view.Surface;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.widget.Toast;
+import android.window.RemoteTransition;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -93,6 +97,7 @@
import com.android.launcher3.model.data.AppPairInfo;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.TaskItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.popup.PopupDataProvider;
@@ -104,10 +109,18 @@
import com.android.launcher3.taskbar.bubbles.BubbleBarView;
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController;
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
+import com.android.launcher3.taskbar.bubbles.BubbleCreator;
import com.android.launcher3.taskbar.bubbles.BubbleDismissController;
import com.android.launcher3.taskbar.bubbles.BubbleDragController;
-import com.android.launcher3.taskbar.bubbles.BubbleStashController;
+import com.android.launcher3.taskbar.bubbles.BubblePinController;
import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.TaskbarHotseatDimensionsProvider;
+import com.android.launcher3.taskbar.bubbles.stashing.DeviceProfileDimensionsProviderAdapter;
+import com.android.launcher3.taskbar.bubbles.stashing.PersistentBubbleStashController;
+import com.android.launcher3.taskbar.bubbles.stashing.TransientBubbleStashController;
+import com.android.launcher3.taskbar.customization.TaskbarFeatureEvaluator;
+import com.android.launcher3.taskbar.customization.TaskbarSpecsEvaluator;
import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
import com.android.launcher3.testing.TestLogging;
@@ -131,13 +144,20 @@
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.NavHandle;
import com.android.quickstep.RecentsModel;
+import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.util.DesktopTask;
+import com.android.quickstep.util.GroupTask;
+import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.rotation.RotationButtonController;
+import com.android.systemui.shared.statusbar.phone.BarTransitions;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.unfold.updates.RotationChangeProvider;
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
+import com.android.wm.shell.Flags;
import java.io.PrintWriter;
import java.util.Collections;
@@ -164,9 +184,9 @@
private final TaskbarControllers mControllers;
private final WindowManager mWindowManager;
- private final @Nullable RoundedCorner mLeftCorner, mRightCorner;
private DeviceProfile mDeviceProfile;
private WindowManager.LayoutParams mWindowLayoutParams;
+ private WindowManager.LayoutParams mLastUpdatedLayoutParams;
private boolean mIsFullscreen;
// The size we should return to when we call setTaskbarWindowFullscreen(false)
private int mLastRequestedNonFullscreenSize;
@@ -197,6 +217,10 @@
private final LauncherPrefs mLauncherPrefs;
+ private TaskbarFeatureEvaluator mTaskbarFeatureEvaluator;
+
+ private TaskbarSpecsEvaluator mTaskbarSpecsEvaluator;
+
public TaskbarActivityContext(Context windowContext,
@Nullable Context navigationBarPanelContext, DeviceProfile launcherDp,
TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider
@@ -207,6 +231,15 @@
applyDeviceProfile(launcherDp);
final Resources resources = getResources();
+ if (enableTaskbarCustomization()) {
+ mTaskbarFeatureEvaluator = TaskbarFeatureEvaluator.getInstance(this);
+ mTaskbarSpecsEvaluator = new TaskbarSpecsEvaluator(
+ this,
+ mTaskbarFeatureEvaluator,
+ mDeviceProfile.inv.numRows,
+ mDeviceProfile.inv.numColumns);
+ }
+
mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, resources, false);
mIsSafeModeEnabled = TraceHelper.allowIpcs("isSafeMode",
() -> getPackageManager().isSafeMode());
@@ -225,24 +258,19 @@
Context c = getApplicationContext();
mWindowManager = c.getSystemService(WindowManager.class);
- boolean phoneMode = isPhoneMode();
- mLeftCorner = phoneMode
- ? null
- : display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT);
- mRightCorner = phoneMode
- ? null
- : display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT);
-
// Inflate views.
- int taskbarLayout = DisplayController.isTransientTaskbar(this) && !phoneMode
- ? R.layout.transient_taskbar
- : R.layout.taskbar;
+ final boolean isTransientTaskbar = DisplayController.isTransientTaskbar(this)
+ && !isPhoneMode();
+ int taskbarLayout = isTransientTaskbar ? R.layout.transient_taskbar : R.layout.taskbar;
mDragLayer = (TaskbarDragLayer) mLayoutInflater.inflate(taskbarLayout, null, false);
TaskbarView taskbarView = mDragLayer.findViewById(R.id.taskbar_view);
TaskbarScrimView taskbarScrimView = mDragLayer.findViewById(R.id.taskbar_scrim);
NearestTouchFrame navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
- BubbleBarView bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
+ BubbleBarView bubbleBarView = null;
+ if (isTransientTaskbar || Flags.enableBubbleBarInPersistentTaskBar()) {
+ bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
+ }
StashedHandleView bubbleHandleView = mDragLayer.findViewById(R.id.stashed_bubble_handle);
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
@@ -251,15 +279,28 @@
Optional<BubbleControllers> bubbleControllersOptional = Optional.empty();
BubbleBarController.onTaskbarRecreated();
if (BubbleBarController.isBubbleBarEnabled() && bubbleBarView != null) {
+ Optional<BubbleStashedHandleViewController> bubbleHandleController = Optional.empty();
+ if (isTransientTaskbar) {
+ bubbleHandleController = Optional.of(
+ new BubbleStashedHandleViewController(this, bubbleHandleView));
+ }
+ TaskbarHotseatDimensionsProvider dimensionsProvider =
+ new DeviceProfileDimensionsProviderAdapter(this);
+ BubbleStashController bubbleStashController = isTransientTaskbar
+ ? new TransientBubbleStashController(dimensionsProvider, getResources())
+ : new PersistentBubbleStashController(dimensionsProvider);
bubbleControllersOptional = Optional.of(new BubbleControllers(
new BubbleBarController(this, bubbleBarView),
new BubbleBarViewController(this, bubbleBarView),
- new BubbleStashController(this),
- new BubbleStashedHandleViewController(this, bubbleHandleView),
+ bubbleStashController,
+ bubbleHandleController,
new BubbleDragController(this),
new BubbleDismissController(this, mDragLayer),
new BubbleBarPinController(this, mDragLayer,
- () -> getDeviceProfile().getDisplayInfo().currentSize)
+ () -> DisplayController.INSTANCE.get(this).getInfo().currentSize),
+ new BubblePinController(this, mDragLayer,
+ () -> DisplayController.INSTANCE.get(this).getInfo().currentSize),
+ new BubbleCreator(this)
));
}
@@ -272,12 +313,13 @@
R.drawable.ic_sysbar_rotate_button_cw_start_0,
R.drawable.ic_sysbar_rotate_button_cw_start_90,
() -> getDisplay().getRotation());
- rotationButtonController.setBgExecutor(Executors.THREAD_POOL_EXECUTOR);
+ rotationButtonController.setBgExecutor(Executors.UI_HELPER_EXECUTOR);
mControllers = new TaskbarControllers(this,
new TaskbarDragController(this),
buttonController,
- new NavbarButtonsViewController(this, mNavigationBarPanelContext, navButtonsView),
+ new NavbarButtonsViewController(this, mNavigationBarPanelContext, navButtonsView,
+ getMainThreadHandler()),
rotationButtonController,
new TaskbarDragLayerController(this, mDragLayer),
new TaskbarViewController(this, taskbarView),
@@ -285,7 +327,7 @@
new TaskbarUnfoldAnimationController(this, unfoldTransitionProgressProvider,
mWindowManager,
new RotationChangeProvider(c.getSystemService(DisplayManager.class), this,
- getMainThreadHandler())),
+ UI_HELPER_EXECUTOR.getHandler(), getMainThreadHandler())),
new TaskbarKeyguardController(this),
new StashedHandleViewController(this, stashedHandleView),
new TaskbarStashController(this),
@@ -298,26 +340,20 @@
new VoiceInteractionWindowController(this),
new TaskbarTranslationController(this),
new TaskbarSpringOnStashController(this),
- createTaskbarRecentAppsController(),
+ new TaskbarRecentAppsController(
+ this,
+ RecentsModel.INSTANCE.get(this),
+ LauncherActivityInterface.INSTANCE::getDesktopVisibilityController),
TaskbarEduTooltipController.newInstance(this),
new KeyboardQuickSwitchController(),
new TaskbarPinningController(this, () ->
- DisplayController.INSTANCE.get(this).getInfo().isInDesktopMode()),
- bubbleControllersOptional);
-
+ DisplayController.isInDesktopMode(this)),
+ bubbleControllersOptional,
+ new TaskbarDesktopModeController(
+ LauncherActivityInterface.INSTANCE::getDesktopVisibilityController));
mLauncherPrefs = LauncherPrefs.get(this);
}
- private TaskbarRecentAppsController createTaskbarRecentAppsController() {
- // TODO(b/335401172): unify DesktopMode checks in Launcher
- if (enableDesktopWindowingMode() && enableDesktopWindowingTaskbarRunningApps()) {
- return new DesktopTaskbarRunningAppsController(
- RecentsModel.INSTANCE.get(this),
- LauncherActivityInterface.INSTANCE::getDesktopVisibilityController);
- }
- return TaskbarRecentAppsController.DEFAULT;
- }
-
/** Updates {@link DeviceProfile} instances for any Taskbar windows. */
public void updateDeviceProfile(DeviceProfile launcherDp) {
applyDeviceProfile(launcherDp);
@@ -331,6 +367,38 @@
}
/**
+ * Calculate the offsets needed to transform the transient taskbar bounds to the hotseat bounds.
+ * @return The offsets will be stored in a Rect
+ */
+ public Rect calculateTaskbarToHotseatOffsets(Rect hotseatBounds) {
+ Rect taskbar = getTransientTaskbarBounds();
+ Rect offsets = new Rect();
+
+ offsets.left = hotseatBounds.left - taskbar.left;
+ offsets.right = hotseatBounds.right - taskbar.right;
+
+ int heightDiff = hotseatBounds.height() - taskbar.height();
+ offsets.top = (taskbar.height() - heightDiff) / 2;
+
+ int gleanedTaskbarPadding = (mDeviceProfile.taskbarHeight
+ - getTransientTaskbarBounds().height()) / 2;
+ offsets.left -= gleanedTaskbarPadding;
+ offsets.top -= gleanedTaskbarPadding;
+ offsets.right += gleanedTaskbarPadding;
+
+ // Bottom is relative to the bottom of layout, so we can calculate it with padding included.
+ offsets.bottom = (hotseatBounds.height() - taskbar.height()) / 2;
+
+ // Update bounds in taskbar background
+ if (hotseatBounds.isEmpty()) {
+ mDragLayer.getTaskbarToHotseatOffsetRect().setEmpty();
+ } else {
+ mDragLayer.getTaskbarToHotseatOffsetRect().set(offsets);
+ }
+ return offsets;
+ }
+
+ /**
* Copy the original DeviceProfile, match the number of hotseat icons and qsb width and update
* the icon size
*/
@@ -376,6 +444,7 @@
mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, getResources(), false);
mLastRequestedNonFullscreenSize = getDefaultTaskbarWindowSize();
mWindowLayoutParams = createAllWindowParams();
+ mLastUpdatedLayoutParams = new WindowManager.LayoutParams();
// Initialize controllers after all are constructed.
mControllers.init(sharedState);
@@ -411,7 +480,9 @@
* single window for taskbar and navbar.
*/
public boolean isPhoneMode() {
- return ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone;
+ return ENABLE_TASKBAR_NAVBAR_UNIFICATION
+ && mDeviceProfile.isPhone
+ && !mDeviceProfile.isTaskbarPresent;
}
/**
@@ -428,6 +499,20 @@
return isPhoneMode() && !isThreeButtonNav();
}
+ /** Returns {@code true} iff a tiny version of taskbar is shown on phone. */
+ public boolean isTinyTaskbar() {
+ return enableTinyTaskbar() && mDeviceProfile.isPhone && mDeviceProfile.isTaskbarPresent;
+ }
+
+ /**
+ * Returns {@code true} iff bubble bar is enabled (but not necessarily visible /
+ * containing bubbles).
+ */
+ @Override
+ public boolean isBubbleBarEnabled() {
+ return getBubbleControllers() != null && BubbleBarController.isBubbleBarEnabled();
+ }
+
/**
* Returns if software keyboard is docked or input toolbar is placed at the taskbar area
*/
@@ -454,7 +539,12 @@
* Show Taskbar upon receiving broadcast
*/
public void showTaskbarFromBroadcast() {
- mControllers.taskbarStashController.showTaskbarFromBroadcast();
+ // If user is in middle of taskbar education handle go to next step of education
+ if (mControllers.taskbarEduTooltipController.isBeforeTooltipFeaturesStep()) {
+ mControllers.taskbarEduTooltipController.hide();
+ mControllers.taskbarEduTooltipController.maybeShowFeaturesEdu();
+ }
+ mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false);
}
/** Toggles Taskbar All Apps overlay. */
@@ -612,12 +702,9 @@
return mImeDrawsImeNavBar;
}
- public int getLeftCornerRadius() {
- return mLeftCorner == null ? 0 : mLeftCorner.getRadius();
- }
-
- public int getRightCornerRadius() {
- return mRightCorner == null ? 0 : mRightCorner.getRadius();
+ public int getCornerRadius() {
+ return isPhoneMode() ? 0 : getResources().getDimensionPixelSize(
+ R.dimen.persistent_taskbar_corner_radius);
}
public WindowManager.LayoutParams getWindowLayoutParams() {
@@ -796,6 +883,11 @@
*/
public void setUIController(@NonNull TaskbarUIController uiController) {
mControllers.setUiController(uiController);
+ if (BubbleBarController.isBubbleBarEnabled() && mControllers.bubbleControllers.isEmpty()) {
+ // if the bubble bar was visible in a previous configuration of taskbar and is being
+ // recreated now without bubbles, clean up any bubble bar adjustments from hotseat
+ bubbleBarVisibilityChanged(/* isVisible= */ false);
+ }
}
/**
@@ -805,6 +897,27 @@
mControllers.taskbarStashController.setSetupUIVisible(isVisible);
}
+ public void setWallpaperVisible(boolean isVisible) {
+ mControllers.navbarButtonsViewController.setWallpaperVisible(isVisible);
+ }
+
+ public void checkNavBarModes() {
+ mControllers.navbarButtonsViewController.checkNavBarModes();
+ }
+
+ public void finishBarAnimations() {
+ mControllers.navbarButtonsViewController.finishBarAnimations();
+ }
+
+ public void touchAutoDim(boolean reset) {
+ mControllers.navbarButtonsViewController.touchAutoDim(reset);
+ }
+
+ public void transitionTo(@BarTransitions.TransitionMode int barMode,
+ boolean animate) {
+ mControllers.navbarButtonsViewController.transitionTo(barMode, animate);
+ }
+
/**
* Called when this instance of taskbar is no longer needed
*/
@@ -822,11 +935,12 @@
return mIsDestroyed;
}
- public void updateSysuiStateFlags(int systemUiStateFlags, boolean fromInit) {
+ public void updateSysuiStateFlags(@SystemUiStateFlags long systemUiStateFlags,
+ boolean fromInit) {
mControllers.navbarButtonsViewController.updateStateForSysuiFlags(systemUiStateFlags,
fromInit);
boolean isShadeVisible = (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE) != 0;
- onNotificationShadeExpandChanged(isShadeVisible, fromInit);
+ onNotificationShadeExpandChanged(isShadeVisible, fromInit || isPhoneMode());
mControllers.taskbarViewController.setRecentsButtonDisabled(
mControllers.navbarButtonsViewController.isRecentsDisabled()
|| isNavBarKidsModeActive());
@@ -845,8 +959,9 @@
mControllers.uiController.updateStateForSysuiFlags(systemUiStateFlags);
mControllers.bubbleControllers.ifPresent(controllers -> {
controllers.bubbleBarController.updateStateForSysuiFlags(systemUiStateFlags);
- controllers.bubbleStashedHandleViewController.setIsHomeButtonDisabled(
- mControllers.navbarButtonsViewController.isHomeDisabled());
+ controllers.bubbleStashedHandleViewController.ifPresent(controller ->
+ controller.setIsHomeButtonDisabled(
+ mControllers.navbarButtonsViewController.isHomeDisabled()));
});
}
@@ -881,6 +996,10 @@
mControllers.rotationButtonController.onBehaviorChanged(displayId, behavior);
}
+ public void onTransitionModeUpdated(int barMode, boolean checkBarModes) {
+ mControllers.navbarButtonsViewController.onTransitionModeUpdated(barMode, checkBarModes);
+ }
+
public void onNavButtonsDarkIntensityChanged(float darkIntensity) {
mControllers.navbarButtonsViewController.getTaskbarNavButtonDarkIntensity()
.updateValue(darkIntensity);
@@ -962,7 +1081,9 @@
mWindowLayoutParams.paramsForRotation[rot].height = size;
}
}
- mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
+ mControllers.runAfterInit(
+ mControllers.taskbarInsetsController
+ ::onTaskbarOrBubblebarWindowHeightOrInsetsChanged);
notifyUpdateLayoutParams();
}
@@ -973,7 +1094,7 @@
public int getDefaultTaskbarWindowSize() {
Resources resources = getResources();
- if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) {
+ if (isPhoneMode()) {
return isThreeButtonNav() ?
resources.getDimensionPixelSize(R.dimen.taskbar_phone_size) :
resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
@@ -1007,7 +1128,7 @@
return mDeviceProfile.taskbarHeight
- + Math.max(getLeftCornerRadius(), getRightCornerRadius())
+ + getCornerRadius()
+ extraHeightForTaskbarTooltips;
}
@@ -1028,6 +1149,9 @@
* window.
*/
public void setTaskbarWindowFocusable(boolean focusable) {
+ if (isPhoneMode()) {
+ return;
+ }
if (focusable) {
mWindowLayoutParams.flags &= ~FLAG_NOT_FOCUSABLE;
} else {
@@ -1040,7 +1164,7 @@
* Applies forcibly show flag to taskbar window iff transient taskbar is unstashed.
*/
public void applyForciblyShownFlagWhileTransientTaskbarUnstashed(boolean shouldForceShow) {
- if (!DisplayController.isTransientTaskbar(this)) {
+ if (!DisplayController.isTransientTaskbar(this) || isPhoneMode()) {
return;
}
if (shouldForceShow) {
@@ -1088,10 +1212,9 @@
RecentsView recents = taskbarUIController.getRecentsView();
boolean shouldCloseAllOpenViews = true;
Object tag = view.getTag();
- if (tag instanceof Task) {
- Task task = (Task) tag;
- ActivityManagerWrapper.getInstance().startActivityFromRecents(task.key,
- ActivityOptions.makeBasic());
+ if (tag instanceof GroupTask groupTask) {
+ handleGroupTaskLaunch(groupTask, /* remoteTransition = */ null,
+ DisplayController.isInDesktopMode(this));
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true);
} else if (tag instanceof FolderInfo) {
// Tapping an expandable folder icon on Taskbar
@@ -1108,6 +1231,11 @@
mControllers.uiController.onTaskbarIconLaunched(api);
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true);
}
+ } else if (tag instanceof TaskItemInfo info) {
+ UI_HELPER_EXECUTOR.execute(() ->
+ SystemUiProxy.INSTANCE.get(this).showDesktopApp(info.getTaskId()));
+ mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(
+ /* stash= */ true);
} else if (tag instanceof WorkspaceItemInfo) {
// Tapping a launchable icon on Taskbar
WorkspaceItemInfo info = (WorkspaceItemInfo) tag;
@@ -1191,6 +1319,58 @@
}
}
+ public void handleGroupTaskLaunch(
+ GroupTask task,
+ @Nullable RemoteTransition remoteTransition,
+ boolean onDesktop) {
+ handleGroupTaskLaunch(task, remoteTransition, onDesktop, null, null);
+ }
+
+ /**
+ * Launches the given GroupTask with the following behavior:
+ * - If the GroupTask is a DesktopTask, launch the tasks in that Desktop.
+ * - If {@code onDesktop}, bring the given GroupTask to the front.
+ * - If the GroupTask is a single task, launch it via startActivityFromRecents.
+ * - Otherwise, we assume the GroupTask is a Split pair and launch them together.
+ * <p>
+ * Given start and/or finish callbacks, they will be run before an after the app launch
+ * respectively in cases where we can't use the remote transition, otherwise we will assume that
+ * these callbacks are included in the remote transition.
+ */
+ public void handleGroupTaskLaunch(
+ GroupTask task,
+ @Nullable RemoteTransition remoteTransition,
+ boolean onDesktop,
+ @Nullable Runnable onStartCallback,
+ @Nullable Runnable onFinishCallback) {
+ if (task instanceof DesktopTask) {
+ UI_HELPER_EXECUTOR.execute(() ->
+ SystemUiProxy.INSTANCE.get(this).showDesktopApps(getDisplay().getDisplayId(),
+ remoteTransition));
+ } else if (onDesktop) {
+ UI_HELPER_EXECUTOR.execute(() -> {
+ if (onStartCallback != null) {
+ onStartCallback.run();
+ }
+ SystemUiProxy.INSTANCE.get(this).showDesktopApp(task.task1.key.id);
+ if (onFinishCallback != null) {
+ onFinishCallback.run();
+ }
+ });
+ } else if (task.task2 == null) {
+ UI_HELPER_EXECUTOR.execute(() -> {
+ ActivityOptions activityOptions =
+ makeDefaultActivityOptions(SPLASH_SCREEN_STYLE_UNDEFINED).options;
+ activityOptions.setRemoteTransition(remoteTransition);
+
+ ActivityManagerWrapper.getInstance().startActivityFromRecents(
+ task.task1.key, activityOptions);
+ });
+ } else {
+ mControllers.uiController.launchSplitTasks(task, remoteTransition);
+ }
+ }
+
/**
* Runs when the user taps a Taskbar icon in TaskbarActivityContext (Overview or inside an app),
* and calls the appropriate method to animate and launch.
@@ -1251,7 +1431,8 @@
if (foundTask != null) {
TaskView foundTaskView = recents.getTaskViewByTaskId(foundTask.key.id);
if (foundTaskView != null
- && foundTaskView.isVisibleToUser()) {
+ && foundTaskView.isVisibleToUser()
+ && !(foundTaskView instanceof DesktopTaskView)) {
TestLogging.recordEvent(
TestProtocol.SEQUENCE_MAIN, "start: taskbarAppIcon");
foundTaskView.launchTasks();
@@ -1302,7 +1483,6 @@
return;
}
}
-
startActivity(intent);
} else {
getSystemService(LauncherApps.class).startMainActivity(
@@ -1347,6 +1527,12 @@
itemView.setHapticFeedbackEnabled(true);
return false;
});
+
+ // Close any open taskbar tooltips.
+ if (AbstractFloatingView.hasOpenView(this, TYPE_ON_BOARD_POPUP)) {
+ AbstractFloatingView.getOpenView(this, TYPE_ON_BOARD_POPUP)
+ .close(/* animate= */ false);
+ }
});
}
@@ -1390,6 +1576,13 @@
}
/**
+ * Plays the taskbar background alpha animation if one is not currently playing.
+ */
+ public void playTaskbarBackgroundAlphaAnimation() {
+ mControllers.taskbarStashController.playTaskbarBackgroundAlphaAnimation();
+ }
+
+ /**
* Called to start the taskbar translation spring to its settled translation (0).
*/
public void startTranslationSpring() {
@@ -1448,7 +1641,7 @@
});
}
- protected boolean isUserSetupComplete() {
+ public boolean isUserSetupComplete() {
return mIsUserSetupComplete;
}
@@ -1456,7 +1649,8 @@
return mIsNavBarKidsMode && isThreeButtonNav();
}
- protected boolean isNavBarForceVisible() {
+ @VisibleForTesting(otherwise = PROTECTED)
+ public boolean isNavBarForceVisible() {
return mIsNavBarForceVisible;
}
@@ -1484,7 +1678,8 @@
((LauncherTaskbarUIController) uiController).addLauncherVisibilityChangedAnimation(
fullAnimation, duration);
}
- mControllers.taskbarStashController.addUnstashToHotseatAnimation(fullAnimation, duration);
+ mControllers.taskbarStashController.addUnstashToHotseatAnimationFromSuw(fullAnimation,
+ duration);
View allAppsButton = mControllers.taskbarViewController.getAllAppsButtonView();
if (allAppsButton != null && !FeatureFlags.ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT.get()) {
@@ -1501,12 +1696,24 @@
}
/**
+ * Returns the bounds of launcher's hotseat (if exists).
+ */
+ public void getHotseatBounds(Rect hotseatBoundsOut) {
+ TaskbarUIController uiController = mControllers.uiController;
+ if (uiController instanceof LauncherTaskbarUIController launcherController) {
+ launcherController.getHotseatBounds(hotseatBoundsOut);
+ } else {
+ hotseatBoundsOut.setEmpty();
+ }
+ }
+
+ /**
* Called when we determine the touchable region.
*
* @param exclude {@code true} then the magnification region computation will omit the window.
*/
public void excludeFromMagnificationRegion(boolean exclude) {
- if (mIsExcludeFromMagnificationRegion == exclude) {
+ if (mIsExcludeFromMagnificationRegion == exclude || isPhoneMode()) {
return;
}
@@ -1523,6 +1730,12 @@
void notifyUpdateLayoutParams() {
if (mDragLayer.isAttachedToWindow()) {
+ // Copy the current windowLayoutParams to mLastUpdatedLayoutParams and compare the diff.
+ // If there is no change, we will skip the call to updateViewLayout.
+ int changes = mLastUpdatedLayoutParams.copyFrom(mWindowLayoutParams);
+ if (changes == 0) {
+ return;
+ }
if (enableTaskbarNoRecreate()) {
mWindowManager.updateViewLayout(mDragLayer.getRootView(), mWindowLayoutParams);
} else {
@@ -1548,6 +1761,16 @@
return mControllers.taskbarStashController.isInStashedLauncherState();
}
+ @Nullable
+ public TaskbarFeatureEvaluator getTaskbarFeatureEvaluator() {
+ return mTaskbarFeatureEvaluator;
+ }
+
+ @Nullable
+ public TaskbarSpecsEvaluator getTaskbarSpecsEvaluator() {
+ return mTaskbarSpecsEvaluator;
+ }
+
protected void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarActivityContext:");
@@ -1588,4 +1811,13 @@
boolean canToggleHomeAllApps() {
return mControllers.uiController.canToggleHomeAllApps();
}
+
+ boolean isIconAlignedWithHotseat() {
+ return mControllers.uiController.isIconAlignedWithHotseat();
+ }
+
+ @VisibleForTesting
+ public TaskbarControllers getControllers() {
+ return mControllers;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
index e290c3f..4ac7514 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
@@ -21,8 +21,10 @@
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
+import android.graphics.Rect
import android.graphics.RectF
import com.android.app.animation.Interpolators
+import com.android.internal.policy.ScreenDecorationsUtils
import com.android.launcher3.R
import com.android.launcher3.Utilities
import com.android.launcher3.Utilities.mapRange
@@ -37,8 +39,6 @@
class TaskbarBackgroundRenderer(private val context: TaskbarActivityContext) {
private val isInSetup: Boolean = !context.isUserSetupComplete
- private val DARK_THEME_SHADOW_ALPHA = 51f
- private val LIGHT_THEME_SHADOW_ALPHA = 25f
private val maxTransientTaskbarHeight =
context.transientTaskbarDeviceProfile.taskbarHeight.toFloat()
@@ -54,27 +54,30 @@
var isAnimatingPinning = false
val paint = Paint()
+ private val strokePaint = Paint()
val lastDrawnTransientRect = RectF()
var backgroundHeight = context.deviceProfile.taskbarHeight.toFloat()
var translationYForSwipe = 0f
var translationYForStash = 0f
+ // When not empty, we can use this to transform transient taskbar background to hotseat bounds.
+ val taskbarToHotseatOffsetRect = Rect()
+
private val transientBackgroundBounds = context.transientTaskbarBounds
private val shadowAlpha: Float
+ private val strokeAlpha: Int
private var shadowBlur = 0f
private var keyShadowDistance = 0f
private var bottomMargin = 0
- private val fullLeftCornerRadius = context.leftCornerRadius.toFloat()
- private val fullRightCornerRadius = context.rightCornerRadius.toFloat()
- private var leftCornerRadius = fullLeftCornerRadius
- private var rightCornerRadius = fullRightCornerRadius
+ private val fullCornerRadius: Float
+ private var cornerRadius = 0f
private var widthInsetPercentage = 0f
- private val square: Path = Path()
- private val circle: Path = Path()
- private val invertedLeftCornerPath: Path = Path()
- private val invertedRightCornerPath: Path = Path()
+ private val square = Path()
+ private val circle = Path()
+ private val invertedLeftCornerPath = Path()
+ private val invertedRightCornerPath = Path()
private var stashedHandleWidth =
context.resources.getDimensionPixelSize(R.dimen.taskbar_stashed_handle_width)
@@ -86,24 +89,42 @@
paint.color = context.getColor(R.color.taskbar_background)
paint.flags = Paint.ANTI_ALIAS_FLAG
paint.style = Paint.Style.FILL
+ strokePaint.color = context.getColor(R.color.taskbar_stroke)
+ strokePaint.flags = Paint.ANTI_ALIAS_FLAG
+ strokePaint.style = Paint.Style.STROKE
+ strokePaint.strokeWidth =
+ context.resources.getDimension(R.dimen.transient_taskbar_stroke_width)
+ if (Utilities.isDarkTheme(context)) {
+ strokeAlpha = DARK_THEME_STROKE_ALPHA
+ shadowAlpha = DARK_THEME_SHADOW_ALPHA
+ } else {
+ strokeAlpha = LIGHT_THEME_STROKE_ALPHA
+ shadowAlpha = LIGHT_THEME_SHADOW_ALPHA
+ }
- shadowAlpha =
- if (Utilities.isDarkTheme(context)) DARK_THEME_SHADOW_ALPHA
- else LIGHT_THEME_SHADOW_ALPHA
-
- setCornerRoundness(DEFAULT_ROUNDNESS)
+ if (DisplayController.isInDesktopMode(context)) {
+ fullCornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(context)
+ cornerRadius = fullCornerRadius
+ } else {
+ fullCornerRadius = context.cornerRadius.toFloat()
+ cornerRadius = fullCornerRadius
+ setCornerRoundness(MAX_ROUNDNESS)
+ }
}
fun updateStashedHandleWidth(context: TaskbarActivityContext, res: Resources) {
stashedHandleWidth =
res.getDimensionPixelSize(
- if (context.isPhoneMode) R.dimen.taskbar_stashed_small_screen
- else R.dimen.taskbar_stashed_handle_width
+ if (context.isPhoneMode || context.isTinyTaskbar) {
+ R.dimen.taskbar_stashed_small_screen
+ } else {
+ R.dimen.taskbar_stashed_handle_width
+ }
)
}
/**
- * Sets the roundness of the round corner above Taskbar. No effect on transient Taskkbar.
+ * Sets the roundness of the round corner above Taskbar. No effect on transient Taskbar.
*
* @param cornerRoundness 0 has no round corner, 1 has complete round corner.
*/
@@ -112,21 +133,18 @@
return
}
- leftCornerRadius = fullLeftCornerRadius * cornerRoundness
- rightCornerRadius = fullRightCornerRadius * cornerRoundness
+ cornerRadius = fullCornerRadius * cornerRoundness
// Create the paths for the inverted rounded corners above the taskbar. Start with a filled
// square, and then subtract out a circle from the appropriate corner.
square.reset()
- square.addRect(0f, 0f, leftCornerRadius, leftCornerRadius, Path.Direction.CW)
+ square.addRect(0f, 0f, cornerRadius, cornerRadius, Path.Direction.CW)
circle.reset()
- circle.addCircle(leftCornerRadius, 0f, leftCornerRadius, Path.Direction.CW)
+ circle.addCircle(cornerRadius, 0f, cornerRadius, Path.Direction.CW)
invertedLeftCornerPath.op(square, circle, Path.Op.DIFFERENCE)
- square.reset()
- square.addRect(0f, 0f, rightCornerRadius, rightCornerRadius, Path.Direction.CW)
circle.reset()
- circle.addCircle(0f, 0f, rightCornerRadius, Path.Direction.CW)
+ circle.addCircle(0f, 0f, cornerRadius, Path.Direction.CW)
invertedRightCornerPath.op(square, circle, Path.Op.DIFFERENCE)
}
@@ -160,10 +178,10 @@
}
// Draw the inverted rounded corners above the taskbar.
- canvas.translate(0f, -leftCornerRadius)
+ canvas.translate(0f, -cornerRadius)
canvas.drawPath(invertedLeftCornerPath, paint)
- canvas.translate(0f, leftCornerRadius)
- canvas.translate(canvas.width - rightCornerRadius, -rightCornerRadius)
+ canvas.translate(0f, cornerRadius)
+ canvas.translate(canvas.width - cornerRadius, -cornerRadius)
canvas.drawPath(invertedRightCornerPath, paint)
}
@@ -212,6 +230,12 @@
val radius = newBackgroundHeight / 2f
val bottomMarginProgress = bottomMargin * ((1f - progress) / 2f)
+ // Used to transform the background so that it wraps around the items on the hotseat.
+ val hotseatOffsetLeft = taskbarToHotseatOffsetRect.left * progress
+ val hotseatOffsetTop = taskbarToHotseatOffsetRect.top * progress
+ val hotseatOffsetRight = taskbarToHotseatOffsetRect.right * progress
+ val hotseatOffsetBottom = taskbarToHotseatOffsetRect.bottom * progress
+
// Aligns the bottom with the bottom of the stashed handle.
val bottom =
canvas.height - bottomMargin +
@@ -233,17 +257,19 @@
keyShadowDistance,
setColorAlphaBound(Color.BLACK, Math.round(newShadowAlpha))
)
+ strokePaint.alpha = (paint.alpha * strokeAlpha) / 255
lastDrawnTransientRect.set(
- transientBackgroundBounds.left + halfWidthDelta,
- bottom - newBackgroundHeight,
- transientBackgroundBounds.right - halfWidthDelta,
- bottom
+ transientBackgroundBounds.left + halfWidthDelta + hotseatOffsetLeft,
+ bottom - newBackgroundHeight + hotseatOffsetTop,
+ transientBackgroundBounds.right - halfWidthDelta + hotseatOffsetRight,
+ bottom + hotseatOffsetBottom
)
val horizontalInset = fullWidth * widthInsetPercentage
lastDrawnTransientRect.inset(horizontalInset, 0f)
canvas.drawRoundRect(lastDrawnTransientRect, radius, radius, paint)
+ canvas.drawRoundRect(lastDrawnTransientRect, radius, radius, strokePaint)
}
/**
@@ -255,6 +281,10 @@
}
companion object {
- const val DEFAULT_ROUNDNESS = 1f
+ const val MAX_ROUNDNESS = 1f
+ private const val DARK_THEME_STROKE_ALPHA = 51
+ private const val LIGHT_THEME_STROKE_ALPHA = 41
+ private const val DARK_THEME_SHADOW_ALPHA = 51f
+ private const val LIGHT_THEME_SHADOW_ALPHA = 25f
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
index f9ddc3d..34ab9f0 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
@@ -25,6 +25,7 @@
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
+import com.android.launcher3.util.DisplayController;
import com.android.systemui.shared.rotation.RotationButtonController;
import java.io.PrintWriter;
@@ -64,6 +65,7 @@
public final KeyboardQuickSwitchController keyboardQuickSwitchController;
public final TaskbarPinningController taskbarPinningController;
public final Optional<BubbleControllers> bubbleControllers;
+ public final TaskbarDesktopModeController taskbarDesktopModeController;
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
@Nullable private BackgroundRendererController[] mBackgroundRendererControllers = null;
@@ -111,7 +113,8 @@
TaskbarEduTooltipController taskbarEduTooltipController,
KeyboardQuickSwitchController keyboardQuickSwitchController,
TaskbarPinningController taskbarPinningController,
- Optional<BubbleControllers> bubbleControllers) {
+ Optional<BubbleControllers> bubbleControllers,
+ TaskbarDesktopModeController taskbarDesktopModeController) {
this.taskbarActivityContext = taskbarActivityContext;
this.taskbarDragController = taskbarDragController;
this.navButtonController = navButtonController;
@@ -138,6 +141,7 @@
this.keyboardQuickSwitchController = keyboardQuickSwitchController;
this.taskbarPinningController = taskbarPinningController;
this.bubbleControllers = bubbleControllers;
+ this.taskbarDesktopModeController = taskbarDesktopModeController;
}
/**
@@ -165,6 +169,7 @@
taskbarOverlayController.init(this);
taskbarAllAppsController.init(this, sharedState.allAppsVisible);
navButtonController.init(this);
+ bubbleControllers.ifPresent(controllers -> controllers.init(this));
taskbarInsetsController.init(this);
voiceInteractionWindowController.init(this);
taskbarRecentAppsController.init(this);
@@ -172,7 +177,7 @@
taskbarEduTooltipController.init(this);
keyboardQuickSwitchController.init(this);
taskbarPinningController.init(this, mSharedState);
- bubbleControllers.ifPresent(controllers -> controllers.init(this));
+ taskbarDesktopModeController.init(this, mSharedState);
mControllersToLog = new LoggableTaskbarController[] {
taskbarDragController, navButtonController, navbarButtonsViewController,
@@ -180,14 +185,21 @@
taskbarUnfoldAnimationController, taskbarKeyguardController,
stashedHandleViewController, taskbarStashController,
taskbarAutohideSuspendController, taskbarPopupController, taskbarInsetsController,
- voiceInteractionWindowController, taskbarTranslationController,
- taskbarEduTooltipController, keyboardQuickSwitchController, taskbarPinningController
+ voiceInteractionWindowController, taskbarRecentAppsController,
+ taskbarTranslationController, taskbarEduTooltipController,
+ keyboardQuickSwitchController, taskbarPinningController,
};
mBackgroundRendererControllers = new BackgroundRendererController[] {
taskbarDragLayerController, taskbarScrimViewController,
voiceInteractionWindowController
};
- mCornerRoundness.updateValue(TaskbarBackgroundRenderer.DEFAULT_ROUNDNESS);
+
+ if (DisplayController.isInDesktopMode(taskbarActivityContext)) {
+ mCornerRoundness.updateValue(taskbarDesktopModeController.getTaskbarCornerRoundness(
+ mSharedState.showCornerRadiusInDesktopMode));
+ } else {
+ mCornerRoundness.updateValue(TaskbarBackgroundRenderer.MAX_ROUNDNESS);
+ }
mAreAllControllersInitialized = true;
for (Runnable postInitCallback : mPostInitCallbacks) {
@@ -247,6 +259,7 @@
keyboardQuickSwitchController.onDestroy();
taskbarStashController.onDestroy();
bubbleControllers.ifPresent(controllers -> controllers.onDestroy());
+ taskbarDesktopModeController.onDestroy();
mControllersToLog = null;
mBackgroundRendererControllers = null;
@@ -281,6 +294,11 @@
}
uiController.dumpLogs(prefix + "\t", pw);
rotationButtonController.dumpLogs(prefix + "\t", pw);
+ if (bubbleControllers.isPresent()) {
+ bubbleControllers.get().dump(pw);
+ } else {
+ pw.println(String.format("%s\t%s", prefix, "Bubble controllers are empty."));
+ }
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt
new file mode 100644
index 0000000..a376531
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar
+
+import com.android.launcher3.statehandlers.DesktopVisibilityController
+import com.android.launcher3.statehandlers.DesktopVisibilityController.TaskbarDesktopModeListener
+import com.android.launcher3.taskbar.TaskbarBackgroundRenderer.Companion.MAX_ROUNDNESS
+
+/** Handles Taskbar in Desktop Windowing mode. */
+class TaskbarDesktopModeController(
+ private val desktopVisibilityControllerProvider: () -> DesktopVisibilityController?
+) : TaskbarDesktopModeListener {
+ private lateinit var taskbarControllers: TaskbarControllers
+ private lateinit var taskbarSharedState: TaskbarSharedState
+
+ private val desktopVisibilityController: DesktopVisibilityController?
+ get() = desktopVisibilityControllerProvider()
+
+ fun init(controllers: TaskbarControllers, sharedState: TaskbarSharedState) {
+ taskbarControllers = controllers
+ taskbarSharedState = sharedState
+ desktopVisibilityController?.registerTaskbarDesktopModeListener(this)
+ }
+
+ override fun onTaskbarCornerRoundingUpdate(doesAnyTaskRequireTaskbarRounding: Boolean) {
+ taskbarSharedState.showCornerRadiusInDesktopMode = doesAnyTaskRequireTaskbarRounding
+ val cornerRadius = getTaskbarCornerRoundness(doesAnyTaskRequireTaskbarRounding)
+ taskbarControllers.taskbarCornerRoundness.animateToValue(cornerRadius).start()
+ }
+
+ fun getTaskbarCornerRoundness(doesAnyTaskRequireTaskbarRounding: Boolean): Float {
+ return if (doesAnyTaskRequireTaskbarRounding) {
+ MAX_ROUNDNESS
+ } else {
+ 0f
+ }
+ }
+
+ fun onDestroy() = desktopVisibilityController?.unregisterTaskbarDesktopModeListener(this)
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt
index 12f1e63..a635537 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt
@@ -69,8 +69,6 @@
private lateinit var dividerView: View
- private val menuWidth =
- resources.getDimensionPixelSize(R.dimen.taskbar_pinning_popup_menu_width)
private val popupCornerRadius = Themes.getDialogCornerRadius(context)
private val arrowWidth = resources.getDimension(R.dimen.popup_arrow_width)
private val arrowHeight = resources.getDimension(R.dimen.popup_arrow_height)
@@ -98,16 +96,21 @@
popupContainer.getDescendantRectRelativeToSelf(dividerView, outPos)
}
- @SuppressLint("UseSwitchCompatOrMaterialCode")
+ @SuppressLint("UseSwitchCompatOrMaterialCode", "ClickableViewAccessibility")
override fun onFinishInflate() {
super.onFinishInflate()
val taskbarSwitchOption = requireViewById<LinearLayout>(R.id.taskbar_switch_option)
val alwaysShowTaskbarSwitch = requireViewById<Switch>(R.id.taskbar_pinning_switch)
val taskbarVisibilityIcon = requireViewById<View>(R.id.taskbar_pinning_visibility_icon)
+
alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn
+ alwaysShowTaskbarSwitch.setOnTouchListener { view, event ->
+ (view.parent as View).onTouchEvent(event)
+ }
+ alwaysShowTaskbarSwitch.setOnClickListener { view -> (view.parent as View).performClick() }
+
if (ActivityContext.lookupContext<TaskbarActivityContext>(context).isGestureNav) {
taskbarSwitchOption.setOnClickListener {
- alwaysShowTaskbarSwitch.isClickable = true
alwaysShowTaskbarSwitch.isChecked = !alwaysShowTaskbarOn
onClickAlwaysShowTaskbarSwitchOption()
}
@@ -125,7 +128,7 @@
/** Orient object as usual and then center object horizontally. */
override fun orientAboutObject() {
super.orientAboutObject()
- x = mTempRect.centerX() - menuWidth / 2f
+ x = mTempRect.centerX() - measuredWidth / 2f
}
override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
index 189b687..5bbf4b2 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -74,16 +74,19 @@
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
+import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.views.BubbleTextHolder;
+import com.android.quickstep.LauncherActivityInterface;
+import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.LogUtils;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.systemui.shared.recents.model.Task;
-import com.android.wm.shell.draganddrop.DragAndDropConstants;
+import com.android.wm.shell.shared.draganddrop.DragAndDropConstants;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -163,11 +166,6 @@
return false;
}
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onTaskbarItemLongClick");
- if (TestProtocol.sDebugTracing) {
- Log.d(TestProtocol.TWO_TASKBAR_LONG_CLICKS,
- "TaskbarDragController.startDragOnLongClick",
- new Throwable());
- }
BubbleTextView btv = (BubbleTextView) view;
mActivity.onDragStart();
btv.post(() -> {
@@ -184,7 +182,9 @@
private DragView startInternalDrag(
BubbleTextView btv, @Nullable DragPreviewProvider dragPreviewProvider) {
- float iconScale = btv.getIcon().getAnimatedScale();
+ // TODO(b/344038728): null check is only necessary because Recents doesn't use
+ // FastBitmapDrawable
+ float iconScale = btv.getIcon() == null ? 1f : btv.getIcon().getAnimatedScale();
// Clear the pressed state if necessary
btv.clearFocus();
@@ -251,7 +251,7 @@
dragLayerX + dragOffset.x,
dragLayerY + dragOffset.y,
(View target, DropTarget.DragObject d, boolean success) -> {} /* DragSource */,
- (ItemInfo) btv.getTag(),
+ btv.getTag() instanceof ItemInfo itemInfo ? itemInfo : null,
dragRect,
scale * iconScale,
scale,
@@ -291,7 +291,9 @@
initialDragViewScale,
dragViewScaleOnDrop,
scalePx);
- dragView.setItemInfo(dragInfo);
+ if (dragInfo != null) {
+ dragView.setItemInfo(dragInfo);
+ }
mDragObject.dragComplete = false;
mDragObject.xOffset = mMotionDown.x - (dragLayerX + dragRegionLeft);
@@ -304,7 +306,8 @@
mDragObject.dragSource = source;
mDragObject.dragInfo = dragInfo;
- mDragObject.originalDragInfo = mDragObject.dragInfo.makeShallowCopy();
+ mDragObject.originalDragInfo =
+ mDragObject.dragInfo != null ? mDragObject.dragInfo.makeShallowCopy() : null;
if (mOptions.preDragCondition != null) {
dragView.setHasDragOffset(mOptions.preDragCondition.getDragOffset().x != 0
@@ -340,8 +343,13 @@
@Override
protected void callOnDragStart() {
super.callOnDragStart();
+ // TODO(297921594) clean it up when taskbar to desktop drag is implemented.
+ DesktopVisibilityController desktopController =
+ LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
+
// Pre-drag has ended, start the global system drag.
- if (mDisallowGlobalDrag) {
+ if (mDisallowGlobalDrag || (desktopController != null
+ && desktopController.areDesktopTasksVisible())) {
AbstractFloatingView.closeAllOpenViewsExcept(mActivity, TYPE_TASKBAR_ALL_APPS);
return;
}
@@ -429,8 +437,8 @@
null, item.user));
}
intent.putExtra(Intent.EXTRA_USER, item.user);
- } else if (tag instanceof Task) {
- Task task = (Task) tag;
+ } else if (tag instanceof GroupTask groupTask && !groupTask.hasMultipleTasks()) {
+ Task task = groupTask.task1;
clipDescription = new ClipDescription(task.titleDescription,
new String[] {
ClipDescription.MIMETYPE_APPLICATION_TASK
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
index 7f201b4..a090956 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
@@ -22,6 +22,7 @@
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.Rect;
import android.graphics.RectF;
import android.media.permission.SafeCloseable;
import android.util.AttributeSet;
@@ -37,7 +38,7 @@
import androidx.core.graphics.Insets;
import androidx.core.view.WindowInsetsCompat;
-import com.android.app.viewcapture.SettingsAwareViewCapture;
+import com.android.app.viewcapture.ViewCaptureFactory;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -104,7 +105,6 @@
mTaskbarBackgroundAlpha = new MultiPropertyFactory<>(this, BG_ALPHA, INDEX_COUNT,
(a, b) -> a * b, 1f);
mTaskbarBackgroundAlpha.get(INDEX_ALL_OTHER_STATES).setValue(0);
- mTaskbarBackgroundAlpha.get(INDEX_STASH_ANIM).setValue(1);
}
public void init(TaskbarDragLayerController.TaskbarDragLayerCallbacks callbacks) {
@@ -150,7 +150,7 @@
protected void onAttachedToWindow() {
super.onAttachedToWindow();
getViewTreeObserver().addOnComputeInternalInsetsListener(mTaskbarInsetsComputer);
- mViewCaptureCloseable = SettingsAwareViewCapture.getInstance(getContext())
+ mViewCaptureCloseable = ViewCaptureFactory.getInstance(getContext())
.startCapture(getRootView(), ".Taskbar");
}
@@ -260,6 +260,11 @@
return mBackgroundRenderer.getLastDrawnTransientRect();
}
+ /** Returns the rect used to transform transient taskbar to the hotseat */
+ public Rect getTaskbarToHotseatOffsetRect() {
+ return mBackgroundRenderer.getTaskbarToHotseatOffsetRect();
+ }
+
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
TestLogging.recordMotionEvent(TestProtocol.SEQUENCE_MAIN, "Touch event", ev);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
index ff890fb..acf976f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -291,7 +291,7 @@
if (mActivity.isPhoneMode()) {
Resources resources = mActivity.getResources();
Point taskbarDimensions = DimensionUtils.getTaskbarPhoneDimensions(deviceProfile,
- resources, true /* isPhoneMode */);
+ resources, true /* isPhoneMode */, mActivity.isGestureNav());
return taskbarDimensions.y == -1 ?
deviceProfile.getDisplayInfo().currentSize.y :
taskbarDimensions.y;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt
index c45c667..19e9872 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt
@@ -27,6 +27,7 @@
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.view.animation.Interpolator
+import android.window.OnBackInvokedDispatcher
import androidx.core.view.updateLayoutParams
import com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE
import com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE
@@ -52,8 +53,7 @@
private val activityContext: ActivityContext = ActivityContext.lookupContext(context)
- private val backgroundColor =
- Themes.getAttrColor(context, com.android.internal.R.attr.materialColorSurfaceBright)
+ private val backgroundColor = Themes.getAttrColor(context, R.attr.materialColorSurfaceBright)
private val tooltipCornerRadius = Themes.getDialogCornerRadius(context)
private val arrowWidth = resources.getDimension(R.dimen.popup_arrow_width)
@@ -66,11 +66,14 @@
/** Container where the tooltip's body should be inflated. */
lateinit var content: ViewGroup
private set
+
private lateinit var arrow: View
/** Callback invoked when the tooltip is being closed. */
var onCloseCallback: () -> Unit = {}
private var openCloseAnimator: AnimatorSet? = null
+ /** Used to set whether users can tap outside the current tooltip window to dismiss it */
+ var allowTouchDismissal = true
/** Animates the tooltip into view. */
fun show() {
@@ -134,14 +137,25 @@
override fun isOfType(type: Int): Boolean = type and TYPE_TASKBAR_EDUCATION_DIALOG != 0
override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean {
- if (ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev)) {
+ if (
+ ev?.action == ACTION_DOWN &&
+ !activityContext.dragLayer.isEventOverView(this, ev) &&
+ allowTouchDismissal
+ ) {
close(true)
}
return false
}
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ findOnBackInvokedDispatcher()
+ ?.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, this)
+ }
+
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
+ findOnBackInvokedDispatcher()?.unregisterOnBackInvokedCallback(this)
Settings.Secure.putInt(mContext.contentResolver, LAUNCHER_TASKBAR_EDUCATION_SHOWING, 0)
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt
index d43055d..06376d3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt
@@ -33,6 +33,7 @@
import android.widget.TextView
import androidx.annotation.IntDef
import androidx.annotation.LayoutRes
+import androidx.annotation.VisibleForTesting
import androidx.core.text.HtmlCompat
import androidx.core.view.updateLayoutParams
import com.airbnb.lottie.LottieAnimationView
@@ -81,15 +82,23 @@
protected val activityContext: TaskbarActivityContext = ActivityContext.lookupContext(context)
open val shouldShowSearchEdu = false
private val isTooltipEnabled: Boolean
- get() = !Utilities.isRunningInTestHarness() && !activityContext.isPhoneMode
- private val isOpen: Boolean
+ get() {
+ return !Utilities.isRunningInTestHarness() &&
+ !activityContext.isPhoneMode &&
+ !activityContext.isTinyTaskbar
+ }
+
+ val isTooltipOpen: Boolean
get() = tooltip?.isOpen ?: false
+
val isBeforeTooltipFeaturesStep: Boolean
get() = isTooltipEnabled && tooltipStep <= TOOLTIP_STEP_FEATURES
+
private lateinit var controllers: TaskbarControllers
// Keep track of whether the user has seen the Search Edu
- private var userHasSeenSearchEdu: Boolean
+ @VisibleForTesting
+ var userHasSeenSearchEdu: Boolean
get() {
return TASKBAR_SEARCH_EDU_SEEN.get(activityContext)
}
@@ -148,6 +157,7 @@
tooltipStep = TOOLTIP_STEP_NONE
inflateTooltip(R.layout.taskbar_edu_features)
tooltip?.run {
+ allowTouchDismissal = false
val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation)
val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation)
val pinningAnim = requireViewById<LottieAnimationView>(R.id.pinning_animation)
@@ -212,6 +222,7 @@
inflateTooltip(R.layout.taskbar_edu_pinning)
tooltip?.run {
+ allowTouchDismissal = true
requireViewById<LottieAnimationView>(R.id.standalone_pinning_animation)
.supportLightTheme()
@@ -256,6 +267,7 @@
userHasSeenSearchEdu = true
inflateTooltip(R.layout.taskbar_edu_search)
tooltip?.run {
+ allowTouchDismissal = true
requireViewById<LottieAnimationView>(R.id.search_edu_animation).supportLightTheme()
val eduSubtitle: TextView = requireViewById(R.id.search_edu_text)
showDisclosureText(eduSubtitle)
@@ -328,7 +340,9 @@
}
/** Closes the current [tooltip]. */
- fun hide() = tooltip?.close(true)
+ fun hide() {
+ tooltip?.close(true)
+ }
/** Initializes [tooltip] with content from [contentResId]. */
private fun inflateTooltip(@LayoutRes contentResId: Int) {
@@ -397,7 +411,7 @@
override fun dumpLogs(prefix: String?, pw: PrintWriter?) {
pw?.println(prefix + "TaskbarEduTooltipController:")
pw?.println("$prefix\tisTooltipEnabled=$isTooltipEnabled")
- pw?.println("$prefix\tisOpen=$isOpen")
+ pw?.println("$prefix\tisOpen=$isTooltipOpen")
pw?.println("$prefix\ttooltipStep=$tooltipStep")
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
index 333c07b..8a86402 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
@@ -34,6 +34,7 @@
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.TouchController;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
/**
* Controller for taskbar when force visible in immersive mode is set.
@@ -83,7 +84,10 @@
}
/** Update values tracked via sysui flags. */
- public void updateSysuiFlags(int sysuiFlags) {
+ public void updateSysuiFlags(@SystemUiStateFlags long sysuiFlags) {
+ if (mContext.isPhoneMode()) {
+ return;
+ }
mIsImmersiveMode = (sysuiFlags & SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY) == 0;
if (mContext.isNavBarForceVisible()) {
if (mIsImmersiveMode) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
index 0443197..3bff31f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java
@@ -18,29 +18,22 @@
import static android.view.MotionEvent.ACTION_HOVER_ENTER;
import static android.view.MotionEvent.ACTION_HOVER_EXIT;
import static android.view.View.ALPHA;
-import static android.view.View.SCALE_Y;
-import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_TEXT;
-import static com.android.app.animation.Interpolators.LINEAR;
-import static com.android.launcher3.AbstractFloatingView.TYPE_ALL_EXCEPT_ON_BOARD_POPUP;
+import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS;
-import static com.android.launcher3.views.ArrowTipView.TEXT_ALPHA;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Looper;
import android.view.ContextThemeWrapper;
import android.view.MotionEvent;
import android.view.View;
-import com.android.app.animation.Interpolators;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.compat.AccessibilityManagerCompat;
+import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.views.ArrowTipView;
@@ -48,19 +41,16 @@
* Controls showing a tooltip in the taskbar above each icon when it is hovered.
*/
public class TaskbarHoverToolTipController implements View.OnHoverListener {
-
- private static final int HOVER_TOOL_TIP_REVEAL_DURATION = 250;
- private static final int HOVER_TOOL_TIP_EXIT_DURATION = 150;
-
- private final Handler mHoverToolTipHandler = new Handler(Looper.getMainLooper());
- private final Runnable mRevealHoverToolTipRunnable = this::revealHoverToolTip;
- private final Runnable mHideHoverToolTipRunnable = this::hideHoverToolTip;
+ // Short duration to reveal tooltip, as it is positioned in the x/y via a post() call in
+ // parallel with the open animation. An instant animation could show in the wrong location.
+ private static final int HOVER_TOOL_TIP_REVEAL_DURATION = 15;
private final TaskbarActivityContext mActivity;
private final TaskbarView mTaskbarView;
private final View mHoverView;
private final ArrowTipView mHoverToolTipView;
private final String mToolTipText;
+ private final int mYOffset;
public TaskbarHoverToolTipController(TaskbarActivityContext activity, TaskbarView taskbarView,
View hoverView) {
@@ -73,6 +63,8 @@
} else if (mHoverView instanceof FolderIcon
&& ((FolderIcon) mHoverView).mInfo.title != null) {
mToolTipText = ((FolderIcon) mHoverView).mInfo.title.toString();
+ } else if (mHoverView instanceof AppPairIcon) {
+ mToolTipText = ((AppPairIcon) mHoverView).getTitleTextView().getText().toString();
} else {
mToolTipText = null;
}
@@ -87,90 +79,51 @@
R.dimen.taskbar_tooltip_horizontal_padding);
mHoverToolTipView.findViewById(R.id.text).setPadding(horizontalPadding, verticalPadding,
horizontalPadding, verticalPadding);
-
- AnimatorSet hoverCloseAnimator = new AnimatorSet();
- ObjectAnimator textCloseAnimator = ObjectAnimator.ofInt(mHoverToolTipView, TEXT_ALPHA, 0);
- textCloseAnimator.setInterpolator(Interpolators.clampToProgress(LINEAR, 0, 0.33f));
- ObjectAnimator alphaCloseAnimator = ObjectAnimator.ofFloat(mHoverToolTipView, ALPHA, 0);
- alphaCloseAnimator.setInterpolator(Interpolators.clampToProgress(LINEAR, 0.33f, 0.66f));
- ObjectAnimator scaleCloseAnimator = ObjectAnimator.ofFloat(mHoverToolTipView, SCALE_Y, 0);
- scaleCloseAnimator.setInterpolator(Interpolators.STANDARD);
- hoverCloseAnimator.playTogether(
- textCloseAnimator,
- alphaCloseAnimator,
- scaleCloseAnimator);
- hoverCloseAnimator.setStartDelay(0);
- hoverCloseAnimator.setDuration(HOVER_TOOL_TIP_EXIT_DURATION);
- mHoverToolTipView.setCustomCloseAnimation(hoverCloseAnimator);
+ mHoverToolTipView.setAlpha(0);
+ mYOffset = arrowContextWrapper.getResources().getDimensionPixelSize(
+ R.dimen.taskbar_tooltip_y_offset);
AnimatorSet hoverOpenAnimator = new AnimatorSet();
- ObjectAnimator textOpenAnimator =
- ObjectAnimator.ofInt(mHoverToolTipView, TEXT_ALPHA, 0, 255);
- textOpenAnimator.setInterpolator(Interpolators.clampToProgress(LINEAR, 0.15f, 0.75f));
- ObjectAnimator scaleOpenAnimator =
- ObjectAnimator.ofFloat(mHoverToolTipView, SCALE_Y, 0f, 1f);
- scaleOpenAnimator.setInterpolator(Interpolators.EMPHASIZED);
ObjectAnimator alphaOpenAnimator = ObjectAnimator.ofFloat(mHoverToolTipView, ALPHA, 0f, 1f);
- alphaOpenAnimator.setInterpolator(Interpolators.clampToProgress(LINEAR, 0f, 0.33f));
- hoverOpenAnimator.playTogether(
- scaleOpenAnimator,
- textOpenAnimator,
- alphaOpenAnimator);
+ hoverOpenAnimator.play(alphaOpenAnimator);
hoverOpenAnimator.setDuration(HOVER_TOOL_TIP_REVEAL_DURATION);
mHoverToolTipView.setCustomOpenAnimation(hoverOpenAnimator);
mHoverToolTipView.addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
mHoverToolTipView.setPivotY(bottom);
- mHoverToolTipView.setY(mTaskbarView.getTop() - (bottom - top));
+ mHoverToolTipView.setY(mTaskbarView.getTop() - mYOffset - (bottom - top));
});
}
@Override
public boolean onHover(View v, MotionEvent event) {
- boolean isAnyOtherFloatingViewOpen =
- AbstractFloatingView.hasOpenView(mActivity, TYPE_ALL_EXCEPT_ON_BOARD_POPUP);
- if (isAnyOtherFloatingViewOpen) {
- mHoverToolTipHandler.removeCallbacksAndMessages(null);
- }
+ boolean isFolderOpen = AbstractFloatingView.hasOpenView(mActivity, TYPE_FOLDER);
// If hover leaves a taskbar icon animate the tooltip closed.
if (event.getAction() == ACTION_HOVER_EXIT) {
- startHideHoverToolTip();
+ mHoverToolTipView.close(/* animate= */ false);
mActivity.setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, false);
- return true;
- } else if (!isAnyOtherFloatingViewOpen && event.getAction() == ACTION_HOVER_ENTER) {
- // If hovering above a taskbar icon starts, animate the tooltip open. Do not
- // reveal if any floating views such as folders or edu pop-ups are open.
- startRevealHoverToolTip();
+ } else if (!isFolderOpen && event.getAction() == ACTION_HOVER_ENTER) {
+ // Do not reveal if any floating views such as folders or edu pop-ups are open.
+ revealHoverToolTip();
mActivity.setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true);
- return true;
}
- return false;
- }
-
- private void startRevealHoverToolTip() {
- mHoverToolTipHandler.post(mRevealHoverToolTipRunnable);
+ return true;
}
private void revealHoverToolTip() {
if (mHoverView == null || mToolTipText == null) {
return;
}
+ // Do not show tooltip if taskbar icons are transitioning to hotseat.
+ if (mActivity.isIconAlignedWithHotseat()) {
+ return;
+ }
if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) {
return;
}
Rect iconViewBounds = Utilities.getViewBounds(mHoverView);
mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(),
- mTaskbarView.getTop(), /* shouldAutoClose= */ false);
- }
-
- private void startHideHoverToolTip() {
- int accessibilityHideTimeout = AccessibilityManagerCompat.getRecommendedTimeoutMillis(
- mActivity, /* originalTimeout= */ 0, FLAG_CONTENT_TEXT);
- mHoverToolTipHandler.postDelayed(mHideHoverToolTipRunnable, accessibilityHideTimeout);
- }
-
- private void hideHoverToolTip() {
- mHoverToolTipView.close(/* animate = */ true);
+ mTaskbarView.getTop() - mYOffset, /* shouldAutoClose= */ false);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
index 4a8ed87..221504d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
@@ -51,10 +51,11 @@
import com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION
import com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
+import com.android.launcher3.testing.shared.ResourceUtils
import com.android.launcher3.util.DisplayController
+import com.android.launcher3.util.Executors
import java.io.PrintWriter
import kotlin.jvm.optionals.getOrNull
-import kotlin.math.max
/** Handles the insets that Taskbar provides to underlying apps and the IME. */
class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTaskbarController {
@@ -62,6 +63,10 @@
companion object {
private const val INDEX_LEFT = 0
private const val INDEX_RIGHT = 1
+
+ private fun Region.addBoundsToRegion(bounds: Rect?) {
+ bounds?.let { op(it, Region.Op.UNION) }
+ }
}
/** The bottom insets taskbar provides to the IME when IME is visible. */
@@ -75,6 +80,7 @@
private val gestureNavSettingsObserver =
GestureNavigationSettingsObserver(
context.mainThreadHandler,
+ Executors.UI_HELPER_EXECUTOR.handler,
context,
this::onTaskbarOrBubblebarWindowHeightOrInsetsChanged
)
@@ -99,7 +105,8 @@
}
fun onTaskbarOrBubblebarWindowHeightOrInsetsChanged() {
- val tappableHeight = controllers.taskbarStashController.tappableHeightToReportToApps
+ val taskbarStashController = controllers.taskbarStashController
+ val tappableHeight = taskbarStashController.tappableHeightToReportToApps
// We only report tappableElement height for unstashed, persistent taskbar,
// which is also when we draw the rounded corners above taskbar.
val insetsRoundedCornerFlag =
@@ -125,47 +132,27 @@
}
}
- val taskbarTouchableHeight = controllers.taskbarStashController.touchableHeight
+ val bubbleControllers = controllers.bubbleControllers.getOrNull()
+ val taskbarTouchableHeight = taskbarStashController.touchableHeight
val bubblesTouchableHeight =
- if (controllers.bubbleControllers.isPresent) {
- controllers.bubbleControllers.get().bubbleStashController.touchableHeight
- } else {
- 0
+ bubbleControllers?.bubbleStashController?.getTouchableHeight() ?: 0
+ // reset touch bounds
+ defaultTouchableRegion.setEmpty()
+ if (bubbleControllers != null) {
+ val bubbleBarViewController = bubbleControllers.bubbleBarViewController
+ val isBubbleBarVisible = bubbleControllers.bubbleStashController.isBubbleBarVisible()
+ val isAnimatingNewBubble = bubbleBarViewController.isAnimatingNewBubble
+ // if bubble bar is visible or animating new bubble, add bar bounds to the touch region
+ if (isBubbleBarVisible || isAnimatingNewBubble) {
+ defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.bubbleBarBounds)
}
- val touchableHeight = max(taskbarTouchableHeight, bubblesTouchableHeight)
-
- if (
- controllers.bubbleControllers.isPresent &&
- controllers.bubbleControllers.get().bubbleStashController.isBubblesShowingOnHome
- ) {
- val iconBounds =
- controllers.bubbleControllers.get().bubbleBarViewController.bubbleBarBounds
- defaultTouchableRegion.set(
- iconBounds.left,
- iconBounds.top,
- iconBounds.right,
- iconBounds.bottom
- )
- } else {
- defaultTouchableRegion.set(
- 0,
- windowLayoutParams.height - touchableHeight,
- context.deviceProfile.widthPx,
- windowLayoutParams.height
- )
-
- // if there's an animating bubble add it to the touch region so that it's clickable
- val isAnimatingNewBubble =
- controllers.bubbleControllers
- .getOrNull()
- ?.bubbleBarViewController
- ?.isAnimatingNewBubble
- ?: false
- if (isAnimatingNewBubble) {
- val iconBounds =
- controllers.bubbleControllers.get().bubbleBarViewController.bubbleBarBounds
- defaultTouchableRegion.op(iconBounds, Region.Op.UNION)
- }
+ }
+ if (taskbarStashController.isInApp || taskbarStashController.isInOverview) {
+ // only add the taskbar touch region if not on home
+ val bottom = windowLayoutParams.height
+ val top = bottom - taskbarTouchableHeight
+ val right = context.deviceProfile.widthPx
+ defaultTouchableRegion.addBoundsToRegion(Rect(/* left= */ 0, top, right, bottom))
}
// Pre-calculate insets for different providers across different rotations for this gravity
@@ -231,8 +218,25 @@
val contentHeight = controllers.taskbarStashController.contentHeightToReportToApps
val tappableHeight = controllers.taskbarStashController.tappableHeightToReportToApps
val res = context.resources
- if (provider.type == navigationBars() || provider.type == mandatorySystemGestures()) {
+ if (provider.type == navigationBars()) {
provider.insetsSize = getInsetsForGravityWithCutout(contentHeight, gravity, endRotation)
+ } else if (provider.type == mandatorySystemGestures()) {
+ if (context.isThreeButtonNav) {
+ provider.insetsSize =
+ getInsetsForGravityWithCutout(contentHeight, gravity, endRotation)
+ } else {
+ val gestureHeight =
+ ResourceUtils.getNavbarSize(
+ ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE,
+ context.resources
+ )
+ val isPinnedTaskbar =
+ context.deviceProfile.isTaskbarPresent &&
+ !context.deviceProfile.isTransientTaskbar
+ val mandatoryGestureHeight = if (isPinnedTaskbar) contentHeight else gestureHeight
+ provider.insetsSize =
+ getInsetsForGravityWithCutout(mandatoryGestureHeight, gravity, endRotation)
+ }
} else if (provider.type == tappableElement()) {
provider.insetsSize = getInsetsForGravity(tappableHeight, gravity)
} else if (provider.type == systemGestures() && provider.index == INDEX_LEFT) {
@@ -338,13 +342,6 @@
*/
fun updateInsetsTouchability(insetsInfo: ViewTreeObserver.InternalInsetsInfo) {
insetsInfo.touchableRegion.setEmpty()
- // Always have nav buttons be touchable
- controllers.navbarButtonsViewController.addVisibleButtonsRegion(
- context.dragLayer,
- insetsInfo.touchableRegion
- )
- debugTouchableRegion.lastSetTouchableBounds.set(insetsInfo.touchableRegion.bounds)
-
val bubbleBarVisible =
controllers.bubbleControllers.isPresent &&
controllers.bubbleControllers.get().bubbleBarViewController.isBubbleBarVisible()
@@ -406,7 +403,7 @@
// Include the bounds of the bubble bar in the touchable region if they exist.
if (bubbleBarBounds != null) {
- region.op(bubbleBarBounds, Region.Op.UNION)
+ region.addBoundsToRegion(bubbleBarBounds)
}
insetsInfo.touchableRegion.set(region)
debugTouchableRegion.lastSetTouchableReason = "Transient Taskbar is in Overview"
@@ -423,6 +420,12 @@
debugTouchableRegion.lastSetTouchableReason =
"Icons are not visible, but other components such as 3 buttons might be"
}
+ // Always have nav buttons be touchable
+ controllers.navbarButtonsViewController.addVisibleButtonsRegion(
+ context.dragLayer,
+ insetsInfo.touchableRegion
+ )
+ debugTouchableRegion.lastSetTouchableBounds.set(insetsInfo.touchableRegion.bounds)
context.excludeFromMagnificationRegion(insetsIsTouchableRegion)
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
index 03d08eb..911140a 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
@@ -5,9 +5,6 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BACK_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DOZING;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DREAMING;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_WAKEFULNESS_MASK;
@@ -16,7 +13,9 @@
import android.app.KeyguardManager;
import com.android.launcher3.AbstractFloatingView;
+import com.android.quickstep.util.SystemUiFlagUtils;
import com.android.systemui.shared.system.QuickStepContract;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
@@ -25,21 +24,8 @@
*/
public class TaskbarKeyguardController implements TaskbarControllers.LoggableTaskbarController {
- private static final int KEYGUARD_SYSUI_FLAGS = SYSUI_STATE_BOUNCER_SHOWING
- | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING | SYSUI_STATE_DEVICE_DOZING
- | SYSUI_STATE_OVERVIEW_DISABLED | SYSUI_STATE_HOME_DISABLED
- | SYSUI_STATE_BACK_DISABLED | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED
- | SYSUI_STATE_WAKEFULNESS_MASK;
-
- // If any of these SysUi flags (via QuickstepContract) is set, the device to be considered
- // locked.
- public static final int MASK_ANY_SYSUI_LOCKED = SYSUI_STATE_BOUNCER_SHOWING
- | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
- | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED
- | SYSUI_STATE_DEVICE_DREAMING;
-
private final TaskbarActivityContext mContext;
- private int mKeyguardSysuiFlags;
+ private long mKeyguardSysuiFlags;
private boolean mBouncerShowing;
private NavbarButtonsViewController mNavbarButtonsViewController;
private final KeyguardManager mKeyguardManager;
@@ -53,8 +39,8 @@
mNavbarButtonsViewController = navbarButtonUIController;
}
- public void updateStateForSysuiFlags(int systemUiStateFlags) {
- int interestingKeyguardFlags = systemUiStateFlags & KEYGUARD_SYSUI_FLAGS;
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags) {
+ long interestingKeyguardFlags = systemUiStateFlags & SystemUiFlagUtils.KEYGUARD_SYSUI_FLAGS;
if (interestingKeyguardFlags == mKeyguardSysuiFlags) {
// No change in keyguard relevant flags
return;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index ee21eac..63fae8c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -16,7 +16,6 @@
package com.android.launcher3.taskbar;
import static com.android.app.animation.Interpolators.EMPHASIZED;
-import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_APP;
import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_OVERVIEW;
import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_STASHED_LAUNCHER_STATE;
@@ -24,6 +23,7 @@
import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_AWAKE;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_COMMUNAL_HUB_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DREAMING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_WAKEFULNESS_MASK;
import static com.android.systemui.shared.system.QuickStepContract.WAKEFULNESS_AWAKE;
@@ -48,12 +48,15 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.quickstep.RecentsAnimationCallbacks;
import com.android.quickstep.RecentsAnimationController;
+import com.android.quickstep.util.SystemUiFlagUtils;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.animation.ViewRootSync;
import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
import java.util.HashMap;
@@ -65,7 +68,7 @@
*/
public class TaskbarLauncherStateController {
- private static final String TAG = TaskbarLauncherStateController.class.getSimpleName();
+ private static final String TAG = "TaskbarLauncherStateController";
private static final boolean DEBUG = false;
/** Launcher activity is visible and focused. */
@@ -145,6 +148,7 @@
private MultiProperty mIconAlphaForHome;
private QuickstepLauncher mLauncher;
+ private boolean mIsDestroyed = false;
private Integer mPrevState;
private int mState;
private LauncherState mLauncherState = LauncherState.NORMAL;
@@ -226,7 +230,7 @@
/** Initializes the controller instance, and applies the initial state immediately. */
public void init(TaskbarControllers controllers, QuickstepLauncher launcher,
- int sysuiStateFlags) {
+ @SystemUiStateFlags long sysuiStateFlags) {
mCanSyncViews = false;
mControllers = controllers;
@@ -243,18 +247,21 @@
resetIconAlignment();
- mLauncher.getStateManager().addStateListener(mStateListener);
+ if (!mControllers.taskbarActivityContext.isPhoneMode()) {
+ mLauncher.getStateManager().addStateListener(mStateListener);
+ }
mLauncherState = launcher.getStateManager().getState();
updateStateForSysuiFlags(sysuiStateFlags, /*applyState*/ false);
applyState(0);
- mCanSyncViews = true;
+ mCanSyncViews = !mControllers.taskbarActivityContext.isPhoneMode();
mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
updateOverviewDragState(mLauncherState);
}
public void onDestroy() {
+ mIsDestroyed = true;
mCanSyncViews = false;
mIconAlignment.finishAnimation();
@@ -262,7 +269,7 @@
mLauncher.getHotseat().setIconsAlpha(1f);
mLauncher.getStateManager().removeStateListener(mStateListener);
- mCanSyncViews = true;
+ mCanSyncViews = !mControllers.taskbarActivityContext.isPhoneMode();
mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
}
@@ -325,11 +332,12 @@
}
/** SysUI flags updated, see QuickStepContract.SYSUI_STATE_* values. */
- public void updateStateForSysuiFlags(int systemUiStateFlags) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags) {
updateStateForSysuiFlags(systemUiStateFlags, /* applyState */ true);
}
- private void updateStateForSysuiFlags(int systemUiStateFlags, boolean applyState) {
+ private void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags,
+ boolean applyState) {
final boolean prevIsAwake = hasAnyFlag(FLAG_AWAKE);
final boolean currIsAwake = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_AWAKE);
@@ -341,15 +349,16 @@
prevIsAwake && hasAnyFlag(FLAGS_LAUNCHER_ACTIVE));
}
- boolean isDeviceLocked = hasAnyFlag(systemUiStateFlags, MASK_ANY_SYSUI_LOCKED);
- updateStateForFlag(FLAG_DEVICE_LOCKED, isDeviceLocked);
+ updateStateForFlag(FLAG_DEVICE_LOCKED, SystemUiFlagUtils.isLocked(systemUiStateFlags));
// Taskbar is hidden whenever the device is dreaming. The dreaming state includes the
// interactive dreams, AoD, screen off. Since the SYSUI_STATE_DEVICE_DREAMING only kicks in
// when the device is asleep, the second condition extends ensures that the transition from
// and to the WAKEFULNESS_ASLEEP state also hide the taskbar, and improves the taskbar
- // hide/reveal animation timings.
- boolean isTaskbarHidden = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_DEVICE_DREAMING)
+ // hide/reveal animation timings. The Taskbar can show when dreaming if the glanceable hub
+ // is showing on top.
+ boolean isTaskbarHidden = (hasAnyFlag(systemUiStateFlags, SYSUI_STATE_DEVICE_DREAMING)
+ && !hasAnyFlag(systemUiStateFlags, SYSUI_STATE_COMMUNAL_HUB_SHOWING))
|| (systemUiStateFlags & SYSUI_STATE_WAKEFULNESS_MASK) != WAKEFULNESS_AWAKE;
updateStateForFlag(FLAG_TASKBAR_HIDDEN, isTaskbarHidden);
@@ -389,11 +398,11 @@
}
}
- private boolean hasAnyFlag(int flagMask) {
+ private boolean hasAnyFlag(long flagMask) {
return hasAnyFlag(mState, flagMask);
}
- private boolean hasAnyFlag(int flags, int flagMask) {
+ private boolean hasAnyFlag(long flags, long flagMask) {
return (flags & flagMask) != 0;
}
@@ -406,7 +415,7 @@
}
public Animator applyState(long duration, boolean start) {
- if (mControllers.taskbarActivityContext.isDestroyed()) {
+ if (mIsDestroyed || mControllers.taskbarActivityContext.isPhoneMode()) {
return null;
}
Animator animator = null;
@@ -432,6 +441,11 @@
return animator;
}
+ /** Returns {@code true} if launcher is currently presenting the home screen. */
+ public boolean isOnHome() {
+ return isInLauncher() && mLauncherState == LauncherState.NORMAL;
+ }
+
private Animator onStateChangeApplied(int changedFlags, long duration, boolean start) {
final boolean isInLauncher = isInLauncher();
final boolean isIconAlignedWithHotseat = isIconAlignedWithHotseat();
@@ -444,9 +458,8 @@
}
mControllers.bubbleControllers.ifPresent(controllers -> {
// Show the bubble bar when on launcher home or in overview.
- boolean onHome = isInLauncher && mLauncherState == LauncherState.NORMAL;
boolean onOverview = mLauncherState == LauncherState.OVERVIEW;
- controllers.bubbleStashController.setBubblesShowingOnHome(onHome);
+ controllers.bubbleStashController.setBubblesShowingOnHome(isOnHome());
controllers.bubbleStashController.setBubblesShowingOnOverview(onOverview);
});
@@ -469,7 +482,8 @@
// We're changing state to home, should close open popups e.g. Taskbar AllApps
handleOpenFloatingViews = true;
}
- if (mLauncherState == LauncherState.OVERVIEW) {
+ if (mLauncherState == LauncherState.OVERVIEW
+ && !mControllers.taskbarActivityContext.isPhoneMode()) {
// Calling to update the insets in TaskbarInsetController#updateInsetsTouchability
mControllers.taskbarActivityContext.notifyUpdateLayoutParams();
}
@@ -578,6 +592,12 @@
float cornerRoundness = isInLauncher ? 0 : 1;
+ if (DisplayController.isInDesktopMode(mLauncher) && mControllers.getSharedState() != null) {
+ cornerRoundness =
+ mControllers.taskbarDesktopModeController.getTaskbarCornerRoundness(
+ mControllers.getSharedState().showCornerRadiusInDesktopMode);
+ }
+
// Don't animate if corner roundness has reached desired value.
if (mTaskbarCornerRoundness.isAnimating()
|| mTaskbarCornerRoundness.value != cornerRoundness) {
@@ -667,7 +687,7 @@
}
boolean isInOverviewUi() {
- return mLauncherState.overviewUi;
+ return mLauncherState.isRecentsViewVisible;
}
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
@@ -742,13 +762,12 @@
if (firstFrameVisChanged && mCanSyncViews && !Utilities.isRunningInTestHarness()) {
ViewRootSync.synchronizeNextDraw(mLauncher.getHotseat(),
mControllers.taskbarActivityContext.getDragLayer(),
- () -> {
- });
+ () -> {});
}
}
private void updateIconAlphaForHome(float alpha) {
- if (mControllers.taskbarActivityContext.isDestroyed()) {
+ if (mIsDestroyed) {
return;
}
mIconAlphaForHome.setValue(alpha);
@@ -851,7 +870,8 @@
"%s\tmTaskbarBackgroundAlpha=%.2f", prefix, mTaskbarBackgroundAlpha.value));
pw.println(String.format(
"%s\tmIconAlphaForHome=%.2f", prefix, mIconAlphaForHome.getValue()));
- pw.println(String.format("%s\tmPrevState=%s", prefix, getStateString(mPrevState)));
+ pw.println(String.format("%s\tmPrevState=%s", prefix,
+ mPrevState == null ? null : getStateString(mPrevState)));
pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
pw.println(String.format("%s\tmLauncherState=%s", prefix, mLauncherState));
pw.println(String.format(
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 42e6edb..8c87fa6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -39,7 +39,6 @@
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
@@ -72,7 +71,9 @@
import com.android.quickstep.RecentsActivity;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.AssistUtils;
+import com.android.systemui.shared.statusbar.phone.BarTransitions;
import com.android.systemui.shared.system.QuickStepContract;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
@@ -113,11 +114,12 @@
private WindowManager mWindowManager;
private FrameLayout mTaskbarRootLayout;
private boolean mAddedWindow;
+ private boolean mIsSuspended;
private final TaskbarNavButtonController mNavButtonController;
private final ComponentCallbacks mComponentCallbacks;
private final SimpleBroadcastReceiver mShutdownReceiver =
- new SimpleBroadcastReceiver(i -> destroyExistingTaskbar());
+ new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, i -> destroyExistingTaskbar());
// The source for this provider is set when Launcher is available
// We use 'non-destroyable' version here so the original provider won't be destroyed
@@ -154,7 +156,7 @@
private boolean mUserUnlocked = false;
private final SimpleBroadcastReceiver mTaskbarBroadcastReceiver =
- new SimpleBroadcastReceiver(this::showTaskbarFromBroadcast);
+ new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, this::showTaskbarFromBroadcast);
private final AllAppsActionManager mAllAppsActionManager;
@@ -310,10 +312,8 @@
SYSTEM_ACTION_ID_TASKBAR,
new Intent(ACTION_SHOW_TASKBAR).setPackage(mContext.getPackageName()),
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
- mContext.registerReceiver(
- mTaskbarBroadcastReceiver,
- new IntentFilter(ACTION_SHOW_TASKBAR),
- RECEIVER_NOT_EXPORTED);
+ mTaskbarBroadcastReceiver.register(
+ mContext, RECEIVER_NOT_EXPORTED, ACTION_SHOW_TASKBAR);
});
debugWhyTaskbarNotDestroyed("TaskbarManager created");
@@ -441,6 +441,8 @@
*/
@VisibleForTesting
public synchronized void recreateTaskbar() {
+ if (mIsSuspended) return;
+
Trace.beginSection("recreateTaskbar");
try {
DeviceProfile dp = mUserUnlocked ?
@@ -457,10 +459,12 @@
+ " [dp != null (i.e. mUserUnlocked)]=" + (dp != null)
+ " FLAG_HIDE_NAVBAR_WINDOW=" + ENABLE_TASKBAR_NAVBAR_UNIFICATION
+ " dp.isTaskbarPresent=" + (dp == null ? "null" : dp.isTaskbarPresent));
- if (!isTaskbarEnabled) {
+ if (!isTaskbarEnabled || !isLargeScreenTaskbar) {
SystemUiProxy.INSTANCE.get(mContext)
.notifyTaskbarStatus(/* visible */ false, /* stashed */ false);
- return;
+ if (!isTaskbarEnabled) {
+ return;
+ }
}
if (enableTaskbarNoRecreate() || mTaskbarActivityContext == null) {
@@ -491,7 +495,7 @@
}
}
- public void onSystemUiFlagsChanged(int systemUiStateFlags) {
+ public void onSystemUiFlagsChanged(@SystemUiStateFlags long systemUiStateFlags) {
if (DEBUG) {
Log.d(TAG, "SysUI flags changed: " + formatFlagChange(systemUiStateFlags,
mSharedState.sysuiStateFlags, QuickStepContract::getSystemUiStateString));
@@ -518,7 +522,37 @@
}
}
- private static boolean isTaskbarEnabled(DeviceProfile deviceProfile) {
+ public void setWallpaperVisible(boolean isVisible) {
+ mSharedState.wallpaperVisible = isVisible;
+ if (mTaskbarActivityContext != null) {
+ mTaskbarActivityContext.setWallpaperVisible(isVisible);
+ }
+ }
+
+ public void checkNavBarModes() {
+ if (mTaskbarActivityContext != null) {
+ mTaskbarActivityContext.checkNavBarModes();
+ }
+ }
+
+ public void finishBarAnimations() {
+ if (mTaskbarActivityContext != null) {
+ mTaskbarActivityContext.finishBarAnimations();
+ }
+ }
+
+ public void touchAutoDim(boolean reset) {
+ if (mTaskbarActivityContext != null) {
+ mTaskbarActivityContext.touchAutoDim(reset);
+ }
+ }
+
+ public void transitionTo(@BarTransitions.TransitionMode int barMode,
+ boolean animate) {
+ mTaskbarActivityContext.transitionTo(barMode, animate);
+ }
+
+ private boolean isTaskbarEnabled(DeviceProfile deviceProfile) {
return ENABLE_TASKBAR_NAVBAR_UNIFICATION || deviceProfile.isTaskbarPresent;
}
@@ -545,6 +579,13 @@
}
}
+ public void onTransitionModeUpdated(int barMode, boolean checkBarModes) {
+ mSharedState.barMode = barMode;
+ if (mTaskbarActivityContext != null) {
+ mTaskbarActivityContext.onTransitionModeUpdated(barMode, checkBarModes);
+ }
+ }
+
public void onNavButtonsDarkIntensityChanged(float darkIntensity) {
mSharedState.navButtonsDarkIntensity = darkIntensity;
if (mTaskbarActivityContext != null) {
@@ -581,8 +622,7 @@
public void destroy() {
debugWhyTaskbarNotDestroyed("TaskbarManager#destroy()");
removeActivityCallbacksAndListeners();
- UI_HELPER_EXECUTOR.execute(
- () -> mTaskbarBroadcastReceiver.unregisterReceiverSafely(mContext));
+ mTaskbarBroadcastReceiver.unregisterReceiverSafely(mContext);
destroyExistingTaskbar();
removeTaskbarRootViewFromWindow();
if (mUserUnlocked) {
@@ -594,7 +634,7 @@
.unregister(NAV_BAR_KIDS_MODE, mOnSettingsChangeListener);
Log.d(TASKBAR_NOT_DESTROYED_TAG, "unregistering component callbacks from destroy().");
mContext.unregisterComponentCallbacks(mComponentCallbacks);
- mContext.unregisterReceiver(mShutdownReceiver);
+ mShutdownReceiver.unregisterReceiverSafely(mContext);
}
public @Nullable TaskbarActivityContext getCurrentActivityContext() {
@@ -610,6 +650,21 @@
}
}
+ /**
+ * Removes Taskbar from the window manager and prevents recreation if {@code true}.
+ * <p>
+ * Suspending is for testing purposes only; avoid calling this method in production.
+ */
+ @VisibleForTesting
+ public void setSuspended(boolean isSuspended) {
+ mIsSuspended = isSuspended;
+ if (mIsSuspended) {
+ removeTaskbarRootViewFromWindow();
+ } else {
+ addTaskbarRootViewToWindow();
+ }
+ }
+
private void addTaskbarRootViewToWindow() {
if (enableTaskbarNoRecreate() && !mAddedWindow && mTaskbarActivityContext != null) {
mWindowManager.addView(mTaskbarRootLayout,
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
index 9f24d38..5024cd8 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
@@ -15,9 +15,6 @@
*/
package com.android.launcher3.taskbar;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-import static com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps;
-
import android.util.SparseArray;
import android.view.View;
@@ -29,7 +26,6 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
@@ -37,8 +33,7 @@
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.Preconditions;
-import com.android.quickstep.LauncherActivityInterface;
-import com.android.quickstep.RecentsModel;
+import com.android.quickstep.util.GroupTask;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -54,7 +49,7 @@
* Launcher model Callbacks for rendering taskbar.
*/
public class TaskbarModelCallbacks implements
- BgDataModel.Callbacks, LauncherBindableItemsContainer, RecentsModel.RunningTasksListener {
+ BgDataModel.Callbacks, LauncherBindableItemsContainer {
private final SparseArray<ItemInfo> mHotseatItems = new SparseArray<>();
private List<ItemInfo> mPredictedItems = Collections.emptyList();
@@ -68,8 +63,6 @@
// Used to defer any UI updates during the SUW unstash animation.
private boolean mDeferUpdatesForSUW;
private Runnable mDeferredUpdates;
- private DesktopVisibilityController.DesktopVisibilityListener mDesktopVisibilityListener =
- visible -> updateRunningApps();
public TaskbarModelCallbacks(
TaskbarActivityContext context, TaskbarView container) {
@@ -79,39 +72,6 @@
public void init(TaskbarControllers controllers) {
mControllers = controllers;
- if (mControllers.taskbarRecentAppsController.isEnabled()) {
- RecentsModel.INSTANCE.get(mContext).registerRunningTasksListener(this);
-
- if (shouldShowRunningAppsInDesktopMode()) {
- DesktopVisibilityController desktopVisibilityController =
- LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
- if (desktopVisibilityController != null) {
- desktopVisibilityController.registerDesktopVisibilityListener(
- mDesktopVisibilityListener);
- }
- }
- }
- }
-
- /**
- * Unregisters listeners in this class.
- */
- public void unregisterListeners() {
- RecentsModel.INSTANCE.get(mContext).unregisterRunningTasksListener();
-
- if (shouldShowRunningAppsInDesktopMode()) {
- DesktopVisibilityController desktopVisibilityController =
- LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
- if (desktopVisibilityController != null) {
- desktopVisibilityController.unregisterDesktopVisibilityListener(
- mDesktopVisibilityListener);
- }
- }
- }
-
- private boolean shouldShowRunningAppsInDesktopMode() {
- // TODO(b/335401172): unify DesktopMode checks in Launcher
- return enableDesktopWindowingMode() && enableDesktopWindowingTaskbarRunningApps();
}
@Override
@@ -171,7 +131,7 @@
final int itemCount = mContainer.getChildCount();
for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) {
View item = mContainer.getChildAt(itemIdx);
- if (op.evaluate((ItemInfo) item.getTag(), item)) {
+ if (item.getTag() instanceof ItemInfo itemInfo && op.evaluate(itemInfo, item)) {
return;
}
}
@@ -232,23 +192,30 @@
predictionNextIndex++;
}
}
- hotseatItemInfos = mControllers.taskbarRecentAppsController
- .updateHotseatItemInfos(hotseatItemInfos);
- Set<String> runningPackages = mControllers.taskbarRecentAppsController.getRunningApps();
+
+ final TaskbarRecentAppsController recentAppsController =
+ mControllers.taskbarRecentAppsController;
+ hotseatItemInfos = recentAppsController.updateHotseatItemInfos(hotseatItemInfos);
+ Set<Integer> runningTaskIds = recentAppsController.getRunningTaskIds();
+ Set<Integer> minimizedTaskIds = recentAppsController.getMinimizedTaskIds();
if (mDeferUpdatesForSUW) {
ItemInfo[] finalHotseatItemInfos = hotseatItemInfos;
mDeferredUpdates = () ->
- commitHotseatItemUpdates(finalHotseatItemInfos, runningPackages);
+ commitHotseatItemUpdates(finalHotseatItemInfos,
+ recentAppsController.getShownTasks(), runningTaskIds,
+ minimizedTaskIds);
} else {
- commitHotseatItemUpdates(hotseatItemInfos, runningPackages);
+ commitHotseatItemUpdates(hotseatItemInfos,
+ recentAppsController.getShownTasks(), runningTaskIds, minimizedTaskIds);
}
}
- private void commitHotseatItemUpdates(
- ItemInfo[] hotseatItemInfos, Set<String> runningPackages) {
- mContainer.updateHotseatItems(hotseatItemInfos);
- mControllers.taskbarViewController.updateIconViewsRunningStates(runningPackages);
+ private void commitHotseatItemUpdates(ItemInfo[] hotseatItemInfos, List<GroupTask> recentTasks,
+ Set<Integer> runningTaskIds, Set<Integer> minimizedTaskIds) {
+ mContainer.updateHotseatItems(hotseatItemInfos, recentTasks);
+ mControllers.taskbarViewController.updateIconViewsRunningStates(
+ runningTaskIds, minimizedTaskIds);
}
/**
@@ -267,21 +234,11 @@
}
}
- @Override
- public void onRunningTasksChanged() {
- updateRunningApps();
- }
-
/** Called when there's a change in running apps to update the UI. */
public void commitRunningAppsToUI() {
commitItemsToUI();
}
- /** Call TaskbarRecentAppsController to update running apps with mHotseatItems. */
- public void updateRunningApps() {
- mControllers.taskbarRecentAppsController.updateRunningApps();
- }
-
@Override
public void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMapCopy) {
mControllers.taskbarPopupController.setDeepShortcutMap(deepShortcutMapCopy);
@@ -293,7 +250,6 @@
Map<PackageUserKey, Integer> packageUserKeytoUidMap) {
Preconditions.assertUIThread();
mControllers.taskbarAllAppsController.setApps(apps, flags, packageUserKeytoUidMap);
- mControllers.taskbarRecentAppsController.setApps(apps);
}
protected void dumpLogs(String prefix, PrintWriter pw) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
index ade4649..872a4d0 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
@@ -24,6 +24,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
@@ -37,6 +38,7 @@
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.View;
+import android.view.inputmethod.Flags;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@@ -44,13 +46,12 @@
import com.android.launcher3.R;
import com.android.launcher3.logging.StatsLogManager;
-import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
-import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.util.AssistUtils;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
@@ -66,7 +67,7 @@
/** Allow some time in between the long press for back and recents. */
static final int SCREEN_PIN_LONG_PRESS_THRESHOLD = 200;
static final int SCREEN_PIN_LONG_PRESS_RESET = SCREEN_PIN_LONG_PRESS_THRESHOLD + 100;
- private static final String TAG = TaskbarNavButtonController.class.getSimpleName();
+ private static final String TAG = "TaskbarNavButtonController";
private long mLastScreenPinLongPress;
private boolean mScreenPinned;
@@ -148,7 +149,7 @@
break;
case BUTTON_IME_SWITCH:
logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP);
- showIMESwitcher();
+ onImeSwitcherPress();
break;
case BUTTON_A11Y:
logEvent(LAUNCHER_TASKBAR_A11Y_BUTTON_TAP);
@@ -167,8 +168,12 @@
if (buttonType == BUTTON_SPACE) {
return false;
}
- // Provide the same haptic feedback that the system offers for virtual keys.
- view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
+
+ // Provide the same haptic feedback that the system offers for long press.
+ // The haptic feedback from long pressing on the home button is handled by circle to search.
+ if (buttonType != BUTTON_HOME) {
+ view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ }
switch (buttonType) {
case BUTTON_HOME:
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS);
@@ -180,11 +185,19 @@
return true;
case BUTTON_BACK:
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_LONGPRESS);
- return backRecentsLongpress(buttonType);
+ backRecentsLongpress(buttonType);
+ return true;
case BUTTON_RECENTS:
logEvent(LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS);
- return backRecentsLongpress(buttonType);
+ backRecentsLongpress(buttonType);
+ return true;
case BUTTON_IME_SWITCH:
+ if (Flags.imeSwitcherRevamp()) {
+ logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS);
+ onImeSwitcherLongPress();
+ return true;
+ }
+ return false;
default:
return false;
}
@@ -258,7 +271,7 @@
mLastScreenPinLongPress = 0;
}
- public void updateSysuiFlags(int sysuiFlags) {
+ public void updateSysuiFlags(@SystemUiStateFlags long sysuiFlags) {
mScreenPinned = (sysuiFlags & SYSUI_STATE_SCREEN_PINNING) != 0;
}
@@ -284,13 +297,6 @@
private void navigateHome() {
TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
-
- DesktopVisibilityController desktopVisibilityController =
- LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
- if (desktopVisibilityController != null) {
- desktopVisibilityController.onHomeActionTriggered();
- }
-
mCallbacks.onNavigateHome();
}
@@ -307,10 +313,14 @@
mSystemUiProxy.onBackPressed();
}
- private void showIMESwitcher() {
+ private void onImeSwitcherPress() {
mSystemUiProxy.onImeSwitcherPressed();
}
+ private void onImeSwitcherLongPress() {
+ mSystemUiProxy.onImeSwitcherLongPress();
+ }
+
private void notifyA11yClick(boolean longClick) {
if (longClick) {
mSystemUiProxy.notifyAccessibilityButtonLongClicked();
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
index 2730be1..332eb95 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
@@ -53,6 +53,7 @@
import com.android.quickstep.util.LogUtils;
import java.io.PrintWriter;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -69,6 +70,9 @@
private static final SystemShortcut.Factory<BaseTaskbarContext>
APP_INFO = SystemShortcut.AppInfo::new;
+ private static final SystemShortcut.Factory<BaseTaskbarContext>
+ BUBBLE = SystemShortcut.BubbleShortcut::new;
+
private final TaskbarActivityContext mContext;
private final PopupDataProvider mPopupDataProvider;
@@ -148,8 +152,8 @@
icon.clearFocus();
return null;
}
- ItemInfo item = (ItemInfo) icon.getTag();
- if (!ShortcutUtil.supportsShortcuts(item)) {
+ // TODO(b/344657629) support GroupTask as well, for Taskbar Recent apps
+ if (!(icon.getTag() instanceof ItemInfo item) || !ShortcutUtil.supportsShortcuts(item)) {
return null;
}
@@ -181,11 +185,17 @@
// Create a Stream of all applicable system shortcuts
private Stream<SystemShortcut.Factory> getSystemShortcuts() {
- // append split options to APP_INFO shortcut, the order here will reflect in the popup
- return Stream.concat(
- Stream.of(APP_INFO),
- mControllers.uiController.getSplitMenuOptions()
- );
+ // append split options to APP_INFO shortcut if not in Desktop Windowing mode, the order
+ // here will reflect in the popup
+ ArrayList<SystemShortcut.Factory> shortcuts = new ArrayList<>();
+ shortcuts.add(APP_INFO);
+ if (!mControllers.taskbarRecentAppsController.isInDesktopMode()) {
+ shortcuts.addAll(mControllers.uiController.getSplitMenuOptions().toList());
+ }
+ if (com.android.wm.shell.Flags.enableBubbleAnything()) {
+ shortcuts.add(BUBBLE);
+ }
+ return shortcuts.stream();
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
deleted file mode 100644
index a29c74b..0000000
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.taskbar;
-
-import static java.util.Collections.emptySet;
-
-import androidx.annotation.CallSuper;
-import androidx.annotation.NonNull;
-
-import com.android.launcher3.model.data.AppInfo;
-import com.android.launcher3.model.data.ItemInfo;
-
-import java.util.Set;
-
-/**
- * Base class for providing recent apps functionality
- */
-public class TaskbarRecentAppsController {
-
- public static final TaskbarRecentAppsController DEFAULT = new TaskbarRecentAppsController();
-
- // Initialized in init.
- protected TaskbarControllers mControllers;
-
- @CallSuper
- protected void init(TaskbarControllers taskbarControllers) {
- mControllers = taskbarControllers;
- }
-
- @CallSuper
- protected void onDestroy() {
- mControllers = null;
- }
-
- /** Stores the current {@link AppInfo} instances, no-op except in desktop environment. */
- protected void setApps(AppInfo[] apps) {
- }
-
- /**
- * Indicates whether recent apps functionality is enabled, should return false except in
- * desktop environment.
- */
- protected boolean isEnabled() {
- return false;
- }
-
- /** Called to update hotseatItems, no-op except in desktop environment. */
- protected ItemInfo[] updateHotseatItemInfos(@NonNull ItemInfo[] hotseatItems) {
- return hotseatItems;
- }
-
- /** Called to update the list of currently running apps, no-op except in desktop environment. */
- protected void updateRunningApps() {}
-
- /** Returns the currently running apps, or an empty Set if outside of Desktop environment. */
- public Set<String> getRunningApps() {
- return emptySet();
- }
-}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt
new file mode 100644
index 0000000..737d031
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar
+
+import android.content.Context
+import androidx.annotation.VisibleForTesting
+import com.android.launcher3.Flags.enableRecentsInTaskbar
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.TaskItemInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.statehandlers.DesktopVisibilityController
+import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
+import com.android.launcher3.util.CancellableTask
+import com.android.quickstep.RecentsModel
+import com.android.quickstep.util.DesktopTask
+import com.android.quickstep.util.GroupTask
+import com.android.wm.shell.shared.desktopmode.DesktopModeFlags
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
+import java.io.PrintWriter
+
+/**
+ * Provides recent apps functionality, when the Taskbar Recent Apps section is enabled. Behavior:
+ * - When in Fullscreen mode: show the N most recent Tasks
+ * - When in Desktop Mode: show the currently running (open) Tasks
+ */
+class TaskbarRecentAppsController(
+ context: Context,
+ private val recentsModel: RecentsModel,
+ // Pass a provider here instead of the actual DesktopVisibilityController instance since that
+ // instance might not be available when this constructor is called.
+ private val desktopVisibilityControllerProvider: () -> DesktopVisibilityController?,
+) : LoggableTaskbarController {
+
+ var canShowRunningApps =
+ DesktopModeStatus.canEnterDesktopMode(context) &&
+ DesktopModeFlags.TASKBAR_RUNNING_APPS.isEnabled(context)
+ @VisibleForTesting
+ set(isEnabledFromTest) {
+ field = isEnabledFromTest
+ if (!field && !canShowRecentApps) {
+ recentsModel.unregisterRecentTasksChangedListener()
+ }
+ }
+
+ // TODO(b/343532825): Add a setting to disable Recents even when the flag is on.
+ var canShowRecentApps = enableRecentsInTaskbar()
+ @VisibleForTesting
+ set(isEnabledFromTest) {
+ field = isEnabledFromTest
+ if (!field && !canShowRunningApps) {
+ recentsModel.unregisterRecentTasksChangedListener()
+ }
+ }
+
+ // Initialized in init.
+ private lateinit var controllers: TaskbarControllers
+
+ var shownHotseatItems: List<ItemInfo> = emptyList()
+ private set
+
+ private var allRecentTasks: List<GroupTask> = emptyList()
+ private var desktopTask: DesktopTask? = null
+ // Keeps track of the order in which running tasks appear.
+ private var orderedRunningTaskIds = emptyList<Int>()
+ var shownTasks: List<GroupTask> = emptyList()
+ private set
+
+ private val desktopVisibilityController: DesktopVisibilityController?
+ get() = desktopVisibilityControllerProvider()
+
+ val isInDesktopMode: Boolean
+ get() = desktopVisibilityController?.areDesktopTasksVisible() ?: false
+
+ val runningTaskIds: Set<Int>
+ /**
+ * Returns the task IDs of apps that should be indicated as "running" to the user.
+ * Specifically, we return all the open tasks if we are in Desktop mode, else emptySet().
+ */
+ get() {
+ if (!canShowRunningApps || !isInDesktopMode) {
+ return emptySet()
+ }
+ val tasks = desktopTask?.tasks ?: return emptySet()
+ return tasks.map { task -> task.key.id }.toSet()
+ }
+
+ val minimizedTaskIds: Set<Int>
+ /**
+ * Returns the task IDs for the tasks that should be indicated as "minimized" to the user.
+ */
+ get() {
+ if (!canShowRunningApps || !isInDesktopMode) {
+ return emptySet()
+ }
+ val desktopTasks = desktopTask?.tasks ?: return emptySet()
+ return desktopTasks.filter { !it.isVisible }.map { task -> task.key.id }.toSet()
+ }
+
+ private val recentTasksChangedListener =
+ RecentsModel.RecentTasksChangedListener { reloadRecentTasksIfNeeded() }
+
+ private val iconLoadRequests: MutableSet<CancellableTask<*>> = HashSet()
+
+ // TODO(b/343291428): add TaskVisualsChangListener as well (for calendar/clock?)
+
+ // Used to keep track of the last requested task list ID, so that we do not request to load the
+ // tasks again if we have already requested it and the task list has not changed
+ private var taskListChangeId = -1
+
+ fun init(taskbarControllers: TaskbarControllers) {
+ controllers = taskbarControllers
+ if (canShowRunningApps || canShowRecentApps) {
+ recentsModel.registerRecentTasksChangedListener(recentTasksChangedListener)
+ reloadRecentTasksIfNeeded()
+ }
+ }
+
+ fun onDestroy() {
+ recentsModel.unregisterRecentTasksChangedListener()
+ iconLoadRequests.forEach { it.cancel() }
+ iconLoadRequests.clear()
+ }
+
+ /** Called to update hotseatItems, in order to de-dupe them from Recent/Running tasks later. */
+ fun updateHotseatItemInfos(hotseatItems: Array<ItemInfo?>): Array<ItemInfo?> {
+ // Ignore predicted apps - we show running or recent apps instead.
+ val removePredictions =
+ (isInDesktopMode && canShowRunningApps) || (!isInDesktopMode && canShowRecentApps)
+ if (!removePredictions) {
+ shownHotseatItems = hotseatItems.filterNotNull()
+ onRecentsOrHotseatChanged()
+ return hotseatItems
+ }
+ shownHotseatItems =
+ hotseatItems
+ .filterNotNull()
+ .filter { itemInfo -> !itemInfo.isPredictedItem }
+ .toMutableList()
+
+ if (isInDesktopMode && canShowRunningApps) {
+ shownHotseatItems =
+ updateHotseatItemsFromRunningTasks(
+ getOrderedAndWrappedDesktopTasks(),
+ shownHotseatItems
+ )
+ }
+
+ onRecentsOrHotseatChanged()
+
+ return shownHotseatItems.toTypedArray()
+ }
+
+ private fun getOrderedAndWrappedDesktopTasks(): List<GroupTask> {
+ val tasks = desktopTask?.tasks ?: emptyList()
+ // Kind of hacky, we wrap each single task in the Desktop as a GroupTask.
+ val orderFromId = orderedRunningTaskIds.withIndex().associate { (index, id) -> id to index }
+ val sortedTasks = tasks.sortedWith(compareBy(nullsLast()) { orderFromId[it.key.id] })
+ return sortedTasks.map { GroupTask(it) }
+ }
+
+ private fun reloadRecentTasksIfNeeded() {
+ if (!recentsModel.isTaskListValid(taskListChangeId)) {
+ taskListChangeId =
+ recentsModel.getTasks { tasks ->
+ allRecentTasks = tasks
+ val oldRunningTaskdIds = runningTaskIds
+ val oldMinimizedTaskIds = minimizedTaskIds
+ desktopTask = allRecentTasks.filterIsInstance<DesktopTask>().firstOrNull()
+ val runningTasksChanged = oldRunningTaskdIds != runningTaskIds
+ val minimizedTasksChanged = oldMinimizedTaskIds != minimizedTaskIds
+ if (
+ onRecentsOrHotseatChanged() || runningTasksChanged || minimizedTasksChanged
+ ) {
+ controllers.taskbarViewController.commitRunningAppsToUI()
+ }
+ }
+ }
+ }
+
+ /**
+ * Updates [shownTasks] when Recents or Hotseat changes.
+ *
+ * @return Whether [shownTasks] changed.
+ */
+ private fun onRecentsOrHotseatChanged(): Boolean {
+ val oldShownTasks = shownTasks
+ orderedRunningTaskIds = updateOrderedRunningTaskIds()
+ shownTasks =
+ if (isInDesktopMode) {
+ computeShownRunningTasks()
+ } else {
+ computeShownRecentTasks()
+ }
+ val shownTasksChanged = oldShownTasks != shownTasks
+ if (!shownTasksChanged) {
+ return shownTasksChanged
+ }
+
+ for (groupTask in shownTasks) {
+ for (task in groupTask.tasks) {
+ val cancellableTask =
+ recentsModel.iconCache.getIconInBackground(task) {
+ icon,
+ contentDescription,
+ title ->
+ task.icon = icon
+ task.titleDescription = contentDescription
+ task.title = title
+ controllers.taskbarViewController.onTaskUpdated(task)
+ }
+ if (cancellableTask != null) {
+ iconLoadRequests.add(cancellableTask)
+ }
+ }
+ }
+ return shownTasksChanged
+ }
+
+ private fun updateOrderedRunningTaskIds(): MutableList<Int> {
+ val desktopTaskAsList = getOrderedAndWrappedDesktopTasks()
+ val desktopTaskIds = desktopTaskAsList.map { it.task1.key.id }
+ var newOrder =
+ orderedRunningTaskIds
+ .filter { it in desktopTaskIds } // Only keep the tasks that are still running
+ .toMutableList()
+ // Add new tasks not already listed
+ newOrder.addAll(desktopTaskIds.filter { it !in newOrder })
+ return newOrder
+ }
+
+ private fun computeShownRunningTasks(): List<GroupTask> {
+ if (!canShowRunningApps) {
+ return emptyList()
+ }
+ val desktopTaskAsList = getOrderedAndWrappedDesktopTasks()
+ val desktopTaskIds = desktopTaskAsList.map { it.task1.key.id }
+ val shownTaskIds = shownTasks.map { it.task1.key.id }
+ // TODO(b/315344726 Multi-instance support): only show one icon per package once we support
+ // taskbar multi-instance menus
+ val shownHotseatItemTaskIds =
+ shownHotseatItems.mapNotNull { it as? TaskItemInfo }.map { it.taskId }
+ // Remove any newly-missing Tasks, and actual group-tasks
+ val newShownTasks =
+ shownTasks
+ .filter { !it.hasMultipleTasks() }
+ .filter { it.task1.key.id in desktopTaskIds }
+ .toMutableList()
+ // Add any new Tasks, maintaining the order from previous shownTasks.
+ newShownTasks.addAll(desktopTaskAsList.filter { it.task1.key.id !in shownTaskIds })
+ // Remove any tasks already covered by Hotseat icons
+ return newShownTasks.filter { it.task1.key.id !in shownHotseatItemTaskIds }
+ }
+
+ private fun computeShownRecentTasks(): List<GroupTask> {
+ if (!canShowRecentApps || allRecentTasks.isEmpty()) {
+ return emptyList()
+ }
+ // Remove the current task.
+ val allRecentTasks = allRecentTasks.subList(0, allRecentTasks.size - 1)
+ // TODO(b/315344726 Multi-instance support): dedupe Tasks of the same package too
+ var shownTasks = dedupeHotseatTasks(allRecentTasks, shownHotseatItems)
+ if (shownTasks.size > MAX_RECENT_TASKS) {
+ // Remove any tasks older than MAX_RECENT_TASKS.
+ shownTasks = shownTasks.subList(shownTasks.size - MAX_RECENT_TASKS, shownTasks.size)
+ }
+ return shownTasks
+ }
+
+ private fun dedupeHotseatTasks(
+ groupTasks: List<GroupTask>,
+ shownHotseatItems: List<ItemInfo>
+ ): List<GroupTask> {
+ val hotseatPackages = shownHotseatItems.map { item -> item.targetPackage }
+ return groupTasks.filter { groupTask ->
+ groupTask.hasMultipleTasks() ||
+ !hotseatPackages.contains(groupTask.task1.key.packageName)
+ }
+ }
+
+ /**
+ * Returns the hotseat items updated so that any item that points to a package with a running
+ * task also references that task.
+ */
+ private fun updateHotseatItemsFromRunningTasks(
+ groupTasks: List<GroupTask>,
+ shownHotseatItems: List<ItemInfo>
+ ): List<ItemInfo> =
+ shownHotseatItems.map { itemInfo ->
+ if (itemInfo is TaskItemInfo) {
+ itemInfo
+ } else {
+ val foundTask =
+ groupTasks.find { task -> task.task1.key.packageName == itemInfo.targetPackage }
+ ?: return@map itemInfo
+ TaskItemInfo(foundTask.task1.key.id, itemInfo as WorkspaceItemInfo)
+ }
+ }
+
+ override fun dumpLogs(prefix: String, pw: PrintWriter) {
+ pw.println("$prefix TaskbarRecentAppsController:")
+ pw.println("$prefix\tcanShowRunningApps=$canShowRunningApps")
+ pw.println("$prefix\tcanShowRecentApps=$canShowRecentApps")
+ pw.println("$prefix\tshownHotseatItems=${shownHotseatItems.map{item->item.targetPackage}}")
+ pw.println("$prefix\tallRecentTasks=${allRecentTasks.map { it.packageNames }}")
+ pw.println("$prefix\tdesktopTask=${desktopTask?.packageNames}")
+ pw.println("$prefix\tshownTasks=${shownTasks.map { it.packageNames }}")
+ pw.println("$prefix\trunningTaskIds=$runningTaskIds")
+ pw.println("$prefix\tminimizedTaskIds=$minimizedTaskIds")
+ }
+
+ private val GroupTask.packageNames: List<String>
+ get() = tasks.map { task -> task.key.packageName }
+
+ private companion object {
+ const val MAX_RECENT_TASKS = 2
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
index 712374d..4df0223 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
@@ -20,16 +20,18 @@
import static com.android.launcher3.taskbar.bubbles.BubbleBarController.isBubbleBarEnabled;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED;
-import static com.android.wm.shell.common.bubbles.BubbleConstants.BUBBLE_EXPANDED_SCRIM_ALPHA;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
+import static com.android.wm.shell.common.bubbles.BubbleConstants.BUBBLE_EXPANDED_SCRIM_ALPHA;
import android.animation.ObjectAnimator;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
import com.android.launcher3.anim.AnimatedFloat;
+import com.android.launcher3.taskbar.bubbles.BubbleControllers;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.SystemUiProxy;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
@@ -45,7 +47,8 @@
private final TaskbarActivityContext mActivity;
private final TaskbarScrimView mScrimView;
private boolean mTaskbarVisible;
- private int mSysUiStateFlags;
+ @SystemUiStateFlags
+ private long mSysUiStateFlags;
// Alpha property for the scrim.
private final AnimatedFloat mScrimAlpha = new AnimatedFloat(this::updateScrimAlpha);
@@ -63,6 +66,7 @@
*/
public void init(TaskbarControllers controllers) {
mControllers = controllers;
+ onTaskbarVisibilityChanged(mControllers.taskbarViewController.getTaskbarVisibility());
}
/**
@@ -82,7 +86,11 @@
/**
* Updates the scrim state based on the flags.
*/
- public void updateStateForSysuiFlags(int stateFlags, boolean skipAnim) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long stateFlags, boolean skipAnim) {
+ if (mActivity.isPhoneMode()) {
+ // There is no scrim for the bar in the phone mode.
+ return;
+ }
if (isBubbleBarEnabled() && DisplayController.isTransientTaskbar(mActivity)) {
// These scrims aren't used if bubble bar & transient taskbar are active.
return;
@@ -94,21 +102,37 @@
private boolean shouldShowScrim() {
final boolean bubblesExpanded = (mSysUiStateFlags & SYSUI_STATE_BUBBLES_EXPANDED) != 0;
boolean isShadeVisible = (mSysUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE) != 0;
+ BubbleControllers bubbleControllers = mActivity.getBubbleControllers();
+ boolean isBubbleControllersPresented = bubbleControllers != null;
+ // when the taskbar is in persistent mode, we hide the task bar icons on bubble bar expand,
+ // which makes the taskbar invisible, so need to check if the bubble bar is not on home
+ // to show the scrim view
+ boolean showScrimForBubbles = bubblesExpanded
+ && !mTaskbarVisible
+ && isBubbleControllersPresented
+ && !DisplayController.isTransientTaskbar(mActivity)
+ && !bubbleControllers.bubbleStashController.isBubblesShowingOnHome();
return bubblesExpanded && !mControllers.navbarButtonsViewController.isImeVisible()
&& !isShadeVisible
&& !mControllers.taskbarStashController.isStashed()
- && mTaskbarVisible;
+ && (mTaskbarVisible || showScrimForBubbles);
}
private float getScrimAlpha() {
+ final boolean isPersistentTaskBarVisible =
+ mTaskbarVisible && !DisplayController.isTransientTaskbar(mScrimView.getContext());
final boolean manageMenuExpanded =
(mSysUiStateFlags & SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED) != 0;
- return manageMenuExpanded
- // When manage menu shows there's the first scrim and second scrim so figure out
- // what the total transparency would be.
- ? (BUBBLE_EXPANDED_SCRIM_ALPHA + (BUBBLE_EXPANDED_SCRIM_ALPHA
- * (1 - BUBBLE_EXPANDED_SCRIM_ALPHA)))
- : shouldShowScrim() ? BUBBLE_EXPANDED_SCRIM_ALPHA : 0;
+ if (isPersistentTaskBarVisible && manageMenuExpanded) {
+ // When manage menu shows for persistent task bar there's the first scrim and second
+ // scrim so figure out what the total transparency would be.
+ return BUBBLE_EXPANDED_SCRIM_ALPHA
+ + (BUBBLE_EXPANDED_SCRIM_ALPHA * (1 - BUBBLE_EXPANDED_SCRIM_ALPHA));
+ } else if (shouldShowScrim()) {
+ return BUBBLE_EXPANDED_SCRIM_ALPHA;
+ } else {
+ return 0;
+ }
}
private void showScrim(boolean showScrim, float alpha, boolean skipAnim) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
index e2c71bf..729cbe9 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java
@@ -29,6 +29,8 @@
import android.os.IBinder;
import android.view.InsetsFrameProvider;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
+
/**
* State shared across different taskbar instance
*/
@@ -39,7 +41,8 @@
private static int INDEX_RIGHT = 1;
// TaskbarManager#onSystemUiFlagsChanged
- public int sysuiStateFlags;
+ @SystemUiStateFlags
+ public long sysuiStateFlags;
// TaskbarManager#disableNavBarElements()
public int disableNavBarDisplayId;
@@ -53,12 +56,17 @@
// TaskbarManager#onNavButtonsDarkIntensityChanged()
public float navButtonsDarkIntensity;
+ // TaskbarManager#onTransitionModeUpdated()
+ public int barMode;
+
// TaskbarManager#onNavigationBarLumaSamplingEnabled()
public int mLumaSamplingDisplayId = DEFAULT_DISPLAY;
public boolean mIsLumaSamplingEnabled = true;
public boolean setupUIVisible = false;
+ public boolean wallpaperVisible = false;
+
public boolean allAppsVisible = false;
// LauncherTaskbarUIController#mTaskbarInAppDisplayProgressMultiProp
@@ -94,5 +102,8 @@
// To track if taskbar was stashed / unstashed between configuration changes (which recreates
// the task bar).
- public Boolean taskbarWasStashedAuto = true;
+ public boolean taskbarWasStashedAuto = true;
+
+ // should show corner radius on persistent taskbar when in desktop mode.
+ public boolean showCornerRadiusInDesktopMode = false;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 182ff7e..56f88d1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -22,25 +22,27 @@
import static com.android.app.animation.Interpolators.INSTANT;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.internal.jank.InteractionJankMonitor.Configuration;
+import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
-import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange;
import static com.android.quickstep.util.SystemActionConstants.SYSTEM_ACTION_ID_TASKBAR;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DIALOG_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
+import android.animation.ValueAnimator;
import android.app.RemoteAction;
+import android.graphics.Rect;
import android.graphics.drawable.Icon;
import android.os.SystemClock;
import android.util.Log;
@@ -66,19 +68,20 @@
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.util.SystemUiFlagUtils;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.StringJoiner;
-import java.util.function.IntPredicate;
+import java.util.function.LongPredicate;
/**
* Coordinates between controllers such as TaskbarViewController and StashedHandleViewController to
* create a cohesive animation between stashed/unstashed states.
*/
public class TaskbarStashController implements TaskbarControllers.LoggableTaskbarController {
- private static final String TAG = TaskbarStashController.class.getSimpleName();
+ private static final String TAG = "TaskbarStashController";
private static final boolean DEBUG = false;
public static final int FLAG_IN_APP = 1 << 0;
@@ -100,7 +103,10 @@
// If we're in an app and any of these flags are enabled, taskbar should be stashed.
private static final int FLAGS_STASHED_IN_APP = FLAG_STASHED_IN_APP_SYSUI
| FLAG_STASHED_IN_APP_SETUP | FLAG_STASHED_IN_TASKBAR_ALL_APPS
- | FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IN_APP_AUTO;
+ | FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IN_APP_AUTO | FLAG_STASHED_IME;
+
+ // If we're in overview and any of these flags are enabled, taskbar should be stashed.
+ private static final int FLAGS_STASHED_IN_OVERVIEW = FLAG_STASHED_IME;
// If any of these flags are enabled, inset apps by our stashed height instead of our unstashed
// height. This way the reported insets are consistent even during transitions out of the app.
@@ -111,7 +117,7 @@
// If any of these flags are enabled, the taskbar must be stashed.
private static final int FLAGS_FORCE_STASHED = FLAG_STASHED_SYSUI | FLAG_STASHED_DEVICE_LOCKED
- | FLAG_STASHED_IN_TASKBAR_ALL_APPS | FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IME;
+ | FLAG_STASHED_IN_TASKBAR_ALL_APPS | FLAG_STASHED_SMALL_SCREEN;
/**
* How long to stash/unstash when manually invoked via long press.
@@ -196,6 +202,7 @@
* by not scaling the height of the taskbar background.
*/
private static final int TRANSITION_UNSTASH_SUW_MANUAL = 3;
+ private static final Rect EMPTY_RECT = new Rect();
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
@@ -229,7 +236,7 @@
/** Whether we are currently visually stashed (might change based on launcher state). */
private boolean mIsStashed = false;
- private int mState;
+ private long mState;
private @Nullable AnimatorSet mAnimator;
private boolean mIsSystemGestureInProgress;
@@ -239,13 +246,22 @@
private final Alarm mTimeoutAlarm = new Alarm();
private boolean mEnableBlockingTimeoutDuringTests = false;
+ private Animator mTaskbarBackgroundAlphaAnimator;
+ private long mTaskbarBackgroundDuration;
+ private boolean mUserIsNotGoingHome = false;
+
// Evaluate whether the handle should be stashed
- private final IntPredicate mIsStashedPredicate = flags -> {
+ private final LongPredicate mIsStashedPredicate = flags -> {
boolean inApp = hasAnyFlag(flags, FLAGS_IN_APP);
boolean stashedInApp = hasAnyFlag(flags, FLAGS_STASHED_IN_APP);
boolean stashedLauncherState = hasAnyFlag(flags, FLAG_IN_STASHED_LAUNCHER_STATE);
+ boolean inOverview = hasAnyFlag(flags, FLAG_IN_OVERVIEW);
+ boolean stashedInOverview = hasAnyFlag(flags, FLAGS_STASHED_IN_OVERVIEW);
boolean forceStashed = hasAnyFlag(flags, FLAGS_FORCE_STASHED);
- return (inApp && stashedInApp) || (!inApp && stashedLauncherState) || forceStashed;
+ return (inApp && stashedInApp)
+ || (!inApp && stashedLauncherState)
+ || (inOverview && stashedInOverview)
+ || forceStashed;
};
private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder(
mIsStashedPredicate);
@@ -258,6 +274,8 @@
mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity);
mAccessibilityManager = mActivity.getSystemService(AccessibilityManager.class);
+ mTaskbarBackgroundDuration =
+ activity.getResources().getInteger(R.integer.taskbar_background_duration);
if (mActivity.isPhoneMode()) {
mUnstashedHeight = mActivity.getResources().getDimensionPixelSize(
R.dimen.taskbar_phone_size);
@@ -270,18 +288,6 @@
}
/**
- * Show Taskbar upon receiving broadcast
- */
- public void showTaskbarFromBroadcast() {
- // If user is in middle of taskbar education handle go to next step of education
- if (mControllers.taskbarEduTooltipController.isBeforeTooltipFeaturesStep()) {
- mControllers.taskbarEduTooltipController.hide();
- mControllers.taskbarEduTooltipController.maybeShowFeaturesEdu();
- }
- updateAndAnimateTransientTaskbar(false);
- }
-
- /**
* Initializes the controller
*/
public void init(
@@ -323,7 +329,17 @@
// For now, assume we're in an app, since LauncherTaskbarUIController won't be able to tell
// us that we're paused until a bit later. This avoids flickering upon recreating taskbar.
updateStateForFlag(FLAG_IN_APP, true);
+
applyState(/* duration = */ 0);
+
+ // Hide the background while stashed so it doesn't show on fast swipes home
+ boolean shouldHideTaskbarBackground = mActivity.isPhoneMode() ||
+ (enableScalingRevealHomeAnimation()
+ && DisplayController.isTransientTaskbar(mActivity)
+ && isStashed());
+
+ mTaskbarBackgroundAlphaForStash.setValue(shouldHideTaskbarBackground ? 0 : 1);
+
if (mTaskbarSharedState.getTaskbarWasPinned()
|| !mTaskbarSharedState.taskbarWasStashedAuto) {
tryStartTaskbarTimeout();
@@ -355,7 +371,6 @@
boolean hideTaskbar = isVisible || !mActivity.isUserSetupComplete();
updateStateForFlag(FLAG_IN_SETUP, hideTaskbar);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, hideTaskbar);
- updateStateForFlag(FLAG_STASHED_SMALL_SCREEN, mActivity.isPhoneGestureNavMode());
applyState(hideTaskbar ? 0 : getStashDuration());
}
@@ -389,11 +404,11 @@
return (hasAnyFlag(FLAG_IN_STASHED_LAUNCHER_STATE) && supportsVisualStashing());
}
- private boolean hasAnyFlag(int flagMask) {
+ private boolean hasAnyFlag(long flagMask) {
return hasAnyFlag(mState, flagMask);
}
- private boolean hasAnyFlag(int flags, int flagMask) {
+ private boolean hasAnyFlag(long flags, long flagMask) {
return (flags & flagMask) != 0;
}
@@ -409,6 +424,11 @@
return hasAnyFlag(FLAGS_IN_APP);
}
+ /** Returns whether the taskbar is currently in overview screen. */
+ public boolean isInOverview() {
+ return hasAnyFlag(FLAG_IN_OVERVIEW);
+ }
+
/**
* Returns the height that taskbar will be touchable.
*/
@@ -425,14 +445,15 @@
* @see android.view.WindowInsets.Type#systemBars()
*/
public int getContentHeightToReportToApps() {
- if ((mActivity.isPhoneMode() && !mActivity.isThreeButtonNav())
- || DisplayController.isTransientTaskbar(mActivity)) {
+ if (mActivity.isUserSetupComplete() && (mActivity.isPhoneGestureNavMode()
+ || DisplayController.isTransientTaskbar(mActivity))) {
return getStashedHeight();
}
if (supportsVisualStashing() && hasAnyFlag(FLAGS_REPORT_STASHED_INSETS_TO_APP)) {
DeviceProfile dp = mActivity.getDeviceProfile();
- if (hasAnyFlag(FLAG_STASHED_IN_APP_SETUP) && dp.isTaskbarPresent) {
+ if (hasAnyFlag(FLAG_STASHED_IN_APP_SETUP) && (dp.isTaskbarPresent
+ || mActivity.isPhoneGestureNavMode())) {
// We always show the back button in SUW but in portrait the SUW layout may not
// be wide enough to support overlapping the nav bar with its content.
// We're sending different res values in portrait vs landscape
@@ -547,11 +568,12 @@
* sub-animations are properly coordinated. This duration should not
* actually be used since this animation tracks a swipe progress.
*/
- protected void addUnstashToHotseatAnimation(AnimatorSet animation, int placeholderDuration) {
+ protected void addUnstashToHotseatAnimationFromSuw(AnimatorSet animation,
+ int placeholderDuration) {
// Defer any UI updates now to avoid the UI becoming stale when the animation plays.
mControllers.taskbarViewController.setDeferUpdatesForSUW(true);
createAnimToIsStashed(
- /* isStashed= */ false,
+ /* isStashed= */ mActivity.isPhoneMode(),
placeholderDuration,
TRANSITION_UNSTASH_SUW_MANUAL,
/* jankTag= */ "SUW_MANUAL");
@@ -697,7 +719,7 @@
}
fullLengthAnimatorSet.play(mControllers.stashedHandleViewController
- .createRevealAnimToIsStashed(isStashed));
+ .createRevealAnimToIsStashed(isStashed, EMPTY_RECT));
// Return the stashed handle to its default scale in case it was changed as part of the
// feedforward hint. Note that the reveal animation above also visually scales it.
fullLengthAnimatorSet.play(mTaskbarStashedHandleHintScale.animateToValue(1f));
@@ -747,13 +769,33 @@
}
}
+
+ Rect taskbarToHotseatOffsets = new Rect();
+ if (enableScalingRevealHomeAnimation() && animationType == TRANSITION_HOME_TO_APP) {
+ Rect hotseatRect = new Rect();
+ mActivity.getHotseatBounds(hotseatRect);
+
+ // Calculate and store offsets so that we can sync with the taskbar stashed handle
+ taskbarToHotseatOffsets.set(
+ mActivity.calculateTaskbarToHotseatOffsets(hotseatRect));
+ as.addListener(AnimatorListeners.forEndCallback(
+ () -> mActivity.calculateTaskbarToHotseatOffsets(EMPTY_RECT)));
+ }
+
play(as, mTaskbarStashedHandleAlpha.animateToValue(stashedHandleAlphaTarget),
backgroundAndHandleAlphaStartDelay,
backgroundAndHandleAlphaDuration, LINEAR);
- play(as, mTaskbarBackgroundAlphaForStash.animateToValue(backgroundAlphaTarget),
- backgroundAndHandleAlphaStartDelay,
- backgroundAndHandleAlphaDuration, LINEAR);
+ if (enableScalingRevealHomeAnimation() && !isStashed) {
+ play(as, getTaskbarBackgroundAnimatorWhenNotGoingHome(duration),
+ 0, 0, LINEAR);
+ as.addListener(AnimatorListeners.forEndCallback(
+ () -> mTaskbarBackgroundAlphaForStash.setValue(backgroundAlphaTarget)));
+ } else {
+ play(as, mTaskbarBackgroundAlphaForStash.animateToValue(backgroundAlphaTarget),
+ backgroundAndHandleAlphaStartDelay,
+ backgroundAndHandleAlphaDuration, LINEAR);
+ }
// The rest of the animations might be "skipped" in TRANSITION_HANDLE_FADE transitions.
AnimatorSet skippable = as;
@@ -785,10 +827,12 @@
}
mControllers.taskbarViewController.addRevealAnimToIsStashed(skippable, isStashed, duration,
- EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL);
+ EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL,
+ animationType == TRANSITION_HOME_TO_APP);
play(skippable, mControllers.stashedHandleViewController
- .createRevealAnimToIsStashed(isStashed), 0, duration, EMPHASIZED);
+ .createRevealAnimToIsStashed(isStashed, taskbarToHotseatOffsets), 0, duration,
+ EMPHASIZED);
// Return the stashed handle to its default scale in case it was changed as part of the
// feedforward hint. Note that the reveal animation above also visually scales it.
@@ -796,6 +840,58 @@
.setDuration(isStashed ? duration / 2 : duration));
}
+ private Animator getTaskbarBackgroundAnimatorWhenNotGoingHome(long duration) {
+ ValueAnimator a = ValueAnimator.ofFloat(0, 1);
+ a.setDuration(duration);
+ a.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ // This value is arbitrary.
+ private static final float ANIMATED_FRACTION_THRESHOLD = 0.25f;
+ private boolean mTaskbarBgAlphaAnimationStarted = false;
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ if (mTaskbarBgAlphaAnimationStarted) {
+ return;
+ }
+
+ if (valueAnimator.getAnimatedFraction() >= ANIMATED_FRACTION_THRESHOLD) {
+ if (mUserIsNotGoingHome) {
+ playTaskbarBackgroundAlphaAnimation();
+ mTaskbarBgAlphaAnimationStarted = true;
+ }
+ }
+ }
+ });
+ return a;
+ }
+
+ /**
+ * Sets whether the user is going home based on the current gesture.
+ */
+ public void setUserIsNotGoingHome(boolean userIsNotGoingHome) {
+ mUserIsNotGoingHome = userIsNotGoingHome;
+ }
+
+ /**
+ * Plays the taskbar background alpha animation if one is not currently playing.
+ */
+ public void playTaskbarBackgroundAlphaAnimation() {
+ if (mTaskbarBackgroundAlphaAnimator != null
+ && mTaskbarBackgroundAlphaAnimator.isRunning()) {
+ return;
+ }
+ mTaskbarBackgroundAlphaAnimator = mTaskbarBackgroundAlphaForStash
+ .animateToValue(1f)
+ .setDuration(mTaskbarBackgroundDuration);
+ mTaskbarBackgroundAlphaAnimator.setInterpolator(LINEAR);
+ mTaskbarBackgroundAlphaAnimator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mTaskbarBackgroundAlphaAnimator = null;
+ }
+ });
+ mTaskbarBackgroundAlphaAnimator.start();
+ }
+
private static void play(AnimatorSet as, @Nullable Animator a, long startDelay, long duration,
Interpolator interpolator) {
if (a == null) {
@@ -929,21 +1025,24 @@
}
/** Called when some system ui state has changed. (See SYSUI_STATE_... in QuickstepContract) */
- public void updateStateForSysuiFlags(int systemUiStateFlags, boolean skipAnim) {
+ public void updateStateForSysuiFlags(long systemUiStateFlags, boolean skipAnim) {
+ if (mActivity.isPhoneMode()) {
+ return;
+ }
+
long animDuration = TASKBAR_STASH_DURATION;
long startDelay = 0;
updateStateForFlag(FLAG_STASHED_IN_APP_SYSUI, hasAnyFlag(systemUiStateFlags,
- SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE));
+ SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE | SYSUI_STATE_DIALOG_SHOWING));
boolean stashForBubbles = hasAnyFlag(FLAG_IN_OVERVIEW)
&& hasAnyFlag(systemUiStateFlags, SYSUI_STATE_BUBBLES_EXPANDED)
&& DisplayController.isTransientTaskbar(mActivity);
updateStateForFlag(FLAG_STASHED_SYSUI,
hasAnyFlag(systemUiStateFlags, SYSUI_STATE_SCREEN_PINNING) || stashForBubbles);
- boolean isLocked = hasAnyFlag(systemUiStateFlags, MASK_ANY_SYSUI_LOCKED)
- && !hasAnyFlag(systemUiStateFlags, SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY);
- updateStateForFlag(FLAG_STASHED_DEVICE_LOCKED, isLocked);
+ updateStateForFlag(FLAG_STASHED_DEVICE_LOCKED,
+ SystemUiFlagUtils.isLocked(systemUiStateFlags));
mIsImeShowing = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_SHOWING);
mIsImeSwitcherShowing = hasAnyFlag(systemUiStateFlags, SYSUI_STATE_IME_SWITCHER_SHOWING);
@@ -1005,8 +1104,8 @@
* unstashed.
* @return Whether the flag state changed.
*/
- public boolean updateStateForFlag(int flag, boolean enabled) {
- int oldState = mState;
+ public boolean updateStateForFlag(long flag, boolean enabled) {
+ long oldState = mState;
if (enabled) {
mState |= flag;
} else {
@@ -1020,7 +1119,7 @@
*
* @param changedFlags The flags that have changed.
*/
- private void onStateChangeApplied(int changedFlags) {
+ private void onStateChangeApplied(long changedFlags) {
if (hasAnyFlag(changedFlags, FLAGS_STASHED_IN_APP)) {
mControllers.uiController.onStashedInAppChanged();
}
@@ -1052,7 +1151,8 @@
*/
public void setUpTaskbarSystemAction(boolean visible) {
UI_HELPER_EXECUTOR.execute(() -> {
- if (!visible || !DisplayController.isTransientTaskbar(mActivity)) {
+ if (!visible || !DisplayController.isTransientTaskbar(mActivity)
+ || mActivity.isPhoneMode()) {
mAccessibilityManager.unregisterSystemAction(SYSTEM_ACTION_ID_TASKBAR);
mIsTaskbarSystemActionRegistered = false;
return;
@@ -1151,7 +1251,7 @@
pw.println(prefix + "\tmIsImeSwitcherShowing=" + mIsImeSwitcherShowing);
}
- private static String getStateString(int flags) {
+ private static String getStateString(long flags) {
StringJoiner sj = new StringJoiner("|");
appendFlag(sj, flags, FLAGS_IN_APP, "FLAG_IN_APP");
appendFlag(sj, flags, FLAG_STASHED_IN_APP_SYSUI, "FLAG_STASHED_IN_APP_SYSUI");
@@ -1168,15 +1268,15 @@
}
private class StatePropertyHolder {
- private final IntPredicate mStashCondition;
+ private final LongPredicate mStashCondition;
private boolean mIsStashed;
private @StashAnimation int mLastStartedTransitionType = TRANSITION_DEFAULT;
- private int mPrevFlags;
+ private long mPrevFlags;
private long mLastUnlockTransitionTimeout = 0;
- StatePropertyHolder(IntPredicate stashCondition) {
+ StatePropertyHolder(LongPredicate stashCondition) {
mStashCondition = stashCondition;
}
@@ -1189,7 +1289,7 @@
* @return mAnimator if mIsStashed changed, or {@code null} otherwise.
*/
@Nullable
- public Animator createSetStateAnimator(int flags, long duration) {
+ public Animator createSetStateAnimator(long flags, long duration) {
boolean isStashed = mStashCondition.test(flags);
if (DEBUG) {
@@ -1201,7 +1301,7 @@
+ ", mIsStashed: " + mIsStashed);
}
- int changedFlags = mPrevFlags ^ flags;
+ long changedFlags = mPrevFlags ^ flags;
if (mPrevFlags != flags) {
onStateChangeApplied(changedFlags);
mPrevFlags = flags;
@@ -1248,7 +1348,7 @@
}
/** Calculates the tag for CUJ_TASKBAR_EXPAND and CUJ_TASKBAR_COLLAPSE jank traces. */
- private String computeTaskbarJankMonitorTag(int changedFlags) {
+ private String computeTaskbarJankMonitorTag(long changedFlags) {
if (hasAnyFlag(changedFlags, FLAG_IN_APP)) {
// moving in or out of the app
if (hasAnyFlag(FLAG_IN_APP)) {
@@ -1268,7 +1368,7 @@
return "";
}
- private @StashAnimation int computeTransitionType(int changedFlags) {
+ private @StashAnimation int computeTransitionType(long changedFlags) {
boolean hotseatHiddenDuringAppLaunch =
!mControllers.uiController.isHotseatIconOnTopWhenAligned()
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTransitions.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTransitions.java
new file mode 100644
index 0000000..615db01
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTransitions.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar;
+
+import android.view.View;
+
+import com.android.launcher3.R;
+import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;
+import com.android.systemui.shared.statusbar.phone.BarTransitions;
+
+import java.io.PrintWriter;
+
+/** Manages task bar transitions */
+public class TaskbarTransitions extends BarTransitions implements
+ TaskbarControllers.LoggableTaskbarController {
+
+ private final TaskbarActivityContext mContext;
+
+ private boolean mWallpaperVisible;
+
+ private boolean mLightsOut;
+ private boolean mAutoDim;
+ private View mNavButtons;
+ private float mDarkIntensity;
+
+ private final NearestTouchFrame mView;
+
+ public TaskbarTransitions(TaskbarActivityContext context, NearestTouchFrame view) {
+ super(view, R.drawable.nav_background);
+
+ mContext = context;
+ mView = view;
+ }
+
+ void init() {
+ mView.addOnLayoutChangeListener(
+ (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
+ mNavButtons = mView.findViewById(R.id.end_nav_buttons);
+ applyLightsOut(false, true);
+ });
+ mNavButtons = mView.findViewById(R.id.end_nav_buttons);
+
+ applyModeBackground(-1, getMode(), false /*animate*/);
+ applyLightsOut(false /*animate*/, true /*force*/);
+ if (mContext.isPhoneButtonNavMode()) {
+ mBarBackground.setOverrideAlpha(1);
+ }
+ }
+
+ void setWallpaperVisibility(boolean visible) {
+ mWallpaperVisible = visible;
+ applyLightsOut(true, false);
+ }
+
+ @Override
+ public void setAutoDim(boolean autoDim) {
+ // Ensure we aren't in gestural nav if we are triggering auto dim
+ if (autoDim && !mContext.isPhoneButtonNavMode()) {
+ return;
+ }
+ if (mAutoDim == autoDim) return;
+ mAutoDim = autoDim;
+ applyLightsOut(true, false);
+ }
+
+ @Override
+ protected void onTransition(int oldMode, int newMode, boolean animate) {
+ super.onTransition(oldMode, newMode, animate);
+ applyLightsOut(animate, false /*force*/);
+ }
+
+ private void applyLightsOut(boolean animate, boolean force) {
+ // apply to lights out
+ applyLightsOut(isLightsOut(getMode()), animate, force);
+ }
+
+ private void applyLightsOut(boolean lightsOut, boolean animate, boolean force) {
+ if (!force && lightsOut == mLightsOut) return;
+
+ mLightsOut = lightsOut;
+ if (mNavButtons == null) return;
+
+ // ok, everyone, stop it right there
+ mNavButtons.animate().cancel();
+
+ // Bump percentage by 10% if dark.
+ float darkBump = mDarkIntensity / 10;
+ final float navButtonsAlpha = lightsOut ? 0.6f + darkBump : 1f;
+
+ if (!animate) {
+ mNavButtons.setAlpha(navButtonsAlpha);
+ } else {
+ final int duration = lightsOut ? LIGHTS_OUT_DURATION : LIGHTS_IN_DURATION;
+ mNavButtons.animate()
+ .alpha(navButtonsAlpha)
+ .setDuration(duration)
+ .start();
+ }
+ }
+
+ void onDarkIntensityChanged(float darkIntensity) {
+ mDarkIntensity = darkIntensity;
+ if (mAutoDim) {
+ applyLightsOut(false, true);
+ }
+ }
+
+ @Override
+ public void dumpLogs(String prefix, PrintWriter pw) {
+ pw.println(prefix + "TaskbarTransitions:");
+
+ pw.println(prefix + "\tmMode=" + getMode());
+ pw.println(prefix + "\tmAlwaysOpaque: " + isAlwaysOpaque());
+ pw.println(prefix + "\tmWallpaperVisible: " + mWallpaperVisible);
+ pw.println(prefix + "\tmLightsOut: " + mLightsOut);
+ pw.println(prefix + "\tmAutoDim: " + mAutoDim);
+ pw.println(prefix + "\tbg overrideAlpha: " + mBarBackground.getOverrideAlpha());
+ pw.println(prefix + "\tbg color: " + mBarBackground.getColor());
+ pw.println(prefix + "\tbg frame: " + mBarBackground.getFrame());
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
index 144c0c2..5a5d6d0 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
@@ -95,7 +95,8 @@
mControllers.taskbarDragLayerController.setTranslationYForSwipe(transY);
mControllers.bubbleControllers.ifPresent(controllers -> {
controllers.bubbleBarViewController.setTranslationYForSwipe(transY);
- controllers.bubbleStashedHandleViewController.setTranslationYForSwipe(transY);
+ controllers.bubbleStashedHandleViewController.ifPresent(
+ controller -> controller.setTranslationYForSwipe(transY));
});
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
index 2e78489..43960a1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
@@ -43,9 +43,10 @@
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.TISBindHelper;
import com.android.quickstep.views.RecentsView;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
import com.android.systemui.shared.recents.model.Task;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
import java.util.Collections;
@@ -55,12 +56,13 @@
* Base class for providing different taskbar UI
*/
public class TaskbarUIController {
-
public static final TaskbarUIController DEFAULT = new TaskbarUIController();
// Initialized in init.
protected TaskbarControllers mControllers;
+ protected boolean mSkipLauncherVisibilityChange;
+
@CallSuper
protected void init(TaskbarControllers taskbarControllers) {
mControllers = taskbarControllers;
@@ -91,16 +93,13 @@
*/
protected void onIconLayoutBoundsChanged() { }
- /** Called when an icon is launched. */
- @CallSuper
- public void onTaskbarIconLaunched(ItemInfo item) {
- // When launching from Taskbar, e.g. from Overview, set FLAG_IN_APP immediately instead of
- // waiting for onPause, to reduce potential visual noise during the app open transition.
- if (mControllers.taskbarStashController == null) return;
- mControllers.taskbarStashController.updateStateForFlag(FLAG_IN_APP, true);
- mControllers.taskbarStashController.applyState();
+ protected String getTaskbarUIControllerName() {
+ return "TaskbarUIController";
}
+ /** Called when an icon is launched. */
+ public void onTaskbarIconLaunched(ItemInfo item) { }
+
public View getRootView() {
return mControllers.taskbarActivityContext.getDragLayer();
}
@@ -137,7 +136,7 @@
/**
* SysUI flags updated, see QuickStepContract.SYSUI_STATE_* values.
*/
- public void updateStateForSysuiFlags(int sysuiFlags) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long sysuiFlags) {
}
/**
@@ -170,11 +169,11 @@
|| mControllers.navbarButtonsViewController.isEventOverAnyItem(ev);
}
- /** Checks if the given {@link MotionEvent} is over the bubble bar stash handle. */
- public boolean isEventOverBubbleBarStashHandle(MotionEvent ev) {
+ /** Checks if the given {@link MotionEvent} is over the bubble bar views. */
+ public boolean isEventOverBubbleBarViews(MotionEvent ev) {
return mControllers.bubbleControllers.map(
bubbleControllers ->
- bubbleControllers.bubbleStashController.isEventOverStashHandle(ev))
+ bubbleControllers.bubbleStashController.isEventOverBubbleBarViews(ev))
.orElse(false);
}
@@ -207,7 +206,7 @@
pw.println(String.format(
"%sTaskbarUIController: using an instance of %s",
prefix,
- getClass().getSimpleName()));
+ getTaskbarUIControllerName()));
}
/**
@@ -226,7 +225,7 @@
}
recentsView.getSplitSelectController().findLastActiveTasksAndRunCallback(
- Collections.singletonList(splitSelectSource.itemInfo.getComponentKey()),
+ Collections.singletonList(splitSelectSource.getItemInfo().getComponentKey()),
false /* findExactPairMatch */,
foundTasks -> {
@Nullable Task foundTask = foundTasks[0];
@@ -243,6 +242,13 @@
* Uses the clicked Taskbar icon to launch a second app for splitscreen.
*/
public void triggerSecondAppForSplit(ItemInfoWithIcon info, Intent intent, View startingView) {
+ // When launching from Taskbar, e.g. from Overview, set FLAG_IN_APP immediately
+ // to reduce potential visual noise during the app open transition.
+ if (mControllers.taskbarStashController != null) {
+ mControllers.taskbarStashController.updateStateForFlag(FLAG_IN_APP, true);
+ mControllers.taskbarStashController.applyState();
+ }
+
RecentsView recents = getRecentsView();
recents.getSplitSelectController().findLastActiveTasksAndRunCallback(
Collections.singletonList(info.getComponentKey()),
@@ -259,14 +265,14 @@
if (foundTaskView != null) {
// There is already a running app of this type, use that as second app.
// Get index of task (0 or 1), in case it's a GroupedTaskView
- TaskIdAttributeContainer taskAttributes =
- foundTaskView.getTaskAttributesById(foundTask.key.id);
+ TaskContainer taskContainer =
+ foundTaskView.getTaskContainerById(foundTask.key.id);
recents.confirmSplitSelect(
foundTaskView,
foundTask,
- taskAttributes.getIconView().getDrawable(),
- taskAttributes.getThumbnailView(),
- taskAttributes.getThumbnailView().getThumbnail(),
+ taskContainer.getIconView().getDrawable(),
+ taskContainer.getSnapshotView(),
+ taskContainer.getSplitAnimationThumbnail(),
null /* intent */,
null /* user */,
info);
@@ -407,4 +413,19 @@
public void setSkipNextRecentsAnimEnd() {
// Overridden
}
+
+ /**
+ * Sets whether the user is going home based on the current gesture.
+ */
+ public void setUserIsNotGoingHome(boolean isNotGoingHome) {
+ mControllers.taskbarStashController.setUserIsNotGoingHome(isNotGoingHome);
+ }
+
+ /**
+ * Sets whether to prevent taskbar from reacting to launcher visibility during the recents
+ * transition animation.
+ */
+ public void setSkipLauncherVisibilityChange(boolean skip) {
+ mSkipLauncherVisibilityChange = skip;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 77f8a8a..54a7fdc 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -19,16 +19,19 @@
import static com.android.launcher3.BubbleTextView.DISPLAY_TASKBAR;
import static com.android.launcher3.Flags.enableCursorHoverStates;
+import static com.android.launcher3.Flags.enableRecentsInTaskbar;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER;
import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR;
import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.DisplayCutout;
@@ -36,6 +39,7 @@
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;
@@ -63,7 +67,14 @@
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.IconButtonView;
+import com.android.quickstep.DeviceConfigWrapper;
+import com.android.quickstep.util.AssistStateManager;
+import com.android.quickstep.util.DesktopTask;
+import com.android.quickstep.util.GroupTask;
+import com.android.systemui.shared.recents.model.Task;
+import com.android.wm.shell.common.bubbles.BubbleBarLocation;
+import java.util.List;
import java.util.function.Predicate;
/**
@@ -71,8 +82,6 @@
*/
public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconParent, Insettable,
DeviceProfile.OnDeviceProfileChangeListener {
- private static final String TAG = TaskbarView.class.getSimpleName();
-
private static final Rect sTmpRect = new Rect();
private final int[] mTempOutLocation = new int[2];
@@ -95,10 +104,19 @@
// Only non-null when device supports having an All Apps button.
private @Nullable IconButtonView mAllAppsButton;
+ private Runnable mAllAppsTouchRunnable;
+ private long mAllAppsButtonTouchDelayMs;
+ private boolean mAllAppsTouchTriggered;
- // Only non-null when device supports having an All Apps button.
+ // Only non-null when device supports having an All Apps button, or Recent Apps.
private @Nullable IconButtonView mTaskbarDivider;
+ /**
+ * Whether the divider is between Hotseat icons and Recents,
+ * instead of between All Apps button and Hotseat.
+ */
+ private boolean mAddedDividerForRecents;
+
private final View mQsb;
private final float mTransientTaskbarMinWidth;
@@ -129,7 +147,6 @@
mIsRtl = Utilities.isRtl(resources);
mTransientTaskbarMinWidth = resources.getDimension(R.dimen.transient_taskbar_min_width);
-
onDeviceProfileChanged(mActivityContext.getDeviceProfile());
int actualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing);
@@ -164,7 +181,7 @@
mAllAppsButton.setForegroundTint(
mActivityContext.getColor(R.color.all_apps_button_color));
- if (enableTaskbarPinning()) {
+ if (enableTaskbarPinning() || enableRecentsInTaskbar()) {
mTaskbarDivider = (IconButtonView) LayoutInflater.from(context).inflate(
R.layout.taskbar_divider,
this, false);
@@ -175,6 +192,9 @@
// TODO: Disable touch events on QSB otherwise it can crash.
mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
+
+ // Default long press (touch) delay = 400ms
+ mAllAppsButtonTouchDelayMs = ViewConfiguration.getLongPressTimeout();
}
@DrawableRes
@@ -233,12 +253,34 @@
@Override
public boolean performAccessibilityActionInternal(int action, Bundle arguments) {
if (action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS) {
- announceForAccessibility(mContext.getString(R.string.taskbar_a11y_shown_title));
+ announceTaskbarShown();
} else if (action == AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS) {
- announceForAccessibility(mContext.getString(R.string.taskbar_a11y_hidden_title));
+ announceTaskbarHidden();
}
return super.performAccessibilityActionInternal(action, arguments);
+ }
+ private void announceTaskbarShown() {
+ BubbleBarLocation bubbleBarLocation = mControllerCallbacks.getBubbleBarLocationIfVisible();
+ if (bubbleBarLocation == null) {
+ announceForAccessibility(mContext.getString(R.string.taskbar_a11y_shown_title));
+ } else if (bubbleBarLocation.isOnLeft(isLayoutRtl())) {
+ announceForAccessibility(
+ mContext.getString(R.string.taskbar_a11y_shown_with_bubbles_left_title));
+ } else {
+ announceForAccessibility(
+ mContext.getString(R.string.taskbar_a11y_shown_with_bubbles_right_title));
+ }
+ }
+
+ private void announceTaskbarHidden() {
+ BubbleBarLocation bubbleBarLocation = mControllerCallbacks.getBubbleBarLocationIfVisible();
+ if (bubbleBarLocation == null) {
+ announceForAccessibility(mContext.getString(R.string.taskbar_a11y_hidden_title));
+ } else {
+ announceForAccessibility(
+ mContext.getString(R.string.taskbar_a11y_hidden_with_bubbles_title));
+ }
}
protected void announceAccessibilityChanges() {
@@ -265,11 +307,20 @@
mIconLongClickListener = mControllerCallbacks.getIconOnLongClickListener();
if (mAllAppsButton != null) {
- mAllAppsButton.setOnClickListener(mControllerCallbacks.getAllAppsButtonClickListener());
- mAllAppsButton.setOnLongClickListener(
- mControllerCallbacks.getAllAppsButtonLongClickListener());
+ mAllAppsButton.setOnClickListener(this::onAllAppsButtonClick);
+ mAllAppsButton.setOnLongClickListener(this::onAllAppsButtonLongClick);
+ mAllAppsButton.setOnTouchListener(this::onAllAppsButtonTouch);
mAllAppsButton.setHapticFeedbackEnabled(
mControllerCallbacks.isAllAppsButtonHapticFeedbackEnabled());
+ mAllAppsTouchRunnable = () -> {
+ mControllerCallbacks.triggerAllAppsButtonLongClick();
+ mAllAppsTouchTriggered = true;
+ };
+ AssistStateManager assistStateManager = AssistStateManager.INSTANCE.get(mContext);
+ if (DeviceConfigWrapper.get().getCustomLpaaThresholds()
+ && assistStateManager.getLPNHDurationMillis().isPresent()) {
+ mAllAppsButtonTouchDelayMs = assistStateManager.getLPNHDurationMillis().get();
+ }
}
if (mTaskbarDivider != null && !mActivityContext.isThreeButtonNav()) {
mTaskbarDivider.setOnLongClickListener(
@@ -292,9 +343,10 @@
/**
* Inflates/binds the Hotseat views to show in the Taskbar given their ItemInfos.
*/
- protected void updateHotseatItems(ItemInfo[] hotseatItemInfos) {
+ protected void updateHotseatItems(ItemInfo[] hotseatItemInfos, List<GroupTask> recentTasks) {
int nextViewIndex = 0;
int numViewsAnimated = 0;
+ mAddedDividerForRecents = false;
if (mAllAppsButton != null) {
removeView(mAllAppsButton);
@@ -305,9 +357,8 @@
}
removeView(mQsb);
-
- for (int i = 0; i < hotseatItemInfos.length; i++) {
- ItemInfo hotseatItemInfo = hotseatItemInfos[i];
+ // Add Hotseat icons.
+ for (ItemInfo hotseatItemInfo : hotseatItemInfos) {
if (hotseatItemInfo == null) {
continue;
}
@@ -373,11 +424,8 @@
}
// Apply the Hotseat ItemInfos, or hide the view if there is none for a given index.
- if (hotseatView instanceof BubbleTextView
- && hotseatItemInfo instanceof WorkspaceItemInfo) {
- BubbleTextView btv = (BubbleTextView) hotseatView;
- WorkspaceItemInfo workspaceInfo = (WorkspaceItemInfo) hotseatItemInfo;
-
+ if (hotseatView instanceof BubbleTextView btv
+ && hotseatItemInfo instanceof WorkspaceItemInfo workspaceInfo) {
boolean animate = btv.shouldAnimateIconChange((WorkspaceItemInfo) hotseatItemInfo);
btv.applyFromWorkspaceItem(workspaceInfo, animate, numViewsAnimated);
if (animate) {
@@ -390,16 +438,77 @@
}
nextViewIndex++;
}
+
+ if (mTaskbarDivider != null && !recentTasks.isEmpty()) {
+ addView(mTaskbarDivider, nextViewIndex++);
+ mAddedDividerForRecents = true;
+ }
+
+ // Add Recent/Running icons.
+ for (GroupTask task : recentTasks) {
+ // Replace any Recent views with the appropriate type if it's not already that type.
+ final int expectedLayoutResId;
+ boolean isCollection = false;
+ if (task.hasMultipleTasks()) {
+ if (task instanceof DesktopTask) {
+ // TODO(b/316004172): use Desktop tile layout.
+ expectedLayoutResId = -1;
+ } else {
+ // TODO(b/343289567): use R.layout.app_pair_icon
+ expectedLayoutResId = -1;
+ }
+ isCollection = true;
+ } else {
+ expectedLayoutResId = R.layout.taskbar_app_icon;
+ }
+
+ View recentIcon = null;
+ while (nextViewIndex < getChildCount()) {
+ recentIcon = getChildAt(nextViewIndex);
+
+ // see if the view can be reused
+ if ((recentIcon.getSourceLayoutResId() != expectedLayoutResId)
+ || (isCollection && (recentIcon.getTag() != task))) {
+ removeAndRecycle(recentIcon);
+ recentIcon = null;
+ } else {
+ // View found
+ break;
+ }
+ }
+
+ if (recentIcon == null) {
+ if (isCollection) {
+ // TODO(b/343289567 and b/316004172): support app pairs and desktop mode.
+ continue;
+ }
+
+ recentIcon = inflate(expectedLayoutResId);
+ LayoutParams lp = new LayoutParams(mIconTouchSize, mIconTouchSize);
+ recentIcon.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
+ addView(recentIcon, nextViewIndex, lp);
+ }
+
+ if (recentIcon instanceof BubbleTextView btv) {
+ applyGroupTaskToBubbleTextView(btv, task);
+ }
+ setClickAndLongClickListenersForIcon(recentIcon);
+ if (enableCursorHoverStates()) {
+ setHoverListenerForIcon(recentIcon);
+ }
+ nextViewIndex++;
+ }
+
// Remove remaining views
while (nextViewIndex < getChildCount()) {
removeAndRecycle(getChildAt(nextViewIndex));
}
if (mAllAppsButton != null) {
- addView(mAllAppsButton, mIsRtl ? getChildCount() : 0);
+ addView(mAllAppsButton, mIsRtl ? hotseatItemInfos.length : 0);
- // if only all apps button present, don't include divider view.
- if (mTaskbarDivider != null && getChildCount() > 1) {
+ // If there are no recent tasks, add divider after All Apps (unless it's the only view).
+ if (!mAddedDividerForRecents && mTaskbarDivider != null && getChildCount() > 1) {
addView(mTaskbarDivider, mIsRtl ? (getChildCount() - 1) : 1);
}
}
@@ -410,6 +519,20 @@
}
}
+ /** Binds the GroupTask to the BubbleTextView to be ready to present to the user. */
+ public void applyGroupTaskToBubbleTextView(BubbleTextView btv, GroupTask groupTask) {
+ // TODO(b/343289567): support app pairs.
+ Task task1 = groupTask.task1;
+ // TODO(b/344038728): use FastBitmapDrawable instead of Drawable, to get disabled state
+ // while dragging.
+ Drawable taskIcon = groupTask.task1.icon;
+ if (taskIcon != null) {
+ taskIcon = taskIcon.getConstantState().newDrawable().mutate();
+ }
+ btv.applyIconAndLabel(taskIcon, task1.titleDescription);
+ btv.setTag(groupTask);
+ }
+
/**
* Sets OnClickListener and OnLongClickListener for the given view.
*/
@@ -552,8 +675,20 @@
return isShown() && mIconLayoutBounds.contains(xInOurCoordinates, yInOurCoorindates);
}
+ /**
+ * Gets visual bounds of the taskbar view. The visual bounds correspond to the taskbar touch
+ * area, rather than layout placement in the parent view.
+ */
+ public Rect getIconLayoutVisualBounds() {
+ return new Rect(mIconLayoutBounds);
+ }
+
+ /** Gets taskbar layout bounds in parent view. */
public Rect getIconLayoutBounds() {
- return mIconLayoutBounds;
+ Rect actualBounds = new Rect(mIconLayoutBounds);
+ actualBounds.top = getTop();
+ actualBounds.bottom = getBottom();
+ return actualBounds;
}
/**
@@ -605,6 +740,14 @@
}
/**
+ * Returns whether the divider is between Hotseat icons and Recents,
+ * instead of between All Apps button and Hotseat.
+ */
+ public boolean isDividerForRecents() {
+ return mAddedDividerForRecents;
+ }
+
+ /**
* Returns the QSB in the taskbar.
*/
public View getQsb() {
@@ -662,7 +805,8 @@
// map over all the shortcuts on the taskbar
for (int i = 0; i < getChildCount(); i++) {
View item = getChildAt(i);
- if (op.evaluate((ItemInfo) item.getTag(), item)) {
+ // TODO(b/344657629): Support GroupTask as well for notification dots/popup
+ if (item.getTag() instanceof ItemInfo itemInfo && op.evaluate(itemInfo, item)) {
return;
}
}
@@ -679,6 +823,7 @@
View item = getChildAt(i);
if (!(item.getTag() instanceof ItemInfo)) {
// Should only happen for All Apps button.
+ // Will also happen for Recent/Running app icons. (Which have GroupTask as tags)
continue;
}
ItemInfo info = (ItemInfo) item.getTag();
@@ -689,4 +834,46 @@
}
return mAllAppsButton;
}
+
+ private boolean onAllAppsButtonTouch(View view, MotionEvent ev) {
+ switch (ev.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ mAllAppsTouchTriggered = false;
+ MAIN_EXECUTOR.getHandler().postDelayed(
+ mAllAppsTouchRunnable, mAllAppsButtonTouchDelayMs);
+ break;
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ cancelAllAppsButtonTouch();
+ }
+ return false;
+ }
+
+ private void cancelAllAppsButtonTouch() {
+ MAIN_EXECUTOR.getHandler().removeCallbacks(mAllAppsTouchRunnable);
+ // ACTION_UP is first triggered, then click listener / long-click listener is triggered on
+ // the next frame, so we need to post twice and delay the reset.
+ if (mAllAppsButton != null) {
+ mAllAppsButton.post(() -> {
+ mAllAppsButton.post(() -> {
+ mAllAppsTouchTriggered = false;
+ });
+ });
+ }
+ }
+
+ private void onAllAppsButtonClick(View view) {
+ if (!mAllAppsTouchTriggered) {
+ mControllerCallbacks.triggerAllAppsButtonClick(view);
+ }
+ }
+
+ // Handle long click from Switch Access and Voice Access
+ private boolean onAllAppsButtonLongClick(View view) {
+ if (!MAIN_EXECUTOR.getHandler().hasCallbacks(mAllAppsTouchRunnable)
+ && !mAllAppsTouchTriggered) {
+ mControllerCallbacks.triggerAllAppsButtonLongClick();
+ }
+ return true;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java
index c841cac..e6cac2f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewCallbacks.java
@@ -23,8 +23,12 @@
import android.view.MotionEvent;
import android.view.View;
+import androidx.annotation.Nullable;
+
import com.android.internal.jank.Cuj;
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
+import com.android.wm.shell.common.bubbles.BubbleBarLocation;
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
@@ -46,20 +50,17 @@
return mActivity.getItemOnClickListener();
}
- public View.OnClickListener getAllAppsButtonClickListener() {
- return v -> {
- InteractionJankMonitorWrapper.begin(v, Cuj.CUJ_LAUNCHER_OPEN_ALL_APPS,
- /* tag= */ "TASKBAR_BUTTON");
- mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP);
- mControllers.taskbarAllAppsController.toggle();
- };
+ /** Trigger All Apps button click action. */
+ protected void triggerAllAppsButtonClick(View v) {
+ InteractionJankMonitorWrapper.begin(v, Cuj.CUJ_LAUNCHER_OPEN_ALL_APPS,
+ /* tag= */ "TASKBAR_BUTTON");
+ mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP);
+ mControllers.taskbarAllAppsController.toggle();
}
- public View.OnLongClickListener getAllAppsButtonLongClickListener() {
- return v -> {
- mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_LONG_PRESS);
- return true;
- };
+ /** Trigger All Apps button long click action. */
+ protected void triggerAllAppsButtonLongClick() {
+ mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_LONG_PRESS);
}
public boolean isAllAppsButtonHapticFeedbackEnabled() {
@@ -107,4 +108,18 @@
mControllers.taskbarScrimViewController.onTaskbarVisibilityChanged(
mTaskbarView.getVisibility());
}
+
+ /**
+ * Get current location of bubble bar, if it is visible.
+ * Returns {@code null} if bubble bar is not shown.
+ */
+ @Nullable
+ public BubbleBarLocation getBubbleBarLocationIfVisible() {
+ BubbleBarViewController bubbleBarViewController =
+ mControllers.bubbleControllers.map(c -> c.bubbleBarViewController).orElse(null);
+ if (bubbleBarViewController != null && bubbleBarViewController.isBubbleBarVisible()) {
+ return bubbleBarViewController.getBubbleBarLocation();
+ }
+ return null;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index e0b446e..27c1d9c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -17,6 +17,7 @@
import static com.android.app.animation.Interpolators.FINAL_FRAME;
import static com.android.app.animation.Interpolators.LINEAR;
+import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
@@ -32,6 +33,7 @@
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_ALIGNMENT_ANIM;
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_PINNING_ANIM;
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_REVEAL_ANIM;
+import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -45,6 +47,7 @@
import android.view.animation.Interpolator;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import androidx.core.view.OneShotPreDrawListener;
import com.android.app.animation.Interpolators;
@@ -62,6 +65,7 @@
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.TaskItemInfo;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
@@ -69,6 +73,8 @@
import com.android.launcher3.util.MultiTranslateDelegate;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.views.IconButtonView;
+import com.android.quickstep.util.GroupTask;
+import com.android.systemui.shared.recents.model.Task;
import java.io.PrintWriter;
import java.util.Set;
@@ -79,7 +85,7 @@
*/
public class TaskbarViewController implements TaskbarControllers.LoggableTaskbarController {
- private static final String TAG = TaskbarViewController.class.getSimpleName();
+ private static final String TAG = "TaskbarViewController";
private static final Runnable NO_OP = () -> { };
@@ -90,7 +96,17 @@
public static final int ALPHA_INDEX_NOTIFICATION_EXPANDED = 4;
public static final int ALPHA_INDEX_ASSISTANT_INVOKED = 5;
public static final int ALPHA_INDEX_SMALL_SCREEN = 6;
- private static final int NUM_ALPHA_CHANNELS = 7;
+
+ public static final int ALPHA_INDEX_BUBBLE_BAR = 7;
+ private static final int NUM_ALPHA_CHANNELS = 8;
+
+ /** Only used for animation purposes, to position the divider between two item indices. */
+ public static final float DIVIDER_VIEW_POSITION_OFFSET = 0.5f;
+
+ /** Used if an unexpected edge case is hit in {@link #getPositionInHotseat}. */
+ private static final float ERROR_POSITION_IN_HOTSEAT_NOT_FOUND = -100;
+
+ private static boolean sEnableModelLoadingForTests = true;
private final TaskbarActivityContext mActivity;
private final TaskbarView mTaskbarView;
@@ -134,6 +150,7 @@
private Runnable mOnControllerPreCreateCallback = NO_OP;
// Stored here as signals to determine if the mIconAlignController needs to be recreated.
+ private boolean mIsIconAlignedWithHotseat;
private boolean mIsHotseatIconOnTopWhenAligned;
private boolean mIsStashed;
@@ -188,7 +205,7 @@
mTaskbarIconTranslationXForPinning.updateValue(pinningValue);
mModelCallbacks.init(controllers);
- if (mActivity.isUserSetupComplete()) {
+ if (mActivity.isUserSetupComplete() && sEnableModelLoadingForTests) {
// Only load the callbacks if user setup is completed
LauncherAppState.getInstance(mActivity).getModel().addCallbacksAndLoad(mModelCallbacks);
}
@@ -202,8 +219,8 @@
if (ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
// This gets modified in NavbarButtonsViewController, but the initial value it reads
// may be incorrect since it's state gets destroyed on taskbar recreate, so reset here
- mTaskbarIconAlpha.get(ALPHA_INDEX_SMALL_SCREEN)
- .animateToValue(mActivity.isPhoneButtonNavMode() ? 0 : 1).start();
+ mTaskbarIconAlpha.get(ALPHA_INDEX_SMALL_SCREEN).setValue(
+ mActivity.isPhoneMode() ? 0 : 1);
}
if (enableTaskbarPinning()) {
mTaskbarView.addOnLayoutChangeListener(mTaskbarViewLayoutChangeListener);
@@ -223,7 +240,13 @@
}
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
mActivity.removeOnDeviceProfileChangeListener(mDeviceProfileChangeListener);
- mModelCallbacks.unregisterListeners();
+ }
+
+ /**
+ * Gets the taskbar {@link View.Visibility visibility}.
+ */
+ public int getTaskbarVisibility() {
+ return mTaskbarView.getVisibility();
}
public boolean areIconsVisible() {
@@ -258,6 +281,10 @@
OneShotPreDrawListener.add(mTaskbarView, listener);
}
+ public Rect getIconLayoutVisualBounds() {
+ return mTaskbarView.getIconLayoutVisualBounds();
+ }
+
public Rect getIconLayoutBounds() {
return mTaskbarView.getIconLayoutBounds();
}
@@ -346,6 +373,11 @@
float allAppIconTranslateRange = mapRange(scale, transientTaskbarAllAppsOffset,
persistentTaskbarAllAppsOffset);
+ // no x translation required when all apps button is the only icon in taskbar.
+ if (iconViews.length <= 1) {
+ allAppIconTranslateRange = 0f;
+ }
+
if (mIsRtl) {
allAppIconTranslateRange *= -1;
}
@@ -376,7 +408,7 @@
-finalMarginScale * (iconIndex - halfIconCount));
}
- if (iconView.equals(mTaskbarView.getAllAppsButtonView()) && iconViews.length > 1) {
+ if (iconView.equals(mTaskbarView.getAllAppsButtonView())) {
((IconButtonView) iconView).setTranslationXForTaskbarAllAppsIcon(
allAppIconTranslateRange);
}
@@ -443,14 +475,14 @@
if (mControllers.getSharedState().startTaskbarVariantIsTransient) {
float transY =
mTransientTaskbarDp.taskbarBottomMargin + (mTransientTaskbarDp.taskbarHeight
- - mTaskbarView.getIconLayoutBounds().bottom)
+ - mTaskbarView.getIconLayoutVisualBounds().bottom)
- (mPersistentTaskbarDp.taskbarHeight
- mTransientTaskbarDp.taskbarIconSize) / 2f;
taskbarIconTranslationYForPinningValue = mapRange(scale, 0f, transY);
} else {
float transY =
-mTransientTaskbarDp.taskbarBottomMargin + (mPersistentTaskbarDp.taskbarHeight
- - mTaskbarView.getIconLayoutBounds().bottom)
+ - mTaskbarView.getIconLayoutVisualBounds().bottom)
- (mTransientTaskbarDp.taskbarHeight
- mTransientTaskbarDp.taskbarIconSize) / 2f;
taskbarIconTranslationYForPinningValue = mapRange(scale, transY, 0f);
@@ -508,15 +540,44 @@
return mTaskbarView.getTaskbarDividerView();
}
- /** Updates which icons are marked as running given the Set of currently running packages. */
- public void updateIconViewsRunningStates(Set<String> runningPackages) {
+ /**
+ * Updates which icons are marked as running or minimized given the Sets of currently running
+ * and minimized tasks.
+ */
+ public void updateIconViewsRunningStates(Set<Integer> runningTaskIds,
+ Set<Integer> minimizedTaskIds) {
for (View iconView : getIconViews()) {
if (iconView instanceof BubbleTextView btv) {
- btv.updateRunningState(runningPackages.contains(btv.getTargetPackageName()));
+ btv.updateRunningState(
+ getRunningAppState(btv, runningTaskIds, minimizedTaskIds));
}
}
}
+ private BubbleTextView.RunningAppState getRunningAppState(
+ BubbleTextView btv,
+ Set<Integer> runningTaskIds,
+ Set<Integer> minimizedTaskIds) {
+ Object tag = btv.getTag();
+ if (tag instanceof TaskItemInfo itemInfo) {
+ if (minimizedTaskIds.contains(itemInfo.getTaskId())) {
+ return BubbleTextView.RunningAppState.MINIMIZED;
+ }
+ if (runningTaskIds.contains(itemInfo.getTaskId())) {
+ return BubbleTextView.RunningAppState.RUNNING;
+ }
+ }
+ if (tag instanceof GroupTask groupTask && !groupTask.hasMultipleTasks()) {
+ if (minimizedTaskIds.contains(groupTask.task1.key.id)) {
+ return BubbleTextView.RunningAppState.MINIMIZED;
+ }
+ if (runningTaskIds.contains(groupTask.task1.key.id)) {
+ return BubbleTextView.RunningAppState.RUNNING;
+ }
+ }
+ return BubbleTextView.RunningAppState.NOT_RUNNING;
+ }
+
/**
* Defers any updates to the UI for the setup wizard animation.
*/
@@ -534,7 +595,8 @@
* @param interpolator The interpolator to use for all animations.
*/
public void addRevealAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration,
- Interpolator interpolator, boolean dispatchOnAnimationStart) {
+ Interpolator interpolator, boolean dispatchOnAnimationStart,
+ boolean isHomeToAppAnimation) {
AnimatorSet reveal = new AnimatorSet();
Rect stashedBounds = new Rect();
@@ -583,8 +645,21 @@
reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationX(INDEX_TASKBAR_REVEAL_ANIM),
MULTI_PROPERTY_VALUE, transX)
.setDuration(duration));
- reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
- MULTI_PROPERTY_VALUE, transY));
+
+ if (enableScalingRevealHomeAnimation()) {
+ // Delay y-translation by 1 frame to keep icons within the bounds of the bg.
+ int delay = isHomeToAppAnimation ? getSingleFrameMs(mActivity) : 0;
+ ObjectAnimator yAnimator =
+ ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
+ MULTI_PROPERTY_VALUE, transY)
+ .setDuration(Math.max(0, duration - delay));
+ yAnimator.setStartDelay(delay);
+ reveal.play(yAnimator);
+ } else {
+ reveal.play(
+ ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
+ MULTI_PROPERTY_VALUE, transY));
+ }
as.addListener(forEndCallback(() ->
mtd.setTranslation(INDEX_TASKBAR_REVEAL_ANIM, 0, 0)));
} else {
@@ -613,15 +688,17 @@
mIconAlignControllerLazy = null;
return;
}
-
boolean isHotseatIconOnTopWhenAligned =
mControllers.uiController.isHotseatIconOnTopWhenAligned();
+ boolean isIconAlignedWithHotseat = mControllers.uiController.isIconAlignedWithHotseat();
boolean isStashed = mControllers.taskbarStashController.isStashed();
- // Re-create animation when mIsHotseatIconOnTopWhenAligned or mIsStashed changes.
+ // Re-create animation when any of these values change.
if (mIconAlignControllerLazy == null
|| mIsHotseatIconOnTopWhenAligned != isHotseatIconOnTopWhenAligned
+ || mIsIconAlignedWithHotseat != isIconAlignedWithHotseat
|| mIsStashed != isStashed) {
mIsHotseatIconOnTopWhenAligned = isHotseatIconOnTopWhenAligned;
+ mIsIconAlignedWithHotseat = isIconAlignedWithHotseat;
mIsStashed = isStashed;
mIconAlignControllerLazy = createIconAlignmentController(launcherDp);
}
@@ -673,22 +750,33 @@
? mTransientTaskbarDp.taskbarBottomMargin
: mPersistentTaskbarDp.taskbarBottomMargin;
+ int firstRecentTaskIndex = -1;
for (int i = 0; i < mTaskbarView.getChildCount(); i++) {
View child = mTaskbarView.getChildAt(i);
boolean isAllAppsButton = child == mTaskbarView.getAllAppsButtonView();
boolean isTaskbarDividerView = child == mTaskbarView.getTaskbarDividerView();
+ boolean isRecentTask = child.getTag() instanceof GroupTask;
+ // TODO(b/343522351): show recents on the home screen.
+ final boolean isRecentsInHotseat = false;
if (!mIsHotseatIconOnTopWhenAligned) {
// When going to home, the EMPHASIZED interpolator in TaskbarLauncherStateController
// plays iconAlignment to 1 really fast, therefore moving the fading towards the end
// to avoid icons disappearing rather than fading out visually.
setter.setViewAlpha(child, 0, Interpolators.clampToProgress(LINEAR, 0.8f, 1f));
} else if ((isAllAppsButton && !FeatureFlags.ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT.get())
- || (isTaskbarDividerView && enableTaskbarPinning())) {
+ || (isTaskbarDividerView && enableTaskbarPinning())
+ || (isRecentTask && !isRecentsInHotseat)) {
if (!isToHome
&& mIsHotseatIconOnTopWhenAligned
&& mIsStashed) {
// Prevent All Apps icon from appearing when going from hotseat to nav handle.
setter.setViewAlpha(child, 0, Interpolators.clampToProgress(LINEAR, 0f, 0f));
+ } else if (enableScalingRevealHomeAnimation()) {
+ // Tighten clamp so that these icons do not linger as the spring settles.
+ setter.setViewAlpha(child, 0,
+ isToHome
+ ? Interpolators.clampToProgress(LINEAR, 0f, 0.07f)
+ : Interpolators.clampToProgress(LINEAR, 0.93f, 1f));
} else {
setter.setViewAlpha(child, 0,
isToHome
@@ -738,25 +826,17 @@
continue;
}
- float positionInHotseat;
- if (isAllAppsButton) {
- // Note that there is no All Apps button in the hotseat,
- // this position is only used as its convenient for animation purposes.
- positionInHotseat = Utilities.isRtl(child.getResources())
- ? taskbarDp.numShownHotseatIcons
- : -1;
- } else if (isTaskbarDividerView) {
- // Note that there is no taskbar divider view in the hotseat,
- // this position is only used as its convenient for animation purposes.
- positionInHotseat = Utilities.isRtl(child.getResources())
- ? taskbarDp.numShownHotseatIcons - 0.5f
- : -0.5f;
- } else if (child.getTag() instanceof ItemInfo) {
- positionInHotseat = ((ItemInfo) child.getTag()).screenId;
- } else {
- Log.w(TAG, "Unsupported view found in createIconAlignmentController, v=" + child);
- continue;
+ int recentTaskIndex = -1;
+ if (isRecentTask) {
+ if (firstRecentTaskIndex < 0) {
+ firstRecentTaskIndex = i;
+ }
+ recentTaskIndex = i - firstRecentTaskIndex;
}
+ float positionInHotseat = getPositionInHotseat(taskbarDp.numShownHotseatIcons, child,
+ mIsRtl, isAllAppsButton, isTaskbarDividerView,
+ mTaskbarView.isDividerForRecents(), recentTaskIndex);
+ if (positionInHotseat == ERROR_POSITION_IN_HOTSEAT_NOT_FOUND) continue;
float hotseatAdjustedBorderSpace =
launcherDp.getHotseatAdjustedBorderSpaceForBubbleBar(child.getContext());
@@ -792,6 +872,58 @@
return controller;
}
+ /**
+ * Returns the index of the given child relative to its position in hotseat.
+ * Examples:
+ * -1 is the item before the first hotseat item.
+ * -0.5 is between those (e.g. for the divider).
+ * {@link #ERROR_POSITION_IN_HOTSEAT_NOT_FOUND} if there's no calculation relative to hotseat.
+ */
+ @VisibleForTesting
+ float getPositionInHotseat(int numShownHotseatIcons, View child, boolean isRtl,
+ boolean isAllAppsButton, boolean isTaskbarDividerView, boolean isDividerForRecents,
+ int recentTaskIndex) {
+ float positionInHotseat;
+ // Note that there is no All Apps button in the hotseat,
+ // this position is only used as it's convenient for animation purposes.
+ float allAppsButtonPositionInHotseat = isRtl
+ // Right after all hotseat items.
+ // [HHHHHH]|[>A<]
+ ? numShownHotseatIcons
+ // Right before all hotseat items.
+ // [>A<]|[HHHHHH]
+ : -1;
+ // Note that there are no recent tasks in the hotseat,
+ // this position is only used as it's convenient for animation purposes.
+ float firstRecentTaskPositionInHotseat = isRtl
+ // After all hotseat icons and All Apps button.
+ // [HHHHHH][A]|[>R<R]
+ ? numShownHotseatIcons + 1
+ // Right after all hotseat items.
+ // [A][HHHHHH]|[>R<R]
+ : numShownHotseatIcons;
+ if (isAllAppsButton) {
+ positionInHotseat = allAppsButtonPositionInHotseat;
+ } else if (isTaskbarDividerView) {
+ // Note that there is no taskbar divider view in the hotseat,
+ // this position is only used as it's convenient for animation purposes.
+ float relativePosition = isDividerForRecents
+ ? firstRecentTaskPositionInHotseat
+ : allAppsButtonPositionInHotseat;
+ positionInHotseat = relativePosition > 0
+ ? relativePosition - DIVIDER_VIEW_POSITION_OFFSET
+ : relativePosition + DIVIDER_VIEW_POSITION_OFFSET;
+ } else if (child.getTag() instanceof ItemInfo) {
+ positionInHotseat = ((ItemInfo) child.getTag()).screenId;
+ } else if (recentTaskIndex >= 0) {
+ positionInHotseat = firstRecentTaskPositionInHotseat + recentTaskIndex;
+ } else {
+ Log.w(TAG, "Unsupported view found in createIconAlignmentController, v=" + child);
+ return ERROR_POSITION_IN_HOTSEAT_NOT_FOUND;
+ }
+ return positionInHotseat;
+ }
+
private boolean bubbleBarHasBubbles() {
return mControllers.bubbleControllers.isPresent()
&& mControllers.bubbleControllers.get().bubbleBarViewController.hasBubbles();
@@ -841,6 +973,27 @@
return mTaskbarView.isEventOverAnyItem(ev);
}
+ /** Called when there's a change in running apps to update the UI. */
+ public void commitRunningAppsToUI() {
+ mModelCallbacks.commitRunningAppsToUI();
+ }
+
+ /**
+ * To be called when the given Task is updated, so that we can tell TaskbarView to also update.
+ * @param task The Task whose e.g. icon changed.
+ */
+ public void onTaskUpdated(Task task) {
+ // Find the icon view(s) that changed.
+ for (View view : mTaskbarView.getIconViews()) {
+ if (view instanceof BubbleTextView btv
+ && view.getTag() instanceof GroupTask groupTask) {
+ if (groupTask.containsTask(task.key.id)) {
+ mTaskbarView.applyGroupTaskToBubbleTextView(btv, groupTask);
+ }
+ }
+ }
+ }
+
@Override
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarViewController:");
@@ -855,20 +1008,14 @@
"ALPHA_INDEX_RECENTS_DISABLED",
"ALPHA_INDEX_NOTIFICATION_EXPANDED",
"ALPHA_INDEX_ASSISTANT_INVOKED",
- "ALPHA_INDEX_IME_BUTTON_NAV",
"ALPHA_INDEX_SMALL_SCREEN");
mModelCallbacks.dumpLogs(prefix + "\t", pw);
}
- /** Called when there's a change in running apps to update the UI. */
- public void commitRunningAppsToUI() {
- mModelCallbacks.commitRunningAppsToUI();
+ /** Enables model loading for tests. */
+ @VisibleForTesting
+ public static void enableModelLoadingForTests(boolean enable) {
+ sEnableModelLoadingForTests = enable;
}
-
- /** Call TaskbarModelCallbacks to update running apps. */
- public void updateRunningApps() {
- mModelCallbacks.updateRunningApps();
- }
-
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
index 5a5ff8e..c380c8d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
@@ -41,7 +41,8 @@
class VoiceInteractionWindowController(val context: TaskbarActivityContext) :
TaskbarControllers.LoggableTaskbarController, TaskbarControllers.BackgroundRendererController {
- private val isSeparateBackgroundEnabled = !DisplayController.isTransientTaskbar(context)
+ private val isSeparateBackgroundEnabled =
+ !DisplayController.isTransientTaskbar(context) && !context.isPhoneMode
private val taskbarBackgroundRenderer = TaskbarBackgroundRenderer(context)
private val nonTouchableInsetsComputer =
ViewTreeObserver.OnComputeInternalInsetsListener {
@@ -109,7 +110,7 @@
}
fun setIsVoiceInteractionWindowVisible(visible: Boolean, skipAnim: Boolean) {
- if (isVoiceInteractionWindowVisible == visible) {
+ if (isVoiceInteractionWindowVisible == visible || context.isPhoneMode) {
return
}
isVoiceInteractionWindowVisible = visible
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
index 8e05686..90ac872 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
@@ -17,6 +17,8 @@
import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.launcher3.Flags.enablePredictiveBackGesture;
+import static com.android.launcher3.touch.AllAppsSwipeController.ALL_APPS_FADE_MANUAL;
+import static com.android.launcher3.touch.AllAppsSwipeController.SCRIM_FADE_MANUAL;
import android.animation.Animator;
import android.content.Context;
@@ -32,6 +34,7 @@
import androidx.annotation.Nullable;
+import com.android.app.animation.Interpolators;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
@@ -40,6 +43,7 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsViewController.TaskbarAllAppsCallbacks;
import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext;
+import com.android.launcher3.util.Themes;
import com.android.launcher3.views.AbstractSlideInView;
/** Wrapper for taskbar all apps with slide-in behavior. */
@@ -113,8 +117,25 @@
@Override
protected void onOpenCloseAnimationPending(PendingAnimation animation) {
- mAllAppsCallbacks.onAllAppsAnimationPending(
- animation, mToTranslationShift == TRANSLATION_SHIFT_OPENED);
+ final boolean isOpening = mToTranslationShift == TRANSLATION_SHIFT_OPENED;
+
+ if (mActivityContext.getDeviceProfile().isPhone) {
+ final Interpolator allAppsFadeInterpolator =
+ isOpening ? ALL_APPS_FADE_MANUAL : Interpolators.reverse(ALL_APPS_FADE_MANUAL);
+ animation.setViewAlpha(mAppsView, 1 - mToTranslationShift, allAppsFadeInterpolator);
+ }
+
+ mAllAppsCallbacks.onAllAppsAnimationPending(animation, isOpening);
+ }
+
+ @Override
+ protected Interpolator getScrimInterpolator() {
+ if (mActivityContext.getDeviceProfile().isTablet) {
+ return super.getScrimInterpolator();
+ }
+ return mToTranslationShift == TRANSLATION_SHIFT_OPENED
+ ? SCRIM_FADE_MANUAL
+ : Interpolators.reverse(SCRIM_FADE_MANUAL);
}
/** The apps container inside this view. */
@@ -154,6 +175,9 @@
protected void onFinishInflate() {
super.onFinishInflate();
mAppsView = findViewById(R.id.apps_view);
+ if (mActivityContext.getDeviceProfile().isPhone) {
+ mAppsView.setAlpha(0);
+ }
mContent = mAppsView;
// Setup header protection for search bar, if enabled.
@@ -214,7 +238,9 @@
@Override
protected int getScrimColor(Context context) {
- return context.getColor(R.color.widgets_picker_scrim);
+ return mActivityContext.getDeviceProfile().isPhone
+ ? Themes.getAttrColor(context, R.attr.allAppsScrimColor)
+ : context.getColor(R.color.widgets_picker_scrim);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
index ec47c4f..25939e1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
@@ -19,7 +19,9 @@
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.ColorFilter
+import android.graphics.Matrix
import android.graphics.Paint
+import android.graphics.Path
import android.graphics.PixelFormat
import android.graphics.drawable.Drawable
import com.android.app.animation.Interpolators
@@ -28,28 +30,28 @@
import com.android.launcher3.Utilities.mapToRange
import com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound
import com.android.launcher3.popup.RoundedArrowDrawable
+import kotlin.math.max
+import kotlin.math.min
/** Drawable for the background of the bubble bar. */
class BubbleBarBackground(context: Context, private var backgroundHeight: Float) : Drawable() {
- private val DARK_THEME_SHADOW_ALPHA = 51f
- private val LIGHT_THEME_SHADOW_ALPHA = 25f
-
- private val paint: Paint = Paint()
- private val pointerWidth: Float
- private val pointerHeight: Float
- private val pointerTipRadius: Float
- private val pointerVisibleHeight: Float
+ private val fillPaint: Paint = Paint()
+ private val strokePaint: Paint = Paint()
+ private val arrowWidth: Float
+ private val arrowHeight: Float
+ private val arrowTipRadius: Float
+ private val arrowVisibleHeight: Float
private val shadowAlpha: Float
private var shadowBlur = 0f
private var keyShadowDistance = 0f
+ private var arrowHeightFraction = 1f
var arrowPositionX: Float = 0f
private set
private var showingArrow: Boolean = false
- private var arrowDrawable: RoundedArrowDrawable
var width: Float = 0f
@@ -70,34 +72,31 @@
}
init {
- paint.color = context.getColor(R.color.taskbar_background)
- paint.flags = Paint.ANTI_ALIAS_FLAG
- paint.style = Paint.Style.FILL
-
val res = context.resources
+ // configure fill paint
+ fillPaint.color = context.getColor(R.color.taskbar_background)
+ fillPaint.flags = Paint.ANTI_ALIAS_FLAG
+ fillPaint.style = Paint.Style.FILL
+ // configure stroke paint
+ strokePaint.color = context.getColor(R.color.taskbar_stroke)
+ strokePaint.flags = Paint.ANTI_ALIAS_FLAG
+ strokePaint.style = Paint.Style.STROKE
+ strokePaint.strokeWidth = res.getDimension(R.dimen.transient_taskbar_stroke_width)
+ // apply theme alpha attributes
+ if (Utilities.isDarkTheme(context)) {
+ strokePaint.alpha = DARK_THEME_STROKE_ALPHA
+ shadowAlpha = DARK_THEME_SHADOW_ALPHA
+ } else {
+ strokePaint.alpha = LIGHT_THEME_STROKE_ALPHA
+ shadowAlpha = LIGHT_THEME_SHADOW_ALPHA
+ }
+
shadowBlur = res.getDimension(R.dimen.transient_taskbar_shadow_blur)
keyShadowDistance = res.getDimension(R.dimen.transient_taskbar_key_shadow_distance)
- pointerWidth = res.getDimension(R.dimen.bubblebar_pointer_width)
- pointerHeight = res.getDimension(R.dimen.bubblebar_pointer_height)
- pointerVisibleHeight = res.getDimension(R.dimen.bubblebar_pointer_visible_size)
- pointerTipRadius = res.getDimension(R.dimen.bubblebar_pointer_radius)
-
- shadowAlpha =
- if (Utilities.isDarkTheme(context)) {
- DARK_THEME_SHADOW_ALPHA
- } else {
- LIGHT_THEME_SHADOW_ALPHA
- }
-
- arrowDrawable =
- RoundedArrowDrawable.createVerticalRoundedArrow(
- pointerWidth,
- pointerHeight,
- pointerTipRadius,
- /* isPointingUp= */ true,
- context.getColor(R.color.taskbar_background)
- )
- arrowDrawable.setBounds(0, 0, pointerWidth.toInt(), pointerHeight.toInt())
+ arrowWidth = res.getDimension(R.dimen.bubblebar_pointer_width)
+ arrowHeight = res.getDimension(R.dimen.bubblebar_pointer_height)
+ arrowVisibleHeight = res.getDimension(R.dimen.bubblebar_pointer_visible_size)
+ arrowTipRadius = res.getDimension(R.dimen.bubblebar_pointer_radius)
}
fun showArrow(show: Boolean) {
@@ -115,46 +114,54 @@
// TODO (b/277359345): Should animate the alpha similar to taskbar (see TaskbarDragLayer)
// Draw shadows.
val newShadowAlpha =
- mapToRange(paint.alpha.toFloat(), 0f, 255f, 0f, shadowAlpha, Interpolators.LINEAR)
- paint.setShadowLayer(
+ mapToRange(fillPaint.alpha.toFloat(), 0f, 255f, 0f, shadowAlpha, Interpolators.LINEAR)
+ fillPaint.setShadowLayer(
shadowBlur,
0f,
keyShadowDistance,
setColorAlphaBound(Color.BLACK, Math.round(newShadowAlpha))
)
- arrowDrawable.setShadowLayer(
- shadowBlur,
- 0f,
- keyShadowDistance,
- setColorAlphaBound(Color.BLACK, Math.round(newShadowAlpha))
- )
+ // Create background path
+ val backgroundPath = Path()
+ val topOffset = backgroundHeight - bounds.height().toFloat()
+ val radius = backgroundHeight / 2f
+ val left = bounds.left + (if (anchorLeft) 0f else bounds.width().toFloat() - width)
+ val right = bounds.left + (if (anchorLeft) width else bounds.width().toFloat())
+ val top = bounds.top - topOffset + arrowVisibleHeight
+
+ val bottom = bounds.top + bounds.height().toFloat()
+ backgroundPath.addRoundRect(left, top, right, bottom, radius, radius, Path.Direction.CW)
+ addArrowPathIfNeeded(backgroundPath, topOffset)
// Draw background.
- val radius = backgroundHeight / 2f
- val left = if (anchorLeft) 0f else bounds.width().toFloat() - width
- val right = if (anchorLeft) width else bounds.width().toFloat()
- canvas.drawRoundRect(
- left,
- pointerVisibleHeight,
- right,
- bounds.height().toFloat(),
- radius,
- radius,
- paint
- )
-
- if (showingArrow) {
- // Draw arrow.
- val transX = arrowPositionX - pointerWidth / 2f
- canvas.translate(transX, 0f)
- arrowDrawable.draw(canvas)
- }
-
+ canvas.drawPath(backgroundPath, fillPaint)
+ canvas.drawPath(backgroundPath, strokePaint)
canvas.restore()
}
+ private fun addArrowPathIfNeeded(sourcePath: Path, topOffset: Float) {
+ if (!showingArrow || arrowHeightFraction <= 0) return
+ val arrowPath = Path()
+ RoundedArrowDrawable.addDownPointingRoundedTriangleToPath(
+ arrowWidth,
+ arrowHeight,
+ arrowTipRadius,
+ arrowPath
+ )
+ // flip it horizontally
+ val pathTransform = Matrix()
+ pathTransform.setRotate(180f, arrowWidth * 0.5f, arrowHeight * 0.5f)
+ arrowPath.transform(pathTransform)
+ // shift to arrow position
+ val arrowStart = bounds.left + arrowPositionX - (arrowWidth / 2f)
+ val arrowTop = (1 - arrowHeightFraction) * arrowVisibleHeight - topOffset
+ arrowPath.offset(arrowStart, arrowTop)
+ // union with rectangle
+ sourcePath.op(arrowPath, Path.Op.UNION)
+ }
+
override fun getOpacity(): Int {
- return when (paint.alpha) {
+ return when (fillPaint.alpha) {
255 -> PixelFormat.OPAQUE
0 -> PixelFormat.TRANSPARENT
else -> PixelFormat.TRANSLUCENT
@@ -162,23 +169,40 @@
}
override fun setAlpha(alpha: Int) {
- paint.alpha = alpha
- arrowDrawable.alpha = alpha
+ fillPaint.alpha = alpha
+ invalidateSelf()
}
override fun getAlpha(): Int {
- return paint.alpha
+ return fillPaint.alpha
}
override fun setColorFilter(colorFilter: ColorFilter?) {
- paint.colorFilter = colorFilter
+ fillPaint.colorFilter = colorFilter
}
- fun setArrowAlpha(alpha: Int) {
- arrowDrawable.alpha = alpha
- }
-
- fun setHeight(newHeight: Float) {
+ fun setBackgroundHeight(newHeight: Float) {
backgroundHeight = newHeight
}
+
+ /**
+ * Set fraction of the arrow height that should be displayed. Allowed values range are [0..1].
+ * If value passed is out of range it will be converted to the closest value in tha allowed
+ * range.
+ */
+ fun setArrowHeightFraction(arrowHeightFraction: Float) {
+ var newHeightFraction = arrowHeightFraction
+ if (newHeightFraction !in 0f..1f) {
+ newHeightFraction = min(max(newHeightFraction, 0f), 1f)
+ }
+ this.arrowHeightFraction = newHeightFraction
+ invalidateSelf()
+ }
+
+ companion object {
+ private const val DARK_THEME_STROKE_ALPHA = 51
+ private const val LIGHT_THEME_STROKE_ALPHA = 41
+ private const val DARK_THEME_SHADOW_ALPHA = 51f
+ private const val LIGHT_THEME_SHADOW_ALPHA = 25f
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBubbleIconsFactory.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBubbleIconsFactory.kt
new file mode 100644
index 0000000..4330c5b
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBubbleIconsFactory.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar.bubbles
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.drawable.Drawable
+import com.android.launcher3.icons.BaseIconFactory
+
+/** Bubble icons factory for the bubble bar. */
+class BubbleBarBubbleIconsFactory(context: Context, bubbleSize: Int) :
+ BaseIconFactory(context, context.resources.configuration.densityDpi, bubbleSize) {
+
+ /** Creates shadowed icon for the bubble bar. */
+ fun createShadowedIconBitmap(
+ icon: Drawable,
+ scale: Float,
+ ): Bitmap = super.createIconBitmap(icon, scale, MODE_WITH_SHADOW)
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java
index 66e5302..cdd3e13 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java
@@ -15,13 +15,8 @@
*/
package com.android.launcher3.taskbar.bubbles;
-import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_GET_PERSONS_DATA;
-import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_CACHED;
-import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC;
-import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
-import static com.android.launcher3.icons.FastBitmapDrawable.WHITE_SCRIM_ALPHA;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
@@ -31,46 +26,19 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
-import static java.lang.Math.abs;
-
import android.annotation.BinderThread;
import android.annotation.Nullable;
-import android.app.Notification;
import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.LauncherApps;
-import android.content.pm.PackageManager;
-import android.content.pm.ShortcutInfo;
-import android.content.res.TypedArray;
-import android.graphics.Bitmap;
-import android.graphics.Color;
-import android.graphics.Matrix;
-import android.graphics.Path;
import android.graphics.Point;
-import android.graphics.Rect;
-import android.graphics.drawable.AdaptiveIconDrawable;
-import android.graphics.drawable.ColorDrawable;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.InsetDrawable;
import android.os.Bundle;
import android.os.SystemProperties;
-import android.os.UserHandle;
import android.util.ArrayMap;
import android.util.Log;
-import android.util.PathParser;
-import android.view.LayoutInflater;
-import androidx.appcompat.content.res.AppCompatResources;
-
-import com.android.internal.graphics.ColorUtils;
-import com.android.launcher3.R;
-import com.android.launcher3.icons.BitmapInfo;
-import com.android.launcher3.icons.BubbleIconFactory;
-import com.android.launcher3.shortcuts.ShortcutRequest;
-import com.android.launcher3.taskbar.TaskbarControllers;
-import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
import com.android.launcher3.util.Executors.SimpleThreadFactory;
import com.android.quickstep.SystemUiProxy;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.wm.shell.Flags;
import com.android.wm.shell.bubbles.IBubblesListener;
import com.android.wm.shell.common.bubbles.BubbleBarLocation;
@@ -81,6 +49,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -94,7 +63,7 @@
*/
public class BubbleBarController extends IBubblesListener.Stub {
- private static final String TAG = BubbleBarController.class.getSimpleName();
+ private static final String TAG = "BubbleBarController";
private static final boolean DEBUG = false;
/**
@@ -117,7 +86,7 @@
|| SystemProperties.getBoolean("persist.wm.debug.bubble_bar", false);
}
- private static final int MASK_HIDE_BUBBLE_BAR = SYSUI_STATE_BOUNCER_SHOWING
+ private static final long MASK_HIDE_BUBBLE_BAR = SYSUI_STATE_BOUNCER_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED
| SYSUI_STATE_IME_SHOWING
@@ -125,11 +94,11 @@
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED
| SYSUI_STATE_IME_SWITCHER_SHOWING;
- private static final int MASK_HIDE_HANDLE_VIEW = SYSUI_STATE_BOUNCER_SHOWING
+ private static final long MASK_HIDE_HANDLE_VIEW = SYSUI_STATE_BOUNCER_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
- private static final int MASK_SYSUI_LOCKED = SYSUI_STATE_BOUNCER_SHOWING
+ private static final long MASK_SYSUI_LOCKED = SYSUI_STATE_BOUNCER_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
| SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
@@ -139,20 +108,19 @@
private static final Executor BUBBLE_STATE_EXECUTOR = Executors.newSingleThreadExecutor(
new SimpleThreadFactory("BubbleStateUpdates-", THREAD_PRIORITY_BACKGROUND));
- private final Executor mMainExecutor;
- private final LauncherApps mLauncherApps;
- private final BubbleIconFactory mIconFactory;
private final SystemUiProxy mSystemUiProxy;
private BubbleBarItem mSelectedBubble;
- private BubbleBarOverflow mOverflowBubble;
+ private ImeVisibilityChecker mImeVisibilityChecker;
private BubbleBarViewController mBubbleBarViewController;
private BubbleStashController mBubbleStashController;
- private BubbleStashedHandleViewController mBubbleStashedHandleViewController;
+ private Optional<BubbleStashedHandleViewController> mBubbleStashedHandleViewController;
+ private BubblePinController mBubblePinController;
+ private BubbleCreator mBubbleCreator;
- // Keep track of bubble bar bounds sent to shell to avoid sending duplicate updates
- private final Rect mLastSentBubbleBarBounds = new Rect();
+ // Cache last sent top coordinate to avoid sending duplicate updates to shell
+ private int mLastSentBubbleBarTop;
/**
* Similar to {@link BubbleBarUpdate} but rather than {@link BubbleInfo}s it uses
@@ -169,6 +137,9 @@
BubbleBarLocation bubbleBarLocation;
List<RemovedBubble> removedBubbles;
List<String> bubbleKeysInOrder;
+ Point expandedViewDropTargetSize;
+ boolean showOverflow;
+ boolean showOverflowChanged;
// These need to be loaded in the background
BubbleBarBubble addedBubble;
@@ -186,6 +157,9 @@
bubbleBarLocation = update.bubbleBarLocation;
removedBubbles = update.removedBubbles;
bubbleKeysInOrder = update.bubbleKeysInOrder;
+ expandedViewDropTargetSize = update.expandedViewDropTargetSize;
+ showOverflow = update.showOverflow;
+ showOverflowChanged = update.showOverflowChanged;
}
}
@@ -194,73 +168,51 @@
mBarView = bubbleView; // Need the view for inflating bubble views.
mSystemUiProxy = SystemUiProxy.INSTANCE.get(context);
-
- if (sBubbleBarEnabled) {
- mSystemUiProxy.setBubblesListener(this);
- }
- mMainExecutor = MAIN_EXECUTOR;
- mLauncherApps = context.getSystemService(LauncherApps.class);
- mIconFactory = new BubbleIconFactory(context,
- context.getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size),
- context.getResources().getDimensionPixelSize(R.dimen.bubblebar_badge_size),
- context.getResources().getColor(R.color.important_conversation),
- context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.importance_ring_stroke_width));
}
public void onDestroy() {
mSystemUiProxy.setBubblesListener(null);
}
- public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) {
+ /** Initializes controllers. */
+ public void init(BubbleControllers bubbleControllers,
+ ImeVisibilityChecker imeVisibilityChecker) {
+ mImeVisibilityChecker = imeVisibilityChecker;
mBubbleBarViewController = bubbleControllers.bubbleBarViewController;
mBubbleStashController = bubbleControllers.bubbleStashController;
mBubbleStashedHandleViewController = bubbleControllers.bubbleStashedHandleViewController;
+ mBubblePinController = bubbleControllers.bubblePinController;
+ mBubbleCreator = bubbleControllers.bubbleCreator;
bubbleControllers.runAfterInit(() -> {
mBubbleBarViewController.setHiddenForBubbles(
!sBubbleBarEnabled || mBubbles.isEmpty());
- mBubbleStashedHandleViewController.setHiddenForBubbles(
- !sBubbleBarEnabled || mBubbles.isEmpty());
+ mBubbleStashedHandleViewController.ifPresent(
+ controller -> controller.setHiddenForBubbles(
+ !sBubbleBarEnabled || mBubbles.isEmpty()));
mBubbleBarViewController.setUpdateSelectedBubbleAfterCollapse(
key -> setSelectedBubbleInternal(mBubbles.get(key)));
mBubbleBarViewController.setBoundsChangeListener(this::onBubbleBarBoundsChanged);
- });
- }
- /**
- * Creates and adds the overflow bubble to the bubble bar if it hasn't been created yet.
- *
- * <p>This should be called on the {@link #BUBBLE_STATE_EXECUTOR} executor to avoid inflating
- * the overflow multiple times.
- */
- private void createAndAddOverflowIfNeeded() {
- if (mOverflowBubble == null) {
- BubbleBarOverflow overflow = createOverflow(mContext);
- mMainExecutor.execute(() -> {
- // we're on the main executor now, so check that the overflow hasn't been created
- // again to avoid races.
- if (mOverflowBubble == null) {
- mBubbleBarViewController.addBubble(
- overflow, /* isExpanding= */ false, /* suppressAnimation= */ true);
- mOverflowBubble = overflow;
- }
- });
- }
+ if (sBubbleBarEnabled) {
+ mSystemUiProxy.setBubblesListener(this);
+ }
+ });
}
/**
* Updates the bubble bar, handle bar, and stash controllers based on sysui state flags.
*/
- public void updateStateForSysuiFlags(int flags) {
+ public void updateStateForSysuiFlags(@SystemUiStateFlags long flags) {
boolean hideBubbleBar = (flags & MASK_HIDE_BUBBLE_BAR) != 0;
mBubbleBarViewController.setHiddenForSysui(hideBubbleBar);
boolean hideHandleView = (flags & MASK_HIDE_HANDLE_VIEW) != 0;
- mBubbleStashedHandleViewController.setHiddenForSysui(hideHandleView);
+ mBubbleStashedHandleViewController.ifPresent(
+ controller -> controller.setHiddenForSysui(hideHandleView));
boolean sysuiLocked = (flags & MASK_SYSUI_LOCKED) != 0;
- mBubbleStashController.onSysuiLockedStateChange(sysuiLocked);
+ mBubbleStashController.setSysuiLocked(sysuiLocked);
}
//
@@ -278,33 +230,35 @@
|| !update.currentBubbleList.isEmpty()) {
// We have bubbles to load
BUBBLE_STATE_EXECUTOR.execute(() -> {
- createAndAddOverflowIfNeeded();
if (update.addedBubble != null) {
- viewUpdate.addedBubble = populateBubble(mContext, update.addedBubble, mBarView,
+ viewUpdate.addedBubble = mBubbleCreator.populateBubble(mContext,
+ update.addedBubble,
+ mBarView,
null /* existingBubble */);
}
if (update.updatedBubble != null) {
BubbleBarBubble existingBubble = mBubbles.get(update.updatedBubble.getKey());
viewUpdate.updatedBubble =
- populateBubble(mContext, update.updatedBubble, mBarView,
+ mBubbleCreator.populateBubble(mContext, update.updatedBubble,
+ mBarView,
existingBubble);
}
if (update.currentBubbleList != null && !update.currentBubbleList.isEmpty()) {
List<BubbleBarBubble> currentBubbles = new ArrayList<>();
for (int i = 0; i < update.currentBubbleList.size(); i++) {
- BubbleBarBubble b =
- populateBubble(mContext, update.currentBubbleList.get(i), mBarView,
- null /* existingBubble */);
+ BubbleBarBubble b = mBubbleCreator.populateBubble(mContext,
+ update.currentBubbleList.get(i), mBarView,
+ null /* existingBubble */);
currentBubbles.add(b);
}
viewUpdate.currentBubbles = currentBubbles;
}
- mMainExecutor.execute(() -> applyViewChanges(viewUpdate));
+ MAIN_EXECUTOR.execute(() -> applyViewChanges(viewUpdate));
});
} else {
// No bubbles to load, immediately apply the changes.
BUBBLE_STATE_EXECUTOR.execute(
- () -> mMainExecutor.execute(() -> applyViewChanges(viewUpdate)));
+ () -> MAIN_EXECUTOR.execute(() -> applyViewChanges(viewUpdate)));
}
}
@@ -316,31 +270,74 @@
// enabling gesture nav. also suppress animation if the bubble bar is hidden for sysui e.g.
// the shade is open, or we're locked.
final boolean suppressAnimation =
- update.initialState || mBubbleBarViewController.isHiddenForSysui();
+ update.initialState || mBubbleBarViewController.isHiddenForSysui()
+ || mImeVisibilityChecker.isImeVisible();
- BubbleBarItem previouslySelectedBubble = mSelectedBubble;
BubbleBarBubble bubbleToSelect = null;
- if (!update.removedBubbles.isEmpty()) {
- for (int i = 0; i < update.removedBubbles.size(); i++) {
- RemovedBubble removedBubble = update.removedBubbles.get(i);
- BubbleBarBubble bubble = mBubbles.remove(removedBubble.getKey());
- if (bubble != null) {
- mBubbleBarViewController.removeBubble(bubble);
- } else {
- Log.w(TAG, "trying to remove bubble that doesn't exist: "
- + removedBubble.getKey());
+
+ if (Flags.enableOptionalBubbleOverflow()
+ && update.showOverflowChanged && !update.showOverflow && update.addedBubble != null
+ && update.removedBubbles.isEmpty()) {
+ // A bubble was added from the overflow (& now it's empty / not showing)
+ mBubbles.put(update.addedBubble.getKey(), update.addedBubble);
+ mBubbleBarViewController.removeOverflowAndAddBubble(update.addedBubble);
+ } else if (update.addedBubble != null && update.removedBubbles.size() == 1) {
+ // we're adding and removing a bubble at the same time. handle this as a single update.
+ RemovedBubble removedBubble = update.removedBubbles.get(0);
+ BubbleBarBubble bubbleToRemove = mBubbles.remove(removedBubble.getKey());
+ mBubbles.put(update.addedBubble.getKey(), update.addedBubble);
+ boolean showOverflow = update.showOverflowChanged && update.showOverflow;
+ if (bubbleToRemove != null) {
+ mBubbleBarViewController.addBubbleAndRemoveBubble(update.addedBubble,
+ bubbleToRemove, isExpanding, suppressAnimation, showOverflow);
+ } else {
+ mBubbleBarViewController.addBubble(update.addedBubble, isExpanding,
+ suppressAnimation);
+ Log.w(TAG, "trying to remove bubble that doesn't exist: " + removedBubble.getKey());
+ }
+ } else {
+ boolean overflowNeedsToBeAdded = Flags.enableOptionalBubbleOverflow()
+ && update.showOverflowChanged && update.showOverflow;
+ if (!update.removedBubbles.isEmpty()) {
+ for (int i = 0; i < update.removedBubbles.size(); i++) {
+ RemovedBubble removedBubble = update.removedBubbles.get(i);
+ BubbleBarBubble bubble = mBubbles.remove(removedBubble.getKey());
+ if (bubble != null && overflowNeedsToBeAdded) {
+ // First removal, show the overflow
+ overflowNeedsToBeAdded = false;
+ mBubbleBarViewController.addOverflowAndRemoveBubble(bubble);
+ } else if (bubble != null) {
+ mBubbleBarViewController.removeBubble(bubble);
+ } else {
+ Log.w(TAG, "trying to remove bubble that doesn't exist: "
+ + removedBubble.getKey());
+ }
}
}
- }
- if (update.addedBubble != null) {
- mBubbles.put(update.addedBubble.getKey(), update.addedBubble);
- mBubbleBarViewController.addBubble(update.addedBubble, isExpanding, suppressAnimation);
- if (isCollapsed) {
- // If we're collapsed, the most recently added bubble will be selected.
- bubbleToSelect = update.addedBubble;
+ if (update.addedBubble != null) {
+ mBubbles.put(update.addedBubble.getKey(), update.addedBubble);
+ mBubbleBarViewController.addBubble(update.addedBubble, isExpanding,
+ suppressAnimation);
}
-
+ if (Flags.enableOptionalBubbleOverflow()
+ && update.showOverflowChanged
+ && update.showOverflow != mBubbleBarViewController.isOverflowAdded()) {
+ mBubbleBarViewController.showOverflow(update.showOverflow);
+ }
}
+
+ // if a bubble was updated upstream, but removed before the update was received, add it back
+ if (update.updatedBubble != null && !mBubbles.containsKey(update.updatedBubble.getKey())) {
+ mBubbles.put(update.updatedBubble.getKey(), update.updatedBubble);
+ mBubbleBarViewController.addBubble(
+ update.updatedBubble, isExpanding, suppressAnimation);
+ }
+
+ if (update.addedBubble != null && isCollapsed) {
+ // If we're collapsed, the most recently added bubble will be selected.
+ bubbleToSelect = update.addedBubble;
+ }
+
if (update.currentBubbles != null && !update.currentBubbles.isEmpty()) {
// Iterate in reverse because new bubbles are added in front and the list is in order.
for (int i = update.currentBubbles.size() - 1; i >= 0; i--) {
@@ -358,10 +355,14 @@
}
}
}
+ if (Flags.enableOptionalBubbleOverflow() && update.initialState && update.showOverflow) {
+ mBubbleBarViewController.showOverflow(true);
+ }
// Adds and removals have happened, update visibility before any other visual changes.
mBubbleBarViewController.setHiddenForBubbles(mBubbles.isEmpty());
- mBubbleStashedHandleViewController.setHiddenForBubbles(mBubbles.isEmpty());
+ mBubbleStashedHandleViewController.ifPresent(
+ controller -> controller.setHiddenForBubbles(mBubbles.isEmpty()));
if (mBubbles.isEmpty()) {
// all bubbles were removed. clear the selected bubble
@@ -374,6 +375,8 @@
BubbleBarBubble bb = mBubbles.get(update.updatedBubble.getKey());
// If we're not stashed, we're visible so animate
bb.getView().updateDotVisibility(!mBubbleStashController.isStashed() /* animate */);
+ mBubbleBarViewController.animateBubbleNotification(
+ bb, /* isExpanding= */ false, /* isUpdate= */ true);
}
if (update.bubbleKeysInOrder != null && !update.bubbleKeysInOrder.isEmpty()) {
// Create the new list
@@ -403,9 +406,6 @@
}
if (bubbleToSelect != null) {
setSelectedBubbleInternal(bubbleToSelect);
- if (previouslySelectedBubble == null) {
- mBubbleStashController.animateToInitialState(update.expanded);
- }
}
if (update.shouldShowEducation) {
mBubbleBarViewController.prepareToShowEducation();
@@ -422,23 +422,23 @@
updateBubbleBarLocationInternal(update.bubbleBarLocation);
}
}
+ if (update.expandedViewDropTargetSize != null) {
+ mBubblePinController.setDropTargetSize(update.expandedViewDropTargetSize);
+ }
+ }
+
+ /**
+ * Removes the given bubble from the backing list of bubbles after it was dismissed by the user.
+ */
+ public void onBubbleDismissed(BubbleView bubble) {
+ mBubbles.remove(bubble.getBubble().getKey());
}
/** Tells WMShell to show the currently selected bubble. */
public void showSelectedBubble() {
if (getSelectedBubbleKey() != null) {
- if (mSelectedBubble instanceof BubbleBarBubble) {
- // Because we've visited this bubble, we should suppress the notification.
- // This is updated on WMShell side when we show the bubble, but that update isn't
- // passed to launcher, instead we apply it directly here.
- BubbleInfo info = ((BubbleBarBubble) mSelectedBubble).getInfo();
- info.setFlags(
- info.getFlags() | Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION);
- mSelectedBubble.getView().updateDotVisibility(true /* animate */);
- }
- Rect bounds = getExpandedBubbleBarDisplayBounds();
- mLastSentBubbleBarBounds.set(bounds);
- mSystemUiProxy.showBubble(getSelectedBubbleKey(), bounds);
+ mLastSentBubbleBarTop = mBarView.getRestingTopPositionOnScreen();
+ mSystemUiProxy.showBubble(getSelectedBubbleKey(), mLastSentBubbleBarTop);
} else {
Log.w(TAG, "Trying to show the selected bubble but it's null");
}
@@ -492,174 +492,30 @@
@Override
public void animateBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
- mMainExecutor.execute(
+ MAIN_EXECUTOR.execute(
() -> mBubbleBarViewController.animateBubbleBarLocation(bubbleBarLocation));
}
+ /** Notifies WMShell to show the expanded view. */
+ void showExpandedView() {
+ mSystemUiProxy.showExpandedView();
+ }
+
//
// Loading data for the bubbles
//
- @Nullable
- private BubbleBarBubble populateBubble(Context context, BubbleInfo b, BubbleBarView bbv,
- @Nullable BubbleBarBubble existingBubble) {
- String appName;
- Bitmap badgeBitmap;
- Bitmap bubbleBitmap;
- Path dotPath;
- int dotColor;
-
- boolean isImportantConvo = b.isImportantConversation();
-
- ShortcutRequest.QueryResult result = new ShortcutRequest(context,
- new UserHandle(b.getUserId()))
- .forPackage(b.getPackageName(), b.getShortcutId())
- .query(FLAG_MATCH_DYNAMIC
- | FLAG_MATCH_PINNED_BY_ANY_LAUNCHER
- | FLAG_MATCH_CACHED
- | FLAG_GET_PERSONS_DATA);
-
- ShortcutInfo shortcutInfo = result.size() > 0 ? result.get(0) : null;
- if (shortcutInfo == null) {
- Log.w(TAG, "No shortcutInfo found for bubble: " + b.getKey()
- + " with shortcutId: " + b.getShortcutId());
- }
-
- ApplicationInfo appInfo;
- try {
- appInfo = mLauncherApps.getApplicationInfo(
- b.getPackageName(),
- 0,
- new UserHandle(b.getUserId()));
- } catch (PackageManager.NameNotFoundException e) {
- // If we can't find package... don't think we should show the bubble.
- Log.w(TAG, "Unable to find packageName: " + b.getPackageName());
- return null;
- }
- if (appInfo == null) {
- Log.w(TAG, "Unable to find appInfo: " + b.getPackageName());
- return null;
- }
- PackageManager pm = context.getPackageManager();
- appName = String.valueOf(appInfo.loadLabel(pm));
- Drawable appIcon = appInfo.loadUnbadgedIcon(pm);
- Drawable badgedIcon = pm.getUserBadgedIcon(appIcon, new UserHandle(b.getUserId()));
-
- // Badged bubble image
- Drawable bubbleDrawable = mIconFactory.getBubbleDrawable(context, shortcutInfo,
- b.getIcon());
- if (bubbleDrawable == null) {
- // Default to app icon
- bubbleDrawable = appIcon;
- }
-
- BitmapInfo badgeBitmapInfo = mIconFactory.getBadgeBitmap(badgedIcon, isImportantConvo);
- badgeBitmap = badgeBitmapInfo.icon;
-
- float[] bubbleBitmapScale = new float[1];
- bubbleBitmap = mIconFactory.getBubbleBitmap(bubbleDrawable, bubbleBitmapScale);
-
- // Dot color & placement
- Path iconPath = PathParser.createPathFromPathData(
- context.getResources().getString(
- com.android.internal.R.string.config_icon_mask));
- Matrix matrix = new Matrix();
- float scale = bubbleBitmapScale[0];
- float radius = BubbleView.DEFAULT_PATH_SIZE / 2f;
- matrix.setScale(scale /* x scale */, scale /* y scale */, radius /* pivot x */,
- radius /* pivot y */);
- iconPath.transform(matrix);
- dotPath = iconPath;
- dotColor = ColorUtils.blendARGB(badgeBitmapInfo.color,
- Color.WHITE, WHITE_SCRIM_ALPHA / 255f);
-
- if (existingBubble == null) {
- LayoutInflater inflater = LayoutInflater.from(context);
- BubbleView bubbleView = (BubbleView) inflater.inflate(
- R.layout.bubblebar_item_view, bbv, false /* attachToRoot */);
-
- BubbleBarBubble bubble = new BubbleBarBubble(b, bubbleView,
- badgeBitmap, bubbleBitmap, dotColor, dotPath, appName);
- bubbleView.setBubble(bubble);
- return bubble;
- } else {
- // If we already have a bubble (so it already has an inflated view), update it.
- existingBubble.setInfo(b);
- existingBubble.setBadge(badgeBitmap);
- existingBubble.setIcon(bubbleBitmap);
- existingBubble.setDotColor(dotColor);
- existingBubble.setDotPath(dotPath);
- existingBubble.setAppName(appName);
- return existingBubble;
+ private void onBubbleBarBoundsChanged() {
+ int newTop = mBarView.getRestingTopPositionOnScreen();
+ if (newTop != mLastSentBubbleBarTop) {
+ mLastSentBubbleBarTop = newTop;
+ mSystemUiProxy.updateBubbleBarTopOnScreen(newTop);
}
}
- private BubbleBarOverflow createOverflow(Context context) {
- Bitmap bitmap = createOverflowBitmap(context);
- LayoutInflater inflater = LayoutInflater.from(context);
- BubbleView bubbleView = (BubbleView) inflater.inflate(
- R.layout.bubblebar_item_view, mBarView, false /* attachToRoot */);
- BubbleBarOverflow overflow = new BubbleBarOverflow(bubbleView);
- bubbleView.setOverflow(overflow, bitmap);
- return overflow;
- }
-
- private Bitmap createOverflowBitmap(Context context) {
- Drawable iconDrawable = AppCompatResources.getDrawable(mContext,
- R.drawable.bubble_ic_overflow_button);
-
- final TypedArray ta = mContext.obtainStyledAttributes(
- new int[]{
- com.android.internal.R.attr.materialColorOnPrimaryFixed,
- com.android.internal.R.attr.materialColorPrimaryFixed
- });
- int overflowIconColor = ta.getColor(0, Color.WHITE);
- int overflowBackgroundColor = ta.getColor(1, Color.BLACK);
- ta.recycle();
-
- iconDrawable.setTint(overflowIconColor);
-
- int inset = context.getResources().getDimensionPixelSize(R.dimen.bubblebar_overflow_inset);
- Drawable foreground = new InsetDrawable(iconDrawable, inset);
- Drawable drawable = new AdaptiveIconDrawable(new ColorDrawable(overflowBackgroundColor),
- foreground);
-
- return mIconFactory.createBadgedIconBitmap(drawable).icon;
- }
-
- private void onBubbleBarBoundsChanged(Rect newBounds) {
- Rect displayBounds = convertToDisplayBounds(newBounds);
- // Only send bounds over if they changed
- if (!displayBounds.equals(mLastSentBubbleBarBounds)) {
- mLastSentBubbleBarBounds.set(displayBounds);
- mSystemUiProxy.setBubbleBarBounds(displayBounds);
- }
- }
-
- /**
- * Get bounds of the bubble bar as if it would be expanded.
- * Calculates the bounds instead of retrieving current view location as the view may be
- * animating.
- */
- private Rect getExpandedBubbleBarDisplayBounds() {
- return convertToDisplayBounds(mBarView.getBubbleBarBounds());
- }
-
- private Rect convertToDisplayBounds(Rect currentBarBounds) {
- Point displaySize = DisplayController.INSTANCE.get(mContext).getInfo().currentSize;
- Rect displayBounds = new Rect();
- // currentBarBounds is only useful for distance from left or right edge.
- // It contains the current bounds, calculate the expanded bounds.
- if (mBarView.getBubbleBarLocation().isOnLeft(mBarView.isLayoutRtl())) {
- displayBounds.left = currentBarBounds.left;
- displayBounds.right = (int) (currentBarBounds.left + mBarView.expandedWidth());
- } else {
- displayBounds.left = (int) (currentBarBounds.right - mBarView.expandedWidth());
- displayBounds.right = currentBarBounds.right;
- }
- final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY());
- displayBounds.top = displaySize.y - currentBarBounds.height() - translation;
- displayBounds.bottom = displaySize.y - translation;
- return displayBounds;
+ /** Interface for checking whether the IME is visible. */
+ public interface ImeVisibilityChecker {
+ /** Whether the IME is visible. */
+ boolean isImeVisible();
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt
index 43e21f4..39d1ed7 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarItem.kt
@@ -34,4 +34,8 @@
) : BubbleBarItem(info.key, view)
/** Represents the overflow bubble in the bubble bar. */
-data class BubbleBarOverflow(override var view: BubbleView) : BubbleBarItem("Overflow", view)
+data class BubbleBarOverflow(override var view: BubbleView) : BubbleBarItem(KEY, view) {
+ companion object {
+ const val KEY = "Overflow"
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarPinController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarPinController.kt
index 9e5ffc9..a6b0860 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarPinController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarPinController.kt
@@ -27,6 +27,7 @@
import android.widget.FrameLayout
import androidx.core.view.updateLayoutParams
import com.android.launcher3.R
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController
import com.android.wm.shell.common.bubbles.BaseBubblePinController
import com.android.wm.shell.common.bubbles.BubbleBarLocation
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
index 60e8abe..c458936 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
@@ -16,6 +16,7 @@
package com.android.launcher3.taskbar.bubbles;
import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE;
+import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import android.animation.Animator;
@@ -23,26 +24,34 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.os.Bundle;
import android.util.AttributeSet;
+import android.util.FloatProperty;
import android.util.LayoutDirection;
import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;
import androidx.dynamicanimation.animation.SpringForce;
import com.android.launcher3.R;
import com.android.launcher3.anim.SpringAnimationBuilder;
+import com.android.launcher3.taskbar.bubbles.animation.BubbleAnimator;
+import com.android.launcher3.util.DisplayController;
import com.android.wm.shell.common.bubbles.BubbleBarLocation;
+import java.io.PrintWriter;
+import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@@ -74,13 +83,15 @@
*/
public class BubbleBarView extends FrameLayout {
- private static final String TAG = BubbleBarView.class.getSimpleName();
+ private static final String TAG = "BubbleBarView";
// TODO: (b/273594744) calculate the amount of space we have and base the max on that
// if it's smaller than 5.
private static final int MAX_BUBBLES = 5;
+ private static final int MAX_VISIBLE_BUBBLES_COLLAPSED = 2;
private static final int ARROW_POSITION_ANIMATION_DURATION_MS = 200;
private static final int WIDTH_ANIMATION_DURATION_MS = 200;
+ private static final int SCALE_ANIMATION_DURATION_MS = 200;
private static final long FADE_OUT_ANIM_ALPHA_DURATION_MS = 50L;
private static final long FADE_OUT_ANIM_ALPHA_DELAY_MS = 50L;
@@ -94,9 +105,24 @@
// During fade in animation we shift the bubble bar 1/60th of the screen width
private static final float FADE_IN_ANIM_POSITION_SHIFT = 1 / 60f;
- private final BubbleBarBackground mBubbleBarBackground;
+ /**
+ * Custom property to set alpha value for the bar view while a bubble is being dragged.
+ * Skips applying alpha to the dragged bubble.
+ */
+ private static final FloatProperty<BubbleBarView> BUBBLE_DRAG_ALPHA =
+ new FloatProperty<>("bubbleDragAlpha") {
+ @Override
+ public void setValue(BubbleBarView bubbleBarView, float alpha) {
+ bubbleBarView.setAlphaDuringBubbleDrag(alpha);
+ }
- private boolean mIsAnimatingNewBubble = false;
+ @Override
+ public Float get(BubbleBarView bubbleBarView) {
+ return bubbleBarView.mAlphaDuringDrag;
+ }
+ };
+
+ private final BubbleBarBackground mBubbleBarBackground;
/**
* The current bounds of all the bubble bar. Note that these bounds may not account for
@@ -112,11 +138,12 @@
private float mBubbleBarPadding;
// The size of a bubble in the bar
private float mIconSize;
+ // The scale of bubble icons
+ private float mIconScale = 1f;
// The elevation of the bubbles within the bar
private final float mBubbleElevation;
private final float mDragElevation;
private final int mPointerSize;
-
// Whether the bar is expanded (i.e. the bubble activity is being displayed).
private boolean mIsBarExpanded = false;
// The currently selected bubble view.
@@ -134,6 +161,12 @@
// collapsed state and 1 to the fully expanded state.
private final ValueAnimator mWidthAnimator = ValueAnimator.ofFloat(0, 1);
+ /** An animator used for animating individual bubbles in the bubble bar while expanded. */
+ @Nullable
+ private BubbleAnimator mBubbleAnimator = null;
+ @Nullable
+ private ValueAnimator mScalePaddingAnimator;
+
@Nullable
private Animator mBubbleBarLocationAnimator = null;
@@ -150,6 +183,11 @@
@Nullable
private BubbleView mDraggedBubbleView;
+ @Nullable
+ private BubbleView mDismissedByDragBubbleView;
+ private float mAlphaDuringDrag = 1f;
+
+ private Controller mController;
private int mPreviousLayoutDirection = LayoutDirection.UNDEFINED;
@@ -185,67 +223,120 @@
setBackgroundDrawable(mBubbleBarBackground);
mWidthAnimator.setDuration(WIDTH_ANIMATION_DURATION_MS);
- mWidthAnimator.addUpdateListener(animation -> {
- updateChildrenRenderNodeProperties(mBubbleBarLocation);
- invalidate();
- });
- mWidthAnimator.addListener(new Animator.AnimatorListener() {
- @Override
- public void onAnimationCancel(Animator animation) {
- }
- @Override
- public void onAnimationEnd(Animator animation) {
- mBubbleBarBackground.showArrow(mIsBarExpanded);
- if (!mIsBarExpanded && mReorderRunnable != null) {
- mReorderRunnable.run();
- mReorderRunnable = null;
- }
- // If the bar was just collapsed and the overflow was the last bubble that was
- // selected, set the first bubble as selected.
- if (!mIsBarExpanded && mUpdateSelectedBubbleAfterCollapse != null
- && mSelectedBubbleView != null
- && mSelectedBubbleView.getBubble() instanceof BubbleBarOverflow) {
- BubbleView firstBubble = (BubbleView) getChildAt(0);
- mUpdateSelectedBubbleAfterCollapse.accept(firstBubble.getBubble().getKey());
- }
- updateWidth();
- }
+ addAnimationCallBacks(mWidthAnimator,
+ /* onStart= */ () -> mBubbleBarBackground.showArrow(true),
+ /* onEnd= */ () -> {
+ mBubbleBarBackground.showArrow(mIsBarExpanded);
+ if (!mIsBarExpanded && mReorderRunnable != null) {
+ mReorderRunnable.run();
+ mReorderRunnable = null;
+ }
+ // If the bar was just collapsed and the overflow was the last bubble that was
+ // selected, set the first bubble as selected.
+ if (!mIsBarExpanded && mUpdateSelectedBubbleAfterCollapse != null
+ && mSelectedBubbleView != null
+ && mSelectedBubbleView.getBubble() instanceof BubbleBarOverflow) {
+ BubbleView firstBubble = (BubbleView) getChildAt(0);
+ mUpdateSelectedBubbleAfterCollapse.accept(firstBubble.getBubble().getKey());
+ }
+ // If the bar was just expanded, remove the dot from the selected bubble.
+ if (mIsBarExpanded && mSelectedBubbleView != null) {
+ mSelectedBubbleView.markSeen();
+ }
+ updateLayoutParams();
+ },
+ /* onUpdate= */ animator -> {
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ invalidate();
+ });
+ }
- @Override
- public void onAnimationRepeat(Animator animation) {
- }
- @Override
- public void onAnimationStart(Animator animation) {
- mBubbleBarBackground.showArrow(true);
- }
- });
+ /**
+ * Animates icon sizes and spacing between icons and bubble bar borders.
+ *
+ * @param newIconSize new icon size
+ * @param newBubbleBarPadding spacing between icons and bubble bar borders.
+ */
+ public void animateBubbleBarIconSize(float newIconSize, float newBubbleBarPadding) {
+ if (!isIconSizeOrPaddingUpdated(newIconSize, newBubbleBarPadding)) {
+ return;
+ }
+ if (mScalePaddingAnimator != null && mScalePaddingAnimator.isRunning()) {
+ mScalePaddingAnimator.cancel();
+ }
+ ValueAnimator scalePaddingAnimator = ValueAnimator.ofFloat(0f, 1f);
+ scalePaddingAnimator.setDuration(SCALE_ANIMATION_DURATION_MS);
+ boolean isPaddingUpdated = isPaddingUpdated(newBubbleBarPadding);
+ boolean isIconSizeUpdated = isIconSizeUpdated(newIconSize);
+ float initialScale = mIconScale;
+ float initialPadding = mBubbleBarPadding;
+ float targetScale = newIconSize / getScaledIconSize();
+
+ addAnimationCallBacks(scalePaddingAnimator,
+ /* onStart= */ null,
+ /* onEnd= */ () -> setIconSizeAndPadding(newIconSize, newBubbleBarPadding),
+ /* onUpdate= */ animator -> {
+ float transitionProgress = (float) animator.getAnimatedValue();
+ if (isIconSizeUpdated) {
+ mIconScale =
+ initialScale + (targetScale - initialScale) * transitionProgress;
+ }
+ if (isPaddingUpdated) {
+ mBubbleBarPadding = initialPadding
+ + (newBubbleBarPadding - initialPadding) * transitionProgress;
+ }
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ invalidate();
+ });
+ scalePaddingAnimator.start();
+ mScalePaddingAnimator = scalePaddingAnimator;
+ }
+
+ @Override
+ public void setTranslationX(float translationX) {
+ super.setTranslationX(translationX);
+ if (mDraggedBubbleView != null) {
+ // Apply reverse of the translation as an offset to the dragged view. This ensures
+ // that the dragged bubble stays at the current location on the screen and its
+ // position is not affected by the parent translation.
+ mDraggedBubbleView.setOffsetX(-translationX);
+ }
}
/**
- * Sets new icon size and spacing between icons and bubble bar borders.
+ * Sets new icon sizes and newBubbleBarPadding between icons and bubble bar borders.
*
- * @param newIconSize new icon size
- * @param spacing spacing between icons and bubble bar borders.
+ * @param newIconSize new icon size
+ * @param newBubbleBarPadding newBubbleBarPadding between icons and bubble bar borders.
*/
- // TODO(b/335575529): animate bubble bar icons size change
- public void setIconSizeAndPadding(float newIconSize, float spacing) {
+ public void setIconSizeAndPadding(float newIconSize, float newBubbleBarPadding) {
// TODO(b/335457839): handle new bubble animation during the size change
- mBubbleBarPadding = spacing;
+ if (!isIconSizeOrPaddingUpdated(newIconSize, newBubbleBarPadding)) {
+ return;
+ }
+ mIconScale = 1f;
+ mBubbleBarPadding = newBubbleBarPadding;
mIconSize = newIconSize;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View childView = getChildAt(i);
+ childView.setScaleY(mIconScale);
+ childView.setScaleY(mIconScale);
FrameLayout.LayoutParams params = (LayoutParams) childView.getLayoutParams();
params.height = (int) mIconSize;
params.width = (int) mIconSize;
childView.setLayoutParams(params);
}
- mBubbleBarBackground.setHeight(getBubbleBarExpandedHeight());
+ mBubbleBarBackground.setBackgroundHeight(getBubbleBarHeight());
updateLayoutParams();
}
+ private float getScaledIconSize() {
+ return mIconSize * mIconScale;
+ }
+
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
@@ -259,8 +350,10 @@
setPivotX(mRelativePivotX * getWidth());
setPivotY(mRelativePivotY * getHeight());
- // Position the views
- updateChildrenRenderNodeProperties(mBubbleBarLocation);
+ if (!mDragging) {
+ // Position the views when not dragging
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ }
}
@Override
@@ -274,16 +367,56 @@
}
}
+ @Override
+ public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
+ super.onInitializeAccessibilityNodeInfoInternal(info);
+ // Always show only expand action as the menu is only for collapsed bubble bar
+ info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND);
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_dismiss_all,
+ getResources().getString(R.string.bubble_bar_action_dismiss_all)));
+ if (mBubbleBarLocation.isOnLeft(isLayoutRtl())) {
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_move_right,
+ getResources().getString(R.string.bubble_bar_action_move_right)));
+ } else {
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_move_left,
+ getResources().getString(R.string.bubble_bar_action_move_left)));
+ }
+ }
+
+ @Override
+ public boolean performAccessibilityActionInternal(int action,
+ @androidx.annotation.Nullable Bundle arguments) {
+ if (super.performAccessibilityActionInternal(action, arguments)) {
+ return true;
+ }
+ if (action == AccessibilityNodeInfo.ACTION_EXPAND) {
+ mController.expandBubbleBar();
+ return true;
+ }
+ if (action == R.id.action_dismiss_all) {
+ mController.dismissBubbleBar();
+ return true;
+ }
+ if (action == R.id.action_move_left) {
+ mController.updateBubbleBarLocation(BubbleBarLocation.LEFT);
+ return true;
+ }
+ if (action == R.id.action_move_right) {
+ mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT);
+ return true;
+ }
+ return false;
+ }
+
@SuppressLint("RtlHardcoded")
private void onBubbleBarLocationChanged() {
final boolean onLeft = mBubbleBarLocation.isOnLeft(isLayoutRtl());
mBubbleBarBackground.setAnchorLeft(onLeft);
mRelativePivotX = onLeft ? 0f : 1f;
- if (getLayoutParams() instanceof LayoutParams lp) {
- lp.gravity = Gravity.BOTTOM | (onLeft ? Gravity.LEFT : Gravity.RIGHT);
- setLayoutParams(lp);
- }
- invalidate();
+ LayoutParams lp = (LayoutParams) getLayoutParams();
+ lp.gravity = Gravity.BOTTOM | (onLeft ? Gravity.LEFT : Gravity.RIGHT);
+ setLayoutParams(lp); // triggers a relayout
+ updateBubbleAccessibilityStates();
}
/**
@@ -297,22 +430,15 @@
* Update {@link BubbleBarLocation}
*/
public void setBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
- if (mBubbleBarLocationAnimator != null) {
- mBubbleBarLocationAnimator.removeAllListeners();
- mBubbleBarLocationAnimator.cancel();
- mBubbleBarLocationAnimator = null;
- }
- setTranslationX(0f);
- setAlpha(1f);
+ resetDragAnimation();
if (bubbleBarLocation != mBubbleBarLocation) {
mBubbleBarLocation = bubbleBarLocation;
onBubbleBarLocationChanged();
- invalidate();
}
}
/**
- * Set whether this view is being currently being dragged
+ * Set whether this view is currently being dragged
*/
public void setIsDragging(boolean dragging) {
if (mDragging == dragging) {
@@ -320,13 +446,17 @@
}
mDragging = dragging;
setElevation(dragging ? mDragElevation : mBubbleElevation);
+ if (!mDragging) {
+ // Relayout after dragging to ensure that the dragged bubble is positioned correctly
+ requestLayout();
+ }
}
/**
* Get translation for bubble bar when drag is released and it needs to animate back to the
* resting position.
* Resting position is based on the supplied location. If the supplied location is different
- * from the internal location that was used to lay out the bubble bar, translation values are
+ * from the internal location that was used during bubble bar layout, translation values are
* calculated to position the bar at the desired location.
*
* @param initialTranslation initial bubble bar translation at the start of drag
@@ -335,22 +465,50 @@
*/
public PointF getBubbleBarDragReleaseTranslation(PointF initialTranslation,
BubbleBarLocation location) {
- // Start with the initial translation. Value on y-axis can be reused.
- final PointF dragEndTranslation = new PointF(initialTranslation);
- // Bubble bar is laid out on left or right side of the screen. And the desired new
- // location is on the other side. Calculate x translation value required to shift
- // bubble bar from one side to the other.
- final float shift = getDistanceFromOtherSide();
- if (location.isOnLeft(isLayoutRtl())) {
- // New location is on the left, shift left
- // before -> |......ooo.| after -> |.ooo......|
- dragEndTranslation.x = -shift;
- } else {
- // New location is on the right, shift right
- // before -> |.ooo......| after -> |......ooo.|
- dragEndTranslation.x = shift;
+ float dragEndTranslationX = initialTranslation.x;
+ if (getBubbleBarLocation().isOnLeft(isLayoutRtl()) != location.isOnLeft(isLayoutRtl())) {
+ // Bubble bar is laid out on left or right side of the screen. And the desired new
+ // location is on the other side. Calculate x translation value required to shift
+ // bubble bar from one side to the other.
+ final float shift = getDistanceFromOtherSide();
+ if (location.isOnLeft(isLayoutRtl())) {
+ // New location is on the left, shift left
+ // before -> |......ooo.| after -> |.ooo......|
+ dragEndTranslationX = -shift;
+ } else {
+ // New location is on the right, shift right
+ // before -> |.ooo......| after -> |......ooo.|
+ dragEndTranslationX = shift;
+ }
}
- return dragEndTranslation;
+ return new PointF(dragEndTranslationX, mController.getBubbleBarTranslationY());
+ }
+
+ /**
+ * Get translation for a bubble when drag is released and it needs to animate back to the
+ * resting position.
+ * Resting position is based on the supplied location. If the supplied location is different
+ * from the internal location that was used during bubble bar layout, translation values are
+ * calculated to position the bar at the desired location.
+ *
+ * @param initialTranslation initial bubble translation inside the bar at the start of drag
+ * @param location desired location of the bubble bar when drag is released
+ * @return point with x and y values representing translation on x and y-axis
+ */
+ public PointF getDraggedBubbleReleaseTranslation(PointF initialTranslation,
+ BubbleBarLocation location) {
+ float dragEndTranslationX = initialTranslation.x;
+ boolean newLocationOnLeft = location.isOnLeft(isLayoutRtl());
+ if (getBubbleBarLocation().isOnLeft(isLayoutRtl()) != newLocationOnLeft) {
+ // Calculate translationX based on bar and bubble translations
+ float bubbleBarTx = getBubbleBarDragReleaseTranslation(initialTranslation, location).x;
+ float bubbleTx =
+ getExpandedBubbleTranslationX(
+ indexOfChild(mDraggedBubbleView), getChildCount(), newLocationOnLeft);
+ dragEndTranslationX = bubbleBarTx + bubbleTx;
+ }
+ // translationY does not change during drag and can be reused
+ return new PointF(dragEndTranslationX, initialTranslation.y);
}
private float getDistanceFromOtherSide() {
@@ -382,7 +540,7 @@
mBubbleBarLocationAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- updateChildrenRenderNodeProperties(bubbleBarLocation);
+ updateBubblesLayoutProperties(bubbleBarLocation);
mBubbleBarBackground.setAnchorLeft(bubbleBarLocation.isOnLeft(isLayoutRtl()));
// Animate it in
@@ -393,17 +551,17 @@
mBubbleBarLocationAnimator.start();
}
- private Animator getLocationUpdateFadeOutAnimator(BubbleBarLocation bubbleBarLocation) {
+ private Animator getLocationUpdateFadeOutAnimator(BubbleBarLocation newLocation) {
final float shift =
getResources().getDisplayMetrics().widthPixels * FADE_OUT_ANIM_POSITION_SHIFT;
- final boolean onLeft = bubbleBarLocation.isOnLeft(isLayoutRtl());
- final float tx = getTranslationX() + (onLeft ? shift : -shift);
+ final boolean onLeft = newLocation.isOnLeft(isLayoutRtl());
+ final float tx = getTranslationX() + (onLeft ? -shift : shift);
- ObjectAnimator positionAnim = ObjectAnimator.ofFloat(this, TRANSLATION_X, tx)
+ ObjectAnimator positionAnim = ObjectAnimator.ofFloat(this, VIEW_TRANSLATE_X, tx)
.setDuration(FADE_OUT_ANIM_POSITION_DURATION_MS);
positionAnim.setInterpolator(EMPHASIZED_ACCELERATE);
- ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(this, ALPHA, 0f)
+ ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(this, getLocationAnimAlphaProperty(), 0f)
.setDuration(FADE_OUT_ANIM_ALPHA_DURATION_MS);
alphaAnim.setStartDelay(FADE_OUT_ANIM_ALPHA_DELAY_MS);
@@ -412,14 +570,14 @@
return animatorSet;
}
- private Animator getLocationUpdateFadeInAnimator(BubbleBarLocation animatedLocation) {
+ private Animator getLocationUpdateFadeInAnimator(BubbleBarLocation newLocation) {
final float shift =
getResources().getDisplayMetrics().widthPixels * FADE_IN_ANIM_POSITION_SHIFT;
- final boolean onLeft = animatedLocation.isOnLeft(isLayoutRtl());
+ final boolean onLeft = newLocation.isOnLeft(isLayoutRtl());
final float startTx;
final float finalTx;
- if (animatedLocation == mBubbleBarLocation) {
+ if (newLocation == mBubbleBarLocation) {
// Animated location matches layout location.
finalTx = 0;
} else {
@@ -441,7 +599,7 @@
.setStiffness(FADE_IN_ANIM_POSITION_SPRING_STIFFNESS)
.build(this, VIEW_TRANSLATE_X);
- ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(this, ALPHA, 1f)
+ ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(this, getLocationAnimAlphaProperty(), 1f)
.setDuration(FADE_IN_ANIM_ALPHA_DURATION_MS);
AnimatorSet animatorSet = new AnimatorSet();
@@ -450,17 +608,84 @@
}
/**
- * Updates the bounds with translation that may have been applied and returns the result.
+ * Get property that can be used to animate the alpha value for the bar.
+ * When a bubble is being dragged, uses {@link #BUBBLE_DRAG_ALPHA}.
+ * Falls back to {@link com.android.launcher3.LauncherAnimUtils#VIEW_ALPHA} otherwise.
*/
+ private FloatProperty<? super BubbleBarView> getLocationAnimAlphaProperty() {
+ return mDraggedBubbleView == null ? VIEW_ALPHA : BUBBLE_DRAG_ALPHA;
+ }
+
+ /**
+ * Set alpha value for the bar while a bubble is being dragged.
+ * We can not update the alpha on the bar directly because the dragged bubble would be affected
+ * as well. As it is a child view.
+ * Instead, while a bubble is being dragged, set alpha on each child view, that is not the
+ * dragged view. And set an alpha on the background.
+ * This allows for the dragged bubble to remain visible while the bar is hidden during
+ * animation.
+ */
+ private void setAlphaDuringBubbleDrag(float alpha) {
+ mAlphaDuringDrag = alpha;
+ final int childCount = getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ View view = getChildAt(i);
+ if (view != mDraggedBubbleView) {
+ view.setAlpha(alpha);
+ }
+ }
+ if (mBubbleBarBackground != null) {
+ mBubbleBarBackground.setAlpha((int) (255 * alpha));
+ }
+ }
+
+ private void resetDragAnimation() {
+ if (mBubbleBarLocationAnimator != null) {
+ mBubbleBarLocationAnimator.removeAllListeners();
+ mBubbleBarLocationAnimator.cancel();
+ mBubbleBarLocationAnimator = null;
+ }
+ setAlphaDuringBubbleDrag(1f);
+ setTranslationX(0f);
+ if (getBubbleChildCount() > 0) {
+ setAlpha(1f);
+ }
+ }
+
+ /**
+ * Get bubble bar top coordinate on screen when bar is resting
+ */
+ public int getRestingTopPositionOnScreen() {
+ int displayHeight = DisplayController.INSTANCE.get(getContext()).getInfo().currentSize.y;
+ int bubbleBarHeight = getBubbleBarBounds().height();
+ return displayHeight - bubbleBarHeight + (int) mController.getBubbleBarTranslationY();
+ }
+
+ /** Returns the bounds with translation that may have been applied. */
public Rect getBubbleBarBounds() {
- mBubbleBarBounds.top = getTop() + (int) getTranslationY() + mPointerSize;
- mBubbleBarBounds.bottom = getBottom() + (int) getTranslationY();
- return mBubbleBarBounds;
+ Rect bounds = new Rect(mBubbleBarBounds);
+ bounds.top = getTop() + (int) getTranslationY() + mPointerSize;
+ bounds.bottom = getBottom() + (int) getTranslationY();
+ return bounds;
+ }
+
+ /** Returns the expanded bounds with translation that may have been applied. */
+ public Rect getBubbleBarExpandedBounds() {
+ Rect expandedBounds = getBubbleBarBounds();
+ if (!isExpanded() || isExpanding()) {
+ if (mBubbleBarLocation.isOnLeft(isLayoutRtl())) {
+ expandedBounds.right = expandedBounds.left + (int) expandedWidth();
+ } else {
+ expandedBounds.left = expandedBounds.right - (int) expandedWidth();
+ }
+ }
+ return expandedBounds;
}
/**
* Set bubble bar relative pivot value for X and Y, applied as a fraction of view width/height
* respectively. If the value is not in range of 0 to 1 it will be normalized.
+ *
* @param x relative X pivot value in range 0..1
* @param y relative Y pivot value in range 0..1
*/
@@ -489,26 +714,169 @@
return mRelativePivotY;
}
- /** Notifies the bubble bar that a new bubble animation is starting. */
- public void onAnimatingBubbleStarted() {
- mIsAnimatingNewBubble = true;
+ /** Add a new bubble to the bubble bar. */
+ public void addBubble(BubbleView bubble) {
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams((int) mIconSize, (int) mIconSize,
+ Gravity.LEFT);
+ final int index = bubble.isOverflow() ? getChildCount() : 0;
+
+ if (isExpanded()) {
+ // if we're expanded scale the new bubble in
+ bubble.setScaleX(0f);
+ bubble.setScaleY(0f);
+ addView(bubble, index, lp);
+ bubble.showDotIfNeeded(/* animate= */ false);
+
+ mBubbleAnimator = new BubbleAnimator(mIconSize, mExpandedBarIconsSpacing,
+ getChildCount(), mBubbleBarLocation.isOnLeft(isLayoutRtl()));
+ BubbleAnimator.Listener listener = new BubbleAnimator.Listener() {
+
+ @Override
+ public void onAnimationEnd() {
+ updateLayoutParams();
+ mBubbleAnimator = null;
+ }
+
+ @Override
+ public void onAnimationCancel() {
+ bubble.setScaleX(1);
+ bubble.setScaleY(1);
+ }
+
+ @Override
+ public void onAnimationUpdate(float animatedFraction) {
+ bubble.setScaleX(animatedFraction);
+ bubble.setScaleY(animatedFraction);
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ invalidate();
+ }
+ };
+ mBubbleAnimator.animateNewBubble(indexOfChild(mSelectedBubbleView), listener);
+ } else {
+ addView(bubble, index, lp);
+ }
}
- /** Notifies the bubble bar that a new bubble animation is complete. */
- public void onAnimatingBubbleCompleted() {
- mIsAnimatingNewBubble = false;
+ /** Add a new bubble and remove an old bubble from the bubble bar. */
+ public void addBubbleAndRemoveBubble(BubbleView addedBubble, BubbleView removedBubble,
+ Runnable onEndRunnable) {
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams((int) mIconSize, (int) mIconSize,
+ Gravity.LEFT);
+ boolean isOverflowSelected = mSelectedBubbleView.isOverflow();
+ boolean removingOverflow = removedBubble.isOverflow();
+ boolean addingOverflow = addedBubble.isOverflow();
+
+ if (!isExpanded()) {
+ removeView(removedBubble);
+ int index = addingOverflow ? getChildCount() : 0;
+ addView(addedBubble, index, lp);
+ return;
+ }
+ int index = addingOverflow ? getChildCount() : 0;
+ addedBubble.setScaleX(0f);
+ addedBubble.setScaleY(0f);
+ addView(addedBubble, index, lp);
+
+ if (isOverflowSelected && removingOverflow) {
+ // The added bubble will be selected
+ mSelectedBubbleView = addedBubble;
+ }
+ int indexOfSelectedBubble = indexOfChild(mSelectedBubbleView);
+ int indexOfBubbleToRemove = indexOfChild(removedBubble);
+
+ mBubbleAnimator = new BubbleAnimator(mIconSize, mExpandedBarIconsSpacing,
+ getChildCount(), mBubbleBarLocation.isOnLeft(isLayoutRtl()));
+ BubbleAnimator.Listener listener = new BubbleAnimator.Listener() {
+
+ @Override
+ public void onAnimationEnd() {
+ removeView(removedBubble);
+ updateLayoutParams();
+ mBubbleAnimator = null;
+ if (onEndRunnable != null) {
+ onEndRunnable.run();
+ }
+ }
+
+ @Override
+ public void onAnimationCancel() {
+ addedBubble.setScaleX(1);
+ addedBubble.setScaleY(1);
+ removedBubble.setScaleX(0);
+ removedBubble.setScaleY(0);
+ }
+
+ @Override
+ public void onAnimationUpdate(float animatedFraction) {
+ addedBubble.setScaleX(animatedFraction);
+ addedBubble.setScaleY(animatedFraction);
+ removedBubble.setScaleX(1 - animatedFraction);
+ removedBubble.setScaleY(1 - animatedFraction);
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ invalidate();
+ }
+ };
+ mBubbleAnimator.animateNewAndRemoveOld(indexOfSelectedBubble, indexOfBubbleToRemove,
+ listener);
}
- // TODO: (b/280605790) animate it
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
- if (getChildCount() + 1 > MAX_BUBBLES) {
- // the last child view is the overflow bubble and we shouldn't remove that. remove the
- // second to last child view.
- removeViewInLayout(getChildAt(getChildCount() - 2));
- }
super.addView(child, index, params);
- updateWidth();
+ updateLayoutParams();
+ updateBubbleAccessibilityStates();
+ updateContentDescription();
+ }
+
+ /** Removes the given bubble from the bubble bar. */
+ public void removeBubble(View bubble) {
+ if (isExpanded()) {
+ // TODO b/347062801 - animate the bubble bar if the last bubble is removed
+ final boolean dismissedByDrag = mDraggedBubbleView == bubble;
+ if (dismissedByDrag) {
+ mDismissedByDragBubbleView = mDraggedBubbleView;
+ }
+ int bubbleCount = getChildCount();
+ mBubbleAnimator = new BubbleAnimator(mIconSize, mExpandedBarIconsSpacing,
+ bubbleCount, mBubbleBarLocation.isOnLeft(isLayoutRtl()));
+ BubbleAnimator.Listener listener = new BubbleAnimator.Listener() {
+
+ @Override
+ public void onAnimationEnd() {
+ removeView(bubble);
+ mBubbleAnimator = null;
+ }
+
+ @Override
+ public void onAnimationCancel() {
+ bubble.setScaleX(0);
+ bubble.setScaleY(0);
+ }
+
+ @Override
+ public void onAnimationUpdate(float animatedFraction) {
+ // don't update the scale if this bubble was dismissed by drag
+ if (!dismissedByDrag) {
+ bubble.setScaleX(1 - animatedFraction);
+ bubble.setScaleY(1 - animatedFraction);
+ }
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ invalidate();
+ }
+ };
+ int bubbleIndex = indexOfChild(bubble);
+ BubbleView lastBubble = (BubbleView) getChildAt(bubbleCount - 1);
+ String lastBubbleKey = lastBubble.getBubble().getKey();
+ boolean removingLastBubble =
+ BubbleBarOverflow.KEY.equals(lastBubbleKey)
+ ? bubbleIndex == bubbleCount - 2
+ : bubbleIndex == bubbleCount - 1;
+ mBubbleAnimator.animateRemovedBubble(
+ indexOfChild(bubble), indexOfChild(mSelectedBubbleView), removingLastBubble,
+ listener);
+ } else {
+ removeView(bubble);
+ }
}
// TODO: (b/283309949) animate it
@@ -519,13 +887,54 @@
mSelectedBubbleView = null;
mBubbleBarBackground.showArrow(false);
}
- updateWidth();
+ updateLayoutParams();
+ updateBubbleAccessibilityStates();
+ updateContentDescription();
+ mDismissedByDragBubbleView = null;
+ updateNotificationDotsIfCollapsed();
}
- private void updateWidth() {
- LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
- lp.width = (int) (mIsBarExpanded ? expandedWidth() : collapsedWidth());
- setLayoutParams(lp);
+ /**
+ * Return child views in the order which they are shown on the screen.
+ * <p>
+ * Child views (bubbles) are always ordered based on recency. The most recent bubble is at index
+ * 0.
+ * For example if the child views are (1)(2)(3) then (1) is the most recent bubble and at index
+ * 0.<br>
+ *
+ * How bubbles show up on the screen depends on the bubble bar location. If the bar is on the
+ * left, the most recent bubble is shown on the right. The bubbles from the example above would
+ * be shown as: (3)(2)(1).<br>
+ *
+ * If bubble bar is on the right, then the most recent bubble is on the left. Bubbles from the
+ * example above would be shown as: (1)(2)(3).
+ */
+ private List<View> getChildViewsInOnScreenOrder() {
+ List<View> childViews = new ArrayList<>(getChildCount());
+ for (int i = 0; i < getChildCount(); i++) {
+ childViews.add(getChildAt(i));
+ }
+ if (mBubbleBarLocation.isOnLeft(isLayoutRtl())) {
+ // Visually child views are shown in reverse order when bar is on the left
+ return childViews.reversed();
+ }
+ return childViews;
+ }
+
+ private void updateNotificationDotsIfCollapsed() {
+ if (isExpanded()) {
+ return;
+ }
+ for (int i = 0; i < getChildCount(); i++) {
+ BubbleView bubbleView = (BubbleView) getChildAt(i);
+ // when we're collapsed, the first bubble should show the dot if it has it. the rest of
+ // the bubbles should hide their dots.
+ if (i == 0 && bubbleView.hasUnseenContent()) {
+ bubbleView.showDotIfNeeded(/* animate= */ true);
+ } else {
+ bubbleView.hideDot();
+ }
+ }
}
private void updateLayoutParams() {
@@ -535,6 +944,11 @@
setLayoutParams(lp);
}
+ private float getBubbleBarHeight() {
+ return mIsBarExpanded ? getBubbleBarExpandedHeight()
+ : getBubbleBarCollapsedHeight();
+ }
+
/** @return the horizontal margin between the bubble bar and the edge of the screen. */
int getHorizontalMargin() {
LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
@@ -545,66 +959,75 @@
* Updates the z order, positions, and badge visibility of the bubble views in the bar based
* on the expanded state.
*/
- private void updateChildrenRenderNodeProperties(BubbleBarLocation bubbleBarLocation) {
+ private void updateBubblesLayoutProperties(BubbleBarLocation bubbleBarLocation) {
final float widthState = (float) mWidthAnimator.getAnimatedValue();
final float currentWidth = getWidth();
final float expandedWidth = expandedWidth();
final float collapsedWidth = collapsedWidth();
- int bubbleCount = getChildCount();
- final float ty = (mBubbleBarBounds.height() - mIconSize) / 2f;
- final boolean animate = getVisibility() == VISIBLE;
+ int childCount = getChildCount();
+ float viewBottom = mBubbleBarBounds.height() + (isExpanded() ? mPointerSize : 0);
+ float bubbleBarAnimatedTop = viewBottom - getBubbleBarHeight();
+ // When translating X & Y the scale is ignored, so need to deduct it from the translations
+ final float ty = bubbleBarAnimatedTop + mBubbleBarPadding - getScaleIconShift();
final boolean onLeft = bubbleBarLocation.isOnLeft(isLayoutRtl());
// elevation state is opposite to widthState - when expanded all icons are flat
float elevationState = (1 - widthState);
- for (int i = 0; i < bubbleCount; i++) {
+ for (int i = 0; i < childCount; i++) {
BubbleView bv = (BubbleView) getChildAt(i);
+ if (bv == mDraggedBubbleView || bv == mDismissedByDragBubbleView) {
+ // Skip the dragged bubble. Its translation is managed by the drag controller.
+ continue;
+ }
+ // Clear out drag translation and offset
+ bv.setDragTranslationX(0f);
+ bv.setOffsetX(0f);
+
+ if (mBubbleAnimator == null || !mBubbleAnimator.isRunning()) {
+ // if the bubble animator is running don't set scale here, it will be set by the
+ // animator
+ bv.setScaleX(mIconScale);
+ bv.setScaleY(mIconScale);
+ }
bv.setTranslationY(ty);
// the position of the bubble when the bar is fully expanded
- final float expandedX;
+ final float expandedX = getExpandedBubbleTranslationX(i, childCount, onLeft);
// the position of the bubble when the bar is fully collapsed
- final float collapsedX;
- if (onLeft) {
- // If bar is on the left, bubbles are ordered right to left
- expandedX = (bubbleCount - i - 1) * (mIconSize + mExpandedBarIconsSpacing);
- // Shift the first bubble only if there are more bubbles in addition to overflow
- collapsedX = i == 0 && bubbleCount > 2 ? mIconOverlapAmount : 0;
- } else {
- // Bubbles ordered left to right, don't move the first bubble
- expandedX = i * (mIconSize + mExpandedBarIconsSpacing);
- collapsedX = i == 0 ? 0 : mIconOverlapAmount;
+ final float collapsedX = getCollapsedBubbleTranslationX(i, childCount, onLeft);
+
+ // slowly animate elevation while keeping correct Z ordering
+ float fullElevationForChild = (MAX_BUBBLES * mBubbleElevation) - i;
+ bv.setZ(fullElevationForChild * elevationState);
+
+ // only update the dot and badge scale if we're expanding or collapsing
+ if (mWidthAnimator.isRunning()) {
+ // The dot for the selected bubble scales in the opposite direction of the expansion
+ // animation.
+ bv.showDotIfNeeded(bv == mSelectedBubbleView ? 1 - widthState : widthState);
+ // The badge for the selected bubble is always at full scale. All other bubbles
+ // scale according to the expand animation.
+ bv.setBadgeScale(bv == mSelectedBubbleView ? 1 : widthState);
}
- if (bv == mDraggedBubbleView) {
- // if bubble is dragged set the elevation to bubble drag elevation
- bv.setZ(mDragElevation);
- } else {
- // otherwise slowly animate elevation while keeping correct Z ordering
- float fullElevationForChild = (MAX_BUBBLES * mBubbleElevation) - i;
- bv.setZ(fullElevationForChild * elevationState);
- }
+
if (mIsBarExpanded) {
// If bar is on the right, account for bubble bar expanding and shifting left
final float expandedBarShift = onLeft ? 0 : currentWidth - expandedWidth;
// where the bubble will end up when the animation ends
final float targetX = expandedX + expandedBarShift;
bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX);
- // When we're expanded, we're not stacked so we're not behind the stack
- bv.setBehindStack(false, animate);
bv.setAlpha(1);
} else {
// If bar is on the right, account for bubble bar expanding and shifting left
final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth;
final float targetX = collapsedX + collapsedBarShift;
bv.setTranslationX(widthState * (expandedX - targetX) + targetX);
- // If we're not the first bubble we're behind the stack
- bv.setBehindStack(i > 0, animate);
- // If we're fully collapsed, hide all bubbles except for the first 2. If there are
- // only 2 bubbles, hide the second bubble as well because it's the overflow.
+ // If we're fully collapsed, hide all bubbles except for the first 2, excluding
+ // the overflow.
if (widthState == 0) {
- if (i > 1) {
+ if (bv.isOverflow() || i > MAX_VISIBLE_BUBBLES_COLLAPSED - 1) {
bv.setAlpha(0);
- } else if (i == 1 && bubbleCount == 2) {
- bv.setAlpha(0);
+ } else {
+ bv.setAlpha(1);
}
}
}
@@ -632,8 +1055,51 @@
}
}
mBubbleBarBackground.setArrowPosition(arrowPosition);
- mBubbleBarBackground.setArrowAlpha((int) (255 * widthState));
+ mBubbleBarBackground.setArrowHeightFraction(widthState);
mBubbleBarBackground.setWidth(interpolatedWidth);
+ mBubbleBarBackground.setBackgroundHeight(getBubbleBarExpandedHeight());
+ }
+
+ private float getScaleIconShift() {
+ return (mIconSize - getScaledIconSize()) / 2;
+ }
+
+ private float getExpandedBubbleTranslationX(int bubbleIndex, int bubbleCount, boolean onLeft) {
+ if (bubbleIndex < 0 || bubbleIndex >= bubbleCount) {
+ return 0;
+ }
+ final float iconAndSpacing = getScaledIconSize() + mExpandedBarIconsSpacing;
+ float translationX;
+ if (mBubbleAnimator != null && mBubbleAnimator.isRunning()) {
+ return mBubbleAnimator.getBubbleTranslationX(bubbleIndex) + mBubbleBarPadding;
+ } else if (onLeft) {
+ translationX = mBubbleBarPadding + (bubbleCount - bubbleIndex - 1) * iconAndSpacing;
+ } else {
+ translationX = mBubbleBarPadding + bubbleIndex * iconAndSpacing;
+ }
+ return translationX - getScaleIconShift();
+ }
+
+ private float getCollapsedBubbleTranslationX(int bubbleIndex, int childCount, boolean onLeft) {
+ if (bubbleIndex < 0 || bubbleIndex >= childCount) {
+ return 0;
+ }
+ float translationX;
+ if (onLeft) {
+ // Shift the first bubble only if there are more bubbles
+ if (bubbleIndex == 0 && getBubbleChildCount() >= MAX_VISIBLE_BUBBLES_COLLAPSED) {
+ translationX = mIconOverlapAmount;
+ } else {
+ translationX = 0f;
+ }
+ } else {
+ if (bubbleIndex == 1 && getBubbleChildCount() >= MAX_VISIBLE_BUBBLES_COLLAPSED) {
+ translationX = mIconOverlapAmount;
+ } else {
+ translationX = 0f;
+ }
+ }
+ return mBubbleBarPadding + translationX - getScaleIconShift();
}
/**
@@ -660,7 +1126,9 @@
addViewInLayout(child, i, child.getLayoutParams());
}
}
- updateChildrenRenderNodeProperties(mBubbleBarLocation);
+ updateBubblesLayoutProperties(mBubbleBarLocation);
+ updateContentDescription();
+ updateNotificationDotsIfCollapsed();
}
}
@@ -669,6 +1137,10 @@
mUpdateSelectedBubbleAfterCollapse = updateSelectedBubbleAfterCollapse;
}
+ void setController(Controller controller) {
+ mController = controller;
+ }
+
/**
* Sets which bubble view should be shown as selected.
*/
@@ -676,17 +1148,35 @@
BubbleView previouslySelectedBubble = mSelectedBubbleView;
mSelectedBubbleView = view;
mBubbleBarBackground.showArrow(view != null);
- // TODO: (b/283309949) remove animation should be implemented first, so than arrow
- // animation is adjusted, skip animation for now
- updateArrowForSelected(previouslySelectedBubble != null);
+
+ // if bubbles are being animated, the arrow position will be set as part of the animation
+ if (mBubbleAnimator == null) {
+ updateArrowForSelected(previouslySelectedBubble != null);
+ }
+ if (view != null) {
+ if (isExpanded()) {
+ view.markSeen();
+ } else {
+ // when collapsed, the selected bubble should show the dot if it has it
+ view.showDotIfNeeded(/* animate= */ true);
+ }
+ }
}
/**
* Sets the dragged bubble view to correctly apply Z order. Dragged view should appear on top
*/
public void setDraggedBubble(@Nullable BubbleView view) {
+ if (mDraggedBubbleView != null) {
+ mDraggedBubbleView.setZ(0);
+ }
mDraggedBubbleView = view;
- requestLayout();
+ if (view != null) {
+ view.setZ(mDragElevation);
+ // we started dragging a bubble. reset the bubble that was previously dismissed by drag
+ mDismissedByDragBubbleView = null;
+ }
+ setIsDragging(view != null);
}
/**
@@ -727,16 +1217,13 @@
}
private float arrowPositionForSelectedWhenExpanded(BubbleBarLocation bubbleBarLocation) {
- final int index = indexOfChild(mSelectedBubbleView);
- final int bubblePosition;
- if (bubbleBarLocation.isOnLeft(isLayoutRtl())) {
- // Bubble positions are reversed. First bubble is on the right.
- bubblePosition = getChildCount() - index - 1;
- } else {
- bubblePosition = index;
+ if (mBubbleAnimator != null && mBubbleAnimator.isRunning()) {
+ return mBubbleAnimator.getArrowPosition() + mBubbleBarPadding;
}
- return getPaddingStart() + bubblePosition * (mIconSize + mExpandedBarIconsSpacing)
- + mIconSize / 2f;
+ final int index = indexOfChild(mSelectedBubbleView);
+ final float selectedBubbleTranslationX = getExpandedBubbleTranslationX(
+ index, getChildCount(), bubbleBarLocation.isOnLeft(isLayoutRtl()));
+ return selectedBubbleTranslationX + mIconSize / 2f;
}
private float arrowPositionForSelectedWhenCollapsed(BubbleBarLocation bubbleBarLocation) {
@@ -745,11 +1232,12 @@
if (bubbleBarLocation.isOnLeft(isLayoutRtl())) {
// Bubble positions are reversed. First bubble may be shifted, if there are more
// bubbles than the current bubble and overflow.
- bubblePosition = index == 0 && getChildCount() > 2 ? 1 : 0;
+ bubblePosition = index == 0 && getChildCount() > MAX_VISIBLE_BUBBLES_COLLAPSED ? 1 : 0;
} else {
- bubblePosition = index;
+ bubblePosition = index >= MAX_VISIBLE_BUBBLES_COLLAPSED
+ ? MAX_VISIBLE_BUBBLES_COLLAPSED - 1 : index;
}
- return getPaddingStart() + bubblePosition * (mIconOverlapAmount) + mIconSize / 2f;
+ return mBubbleBarPadding + bubblePosition * (mIconOverlapAmount) + getScaledIconSize() / 2f;
}
@Override
@@ -779,6 +1267,8 @@
} else {
mWidthAnimator.reverse();
}
+ updateBubbleAccessibilityStates();
+ announceExpandedStateChange();
}
}
@@ -790,26 +1280,42 @@
}
/**
+ * Returns whether the bubble bar is expanding.
+ */
+ public boolean isExpanding() {
+ return mWidthAnimator.isRunning() && mIsBarExpanded;
+ }
+
+ /**
* Get width of the bubble bar as if it would be expanded.
*
* @return width of the bubble bar in its expanded state, regardless of current width
*/
public float expandedWidth() {
final int childCount = getChildCount();
- final int horizontalPadding = getPaddingStart() + getPaddingEnd();
+ final float horizontalPadding = 2 * mBubbleBarPadding;
+ if (mBubbleAnimator != null && mBubbleAnimator.isRunning()) {
+ return mBubbleAnimator.getExpandedWidth() + horizontalPadding;
+ }
// spaces amount is less than child count by 1, or 0 if no child views
- int spacesCount = Math.max(childCount - 1, 0);
- return childCount * mIconSize + spacesCount * mExpandedBarIconsSpacing + horizontalPadding;
+ final float totalSpace = Math.max(childCount - 1, 0) * mExpandedBarIconsSpacing;
+ final float totalIconSize = childCount * getScaledIconSize();
+ return totalIconSize + totalSpace + horizontalPadding;
}
private float collapsedWidth() {
- final int childCount = getChildCount();
- final int horizontalPadding = getPaddingStart() + getPaddingEnd();
- // If there are more than 2 bubbles, the first 2 should be visible when collapsed.
- // Otherwise just the first bubble should be visible because we don't show the overflow.
- return childCount > 2
- ? mIconSize + mIconOverlapAmount + horizontalPadding
- : mIconSize + horizontalPadding;
+ final int bubbleChildCount = getBubbleChildCount();
+ final float horizontalPadding = 2 * mBubbleBarPadding;
+ // If there are more than 2 bubbles, the first 2 should be visible when collapsed,
+ // excluding the overflow.
+ return bubbleChildCount >= MAX_VISIBLE_BUBBLES_COLLAPSED
+ ? getScaledIconSize() + mIconOverlapAmount + horizontalPadding
+ : getScaledIconSize() + horizontalPadding;
+ }
+
+ /** Returns the child count excluding the overflow if it's present. */
+ int getBubbleChildCount() {
+ return hasOverflow() ? getChildCount() - 1 : getChildCount();
}
private float getBubbleBarExpandedHeight() {
@@ -818,7 +1324,7 @@
float getBubbleBarCollapsedHeight() {
// the pointer is invisible when collapsed
- return mIconSize + mBubbleBarPadding * 2;
+ return getScaledIconSize() + mBubbleBarPadding * 2;
}
/**
@@ -835,15 +1341,180 @@
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (!mIsBarExpanded && !mIsAnimatingNewBubble) {
+ mController.onBubbleBarTouched();
+ if (!mIsBarExpanded) {
// When the bar is collapsed, all taps on it should expand it.
return true;
}
return super.onInterceptTouchEvent(ev);
}
- /** Whether a new bubble is currently animating. */
- public boolean isAnimatingNewBubble() {
- return mIsAnimatingNewBubble;
+ private boolean hasOverflow() {
+ // Overflow is always the last bubble
+ View lastChild = getChildAt(getChildCount() - 1);
+ if (lastChild instanceof BubbleView bubbleView) {
+ return bubbleView.getBubble() instanceof BubbleBarOverflow;
+ }
+ return false;
+ }
+
+ private void updateBubbleAccessibilityStates() {
+ if (mIsBarExpanded) {
+ // Bar is expanded, focus on the bubbles
+ setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+
+ // Set up a11y navigation order. Get list of child views in the order they are shown
+ // on screen. And use that to set up navigation so that swiping left focuses the view
+ // on the left and swiping right focuses view on the right.
+ View prevChild = null;
+ for (View childView : getChildViewsInOnScreenOrder()) {
+ childView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ childView.setFocusable(true);
+ final View finalPrevChild = prevChild;
+ // Always need to set a new delegate to clear out any previous.
+ childView.setAccessibilityDelegate(new AccessibilityDelegate() {
+ @Override
+ public void onInitializeAccessibilityNodeInfo(View host,
+ AccessibilityNodeInfo info) {
+ super.onInitializeAccessibilityNodeInfo(host, info);
+ if (finalPrevChild != null) {
+ info.setTraversalAfter(finalPrevChild);
+ }
+ }
+ });
+ prevChild = childView;
+ }
+ } else {
+ // Bar is collapsed, only focus on the bar
+ setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ for (int i = 0; i < getChildCount(); i++) {
+ View childView = getChildAt(i);
+ childView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+ childView.setFocusable(false);
+ }
+ }
+ }
+
+ private void updateContentDescription() {
+ View firstChild = getChildAt(0);
+ CharSequence contentDesc = firstChild != null ? firstChild.getContentDescription() : "";
+
+ // Don't count overflow if it exists
+ int bubbleCount = getChildCount() - (hasOverflow() ? 1 : 0);
+ if (bubbleCount > 1) {
+ contentDesc = getResources().getString(R.string.bubble_bar_description_multiple_bubbles,
+ contentDesc, bubbleCount - 1);
+ }
+ setContentDescription(contentDesc);
+ }
+
+ private void announceExpandedStateChange() {
+ final CharSequence selectedBubbleContentDesc;
+ if (mSelectedBubbleView != null) {
+ selectedBubbleContentDesc = mSelectedBubbleView.getContentDescription();
+ } else {
+ selectedBubbleContentDesc = getResources().getString(
+ R.string.bubble_bar_bubble_fallback_description);
+ }
+
+ final String msg;
+ if (mIsBarExpanded) {
+ msg = getResources().getString(R.string.bubble_bar_accessibility_announce_expand,
+ selectedBubbleContentDesc);
+ } else {
+ msg = getResources().getString(R.string.bubble_bar_accessibility_announce_collapse,
+ selectedBubbleContentDesc);
+ }
+ announceForAccessibility(msg);
+ }
+
+ private boolean isIconSizeOrPaddingUpdated(float newIconSize, float newBubbleBarPadding) {
+ return isIconSizeUpdated(newIconSize) || isPaddingUpdated(newBubbleBarPadding);
+ }
+
+ private boolean isIconSizeUpdated(float newIconSize) {
+ return Float.compare(mIconSize, newIconSize) != 0;
+ }
+
+ private boolean isPaddingUpdated(float newBubbleBarPadding) {
+ return Float.compare(mBubbleBarPadding, newBubbleBarPadding) != 0;
+ }
+
+ private void addAnimationCallBacks(@NonNull ValueAnimator animator,
+ @Nullable Runnable onStart,
+ @Nullable Runnable onEnd,
+ @Nullable ValueAnimator.AnimatorUpdateListener onUpdate) {
+ if (onUpdate != null) animator.addUpdateListener(onUpdate);
+ animator.addListener(new Animator.AnimatorListener() {
+ @Override
+ public void onAnimationCancel(Animator animator) {
+
+ }
+
+ @Override
+ public void onAnimationStart(Animator animator) {
+ if (onStart != null) onStart.run();
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animator) {
+ if (onEnd != null) onEnd.run();
+ }
+
+ @Override
+ public void onAnimationRepeat(Animator animator) {
+
+ }
+ });
+ }
+
+ /** Dumps the current state of BubbleBarView. */
+ public void dump(PrintWriter pw) {
+ pw.println("BubbleBarView state:");
+ pw.println(" visibility: " + getVisibility());
+ pw.println(" alpha: " + getAlpha());
+ pw.println(" translation Y: " + getTranslationY());
+ pw.println(" bubbles in bar (childCount = " + getChildCount() + ")");
+ for (BubbleView bubbleView: getBubbles()) {
+ BubbleBarItem bubble = bubbleView.getBubble();
+ String key = bubble == null ? "null" : bubble.getKey();
+ pw.println(" bubble key: " + key);
+ }
+ pw.println(" isExpanded: " + isExpanded());
+ if (mBubbleAnimator != null) {
+ pw.println(" mBubbleAnimator.isRunning(): " + mBubbleAnimator.isRunning());
+ pw.println(" mBubbleAnimator is null");
+ }
+ pw.println(" mDragging: " + mDragging);
+ }
+
+ private List<BubbleView> getBubbles() {
+ List<BubbleView> bubbles = new ArrayList<>();
+ for (int i = 0; i < getChildCount(); i++) {
+ View child = getChildAt(i);
+ if (child instanceof BubbleView bubble) {
+ bubbles.add(bubble);
+ }
+ }
+ return bubbles;
+ }
+
+ /** Interface for BubbleBarView to communicate with its controller. */
+ interface Controller {
+
+ /** Returns the translation Y that the bubble bar should have. */
+ float getBubbleBarTranslationY();
+
+ /** Notifies the controller that the bubble bar was touched. */
+ void onBubbleBarTouched();
+
+ /** Requests the controller to expand bubble bar */
+ void expandBubbleBar();
+
+ /** Requests the controller to dismiss the bubble bar */
+ void dismissBubbleBar();
+
+ /** Requests the controller to update bubble bar location to the given value */
+ void updateBubbleBarLocation(BubbleBarLocation location);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java
index dc48a66..5c1a546 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java
@@ -20,18 +20,18 @@
import android.content.res.Resources;
import android.graphics.Point;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
-import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
-import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.taskbar.TaskbarActivityContext;
@@ -39,11 +39,13 @@
import com.android.launcher3.taskbar.TaskbarInsetsController;
import com.android.launcher3.taskbar.TaskbarStashController;
import com.android.launcher3.taskbar.bubbles.animation.BubbleBarViewAnimator;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.SystemUiProxy;
import com.android.wm.shell.common.bubbles.BubbleBarLocation;
+import java.io.PrintWriter;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
@@ -54,7 +56,7 @@
*/
public class BubbleBarViewController {
- private static final String TAG = BubbleBarViewController.class.getSimpleName();
+ private static final String TAG = "BubbleBarViewController";
private static final float APP_ICON_SMALL_DP = 44f;
private static final float APP_ICON_MEDIUM_DP = 48f;
private static final float APP_ICON_LARGE_DP = 52f;
@@ -62,6 +64,7 @@
private final TaskbarActivityContext mActivity;
private final BubbleBarView mBarView;
private int mIconSize;
+ private int mBubbleBarPadding;
// Initialized in init.
private BubbleStashController mBubbleStashController;
@@ -69,8 +72,11 @@
private BubbleDragController mBubbleDragController;
private TaskbarStashController mTaskbarStashController;
private TaskbarInsetsController mTaskbarInsetsController;
+ private TaskbarViewPropertiesProvider mTaskbarViewPropertiesProvider;
private View.OnClickListener mBubbleClickListener;
private View.OnClickListener mBubbleBarClickListener;
+ private BubbleView.Controller mBubbleViewController;
+ private BubbleBarOverflow mOverflowBubble;
// These are exposed to {@link BubbleStashController} to animate for stashing/un-stashing
private final MultiValueAlpha mBubbleBarAlpha;
@@ -87,77 +93,129 @@
private boolean mHiddenForNoBubbles = true;
private boolean mShouldShowEducation;
+ public boolean mOverflowAdded;
+
private BubbleBarViewAnimator mBubbleBarViewAnimator;
+ private final TimeSource mTimeSource = System::currentTimeMillis;
+
@Nullable
private BubbleBarBoundsChangeListener mBoundsChangeListener;
- private final Rect mPreviousBubbleBarBounds = new Rect();
-
public BubbleBarViewController(TaskbarActivityContext activity, BubbleBarView barView) {
mActivity = activity;
mBarView = barView;
mSystemUiProxy = SystemUiProxy.INSTANCE.get(mActivity);
mBubbleBarAlpha = new MultiValueAlpha(mBarView, 1 /* num alpha channels */);
- mBubbleBarAlpha.setUpdateVisibility(true);
mIconSize = activity.getResources().getDimensionPixelSize(
R.dimen.bubblebar_icon_size);
}
- public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) {
+ /** Initializes controller. */
+ public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers,
+ TaskbarViewPropertiesProvider taskbarViewPropertiesProvider) {
mBubbleStashController = bubbleControllers.bubbleStashController;
mBubbleBarController = bubbleControllers.bubbleBarController;
mBubbleDragController = bubbleControllers.bubbleDragController;
mTaskbarStashController = controllers.taskbarStashController;
mTaskbarInsetsController = controllers.taskbarInsetsController;
-
- mActivity.addOnDeviceProfileChangeListener(dp -> setBubbleBarIconSize(dp.taskbarIconSize));
- setBubbleBarIconSize(mActivity.getDeviceProfile().taskbarIconSize);
+ mBubbleBarViewAnimator = new BubbleBarViewAnimator(
+ mBarView, mBubbleStashController, mBubbleBarController::showExpandedView);
+ mTaskbarViewPropertiesProvider = taskbarViewPropertiesProvider;
+ onBubbleBarConfigurationChanged(/* animate= */ false);
+ mActivity.addOnDeviceProfileChangeListener(
+ dp -> onBubbleBarConfigurationChanged(/* animate= */ true));
mBubbleBarScale.updateValue(1f);
- mBubbleClickListener = v -> onBubbleClicked(v);
- mBubbleBarClickListener = v -> onBubbleBarClicked();
+ mBubbleClickListener = v -> onBubbleClicked((BubbleView) v);
+ mBubbleBarClickListener = v -> expandBubbleBar();
mBubbleDragController.setupBubbleBarView(mBarView);
+ mOverflowBubble = bubbleControllers.bubbleCreator.createOverflow(mBarView);
mBarView.setOnClickListener(mBubbleBarClickListener);
mBarView.addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
- Rect bubbleBarBounds = mBarView.getBubbleBarBounds();
- if (!bubbleBarBounds.equals(mPreviousBubbleBarBounds)) {
- mPreviousBubbleBarBounds.set(bubbleBarBounds);
- if (mBoundsChangeListener != null) {
- mBoundsChangeListener.onBoundsChanged(bubbleBarBounds);
- }
+ if (mBoundsChangeListener != null) {
+ mBoundsChangeListener.onBoundsChanged();
}
});
+ mBarView.setController(new BubbleBarView.Controller() {
+ @Override
+ public float getBubbleBarTranslationY() {
+ return mBubbleStashController.getBubbleBarTranslationY();
+ }
- mBubbleBarViewAnimator = new BubbleBarViewAnimator(mBarView, mBubbleStashController);
+ @Override
+ public void onBubbleBarTouched() {
+ BubbleBarViewController.this.onBubbleBarTouched();
+ }
+
+ @Override
+ public void expandBubbleBar() {
+ BubbleBarViewController.this.expandBubbleBar();
+ }
+
+ @Override
+ public void dismissBubbleBar() {
+ onDismissAllBubbles();
+ }
+
+ @Override
+ public void updateBubbleBarLocation(BubbleBarLocation location) {
+ mBubbleBarController.updateBubbleBarLocation(location);
+ }
+ });
+
+ mBubbleViewController = new BubbleView.Controller() {
+ @Override
+ public BubbleBarLocation getBubbleBarLocation() {
+ return BubbleBarViewController.this.getBubbleBarLocation();
+ }
+
+ @Override
+ public void dismiss(BubbleView bubble) {
+ if (bubble.getBubble() != null) {
+ notifySysUiBubbleDismissed(bubble.getBubble());
+ }
+ onBubbleDismissed(bubble);
+ }
+
+ @Override
+ public void collapse() {
+ collapseBubbleBar();
+ }
+
+ @Override
+ public void updateBubbleBarLocation(BubbleBarLocation location) {
+ mBubbleBarController.updateBubbleBarLocation(location);
+ }
+ };
}
- private void onBubbleClicked(View v) {
- BubbleBarItem bubble = ((BubbleView) v).getBubble();
+ private void onBubbleClicked(BubbleView bubbleView) {
+ bubbleView.markSeen();
+ BubbleBarItem bubble = bubbleView.getBubble();
if (bubble == null) {
Log.e(TAG, "bubble click listener, bubble was null");
}
- if (mBarView.isAnimatingNewBubble()) {
- mBubbleBarViewAnimator.onBubbleClickedWhileAnimating();
- mBubbleStashController.showBubbleBarImmediate();
- setExpanded(true);
- mBubbleBarController.showAndSelectBubble(bubble);
- return;
- }
-
final String currentlySelected = mBubbleBarController.getSelectedBubbleKey();
if (mBarView.isExpanded() && Objects.equals(bubble.getKey(), currentlySelected)) {
// Tapping the currently selected bubble while expanded collapses the view.
- setExpanded(false);
- mBubbleStashController.stashBubbleBar();
+ collapseBubbleBar();
} else {
mBubbleBarController.showAndSelectBubble(bubble);
}
}
- private void onBubbleBarClicked() {
+ private void onBubbleBarTouched() {
+ if (isAnimatingNewBubble()) {
+ mBubbleBarViewAnimator.onBubbleBarTouchedWhileAnimating();
+ mBubbleStashController.onNewBubbleAnimationInterrupted(false,
+ mBarView.getTranslationY());
+ }
+ }
+
+ private void expandBubbleBar() {
if (mShouldShowEducation) {
mShouldShowEducation = false;
// Get the bubble bar bounds on screen
@@ -168,10 +226,26 @@
// Show user education relative to the reference point
mSystemUiProxy.showUserEducation(position);
} else {
+ // ensure that the bubble bar has the correct translation. we may have just interrupted
+ // the animation by touching the bubble bar.
+ mBubbleBarTranslationY.animateToValue(mBubbleStashController.getBubbleBarTranslationY())
+ .start();
setExpanded(true);
}
}
+ private void collapseBubbleBar() {
+ setExpanded(false);
+ mBubbleStashController.stashBubbleBar();
+ }
+
+ /** Notifies that the stash state is changing. */
+ public void onStashStateChanging() {
+ if (isAnimatingNewBubble()) {
+ mBubbleBarViewAnimator.onStashStateChangingWhileAnimating();
+ }
+ }
+
//
// The below animators are exposed to BubbleStashController so it can manage the stashing
// animation.
@@ -189,7 +263,7 @@
return mBubbleBarTranslationY;
}
- float getBubbleBarCollapsedHeight() {
+ public float getBubbleBarCollapsedHeight() {
return mBarView.getBubbleBarCollapsedHeight();
}
@@ -235,9 +309,22 @@
return mBarView.getBubbleBarBounds();
}
+ /** Checks that bubble bar is visible and that the motion event is within bounds. */
+ public boolean isEventOverBubbleBar(MotionEvent event) {
+ if (!isBubbleBarVisible()) return false;
+ final Rect bounds = getBubbleBarBounds();
+ final int bubbleBarTopOnScreen = mBarView.getRestingTopPositionOnScreen();
+ final float x = event.getX();
+ return event.getRawY() >= bubbleBarTopOnScreen && x >= bounds.left && x <= bounds.right;
+ }
+
/** Whether a new bubble is animating. */
public boolean isAnimatingNewBubble() {
- return mBarView.isAnimatingNewBubble();
+ return mBubbleBarViewAnimator != null && mBubbleBarViewAnimator.isAnimating();
+ }
+
+ public boolean isNewBubbleAnimationRunningOrPending() {
+ return mBubbleBarViewAnimator != null && mBubbleBarViewAnimator.hasAnimation();
}
/** The horizontal margin of the bubble bar from the edge of the screen. */
@@ -281,38 +368,12 @@
if (hidden) {
mBarView.setAlpha(0);
mBarView.setExpanded(false);
+ updatePersistentTaskbar(/* isBubbleBarExpanded = */ false);
}
mActivity.bubbleBarVisibilityChanged(!hidden);
}
}
- private void setBubbleBarIconSize(int newIconSize) {
- if (newIconSize == mIconSize) {
- return;
- }
- Resources res = mActivity.getResources();
- DisplayMetrics dm = res.getDisplayMetrics();
- float smallIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- APP_ICON_SMALL_DP, dm);
- float mediumIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- APP_ICON_MEDIUM_DP, dm);
- float largeIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- APP_ICON_LARGE_DP, dm);
- float smallMediumThreshold = (smallIconSize + mediumIconSize) / 2f;
- float mediumLargeThreshold = (mediumIconSize + largeIconSize) / 2f;
- mIconSize = newIconSize <= smallMediumThreshold
- ? res.getDimensionPixelSize(R.dimen.bubblebar_icon_size_small) :
- res.getDimensionPixelSize(R.dimen.bubblebar_icon_size);
- float bubbleBarPadding = newIconSize >= mediumLargeThreshold
- ? res.getDimensionPixelSize(R.dimen.bubblebar_icon_spacing_large) :
- res.getDimensionPixelSize(R.dimen.bubblebar_icon_spacing);
-
- mBarView.setIconSizeAndPadding(mIconSize, bubbleBarPadding);
- mBarView.setPadding((int) bubbleBarPadding, mBarView.getPaddingTop(),
- (int) bubbleBarPadding,
- mBarView.getPaddingBottom());
- }
-
/** Sets a callback that updates the selected bubble after the bubble bar collapses. */
public void setUpdateSelectedBubbleAfterCollapse(
Consumer<String> updateSelectedBubbleAfterCollapse) {
@@ -347,6 +408,64 @@
// Modifying view related properties.
//
+ /** Notifies controller of configuration change, so bubble bar can be adjusted */
+ public void onBubbleBarConfigurationChanged(boolean animate) {
+ int newIconSize;
+ int newPadding;
+ Resources res = mActivity.getResources();
+ if (mBubbleStashController.isBubblesShowingOnHome()
+ || mBubbleStashController.isTransientTaskBar()) {
+ newIconSize = getBubbleBarIconSizeFromDeviceProfile(res);
+ newPadding = getBubbleBarPaddingFromDeviceProfile(res);
+ } else {
+ // the bubble bar is shown inside the persistent task bar, use preset sizes
+ newIconSize = res.getDimensionPixelSize(R.dimen.bubblebar_icon_size_persistent_taskbar);
+ newPadding = res.getDimensionPixelSize(
+ R.dimen.bubblebar_icon_spacing_persistent_taskbar);
+ }
+ updateBubbleBarIconSizeAndPadding(newIconSize, newPadding, animate);
+ }
+
+
+ private int getBubbleBarIconSizeFromDeviceProfile(Resources res) {
+ DeviceProfile deviceProfile = mActivity.getDeviceProfile();
+ DisplayMetrics dm = res.getDisplayMetrics();
+ float smallIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ APP_ICON_SMALL_DP, dm);
+ float mediumIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ APP_ICON_MEDIUM_DP, dm);
+ float smallMediumThreshold = (smallIconSize + mediumIconSize) / 2f;
+ int taskbarIconSize = deviceProfile.taskbarIconSize;
+ return taskbarIconSize <= smallMediumThreshold
+ ? res.getDimensionPixelSize(R.dimen.bubblebar_icon_size_small) :
+ res.getDimensionPixelSize(R.dimen.bubblebar_icon_size);
+
+ }
+
+ private int getBubbleBarPaddingFromDeviceProfile(Resources res) {
+ DeviceProfile deviceProfile = mActivity.getDeviceProfile();
+ DisplayMetrics dm = res.getDisplayMetrics();
+ float mediumIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ APP_ICON_MEDIUM_DP, dm);
+ float largeIconSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ APP_ICON_LARGE_DP, dm);
+ float mediumLargeThreshold = (mediumIconSize + largeIconSize) / 2f;
+ return deviceProfile.taskbarIconSize >= mediumLargeThreshold
+ ? res.getDimensionPixelSize(R.dimen.bubblebar_icon_spacing_large) :
+ res.getDimensionPixelSize(R.dimen.bubblebar_icon_spacing);
+ }
+
+ private void updateBubbleBarIconSizeAndPadding(int iconSize, int padding, boolean animate) {
+ if (mIconSize == iconSize && mBubbleBarPadding == padding) return;
+ mIconSize = iconSize;
+ mBubbleBarPadding = padding;
+ if (animate) {
+ mBarView.animateBubbleBarIconSize(iconSize, padding);
+ } else {
+ mBarView.setIconSizeAndPadding(iconSize, padding);
+ }
+ }
+
/**
* Sets the translation of the bubble bar during the swipe up gesture.
*/
@@ -376,38 +495,122 @@
/**
* Removes the provided bubble from the bubble bar.
*/
- public void removeBubble(BubbleBarItem b) {
+ public void removeBubble(BubbleBarBubble b) {
if (b != null) {
- mBarView.removeView(b.getView());
+ mBarView.removeBubble(b.getView());
+ b.getView().setController(null);
} else {
Log.w(TAG, "removeBubble, bubble was null!");
}
}
+ /** Adds a new bubble and removes an old bubble at the same time. */
+ public void addBubbleAndRemoveBubble(BubbleBarBubble addedBubble,
+ BubbleBarBubble removedBubble, boolean isExpanding, boolean suppressAnimation,
+ boolean addOverflowToo) {
+ mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), removedBubble.getView(),
+ addOverflowToo ? () -> showOverflow(true) : null);
+ addedBubble.getView().setOnClickListener(mBubbleClickListener);
+ addedBubble.getView().setController(mBubbleViewController);
+ removedBubble.getView().setController(null);
+ mBubbleDragController.setupBubbleView(addedBubble.getView());
+ if (!suppressAnimation) {
+ animateBubbleNotification(addedBubble, isExpanding, /* isUpdate= */ false);
+ }
+ }
+
+ /** Whether the overflow view is added to the bubble bar. */
+ public boolean isOverflowAdded() {
+ return mOverflowAdded;
+ }
+
+ /** Shows or hides the overflow view. */
+ public void showOverflow(boolean showOverflow) {
+ if (mOverflowAdded == showOverflow) return;
+ mOverflowAdded = showOverflow;
+ if (mOverflowAdded) {
+ mBarView.addBubble(mOverflowBubble.getView());
+ mOverflowBubble.getView().setOnClickListener(mBubbleClickListener);
+ mOverflowBubble.getView().setController(mBubbleViewController);
+ } else {
+ mBarView.removeBubble(mOverflowBubble.getView());
+ mOverflowBubble.getView().setOnClickListener(null);
+ mOverflowBubble.getView().setController(null);
+ }
+ }
+
+ /** Adds the overflow view to the bubble bar while animating a view away. */
+ public void addOverflowAndRemoveBubble(BubbleBarBubble removedBubble) {
+ if (mOverflowAdded) return;
+ mOverflowAdded = true;
+ mBarView.addBubbleAndRemoveBubble(mOverflowBubble.getView(), removedBubble.getView(),
+ null /* onEndRunnable */);
+ mOverflowBubble.getView().setOnClickListener(mBubbleClickListener);
+ mOverflowBubble.getView().setController(mBubbleViewController);
+ removedBubble.getView().setController(null);
+ }
+
+ /** Removes the overflow view to the bubble bar while animating a view in. */
+ public void removeOverflowAndAddBubble(BubbleBarBubble addedBubble) {
+ if (!mOverflowAdded) return;
+ mOverflowAdded = false;
+ mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), mOverflowBubble.getView(),
+ null /* onEndRunnable */);
+ addedBubble.getView().setOnClickListener(mBubbleClickListener);
+ addedBubble.getView().setController(mBubbleViewController);
+ mOverflowBubble.getView().setController(null);
+ }
+
/**
* Adds the provided bubble to the bubble bar.
*/
public void addBubble(BubbleBarItem b, boolean isExpanding, boolean suppressAnimation) {
if (b != null) {
- mBarView.addView(b.getView(), 0,
- new FrameLayout.LayoutParams(mIconSize, mIconSize, Gravity.LEFT));
+ mBarView.addBubble(b.getView());
b.getView().setOnClickListener(mBubbleClickListener);
mBubbleDragController.setupBubbleView(b.getView());
+ b.getView().setController(mBubbleViewController);
- if (suppressAnimation) {
+ if (suppressAnimation || !(b instanceof BubbleBarBubble bubble)) {
+ // the bubble bar and handle are initialized as part of the first bubble animation.
+ // if the animation is suppressed, immediately stash or show the bubble bar to
+ // ensure they've been initialized.
+ if (mTaskbarStashController.isInApp()
+ && mBubbleStashController.isTransientTaskBar()) {
+ mBubbleStashController.stashBubbleBarImmediate();
+ } else {
+ mBubbleStashController.showBubbleBarImmediate();
+ }
return;
}
-
- boolean isInApp = mTaskbarStashController.isInApp();
- // only animate the new bubble if we're in an app and not auto expanding
- if (b instanceof BubbleBarBubble && isInApp && !isExpanding && !isExpanded()) {
- mBubbleBarViewAnimator.animateBubbleInForStashed((BubbleBarBubble) b);
- }
+ animateBubbleNotification(bubble, isExpanding, /* isUpdate= */ false);
} else {
Log.w(TAG, "addBubble, bubble was null!");
}
}
+ /** Animates the bubble bar to notify the user about a bubble change. */
+ public void animateBubbleNotification(BubbleBarBubble bubble, boolean isExpanding,
+ boolean isUpdate) {
+ boolean isInApp = mTaskbarStashController.isInApp();
+ // if this is the first bubble, animate to the initial state.
+ if (mBarView.getBubbleChildCount() == 1 && !isUpdate) {
+ mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding);
+ return;
+ }
+ boolean persistentTaskbarOrOnHome = mBubbleStashController.isBubblesShowingOnHome()
+ || !mBubbleStashController.isTransientTaskBar();
+ if (persistentTaskbarOrOnHome && !isExpanded()) {
+ mBubbleBarViewAnimator.animateBubbleBarForCollapsed(bubble, isExpanding);
+ return;
+ }
+
+ // only animate the new bubble if we're in an app, have handle view and not auto expanding
+ if (isInApp && mBubbleStashController.getHasHandleView() && !isExpanded()) {
+ mBubbleBarViewAnimator.animateBubbleInForStashed(bubble, isExpanding);
+ }
+ }
+
/**
* Reorders the bubbles based on the provided list.
*/
@@ -433,6 +636,7 @@
public void setExpanded(boolean isExpanded) {
if (isExpanded != mBarView.isExpanded()) {
mBarView.setExpanded(isExpanded);
+ updatePersistentTaskbar(isExpanded);
if (!isExpanded) {
mSystemUiProxy.collapseBubbles();
} else {
@@ -443,11 +647,34 @@
}
}
+ private void updatePersistentTaskbar(boolean isBubbleBarExpanded) {
+ if (mBubbleStashController.isTransientTaskBar()) return;
+ boolean hideTaskbar = isBubbleBarExpanded && isIntersectingTaskbar();
+ mTaskbarViewPropertiesProvider
+ .getIconsAlpha()
+ .animateToValue(hideTaskbar ? 0 : 1)
+ .start();
+ }
+
+ /** Return {@code true} if expanded bubble bar would intersect the taskbar. */
+ public boolean isIntersectingTaskbar() {
+ if (mBarView.isExpanding() || mBarView.isExpanded()) {
+ Rect taskbarViewBounds = mTaskbarViewPropertiesProvider.getTaskbarViewBounds();
+ return mBarView.getBubbleBarExpandedBounds().intersect(taskbarViewBounds);
+ } else {
+ return false;
+ }
+ }
+
/**
* Sets whether the bubble bar should be expanded. This method is used in response to UI events
* from SystemUI.
*/
public void setExpandedFromSysui(boolean isExpanded) {
+ if (isNewBubbleAnimationRunningOrPending() && isExpanded) {
+ mBubbleBarViewAnimator.expandedWhileAnimating();
+ return;
+ }
if (!isExpanded) {
mBubbleStashController.stashBubbleBar();
} else {
@@ -464,42 +691,77 @@
/**
* Updates the dragged bubble view in the bubble bar view, and notifies SystemUI
* that a bubble is being dragged to dismiss.
+ *
* @param bubbleView dragged bubble view
*/
- public void onDragStart(@NonNull BubbleView bubbleView) {
+ public void onBubbleDragStart(@NonNull BubbleView bubbleView) {
if (bubbleView.getBubble() == null) return;
- mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ true);
+
+ mSystemUiProxy.startBubbleDrag(bubbleView.getBubble().getKey());
mBarView.setDraggedBubble(bubbleView);
}
/**
* Notifies SystemUI to expand the selected bubble when the bubble is released.
- * @param bubbleView dragged bubble view
*/
- public void onDragRelease(@NonNull BubbleView bubbleView) {
- if (bubbleView.getBubble() == null) return;
- mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ false);
+ public void onBubbleDragRelease(BubbleBarLocation location) {
+ mSystemUiProxy.stopBubbleDrag(location, mBarView.getRestingTopPositionOnScreen());
+ }
+
+ /** Handle given bubble being dismissed */
+ public void onBubbleDismissed(BubbleView bubble) {
+ mBubbleBarController.onBubbleDismissed(bubble);
+ mBarView.removeBubble(bubble);
}
/**
- * Removes the dragged bubble view in the bubble bar view
+ * Notifies {@link BubbleBarView} that drag and all animations are finished.
*/
- public void onDragEnd() {
+ public void onBubbleDragEnd() {
mBarView.setDraggedBubble(null);
}
- /**
- * Called when bubble was dragged into the dismiss target. Notifies System
- * @param bubble dismissed bubble item
- */
- public void onDismissBubbleWhileDragging(@NonNull BubbleBarItem bubble) {
- mSystemUiProxy.removeBubble(bubble.getKey());
+ /** Notifies that dragging the bubble bar ended. */
+ public void onBubbleBarDragEnd() {
+ // we may have changed the bubble bar translation Y value from the value it had at the
+ // beginning of the drag, so update the translation Y animator state
+ mBubbleBarTranslationY.updateValue(mBarView.getTranslationY());
}
/**
- * Called when bubble stack was dragged into the dismiss target
+ * Get translation for bubble bar when drag is released.
+ *
+ * @see BubbleBarView#getBubbleBarDragReleaseTranslation(PointF, BubbleBarLocation)
*/
- public void onDismissAllBubblesWhileDragging() {
+ public PointF getBubbleBarDragReleaseTranslation(PointF initialTranslation,
+ BubbleBarLocation location) {
+ return mBarView.getBubbleBarDragReleaseTranslation(initialTranslation, location);
+ }
+
+ /**
+ * Get translation for bubble view when drag is released.
+ *
+ * @see BubbleBarView#getDraggedBubbleReleaseTranslation(PointF, BubbleBarLocation)
+ */
+ public PointF getDraggedBubbleReleaseTranslation(PointF initialTranslation,
+ BubbleBarLocation location) {
+ if (location == mBarView.getBubbleBarLocation()) {
+ return initialTranslation;
+ }
+ return mBarView.getDraggedBubbleReleaseTranslation(initialTranslation, location);
+ }
+
+ /**
+ * Notify SystemUI that the given bubble has been dismissed.
+ */
+ public void notifySysUiBubbleDismissed(@NonNull BubbleBarItem bubble) {
+ mSystemUiProxy.dragBubbleToDismiss(bubble.getKey(), mTimeSource.currentTimeMillis());
+ }
+
+ /**
+ * Called when bubble stack was dismissed
+ */
+ public void onDismissAllBubbles() {
mSystemUiProxy.removeAllBubbles();
}
@@ -515,6 +777,36 @@
*/
public interface BubbleBarBoundsChangeListener {
/** Called when bounds have changed */
- void onBoundsChanged(Rect newBounds);
+ void onBoundsChanged();
+ }
+
+ /** Interface for getting the current timestamp. */
+ interface TimeSource {
+ long currentTimeMillis();
+ }
+
+ /** Dumps the state of BubbleBarViewController. */
+ public void dump(PrintWriter pw) {
+ pw.println("Bubble bar view controller state:");
+ pw.println(" mHiddenForSysui: " + mHiddenForSysui);
+ pw.println(" mHiddenForNoBubbles: " + mHiddenForNoBubbles);
+ pw.println(" mShouldShowEducation: " + mShouldShowEducation);
+ pw.println(" mBubbleBarTranslationY.value: " + mBubbleBarTranslationY.value);
+ pw.println(" mBubbleBarSwipeUpTranslationY: " + mBubbleBarSwipeUpTranslationY);
+ if (mBarView != null) {
+ mBarView.dump(pw);
+ } else {
+ pw.println(" Bubble bar view is null!");
+ }
+ }
+
+ /** Interface for BubbleBarViewController to get the taskbar view properties. */
+ public interface TaskbarViewPropertiesProvider {
+
+ /** Returns the bounds of the taskbar. */
+ Rect getTaskbarViewBounds();
+
+ /** Returns taskbar icons alpha */
+ MultiPropertyFactory<View>.MultiProperty getIconsAlpha();
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java
index 90f1be3..e00916a 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java
@@ -15,21 +15,32 @@
*/
package com.android.launcher3.taskbar.bubbles;
+import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_BUBBLE_BAR;
+
+import android.graphics.Rect;
+import android.view.View;
+
import com.android.launcher3.taskbar.TaskbarControllers;
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController.TaskbarViewPropertiesProvider;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
+import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.RunnableList;
-/**
- * Hosts various bubble controllers to facilitate passing between one another.
- */
+import java.io.PrintWriter;
+import java.util.Optional;
+
+/** Hosts various bubble controllers to facilitate passing between one another. */
public class BubbleControllers {
public final BubbleBarController bubbleBarController;
public final BubbleBarViewController bubbleBarViewController;
public final BubbleStashController bubbleStashController;
- public final BubbleStashedHandleViewController bubbleStashedHandleViewController;
+ public final Optional<BubbleStashedHandleViewController> bubbleStashedHandleViewController;
public final BubbleDragController bubbleDragController;
public final BubbleDismissController bubbleDismissController;
public final BubbleBarPinController bubbleBarPinController;
+ public final BubblePinController bubblePinController;
+ public final BubbleCreator bubbleCreator;
private final RunnableList mPostInitRunnables = new RunnableList();
@@ -42,10 +53,12 @@
BubbleBarController bubbleBarController,
BubbleBarViewController bubbleBarViewController,
BubbleStashController bubbleStashController,
- BubbleStashedHandleViewController bubbleStashedHandleViewController,
+ Optional<BubbleStashedHandleViewController> bubbleStashedHandleViewController,
BubbleDragController bubbleDragController,
BubbleDismissController bubbleDismissController,
- BubbleBarPinController bubbleBarPinController) {
+ BubbleBarPinController bubbleBarPinController,
+ BubblePinController bubblePinController,
+ BubbleCreator bubbleCreator) {
this.bubbleBarController = bubbleBarController;
this.bubbleBarViewController = bubbleBarViewController;
this.bubbleStashController = bubbleStashController;
@@ -53,6 +66,8 @@
this.bubbleDragController = bubbleDragController;
this.bubbleDismissController = bubbleDismissController;
this.bubbleBarPinController = bubbleBarPinController;
+ this.bubblePinController = bubblePinController;
+ this.bubbleCreator = bubbleCreator;
}
/**
@@ -61,13 +76,34 @@
* in constructors for now, as some controllers may still be waiting for init().
*/
public void init(TaskbarControllers taskbarControllers) {
- bubbleBarController.init(taskbarControllers, this);
- bubbleBarViewController.init(taskbarControllers, this);
- bubbleStashedHandleViewController.init(taskbarControllers, this);
- bubbleStashController.init(taskbarControllers, this);
+ bubbleBarController.init(this,
+ taskbarControllers.navbarButtonsViewController::isImeVisible);
+ bubbleStashedHandleViewController.ifPresent(
+ controller -> controller.init(/* bubbleControllers = */ this));
+ bubbleStashController.init(
+ taskbarControllers.taskbarInsetsController,
+ bubbleBarViewController,
+ bubbleStashedHandleViewController.orElse(null),
+ taskbarControllers::runAfterInit
+ );
+ bubbleBarViewController.init(taskbarControllers, /* bubbleControllers = */ this,
+ new TaskbarViewPropertiesProvider() {
+ @Override
+ public Rect getTaskbarViewBounds() {
+ return taskbarControllers.taskbarViewController.getIconLayoutBounds();
+ }
+
+ @Override
+ public MultiPropertyFactory<View>.MultiProperty getIconsAlpha() {
+ return taskbarControllers.taskbarViewController
+ .getTaskbarIconAlpha()
+ .get(ALPHA_INDEX_BUBBLE_BAR);
+ }
+ });
bubbleDragController.init(/* bubbleControllers = */ this);
bubbleDismissController.init(/* bubbleControllers = */ this);
bubbleBarPinController.init(this);
+ bubblePinController.init(this);
mPostInitRunnables.executeAllAndDestroy();
}
@@ -86,7 +122,12 @@
* Cleans up all controllers.
*/
public void onDestroy() {
- bubbleStashedHandleViewController.onDestroy();
+ bubbleStashedHandleViewController.ifPresent(BubbleStashedHandleViewController::onDestroy);
bubbleBarController.onDestroy();
}
+
+ /** Dumps bubble controllers state. */
+ public void dump(PrintWriter pw) {
+ bubbleBarViewController.dump(pw);
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleCreator.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleCreator.java
new file mode 100644
index 0000000..8e9a2f6
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleCreator.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles;
+
+import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_GET_PERSONS_DATA;
+import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_CACHED;
+import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC;
+import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER;
+
+import static com.android.launcher3.icons.FastBitmapDrawable.WHITE_SCRIM_ALPHA;
+
+import android.annotation.Nullable;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.LauncherApps;
+import android.content.pm.PackageManager;
+import android.content.pm.ShortcutInfo;
+import android.content.res.TypedArray;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Path;
+import android.graphics.drawable.AdaptiveIconDrawable;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.InsetDrawable;
+import android.os.UserHandle;
+import android.util.Log;
+import android.util.PathParser;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+import androidx.appcompat.content.res.AppCompatResources;
+
+import com.android.internal.graphics.ColorUtils;
+import com.android.launcher3.R;
+import com.android.launcher3.icons.BitmapInfo;
+import com.android.launcher3.icons.BubbleIconFactory;
+import com.android.launcher3.shortcuts.ShortcutRequest;
+import com.android.wm.shell.common.bubbles.BubbleInfo;
+
+/**
+ * Loads the necessary info to populate / present a bubble (name, icon, shortcut).
+ */
+public class BubbleCreator {
+
+ private static final String TAG = BubbleCreator.class.getSimpleName();
+
+ private final Context mContext;
+ private final LauncherApps mLauncherApps;
+ private final BubbleIconFactory mIconFactory;
+
+ public BubbleCreator(Context context) {
+ mContext = context;
+ mLauncherApps = mContext.getSystemService(LauncherApps.class);
+ mIconFactory = new BubbleIconFactory(context,
+ context.getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size),
+ context.getResources().getDimensionPixelSize(R.dimen.bubblebar_badge_size),
+ context.getResources().getColor(R.color.important_conversation),
+ context.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.importance_ring_stroke_width));
+ }
+
+ /**
+ * Creates a BubbleBarBubble object, including the view if needed, and populates it with
+ * the info needed for presentation.
+ *
+ * @param context the context to use for inflation.
+ * @param info the info to use to populate the bubble.
+ * @param barView the parent view for the bubble (bubble is not added to the view).
+ * @param existingBubble if a bubble exists already, this object gets updated with the new
+ * info & returned (& any existing views are reused instead of inflating
+ * new ones.
+ */
+ @Nullable
+ public BubbleBarBubble populateBubble(Context context, BubbleInfo info, ViewGroup barView,
+ @Nullable BubbleBarBubble existingBubble) {
+ String appName;
+ Bitmap badgeBitmap;
+ Bitmap bubbleBitmap;
+ Path dotPath;
+ int dotColor;
+
+ boolean isImportantConvo = info.isImportantConversation();
+
+ ShortcutRequest.QueryResult result = new ShortcutRequest(context,
+ new UserHandle(info.getUserId()))
+ .forPackage(info.getPackageName(), info.getShortcutId())
+ .query(FLAG_MATCH_DYNAMIC
+ | FLAG_MATCH_PINNED_BY_ANY_LAUNCHER
+ | FLAG_MATCH_CACHED
+ | FLAG_GET_PERSONS_DATA);
+
+ ShortcutInfo shortcutInfo = result.size() > 0 ? result.get(0) : null;
+ if (shortcutInfo == null) {
+ Log.w(TAG, "No shortcutInfo found for bubble: " + info.getKey()
+ + " with shortcutId: " + info.getShortcutId());
+ }
+
+ ApplicationInfo appInfo;
+ try {
+ appInfo = mLauncherApps.getApplicationInfo(
+ info.getPackageName(),
+ 0,
+ new UserHandle(info.getUserId()));
+ } catch (PackageManager.NameNotFoundException e) {
+ // If we can't find package... don't think we should show the bubble.
+ Log.w(TAG, "Unable to find packageName: " + info.getPackageName());
+ return null;
+ }
+ if (appInfo == null) {
+ Log.w(TAG, "Unable to find appInfo: " + info.getPackageName());
+ return null;
+ }
+ PackageManager pm = context.getPackageManager();
+ appName = String.valueOf(appInfo.loadLabel(pm));
+ Drawable appIcon = appInfo.loadUnbadgedIcon(pm);
+ Drawable badgedIcon = pm.getUserBadgedIcon(appIcon, new UserHandle(info.getUserId()));
+
+ // Badged bubble image
+ Drawable bubbleDrawable = mIconFactory.getBubbleDrawable(context, shortcutInfo,
+ info.getIcon());
+ if (bubbleDrawable == null) {
+ // Default to app icon
+ bubbleDrawable = appIcon;
+ }
+
+ BitmapInfo badgeBitmapInfo = mIconFactory.getBadgeBitmap(badgedIcon, isImportantConvo);
+ badgeBitmap = badgeBitmapInfo.icon;
+
+ float[] bubbleBitmapScale = new float[1];
+ bubbleBitmap = mIconFactory.getBubbleBitmap(bubbleDrawable, bubbleBitmapScale);
+
+ // Dot color & placement
+ Path iconPath = PathParser.createPathFromPathData(
+ context.getResources().getString(
+ com.android.internal.R.string.config_icon_mask));
+ Matrix matrix = new Matrix();
+ float scale = bubbleBitmapScale[0];
+ float radius = BubbleView.DEFAULT_PATH_SIZE / 2f;
+ matrix.setScale(scale /* x scale */, scale /* y scale */, radius /* pivot x */,
+ radius /* pivot y */);
+ iconPath.transform(matrix);
+ dotPath = iconPath;
+ dotColor = ColorUtils.blendARGB(badgeBitmapInfo.color,
+ Color.WHITE, WHITE_SCRIM_ALPHA / 255f);
+
+ if (existingBubble == null) {
+ LayoutInflater inflater = LayoutInflater.from(context);
+ BubbleView bubbleView = (BubbleView) inflater.inflate(
+ R.layout.bubblebar_item_view, barView, false /* attachToRoot */);
+
+ BubbleBarBubble bubble = new BubbleBarBubble(info, bubbleView,
+ badgeBitmap, bubbleBitmap, dotColor, dotPath, appName);
+ bubbleView.setBubble(bubble);
+ return bubble;
+ } else {
+ // If we already have a bubble (so it already has an inflated view), update it.
+ existingBubble.setInfo(info);
+ existingBubble.setBadge(badgeBitmap);
+ existingBubble.setIcon(bubbleBitmap);
+ existingBubble.setDotColor(dotColor);
+ existingBubble.setDotPath(dotPath);
+ existingBubble.setAppName(appName);
+ return existingBubble;
+ }
+ }
+
+ /**
+ * Creates the overflow view shown in the bubble bar.
+ *
+ * @param barView the parent view for the bubble (bubble is not added to the view).
+ */
+ public BubbleBarOverflow createOverflow(ViewGroup barView) {
+ Bitmap bitmap = createOverflowBitmap();
+ LayoutInflater inflater = LayoutInflater.from(mContext);
+ BubbleView bubbleView = (BubbleView) inflater.inflate(
+ R.layout.bubble_bar_overflow_button, barView, false /* attachToRoot */);
+ BubbleBarOverflow overflow = new BubbleBarOverflow(bubbleView);
+ bubbleView.setOverflow(overflow, bitmap);
+ return overflow;
+ }
+
+ private Bitmap createOverflowBitmap() {
+ Drawable iconDrawable = AppCompatResources.getDrawable(mContext,
+ R.drawable.bubble_ic_overflow_button);
+
+ final TypedArray ta = mContext.obtainStyledAttributes(
+ new int[]{
+ R.attr.materialColorOnPrimaryFixed,
+ R.attr.materialColorPrimaryFixed
+ });
+ int overflowIconColor = ta.getColor(0, Color.WHITE);
+ int overflowBackgroundColor = ta.getColor(1, Color.BLACK);
+ ta.recycle();
+
+ iconDrawable.setTint(overflowIconColor);
+
+ int inset = mContext.getResources().getDimensionPixelSize(R.dimen.bubblebar_overflow_inset);
+ Drawable foreground = new InsetDrawable(iconDrawable, inset);
+ Drawable drawable = new AdaptiveIconDrawable(new ColorDrawable(overflowBackgroundColor),
+ foreground);
+
+ return mIconFactory.createBadgedIconBitmap(drawable).icon;
+ }
+
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java
index a40f33c..f554fcd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java
@@ -30,7 +30,7 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarDragLayer;
import com.android.wm.shell.common.bubbles.DismissView;
-import com.android.wm.shell.common.magnetictarget.MagnetizedObject;
+import com.android.wm.shell.shared.magnetictarget.MagnetizedObject;
/**
* Controls dismiss view presentation for the bubble bar dismiss functionality.
@@ -40,7 +40,7 @@
* @see BubbleDragController
*/
public class BubbleDismissController {
- private static final String TAG = BubbleDismissController.class.getSimpleName();
+ private static final String TAG = "BubbleDismissController";
private static final float FLING_TO_DISMISS_MIN_VELOCITY = 6000f;
private final TaskbarActivityContext mActivity;
private final TaskbarDragLayer mDragLayer;
@@ -143,10 +143,10 @@
if (mMagnetizedObject.getUnderlyingObject() instanceof BubbleView) {
BubbleView bubbleView = (BubbleView) mMagnetizedObject.getUnderlyingObject();
if (bubbleView.getBubble() != null) {
- mBubbleBarViewController.onDismissBubbleWhileDragging(bubbleView.getBubble());
+ mBubbleBarViewController.notifySysUiBubbleDismissed(bubbleView.getBubble());
}
} else if (mMagnetizedObject.getUnderlyingObject() instanceof BubbleBarView) {
- mBubbleBarViewController.onDismissAllBubblesWhileDragging();
+ mBubbleBarViewController.onDismissAllBubbles();
}
}
@@ -169,7 +169,8 @@
private void setupMagnetizedObject(@NonNull View magnetizedView) {
mMagnetizedObject = new MagnetizedObject<>(mActivity.getApplicationContext(),
- magnetizedView, DynamicAnimation.TRANSLATION_X, DynamicAnimation.TRANSLATION_Y) {
+ magnetizedView, BubbleDragController.DRAG_TRANSLATION_X,
+ DynamicAnimation.TRANSLATION_Y) {
@Override
public float getWidth(@NonNull View underlyingObject) {
return underlyingObject.getWidth() * underlyingObject.getScaleX();
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragAnimator.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragAnimator.java
index 49f114a..87f466f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragAnimator.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragAnimator.java
@@ -120,7 +120,7 @@
mBubbleAnimator
.spring(DynamicAnimation.SCALE_X, 1f)
.spring(DynamicAnimation.SCALE_Y, 1f)
- .spring(DynamicAnimation.TRANSLATION_X, restingPosition.x, velocity.x,
+ .spring(BubbleDragController.DRAG_TRANSLATION_X, restingPosition.x, velocity.x,
mTranslationConfig)
.spring(DynamicAnimation.TRANSLATION_Y, restingPosition.y, velocity.y,
mTranslationConfig)
@@ -128,7 +128,7 @@
boolean wasFling, boolean canceled, float finalValue, float finalVelocity,
boolean allRelevantPropertyAnimationsEnded) -> {
if (canceled || allRelevantPropertyAnimationsEnded) {
- resetAnimatedViews(restingPosition);
+ resetAnimatedViews(restingPosition, /* dismissed= */ false);
if (endActions != null) {
endActions.run();
}
@@ -197,7 +197,7 @@
boolean wasFling, boolean canceled, float finalValue, float finalVelocity,
boolean allRelevantPropertyAnimationsEnded) -> {
if (canceled || allRelevantPropertyAnimationsEnded) {
- resetAnimatedViews(initialPosition);
+ resetAnimatedViews(initialPosition, /* dismissed= */ true);
if (endActions != null) endActions.run();
}
})
@@ -208,11 +208,14 @@
* Reset the animated views to the initial state
*
* @param initialPosition position of the bubble
+ * @param dismissed whether the animated view was dismissed
*/
- private void resetAnimatedViews(@NonNull PointF initialPosition) {
+ private void resetAnimatedViews(@NonNull PointF initialPosition, boolean dismissed) {
mView.setScaleX(1f);
mView.setScaleY(1f);
- mView.setAlpha(1f);
+ if (!dismissed) {
+ mView.setAlpha(1f);
+ }
mView.setTranslationX(initialPosition.x);
mView.setTranslationY(initialPosition.y);
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java
index d1c9da7..54b883c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java
@@ -24,6 +24,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.dynamicanimation.animation.FloatPropertyCompat;
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.wm.shell.common.bubbles.BaseBubblePinController.LocationChangeListener;
@@ -38,11 +39,45 @@
* Restores initial position of dragged view if released outside of the dismiss target.
*/
public class BubbleDragController {
+
+ /**
+ * Property to update dragged bubble x-translation value.
+ * <p>
+ * When applied to {@link BubbleView}, will use set the translation through
+ * {@link BubbleView#getDragTranslationX()} and {@link BubbleView#setDragTranslationX(float)}
+ * methods.
+ * <p>
+ * When applied to {@link BubbleBarView}, will use {@link View#getTranslationX()} and
+ * {@link View#setTranslationX(float)}.
+ */
+ public static final FloatPropertyCompat<View> DRAG_TRANSLATION_X = new FloatPropertyCompat<>(
+ "dragTranslationX") {
+ @Override
+ public float getValue(View view) {
+ if (view instanceof BubbleView bubbleView) {
+ return bubbleView.getDragTranslationX();
+ }
+ return view.getTranslationX();
+ }
+
+ @Override
+ public void setValue(View view, float value) {
+ if (view instanceof BubbleView bubbleView) {
+ bubbleView.setDragTranslationX(value);
+ } else {
+ view.setTranslationX(value);
+ }
+ }
+ };
+
private final TaskbarActivityContext mActivity;
private BubbleBarController mBubbleBarController;
private BubbleBarViewController mBubbleBarViewController;
private BubbleDismissController mBubbleDismissController;
private BubbleBarPinController mBubbleBarPinController;
+ private BubblePinController mBubblePinController;
+
+ private boolean mIsDragging;
public BubbleDragController(TaskbarActivityContext activity) {
mActivity = activity;
@@ -58,8 +93,14 @@
mBubbleBarViewController = bubbleControllers.bubbleBarViewController;
mBubbleDismissController = bubbleControllers.bubbleDismissController;
mBubbleBarPinController = bubbleControllers.bubbleBarPinController;
+ mBubblePinController = bubbleControllers.bubblePinController;
mBubbleDismissController.setListener(
- stuck -> mBubbleBarPinController.setDropTargetHidden(stuck));
+ stuck -> {
+ if (stuck) {
+ mBubbleBarPinController.onStuckToDismissTarget();
+ mBubblePinController.onStuckToDismissTarget();
+ }
+ });
}
/**
@@ -73,19 +114,62 @@
}
bubbleView.setOnTouchListener(new BubbleTouchListener() {
+
+ private BubbleBarLocation mReleasedLocation = BubbleBarLocation.DEFAULT;
+
+ private final LocationChangeListener mLocationChangeListener =
+ new LocationChangeListener() {
+ @Override
+ public void onChange(@NonNull BubbleBarLocation location) {
+ mBubbleBarController.animateBubbleBarLocation(location);
+ }
+
+ @Override
+ public void onRelease(@NonNull BubbleBarLocation location) {
+ mReleasedLocation = location;
+ }
+ };
+
@Override
void onDragStart() {
- mBubbleBarViewController.onDragStart(bubbleView);
+ mBubblePinController.setListener(mLocationChangeListener);
+ mBubbleBarViewController.onBubbleDragStart(bubbleView);
+ mBubblePinController.onDragStart(
+ mBubbleBarViewController.getBubbleBarLocation().isOnLeft(
+ bubbleView.isLayoutRtl()));
}
@Override
- void onDragEnd() {
- mBubbleBarViewController.onDragEnd();
+ protected void onDragUpdate(float x, float y, float newTx, float newTy) {
+ bubbleView.setDragTranslationX(newTx);
+ bubbleView.setTranslationY(newTy);
+ mBubblePinController.onDragUpdate(x, y);
}
@Override
protected void onDragRelease() {
- mBubbleBarViewController.onDragRelease(bubbleView);
+ mBubblePinController.onDragEnd();
+ mBubbleBarViewController.onBubbleDragRelease(mReleasedLocation);
+ }
+
+ @Override
+ protected void onDragDismiss() {
+ mBubblePinController.onDragEnd();
+ mBubbleBarViewController.onBubbleDismissed(bubbleView);
+ mBubbleBarViewController.onBubbleDragEnd();
+ }
+
+ @Override
+ void onDragEnd() {
+ mBubbleBarController.updateBubbleBarLocation(mReleasedLocation);
+ mBubbleBarViewController.onBubbleDragEnd();
+ mBubblePinController.setListener(null);
+ }
+
+ @Override
+ protected PointF getRestingPosition() {
+ return mBubbleBarViewController.getDraggedBubbleReleaseTranslation(
+ getInitialPosition(), mReleasedLocation);
}
});
}
@@ -98,16 +182,10 @@
PointF initialRelativePivot = new PointF();
bubbleBarView.setOnTouchListener(new BubbleTouchListener() {
- @Nullable
- private BubbleBarLocation mReleasedLocation;
+ private BubbleBarLocation mReleasedLocation = BubbleBarLocation.DEFAULT;
private final LocationChangeListener mLocationChangeListener =
- new LocationChangeListener() {
- @Override
- public void onRelease(@NonNull BubbleBarLocation location) {
- mReleasedLocation = location;
- }
- };
+ location -> mReleasedLocation = location;
@Override
protected boolean onTouchDown(@NonNull View view, @NonNull MotionEvent event) {
@@ -129,7 +207,9 @@
}
@Override
- protected void onDragUpdate(float x, float y) {
+ protected void onDragUpdate(float x, float y, float newTx, float newTy) {
+ bubbleBarView.setTranslationX(newTx);
+ bubbleBarView.setTranslationY(newTy);
mBubbleBarPinController.onDragUpdate(x, y);
}
@@ -145,24 +225,33 @@
@Override
void onDragEnd() {
+ // Make sure to update location as the first thing. Pivot update causes a relayout
+ mBubbleBarController.updateBubbleBarLocation(mReleasedLocation);
+ bubbleBarView.setIsDragging(false);
// Restoring the initial pivot for the bubble bar view
bubbleBarView.setRelativePivot(initialRelativePivot.x, initialRelativePivot.y);
- bubbleBarView.setIsDragging(false);
- mBubbleBarController.updateBubbleBarLocation(mReleasedLocation);
+ mBubbleBarViewController.onBubbleBarDragEnd();
+ mBubbleBarPinController.setListener(null);
}
@Override
protected PointF getRestingPosition() {
- if (mReleasedLocation == null
- || mReleasedLocation == bubbleBarView.getBubbleBarLocation()) {
- return getInitialPosition();
- }
- return bubbleBarView.getBubbleBarDragReleaseTranslation(getInitialPosition(),
- mReleasedLocation);
+ return mBubbleBarViewController.getBubbleBarDragReleaseTranslation(
+ getInitialPosition(), mReleasedLocation);
}
});
}
+ /** Whether there is an item being dragged or not. */
+ public boolean isDragging() {
+ return mIsDragging;
+ }
+
+ /** Sets whether something is being dragged or not. */
+ public void setIsDragging(boolean isDragging) {
+ mIsDragging = isDragging;
+ }
+
/**
* Bubble touch listener for handling a single bubble view or bubble bar view while dragging.
* The dragging starts after "shorter" long click (the long click duration might change):
@@ -224,8 +313,7 @@
* Called when bubble is dragged to new coordinates.
* Not called while bubble is stuck to the dismiss target.
*/
- protected void onDragUpdate(float x, float y) {
- }
+ protected abstract void onDragUpdate(float x, float y, float newTx, float newTy);
/**
* Called when the dragging interaction has ended and all the animations have completed
@@ -360,6 +448,7 @@
private void startDragging(@NonNull View view) {
onDragStart();
+ BubbleDragController.this.setIsDragging(true);
mActivity.setTaskbarWindowFullscreen(true);
mAnimator = new BubbleDragAnimator(view);
mAnimator.animateFocused();
@@ -370,12 +459,13 @@
private void drag(@NonNull View view, @NonNull MotionEvent event, float dx, float dy,
float x, float y) {
if (mBubbleDismissController.handleTouchEvent(event)) return;
- view.setTranslationX(mViewInitialPosition.x + dx);
- view.setTranslationY(mViewInitialPosition.y + dy);
- onDragUpdate(x, y);
+ final float newTx = mViewInitialPosition.x + dx;
+ final float newTy = mViewInitialPosition.y + dy;
+ onDragUpdate(x, y, newTx, newTy);
}
private void stopDragging(@NonNull View view, @NonNull MotionEvent event) {
+ BubbleDragController.this.setIsDragging(false);
Runnable onComplete = () -> {
mActivity.setTaskbarWindowFullscreen(false);
cleanUp(view);
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubblePinController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubblePinController.kt
new file mode 100644
index 0000000..1341b53
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubblePinController.kt
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.graphics.Point
+import android.view.Gravity.BOTTOM
+import android.view.Gravity.LEFT
+import android.view.Gravity.RIGHT
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.FrameLayout
+import androidx.core.view.updateLayoutParams
+import com.android.launcher3.R
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController
+import com.android.wm.shell.common.bubbles.BaseBubblePinController
+import com.android.wm.shell.common.bubbles.BubbleBarLocation
+
+/** Controller to manage pinning bubble bar to left or right when dragging starts from a bubble */
+class BubblePinController(
+ private val context: Context,
+ private val container: FrameLayout,
+ screenSizeProvider: () -> Point
+) : BaseBubblePinController(screenSizeProvider) {
+
+ var dropTargetSize: Point? = null
+
+ private lateinit var bubbleBarViewController: BubbleBarViewController
+ private lateinit var bubbleStashController: BubbleStashController
+ private var exclRectWidth: Float = 0f
+ private var exclRectHeight: Float = 0f
+
+ private var dropTargetView: View? = null
+ // Fallback width and height in case shell has not sent the size over
+ private var dropTargetDefaultWidth: Int = 0
+ private var dropTargetDefaultHeight: Int = 0
+ private var dropTargetMargin: Int = 0
+
+ fun init(bubbleControllers: BubbleControllers) {
+ bubbleBarViewController = bubbleControllers.bubbleBarViewController
+ bubbleStashController = bubbleControllers.bubbleStashController
+ exclRectWidth = context.resources.getDimension(R.dimen.bubblebar_dismiss_zone_width)
+ exclRectHeight = context.resources.getDimension(R.dimen.bubblebar_dismiss_zone_height)
+ dropTargetDefaultWidth =
+ context.resources.getDimensionPixelSize(
+ R.dimen.bubble_expanded_view_drop_target_default_width
+ )
+ dropTargetDefaultHeight =
+ context.resources.getDimensionPixelSize(
+ R.dimen.bubble_expanded_view_drop_target_default_height
+ )
+ dropTargetMargin =
+ context.resources.getDimensionPixelSize(R.dimen.bubble_expanded_view_drop_target_margin)
+ }
+
+ override fun getExclusionRectWidth(): Float {
+ return exclRectWidth
+ }
+
+ override fun getExclusionRectHeight(): Float {
+ return exclRectHeight
+ }
+
+ override fun getDropTargetView(): View? {
+ return dropTargetView
+ }
+
+ override fun removeDropTargetView(view: View) {
+ container.removeView(view)
+ dropTargetView = null
+ }
+
+ override fun createDropTargetView(): View {
+ return LayoutInflater.from(context)
+ .inflate(R.layout.bubble_expanded_view_drop_target, container, false)
+ .also { view ->
+ dropTargetView = view
+ container.addView(view)
+ }
+ }
+
+ @SuppressLint("RtlHardcoded")
+ override fun updateLocation(location: BubbleBarLocation) {
+ val onLeft = location.isOnLeft(container.isLayoutRtl)
+
+ val bubbleBarBounds = bubbleBarViewController.bubbleBarBounds
+ dropTargetView?.updateLayoutParams<FrameLayout.LayoutParams> {
+ gravity = BOTTOM or (if (onLeft) LEFT else RIGHT)
+ width = dropTargetSize?.x ?: dropTargetDefaultWidth
+ height = dropTargetSize?.y ?: dropTargetDefaultHeight
+ bottomMargin =
+ -bubbleStashController.bubbleBarTranslationY.toInt() +
+ bubbleBarBounds.height() +
+ dropTargetMargin
+ }
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java
deleted file mode 100644
index f689a05..0000000
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.taskbar.bubbles;
-
-import static java.lang.Math.abs;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
-import android.annotation.Nullable;
-import android.view.InsetsController;
-import android.view.MotionEvent;
-import android.view.View;
-
-import com.android.launcher3.R;
-import com.android.launcher3.anim.AnimatedFloat;
-import com.android.launcher3.taskbar.StashedHandleViewController;
-import com.android.launcher3.taskbar.TaskbarActivityContext;
-import com.android.launcher3.taskbar.TaskbarControllers;
-import com.android.launcher3.taskbar.TaskbarInsetsController;
-import com.android.launcher3.taskbar.TaskbarStashController;
-import com.android.launcher3.util.MultiPropertyFactory;
-import com.android.wm.shell.common.bubbles.BubbleBarLocation;
-import com.android.wm.shell.shared.animation.PhysicsAnimator;
-
-/**
- * Coordinates between controllers such as BubbleBarView and BubbleHandleViewController to
- * create a cohesive animation between stashed/unstashed states.
- */
-public class BubbleStashController {
-
- private static final String TAG = BubbleStashController.class.getSimpleName();
-
- /**
- * How long to stash/unstash.
- */
- public static final long BAR_STASH_DURATION = InsetsController.ANIMATION_DURATION_RESIZE;
-
- /**
- * The scale bubble bar animates to when being stashed.
- */
- private static final float STASHED_BAR_SCALE = 0.5f;
-
- protected final TaskbarActivityContext mActivity;
-
- // Initialized in init.
- private TaskbarControllers mControllers;
- private TaskbarInsetsController mTaskbarInsetsController;
- private BubbleBarViewController mBarViewController;
- private BubbleStashedHandleViewController mHandleViewController;
- private TaskbarStashController mTaskbarStashController;
-
- private MultiPropertyFactory.MultiProperty mIconAlphaForStash;
- private AnimatedFloat mIconScaleForStash;
- private AnimatedFloat mIconTranslationYForStash;
- private MultiPropertyFactory.MultiProperty mBubbleStashedHandleAlpha;
-
- private boolean mRequestedStashState;
- private boolean mRequestedExpandedState;
-
- private boolean mIsStashed;
- private int mStashedHeight;
- private int mUnstashedHeight;
- private boolean mBubblesShowingOnHome;
- private boolean mBubblesShowingOnOverview;
- private boolean mIsSysuiLocked;
-
- private final float mHandleCenterFromScreenBottom;
-
- @Nullable
- private AnimatorSet mAnimator;
-
- public BubbleStashController(TaskbarActivityContext activity) {
- mActivity = activity;
- // the handle is centered within the stashed taskbar area
- mHandleCenterFromScreenBottom =
- mActivity.getResources().getDimensionPixelSize(R.dimen.bubblebar_stashed_size) / 2f;
- }
-
- public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) {
- mControllers = controllers;
- mTaskbarInsetsController = controllers.taskbarInsetsController;
- mBarViewController = bubbleControllers.bubbleBarViewController;
- mHandleViewController = bubbleControllers.bubbleStashedHandleViewController;
- mTaskbarStashController = controllers.taskbarStashController;
-
- mIconAlphaForStash = mBarViewController.getBubbleBarAlpha().get(0);
- mIconScaleForStash = mBarViewController.getBubbleBarScale();
- mIconTranslationYForStash = mBarViewController.getBubbleBarTranslationY();
-
- mBubbleStashedHandleAlpha = mHandleViewController.getStashedHandleAlpha().get(
- StashedHandleViewController.ALPHA_INDEX_STASHED);
-
- mStashedHeight = mHandleViewController.getStashedHeight();
- mUnstashedHeight = mHandleViewController.getUnstashedHeight();
- }
-
- /**
- * Returns the touchable height of the bubble bar based on it's stashed state.
- */
- public int getTouchableHeight() {
- return mIsStashed ? mStashedHeight : mUnstashedHeight;
- }
-
- /**
- * Returns whether the bubble bar is currently stashed.
- */
- public boolean isStashed() {
- return mIsStashed;
- }
-
- /**
- * Animates the bubble bar and handle to their initial state, transitioning from the state where
- * both views are invisible. Called when the first bubble is added or when the device is
- * unlocked.
- *
- * <p>Normally either the bubble bar or the handle is visible,
- * and {@link #showBubbleBar(boolean)} and {@link #stashBubbleBar()} are used to transition
- * between these two states. But the transition from the state where both the bar and handle
- * are invisible is slightly different.
- *
- * <p>The initial state will depend on the current state of the device, i.e. overview, home etc
- * and whether bubbles are requested to be expanded.
- */
- public void animateToInitialState(boolean expanding) {
- AnimatorSet animatorSet = new AnimatorSet();
- if (expanding || mBubblesShowingOnHome || mBubblesShowingOnOverview) {
- mIsStashed = false;
- animatorSet.playTogether(mIconScaleForStash.animateToValue(1),
- mIconTranslationYForStash.animateToValue(getBubbleBarTranslationY()),
- mIconAlphaForStash.animateToValue(1));
- } else {
- mIsStashed = true;
- animatorSet.playTogether(mBubbleStashedHandleAlpha.animateToValue(1));
- }
-
- animatorSet.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- onIsStashedChanged();
- }
- });
- animatorSet.setDuration(BAR_STASH_DURATION).start();
- }
-
- /**
- * Called when launcher enters or exits the home page. Bubbles are unstashed on home.
- */
- public void setBubblesShowingOnHome(boolean onHome) {
- if (mBubblesShowingOnHome != onHome) {
- mBubblesShowingOnHome = onHome;
-
- if (!mBarViewController.hasBubbles()) {
- // if there are no bubbles, there's nothing to show, so just return.
- return;
- }
-
- if (mBubblesShowingOnHome) {
- showBubbleBar(/* expanded= */ false);
- // When transitioning from app to home the stash animator may already have been
- // created, so we need to animate the bubble bar here to align with hotseat.
- if (!mIsStashed) {
- mIconTranslationYForStash.animateToValue(getBubbleBarTranslationYForHotseat())
- .start();
- }
- // If the bubble bar is already unstashed, the taskbar touchable region won't be
- // updated correctly, so force an update here.
- mControllers.runAfterInit(() ->
- mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged());
- } else if (!mBarViewController.isExpanded()) {
- stashBubbleBar();
- }
- }
- }
-
- /** Whether bubbles are showing on the launcher home page. */
- public boolean isBubblesShowingOnHome() {
- return mBubblesShowingOnHome;
- }
-
- // TODO: when tapping on an app in overview, this is a bit delayed compared to taskbar stashing
- /** Called when launcher enters or exits overview. Bubbles are unstashed on overview. */
- public void setBubblesShowingOnOverview(boolean onOverview) {
- if (mBubblesShowingOnOverview != onOverview) {
- mBubblesShowingOnOverview = onOverview;
- if (!mBubblesShowingOnOverview && !mBarViewController.isExpanded()) {
- stashBubbleBar();
- } else {
- // When transitioning to overview the stash animator may already have been
- // created, so we need to animate the bubble bar here to align with taskbar.
- mIconTranslationYForStash.animateToValue(getBubbleBarTranslationYForTaskbar())
- .start();
- }
- }
- }
-
- /** Whether bubbles are showing on Overview. */
- public boolean isBubblesShowingOnOverview() {
- return mBubblesShowingOnOverview;
- }
-
- /** Called when sysui locked state changes, when locked, bubble bar is stashed. */
- public void onSysuiLockedStateChange(boolean isSysuiLocked) {
- if (isSysuiLocked != mIsSysuiLocked) {
- mIsSysuiLocked = isSysuiLocked;
- if (!mIsSysuiLocked && mBarViewController.hasBubbles()) {
- animateToInitialState(false /* expanding */);
- }
- }
- }
-
- /**
- * Stashes the bubble bar if allowed based on other state (e.g. on home and overview the
- * bar does not stash).
- */
- public void stashBubbleBar() {
- mRequestedStashState = true;
- mRequestedExpandedState = false;
- updateStashedAndExpandedState();
- }
-
- /**
- * Shows the bubble bar, and expands bubbles depending on {@param expandBubbles}.
- */
- public void showBubbleBar(boolean expandBubbles) {
- mRequestedStashState = false;
- mRequestedExpandedState = expandBubbles;
- updateStashedAndExpandedState();
- }
-
- private void updateStashedAndExpandedState() {
- if (mBarViewController.isHiddenForNoBubbles()) {
- // If there are no bubbles the bar and handle are invisible, nothing to do here.
- return;
- }
- boolean isStashed = mRequestedStashState
- && !mBubblesShowingOnHome
- && !mBubblesShowingOnOverview;
- if (mIsStashed != isStashed) {
- mIsStashed = isStashed;
- if (mAnimator != null) {
- mAnimator.cancel();
- }
- mAnimator = createStashAnimator(mIsStashed, BAR_STASH_DURATION);
- mAnimator.start();
- onIsStashedChanged();
- }
- if (mBarViewController.isExpanded() != mRequestedExpandedState) {
- mBarViewController.setExpanded(mRequestedExpandedState);
- }
- }
-
- /**
- * Create a stash animation.
- *
- * @param isStashed whether it's a stash animation or an unstash animation
- * @param duration duration of the animation
- * @return the animation
- */
- private AnimatorSet createStashAnimator(boolean isStashed, long duration) {
- AnimatorSet animatorSet = new AnimatorSet();
-
- AnimatorSet fullLengthAnimatorSet = new AnimatorSet();
- // Not exactly half and may overlap. See [first|second]HalfDurationScale below.
- AnimatorSet firstHalfAnimatorSet = new AnimatorSet();
- AnimatorSet secondHalfAnimatorSet = new AnimatorSet();
-
- final float firstHalfDurationScale;
- final float secondHalfDurationScale;
-
- if (isStashed) {
- firstHalfDurationScale = 0.75f;
- secondHalfDurationScale = 0.5f;
-
- fullLengthAnimatorSet.play(
- mIconTranslationYForStash.animateToValue(getStashTranslation()));
-
- firstHalfAnimatorSet.playTogether(
- mIconAlphaForStash.animateToValue(0),
- mIconScaleForStash.animateToValue(STASHED_BAR_SCALE));
- secondHalfAnimatorSet.playTogether(
- mBubbleStashedHandleAlpha.animateToValue(1));
- } else {
- firstHalfDurationScale = 0.5f;
- secondHalfDurationScale = 0.75f;
-
- final float translationY = getBubbleBarTranslationY();
-
- fullLengthAnimatorSet.playTogether(
- mIconScaleForStash.animateToValue(1),
- mIconTranslationYForStash.animateToValue(translationY));
-
- firstHalfAnimatorSet.playTogether(
- mBubbleStashedHandleAlpha.animateToValue(0)
- );
- secondHalfAnimatorSet.playTogether(
- mIconAlphaForStash.animateToValue(1)
- );
- }
-
- fullLengthAnimatorSet.play(mHandleViewController.createRevealAnimToIsStashed(isStashed));
-
- fullLengthAnimatorSet.setDuration(duration);
- firstHalfAnimatorSet.setDuration((long) (duration * firstHalfDurationScale));
- secondHalfAnimatorSet.setDuration((long) (duration * secondHalfDurationScale));
- secondHalfAnimatorSet.setStartDelay((long) (duration * (1 - secondHalfDurationScale)));
-
- animatorSet.playTogether(fullLengthAnimatorSet, firstHalfAnimatorSet,
- secondHalfAnimatorSet);
- animatorSet.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mAnimator = null;
- mControllers.runAfterInit(() -> {
- if (isStashed) {
- mBarViewController.setExpanded(false);
- }
- mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
- });
- }
- });
- return animatorSet;
- }
-
- private float getStashTranslation() {
- return (mUnstashedHeight - mStashedHeight) / 2f;
- }
-
- private void onIsStashedChanged() {
- mControllers.runAfterInit(() -> {
- mHandleViewController.onIsStashedChanged();
- mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
- });
- }
-
- public float getBubbleBarTranslationYForTaskbar() {
- return -mActivity.getDeviceProfile().taskbarBottomMargin;
- }
-
- private float getBubbleBarTranslationYForHotseat() {
- final float hotseatBottomSpace = mActivity.getDeviceProfile().hotseatBarBottomSpacePx;
- final float hotseatCellHeight = mActivity.getDeviceProfile().hotseatCellHeightPx;
- return -hotseatBottomSpace - hotseatCellHeight + mUnstashedHeight - abs(
- hotseatCellHeight - mUnstashedHeight) / 2;
- }
-
- public float getBubbleBarTranslationY() {
- // If we're on home, adjust the translation so the bubble bar aligns with hotseat.
- // Otherwise we're either showing in an app or in overview. In either case adjust it so
- // the bubble bar aligns with the taskbar.
- return mBubblesShowingOnHome ? getBubbleBarTranslationYForHotseat()
- : getBubbleBarTranslationYForTaskbar();
- }
-
- /**
- * The difference on the Y axis between the center of the handle and the center of the bubble
- * bar.
- */
- public float getDiffBetweenHandleAndBarCenters() {
- // the difference between the centers of the handle and the bubble bar is the difference
- // between their distance from the bottom of the screen.
-
- float barCenter = mBarViewController.getBubbleBarCollapsedHeight() / 2f;
- return mHandleCenterFromScreenBottom - barCenter;
- }
-
- /** The distance the handle moves as part of the new bubble animation. */
- public float getStashedHandleTranslationForNewBubbleAnimation() {
- // the should move up to the top of the stashed taskbar area. it is centered within it so
- // it should move the same distance as it is away from the bottom.
- return -mHandleCenterFromScreenBottom;
- }
-
- /** Checks whether the motion event is over the stash handle. */
- public boolean isEventOverStashHandle(MotionEvent ev) {
- return mHandleViewController.isEventOverHandle(ev);
- }
-
- /** Set a bubble bar location */
- public void setBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
- mHandleViewController.setBubbleBarLocation(bubbleBarLocation);
- }
-
- /** Returns the [PhysicsAnimator] for the stashed handle view. */
- public PhysicsAnimator<View> getStashedHandlePhysicsAnimator() {
- return mHandleViewController.getPhysicsAnimator();
- }
-
- /** Notifies taskbar that it should update its touchable region. */
- public void updateTaskbarTouchRegion() {
- mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
- }
-
- /** Shows the bubble bar immediately without animation. */
- public void showBubbleBarImmediate() {
- mHandleViewController.setTranslationYForSwipe(0);
- mIconTranslationYForStash.updateValue(getBubbleBarTranslationY());
- mIconAlphaForStash.setValue(1);
- mIconScaleForStash.updateValue(1);
- mIsStashed = false;
- onIsStashedChanged();
- }
-
- /** Stashes the bubble bar immediately without animation. */
- public void stashBubbleBarImmediate() {
- mHandleViewController.setTranslationYForSwipe(0);
- mIconAlphaForStash.setValue(0);
- mIconTranslationYForStash.updateValue(getStashTranslation());
- mIconScaleForStash.updateValue(STASHED_BAR_SCALE);
- mIsStashed = true;
- onIsStashedChanged();
- }
-}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java
index 91103d7..6bfe8f4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java
@@ -33,7 +33,7 @@
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.taskbar.StashedHandleView;
import com.android.launcher3.taskbar.TaskbarActivityContext;
-import com.android.launcher3.taskbar.TaskbarControllers;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.MultiValueAlpha;
@@ -79,7 +79,8 @@
mStashedHandleAlpha = new MultiValueAlpha(mStashedHandleView, 1);
}
- public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) {
+ /** Initialize controller. */
+ public void init(BubbleControllers bubbleControllers) {
mBarViewController = bubbleControllers.bubbleBarViewController;
mBubbleStashController = bubbleControllers.bubbleStashController;
@@ -117,7 +118,7 @@
public Rect getSampledRegion(View sampledView) {
return mStashedHandleView.getSampledRegion();
}
- }, Executors.UI_HELPER_EXECUTOR);
+ }, Executors.MAIN_EXECUTOR, Executors.UI_HELPER_EXECUTOR);
mStashedHandleView.addOnLayoutChangeListener((view, i, i1, i2, i3, i4, i5, i6, i7) ->
updateBounds(mBarViewController.getBubbleBarLocation()));
@@ -244,6 +245,11 @@
mStashedHandleView.setTranslationY(transY);
}
+ /** Returns the translation of the stashed handle. */
+ public float getTranslationY() {
+ return mStashedHandleView.getTranslationY();
+ }
+
/**
* Used by {@link BubbleStashController} to animate the handle when stashing or un stashing.
*/
@@ -292,15 +298,11 @@
}
// the bounds of the handle only include the visible part, so we check that the Y coordinate
- // is anywhere within the stashed taskbar height.
- int top = mActivity.getDeviceProfile().heightPx - mStashedTaskbarHeight;
-
- return (int) ev.getRawY() >= top && containsX((int) ev.getRawX());
- }
-
- /** Checks if the given x coordinate is within the stashed handle bounds. */
- public boolean containsX(int x) {
- return x >= mStashedHandleBounds.left && x <= mStashedHandleBounds.right;
+ // is anywhere within the stashed height of bubble bar (same as taskbar stashed height).
+ final int top = mActivity.getDeviceProfile().heightPx - mStashedTaskbarHeight;
+ final float x = ev.getRawX();
+ return ev.getRawY() >= top && x >= mStashedHandleBounds.left
+ && x <= mStashedHandleBounds.right;
}
/** Set a bubble bar location */
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java
index bcdc718..eb3b24b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleView.java
@@ -16,25 +16,27 @@
package com.android.launcher3.taskbar.bubbles;
import android.annotation.Nullable;
+import android.app.Notification;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Outline;
+import android.graphics.Path;
import android.graphics.Rect;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewOutlineProvider;
+import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ImageView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.android.launcher3.R;
import com.android.launcher3.icons.DotRenderer;
-import com.android.launcher3.icons.IconNormalizer;
-import com.android.wm.shell.animation.Interpolators;
-
-import java.util.EnumSet;
+import com.android.wm.shell.common.bubbles.BubbleBarLocation;
+import com.android.wm.shell.common.bubbles.BubbleInfo;
+import com.android.wm.shell.shared.animation.Interpolators;
// TODO: (b/276978250) This is will be similar to WMShell's BadgedImageView, it'd be nice to share.
@@ -46,25 +48,12 @@
public static final int DEFAULT_PATH_SIZE = 100;
- /**
- * Flags that suppress the visibility of the 'new' dot or the app badge, for one reason or
- * another. If any of these flags are set, the dot will not be shown.
- * If {@link SuppressionFlag#BEHIND_STACK} then the app badge will not be shown.
- */
- enum SuppressionFlag {
- // TODO: (b/277815200) implement flyout
- // Suppressed because the flyout is visible - it will morph into the dot via animation.
- FLYOUT_VISIBLE,
- // Suppressed because this bubble is behind others in the collapsed stack.
- BEHIND_STACK,
- }
-
- private final EnumSet<SuppressionFlag> mSuppressionFlags =
- EnumSet.noneOf(SuppressionFlag.class);
-
private final ImageView mBubbleIcon;
private final ImageView mAppIcon;
- private final int mBubbleSize;
+ private int mBubbleSize;
+
+ private float mDragTranslationX;
+ private float mOffsetX;
private DotRenderer mDotRenderer;
private DotRenderer.DrawParams mDrawParams;
@@ -78,11 +67,22 @@
// The current scale value of the dot
private float mDotScale;
+ private boolean mProvideShadowOutline = true;
+
// TODO: (b/273310265) handle RTL
// Whether the bubbles are positioned on the left or right side of the screen
private boolean mOnLeft = false;
private BubbleBarItem mBubble;
+ private boolean mIsOverflow;
+
+ private Bitmap mIcon;
+
+ @Nullable
+ private Controller mController;
+
+ @Nullable
+ private BubbleBarBubbleIconsFactory mIconFactory = null;
public BubbleView(Context context) {
this(context, null);
@@ -103,8 +103,6 @@
setLayoutDirection(LAYOUT_DIRECTION_LTR);
LayoutInflater.from(context).inflate(R.layout.bubble_view, this);
-
- mBubbleSize = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size);
mBubbleIcon = findViewById(R.id.icon_view);
mAppIcon = findViewById(R.id.app_icon_view);
@@ -112,18 +110,56 @@
setFocusable(true);
setClickable(true);
- setOutlineProvider(new ViewOutlineProvider() {
- @Override
- public void getOutline(View view, Outline outline) {
- BubbleView.this.getOutline(outline);
- }
- });
}
- private void getOutline(Outline outline) {
- final int normalizedSize = IconNormalizer.getNormalizedCircleSize(mBubbleSize);
- final int inset = (mBubbleSize - normalizedSize) / 2;
- outline.setOval(inset, inset, inset + normalizedSize, inset + normalizedSize);
+ private void updateBubbleSizeAndDotRender() {
+ int updatedBubbleSize = Math.min(getWidth(), getHeight());
+ if (updatedBubbleSize == mBubbleSize) return;
+ mBubbleSize = updatedBubbleSize;
+ mIconFactory = new BubbleBarBubbleIconsFactory(mContext, mBubbleSize);
+ updateBubbleIcon();
+ if (mBubble == null || mBubble instanceof BubbleBarOverflow) return;
+ Path dotPath = ((BubbleBarBubble) mBubble).getDotPath();
+ mDotRenderer = new DotRenderer(mBubbleSize, dotPath, DEFAULT_PATH_SIZE);
+ }
+
+ /**
+ * Set translation-x while this bubble is being dragged.
+ * Translation applied to the view is a sum of {@code translationX} and offset defined by
+ * {@link #setOffsetX(float)}.
+ */
+ public void setDragTranslationX(float translationX) {
+ mDragTranslationX = translationX;
+ applyDragTranslation();
+ }
+
+ /**
+ * Get translation value applied via {@link #setDragTranslationX(float)}.
+ */
+ public float getDragTranslationX() {
+ return mDragTranslationX;
+ }
+
+ /**
+ * Set offset on x-axis while dragging.
+ * Used to counter parent translation in order to keep the dragged view at the current position
+ * on screen.
+ * Translation applied to the view is a sum of {@code offsetX} and translation defined by
+ * {@link #setDragTranslationX(float)}
+ */
+ public void setOffsetX(float offsetX) {
+ mOffsetX = offsetX;
+ applyDragTranslation();
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ updateBubbleSizeAndDotRender();
+ }
+
+ private void applyDragTranslation() {
+ setTranslationX(mDragTranslationX + mOffsetX);
}
@Override
@@ -144,13 +180,88 @@
mDotRenderer.draw(canvas, mDrawParams);
}
+ @Override
+ public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
+ super.onInitializeAccessibilityNodeInfoInternal(info);
+ info.addAction(AccessibilityNodeInfo.ACTION_COLLAPSE);
+ if (mBubble instanceof BubbleBarBubble) {
+ info.addAction(AccessibilityNodeInfo.ACTION_DISMISS);
+ }
+ if (mController != null) {
+ if (mController.getBubbleBarLocation().isOnLeft(isLayoutRtl())) {
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_move_right,
+ getResources().getString(R.string.bubble_bar_action_move_right)));
+ } else {
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_move_left,
+ getResources().getString(R.string.bubble_bar_action_move_left)));
+ }
+ }
+ }
+
+ @Override
+ public boolean performAccessibilityActionInternal(int action, Bundle arguments) {
+ if (super.performAccessibilityActionInternal(action, arguments)) {
+ return true;
+ }
+ if (action == AccessibilityNodeInfo.ACTION_COLLAPSE) {
+ if (mController != null) {
+ mController.collapse();
+ }
+ return true;
+ }
+ if (action == AccessibilityNodeInfo.ACTION_DISMISS) {
+ if (mController != null) {
+ mController.dismiss(this);
+ }
+ return true;
+ }
+ if (action == R.id.action_move_left) {
+ if (mController != null) {
+ mController.updateBubbleBarLocation(BubbleBarLocation.LEFT);
+ }
+ }
+ if (action == R.id.action_move_right) {
+ if (mController != null) {
+ mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT);
+ }
+ }
+ return false;
+ }
+
+ void setController(@Nullable Controller controller) {
+ mController = controller;
+ }
+
/** Sets the bubble being rendered in this view. */
public void setBubble(BubbleBarBubble bubble) {
mBubble = bubble;
- mBubbleIcon.setImageBitmap(bubble.getIcon());
+ mIcon = bubble.getIcon();
+ updateBubbleIcon();
mAppIcon.setImageBitmap(bubble.getBadge());
mDotColor = bubble.getDotColor();
mDotRenderer = new DotRenderer(mBubbleSize, bubble.getDotPath(), DEFAULT_PATH_SIZE);
+ String contentDesc = bubble.getInfo().getTitle();
+ if (TextUtils.isEmpty(contentDesc)) {
+ contentDesc = getResources().getString(R.string.bubble_bar_bubble_fallback_description);
+ }
+ String appName = bubble.getInfo().getAppName();
+ if (!TextUtils.isEmpty(appName)) {
+ contentDesc = getResources().getString(R.string.bubble_bar_bubble_description,
+ contentDesc, appName);
+ }
+ setContentDescription(contentDesc);
+ }
+
+ private void updateBubbleIcon() {
+ Bitmap icon = null;
+ if (mIcon != null) {
+ icon = mIcon;
+ if (mIconFactory != null) {
+ BitmapDrawable iconDrawable = new BitmapDrawable(getResources(), icon);
+ icon = mIconFactory.createShadowedIconBitmap(iconDrawable, /* scale = */ 1f);
+ }
+ }
+ mBubbleIcon.setImageBitmap(icon);
}
/**
@@ -161,11 +272,18 @@
*/
public void setOverflow(BubbleBarOverflow overflow, Bitmap bitmap) {
mBubble = overflow;
- mBubbleIcon.setImageBitmap(bitmap);
+ mIsOverflow = true;
+ mIcon = bitmap;
+ updateBubbleIcon();
mAppIcon.setVisibility(GONE); // Overflow doesn't show the app badge
setContentDescription(getResources().getString(R.string.bubble_bar_overflow_description));
}
+ /** Whether this view represents the overflow button. */
+ public boolean isOverflow() {
+ return mIsOverflow;
+ }
+
/** Returns the bubble being rendered in this view. */
@Nullable
public BubbleBarItem getBubble() {
@@ -173,9 +291,9 @@
}
void updateDotVisibility(boolean animate) {
- final float targetScale = shouldDrawDot() ? 1f : 0f;
+ final float targetScale = hasUnseenContent() ? 1f : 0f;
if (animate) {
- animateDotScale();
+ animateDotScale(targetScale);
} else {
mDotScale = targetScale;
mAnimatingToDotScale = targetScale;
@@ -183,73 +301,86 @@
}
}
- void updateBadgeVisibility() {
- if (mBubble instanceof BubbleBarOverflow) {
- // The overflow bubble does not have a badge, so just bail.
+ void setBadgeScale(float fraction) {
+ mAppIcon.setScaleX(fraction);
+ mAppIcon.setScaleY(fraction);
+ }
+
+ boolean hasUnseenContent() {
+ return mBubble != null
+ && mBubble instanceof BubbleBarBubble
+ && !((BubbleBarBubble) mBubble).getInfo().isNotificationSuppressed();
+ }
+
+ /**
+ * Used to determine if we can skip drawing frames.
+ *
+ * <p>Generally we should draw the dot when it is requested to be shown and there is unseen
+ * content. But when the dot is removed, we still want to draw frames so that it can be scaled
+ * out.
+ */
+ private boolean shouldDrawDot() {
+ // if there's no dot there's nothing to draw, unless the dot was removed and we're in the
+ // middle of removing it
+ return hasUnseenContent() || mDotIsAnimating;
+ }
+
+ /** Updates the dot scale to the specified fraction from 0 to 1. */
+ private void setDotScale(float fraction) {
+ if (!shouldDrawDot()) {
return;
}
- BubbleBarBubble bubble = (BubbleBarBubble) mBubble;
- Bitmap appBadgeBitmap = bubble.getBadge();
- int translationX = mOnLeft
- ? -(bubble.getIcon().getWidth() - appBadgeBitmap.getWidth())
- : 0;
- mAppIcon.setTranslationX(translationX);
- mAppIcon.setVisibility(isBehindStack() ? GONE : VISIBLE);
- }
-
- /** Sets whether this bubble is in the stack & not the first bubble. **/
- void setBehindStack(boolean behindStack, boolean animate) {
- if (behindStack) {
- mSuppressionFlags.add(SuppressionFlag.BEHIND_STACK);
- } else {
- mSuppressionFlags.remove(SuppressionFlag.BEHIND_STACK);
- }
- updateDotVisibility(animate);
- updateBadgeVisibility();
- }
-
- /** Whether this bubble is in the stack & not the first bubble. **/
- boolean isBehindStack() {
- return mSuppressionFlags.contains(SuppressionFlag.BEHIND_STACK);
- }
-
- /** Whether the dot indicating unseen content in a bubble should be shown. */
- private boolean shouldDrawDot() {
- boolean bubbleHasUnseenContent = mBubble != null
- && mBubble instanceof BubbleBarBubble
- && mSuppressionFlags.isEmpty()
- && !((BubbleBarBubble) mBubble).getInfo().isNotificationSuppressed();
-
- // Always render the dot if it's animating, since it could be animating out. Otherwise, show
- // it if the bubble wants to show it, and we aren't suppressing it.
- return bubbleHasUnseenContent || mDotIsAnimating;
- }
-
- /** How big the dot should be, fraction from 0 to 1. */
- private void setDotScale(float fraction) {
mDotScale = fraction;
invalidate();
}
- /**
- * Animates the dot to the given scale.
- */
- private void animateDotScale() {
- float toScale = shouldDrawDot() ? 1f : 0f;
- mDotIsAnimating = true;
-
- // Don't restart the animation if we're already animating to the given value.
- if (mAnimatingToDotScale == toScale || !shouldDrawDot()) {
- mDotIsAnimating = false;
+ void showDotIfNeeded(float fraction) {
+ if (!hasUnseenContent()) {
return;
}
+ setDotScale(fraction);
+ }
+ void showDotIfNeeded(boolean animate) {
+ // only show the dot if we have unseen content
+ if (!hasUnseenContent()) {
+ return;
+ }
+ if (animate) {
+ animateDotScale(1f);
+ } else {
+ setDotScale(1f);
+ }
+ }
+
+ void hideDot() {
+ animateDotScale(0f);
+ }
+
+ /** Marks this bubble such that it no longer has unseen content, and hides the dot. */
+ void markSeen() {
+ if (mBubble instanceof BubbleBarBubble bubble) {
+ BubbleInfo info = bubble.getInfo();
+ info.setFlags(
+ info.getFlags() | Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION);
+ hideDot();
+ }
+ }
+
+ /** Animates the dot to the given scale. */
+ private void animateDotScale(float toScale) {
+ boolean isDotScaleChanging = Float.compare(mDotScale, toScale) != 0;
+
+ // Don't restart the animation if we're already animating to the given value or if the dot
+ // scale is not changing
+ if ((mDotIsAnimating && mAnimatingToDotScale == toScale) || !isDotScaleChanging) {
+ return;
+ }
+ mDotIsAnimating = true;
mAnimatingToDotScale = toScale;
final boolean showDot = toScale > 0f;
- // Do NOT wait until after animation ends to setShowDot
- // to avoid overriding more recent showDot states.
clearAnimation();
animate()
.setDuration(200)
@@ -264,10 +395,24 @@
}).start();
}
-
@Override
public String toString() {
String toString = mBubble != null ? mBubble.getKey() : "null";
return "BubbleView{" + toString + "}";
}
+
+ /** Interface for BubbleView to communicate with its controller */
+ public interface Controller {
+ /** Get current bubble bar {@link BubbleBarLocation} */
+ BubbleBarLocation getBubbleBarLocation();
+
+ /** This bubble should be dismissed */
+ void dismiss(BubbleView bubble);
+
+ /** Collapse the bubble bar */
+ void collapse();
+
+ /** Request bubble bar location to be updated to the given location */
+ void updateBubbleBarLocation(BubbleBarLocation location);
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimator.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimator.kt
new file mode 100644
index 0000000..8af8ffb
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimator.kt
@@ -0,0 +1,403 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.animation
+
+import androidx.core.animation.Animator
+import androidx.core.animation.ValueAnimator
+
+/**
+ * Animates individual bubbles within the bubble bar while the bubble bar is expanded.
+ *
+ * This class should only be kept for the duration of the animation and a new instance should be
+ * created for each animation.
+ */
+class BubbleAnimator(
+ private val iconSize: Float,
+ private val expandedBarIconSpacing: Float,
+ private val bubbleCount: Int,
+ private val onLeft: Boolean,
+) {
+
+ companion object {
+ const val ANIMATION_DURATION_MS = 250L
+ }
+
+ private var state: State = State.Idle
+ private lateinit var animator: ValueAnimator
+
+ fun animateNewBubble(selectedBubbleIndex: Int, listener: Listener) {
+ animator = createAnimator(listener)
+ state = State.AddingBubble(selectedBubbleIndex)
+ animator.start()
+ }
+
+ fun animateRemovedBubble(
+ bubbleIndex: Int,
+ selectedBubbleIndex: Int,
+ removingLastBubble: Boolean,
+ listener: Listener
+ ) {
+ animator = createAnimator(listener)
+ state = State.RemovingBubble(bubbleIndex, selectedBubbleIndex, removingLastBubble)
+ animator.start()
+ }
+
+ fun animateNewAndRemoveOld(
+ selectedBubbleIndex: Int,
+ removedBubbleIndex: Int,
+ listener: Listener
+ ) {
+ animator = createAnimator(listener)
+ state =
+ State.AddingAndRemoving(
+ selectedBubbleIndex = selectedBubbleIndex,
+ removedBubbleIndex = removedBubbleIndex
+ )
+ animator.start()
+ }
+
+ private fun createAnimator(listener: Listener): ValueAnimator {
+ val animator = ValueAnimator.ofFloat(0f, 1f).setDuration(ANIMATION_DURATION_MS)
+ animator.addUpdateListener { animation ->
+ val animatedFraction = (animation as ValueAnimator).animatedFraction
+ listener.onAnimationUpdate(animatedFraction)
+ }
+ animator.addListener(
+ object : Animator.AnimatorListener {
+
+ override fun onAnimationCancel(animation: Animator) {
+ listener.onAnimationCancel()
+ }
+
+ override fun onAnimationEnd(animation: Animator) {
+ state = State.Idle
+ listener.onAnimationEnd()
+ }
+
+ override fun onAnimationRepeat(animation: Animator) {}
+
+ override fun onAnimationStart(animation: Animator) {}
+ }
+ )
+ return animator
+ }
+
+ /**
+ * The translation X of the bubble at index [bubbleIndex] when the bubble bar is expanded
+ * according to the progress of this animation.
+ *
+ * Callers should verify that the animation is running before calling this.
+ *
+ * @see isRunning
+ */
+ fun getBubbleTranslationX(bubbleIndex: Int): Float {
+ return when (val state = state) {
+ State.Idle -> 0f
+ is State.AddingBubble ->
+ getBubbleTranslationXWhileScalingBubble(
+ bubbleIndex = bubbleIndex,
+ scalingBubbleIndex = 0,
+ bubbleScale = animator.animatedFraction
+ )
+ is State.RemovingBubble ->
+ getBubbleTranslationXWhileScalingBubble(
+ bubbleIndex = bubbleIndex,
+ scalingBubbleIndex = state.bubbleIndex,
+ bubbleScale = 1 - animator.animatedFraction
+ )
+ is State.AddingAndRemoving ->
+ getBubbleTranslationXWhileAddingBubbleAtLimit(
+ bubbleIndex = bubbleIndex,
+ removedBubbleIndex = state.removedBubbleIndex,
+ addedBubbleScale = animator.animatedFraction,
+ removedBubbleScale = 1 - animator.animatedFraction
+ )
+ }
+ }
+
+ /**
+ * The expanded width of the bubble bar according to the progress of the animation.
+ *
+ * Callers should verify that the animation is running before calling this.
+ *
+ * @see isRunning
+ */
+ fun getExpandedWidth(): Float {
+ val bubbleScale =
+ when (state) {
+ State.Idle -> 0f
+ is State.AddingBubble -> animator.animatedFraction
+ is State.RemovingBubble -> 1 - animator.animatedFraction
+ is State.AddingAndRemoving -> {
+ // since we're adding a bubble and removing another bubble, their sizes together
+ // equal to a single bubble. the width is the same as having bubbleCount - 1
+ // bubbles at full scale.
+ val totalSpace = (bubbleCount - 2) * expandedBarIconSpacing
+ val totalIconSize = (bubbleCount - 1) * iconSize
+ return totalIconSize + totalSpace
+ }
+ }
+ // When this animator is running the bubble bar is expanded so it's safe to assume that we
+ // have at least 2 bubbles, but should update the logic to support optional overflow.
+ // If we're removing the last bubble, the entire bar should animate and we shouldn't get
+ // here.
+ val totalSpace = (bubbleCount - 2 + bubbleScale) * expandedBarIconSpacing
+ val totalIconSize = (bubbleCount - 1 + bubbleScale) * iconSize
+ return totalIconSize + totalSpace
+ }
+
+ /**
+ * Returns the arrow position according to the progress of the animation and, if the selected
+ * bubble is being removed, accounting to the newly selected bubble.
+ *
+ * Callers should verify that the animation is running before calling this.
+ *
+ * @see isRunning
+ */
+ fun getArrowPosition(): Float {
+ return when (val state = state) {
+ State.Idle -> 0f
+ is State.AddingBubble -> {
+ val tx =
+ getBubbleTranslationXWhileScalingBubble(
+ bubbleIndex = state.selectedBubbleIndex,
+ scalingBubbleIndex = 0,
+ bubbleScale = animator.animatedFraction
+ )
+ tx + iconSize / 2f
+ }
+ is State.RemovingBubble -> getArrowPositionWhenRemovingBubble(state)
+ is State.AddingAndRemoving -> {
+ // we never remove the selected bubble, so the arrow stays pointing to its center
+ val tx =
+ getBubbleTranslationXWhileAddingBubbleAtLimit(
+ bubbleIndex = state.selectedBubbleIndex,
+ removedBubbleIndex = state.removedBubbleIndex,
+ addedBubbleScale = animator.animatedFraction,
+ removedBubbleScale = 1 - animator.animatedFraction
+ )
+ tx + iconSize / 2f
+ }
+ }
+ }
+
+ private fun getArrowPositionWhenRemovingBubble(state: State.RemovingBubble): Float {
+ return if (state.selectedBubbleIndex != state.bubbleIndex) {
+ // if we're not removing the selected bubble, the selected bubble doesn't change so just
+ // return the translation X of the selected bubble and add half icon
+ val tx =
+ getBubbleTranslationXWhileScalingBubble(
+ bubbleIndex = state.selectedBubbleIndex,
+ scalingBubbleIndex = state.bubbleIndex,
+ bubbleScale = 1 - animator.animatedFraction
+ )
+ tx + iconSize / 2f
+ } else {
+ // we're removing the selected bubble so the arrow needs to point to a different bubble.
+ // if we're removing the last bubble the newly selected bubble will be the second to
+ // last. otherwise, it'll be the next bubble (closer to the overflow)
+ val iconAndSpacing = iconSize + expandedBarIconSpacing
+ if (state.removingLastBubble) {
+ if (onLeft) {
+ // the newly selected bubble is the bubble to the right. at the end of the
+ // animation all the bubbles will have shifted left, so the arrow stays at the
+ // same distance from the left edge of bar
+ (bubbleCount - state.bubbleIndex - 1) * iconAndSpacing + iconSize / 2f
+ } else {
+ // the newly selected bubble is the bubble to the left. at the end of the
+ // animation all the bubbles will have shifted right, and the arrow would
+ // eventually be closer to the left edge of the bar by iconAndSpacing
+ val initialTx = state.bubbleIndex * iconAndSpacing + iconSize / 2f
+ initialTx - animator.animatedFraction * iconAndSpacing
+ }
+ } else {
+ if (onLeft) {
+ // the newly selected bubble is to the left, and bubbles are shifting left, so
+ // move the arrow closer to the left edge of the bar by iconAndSpacing
+ val initialTx =
+ (bubbleCount - state.bubbleIndex - 1) * iconAndSpacing + iconSize / 2f
+ initialTx - animator.animatedFraction * iconAndSpacing
+ } else {
+ // the newly selected bubble is to the right, and bubbles are shifting right, so
+ // the arrow stays at the same distance from the left edge of the bar
+ state.bubbleIndex * iconAndSpacing + iconSize / 2f
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the translation X for the bubble at index {@code bubbleIndex} when the bubble bar is
+ * expanded and a bubble is animating in or out.
+ *
+ * @param bubbleIndex the index of the bubble for which the translation is requested
+ * @param scalingBubbleIndex the index of the bubble that is animating
+ * @param bubbleScale the current scale of the animating bubble
+ */
+ private fun getBubbleTranslationXWhileScalingBubble(
+ bubbleIndex: Int,
+ scalingBubbleIndex: Int,
+ bubbleScale: Float
+ ): Float {
+ val iconAndSpacing = iconSize + expandedBarIconSpacing
+ // the bubble is scaling from the center, so we need to adjust its translation so
+ // that the distance to the adjacent bubble scales at the same rate.
+ val pivotAdjustment = -(1 - bubbleScale) * iconSize / 2f
+
+ return if (onLeft) {
+ when {
+ bubbleIndex < scalingBubbleIndex ->
+ // the bar is on the left and the current bubble is to the right of the scaling
+ // bubble so account for its scale
+ (bubbleCount - bubbleIndex - 2 + bubbleScale) * iconAndSpacing
+ bubbleIndex == scalingBubbleIndex -> {
+ // the bar is on the left and this is the scaling bubble
+ val totalIconSize = (bubbleCount - bubbleIndex - 1) * iconSize
+ // don't count the spacing between the scaling bubble and the bubble on the left
+ // because we need to scale that space
+ val totalSpacing = (bubbleCount - bubbleIndex - 2) * expandedBarIconSpacing
+ val scaledSpace = bubbleScale * expandedBarIconSpacing
+ totalIconSize + totalSpacing + scaledSpace + pivotAdjustment
+ }
+ else ->
+ // the bar is on the left and the scaling bubble is on the right. the current
+ // bubble is unaffected by the scaling bubble
+ (bubbleCount - bubbleIndex - 1) * iconAndSpacing
+ }
+ } else {
+ when {
+ bubbleIndex < scalingBubbleIndex ->
+ // the bar is on the right and the scaling bubble is on the right. the current
+ // bubble is unaffected by the scaling bubble
+ iconAndSpacing * bubbleIndex
+ bubbleIndex == scalingBubbleIndex ->
+ // the bar is on the right, and this is the animating bubble. it only needs to
+ // be adjusted for the scaling pivot.
+ iconAndSpacing * bubbleIndex + pivotAdjustment
+ else ->
+ // the bar is on the right and the scaling bubble is on the left so account for
+ // its scale
+ iconAndSpacing * (bubbleIndex - 1 + bubbleScale)
+ }
+ }
+ }
+
+ private fun getBubbleTranslationXWhileAddingBubbleAtLimit(
+ bubbleIndex: Int,
+ removedBubbleIndex: Int,
+ addedBubbleScale: Float,
+ removedBubbleScale: Float
+ ): Float {
+ val iconAndSpacing = iconSize + expandedBarIconSpacing
+ // the bubbles are scaling from the center, so we need to adjust their translation so
+ // that the distance to the adjacent bubble scales at the same rate.
+ val addedBubblePivotAdjustment = -(1 - addedBubbleScale) * iconSize / 2f
+ val removedBubblePivotAdjustment = -(1 - removedBubbleScale) * iconSize / 2f
+
+ return if (onLeft) {
+ // this is how many bubbles there are to the left of the current bubble.
+ // when the bubble bar is on the right the added bubble is the right-most bubble so it
+ // doesn't affect the translation of any other bubble.
+ // when the removed bubble is to the left of the current bubble, we need to subtract it
+ // from bubblesToLeft and use removedBubbleScale instead when calculating the
+ // translation.
+ val bubblesToLeft = bubbleCount - bubbleIndex - 1
+ when {
+ bubbleIndex == 0 ->
+ // this is the added bubble and it's the right-most bubble. account for all the
+ // other bubbles -- including the removed bubble -- and adjust for the added
+ // bubble pivot.
+ (bubblesToLeft - 1 + removedBubbleScale) * iconAndSpacing +
+ addedBubblePivotAdjustment
+ bubbleIndex < removedBubbleIndex ->
+ // the removed bubble is to the left so account for it
+ (bubblesToLeft - 1 + removedBubbleScale) * iconAndSpacing
+ bubbleIndex == removedBubbleIndex -> {
+ // this is the removed bubble. all the bubbles to the left are at full scale
+ // but we need to scale the spacing between the removed bubble and the bubble to
+ // its left because the removed bubble disappears towards the left side
+ val totalIconSize = bubblesToLeft * iconSize
+ val totalSpacing =
+ (bubblesToLeft - 1 + removedBubbleScale) * expandedBarIconSpacing
+ totalIconSize + totalSpacing + removedBubblePivotAdjustment
+ }
+ else ->
+ // both added and removed bubbles are to the right so they don't affect the tx
+ bubblesToLeft * iconAndSpacing
+ }
+ } else {
+ when {
+ bubbleIndex == 0 -> addedBubblePivotAdjustment // we always add bubbles at index 0
+ bubbleIndex < removedBubbleIndex ->
+ // the bar is on the right and the removed bubble is on the right. the current
+ // bubble is unaffected by the removed bubble. only need to factor in the added
+ // bubble's scale.
+ iconAndSpacing * (bubbleIndex - 1 + addedBubbleScale)
+ bubbleIndex == removedBubbleIndex ->
+ // the bar is on the right, and this is the animating bubble.
+ iconAndSpacing * (bubbleIndex - 1 + addedBubbleScale) +
+ removedBubblePivotAdjustment
+ else ->
+ // both the added and the removed bubbles are to the left of the current bubble
+ iconAndSpacing * (bubbleIndex - 2 + addedBubbleScale + removedBubbleScale)
+ }
+ }
+ }
+
+ val isRunning: Boolean
+ get() = state != State.Idle
+
+ /** The state of the animation. */
+ sealed interface State {
+
+ /** The animation is not running. */
+ data object Idle : State
+
+ /** A new bubble is being added to the bubble bar. */
+ data class AddingBubble(val selectedBubbleIndex: Int) : State
+
+ /** A bubble is being removed from the bubble bar. */
+ data class RemovingBubble(
+ /** The index of the bubble being removed. */
+ val bubbleIndex: Int,
+ /** The index of the selected bubble. */
+ val selectedBubbleIndex: Int,
+ /** Whether the bubble being removed is also the last bubble. */
+ val removingLastBubble: Boolean
+ ) : State
+
+ /** A new bubble is being added and an old bubble is being removed from the bubble bar. */
+ data class AddingAndRemoving(val selectedBubbleIndex: Int, val removedBubbleIndex: Int) :
+ State
+ }
+
+ /** Callbacks for the animation. */
+ interface Listener {
+
+ /**
+ * Notifies the listener of an animation update event, where `animatedFraction` represents
+ * the progress of the animation starting from 0 and ending at 1.
+ */
+ fun onAnimationUpdate(animatedFraction: Float)
+
+ /** Notifies the listener that the animation was canceled. */
+ fun onAnimationCancel()
+
+ /** Notifies that listener that the animation ended. */
+ fun onAnimationEnd()
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt
index a6d0ff8..99c50f2 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt
@@ -18,12 +18,16 @@
import android.view.View
import android.view.View.VISIBLE
+import androidx.core.animation.Animator
+import androidx.core.animation.AnimatorListenerAdapter
+import androidx.core.animation.ObjectAnimator
import androidx.dynamicanimation.animation.DynamicAnimation
import androidx.dynamicanimation.animation.SpringForce
+import com.android.launcher3.R
import com.android.launcher3.taskbar.bubbles.BubbleBarBubble
import com.android.launcher3.taskbar.bubbles.BubbleBarView
-import com.android.launcher3.taskbar.bubbles.BubbleStashController
import com.android.launcher3.taskbar.bubbles.BubbleView
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController
import com.android.wm.shell.shared.animation.PhysicsAnimator
/** Handles animations for bubble bar bubbles. */
@@ -32,24 +36,64 @@
constructor(
private val bubbleBarView: BubbleBarView,
private val bubbleStashController: BubbleStashController,
+ private val onExpanded: Runnable,
private val scheduler: Scheduler = HandlerScheduler(bubbleBarView)
) {
private var animatingBubble: AnimatingBubble? = null
+ private val bubbleBarBounceDistanceInPx =
+ bubbleBarView.resources.getDimensionPixelSize(R.dimen.bubblebar_bounce_distance)
+
+ fun hasAnimation() = animatingBubble != null
+
+ val isAnimating: Boolean
+ get() {
+ val animatingBubble = animatingBubble ?: return false
+ return animatingBubble.state != AnimatingBubble.State.CREATED
+ }
private companion object {
/** The time to show the flyout. */
const val FLYOUT_DELAY_MS: Long = 2500
/** The initial scale Y value that the new bubble is set to before the animation starts. */
const val BUBBLE_ANIMATION_INITIAL_SCALE_Y = 0.3f
+ /** The minimum alpha value to make the bubble bar touchable. */
+ const val MIN_ALPHA_FOR_TOUCHABLE = 0.5f
+ /** The duration of the bounce animation. */
+ const val BUBBLE_BAR_BOUNCE_ANIMATION_DURATION_MS = 250L
}
/** Wrapper around the animating bubble with its show and hide animations. */
private data class AnimatingBubble(
val bubbleView: BubbleView,
val showAnimation: Runnable,
- val hideAnimation: Runnable
- )
+ val hideAnimation: Runnable,
+ val expand: Boolean,
+ val state: State = State.CREATED
+ ) {
+
+ /**
+ * The state of the animation.
+ *
+ * The animation is initially created but will be scheduled later using the [Scheduler].
+ *
+ * The normal uninterrupted cycle is for the bubble notification to animate in, then be in a
+ * transient state and eventually to animate out.
+ *
+ * However different events, such as touch and external signals, may cause the animation to
+ * end earlier.
+ */
+ enum class State {
+ /** The animation is created but not started yet. */
+ CREATED,
+ /** The bubble notification is animating in. */
+ ANIMATING_IN,
+ /** The bubble notification is now fully showing and waiting to be hidden. */
+ IN,
+ /** The bubble notification is animating out. */
+ ANIMATING_OUT
+ }
+ }
/** An interface for scheduling jobs. */
interface Scheduler {
@@ -87,21 +131,24 @@
)
/** Animates a bubble for the state where the bubble bar is stashed. */
- fun animateBubbleInForStashed(b: BubbleBarBubble) {
+ fun animateBubbleInForStashed(b: BubbleBarBubble, isExpanding: Boolean) {
+ // TODO b/346400677: handle animations for the same bubble interrupting each other
+ if (animatingBubble?.bubbleView?.bubble?.key == b.key) return
val bubbleView = b.view
val animator = PhysicsAnimator.getInstance(bubbleView)
if (animator.isRunning()) animator.cancel()
// the animation of a new bubble is divided into 2 parts. The first part shows the bubble
// and the second part hides it after a delay.
- val showAnimation = buildShowAnimation()
- val hideAnimation = buildHideAnimation()
- animatingBubble = AnimatingBubble(bubbleView, showAnimation, hideAnimation)
+ val showAnimation = buildHandleToBubbleBarAnimation()
+ val hideAnimation = if (isExpanding) Runnable {} else buildBubbleBarToHandleAnimation()
+ animatingBubble =
+ AnimatingBubble(bubbleView, showAnimation, hideAnimation, expand = isExpanding)
scheduler.post(showAnimation)
scheduler.postDelayed(FLYOUT_DELAY_MS, hideAnimation)
}
/**
- * Returns a [Runnable] that starts the animation that shows the new or updated bubble.
+ * Returns a [Runnable] that starts the animation that morphs the handle to the bubble bar.
*
* Visually, the animation is divided into 2 parts. The stash handle starts animating up and
* fading out and then the bubble bar starts animating up and fading in.
@@ -114,9 +161,9 @@
* 3. The third part is the overshoot of the spring animation, where we make the bubble fully
* visible which helps avoiding further updates when we re-enter the second part.
*/
- private fun buildShowAnimation() = Runnable {
+ private fun buildHandleToBubbleBarAnimation() = Runnable {
+ moveToState(AnimatingBubble.State.ANIMATING_IN)
// prepare the bubble bar for the animation
- bubbleBarView.onAnimatingBubbleStarted()
bubbleBarView.visibility = VISIBLE
bubbleBarView.alpha = 0f
bubbleBarView.translationY = 0f
@@ -128,26 +175,29 @@
// handle. when the handle becomes invisible and we start animating in the bubble bar,
// the translation y is offset by this value to make the transition from the handle to the
// bar smooth.
- val offset = bubbleStashController.diffBetweenHandleAndBarCenters
+ val offset = bubbleStashController.getDiffBetweenHandleAndBarCenters()
+ val stashedHandleTranslationYForAnimation =
+ bubbleStashController.getStashedHandleTranslationForNewBubbleAnimation()
val stashedHandleTranslationY =
- bubbleStashController.stashedHandleTranslationForNewBubbleAnimation
+ bubbleStashController.getHandleTranslationY() ?: return@Runnable
+ val translationTracker = TranslationTracker(stashedHandleTranslationY)
// this is the total distance that both the stashed handle and the bubble will be traveling
// at the end of the animation the bubble bar will be positioned in the same place when it
// shows while we're in an app.
val totalTranslationY = bubbleStashController.bubbleBarTranslationYForTaskbar + offset
- val animator = bubbleStashController.stashedHandlePhysicsAnimator
+ val animator = bubbleStashController.getStashedHandlePhysicsAnimator() ?: return@Runnable
animator.setDefaultSpringConfig(springConfig)
animator.spring(DynamicAnimation.TRANSLATION_Y, totalTranslationY)
animator.addUpdateListener { handle, values ->
val ty = values[DynamicAnimation.TRANSLATION_Y]?.value ?: return@addUpdateListener
when {
- ty >= stashedHandleTranslationY -> {
+ ty >= stashedHandleTranslationYForAnimation -> {
// we're in the first leg of the animation. only animate the handle. the bubble
// bar remains hidden during this part of the animation
// map the path [0, stashedHandleTranslationY] to [0,1]
- val fraction = ty / stashedHandleTranslationY
+ val fraction = ty / stashedHandleTranslationYForAnimation
handle.alpha = 1 - fraction
}
ty >= totalTranslationY -> {
@@ -161,12 +211,15 @@
if (bubbleBarView.alpha != 1f) {
// map the path [stashedHandleTranslationY, totalTranslationY] to [0, 1]
val fraction =
- (ty - stashedHandleTranslationY) /
- (totalTranslationY - stashedHandleTranslationY)
+ (ty - stashedHandleTranslationYForAnimation) /
+ (totalTranslationY - stashedHandleTranslationYForAnimation)
bubbleBarView.alpha = fraction
bubbleBarView.scaleY =
BUBBLE_ANIMATION_INITIAL_SCALE_Y +
(1 - BUBBLE_ANIMATION_INITIAL_SCALE_Y) * fraction
+ if (bubbleBarView.alpha > MIN_ALPHA_FOR_TOUCHABLE) {
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
}
}
else -> {
@@ -176,10 +229,19 @@
bubbleBarView.alpha = 1f
bubbleBarView.scaleY = 1f
bubbleBarView.translationY = ty - offset
+ bubbleStashController.updateTaskbarTouchRegion()
}
}
+ translationTracker.updateTyAndExpandIfNeeded(ty)
}
- animator.addEndListener { _, _, _, _, _, _, _ ->
+ animator.addEndListener { _, _, _, canceled, _, _, _ ->
+ // if the show animation was canceled, also cancel the hide animation. this is typically
+ // canceled in this class, but could potentially be canceled elsewhere.
+ if (canceled || animatingBubble?.expand == true) {
+ cancelHideAnimation()
+ return@addEndListener
+ }
+ moveToState(AnimatingBubble.State.IN)
// the bubble bar is now fully settled in. update taskbar touch region so it's touchable
bubbleStashController.updateTaskbarTouchRegion()
}
@@ -187,7 +249,8 @@
}
/**
- * Returns a [Runnable] that starts the animation that hides the bubble bar.
+ * Returns a [Runnable] that starts the animation that hides the bubble bar and morphs it into
+ * the stashed handle.
*
* Similarly to the show animation, this is visually divided into 2 parts. We first animate the
* bubble bar out, and then animate the stash handle in. At the end of the animation we reset
@@ -199,13 +262,16 @@
* 2. In the second part the bubble bar is fully hidden and the handle animates in.
* 3. The third part is the overshoot. The handle is made fully visible.
*/
- private fun buildHideAnimation() = Runnable {
- val offset = bubbleStashController.diffBetweenHandleAndBarCenters
+ private fun buildBubbleBarToHandleAnimation() = Runnable {
+ if (animatingBubble == null) return@Runnable
+ moveToState(AnimatingBubble.State.ANIMATING_OUT)
+ val offset = bubbleStashController.getDiffBetweenHandleAndBarCenters()
val stashedHandleTranslationY =
- bubbleStashController.stashedHandleTranslationForNewBubbleAnimation
+ bubbleStashController.getStashedHandleTranslationForNewBubbleAnimation()
// this is the total distance that both the stashed handle and the bar will be traveling
val totalTranslationY = bubbleStashController.bubbleBarTranslationYForTaskbar + offset
- val animator = bubbleStashController.stashedHandlePhysicsAnimator
+ bubbleStashController.setHandleTranslationY(totalTranslationY)
+ val animator = bubbleStashController.getStashedHandlePhysicsAnimator() ?: return@Runnable
animator.setDefaultSpringConfig(springConfig)
animator.spring(DynamicAnimation.TRANSLATION_Y, 0f)
animator.addUpdateListener { handle, values ->
@@ -220,6 +286,9 @@
(totalTranslationY - ty) / (totalTranslationY - stashedHandleTranslationY)
bubbleBarView.alpha = 1 - fraction
bubbleBarView.scaleY = 1 - (1 - BUBBLE_ANIMATION_INITIAL_SCALE_Y) * fraction
+ if (bubbleBarView.alpha > MIN_ALPHA_FOR_TOUCHABLE) {
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
}
ty <= 0 -> {
// this is the second part of the animation. make the bubble bar invisible and
@@ -238,22 +307,219 @@
}
}
}
- animator.addEndListener { _, _, _, _, _, _, _ ->
+ animator.addEndListener { _, _, _, canceled, _, _, _ ->
animatingBubble = null
- bubbleStashController.stashBubbleBarImmediate()
- bubbleBarView.onAnimatingBubbleCompleted()
+ if (!canceled) bubbleStashController.stashBubbleBarImmediate()
bubbleBarView.relativePivotY = 1f
bubbleStashController.updateTaskbarTouchRegion()
}
animator.start()
}
- /** Handles clicking on the animating bubble while the animation is still playing. */
- fun onBubbleClickedWhileAnimating() {
+ /** Animates to the initial state of the bubble bar, when there are no previous bubbles. */
+ fun animateToInitialState(b: BubbleBarBubble, isInApp: Boolean, isExpanding: Boolean) {
+ // TODO b/346400677: handle animations for the same bubble interrupting each other
+ if (animatingBubble?.bubbleView?.bubble?.key == b.key) return
+ val bubbleView = b.view
+ val animator = PhysicsAnimator.getInstance(bubbleView)
+ if (animator.isRunning()) animator.cancel()
+ // the animation of a new bubble is divided into 2 parts. The first part shows the bubble
+ // and the second part hides it after a delay if we are in an app.
+ val showAnimation = buildBubbleBarSpringInAnimation()
+ val hideAnimation =
+ if (isInApp && !isExpanding) {
+ buildBubbleBarToHandleAnimation()
+ } else {
+ // in this case the bubble bar remains visible so not much to do. once we implement
+ // the flyout we'll update this runnable to hide it.
+ Runnable {
+ animatingBubble = null
+ bubbleStashController.showBubbleBarImmediate()
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
+ }
+ animatingBubble =
+ AnimatingBubble(bubbleView, showAnimation, hideAnimation, expand = isExpanding)
+ scheduler.post(showAnimation)
+ scheduler.postDelayed(FLYOUT_DELAY_MS, hideAnimation)
+ }
+
+ private fun buildBubbleBarSpringInAnimation() = Runnable {
+ moveToState(AnimatingBubble.State.ANIMATING_IN)
+ // prepare the bubble bar for the animation
+ bubbleBarView.translationY = bubbleBarView.height.toFloat()
+ bubbleBarView.visibility = VISIBLE
+ bubbleBarView.alpha = 1f
+ bubbleBarView.scaleX = 1f
+ bubbleBarView.scaleY = 1f
+
+ val translationTracker = TranslationTracker(bubbleBarView.translationY)
+
+ val animator = PhysicsAnimator.getInstance(bubbleBarView)
+ animator.setDefaultSpringConfig(springConfig)
+ animator.spring(DynamicAnimation.TRANSLATION_Y, bubbleStashController.bubbleBarTranslationY)
+ animator.addUpdateListener { _, values ->
+ val ty = values[DynamicAnimation.TRANSLATION_Y]?.value ?: return@addUpdateListener
+ translationTracker.updateTyAndExpandIfNeeded(ty)
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
+ animator.addEndListener { _, _, _, _, _, _, _ ->
+ if (animatingBubble?.expand == true) {
+ cancelHideAnimation()
+ } else {
+ moveToState(AnimatingBubble.State.IN)
+ }
+ // the bubble bar is now fully settled in. update taskbar touch region so it's touchable
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
+ animator.start()
+ }
+
+ fun animateBubbleBarForCollapsed(b: BubbleBarBubble, isExpanding: Boolean) {
+ // TODO b/346400677: handle animations for the same bubble interrupting each other
+ if (animatingBubble?.bubbleView?.bubble?.key == b.key) return
+ val bubbleView = b.view
+ val animator = PhysicsAnimator.getInstance(bubbleView)
+ if (animator.isRunning()) animator.cancel()
+ val showAnimation = buildBubbleBarBounceAnimation()
+ val hideAnimation = Runnable {
+ animatingBubble = null
+ bubbleStashController.showBubbleBarImmediate()
+ bubbleStashController.updateTaskbarTouchRegion()
+ }
+ animatingBubble =
+ AnimatingBubble(bubbleView, showAnimation, hideAnimation, expand = isExpanding)
+ scheduler.post(showAnimation)
+ scheduler.postDelayed(FLYOUT_DELAY_MS, hideAnimation)
+ }
+
+ /**
+ * The bubble bar animation when it is collapsed is divided into 2 chained animations. The first
+ * animation is a regular accelerate animation that moves the bubble bar upwards. When it ends
+ * the bubble bar moves back to its initial position with a spring animation.
+ */
+ private fun buildBubbleBarBounceAnimation() = Runnable {
+ moveToState(AnimatingBubble.State.ANIMATING_IN)
+ val ty = bubbleStashController.bubbleBarTranslationY
+
+ val springBackAnimation = PhysicsAnimator.getInstance(bubbleBarView)
+ springBackAnimation.setDefaultSpringConfig(springConfig)
+ springBackAnimation.spring(DynamicAnimation.TRANSLATION_Y, ty)
+ springBackAnimation.addEndListener { _, _, _, _, _, _, _ ->
+ if (animatingBubble?.expand == true) {
+ expandBubbleBar()
+ cancelHideAnimation()
+ } else {
+ moveToState(AnimatingBubble.State.IN)
+ }
+ }
+
+ // animate the bubble bar up and start the spring back down animation when it ends.
+ ObjectAnimator.ofFloat(bubbleBarView, View.TRANSLATION_Y, ty - bubbleBarBounceDistanceInPx)
+ .withDuration(BUBBLE_BAR_BOUNCE_ANIMATION_DURATION_MS)
+ .withEndAction {
+ if (animatingBubble?.expand == true) expandBubbleBar()
+ springBackAnimation.start()
+ }
+ .start()
+ }
+
+ /** Handles touching the animating bubble bar. */
+ fun onBubbleBarTouchedWhileAnimating() {
+ PhysicsAnimator.getInstance(bubbleBarView).cancelIfRunning()
+ bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning()
val hideAnimation = animatingBubble?.hideAnimation ?: return
scheduler.cancel(hideAnimation)
- bubbleBarView.onAnimatingBubbleCompleted()
bubbleBarView.relativePivotY = 1f
animatingBubble = null
}
+
+ /** Notifies the animator that the taskbar area was touched during an animation. */
+ fun onStashStateChangingWhileAnimating() {
+ val hideAnimation = animatingBubble?.hideAnimation ?: return
+ scheduler.cancel(hideAnimation)
+ animatingBubble = null
+ bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning()
+ bubbleBarView.relativePivotY = 1f
+ bubbleStashController.onNewBubbleAnimationInterrupted(
+ /* isStashed= */ bubbleBarView.alpha == 0f,
+ bubbleBarView.translationY
+ )
+ }
+
+ fun expandedWhileAnimating() {
+ val animatingBubble = animatingBubble ?: return
+ this.animatingBubble = animatingBubble.copy(expand = true)
+ // if we're fully in and waiting to hide, cancel the hide animation and clean up
+ if (animatingBubble.state == AnimatingBubble.State.IN) {
+ expandBubbleBar()
+ cancelHideAnimation()
+ }
+ }
+
+ private fun cancelHideAnimation() {
+ val hideAnimation = animatingBubble?.hideAnimation ?: return
+ scheduler.cancel(hideAnimation)
+ animatingBubble = null
+ bubbleBarView.relativePivotY = 1f
+ bubbleStashController.showBubbleBarImmediate()
+ }
+
+ private fun <T> PhysicsAnimator<T>?.cancelIfRunning() {
+ if (this?.isRunning() == true) cancel()
+ }
+
+ private fun ObjectAnimator.withDuration(duration: Long): ObjectAnimator {
+ setDuration(duration)
+ return this
+ }
+
+ private fun ObjectAnimator.withEndAction(endAction: () -> Unit): ObjectAnimator {
+ addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ endAction()
+ }
+ }
+ )
+ return this
+ }
+
+ private fun moveToState(state: AnimatingBubble.State) {
+ val animatingBubble = this.animatingBubble ?: return
+ this.animatingBubble = animatingBubble.copy(state = state)
+ }
+
+ private fun expandBubbleBar() {
+ bubbleBarView.isExpanded = true
+ onExpanded.run()
+ }
+
+ /**
+ * Tracks the translation Y of the bubble bar during the animation. When the bubble bar expands
+ * as part of the animation, the expansion should start after the bubble bar reaches the peak
+ * position.
+ */
+ private inner class TranslationTracker(initialTy: Float) {
+ private var previousTy = initialTy
+ private var startedExpanding = false
+ private var reachedPeak = false
+
+ fun updateTyAndExpandIfNeeded(ty: Float) {
+ if (!reachedPeak) {
+ // the bubble bar is positioned at the bottom of the screen and moves up using
+ // negative ty values. the peak is reached the first time we see a value that is
+ // greater than the previous.
+ if (ty > previousTy) {
+ reachedPeak = true
+ }
+ }
+ val expand = animatingBubble?.expand ?: false
+ if (reachedPeak && expand && !startedExpanding) {
+ expandBubbleBar()
+ startedExpanding = true
+ }
+ previousTy = ty
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt
new file mode 100644
index 0000000..48eb7de
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/BubbleStashController.kt
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import android.view.InsetsController
+import android.view.MotionEvent
+import android.view.View
+import com.android.launcher3.taskbar.TaskbarInsetsController
+import com.android.launcher3.taskbar.bubbles.BubbleBarView
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
+import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController
+import com.android.wm.shell.common.bubbles.BubbleBarLocation
+import com.android.wm.shell.shared.animation.PhysicsAnimator
+import java.io.PrintWriter
+
+/** StashController that defines stashing behaviour for the taskbar modes. */
+interface BubbleStashController {
+
+ /**
+ * Abstraction on the task bar activity context to only provide the dimensions required for
+ * [BubbleBarView] translation Y computation.
+ */
+ interface TaskbarHotseatDimensionsProvider {
+
+ /** Provides taskbar bottom space in pixels. */
+ fun getTaskbarBottomSpace(): Int
+
+ /** Provides taskbar height in pixels. */
+ fun getTaskbarHeight(): Int
+
+ /** Provides hotseat bottom space in pixels. */
+ fun getHotseatBottomSpace(): Int
+
+ /** Provides hotseat height in pixels. */
+ fun getHotseatHeight(): Int
+ }
+
+ /** Execute passed action only after controllers are initiated. */
+ interface ControllersAfterInitAction {
+ /** Execute action after controllers are initiated. */
+ fun runAfterInit(action: Runnable)
+ }
+
+ /** Whether bubble bar is currently stashed */
+ val isStashed: Boolean
+
+ /** Whether launcher enters or exits the home page. */
+ var isBubblesShowingOnHome: Boolean
+
+ /** Whether launcher enters or exits the overview page. */
+ var isBubblesShowingOnOverview: Boolean
+
+ /** Updated when sysui locked state changes, when locked, bubble bar is not shown. */
+ var isSysuiLocked: Boolean
+
+ /** Whether there is a transient taskbar mode */
+ val isTransientTaskBar: Boolean
+
+ /** Whether stash control has a handle view */
+ val hasHandleView: Boolean
+
+ /** Initialize controller */
+ fun init(
+ taskbarInsetsController: TaskbarInsetsController,
+ bubbleBarViewController: BubbleBarViewController,
+ bubbleStashedHandleViewController: BubbleStashedHandleViewController?,
+ controllersAfterInitAction: ControllersAfterInitAction
+ )
+
+ /** Shows the bubble bar at [bubbleBarTranslationY] position immediately without animation. */
+ fun showBubbleBarImmediate()
+
+ /** Shows the bubble bar at [bubbleBarTranslationY] position immediately without animation. */
+ fun showBubbleBarImmediate(bubbleBarTranslationY: Float)
+
+ /** Stashes the bubble bar immediately without animation. */
+ fun stashBubbleBarImmediate()
+
+ /** Returns the touchable height of the bubble bar based on it's stashed state. */
+ fun getTouchableHeight(): Int
+
+ /** Whether bubble bar is currently visible */
+ fun isBubbleBarVisible(): Boolean
+
+ /**
+ * Updates the values of the internal animators after the new bubble animation was interrupted
+ *
+ * @param isStashed whether the current state should be stashed
+ * @param bubbleBarTranslationY the current bubble bar translation. this is only used if the
+ * bubble bar is showing to ensure that the stash animator runs smoothly.
+ */
+ fun onNewBubbleAnimationInterrupted(isStashed: Boolean, bubbleBarTranslationY: Float)
+
+ /** Checks whether the motion event is over the stash handle or bubble bar. */
+ fun isEventOverBubbleBarViews(ev: MotionEvent): Boolean
+
+ /** Set a bubble bar location */
+ fun setBubbleBarLocation(bubbleBarLocation: BubbleBarLocation)
+
+ /**
+ * Stashes the bubble bar (transform to the handle view), or just shrink width of the expanded
+ * bubble bar based on the controller implementation.
+ */
+ fun stashBubbleBar()
+
+ /** Shows the bubble bar, and expands bubbles depending on [expandBubbles]. */
+ fun showBubbleBar(expandBubbles: Boolean)
+
+ // TODO(b/354218264): Move to BubbleBarViewAnimator
+ /**
+ * The difference on the Y axis between the center of the handle and the center of the bubble
+ * bar.
+ */
+ fun getDiffBetweenHandleAndBarCenters(): Float
+
+ // TODO(b/354218264): Move to BubbleBarViewAnimator
+ /** The distance the handle moves as part of the new bubble animation. */
+ fun getStashedHandleTranslationForNewBubbleAnimation(): Float
+
+ // TODO(b/354218264): Move to BubbleBarViewAnimator
+ /** Returns the [PhysicsAnimator] for the stashed handle view. */
+ fun getStashedHandlePhysicsAnimator(): PhysicsAnimator<View>?
+
+ // TODO(b/354218264): Move to BubbleBarViewAnimator
+ /** Notifies taskbar that it should update its touchable region. */
+ fun updateTaskbarTouchRegion()
+
+ // TODO(b/354218264): Move to BubbleBarViewAnimator
+ /** Set the translation Y for the stashed handle. */
+ fun setHandleTranslationY(translationY: Float)
+
+ /** Returns the translation of the handle. */
+ fun getHandleTranslationY(): Float?
+
+ /**
+ * Returns bubble bar Y position according to [isBubblesShowingOnHome] and
+ * [isBubblesShowingOnOverview] values. Default implementation only analyse
+ * [isBubblesShowingOnHome] and return translationY to align with the hotseat vertical center.
+ * For Other cases align bubbles with the taskbar.
+ */
+ val bubbleBarTranslationY: Float
+ get() =
+ if (isBubblesShowingOnHome) {
+ bubbleBarTranslationYForHotseat
+ } else {
+ bubbleBarTranslationYForTaskbar
+ }
+
+ /** Translation Y to align the bubble bar with the hotseat. */
+ val bubbleBarTranslationYForTaskbar: Float
+
+ /** Return translation Y to align the bubble bar with the taskbar. */
+ val bubbleBarTranslationYForHotseat: Float
+
+ /** Dumps the state of BubbleStashController. */
+ fun dump(pw: PrintWriter) {
+ pw.println("Bubble stash controller state:")
+ pw.println(" isStashed: $isStashed")
+ pw.println(" isBubblesShowingOnOverview: $isBubblesShowingOnOverview")
+ pw.println(" isBubblesShowingOnHome: $isBubblesShowingOnHome")
+ pw.println(" isSysuiLocked: $isSysuiLocked")
+ }
+
+ companion object {
+ /** How long to stash/unstash. */
+ const val BAR_STASH_DURATION = InsetsController.ANIMATION_DURATION_RESIZE.toLong()
+
+ /** How long to translate Y coordinate of the BubbleBar. */
+ const val BAR_TRANSLATION_DURATION = 300L
+
+ /** The scale bubble bar animates to when being stashed. */
+ const val STASHED_BAR_SCALE = 0.5f
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/DeviceProfileDimensionsProviderAdapter.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/DeviceProfileDimensionsProviderAdapter.kt
new file mode 100644
index 0000000..a55763b
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/DeviceProfileDimensionsProviderAdapter.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import com.android.launcher3.DeviceProfile
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.TaskbarHotseatDimensionsProvider
+
+/**
+ * Implementation of the [TaskbarHotseatDimensionsProvider] that take sizes from the
+ * [DeviceProfile].
+ */
+class DeviceProfileDimensionsProviderAdapter(
+ private val taskbarActivityContext: TaskbarActivityContext
+) : TaskbarHotseatDimensionsProvider {
+ override fun getTaskbarBottomSpace(): Int = deviceProfile().taskbarBottomMargin
+
+ override fun getTaskbarHeight(): Int = deviceProfile().taskbarHeight
+
+ override fun getHotseatBottomSpace(): Int = deviceProfile().hotseatBarBottomSpacePx
+
+ override fun getHotseatHeight(): Int = deviceProfile().hotseatCellHeightPx
+
+ private fun deviceProfile(): DeviceProfile = taskbarActivityContext.deviceProfile
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt
new file mode 100644
index 0000000..1b65019
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashController.kt
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.animation.AnimatorSet
+import android.view.MotionEvent
+import android.view.View
+import com.android.launcher3.anim.AnimatedFloat
+import com.android.launcher3.taskbar.TaskbarInsetsController
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
+import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_STASH_DURATION
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_TRANSLATION_DURATION
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.ControllersAfterInitAction
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.TaskbarHotseatDimensionsProvider
+import com.android.launcher3.util.MultiPropertyFactory
+import com.android.wm.shell.common.bubbles.BubbleBarLocation
+import com.android.wm.shell.shared.animation.PhysicsAnimator
+
+class PersistentBubbleStashController(
+ private val taskbarHotseatDimensionsProvider: TaskbarHotseatDimensionsProvider,
+) : BubbleStashController {
+
+ private lateinit var taskbarInsetsController: TaskbarInsetsController
+ private lateinit var bubbleBarViewController: BubbleBarViewController
+ private lateinit var bubbleBarTranslationYAnimator: AnimatedFloat
+ private lateinit var bubbleBarAlphaAnimator: MultiPropertyFactory<View>.MultiProperty
+ private lateinit var bubbleBarScaleAnimator: AnimatedFloat
+ private lateinit var controllersAfterInitAction: ControllersAfterInitAction
+
+ override var isBubblesShowingOnHome: Boolean = false
+ set(onHome) {
+ if (field == onHome) return
+ field = onHome
+ if (!bubbleBarViewController.hasBubbles()) {
+ // if there are no bubbles, there's nothing to show, so just return.
+ return
+ }
+ if (onHome) {
+ // When transition to home we should show collapse the bubble bar
+ updateExpandedState(expand = false)
+ }
+ animateBubbleBarY()
+ bubbleBarViewController.onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ override var isBubblesShowingOnOverview: Boolean = false
+ set(onOverview) {
+ if (field == onOverview) return
+ field = onOverview
+ if (!onOverview) {
+ // When transition from overview we should show collapse the bubble bar
+ updateExpandedState(expand = false)
+ }
+ bubbleBarViewController.onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ override var isSysuiLocked: Boolean = false
+ set(isLocked) {
+ if (field == isLocked) return
+ field = isLocked
+ if (!isLocked && bubbleBarViewController.hasBubbles()) {
+ animateAfterUnlock()
+ }
+ }
+
+ override var isTransientTaskBar: Boolean = false
+
+ /** When the bubble bar is shown for the persistent task bar, there is no handle view. */
+ override val hasHandleView: Boolean = false
+
+ /** For persistent task bar we never stash the bubble bar */
+ override val isStashed: Boolean = false
+
+ override val bubbleBarTranslationYForTaskbar: Float
+ get() {
+ val taskbarBottomMargin = taskbarHotseatDimensionsProvider.getTaskbarBottomSpace()
+ val bubbleBarHeight: Float = bubbleBarViewController.bubbleBarCollapsedHeight
+ val taskbarHeight = taskbarHotseatDimensionsProvider.getTaskbarHeight()
+ return -taskbarBottomMargin - (taskbarHeight - bubbleBarHeight) / 2f
+ }
+
+ override val bubbleBarTranslationYForHotseat: Float
+ get() {
+ val hotseatBottomSpace = taskbarHotseatDimensionsProvider.getHotseatBottomSpace()
+ val hotseatCellHeight = taskbarHotseatDimensionsProvider.getHotseatHeight()
+ val bubbleBarHeight: Float = bubbleBarViewController.bubbleBarCollapsedHeight
+ return -hotseatBottomSpace - (hotseatCellHeight - bubbleBarHeight) / 2
+ }
+
+ override fun init(
+ taskbarInsetsController: TaskbarInsetsController,
+ bubbleBarViewController: BubbleBarViewController,
+ bubbleStashedHandleViewController: BubbleStashedHandleViewController?,
+ controllersAfterInitAction: ControllersAfterInitAction
+ ) {
+ this.taskbarInsetsController = taskbarInsetsController
+ this.bubbleBarViewController = bubbleBarViewController
+ this.controllersAfterInitAction = controllersAfterInitAction
+ bubbleBarTranslationYAnimator = bubbleBarViewController.bubbleBarTranslationY
+ // bubble bar has only alpha property, getting it at index 0
+ bubbleBarAlphaAnimator = bubbleBarViewController.bubbleBarAlpha.get(/* index= */ 0)
+ bubbleBarScaleAnimator = bubbleBarViewController.bubbleBarScale
+ }
+
+ private fun animateAfterUnlock() {
+ val animatorSet = AnimatorSet()
+ if (isBubblesShowingOnHome || isBubblesShowingOnOverview) {
+ animatorSet.playTogether(
+ bubbleBarScaleAnimator.animateToValue(1f),
+ bubbleBarTranslationYAnimator.animateToValue(bubbleBarTranslationY),
+ bubbleBarAlphaAnimator.animateToValue(1f)
+ )
+ }
+ updateTouchRegionOnAnimationEnd(animatorSet)
+ animatorSet.setDuration(BAR_STASH_DURATION).start()
+ }
+
+ override fun showBubbleBarImmediate() = showBubbleBarImmediate(bubbleBarTranslationY)
+
+ override fun showBubbleBarImmediate(bubbleBarTranslationY: Float) {
+ bubbleBarTranslationYAnimator.updateValue(bubbleBarTranslationY)
+ bubbleBarAlphaAnimator.setValue(1f)
+ bubbleBarScaleAnimator.updateValue(1f)
+ }
+
+ override fun setBubbleBarLocation(bubbleBarLocation: BubbleBarLocation) {
+ // When the bubble bar is shown for the persistent task bar, there is no handle view, so no
+ // operation is performed.
+ }
+
+ override fun stashBubbleBar() {
+ updateExpandedState(expand = false)
+ }
+
+ override fun showBubbleBar(expandBubbles: Boolean) {
+ updateExpandedState(expandBubbles)
+ }
+
+ override fun stashBubbleBarImmediate() {
+ // When the bubble bar is shown for the persistent task bar, there is no handle view, so no
+ // operation is performed.
+ }
+
+ /** If bubble bar is visible return bubble bar height, 0 otherwise */
+ override fun getTouchableHeight() =
+ if (isBubbleBarVisible()) {
+ bubbleBarViewController.bubbleBarCollapsedHeight.toInt()
+ } else {
+ 0
+ }
+
+ override fun isBubbleBarVisible(): Boolean = bubbleBarViewController.hasBubbles()
+
+ override fun onNewBubbleAnimationInterrupted(isStashed: Boolean, bubbleBarTranslationY: Float) {
+ showBubbleBarImmediate(bubbleBarTranslationY)
+ }
+
+ override fun isEventOverBubbleBarViews(ev: MotionEvent): Boolean =
+ bubbleBarViewController.isEventOverAnyItem(ev)
+
+ override fun getDiffBetweenHandleAndBarCenters(): Float {
+ // distance from the bottom of the screen and the bubble bar center.
+ return -bubbleBarViewController.bubbleBarCollapsedHeight / 2f
+ }
+
+ /** When the bubble bar is shown for the persistent task bar, there is no handle view. */
+ override fun getStashedHandleTranslationForNewBubbleAnimation(): Float = 0f
+
+ /** When the bubble bar is shown for the persistent task bar, there is no handle view. */
+ override fun getStashedHandlePhysicsAnimator(): PhysicsAnimator<View>? = null
+
+ override fun updateTaskbarTouchRegion() {
+ taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ /**
+ * When the bubble bar is shown for the persistent task bar the bar does not stash, so no
+ * operation is performed
+ */
+ override fun setHandleTranslationY(translationY: Float) {
+ // no op since does not have a handle view
+ }
+
+ override fun getHandleTranslationY(): Float? = null
+
+ private fun updateExpandedState(expand: Boolean) {
+ if (bubbleBarViewController.isHiddenForNoBubbles) {
+ // If there are no bubbles the bar is invisible, nothing to do here.
+ return
+ }
+ if (bubbleBarViewController.isExpanded != expand) {
+ bubbleBarViewController.isExpanded = expand
+ }
+ }
+
+ /** Animates bubble bar Y accordingly to the showing mode */
+ private fun animateBubbleBarY() {
+ val animator =
+ bubbleBarViewController.bubbleBarTranslationY.animateToValue(bubbleBarTranslationY)
+ updateTouchRegionOnAnimationEnd(animator)
+ animator.setDuration(BAR_TRANSLATION_DURATION)
+ animator.start()
+ }
+
+ private fun updateTouchRegionOnAnimationEnd(animator: Animator) {
+ animator.addListener(
+ object : AnimatorListenerAdapter() {
+
+ override fun onAnimationEnd(animation: Animator) {
+ controllersAfterInitAction.runAfterInit {
+ taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+ }
+ }
+ )
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashController.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashController.kt
new file mode 100644
index 0000000..1a4b982
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashController.kt
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.animation.AnimatorSet
+import android.content.res.Resources
+import android.view.MotionEvent
+import android.view.View
+import androidx.annotation.VisibleForTesting
+import com.android.launcher3.R
+import com.android.launcher3.anim.AnimatedFloat
+import com.android.launcher3.taskbar.StashedHandleViewController
+import com.android.launcher3.taskbar.TaskbarInsetsController
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
+import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_STASH_DURATION
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_TRANSLATION_DURATION
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.STASHED_BAR_SCALE
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.ControllersAfterInitAction
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.TaskbarHotseatDimensionsProvider
+import com.android.launcher3.util.MultiPropertyFactory
+import com.android.wm.shell.common.bubbles.BubbleBarLocation
+import com.android.wm.shell.shared.animation.PhysicsAnimator
+
+class TransientBubbleStashController(
+ private val taskbarHotseatDimensionsProvider: TaskbarHotseatDimensionsProvider,
+ resources: Resources
+) : BubbleStashController {
+
+ private lateinit var bubbleBarViewController: BubbleBarViewController
+ private lateinit var taskbarInsetsController: TaskbarInsetsController
+ private lateinit var controllersAfterInitAction: ControllersAfterInitAction
+
+ // stash view properties
+ private var bubbleStashedHandleViewController: BubbleStashedHandleViewController? = null
+ private var stashHandleViewAlpha: MultiPropertyFactory<View>.MultiProperty? = null
+ private var stashedHeight: Int = 0
+
+ // bubble bar properties
+ private lateinit var bubbleBarAlpha: MultiPropertyFactory<View>.MultiProperty
+ private lateinit var bubbleBarTranslationYAnimator: AnimatedFloat
+ private lateinit var bubbleBarScale: AnimatedFloat
+ private val mHandleCenterFromScreenBottom =
+ resources.getDimensionPixelSize(R.dimen.bubblebar_stashed_size) / 2f
+
+ private var animator: AnimatorSet? = null
+
+ override var isStashed: Boolean = false
+ @VisibleForTesting set
+
+ override var isBubblesShowingOnHome: Boolean = false
+ set(onHome) {
+ if (field == onHome) return
+ field = onHome
+ if (!bubbleBarViewController.hasBubbles()) {
+ // if there are no bubbles, there's nothing to show, so just return.
+ return
+ }
+ if (onHome) {
+ updateStashedAndExpandedState(stash = false, expand = false)
+ // When transitioning from app to home we need to animate the bubble bar
+ // here to align with hotseat center.
+ animateBubbleBarYToHotseat()
+ } else if (!bubbleBarViewController.isExpanded) {
+ updateStashedAndExpandedState(stash = true, expand = false)
+ }
+ bubbleBarViewController.onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ override var isBubblesShowingOnOverview: Boolean = false
+ set(onOverview) {
+ if (field == onOverview) return
+ field = onOverview
+ if (onOverview) {
+ // When transitioning to overview we need to animate the bubble bar to align with
+ // the taskbar bottom.
+ animateBubbleBarYToTaskbar()
+ } else {
+ updateStashedAndExpandedState(stash = true, expand = false)
+ }
+ bubbleBarViewController.onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ override var isSysuiLocked: Boolean = false
+ set(isLocked) {
+ if (field == isLocked) return
+ field = isLocked
+ if (!isLocked && bubbleBarViewController.hasBubbles()) {
+ animateAfterUnlock()
+ }
+ }
+
+ override val isTransientTaskBar: Boolean = true
+
+ override val bubbleBarTranslationYForHotseat: Float
+ get() {
+ val hotseatBottomSpace = taskbarHotseatDimensionsProvider.getHotseatBottomSpace()
+ val hotseatCellHeight = taskbarHotseatDimensionsProvider.getHotseatHeight()
+ val bubbleBarHeight: Float = bubbleBarViewController.bubbleBarCollapsedHeight
+ return -hotseatBottomSpace - (hotseatCellHeight - bubbleBarHeight) / 2
+ }
+
+ override val bubbleBarTranslationYForTaskbar: Float =
+ -taskbarHotseatDimensionsProvider.getTaskbarBottomSpace().toFloat()
+
+ /** Check if we have handle view controller */
+ override val hasHandleView: Boolean
+ get() = bubbleStashedHandleViewController != null
+
+ override fun init(
+ taskbarInsetsController: TaskbarInsetsController,
+ bubbleBarViewController: BubbleBarViewController,
+ bubbleStashedHandleViewController: BubbleStashedHandleViewController?,
+ controllersAfterInitAction: ControllersAfterInitAction
+ ) {
+ this.taskbarInsetsController = taskbarInsetsController
+ this.bubbleBarViewController = bubbleBarViewController
+ this.bubbleStashedHandleViewController = bubbleStashedHandleViewController
+ this.controllersAfterInitAction = controllersAfterInitAction
+ bubbleBarTranslationYAnimator = bubbleBarViewController.bubbleBarTranslationY
+ // bubble bar has only alpha property, getting it at index 0
+ bubbleBarAlpha = bubbleBarViewController.bubbleBarAlpha.get(/* index= */ 0)
+ bubbleBarScale = bubbleBarViewController.bubbleBarScale
+ stashedHeight = bubbleStashedHandleViewController?.stashedHeight ?: 0
+ stashHandleViewAlpha =
+ bubbleStashedHandleViewController
+ ?.stashedHandleAlpha
+ ?.get(StashedHandleViewController.ALPHA_INDEX_STASHED)
+ }
+
+ private fun animateAfterUnlock() {
+ val animatorSet = AnimatorSet()
+ if (isBubblesShowingOnHome || isBubblesShowingOnOverview) {
+ isStashed = false
+ animatorSet.playTogether(
+ bubbleBarScale.animateToValue(1f),
+ bubbleBarTranslationYAnimator.animateToValue(bubbleBarTranslationY),
+ bubbleBarAlpha.animateToValue(1f)
+ )
+ } else {
+ isStashed = true
+ stashHandleViewAlpha?.let { animatorSet.playTogether(it.animateToValue(1f)) }
+ }
+ animatorSet.updateTouchRegionOnAnimationEnd().setDuration(BAR_STASH_DURATION).start()
+ }
+
+ override fun showBubbleBarImmediate() {
+ showBubbleBarImmediate(bubbleBarTranslationY)
+ }
+
+ override fun showBubbleBarImmediate(bubbleBarTranslationY: Float) {
+ bubbleStashedHandleViewController?.setTranslationYForSwipe(0f)
+ stashHandleViewAlpha?.value = 0f
+ this.bubbleBarTranslationYAnimator.updateValue(bubbleBarTranslationY)
+ bubbleBarAlpha.setValue(1f)
+ bubbleBarScale.updateValue(1f)
+ isStashed = false
+ onIsStashedChanged()
+ }
+
+ override fun stashBubbleBarImmediate() {
+ bubbleStashedHandleViewController?.setTranslationYForSwipe(0f)
+ stashHandleViewAlpha?.value = 1f
+ this.bubbleBarTranslationYAnimator.updateValue(getStashTranslation())
+ bubbleBarAlpha.setValue(0f)
+ bubbleBarScale.updateValue(STASHED_BAR_SCALE)
+ isStashed = true
+ onIsStashedChanged()
+ }
+
+ override fun getTouchableHeight(): Int =
+ when {
+ isStashed -> stashedHeight
+ isBubbleBarVisible() -> bubbleBarViewController.bubbleBarCollapsedHeight.toInt()
+ else -> 0
+ }
+
+ override fun isBubbleBarVisible(): Boolean = bubbleBarViewController.hasBubbles() && !isStashed
+
+ override fun onNewBubbleAnimationInterrupted(isStashed: Boolean, bubbleBarTranslationY: Float) =
+ if (isStashed) {
+ stashBubbleBarImmediate()
+ } else {
+ showBubbleBarImmediate(bubbleBarTranslationY)
+ }
+
+ /** Check if [ev] belongs to the stash handle or the bubble bar views. */
+ override fun isEventOverBubbleBarViews(ev: MotionEvent): Boolean {
+ val isOverHandle = bubbleStashedHandleViewController?.isEventOverHandle(ev) ?: false
+ return isOverHandle || bubbleBarViewController.isEventOverAnyItem(ev)
+ }
+
+ /** Set the bubble bar stash handle location . */
+ override fun setBubbleBarLocation(bubbleBarLocation: BubbleBarLocation) {
+ bubbleStashedHandleViewController?.setBubbleBarLocation(bubbleBarLocation)
+ }
+
+ override fun stashBubbleBar() {
+ updateStashedAndExpandedState(stash = true, expand = false)
+ }
+
+ override fun showBubbleBar(expandBubbles: Boolean) {
+ updateStashedAndExpandedState(stash = false, expandBubbles)
+ }
+
+ override fun getDiffBetweenHandleAndBarCenters(): Float {
+ // the difference between the centers of the handle and the bubble bar is the difference
+ // between their distance from the bottom of the screen.
+ val barCenter: Float = bubbleBarViewController.bubbleBarCollapsedHeight / 2f
+ return mHandleCenterFromScreenBottom - barCenter
+ }
+
+ override fun getStashedHandleTranslationForNewBubbleAnimation(): Float {
+ return -mHandleCenterFromScreenBottom
+ }
+
+ override fun getStashedHandlePhysicsAnimator(): PhysicsAnimator<View>? {
+ return bubbleStashedHandleViewController?.physicsAnimator
+ }
+
+ override fun updateTaskbarTouchRegion() {
+ taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ override fun setHandleTranslationY(translationY: Float) {
+ bubbleStashedHandleViewController?.setTranslationYForSwipe(translationY)
+ }
+
+ override fun getHandleTranslationY(): Float? = bubbleStashedHandleViewController?.translationY
+
+ private fun getStashTranslation(): Float {
+ return (bubbleBarViewController.bubbleBarCollapsedHeight - stashedHeight) / 2f
+ }
+
+ /**
+ * Create a stash animation.
+ *
+ * @param isStashed whether it's a stash animation or an unstash animation
+ * @param duration duration of the animation
+ * @return the animation
+ */
+ @Suppress("SameParameterValue")
+ private fun createStashAnimator(isStashed: Boolean, duration: Long): AnimatorSet {
+ val animatorSet = AnimatorSet()
+ val fullLengthAnimatorSet = AnimatorSet()
+ // Not exactly half and may overlap. See [first|second]HalfDurationScale below.
+ val firstHalfAnimatorSet = AnimatorSet()
+ val secondHalfAnimatorSet = AnimatorSet()
+ val firstHalfDurationScale: Float
+ val secondHalfDurationScale: Float
+ val stashHandleAlphaValue: Float
+ if (isStashed) {
+ firstHalfDurationScale = 0.75f
+ secondHalfDurationScale = 0.5f
+ stashHandleAlphaValue = 1f
+ fullLengthAnimatorSet.play(
+ bubbleBarTranslationYAnimator.animateToValue(getStashTranslation())
+ )
+ firstHalfAnimatorSet.playTogether(
+ bubbleBarAlpha.animateToValue(0f),
+ bubbleBarScale.animateToValue(STASHED_BAR_SCALE)
+ )
+ } else {
+ firstHalfDurationScale = 0.5f
+ secondHalfDurationScale = 0.75f
+ stashHandleAlphaValue = 0f
+ fullLengthAnimatorSet.playTogether(
+ bubbleBarScale.animateToValue(1f),
+ bubbleBarTranslationYAnimator.animateToValue(bubbleBarTranslationY)
+ )
+ secondHalfAnimatorSet.playTogether(bubbleBarAlpha.animateToValue(1f))
+ }
+ stashHandleViewAlpha?.let {
+ secondHalfAnimatorSet.playTogether(it.animateToValue(stashHandleAlphaValue))
+ }
+ bubbleStashedHandleViewController?.createRevealAnimToIsStashed(isStashed)?.let {
+ fullLengthAnimatorSet.play(it)
+ }
+ fullLengthAnimatorSet.setDuration(duration)
+ firstHalfAnimatorSet.setDuration((duration * firstHalfDurationScale).toLong())
+ secondHalfAnimatorSet.setDuration((duration * secondHalfDurationScale).toLong())
+ secondHalfAnimatorSet.startDelay = (duration * (1 - secondHalfDurationScale)).toLong()
+ animatorSet.playTogether(fullLengthAnimatorSet, firstHalfAnimatorSet, secondHalfAnimatorSet)
+ animatorSet.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ animator = null
+ controllersAfterInitAction.runAfterInit {
+ if (isStashed) {
+ bubbleBarViewController.isExpanded = false
+ }
+ taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+ }
+ }
+ )
+ return animatorSet
+ }
+
+ private fun onIsStashedChanged() {
+ controllersAfterInitAction.runAfterInit {
+ taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ bubbleStashedHandleViewController?.onIsStashedChanged()
+ }
+ }
+
+ private fun animateBubbleBarYToHotseat() {
+ translateBubbleBarYUpdateTouchRegionOnCompletion(bubbleBarTranslationYForHotseat)
+ }
+
+ private fun animateBubbleBarYToTaskbar() {
+ translateBubbleBarYUpdateTouchRegionOnCompletion(bubbleBarTranslationYForTaskbar)
+ }
+
+ private fun translateBubbleBarYUpdateTouchRegionOnCompletion(toY: Float) {
+ bubbleBarViewController.bubbleBarTranslationY
+ .animateToValue(toY)
+ .updateTouchRegionOnAnimationEnd()
+ .setDuration(BAR_TRANSLATION_DURATION)
+ .start()
+ }
+
+ @VisibleForTesting
+ fun updateStashedAndExpandedState(stash: Boolean, expand: Boolean) {
+ if (bubbleBarViewController.isHiddenForNoBubbles) {
+ // If there are no bubbles the bar and handle are invisible, nothing to do here.
+ return
+ }
+ val isStashed = stash && !isBubblesShowingOnHome && !isBubblesShowingOnOverview
+ if (this.isStashed != isStashed) {
+ this.isStashed = isStashed
+ // notify the view controller that the stash state is about to change so that it can
+ // cancel an ongoing animation if there is one.
+ // note that this has to be called before updating mIsStashed with the new value,
+ // otherwise interrupting an ongoing animation may update it again with the wrong state
+ bubbleBarViewController.onStashStateChanging()
+ animator?.cancel()
+ animator =
+ createStashAnimator(isStashed, BAR_STASH_DURATION).apply {
+ updateTouchRegionOnAnimationEnd()
+ start()
+ }
+ }
+ if (bubbleBarViewController.isExpanded != expand) {
+ bubbleBarViewController.isExpanded = expand
+ }
+ }
+
+ private fun Animator.updateTouchRegionOnAnimationEnd(): Animator {
+ this.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ onIsStashedChanged()
+ }
+ }
+ )
+ return this
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/CustomizableTaskbarView.kt b/quickstep/src/com/android/launcher3/taskbar/customization/CustomizableTaskbarView.kt
new file mode 100644
index 0000000..e384586
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/CustomizableTaskbarView.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+import android.content.Context
+import android.graphics.Rect
+import android.util.AttributeSet
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.android.launcher3.Insettable
+import com.android.launcher3.R
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.views.ActivityContext
+
+/** TaskbarView that is customizeable via Taskbar containers. */
+class CustomizableTaskbarView(context: Context, attrs: AttributeSet? = null) :
+ ConstraintLayout(context, attrs), Insettable {
+ private val activityContext: TaskbarActivityContext = ActivityContext.lookupContext(context)
+
+ init {
+ inflate(context, R.layout.customizable_taskbar_view, this)
+ }
+
+ override fun setInsets(insets: Rect?) {
+ // Ignore, we just implement Insettable to draw behind system insets.
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarAllAppsButtonContainer.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarAllAppsButtonContainer.kt
new file mode 100644
index 0000000..7d2d36d
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarAllAppsButtonContainer.kt
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.LinearLayout
+import androidx.annotation.DimenRes
+import androidx.annotation.DrawableRes
+import androidx.core.view.setPadding
+import com.android.launcher3.R
+import com.android.launcher3.Utilities.dpToPx
+import com.android.launcher3.config.FeatureFlags
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.views.ActivityContext
+import com.android.launcher3.views.IconButtonView
+
+/** Taskbar all apps button container for customizable taskbar. */
+class TaskbarAllAppsButtonContainer
+@JvmOverloads
+constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0,
+) : LinearLayout(context, attrs), TaskbarContainer {
+
+ private val allAppsButton: IconButtonView =
+ LayoutInflater.from(context).inflate(R.layout.taskbar_all_apps_button, this, false)
+ as IconButtonView
+ private val activityContext: TaskbarActivityContext = ActivityContext.lookupContext(context)
+
+ override val spaceNeeded: Int
+ get() {
+ return dpToPx(activityContext.taskbarSpecsEvaluator!!.taskbarIconSize.size.toFloat())
+ }
+
+ init {
+ setUpIcon()
+ }
+
+ @SuppressLint("UseCompatLoadingForDrawables", "ResourceAsColor")
+ private fun setUpIcon() {
+ val drawable =
+ resources.getDrawable(
+ getAllAppsButton(activityContext.taskbarFeatureEvaluator!!.isTransient)
+ )
+ val padding = activityContext.taskbarSpecsEvaluator!!.taskbarIconPadding
+
+ allAppsButton.setIconDrawable(drawable)
+ allAppsButton.setPadding(padding)
+ allAppsButton.setForegroundTint(activityContext.getColor(R.color.all_apps_button_color))
+
+ // TODO(b/356465292) : add click listeners in future cl
+ addView(allAppsButton)
+ }
+
+ @DrawableRes
+ private fun getAllAppsButton(isTransientTaskbar: Boolean): Int {
+ val shouldSelectTransientIcon =
+ isTransientTaskbar ||
+ (FeatureFlags.enableTaskbarPinning() && !activityContext.isThreeButtonNav)
+ return if (FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) {
+ if (shouldSelectTransientIcon) R.drawable.ic_transient_taskbar_all_apps_search_button
+ else R.drawable.ic_taskbar_all_apps_search_button
+ } else {
+ if (shouldSelectTransientIcon) R.drawable.ic_transient_taskbar_all_apps_button
+ else R.drawable.ic_taskbar_all_apps_button
+ }
+ }
+
+ @DimenRes
+ fun getAllAppsButtonTranslationXOffset(isTransientTaskbar: Boolean): Int {
+ return if (isTransientTaskbar) {
+ R.dimen.transient_taskbar_all_apps_button_translation_x_offset
+ } else if (FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) {
+ R.dimen.taskbar_all_apps_search_button_translation_x_offset
+ } else {
+ R.dimen.taskbar_all_apps_button_translation_x_offset
+ }
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainer.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainer.kt
new file mode 100644
index 0000000..35ae43c
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainer.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar.customization
+
+import androidx.annotation.Dimension
+
+/**
+ * Interface to be implemented by all taskbar container to expose [spaceNeeded] for each container.
+ */
+interface TaskbarContainer {
+ @get:Dimension(unit = Dimension.DP) val spaceNeeded: Int
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainers.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainers.kt
new file mode 100644
index 0000000..d4548f5
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarContainers.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+/** Enums for all feature container that taskbar supports. */
+enum class TaskbarContainers {
+ ALL_APPS,
+ DIVIDER,
+ APP_ICONS,
+ RECENTS,
+ NAV_BUTTONS,
+ BUBBLES,
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarDividerContainer.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarDividerContainer.kt
new file mode 100644
index 0000000..26e71f7
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarDividerContainer.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.LinearLayout
+import androidx.core.view.setPadding
+import com.android.launcher3.R
+import com.android.launcher3.Utilities.dpToPx
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.views.ActivityContext
+import com.android.launcher3.views.IconButtonView
+
+/** Taskbar divider view container for customizable taskbar. */
+class TaskbarDividerContainer
+@JvmOverloads
+constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0,
+) : LinearLayout(context, attrs), TaskbarContainer {
+
+ private val taskbarDivider: IconButtonView =
+ LayoutInflater.from(context).inflate(R.layout.taskbar_divider, this, false)
+ as IconButtonView
+ private val activityContext: TaskbarActivityContext = ActivityContext.lookupContext(context)
+
+ override val spaceNeeded: Int
+ get() {
+ return dpToPx(activityContext.taskbarSpecsEvaluator!!.taskbarIconSize.size.toFloat())
+ }
+
+ init {
+ setUpIcon()
+ }
+
+ @SuppressLint("UseCompatLoadingForDrawables")
+ fun setUpIcon() {
+ val drawable = resources.getDrawable(R.drawable.taskbar_divider_button)
+ val padding = activityContext.taskbarSpecsEvaluator!!.taskbarIconPadding
+
+ taskbarDivider.setIconDrawable(drawable)
+ taskbarDivider.setPadding(padding)
+
+ // TODO(b/356465292):: add click listeners in future cl
+ addView(taskbarDivider)
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarFeatureEvaluator.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarFeatureEvaluator.kt
new file mode 100644
index 0000000..c83ac50
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarFeatureEvaluator.kt
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+import com.android.launcher3.Flags.enableRecentsInTaskbar
+import com.android.launcher3.config.FeatureFlags.enableTaskbarPinning
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.util.DisplayController
+
+/** Evaluates all the features taskbar can have. */
+class TaskbarFeatureEvaluator
+private constructor(
+ private val taskbarActivityContext: TaskbarActivityContext,
+) {
+
+ companion object {
+ @Volatile private lateinit var taskbarFeatureEvaluator: TaskbarFeatureEvaluator
+
+ @JvmStatic
+ fun getInstance(
+ taskbarActivityContext: TaskbarActivityContext,
+ ): TaskbarFeatureEvaluator {
+ synchronized(this) {
+ if (!::taskbarFeatureEvaluator.isInitialized) {
+ taskbarFeatureEvaluator = TaskbarFeatureEvaluator(taskbarActivityContext)
+ }
+ return taskbarFeatureEvaluator
+ }
+ }
+ }
+
+ val hasAllApps = true
+ val hasAppIcons = true
+ val hasBubbles = false
+ val hasNavButtons = taskbarActivityContext.isThreeButtonNav
+
+ val isRecentsEnabled: Boolean
+ get() = enableRecentsInTaskbar()
+
+ val hasDivider: Boolean
+ get() = enableTaskbarPinning() || isRecentsEnabled
+
+ val isTransient: Boolean
+ get() = DisplayController.isTransientTaskbar(taskbarActivityContext)
+
+ val isLandscape: Boolean
+ get() = taskbarActivityContext.deviceProfile.isLandscape
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarIconSpecs.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarIconSpecs.kt
new file mode 100644
index 0000000..887eb01
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarIconSpecs.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+/** Taskbar Icon Specs */
+object TaskbarIconSpecs {
+
+ val iconSize40dp = TaskbarIconSize(40)
+ val iconSize44dp = TaskbarIconSize(44)
+ val iconSize48dp = TaskbarIconSize(48)
+ val iconSize52dp = TaskbarIconSize(52)
+
+ val transientTaskbarIconSizes = arrayOf(iconSize44dp, iconSize48dp, iconSize52dp)
+
+ val defaultPersistentIconSize = iconSize40dp
+ val defaultTransientIconSize = iconSize44dp
+
+ val minimumIconSize = iconSize40dp
+
+ val defaultPersistentIconMargin = TaskbarIconMarginSize(6)
+ val defaultTransientIconMargin = TaskbarIconMarginSize(12)
+
+ val minimumTaskbarIconTouchSize = TaskbarIconSize(48)
+
+ val transientTaskbarIconSizeByGridSize =
+ mapOf(
+ TransientTaskbarIconSizeKey(6, 5, false) to iconSize52dp,
+ TransientTaskbarIconSizeKey(6, 5, true) to iconSize52dp,
+ TransientTaskbarIconSizeKey(4, 4, false) to iconSize48dp,
+ TransientTaskbarIconSizeKey(4, 4, true) to iconSize52dp,
+ TransientTaskbarIconSizeKey(4, 5, false) to iconSize48dp,
+ TransientTaskbarIconSizeKey(4, 5, true) to iconSize48dp,
+ TransientTaskbarIconSizeKey(5, 5, false) to iconSize44dp,
+ TransientTaskbarIconSizeKey(5, 5, true) to iconSize44dp,
+ )
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarSpecsEvaluator.kt b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarSpecsEvaluator.kt
new file mode 100644
index 0000000..761b47e
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/customization/TaskbarSpecsEvaluator.kt
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.customization
+
+import com.android.launcher3.taskbar.TaskbarActivityContext
+
+/** Evaluates the taskbar specs based on the taskbar grid size and the taskbar icon size. */
+class TaskbarSpecsEvaluator(
+ private val taskbarActivityContext: TaskbarActivityContext,
+ private val taskbarFeatureEvaluator: TaskbarFeatureEvaluator,
+ numRows: Int = taskbarActivityContext.deviceProfile.inv.numRows,
+ numColumns: Int = taskbarActivityContext.deviceProfile.inv.numColumns,
+) {
+ var taskbarIconSize: TaskbarIconSize = getIconSizeByGrid(numRows, numColumns)
+
+ // TODO(b/341146605) : initialize it to taskbar container in later cl.
+ private var taskbarContainer: List<TaskbarContainer> = emptyList()
+
+ val taskbarIconPadding: Int =
+ if (TaskbarIconSpecs.minimumTaskbarIconTouchSize.size > taskbarIconSize.size) {
+ (TaskbarIconSpecs.minimumTaskbarIconTouchSize.size - taskbarIconSize.size) / 2
+ } else {
+ 0
+ }
+
+ val taskbarIconMargin: TaskbarIconMarginSize =
+ if (taskbarFeatureEvaluator.isTransient) {
+ TaskbarIconSpecs.defaultTransientIconMargin
+ } else {
+ TaskbarIconSpecs.defaultPersistentIconMargin
+ }
+
+ fun getIconSizeByGrid(row: Int, column: Int): TaskbarIconSize {
+ return if (taskbarFeatureEvaluator.isTransient) {
+ TaskbarIconSpecs.transientTaskbarIconSizeByGridSize.getOrDefault(
+ TransientTaskbarIconSizeKey(row, column, taskbarFeatureEvaluator.isLandscape),
+ TaskbarIconSpecs.defaultTransientIconSize,
+ )
+ } else {
+ TaskbarIconSpecs.defaultPersistentIconSize
+ }
+ }
+
+ fun getIconSizeStepDown(iconSize: TaskbarIconSize): TaskbarIconSize {
+ if (!taskbarFeatureEvaluator.isTransient) return TaskbarIconSpecs.defaultPersistentIconSize
+
+ val currentIconSizeIndex = TaskbarIconSpecs.transientTaskbarIconSizes.indexOf(iconSize)
+ // return the current icon size if supplied icon size is unknown or we have reached the
+ // min icon size.
+ return if (currentIconSizeIndex == -1 || currentIconSizeIndex == 0) {
+ iconSize
+ } else {
+ TaskbarIconSpecs.transientTaskbarIconSizes[currentIconSizeIndex - 1]
+ }
+ }
+
+ fun getIconSizeStepUp(iconSize: TaskbarIconSize): TaskbarIconSize {
+ if (!taskbarFeatureEvaluator.isTransient) return TaskbarIconSpecs.defaultPersistentIconSize
+
+ val currentIconSizeIndex = TaskbarIconSpecs.transientTaskbarIconSizes.indexOf(iconSize)
+ // return the current icon size if supplied icon size is unknown or we have reached the
+ // max icon size.
+ return if (
+ currentIconSizeIndex == -1 ||
+ currentIconSizeIndex == TaskbarIconSpecs.transientTaskbarIconSizes.size - 1
+ ) {
+ iconSize
+ } else {
+ TaskbarIconSpecs.transientTaskbarIconSizes[currentIconSizeIndex + 1]
+ }
+ }
+
+ // TODO(jagrutdesai) : Call this in init once the containers are ready.
+ private fun calculateTaskbarIconSize() {
+ while (
+ taskbarIconSize != TaskbarIconSpecs.minimumIconSize &&
+ taskbarActivityContext.transientTaskbarBounds.width() <
+ calculateSpaceNeeded(taskbarContainer)
+ ) {
+ taskbarIconSize = getIconSizeStepDown(taskbarIconSize)
+ }
+ }
+
+ private fun calculateSpaceNeeded(containers: List<TaskbarContainer>): Int {
+ return containers.sumOf { it.spaceNeeded }
+ }
+}
+
+data class TaskbarIconSize(val size: Int)
+
+data class TransientTaskbarIconSizeKey(val row: Int, val column: Int, val isLandscape: Boolean)
+
+data class TaskbarIconMarginSize(val size: Int)
diff --git a/quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt b/quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt
index 8ad2493..e487f9f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt
@@ -24,8 +24,10 @@
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.Space
+import com.android.launcher3.DeviceProfile
import com.android.launcher3.R
import com.android.launcher3.Utilities
+import com.android.launcher3.taskbar.TaskbarActivityContext
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter
/**
@@ -73,6 +75,23 @@
return params
}
+ fun adjustForSetupInPhoneMode(
+ navButtonsLayoutParams: FrameLayout.LayoutParams,
+ navButtonsViewLayoutParams: FrameLayout.LayoutParams,
+ deviceProfile: DeviceProfile
+ ) {
+ val phoneOrPortraitSetupMargin =
+ resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_suw_margin)
+ navButtonsLayoutParams.marginStart = phoneOrPortraitSetupMargin
+ navButtonsLayoutParams.bottomMargin =
+ if (!deviceProfile.isLandscape) 0
+ else
+ phoneOrPortraitSetupMargin -
+ resources.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size) / 2
+ navButtonsViewLayoutParams.height =
+ resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_suw_height)
+ }
+
open fun repositionContextualContainer(
contextualContainer: ViewGroup,
buttonSize: Int,
diff --git a/quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt b/quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt
index 1e9f09b..2497fbb 100644
--- a/quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt
@@ -116,6 +116,7 @@
isPhoneGestureMode -> {
PhoneGestureLayoutter(
resources,
+ navButtonsView,
navButtonContainer,
endContextualContainer,
startContextualContainer,
diff --git a/quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt b/quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt
index 8d91f2c..390ec34 100644
--- a/quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt
@@ -17,15 +17,19 @@
package com.android.launcher3.taskbar.navbutton
import android.content.res.Resources
+import android.view.Gravity
import android.view.ViewGroup
+import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.Space
+import com.android.launcher3.DeviceProfile
import com.android.launcher3.taskbar.TaskbarActivityContext
/** Layoutter for showing gesture navigation on phone screen. No buttons here, no-op container */
class PhoneGestureLayoutter(
resources: Resources,
+ navButtonsView: NearestTouchFrame,
navBarContainer: LinearLayout,
endContextualContainer: ViewGroup,
startContextualContainer: ViewGroup,
@@ -42,8 +46,31 @@
a11yButton,
space
) {
+ private val mNavButtonsView = navButtonsView
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
+ // TODO: look into if we should use SetupNavLayoutter instead.
+ if (!context.isUserSetupComplete) {
+ // Since setup wizard only has back button enabled, it looks strange to be
+ // end-aligned, so start-align instead.
+ val navButtonsLayoutParams = navButtonContainer.layoutParams as FrameLayout.LayoutParams
+ val navButtonsViewLayoutParams =
+ mNavButtonsView.layoutParams as FrameLayout.LayoutParams
+ val deviceProfile: DeviceProfile = context.deviceProfile
+
+ navButtonsLayoutParams.marginEnd = 0
+ navButtonsLayoutParams.gravity = Gravity.START
+ context.setTaskbarWindowSize(context.setupWindowSize)
+
+ adjustForSetupInPhoneMode(
+ navButtonsLayoutParams,
+ navButtonsViewLayoutParams,
+ deviceProfile
+ )
+ mNavButtonsView.layoutParams = navButtonsViewLayoutParams
+ navButtonContainer.layoutParams = navButtonsLayoutParams
+ }
+
endContextualContainer.removeAllViews()
startContextualContainer.removeAllViews()
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt b/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt
index 91042c3..22a3630 100644
--- a/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt
@@ -77,16 +77,11 @@
navButtonsLayoutParams.height =
resources.getDimensionPixelSize(R.dimen.taskbar_back_button_suw_height)
} else {
- val phoneOrPortraitSetupMargin =
- resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_suw_margin)
- navButtonsLayoutParams.marginStart = phoneOrPortraitSetupMargin
- navButtonsLayoutParams.bottomMargin =
- if (!deviceProfile.isLandscape) 0
- else
- phoneOrPortraitSetupMargin -
- resources.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size) / 2
- navButtonsViewLayoutParams.height =
- resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_suw_height)
+ adjustForSetupInPhoneMode(
+ navButtonsLayoutParams,
+ navButtonsViewLayoutParams,
+ deviceProfile
+ )
}
mNavButtonsView.layoutParams = navButtonsViewLayoutParams
navButtonContainer.layoutParams = navButtonsLayoutParams
diff --git a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java
index adbec65..7eb34a5 100644
--- a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java
@@ -133,16 +133,19 @@
* <p>
* This method should be called after an exit animation finishes, if applicable.
*/
- @SuppressLint("WrongConstant")
void maybeCloseWindow() {
- if (mOverlayContext != null && (AbstractFloatingView.hasOpenView(mOverlayContext, TYPE_ALL)
- || mOverlayContext.getDragController().isSystemDragInProgress())) {
- return;
- }
+ if (!canCloseWindow()) return;
mProxyView.close(false);
onDestroy();
}
+ @SuppressLint("WrongConstant")
+ private boolean canCloseWindow() {
+ if (mOverlayContext == null) return true;
+ if (AbstractFloatingView.hasOpenView(mOverlayContext, TYPE_ALL)) return false;
+ return !mOverlayContext.getDragController().isSystemDragInProgress();
+ }
+
/** Destroys the controller and any overlay window if present. */
public void onDestroy() {
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
@@ -212,10 +215,17 @@
@Override
protected void handleClose(boolean animate) {
- if (mIsOpen) {
- mTaskbarContext.getDragLayer().removeView(this);
- Optional.ofNullable(mOverlayContext).ifPresent(c -> closeAllOpenViews(c, animate));
- }
+ if (!mIsOpen) return;
+ mTaskbarContext.getDragLayer().removeView(this);
+ Optional.ofNullable(mOverlayContext).ifPresent(c -> {
+ if (canCloseWindow()) {
+ onDestroy(); // Window is already ready to be destroyed.
+ } else {
+ // Close window's AFVs before destroying it. Its drag layer will attempt to
+ // close the proxy view again once its children are removed.
+ closeAllOpenViews(c, animate);
+ }
+ });
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayDragLayer.java
index 9c3e8af..773b0b9 100644
--- a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayDragLayer.java
@@ -30,7 +30,7 @@
import androidx.annotation.NonNull;
-import com.android.app.viewcapture.SettingsAwareViewCapture;
+import com.android.app.viewcapture.ViewCaptureFactory;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -59,7 +59,7 @@
protected void onAttachedToWindow() {
super.onAttachedToWindow();
getViewTreeObserver().addOnComputeInternalInsetsListener(this);
- mViewCaptureCloseable = SettingsAwareViewCapture.getInstance(getContext())
+ mViewCaptureCloseable = ViewCaptureFactory.getInstance(getContext())
.startCapture(getRootView(), ".TaskbarOverlay");
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index 2eced74..14d391b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -71,7 +71,7 @@
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, scaleAndOffset[1]);
TASK_SECONDARY_TRANSLATION.set(mRecentsView, 0f);
- getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
+ getContentAlphaProperty().set(mRecentsView, state.isRecentsViewVisible ? 1f : 0);
getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness());
RECENTS_GRID_PROGRESS.set(mRecentsView,
state.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f);
@@ -109,7 +109,8 @@
setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f,
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
- boolean exitingOverview = !FeatureFlags.enableSplitContextually() && !toState.overviewUi;
+ boolean exitingOverview =
+ !FeatureFlags.enableSplitContextually() && !toState.isRecentsViewVisible;
if (mRecentsView.isSplitSelectionActive() && exitingOverview) {
setter.add(mRecentsView.getSplitSelectController().getSplitAnimationController()
.createPlaceholderDismissAnim(mLauncher, LAUNCHER_SPLIT_SELECTION_EXIT_HOME,
@@ -124,7 +125,8 @@
);
}
- setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0,
+ setter.setFloat(mRecentsView, getContentAlphaProperty(),
+ toState.isRecentsViewVisible ? 1 : 0,
config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
setter.setFloat(
@@ -145,7 +147,7 @@
private Interpolator getOverviewInterpolator(LauncherState fromState, LauncherState toState) {
return fromState == QUICK_SWITCH_FROM_HOME
? ACCELERATE_DECELERATE
- : toState.overviewUi ? INSTANT : FINAL_FRAME;
+ : toState.isRecentsViewVisible ? INSTANT : FINAL_FRAME;
}
abstract FloatProperty getTaskModalnessProperty();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
index 110ca16..37e0034 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter;
import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.Keyframe;
@@ -39,6 +40,7 @@
import android.os.Process;
import android.util.AttributeSet;
import android.util.FloatProperty;
+import android.util.Property;
import android.view.LayoutInflater;
import android.view.ViewGroup;
@@ -71,12 +73,27 @@
*/
public class PredictedAppIcon extends DoubleShadowBubbleTextView {
+ private static final float RING_SCALE_START_VALUE = 0.75f;
private static final int RING_SHADOW_COLOR = 0x99000000;
private static final float RING_EFFECT_RATIO = 0.095f;
private static final long ICON_CHANGE_ANIM_DURATION = 360;
private static final long ICON_CHANGE_ANIM_STAGGER = 50;
+ private static final Property<PredictedAppIcon, Float> RING_SCALE_PROPERTY =
+ new Property<>(Float.TYPE, "ringScale") {
+ @Override
+ public Float get(PredictedAppIcon icon) {
+ return icon.mRingScale;
+ }
+
+ @Override
+ public void set(PredictedAppIcon icon, Float value) {
+ icon.mRingScale = value;
+ icon.invalidate();
+ }
+ };
+
boolean mIsDrawingDot = false;
private final DeviceProfile mDeviceProfile;
private final Paint mIconRingPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@@ -96,6 +113,11 @@
private Animator mSlotMachineAnim;
private float mSlotMachineIconTranslationY;
+ // Used to animate the "ring" around predicted icons
+ private float mRingScale = 1f;
+ private boolean mForceHideRing = false;
+ private Animator mRingScaleAnim;
+
private static final FloatProperty<PredictedAppIcon> SLOT_MACHINE_TRANSLATION_Y =
new FloatProperty<PredictedAppIcon>("slotMachineTranslationY") {
@Override
@@ -356,17 +378,57 @@
}
}
+ @Override
+ public void setIconVisible(boolean visible) {
+ setForceHideRing(!visible);
+ super.setIconVisible(visible);
+ }
+
+ private void setForceHideRing(boolean forceHideRing) {
+ if (mForceHideRing == forceHideRing) {
+ return;
+ }
+ mForceHideRing = forceHideRing;
+
+ if (forceHideRing) {
+ invalidate();
+ } else {
+ animateRingScale(RING_SCALE_START_VALUE, 1);
+ }
+ }
+
+ private void cancelRingScaleAnim() {
+ if (mRingScaleAnim != null) {
+ mRingScaleAnim.cancel();
+ }
+ }
+
+ private void animateRingScale(float... ringScale) {
+ cancelRingScaleAnim();
+ mRingScaleAnim = ObjectAnimator.ofFloat(this, RING_SCALE_PROPERTY, ringScale);
+ mRingScaleAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mRingScaleAnim = null;
+ }
+ });
+ mRingScaleAnim.start();
+ }
+
private void drawEffect(Canvas canvas) {
- // Don't draw ring effect if item is about to be dragged.
- if (mDrawForDrag) {
+ // Don't draw ring effect if item is about to be dragged or if the icon is not visible.
+ if (mDrawForDrag || !mIsIconVisible) {
return;
}
mIconRingPaint.setColor(RING_SHADOW_COLOR);
mIconRingPaint.setMaskFilter(mShadowFilter);
+ int count = canvas.save();
+ canvas.scale(mRingScale, mRingScale, canvas.getWidth() / 2f, canvas.getHeight() / 2f);
canvas.drawPath(mRingPath, mIconRingPaint);
mIconRingPaint.setColor(mPlateColor);
mIconRingPaint.setMaskFilter(null);
canvas.drawPath(mRingPath, mIconRingPaint);
+ canvas.restoreToCount(count);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 4184ab2..17735e1 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -45,6 +45,7 @@
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.SystemShortcut.APP_INFO;
+import static com.android.launcher3.popup.SystemShortcut.BUBBLE_SHORTCUT;
import static com.android.launcher3.popup.SystemShortcut.DONT_SUGGEST_APP;
import static com.android.launcher3.popup.SystemShortcut.INSTALL;
import static com.android.launcher3.popup.SystemShortcut.PRIVATE_PROFILE_INSTALL;
@@ -60,12 +61,13 @@
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.QUICK_SWITCH_FROM_HOME_FAILED;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.QUICK_SWITCH_FROM_HOME_FALLBACK;
import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
import static com.android.quickstep.util.SplitAnimationTimings.TABLET_HOME_TO_SPLIT;
+import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -74,6 +76,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
+import android.content.pm.ShortcutInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -103,7 +106,7 @@
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
-import com.android.app.viewcapture.SettingsAwareViewCapture;
+import com.android.app.viewcapture.ViewCaptureFactory;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
@@ -172,6 +175,7 @@
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TouchInteractionService.TISBinder;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.AsyncClockEventDelegate;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.LauncherUnfoldAnimationController;
@@ -194,8 +198,12 @@
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import com.android.systemui.unfold.config.ResourceUnfoldTransitionConfig;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;
+import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.progress.RemoteUnfoldTransitionReceiver;
import com.android.systemui.unfold.updates.RotationChangeProvider;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
+
+import kotlin.Unit;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -209,7 +217,8 @@
import java.util.function.Predicate;
import java.util.stream.Stream;
-public class QuickstepLauncher extends Launcher implements RecentsViewContainer {
+public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
+ SystemShortcut.BubbleActivityStarter {
private static final boolean TRACE_LAYOUTS =
SystemProperties.getBoolean("persist.debug.trace_layouts", false);
private static final String TRACE_RELAYOUT_CLASS =
@@ -250,6 +259,10 @@
private boolean mIsPredictiveBackToHomeInProgress;
+ private boolean mCanShowAllAppsEducationView;
+
+ private boolean mIsOverlayVisible;
+
public static QuickstepLauncher getLauncher(Context context) {
return fromContext(context);
}
@@ -270,7 +283,7 @@
// TODO(b/337863494): Explore use of the same OverviewComponentObserver across launcher
OverviewComponentObserver overviewComponentObserver = new OverviewComponentObserver(
asContext(), deviceState);
- if (enableDesktopWindowingMode()) {
+ if (DesktopModeStatus.canEnterDesktopMode(this)) {
mDesktopRecentsTransitionController = new DesktopRecentsTransitionController(
getStateManager(), systemUiProxy, getIApplicationThread(),
getDepthController());
@@ -290,7 +303,7 @@
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
mDepthController = new DepthController(this);
- if (enableDesktopWindowingMode()) {
+ if (DesktopModeStatus.canEnterDesktopMode(this)) {
mDesktopVisibilityController = new DesktopVisibilityController(this);
mDesktopVisibilityController.registerSystemUiListener();
mSplitSelectStateController.initSplitFromDesktopController(this,
@@ -398,6 +411,12 @@
}
@Override
+ public void startBinding() {
+ super.startBinding();
+ mHotseatPredictionController.verifyUIUpdateNotPaused();
+ }
+
+ @Override
protected void onActivityFlagsChanged(int changeBits) {
if ((changeBits & ACTIVITY_STATE_STARTED) != 0) {
mDepthController.setActivityStarted(isStarted());
@@ -450,6 +469,9 @@
if (Flags.enablePrivateSpace()) {
shortcuts.add(UNINSTALL_APP);
}
+ if (com.android.wm.shell.Flags.enableBubbleAnything()) {
+ shortcuts.add(BUBBLE_SHORTCUT);
+ }
return shortcuts.stream();
}
@@ -481,7 +503,8 @@
(getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0;
boolean visible = (state == NORMAL || state == OVERVIEW)
&& (willUserBeActive || isUserActive())
- && !profile.isVerticalBarLayout();
+ && !profile.isVerticalBarLayout()
+ && !mIsOverlayVisible;
SystemUiProxy.INSTANCE.get(this)
.setLauncherKeepClearAreaHeight(visible, profile.hotseatBarSizePx);
}
@@ -491,6 +514,12 @@
}
@Override
+ public void onOverlayVisibilityChanged(boolean visible) {
+ super.onOverlayVisibilityChanged(visible);
+ mIsOverlayVisible = visible;
+ }
+
+ @Override
public void bindExtraContainerItems(FixedContainerItems item) {
if (item.containerId == Favorites.CONTAINER_PREDICTION) {
mAllAppsPredictions = item;
@@ -501,7 +530,7 @@
} else if (item.containerId == Favorites.CONTAINER_HOTSEAT_PREDICTION) {
mHotseatPredictionController.setPredictedItems(item);
} else if (item.containerId == Favorites.CONTAINER_WIDGETS_PREDICTION) {
- getPopupDataProvider().setRecommendedWidgets(item.items);
+ getWidgetPickerDataProvider().setWidgetRecommendations(item.items);
}
}
@@ -572,16 +601,32 @@
}
case QUICK_SWITCH_STATE_ORDINAL: {
RecentsView rv = getOverviewPanel();
- TaskView tasktolaunch = rv.getCurrentPageTaskView();
- if (tasktolaunch != null) {
- tasktolaunch.launchTask(success -> {
+ TaskView currentPageTask = rv.getCurrentPageTaskView();
+ TaskView fallbackTask = rv.getTaskViewAt(0);
+ if (currentPageTask != null || fallbackTask != null) {
+ TaskView taskToLaunch = currentPageTask;
+ if (currentPageTask == null) {
+ taskToLaunch = fallbackTask;
+ ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
+ "Quick switch from home fallback case: The TaskView at index ")
+ .append(rv.getCurrentPage())
+ .append(" is missing."),
+ QUICK_SWITCH_FROM_HOME_FALLBACK);
+ }
+ taskToLaunch.launchTask(success -> {
if (!success) {
getStateManager().goToState(OVERVIEW);
} else {
getStateManager().moveToRestState();
}
+ return Unit.INSTANCE;
});
} else {
+ ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
+ "Quick switch from home failed: TaskViews at indices ")
+ .append(rv.getCurrentPage())
+ .append(" and 0 are missing."),
+ QUICK_SWITCH_FROM_HOME_FAILED);
getStateManager().goToState(NORMAL);
}
break;
@@ -662,7 +707,7 @@
addMultiWindowModeChangedListener(mDepthController);
initUnfoldTransitionProgressProvider();
if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
- mViewCapture = SettingsAwareViewCapture.getInstance(this).startCapture(getWindow());
+ mViewCapture = ViewCaptureFactory.getInstance(this).startCapture(getWindow());
}
getWindow().addPrivateFlags(PRIVATE_FLAG_OPTIMIZE_MEASURE);
QuickstepOnboardingPrefs.setup(this);
@@ -684,7 +729,7 @@
// Check if there is already an instance of this app running, if so, initiate the split
// using that.
mSplitSelectStateController.findLastActiveTasksAndRunCallback(
- Collections.singletonList(splitSelectSource.itemInfo.getComponentKey()),
+ Collections.singletonList(splitSelectSource.getItemInfo().getComponentKey()),
false /* findExactPairMatch */,
foundTasks -> {
@Nullable Task foundTask = foundTasks[0];
@@ -711,7 +756,7 @@
Rect tempRect = new Rect();
mSplitSelectStateController.setInitialTaskSelect(source.intent,
- source.position.stagePosition, source.itemInfo, source.splitEvent,
+ source.position.stagePosition, source.getItemInfo(), source.splitEvent,
source.alreadyRunningTaskId);
RecentsView recentsView = getOverviewPanel();
@@ -729,6 +774,8 @@
floatingTaskView.setOnClickListener(view ->
mSplitSelectStateController.getSplitAnimationController().
playAnimPlaceholderToFullscreen(this, view, Optional.empty()));
+ floatingTaskView.setContentDescription(source.getItemInfo().contentDescription);
+
mSplitSelectStateController.setFirstFloatingTaskView(floatingTaskView);
anim.addListener(new AnimatorListenerAdapter() {
@Override
@@ -746,6 +793,9 @@
@Override
public boolean isSplitSelectionActive() {
+ if (mSplitSelectStateController == null) {
+ return false;
+ }
return mSplitSelectStateController.isSplitSelectActive();
}
@@ -973,7 +1023,7 @@
@Override
public void setResumed() {
- if (!enableDesktopWindowingWallpaperActivity()
+ if (!WALLPAPER_ACTIVITY.isEnabled(this)
&& mDesktopVisibilityController != null
&& mDesktopVisibilityController.areDesktopTasksVisible()
&& !mDesktopVisibilityController.isRecentsGestureInProgress()) {
@@ -1038,6 +1088,7 @@
getMainExecutor(),
getMainThreadHandler(),
/* backgroundExecutor= */ UI_HELPER_EXECUTOR,
+ /* bgHandler= */ UI_HELPER_EXECUTOR.getHandler(),
/* tracingTagPrefix= */ "launcher",
getSystemService(DisplayManager.class)
);
@@ -1057,7 +1108,7 @@
}
private void initUnfoldAnimationController(UnfoldTransitionProgressProvider progressProvider,
- RotationChangeProvider rotationChangeProvider) {
+ @UnfoldMain RotationChangeProvider rotationChangeProvider) {
mLauncherUnfoldAnimationController = new LauncherUnfoldAnimationController(
/* launcher= */ this,
getWindowManager(),
@@ -1104,7 +1155,7 @@
}
@Override
- protected void collectStateHandlers(List<StateHandler> out) {
+ public void collectStateHandlers(List<StateHandler<LauncherState>> out) {
super.collectStateHandlers(out);
out.add(getDepthController());
out.add(new RecentsViewStateController(this));
@@ -1168,7 +1219,6 @@
: Display.DEFAULT_DISPLAY);
activityOptions.options.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
- addLaunchCookie(item, activityOptions.options);
return activityOptions;
}
@@ -1193,19 +1243,6 @@
}
/**
- * Adds a new launch cookie for the activity launch if supported.
- *
- * @param info the item info for the launch
- * @param opts the options to set the launchCookie on.
- */
- public void addLaunchCookie(ItemInfo info, ActivityOptions opts) {
- IBinder launchCookie = getLaunchCookie(info);
- if (launchCookie != null) {
- opts.setLaunchCookie(launchCookie);
- }
- }
-
- /**
* Return a new launch cookie for the activity launch if supported.
*
* @param info the item info for the launch
@@ -1262,7 +1299,7 @@
if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
getDragLayer().recreateControllers();
if (mActionsView != null) {
- mActionsView.updateVerticalMargin(info.navigationMode);
+ mActionsView.updateVerticalMargin(info.getNavigationMode());
}
}
}
@@ -1353,10 +1390,11 @@
*/
public void launchSplitTasks(
@NonNull GroupTask groupTask, @Nullable RemoteTransition remoteTransition) {
- // Top/left and bottom/right tasks respectively.
- Task task1 = groupTask.task1;
+ // SplitBounds can be null if coming from Taskbar launch.
+ final boolean firstTaskIsLeftTopTask = isFirstTaskLeftTopTask(groupTask);
// task2 should never be null when calling this method. Allow a crash to catch invalid calls
- Task task2 = groupTask.task2;
+ Task task1 = firstTaskIsLeftTopTask ? groupTask.task1 : groupTask.task2;
+ Task task2 = firstTaskIsLeftTopTask ? groupTask.task2 : groupTask.task1;
mSplitSelectStateController.launchExistingSplitPair(
null /* launchingTaskView */,
task1.key.id,
@@ -1370,12 +1408,23 @@
remoteTransition);
}
+ private static boolean isFirstTaskLeftTopTask(@NonNull GroupTask groupTask) {
+ return groupTask.mSplitBounds == null
+ || groupTask.mSplitBounds.leftTopTaskId == groupTask.task1.key.id;
+ }
+
/**
* Launches two apps as an app pair.
*/
public void launchAppPair(AppPairIcon appPairIcon) {
+ // Potentially show the Taskbar education once the app pair launch finishes
mSplitSelectStateController.getAppPairsController().launchAppPair(appPairIcon,
- CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE);
+ CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE,
+ (success) -> {
+ if (success && mTaskbarUIController != null) {
+ mTaskbarUIController.showEduOnAppLaunch();
+ }
+ });
}
public boolean canStartHomeSafely() {
@@ -1407,6 +1456,18 @@
return true;
}
+ @Override
+ public void showShortcutBubble(ShortcutInfo info) {
+ if (info == null) return;
+ SystemUiProxy.INSTANCE.get(this).showShortcutBubble(info);
+ }
+
+ @Override
+ public void showAppBubble(Intent intent) {
+ if (intent == null || intent.getPackage() == null) return;
+ SystemUiProxy.INSTANCE.get(this).showAppBubble(intent);
+ }
+
private static final class LauncherTaskViewController extends
TaskViewTouchController<QuickstepLauncher> {
@@ -1471,4 +1532,17 @@
}
return super.onCreateView(parent, name, context, attrs);
}
+
+ @Override
+ public boolean isRecentsViewVisible() {
+ return getStateManager().getState().isRecentsViewVisible;
+ }
+
+ public boolean isCanShowAllAppsEducationView() {
+ return mCanShowAllAppsEducationView;
+ }
+
+ public void setCanShowAllAppsEducationView(boolean canShowAllAppsEducationView) {
+ mCanShowAllAppsEducationView = canShowAllAppsEducationView;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepWidgetHolder.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepWidgetHolder.java
index 01d5ff0..56fc4d1 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepWidgetHolder.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepWidgetHolder.java
@@ -17,7 +17,6 @@
import static com.android.launcher3.BuildConfig.WIDGETS_ENABLED;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
@@ -100,7 +99,7 @@
// for concurrent modification.
new ArrayList<>(h.mProviderChangedListeners).forEach(
ProviderChangedListener::notifyWidgetProvidersChanged))),
- UI_HELPER_EXECUTOR.getLooper());
+ getWidgetHolderExecutor().getLooper());
if (WIDGETS_ENABLED) {
sWidgetHost.startListening();
}
@@ -199,8 +198,10 @@
return;
}
- sWidgetHost.setAppWidgetHidden();
- setListeningFlag(false);
+ getWidgetHolderExecutor().execute(() -> {
+ sWidgetHost.setAppWidgetHidden();
+ setListeningFlag(false);
+ });
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index 6c1d4b1..235ec7b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -21,7 +21,6 @@
import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
-import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
import static com.android.quickstep.views.RecentsView.TASK_MODALNESS;
@@ -41,6 +40,7 @@
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
+import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
@@ -67,7 +67,7 @@
@Override
public void setState(@NonNull LauncherState state) {
super.setState(state);
- if (state.overviewUi) {
+ if (state.isRecentsViewVisible) {
mRecentsView.updateEmptyMessage();
} else {
mRecentsView.resetTaskVisuals();
@@ -76,7 +76,7 @@
mRecentsView.setFullscreenProgress(state.getOverviewFullscreenProgress());
// In Overview, we may be layering app surfaces behind Launcher, so we need to notify
// DepthController to prevent optimizations which might occlude the layers behind
- mLauncher.getDepthController().setHasContentBehindLauncher(state.overviewUi);
+ mLauncher.getDepthController().setHasContentBehindLauncher(state.isRecentsViewVisible);
PendingAnimation builder =
new PendingAnimation(state.getTransitionDuration(mLauncher, true));
@@ -89,7 +89,7 @@
@NonNull StateAnimationConfig config, @NonNull PendingAnimation builder) {
super.setStateWithAnimationInternal(toState, config, builder);
- if (toState.overviewUi) {
+ if (toState.isRecentsViewVisible) {
// While animating into recents, update the visible task data as needed
builder.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
mRecentsView.updateEmptyMessage();
@@ -107,7 +107,8 @@
// In Overview, we may be layering app surfaces behind Launcher, so we need to notify
// DepthController to prevent optimizations which might occlude the layers behind
builder.addListener(AnimatorListeners.forSuccessCallback(() ->
- mLauncher.getDepthController().setHasContentBehindLauncher(toState.overviewUi)));
+ mLauncher.getDepthController().setHasContentBehindLauncher(
+ toState.isRecentsViewVisible)));
handleSplitSelectionState(toState, builder, /* animate */true);
@@ -168,7 +169,7 @@
clearAllButtonAlpha, LINEAR);
float overviewButtonAlpha = state.areElementsVisible(mLauncher, OVERVIEW_ACTIONS) ? 1 : 0;
propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(),
- MULTI_PROPERTY_VALUE, overviewButtonAlpha, config.getInterpolator(
+ AnimatedFloat.VALUE, overviewButtonAlpha, config.getInterpolator(
ANIM_OVERVIEW_ACTIONS_FADE, LINEAR));
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/SystemApiWrapper.kt b/quickstep/src/com/android/launcher3/uioverrides/SystemApiWrapper.kt
index 535b4c2..0469636 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/SystemApiWrapper.kt
+++ b/quickstep/src/com/android/launcher3/uioverrides/SystemApiWrapper.kt
@@ -17,30 +17,38 @@
import android.app.ActivityOptions
import android.app.PendingIntent
+import android.app.role.RoleManager
import android.content.Context
+import android.content.IIntentReceiver
+import android.content.IIntentSender
import android.content.Intent
import android.content.pm.ActivityInfo
import android.content.pm.LauncherActivityInfo
import android.content.pm.LauncherApps
import android.content.pm.ShortcutInfo
+import android.os.Bundle
import android.os.Flags.allowPrivateProfile
+import android.os.IBinder
import android.os.UserHandle
import android.os.UserManager
import android.util.ArrayMap
+import android.widget.Toast
import android.window.RemoteTransition
import com.android.launcher3.Flags.enablePrivateSpace
import com.android.launcher3.Flags.enablePrivateSpaceInstallShortcut
import com.android.launcher3.Flags.privateSpaceAppInstallerButton
import com.android.launcher3.Flags.privateSpaceSysAppsSeparation
+import com.android.launcher3.R
import com.android.launcher3.Utilities
import com.android.launcher3.proxy.ProxyActivityStarter
import com.android.launcher3.util.ApiWrapper
+import com.android.launcher3.util.Executors
import com.android.launcher3.util.StartActivityParams
import com.android.launcher3.util.UserIconInfo
import com.android.quickstep.util.FadeOutRemoteTransition
/** A wrapper for the hidden API calls */
-class SystemApiWrapper(context: Context?) : ApiWrapper(context) {
+open class SystemApiWrapper(context: Context?) : ApiWrapper(context) {
override fun getPersons(si: ShortcutInfo) = si.persons ?: Utilities.EMPTY_PERSON_ARRAY
@@ -115,8 +123,7 @@
intentSender =
mContext
.getSystemService(LauncherApps::class.java)
- ?.privateSpaceSettingsIntent
- ?: return null
+ ?.privateSpaceSettingsIntent ?: return null
options =
ActivityOptions.makeBasic()
.setPendingIntentBackgroundActivityStartMode(
@@ -130,4 +137,50 @@
override fun isNonResizeableActivity(lai: LauncherActivityInfo) =
lai.activityInfo.resizeMode == ActivityInfo.RESIZE_MODE_UNRESIZEABLE
+
+ /**
+ * Starts an Activity which can be used to set this Launcher as the HOME app, via a consent
+ * screen. In case the consent screen cannot be shown, or the user does not set current Launcher
+ * as HOME app, a toast asking the user to do the latter is shown.
+ */
+ override fun assignDefaultHomeRole(context: Context) {
+ val roleManager = context.getSystemService(RoleManager::class.java)
+ if (
+ (roleManager!!.isRoleAvailable(RoleManager.ROLE_HOME) &&
+ !roleManager.isRoleHeld(RoleManager.ROLE_HOME))
+ ) {
+ val roleRequestIntent = roleManager.createRequestRoleIntent(RoleManager.ROLE_HOME)
+ val pendingIntent =
+ PendingIntent(
+ object : IIntentSender.Stub() {
+ override fun send(
+ code: Int,
+ intent: Intent,
+ resolvedType: String?,
+ allowlistToken: IBinder?,
+ finishedReceiver: IIntentReceiver?,
+ requiredPermission: String?,
+ options: Bundle?
+ ) {
+ if (code != -1) {
+ Executors.MAIN_EXECUTOR.execute {
+ Toast.makeText(
+ context,
+ context.getString(
+ R.string.set_default_home_app,
+ context.getString(R.string.derived_app_name)
+ ),
+ Toast.LENGTH_LONG
+ )
+ .show()
+ }
+ }
+ }
+ }
+ )
+ val params = StartActivityParams(pendingIntent, 0)
+ params.intent = roleRequestIntent
+ context.startActivity(ProxyActivityStarter.getLaunchIntent(context, params))
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DevOptionsUiHelper.kt b/quickstep/src/com/android/launcher3/uioverrides/flags/DevOptionsUiHelper.kt
index 3881e9a..181cba0 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/DevOptionsUiHelper.kt
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DevOptionsUiHelper.kt
@@ -16,14 +16,28 @@
package com.android.launcher3.uioverrides.flags
+import android.app.PendingIntent
+import android.app.blob.BlobHandle.createWithSha256
+import android.app.blob.BlobStoreManager
import android.content.Context
+import android.content.IIntentReceiver
+import android.content.IIntentSender.Stub
import android.content.Intent
+import android.content.Intent.ACTION_CREATE_DOCUMENT
+import android.content.Intent.ACTION_OPEN_DOCUMENT
import android.content.pm.PackageManager
import android.net.Uri
+import android.os.Bundle
+import android.os.IBinder
+import android.os.ParcelFileDescriptor.AutoCloseOutputStream
import android.provider.DeviceConfig
import android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS
+import android.provider.Settings.Secure
import android.text.Html
import android.util.AttributeSet
+import android.util.Base64
+import android.util.Base64.NO_PADDING
+import android.util.Base64.NO_WRAP
import android.view.inputmethod.EditorInfo
import android.widget.TextView
import android.widget.Toast
@@ -33,24 +47,51 @@
import androidx.preference.PreferenceGroup
import androidx.preference.PreferenceViewHolder
import androidx.preference.SwitchPreference
+import com.android.launcher3.AutoInstallsLayout
import com.android.launcher3.ExtendedEditText
+import com.android.launcher3.LauncherAppState
import com.android.launcher3.LauncherPrefs
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
+import com.android.launcher3.LauncherSettings.Settings.LAYOUT_DIGEST_KEY
+import com.android.launcher3.LauncherSettings.Settings.LAYOUT_DIGEST_LABEL
+import com.android.launcher3.LauncherSettings.Settings.LAYOUT_DIGEST_TAG
import com.android.launcher3.R
+import com.android.launcher3.model.data.FolderInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo
+import com.android.launcher3.pm.UserCache
+import com.android.launcher3.proxy.ProxyActivityStarter
import com.android.launcher3.secondarydisplay.SecondaryDisplayLauncher
+import com.android.launcher3.shortcuts.ShortcutKey
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapperImpl
+import com.android.launcher3.util.Executors.MAIN_EXECUTOR
+import com.android.launcher3.util.Executors.MODEL_EXECUTOR
+import com.android.launcher3.util.Executors.ORDERED_BG_EXECUTOR
+import com.android.launcher3.util.LauncherLayoutBuilder
import com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT
import com.android.launcher3.util.OnboardingPrefs.HOME_BOUNCE_COUNT
import com.android.launcher3.util.OnboardingPrefs.HOME_BOUNCE_SEEN
import com.android.launcher3.util.OnboardingPrefs.HOTSEAT_DISCOVERY_TIP_COUNT
import com.android.launcher3.util.OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN
import com.android.launcher3.util.OnboardingPrefs.TASKBAR_EDU_TOOLTIP_STEP
+import com.android.launcher3.util.OnboardingPrefs.TASKBAR_SEARCH_EDU_SEEN
import com.android.launcher3.util.PluginManagerWrapper
+import com.android.launcher3.util.StartActivityParams
+import com.android.launcher3.util.UserIconInfo
import com.android.quickstep.util.DeviceConfigHelper
import com.android.quickstep.util.DeviceConfigHelper.Companion.NAMESPACE_LAUNCHER
import com.android.quickstep.util.DeviceConfigHelper.DebugInfo
import com.android.systemui.shared.plugins.PluginEnabler
import com.android.systemui.shared.plugins.PluginPrefs
+import java.io.OutputStreamWriter
+import java.security.MessageDigest
import java.util.Locale
+import java.util.concurrent.Executor
/** Helper class to generate UI for Device Config */
class DevOptionsUiHelper(c: Context, attr: AttributeSet?) : PreferenceGroup(c, attr) {
@@ -67,6 +108,9 @@
(holder.findViewById(R.id.filter_box) as TextView?)?.doAfterTextChanged {
val query: String = it.toString().lowercase(Locale.getDefault()).replace("_", " ")
filterPreferences(query, this)
+
+ // Always keep myself visible
+ this@DevOptionsUiHelper.isVisible = true
}
}
@@ -97,6 +141,7 @@
}
addIntentTargets()
addOnboardingPrefsCategory()
+ addLayoutSharePref()
}
private fun newCategory(titleText: String, subTitleText: String? = null) =
@@ -350,6 +395,7 @@
HOTSEAT_LONGPRESS_TIP_SEEN.sharedPrefKey
)
addOnboardPref("Taskbar Education", TASKBAR_EDU_TOOLTIP_STEP.sharedPrefKey)
+ addOnboardPref("Taskbar Search Education", TASKBAR_SEARCH_EDU_SEEN.sharedPrefKey)
addOnboardPref("All Apps Visited Count", ALL_APPS_VISITED_COUNT.sharedPrefKey)
}
}
@@ -359,7 +405,7 @@
Preference(context).also {
it.title = title
it.summary = "Tap to reset"
- setOnPreferenceClickListener { _ ->
+ it.setOnPreferenceClickListener { _ ->
LauncherPrefs.getPrefs(context)
.edit()
.apply { keys.forEach { key -> remove(key) } }
@@ -370,6 +416,137 @@
}
)
+ private fun addLayoutSharePref() {
+ val model = LauncherAppState.getInstance(context).model
+ val category = newCategory("Workspace grid layout")
+ Preference(context).apply {
+ title = "Export"
+ intent =
+ createUriPickerIntent(ACTION_CREATE_DOCUMENT, MAIN_EXECUTOR) { uri ->
+ model.enqueueModelUpdateTask { _, dataModel, _ ->
+ val builder = LauncherLayoutBuilder()
+ dataModel.workspaceItems.forEach { info ->
+ val loc =
+ when (info.container) {
+ CONTAINER_DESKTOP ->
+ builder.atWorkspace(info.cellX, info.cellY, info.screenId)
+ CONTAINER_HOTSEAT -> builder.atHotseat(info.screenId)
+ else -> return@forEach
+ }
+ loc.addItem(info)
+ }
+ dataModel.appWidgets.forEach { info ->
+ builder.atWorkspace(info.cellX, info.cellY, info.screenId).addItem(info)
+ }
+
+ context.contentResolver.openOutputStream(uri).use { os ->
+ builder.build(OutputStreamWriter(os))
+ }
+
+ MAIN_EXECUTOR.execute {
+ Toast.makeText(context, "File saved", Toast.LENGTH_LONG).show()
+ }
+ }
+ }
+ category.addPreference(this)
+ }
+
+ Preference(context).apply {
+ title = "Import"
+ intent =
+ createUriPickerIntent(ACTION_OPEN_DOCUMENT, ORDERED_BG_EXECUTOR) { uri ->
+ val resolver = context.contentResolver
+ val data =
+ resolver.openInputStream(uri).use { stream ->
+ stream?.readAllBytes() ?: return@createUriPickerIntent
+ }
+
+ val digest = MessageDigest.getInstance("SHA-256").digest(data)
+ val handle = createWithSha256(digest, LAYOUT_DIGEST_LABEL, 0, LAYOUT_DIGEST_TAG)
+ val blobManager = context.getSystemService(BlobStoreManager::class.java)!!
+
+ blobManager.openSession(blobManager.createSession(handle)).use { session ->
+ AutoCloseOutputStream(session.openWrite(0, -1)).use { it.write(data) }
+ session.allowPublicAccess()
+
+ session.commit(ORDERED_BG_EXECUTOR) {
+ val key = Base64.encodeToString(digest, NO_WRAP or NO_PADDING)
+ Secure.putString(resolver, LAYOUT_DIGEST_KEY, key)
+
+ MODEL_EXECUTOR.submit { model.modelDbController.createEmptyDB() }.get()
+ MAIN_EXECUTOR.submit { model.forceReload() }.get()
+ MODEL_EXECUTOR.submit {}.get()
+ Secure.putString(resolver, LAYOUT_DIGEST_KEY, null)
+ }
+ }
+ }
+ category.addPreference(this)
+ }
+ }
+
+ private fun LauncherLayoutBuilder.ItemTarget.addItem(info: ItemInfo) {
+ val userType: String? =
+ when (UserCache.INSTANCE.get(context).getUserInfo(info.user).type) {
+ UserIconInfo.TYPE_WORK -> AutoInstallsLayout.USER_TYPE_WORK
+ UserIconInfo.TYPE_CLONED -> AutoInstallsLayout.USER_TYPE_CLONED
+ else -> null
+ }
+ when (info.itemType) {
+ ITEM_TYPE_APPLICATION ->
+ info.targetComponent?.let { c -> putApp(c.packageName, c.className, userType) }
+ ITEM_TYPE_DEEP_SHORTCUT ->
+ ShortcutKey.fromItemInfo(info).let { key ->
+ putShortcut(key.packageName, key.id, userType)
+ }
+ ITEM_TYPE_FOLDER ->
+ (info as FolderInfo).let { folderInfo ->
+ putFolder(folderInfo.title?.toString() ?: "").also { folderBuilder ->
+ folderInfo.getContents().forEach { folderContent ->
+ folderBuilder.addItem(folderContent)
+ }
+ }
+ }
+ ITEM_TYPE_APPWIDGET ->
+ putWidget(
+ (info as LauncherAppWidgetInfo).providerName.packageName,
+ info.providerName.className,
+ info.spanX,
+ info.spanY,
+ userType
+ )
+ }
+ }
+
+ private fun createUriPickerIntent(
+ action: String,
+ executor: Executor,
+ callback: (uri: Uri) -> Unit
+ ): Intent {
+ val pendingIntent =
+ PendingIntent(
+ object : Stub() {
+ override fun send(
+ code: Int,
+ intent: Intent,
+ resolvedType: String?,
+ allowlistToken: IBinder?,
+ finishedReceiver: IIntentReceiver?,
+ requiredPermission: String?,
+ options: Bundle?
+ ) {
+ intent.data?.let { uri -> executor.execute { callback(uri) } }
+ }
+ }
+ )
+ val params = StartActivityParams(pendingIntent, 0)
+ params.intent =
+ Intent(action)
+ .addCategory(Intent.CATEGORY_OPENABLE)
+ .setType("text/xml")
+ .putExtra(Intent.EXTRA_TITLE, "launcher_grid.xml")
+ return ProxyActivityStarter.getLaunchIntent(context, params)
+ }
+
private inner class CustomSwitchPref(
private val bindCallback: (holder: PreferenceViewHolder, pref: SwitchPreference) -> Unit
) : SwitchPreference(context) {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
index 2625919..fa80dc2 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
@@ -102,6 +102,11 @@
}
@Override
+ public int getTitle() {
+ return R.string.all_apps_label;
+ }
+
+ @Override
public float getVerticalProgress(Launcher launcher) {
return 0f;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index 7fa121d..2625646 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -34,7 +34,7 @@
*/
public class BackgroundAppState extends OverviewState {
- private static final int STATE_FLAGS = FLAG_DISABLE_RESTORE | FLAG_OVERVIEW_UI
+ private static final int STATE_FLAGS = FLAG_DISABLE_RESTORE | FLAG_RECENTS_VIEW_VISIBLE
| FLAG_WORKSPACE_INACCESSIBLE | FLAG_NON_INTERACTIVE | FLAG_CLOSE_POPUPS;
public BackgroundAppState(int id) {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
index 3c291e6..932d241 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
@@ -32,7 +32,7 @@
public class OverviewModalTaskState extends OverviewState {
private static final int STATE_FLAGS =
- FLAG_DISABLE_RESTORE | FLAG_OVERVIEW_UI | FLAG_WORKSPACE_INACCESSIBLE;
+ FLAG_DISABLE_RESTORE | FLAG_RECENTS_VIEW_VISIBLE | FLAG_WORKSPACE_INACCESSIBLE;
public OverviewModalTaskState(int id) {
super(id, LAUNCHER_STATE_OVERVIEW, STATE_FLAGS);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index d0eef8e..6822f1b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -47,7 +47,7 @@
protected static final Rect sTempRect = new Rect();
private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
- | FLAG_DISABLE_RESTORE | FLAG_OVERVIEW_UI | FLAG_WORKSPACE_INACCESSIBLE
+ | FLAG_DISABLE_RESTORE | FLAG_RECENTS_VIEW_VISIBLE | FLAG_WORKSPACE_INACCESSIBLE
| FLAG_CLOSE_POPUPS;
public OverviewState(int id) {
@@ -182,6 +182,11 @@
return launcher.getString(R.string.accessibility_recent_apps);
}
+ @Override
+ public int getTitle() {
+ return R.string.accessibility_recent_apps;
+ }
+
public static float getDefaultSwipeHeight(Launcher launcher) {
return LayoutUtils.getDefaultSwipeHeight(launcher, launcher.getDeviceProfile());
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
index 0368f3a..3a39cf2 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
@@ -110,6 +110,7 @@
// taskbar icons disappearing before hotseat icons show up.
float scrimUpperBoundFromSplit =
QuickstepTransitionManager.getTaskbarToHomeDuration() / (float) config.duration;
+ scrimUpperBoundFromSplit = Math.min(scrimUpperBoundFromSplit, 1f);
config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f));
config.setInterpolator(ANIM_SCRIM_FADE,
fromState == OVERVIEW_SPLIT_SELECT
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
index 3ed2d0b..11e0ed5 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
@@ -118,7 +118,7 @@
if (!cameFromNavBar) {
return false;
}
- if (mStartState.overviewUi || mStartState == ALL_APPS) {
+ if (mStartState.isRecentsViewVisible || mStartState == ALL_APPS) {
return true;
}
int typeToClose = TYPE_ALL & ~TYPE_ALL_APPS_EDU;
@@ -145,7 +145,7 @@
private void initCurrentAnimation() {
long accuracy = (long) (getShiftRange() * 2);
final PendingAnimation builder = new PendingAnimation(accuracy);
- if (mStartState.overviewUi) {
+ if (mStartState.isRecentsViewVisible) {
RecentsView recentsView = mLauncher.getOverviewPanel();
AnimatorControllerWithResistance.createRecentsResistanceFromOverviewAnim(mLauncher,
builder);
@@ -194,7 +194,7 @@
RecentsView recentsView = mLauncher.getOverviewPanel();
recentsView.switchToScreenshot(null,
() -> recentsView.finishRecentsAnimation(true /* toRecents */, null));
- if (mStartState.overviewUi) {
+ if (mStartState.isRecentsViewVisible) {
Runnable onReachedHome = () -> {
StateManager.StateListener<LauncherState> listener =
new StateManager.StateListener<>() {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
index 42be52f..d1aa472 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
@@ -39,7 +39,6 @@
import android.view.ViewConfiguration;
import com.android.internal.jank.Cuj;
-import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -88,13 +87,17 @@
// Normal to Hint animation has flag SKIP_OVERVIEW, so we update this scrim with this animator.
private ObjectAnimator mNormalToHintOverviewScrimAnimator;
+ private final QuickstepLauncher mLauncher;
+ private boolean mIsTrackpadSwipe;
+
/**
* @param cancelSplitRunnable Called when split placeholder view needs to be cancelled.
* Animation should be added to the provided AnimatorSet
*/
- public NoButtonNavbarToOverviewTouchController(Launcher l,
+ public NoButtonNavbarToOverviewTouchController(QuickstepLauncher l,
BiConsumer<AnimatorSet, Long> cancelSplitRunnable) {
super(l);
+ mLauncher = l;
mRecentsView = l.getOverviewPanel();
mMotionPauseDetector = new MotionPauseDetector(l);
mMotionPauseMinDisplacement = ViewConfiguration.get(l).getScaledTouchSlop();
@@ -104,7 +107,9 @@
@Override
protected boolean canInterceptTouch(MotionEvent ev) {
- if (!isTrackpadMotionEvent(ev) && DisplayController.getNavigationMode(mLauncher)
+ mIsTrackpadSwipe = isTrackpadMotionEvent(ev);
+ mLauncher.setCanShowAllAppsEducationView(!mIsTrackpadSwipe);
+ if (!mIsTrackpadSwipe && DisplayController.getNavigationMode(mLauncher)
== THREE_BUTTONS) {
return false;
}
@@ -148,6 +153,7 @@
super.onDragStart(start, startDisplacement);
mMotionPauseDetector.clear();
+ mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe);
if (handlingOverviewAnim()) {
InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS,
@@ -191,6 +197,7 @@
}
mMotionPauseDetector.clear();
+ mIsTrackpadSwipe = false;
mNormalToHintOverviewScrimAnimator = null;
if (mLauncher.isInState(OVERVIEW)) {
// Normally we would cleanup the state based on mCurrentAnimation, but since we stop
@@ -249,7 +256,7 @@
}
private boolean handlingOverviewAnim() {
- int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
+ long stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
return mDidTouchStartInNavBar && mStartState == NORMAL
&& (stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index 527a776..0da7b2d 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -121,6 +121,7 @@
private AnimatorPlaybackController mNonOverviewAnim;
private AnimatorPlaybackController mXOverviewAnim;
private AnimatedFloat mYOverviewAnim;
+ private boolean mIsTrackpadSwipe;
public NoButtonQuickSwitchTouchController(QuickstepLauncher launcher) {
mLauncher = launcher;
@@ -172,12 +173,13 @@
if ((ev.getEdgeFlags() & Utilities.EDGE_NAV_BAR) == 0) {
return false;
}
- int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
+ long stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) {
return false;
}
if (isTrackpadMultiFingerSwipe(ev)) {
- return isTrackpadFourFingerSwipe(ev);
+ mIsTrackpadSwipe = isTrackpadFourFingerSwipe(ev);
+ return mIsTrackpadSwipe;
}
return true;
}
@@ -185,6 +187,7 @@
@Override
public void onDragStart(boolean start) {
mMotionPauseDetector.clear();
+ mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe);
if (start) {
InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_QUICK_SWITCH);
InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS,
@@ -248,7 +251,7 @@
TASK_THUMBNAIL_SPLASH_ALPHA.set(mRecentsView, fromState.showTaskThumbnailSplash() ? 1f : 0);
mRecentsView.setContentAlpha(1);
mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
- mLauncher.getActionsView().getVisibilityAlpha().setValue(
+ mLauncher.getActionsView().getVisibilityAlpha().updateValue(
(fromState.getVisibleElements(mLauncher) & OVERVIEW_ACTIONS) != 0 ? 1f : 0f);
mRecentsView.setTaskIconScaledDown(true);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index 05a55d0..31e4e33 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
@@ -84,7 +84,7 @@
@Override
protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) {
- int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
+ long stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) {
return NORMAL;
}
@@ -151,7 +151,7 @@
int sysuiFlags = 0;
TaskView tv = mOverviewPanel.getTaskViewAt(0);
if (tv != null) {
- sysuiFlags = tv.getThumbnail().getSysUiStatusNavFlags();
+ sysuiFlags = tv.getTaskContainers().getFirst().getSysUiStatusNavFlags();
}
mLauncher.getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, sysuiFlags);
} else {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
index d98e608..cb2c324 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
@@ -58,8 +58,6 @@
/* If {@code false}, this controller should not handle the input {@link MotionEvent}.*/
private boolean mCanIntercept;
- private boolean mIsTrackpadReverseScroll;
-
public StatusBarTouchController(Launcher l) {
mLauncher = l;
mSystemUiProxy = SystemUiProxy.INSTANCE.get(mLauncher);
@@ -95,8 +93,6 @@
}
mDownEvents.clear();
mDownEvents.put(pid, new PointF(ev.getX(), ev.getY()));
- mIsTrackpadReverseScroll = !mLauncher.isNaturalScrollingEnabled()
- && isTrackpadScroll(ev);
} else if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
// Check!! should only set it only when threshold is not entered.
mDownEvents.put(pid, new PointF(ev.getX(idx), ev.getY(idx)));
@@ -107,9 +103,6 @@
if (action == ACTION_MOVE && mDownEvents.contains(pid)) {
float dy = ev.getY(idx) - mDownEvents.get(pid).y;
float dx = ev.getX(idx) - mDownEvents.get(pid).x;
- if (mIsTrackpadReverseScroll) {
- dy = -dy;
- }
// Currently input dispatcher will not do touch transfer if there are more than
// one touch pointer. Hence, even if slope passed, only set the slippery flag
// when there is single touch event. (context: InputDispatcher.cpp line 1445)
@@ -134,7 +127,6 @@
mLauncher.getStatsLogManager().logger()
.log(LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN);
setWindowSlippery(false);
- mIsTrackpadReverseScroll = false;
return true;
}
return true;
@@ -161,9 +153,9 @@
}
private boolean canInterceptTouch(MotionEvent ev) {
- if (!mLauncher.isInState(LauncherState.NORMAL) ||
- AbstractFloatingView.getTopOpenViewWithType(mLauncher,
- AbstractFloatingView.TYPE_STATUS_BAR_SWIPE_DOWN_DISALLOW) != null) {
+ if (isTrackpadScroll(ev) || !mLauncher.isInState(LauncherState.NORMAL)
+ || AbstractFloatingView.getTopOpenViewWithType(mLauncher,
+ AbstractFloatingView.TYPE_STATUS_BAR_SWIPE_DOWN_DISALLOW) != null) {
return false;
} else {
// For NORMAL state, only listen if the event originated above the navbar height
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index 300d697..202276e 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -22,9 +22,9 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
+import android.graphics.Rect;
import android.os.VibrationEffect;
import android.view.MotionEvent;
-import android.view.View;
import android.view.animation.Interpolator;
import com.android.app.animation.Interpolators;
@@ -67,7 +67,7 @@
protected final CONTAINER mContainer;
private final SingleAxisSwipeDetector mDetector;
private final RecentsView mRecentsView;
- private final int[] mTempCords = new int[2];
+ private final Rect mTempRect = new Rect();
private final boolean mIsRtl;
private AnimatorPlaybackController mCurrentAnimation;
@@ -181,7 +181,7 @@
// - The task is snapped
mAllowGoingDown = i == mRecentsView.getCurrentPage()
&& DisplayController.getNavigationMode(mContainer).hasGestures
- && (!mRecentsView.showAsGrid() || mTaskBeingDragged.isFocusedTask())
+ && (!mRecentsView.showAsGrid() || mTaskBeingDragged.isLargeTile())
&& mRecentsView.isTaskInExpectedScrollPosition(i);
directionsToDetectScroll = mAllowGoingDown ? DIRECTION_BOTH : upDirection;
@@ -252,10 +252,8 @@
mTaskBeingDragged, maxDuration, currentInterpolator);
// Since the thumbnail is what is filling the screen, based the end displacement on it.
- View thumbnailView = mTaskBeingDragged.getThumbnail();
- mTempCords[1] = orientationHandler.getSecondaryDimension(thumbnailView);
- dl.getDescendantCoordRelativeToSelf(thumbnailView, mTempCords);
- mEndDisplacement = secondaryLayerDimension - mTempCords[1];
+ mTaskBeingDragged.getThumbnailBounds(mTempRect, /*relativeToDragLayer=*/true);
+ mEndDisplacement = secondaryLayerDimension - mTempRect.bottom;
}
mEndDisplacement *= verticalFactor;
mCurrentAnimation = pa.createPlaybackController();
@@ -312,7 +310,7 @@
// Set mOverrideVelocity to control task dismiss velocity in onDragEnd
int velocityDimenId = R.dimen.default_task_dismiss_drag_velocity;
if (mRecentsView.showAsGrid()) {
- if (mTaskBeingDragged.isFocusedTask()) {
+ if (mTaskBeingDragged.isLargeTile()) {
velocityDimenId =
R.dimen.default_task_dismiss_drag_velocity_grid_focus_task;
} else {
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 8e4dde2..3d94442 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -30,7 +30,9 @@
import static com.android.launcher3.BaseActivity.EVENT_STARTED;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_STATE_HANDLER;
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
+import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
import static com.android.launcher3.Flags.enableGridOnlyOverview;
+import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.PagedView.INVALID_PAGE;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE;
@@ -51,6 +53,7 @@
import static com.android.quickstep.GestureState.STATE_END_TARGET_ANIMATION_FINISHED;
import static com.android.quickstep.GestureState.STATE_END_TARGET_SET;
import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_CANCELED;
+import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED;
import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION;
@@ -103,10 +106,10 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
+import com.android.launcher3.contextualeducation.ContextualEduStatsManager;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
-import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.taskbar.TaskbarThresholdUtils;
import com.android.launcher3.taskbar.TaskbarUIController;
@@ -134,10 +137,12 @@
import com.android.quickstep.util.SwipePipToHomeAnimator;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
+import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
+import com.android.systemui.contextualeducation.GestureType;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -146,12 +151,17 @@
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
-import com.android.wm.shell.common.TransactionPool;
-import com.android.wm.shell.startingsurface.SplashScreenExitAnimationUtils;
+import com.android.wm.shell.shared.TransactionPool;
+import com.android.wm.shell.shared.desktopmode.DesktopModeFlags;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
+import com.android.wm.shell.shared.startingsurface.SplashScreenExitAnimationUtils;
+
+import kotlin.Unit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalInt;
@@ -459,6 +469,8 @@
mGestureState.runOnceAtState(STATE_END_TARGET_ANIMATION_FINISHED
| STATE_RECENTS_SCROLLING_FINISHED,
this::onSettledOnEndTarget);
+ mGestureState.runOnceAtState(STATE_END_TARGET_SET | STATE_RECENTS_ANIMATION_STARTED,
+ this::onCalculateEndTarget);
mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED, this::invalidateHandler);
mStateCallback.runOnceAtState(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED,
@@ -722,11 +734,18 @@
}
private void maybeUpdateRecentsAttachedState() {
- maybeUpdateRecentsAttachedState(true /* animate */);
+ maybeUpdateRecentsAttachedState(/* animate= */ true);
}
protected void maybeUpdateRecentsAttachedState(boolean animate) {
- maybeUpdateRecentsAttachedState(animate, false /* moveRunningTask */);
+ maybeUpdateRecentsAttachedState(animate, /* moveRunningTask= */ false);
+ }
+
+ protected void maybeUpdateRecentsAttachedState(boolean animate, boolean moveRunningTask) {
+ maybeUpdateRecentsAttachedState(
+ animate,
+ moveRunningTask,
+ mRecentsView != null && mRecentsView.shouldUpdateRunningTaskAlpha());
}
/**
@@ -737,8 +756,10 @@
* Note this method has no effect unless the navigation mode is NO_BUTTON.
* @param animate whether to animate when attaching RecentsView
* @param moveRunningTask whether to move running task to front when attaching
+ * @param updateRunningTaskAlpha Whether to update the running task's attached alpha
*/
- private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveRunningTask) {
+ private void maybeUpdateRecentsAttachedState(
+ boolean animate, boolean moveRunningTask, boolean updateRunningTaskAlpha) {
if ((!mDeviceState.isFullyGesturalNavMode() && !mGestureState.isTrackpadGesture())
|| mRecentsView == null) {
return;
@@ -769,7 +790,8 @@
// TaskView jumping to new position as we move the tasks.
mRecentsView.moveRunningTaskToFront();
}
- mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate);
+ mAnimationFactory.setRecentsAttachedToAppWindow(
+ recentsAttachedToAppWindow, animate, updateRunningTaskAlpha);
// Reapply window transform throughout the attach animation, as the animation affects how
// much the window is bound by overscroll (vs moving freely).
@@ -920,7 +942,7 @@
TaskView runningTask = mRecentsView.getRunningTaskView();
TaskView centermostTask = mRecentsView.getTaskViewNearestToCenterOfScreen();
int centermostTaskFlags = centermostTask == null ? 0
- : centermostTask.getThumbnail().getSysUiStatusNavFlags();
+ : centermostTask.getTaskContainers().getFirst().getSysUiStatusNavFlags();
boolean swipeUpThresholdPassed = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
boolean quickswitchThresholdPassed = centermostTask != runningTask;
@@ -946,7 +968,7 @@
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
super.onRecentsAnimationStart(controller, targets);
- if (targets.hasDesktopTasks()) {
+ if (targets.hasDesktopTasks(mContext)) {
mRemoteTargetHandles = mTargetGluer.assignTargetsForDesktop(targets);
} else {
int untrimmedAppCount = mRemoteTargetHandles.length;
@@ -982,7 +1004,6 @@
dp = dp.copy(mContext);
}
dp.updateInsets(targets.homeContentInsets);
- dp.updateIsSeascape(mContext);
initTransitionEndpoints(dp);
orientationState.setMultiWindowMode(dp.isMultiWindowMode);
}
@@ -1144,6 +1165,22 @@
}
}
+ /**
+ * Called if the end target has been set and the recents animation is started.
+ */
+ private void onCalculateEndTarget() {
+ final GestureEndTarget endTarget = mGestureState.getEndTarget();
+
+ switch (endTarget) {
+ case HOME:
+ // Early detach the nav bar if endTarget is determined as HOME
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.detachNavigationBarFromApp(true);
+ }
+ break;
+ }
+ }
+
private void onSettledOnEndTarget() {
// Fast-finish the attaching animation if it's still running.
maybeUpdateRecentsAttachedState(false);
@@ -1169,12 +1206,6 @@
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
// Notify the SysUI to use fade-in animation when entering PiP
SystemUiProxy.INSTANCE.get(mContext).setPipAnimationTypeToAlpha();
- DesktopVisibilityController desktopVisibilityController =
- mContainerInterface.getDesktopVisibilityController();
- if (desktopVisibilityController != null) {
- // Notify the SysUI to stash desktop apps if they are visible
- desktopVisibilityController.onHomeActionTriggered();
- }
break;
case RECENTS:
mStateCallback.setState(STATE_SCALED_CONTROLLER_RECENTS | STATE_CAPTURE_SCREENSHOT
@@ -1194,6 +1225,10 @@
setDividerShown(true);
break;
}
+ if (mContainerInterface.getTaskbarController() != null) {
+ // Resets this value as the gesture is now complete.
+ mContainerInterface.getTaskbarController().setUserIsNotGoingHome(false);
+ }
ActiveGestureLog.INSTANCE.addLog(
new ActiveGestureLog.CompoundString("onSettledOnEndTarget ")
.append(endTarget.name()),
@@ -1201,17 +1236,28 @@
}
/** @return Whether this was the task we were waiting to appear, and thus handled it. */
- protected boolean handleTaskAppeared(RemoteAnimationTarget[] appearedTaskTarget) {
+ protected boolean handleTaskAppeared(@NonNull RemoteAnimationTarget[] appearedTaskTargets,
+ @NonNull ActiveGestureLog.CompoundString failureReason) {
if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
+ failureReason.append("State handler was invalidated");
return false;
}
- boolean hasStartedTaskBefore = Arrays.stream(appearedTaskTarget).anyMatch(
- mGestureState.mLastStartedTaskIdPredicate);
- if (mStateCallback.hasStates(STATE_START_NEW_TASK) && hasStartedTaskBefore) {
- reset();
- return true;
+ boolean stateStartNewTaskSet = mStateCallback.hasStates(STATE_START_NEW_TASK);
+ if (!stateStartNewTaskSet || !hasStartedTaskBefore(appearedTaskTargets)) {
+ if (!stateStartNewTaskSet) {
+ failureReason.append("STATE_START_NEW_TASK was never set");
+ } else {
+ TaskInfo taskInfo = appearedTaskTargets[0].taskInfo;
+ failureReason.append("Unexpected task appeared")
+ .append(" id=")
+ .append(taskInfo.taskId)
+ .append(" pkg=")
+ .append(taskInfo.baseIntent.getComponent().getPackageName());
+ }
+ return false;
}
- return false;
+ reset();
+ return true;
}
private float dpiFromPx(float pixels) {
@@ -1256,13 +1302,16 @@
? mRecentsView.getNextPageTaskView() : null;
TaskView currentPageTaskView = mRecentsView != null
? mRecentsView.getCurrentPageTaskView() : null;
- if (((nextPageTaskView != null && nextPageTaskView.isDesktopTask())
- || (currentPageTaskView != null && currentPageTaskView.isDesktopTask()))
- && endTarget == NEW_TASK) {
- // TODO(b/268075592): add support for quickswitch to/from desktop
- return LAST_TASK;
- }
+ if (DesktopModeStatus.canEnterDesktopMode(mContext)
+ && !(DesktopModeFlags.WALLPAPER_ACTIVITY.isEnabled(mContext)
+ && DesktopModeFlags.QUICK_SWITCH.isEnabled(mContext))) {
+ if ((nextPageTaskView instanceof DesktopTaskView
+ || currentPageTaskView instanceof DesktopTaskView)
+ && endTarget == NEW_TASK) {
+ return LAST_TASK;
+ }
+ }
return endTarget;
}
@@ -1339,6 +1388,13 @@
mGestureState.setEndTarget(endTarget, false /* isAtomic */);
mAnimationFactory.setEndTarget(endTarget);
+ if (enableScalingRevealHomeAnimation()
+ && mIsTransientTaskbar
+ && mContainerInterface.getTaskbarController() != null) {
+ mContainerInterface.getTaskbarController()
+ .setUserIsNotGoingHome(endTarget != GestureState.GestureEndTarget.HOME);
+ }
+
float endShift = endTarget == ALL_APPS ? mDragLengthFactor
: endTarget.isLauncher ? 1 : 0;
final float startShift;
@@ -1379,10 +1435,8 @@
duration = mContainer != null && mContainer.getDeviceProfile().isTaskbarPresent
? StaggeredWorkspaceAnim.DURATION_TASKBAR_MS
: StaggeredWorkspaceAnim.DURATION_MS;
- // Early detach the nav bar once the endTarget is determined as HOME
- if (mRecentsAnimationController != null) {
- mRecentsAnimationController.detachNavigationBarFromApp(true);
- }
+ ContextualEduStatsManager.INSTANCE.get(mContext).updateEduStats(
+ mGestureState.isTrackpadGesture(), GestureType.HOME);
} else if (endTarget == RECENTS) {
if (mRecentsView != null) {
int nearestPage = mRecentsView.getDestinationPage();
@@ -1407,6 +1461,8 @@
if (!mGestureState.isHandlingAtomicEvent() || isScrolling) {
duration = Math.max(duration, mRecentsView.getScroller().getDuration());
}
+ ContextualEduStatsManager.INSTANCE.get(mContext).updateEduStats(
+ mGestureState.isTrackpadGesture(), GestureType.OVERVIEW);
}
} else if (endTarget == LAST_TASK && mRecentsView != null
&& mRecentsView.getNextPage() != mRecentsView.getRunningTaskIndex()) {
@@ -1419,14 +1475,27 @@
mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
setClampScrollOffset(false);
};
- if (mRecentsView != null && (mRecentsView.getCurrentPageTaskView() != null
- && !mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
- ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
- .SET_ON_PAGE_TRANSITION_END_CALLBACK);
- // TODO(b/268075592): add support for quickswitch to/from desktop
- mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
+
+ if (DesktopModeStatus.canEnterDesktopMode(mContext)
+ && !(DesktopModeFlags.WALLPAPER_ACTIVITY.isEnabled(mContext)
+ && DesktopModeFlags.QUICK_SWITCH.isEnabled(mContext))) {
+ if (mRecentsView != null && (mRecentsView.getCurrentPageTaskView() != null
+ && !(mRecentsView.getCurrentPageTaskView() instanceof DesktopTaskView))) {
+ ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
+ .SET_ON_PAGE_TRANSITION_END_CALLBACK);
+ mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
+ } else {
+ onPageTransitionEnd.run();
+ }
} else {
- onPageTransitionEnd.run();
+ if (mRecentsView != null) {
+ ActiveGestureLog.INSTANCE.trackEvent(
+ ActiveGestureErrorDetector
+ .GestureEvent.SET_ON_PAGE_TRANSITION_END_CALLBACK);
+ mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
+ } else {
+ onPageTransitionEnd.run();
+ }
}
animateToProgress(startShift, endShift, duration, interpolator, endTarget, velocityPxPerMs);
@@ -1454,14 +1523,15 @@
default:
event = IGNORE;
}
- StatsLogger logger = StatsLogManager.newInstance(mContext).logger()
+ StatsLogger logger = StatsLogManager.newInstance(
+ mContainer != null ? mContainer.asContext() : mContext).logger()
.withSrcState(LAUNCHER_STATE_BACKGROUND)
.withDstState(endTarget.containerType)
.withInputType(mGestureState.isTrackpadGesture()
? SysUiStatsLog.LAUNCHER_UICHANGED__INPUT_TYPE__TRACKPAD
: SysUiStatsLog.LAUNCHER_UICHANGED__INPUT_TYPE__TOUCH);
if (targetTask != null) {
- logger.withItemInfo(targetTask.getItemInfo());
+ logger.withItemInfo(targetTask.getFirstItemInfo());
}
int pageIndex = endTarget == LAST_TASK || mRecentsView == null
@@ -1480,8 +1550,12 @@
}
protected abstract HomeAnimationFactory createHomeAnimationFactory(
- ArrayList<IBinder> launchCookies, long duration, boolean isTargetTranslucent,
- boolean appCanEnterPip, RemoteAnimationTarget runningTaskTarget);
+ List<IBinder> launchCookies,
+ long duration,
+ boolean isTargetTranslucent,
+ boolean appCanEnterPip,
+ RemoteAnimationTarget runningTaskTarget,
+ @Nullable TaskView targetTaskView);
private final TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() {
@Override
@@ -1555,9 +1629,16 @@
&& runningTaskTarget.allowEnterPip
&& runningTaskTarget.taskInfo.pictureInPictureParams != null
&& runningTaskTarget.taskInfo.pictureInPictureParams.isAutoEnterEnabled();
- HomeAnimationFactory homeAnimFactory =
- createHomeAnimationFactory(cookies, duration, isTranslucent, appCanEnterPip,
- runningTaskTarget);
+ HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(
+ cookies,
+ duration,
+ isTranslucent,
+ appCanEnterPip,
+ runningTaskTarget,
+ !enableAdditionalHomeAnimations()
+ || mRecentsView == null
+ || mRecentsView.getCurrentPage() == mRecentsView.getRunningTaskIndex()
+ ? null : mRecentsView.getCurrentPageTaskView());
SwipePipToHomeAnimator swipePipToHomeAnimator = !mIsSwipeForSplit && appCanEnterPip
? createWindowAnimationToPip(homeAnimFactory, runningTaskTarget, start)
: null;
@@ -1581,13 +1662,17 @@
mRecentsAnimationController.screenshotTask(taskId));
});
- // let SystemUi reparent the overlay leash as soon as possible
+ // let SystemUi reparent the overlay leash as soon as possible;
+ // make sure to pass in an empty src-rect-hint if overlay is present, since we
+ // use our own calculated source-rect-hint for the animation.
SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome(
mSwipePipToHomeAnimator.getTaskId(),
mSwipePipToHomeAnimator.getComponentName(),
mSwipePipToHomeAnimator.getDestinationBounds(),
mSwipePipToHomeAnimator.getContentOverlay(),
- mSwipePipToHomeAnimator.getAppBounds());
+ mSwipePipToHomeAnimator.getAppBounds(),
+ mSwipePipToHomeAnimator.getContentOverlay() != null ? new Rect()
+ : mSwipePipToHomeAnimator.getSourceRectHint());
windowAnim = mSwipePipToHomeAnimators;
} else {
@@ -1756,6 +1841,8 @@
&& (windowRotation == ROTATION_90 || windowRotation == ROTATION_270)) {
builder.setFromRotation(mRemoteTargetHandles[0].getTaskViewSimulator(), windowRotation,
taskInfo.displayCutoutInsets);
+ } else if (taskInfo.displayCutoutInsets != null) {
+ builder.setDisplayCutoutInsets(taskInfo.displayCutoutInsets);
}
final SwipePipToHomeAnimator swipePipToHomeAnimator = builder.build();
AnimatorPlaybackController activityAnimationToHome =
@@ -2043,7 +2130,6 @@
// If there are no targets, then we don't need to capture anything
mStateCallback.setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
} else {
- boolean finishTransitionPosted = false;
// If we already have cached screenshot(s) from running tasks, skip update
boolean shouldUpdate = false;
int[] runningTaskIds = mGestureState.getRunningTaskIds(mIsSwipeForSplit);
@@ -2067,45 +2153,32 @@
}
MAIN_EXECUTOR.execute(() -> {
- if (!updateThumbnail(false /* refreshView */)) {
- setScreenshotCapturedState();
- }
+ updateThumbnail();
+ setScreenshotCapturedState();
});
});
return;
}
- finishTransitionPosted = updateThumbnail(false /* refreshView */);
+ updateThumbnail();
}
- if (!finishTransitionPosted) {
- setScreenshotCapturedState();
- }
+ setScreenshotCapturedState();
}
}
// Returns whether finish transition was posted.
- private boolean updateThumbnail(boolean refreshView) {
+ private void updateThumbnail() {
if (mGestureState.getEndTarget() == HOME
|| mGestureState.getEndTarget() == NEW_TASK
|| mGestureState.getEndTarget() == ALL_APPS
|| mRecentsView == null) {
// Capture the screenshot before finishing the transition to home or quickswitching to
// ensure it's taken in the correct orientation, but no need to update the thumbnail.
- return false;
+ return;
}
- boolean finishTransitionPosted = false;
- TaskView updatedTaskView = mRecentsView.updateThumbnail(mTaskSnapshotCache, refreshView);
- if (updatedTaskView != null && refreshView && !mCanceled) {
- // Defer finishing the animation until the next launcher frame with the
- // new thumbnail
- finishTransitionPosted = ViewUtils.postFrameDrawn(updatedTaskView,
- () -> mStateCallback.setStateOnUiThread(STATE_SCREENSHOT_CAPTURED),
- this::isCanceled);
- }
-
- return finishTransitionPosted;
+ mRecentsView.updateThumbnail(mTaskSnapshotCache);
}
private void setScreenshotCapturedState() {
@@ -2237,13 +2310,14 @@
mRecentsAnimationController, mRecentsAnimationTargets);
});
- if ((mRecentsView.getNextPageTaskView() != null
- && mRecentsView.getNextPageTaskView().isDesktopTask())
- || (mRecentsView.getCurrentPageTaskView() != null
- && mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
- // TODO(b/268075592): add support for quickswitch to/from desktop
- mRecentsViewScrollLinked = false;
- return;
+ if (DesktopModeStatus.canEnterDesktopMode(mContext)
+ && !(DesktopModeFlags.WALLPAPER_ACTIVITY.isEnabled(mContext)
+ && DesktopModeFlags.QUICK_SWITCH.isEnabled(mContext))) {
+ if (mRecentsView.getNextPageTaskView() instanceof DesktopTaskView
+ || mRecentsView.getCurrentPageTaskView() instanceof DesktopTaskView) {
+ mRecentsViewScrollLinked = false;
+ return;
+ }
}
// Disable scrolling in RecentsView for trackpad 3-finger swipe up gesture.
@@ -2274,15 +2348,15 @@
int[] taskIds = nextTask.getTaskIds();
ActiveGestureLog.CompoundString nextTaskLog = new ActiveGestureLog.CompoundString(
"Launching task: ");
- for (TaskIdAttributeContainer c : nextTask.getTaskIdAttributeContainers()) {
- if (c == null) {
+ for (TaskContainer container : nextTask.getTaskContainers()) {
+ if (container == null) {
continue;
}
nextTaskLog
.append("[id: ")
- .append(c.getTask().key.id)
+ .append(container.getTask().key.id)
.append(", pkg: ")
- .append(c.getTask().key.getPackageName())
+ .append(container.getTask().key.getPackageName())
.append("] | ");
}
mGestureState.updateLastStartedTaskIds(taskIds);
@@ -2305,6 +2379,7 @@
mRecentsAnimationController.finish(true /* toRecents */, null);
}
}
+ return Unit.INSTANCE;
}, true /* freezeTaskList */);
} else {
mContainerInterface.onLaunchTaskFailed();
@@ -2358,59 +2433,75 @@
}
}
+ private boolean hasStartedTaskBefore(@NonNull RemoteAnimationTarget[] appearedTaskTargets) {
+ return Arrays.stream(appearedTaskTargets)
+ .anyMatch(mGestureState.mLastStartedTaskIdPredicate);
+ }
+
@Override
public void onTasksAppeared(@NonNull RemoteAnimationTarget[] appearedTaskTargets) {
if (mRecentsAnimationController == null) {
return;
}
- boolean hasStartedTaskBefore = Arrays.stream(appearedTaskTargets).anyMatch(
- mGestureState.mLastStartedTaskIdPredicate);
- if (!mStateCallback.hasStates(STATE_GESTURE_COMPLETED) && !hasStartedTaskBefore) {
+ final Runnable onFinishComplete = () -> {
+ ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
+ "AbsSwipeUpHandler.onTasksAppeared: ")
+ .append("force finish recents animation complete; clearing state callback."));
+ mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED);
+ };
+ ActiveGestureLog.CompoundString forceFinishReason = new ActiveGestureLog.CompoundString(
+ "Forcefully finishing recents animation: ");
+ if (!mStateCallback.hasStates(STATE_GESTURE_COMPLETED)
+ && !hasStartedTaskBefore(appearedTaskTargets)) {
// This is a special case, if a task is started mid-gesture that wasn't a part of a
// previous quickswitch task launch, then cancel the animation back to the app
RemoteAnimationTarget appearedTaskTarget = appearedTaskTargets[0];
TaskInfo taskInfo = appearedTaskTarget.taskInfo;
- ActiveGestureLog.INSTANCE.addLog(
- new ActiveGestureLog.CompoundString("Unexpected task appeared")
- .append(" id=")
+ ActiveGestureLog.INSTANCE.addLog(forceFinishReason
+ .append("Unexpected task appeared id=")
.append(taskInfo.taskId)
.append(" pkg=")
.append(taskInfo.baseIntent.getComponent().getPackageName()));
- finishRecentsAnimationOnTasksAppeared(null /* onFinishComplete */);
+ finishRecentsAnimationOnTasksAppeared(onFinishComplete);
return;
}
- if (!handleTaskAppeared(appearedTaskTargets)) {
+ ActiveGestureLog.CompoundString handleTaskFailureReason =
+ new ActiveGestureLog.CompoundString("handleTaskAppeared check failed: ");
+ if (!handleTaskAppeared(appearedTaskTargets, handleTaskFailureReason)) {
+ ActiveGestureLog.INSTANCE.addLog(forceFinishReason.append(handleTaskFailureReason));
+ finishRecentsAnimationOnTasksAppeared(onFinishComplete);
return;
}
- Optional<RemoteAnimationTarget> taskTargetOptional =
- Arrays.stream(appearedTaskTargets)
- .filter(mGestureState.mLastStartedTaskIdPredicate)
- .findFirst();
- if (!taskTargetOptional.isPresent()) {
- ActiveGestureLog.INSTANCE.addLog("No appeared task matching started task id");
- finishRecentsAnimationOnTasksAppeared(null /* onFinishComplete */);
+ RemoteAnimationTarget[] taskTargets = Arrays.stream(appearedTaskTargets)
+ .filter(mGestureState.mLastStartedTaskIdPredicate)
+ .toArray(RemoteAnimationTarget[]::new);
+ if (taskTargets.length == 0) {
+ ActiveGestureLog.INSTANCE.addLog(
+ forceFinishReason.append("No appeared task matching started task id"));
+ finishRecentsAnimationOnTasksAppeared(onFinishComplete);
return;
}
- RemoteAnimationTarget taskTarget = taskTargetOptional.get();
+ RemoteAnimationTarget taskTarget = taskTargets[0];
TaskView taskView = mRecentsView == null
? null : mRecentsView.getTaskViewByTaskId(taskTarget.taskId);
- if (taskView == null || !taskView.getThumbnail().shouldShowSplashView()) {
- ActiveGestureLog.INSTANCE.addLog("Invalid task view splash state");
- finishRecentsAnimationOnTasksAppeared(null /* onFinishComplete */);
+ if (taskView == null || taskView.getTaskContainers().stream().noneMatch(
+ TaskContainer::getShouldShowSplashView)) {
+ ActiveGestureLog.INSTANCE.addLog(forceFinishReason.append("Splash not needed"));
+ finishRecentsAnimationOnTasksAppeared(onFinishComplete);
return;
}
if (mContainer == null) {
- ActiveGestureLog.INSTANCE.addLog("Activity destroyed");
- finishRecentsAnimationOnTasksAppeared(null /* onFinishComplete */);
+ ActiveGestureLog.INSTANCE.addLog(forceFinishReason.append("Activity destroyed"));
+ finishRecentsAnimationOnTasksAppeared(onFinishComplete);
return;
}
- animateSplashScreenExit(mContainer, appearedTaskTargets, taskTarget.leash);
+ animateSplashScreenExit(mContainer, appearedTaskTargets, taskTargets);
}
private void animateSplashScreenExit(
@NonNull T activity,
@NonNull RemoteAnimationTarget[] appearedTaskTargets,
- @NonNull SurfaceControl leash) {
+ @NonNull RemoteAnimationTarget[] animatingTargets) {
ViewGroup splashView = activity.getDragLayer();
final QuickstepLauncher quickstepLauncher = activity instanceof QuickstepLauncher
? (QuickstepLauncher) activity : null;
@@ -2428,26 +2519,28 @@
}
surfaceApplier.scheduleApply(transaction);
- SplashScreenExitAnimationUtils.startAnimations(splashView, leash,
- mSplashMainWindowShiftLength, new TransactionPool(), new Rect(),
- SPLASH_ANIMATION_DURATION, SPLASH_FADE_OUT_DURATION,
- /* iconStartAlpha= */ 0, /* brandingStartAlpha= */ 0,
- SPLASH_APP_REVEAL_DELAY, SPLASH_APP_REVEAL_DURATION,
- new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- // Hiding launcher which shows the app surface behind, then
- // finishing recents to the app. After transition finish, showing
- // the views on launcher again, so it can be visible when next
- // animation starts.
- splashView.setAlpha(0);
- if (quickstepLauncher != null) {
- quickstepLauncher.getDepthController()
- .pauseBlursOnWindows(false);
+ for (RemoteAnimationTarget target : animatingTargets) {
+ SplashScreenExitAnimationUtils.startAnimations(splashView, target.leash,
+ mSplashMainWindowShiftLength, new TransactionPool(), target.screenSpaceBounds,
+ SPLASH_ANIMATION_DURATION, SPLASH_FADE_OUT_DURATION,
+ /* iconStartAlpha= */ 0, /* brandingStartAlpha= */ 0,
+ SPLASH_APP_REVEAL_DELAY, SPLASH_APP_REVEAL_DURATION,
+ new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ // Hiding launcher which shows the app surface behind, then
+ // finishing recents to the app. After transition finish, showing
+ // the views on launcher again, so it can be visible when next
+ // animation starts.
+ splashView.setAlpha(0);
+ if (quickstepLauncher != null) {
+ quickstepLauncher.getDepthController()
+ .pauseBlursOnWindows(false);
+ }
+ finishRecentsAnimationOnTasksAppeared(() -> splashView.setAlpha(1));
}
- finishRecentsAnimationOnTasksAppeared(() -> splashView.setAlpha(1));
- }
- });
+ });
+ }
}
private void finishRecentsAnimationOnTasksAppeared(Runnable onFinishComplete) {
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index 00cd60b..8703843 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -21,17 +21,18 @@
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.quickstep.AbsSwipeUpHandler.RECENTS_ATTACH_DURATION;
import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK;
+import static com.android.quickstep.util.RecentsAtomicAnimationFactory.INDEX_RECENTS_ATTACHED_ALPHA_ANIM;
import static com.android.quickstep.util.RecentsAtomicAnimationFactory.INDEX_RECENTS_FADE_ANIM;
import static com.android.quickstep.util.RecentsAtomicAnimationFactory.INDEX_RECENTS_TRANSLATE_X_ANIM;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
+import static com.android.quickstep.views.RecentsView.RUNNING_TASK_ATTACH_ALPHA;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
-import android.graphics.Color;
import android.view.MotionEvent;
import androidx.annotation.Nullable;
@@ -133,7 +134,7 @@
public boolean deferStartingActivity(RecentsAnimationDeviceState deviceState, MotionEvent ev) {
TaskbarUIController controller = getTaskbarController();
boolean isEventOverBubbleBarStashHandle =
- controller != null && controller.isEventOverBubbleBarStashHandle(ev);
+ controller != null && controller.isEventOverBubbleBarViews(ev);
return deviceState.isInDeferredGestureRegion(ev) || deviceState.isImeRenderingNavButtons()
|| isTrackpadMultiFingerSwipe(ev) || isEventOverBubbleBarStashHandle;
}
@@ -188,8 +189,10 @@
* @param attached Whether to show RecentsView alongside the app window. If false, recents
* will be hidden by some property we can animate, e.g. alpha.
* @param animate Whether to animate recents to/from its new attached state.
+ * @param updateRunningTaskAlpha Whether to update the running task's attached alpha
*/
- default void setRecentsAttachedToAppWindow(boolean attached, boolean animate) { }
+ default void setRecentsAttachedToAppWindow(
+ boolean attached, boolean animate, boolean updateRunningTaskAlpha) { }
default boolean isRecentsAttachedToAppWindow() {
return false;
@@ -254,12 +257,14 @@
// (because we set the animation as the current state animation), so we reapply the
// attached state here as well to ensure recents is shown/hidden appropriately.
if (DisplayController.getNavigationMode(mActivity) == NavigationMode.NO_BUTTON) {
- setRecentsAttachedToAppWindow(mIsAttachedToWindow, false);
+ setRecentsAttachedToAppWindow(
+ mIsAttachedToWindow, false, recentsView.shouldUpdateRunningTaskAlpha());
}
}
@Override
- public void setRecentsAttachedToAppWindow(boolean attached, boolean animate) {
+ public void setRecentsAttachedToAppWindow(
+ boolean attached, boolean animate, boolean updateRunningTaskAlpha) {
if (mIsAttachedToWindow == attached && animate) {
return;
}
@@ -267,6 +272,10 @@
.cancelStateElementAnimation(INDEX_RECENTS_FADE_ANIM);
mActivity.getStateManager()
.cancelStateElementAnimation(INDEX_RECENTS_TRANSLATE_X_ANIM);
+ if (updateRunningTaskAlpha) {
+ mActivity.getStateManager()
+ .cancelStateElementAnimation(INDEX_RECENTS_ATTACHED_ALPHA_ANIM);
+ }
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.addListener(new AnimatorListenerAdapter() {
@@ -281,19 +290,28 @@
long animationDuration = animate ? RECENTS_ATTACH_DURATION : 0;
Animator fadeAnim = mActivity.getStateManager()
- .createStateElementAnimation(INDEX_RECENTS_FADE_ANIM, attached ? 1 : 0);
+ .createStateElementAnimation(INDEX_RECENTS_FADE_ANIM, attached ? 1f : 0f);
fadeAnim.setInterpolator(attached ? INSTANT : ACCELERATE_2);
fadeAnim.setDuration(animationDuration);
animatorSet.play(fadeAnim);
float fromTranslation = ADJACENT_PAGE_HORIZONTAL_OFFSET.get(
mActivity.getOverviewPanel());
- float toTranslation = attached ? 0 : 1;
-
+ float toTranslation = attached ? 0f : 1f;
Animator translationAnimator = mActivity.getStateManager().createStateElementAnimation(
INDEX_RECENTS_TRANSLATE_X_ANIM, fromTranslation, toTranslation);
translationAnimator.setDuration(animationDuration);
animatorSet.play(translationAnimator);
+
+ if (updateRunningTaskAlpha) {
+ float fromAlpha = RUNNING_TASK_ATTACH_ALPHA.get(mActivity.getOverviewPanel());
+ float toAlpha = attached ? 1f : 0f;
+ Animator runningTaskAttachAlphaAnimator = mActivity.getStateManager()
+ .createStateElementAnimation(
+ INDEX_RECENTS_ATTACHED_ALPHA_ANIM, fromAlpha, toAlpha);
+ runningTaskAttachAlphaAnimator.setDuration(animationDuration);
+ animatorSet.play(runningTaskAttachAlphaAnimator);
+ }
animatorSet.start();
}
diff --git a/quickstep/src/com/android/quickstep/BaseContainerInterface.java b/quickstep/src/com/android/quickstep/BaseContainerInterface.java
index 9955183..3a8c141 100644
--- a/quickstep/src/com/android/quickstep/BaseContainerInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseContainerInterface.java
@@ -41,8 +41,8 @@
import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.taskbar.TaskbarUIController;
-import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.util.ActivityInitListener;
@@ -52,6 +52,7 @@
import com.android.systemui.shared.recents.model.ThumbnailData;
import java.util.HashMap;
+import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -207,10 +208,10 @@
}
public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect,
- PagedOrientationHandler orientedState) {
+ RecentsPagedOrientationHandler orientationHandler) {
if (dp.isTablet) {
if (Flags.enableGridOnlyOverview()) {
- calculateGridTaskSize(context, dp, outRect, orientedState);
+ calculateGridTaskSize(context, dp, outRect, orientationHandler);
} else {
calculateFocusTaskSize(context, dp, outRect);
}
@@ -218,15 +219,19 @@
Resources res = context.getResources();
float maxScale = res.getFloat(R.dimen.overview_max_scale);
int taskMargin = dp.overviewTaskMarginPx;
+ // In fake orientation, OverviewActions is hidden and we only leave a margin there.
+ int overviewActionsClaimedSpace = orientationHandler.isLayoutNaturalToLauncher()
+ ? dp.getOverviewActionsClaimedSpace() : dp.overviewActionsTopMarginPx;
calculateTaskSizeInternal(
context,
dp,
dp.overviewTaskThumbnailTopMarginPx,
- dp.getOverviewActionsClaimedSpace(),
+ overviewActionsClaimedSpace,
res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
maxScale,
Gravity.CENTER,
- outRect);
+ outRect,
+ orientationHandler);
}
}
@@ -234,7 +239,7 @@
* Calculates the taskView size for carousel during app to overview animation on tablets.
*/
public final void calculateCarouselTaskSize(Context context, DeviceProfile dp, Rect outRect,
- PagedOrientationHandler orientedState) {
+ RecentsPagedOrientationHandler orientationHandler) {
if (dp.isTablet && dp.isGestureMode) {
Resources res = context.getResources();
float minScale = res.getFloat(R.dimen.overview_carousel_min_scale);
@@ -243,7 +248,7 @@
calculateTaskSizeInternal(context, dp, gridRect, minScale, Gravity.CENTER | Gravity.TOP,
outRect);
} else {
- calculateTaskSize(context, dp, outRect, orientedState);
+ calculateTaskSize(context, dp, outRect, orientationHandler);
}
}
@@ -257,16 +262,42 @@
private void calculateTaskSizeInternal(Context context, DeviceProfile dp, int claimedSpaceAbove,
int claimedSpaceBelow, int minimumHorizontalPadding, float maxScale, int gravity,
- Rect outRect) {
- Rect insets = dp.getInsets();
-
+ Rect outRect, RecentsPagedOrientationHandler orientationHandler) {
Rect potentialTaskRect = new Rect(0, 0, dp.widthPx, dp.heightPx);
- potentialTaskRect.inset(insets.left, insets.top, insets.right, insets.bottom);
- potentialTaskRect.inset(
+
+ Rect insets;
+ if (orientationHandler.isLayoutNaturalToLauncher()) {
+ insets = dp.getInsets();
+ } else {
+ Rect portraitInsets = dp.getInsets();
+ DisplayController displayController = DisplayController.INSTANCE.get(context);
+ @Nullable List<WindowBounds> windowBounds =
+ displayController.getInfo().getCurrentBounds();
+ Rect deviceRotationInsets = windowBounds != null
+ ? windowBounds.get(orientationHandler.getRotation()).insets
+ : new Rect();
+ // Obtain the landscape/seascape insets, and rotate it to portrait perspective.
+ orientationHandler.rotateInsets(deviceRotationInsets, outRect);
+ // Then combine with portrait's insets to leave space for status bar/nav bar in
+ // either orientations.
+ outRect.set(
+ Math.max(outRect.left, portraitInsets.left),
+ Math.max(outRect.top, portraitInsets.top),
+ Math.max(outRect.right, portraitInsets.right),
+ Math.max(outRect.bottom, portraitInsets.bottom)
+ );
+ insets = outRect;
+ }
+ potentialTaskRect.inset(insets);
+
+ outRect.set(
minimumHorizontalPadding,
claimedSpaceAbove,
minimumHorizontalPadding,
claimedSpaceBelow);
+ // Rotate the paddings to portrait perspective,
+ orientationHandler.rotateInsets(outRect, outRect);
+ potentialTaskRect.inset(outRect);
calculateTaskSizeInternal(context, dp, potentialTaskRect, maxScale, gravity, outRect);
}
@@ -326,7 +357,7 @@
* Calculates the overview grid non-focused task size for the provided device configuration.
*/
public final void calculateGridTaskSize(Context context, DeviceProfile dp, Rect outRect,
- PagedOrientationHandler orientedState) {
+ RecentsPagedOrientationHandler orientationHandler) {
Resources res = context.getResources();
Rect potentialTaskRect = new Rect();
if (Flags.enableGridOnlyOverview()) {
@@ -344,7 +375,7 @@
int outHeight = Math.round(scale * taskDimension.y);
int gravity = Gravity.TOP;
- gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
+ gravity |= orientationHandler.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
}
@@ -352,8 +383,8 @@
* Calculates the modal taskView size for the provided device configuration
*/
public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect,
- PagedOrientationHandler orientedState) {
- calculateTaskSize(context, dp, outRect, orientedState);
+ RecentsPagedOrientationHandler orientationHandler) {
+ calculateTaskSize(context, dp, outRect, orientationHandler);
boolean isGridOnlyOverview = dp.isTablet && Flags.enableGridOnlyOverview();
int claimedSpaceBelow = isGridOnlyOverview
? dp.overviewActionsTopMarginPx + dp.overviewActionsHeight + dp.stashedTaskbarHeight
@@ -372,6 +403,7 @@
minimumHorizontalPadding,
1f /*maxScale*/,
Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM,
- outRect);
+ outRect,
+ orientationHandler);
}
}
diff --git a/quickstep/src/com/android/quickstep/BinderTracker.java b/quickstep/src/com/android/quickstep/BinderTracker.java
index a876cd8..2a42861 100644
--- a/quickstep/src/com/android/quickstep/BinderTracker.java
+++ b/quickstep/src/com/android/quickstep/BinderTracker.java
@@ -26,11 +26,14 @@
import android.os.Trace;
import android.util.Log;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.util.TraceHelper;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.util.LinkedList;
import java.util.Set;
import java.util.function.Consumer;
@@ -43,6 +46,9 @@
public class BinderTracker {
private static final String TAG = "BinderTracker";
+ private static final Boolean DEBUG_STACKTRACE = false;
+
+ private static final String[] sActionablePackageKeywords = {"launcher3", "systemui"};
// Common IPCs that are ok to block the main thread.
private static final Set<String> sAllowedFrameworkClasses = Set.of(
@@ -145,13 +151,32 @@
if (ipcBypass == null) {
mUnexpectedTransactionCallback.accept(new BinderCallSite(
- mMainThreadTraceStack.peekLast(), descriptor, transactionCode));
+ mMainThreadTraceStack.peekLast(), descriptor, transactionCode,
+ getActionableStacktrace()));
} else {
Log.d(TAG, "MainThread-IPC " + descriptor + " ignored due to " + ipcBypass);
}
return null;
}
+ @NonNull
+ private static String getActionableStacktrace() {
+ if (!DEBUG_STACKTRACE) {
+ return "DEBUG_STACKTRACE not turned on.";
+ }
+ final StringWriter sw = new StringWriter();
+ new Throwable().printStackTrace(new PrintWriter(sw));
+ final String stackTrace = sw.toString();
+
+ for (String actionablePackageKeyword : sActionablePackageKeywords) {
+ if (stackTrace.contains(actionablePackageKeyword)) {
+ return stackTrace;
+ }
+ }
+
+ return "Not actionable to launcher";
+ }
+
@Override
public Object onTransactStarted(IBinder binder, int transactionCode) {
// Do nothing
@@ -177,11 +202,14 @@
public final String activeTrace;
public final String descriptor;
public final int transactionCode;
+ public final String stackTrace;
- BinderCallSite(String activeTrace, String descriptor, int transactionCode) {
+ BinderCallSite(
+ String activeTrace, String descriptor, int transactionCode, String stackTrace) {
this.activeTrace = activeTrace;
this.descriptor = descriptor;
this.transactionCode = transactionCode;
+ this.stackTrace = stackTrace;
}
}
}
diff --git a/quickstep/src/com/android/quickstep/DesktopModeStatus.java b/quickstep/src/com/android/quickstep/DesktopModeStatus.java
deleted file mode 100644
index b1aae16..0000000
--- a/quickstep/src/com/android/quickstep/DesktopModeStatus.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep;
-
-import android.content.Context;
-import android.os.SystemProperties;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.window.flags.Flags;
-
-// TODO(b/335401172): Explore unifying logic across core and shell
-public class DesktopModeStatus {
-
- /**
- * Flag to indicate whether to restrict desktop mode to supported devices.
- */
- private static final boolean ENFORCE_DEVICE_RESTRICTIONS = SystemProperties.getBoolean(
- "persist.wm.debug.desktop_mode_enforce_device_restrictions", true);
-
- /**
- * Return {@code true} if desktop mode should be restricted to supported devices.
- */
- @VisibleForTesting
- public static boolean enforceDeviceRestrictions() {
- return ENFORCE_DEVICE_RESTRICTIONS;
- }
-
- /**
- * Return {@code true} if the current device supports desktop mode.
- */
- @VisibleForTesting
- public static boolean isDesktopModeSupported(Context context) {
- return context.getResources().getBoolean(
- com.android.internal.R.bool.config_isDesktopModeSupported);
- }
-
- /**
- * Return {@code true} if desktop mode can be entered on the current device.
- */
- public static boolean canEnterDesktopMode(Context context) {
- return Flags.enableDesktopWindowingMode()
- && (!enforceDeviceRestrictions() || isDesktopModeSupported(context));
- }
-}
diff --git a/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt b/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt
index aab6aa1..94f4920 100644
--- a/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt
+++ b/quickstep/src/com/android/quickstep/DesktopSystemShortcut.kt
@@ -23,29 +23,34 @@
import com.android.launcher3.popup.SystemShortcut
import com.android.quickstep.views.RecentsView
import com.android.quickstep.views.RecentsViewContainer
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer
+import com.android.quickstep.views.TaskContainer
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
+import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource
/** A menu item, "Desktop", that allows the user to bring the current app into Desktop Windowing. */
class DesktopSystemShortcut(
container: RecentsViewContainer,
- private val mTaskContainer: TaskIdAttributeContainer,
+ private val taskContainer: TaskContainer,
abstractFloatingViewHelper: AbstractFloatingViewHelper
) :
SystemShortcut<RecentsViewContainer>(
- R.drawable.ic_caption_desktop_button_foreground,
+ R.drawable.ic_desktop,
R.string.recent_task_option_desktop,
container,
- mTaskContainer.itemInfo,
- mTaskContainer.taskView,
+ taskContainer.itemInfo,
+ taskContainer.taskView,
abstractFloatingViewHelper
) {
override fun onClick(view: View) {
dismissTaskMenuView()
- val recentsView = mTarget!!.getOverviewPanel<RecentsView<*, *>>()
- recentsView.moveTaskToDesktop(mTaskContainer) {
+ val recentsView = mTarget.getOverviewPanel<RecentsView<*, *>>()
+ recentsView.moveTaskToDesktop(
+ taskContainer,
+ DesktopModeTransitionSource.APP_FROM_OVERVIEW
+ ) {
mTarget.statsLogManager
.logger()
- .withItemInfo(mTaskContainer.itemInfo)
+ .withItemInfo(taskContainer.itemInfo)
.log(LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_DESKTOP_TAP)
}
}
@@ -59,7 +64,7 @@
return object : TaskShortcutFactory {
override fun getShortcuts(
container: RecentsViewContainer,
- taskContainer: TaskIdAttributeContainer
+ taskContainer: TaskContainer
): List<DesktopSystemShortcut>? {
return if (!DesktopModeStatus.canEnterDesktopMode(container.asContext())) null
else if (!taskContainer.task.isDockable) null
diff --git a/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt b/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
index f68f793..904ed69 100644
--- a/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
+++ b/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
@@ -37,6 +37,13 @@
"Server side control to customize LPH timeout and touch slop"
)
+ val customLpaaThresholds =
+ propReader.get(
+ "CUSTOM_LPAA_THRESHOLDS",
+ false,
+ "Server side control to customize LPAA timeout and touch slop"
+ )
+
val overrideLpnhLphThresholds =
propReader.get(
"OVERRIDE_LPNH_LPH_THRESHOLDS",
@@ -57,11 +64,19 @@
"Enable two stage for LPNH duration and touch slop"
)
- val twoStageMultiplier =
+ val twoStageDurationPercentage =
propReader.get(
- "TWO_STAGE_MULTIPLIER",
- 2,
- "Extends the duration and touch slop if the initial slop is passed"
+ "TWO_STAGE_DURATION_PERCENTAGE",
+ 200,
+ "Extends the duration to trigger a long press after a fraction of the gesture " +
+ "slop is passed, expressed as a percentage (i.e. 200 = 2x)."
+ )
+
+ val twoStageSlopPercentage =
+ propReader.get(
+ "TWO_STAGE_SLOP_PERCENTAGE",
+ 50,
+ "Percentage of gesture slop region to trigger the extended long press duration."
)
val animateLpnh = propReader.get("ANIMATE_LPNH", false, "Animates navbar when long pressing")
@@ -154,7 +169,7 @@
}
companion object {
- val configHelper by lazy { DeviceConfigHelper(::DeviceConfigWrapper) }
+ @JvmStatic val configHelper by lazy { DeviceConfigHelper(::DeviceConfigWrapper) }
@JvmStatic fun get() = configHelper.config
}
diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
index 9e896fd..89fbf4a 100644
--- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
@@ -154,7 +154,8 @@
@Override
public void onExitOverview(RotationTouchHelper deviceState, Runnable exitRunnable) {
- final StateManager<RecentsState> stateManager = getCreatedContainer().getStateManager();
+ final StateManager<RecentsState, RecentsActivity> stateManager =
+ getCreatedContainer().getStateManager();
if (stateManager.getState() == HOME) {
exitRunnable.run();
notifyRecentsOfOrientation(deviceState);
diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
index 92cdf72..9b66154 100644
--- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
@@ -64,15 +64,17 @@
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.fallback.RecentsState;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties;
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.util.TransformParams.BuilderProxy;
+import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.system.InputConsumerController;
import java.lang.ref.WeakReference;
-import java.util.ArrayList;
+import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
@@ -140,9 +142,13 @@
}
@Override
- protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies,
- long duration, boolean isTargetTranslucent, boolean appCanEnterPip,
- RemoteAnimationTarget runningTaskTarget) {
+ protected HomeAnimationFactory createHomeAnimationFactory(
+ List<IBinder> launchCookies,
+ long duration,
+ boolean isTargetTranslucent,
+ boolean appCanEnterPip,
+ RemoteAnimationTarget runningTaskTarget,
+ @Nullable TaskView targetTaskView) {
mAppCanEnterPip = appCanEnterPip;
if (appCanEnterPip) {
return new FallbackPipToHomeAnimationFactory();
@@ -165,14 +171,16 @@
}
@Override
- protected boolean handleTaskAppeared(RemoteAnimationTarget[] appearedTaskTarget) {
+ protected boolean handleTaskAppeared(@NonNull RemoteAnimationTarget[] appearedTaskTarget,
+ @NonNull ActiveGestureLog.CompoundString failureReason) {
if (mActiveAnimationFactory != null
&& mActiveAnimationFactory.handleHomeTaskAppeared(appearedTaskTarget)) {
mActiveAnimationFactory = null;
+ failureReason.append("(FallbackSwipeHandler) should be handled as home task appeared");
return false;
}
- return super.handleTaskAppeared(appearedTaskTarget);
+ return super.handleTaskAppeared(appearedTaskTarget, failureReason);
}
@Override
@@ -380,7 +388,7 @@
}
@Override
- public void update(RectF currentRect, float progress, float radius) {
+ public void update(RectF currentRect, float progress, float radius, int overlayAlpha) {
if (mSurfaceControl != null) {
currentRect.roundOut(mTempRect);
Transaction t = new Transaction();
diff --git a/quickstep/src/com/android/quickstep/InputConsumer.java b/quickstep/src/com/android/quickstep/InputConsumer.java
index f898e2f..0185737 100644
--- a/quickstep/src/com/android/quickstep/InputConsumer.java
+++ b/quickstep/src/com/android/quickstep/InputConsumer.java
@@ -40,6 +40,7 @@
int TYPE_STATUS_BAR = 1 << 13;
int TYPE_CURSOR_HOVER = 1 << 14;
int TYPE_NAV_HANDLE_LONG_PRESS = 1 << 15;
+ int TYPE_BUBBLE_BAR = 1 << 16;
String[] NAMES = new String[] {
"TYPE_NO_OP", // 0
@@ -58,6 +59,7 @@
"TYPE_STATUS_BAR", // 13
"TYPE_CURSOR_HOVER", // 14
"TYPE_NAV_HANDLE_LONG_PRESS", // 15
+ "TYPE_BUBBLE_BAR", // 16
};
InputConsumer NO_OP = () -> TYPE_NO_OP;
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index 7655c59..b564fa7 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -35,7 +35,7 @@
import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.Flags;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherInitListener;
import com.android.launcher3.LauncherState;
@@ -192,7 +192,7 @@
public RecentsView getVisibleRecentsView() {
QuickstepLauncher launcher = getVisibleLauncher();
RecentsView recentsView =
- launcher != null && launcher.getStateManager().getState().overviewUi
+ launcher != null && launcher.getStateManager().getState().isRecentsViewVisible
? launcher.getOverviewPanel() : null;
if (recentsView == null || (!launcher.hasBeenResumed()
&& recentsView.getRunningTaskViewId() == -1)) {
@@ -212,10 +212,10 @@
if (launcher.isStarted() && (isInLiveTileMode() || launcher.hasBeenResumed())) {
return launcher;
}
- if (Flags.useActivityOverlay()
- && SystemUiProxy.INSTANCE.get(launcher).getHomeVisibilityState().isHomeVisible()) {
+ if (isInMinusOne()) {
return launcher;
}
+
return null;
}
@@ -242,7 +242,8 @@
@Override
public void onExitOverview(RotationTouchHelper deviceState, Runnable exitRunnable) {
- final StateManager<LauncherState> stateManager = getCreatedContainer().getStateManager();
+ final StateManager<LauncherState, Launcher> stateManager =
+ getCreatedContainer().getStateManager();
stateManager.addStateListener(
new StateManager.StateListener<LauncherState>() {
@Override
@@ -291,6 +292,15 @@
&& TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
}
+ private boolean isInMinusOne() {
+ QuickstepLauncher launcher = getCreatedContainer();
+
+ return launcher != null
+ && launcher.getStateManager().getState() == NORMAL
+ && !launcher.isStarted()
+ && TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
+ }
+
@Override
public void onLaunchTaskFailed() {
QuickstepLauncher launcher = getCreatedContainer();
@@ -308,7 +318,8 @@
return;
}
LauncherOverlayManager om = launcher.getOverlayManager();
- if (!launcher.isStarted() || launcher.isForceInvisible()) {
+ if (!SystemUiProxy.INSTANCE.get(launcher).getHomeVisibilityState().isHomeVisible()
+ || launcher.isForceInvisible()) {
om.hideOverlay(false /* animate */);
} else {
om.hideOverlay(150);
diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
index 225b127..b720382 100644
--- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
+++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
@@ -53,6 +53,7 @@
import android.window.IOnBackInvokedCallback;
import com.android.app.animation.Interpolators;
+import com.android.internal.policy.SystemBarUtils;
import com.android.internal.view.AppearanceRegion;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
@@ -88,7 +89,6 @@
private static final float MIN_WINDOW_SCALE = 0.85f;
private static final float MAX_SCRIM_ALPHA_DARK = 0.8f;
private static final float MAX_SCRIM_ALPHA_LIGHT = 0.2f;
- private static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.20f;
private final QuickstepTransitionManager mQuickstepTransitionManager;
private final Matrix mTransformMatrix = new Matrix();
@@ -100,6 +100,7 @@
private final int mWindowScaleMarginX;
private float mWindowScaleEndCornerRadius;
private float mWindowScaleStartCornerRadius;
+ private int mStatusBarHeight;
private final Interpolator mProgressInterpolator = Interpolators.BACK_GESTURE;
private final Interpolator mVerticalMoveInterpolator = new DecelerateInterpolator();
private final PointF mInitialTouchPos = new PointF();
@@ -123,7 +124,7 @@
private final ComponentCallbacks mComponentCallbacks = new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration newConfig) {
- loadCornerRadius();
+ loadResources();
}
@Override
@@ -135,7 +136,7 @@
QuickstepTransitionManager quickstepTransitionManager) {
mLauncher = launcher;
mQuickstepTransitionManager = quickstepTransitionManager;
- loadCornerRadius();
+ loadResources();
mWindowScaleMarginX = mLauncher.getResources().getDimensionPixelSize(
R.dimen.swipe_back_window_scale_x_margin);
}
@@ -388,7 +389,7 @@
progress, mWindowScaleStartCornerRadius, mWindowScaleEndCornerRadius);
applyTransform(mCurrentRect, cornerRadius);
- customizeStatusBarAppearance(progress > UPDATE_SYSUI_FLAGS_THRESHOLD);
+ customizeStatusBarAppearance(top > mStatusBarHeight / 2);
}
/** Transform the target window to match the target rect. */
@@ -535,13 +536,14 @@
anim.start();
}
- private void loadCornerRadius() {
+ private void loadResources() {
mWindowScaleEndCornerRadius = QuickStepContract.supportsRoundedCornersOnWindows(
mLauncher.getResources())
? mLauncher.getResources().getDimensionPixelSize(
R.dimen.swipe_back_window_corner_radius)
: 0;
mWindowScaleStartCornerRadius = QuickStepContract.getWindowCornerRadius(mLauncher);
+ mStatusBarHeight = SystemBarUtils.getStatusBarHeight(mLauncher);
}
/**
diff --git a/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt b/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt
index 27bd03d..7d22c52 100644
--- a/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt
+++ b/quickstep/src/com/android/quickstep/LauncherRestoreEventLoggerImpl.kt
@@ -5,6 +5,7 @@
import android.app.backup.BackupRestoreEventLogger.BackupRestoreDataType
import android.app.backup.BackupRestoreEventLogger.BackupRestoreError
import android.content.Context
+import androidx.annotation.VisibleForTesting
import com.android.launcher3.Flags.enableLauncherBrMetricsFixed
import com.android.launcher3.LauncherSettings.Favorites
import com.android.launcher3.backuprestore.LauncherRestoreEventLogger
@@ -29,8 +30,8 @@
@BackupRestoreDataType private const val DATA_TYPE_APP_PAIR = "app_pair"
}
- private val restoreEventLogger: BackupRestoreEventLogger =
- BackupManager(context).delayedRestoreLogger
+ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
+ val restoreEventLogger: BackupRestoreEventLogger = BackupManager(context).delayedRestoreLogger
/**
* For logging when multiple items of a given data type failed to restore.
diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
index af02ccf..e17cdcd 100644
--- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
+++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
@@ -43,6 +43,7 @@
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.ObjectWrapper;
+import com.android.launcher3.views.ClipIconView;
import com.android.launcher3.views.FloatingIconView;
import com.android.launcher3.views.FloatingView;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
@@ -55,7 +56,8 @@
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.system.InputConsumerController;
-import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
* Temporary class to allow easier refactoring
@@ -72,9 +74,13 @@
@Override
- protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies,
- long duration, boolean isTargetTranslucent, boolean appCanEnterPip,
- RemoteAnimationTarget runningTaskTarget) {
+ protected HomeAnimationFactory createHomeAnimationFactory(
+ List<IBinder> launchCookies,
+ long duration,
+ boolean isTargetTranslucent,
+ boolean appCanEnterPip,
+ RemoteAnimationTarget runningTaskTarget,
+ @Nullable TaskView targetTaskView) {
if (mContainer == null) {
mStateCallback.addChangeListener(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED,
isPresent -> mRecentsView.startHome());
@@ -86,8 +92,14 @@
};
}
- final View workspaceView = findWorkspaceView(launchCookies,
- mRecentsView.getRunningTaskView());
+ TaskView sourceTaskView = mRecentsView == null && targetTaskView == null
+ ? null
+ : targetTaskView == null
+ ? mRecentsView.getRunningTaskView()
+ : targetTaskView;
+ final View workspaceView = findWorkspaceView(
+ targetTaskView == null ? launchCookies : Collections.emptyList(),
+ sourceTaskView);
boolean canUseWorkspaceView = workspaceView != null
&& workspaceView.isAttachedToWindow()
&& workspaceView.getHeight() > 0
@@ -100,16 +112,24 @@
}
if (!canUseWorkspaceView || appCanEnterPip || mIsSwipeForSplit) {
- return new LauncherHomeAnimationFactory();
+ return new LauncherHomeAnimationFactory() {
+
+ @Nullable
+ @Override
+ public TaskView getTargetTaskView() {
+ return targetTaskView;
+ }
+ };
}
if (workspaceView instanceof LauncherAppWidgetHostView) {
return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView,
isTargetTranslucent, runningTaskTarget);
}
- return createIconHomeAnimationFactory(workspaceView);
+ return createIconHomeAnimationFactory(workspaceView, targetTaskView);
}
- private HomeAnimationFactory createIconHomeAnimationFactory(View workspaceView) {
+ private HomeAnimationFactory createIconHomeAnimationFactory(
+ View workspaceView, @Nullable TaskView targetTaskView) {
RectF iconLocation = new RectF();
FloatingIconView floatingIconView = getFloatingIconView(mContainer, workspaceView, null,
mContainer.getTaskbarUIController() == null
@@ -124,8 +144,6 @@
return new FloatingViewHomeAnimationFactory(floatingIconView) {
@Nullable
private RectF mTargetRect;
- @Nullable
- private RectFSpringAnim mSiblingAnimation;
@Nullable
@Override
@@ -153,18 +171,6 @@
}
@Override
- public void playAtomicAnimation(float velocity) {
- if (enableScalingRevealHomeAnimation()) {
- if (mContainer != null) {
- new ScalingWorkspaceRevealAnim(
- mContainer, mSiblingAnimation, getWindowTargetRect()).start();
- }
- } else {
- super.playAtomicAnimation(velocity);
- }
- }
-
- @Override
public void setAnimation(RectFSpringAnim anim) {
super.setAnimation(anim);
mSiblingAnimation = anim;
@@ -175,10 +181,35 @@
}
@Override
- public void update(RectF currentRect, float progress, float radius) {
- super.update(currentRect, progress, radius);
+ public void update(
+ RectF currentRect,
+ float progress,
+ float radius,
+ int overlayAlpha) {
floatingIconView.update(1f /* alpha */, currentRect, progress, windowAlphaThreshold,
- radius, false);
+ radius, false, overlayAlpha);
+ }
+
+ @Override
+ public boolean isAnimationReady() {
+ return floatingIconView.isLaidOut();
+ }
+
+ @Override
+ public void setTaskViewArtist(ClipIconView.TaskViewArtist taskViewArtist) {
+ super.setTaskViewArtist(taskViewArtist);
+ floatingIconView.setOverlayArtist(taskViewArtist);
+ }
+
+ @Override
+ public boolean isAnimatingIntoIcon() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public TaskView getTargetTaskView() {
+ return targetTaskView;
}
};
}
@@ -204,6 +235,8 @@
isTargetTranslucent, fallbackBackgroundColor);
return new FloatingViewHomeAnimationFactory(floatingWidgetView) {
+ @Nullable
+ private RectF mTargetRect;
@Override
@Nullable
@@ -213,8 +246,14 @@
@Override
public RectF getWindowTargetRect() {
- super.getWindowTargetRect();
- return backgroundLocation;
+ if (enableScalingRevealHomeAnimation()) {
+ if (mTargetRect == null) {
+ mTargetRect = new RectF(backgroundLocation);
+ }
+ return mTargetRect;
+ } else {
+ return backgroundLocation;
+ }
}
@Override
@@ -225,15 +264,16 @@
@Override
public void setAnimation(RectFSpringAnim anim) {
super.setAnimation(anim);
-
- anim.addAnimatorListener(floatingWidgetView);
- floatingWidgetView.setOnTargetChangeListener(anim::onTargetPositionChanged);
- floatingWidgetView.setFastFinishRunnable(anim::end);
+ mSiblingAnimation = anim;
+ mSiblingAnimation.addAnimatorListener(floatingWidgetView);
+ floatingWidgetView.setOnTargetChangeListener(
+ mSiblingAnimation::onTargetPositionChanged);
+ floatingWidgetView.setFastFinishRunnable(mSiblingAnimation::end);
}
@Override
- public void update(RectF currentRect, float progress, float radius) {
- super.update(currentRect, progress, radius);
+ public void update(RectF currentRect, float progress, float radius, int overlayAlpha) {
+ super.update(currentRect, progress, radius, overlayAlpha);
final float fallbackBackgroundAlpha =
1 - mapBoundToRange(progress, 0.8f, 1, 0, 1, EXAGGERATED_EASE);
final float foregroundAlpha =
@@ -254,13 +294,12 @@
* associated with the running task.
*/
@Nullable
- private View findWorkspaceView(ArrayList<IBinder> launchCookies, TaskView runningTaskView) {
+ private View findWorkspaceView(List<IBinder> launchCookies, TaskView sourceTaskView) {
if (mIsSwipingPipToHome) {
// Disable if swiping to PIP
return null;
}
- if (runningTaskView == null || runningTaskView.getTask() == null
- || runningTaskView.getTask().key.getComponent() == null) {
+ if (sourceTaskView == null || sourceTaskView.getFirstTask().key.getComponent() == null) {
// Disable if it's an invalid task
return null;
}
@@ -277,8 +316,8 @@
}
return mContainer.getFirstMatchForAppClose(launchCookieItemId,
- runningTaskView.getTask().key.getComponent().getPackageName(),
- UserHandle.of(runningTaskView.getTask().key.userId),
+ sourceTaskView.getFirstTask().key.getComponent().getPackageName(),
+ UserHandle.of(sourceTaskView.getFirstTask().key.userId),
false /* supportsAllAppsState */);
}
@@ -290,14 +329,23 @@
}
private class FloatingViewHomeAnimationFactory extends LauncherHomeAnimationFactory {
-
private final FloatingView mFloatingView;
+ @Nullable
+ protected RectFSpringAnim mSiblingAnimation;
FloatingViewHomeAnimationFactory(FloatingView floatingView) {
mFloatingView = floatingView;
}
@Override
+ protected void playScalingRevealAnimation() {
+ if (mContainer != null) {
+ new ScalingWorkspaceRevealAnim(mContainer, mSiblingAnimation,
+ getWindowTargetRect()).start();
+ }
+ }
+
+ @Override
public void onCancel() {
mFloatingView.fastFinish();
}
@@ -326,9 +374,25 @@
@Override
public void playAtomicAnimation(float velocity) {
- new StaggeredWorkspaceAnim(mContainer, velocity, true /* animateOverviewScrim */,
- getViewIgnoredInWorkspaceRevealAnimation())
- .start();
+ if (enableScalingRevealHomeAnimation()) {
+ playScalingRevealAnimation();
+ } else {
+ new StaggeredWorkspaceAnim(mContainer, velocity, true /* animateOverviewScrim */,
+ getViewIgnoredInWorkspaceRevealAnimation())
+ .start();
+ }
+ }
+
+ /**
+ * Extracted in a different method so subclasses that have a custom window animation with a
+ * target (icons, widgets) can pass the optional parameters.
+ */
+ protected void playScalingRevealAnimation() {
+ if (mContainer != null) {
+ new ScalingWorkspaceRevealAnim(
+ mContainer, null /* siblingAnimation */,
+ null /* windowTargetRect */).start();
+ }
}
}
}
diff --git a/quickstep/src/com/android/quickstep/OrientationRectF.java b/quickstep/src/com/android/quickstep/OrientationRectF.java
index aa01b05..2b7ecb2 100644
--- a/quickstep/src/com/android/quickstep/OrientationRectF.java
+++ b/quickstep/src/com/android/quickstep/OrientationRectF.java
@@ -67,13 +67,15 @@
}
public boolean applyTransform(MotionEvent event, int deltaRotation, boolean forceTransform) {
+ if (deltaRotation == 0) {
+ return contains(event.getX(), event.getY());
+ }
mTmpMatrix.reset();
postDisplayRotation(deltaRotation, mHeight, mWidth, mTmpMatrix);
if (forceTransform) {
if (DEBUG) {
Log.d(TAG, "Transforming rotation due to forceTransform, "
+ "deltaRotation: " + deltaRotation
- + "mRotation: " + mRotation
+ " this: " + this);
}
event.applyTransform(mTmpMatrix);
diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
index 84f6b55..a03c0f8 100644
--- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
+++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
@@ -37,6 +37,7 @@
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.window.CachedDisplayInfo;
+import com.android.systemui.shared.Flags;
import java.io.PrintWriter;
import java.util.HashMap;
@@ -242,7 +243,8 @@
int rotation = display.rotation;
int touchHeight = mNavBarGesturalHeight;
OrientationRectF orientationRectF = new OrientationRectF(0, 0, size.x, size.y, rotation);
- if (mMode == NavigationMode.NO_BUTTON) {
+ if (mMode == NavigationMode.NO_BUTTON
+ || (mMode == NavigationMode.THREE_BUTTONS && Flags.threeButtonCornerSwipe())) {
orientationRectF.top = orientationRectF.bottom - touchHeight;
updateAssistantRegions(orientationRectF);
} else {
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
deleted file mode 100644
index 68923ee..0000000
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep;
-
-import static com.android.launcher3.PagedView.INVALID_PAGE;
-import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.quickstep.util.ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.content.Intent;
-import android.graphics.PointF;
-import android.os.SystemClock;
-import android.os.Trace;
-import android.view.View;
-
-import androidx.annotation.BinderThread;
-import androidx.annotation.Nullable;
-import androidx.annotation.UiThread;
-
-import com.android.internal.jank.Cuj;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.statemanager.StatefulActivity;
-import com.android.launcher3.taskbar.TaskbarUIController;
-import com.android.launcher3.util.RunnableList;
-import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
-import com.android.quickstep.util.ActiveGestureLog;
-import com.android.quickstep.views.RecentsView;
-import com.android.quickstep.views.RecentsViewContainer;
-import com.android.quickstep.views.TaskView;
-import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * Helper class to handle various atomic commands for switching between Overview.
- */
-public class OverviewCommandHelper {
-
- public static final int TYPE_SHOW = 1;
- public static final int TYPE_KEYBOARD_INPUT = 2;
- public static final int TYPE_HIDE = 3;
- public static final int TYPE_TOGGLE = 4;
- public static final int TYPE_HOME = 5;
-
- /**
- * Use case for needing a queue is double tapping recents button in 3 button nav.
- * Size of 2 should be enough. We'll toss in one more because we're kind hearted.
- */
- private final static int MAX_QUEUE_SIZE = 3;
-
- private static final String TRANSITION_NAME = "Transition:toOverview";
-
- private final TouchInteractionService mService;
- private final OverviewComponentObserver mOverviewComponentObserver;
- private final TaskAnimationManager mTaskAnimationManager;
- private final ArrayList<CommandInfo> mPendingCommands = new ArrayList<>();
-
- /**
- * Index of the TaskView that should be focused when launching Overview. Persisted so that we
- * do not lose the focus across multiple calls of
- * {@link OverviewCommandHelper#executeCommand(CommandInfo)} for the same command
- */
- private int mKeyboardTaskFocusIndex = -1;
-
- /**
- * Whether we should incoming toggle commands while a previous toggle command is still ongoing.
- * This serves as a rate-limiter to prevent overlapping animations that can clobber each other
- * and prevent clean-up callbacks from running. This thus prevents a recurring set of bugs with
- * janky recents animations and unresponsive home and overview buttons.
- */
- private boolean mWaitForToggleCommandComplete = false;
-
- public OverviewCommandHelper(TouchInteractionService service,
- OverviewComponentObserver observer,
- TaskAnimationManager taskAnimationManager) {
- mService = service;
- mOverviewComponentObserver = observer;
- mTaskAnimationManager = taskAnimationManager;
- }
-
- /**
- * Called when the command finishes execution.
- */
- private void scheduleNextTask(CommandInfo command) {
- if (!mPendingCommands.isEmpty() && mPendingCommands.get(0) == command) {
- mPendingCommands.remove(0);
- executeNext();
- }
- }
-
- /**
- * Executes the next command from the queue. If the command finishes immediately (returns true),
- * it continues to execute the next command, until the queue is empty of a command defer's its
- * completion (returns false).
- */
- @UiThread
- private void executeNext() {
- if (mPendingCommands.isEmpty()) {
- return;
- }
- CommandInfo cmd = mPendingCommands.get(0);
- if (executeCommand(cmd)) {
- scheduleNextTask(cmd);
- }
- }
-
- @UiThread
- private void addCommand(CommandInfo cmd) {
- boolean wasEmpty = mPendingCommands.isEmpty();
- mPendingCommands.add(cmd);
- if (wasEmpty) {
- executeNext();
- }
- }
-
- /**
- * Adds a command to be executed next, after all pending tasks are completed.
- * Max commands that can be queued is {@link #MAX_QUEUE_SIZE}.
- * Requests after reaching that limit will be silently dropped.
- */
- @BinderThread
- public void addCommand(int type) {
- if (mPendingCommands.size() >= MAX_QUEUE_SIZE) {
- return;
- }
- CommandInfo cmd = new CommandInfo(type);
- MAIN_EXECUTOR.execute(() -> addCommand(cmd));
- }
-
- @UiThread
- public void clearPendingCommands() {
- mPendingCommands.clear();
- }
-
- @UiThread
- public boolean canStartHomeSafely() {
- return mPendingCommands.isEmpty() || mPendingCommands.get(0).type == TYPE_HOME;
- }
-
- @Nullable
- private TaskView getNextTask(RecentsView view) {
- final TaskView runningTaskView = view.getRunningTaskView();
-
- if (runningTaskView == null) {
- return view.getTaskViewAt(0);
- } else {
- final TaskView nextTask = view.getNextTaskView();
- return nextTask != null ? nextTask : runningTaskView;
- }
- }
-
- private boolean launchTask(RecentsView recents, @Nullable TaskView taskView, CommandInfo cmd) {
- RunnableList callbackList = null;
- if (taskView != null) {
- mWaitForToggleCommandComplete = true;
- taskView.setEndQuickswitchCuj(true);
- callbackList = taskView.launchTasks();
- }
-
- if (callbackList != null) {
- callbackList.add(() -> {
- scheduleNextTask(cmd);
- mWaitForToggleCommandComplete = false;
- });
- return false;
- } else {
- recents.startHome();
- mWaitForToggleCommandComplete = false;
- return true;
- }
- }
-
- /**
- * Executes the task and returns true if next task can be executed. If false, then the next
- * task is deferred until {@link #scheduleNextTask} is called
- */
- private <T extends StatefulActivity<?> & RecentsViewContainer> boolean executeCommand(
- CommandInfo cmd) {
- if (mWaitForToggleCommandComplete && cmd.type == TYPE_TOGGLE) {
- return true;
- }
- BaseActivityInterface<?, T> activityInterface =
- mOverviewComponentObserver.getActivityInterface();
- RecentsView visibleRecentsView = activityInterface.getVisibleRecentsView();
- RecentsView createdRecentsView;
- if (visibleRecentsView == null) {
- T activity = activityInterface.getCreatedContainer();
- createdRecentsView = activity == null ? null : activity.getOverviewPanel();
- DeviceProfile dp = activity == null ? null : activity.getDeviceProfile();
- TaskbarUIController uiController = activityInterface.getTaskbarController();
- boolean allowQuickSwitch = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get()
- && uiController != null
- && dp != null
- && (dp.isTablet || dp.isTwoPanels);
-
- switch (cmd.type) {
- case TYPE_HIDE:
- if (!allowQuickSwitch) {
- return true;
- }
- mKeyboardTaskFocusIndex = uiController.launchFocusedTask();
- if (mKeyboardTaskFocusIndex == -1) {
- return true;
- }
- break;
- case TYPE_KEYBOARD_INPUT:
- if (allowQuickSwitch) {
- uiController.openQuickSwitchView();
- return true;
- } else {
- mKeyboardTaskFocusIndex = 0;
- break;
- }
- case TYPE_HOME:
- ActiveGestureLog.INSTANCE.addLog(
- "OverviewCommandHelper.executeCommand(TYPE_HOME)");
- mService.startActivity(mOverviewComponentObserver.getHomeIntent());
- return true;
- case TYPE_SHOW:
- // When Recents is not currently visible, the command's type is TYPE_SHOW
- // when overview is triggered via the keyboard overview button or Action+Tab
- // keys (Not Alt+Tab which is KQS). The overview button on-screen in 3-button
- // nav is TYPE_TOGGLE.
- mKeyboardTaskFocusIndex = 0;
- break;
- default:
- // continue below to handle displaying Recents.
- }
- } else {
- createdRecentsView = visibleRecentsView;
- switch (cmd.type) {
- case TYPE_SHOW:
- // already visible
- return true;
- case TYPE_KEYBOARD_INPUT: {
- if (visibleRecentsView.isHandlingTouch()) {
- return true;
- }
- }
- case TYPE_HIDE: {
- if (visibleRecentsView.isHandlingTouch()) {
- return true;
- }
- mKeyboardTaskFocusIndex = INVALID_PAGE;
- int currentPage = visibleRecentsView.getNextPage();
- TaskView tv = (currentPage >= 0
- && currentPage < visibleRecentsView.getTaskViewCount())
- ? (TaskView) visibleRecentsView.getPageAt(currentPage)
- : null;
- return launchTask(visibleRecentsView, tv, cmd);
- }
- case TYPE_TOGGLE:
- return launchTask(visibleRecentsView, getNextTask(visibleRecentsView), cmd);
- case TYPE_HOME:
- visibleRecentsView.startHome();
- return true;
- }
- }
-
- if (createdRecentsView != null) {
- createdRecentsView.setKeyboardTaskFocusIndex(mKeyboardTaskFocusIndex);
- }
- // Handle recents view focus when launching from home
- Animator.AnimatorListener animatorListener = new AnimatorListenerAdapter() {
-
- @Override
- public void onAnimationStart(Animator animation) {
- super.onAnimationStart(animation);
- updateRecentsViewFocus(cmd);
- }
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- onRecentsViewFocusUpdated(cmd);
- scheduleNextTask(cmd);
- }
- };
- if (activityInterface.switchToRecentsIfVisible(animatorListener)) {
- // If successfully switched, wait until animation finishes
- return false;
- }
-
- final T activity = activityInterface.getCreatedContainer();
- if (activity != null) {
- InteractionJankMonitorWrapper.begin(
- activity.getRootView(),
- Cuj.CUJ_LAUNCHER_QUICK_SWITCH);
- }
-
- GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE,
- GestureState.TrackpadGestureType.NONE);
- gestureState.setHandlingAtomicEvent(true);
- AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory()
- .newHandler(gestureState, cmd.createTime);
- interactionHandler.setGestureEndCallback(
- () -> onTransitionComplete(cmd, interactionHandler));
- interactionHandler.initWhenReady("OverviewCommandHelper: cmd.type=" + cmd.type);
-
- RecentsAnimationListener recentAnimListener = new RecentsAnimationListener() {
- @Override
- public void onRecentsAnimationStart(RecentsAnimationController controller,
- RecentsAnimationTargets targets) {
- updateRecentsViewFocus(cmd);
- activityInterface.runOnInitBackgroundStateUI(() ->
- interactionHandler.onGestureEnded(0, new PointF()));
- cmd.removeListener(this);
- }
-
- @Override
- public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) {
- interactionHandler.onGestureCancelled();
- cmd.removeListener(this);
-
- T createdActivity = activityInterface.getCreatedContainer();
- if (createdActivity == null) {
- return;
- }
- if (createdRecentsView != null) {
- createdRecentsView.onRecentsAnimationComplete();
- }
- }
- };
-
- if (visibleRecentsView != null) {
- visibleRecentsView.moveRunningTaskToFront();
- }
- if (mTaskAnimationManager.isRecentsAnimationRunning()) {
- cmd.mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(gestureState);
- cmd.mActiveCallbacks.addListener(interactionHandler);
- mTaskAnimationManager.notifyRecentsAnimationState(interactionHandler);
- interactionHandler.onGestureStarted(true /*isLikelyToStartNewTask*/);
-
- cmd.mActiveCallbacks.addListener(recentAnimListener);
- mTaskAnimationManager.notifyRecentsAnimationState(recentAnimListener);
- } else {
- Intent intent = new Intent(interactionHandler.getLaunchIntent());
- intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, gestureState.getGestureId());
- cmd.mActiveCallbacks = mTaskAnimationManager.startRecentsAnimation(
- gestureState, intent, interactionHandler);
- interactionHandler.onGestureStarted(false /*isLikelyToStartNewTask*/);
- cmd.mActiveCallbacks.addListener(recentAnimListener);
- }
- Trace.beginAsyncSection(TRANSITION_NAME, 0);
- return false;
- }
-
- private void onTransitionComplete(CommandInfo cmd, AbsSwipeUpHandler handler) {
- cmd.removeListener(handler);
- Trace.endAsyncSection(TRANSITION_NAME, 0);
- onRecentsViewFocusUpdated(cmd);
- scheduleNextTask(cmd);
- }
-
- private void updateRecentsViewFocus(CommandInfo cmd) {
- RecentsView recentsView =
- mOverviewComponentObserver.getActivityInterface().getVisibleRecentsView();
- if (recentsView == null || (cmd.type != TYPE_KEYBOARD_INPUT && cmd.type != TYPE_HIDE
- && cmd.type != TYPE_SHOW)) {
- return;
- }
- // When the overview is launched via alt tab (cmd type is TYPE_KEYBOARD_INPUT),
- // the touch mode somehow is not change to false by the Android framework.
- // The subsequent tab to go through tasks in overview can only be dispatched to
- // focuses views, while focus can only be requested in
- // {@link View#requestFocusNoSearch(int, Rect)} when touch mode is false. To note,
- // here we launch overview with live tile.
- recentsView.getViewRootImpl().touchModeChanged(false);
- // Ensure that recents view has focus so that it receives the followup key inputs
- if (requestFocus(recentsView.getTaskViewAt(mKeyboardTaskFocusIndex))) {
- return;
- }
- if (requestFocus(recentsView.getNextTaskView())) {
- return;
- }
- if (requestFocus(recentsView.getTaskViewAt(0))) {
- return;
- }
- requestFocus(recentsView);
- }
-
- private void onRecentsViewFocusUpdated(CommandInfo cmd) {
- RecentsView recentsView =
- mOverviewComponentObserver.getActivityInterface().getVisibleRecentsView();
- if (recentsView == null
- || cmd.type != TYPE_HIDE
- || mKeyboardTaskFocusIndex == INVALID_PAGE) {
- return;
- }
- recentsView.setKeyboardTaskFocusIndex(INVALID_PAGE);
- recentsView.setCurrentPage(mKeyboardTaskFocusIndex);
- mKeyboardTaskFocusIndex = INVALID_PAGE;
- }
-
- private boolean requestFocus(@Nullable View taskView) {
- if (taskView == null) {
- return false;
- }
- taskView.post(() -> {
- taskView.requestFocus();
- taskView.requestAccessibilityFocus();
- });
- return true;
- }
-
- public void dump(PrintWriter pw) {
- pw.println("OverviewCommandHelper:");
- pw.println(" mPendingCommands=" + mPendingCommands.size());
- if (!mPendingCommands.isEmpty()) {
- pw.println(" pendingCommandType=" + mPendingCommands.get(0).type);
- }
- pw.println(" mKeyboardTaskFocusIndex=" + mKeyboardTaskFocusIndex);
- pw.println(" mWaitForToggleCommandComplete=" + mWaitForToggleCommandComplete);
- }
-
- private static class CommandInfo {
- public final long createTime = SystemClock.elapsedRealtime();
- public final int type;
- RecentsAnimationCallbacks mActiveCallbacks;
-
- CommandInfo(int type) {
- this.type = type;
- }
-
- void removeListener(RecentsAnimationListener listener) {
- if (mActiveCallbacks != null) {
- mActiveCallbacks.removeListener(listener);
- }
- }
- }
-}
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt
new file mode 100644
index 0000000..f6b9e4e
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt
@@ -0,0 +1,484 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.content.Intent
+import android.graphics.PointF
+import android.os.SystemClock
+import android.os.Trace
+import android.util.Log
+import android.view.View
+import androidx.annotation.BinderThread
+import androidx.annotation.UiThread
+import com.android.internal.jank.Cuj
+import com.android.launcher3.PagedView
+import com.android.launcher3.config.FeatureFlags
+import com.android.launcher3.logger.LauncherAtom
+import com.android.launcher3.logging.StatsLogManager
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.*
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.RunnableList
+import com.android.quickstep.util.ActiveGestureLog
+import com.android.quickstep.views.RecentsView
+import com.android.quickstep.views.RecentsViewContainer
+import com.android.quickstep.views.TaskView
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.android.systemui.shared.system.InteractionJankMonitorWrapper
+import java.io.PrintWriter
+
+/** Helper class to handle various atomic commands for switching between Overview. */
+class OverviewCommandHelper(
+ private val touchInteractionService: TouchInteractionService,
+ private val overviewComponentObserver: OverviewComponentObserver,
+ private val taskAnimationManager: TaskAnimationManager
+) {
+ private val pendingCommands = mutableListOf<CommandInfo>()
+
+ /**
+ * Index of the TaskView that should be focused when launching Overview. Persisted so that we do
+ * not lose the focus across multiple calls of [OverviewCommandHelper.executeCommand] for the
+ * same command
+ */
+ private var keyboardTaskFocusIndex = -1
+
+ /**
+ * Whether we should incoming toggle commands while a previous toggle command is still ongoing.
+ * This serves as a rate-limiter to prevent overlapping animations that can clobber each other
+ * and prevent clean-up callbacks from running. This thus prevents a recurring set of bugs with
+ * janky recents animations and unresponsive home and overview buttons.
+ */
+ private var waitForToggleCommandComplete = false
+
+ /** Called when the command finishes execution. */
+ private fun scheduleNextTask(command: CommandInfo) {
+ if (pendingCommands.isEmpty()) {
+ Log.d(TAG, "no pending commands to schedule")
+ return
+ }
+ if (pendingCommands.first() !== command) {
+ Log.d(
+ TAG,
+ "next task not scheduled. First pending command type " +
+ "is ${pendingCommands.first()} - command type is: $command"
+ )
+ return
+ }
+ Log.d(TAG, "scheduleNextTask called: $command")
+ pendingCommands.removeFirst()
+ executeNext()
+ }
+
+ /**
+ * Executes the next command from the queue. If the command finishes immediately (returns true),
+ * it continues to execute the next command, until the queue is empty of a command defer's its
+ * completion (returns false).
+ */
+ @UiThread
+ private fun executeNext() {
+ if (pendingCommands.isEmpty()) {
+ Log.d(TAG, "executeNext - pendingCommands is empty")
+ return
+ }
+ val command = pendingCommands.first()
+ val result = executeCommand(command)
+ Log.d(TAG, "executeNext command type: $command, result: $result")
+ if (result) {
+ scheduleNextTask(command)
+ }
+ }
+
+ @UiThread
+ private fun addCommand(command: CommandInfo) {
+ val wasEmpty = pendingCommands.isEmpty()
+ pendingCommands.add(command)
+ if (wasEmpty) {
+ executeNext()
+ }
+ }
+
+ /**
+ * Adds a command to be executed next, after all pending tasks are completed. Max commands that
+ * can be queued is [.MAX_QUEUE_SIZE]. Requests after reaching that limit will be silently
+ * dropped.
+ */
+ @BinderThread
+ fun addCommand(type: Int) {
+ if (pendingCommands.size >= MAX_QUEUE_SIZE) {
+ Log.d(
+ TAG,
+ "the pending command queue is full (${pendingCommands.size}). command not added: $type"
+ )
+ return
+ }
+ Log.d(TAG, "adding command type: $type")
+ val command = CommandInfo(type)
+ Executors.MAIN_EXECUTOR.execute { addCommand(command) }
+ }
+
+ @UiThread
+ fun clearPendingCommands() {
+ Log.d(TAG, "clearing pending commands - size: ${pendingCommands.size}")
+ pendingCommands.clear()
+ }
+
+ @UiThread
+ fun canStartHomeSafely(): Boolean =
+ pendingCommands.isEmpty() || pendingCommands.first().type == TYPE_HOME
+
+ private fun getNextTask(view: RecentsView<*, *>): TaskView? {
+ val runningTaskView = view.runningTaskView
+
+ return if (runningTaskView == null) {
+ view.getTaskViewAt(0)
+ } else {
+ val nextTask = view.nextTaskView
+ nextTask ?: runningTaskView
+ }
+ }
+
+ private fun launchTask(
+ recents: RecentsView<*, *>,
+ taskView: TaskView?,
+ command: CommandInfo
+ ): Boolean {
+ var callbackList: RunnableList? = null
+ if (taskView != null) {
+ waitForToggleCommandComplete = true
+ taskView.isEndQuickSwitchCuj = true
+ callbackList = taskView.launchTasks()
+ }
+
+ if (callbackList != null) {
+ callbackList.add {
+ Log.d(TAG, "launching task callback: $command")
+ scheduleNextTask(command)
+ waitForToggleCommandComplete = false
+ }
+ Log.d(TAG, "launching task - waiting for callback: $command")
+ return false
+ } else {
+ recents.startHome()
+ waitForToggleCommandComplete = false
+ return true
+ }
+ }
+
+ /**
+ * Executes the task and returns true if next task can be executed. If false, then the next task
+ * is deferred until [.scheduleNextTask] is called
+ */
+ private fun executeCommand(command: CommandInfo): Boolean {
+ if (waitForToggleCommandComplete && command.type == TYPE_TOGGLE) {
+ Log.d(TAG, "executeCommand: $command - waiting for toggle command complete")
+ return true
+ }
+ val activityInterface: BaseActivityInterface<*, *> =
+ overviewComponentObserver.activityInterface
+
+ val visibleRecentsView: RecentsView<*, *>? =
+ activityInterface.getVisibleRecentsView<RecentsView<*, *>>()
+ val createdRecentsView: RecentsView<*, *>?
+
+ Log.d(TAG, "executeCommand: $command - visibleRecentsView: $visibleRecentsView")
+ if (visibleRecentsView == null) {
+ val activity = activityInterface.getCreatedContainer() as? RecentsViewContainer
+ createdRecentsView = activity?.getOverviewPanel()
+ val deviceProfile = activity?.getDeviceProfile()
+ val uiController = activityInterface.getTaskbarController()
+ val allowQuickSwitch =
+ FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get() &&
+ uiController != null &&
+ deviceProfile != null &&
+ (deviceProfile.isTablet || deviceProfile.isTwoPanels)
+
+ when (command.type) {
+ TYPE_HIDE -> {
+ if (!allowQuickSwitch) return true
+ keyboardTaskFocusIndex = uiController!!.launchFocusedTask()
+ if (keyboardTaskFocusIndex == -1) return true
+ }
+ TYPE_KEYBOARD_INPUT ->
+ if (allowQuickSwitch) {
+ uiController!!.openQuickSwitchView()
+ return true
+ } else {
+ keyboardTaskFocusIndex = 0
+ }
+ TYPE_HOME -> {
+ ActiveGestureLog.INSTANCE.addLog(
+ "OverviewCommandHelper.executeCommand(TYPE_HOME)"
+ )
+ // Although IActivityTaskManager$Stub$Proxy.startActivity is a slow binder call,
+ // we should still call it on main thread because launcher is waiting for
+ // ActivityTaskManager to resume it. Also calling startActivity() on bg thread
+ // could potentially delay resuming launcher. See b/348668521 for more details.
+ touchInteractionService.startActivity(overviewComponentObserver.homeIntent)
+ return true
+ }
+ TYPE_SHOW ->
+ // When Recents is not currently visible, the command's type is
+ // TYPE_SHOW
+ // when overview is triggered via the keyboard overview button or Action+Tab
+ // keys (Not Alt+Tab which is KQS). The overview button on-screen in 3-button
+ // nav is TYPE_TOGGLE.
+ keyboardTaskFocusIndex = 0
+ else -> {}
+ }
+ } else {
+ createdRecentsView = visibleRecentsView
+ when (command.type) {
+ TYPE_SHOW -> return true // already visible
+ TYPE_KEYBOARD_INPUT,
+ TYPE_HIDE -> {
+ if (visibleRecentsView.isHandlingTouch) return true
+
+ keyboardTaskFocusIndex = PagedView.INVALID_PAGE
+ val currentPage = visibleRecentsView.nextPage
+ val taskView = visibleRecentsView.getTaskViewAt(currentPage)
+ return launchTask(visibleRecentsView, taskView, command)
+ }
+ TYPE_TOGGLE ->
+ return launchTask(visibleRecentsView, getNextTask(visibleRecentsView), command)
+ TYPE_HOME -> {
+ visibleRecentsView.startHome()
+ return true
+ }
+ }
+ }
+
+ createdRecentsView?.setKeyboardTaskFocusIndex(keyboardTaskFocusIndex)
+ // Handle recents view focus when launching from home
+ val animatorListener: Animator.AnimatorListener =
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationStart(animation: Animator) {
+ super.onAnimationStart(animation)
+ updateRecentsViewFocus(command)
+ logShowOverviewFrom(command.type)
+ }
+
+ override fun onAnimationEnd(animation: Animator) {
+ Log.d(TAG, "switching to Overview state - onAnimationEnd: $command")
+ super.onAnimationEnd(animation)
+ onRecentsViewFocusUpdated(command)
+ scheduleNextTask(command)
+ }
+ }
+ if (activityInterface.switchToRecentsIfVisible(animatorListener)) {
+ Log.d(TAG, "switching to Overview state - waiting: $command")
+ // If successfully switched, wait until animation finishes
+ return false
+ }
+
+ val activity = activityInterface.getCreatedContainer()
+ if (activity != null) {
+ InteractionJankMonitorWrapper.begin(activity.rootView, Cuj.CUJ_LAUNCHER_QUICK_SWITCH)
+ }
+
+ val gestureState =
+ touchInteractionService.createGestureState(
+ GestureState.DEFAULT_STATE,
+ GestureState.TrackpadGestureType.NONE
+ )
+ gestureState.isHandlingAtomicEvent = true
+ val interactionHandler =
+ touchInteractionService.swipeUpHandlerFactory.newHandler(
+ gestureState,
+ command.createTime
+ )
+ interactionHandler.setGestureEndCallback {
+ onTransitionComplete(command, interactionHandler)
+ }
+ interactionHandler.initWhenReady("OverviewCommandHelper: command.type=${command.type}")
+
+ val recentAnimListener: RecentsAnimationCallbacks.RecentsAnimationListener =
+ object : RecentsAnimationCallbacks.RecentsAnimationListener {
+ override fun onRecentsAnimationStart(
+ controller: RecentsAnimationController,
+ targets: RecentsAnimationTargets
+ ) {
+ updateRecentsViewFocus(command)
+ logShowOverviewFrom(command.type)
+ activityInterface.runOnInitBackgroundStateUI {
+ interactionHandler.onGestureEnded(0f, PointF())
+ }
+ command.removeListener(this)
+ }
+
+ override fun onRecentsAnimationCanceled(
+ thumbnailDatas: HashMap<Int, ThumbnailData>
+ ) {
+ interactionHandler.onGestureCancelled()
+ command.removeListener(this)
+
+ activityInterface.getCreatedContainer() ?: return
+ createdRecentsView?.onRecentsAnimationComplete()
+ }
+ }
+
+ // TODO(b/361768912): Dead code. Remove or update after this bug is fixed.
+ // if (visibleRecentsView != null) {
+ // visibleRecentsView.moveRunningTaskToFront();
+ // }
+
+ if (taskAnimationManager.isRecentsAnimationRunning) {
+ command.setAnimationCallbacks(
+ taskAnimationManager.continueRecentsAnimation(gestureState)
+ )
+ command.addListener(interactionHandler)
+ taskAnimationManager.notifyRecentsAnimationState(interactionHandler)
+ interactionHandler.onGestureStarted(true /*isLikelyToStartNewTask*/)
+
+ command.addListener(recentAnimListener)
+ taskAnimationManager.notifyRecentsAnimationState(recentAnimListener)
+ } else {
+ val intent =
+ Intent(interactionHandler.launchIntent)
+ .putExtra(ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID, gestureState.gestureId)
+ command.setAnimationCallbacks(
+ taskAnimationManager.startRecentsAnimation(gestureState, intent, interactionHandler)
+ )
+ interactionHandler.onGestureStarted(false /*isLikelyToStartNewTask*/)
+ command.addListener(recentAnimListener)
+ }
+ Trace.beginAsyncSection(TRANSITION_NAME, 0)
+ Log.d(TAG, "switching via recents animation - onGestureStarted: $command")
+ return false
+ }
+
+ private fun onTransitionComplete(command: CommandInfo, handler: AbsSwipeUpHandler<*, *, *>) {
+ Log.d(TAG, "switching via recents animation - onTransitionComplete: $command")
+ command.removeListener(handler)
+ Trace.endAsyncSection(TRANSITION_NAME, 0)
+ onRecentsViewFocusUpdated(command)
+ scheduleNextTask(command)
+ }
+
+ private fun updateRecentsViewFocus(command: CommandInfo) {
+ val recentsView: RecentsView<*, *> =
+ overviewComponentObserver.activityInterface.getVisibleRecentsView() ?: return
+ if (
+ command.type != TYPE_KEYBOARD_INPUT &&
+ command.type != TYPE_HIDE &&
+ command.type != TYPE_SHOW
+ ) {
+ return
+ }
+
+ // When the overview is launched via alt tab (command type is TYPE_KEYBOARD_INPUT),
+ // the touch mode somehow is not change to false by the Android framework.
+ // The subsequent tab to go through tasks in overview can only be dispatched to
+ // focuses views, while focus can only be requested in
+ // {@link View#requestFocusNoSearch(int, Rect)} when touch mode is false. To note,
+ // here we launch overview with live tile.
+ recentsView.viewRootImpl.touchModeChanged(false)
+ // Ensure that recents view has focus so that it receives the followup key inputs
+ if (requestFocus(recentsView.getTaskViewAt(keyboardTaskFocusIndex))) return
+ if (requestFocus(recentsView.nextTaskView)) return
+ if (requestFocus(recentsView.getTaskViewAt(0))) return
+ requestFocus(recentsView)
+ }
+
+ private fun onRecentsViewFocusUpdated(command: CommandInfo) {
+ val recentsView: RecentsView<*, *> =
+ overviewComponentObserver.activityInterface.getVisibleRecentsView() ?: return
+ if (command.type != TYPE_HIDE || keyboardTaskFocusIndex == PagedView.INVALID_PAGE) {
+ return
+ }
+ recentsView.setKeyboardTaskFocusIndex(PagedView.INVALID_PAGE)
+ recentsView.currentPage = keyboardTaskFocusIndex
+ keyboardTaskFocusIndex = PagedView.INVALID_PAGE
+ }
+
+ private fun requestFocus(taskView: View?): Boolean {
+ if (taskView == null) return false
+ taskView.post {
+ taskView.requestFocus()
+ taskView.requestAccessibilityFocus()
+ }
+ return true
+ }
+
+ private fun logShowOverviewFrom(commandType: Int) {
+ val activityInterface: BaseActivityInterface<*, *> =
+ overviewComponentObserver.activityInterface
+ val container = activityInterface.getCreatedContainer() as? RecentsViewContainer ?: return
+ val event =
+ when (commandType) {
+ TYPE_SHOW -> LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_SHORTCUT
+ TYPE_HIDE -> LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_QUICK_SWITCH
+ TYPE_TOGGLE -> LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_3_BUTTON
+ else -> return
+ }
+ StatsLogManager.newInstance(container.asContext())
+ .logger()
+ .withContainerInfo(
+ LauncherAtom.ContainerInfo.newBuilder()
+ .setTaskSwitcherContainer(
+ LauncherAtom.TaskSwitcherContainer.getDefaultInstance()
+ )
+ .build()
+ )
+ .log(event)
+ }
+
+ fun dump(pw: PrintWriter) {
+ pw.println("OverviewCommandHelper:")
+ pw.println(" pendingCommands=${pendingCommands.size}")
+ if (pendingCommands.isNotEmpty()) {
+ pw.println(" pendingCommandType=${pendingCommands.first().type}")
+ }
+ pw.println(" mKeyboardTaskFocusIndex=$keyboardTaskFocusIndex")
+ pw.println(" mWaitForToggleCommandComplete=$waitForToggleCommandComplete")
+ }
+
+ private data class CommandInfo(
+ val type: Int,
+ val createTime: Long = SystemClock.elapsedRealtime(),
+ private var animationCallbacks: RecentsAnimationCallbacks? = null
+ ) {
+ fun setAnimationCallbacks(recentsAnimationCallbacks: RecentsAnimationCallbacks) {
+ this.animationCallbacks = recentsAnimationCallbacks
+ }
+
+ fun addListener(listener: RecentsAnimationCallbacks.RecentsAnimationListener) {
+ animationCallbacks?.addListener(listener)
+ }
+
+ fun removeListener(listener: RecentsAnimationCallbacks.RecentsAnimationListener?) {
+ animationCallbacks?.removeListener(listener)
+ }
+ }
+
+ companion object {
+ private const val TAG = "OverviewCommandHelper"
+
+ const val TYPE_SHOW: Int = 1
+ const val TYPE_KEYBOARD_INPUT: Int = 2
+ const val TYPE_HIDE: Int = 3
+ const val TYPE_TOGGLE: Int = 4
+ const val TYPE_HOME: Int = 5
+
+ /**
+ * Use case for needing a queue is double tapping recents button in 3 button nav. Size of 2
+ * should be enough. We'll toss in one more because we're kind hearted.
+ */
+ private const val MAX_QUEUE_SIZE = 3
+
+ private const val TRANSITION_NAME = "Transition:toOverview"
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
index a71e314..ca19480 100644
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -21,6 +21,7 @@
import static android.content.Intent.ACTION_PACKAGE_REMOVED;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.systemui.shared.system.PackageManagerWrapper.ACTION_PREFERRED_ACTIVITY_CHANGED;
import android.content.ActivityNotFoundException;
@@ -36,6 +37,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
import com.android.launcher3.R;
import com.android.launcher3.util.SimpleBroadcastReceiver;
@@ -54,10 +56,11 @@
public final class OverviewComponentObserver {
private static final String TAG = "OverviewComponentObserver";
+ // We register broadcast receivers on main thread to avoid missing updates.
private final SimpleBroadcastReceiver mUserPreferenceChangeReceiver =
- new SimpleBroadcastReceiver(this::updateOverviewTargets);
+ new SimpleBroadcastReceiver(MAIN_EXECUTOR, this::updateOverviewTargets);
private final SimpleBroadcastReceiver mOtherHomeAppUpdateReceiver =
- new SimpleBroadcastReceiver(this::updateOverviewTargets);
+ new SimpleBroadcastReceiver(MAIN_EXECUTOR, this::updateOverviewTargets);
private final Context mContext;
private final RecentsAnimationDeviceState mDeviceState;
@@ -114,6 +117,8 @@
mOverviewChangeListener = overviewChangeListener;
}
+ /** Called on {@link TouchInteractionService#onSystemUiFlagsChanged} */
+ @UiThread
public void onSystemUiStateChanged() {
if (mDeviceState.isHomeDisabled() != mIsHomeDisabled) {
updateOverviewTargets();
@@ -128,6 +133,7 @@
* Update overview intent and {@link BaseActivityInterface} based off the current launcher home
* component.
*/
+ @UiThread
private void updateOverviewTargets() {
ComponentName defaultHome = PackageManagerWrapper.getInstance()
.getHomeActivities(new ArrayList<>());
@@ -187,8 +193,9 @@
unregisterOtherHomeAppUpdateReceiver();
mUpdateRegisteredPackage = defaultHome.getPackageName();
- mOtherHomeAppUpdateReceiver.registerPkgActions(mContext, mUpdateRegisteredPackage,
- ACTION_PACKAGE_ADDED, ACTION_PACKAGE_CHANGED, ACTION_PACKAGE_REMOVED);
+ mOtherHomeAppUpdateReceiver.registerPkgActions(
+ mContext, mUpdateRegisteredPackage, ACTION_PACKAGE_ADDED,
+ ACTION_PACKAGE_CHANGED, ACTION_PACKAGE_REMOVED);
}
}
mOverviewChangeListener.accept(mIsHomeAndOverviewSame);
@@ -198,13 +205,13 @@
* Clean up any registered receivers.
*/
public void onDestroy() {
- mContext.unregisterReceiver(mUserPreferenceChangeReceiver);
+ mUserPreferenceChangeReceiver.unregisterReceiverSafely(mContext);
unregisterOtherHomeAppUpdateReceiver();
}
private void unregisterOtherHomeAppUpdateReceiver() {
if (mUpdateRegisteredPackage != null) {
- mContext.unregisterReceiver(mOtherHomeAppUpdateReceiver);
+ mOtherHomeAppUpdateReceiver.unregisterReceiverSafely(mContext);
mUpdateRegisteredPackage = null;
}
}
@@ -267,6 +274,15 @@
return mActivityInterface;
}
+ /**
+ * Get the current container control helper for managing interactions to the overview activity.
+ *
+ * @return the current container control helper
+ */
+ public BaseContainerInterface<?, ?> getContainerInterface() {
+ return mActivityInterface;
+ }
+
public void dump(PrintWriter pw) {
pw.println("OverviewComponentObserver:");
pw.println(" isDefaultHome=" + mIsDefaultHome);
diff --git a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java
index 3c902e6..f4e68dc 100644
--- a/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java
+++ b/quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java
@@ -66,7 +66,8 @@
if (BuildConfig.IS_STUDIO_BUILD) {
BinderTracker.startTracking(call -> Log.e("BinderCall",
- call.descriptor + " called on mainthread under " + call.activeTrace));
+ call.descriptor + " called on main thread under " + call.activeTrace
+ + " stackTrace: " + call.stackTrace));
}
}
}
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index dfbae65..49b6f57 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -6,7 +6,6 @@
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.Rect;
import android.os.Bundle;
import androidx.annotation.Nullable;
@@ -15,11 +14,11 @@
import com.android.launcher3.testing.TestInformationHandler;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
-import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.util.TISBindHelper;
import com.android.quickstep.views.RecentsView;
+import com.android.quickstep.views.RecentsViewContainer;
import java.util.ArrayList;
import java.util.concurrent.CountDownLatch;
@@ -77,26 +76,20 @@
return response;
}
- case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: {
- if (!mDeviceProfile.isTablet) {
- return null;
- }
- Rect focusedTaskRect = new Rect();
- LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
- focusedTaskRect, RecentsPagedOrientationHandler.PORTRAIT);
- response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height());
- return response;
+ case TestProtocol.REQUEST_GET_OVERVIEW_TASK_SIZE: {
+ return getUIProperty(Bundle::putParcelable,
+ recentsViewContainer ->
+ recentsViewContainer.<RecentsView<?, ?>>getOverviewPanel()
+ .getLastComputedTaskSize(),
+ this::getRecentsViewContainer);
}
- case TestProtocol.REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET: {
- if (!mDeviceProfile.isTablet) {
- return null;
- }
- Rect gridTaskRect = new Rect();
- LauncherActivityInterface.INSTANCE.calculateGridTaskSize(mContext, mDeviceProfile,
- gridTaskRect, RecentsPagedOrientationHandler.PORTRAIT);
- response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, gridTaskRect);
- return response;
+ case TestProtocol.REQUEST_GET_OVERVIEW_GRID_TASK_SIZE: {
+ return getUIProperty(Bundle::putParcelable,
+ recentsViewContainer ->
+ recentsViewContainer.<RecentsView<?, ?>>getOverviewPanel()
+ .getLastComputedGridTaskSize(),
+ this::getRecentsViewContainer);
}
case TestProtocol.REQUEST_GET_OVERVIEW_PAGE_SPACING: {
@@ -198,6 +191,12 @@
.unstashBubbleBarIfStashed();
});
return response;
+ case TestProtocol.REQUEST_INJECT_FAKE_TRACKPAD:
+ runOnTISBinder(tisBinder -> tisBinder.injectFakeTrackpadForTesting());
+ return response;
+ case TestProtocol.REQUEST_EJECT_FAKE_TRACKPAD:
+ runOnTISBinder(tisBinder -> tisBinder.ejectFakeTrackpadForTesting());
+ return response;
}
return super.call(method, arg, extras);
@@ -215,6 +214,17 @@
}
}
+ private RecentsViewContainer getRecentsViewContainer() {
+ RecentsAnimationDeviceState rads = new RecentsAnimationDeviceState(mContext);
+ OverviewComponentObserver observer = new OverviewComponentObserver(mContext, rads);
+ try {
+ return observer.getContainerInterface().getCreatedContainer();
+ } finally {
+ observer.onDestroy();
+ rads.destroy();
+ }
+ }
+
@Override
protected boolean isLauncherInitialized() {
return super.isLauncherInitialized() && TouchInteractionService.isInitialized();
diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java
index 711882c..05bef35 100644
--- a/quickstep/src/com/android/quickstep/RecentTasksList.java
+++ b/quickstep/src/com/android/quickstep/RecentTasksList.java
@@ -20,17 +20,18 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.util.SplitScreenUtils.convertShellSplitBoundsToLauncher;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-import static com.android.wm.shell.util.GroupedRecentTaskInfo.TYPE_FREEFORM;
+import static com.android.wm.shell.shared.GroupedRecentTaskInfo.TYPE_FREEFORM;
import android.app.ActivityManager;
import android.app.KeyguardManager;
import android.app.TaskInfo;
import android.content.ComponentName;
+import android.content.Context;
import android.os.Process;
import android.os.RemoteException;
import android.util.SparseBooleanArray;
+import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.util.LooperExecutor;
@@ -39,11 +40,14 @@
import com.android.quickstep.util.GroupTask;
import com.android.systemui.shared.recents.model.Task;
import com.android.wm.shell.recents.IRecentTasksListener;
-import com.android.wm.shell.util.GroupedRecentTaskInfo;
+import com.android.wm.shell.shared.GroupedRecentTaskInfo;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -55,6 +59,7 @@
private static final TaskLoadResult INVALID_RESULT = new TaskLoadResult(-1, false, 0);
+ private final Context mContext;
private final KeyguardManager mKeyguardManager;
private final LooperExecutor mMainThreadExecutor;
private final SystemUiProxy mSysUiProxy;
@@ -68,12 +73,15 @@
private TaskLoadResult mResultsBg = INVALID_RESULT;
private TaskLoadResult mResultsUi = INVALID_RESULT;
- private RecentsModel.RunningTasksListener mRunningTasksListener;
+ private @Nullable RecentsModel.RunningTasksListener mRunningTasksListener;
+ private @Nullable RecentsModel.RecentTasksChangedListener mRecentTasksChangedListener;
// Tasks are stored in order of least recently launched to most recently launched.
private ArrayList<ActivityManager.RunningTaskInfo> mRunningTasks;
- public RecentTasksList(LooperExecutor mainThreadExecutor, KeyguardManager keyguardManager,
- SystemUiProxy sysUiProxy) {
+ public RecentTasksList(Context context, LooperExecutor mainThreadExecutor,
+ KeyguardManager keyguardManager, SystemUiProxy sysUiProxy,
+ TopTaskTracker topTaskTracker) {
+ mContext = context;
mMainThreadExecutor = mainThreadExecutor;
mKeyguardManager = keyguardManager;
mChangeId = 1;
@@ -104,6 +112,13 @@
RecentTasksList.this.onRunningTaskChanged(taskInfo);
});
}
+
+ @Override
+ public void onTaskMovedToFront(ActivityManager.RunningTaskInfo taskInfo) {
+ mMainThreadExecutor.execute(() -> {
+ topTaskTracker.onTaskMovedToFront(taskInfo);
+ });
+ }
});
// We may receive onRunningTaskAppeared events later for tasks which have already been
// included in the list returned by mSysUiProxy.getRunningTasks(), or may receive
@@ -133,11 +148,11 @@
* Asynchronously fetches the list of recent tasks, reusing cached list if available.
*
* @param loadKeysOnly Whether to load other associated task data, or just the key
- * @param callback The callback to receive the list of recent tasks
+ * @param callback The callback to receive the list of recent tasks
* @return The change id of the current task list
*/
public synchronized int getTasks(boolean loadKeysOnly,
- Consumer<ArrayList<GroupTask>> callback, Predicate<GroupTask> filter) {
+ @Nullable Consumer<List<GroupTask>> callback, Predicate<GroupTask> filter) {
final int requestLoadId = mChangeId;
if (mResultsUi.isValidForRequest(requestLoadId, loadKeysOnly)) {
// The list is up to date, send the callback on the next frame,
@@ -190,6 +205,9 @@
public void onRecentTasksChanged() {
invalidateLoadedTasks();
+ if (mRecentTasksChangedListener != null) {
+ mRecentTasksChangedListener.onRecentTasksChanged();
+ }
}
private synchronized void invalidateLoadedTasks() {
@@ -198,7 +216,7 @@
mChangeId++;
}
- /**
+ /**
* Registers a listener for running tasks
*/
public void registerRunningTasksListener(RecentsModel.RunningTasksListener listener) {
@@ -212,6 +230,21 @@
mRunningTasksListener = null;
}
+ /**
+ * Registers a listener for running tasks
+ */
+ public void registerRecentTasksChangedListener(
+ RecentsModel.RecentTasksChangedListener listener) {
+ mRecentTasksChangedListener = listener;
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRecentTasksChangedListener() {
+ mRecentTasksChangedListener = null;
+ }
+
private void initRunningTasks(ArrayList<ActivityManager.RunningTaskInfo> runningTasks) {
// Tasks are retrieved in order of most recently launched/used to least recently launched.
mRunningTasks = new ArrayList<>(runningTasks);
@@ -271,8 +304,12 @@
@VisibleForTesting
TaskLoadResult loadTasksInBackground(int numTasks, int requestId, boolean loadKeysOnly) {
int currentUserId = Process.myUserHandle().getIdentifier();
- ArrayList<GroupedRecentTaskInfo> rawTasks =
- mSysUiProxy.getRecentTasks(numTasks, currentUserId);
+ ArrayList<GroupedRecentTaskInfo> rawTasks;
+ try {
+ rawTasks = mSysUiProxy.getRecentTasks(numTasks, currentUserId);
+ } catch (SystemUiProxy.GetRecentTasksException e) {
+ return INVALID_RESULT;
+ }
// The raw tasks are given in most-recent to least-recent order, we need to reverse it
Collections.reverse(rawTasks);
@@ -292,11 +329,13 @@
int numVisibleTasks = 0;
for (GroupedRecentTaskInfo rawTask : rawTasks) {
if (rawTask.getType() == TYPE_FREEFORM) {
- // TYPE_FREEFORM tasks is only created when enableDesktopWindowingMode() is true,
+ // TYPE_FREEFORM tasks is only created when desktop mode can be entered,
// leftover TYPE_FREEFORM tasks created when flag was on should be ignored.
- if (enableDesktopWindowingMode()) {
+ if (DesktopModeStatus.canEnterDesktopMode(mContext)) {
GroupTask desktopTask = createDesktopTask(rawTask);
- allTasks.add(desktopTask);
+ if (desktopTask != null) {
+ allTasks.add(desktopTask);
+ }
}
continue;
}
@@ -340,14 +379,22 @@
return allTasks;
}
- private DesktopTask createDesktopTask(GroupedRecentTaskInfo recentTaskInfo) {
+ private @Nullable DesktopTask createDesktopTask(GroupedRecentTaskInfo recentTaskInfo) {
ArrayList<Task> tasks = new ArrayList<>(recentTaskInfo.getTaskInfoList().size());
+ int[] minimizedTaskIds = recentTaskInfo.getMinimizedTaskIds();
+ if (minimizedTaskIds.length == recentTaskInfo.getTaskInfoList().size()) {
+ // All Tasks are minimized -> don't create a DesktopTask
+ return null;
+ }
for (ActivityManager.RecentTaskInfo taskInfo : recentTaskInfo.getTaskInfoList()) {
Task.TaskKey key = new Task.TaskKey(taskInfo);
Task task = Task.from(key, taskInfo, false);
task.setLastSnapshotData(taskInfo);
task.positionInParent = taskInfo.positionInParent;
task.appBounds = taskInfo.configuration.windowConfiguration.getAppBounds();
+ task.isVisible = taskInfo.isVisible;
+ task.isMinimized =
+ Arrays.stream(minimizedTaskIds).anyMatch(taskId -> taskId == taskInfo.taskId);
tasks.add(task);
}
return new DesktopTask(tasks);
@@ -377,8 +424,12 @@
}
writer.println(prefix + " ]");
int currentUserId = Process.myUserHandle().getIdentifier();
- ArrayList<GroupedRecentTaskInfo> rawTasks =
- mSysUiProxy.getRecentTasks(Integer.MAX_VALUE, currentUserId);
+ ArrayList<GroupedRecentTaskInfo> rawTasks;
+ try {
+ rawTasks = mSysUiProxy.getRecentTasks(Integer.MAX_VALUE, currentUserId);
+ } catch (SystemUiProxy.GetRecentTasksException e) {
+ rawTasks = new ArrayList<>();
+ }
writer.println(prefix + " rawTasks=[");
for (GroupedRecentTaskInfo task : rawTasks) {
TaskInfo taskInfo1 = task.getTaskInfo1();
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index f57f4c8..6d5cb4b 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -27,13 +27,11 @@
import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely;
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
import static com.android.quickstep.TaskViewUtils.createRecentsWindowAnimator;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.app.ActivityOptions;
-import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
@@ -58,6 +56,7 @@
import com.android.launcher3.LauncherAnimationRunner;
import com.android.launcher3.LauncherAnimationRunner.AnimationResult;
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
+import com.android.launcher3.LauncherRootView;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
@@ -88,6 +87,7 @@
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
import com.android.quickstep.views.TaskView;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -116,7 +116,7 @@
private TISBindHelper mTISBindHelper;
private @Nullable FallbackTaskbarUIController mTaskbarUIController;
- private StateManager<RecentsState> mStateManager;
+ private StateManager<RecentsState, RecentsActivity> mStateManager;
// Strong refs to runners which are cleared when the activity is destroyed
private RemoteAnimationFactory mActivityLaunchAnimationRunner;
@@ -133,21 +133,22 @@
* Init drag layer and overview panel views.
*/
protected void setupViews() {
- inflateRootView(R.layout.fallback_recents_activity);
- setContentView(getRootView());
- mDragLayer = findViewById(R.id.drag_layer);
- mScrimView = findViewById(R.id.scrim_view);
- mFallbackRecentsView = findViewById(R.id.overview_panel);
- mActionsView = findViewById(R.id.overview_actions_view);
- getRootView().getSysUiScrim().getSysUIProgress().updateValue(0);
SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this);
+ // SplitSelectStateController needs to be created before setContentView()
mSplitSelectStateController =
new SplitSelectStateController(this, mHandler, getStateManager(),
null /* depthController */, getStatsLogManager(),
systemUiProxy, RecentsModel.INSTANCE.get(this),
null /*activityBackCallback*/);
- mDragLayer.recreateControllers();
- if (enableDesktopWindowingMode()) {
+ // Setup root and child views
+ inflateRootView(R.layout.fallback_recents_activity);
+ LauncherRootView rootView = getRootView();
+ mDragLayer = rootView.findViewById(R.id.drag_layer);
+ mScrimView = rootView.findViewById(R.id.scrim_view);
+ mFallbackRecentsView = rootView.findViewById(R.id.overview_panel);
+ mActionsView = rootView.findViewById(R.id.overview_actions_view);
+
+ if (DesktopModeStatus.canEnterDesktopMode(this)) {
mDesktopRecentsTransitionController = new DesktopRecentsTransitionController(
getStateManager(), systemUiProxy, getIApplicationThread(),
null /* depthController */
@@ -156,6 +157,10 @@
mFallbackRecentsView.init(mActionsView, mSplitSelectStateController,
mDesktopRecentsTransitionController);
+ setContentView(rootView);
+ rootView.getSysUiScrim().getSysUIProgress().updateValue(0);
+ mDragLayer.recreateControllers();
+
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
}
@@ -372,6 +377,9 @@
getSystemUiController().updateUiState(SystemUiController.UI_STATE_BASE_WINDOW,
Themes.getAttrBoolean(this, R.attr.isWorkspaceDarkText));
ACTIVITY_TRACKER.handleCreate(this);
+
+ // Set screen title for Talkback
+ setTitle(R.string.accessibility_recent_apps);
}
@Override
@@ -384,6 +392,11 @@
}
}
+ @Override
+ public boolean shouldAnimateStateChange() {
+ return false;
+ }
+
/**
* Initialize/update the device profile.
*/
@@ -460,12 +473,12 @@
};
@Override
- protected void collectStateHandlers(List<StateHandler> out) {
+ public void collectStateHandlers(List<StateHandler<RecentsState>> out) {
out.add(new FallbackRecentsStateController(this));
}
@Override
- public StateManager<RecentsState> getStateManager() {
+ public StateManager<RecentsState, RecentsActivity> getStateManager() {
return mStateManager;
}
@@ -507,4 +520,9 @@
public TISBindHelper getTISBindHelper() {
return mTISBindHelper;
}
+
+ @Override
+ public boolean isRecentsViewVisible() {
+ return getStateManager().getState().isRecentsViewVisible();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
index da7a98f..32e2389 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
@@ -128,15 +128,11 @@
mController::finishAnimationToApp);
} else {
RemoteAnimationTarget[] nonAppTargets;
- if (!TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
- nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(appTargets);
- } else {
- final ArrayList<RemoteAnimationTarget> apps = new ArrayList<>();
- final ArrayList<RemoteAnimationTarget> nonApps = new ArrayList<>();
- classifyTargets(appTargets, apps, nonApps);
- appTargets = apps.toArray(new RemoteAnimationTarget[apps.size()]);
- nonAppTargets = nonApps.toArray(new RemoteAnimationTarget[nonApps.size()]);
- }
+ final ArrayList<RemoteAnimationTarget> apps = new ArrayList<>();
+ final ArrayList<RemoteAnimationTarget> nonApps = new ArrayList<>();
+ classifyTargets(appTargets, apps, nonApps);
+ appTargets = apps.toArray(new RemoteAnimationTarget[apps.size()]);
+ nonAppTargets = nonApps.toArray(new RemoteAnimationTarget[nonApps.size()]);
if (nonAppTargets == null) {
nonAppTargets = new RemoteAnimationTarget[0];
}
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index 4b4f914..5131774 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -33,6 +33,8 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DREAMING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DIALOG_SHOWING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_PIP_ANIMATING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_MAGNIFICATION_OVERLAP;
@@ -44,6 +46,7 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TOUCHPAD_GESTURES_DISABLED;
import android.app.ActivityTaskManager;
import android.content.Context;
@@ -71,6 +74,7 @@
import com.android.quickstep.util.GestureExclusionManager;
import com.android.quickstep.util.GestureExclusionManager.ExclusionListener;
import com.android.quickstep.util.NavBarPosition;
+import com.android.systemui.shared.Flags;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
@@ -107,7 +111,7 @@
private final ArrayList<Runnable> mOnDestroyActions = new ArrayList<>();
- private @SystemUiStateFlags int mSystemUiStateFlags = QuickStepContract.SYSUI_STATE_AWAKE;
+ private @SystemUiStateFlags long mSystemUiStateFlags = QuickStepContract.SYSUI_STATE_AWAKE;
private NavigationMode mMode = THREE_BUTTONS;
private NavBarPosition mNavBarPosition;
@@ -299,6 +303,10 @@
return mNavBarPosition;
}
+ public NavigationMode getMode() {
+ return mMode;
+ }
+
/**
* @return whether the current nav mode is fully gestural.
*/
@@ -351,7 +359,7 @@
/**
* Updates the system ui state flags from SystemUI.
*/
- public void setSystemUiFlags(int stateFlags) {
+ public void setSystemUiFlags(@SystemUiStateFlags long stateFlags) {
mSystemUiStateFlags = stateFlags;
}
@@ -359,7 +367,8 @@
* @return the system ui state flags.
*/
// TODO(141886704): See if we can remove this
- public int getSystemUiStateFlags() {
+ @SystemUiStateFlags
+ public long getSystemUiStateFlags() {
return mSystemUiStateFlags;
}
@@ -384,7 +393,7 @@
boolean canStartWithNavHidden = (mSystemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) == 0
|| (mSystemUiStateFlags & SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY) != 0
|| mRotationTouchHelper.isTaskListFrozen();
- return canStartWithNavHidden && canStartTrackpadGesture();
+ return canStartWithNavHidden && canStartAnyGesture();
}
/**
@@ -393,13 +402,25 @@
* mode.
*/
public boolean canStartTrackpadGesture() {
- return (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0
- && (mSystemUiStateFlags & SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING) == 0
- && (mSystemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) == 0
- && (mSystemUiStateFlags & SYSUI_STATE_MAGNIFICATION_OVERLAP) == 0
- && ((mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0
- || (mSystemUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0)
- && (mSystemUiStateFlags & SYSUI_STATE_DEVICE_DREAMING) == 0;
+ boolean trackpadGesturesEnabled =
+ (mSystemUiStateFlags & SYSUI_STATE_TOUCHPAD_GESTURES_DISABLED) == 0;
+ return trackpadGesturesEnabled && canStartAnyGesture();
+ }
+
+ /**
+ * Common logic to determine if either trackpad or finger gesture can be started
+ */
+ private boolean canStartAnyGesture() {
+ boolean homeOrOverviewEnabled = (mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0
+ || (mSystemUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0;
+ long gestureDisablingStates = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
+ | SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
+ | SYSUI_STATE_QUICK_SETTINGS_EXPANDED
+ | SYSUI_STATE_MAGNIFICATION_OVERLAP
+ | SYSUI_STATE_DEVICE_DREAMING
+ | SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION
+ | SYSUI_STATE_DISABLE_GESTURE_PIP_ANIMATING;
+ return (gestureDisablingStates & mSystemUiStateFlags) == 0 && homeOrOverviewEnabled;
}
/**
@@ -528,6 +549,13 @@
}
/**
+ * @return whether the Assistant gesture can be used in 3 button navigation mode.
+ */
+ public boolean supportsAssistantGestureInButtonNav() {
+ return Flags.threeButtonCornerSwipe();
+ }
+
+ /**
* @param ev An ACTION_DOWN motion event
* @return whether the given motion event can trigger the assistant over the current task.
*/
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java
index 82bb453..cf7e499 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java
@@ -18,13 +18,14 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-
import android.app.WindowConfiguration;
+import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.RemoteAnimationTarget;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
+
import java.io.PrintWriter;
/**
@@ -54,8 +55,8 @@
*
* @return {@code true} if at least one target app is a desktop task
*/
- public boolean hasDesktopTasks() {
- if (!enableDesktopWindowingMode()) {
+ public boolean hasDesktopTasks(Context context) {
+ if (!DesktopModeStatus.canEnterDesktopMode(context)) {
return false;
}
for (RemoteAnimationTarget target : apps) {
diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java
index 89351aa..a01ceb2 100644
--- a/quickstep/src/com/android/quickstep/RecentsModel.java
+++ b/quickstep/src/com/android/quickstep/RecentsModel.java
@@ -18,6 +18,7 @@
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static com.android.launcher3.Flags.enableGridOnlyOverview;
+import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
@@ -33,6 +34,7 @@
import android.os.Process;
import android.os.UserHandle;
+import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.icons.IconProvider;
@@ -40,6 +42,9 @@
import com.android.launcher3.util.Executors.SimpleThreadFactory;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.SafeCloseable;
+import com.android.quickstep.recents.data.RecentTasksDataSource;
+import com.android.quickstep.recents.data.TaskVisualsChangeNotifier;
+import com.android.quickstep.util.DesktopTask;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.TaskVisualsChangeListener;
import com.android.systemui.shared.recents.model.Task;
@@ -60,8 +65,9 @@
* Singleton class to load and manage recents model.
*/
@TargetApi(Build.VERSION_CODES.O)
-public class RecentsModel implements IconChangeListener, TaskStackChangeListener,
- TaskVisualsChangeListener, SafeCloseable {
+public class RecentsModel implements RecentTasksDataSource, IconChangeListener,
+ TaskStackChangeListener, TaskVisualsChangeListener, TaskVisualsChangeNotifier,
+ SafeCloseable {
// We do not need any synchronization for this variable as its only written on UI thread.
public static final MainThreadInitializedObject<RecentsModel> INSTANCE =
@@ -86,9 +92,12 @@
private RecentsModel(Context context, IconProvider iconProvider) {
this(context,
- new RecentTasksList(MAIN_EXECUTOR,
+ new RecentTasksList(
+ context,
+ MAIN_EXECUTOR,
context.getSystemService(KeyguardManager.class),
- SystemUiProxy.INSTANCE.get(context)),
+ SystemUiProxy.INSTANCE.get(context),
+ TopTaskTracker.INSTANCE.get(context)),
new TaskIconCache(context, RECENTS_MODEL_EXECUTOR, iconProvider),
new TaskThumbnailCache(context, RECENTS_MODEL_EXECUTOR),
iconProvider,
@@ -104,7 +113,7 @@
mIconCache = iconCache;
mIconCache.registerTaskVisualsChangeListener(this);
mThumbnailCache = thumbnailCache;
- if (enableGridOnlyOverview()) {
+ if (isCachePreloadingEnabled()) {
mCallbacks = new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
@@ -141,7 +150,8 @@
* always called on the UI thread.
* @return the request id associated with this call.
*/
- public int getTasks(Consumer<ArrayList<GroupTask>> callback) {
+ @Override
+ public int getTasks(@Nullable Consumer<List<GroupTask>> callback) {
return mTaskList.getTasks(false /* loadKeysOnly */, callback,
RecentsFilterState.DEFAULT_FILTER);
}
@@ -155,7 +165,7 @@
* callback.
* @return the request id associated with this call.
*/
- public int getTasks(Consumer<ArrayList<GroupTask>> callback, Predicate<GroupTask> filter) {
+ public int getTasks(@Nullable Consumer<List<GroupTask>> callback, Predicate<GroupTask> filter) {
return mTaskList.getTasks(false /* loadKeysOnly */, callback, filter);
}
@@ -279,6 +289,7 @@
/**
* Adds a listener for visuals changes
*/
+ @Override
public void addThumbnailChangeListener(TaskVisualsChangeListener listener) {
mThumbnailChangeListeners.add(listener);
}
@@ -286,6 +297,7 @@
/**
* Removes a previously added listener
*/
+ @Override
public void removeThumbnailChangeListener(TaskVisualsChangeListener listener) {
mThumbnailChangeListeners.remove(listener);
}
@@ -297,6 +309,8 @@
/**
* Registers a listener for running tasks
+ * TODO(b/343292503): Should we remove RunningTasksListener entirely if it's not needed?
+ * (Note that Desktop mode gets the running tasks by checking {@link DesktopTask#tasks}
*/
public void registerRunningTasksListener(RunningTasksListener listener) {
mTaskList.registerRunningTasksListener(listener);
@@ -310,6 +324,20 @@
}
/**
+ * Registers a listener for recent tasks
+ */
+ public void registerRecentTasksChangedListener(RecentTasksChangedListener listener) {
+ mTaskList.registerRecentTasksChangedListener(listener);
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRecentTasksChangedListener() {
+ mTaskList.unregisterRecentTasksChangedListener();
+ }
+
+ /**
* Gets the set of running tasks.
*/
public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks() {
@@ -321,7 +349,7 @@
* highResLoadingState is enabled
*/
public void preloadCacheIfNeeded() {
- if (!enableGridOnlyOverview()) {
+ if (!isCachePreloadingEnabled()) {
return;
}
@@ -347,7 +375,7 @@
* Updates cache size and preloads more tasks if cache size increases
*/
public void updateCacheSizeAndPreloadIfNeeded() {
- if (!enableGridOnlyOverview()) {
+ if (!isCachePreloadingEnabled()) {
return;
}
@@ -366,6 +394,10 @@
mTaskStackChangeListeners.unregisterTaskStackListener(this);
}
+ private boolean isCachePreloadingEnabled() {
+ return enableGridOnlyOverview() || enableRefactorTaskThumbnail();
+ }
+
/**
* Listener for receiving running tasks changes
*/
@@ -375,4 +407,14 @@
*/
void onRunningTasksChanged();
}
+
+ /**
+ * Listener for receiving recent tasks changes
+ */
+ public interface RecentTasksChangedListener {
+ /**
+ * Called when there's a change to recent tasks
+ */
+ void onRecentTasksChanged();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
index 3dec381..1be60de 100644
--- a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
+++ b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
@@ -17,7 +17,7 @@
package com.android.quickstep;
import static com.android.quickstep.util.SplitScreenUtils.convertShellSplitBoundsToLauncher;
-import static com.android.wm.shell.util.SplitBounds.KEY_EXTRA_SPLIT_BOUNDS;
+import static com.android.wm.shell.shared.split.SplitBounds.KEY_EXTRA_SPLIT_BOUNDS;
import android.app.WindowConfiguration;
import android.content.Context;
@@ -33,7 +33,7 @@
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
-import com.android.wm.shell.util.SplitBounds;
+import com.android.wm.shell.shared.split.SplitBounds;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
index 3380291..80c07196 100644
--- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java
+++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
@@ -41,6 +41,7 @@
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SafeCloseable;
import com.android.quickstep.util.RecentsOrientedState;
+import com.android.systemui.shared.Flags;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -157,7 +158,7 @@
// Register for navigation mode changes
mDisplayController.addChangeListener(this);
DisplayController.Info info = mDisplayController.getInfo();
- onDisplayInfoChangedInternal(info, CHANGE_ALL, info.navigationMode.hasGestures);
+ onDisplayInfoChangedInternal(info, CHANGE_ALL, hasGestures(info.getNavigationMode()));
runOnDestroy(() -> mDisplayController.removeChangeListener(this));
mOrientationListener = new OrientationEventListener(mContext) {
@@ -229,7 +230,7 @@
* Updates the regions for detecting the swipe up/quickswitch and assistant gestures.
*/
public void updateGestureTouchRegions() {
- if (!mMode.hasGestures) {
+ if (!hasGestures(mMode)) {
return;
}
@@ -268,7 +269,7 @@
| CHANGE_SUPPORTED_BOUNDS)) != 0) {
mDisplayRotation = info.rotation;
- if (mMode.hasGestures) {
+ if (hasGestures(mMode)) {
updateGestureTouchRegions();
mOrientationTouchTransformer.createOrAddTouchRegion(info);
mCurrentAppRotation = mDisplayRotation;
@@ -291,13 +292,13 @@
}
if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
- NavigationMode newMode = info.navigationMode;
+ NavigationMode newMode = info.getNavigationMode();
mOrientationTouchTransformer.setNavigationMode(newMode, mDisplayController.getInfo(),
mContext.getResources());
- if (forceRegister || (!mMode.hasGestures && newMode.hasGestures)) {
+ if (forceRegister || (!hasGestures(mMode) && hasGestures(newMode))) {
setupOrientationSwipeHandler();
- } else if (mMode.hasGestures && !newMode.hasGestures) {
+ } else if (hasGestures(mMode) && !hasGestures(newMode)) {
destroyOrientationSwipeHandlerCallback();
}
@@ -399,7 +400,7 @@
}
public int getCurrentActiveRotation() {
- if (!mMode.hasGestures) {
+ if (!hasGestures(mMode)) {
// touch rotation should always match that of display for 3 button
return mDisplayRotation;
}
@@ -416,4 +417,8 @@
public OrientationTouchTransformer getOrientationTouchTransformer() {
return mOrientationTouchTransformer;
}
+
+ private boolean hasGestures(NavigationMode mode) {
+ return mode.hasGestures || (mode == THREE_BUTTONS && Flags.threeButtonCornerSwipe());
+ }
}
diff --git a/quickstep/src/com/android/quickstep/SimpleOrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/SimpleOrientationTouchTransformer.java
index 29a57fc..5264643 100644
--- a/quickstep/src/com/android/quickstep/SimpleOrientationTouchTransformer.java
+++ b/quickstep/src/com/android/quickstep/SimpleOrientationTouchTransformer.java
@@ -34,12 +34,18 @@
private final Context mContext;
private OrientationRectF mOrientationRectF;
+ private OrientationRectF mTouchingOrientationRectF;
+ private int mViewRotation;
public SimpleOrientationTouchTransformer(Context context) {
+ this(context, DisplayController.INSTANCE.get(context));
+ }
+
+ @androidx.annotation.VisibleForTesting
+ public SimpleOrientationTouchTransformer(Context context, DisplayController displayController) {
mContext = context;
- DisplayController.INSTANCE.get(context).addChangeListener(this);
- onDisplayInfoChanged(context, DisplayController.INSTANCE.get(context).getInfo(),
- CHANGE_ALL);
+ displayController.addChangeListener(this);
+ onDisplayInfoChanged(context, displayController.getInfo(), CHANGE_ALL);
}
@Override
@@ -56,7 +62,29 @@
info.rotation);
}
+ /**
+ * Called when the touch is started. This preserves the touching orientation until the touch is
+ * done (i.e. ACTION_CANCEL or ACTION_UP). So the transform won't produce inconsistent position
+ * if display is changed during the touch.
+ */
+ public void updateTouchingOrientation(int viewRotation) {
+ mViewRotation = viewRotation;
+ mTouchingOrientationRectF = new OrientationRectF(mOrientationRectF.left,
+ mOrientationRectF.top, mOrientationRectF.right, mOrientationRectF.bottom,
+ mOrientationRectF.getRotation());
+ }
+
+ /** Called when the touch is finished. */
+ public void clearTouchingOrientation() {
+ mTouchingOrientationRectF = null;
+ }
+
public void transform(MotionEvent ev, int rotation) {
+ if (mTouchingOrientationRectF != null) {
+ mTouchingOrientationRectF.applyTransformToRotation(ev, mViewRotation,
+ true /* forceTransform */);
+ return;
+ }
mOrientationRectF.applyTransformToRotation(ev, rotation, true /* forceTransform */);
}
}
diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
index 5ff9787..f813d9a 100644
--- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
+++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
@@ -17,6 +17,8 @@
import static com.android.app.animation.Interpolators.ACCELERATE_1_5;
import static com.android.app.animation.Interpolators.LINEAR;
+import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
+import static com.android.launcher3.PagedView.INVALID_PAGE;
import android.animation.Animator;
import android.content.Context;
@@ -24,9 +26,11 @@
import android.graphics.Matrix.ScaleToFit;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.util.Log;
import android.view.RemoteAnimationTarget;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
@@ -36,6 +40,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.views.ClipIconView;
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.util.AnimatorControllerWithResistance;
@@ -46,6 +51,8 @@
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.util.TransformParams.BuilderProxy;
+import com.android.quickstep.views.RecentsView;
+import com.android.quickstep.views.TaskView;
import java.util.Arrays;
import java.util.function.Consumer;
@@ -201,7 +208,7 @@
public void setAnimation(RectFSpringAnim anim) { }
- public void update(RectF currentRect, float progress, float radius) { }
+ public void update(RectF currentRect, float progress, float radius, int overlayAlpha) { }
public void onCancel() { }
@@ -222,6 +229,33 @@
}
return Utilities.mapToRange(progress, start, end, 1, 0, ACCELERATE_1_5);
}
+
+ /**
+ * Sets a {@link com.android.launcher3.views.ClipIconView.TaskViewArtist} that should be
+ * used draw a {@link TaskView} during this home animation.
+ */
+ public void setTaskViewArtist(ClipIconView.TaskViewArtist taskViewArtist) { }
+
+ public boolean isAnimationReady() {
+ return true;
+ }
+
+ public boolean isAnimatingIntoIcon() {
+ return false;
+ }
+
+ @Nullable
+ public TaskView getTargetTaskView() {
+ return null;
+ }
+
+ public boolean isRtl() {
+ return Utilities.isRtl(mContext.getResources());
+ }
+
+ public boolean isPortrait() {
+ return !mDp.isLandscape && !mDp.isSeascape();
+ }
}
/**
@@ -276,9 +310,13 @@
for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length;
i < mRemoteTargetHandlesLength; i++) {
RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
- out[i] = getWindowAnimationToHomeInternal(homeAnimationFactory,
- targetRect, remoteHandle.getTransformParams(),
- remoteHandle.getTaskViewSimulator(), startRects[i], homeToWindowPositionMap[i]);
+ out[i] = getWindowAnimationToHomeInternal(
+ homeAnimationFactory,
+ targetRect,
+ remoteHandle.getTransformParams(),
+ remoteHandle.getTaskViewSimulator(),
+ startRects[i],
+ homeToWindowPositionMap[i]);
}
return out;
}
@@ -288,21 +326,39 @@
}
private RectFSpringAnim getWindowAnimationToHomeInternal(
- HomeAnimationFactory homeAnimationFactory, RectF targetRect,
- TransformParams transformParams, TaskViewSimulator taskViewSimulator,
- RectF startRect, Matrix homeToWindowPositionMap) {
+ HomeAnimationFactory homeAnimationFactory,
+ RectF targetRect,
+ TransformParams transformParams,
+ TaskViewSimulator taskViewSimulator,
+ RectF startRect,
+ Matrix homeToWindowPositionMap) {
RectF cropRectF = new RectF(taskViewSimulator.getCurrentCropRect());
// Move the startRect to Launcher space as floatingIconView runs in Launcher
Matrix windowToHomePositionMap = new Matrix();
- // If the start rect ends up overshooting too much to the left/right offscreen, bring it
- // back to fullscreen. This can happen when the recentsScroll value isn't aligned with
- // the pageScroll value for a given taskView, see b/228829958#comment12
- mRemoteTargetHandles[0].getTaskViewSimulator().getOrientationState().getOrientationHandler()
- .fixBoundsForHomeAnimStartRect(startRect, mDp);
+ TaskView targetTaskView = homeAnimationFactory.getTargetTaskView();
+ if (targetTaskView == null) {
+ // If the start rect ends up overshooting too much to the left/right offscreen, bring it
+ // back to fullscreen. This can happen when the recentsScroll value isn't aligned with
+ // the pageScroll value for a given taskView, see b/228829958#comment12
+ mRemoteTargetHandles[0].getTaskViewSimulator()
+ .getOrientationState()
+ .getOrientationHandler()
+ .fixBoundsForHomeAnimStartRect(startRect, mDp);
+ }
homeToWindowPositionMap.invert(windowToHomePositionMap);
windowToHomePositionMap.mapRect(startRect);
+ RectF invariantStartRect = new RectF(startRect);
+
+ if (targetTaskView != null) {
+ Rect thumbnailBounds = new Rect();
+ targetTaskView.getThumbnailBounds(thumbnailBounds, /* relativeToDragLayer= */ true);
+
+ invariantStartRect = new RectF(thumbnailBounds);
+ invariantStartRect.offsetTo(startRect.left, thumbnailBounds.top);
+ startRect = new RectF(thumbnailBounds);
+ }
boolean useTaskbarHotseatParams = mDp.isTaskbarPresent
&& homeAnimationFactory.isInHotseat();
@@ -312,8 +368,12 @@
homeAnimationFactory.setAnimation(anim);
SpringAnimationRunner runner = new SpringAnimationRunner(
- homeAnimationFactory, cropRectF, homeToWindowPositionMap,
- transformParams, taskViewSimulator);
+ homeAnimationFactory,
+ cropRectF,
+ homeToWindowPositionMap,
+ transformParams,
+ taskViewSimulator,
+ invariantStartRect);
anim.addAnimatorListener(runner);
anim.addOnUpdateListener(runner);
return anim;
@@ -322,6 +382,8 @@
protected class SpringAnimationRunner extends AnimationSuccessListener
implements RectFSpringAnim.OnUpdateListener, BuilderProxy {
+ private static final String TAG = "SpringAnimationRunner";
+
final Rect mCropRect = new Rect();
final Matrix mMatrix = new Matrix();
@@ -336,9 +398,30 @@
final float mStartRadius;
final float mEndRadius;
- SpringAnimationRunner(HomeAnimationFactory factory, RectF cropRectF,
- Matrix homeToWindowPositionMap, TransformParams transformParams,
- TaskViewSimulator taskViewSimulator) {
+ final RectF mRunningTaskViewStartRectF;
+ @Nullable
+ final TaskView mTargetTaskView;
+ final float mRunningTaskViewScrollOffset;
+ final float mTaskViewWidth;
+ final float mTaskViewHeight;
+ final boolean mIsPortrait;
+ final Rect mThumbnailStartBounds = new Rect();
+
+ // Store the mTargetTaskView view properties onAnimationStart so that we can reset them
+ // when cleaning up.
+ float mTaskViewAlpha;
+ float mTaskViewTranslationX;
+ float mTaskViewTranslationY;
+ float mTaskViewScaleX;
+ float mTaskViewScaleY;
+
+ SpringAnimationRunner(
+ HomeAnimationFactory factory,
+ RectF cropRectF,
+ Matrix homeToWindowPositionMap,
+ TransformParams transformParams,
+ TaskViewSimulator taskViewSimulator,
+ RectF invariantStartRect) {
mAnimationFactory = factory;
mHomeAnim = factory.createActivityAnimationToHome();
mCropRectF = cropRectF;
@@ -351,22 +434,83 @@
// rounding at the end of the animation.
mStartRadius = taskViewSimulator.getCurrentCornerRadius();
mEndRadius = factory.getEndRadius(cropRectF);
+
+ mRunningTaskViewStartRectF = invariantStartRect;
+ mTargetTaskView = factory.getTargetTaskView();
+ mTaskViewWidth = mTargetTaskView == null ? 0 : mTargetTaskView.getWidth();
+ mTaskViewHeight = mTargetTaskView == null ? 0 : mTargetTaskView.getHeight();
+ mIsPortrait = factory.isPortrait();
+ // Use the running task's start position to determine how much it needs to be offset
+ // to end up offscreen.
+ mRunningTaskViewScrollOffset = factory.isRtl()
+ ? (Math.min(0, -invariantStartRect.right))
+ : (Math.max(0, mDp.widthPx - invariantStartRect.left));
}
@Override
public void onUpdate(RectF currentRect, float progress) {
- mHomeAnim.setPlayFraction(progress);
- mHomeToWindowPositionMap.mapRect(mWindowCurrentRect, currentRect);
-
- mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL);
float cornerRadius = Utilities.mapRange(progress, mStartRadius, mEndRadius);
float alpha = mAnimationFactory.getWindowAlpha(progress);
- mLocalTransformParams
- .setTargetAlpha(alpha)
- .setCornerRadius(cornerRadius);
- mLocalTransformParams.applySurfaceParams(mLocalTransformParams
- .createSurfaceParams(this));
- mAnimationFactory.update(currentRect, progress, mMatrix.mapRadius(cornerRadius));
+
+ mHomeAnim.setPlayFraction(progress);
+ if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
+ mHomeToWindowPositionMap.mapRect(mWindowCurrentRect, currentRect);
+ mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL);
+ mLocalTransformParams
+ .setTargetAlpha(alpha)
+ .setCornerRadius(cornerRadius);
+ } else {
+ mHomeToWindowPositionMap.mapRect(mWindowCurrentRect, mRunningTaskViewStartRectF);
+ mWindowCurrentRect.offset(mRunningTaskViewScrollOffset * progress, 0f);
+ mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL);
+ mLocalTransformParams.setCornerRadius(mStartRadius);
+ }
+
+ mLocalTransformParams.applySurfaceParams(
+ mLocalTransformParams.createSurfaceParams(this));
+
+ mAnimationFactory.update(
+ currentRect,
+ progress,
+ mMatrix.mapRadius(cornerRadius),
+ !enableAdditionalHomeAnimations() || mTargetTaskView == null
+ ? 0 : (int) (alpha * 255));
+
+ if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
+ return;
+ }
+ if (mAnimationFactory.isAnimatingIntoIcon() && mAnimationFactory.isAnimationReady()) {
+ mTargetTaskView.setAlpha(0f);
+ return;
+ }
+ mTargetTaskView.setAlpha(mAnimationFactory.isAnimatingIntoIcon() ? 1f : alpha);
+ float startWidth = mThumbnailStartBounds.width();
+ float startHeight = mThumbnailStartBounds.height();
+ float currentWidth = currentRect.width();
+ float currentHeight = currentRect.height();
+ float scale;
+
+ boolean isStartWidthValid = Float.compare(startWidth, 0f) > 0;
+ boolean isStartHeightValid = Float.compare(startHeight, 0f) > 0;
+ if (isStartWidthValid && isStartHeightValid) {
+ scale = Math.min(currentWidth, currentHeight) / Math.min(startWidth, startHeight);
+ } else {
+ Log.e(TAG, "TaskView starting bounds are invalid: " + mThumbnailStartBounds);
+ if (isStartWidthValid) {
+ scale = currentWidth / startWidth;
+ } else if (isStartHeightValid) {
+ scale = currentHeight / startHeight;
+ } else {
+ scale = 1f;
+ }
+ }
+
+ mTargetTaskView.setScaleX(scale);
+ mTargetTaskView.setScaleY(scale);
+ mTargetTaskView.setTranslationX(
+ currentRect.centerX() - mThumbnailStartBounds.centerX());
+ mTargetTaskView.setTranslationY(
+ currentRect.centerY() - mThumbnailStartBounds.centerY());
}
@Override
@@ -379,16 +523,71 @@
@Override
public void onCancel() {
+ cleanUp();
mAnimationFactory.onCancel();
}
@Override
public void onAnimationStart(Animator animation) {
+ setUp();
mHomeAnim.dispatchOnStart();
+ if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
+ return;
+ }
+ Rect thumbnailBounds = new Rect();
+ // Use bounds relative to mTargetTaskView since it will be scaled afterwards
+ mTargetTaskView.getThumbnailBounds(thumbnailBounds);
+ mAnimationFactory.setTaskViewArtist(new ClipIconView.TaskViewArtist(
+ mTargetTaskView::draw,
+ 0f,
+ -thumbnailBounds.top,
+ Math.min(mTaskViewHeight, mTaskViewWidth),
+ mIsPortrait));
+ }
+
+ private void setUp() {
+ if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
+ return;
+ }
+ RecentsView recentsView = mTargetTaskView.getRecentsView();
+ if (recentsView != null) {
+ recentsView.setOffsetMidpointIndexOverride(
+ recentsView.indexOfChild(mTargetTaskView));
+ }
+ mTargetTaskView.getThumbnailBounds(
+ mThumbnailStartBounds, /* relativeToDragLayer= */ true);
+ mTaskViewAlpha = mTargetTaskView.getAlpha();
+ if (mAnimationFactory.isAnimatingIntoIcon()) {
+ return;
+ }
+ mTaskViewTranslationX = mTargetTaskView.getTranslationX();
+ mTaskViewTranslationY = mTargetTaskView.getTranslationY();
+ mTaskViewScaleX = mTargetTaskView.getScaleX();
+ mTaskViewScaleY = mTargetTaskView.getScaleY();
+ }
+
+ private void cleanUp() {
+ if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
+ return;
+ }
+ RecentsView recentsView = mTargetTaskView.getRecentsView();
+ if (recentsView != null) {
+ recentsView.setOffsetMidpointIndexOverride(INVALID_PAGE);
+ }
+ mTargetTaskView.setAlpha(mTaskViewAlpha);
+ if (!mAnimationFactory.isAnimatingIntoIcon()) {
+ mTargetTaskView.setTranslationX(mTaskViewTranslationX);
+ mTargetTaskView.setTranslationY(mTaskViewTranslationY);
+ mTargetTaskView.setScaleX(mTaskViewScaleX);
+ mTargetTaskView.setScaleY(mTaskViewScaleY);
+ return;
+ }
+ mAnimationFactory.setTaskViewArtist(null);
}
@Override
public void onAnimationSuccess(Animator animator) {
+ cleanUp();
mHomeAnim.getAnimationPlayer().end();
}
}
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index fcf5ffc..4392255 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -23,8 +23,6 @@
import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.RECENT_TASKS_MISSING;
import static com.android.quickstep.util.LogUtils.splitFailureMessage;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
-import static com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps;
import android.app.ActivityManager;
import android.app.ActivityOptions;
@@ -49,7 +47,6 @@
import android.view.IRecentsAnimationRunner;
import android.view.IRemoteAnimationRunner;
import android.view.MotionEvent;
-import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.IOnBackInvokedCallback;
@@ -72,6 +69,7 @@
import com.android.quickstep.util.unfold.ProxyUnfoldTransitionProvider;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RecentsAnimationListener;
import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController;
@@ -86,20 +84,24 @@
import com.android.wm.shell.common.bubbles.BubbleBarLocation;
import com.android.wm.shell.common.pip.IPip;
import com.android.wm.shell.common.pip.IPipAnimationListener;
-import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosition;
import com.android.wm.shell.desktopmode.IDesktopMode;
import com.android.wm.shell.desktopmode.IDesktopTaskListener;
import com.android.wm.shell.draganddrop.IDragAndDrop;
import com.android.wm.shell.onehanded.IOneHanded;
import com.android.wm.shell.recents.IRecentTasks;
import com.android.wm.shell.recents.IRecentTasksListener;
+import com.android.wm.shell.shared.GroupedRecentTaskInfo;
import com.android.wm.shell.shared.IShellTransitions;
+import com.android.wm.shell.shared.desktopmode.DesktopModeFlags;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
+import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource;
+import com.android.wm.shell.shared.split.SplitBounds;
+import com.android.wm.shell.shared.split.SplitScreenConstants.PersistentSnapPosition;
import com.android.wm.shell.splitscreen.ISplitScreen;
import com.android.wm.shell.splitscreen.ISplitScreenListener;
import com.android.wm.shell.splitscreen.ISplitSelectListener;
import com.android.wm.shell.startingsurface.IStartingWindow;
import com.android.wm.shell.startingsurface.IStartingWindowListener;
-import com.android.wm.shell.util.GroupedRecentTaskInfo;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -111,7 +113,7 @@
* Holds the reference to SystemUI.
*/
public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable {
- private static final String TAG = SystemUiProxy.class.getSimpleName();
+ private static final String TAG = "SystemUiProxy";
public static final MainThreadInitializedObject<SystemUiProxy> INSTANCE =
new MainThreadInitializedObject<>(SystemUiProxy::new);
@@ -172,7 +174,8 @@
private final Handler mAsyncHandler;
// TODO(141886704): Find a way to remove this
- private int mLastSystemUiStateFlags;
+ @SystemUiStateFlags
+ private long mLastSystemUiStateFlags;
/**
* This is a singleton pending intent that is used to start recents via Shell (which is a
@@ -226,6 +229,28 @@
}
@Override
+ public void onImeSwitcherLongPress() {
+ if (mSystemUiProxy != null) {
+ try {
+ mSystemUiProxy.onImeSwitcherLongPress();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call onImeSwitcherLongPress");
+ }
+ }
+ }
+
+ @Override
+ public void updateContextualEduStats(boolean isTrackpadGesture, String gestureType) {
+ if (mSystemUiProxy != null) {
+ try {
+ mSystemUiProxy.updateContextualEduStats(isTrackpadGesture, gestureType);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call updateContextualEduStats");
+ }
+ }
+ }
+
+ @Override
public void setHomeRotationEnabled(boolean enabled) {
if (mSystemUiProxy != null) {
try {
@@ -324,12 +349,13 @@
}
// TODO(141886704): Find a way to remove this
- public void setLastSystemUiStateFlags(int stateFlags) {
+ public void setLastSystemUiStateFlags(@SystemUiStateFlags long stateFlags) {
mLastSystemUiStateFlags = stateFlags;
}
// TODO(141886704): Find a way to remove this
- public int getLastSystemUiStateFlags() {
+ @SystemUiStateFlags
+ public long getLastSystemUiStateFlags() {
return mLastSystemUiStateFlags;
}
@@ -575,6 +601,17 @@
}
}
+ @Override
+ public void toggleQuickSettingsPanel() {
+ if (mSystemUiProxy != null) {
+ try {
+ mSystemUiProxy.toggleQuickSettingsPanel();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call toggleQuickSettingsPanel", e);
+ }
+ }
+ }
+
//
// Pip
//
@@ -669,11 +706,11 @@
* should be responsible for cleaning up the overlay.
*/
public void stopSwipePipToHome(int taskId, ComponentName componentName, Rect destinationBounds,
- SurfaceControl overlay, Rect appBounds) {
+ SurfaceControl overlay, Rect appBounds, Rect sourceRectHint) {
if (mPip != null) {
try {
mPip.stopSwipePipToHome(taskId, componentName, destinationBounds, overlay,
- appBounds);
+ appBounds, sourceRectHint);
} catch (RemoteException e) {
Log.w(TAG, "Failed call stopSwipePipToHome");
}
@@ -747,12 +784,12 @@
/**
* Tells SysUI to show the bubble with the provided key.
* @param key the key of the bubble to show.
- * @param bubbleBarBounds bounds of the bubble bar in display coordinates
+ * @param top top coordinate of bubble bar on screen
*/
- public void showBubble(String key, Rect bubbleBarBounds) {
+ public void showBubble(String key, int top) {
if (mBubbles != null) {
try {
- mBubbles.showBubble(key, bubbleBarBounds);
+ mBubbles.showBubble(key, top);
} catch (RemoteException e) {
Log.w(TAG, "Failed call showBubble");
}
@@ -760,19 +797,6 @@
}
/**
- * Tells SysUI to remove the bubble with the provided key.
- * @param key the key of the bubble to show.
- */
- public void removeBubble(String key) {
- if (mBubbles == null) return;
- try {
- mBubbles.removeBubble(key);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call removeBubble");
- }
- }
-
- /**
* Tells SysUI to remove all bubbles.
*/
public void removeAllBubbles() {
@@ -800,15 +824,45 @@
/**
* Tells SysUI when the bubble is being dragged.
* Should be called only when the bubble bar is expanded.
- * @param bubbleKey the key of the bubble to collapse/expand
- * @param isBeingDragged whether the bubble is being dragged
+ * @param bubbleKey key of the bubble being dragged
*/
- public void onBubbleDrag(@Nullable String bubbleKey, boolean isBeingDragged) {
+ public void startBubbleDrag(@Nullable String bubbleKey) {
if (mBubbles == null) return;
try {
- mBubbles.onBubbleDrag(bubbleKey, isBeingDragged);
+ mBubbles.startBubbleDrag(bubbleKey);
} catch (RemoteException e) {
- Log.w(TAG, "Failed call onBubbleDrag");
+ Log.w(TAG, "Failed call startBubbleDrag");
+ }
+ }
+
+ /**
+ * Tells SysUI when the bubble stops being dragged.
+ * Should be called only when the bubble bar is expanded.
+ *
+ * @param location location of the bubble bar
+ * @param top new top coordinate for bubble bar on screen
+ */
+ public void stopBubbleDrag(BubbleBarLocation location, int top) {
+ if (mBubbles == null) return;
+ try {
+ mBubbles.stopBubbleDrag(location, top);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call stopBubbleDrag");
+ }
+ }
+
+ /**
+ * Tells SysUI to dismiss the bubble with the provided key.
+ *
+ * @param key the key of the bubble to dismiss.
+ * @param timestamp the timestamp when the removal happened.
+ */
+ public void dragBubbleToDismiss(String key, long timestamp) {
+ if (mBubbles == null) return;
+ try {
+ mBubbles.dragBubbleToDismiss(key, timestamp);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call dragBubbleToDismiss");
}
}
@@ -837,16 +891,58 @@
}
/**
- * Tells SysUI the bounds for the bubble bar
- * @param bubbleBarBounds bounds of the bubble bar in display coordinates
+ * Tells SysUI the top coordinate of bubble bar on screen
+ *
+ * @param topOnScreen top coordinate for bubble bar on screen
*/
- public void setBubbleBarBounds(Rect bubbleBarBounds) {
+ public void updateBubbleBarTopOnScreen(int topOnScreen) {
try {
if (mBubbles != null) {
- mBubbles.setBubbleBarBounds(bubbleBarBounds);
+ mBubbles.updateBubbleBarTopOnScreen(topOnScreen);
}
} catch (RemoteException e) {
- Log.w(TAG, "Failed call setBubbleBarBounds");
+ Log.w(TAG, "Failed call updateBubbleBarTopOnScreen");
+ }
+ }
+
+ /**
+ * Tells SysUI to show a shortcut bubble.
+ *
+ * @param info the shortcut info used to create or identify the bubble.
+ */
+ public void showShortcutBubble(ShortcutInfo info) {
+ try {
+ if (mBubbles != null) {
+ mBubbles.showShortcutBubble(info);
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call show bubble for shortcut");
+ }
+ }
+
+ /**
+ * Tells SysUI to show a bubble of an app.
+ *
+ * @param intent the intent used to create the bubble.
+ */
+ public void showAppBubble(Intent intent) {
+ try {
+ if (mBubbles != null) {
+ mBubbles.showAppBubble(intent);
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call show bubble for app");
+ }
+ }
+
+ /** Tells SysUI to show the expanded view. */
+ public void showExpandedView() {
+ try {
+ if (mBubbles != null) {
+ mBubbles.showExpandedView();
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed to call showExpandedView");
}
}
@@ -956,77 +1052,6 @@
}
}
- /**
- * Start multiple tasks in split-screen simultaneously.
- */
- public void startTasksWithLegacyTransition(int taskId1, Bundle options1, int taskId2,
- Bundle options2, @StagePosition int splitPosition,
- @PersistentSnapPosition int snapPosition, RemoteAnimationAdapter adapter,
- InstanceId instanceId) {
- if (mSystemUiProxy != null) {
- try {
- mSplitScreen.startTasksWithLegacyTransition(taskId1, options1, taskId2, options2,
- splitPosition, snapPosition, adapter, instanceId);
- } catch (RemoteException e) {
- Log.w(TAG, splitFailureMessage(
- "startTasksWithLegacyTransition", "RemoteException"), e);
- }
- }
- }
-
- public void startIntentAndTaskWithLegacyTransition(PendingIntent pendingIntent, int userId1,
- Bundle options1, int taskId, Bundle options2, @StagePosition int splitPosition,
- @PersistentSnapPosition int snapPosition, RemoteAnimationAdapter adapter,
- InstanceId instanceId) {
- if (mSystemUiProxy != null) {
- try {
- mSplitScreen.startIntentAndTaskWithLegacyTransition(pendingIntent, userId1,
- options1, taskId, options2, splitPosition, snapPosition, adapter,
- instanceId);
- } catch (RemoteException e) {
- Log.w(TAG, splitFailureMessage(
- "startIntentAndTaskWithLegacyTransition", "RemoteException"), e);
- }
- }
- }
-
- public void startShortcutAndTaskWithLegacyTransition(ShortcutInfo shortcutInfo, Bundle options1,
- int taskId, Bundle options2, @StagePosition int splitPosition,
- @PersistentSnapPosition int snapPosition, RemoteAnimationAdapter adapter,
- InstanceId instanceId) {
- if (mSystemUiProxy != null) {
- try {
- mSplitScreen.startShortcutAndTaskWithLegacyTransition(shortcutInfo, options1,
- taskId, options2, splitPosition, snapPosition, adapter, instanceId);
- } catch (RemoteException e) {
- Log.w(TAG, splitFailureMessage(
- "startShortcutAndTaskWithLegacyTransition", "RemoteException"), e);
- }
- }
- }
-
- /**
- * Starts a pair of intents or shortcuts in split-screen using legacy transition. Passing a
- * non-null shortcut info means to start the app as a shortcut.
- */
- public void startIntentsWithLegacyTransition(PendingIntent pendingIntent1, int userId1,
- @Nullable ShortcutInfo shortcutInfo1, @Nullable Bundle options1,
- PendingIntent pendingIntent2, int userId2, @Nullable ShortcutInfo shortcutInfo2,
- @Nullable Bundle options2, @StagePosition int sidePosition,
- @PersistentSnapPosition int snapPosition, RemoteAnimationAdapter adapter,
- InstanceId instanceId) {
- if (mSystemUiProxy != null) {
- try {
- mSplitScreen.startIntentsWithLegacyTransition(pendingIntent1, userId1,
- shortcutInfo1, options1, pendingIntent2, userId2, shortcutInfo2, options2,
- sidePosition, snapPosition, adapter, instanceId);
- } catch (RemoteException e) {
- Log.w(TAG, splitFailureMessage(
- "startIntentsWithLegacyTransition", "RemoteException"), e);
- }
- }
- }
-
public void startShortcut(String packageName, String shortcutId, int position,
Bundle options, UserHandle user, InstanceId instanceId) {
if (mSplitScreen != null) {
@@ -1061,36 +1086,6 @@
}
}
- /**
- * Call this when going to recents so that shell can set-up and provide appropriate leashes
- * for animation (eg. DividerBar).
- *
- * @return RemoteAnimationTargets of windows that need to animate but only exist in shell.
- */
- @Nullable
- public RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) {
- if (!TaskAnimationManager.ENABLE_SHELL_TRANSITIONS && mSplitScreen != null) {
- try {
- return mSplitScreen.onGoingToRecentsLegacy(apps);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call onGoingToRecentsLegacy");
- }
- }
- return null;
- }
-
- @Nullable
- public RemoteAnimationTarget[] onStartingSplitLegacy(RemoteAnimationTarget[] apps) {
- if (mSplitScreen != null) {
- try {
- return mSplitScreen.onStartingSplitLegacy(apps);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call onStartingSplitLegacy");
- }
- }
- return null;
- }
-
//
// One handed
//
@@ -1350,10 +1345,26 @@
}
}
- public ArrayList<GroupedRecentTaskInfo> getRecentTasks(int numTasks, int userId) {
+ public static class GetRecentTasksException extends Exception {
+ public GetRecentTasksException(String message) {
+ super(message);
+ }
+
+ public GetRecentTasksException(String message, Throwable cause) {
+ super(message, cause);
+ }
+ }
+
+ /**
+ * Retrieves a list of Recent tasks from ActivityManager.
+ * @throws GetRecentTasksException if IRecentTasks is not initialized, or when we get
+ * RemoteException from server side
+ */
+ public ArrayList<GroupedRecentTaskInfo> getRecentTasks(int numTasks, int userId)
+ throws GetRecentTasksException {
if (mRecentTasks == null) {
- Log.w(TAG, "getRecentTasks() failed due to null mRecentTasks");
- return new ArrayList<>();
+ Log.e(TAG, "getRecentTasks() failed due to null mRecentTasks");
+ throw new GetRecentTasksException("null mRecentTasks");
}
try {
final GroupedRecentTaskInfo[] rawTasks = mRecentTasks.getRecentTasks(numTasks,
@@ -1363,8 +1374,8 @@
}
return new ArrayList<>(Arrays.asList(rawTasks));
} catch (RemoteException e) {
- Log.w(TAG, "Failed call getRecentTasks", e);
- return new ArrayList<>();
+ Log.e(TAG, "Failed call getRecentTasks", e);
+ throw new GetRecentTasksException("Failed call getRecentTasks", e);
}
}
@@ -1383,8 +1394,8 @@
}
private boolean shouldEnableRunningTasksForDesktopMode() {
- // TODO(b/335401172): unify DesktopMode checks in Launcher
- return enableDesktopWindowingMode() && enableDesktopWindowingTaskbarRunningApps();
+ return DesktopModeStatus.canEnterDesktopMode(mContext)
+ && DesktopModeFlags.TASKBAR_RUNNING_APPS.isEnabled(mContext);
}
private boolean handleMessageAsync(Message msg) {
@@ -1415,28 +1426,6 @@
}
}
- /** Call shell to stash desktop apps */
- public void stashDesktopApps(int displayId) {
- if (mDesktopMode != null) {
- try {
- mDesktopMode.stashDesktopApps(displayId);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call stashDesktopApps", e);
- }
- }
- }
-
- /** Call shell to hide desktop apps that may be stashed */
- public void hideStashedDesktopApps(int displayId) {
- if (mDesktopMode != null) {
- try {
- mDesktopMode.hideStashedDesktopApps(displayId);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call hideStashedDesktopApps", e);
- }
- }
- }
-
/**
* If task with the given id is on the desktop, bring it to front
*/
@@ -1486,10 +1475,10 @@
}
/** Call shell to move a task with given `taskId` to desktop */
- public void moveToDesktop(int taskId) {
+ public void moveToDesktop(int taskId, DesktopModeTransitionSource transitionSource) {
if (mDesktopMode != null) {
try {
- mDesktopMode.moveToDesktop(taskId);
+ mDesktopMode.moveToDesktop(taskId, transitionSource);
} catch (RemoteException e) {
Log.w(TAG, "Failed call moveToDesktop", e);
}
@@ -1540,7 +1529,7 @@
// Aidl bundles need to explicitly set class loader
// https://developer.android.com/guide/components/aidl#Bundles
if (extras != null) {
- extras.setClassLoader(getClass().getClassLoader());
+ extras.setClassLoader(SplitBounds.class.getClassLoader());
}
listener.onAnimationStart(new RecentsAnimationControllerCompat(controller), apps,
wallpapers, homeContentInsets, minimizedHomeBounds, extras);
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index 2348f28..85eea3b 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -18,6 +18,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static com.android.launcher3.Flags.enableHandleDelayedGestureCallbacks;
+import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
@@ -26,6 +27,8 @@
import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_INITIALIZED;
import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import android.app.ActivityManager;
import android.app.ActivityOptions;
@@ -42,11 +45,14 @@
import com.android.internal.util.ArrayUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.util.ActiveGestureLog;
+import com.android.quickstep.util.SystemUiFlagUtils;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -96,13 +102,19 @@
TaskAnimationManager(Context ctx) {
mCtx = ctx;
}
+
+ SystemUiProxy getSystemUiProxy() {
+ return SystemUiProxy.INSTANCE.get(mCtx);
+ }
+
/**
* Preloads the recents animation.
*/
public void preloadRecentsAnimation(Intent intent) {
// Pass null animation handler to indicate this start is for preloading
- UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
- .startRecentsActivity(intent, 0, null, null, null));
+ UI_HELPER_EXECUTOR.execute(() -> {
+ ActivityManagerWrapper.getInstance().preloadRecentsActivity(intent);
+ });
}
boolean shouldIgnoreMotionEvents() {
@@ -149,7 +161,7 @@
final BaseContainerInterface containerInterface = gestureState.getContainerInterface();
mLastGestureState = gestureState;
RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks(
- SystemUiProxy.INSTANCE.get(mCtx), containerInterface.allowMinimizeSplitScreen());
+ getSystemUiProxy(), containerInterface.allowMinimizeSplitScreen());
mCallbacks = newCallbacks;
mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() {
@Override
@@ -255,12 +267,7 @@
}
}
- RemoteAnimationTarget[] nonAppTargets = ENABLE_SHELL_TRANSITIONS
- ? null : SystemUiProxy.INSTANCE.get(mCtx).onStartingSplitLegacy(
- appearedTaskTargets);
- if (nonAppTargets == null) {
- nonAppTargets = new RemoteAnimationTarget[0];
- }
+ RemoteAnimationTarget[] nonAppTargets = new RemoteAnimationTarget[0];
if ((containerInterface.isInLiveTileMode()
|| mLastGestureState.getEndTarget() == RECENTS
|| isNonRecentsStartedTasksAppeared(appearedTaskTargets))
@@ -321,39 +328,43 @@
mCallbacks.addListener(gestureState);
mCallbacks.addListener(listener);
- if (ENABLE_SHELL_TRANSITIONS) {
- final ActivityOptions options = ActivityOptions.makeBasic();
- // Use regular (non-transient) launch for all apps page to control IME.
- if (!containerInterface.allowAllAppsFromOverview()) {
- options.setTransientLaunch();
- }
- options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
- mRecentsAnimationStartPending = SystemUiProxy.INSTANCE.get(mCtx)
- .startRecentsActivity(intent, options, mCallbacks);
- if (enableHandleDelayedGestureCallbacks()) {
- ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
- "TaskAnimationManager.startRecentsAnimation(shell transition path): ")
- .append("Setting mRecentsAnimationStartPending = ")
- .append(mRecentsAnimationStartPending));
- }
- } else {
- UI_HELPER_EXECUTOR.execute(
- () -> ActivityManagerWrapper.getInstance().startRecentsActivity(
- intent,
- eventTime,
- mCallbacks,
- result -> {
- if (enableHandleDelayedGestureCallbacks()) {
- ActiveGestureLog.INSTANCE.addLog(
- new ActiveGestureLog.CompoundString(
- "TaskAnimationManager.startRecentsAnimation")
- .append("(legacy path): Setting ")
- .append("mRecentsAnimationStartPending = ")
- .append(result));
- }
- mRecentsAnimationStartPending = result;
- },
- MAIN_EXECUTOR.getHandler()));
+ final ActivityOptions options = ActivityOptions.makeBasic();
+ options.setPendingIntentBackgroundActivityStartMode(
+ ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
+ // Use regular (non-transient) launch for all apps page to control IME.
+ if (!containerInterface.allowAllAppsFromOverview()) {
+ options.setTransientLaunch();
+ }
+ options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
+
+ // Notify taskbar that we should skip reacting to launcher visibility change to
+ // avoid a jumping taskbar.
+ TaskbarUIController taskbarUIController = containerInterface.getTaskbarController();
+ if (enableScalingRevealHomeAnimation() && taskbarUIController != null) {
+ taskbarUIController.setSkipLauncherVisibilityChange(true);
+
+ mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() {
+ @Override
+ public void onRecentsAnimationCanceled(
+ @NonNull HashMap<Integer, ThumbnailData> thumbnailDatas) {
+ taskbarUIController.setSkipLauncherVisibilityChange(false);
+ }
+
+ @Override
+ public void onRecentsAnimationFinished(
+ @NonNull RecentsAnimationController controller) {
+ taskbarUIController.setSkipLauncherVisibilityChange(false);
+ }
+ });
+ }
+
+ mRecentsAnimationStartPending = getSystemUiProxy()
+ .startRecentsActivity(intent, options, mCallbacks);
+ if (enableHandleDelayedGestureCallbacks()) {
+ ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
+ "TaskAnimationManager.startRecentsAnimation: ")
+ .append("Setting mRecentsAnimationStartPending = ")
+ .append(mRecentsAnimationStartPending));
}
gestureState.setState(STATE_RECENTS_ANIMATION_INITIALIZED);
return mCallbacks;
@@ -373,20 +384,54 @@
return mCallbacks;
}
- public void endLiveTile() {
- if (mLastGestureState == null) {
- return;
- }
- BaseContainerInterface containerInterface = mLastGestureState.getContainerInterface();
- if (containerInterface.isInLiveTileMode()
- && containerInterface.getCreatedContainer() != null) {
- RecentsView recentsView = containerInterface.getCreatedContainer().getOverviewPanel();
- if (recentsView != null) {
- recentsView.switchToScreenshot(null,
- () -> recentsView.finishRecentsAnimation(true /* toRecents */,
- false /* shouldPip */, null));
+ public void onSystemUiFlagsChanged(@QuickStepContract.SystemUiStateFlags long lastSysUIFlags,
+ @QuickStepContract.SystemUiStateFlags long newSysUIFlags) {
+ long isShadeExpandedFlagMask =
+ SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED | SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
+ boolean wasExpanded = hasAnyFlag(lastSysUIFlags, isShadeExpandedFlagMask);
+ boolean isExpanded = hasAnyFlag(newSysUIFlags, isShadeExpandedFlagMask);
+ if (wasExpanded != isExpanded && isExpanded) {
+ // End live tile when expanding the notification panel for the first time from
+ // overview.
+ if (endLiveTile()) {
+ return;
}
}
+
+ boolean wasLocked = SystemUiFlagUtils.isLocked(lastSysUIFlags);
+ boolean isLocked = SystemUiFlagUtils.isLocked(newSysUIFlags);
+ if (wasLocked != isLocked && isLocked) {
+ // Finish the running recents animation when locking the device.
+ finishRunningRecentsAnimation(
+ mController != null && mController.getFinishTargetIsLauncher());
+ }
+ }
+
+ private boolean hasAnyFlag(long flags, long flagMask) {
+ return (flags & flagMask) != 0;
+ }
+
+ /**
+ * Switches the {@link RecentsView} to screenshot if in live tile mode.
+ *
+ * @return true iff the {@link RecentsView} was in live tile mode and was switched to screenshot
+ */
+ public boolean endLiveTile() {
+ if (mLastGestureState == null) {
+ return false;
+ }
+ BaseContainerInterface containerInterface = mLastGestureState.getContainerInterface();
+ if (!containerInterface.isInLiveTileMode()
+ || containerInterface.getCreatedContainer() == null) {
+ return false;
+ }
+ RecentsView recentsView = containerInterface.getCreatedContainer().getOverviewPanel();
+ if (recentsView == null) {
+ return false;
+ }
+ recentsView.switchToScreenshot(null, () -> recentsView.finishRecentsAnimation(
+ true /* toRecents */, false /* shouldPip */, null));
+ return true;
}
public void setLiveTileCleanUpHandler(Runnable cleanUpHandler) {
diff --git a/quickstep/src/com/android/quickstep/TaskIconCache.java b/quickstep/src/com/android/quickstep/TaskIconCache.java
index e6febff..1f6c02c 100644
--- a/quickstep/src/com/android/quickstep/TaskIconCache.java
+++ b/quickstep/src/com/android/quickstep/TaskIconCache.java
@@ -33,6 +33,7 @@
import android.text.TextUtils;
import android.util.SparseArray;
+import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;
import com.android.launcher3.R;
@@ -48,6 +49,7 @@
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.FlagOp;
import com.android.launcher3.util.Preconditions;
+import com.android.quickstep.task.thumbnail.data.TaskIconDataSource;
import com.android.quickstep.util.TaskKeyLruCache;
import com.android.quickstep.util.TaskVisualsChangeListener;
import com.android.systemui.shared.recents.model.Task;
@@ -55,12 +57,11 @@
import com.android.systemui.shared.system.PackageManagerWrapper;
import java.util.concurrent.Executor;
-import java.util.function.Consumer;
/**
* Manages the caching of task icons and related data.
*/
-public class TaskIconCache implements DisplayInfoChangeListener {
+public class TaskIconCache implements TaskIconDataSource, DisplayInfoChangeListener {
private final Executor mBgExecutor;
@@ -103,21 +104,22 @@
* @param callback The callback to receive the task after its data has been populated.
* @return A cancelable handle to the request
*/
- public CancellableTask updateIconInBackground(Task task, Consumer<Task> callback) {
+ @Override
+ public CancellableTask getIconInBackground(Task task, @NonNull GetTaskIconCallback callback) {
Preconditions.assertUIThread();
if (task.icon != null) {
// Nothing to load, the icon is already loaded
- callback.accept(task);
+ callback.onTaskIconReceived(task.icon, task.titleDescription, task.title);
return null;
}
CancellableTask<TaskCacheEntry> request = new CancellableTask<>(
() -> getCacheEntry(task),
MAIN_EXECUTOR,
result -> {
- task.icon = result.icon;
- task.titleDescription = result.contentDescription;
- task.title = result.title;
- callback.accept(task);
+ callback.onTaskIconReceived(
+ result.icon,
+ result.contentDescription,
+ result.title);
dispatchIconUpdate(task.key.id);
}
);
@@ -280,6 +282,12 @@
public String title = "";
}
+ /** Callback used when retrieving app icons from cache. */
+ public interface GetTaskIconCallback {
+ /** Called when task icon is retrieved. */
+ void onTaskIconReceived(Drawable icon, String contentDescription, String title);
+ }
+
void registerTaskVisualsChangeListener(TaskVisualsChangeListener newListener) {
mTaskVisualsChangeListener = newListener;
}
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index d32c7a6..f4ff4b2 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -16,18 +16,22 @@
package com.android.quickstep;
+import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBNAIL;
import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED;
import android.annotation.SuppressLint;
import android.content.Context;
+import android.graphics.Bitmap;
import android.graphics.Insets;
import android.graphics.Matrix;
import android.graphics.Rect;
+import android.graphics.RectF;
import android.os.Build;
import android.view.View;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.android.launcher3.BaseActivity;
@@ -38,17 +42,16 @@
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.Snackbar;
+import com.android.quickstep.task.util.TaskOverlayHelper;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.GroupedTaskView;
import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
-import com.android.quickstep.views.TaskThumbnailViewDeprecated;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.recents.model.ThumbnailData;
import java.util.ArrayList;
import java.util.List;
@@ -59,7 +62,7 @@
public class TaskOverlayFactory implements ResourceBasedOverride {
public static List<SystemShortcut> getEnabledShortcuts(TaskView taskView,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
final ArrayList<SystemShortcut> shortcuts = new ArrayList<>();
final RecentsViewContainer container =
RecentsViewContainer.containerFromContext(taskView.getContext());
@@ -80,8 +83,9 @@
return shortcuts;
}
- public TaskOverlay createOverlay(TaskThumbnailViewDeprecated thumbnailView) {
- return new TaskOverlay(thumbnailView);
+ /** Creates a {@link TaskOverlay} associated with the provide {@link TaskContainer}. */
+ public TaskOverlay<?> createOverlay(TaskContainer taskContainer) {
+ return new TaskOverlay<>(taskContainer);
}
/**
@@ -124,41 +128,76 @@
public static class TaskOverlay<T extends OverviewActionsView> {
protected final Context mApplicationContext;
- protected final TaskThumbnailViewDeprecated mThumbnailView;
+ protected final TaskContainer mTaskContainer;
private T mActionsView;
protected ImageActionsApi mImageApi;
+ protected TaskOverlayHelper mHelper;
- protected TaskOverlay(TaskThumbnailViewDeprecated taskThumbnailViewDeprecated) {
- mApplicationContext = taskThumbnailViewDeprecated.getContext().getApplicationContext();
- mThumbnailView = taskThumbnailViewDeprecated;
- mImageApi = new ImageActionsApi(
- mApplicationContext, mThumbnailView::getThumbnail);
+ protected TaskOverlay(TaskContainer taskContainer) {
+ mApplicationContext = taskContainer.getTaskView().getContext().getApplicationContext();
+ mTaskContainer = taskContainer;
+ if (enableRefactorTaskThumbnail()) {
+ mHelper = new TaskOverlayHelper(mTaskContainer.getTask(), this);
+ }
+ mImageApi = new ImageActionsApi(mApplicationContext, this::getThumbnail);
+ }
+
+ /**
+ * Initialize the overlay when a Task is bound to the TaskView.
+ */
+ public void init() {
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.init();
+ }
+ }
+
+ /**
+ * Destroy the overlay when the TaskView is recycled.
+ */
+ public void destroy() {
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.destroy();
+ }
+ }
+
+ protected @Nullable Bitmap getThumbnail() {
+ return enableRefactorTaskThumbnail() ? mHelper.getEnabledState().getThumbnail()
+ : mTaskContainer.getThumbnailViewDeprecated().getThumbnail();
+ }
+
+ protected boolean isRealSnapshot() {
+ return enableRefactorTaskThumbnail() ? mHelper.getEnabledState().isRealSnapshot()
+ : mTaskContainer.getThumbnailViewDeprecated().isRealSnapshot();
}
protected T getActionsView() {
if (mActionsView == null) {
- mActionsView = BaseActivity.fromContext(mThumbnailView.getContext()).findViewById(
+ mActionsView = BaseActivity.fromContext(
+ mTaskContainer.getTaskView().getContext()).findViewById(
R.id.overview_actions_view);
}
return mActionsView;
}
- public TaskThumbnailViewDeprecated getThumbnailView() {
- return mThumbnailView;
+ public TaskView getTaskView() {
+ return mTaskContainer.getTaskView();
+ }
+
+ public View getSnapshotView() {
+ return mTaskContainer.getSnapshotView();
}
/**
* Called when the current task is interactive for the user
*/
- public void initOverlay(Task task, ThumbnailData thumbnail, Matrix matrix,
+ public void initOverlay(Task task, @Nullable Bitmap thumbnail, Matrix matrix,
boolean rotated) {
getActionsView().updateDisabledFlags(DISABLED_NO_THUMBNAIL, thumbnail == null);
if (thumbnail != null) {
getActionsView().updateDisabledFlags(DISABLED_ROTATED, rotated);
- boolean isAllowedByPolicy = mThumbnailView.isRealSnapshot();
- getActionsView().setCallbacks(new OverlayUICallbacksImpl(isAllowedByPolicy, task));
+ getActionsView().setCallbacks(new OverlayUICallbacksImpl(isRealSnapshot(), task));
}
}
@@ -168,7 +207,8 @@
* @param callback callback to run, after switching to screenshot
*/
public void endLiveTileMode(@NonNull Runnable callback) {
- RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView();
+ RecentsView recentsView =
+ mTaskContainer.getTaskView().getRecentsView();
// Task has already been dismissed
if (recentsView == null) return;
recentsView.switchToScreenshot(
@@ -181,8 +221,8 @@
*/
@SuppressLint("NewApi")
protected void saveScreenshot(Task task) {
- if (mThumbnailView.isRealSnapshot()) {
- mImageApi.saveScreenshot(mThumbnailView.getThumbnail(),
+ if (isRealSnapshot()) {
+ mImageApi.saveScreenshot(getThumbnail(),
getTaskSnapshotBounds(), getTaskSnapshotInsets(), task.key);
} else {
showBlockedByPolicyMessage();
@@ -190,14 +230,14 @@
}
protected void enterSplitSelect() {
- RecentsView overviewPanel = mThumbnailView.getTaskView().getRecentsView();
+ RecentsView overviewPanel = mTaskContainer.getTaskView().getRecentsView();
// Task has already been dismissed
if (overviewPanel == null) return;
- overviewPanel.initiateSplitSelect(mThumbnailView.getTaskView());
+ overviewPanel.initiateSplitSelect(mTaskContainer.getTaskView());
}
protected void saveAppPair() {
- GroupedTaskView taskView = (GroupedTaskView) mThumbnailView.getTaskView();
+ GroupedTaskView taskView = (GroupedTaskView) mTaskContainer.getTaskView();
taskView.getRecentsView().getSplitSelectController().getAppPairsController()
.saveAppPair(taskView);
}
@@ -243,10 +283,11 @@
*/
public Rect getTaskSnapshotBounds() {
int[] location = new int[2];
- mThumbnailView.getLocationOnScreen(location);
+ mTaskContainer.getSnapshotView().getLocationOnScreen(location);
- return new Rect(location[0], location[1], mThumbnailView.getWidth() + location[0],
- mThumbnailView.getHeight() + location[1]);
+ return new Rect(location[0], location[1],
+ mTaskContainer.getSnapshotView().getWidth() + location[0],
+ mTaskContainer.getSnapshotView().getHeight() + location[1]);
}
/**
@@ -256,7 +297,36 @@
*/
@RequiresApi(api = Build.VERSION_CODES.Q)
public Insets getTaskSnapshotInsets() {
- return mThumbnailView.getScaledInsets();
+ Bitmap thumbnail = getThumbnail();
+ if (thumbnail == null) {
+ return Insets.NONE;
+ }
+
+ RectF bitmapRect = new RectF(
+ 0,
+ 0,
+ thumbnail.getWidth(),
+ thumbnail.getHeight());
+ View snapshotView = mTaskContainer.getSnapshotView();
+ RectF viewRect = new RectF(0, 0, snapshotView.getMeasuredWidth(),
+ snapshotView.getMeasuredHeight());
+
+ // The position helper matrix tells us how to transform the bitmap to fit the view, the
+ // inverse tells us where the view would be in the bitmaps coordinates. The insets are
+ // the difference between the bitmap bounds and the projected view bounds.
+ Matrix boundsToBitmapSpace = new Matrix();
+ Matrix thumbnailMatrix = enableRefactorTaskThumbnail()
+ ? mHelper.getThumbnailMatrix()
+ : mTaskContainer.getThumbnailViewDeprecated().getThumbnailMatrix();
+ thumbnailMatrix.invert(boundsToBitmapSpace);
+ RectF boundsInBitmapSpace = new RectF();
+ boundsToBitmapSpace.mapRect(boundsInBitmapSpace, viewRect);
+
+ RecentsViewContainer container = RecentsViewContainer.containerFromContext(
+ getTaskView().getContext());
+ int bottomInset = container.getDeviceProfile().isTablet
+ ? Math.round(bitmapRect.bottom - boundsInBitmapSpace.bottom) : 0;
+ return Insets.of(0, 0, 0, bottomInset);
}
/**
@@ -267,17 +337,21 @@
protected void showBlockedByPolicyMessage() {
ActivityContext activityContext = ActivityContext.lookupContext(
- mThumbnailView.getContext());
+ mTaskContainer.getTaskView().getContext());
String message = activityContext.getStringCache() != null
? activityContext.getStringCache().disabledByAdminMessage
- : mThumbnailView.getContext().getString(R.string.blocked_by_policy);
+ : mTaskContainer.getTaskView().getContext().getString(
+ R.string.blocked_by_policy);
- Snackbar.show(BaseActivity.fromContext(mThumbnailView.getContext()), message, null);
+ Snackbar.show(BaseActivity.fromContext(
+ mTaskContainer.getTaskView().getContext()), message, null);
}
/** Called when the snapshot has updated its full screen drawing parameters. */
- public void setFullscreenParams(TaskView.FullscreenDrawParams fullscreenParams) {
- }
+ public void setFullscreenParams(TaskView.FullscreenDrawParams fullscreenParams) {}
+
+ /** Sets visibility for the overlay associated elements. */
+ public void setVisibility(int visibility) {}
private class ScreenshotSystemShortcut extends SystemShortcut {
@@ -292,7 +366,7 @@
@Override
public void onClick(View view) {
- saveScreenshot(mThumbnailView.getTaskView().getTask());
+ saveScreenshot(mTaskContainer.getTaskView().getFirstTask());
dismissTaskMenuView();
}
}
diff --git a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
index 8df4bdd..9e6e2f3 100644
--- a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
@@ -20,8 +20,9 @@
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.view.Surface.ROTATION_0;
+import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import android.app.ActivityOptions;
import android.graphics.Bitmap;
@@ -42,10 +43,8 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.model.WellbeingModel;
-import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.popup.SystemShortcut.AppInfo;
import com.android.launcher3.util.InstantAppResolver;
@@ -56,16 +55,15 @@
import com.android.quickstep.views.GroupedTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
-import com.android.quickstep.views.TaskThumbnailViewDeprecated;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecCompat;
import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFuture;
import com.android.systemui.shared.recents.view.RecentsTransition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
@@ -78,7 +76,7 @@
public interface TaskShortcutFactory {
@Nullable
default List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
return null;
}
@@ -108,12 +106,16 @@
TaskShortcutFactory APP_INFO = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
TaskView taskView = taskContainer.getTaskView();
+ int actionId = taskContainer.getStagePosition() == STAGE_POSITION_BOTTOM_OR_RIGHT
+ ? R.id.action_app_info_bottom_right
+ : R.id.action_app_info_top_left;
+
AppInfo.SplitAccessibilityInfo accessibilityInfo =
new AppInfo.SplitAccessibilityInfo(taskView.containsMultipleTasks(),
TaskUtils.getTitle(taskView.getContext(), taskContainer.getTask()),
- taskContainer.getA11yNodeId()
+ actionId
);
return Collections.singletonList(new AppInfo(container, taskContainer.getItemInfo(),
taskView, accessibilityInfo));
@@ -131,7 +133,8 @@
public SplitSelectSystemShortcut(RecentsViewContainer container, TaskView taskView,
SplitPositionOption option) {
- super(option.iconResId, option.textResId, container, taskView.getItemInfo(), taskView);
+ super(option.iconResId, option.textResId, container, taskView.getFirstItemInfo(),
+ taskView);
mTaskView = taskView;
mSplitPositionOption = option;
}
@@ -152,8 +155,8 @@
public SaveAppPairSystemShortcut(RecentsViewContainer container, GroupedTaskView taskView,
int iconResId) {
- super(iconResId, R.string.save_app_pair, container,
- taskView.getItemInfo(), taskView);
+ super(iconResId, R.string.save_app_pair, container, taskView.getFirstItemInfo(),
+ taskView);
mTaskView = taskView;
}
@@ -171,19 +174,19 @@
private Handler mHandler;
private final RecentsView mRecentsView;
- private final TaskThumbnailViewDeprecated mThumbnailView;
+ private final TaskContainer mTaskContainer;
private final TaskView mTaskView;
private final LauncherEvent mLauncherEvent;
public FreeformSystemShortcut(int iconRes, int textRes, RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer, LauncherEvent launcherEvent) {
+ TaskContainer taskContainer, LauncherEvent launcherEvent) {
super(iconRes, textRes, container, taskContainer.getItemInfo(),
taskContainer.getTaskView());
mLauncherEvent = launcherEvent;
mHandler = new Handler(Looper.getMainLooper());
mTaskView = taskContainer.getTaskView();
mRecentsView = container.getOverviewPanel();
- mThumbnailView = taskContainer.getThumbnailView();
+ mTaskContainer = taskContainer;
}
@Override
@@ -199,7 +202,7 @@
}
private void startActivity() {
- final Task.TaskKey taskKey = mTaskView.getTask().key;
+ final Task.TaskKey taskKey = mTaskView.getFirstTask().key;
final int taskId = taskKey.id;
final ActivityOptions options = makeLaunchOptions(mTarget);
if (options != null) {
@@ -217,19 +220,25 @@
};
final int[] position = new int[2];
- mThumbnailView.getLocationOnScreen(position);
- final int width = (int) (mThumbnailView.getWidth() * mTaskView.getScaleX());
- final int height = (int) (mThumbnailView.getHeight() * mTaskView.getScaleY());
+ View snapShotView = mTaskContainer.getSnapshotView();
+ snapShotView.getLocationOnScreen(position);
+ final int width = (int) (snapShotView.getWidth() * mTaskView.getScaleX());
+ final int height = (int) (snapShotView.getHeight() * mTaskView.getScaleY());
final Rect taskBounds = new Rect(position[0], position[1],
position[0] + width, position[1] + height);
// Take the thumbnail of the task without a scrim and apply it back after
- float alpha = mThumbnailView.getDimAlpha();
- mThumbnailView.setDimAlpha(0);
+ // TODO(b/348643341) add ability to get override the scrim for this Bitmap retrieval
+ float alpha = 0f;
+ if (!enableRefactorTaskThumbnail()) {
+ alpha = mTaskContainer.getThumbnailViewDeprecated().getDimAlpha();
+ mTaskContainer.getThumbnailViewDeprecated().setDimAlpha(0);
+ }
Bitmap thumbnail = RecentsTransition.drawViewIntoHardwareBitmap(
- taskBounds.width(), taskBounds.height(), mThumbnailView, 1f,
- Color.BLACK);
- mThumbnailView.setDimAlpha(alpha);
+ taskBounds.width(), taskBounds.height(), snapShotView, 1f, Color.BLACK);
+ if (!enableRefactorTaskThumbnail()) {
+ mTaskContainer.getThumbnailViewDeprecated().setDimAlpha(alpha);
+ }
AppTransitionAnimationSpecsFuture future =
new AppTransitionAnimationSpecsFuture(mHandler) {
@@ -243,7 +252,7 @@
overridePendingAppTransitionMultiThumbFuture(
future, animStartedListener, mHandler, true /* scaleUp */,
taskKey.displayId);
- mTarget.getStatsLogManager().logger().withItemInfo(mTaskView.getItemInfo())
+ mTarget.getStatsLogManager().logger().withItemInfo(mTaskView.getFirstItemInfo())
.log(mLauncherEvent);
}
}
@@ -292,7 +301,7 @@
TaskShortcutFactory SPLIT_SELECT = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
DeviceProfile deviceProfile = container.getDeviceProfile();
final Task task = taskContainer.getTask();
final int intentFlags = task.key.baseIntent.getFlags();
@@ -306,12 +315,12 @@
boolean isTaskSplitNotSupported = !task.isDockable ||
(intentFlags & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0;
boolean hideForExistingMultiWindow = container.getDeviceProfile().isMultiWindowMode;
- boolean isFocusedTask = deviceProfile.isTablet && taskView.isFocusedTask();
+ boolean isLargeTile = deviceProfile.isTablet && taskView.isLargeTile();
boolean isTaskInExpectedScrollPosition =
recentsView.isTaskInExpectedScrollPosition(recentsView.indexOfChild(taskView));
if (notEnoughTasksToSplit || isTaskSplitNotSupported || hideForExistingMultiWindow
- || (isFocusedTask && isTaskInExpectedScrollPosition)) {
+ || (isLargeTile && isTaskInExpectedScrollPosition)) {
return null;
}
@@ -327,33 +336,24 @@
@Nullable
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
DeviceProfile deviceProfile = container.getDeviceProfile();
final TaskView taskView = taskContainer.getTaskView();
final RecentsView recentsView = taskView.getRecentsView();
- boolean isLargeTileFocusedTask = deviceProfile.isTablet && taskView.isFocusedTask();
+ boolean isLargeTile = deviceProfile.isTablet && taskView.isLargeTile();
boolean isInExpectedScrollPosition =
recentsView.isTaskInExpectedScrollPosition(recentsView.indexOfChild(taskView));
boolean shouldShowActionsButtonInstead =
- isLargeTileFocusedTask && isInExpectedScrollPosition;
- boolean hasUnpinnableApp = Arrays.stream(taskView.getTaskIdAttributeContainers())
- .anyMatch(att -> att != null && att.getItemInfo() != null
- && ((att.getItemInfo().runtimeStatusFlags
- & ItemInfoWithIcon.FLAG_NOT_PINNABLE) != 0));
+ isLargeTile && isInExpectedScrollPosition;
// No "save app pair" menu item if:
- // - app pairs feature is not enabled
// - we are in 3p launcher
- // - the task in question is a single task
- // - at least one app in app pair is unpinnable
// - the Overview Actions Button should be visible
- // - the task is not a GroupedTaskView
- if (!FeatureFlags.enableAppPairs()
- || !recentsView.supportsAppPairs()
- || !taskView.containsMultipleTasks()
- || hasUnpinnableApp
+ // - the task view is not a valid save-able split pair
+ if (!recentsView.supportsAppPairs()
|| shouldShowActionsButtonInstead
- || !(taskView instanceof GroupedTaskView)) {
+ || !recentsView.getSplitSelectController().getAppPairsController()
+ .canSaveAppPair(taskView)) {
return null;
}
@@ -375,7 +375,7 @@
TaskShortcutFactory FREE_FORM = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
final Task task = taskContainer.getTask();
if (!task.isDockable) {
return null;
@@ -394,14 +394,14 @@
return Settings.Global.getInt(
container.asContext().getContentResolver(),
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, 0) != 0
- && !enableDesktopWindowingMode();
+ && !DesktopModeStatus.canEnterDesktopMode(container.asContext());
}
};
TaskShortcutFactory PIN = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
if (!SystemUiProxy.INSTANCE.get(container.asContext()).isActive()) {
return null;
}
@@ -423,7 +423,7 @@
private final TaskView mTaskView;
public PinSystemShortcut(RecentsViewContainer target,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
super(R.drawable.ic_pin, R.string.recent_task_option_pin, target,
taskContainer.getItemInfo(), taskContainer.getTaskView());
mTaskView = taskContainer.getTaskView();
@@ -433,10 +433,10 @@
public void onClick(View view) {
if (mTaskView.launchTaskAnimated() != null) {
SystemUiProxy.INSTANCE.get(mTarget.asContext()).startScreenPinning(
- mTaskView.getTask().key.id);
+ mTaskView.getFirstTask().key.id);
}
dismissTaskMenuView();
- mTarget.getStatsLogManager().logger().withItemInfo(mTaskView.getItemInfo())
+ mTarget.getStatsLogManager().logger().withItemInfo(mTaskView.getFirstItemInfo())
.log(LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_PIN_TAP);
}
}
@@ -444,7 +444,7 @@
TaskShortcutFactory INSTALL = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
Task t = taskContainer.getTask();
return InstantAppResolver.newInstance(container.asContext()).isInstantApp(
t.getTopComponent().getPackageName(), t.getKey().userId)
@@ -457,7 +457,7 @@
TaskShortcutFactory WELLBEING = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
SystemShortcut<ActivityContext> wellbeingShortcut =
WellbeingModel.SHORTCUT_FACTORY.getShortcut(container,
taskContainer.getItemInfo(), taskContainer.getTaskView());
@@ -468,13 +468,12 @@
TaskShortcutFactory SCREENSHOT = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
boolean isTablet = container.getDeviceProfile().isTablet;
boolean isGridOnlyOverview = isTablet && Flags.enableGridOnlyOverview();
// Extra conditions if it's not grid-only overview
if (!isGridOnlyOverview) {
- RecentsOrientedState orientedState =
- taskContainer.getTaskView().getRecentsView().getPagedViewOrientedState();
+ RecentsOrientedState orientedState = taskContainer.getTaskView().getOrientedState();
boolean isFakeLandscape = !orientedState.isRecentsActivityRotationAllowed()
&& orientedState.getTouchRotation() != ROTATION_0;
if (!isFakeLandscape) {
@@ -482,10 +481,8 @@
}
}
- SystemShortcut screenshotShortcut =
- taskContainer.getThumbnailView().getTaskOverlay()
- .getScreenshotShortcut(container, taskContainer.getItemInfo(),
- taskContainer.getTaskView());
+ SystemShortcut screenshotShortcut = taskContainer.getOverlay().getScreenshotShortcut(
+ container, taskContainer.getItemInfo(), taskContainer.getTaskView());
return createSingletonShortcutList(screenshotShortcut);
}
@@ -498,28 +495,16 @@
TaskShortcutFactory MODAL = new TaskShortcutFactory() {
@Override
public List<SystemShortcut> getShortcuts(RecentsViewContainer container,
- TaskIdAttributeContainer taskContainer) {
+ TaskContainer taskContainer) {
boolean isTablet = container.getDeviceProfile().isTablet;
boolean isGridOnlyOverview = isTablet && Flags.enableGridOnlyOverview();
- // Extra conditions if it's not grid-only overview
if (!isGridOnlyOverview) {
- RecentsOrientedState orientedState =
- taskContainer.getTaskView().getRecentsView().getPagedViewOrientedState();
- boolean isFakeLandscape = !orientedState.isRecentsActivityRotationAllowed()
- && orientedState.getTouchRotation() != ROTATION_0;
- if (!isFakeLandscape) {
- return null;
- }
- // Disallow "Select" when swiping up from landscape due to rotated thumbnail.
- if (orientedState.getDisplayRotation() != ROTATION_0) {
- return null;
- }
+ return null;
}
SystemShortcut modalStateSystemShortcut =
- taskContainer.getThumbnailView().getTaskOverlay()
- .getModalStateSystemShortcut(
- taskContainer.getItemInfo(), taskContainer.getTaskView());
+ taskContainer.getOverlay().getModalStateSystemShortcut(
+ taskContainer.getItemInfo(), taskContainer.getTaskView());
return createSingletonShortcutList(modalStateSystemShortcut);
}
};
diff --git a/quickstep/src/com/android/quickstep/TaskThumbnailCache.java b/quickstep/src/com/android/quickstep/TaskThumbnailCache.java
index b7cbb47..580dcc2 100644
--- a/quickstep/src/com/android/quickstep/TaskThumbnailCache.java
+++ b/quickstep/src/com/android/quickstep/TaskThumbnailCache.java
@@ -21,11 +21,14 @@
import android.content.Context;
import android.content.res.Resources;
+import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.R;
import com.android.launcher3.util.CancellableTask;
import com.android.launcher3.util.Preconditions;
+import com.android.quickstep.recents.data.HighResLoadingStateNotifier;
+import com.android.quickstep.task.thumbnail.data.TaskThumbnailDataSource;
import com.android.quickstep.util.TaskKeyByLastActiveTimeCache;
import com.android.quickstep.util.TaskKeyCache;
import com.android.quickstep.util.TaskKeyLruCache;
@@ -38,7 +41,7 @@
import java.util.concurrent.Executor;
import java.util.function.Consumer;
-public class TaskThumbnailCache {
+public class TaskThumbnailCache implements TaskThumbnailDataSource {
private final Executor mBgExecutor;
private final TaskKeyCache<ThumbnailData> mCache;
@@ -46,7 +49,7 @@
private final boolean mEnableTaskSnapshotPreloading;
private final Context mContext;
- public static class HighResLoadingState {
+ public static class HighResLoadingState implements HighResLoadingStateNotifier {
private boolean mForceHighResThumbnails;
private boolean mVisible;
private boolean mFlingingFast;
@@ -63,11 +66,13 @@
mForceHighResThumbnails = !supportsLowResThumbnails();
}
- public void addCallback(HighResLoadingStateChangedCallback callback) {
+ @Override
+ public void addCallback(@NonNull HighResLoadingStateChangedCallback callback) {
mCallbacks.add(callback);
}
- public void removeCallback(HighResLoadingStateChangedCallback callback) {
+ @Override
+ public void removeCallback(@NonNull HighResLoadingStateChangedCallback callback) {
mCallbacks.remove(callback);
}
@@ -129,8 +134,7 @@
Preconditions.assertUIThread();
// Fetch the thumbnail for this task and put it in the cache
if (task.thumbnail == null) {
- updateThumbnailInBackground(task.key, lowResolution,
- t -> task.thumbnail = t);
+ getThumbnailInBackground(task.key, lowResolution, t -> task.thumbnail = t);
}
}
@@ -143,17 +147,18 @@
}
/**
- * Asynchronously fetches the icon and other task data for the given {@param task}.
+ * Asynchronously fetches the thumbnail for the given {@code task}.
*
* @param callback The callback to receive the task after its data has been populated.
* @return A cancelable handle to the request
*/
- public CancellableTask updateThumbnailInBackground(
- Task task, Consumer<ThumbnailData> callback) {
+ @Override
+ public CancellableTask<ThumbnailData> getThumbnailInBackground(
+ Task task, @NonNull Consumer<ThumbnailData> callback) {
Preconditions.assertUIThread();
boolean lowResolution = !mHighResLoadingState.isEnabled();
- if (task.thumbnail != null && task.thumbnail.thumbnail != null
+ if (task.thumbnail != null && task.thumbnail.getThumbnail() != null
&& (!task.thumbnail.reducedResolution || lowResolution)) {
// Nothing to load, the thumbnail is already high-resolution or matches what the
// request, so just callback
@@ -161,10 +166,7 @@
return null;
}
- return updateThumbnailInBackground(task.key, !mHighResLoadingState.isEnabled(), t -> {
- task.thumbnail = t;
- callback.accept(t);
- });
+ return getThumbnailInBackground(task.key, !mHighResLoadingState.isEnabled(), callback);
}
/**
@@ -184,12 +186,12 @@
return newSize > oldSize;
}
- private CancellableTask updateThumbnailInBackground(TaskKey key, boolean lowResolution,
- Consumer<ThumbnailData> callback) {
+ private CancellableTask<ThumbnailData> getThumbnailInBackground(TaskKey key,
+ boolean lowResolution, Consumer<ThumbnailData> callback) {
Preconditions.assertUIThread();
ThumbnailData cachedThumbnail = mCache.getAndInvalidateIfModified(key);
- if (cachedThumbnail != null && cachedThumbnail.thumbnail != null
+ if (cachedThumbnail != null && cachedThumbnail.getThumbnail() != null
&& (!cachedThumbnail.reducedResolution || lowResolution)) {
// Already cached, lets use that thumbnail
callback.accept(cachedThumbnail);
@@ -200,7 +202,7 @@
() -> {
ThumbnailData thumbnailData = ActivityManagerWrapper.getInstance()
.getTaskThumbnail(key.id, lowResolution);
- return thumbnailData.thumbnail != null ? thumbnailData
+ return thumbnailData.getThumbnail() != null ? thumbnailData
: ActivityManagerWrapper.getInstance().takeTaskThumbnail(key.id);
},
MAIN_EXECUTOR,
@@ -210,7 +212,7 @@
if (enableGridOnlyOverview() && result.reducedResolution
&& getHighResLoadingState().isEnabled()) {
ThumbnailData newCachedThumbnail = mCache.getAndInvalidateIfModified(key);
- if (newCachedThumbnail != null && newCachedThumbnail.thumbnail != null
+ if (newCachedThumbnail != null && newCachedThumbnail.getThumbnail() != null
&& !newCachedThumbnail.reducedResolution) {
return;
}
diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index d89d399..1a09691 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -80,7 +80,6 @@
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.GroupedTaskView;
import com.android.quickstep.views.RecentsView;
-import com.android.quickstep.views.TaskThumbnailViewDeprecated;
import com.android.quickstep.views.TaskView;
import com.android.systemui.animation.RemoteAnimationTargetCompat;
import com.android.systemui.shared.recents.model.Task;
@@ -121,7 +120,7 @@
for (int i = 0; i < recentsView.getTaskViewCount(); i++) {
TaskView taskView = recentsView.getTaskViewAt(i);
if (recentsView.isTaskViewVisible(taskView)) {
- Task.TaskKey key = taskView.getTask().key;
+ Task.TaskKey key = taskView.getFirstTask().key;
if (componentName.equals(key.getComponent()) && userId == key.userId) {
return taskView;
}
@@ -165,8 +164,8 @@
@NonNull RemoteAnimationTarget[] nonAppTargets,
@Nullable DepthController depthController,
PendingAnimation out) {
- boolean isQuickSwitch = v.isEndQuickswitchCuj();
- v.setEndQuickswitchCuj(false);
+ boolean isQuickSwitch = v.isEndQuickSwitchCuj();
+ v.setEndQuickSwitchCuj(false);
final RemoteAnimationTargets targets =
new RemoteAnimationTargets(appTargets, wallpaperTargets, nonAppTargets,
@@ -233,9 +232,13 @@
TaskViewSimulator::setTaskRectTranslation, taskRectTranslationPrimary,
taskRectTranslationSecondary);
- // Fade in the task during the initial 20% of the animation
- out.addFloat(targetHandle.getTransformParams(), TransformParams.TARGET_ALPHA, 0, 1,
- clampToProgress(LINEAR, 0, 0.2f));
+ if (v instanceof DesktopTaskView) {
+ targetHandle.getTransformParams().setTargetAlpha(1f);
+ } else {
+ // Fade in the task during the initial 20% of the animation
+ out.addFloat(targetHandle.getTransformParams(), TransformParams.TARGET_ALPHA, 0,
+ 1, clampToProgress(LINEAR, 0, 0.2f));
+ }
}
}
@@ -334,7 +337,7 @@
// During animation we apply transformation on the thumbnailView (and not the rootView)
// to follow the TaskViewSimulator. So the final matrix applied on the thumbnailView is:
// Mt K(0)` K(t) Mt`
- TaskThumbnailViewDeprecated[] thumbnails = v.getThumbnails();
+ View[] thumbnails = v.getSnapshotViews();
// In case simulator copies and thumbnail size do no match, ensure we get the lesser.
// This ensures we do not create arrays with empty elements or attempt to references
@@ -344,7 +347,7 @@
Matrix[] mt = new Matrix[matrixSize];
Matrix[] mti = new Matrix[matrixSize];
for (int i = 0; i < matrixSize; i++) {
- TaskThumbnailViewDeprecated ttv = thumbnails[i];
+ View ttv = thumbnails[i];
RectF localBounds = new RectF(0, 0, ttv.getWidth(), ttv.getHeight());
float[] tvBoundsMapped = new float[]{0, 0, ttv.getWidth(), ttv.getHeight()};
getDescendantCoordRelativeToAncestor(ttv, ttv.getRootView(), tvBoundsMapped, false);
@@ -391,7 +394,7 @@
out.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- for (TaskThumbnailViewDeprecated ttv : thumbnails) {
+ for (View ttv : thumbnails) {
ttv.setAnimationMatrix(null);
}
}
@@ -559,7 +562,7 @@
/**
* Start recents to desktop animation
*/
- public static void composeRecentsDesktopLaunchAnimator(
+ public static AnimatorSet composeRecentsDesktopLaunchAnimator(
@NonNull DesktopTaskView launchingTaskView,
@NonNull StateManager stateManager, @Nullable DepthController depthController,
@NonNull TransitionInfo transitionInfo,
@@ -589,7 +592,7 @@
true /* launcherClosing */, stateManager, launchingTaskView.getRecentsView(),
depthController);
- animatorSet.start();
+ return animatorSet;
}
public static void composeRecentsLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v,
diff --git a/quickstep/src/com/android/quickstep/TopTaskTracker.java b/quickstep/src/com/android/quickstep/TopTaskTracker.java
index 3a6b804..3cf0542 100644
--- a/quickstep/src/com/android/quickstep/TopTaskTracker.java
+++ b/quickstep/src/com/android/quickstep/TopTaskTracker.java
@@ -166,7 +166,7 @@
/**
* @return index 0 will be task in left/top position, index 1 in right/bottom position.
- * Will return empty array if device is not in staged split
+ * Will return empty array if device is not in staged split
*/
public int[] getRunningSplitTaskIds() {
if (mMainStagePosition.taskId == INVALID_TASK_ID
@@ -242,7 +242,7 @@
* If the given task holds an activity that is excluded from recents, and there
* is another running task that is not excluded from recents, returns that underlying task.
*/
- public @Nullable CachedTaskInfo otherVisibleTaskThisIsExcludedOver() {
+ public @Nullable CachedTaskInfo getVisibleNonExcludedTask() {
if (mTopTask == null
|| (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) {
// Not an excluded task.
@@ -250,7 +250,9 @@
}
List<RunningTaskInfo> visibleNonExcludedTasks = mAllCachedTasks.stream()
.filter(t -> t.isVisible
- && (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0)
+ && (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0
+ && t.getActivityType() != ACTIVITY_TYPE_HOME
+ && t.getActivityType() != ACTIVITY_TYPE_RECENTS)
.toList();
return visibleNonExcludedTasks.isEmpty() ? null
: new CachedTaskInfo(visibleNonExcludedTasks);
@@ -284,7 +286,7 @@
*/
public Task[] getPlaceholderTasks() {
return mTopTask == null ? new Task[0]
- : new Task[] {Task.from(new TaskKey(mTopTask), mTopTask, false)};
+ : new Task[]{Task.from(new TaskKey(mTopTask), mTopTask, false)};
}
/**
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index f94a29c..b321b3e 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -42,24 +42,23 @@
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_MOVE;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.NAVIGATION_MODE_SWITCHED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.RECENTS_ANIMATION_START_PENDING;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
-import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.wm.shell.Flags.enableBubblesLongPressNavHandle;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_BUBBLES;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_DRAG_AND_DROP;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_PIP;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN;
-import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BACK_ANIMATION;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_BUBBLES;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_DESKTOP_MODE;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_DRAG_AND_DROP;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_ONE_HANDED;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_PIP;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_RECENT_TASKS;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_SPLIT_SCREEN;
+import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_STARTING_WINDOW;
import android.app.PendingIntent;
import android.app.Service;
@@ -68,11 +67,13 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Region;
+import android.hardware.input.InputManager;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Looper;
import android.os.SystemClock;
import android.os.Trace;
+import android.util.ArraySet;
import android.util.Log;
import android.view.Choreographer;
import android.view.InputDevice;
@@ -83,10 +84,12 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.ConstantItem;
import com.android.launcher3.EncryptionType;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.config.FeatureFlags;
@@ -95,17 +98,20 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarNavButtonCallbacks;
+import com.android.launcher3.taskbar.bubbles.BubbleControllers;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.LockedUserState;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.PluginManagerWrapper;
import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.util.ScreenOnTracker;
import com.android.launcher3.util.TraceHelper;
import com.android.quickstep.inputconsumers.AccessibilityInputConsumer;
import com.android.quickstep.inputconsumers.AssistantInputConsumer;
+import com.android.quickstep.inputconsumers.BubbleBarInputConsumer;
import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer;
import com.android.quickstep.inputconsumers.NavHandleLongPressInputConsumer;
import com.android.quickstep.inputconsumers.OneHandedModeInputConsumer;
@@ -125,10 +131,12 @@
import com.android.quickstep.views.RecentsViewContainer;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
+import com.android.systemui.shared.statusbar.phone.BarTransitions;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver;
import com.android.systemui.shared.system.InputConsumerController;
import com.android.systemui.shared.system.InputMonitorCompat;
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController;
import com.android.systemui.unfold.progress.IUnfoldAnimation;
import com.android.wm.shell.back.IBackAnimation;
@@ -145,6 +153,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
+import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -301,9 +310,9 @@
}
@BinderThread
- public void onSystemUiStateChanged(int stateFlags) {
+ public void onSystemUiStateChanged(@SystemUiStateFlags long stateFlags) {
MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis -> {
- int lastFlags = tis.mDeviceState.getSystemUiStateFlags();
+ long lastFlags = tis.mDeviceState.getSystemUiStateFlags();
tis.mDeviceState.setSystemUiFlags(stateFlags);
tis.onSystemUiFlagsChanged(lastFlags);
}));
@@ -327,6 +336,49 @@
});
}
+ @BinderThread
+ @Override
+ public void updateWallpaperVisibility(int displayId, boolean visible) {
+ MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis ->
+ executeForTaskbarManager(
+ taskbarManager -> taskbarManager.setWallpaperVisible(visible))
+ ));
+ }
+
+ @BinderThread
+ @Override
+ public void checkNavBarModes() {
+ MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis ->
+ executeForTaskbarManager(TaskbarManager::checkNavBarModes)
+ ));
+ }
+
+ @BinderThread
+ @Override
+ public void finishBarAnimations() {
+ MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis ->
+ executeForTaskbarManager(TaskbarManager::finishBarAnimations)
+ ));
+ }
+
+ @BinderThread
+ @Override
+ public void touchAutoDim(boolean reset) {
+ MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis ->
+ executeForTaskbarManager(taskbarManager -> taskbarManager.touchAutoDim(reset))
+ ));
+ }
+
+ @BinderThread
+ @Override
+ public void transitionTo(@BarTransitions.TransitionMode int barMode,
+ boolean animate) {
+ MAIN_EXECUTOR.execute(() -> executeForTouchInteractionService(tis ->
+ executeForTaskbarManager(
+ taskbarManager -> taskbarManager.transitionTo(barMode, animate))
+ ));
+ }
+
/**
* Preloads the Overview activity.
* <p>
@@ -356,6 +408,12 @@
}
@Override
+ public void onTransitionModeUpdated(int barMode, boolean checkBarModes) {
+ executeForTaskbarManager(taskbarManager ->
+ taskbarManager.onTransitionModeUpdated(barMode, checkBarModes));
+ }
+
+ @Override
public void onNavButtonsDarkIntensityChanged(float darkIntensity) {
executeForTaskbarManager(taskbarManager ->
taskbarManager.onNavButtonsDarkIntensityChanged(darkIntensity));
@@ -395,6 +453,25 @@
return tis.mTaskbarManager;
}
+ @VisibleForTesting
+ public void injectFakeTrackpadForTesting() {
+ TouchInteractionService tis = mTis.get();
+ if (tis == null) return;
+ tis.mTrackpadsConnected.add(1000);
+ tis.initInputMonitor("tapl testing");
+ }
+
+ @VisibleForTesting
+ public void ejectFakeTrackpadForTesting() {
+ TouchInteractionService tis = mTis.get();
+ if (tis == null) return;
+ tis.mTrackpadsConnected.clear();
+ // This method destroys the current input monitor if set up, and only init a new one
+ // in 3-button mode if {@code mTrackpadsConnected} is not empty. So in other words,
+ // it will destroy the input monitor.
+ tis.initInputMonitor("tapl testing");
+ }
+
/**
* Sets whether a predictive back-to-home animation is in progress in the device state
*/
@@ -452,6 +529,50 @@
}
}
+ private final InputManager.InputDeviceListener mInputDeviceListener =
+ new InputManager.InputDeviceListener() {
+ @Override
+ public void onInputDeviceAdded(int deviceId) {
+ if (isTrackpadDevice(deviceId)) {
+ boolean wasEmpty = mTrackpadsConnected.isEmpty();
+ mTrackpadsConnected.add(deviceId);
+ if (wasEmpty) {
+ update();
+ }
+ }
+ }
+
+ @Override
+ public void onInputDeviceChanged(int deviceId) {
+ }
+
+ @Override
+ public void onInputDeviceRemoved(int deviceId) {
+ mTrackpadsConnected.remove(deviceId);
+ if (mTrackpadsConnected.isEmpty()) {
+ update();
+ }
+ }
+
+ private void update() {
+ if (mInputMonitorCompat != null && !mTrackpadsConnected.isEmpty()) {
+ // Don't destroy and reinitialize input monitor due to trackpad
+ // connecting when it's already set up.
+ return;
+ }
+ initInputMonitor("onTrackpadConnected()");
+ }
+
+ private boolean isTrackpadDevice(int deviceId) {
+ InputDevice inputDevice = mInputManager.getInputDevice(deviceId);
+ if (inputDevice == null) {
+ return false;
+ }
+ return inputDevice.getSources() == (InputDevice.SOURCE_MOUSE
+ | InputDevice.SOURCE_TOUCHPAD);
+ }
+ };
+
private static boolean sConnected = false;
private static boolean sIsInitialized = false;
private RotationTouchHelper mRotationTouchHelper;
@@ -502,6 +623,10 @@
private TaskbarManager mTaskbarManager;
private Function<GestureState, AnimatedFloat> mSwipeUpProxyProvider = i -> null;
private AllAppsActionManager mAllAppsActionManager;
+ private InputManager mInputManager;
+ private final Set<Integer> mTrackpadsConnected = new ArraySet<>();
+
+ private NavigationMode mGestureStartNavMode = null;
@Override
public void onCreate() {
@@ -511,10 +636,19 @@
mMainChoreographer = Choreographer.getInstance();
mAM = ActivityManagerWrapper.getInstance();
mDeviceState = new RecentsAnimationDeviceState(this, true);
+ mRotationTouchHelper = mDeviceState.getRotationTouchHelper();
mAllAppsActionManager = new AllAppsActionManager(
this, UI_HELPER_EXECUTOR, this::createAllAppsPendingIntent);
+ mInputManager = getSystemService(InputManager.class);
+ if (ENABLE_TRACKPAD_GESTURE.get()) {
+ mInputManager.registerInputDeviceListener(mInputDeviceListener,
+ UI_HELPER_EXECUTOR.getHandler());
+ int [] inputDevices = mInputManager.getInputDeviceIds();
+ for (int inputDeviceId : inputDevices) {
+ mInputDeviceListener.onInputDeviceAdded(inputDeviceId);
+ }
+ }
mTaskbarManager = new TaskbarManager(this, mAllAppsActionManager, mNavCallbacks);
- mRotationTouchHelper = mDeviceState.getRotationTouchHelper();
mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
// Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized.
@@ -541,7 +675,9 @@
private void initInputMonitor(String reason) {
disposeEventHandlers("Initializing input monitor due to: " + reason);
- if (mDeviceState.isButtonNavMode() && !ENABLE_TRACKPAD_GESTURE.get()) {
+ if (mDeviceState.isButtonNavMode()
+ && !mDeviceState.supportsAssistantGestureInButtonNav()
+ && (!ENABLE_TRACKPAD_GESTURE.get() || mTrackpadsConnected.isEmpty())) {
return;
}
@@ -636,22 +772,13 @@
}
@UiThread
- private void onSystemUiFlagsChanged(int lastSysUIFlags) {
+ private void onSystemUiFlagsChanged(@SystemUiStateFlags long lastSysUIFlags) {
if (LockedUserState.get(this).isUserUnlocked()) {
- int systemUiStateFlags = mDeviceState.getSystemUiStateFlags();
+ long systemUiStateFlags = mDeviceState.getSystemUiStateFlags();
SystemUiProxy.INSTANCE.get(this).setLastSystemUiStateFlags(systemUiStateFlags);
mOverviewComponentObserver.onSystemUiStateChanged();
mTaskbarManager.onSystemUiFlagsChanged(systemUiStateFlags);
-
- int isShadeExpandedFlag =
- SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED | SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
- boolean wasExpanded = (lastSysUIFlags & isShadeExpandedFlag) != 0;
- boolean isExpanded = (systemUiStateFlags & isShadeExpandedFlag) != 0;
- if (wasExpanded != isExpanded && isExpanded) {
- // End live tile when expanding the notification panel for the first time from
- // overview.
- mTaskAnimationManager.endLiveTile();
- }
+ mTaskAnimationManager.onSystemUiFlagsChanged(lastSysUIFlags, systemUiStateFlags);
}
}
@@ -677,6 +804,9 @@
mAllAppsActionManager.onDestroy();
+ mInputManager.unregisterInputDeviceListener(mInputDeviceListener);
+ mTrackpadsConnected.clear();
+
mTaskbarManager.destroy();
sConnected = false;
@@ -713,14 +843,28 @@
TestLogging.recordMotionEvent(
TestProtocol.SEQUENCE_TIS, "TouchInteractionService.onInputEvent", event);
- boolean isUserUnlocked = LockedUserState.get(this).isUserUnlocked();
- if (!isUserUnlocked || (mDeviceState.isButtonNavMode()
- && !isTrackpadMotionEvent(event))) {
+ if (!LockedUserState.get(this).isUserUnlocked()) {
+ ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
+ .append("Cannot process input event: user is locked"));
+ return;
+ }
+
+ NavigationMode currentNavMode = mDeviceState.getMode();
+ if (mGestureStartNavMode != null && mGestureStartNavMode != currentNavMode) {
+ ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
+ .append("Navigation mode switched mid-gesture (")
+ .append(mGestureStartNavMode.name())
+ .append(" -> ")
+ .append(currentNavMode.name())
+ .append("); cancelling gesture."),
+ NAVIGATION_MODE_SWITCHED);
+ event.setAction(ACTION_CANCEL);
+ } else if (mDeviceState.isButtonNavMode()
+ && !mDeviceState.supportsAssistantGestureInButtonNav()
+ && !isTrackpadMotionEvent(event)) {
ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
.append("Cannot process input event: ")
- .append(!isUserUnlocked
- ? "user is locked"
- : "using 3-button nav and event is not a trackpad event"));
+ .append("using 3-button nav and event is not a trackpad event"));
return;
}
@@ -747,6 +891,12 @@
}
}
+ if (action == ACTION_DOWN || isHoverActionWithoutConsumer) {
+ mGestureStartNavMode = currentNavMode;
+ } else if (action == ACTION_UP || action == ACTION_CANCEL) {
+ mGestureStartNavMode = null;
+ }
+
SafeCloseable traceToken = TraceHelper.INSTANCE.allowIpcs("TIS.onInputEvent");
CompoundString reasonString = action == ACTION_DOWN
@@ -757,11 +907,29 @@
boolean isOneHandedModeActive = mDeviceState.isOneHandedModeActive();
boolean isInSwipeUpTouchRegion = mRotationTouchHelper.isInSwipeUpTouchRegion(event);
TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
+ BubbleControllers bubbleControllers = tac != null ? tac.getBubbleControllers() : null;
+ boolean isOnBubbles = bubbleControllers != null
+ && BubbleBarInputConsumer.isEventOnBubbles(tac, event);
if (isInSwipeUpTouchRegion && tac != null) {
tac.closeKeyboardQuickSwitchView();
}
- if ((!isOneHandedModeActive && isInSwipeUpTouchRegion)
- || isHoverActionWithoutConsumer) {
+ if (mDeviceState.isButtonNavMode()
+ && mDeviceState.supportsAssistantGestureInButtonNav()) {
+ reasonString.append("in three button mode which supports Assistant gesture");
+ // Consume gesture event for Assistant (all other gestures should do nothing).
+ if (mDeviceState.canTriggerAssistantAction(event)) {
+ reasonString.append(" and event can trigger assistant action")
+ .append(", consuming gesture for assistant action");
+ mGestureState =
+ createGestureState(mGestureState, getTrackpadGestureType(event));
+ mUncheckedConsumer = tryCreateAssistantInputConsumer(mGestureState, event);
+ } else {
+ reasonString.append(" but event cannot trigger Assistant")
+ .append(", consuming gesture as no-op");
+ mUncheckedConsumer = InputConsumer.NO_OP;
+ }
+ } else if ((!isOneHandedModeActive && isInSwipeUpTouchRegion)
+ || isHoverActionWithoutConsumer || isOnBubbles) {
reasonString.append(!isOneHandedModeActive && isInSwipeUpTouchRegion
? "one handed mode is not active and event is in swipe up region"
: "isHoverActionWithoutConsumer == true")
@@ -782,8 +950,7 @@
: "event is a trackpad multi-finger swipe")
.append(" and event can trigger assistant action")
.append(", consuming gesture for assistant action");
- mGestureState = createGestureState(mGestureState,
- getTrackpadGestureType(event));
+ mGestureState = createGestureState(mGestureState, getTrackpadGestureType(event));
// Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we
// should not interrupt it. QuickSwitch assumes that interruption can only
// happen if the next gesture is also quick switch.
@@ -941,6 +1108,15 @@
private InputConsumer newConsumer(
GestureState previousGestureState, GestureState newGestureState, MotionEvent event) {
+ TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
+ BubbleControllers bubbleControllers = tac != null ? tac.getBubbleControllers() : null;
+ if (bubbleControllers != null && BubbleBarInputConsumer.isEventOnBubbles(tac, event)) {
+ InputConsumer consumer = new BubbleBarInputConsumer(this, bubbleControllers,
+ mInputMonitorCompat);
+ logInputConsumerSelectionReason(consumer, newCompoundString(
+ "event is on bubbles, creating new input consumer"));
+ return consumer;
+ }
AnimatedFloat progressProxy = mSwipeUpProxyProvider.apply(mGestureState);
if (progressProxy != null) {
InputConsumer consumer = new ProgressDelegateInputConsumer(
@@ -1005,7 +1181,6 @@
}
// If Taskbar is present, we listen for swipe or cursor hover events to unstash it.
- TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
if (tac != null && !(base instanceof AssistantInputConsumer)) {
// Present always on large screen or on small screen w/ flag
boolean useTaskbarConsumer = tac.getDeviceProfile().isTaskbarPresent
@@ -1036,7 +1211,8 @@
NavHandle navHandle = tac != null ? tac.getNavHandle()
: SystemUiProxy.INSTANCE.get(this);
if (canStartSystemGesture && !previousGestureState.isRecentsAnimationRunning()
- && navHandle.canNavHandleBeLongPressed()) {
+ && navHandle.canNavHandleBeLongPressed()
+ && !ignoreThreeFingerTrackpadForNavHandleLongPress(mGestureState)) {
reasonString.append(NEWLINE_PREFIX)
.append(reasonPrefix)
.append(SUBSTRING_PREFIX)
@@ -1132,6 +1308,11 @@
return new CompoundString(NEWLINE_PREFIX).append(substring);
}
+ private boolean ignoreThreeFingerTrackpadForNavHandleLongPress(GestureState gestureState) {
+ return Flags.ignoreThreeFingerTrackpadForNavHandleLongPress()
+ && gestureState.isThreeFingerTrackpadGesture();
+ }
+
private void logInputConsumerSelectionReason(
InputConsumer consumer, CompoundString reasonString) {
ActiveGestureLog.INSTANCE.addLog(new CompoundString("setInputConsumer: ")
@@ -1173,7 +1354,7 @@
// running activity as the task behind the overlay.
TopTaskTracker.CachedTaskInfo otherVisibleTask = runningTask == null
? null
- : runningTask.otherVisibleTaskThisIsExcludedOver();
+ : runningTask.getVisibleNonExcludedTask();
if (otherVisibleTask != null) {
ActiveGestureLog.INSTANCE.addLog(new CompoundString("Changing active task to ")
.append(otherVisibleTask.getPackageName())
diff --git a/quickstep/src/com/android/quickstep/contextualeducation/SystemContextualEduStatsManager.java b/quickstep/src/com/android/quickstep/contextualeducation/SystemContextualEduStatsManager.java
new file mode 100644
index 0000000..d470b88
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/contextualeducation/SystemContextualEduStatsManager.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.contextualeducation;
+
+import android.content.Context;
+
+import com.android.launcher3.contextualeducation.ContextualEduStatsManager;
+import com.android.quickstep.SystemUiProxy;
+import com.android.systemui.contextualeducation.GestureType;
+
+/**
+ * A class to update contextual education data via {@link SystemUiProxy}
+ */
+public class SystemContextualEduStatsManager extends ContextualEduStatsManager {
+ private Context mContext;
+
+ public SystemContextualEduStatsManager(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public void updateEduStats(boolean isTrackpadGesture, GestureType gestureType) {
+ SystemUiProxy.INSTANCE.get(mContext).updateContextualEduStats(isTrackpadGesture,
+ gestureType.name());
+ }
+
+ @Override
+ public void close() {
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
index 2e76356..94764a5 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
@@ -42,16 +42,14 @@
import androidx.annotation.NonNull;
+import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
-import com.android.launcher3.util.MultiPropertyFactory;
import com.android.quickstep.RecentsActivity;
import com.android.quickstep.views.ClearAllButton;
-import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
-import com.android.quickstep.views.RecentsViewContainer;
/**
* State controller for fallback recents activity
@@ -99,7 +97,7 @@
clearAllButtonAlpha, LINEAR);
float overviewButtonAlpha = state.hasOverviewActions() ? 1 : 0;
setter.setFloat(mActivity.getActionsView().getVisibilityAlpha(),
- MultiPropertyFactory.MULTI_PROPERTY_VALUE, overviewButtonAlpha, LINEAR);
+ AnimatedFloat.VALUE, overviewButtonAlpha, LINEAR);
float[] scaleAndOffset = state.getOverviewScaleAndOffset(mActivity);
setter.setFloat(mRecentsView, RECENTS_SCALE_PROPERTY, scaleAndOffset[0],
@@ -138,7 +136,7 @@
}
private Interpolator getOverviewInterpolator(RecentsState toState) {
- return toState.overviewUi() ? INSTANT : FINAL_FRAME;
+ return toState.isRecentsViewVisible() ? INSTANT : FINAL_FRAME;
}
/**
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index b79586b..f4a2738 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -54,6 +54,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsState>
implements StateListener<RecentsState> {
@@ -92,7 +93,7 @@
}
@Override
- public StateManager<RecentsState> getStateManager() {
+ public StateManager<RecentsState, RecentsActivity> getStateManager() {
return mContainer.getStateManager();
}
@@ -179,7 +180,7 @@
}
@Override
- protected void applyLoadPlan(ArrayList<GroupTask> taskGroups) {
+ protected void applyLoadPlan(List<GroupTask> taskGroups) {
// When quick-switching on 3p-launcher, we add a "stub" tile corresponding to Launcher
// as well. This tile is never shown as we have setCurrentTaskHidden, but allows use to
// track the index of the next task appropriately, as if we are switching on any other app.
@@ -247,7 +248,7 @@
}
// Set border after select mode changes to avoid showing border during state transition
- if (!toState.overviewUi() || toState == MODAL_TASK) {
+ if (!toState.isRecentsViewVisible() || toState == MODAL_TASK) {
setTaskBorderEnabled(false);
}
@@ -267,7 +268,7 @@
setOverviewSelectEnabled(false);
}
- if (finalState.overviewUi() && finalState != MODAL_TASK) {
+ if (finalState.isRecentsViewVisible() && finalState != MODAL_TASK) {
setTaskBorderEnabled(true);
}
@@ -298,7 +299,7 @@
public boolean onTouchEvent(MotionEvent ev) {
boolean result = super.onTouchEvent(ev);
// Do not let touch escape to siblings below this view.
- return result || mContainer.getStateManager().getState().overviewUi();
+ return result || mContainer.getStateManager().getState().isRecentsViewVisible();
}
@Override
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index 84937a2..ca9753f 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -26,7 +26,6 @@
import com.android.launcher3.R;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.util.Themes;
-import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
/**
@@ -41,22 +40,23 @@
private static final int FLAG_SHOW_AS_GRID = BaseState.getFlag(4);
private static final int FLAG_SCRIM = BaseState.getFlag(5);
private static final int FLAG_LIVE_TILE = BaseState.getFlag(6);
- private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7);
+ private static final int FLAG_RECENTS_VIEW_VISIBLE = BaseState.getFlag(7);
private static final int FLAG_TASK_THUMBNAIL_SPLASH = BaseState.getFlag(8);
public static final RecentsState DEFAULT = new RecentsState(0,
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID
- | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
+ | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_RECENTS_VIEW_VISIBLE);
public static final RecentsState MODAL_TASK = new ModalState(1,
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL
- | FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
+ | FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_RECENTS_VIEW_VISIBLE);
public static final RecentsState BACKGROUND_APP = new BackgroundAppState(2,
- FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI
+ FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN
+ | FLAG_RECENTS_VIEW_VISIBLE
| FLAG_TASK_THUMBNAIL_SPLASH);
public static final RecentsState HOME = new RecentsState(3, 0);
public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0);
public static final RecentsState OVERVIEW_SPLIT_SELECT = new RecentsState(5,
- FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_OVERVIEW_UI | FLAG_CLOSE_POPUPS
+ FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_RECENTS_VIEW_VISIBLE | FLAG_CLOSE_POPUPS
| FLAG_DISABLE_RESTORE);
public final int ordinal;
@@ -152,8 +152,8 @@
/**
* True if the state has overview panel visible.
*/
- public boolean overviewUi() {
- return hasFlag(FLAG_OVERVIEW_UI);
+ public boolean isRecentsViewVisible() {
+ return hasFlag(FLAG_RECENTS_VIEW_VISIBLE);
}
private static class ModalState extends RecentsState {
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/BubbleBarInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/BubbleBarInputConsumer.java
new file mode 100644
index 0000000..dbe2068
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/inputconsumers/BubbleBarInputConsumer.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.inputconsumers;
+
+import static android.view.MotionEvent.INVALID_POINTER_ID;
+
+import android.content.Context;
+import android.graphics.PointF;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+import com.android.launcher3.taskbar.TaskbarActivityContext;
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController;
+import com.android.launcher3.taskbar.bubbles.BubbleControllers;
+import com.android.launcher3.taskbar.bubbles.BubbleDragController;
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
+import com.android.launcher3.testing.TestLogging;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.quickstep.InputConsumer;
+import com.android.systemui.shared.system.InputMonitorCompat;
+
+/**
+ * Listens for touch events on the bubble bar.
+ */
+public class BubbleBarInputConsumer implements InputConsumer {
+
+ private final BubbleStashController mBubbleStashController;
+ private final BubbleBarViewController mBubbleBarViewController;
+ private final BubbleDragController mBubbleDragController;
+ private final InputMonitorCompat mInputMonitorCompat;
+
+ private boolean mSwipeUpOnBubbleHandle;
+ private boolean mPassedTouchSlop;
+
+ private final int mTouchSlop;
+ private final PointF mDownPos = new PointF();
+ private final PointF mLastPos = new PointF();
+ private final long mTimeForTap;
+ private int mActivePointerId = INVALID_POINTER_ID;
+
+ public BubbleBarInputConsumer(Context context, BubbleControllers bubbleControllers,
+ InputMonitorCompat inputMonitorCompat) {
+ mBubbleStashController = bubbleControllers.bubbleStashController;
+ mBubbleBarViewController = bubbleControllers.bubbleBarViewController;
+ mBubbleDragController = bubbleControllers.bubbleDragController;
+ mInputMonitorCompat = inputMonitorCompat;
+ mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
+ mTimeForTap = ViewConfiguration.getTapTimeout();
+ }
+
+ @Override
+ public int getType() {
+ return TYPE_BUBBLE_BAR;
+ }
+
+ @Override
+ public void onMotionEvent(MotionEvent ev) {
+ final boolean isStashed = mBubbleStashController.isStashed();
+ final int action = ev.getAction();
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ mActivePointerId = ev.getPointerId(0);
+ mDownPos.set(ev.getX(), ev.getY());
+ mLastPos.set(mDownPos);
+ break;
+ case MotionEvent.ACTION_MOVE:
+ int pointerIndex = ev.findPointerIndex(mActivePointerId);
+ if (pointerIndex == INVALID_POINTER_ID) {
+ break;
+ }
+ mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
+
+ float dX = mLastPos.x - mDownPos.x;
+ float dY = mLastPos.y - mDownPos.y;
+ if (!mPassedTouchSlop) {
+ mPassedTouchSlop = Math.abs(dY) > mTouchSlop || Math.abs(dX) > mTouchSlop;
+ }
+ if ((isCollapsed() || isStashed) && !mSwipeUpOnBubbleHandle && mPassedTouchSlop) {
+ boolean verticalGesture = Math.abs(dY) > Math.abs(dX);
+ if (verticalGesture && !mBubbleDragController.isDragging()) {
+ mSwipeUpOnBubbleHandle = true;
+ mBubbleStashController.showBubbleBar(/* expandBubbles= */ true);
+ // Bubbles is handling the swipe so make sure no one else gets it.
+ TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
+ mInputMonitorCompat.pilferPointers();
+ }
+ }
+ break;
+ case MotionEvent.ACTION_UP:
+ boolean isWithinTapTime = ev.getEventTime() - ev.getDownTime() <= mTimeForTap;
+ if (isWithinTapTime && !mSwipeUpOnBubbleHandle && !mPassedTouchSlop) {
+ // Taps on the handle / collapsed state should open the bar
+ if (isStashed || isCollapsed()) {
+ mBubbleStashController.showBubbleBar(/* expandBubbles= */ true);
+ }
+ }
+ break;
+ }
+ if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
+ cleanupAfterMotionEvent();
+ }
+ }
+
+ private void cleanupAfterMotionEvent() {
+ mPassedTouchSlop = false;
+ mSwipeUpOnBubbleHandle = false;
+ }
+
+ private boolean isCollapsed() {
+ return mBubbleStashController.isBubbleBarVisible()
+ && !mBubbleBarViewController.isExpanded();
+ }
+
+ /**
+ * Returns whether the event is occurring on a visible bubble bar or the bar handle.
+ */
+ public static boolean isEventOnBubbles(TaskbarActivityContext tac, MotionEvent ev) {
+ if (tac == null || !tac.isBubbleBarEnabled()) {
+ return false;
+ }
+ BubbleControllers controllers = tac.getBubbleControllers();
+ if (controllers == null || !controllers.bubbleBarViewController.hasBubbles()) {
+ return false;
+ }
+ if (controllers.bubbleStashController.isStashed()
+ && controllers.bubbleStashedHandleViewController.isPresent()) {
+ return controllers.bubbleStashedHandleViewController.get().isEventOverHandle(ev);
+ } else if (controllers.bubbleBarViewController.isBubbleBarVisible()) {
+ return controllers.bubbleBarViewController.isEventOverBubbleBar(ev);
+ }
+ return false;
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
index f264364..14f47d1 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
@@ -58,7 +58,6 @@
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.util.TransformParams.BuilderProxy;
import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputMonitorCompat;
import java.util.HashMap;
@@ -278,9 +277,7 @@
}
private void endRemoteAnimation() {
- if (mHomeLaunched) {
- ActivityManagerWrapper.getInstance().cancelRecentsAnimation(false);
- } else if (mRecentsAnimationController != null) {
+ if (!mHomeLaunched && mRecentsAnimationController != null) {
mRecentsAnimationController.finishController(
false /* toRecents */, null /* callback */, false /* sendUserLeaveHint */);
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
index 848a43a..f4d3695 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
@@ -27,6 +27,8 @@
import android.view.MotionEvent;
import android.view.ViewConfiguration;
+import androidx.annotation.VisibleForTesting;
+
import com.android.launcher3.Utilities;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.util.DisplayController;
@@ -48,7 +50,7 @@
private static final boolean DEBUG_NAV_HANDLE = Utilities.isPropertyEnabled(
NAV_HANDLE_LONG_PRESS);
- private final NavHandleLongPressHandler mNavHandleLongPressHandler;
+ private NavHandleLongPressHandler mNavHandleLongPressHandler;
private final float mNavHandleWidth;
private final float mScreenWidth;
@@ -73,17 +75,32 @@
super(delegate, inputMonitor);
mScreenWidth = DisplayController.INSTANCE.get(context).getInfo().currentSize.x;
mDeepPressEnabled = DeviceConfigWrapper.get().getEnableLpnhDeepPress();
- int twoStageMultiplier = DeviceConfigWrapper.get().getTwoStageMultiplier();
AssistStateManager assistStateManager = AssistStateManager.INSTANCE.get(context);
if (assistStateManager.getLPNHDurationMillis().isPresent()) {
mLongPressTimeout = assistStateManager.getLPNHDurationMillis().get().intValue();
} else {
mLongPressTimeout = ViewConfiguration.getLongPressTimeout();
}
- mOuterLongPressTimeout = mLongPressTimeout * twoStageMultiplier;
- mTouchSlopSquaredOriginal = deviceState.getSquaredTouchSlop();
- mTouchSlopSquared = mTouchSlopSquaredOriginal;
- mOuterTouchSlopSquared = mTouchSlopSquared * (twoStageMultiplier * twoStageMultiplier);
+ float twoStageDurationMultiplier =
+ (DeviceConfigWrapper.get().getTwoStageDurationPercentage() / 100f);
+ mOuterLongPressTimeout = (int) (mLongPressTimeout * twoStageDurationMultiplier);
+
+ float gestureNavTouchSlopSquared = deviceState.getSquaredTouchSlop();
+ float twoStageSlopMultiplier =
+ (DeviceConfigWrapper.get().getTwoStageSlopPercentage() / 100f);
+ float twoStageSlopMultiplierSquared = twoStageSlopMultiplier * twoStageSlopMultiplier;
+ if (DeviceConfigWrapper.get().getEnableLpnhTwoStages()) {
+ // For 2 stages, the outer touch slop should match gesture nav.
+ mTouchSlopSquared = gestureNavTouchSlopSquared * twoStageSlopMultiplierSquared;
+ mOuterTouchSlopSquared = gestureNavTouchSlopSquared;
+ } else {
+ // For single stage, the touch slop should match gesture nav.
+ mTouchSlopSquared = gestureNavTouchSlopSquared;
+ // Note: This outer slop is not actually used for single-stage (flag disabled).
+ mOuterTouchSlopSquared = gestureNavTouchSlopSquared;
+ }
+ mTouchSlopSquaredOriginal = mTouchSlopSquared;
+
mGestureState = gestureState;
mGestureState.setIsInExtendedSlopRegion(false);
if (DEBUG_NAV_HANDLE) {
@@ -250,4 +267,9 @@
protected String getDelegatorName() {
return "NavHandleLongPressInputConsumer";
}
+
+ @VisibleForTesting
+ void setNavHandleLongPressHandler(NavHandleLongPressHandler navHandleLongPressHandler) {
+ mNavHandleLongPressHandler = navHandleLongPressHandler;
+ }
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
index 0d450c6..69d3bc9 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
@@ -70,6 +70,9 @@
*/
public class OtherActivityInputConsumer extends ContextWrapper implements InputConsumer {
+ private static final String TAG = "OtherActivityInputConsumer";
+ private static final boolean DEBUG = true;
+
public static final String DOWN_EVT = "OtherActivityInputConsumer.DOWN";
private static final String UP_EVT = "OtherActivityInputConsumer.UP";
@@ -230,6 +233,9 @@
// Start the window animation on down to give more time for launcher to draw if the
// user didn't start the gesture over the back button
+ if (DEBUG) {
+ Log.d(TAG, "ACTION_DOWN: mIsDeferredDownTarget=" + mIsDeferredDownTarget);
+ }
if (!mIsDeferredDownTarget) {
startTouchTrackingForWindowAnimation(ev.getEventTime());
}
@@ -284,9 +290,18 @@
float horizontalDist = Math.abs(displacementX);
float upDist = -displacement;
- boolean passedSlop = mGestureState.isTrackpadGesture()
- || (squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop
- && !mGestureState.isInExtendedSlopRegion());
+ boolean isTrackpadGesture = mGestureState.isTrackpadGesture();
+ float squaredHypot = squaredHypot(displacementX, displacementY);
+ boolean isInExtendedSlopRegion = !mGestureState.isInExtendedSlopRegion();
+ boolean passedSlop = isTrackpadGesture
+ || (squaredHypot >= mSquaredTouchSlop
+ && isInExtendedSlopRegion);
+ if (DEBUG) {
+ Log.d(TAG, "ACTION_MOVE: passedSlop=" + passedSlop
+ + " ( " + isTrackpadGesture
+ + " || (" + squaredHypot + " >= " + mSquaredTouchSlop
+ + " && " + isInExtendedSlopRegion + " ))");
+ }
if (!mPassedSlopOnThisGesture && passedSlop) {
mPassedSlopOnThisGesture = true;
@@ -306,6 +321,9 @@
boolean isLikelyToStartNewTask =
haveNotPassedSlopOnContinuedGesture || swipeWithinQuickSwitchRange;
+ if (DEBUG) {
+ Log.d(TAG, "ACTION_MOVE: mPassedPilferInputSlop=" + mPassedPilferInputSlop);
+ }
if (!mPassedPilferInputSlop) {
if (passedSlop) {
// Horizontal gesture is not allowed in this region
@@ -391,9 +409,14 @@
mInteractionHandler = mHandlerFactory.newHandler(mGestureState, touchTimeMs);
mInteractionHandler.setGestureEndCallback(this::onInteractionGestureFinished);
mMotionPauseDetector.setOnMotionPauseListener(mInteractionHandler.getMotionPauseListener());
+ mMotionPauseDetector.setIsTrackpadGesture(mGestureState.isTrackpadGesture());
mInteractionHandler.initWhenReady(
"OtherActivityInputConsumer.startTouchTrackingForWindowAnimation");
+ if (DEBUG) {
+ Log.d(TAG, "startTouchTrackingForWindowAnimation: isRecentsAnimationRunning="
+ + mTaskAnimationManager.isRecentsAnimationRunning());
+ }
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(mGestureState);
mActiveCallbacks.removeListener(mCleanupHandler);
@@ -422,6 +445,11 @@
*/
private void finishTouchTracking(MotionEvent ev) {
TraceHelper.INSTANCE.beginSection(UP_EVT);
+ if (DEBUG) {
+ Log.d(TAG, "finishTouchTracking: mPassedWindowMoveSlop=" + mPassedWindowMoveSlop);
+ Log.d(TAG, "finishTouchTracking: mInteractionHandler=" + mInteractionHandler);
+ Log.d(TAG, "finishTouchTracking: ev=" + ev);
+ }
boolean isCanceled = ev.getActionMasked() == ACTION_CANCEL;
if (mPassedWindowMoveSlop && mInteractionHandler != null) {
@@ -444,7 +472,14 @@
// Since we start touch tracking on DOWN, we may reach this state without actually
// starting the gesture. In that case, we need to clean-up an unfinished or un-started
// animation.
+ if (DEBUG) {
+ Log.d(TAG, "finishTouchTracking: mActiveCallbacks=" + mActiveCallbacks);
+ }
if (mActiveCallbacks != null && mInteractionHandler != null) {
+ if (DEBUG) {
+ Log.d(TAG, "finishTouchTracking: isRecentsAnimationRunning="
+ + mTaskAnimationManager.isRecentsAnimationRunning());
+ }
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
// The animation started, but with no movement, in this case, there will be no
// animateToProgress so we have to manually finish here. In the case of
@@ -535,7 +570,13 @@
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
+ if (DEBUG) {
+ Log.d(TAG, "FinishImmediatelyHandler: queuing callback");
+ }
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
+ if (DEBUG) {
+ Log.d(TAG, "FinishImmediatelyHandler: running callback");
+ }
controller.finish(false /* toRecents */, null);
});
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
index 6b3e6e9..17a97fa 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
@@ -15,12 +15,11 @@
*/
package com.android.quickstep.inputconsumers;
-import static android.view.MotionEvent.ACTION_CANCEL;
import static android.view.MotionEvent.ACTION_MOVE;
-import static android.view.MotionEvent.ACTION_UP;
import static android.view.MotionEvent.INVALID_POINTER_ID;
import static com.android.launcher3.Flags.enableCursorHoverStates;
+import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING;
@@ -28,8 +27,11 @@
import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.os.Handler;
+import android.os.Looper;
import android.view.InputDevice;
import android.view.MotionEvent;
+import android.view.VelocityTracker;
import android.view.ViewConfiguration;
import androidx.annotation.Nullable;
@@ -39,7 +41,6 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarThresholdUtils;
import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback;
-import com.android.launcher3.taskbar.bubbles.BubbleControllers;
import com.android.launcher3.touch.OverScroll;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.GestureState;
@@ -52,6 +53,12 @@
*/
public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
+ private static final int HOVER_TASKBAR_UNSTASH_TIMEOUT = 500;
+
+ private static final int NUM_MOTION_MOVE_THRESHOLD = 3;
+
+ private static final Handler sUnstashHandler = new Handler(Looper.getMainLooper());
+
private final TaskbarActivityContext mTaskbarActivityContext;
private final OverviewCommandHelper mOverviewCommandHelper;
private final float mUnstashArea;
@@ -59,9 +66,6 @@
private final int mTaskbarNavThresholdY;
private final boolean mIsTaskbarAllAppsOpen;
private boolean mHasPassedTaskbarNavThreshold;
- private boolean mIsInBubbleBarArea;
- private boolean mIsVerticalGestureOverBubbleBar;
- private boolean mIsPassedBubbleBarSlop;
private final int mTouchSlop;
private final PointF mDownPos = new PointF();
@@ -78,6 +82,11 @@
private final @Nullable TransitionCallback mTransitionCallback;
private final GestureState mGestureState;
+ private VelocityTracker mVelocityTracker;
+ private boolean mCanPlayTaskbarBgAlphaAnimation = true;
+ private int mMotionMoveCount = 0;
+ // Velocity defined as dp per s
+ private float mTaskbarSlowVelocityYThreshold;
public TaskbarUnstashInputConsumer(Context context, InputConsumer delegate,
InputMonitorCompat inputMonitor, TaskbarActivityContext taskbarActivityContext,
@@ -96,6 +105,8 @@
mIsTaskbarAllAppsOpen = mTaskbarActivityContext.isTaskbarAllAppsOpen();
mIsTransientTaskbar = DisplayController.isTransientTaskbar(context);
+ mTaskbarSlowVelocityYThreshold =
+ res.getDimensionPixelSize(R.dimen.taskbar_slow_velocity_y_threshold);
mBottomScreenEdge = res.getDimensionPixelSize(
R.dimen.taskbar_stashed_screen_edge_hover_deadzone_height);
@@ -120,6 +131,9 @@
@Override
public void onMotionEvent(MotionEvent ev) {
+ if (enableScalingRevealHomeAnimation() && mIsTransientTaskbar) {
+ checkVelocityForTaskbarBackground(ev);
+ }
if (mState != STATE_ACTIVE) {
boolean isStashedTaskbarHovered = isMouseEvent(ev)
&& isStashedTaskbarHovered((int) ev.getX(), (int) ev.getY());
@@ -139,9 +153,6 @@
if (mTransitionCallback != null && !mIsTaskbarAllAppsOpen) {
mTransitionCallback.onActionDown();
}
- if (mIsTransientTaskbar && isInBubbleBarArea(x)) {
- mIsInBubbleBarArea = true;
- }
break;
case MotionEvent.ACTION_POINTER_UP:
int ptrIdx = ev.getActionIndex();
@@ -165,18 +176,6 @@
float dX = mLastPos.x - mDownPos.x;
float dY = mLastPos.y - mDownPos.y;
- if (!mIsPassedBubbleBarSlop && mIsInBubbleBarArea) {
- boolean passedSlop =
- Math.abs(dY) > mTouchSlop || Math.abs(dX) > mTouchSlop;
- if (passedSlop) {
- mIsPassedBubbleBarSlop = true;
- mIsVerticalGestureOverBubbleBar = Math.abs(dY) > Math.abs(dX);
- if (mIsVerticalGestureOverBubbleBar) {
- setActive(ev);
- }
- }
- }
-
if (mIsTransientTaskbar) {
boolean passedTaskbarNavThreshold = dY < 0
&& Math.abs(dY) >= mTaskbarNavThreshold;
@@ -184,11 +183,7 @@
if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold
&& !mGestureState.isInExtendedSlopRegion()) {
mHasPassedTaskbarNavThreshold = true;
- if (mIsInBubbleBarArea && mIsVerticalGestureOverBubbleBar) {
- mTaskbarActivityContext.onSwipeToOpenBubblebar();
- } else {
- mTaskbarActivityContext.onSwipeToUnstashTaskbar();
- }
+ mTaskbarActivityContext.onSwipeToUnstashTaskbar();
}
if (dY < 0) {
@@ -210,42 +205,34 @@
break;
}
}
- boolean isMovingInBubbleBarArea = mIsInBubbleBarArea && ev.getAction() == ACTION_MOVE;
if (!isStashedTaskbarHovered) {
- // if we're moving in the bubble bar area but we haven't passed the slop yet, don't
- // propagate to the delegate, until we can determine the direction of the gesture.
- if (!isMovingInBubbleBarArea || mIsPassedBubbleBarSlop) {
- mDelegate.onMotionEvent(ev);
- }
+ mDelegate.onMotionEvent(ev);
}
- } else if (mIsVerticalGestureOverBubbleBar) {
- // if we get here then this gesture is a vertical swipe over the bubble bar.
- // we're also active and there's no need to delegate any additional motion events. the
- // rest of the gesture will be handled here.
- switch (ev.getAction()) {
- case ACTION_MOVE:
- int pointerIndex = ev.findPointerIndex(mActivePointerId);
- if (pointerIndex == INVALID_POINTER_ID) {
- break;
- }
- mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
+ }
+ }
- float dY = mLastPos.y - mDownPos.y;
+ private void checkVelocityForTaskbarBackground(MotionEvent ev) {
+ int actionMasked = ev.getActionMasked();
+ if (actionMasked == MotionEvent.ACTION_DOWN && mVelocityTracker != null) {
+ mVelocityTracker.clear();
+ }
+ if (mVelocityTracker == null) {
+ mVelocityTracker = VelocityTracker.obtain();
+ }
+ mVelocityTracker.addMovement(ev);
- // bubble bar swipe gesture uses the same threshold as the taskbar.
- boolean passedTaskbarNavThreshold = dY < 0
- && Math.abs(dY) >= mTaskbarNavThreshold;
+ mVelocityTracker.computeCurrentVelocity(1000);
+ if (ev.getAction() == ACTION_MOVE) {
+ mMotionMoveCount++;
+ }
- if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
- mHasPassedTaskbarNavThreshold = true;
- mTaskbarActivityContext.onSwipeToOpenBubblebar();
- }
- break;
- case ACTION_UP:
- case ACTION_CANCEL:
- cleanupAfterMotionEvent();
- break;
- }
+ float velocityYPxPerS = mVelocityTracker.getYVelocity();
+ if (mCanPlayTaskbarBgAlphaAnimation
+ && mMotionMoveCount >= NUM_MOTION_MOVE_THRESHOLD // Arbitrary value
+ && velocityYPxPerS != 0 // Ignore these
+ && velocityYPxPerS >= mTaskbarSlowVelocityYThreshold) {
+ mTaskbarActivityContext.playTaskbarBackgroundAlphaAnimation();
+ mCanPlayTaskbarBgAlphaAnimation = false;
}
}
@@ -256,25 +243,13 @@
mTransitionCallback.onActionEnd();
}
mHasPassedTaskbarNavThreshold = false;
- mIsInBubbleBarArea = false;
- mIsVerticalGestureOverBubbleBar = false;
- mIsPassedBubbleBarSlop = false;
- }
- private boolean isInBubbleBarArea(float x) {
- if (mTaskbarActivityContext == null || !mIsTransientTaskbar) {
- return false;
+ if (mVelocityTracker != null) {
+ mVelocityTracker.recycle();
}
- BubbleControllers controllers = mTaskbarActivityContext.getBubbleControllers();
- if (controllers == null) {
- return false;
- }
- if (controllers.bubbleStashController.isStashed()) {
- return controllers.bubbleStashedHandleViewController.containsX((int) x);
- } else {
- Rect bubbleBarBounds = controllers.bubbleBarViewController.getBubbleBarBounds();
- return x >= bubbleBarBounds.left && x <= bubbleBarBounds.right;
- }
+ mVelocityTracker = null;
+ mCanPlayTaskbarBgAlphaAnimation = true;
+ mMotionMoveCount = 0;
}
/**
@@ -308,16 +283,25 @@
dp.heightPx);
if (mBottomEdgeBounds.contains(x, y)) {
- // If hovering stashed taskbar and then hover screen bottom edge, unstash it.
- mTaskbarActivityContext.onSwipeToUnstashTaskbar();
- mIsStashedTaskbarHovered = false;
+ // start a single unstash timeout if hovering bottom edge under the hinted taskbar.
+ if (!sUnstashHandler.hasMessagesOrCallbacks()) {
+ sUnstashHandler.postDelayed(() -> {
+ mTaskbarActivityContext.onSwipeToUnstashTaskbar();
+ mIsStashedTaskbarHovered = false;
+ }, HOVER_TASKBAR_UNSTASH_TIMEOUT);
+ }
} else if (!isStashedTaskbarHovered(x, y)) {
- // If exit hovering stashed taskbar, remove hint.
+ // If exit hovering stashed taskbar, remove hint and clear pending unstash calls.
+ sUnstashHandler.removeCallbacksAndMessages(null);
startStashedTaskbarHover(/* isHovered = */ false);
+ } else {
+ sUnstashHandler.removeCallbacksAndMessages(null);
}
}
private void updateUnhoveredTaskbarState(int x, int y) {
+ sUnstashHandler.removeCallbacksAndMessages(null);
+
DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile();
mBottomEdgeBounds.set(
0,
diff --git a/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java b/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java
index 4f1dbbe..36ea926 100644
--- a/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java
+++ b/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java
@@ -59,6 +59,7 @@
@Nullable private TutorialType[] mTutorialSteps;
private GestureSandboxFragment mCurrentFragment;
+ private GestureSandboxFragment mPendingFragment;
private int mCurrentStep;
private int mNumSteps;
@@ -176,16 +177,26 @@
&& getResources().getConfiguration().orientation
== ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
- showFragment(showRotationPrompt
+ GestureSandboxFragment fragment = showRotationPrompt
? new RotationPromptFragment()
- : mCurrentFragment.canRecreateFragment()
- ? mCurrentFragment.recreateFragment() : mCurrentFragment);
+ : mCurrentFragment.canRecreateFragment() || mPendingFragment == null
+ ? mCurrentFragment.recreateFragment()
+ : mPendingFragment.recreateFragment();
+ showFragment(fragment == null ? mCurrentFragment : fragment);
+
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
private void showFragment(@NonNull GestureSandboxFragment fragment) {
+ // Store the current fragment in mPendingFragment so that it can be recreated after the
+ // new fragment is shown.
+ if (mCurrentFragment.canRecreateFragment()) {
+ mPendingFragment = mCurrentFragment;
+ } else {
+ mPendingFragment = null;
+ }
mCurrentFragment = fragment;
getSupportFragmentManager().beginTransaction()
.replace(R.id.gesture_tutorial_fragment_container, mCurrentFragment)
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index d5cc447..ad13efb 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -382,7 +382,7 @@
}
@Override
- public void update(RectF rect, float progress, float radius) {
+ public void update(RectF rect, float progress, float radius, int overlayAlpha) {
mFakeIconView.setVisibility(View.VISIBLE);
mFakeIconView.update(rect, progress,
1f - SHAPE_PROGRESS_DURATION /* shapeProgressStart */,
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index f89888a..54653fa 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -782,7 +782,6 @@
(RelativeLayout.LayoutParams) mFakeHotseatView.getLayoutParams();
if (!mTutorialFragment.isLargeScreen()) {
DeviceProfile dp = mTutorialFragment.getDeviceProfile();
- dp.updateIsSeascape(mContext);
hotseatLayoutParams.addRule(dp.isLandscape
? (dp.isSeascape()
diff --git a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
index f8d695c..717f6c8 100644
--- a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
+++ b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
@@ -39,7 +39,8 @@
import android.util.Log;
import android.util.Xml;
-import com.android.launcher3.AutoInstallsLayout;
+import androidx.annotation.VisibleForTesting;
+
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.logging.InstanceId;
@@ -73,7 +74,6 @@
new MainThreadInitializedObject<>(SettingsChangeLogger::new);
private static final String TAG = "SettingsChangeLogger";
- private static final String ROOT_TAG = "androidx.preference.PreferenceScreen";
private static final String BOOLEAN_PREF = "SwitchPreference";
private final Context mContext;
@@ -85,8 +85,13 @@
private StatsLogManager.LauncherEvent mHomeScreenSuggestionEvent;
private SettingsChangeLogger(Context context) {
+ this(context, StatsLogManager.newInstance(context));
+ }
+
+ @VisibleForTesting
+ SettingsChangeLogger(Context context, StatsLogManager statsLogManager) {
mContext = context;
- mStatsLogManager = StatsLogManager.newInstance(mContext);
+ mStatsLogManager = statsLogManager;
mLoggablePrefs = loadPrefKeys(context);
DisplayController.INSTANCE.get(context).addChangeListener(this);
mNavMode = DisplayController.getNavigationMode(context);
@@ -105,7 +110,13 @@
ArrayMap<String, LoggablePref> result = new ArrayMap<>();
try {
- AutoInstallsLayout.beginDocument(parser, ROOT_TAG);
+ // Move cursor to first tag because it could be
+ // androidx.preference.PreferenceScreen or PreferenceScreen
+ int eventType = parser.getEventType();
+ while (eventType != XmlPullParser.START_TAG
+ && eventType != XmlPullParser.END_DOCUMENT) {
+ eventType = parser.next();
+ }
final int depth = parser.getDepth();
int type;
while (((type = parser.next()) != XmlPullParser.END_TAG
@@ -148,7 +159,7 @@
@Override
public void onDisplayInfoChanged(Context context, Info info, int flags) {
if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
- mNavMode = info.navigationMode;
+ mNavMode = info.getNavigationMode();
mStatsLogManager.logger().log(mNavMode.launcherEvent);
}
}
@@ -189,13 +200,19 @@
prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
}
+ @VisibleForTesting
+ ArrayMap<String, LoggablePref> getLoggingPrefs() {
+ return mLoggablePrefs;
+ }
+
@Override
public void close() {
getPrefs(mContext).unregisterOnSharedPreferenceChangeListener(this);
getDevicePrefs(mContext).unregisterOnSharedPreferenceChangeListener(this);
}
- private static class LoggablePref {
+ @VisibleForTesting
+ static class LoggablePref {
public boolean defaultValue;
public int eventIdOn;
public int eventIdOff;
diff --git a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
index ed633df..1d4160d 100644
--- a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
+++ b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
@@ -16,6 +16,10 @@
package com.android.quickstep.logging;
+import static android.view.Surface.ROTATION_180;
+import static android.view.Surface.ROTATION_270;
+import static android.view.Surface.ROTATION_90;
+
import static androidx.core.util.Preconditions.checkNotNull;
import static androidx.core.util.Preconditions.checkState;
@@ -26,10 +30,17 @@
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo.ContainerCase.SEARCH_RESULT_CONTAINER;
import static com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers.ContainerCase.DEVICE_SEARCH_RESULT_CONTAINER;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_SNAPSHOT;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_0;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_90;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_180;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_270;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__ALLAPPS;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__BACKGROUND;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__HOME;
import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__DST_STATE__OVERVIEW;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__PORTRAIT;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__LANDSCAPE;
+import static com.android.systemui.shared.system.SysUiStatsLog.LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__SEASCAPE;
import android.content.Context;
import android.text.TextUtils;
@@ -58,11 +69,8 @@
import com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.StatsLogManager;
-import com.android.launcher3.model.AllAppsList;
-import com.android.launcher3.model.BaseModelUpdateTask;
-import com.android.launcher3.model.BgDataModel;
-import com.android.launcher3.model.data.CollectionInfo;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.LogConfig;
import com.android.launcher3.views.ActivityContext;
@@ -230,10 +238,15 @@
private int mInputType = SysUiStatsLog.LAUNCHER_UICHANGED__INPUT_TYPE__UNKNOWN;
private Optional<Integer> mFeatures = Optional.empty();
private Optional<String> mPackageName = Optional.empty();
+ /**
+ * Indicates the current rotation of the display. Uses {@link android.view.Surface values.}
+ */
+ private final int mDisplayRotation;
StatsCompatLogger(Context context, ActivityContext activityContext) {
mContext = context;
mActivityContext = Optional.ofNullable(activityContext);
+ mDisplayRotation = DisplayController.INSTANCE.get(mContext).getInfo().rotation;
}
@Override
@@ -371,17 +384,9 @@
if (mItemInfo.container < 0 || !LauncherAppState.INSTANCE.executeIfCreated(app -> {
// Item is inside a collection, fetch collection info in a BG thread
// and then write to StatsLog.
- app.getModel().enqueueModelUpdateTask(
- new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
- CollectionInfo collectionInfo =
- dataModel.collections.get(mItemInfo.container);
- write(event, applyOverwrites(mItemInfo.buildProto(collectionInfo)));
- }
- });
+ app.getModel().enqueueModelUpdateTask((taskController, dataModel, apps) ->
+ write(event, applyOverwrites(mItemInfo.buildProto(
+ dataModel.collections.get(mItemInfo.container)))));
})) {
// Write log on the model thread so that logs do not go out of order
// (for eg: drop comes after drag)
@@ -404,6 +409,20 @@
case LAUNCHER_ALLAPPS_VERTICAL_SWIPE_END:
InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_ALL_APPS_SCROLL);
break;
+ case LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_BEGIN:
+ InteractionJankMonitorWrapper.begin(view, Cuj.CUJ_LAUNCHER_PRIVATE_SPACE_LOCK);
+ break;
+ case LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_END:
+ InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_PRIVATE_SPACE_LOCK);
+ break;
+ case LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_BEGIN:
+ InteractionJankMonitorWrapper.begin(
+ view,
+ Cuj.CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK);
+ break;
+ case LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_END:
+ InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK);
+ break;
default:
break;
}
@@ -500,7 +519,28 @@
getSearchAttributes(atomInfo) /* searchAttributes */,
getAttributes(atomInfo) /* attributes */,
inputType /* input_type */,
- atomInfo.getUserType() /* user_type */);
+ atomInfo.getUserType() /* user_type */,
+ getDisplayRotation() /* display_rotation */,
+ getRecentsOrientationHandler(atomInfo) /* recents_orientation_handler */);
+ }
+
+ private int getDisplayRotation() {
+ return switch (mDisplayRotation) {
+ case ROTATION_90 -> LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_90;
+ case ROTATION_180 -> LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_180;
+ case ROTATION_270 -> LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_270;
+ default -> LAUNCHER_UICHANGED__DISPLAY_ROTATION__ROTATION_0;
+ };
+ }
+
+ private int getRecentsOrientationHandler(LauncherAtom.ItemInfo itemInfo) {
+ var orientationHandler =
+ itemInfo.getContainerInfo().getTaskSwitcherContainer().getOrientationHandler();
+ return switch (orientationHandler) {
+ case PORTRAIT -> LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__PORTRAIT;
+ case LANDSCAPE -> LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__LANDSCAPE;
+ case SEASCAPE -> LAUNCHER_UICHANGED__RECENTS_ORIENTATION_HANDLER__SEASCAPE;
+ };
}
}
diff --git a/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.kt b/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.kt
index 1640104..ec04cb7 100644
--- a/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.kt
+++ b/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.kt
@@ -42,6 +42,7 @@
import com.android.launcher3.LauncherAnimUtils
import com.android.launcher3.R
import com.android.launcher3.Utilities
+import com.android.launcher3.logger.LauncherAtom.TaskSwitcherContainer
import com.android.launcher3.touch.PagedOrientationHandler.ChildBounds
import com.android.launcher3.touch.PagedOrientationHandler.Float2DAction
import com.android.launcher3.touch.PagedOrientationHandler.Int2DAction
@@ -120,6 +121,10 @@
override fun getEnd(rect: RectF): Float = rect.bottom
+ override fun rotateInsets(insets: Rect, outInsets: Rect) {
+ outInsets.set(insets.bottom, insets.left, insets.top, insets.right)
+ }
+
override fun getClearAllSidePadding(view: View, isRtl: Boolean): Int =
if (isRtl) view.paddingBottom / 2 else -view.paddingTop / 2
@@ -611,6 +616,9 @@
override fun getFloatingTaskPrimaryTranslation(floatingTask: View, dp: DeviceProfile): Float =
floatingTask.translationY
+ override fun getHandlerTypeForLogging(): TaskSwitcherContainer.OrientationHandler =
+ TaskSwitcherContainer.OrientationHandler.LANDSCAPE
+
/**
* Retrieves split icons position
*
diff --git a/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java b/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java
index 1be908b..eeacee1 100644
--- a/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java
+++ b/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java
@@ -46,9 +46,12 @@
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
+import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.touch.DefaultPagedViewHandler;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.launcher3.util.SplitConfigurationOptions;
@@ -127,6 +130,11 @@
}
@Override
+ public void rotateInsets(@NonNull Rect insets, @NonNull Rect outInsets) {
+ outInsets.set(insets);
+ }
+
+ @Override
public int getClearAllSidePadding(View view, boolean isRtl) {
return (isRtl ? view.getPaddingRight() : - view.getPaddingLeft()) / 2;
}
@@ -251,7 +259,8 @@
return new Pair<>(translationX, translationY);
}
- bannerParams.gravity = BOTTOM | ((deviceProfile.isLandscape) ? START : CENTER_HORIZONTAL);
+ bannerParams.gravity =
+ BOTTOM | (deviceProfile.isLeftRightSplit ? START : CENTER_HORIZONTAL);
// Set correct width
if (desiredTaskId == splitBounds.leftTopTaskId) {
@@ -802,4 +811,10 @@
? floatingTask.getTranslationX()
: floatingTask.getTranslationY();
}
+
+ @NonNull
+ @Override
+ public LauncherAtom.TaskSwitcherContainer.OrientationHandler getHandlerTypeForLogging() {
+ return LauncherAtom.TaskSwitcherContainer.OrientationHandler.PORTRAIT;
+ }
}
diff --git a/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.kt b/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.kt
index 6c82890..df4b030 100644
--- a/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.kt
+++ b/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.kt
@@ -26,6 +26,7 @@
import android.widget.FrameLayout
import android.widget.LinearLayout
import com.android.launcher3.DeviceProfile
+import com.android.launcher3.logger.LauncherAtom
import com.android.launcher3.touch.PagedOrientationHandler
import com.android.launcher3.touch.PagedOrientationHandler.Float2DAction
import com.android.launcher3.touch.PagedOrientationHandler.Int2DAction
@@ -69,6 +70,9 @@
fun getEnd(rect: RectF): Float
+ /** Rotate the provided insets to portrait perspective. */
+ fun rotateInsets(insets: Rect, outInsets: Rect)
+
fun getClearAllSidePadding(view: View, isRtl: Boolean): Int
fun getSecondaryDimension(view: View): Int
@@ -371,6 +375,8 @@
*/
fun getFloatingTaskPrimaryTranslation(floatingTask: View, dp: DeviceProfile): Float
+ fun getHandlerTypeForLogging(): LauncherAtom.TaskSwitcherContainer.OrientationHandler
+
companion object {
@JvmField val PORTRAIT: RecentsPagedOrientationHandler = PortraitPagedViewHandler()
@JvmField val LANDSCAPE: RecentsPagedOrientationHandler = LandscapePagedViewHandler()
diff --git a/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.kt b/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.kt
index 5bebf8c..333359f 100644
--- a/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.kt
+++ b/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.kt
@@ -32,6 +32,7 @@
import com.android.launcher3.Flags
import com.android.launcher3.R
import com.android.launcher3.Utilities
+import com.android.launcher3.logger.LauncherAtom
import com.android.launcher3.touch.SingleAxisSwipeDetector
import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT
import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT
@@ -43,6 +44,10 @@
import com.android.quickstep.views.IconAppChipView
class SeascapePagedViewHandler : LandscapePagedViewHandler() {
+ override fun rotateInsets(insets: Rect, outInsets: Rect) {
+ outInsets.set(insets.top, insets.right, insets.bottom, insets.left)
+ }
+
override val secondaryTranslationDirectionFactor: Int = -1
override fun getSplitTranslationDirectionFactor(
@@ -395,4 +400,8 @@
iconView.layoutParams = layoutParams
}
}
+
+ @Override
+ override fun getHandlerTypeForLogging(): LauncherAtom.TaskSwitcherContainer.OrientationHandler =
+ LauncherAtom.TaskSwitcherContainer.OrientationHandler.SEASCAPE
}
diff --git a/quickstep/src/com/android/quickstep/recents/data/HighResLoadingStateNotifier.kt b/quickstep/src/com/android/quickstep/recents/data/HighResLoadingStateNotifier.kt
new file mode 100644
index 0000000..df546ca
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/HighResLoadingStateNotifier.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback
+
+/** Notifies added callbacks that high res state has changed */
+interface HighResLoadingStateNotifier {
+ /** Adds a callback for high res loading state */
+ fun addCallback(callback: HighResLoadingStateChangedCallback)
+
+ /** Removes a callback for high res loading state */
+ fun removeCallback(callback: HighResLoadingStateChangedCallback)
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentTasksDataSource.kt b/quickstep/src/com/android/quickstep/recents/data/RecentTasksDataSource.kt
new file mode 100644
index 0000000..6719099
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentTasksDataSource.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.util.GroupTask
+import java.util.function.Consumer
+
+interface RecentTasksDataSource {
+ fun getTasks(callback: Consumer<List<GroupTask>>?): Int
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentTasksRepository.kt b/quickstep/src/com/android/quickstep/recents/data/RecentTasksRepository.kt
new file mode 100644
index 0000000..9c4248c
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentTasksRepository.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import kotlinx.coroutines.flow.Flow
+
+interface RecentTasksRepository {
+ /** Gets all the recent tasks, refreshing from data sources if [forceRefresh] is true. */
+ fun getAllTaskData(forceRefresh: Boolean = false): Flow<List<Task>>
+
+ /**
+ * Gets the data associated with a task that has id [taskId]. Flow will settle on null if the
+ * task was not found. [Task.thumbnail] will settle on null if task is invisible.
+ */
+ fun getTaskDataById(taskId: Int): Flow<Task?>
+
+ /**
+ * Gets the [ThumbnailData] associated with a task that has id [taskId]. Flow will settle on
+ * null if the task was not found or is invisible.
+ */
+ fun getThumbnailById(taskId: Int): Flow<ThumbnailData?>
+
+ /**
+ * Sets the tasks that are visible, indicating that properties relating to visuals need to be
+ * populated e.g. icons/thumbnails etc.
+ */
+ fun setVisibleTasks(visibleTaskIdList: List<Int>)
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfile.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfile.kt
new file mode 100644
index 0000000..d2cb595
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfile.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+/**
+ * Container to hold [com.android.launcher3.DeviceProfile] related to Recents.
+ *
+ * @property isLargeScreen whether the current device posture has a large screen
+ */
+data class RecentsDeviceProfile(
+ val isLargeScreen: Boolean,
+)
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepository.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepository.kt
new file mode 100644
index 0000000..13cf56d
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepository.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+interface RecentsDeviceProfileRepository {
+ fun getRecentsDeviceProfile(): RecentsDeviceProfile
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImpl.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImpl.kt
new file mode 100644
index 0000000..c64453d
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImpl.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.views.RecentsViewContainer
+
+/**
+ * Repository for shrink down version of [com.android.launcher3.DeviceProfile] that only contains
+ * data related to Recents.
+ */
+class RecentsDeviceProfileRepositoryImpl(private val container: RecentsViewContainer) :
+ RecentsDeviceProfileRepository {
+
+ override fun getRecentsDeviceProfile() =
+ with(container.deviceProfile) { RecentsDeviceProfile(isLargeScreen = isTablet) }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsRotationState.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationState.kt
new file mode 100644
index 0000000..2c2a744
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationState.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.view.Surface
+
+/**
+ * Container to hold orientation/rotation related information related to Recents.
+ *
+ * @property activityRotation rotation of the activity hosting RecentsView
+ */
+data class RecentsRotationState(
+ @Surface.Rotation val activityRotation: Int,
+ @Surface.Rotation val orientationHandlerRotation: Int,
+)
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepository.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepository.kt
new file mode 100644
index 0000000..ed074d2
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepository.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+interface RecentsRotationStateRepository {
+ fun getRecentsRotationState(): RecentsRotationState
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImpl.kt b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImpl.kt
new file mode 100644
index 0000000..8417b06
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImpl.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.util.RecentsOrientedState
+
+/**
+ * Repository for [RecentsRotationState] which holds orientation/rotation related information
+ * related to Recents
+ */
+class RecentsRotationStateRepositoryImpl(private val state: RecentsOrientedState) :
+ RecentsRotationStateRepository {
+ override fun getRecentsRotationState() =
+ with(state) {
+ RecentsRotationState(
+ activityRotation = recentsActivityRotation,
+ orientationHandlerRotation = orientationHandler.rotation
+ )
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangeNotifier.kt b/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangeNotifier.kt
new file mode 100644
index 0000000..6e7789d
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangeNotifier.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.util.TaskVisualsChangeListener
+
+/** Notifies added listeners that task visuals have changed */
+interface TaskVisualsChangeNotifier {
+ /** Adds a listener for visuals changes */
+ fun addThumbnailChangeListener(listener: TaskVisualsChangeListener)
+
+ /** Removes a listener for visuals changes */
+ fun removeThumbnailChangeListener(listener: TaskVisualsChangeListener)
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegate.kt b/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegate.kt
new file mode 100644
index 0000000..a141e89
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegate.kt
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.os.UserHandle
+import com.android.quickstep.TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskIconChangedCallback
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskThumbnailChangedCallback
+import com.android.quickstep.util.TaskVisualsChangeListener
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+
+/** Delegates the checking of task visuals (thumbnails, high res changes, icons) */
+interface TaskVisualsChangedDelegate :
+ TaskVisualsChangeListener, HighResLoadingStateChangedCallback {
+ /** Registers a callback for visuals relating to icons */
+ fun registerTaskIconChangedCallback(
+ taskKey: Task.TaskKey,
+ taskIconChangedCallback: TaskIconChangedCallback
+ )
+
+ /** Unregisters a callback for visuals relating to icons */
+ fun unregisterTaskIconChangedCallback(taskKey: Task.TaskKey)
+
+ /** Registers a callback for visuals relating to thumbnails */
+ fun registerTaskThumbnailChangedCallback(
+ taskKey: Task.TaskKey,
+ taskThumbnailChangedCallback: TaskThumbnailChangedCallback
+ )
+
+ /** Unregisters a callback for visuals relating to thumbnails */
+ fun unregisterTaskThumbnailChangedCallback(taskKey: Task.TaskKey)
+
+ /** A callback for task icon changes */
+ interface TaskIconChangedCallback {
+ /** Informs the listener that the task icon has changed */
+ fun onTaskIconChanged()
+ }
+
+ /** A callback for task thumbnail changes */
+ interface TaskThumbnailChangedCallback {
+ /** Informs the listener that the task thumbnail data has changed to [thumbnailData] */
+ fun onTaskThumbnailChanged(thumbnailData: ThumbnailData?)
+
+ /** Informs the listener that the default resolution for loading thumbnails has changed */
+ fun onHighResLoadingStateChanged()
+ }
+}
+
+class TaskVisualsChangedDelegateImpl(
+ private val taskVisualsChangeNotifier: TaskVisualsChangeNotifier,
+ private val highResLoadingStateNotifier: HighResLoadingStateNotifier,
+) : TaskVisualsChangedDelegate {
+ private val taskIconChangedCallbacks =
+ mutableMapOf<Int, Pair<Task.TaskKey, TaskIconChangedCallback>>()
+ private val taskThumbnailChangedCallbacks =
+ mutableMapOf<Int, Pair<Task.TaskKey, TaskThumbnailChangedCallback>>()
+ private var isListening = false
+
+ @Synchronized
+ private fun onCallbackRegistered() {
+ if (isListening) return
+
+ taskVisualsChangeNotifier.addThumbnailChangeListener(this)
+ highResLoadingStateNotifier.addCallback(this)
+ isListening = true
+ }
+
+ @Synchronized
+ private fun onCallbackUnregistered() {
+ if (!isListening) return
+
+ if (taskIconChangedCallbacks.size + taskThumbnailChangedCallbacks.size == 0) {
+ taskVisualsChangeNotifier.removeThumbnailChangeListener(this)
+ highResLoadingStateNotifier.removeCallback(this)
+ }
+
+ isListening = false
+ }
+
+ override fun onTaskIconChanged(taskId: Int) {
+ taskIconChangedCallbacks[taskId]?.let { (_, callback) -> callback.onTaskIconChanged() }
+ }
+
+ override fun onTaskIconChanged(pkg: String, user: UserHandle) {
+ taskIconChangedCallbacks.values
+ .filter { (taskKey, _) ->
+ pkg == taskKey.packageName && user.identifier == taskKey.userId
+ }
+ .forEach { (_, callback) -> callback.onTaskIconChanged() }
+ }
+
+ override fun onTaskThumbnailChanged(taskId: Int, thumbnailData: ThumbnailData?): Task? {
+ taskThumbnailChangedCallbacks[taskId]?.let { (_, callback) ->
+ callback.onTaskThumbnailChanged(thumbnailData)
+ }
+ return null
+ }
+
+ override fun onHighResLoadingStateChanged(enabled: Boolean) {
+ taskThumbnailChangedCallbacks.values.forEach { (_, callback) ->
+ callback.onHighResLoadingStateChanged()
+ }
+ }
+
+ override fun registerTaskIconChangedCallback(
+ taskKey: Task.TaskKey,
+ taskIconChangedCallback: TaskIconChangedCallback
+ ) {
+ taskIconChangedCallbacks[taskKey.id] = taskKey to taskIconChangedCallback
+ onCallbackRegistered()
+ }
+
+ override fun unregisterTaskIconChangedCallback(taskKey: Task.TaskKey) {
+ taskIconChangedCallbacks.remove(taskKey.id)
+ onCallbackUnregistered()
+ }
+
+ override fun registerTaskThumbnailChangedCallback(
+ taskKey: Task.TaskKey,
+ taskThumbnailChangedCallback: TaskThumbnailChangedCallback
+ ) {
+ taskThumbnailChangedCallbacks[taskKey.id] = taskKey to taskThumbnailChangedCallback
+ onCallbackRegistered()
+ }
+
+ override fun unregisterTaskThumbnailChangedCallback(taskKey: Task.TaskKey) {
+ taskThumbnailChangedCallbacks.remove(taskKey.id)
+ onCallbackUnregistered()
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/data/TasksRepository.kt b/quickstep/src/com/android/quickstep/recents/data/TasksRepository.kt
new file mode 100644
index 0000000..eb3c2d1
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/data/TasksRepository.kt
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.graphics.drawable.Drawable
+import com.android.launcher3.util.coroutines.DispatcherProvider
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskIconChangedCallback
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskThumbnailChangedCallback
+import com.android.quickstep.task.thumbnail.data.TaskIconDataSource
+import com.android.quickstep.task.thumbnail.data.TaskThumbnailDataSource
+import com.android.quickstep.util.GroupTask
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import kotlin.coroutines.resume
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.channels.awaitClose
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.callbackFlow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.distinctUntilChangedBy
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.flowOn
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.shareIn
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.suspendCancellableCoroutine
+import kotlinx.coroutines.withContext
+
+@OptIn(ExperimentalCoroutinesApi::class)
+class TasksRepository(
+ private val recentsModel: RecentTasksDataSource,
+ private val taskThumbnailDataSource: TaskThumbnailDataSource,
+ private val taskIconDataSource: TaskIconDataSource,
+ private val taskVisualsChangedDelegate: TaskVisualsChangedDelegate,
+ recentsCoroutineScope: CoroutineScope,
+ private val dispatcherProvider: DispatcherProvider,
+) : RecentTasksRepository {
+ private val groupedTaskData = MutableStateFlow(emptyList<GroupTask>())
+ private val visibleTaskIds = MutableStateFlow(emptySet<Int>())
+
+ private val taskData =
+ groupedTaskData.map { groupTaskList -> groupTaskList.flatMap { it.tasks } }
+ private val visibleTasks =
+ combine(taskData, visibleTaskIds) { tasks, visibleIds ->
+ tasks.filter { it.key.id in visibleIds }
+ }
+
+ private val iconQueryResults: Flow<Map<Int, TaskIconQueryResponse?>> =
+ visibleTasks
+ .map { visibleTasksList -> visibleTasksList.map(::getIconDataRequest) }
+ .flatMapLatest { iconRequestFlows: List<IconDataRequest> ->
+ if (iconRequestFlows.isEmpty()) {
+ flowOf(emptyMap())
+ } else {
+ combine(iconRequestFlows) { it.toMap() }
+ }
+ }
+ .distinctUntilChanged()
+
+ private val thumbnailQueryResults: Flow<Map<Int, ThumbnailData?>> =
+ visibleTasks
+ .map { visibleTasksList -> visibleTasksList.map(::getThumbnailDataRequest) }
+ .flatMapLatest { thumbnailRequestFlows: List<ThumbnailDataRequest> ->
+ if (thumbnailRequestFlows.isEmpty()) {
+ flowOf(emptyMap())
+ } else {
+ combine(thumbnailRequestFlows) { it.toMap() }
+ }
+ }
+ .distinctUntilChanged()
+
+ private val augmentedTaskData: Flow<List<Task>> =
+ combine(taskData, thumbnailQueryResults, iconQueryResults) {
+ tasks,
+ thumbnailQueryResults,
+ iconQueryResults ->
+ tasks.onEach { task ->
+ // Add retrieved thumbnails + remove unnecessary thumbnails (e.g. invisible)
+ task.thumbnail = thumbnailQueryResults[task.key.id]
+
+ // TODO(b/352331675) don't load icons for DesktopTaskView
+ // Add retrieved icons + remove unnecessary icons
+ val iconQueryResult = iconQueryResults[task.key.id]
+ task.icon = iconQueryResult?.icon
+ task.titleDescription = iconQueryResult?.contentDescription
+ task.title = iconQueryResult?.title
+ }
+ }
+ .flowOn(dispatcherProvider.io)
+ .shareIn(recentsCoroutineScope, SharingStarted.WhileSubscribed(), replay = 1)
+
+ override fun getAllTaskData(forceRefresh: Boolean): Flow<List<Task>> {
+ if (forceRefresh) {
+ recentsModel.getTasks { groupedTaskData.value = it }
+ }
+ return augmentedTaskData
+ }
+
+ override fun getTaskDataById(taskId: Int): Flow<Task?> =
+ augmentedTaskData.map { taskList -> taskList.firstOrNull { it.key.id == taskId } }
+
+ override fun getThumbnailById(taskId: Int): Flow<ThumbnailData?> =
+ getTaskDataById(taskId).map { it?.thumbnail }.distinctUntilChangedBy { it?.snapshotId }
+
+ override fun setVisibleTasks(visibleTaskIdList: List<Int>) {
+ this.visibleTaskIds.value = visibleTaskIdList.toSet()
+ }
+
+ /** Flow wrapper for [TaskThumbnailDataSource.getThumbnailInBackground] api */
+ private fun getThumbnailDataRequest(task: Task): ThumbnailDataRequest = callbackFlow {
+ trySend(task.key.id to task.thumbnail)
+ trySend(task.key.id to getThumbnailFromDataSource(task))
+
+ val callback =
+ object : TaskThumbnailChangedCallback {
+ override fun onTaskThumbnailChanged(thumbnailData: ThumbnailData?) {
+ trySend(task.key.id to thumbnailData)
+ }
+
+ override fun onHighResLoadingStateChanged() {
+ launch { trySend(task.key.id to getThumbnailFromDataSource(task)) }
+ }
+ }
+ taskVisualsChangedDelegate.registerTaskThumbnailChangedCallback(task.key, callback)
+ awaitClose { taskVisualsChangedDelegate.unregisterTaskThumbnailChangedCallback(task.key) }
+ }
+
+ /** Flow wrapper for [TaskIconDataSource.getIconInBackground] api */
+ private fun getIconDataRequest(task: Task): IconDataRequest =
+ callbackFlow {
+ trySend(task.key.id to task.getTaskIconQueryResponse())
+ trySend(task.key.id to getIconFromDataSource(task))
+
+ val callback =
+ object : TaskIconChangedCallback {
+ override fun onTaskIconChanged() {
+ launch { trySend(task.key.id to getIconFromDataSource(task)) }
+ }
+ }
+ taskVisualsChangedDelegate.registerTaskIconChangedCallback(task.key, callback)
+ awaitClose {
+ taskVisualsChangedDelegate.unregisterTaskIconChangedCallback(task.key)
+ }
+ }
+ .distinctUntilChanged()
+
+ private suspend fun getThumbnailFromDataSource(task: Task) =
+ withContext(dispatcherProvider.main) {
+ suspendCancellableCoroutine { continuation ->
+ val cancellableTask =
+ taskThumbnailDataSource.getThumbnailInBackground(task) {
+ continuation.resume(it)
+ }
+ continuation.invokeOnCancellation { cancellableTask?.cancel() }
+ }
+ }
+
+ private suspend fun getIconFromDataSource(task: Task) =
+ withContext(dispatcherProvider.main) {
+ suspendCancellableCoroutine { continuation ->
+ val cancellableTask =
+ taskIconDataSource.getIconInBackground(task) { icon, contentDescription, title
+ ->
+ icon.constantState?.let {
+ continuation.resume(
+ TaskIconQueryResponse(
+ it.newDrawable().mutate(),
+ contentDescription,
+ title
+ )
+ )
+ }
+ }
+ continuation.invokeOnCancellation { cancellableTask?.cancel() }
+ }
+ }
+}
+
+data class TaskIconQueryResponse(
+ val icon: Drawable,
+ val contentDescription: String,
+ val title: String
+)
+
+private fun Task.getTaskIconQueryResponse(): TaskIconQueryResponse? {
+ val iconVal = icon ?: return null
+ val titleDescriptionVal = titleDescription ?: return null
+ val titleVal = title ?: return null
+
+ return TaskIconQueryResponse(iconVal, titleDescriptionVal, titleVal)
+}
+
+private typealias ThumbnailDataRequest = Flow<Pair<Int, ThumbnailData?>>
+
+private typealias IconDataRequest = Flow<Pair<Int, TaskIconQueryResponse?>>
diff --git a/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt b/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt
new file mode 100644
index 0000000..0a5544f
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt
@@ -0,0 +1,296 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.di
+
+import android.content.Context
+import android.util.Log
+import android.view.View
+import com.android.launcher3.util.coroutines.ProductionDispatchers
+import com.android.quickstep.RecentsModel
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegateImpl
+import com.android.quickstep.recents.data.TasksRepository
+import com.android.quickstep.recents.usecase.GetThumbnailPositionUseCase
+import com.android.quickstep.recents.usecase.GetThumbnailUseCase
+import com.android.quickstep.recents.usecase.SysUiStatusNavFlagsUseCase
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.thumbnail.SplashAlphaUseCase
+import com.android.quickstep.task.thumbnail.TaskThumbnailViewData
+import com.android.quickstep.task.viewmodel.TaskContainerData
+import com.android.quickstep.task.viewmodel.TaskOverlayViewModel
+import com.android.quickstep.task.viewmodel.TaskThumbnailViewModel
+import com.android.quickstep.task.viewmodel.TaskViewData
+import com.android.quickstep.task.viewmodel.TaskViewModel
+import com.android.quickstep.views.TaskViewType
+import com.android.systemui.shared.recents.model.Task
+import kotlinx.coroutines.CoroutineName
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.SupervisorJob
+
+internal typealias RecentsScopeId = String
+
+class RecentsDependencies private constructor(private val appContext: Context) {
+ private val scopes = mutableMapOf<RecentsScopeId, RecentsDependenciesScope>()
+
+ init {
+ startDefaultScope(appContext)
+ }
+
+ /**
+ * This function initialised the default scope with RecentsView dependencies. These dependencies
+ * are used multiple times and should be a singleton to share across Recents classes.
+ */
+ private fun startDefaultScope(appContext: Context) {
+ createScope(DEFAULT_SCOPE_ID).apply {
+ set(RecentsViewData::class.java.simpleName, RecentsViewData())
+ val recentsCoroutineScope =
+ CoroutineScope(SupervisorJob() + Dispatchers.Main + CoroutineName("RecentsView"))
+ set(CoroutineScope::class.java.simpleName, recentsCoroutineScope)
+ val recentsModel = RecentsModel.INSTANCE.get(appContext)
+ val taskVisualsChangedDelegate =
+ TaskVisualsChangedDelegateImpl(
+ recentsModel,
+ recentsModel.thumbnailCache.highResLoadingState
+ )
+ set(TaskVisualsChangedDelegate::class.java.simpleName, taskVisualsChangedDelegate)
+
+ // Create RecentsTaskRepository singleton
+ val recentTasksRepository: RecentTasksRepository =
+ with(recentsModel) {
+ TasksRepository(
+ this,
+ thumbnailCache,
+ iconCache,
+ taskVisualsChangedDelegate,
+ recentsCoroutineScope,
+ ProductionDispatchers
+ )
+ }
+ set(RecentTasksRepository::class.java.simpleName, recentTasksRepository)
+ }
+ }
+
+ inline fun <reified T> inject(
+ scopeId: RecentsScopeId = "",
+ extras: RecentsDependenciesExtras = RecentsDependenciesExtras(),
+ noinline factory: ((extras: RecentsDependenciesExtras) -> T)? = null,
+ ): T = inject(T::class.java, scopeId = scopeId, extras = extras, factory = factory)
+
+ @Suppress("UNCHECKED_CAST")
+ @JvmOverloads
+ fun <T> inject(
+ modelClass: Class<T>,
+ scopeId: RecentsScopeId = DEFAULT_SCOPE_ID,
+ extras: RecentsDependenciesExtras = RecentsDependenciesExtras(),
+ factory: ((extras: RecentsDependenciesExtras) -> T)? = null,
+ ): T {
+ val currentScopeId = scopeId.ifEmpty { DEFAULT_SCOPE_ID }
+ val scope = scopes[currentScopeId] ?: createScope(currentScopeId)
+
+ log("inject ${modelClass.simpleName} into ${scope.scopeId}", Log.INFO)
+ var instance: T?
+ synchronized(this) {
+ instance = getDependency(scope, modelClass)
+ log("found instance? $instance", Log.INFO)
+ if (instance == null) {
+ instance =
+ factory?.invoke(extras) as T ?: createDependency(modelClass, scopeId, extras)
+ scope[modelClass.simpleName] = instance!!
+ }
+ }
+ return instance!!
+ }
+
+ inline fun <reified T> provide(scopeId: RecentsScopeId = "", noinline factory: () -> T): T =
+ provide(T::class.java, scopeId = scopeId, factory = factory)
+
+ @JvmOverloads
+ fun <T> provide(
+ modelClass: Class<T>,
+ scopeId: RecentsScopeId = DEFAULT_SCOPE_ID,
+ factory: () -> T,
+ ) = inject(modelClass, scopeId, factory = { factory.invoke() })
+
+ private fun <T> getDependency(scope: RecentsDependenciesScope, modelClass: Class<T>): T? {
+ var instance: T? = scope[modelClass.simpleName] as T?
+ if (instance == null) {
+ instance =
+ scope.scopeIdsLinked.firstNotNullOfOrNull { scopeId ->
+ getScope(scopeId)[modelClass.simpleName]
+ } as T?
+ }
+ if (instance != null) log("Found dependency: $instance", Log.INFO)
+ return instance
+ }
+
+ fun getScope(scope: Any): RecentsDependenciesScope {
+ val scopeId: RecentsScopeId = scope as? RecentsScopeId ?: scope.hashCode().toString()
+ return getScope(scopeId)
+ }
+
+ fun getScope(scopeId: RecentsScopeId): RecentsDependenciesScope =
+ scopes[scopeId] ?: createScope(scopeId)
+
+ // TODO(b/353912757): Create a factory so we can prevent this method of growing indefinitely.
+ // Each class should be responsible for providing a factory function to create a new instance.
+ @Suppress("UNCHECKED_CAST")
+ private fun <T> createDependency(
+ modelClass: Class<T>,
+ scopeId: RecentsScopeId,
+ extras: RecentsDependenciesExtras,
+ ): T {
+ log("createDependency ${modelClass.simpleName} with $scopeId and $extras", Log.WARN)
+ val instance: Any =
+ when (modelClass) {
+ RecentTasksRepository::class.java -> {
+ with(RecentsModel.INSTANCE.get(appContext)) {
+ TasksRepository(
+ this,
+ thumbnailCache,
+ iconCache,
+ get(),
+ get(),
+ ProductionDispatchers
+ )
+ }
+ }
+ RecentsViewData::class.java -> RecentsViewData()
+ TaskViewModel::class.java -> TaskViewModel(taskViewData = inject(scopeId, extras))
+ TaskViewData::class.java -> {
+ val taskViewType = extras["TaskViewType"] as TaskViewType
+ TaskViewData(taskViewType)
+ }
+ TaskContainerData::class.java -> TaskContainerData()
+ TaskThumbnailViewData::class.java -> TaskThumbnailViewData()
+ TaskThumbnailViewModel::class.java ->
+ TaskThumbnailViewModel(
+ recentsViewData = inject(),
+ taskViewData = inject(scopeId, extras),
+ taskContainerData = inject(scopeId),
+ getThumbnailPositionUseCase = inject(),
+ tasksRepository = inject(),
+ splashAlphaUseCase = inject(scopeId),
+ )
+ TaskOverlayViewModel::class.java -> {
+ val task = extras["Task"] as Task
+ TaskOverlayViewModel(
+ task = task,
+ recentsViewData = inject(),
+ recentTasksRepository = inject(),
+ getThumbnailPositionUseCase = inject()
+ )
+ }
+ GetThumbnailUseCase::class.java -> GetThumbnailUseCase(taskRepository = inject())
+ SysUiStatusNavFlagsUseCase::class.java ->
+ SysUiStatusNavFlagsUseCase(taskRepository = inject())
+ GetThumbnailPositionUseCase::class.java ->
+ GetThumbnailPositionUseCase(
+ deviceProfileRepository = inject(),
+ rotationStateRepository = inject(),
+ tasksRepository = inject()
+ )
+ SplashAlphaUseCase::class.java ->
+ SplashAlphaUseCase(
+ recentsViewData = inject(),
+ taskContainerData = inject(scopeId),
+ taskThumbnailViewData = inject(scopeId),
+ tasksRepository = inject(),
+ rotationStateRepository = inject(),
+ )
+ else -> {
+ log("Factory for ${modelClass.simpleName} not defined!", Log.ERROR)
+ error("Factory for ${modelClass.simpleName} not defined!")
+ }
+ }
+ return instance as T
+ }
+
+ private fun createScope(scopeId: RecentsScopeId): RecentsDependenciesScope {
+ return RecentsDependenciesScope(scopeId).also { scopes[scopeId] = it }
+ }
+
+ private fun log(message: String, @Log.Level level: Int = Log.DEBUG) {
+ if (DEBUG) {
+ when (level) {
+ Log.WARN -> Log.w(TAG, message)
+ Log.VERBOSE -> Log.v(TAG, message)
+ Log.INFO -> Log.i(TAG, message)
+ Log.ERROR -> Log.e(TAG, message)
+ else -> Log.d(TAG, message)
+ }
+ }
+ }
+
+ companion object {
+ private const val DEFAULT_SCOPE_ID = "RecentsDependencies::GlobalScope"
+ private const val TAG = "RecentsDependencies"
+ private const val DEBUG = false
+
+ @Volatile private lateinit var instance: RecentsDependencies
+
+ fun initialize(view: View): RecentsDependencies = initialize(view.context)
+
+ fun initialize(context: Context): RecentsDependencies {
+ synchronized(this) {
+ if (!Companion::instance.isInitialized) {
+ instance = RecentsDependencies(context.applicationContext)
+ }
+ }
+ return instance
+ }
+
+ fun getInstance(): RecentsDependencies {
+ if (!Companion::instance.isInitialized) {
+ throw UninitializedPropertyAccessException(
+ "Recents dependencies are not initialized. " +
+ "Call `RecentsDependencies.initialize` before using this container."
+ )
+ }
+ return instance
+ }
+
+ fun destroy() {
+ instance.scopes.clear()
+ instance.startDefaultScope(instance.appContext)
+ }
+ }
+}
+
+inline fun <reified T> RecentsDependencies.Companion.inject(
+ scope: Any = "",
+ vararg extras: Pair<String, Any>,
+ noinline factory: ((extras: RecentsDependenciesExtras) -> T)? = null,
+): Lazy<T> = lazy { get(scope, RecentsDependenciesExtras(extras), factory) }
+
+inline fun <reified T> RecentsDependencies.Companion.get(
+ scope: Any = "",
+ extras: RecentsDependenciesExtras = RecentsDependenciesExtras(),
+ noinline factory: ((extras: RecentsDependenciesExtras) -> T)? = null,
+): T {
+ val scopeId: RecentsScopeId = scope as? RecentsScopeId ?: scope.hashCode().toString()
+ return getInstance().inject(scopeId, extras, factory)
+}
+
+inline fun <reified T> RecentsDependencies.Companion.get(
+ scope: Any = "",
+ vararg extras: Pair<String, Any>,
+ noinline factory: ((extras: RecentsDependenciesExtras) -> T)? = null,
+): T = get(scope, RecentsDependenciesExtras(extras), factory)
+
+fun RecentsDependencies.Companion.getScope(scopeId: Any) = getInstance().getScope(scopeId)
diff --git a/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesExtras.kt b/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesExtras.kt
new file mode 100644
index 0000000..753cb6e
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesExtras.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.di
+
+data class RecentsDependenciesExtras(private val data: MutableMap<String, Any> = mutableMapOf()) {
+ constructor(value: Array<out Pair<String, Any>>) : this(value.toMap().toMutableMap())
+
+ operator fun get(key: String) = data[key]
+
+ operator fun set(key: String, value: Any) {
+ data[key] = value
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesScope.kt b/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesScope.kt
new file mode 100644
index 0000000..56bb1ed
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/di/RecentsDependenciesScope.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.di
+
+import android.util.Log
+
+class RecentsDependenciesScope(
+ val scopeId: RecentsScopeId,
+ private val dependencies: MutableMap<String, Any> = mutableMapOf(),
+ private val scopeIds: MutableList<RecentsScopeId> = mutableListOf()
+) {
+ val scopeIdsLinked: List<RecentsScopeId>
+ get() = scopeIds.toList()
+
+ operator fun get(identifier: String): Any? {
+ log("get $identifier")
+ return dependencies[identifier]
+ }
+
+ operator fun set(key: String, value: Any) {
+ synchronized(this) {
+ log("set $key")
+ dependencies[key] = value
+ }
+ }
+
+ fun remove(key: String): Any? {
+ synchronized(this) {
+ log("remove $key")
+ return dependencies.remove(key)
+ }
+ }
+
+ fun linkTo(scope: RecentsDependenciesScope) {
+ log("linking to ${scope.scopeId}")
+ scopeIds += scope.scopeId
+ }
+
+ fun close() {
+ log("reset")
+ synchronized(this) { dependencies.clear() }
+ }
+
+ private fun log(message: String) {
+ if (DEBUG) Log.d(TAG, "[scopeId=$scopeId] $message")
+ }
+
+ override fun toString(): String =
+ "scopeId: $scopeId" +
+ "\n dependencies: ${dependencies.map { "${it.key}=${it.value}" }.joinToString(", ")}" +
+ "\n linked to: ${scopeIds.joinToString(", ")}"
+
+ private companion object {
+ private const val TAG = "RecentsDependenciesScope"
+ private const val DEBUG = false
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCase.kt b/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCase.kt
new file mode 100644
index 0000000..f060d7d
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCase.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.graphics.Matrix
+import android.graphics.Rect
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.quickstep.recents.data.RecentsDeviceProfileRepository
+import com.android.quickstep.recents.data.RecentsRotationStateRepository
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MatrixScaling
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MissingThumbnail
+import com.android.systemui.shared.recents.utilities.PreviewPositionHelper
+import kotlinx.coroutines.flow.firstOrNull
+
+/** Use case for retrieving [Matrix] for positioning Thumbnail in a View */
+class GetThumbnailPositionUseCase(
+ private val deviceProfileRepository: RecentsDeviceProfileRepository,
+ private val rotationStateRepository: RecentsRotationStateRepository,
+ private val tasksRepository: RecentTasksRepository,
+ private val previewPositionHelper: PreviewPositionHelper = PreviewPositionHelper()
+) {
+ suspend fun run(taskId: Int, width: Int, height: Int, isRtl: Boolean): ThumbnailPositionState {
+ val thumbnailData =
+ tasksRepository.getThumbnailById(taskId).firstOrNull() ?: return MissingThumbnail
+ val thumbnail = thumbnailData.thumbnail ?: return MissingThumbnail
+ previewPositionHelper.updateThumbnailMatrix(
+ Rect(0, 0, thumbnail.width, thumbnail.height),
+ thumbnailData,
+ width,
+ height,
+ deviceProfileRepository.getRecentsDeviceProfile().isLargeScreen,
+ rotationStateRepository.getRecentsRotationState().activityRotation,
+ isRtl
+ )
+ return MatrixScaling(
+ previewPositionHelper.matrix,
+ previewPositionHelper.isOrientationChanged
+ )
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailUseCase.kt b/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailUseCase.kt
new file mode 100644
index 0000000..3aa808e
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/usecase/GetThumbnailUseCase.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.graphics.Bitmap
+import com.android.quickstep.recents.data.RecentTasksRepository
+import kotlinx.coroutines.flow.firstOrNull
+import kotlinx.coroutines.runBlocking
+
+/** Use case for retrieving thumbnail. */
+class GetThumbnailUseCase(private val taskRepository: RecentTasksRepository) {
+ /** Returns the latest thumbnail associated with [taskId] if loaded, or null otherwise */
+ fun run(taskId: Int): Bitmap? = runBlocking {
+ taskRepository.getThumbnailById(taskId).firstOrNull()?.thumbnail
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCase.kt b/quickstep/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCase.kt
new file mode 100644
index 0000000..1d19c7d
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCase.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.view.WindowInsetsController
+import com.android.launcher3.util.SystemUiController.FLAG_DARK_NAV
+import com.android.launcher3.util.SystemUiController.FLAG_DARK_STATUS
+import com.android.launcher3.util.SystemUiController.FLAG_LIGHT_NAV
+import com.android.launcher3.util.SystemUiController.FLAG_LIGHT_STATUS
+import com.android.quickstep.recents.data.RecentTasksRepository
+import kotlinx.coroutines.flow.firstOrNull
+import kotlinx.coroutines.runBlocking
+
+/** UseCase to calculate flags for status bar and navigation bar */
+class SysUiStatusNavFlagsUseCase(private val taskRepository: RecentTasksRepository) {
+ fun getSysUiStatusNavFlags(taskId: Int): Int {
+ val thumbnailData =
+ runBlocking { taskRepository.getThumbnailById(taskId).firstOrNull() } ?: return 0
+
+ val thumbnailAppearance = thumbnailData.appearance
+ var flags = 0
+ flags =
+ flags or
+ if (
+ thumbnailAppearance and WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS != 0
+ )
+ FLAG_LIGHT_STATUS
+ else FLAG_DARK_STATUS
+ flags =
+ flags or
+ if (
+ thumbnailAppearance and
+ WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS != 0
+ )
+ FLAG_LIGHT_NAV
+ else FLAG_DARK_NAV
+ return flags
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/usecase/ThumbnailPositionState.kt b/quickstep/src/com/android/quickstep/recents/usecase/ThumbnailPositionState.kt
new file mode 100644
index 0000000..1a1bef7
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/usecase/ThumbnailPositionState.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.graphics.Matrix
+
+/** State on how a task Thumbnail can fit on given canvas */
+sealed class ThumbnailPositionState {
+ data object MissingThumbnail : ThumbnailPositionState()
+
+ data class MatrixScaling(val matrix: Matrix, val isRotated: Boolean) : ThumbnailPositionState()
+}
diff --git a/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewData.kt b/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewData.kt
new file mode 100644
index 0000000..87446b0
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewData.kt
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.viewmodel
+
+import kotlinx.coroutines.flow.MutableStateFlow
+
+// This is far from complete but serves the purpose of enabling refactoring in other areas
+class RecentsViewData {
+ val fullscreenProgress = MutableStateFlow(1f)
+
+ // This is typically a View concern but it is used to invalidate rendering in other Views
+ val scale = MutableStateFlow(1f)
+
+ // Whether the current RecentsView state supports task overlays.
+ // TODO(b/331753115): Derive from RecentsView state flow once migrated to MVVM.
+ val overlayEnabled = MutableStateFlow(false)
+
+ // The settled set of visible taskIds that is updated after RecentsView scroll settles.
+ val settledFullyVisibleTaskIds = MutableStateFlow(emptySet<Int>())
+
+ // Color tint on foreground scrim
+ val tintAmount = MutableStateFlow(0f)
+
+ val thumbnailSplashProgress = MutableStateFlow(0f)
+
+ // A list of taskIds that are associated with a RecentsAnimationController. */
+ val runningTaskIds = MutableStateFlow(emptySet<Int>())
+
+ // Whether we should use static screenshot instead of live tile for taskIds in [runningTaskIds]
+ val runningTaskShowScreenshot = MutableStateFlow(false)
+}
diff --git a/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewModel.kt b/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewModel.kt
new file mode 100644
index 0000000..1716f2e
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/viewmodel/RecentsViewModel.kt
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.viewmodel
+
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.systemui.shared.recents.model.ThumbnailData
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.filter
+import kotlinx.coroutines.flow.first
+
+class RecentsViewModel(
+ private val recentsTasksRepository: RecentTasksRepository,
+ private val recentsViewData: RecentsViewData
+) {
+ fun refreshAllTaskData() {
+ recentsTasksRepository.getAllTaskData(true)
+ }
+
+ fun updateVisibleTasks(visibleTaskIdList: List<Int>) {
+ recentsTasksRepository.setVisibleTasks(visibleTaskIdList)
+ }
+
+ fun updateScale(scale: Float) {
+ recentsViewData.scale.value = scale
+ }
+
+ fun updateFullscreenProgress(fullscreenProgress: Float) {
+ recentsViewData.fullscreenProgress.value = fullscreenProgress
+ }
+
+ fun updateTasksFullyVisible(taskIds: Set<Int>) {
+ recentsViewData.settledFullyVisibleTaskIds.value = taskIds
+ }
+
+ fun setOverlayEnabled(isOverlayEnabled: Boolean) {
+ recentsViewData.overlayEnabled.value = isOverlayEnabled
+ }
+
+ fun setTintAmount(tintAmount: Float) {
+ recentsViewData.tintAmount.value = tintAmount
+ }
+
+ fun updateThumbnailSplashProgress(taskThumbnailSplashAlpha: Float) {
+ recentsViewData.thumbnailSplashProgress.value = taskThumbnailSplashAlpha
+ }
+
+ suspend fun waitForThumbnailsToUpdate(updatedThumbnails: Map<Int, ThumbnailData>) {
+ combine(
+ updatedThumbnails.map {
+ recentsTasksRepository.getThumbnailById(it.key).filter { thumbnailData ->
+ thumbnailData?.snapshotId == it.value.snapshotId
+ }
+ }
+ ) {}
+ .first()
+ }
+
+ suspend fun waitForRunningTaskShowScreenshotToUpdate() {
+ recentsViewData.runningTaskShowScreenshot.filter { it }.first()
+ }
+
+ fun onReset() {
+ updateVisibleTasks(emptyList())
+ }
+
+ fun updateRunningTask(taskIds: Set<Int>) {
+ recentsViewData.runningTaskIds.value = taskIds
+ }
+
+ fun setRunningTaskShowScreenshot(showScreenshot: Boolean) {
+ recentsViewData.runningTaskShowScreenshot.value = showScreenshot
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/recents/viewmodel/TaskContainerViewModel.kt b/quickstep/src/com/android/quickstep/recents/viewmodel/TaskContainerViewModel.kt
new file mode 100644
index 0000000..168c1e0
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/recents/viewmodel/TaskContainerViewModel.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.viewmodel
+
+import android.graphics.Bitmap
+import com.android.quickstep.recents.usecase.GetThumbnailUseCase
+import com.android.quickstep.recents.usecase.SysUiStatusNavFlagsUseCase
+import com.android.quickstep.task.thumbnail.SplashAlphaUseCase
+import kotlinx.coroutines.flow.firstOrNull
+import kotlinx.coroutines.runBlocking
+
+class TaskContainerViewModel(
+ private val sysUiStatusNavFlagsUseCase: SysUiStatusNavFlagsUseCase,
+ private val getThumbnailUseCase: GetThumbnailUseCase,
+ private val splashAlphaUseCase: SplashAlphaUseCase,
+) {
+ fun getThumbnail(taskId: Int): Bitmap? = getThumbnailUseCase.run(taskId)
+
+ fun getSysUiStatusNavFlags(taskId: Int) =
+ sysUiStatusNavFlagsUseCase.getSysUiStatusNavFlags(taskId)
+
+ fun shouldShowThumbnailSplash(taskId: Int): Boolean =
+ (runBlocking { splashAlphaUseCase.execute(taskId).firstOrNull() } ?: 0f) > 0f
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/LiveTileView.kt b/quickstep/src/com/android/quickstep/task/thumbnail/LiveTileView.kt
new file mode 100644
index 0000000..45b3687
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/LiveTileView.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail
+
+import android.content.Context
+import android.graphics.Canvas
+import android.graphics.Paint
+import android.graphics.PorterDuff
+import android.graphics.PorterDuffXfermode
+import android.util.AttributeSet
+import android.view.View
+
+class LiveTileView : View {
+ constructor(context: Context) : super(context)
+
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int,
+ ) : super(context, attrs, defStyleAttr)
+
+ override fun onDraw(canvas: Canvas) {
+ canvas.drawRect(0f, 0f, measuredWidth.toFloat(), measuredHeight.toFloat(), CLEAR_PAINT)
+ }
+
+ companion object {
+ private val CLEAR_PAINT =
+ Paint().apply { xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR) }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCase.kt b/quickstep/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCase.kt
new file mode 100644
index 0000000..7673c71
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCase.kt
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail
+
+import android.graphics.Bitmap
+import android.view.Surface
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.quickstep.recents.data.RecentsRotationStateRepository
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.viewmodel.TaskContainerData
+import com.android.systemui.shared.recents.utilities.PreviewPositionHelper
+import com.android.systemui.shared.recents.utilities.Utilities
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
+
+class SplashAlphaUseCase(
+ private val recentsViewData: RecentsViewData,
+ private val taskContainerData: TaskContainerData,
+ private val taskThumbnailViewData: TaskThumbnailViewData,
+ private val tasksRepository: RecentTasksRepository,
+ private val rotationStateRepository: RecentsRotationStateRepository,
+) {
+ fun execute(taskId: Int): Flow<Float> =
+ combine(
+ taskThumbnailViewData.width,
+ taskThumbnailViewData.height,
+ tasksRepository.getThumbnailById(taskId),
+ taskContainerData.thumbnailSplashProgress,
+ recentsViewData.thumbnailSplashProgress
+ ) { width, height, thumbnailData, taskSplashProgress, globalSplashProgress ->
+ val thumbnail = thumbnailData?.thumbnail
+ when {
+ thumbnail == null -> 0f
+ taskSplashProgress > 0f -> taskSplashProgress
+ globalSplashProgress > 0f &&
+ isInaccurateThumbnail(thumbnail, thumbnailData.rotation, width, height) ->
+ globalSplashProgress
+ else -> 0f
+ }
+ }
+ .distinctUntilChanged()
+
+ private fun isInaccurateThumbnail(
+ thumbnail: Bitmap,
+ thumbnailRotation: Int,
+ width: Int,
+ height: Int
+ ): Boolean {
+ return isThumbnailAspectRatioDifferentFromThumbnailData(thumbnail, width, height) ||
+ isThumbnailRotationDifferentFromTask(thumbnailRotation)
+ }
+
+ private fun isThumbnailAspectRatioDifferentFromThumbnailData(
+ thumbnail: Bitmap,
+ viewWidth: Int,
+ viewHeight: Int
+ ): Boolean {
+ val viewAspect: Float = viewWidth / viewHeight.toFloat()
+ val thumbnailAspect: Float = thumbnail.width / thumbnail.height.toFloat()
+ return Utilities.isRelativePercentDifferenceGreaterThan(
+ viewAspect,
+ thumbnailAspect,
+ PreviewPositionHelper.MAX_PCT_BEFORE_ASPECT_RATIOS_CONSIDERED_DIFFERENT
+ )
+ }
+
+ private fun isThumbnailRotationDifferentFromTask(thumbnailRotation: Int): Boolean {
+ val rotationState = rotationStateRepository.getRecentsRotationState()
+ return if (rotationState.orientationHandlerRotation == Surface.ROTATION_0) {
+ (rotationState.activityRotation - thumbnailRotation) % 2 != 0
+ } else {
+ rotationState.orientationHandlerRotation != thumbnailRotation
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/TaskOverlayUiState.kt b/quickstep/src/com/android/quickstep/task/thumbnail/TaskOverlayUiState.kt
new file mode 100644
index 0000000..5fb5b90
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/TaskOverlayUiState.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail
+
+import android.graphics.Bitmap
+
+/** Ui state for [com.android.quickstep.TaskOverlayFactory.TaskOverlay] */
+sealed class TaskOverlayUiState {
+ data object Disabled : TaskOverlayUiState()
+
+ data class Enabled(val isRealSnapshot: Boolean, val thumbnail: Bitmap?) : TaskOverlayUiState()
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailUiState.kt b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailUiState.kt
index 0843ae3..36a86f2 100644
--- a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailUiState.kt
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailUiState.kt
@@ -16,11 +16,26 @@
package com.android.quickstep.task.thumbnail
-import com.android.systemui.shared.recents.model.Task
+import android.graphics.Bitmap
+import android.graphics.drawable.Drawable
+import android.view.Surface
+import androidx.annotation.ColorInt
sealed class TaskThumbnailUiState {
data object Uninitialized : TaskThumbnailUiState()
- data object LiveTile : TaskThumbnailUiState()
-}
-data class TaskThumbnail(val task: Task, val isRunning: Boolean)
+ data object LiveTile : TaskThumbnailUiState()
+
+ data class BackgroundOnly(@ColorInt val backgroundColor: Int) : TaskThumbnailUiState()
+
+ data class SnapshotSplash(
+ val snapshot: Snapshot,
+ val splash: Drawable?,
+ ) : TaskThumbnailUiState()
+
+ data class Snapshot(
+ val bitmap: Bitmap,
+ @Surface.Rotation val thumbnailRotation: Int,
+ @ColorInt val backgroundColor: Int
+ )
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailView.kt b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailView.kt
index d51069f..0279818 100644
--- a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailView.kt
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailView.kt
@@ -17,64 +17,200 @@
package com.android.quickstep.task.thumbnail
import android.content.Context
-import android.graphics.Canvas
-import android.graphics.Paint
-import android.graphics.PorterDuff
-import android.graphics.PorterDuffXfermode
+import android.content.res.Configuration
+import android.graphics.Color
+import android.graphics.Outline
+import android.graphics.Rect
import android.util.AttributeSet
import android.view.View
-import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.*
-import kotlinx.coroutines.MainScope
-import kotlinx.coroutines.launch
+import android.view.ViewOutlineProvider
+import androidx.annotation.ColorInt
+import androidx.constraintlayout.widget.ConstraintLayout
+import androidx.core.view.isInvisible
+import com.android.launcher3.R
+import com.android.launcher3.Utilities
+import com.android.launcher3.util.ViewPool
+import com.android.quickstep.recents.di.RecentsDependencies
+import com.android.quickstep.recents.di.inject
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.BackgroundOnly
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.LiveTile
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Snapshot
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.SnapshotSplash
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Uninitialized
+import com.android.quickstep.task.viewmodel.TaskThumbnailViewModel
+import com.android.quickstep.util.TaskCornerRadius
+import com.android.quickstep.views.FixedSizeImageView
+import com.android.systemui.shared.system.QuickStepContract
+import kotlin.math.abs
+import kotlinx.coroutines.CoroutineName
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.SupervisorJob
+import kotlinx.coroutines.cancel
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.onEach
-class TaskThumbnailView : View {
- // TODO(b/335649589): Ideally create and obtain this from DI. This ViewModel should be scoped
- // to [TaskView], and also shared between [TaskView] and [TaskThumbnailView]
- val viewModel = TaskThumbnailViewModel()
+class TaskThumbnailView : ConstraintLayout, ViewPool.Reusable {
+
+ private val viewData: TaskThumbnailViewData by RecentsDependencies.inject(this)
+ private val viewModel: TaskThumbnailViewModel by RecentsDependencies.inject(this)
+
+ private lateinit var viewAttachedScope: CoroutineScope
+
+ private val scrimView: View by lazy { findViewById(R.id.task_thumbnail_scrim) }
+ private val liveTileView: LiveTileView by lazy { findViewById(R.id.task_thumbnail_live_tile) }
+ private val thumbnailView: FixedSizeImageView by lazy { findViewById(R.id.task_thumbnail) }
+ private val splashBackground: View by lazy { findViewById(R.id.splash_background) }
+ private val splashIcon: FixedSizeImageView by lazy { findViewById(R.id.splash_icon) }
private var uiState: TaskThumbnailUiState = Uninitialized
+ private var inheritedScale: Float = 1f
- constructor(context: Context?) : super(context)
- constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
+ private val _measuredBounds = Rect()
+ private val measuredBounds: Rect
+ get() {
+ _measuredBounds.set(0, 0, measuredWidth, measuredHeight)
+ return _measuredBounds
+ }
+
+ private var overviewCornerRadius: Float = TaskCornerRadius.get(context)
+ private var fullscreenCornerRadius: Float = QuickStepContract.getWindowCornerRadius(context)
+
+ constructor(context: Context) : super(context)
+
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+
constructor(
- context: Context?,
+ context: Context,
attrs: AttributeSet?,
defStyleAttr: Int,
) : super(context, attrs, defStyleAttr)
override fun onAttachedToWindow() {
super.onAttachedToWindow()
- // TODO(b/335396935) replace MainScope with shorter lifecycle.
- MainScope().launch {
- viewModel.uiState.collect { viewModelUiState ->
+ viewAttachedScope =
+ CoroutineScope(SupervisorJob() + Dispatchers.Main + CoroutineName("TaskThumbnailView"))
+ viewModel.uiState
+ .onEach { viewModelUiState ->
uiState = viewModelUiState
- invalidate()
+ resetViews()
+ when (viewModelUiState) {
+ is Uninitialized -> {}
+ is LiveTile -> drawLiveWindow()
+ is SnapshotSplash -> drawSnapshotSplash(viewModelUiState)
+ is BackgroundOnly -> drawBackground(viewModelUiState.backgroundColor)
+ }
}
+ .launchIn(viewAttachedScope)
+ viewModel.dimProgress
+ .onEach { dimProgress -> scrimView.alpha = dimProgress }
+ .launchIn(viewAttachedScope)
+ viewModel.splashAlpha
+ .onEach { splashAlpha ->
+ splashBackground.alpha = splashAlpha
+ splashIcon.alpha = splashAlpha
+ }
+ .launchIn(viewAttachedScope)
+ viewModel.cornerRadiusProgress.onEach { invalidateOutline() }.launchIn(viewAttachedScope)
+ viewModel.inheritedScale
+ .onEach { viewModelInheritedScale ->
+ inheritedScale = viewModelInheritedScale
+ invalidateOutline()
+ }
+ .launchIn(viewAttachedScope)
+
+ clipToOutline = true
+ outlineProvider =
+ object : ViewOutlineProvider() {
+ override fun getOutline(view: View, outline: Outline) {
+ outline.setRoundRect(measuredBounds, getCurrentCornerRadius())
+ }
+ }
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ viewAttachedScope.cancel("TaskThumbnailView detaching from window")
+ }
+
+ override fun onRecycle() {
+ uiState = Uninitialized
+ }
+
+ override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
+ super.onLayout(changed, left, top, right, bottom)
+ if (changed) {
+ viewData.width.value = abs(right - left)
+ viewData.height.value = abs(bottom - top)
}
}
- override fun onDraw(canvas: Canvas) {
- when (uiState) {
- is Uninitialized -> {}
- is LiveTile -> drawTransparentUiState(canvas)
+ override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
+ super.onSizeChanged(w, h, oldw, oldh)
+ if (uiState is SnapshotSplash) {
+ setImageMatrix()
}
}
- private fun drawTransparentUiState(canvas: Canvas) {
- canvas.drawRoundRect(
- 0f,
- 0f,
- measuredWidth.toFloat(),
- measuredHeight.toFloat(),
- // TODO(b/334826840) add rounded corners
- 0f,
- 0f,
- CLEAR_PAINT
- )
+ override fun setScaleX(scaleX: Float) {
+ super.setScaleX(scaleX)
+ // Splash icon should ignore scale on TTV
+ splashIcon.scaleX = 1 / scaleX
}
- companion object {
- private val CLEAR_PAINT =
- Paint().apply { xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR) }
+ override fun setScaleY(scaleY: Float) {
+ super.setScaleY(scaleY)
+ // Splash icon should ignore scale on TTV
+ splashIcon.scaleY = 1 / scaleY
}
+
+ override fun onConfigurationChanged(newConfig: Configuration?) {
+ super.onConfigurationChanged(newConfig)
+
+ overviewCornerRadius = TaskCornerRadius.get(context)
+ fullscreenCornerRadius = QuickStepContract.getWindowCornerRadius(context)
+ invalidateOutline()
+ }
+
+ private fun resetViews() {
+ liveTileView.isInvisible = true
+ thumbnailView.isInvisible = true
+ splashBackground.alpha = 0f
+ splashIcon.alpha = 0f
+ scrimView.alpha = 0f
+ setBackgroundColor(Color.BLACK)
+ }
+
+ private fun drawBackground(@ColorInt background: Int) {
+ setBackgroundColor(background)
+ }
+
+ private fun drawLiveWindow() {
+ liveTileView.isInvisible = false
+ }
+
+ private fun drawSnapshotSplash(snapshotSplash: SnapshotSplash) {
+ drawSnapshot(snapshotSplash.snapshot)
+
+ splashBackground.setBackgroundColor(snapshotSplash.snapshot.backgroundColor)
+ splashIcon.setImageDrawable(snapshotSplash.splash)
+ }
+
+ private fun drawSnapshot(snapshot: Snapshot) {
+ drawBackground(snapshot.backgroundColor)
+ thumbnailView.setImageBitmap(snapshot.bitmap)
+ thumbnailView.isInvisible = false
+ setImageMatrix()
+ }
+
+ private fun setImageMatrix() {
+ thumbnailView.imageMatrix = viewModel.getThumbnailPositionState(width, height, isLayoutRtl)
+ }
+
+ private fun getCurrentCornerRadius() =
+ Utilities.mapRange(
+ viewModel.cornerRadiusProgress.value,
+ overviewCornerRadius,
+ fullscreenCornerRadius
+ ) / inheritedScale
}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewData.kt b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewData.kt
new file mode 100644
index 0000000..3502029
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewData.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail
+
+import kotlinx.coroutines.flow.MutableStateFlow
+
+class TaskThumbnailViewData {
+ val width = MutableStateFlow(0)
+ val height = MutableStateFlow(0)
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModel.kt b/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModel.kt
deleted file mode 100644
index 9925873..0000000
--- a/quickstep/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModel.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.task.thumbnail
-
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.StateFlow
-
-class TaskThumbnailViewModel {
- private val _uiState: MutableStateFlow<TaskThumbnailUiState> =
- MutableStateFlow(TaskThumbnailUiState.Uninitialized)
- val uiState: StateFlow<TaskThumbnailUiState> = _uiState
-
- fun bind(task: TaskThumbnail) {
- _uiState.value =
- if (task.isRunning) {
- TaskThumbnailUiState.LiveTile
- } else {
- TaskThumbnailUiState.Uninitialized
- }
- }
-}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskIconDataSource.kt b/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskIconDataSource.kt
new file mode 100644
index 0000000..ab699c6
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskIconDataSource.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail.data
+
+import com.android.launcher3.util.CancellableTask
+import com.android.quickstep.TaskIconCache.GetTaskIconCallback
+import com.android.systemui.shared.recents.model.Task
+
+interface TaskIconDataSource {
+ fun getIconInBackground(task: Task, callback: GetTaskIconCallback): CancellableTask<*>?
+}
diff --git a/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskThumbnailDataSource.kt b/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskThumbnailDataSource.kt
new file mode 100644
index 0000000..986acbe
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/thumbnail/data/TaskThumbnailDataSource.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail.data
+
+import com.android.launcher3.util.CancellableTask
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import java.util.function.Consumer
+
+interface TaskThumbnailDataSource {
+ fun getThumbnailInBackground(
+ task: Task,
+ callback: Consumer<ThumbnailData>
+ ): CancellableTask<ThumbnailData>?
+}
diff --git a/quickstep/src/com/android/quickstep/task/util/TaskOverlayHelper.kt b/quickstep/src/com/android/quickstep/task/util/TaskOverlayHelper.kt
new file mode 100644
index 0000000..9253dbf
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/util/TaskOverlayHelper.kt
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.util
+
+import android.util.Log
+import com.android.quickstep.TaskOverlayFactory
+import com.android.quickstep.recents.di.RecentsDependencies
+import com.android.quickstep.recents.di.get
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Disabled
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Enabled
+import com.android.quickstep.task.viewmodel.TaskOverlayViewModel
+import com.android.systemui.shared.recents.model.Task
+import kotlinx.coroutines.CoroutineName
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.SupervisorJob
+import kotlinx.coroutines.cancel
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.onEach
+
+/**
+ * Helper for [TaskOverlayFactory.TaskOverlay] to interact with [TaskOverlayViewModel], this helper
+ * should merge with [TaskOverlayFactory.TaskOverlay] when it's migrated to MVVM.
+ */
+class TaskOverlayHelper(val task: Task, val overlay: TaskOverlayFactory.TaskOverlay<*>) {
+ private lateinit var overlayInitializedScope: CoroutineScope
+ private var uiState: TaskOverlayUiState = Disabled
+
+ private val viewModel: TaskOverlayViewModel by lazy {
+ TaskOverlayViewModel(
+ task = task,
+ recentsViewData = RecentsDependencies.get(),
+ getThumbnailPositionUseCase = RecentsDependencies.get(),
+ recentTasksRepository = RecentsDependencies.get()
+ )
+ }
+
+ // TODO(b/331753115): TaskOverlay should listen for state changes and react.
+ val enabledState: Enabled
+ get() = uiState as Enabled
+
+ fun getThumbnailMatrix() = getThumbnailPositionState().matrix
+
+ private fun getThumbnailPositionState() =
+ viewModel.getThumbnailPositionState(
+ overlay.snapshotView.width,
+ overlay.snapshotView.height,
+ overlay.snapshotView.isLayoutRtl
+ )
+
+ fun init() {
+ overlayInitializedScope =
+ CoroutineScope(SupervisorJob() + Dispatchers.Main + CoroutineName("TaskOverlayHelper"))
+ viewModel.overlayState
+ .onEach {
+ uiState = it
+ if (it is Enabled) {
+ initOverlay(it)
+ } else {
+ reset()
+ }
+ }
+ .launchIn(overlayInitializedScope)
+ overlay.snapshotView.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ ->
+ (uiState as? Enabled)?.let { initOverlay(it) }
+ }
+ }
+
+ private fun initOverlay(enabledState: Enabled) {
+ Log.d(TAG, "initOverlay - taskId: ${task.key.id}, thumbnail: ${enabledState.thumbnail}")
+ with(getThumbnailPositionState()) {
+ overlay.initOverlay(task, enabledState.thumbnail, matrix, isRotated)
+ }
+ }
+
+ private fun reset() {
+ Log.d(TAG, "reset - taskId: ${task.key.id}")
+ overlay.reset()
+ }
+
+ fun destroy() {
+ overlayInitializedScope.cancel()
+ uiState = Disabled
+ reset()
+ }
+
+ companion object {
+ private const val TAG = "TaskOverlayHelper"
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/task/viewmodel/TaskContainerData.kt b/quickstep/src/com/android/quickstep/task/viewmodel/TaskContainerData.kt
new file mode 100644
index 0000000..5f2de94
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/viewmodel/TaskContainerData.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import kotlinx.coroutines.flow.MutableStateFlow
+
+class TaskContainerData {
+ val taskMenuOpenProgress = MutableStateFlow(0f)
+
+ val thumbnailSplashProgress = MutableStateFlow(0f)
+}
diff --git a/quickstep/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModel.kt b/quickstep/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModel.kt
new file mode 100644
index 0000000..4e13d1c
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModel.kt
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import android.graphics.Matrix
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.quickstep.recents.usecase.GetThumbnailPositionUseCase
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MatrixScaling
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MissingThumbnail
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Disabled
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Enabled
+import com.android.systemui.shared.recents.model.Task
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.runBlocking
+
+/** View model for TaskOverlay */
+class TaskOverlayViewModel(
+ private val task: Task,
+ recentsViewData: RecentsViewData,
+ private val getThumbnailPositionUseCase: GetThumbnailPositionUseCase,
+ recentTasksRepository: RecentTasksRepository,
+) {
+ val overlayState =
+ combine(
+ recentsViewData.overlayEnabled,
+ recentsViewData.settledFullyVisibleTaskIds.map { it.contains(task.key.id) },
+ recentTasksRepository.getThumbnailById(task.key.id)
+ ) { isOverlayEnabled, isFullyVisible, thumbnailData ->
+ if (isOverlayEnabled && isFullyVisible) {
+ Enabled(
+ isRealSnapshot = (thumbnailData?.isRealSnapshot ?: false) && !task.isLocked,
+ thumbnailData?.thumbnail,
+ )
+ } else {
+ Disabled
+ }
+ }
+ .distinctUntilChanged()
+
+ fun getThumbnailPositionState(width: Int, height: Int, isRtl: Boolean): ThumbnailPositionState {
+ return runBlocking {
+ val matrix: Matrix
+ val isRotated: Boolean
+ when (
+ val thumbnailPositionState =
+ getThumbnailPositionUseCase.run(task.key.id, width, height, isRtl)
+ ) {
+ is MatrixScaling -> {
+ matrix = thumbnailPositionState.matrix
+ isRotated = thumbnailPositionState.isRotated
+ }
+ is MissingThumbnail -> {
+ matrix = Matrix.IDENTITY_MATRIX
+ isRotated = false
+ }
+ }
+ ThumbnailPositionState(matrix, isRotated)
+ }
+ }
+
+ data class ThumbnailPositionState(val matrix: Matrix, val isRotated: Boolean)
+}
diff --git a/quickstep/src/com/android/quickstep/task/viewmodel/TaskThumbnailViewModel.kt b/quickstep/src/com/android/quickstep/task/viewmodel/TaskThumbnailViewModel.kt
new file mode 100644
index 0000000..b1bb65e
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/viewmodel/TaskThumbnailViewModel.kt
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language goveryning permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import android.annotation.ColorInt
+import android.app.ActivityTaskManager.INVALID_TASK_ID
+import android.graphics.Matrix
+import androidx.core.graphics.ColorUtils
+import com.android.quickstep.recents.data.RecentTasksRepository
+import com.android.quickstep.recents.usecase.GetThumbnailPositionUseCase
+import com.android.quickstep.recents.usecase.ThumbnailPositionState
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.thumbnail.SplashAlphaUseCase
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.BackgroundOnly
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.LiveTile
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Snapshot
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.SnapshotSplash
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Uninitialized
+import com.android.systemui.shared.recents.model.Task
+import kotlin.math.max
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.runBlocking
+
+@OptIn(ExperimentalCoroutinesApi::class)
+class TaskThumbnailViewModel(
+ recentsViewData: RecentsViewData,
+ taskViewData: TaskViewData,
+ taskContainerData: TaskContainerData,
+ private val tasksRepository: RecentTasksRepository,
+ private val getThumbnailPositionUseCase: GetThumbnailPositionUseCase,
+ private val splashAlphaUseCase: SplashAlphaUseCase,
+) {
+ private val task = MutableStateFlow<Flow<Task?>>(flowOf(null))
+ private val splashProgress = MutableStateFlow(flowOf(0f))
+ private var taskId: Int = INVALID_TASK_ID
+
+ /**
+ * Progress for changes in corner radius. progress: 0 = overview corner radius; 1 = fullscreen
+ * corner radius.
+ */
+ val cornerRadiusProgress =
+ if (taskViewData.isOutlineFormedByThumbnailView) recentsViewData.fullscreenProgress
+ else MutableStateFlow(1f).asStateFlow()
+
+ val inheritedScale =
+ combine(recentsViewData.scale, taskViewData.scale) { recentsScale, taskScale ->
+ recentsScale * taskScale
+ }
+
+ val dimProgress: Flow<Float> =
+ combine(taskContainerData.taskMenuOpenProgress, recentsViewData.tintAmount) {
+ taskMenuOpenProgress,
+ tintAmount ->
+ max(taskMenuOpenProgress * MAX_SCRIM_ALPHA, tintAmount)
+ }
+ val splashAlpha = splashProgress.flatMapLatest { it }
+
+ private val isLiveTile =
+ combine(
+ task.flatMapLatest { it }.map { it?.key?.id }.distinctUntilChanged(),
+ recentsViewData.runningTaskIds,
+ recentsViewData.runningTaskShowScreenshot
+ ) { taskId, runningTaskIds, runningTaskShowScreenshot ->
+ runningTaskIds.contains(taskId) && !runningTaskShowScreenshot
+ }
+ .distinctUntilChanged()
+
+ val uiState: Flow<TaskThumbnailUiState> =
+ combine(task.flatMapLatest { it }, isLiveTile) { taskVal, isRunning ->
+ when {
+ taskVal == null -> Uninitialized
+ isRunning -> LiveTile
+ isBackgroundOnly(taskVal) ->
+ BackgroundOnly(taskVal.colorBackground.removeAlpha())
+ isSnapshotSplashState(taskVal) ->
+ SnapshotSplash(createSnapshotState(taskVal), taskVal.icon)
+ else -> Uninitialized
+ }
+ }
+ .distinctUntilChanged()
+
+ fun bind(taskId: Int) {
+ this.taskId = taskId
+ task.value = tasksRepository.getTaskDataById(taskId)
+ splashProgress.value = splashAlphaUseCase.execute(taskId)
+ }
+
+ fun getThumbnailPositionState(width: Int, height: Int, isRtl: Boolean): Matrix {
+ return runBlocking {
+ when (
+ val thumbnailPositionState =
+ getThumbnailPositionUseCase.run(taskId, width, height, isRtl)
+ ) {
+ is ThumbnailPositionState.MatrixScaling -> thumbnailPositionState.matrix
+ is ThumbnailPositionState.MissingThumbnail -> Matrix.IDENTITY_MATRIX
+ }
+ }
+ }
+
+ private fun isBackgroundOnly(task: Task): Boolean = task.isLocked || task.thumbnail == null
+
+ private fun isSnapshotSplashState(task: Task): Boolean {
+ val thumbnailPresent = task.thumbnail?.thumbnail != null
+ val taskLocked = task.isLocked
+
+ return thumbnailPresent && !taskLocked
+ }
+
+ private fun createSnapshotState(task: Task): Snapshot {
+ val thumbnailData = task.thumbnail
+ val bitmap = thumbnailData?.thumbnail!!
+ return Snapshot(bitmap, thumbnailData.rotation, task.colorBackground.removeAlpha())
+ }
+
+ @ColorInt private fun Int.removeAlpha(): Int = ColorUtils.setAlphaComponent(this, 0xff)
+
+ private companion object {
+ const val MAX_SCRIM_ALPHA = 0.4f
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewData.kt b/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewData.kt
new file mode 100644
index 0000000..7a9ecf2
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewData.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import com.android.quickstep.views.TaskViewType
+import kotlinx.coroutines.flow.MutableStateFlow
+
+class TaskViewData(taskViewType: TaskViewType) {
+ // This is typically a View concern but it is used to invalidate rendering in other Views
+ val scale = MutableStateFlow(1f)
+
+ // TODO(b/331753115): This property should not be in TaskViewData once TaskView is MVVM.
+ /** Whether outline of TaskView is formed by outline thumbnail view(s). */
+ val isOutlineFormedByThumbnailView: Boolean = taskViewType != TaskViewType.DESKTOP
+}
diff --git a/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewModel.kt b/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewModel.kt
new file mode 100644
index 0000000..ec75d59
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/task/viewmodel/TaskViewModel.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import androidx.lifecycle.ViewModel
+
+class TaskViewModel(private val taskViewData: TaskViewData) : ViewModel() {
+ fun updateScale(scale: Float) {
+ taskViewData.scale.value = scale
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java
index cfa6b98..2398e66 100644
--- a/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java
+++ b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java
@@ -40,6 +40,7 @@
SCROLLER_ANIMATION_ABORTED, TASK_APPEARED, EXPECTING_TASK_APPEARED,
FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER, LAUNCHER_DESTROYED, RECENT_TASKS_MISSING,
INVALID_VELOCITY_ON_SWIPE_UP, RECENTS_ANIMATION_START_PENDING,
+ QUICK_SWITCH_FROM_HOME_FALLBACK, QUICK_SWITCH_FROM_HOME_FAILED, NAVIGATION_MODE_SWITCHED,
/**
* These GestureEvents are specifically associated to state flags that get set in
@@ -282,6 +283,29 @@
+ " animation is still pending.",
writer);
break;
+ case QUICK_SWITCH_FROM_HOME_FALLBACK:
+ errorDetected |= printErrorIfTrue(
+ true,
+ prefix,
+ /* errorMessage= */ "Quick switch from home fallback case: the "
+ + "TaskView at the current page index was missing.",
+ writer);
+ break;
+ case QUICK_SWITCH_FROM_HOME_FAILED:
+ errorDetected |= printErrorIfTrue(
+ true,
+ prefix,
+ /* errorMessage= */ "Quick switch from home failed: the TaskViews at "
+ + "the current page index and index 0 were missing.",
+ writer);
+ break;
+ case NAVIGATION_MODE_SWITCHED:
+ errorDetected |= printErrorIfTrue(
+ true,
+ prefix,
+ /* errorMessage= */ "Navigation mode switched mid-gesture.",
+ writer);
+ break;
case EXPECTING_TASK_APPEARED:
case MOTION_DOWN:
case SET_END_TARGET:
diff --git a/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java b/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
index c54862a..d46b8fc 100644
--- a/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
+++ b/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
@@ -23,6 +23,7 @@
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -237,7 +238,8 @@
/** An entire log of entries associated with a single log ID */
protected static class EventLog {
- protected final List<EventEntry> eventEntries = new ArrayList<>();
+ protected final List<EventEntry> eventEntries =
+ Collections.synchronizedList(new ArrayList<>());
protected final int logId;
protected final boolean mIsFullyGesturalNavMode;
diff --git a/quickstep/src/com/android/quickstep/util/AnimUtils.java b/quickstep/src/com/android/quickstep/util/AnimUtils.java
index 8e3d44f..31aca03 100644
--- a/quickstep/src/com/android/quickstep/util/AnimUtils.java
+++ b/quickstep/src/com/android/quickstep/util/AnimUtils.java
@@ -17,18 +17,28 @@
package com.android.quickstep.util;
import static com.android.app.animation.Interpolators.clampToProgress;
+import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import android.animation.AnimatorSet;
+import android.annotation.NonNull;
import android.os.Bundle;
import android.os.IRemoteCallback;
import android.view.animation.Interpolator;
+import com.android.launcher3.logging.StatsLogManager;
+import com.android.launcher3.statemanager.BaseState;
+import com.android.launcher3.statemanager.StateManager;
+import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.RunnableList;
+import com.android.quickstep.views.RecentsViewContainer;
/**
* Utility class containing methods to help manage animations, interpolators, and timings.
*/
public class AnimUtils {
+ private static final int DURATION_DEFAULT_SPLIT_DISMISS = 350;
+
/**
* Fetches device-specific timings for the Overview > Split animation
* (splitscreen initiated from Overview).
@@ -59,6 +69,33 @@
}
/**
+ * Synchronizes the timing for the split dismiss animation to the current transition to
+ * NORMAL (launcher home/workspace)
+ */
+ public static void goToNormalStateWithSplitDismissal(@NonNull StateManager stateManager,
+ @NonNull RecentsViewContainer container,
+ @NonNull StatsLogManager.LauncherEvent exitReason,
+ @NonNull SplitAnimationController animationController) {
+ StateAnimationConfig config = new StateAnimationConfig();
+ BaseState startState = stateManager.getState();
+ long duration = startState.getTransitionDuration(container.asContext(),
+ false /*isToState*/);
+ if (duration == 0) {
+ // Case where we're in contextual on workspace (NORMAL), which by default has 0
+ // transition duration
+ duration = DURATION_DEFAULT_SPLIT_DISMISS;
+ }
+ config.duration = duration;
+ AnimatorSet stateAnim = stateManager.createAtomicAnimation(
+ startState, NORMAL, config);
+ AnimatorSet dismissAnim = animationController
+ .createPlaceholderDismissAnim(container, exitReason, duration);
+ stateAnim.play(dismissAnim);
+ stateManager.setCurrentAnimation(stateAnim, NORMAL);
+ stateAnim.start();
+ }
+
+ /**
* Returns a IRemoteCallback which completes the provided list as a result
*/
public static IRemoteCallback completeRunnableListCallback(RunnableList list) {
diff --git a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
index c9647f5..c7c04ed 100644
--- a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
+++ b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
@@ -39,6 +39,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statemanager.StateManager;
+import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.touch.AllAppsSwipeController;
import com.android.quickstep.DeviceConfigWrapper;
@@ -163,7 +164,8 @@
recentsOrientedState.getContainerInterface().getCreatedContainer();
if (container != null) {
RecentsView recentsView = container.getOverviewPanel();
- StateManager<LauncherState> stateManager = recentsView.getStateManager();
+ StateManager<LauncherState, StatefulActivity<LauncherState>> stateManager =
+ recentsView.getStateManager();
if (stateManager.isInStableState(LauncherState.BACKGROUND_APP)
&& stateManager.isInTransition()) {
diff --git a/quickstep/src/com/android/quickstep/util/AppPairsController.java b/quickstep/src/com/android/quickstep/util/AppPairsController.java
index a82031a..e1013db 100644
--- a/quickstep/src/com/android/quickstep/util/AppPairsController.java
+++ b/quickstep/src/com/android/quickstep/util/AppPairsController.java
@@ -26,49 +26,55 @@
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
-import static com.android.wm.shell.common.split.SplitScreenConstants.isPersistentSnapPosition;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_NONE;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.isPersistentSnapPosition;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
import android.content.pm.LauncherApps;
-import android.content.pm.PackageManager;
import android.util.Log;
import android.util.Pair;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.internal.jank.Cuj;
import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.LauncherSettings;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.allapps.AllAppsStore;
import com.android.launcher3.apppairs.AppPairIcon;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.AppPairInfo;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.ComponentKey;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.launcher3.views.ActivityContext;
import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.TaskUtils;
import com.android.quickstep.TopTaskTracker;
import com.android.quickstep.views.GroupedTaskView;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosition;
+import com.android.wm.shell.shared.split.SplitScreenConstants.PersistentSnapPosition;
import java.util.Arrays;
import java.util.List;
+import java.util.function.Consumer;
/**
* Controller class that handles app pair interactions: saving, modifying, deleting, etc.
@@ -101,6 +107,55 @@
}
/**
+ * Returns whether the specified GroupedTaskView can be saved as an app pair.
+ */
+ public boolean canSaveAppPair(TaskView taskView) {
+ if (mContext == null) {
+ // Can ignore as the activity is already destroyed
+ return false;
+ }
+
+ // Disallow saving app pairs if:
+ // - app pairs feature is not enabled
+ // - the task in question is a single task
+ // - at least one app in app pair is unpinnable
+ // - the task is not a GroupedTaskView
+ // - both tasks in the GroupedTaskView are from the same app and the app does not
+ // support multi-instance
+ boolean hasUnpinnableApp = taskView.getTaskContainers().stream()
+ .anyMatch(att -> att != null && att.getItemInfo() != null
+ && ((att.getItemInfo().runtimeStatusFlags
+ & ItemInfoWithIcon.FLAG_NOT_PINNABLE) != 0));
+ if (!FeatureFlags.enableAppPairs()
+ || !taskView.containsMultipleTasks()
+ || hasUnpinnableApp
+ || !(taskView instanceof GroupedTaskView)) {
+ return false;
+ }
+
+ GroupedTaskView gtv = (GroupedTaskView) taskView;
+ List<TaskContainer> containers = gtv.getTaskContainers();
+ ComponentKey taskKey1 = TaskUtils.getLaunchComponentKeyForTask(
+ containers.get(0).getTask().key);
+ ComponentKey taskKey2 = TaskUtils.getLaunchComponentKeyForTask(
+ containers.get(1).getTask().key);
+ AppInfo app1 = resolveAppInfoByComponent(taskKey1);
+ AppInfo app2 = resolveAppInfoByComponent(taskKey2);
+
+ if (app1 == null || app2 == null) {
+ // Disallow saving app pairs for apps that don't have a front-door in Launcher
+ return false;
+ }
+
+ if (PackageManagerHelper.isSameAppForMultiInstance(app1, app2)) {
+ if (!app1.supportsMultiInstance() || !app2.supportsMultiInstance()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Creates a new app pair ItemInfo and adds it to the workspace.
* <br>
* We create WorkspaceItemInfos to save onto the app pair in the following way:
@@ -116,34 +171,30 @@
*/
public void saveAppPair(GroupedTaskView gtv) {
InteractionJankMonitorWrapper.begin(gtv, Cuj.CUJ_LAUNCHER_SAVE_APP_PAIR);
- TaskView.TaskIdAttributeContainer[] attributes = gtv.getTaskIdAttributeContainers();
- WorkspaceItemInfo recentsInfo1 = attributes[0].getItemInfo();
- WorkspaceItemInfo recentsInfo2 = attributes[1].getItemInfo();
- WorkspaceItemInfo app1 = lookupLaunchableItem(recentsInfo1.getComponentKey());
- WorkspaceItemInfo app2 = lookupLaunchableItem(recentsInfo2.getComponentKey());
+ List<TaskContainer> containers = gtv.getTaskContainers();
+ WorkspaceItemInfo recentsInfo1 = containers.get(0).getItemInfo();
+ WorkspaceItemInfo recentsInfo2 = containers.get(1).getItemInfo();
+ WorkspaceItemInfo app1 = resolveAppPairWorkspaceInfo(recentsInfo1);
+ WorkspaceItemInfo app2 = resolveAppPairWorkspaceInfo(recentsInfo2);
- // If app lookup fails, use the WorkspaceItemInfo that we have, but try to override default
- // intent with one from PackageManager.
- if (app1 == null) {
- Log.w(TAG, "Creating an app pair, but app lookup for " + recentsInfo1.title
- + " failed. Falling back to the WorkspaceItemInfo from Recents.");
- app1 = convertRecentsItemToAppItem(recentsInfo1);
+ if (app1 == null || app2 == null) {
+ // This shouldn't happen if canSaveAppPair() is called above, but log an error and do
+ // not create the app pair if the workspace items can't be resolved
+ Log.w(TAG, "Failed to save app pair due to invalid apps ("
+ + "app1=" + recentsInfo1.getComponentKey().componentName
+ + " app2=" + recentsInfo2.getComponentKey().componentName + ")");
+ return;
}
- if (app2 == null) {
- Log.w(TAG, "Creating an app pair, but app lookup for " + recentsInfo2.title
- + " failed. Falling back to the WorkspaceItemInfo from Recents.");
- app2 = convertRecentsItemToAppItem(recentsInfo2);
- }
-
- // WorkspaceItemProcessor won't process these new ItemInfos until the next launcher restart,
- // so update some flags now.
- updateWorkspaceItemFlags(app1);
- updateWorkspaceItemFlags(app2);
@PersistentSnapPosition int snapPosition = gtv.getSnapPosition();
+ if (snapPosition == SNAP_TO_NONE) {
+ // Free snap mode is enabled, just save it as 50/50 split.
+ snapPosition = SNAP_TO_50_50;
+ }
if (!isPersistentSnapPosition(snapPosition)) {
- // if we received an illegal snap position, log an error and do not create the app pair.
- Log.wtf(TAG, "tried to save an app pair with illegal snapPosition " + snapPosition);
+ // If we received an illegal snap position, log an error and do not create the app pair
+ Log.wtf(TAG, "Tried to save an app pair with illegal snapPosition "
+ + snapPosition);
return;
}
@@ -182,14 +233,16 @@
*
* @param cuj Should be an integer from {@link Cuj} or -1 if no CUJ needs to be logged for jank
* monitoring
+ * @param callback Called after the app pair launch finishes animating, or null if no method is
+ * to be called
*/
- public void launchAppPair(AppPairIcon appPairIcon, int cuj) {
+ public void launchAppPair(AppPairIcon appPairIcon, int cuj,
+ @Nullable Consumer<Boolean> callback) {
WorkspaceItemInfo app1 = appPairIcon.getInfo().getFirstApp();
WorkspaceItemInfo app2 = appPairIcon.getInfo().getSecondApp();
ComponentKey app1Key = new ComponentKey(app1.getTargetComponent(), app1.user);
ComponentKey app2Key = new ComponentKey(app2.getTargetComponent(), app2.user);
- mSplitSelectStateController.setLaunchingCuj(cuj);
- InteractionJankMonitorWrapper.begin(appPairIcon, cuj);
+ mSplitSelectStateController.setLaunchingCuj(appPairIcon, cuj);
mSplitSelectStateController.findLastActiveTasksAndRunCallback(
Arrays.asList(app1Key, app2Key),
@@ -223,73 +276,51 @@
mSplitSelectStateController.setLaunchingIconView(appPairIcon);
mSplitSelectStateController.launchSplitTasks(
- AppPairsController.convertRankToSnapPosition(app1.rank));
+ AppPairsController.convertRankToSnapPosition(app1.rank), callback);
}
);
}
/**
+ * Launches an app pair but does not specify a callback
+ */
+ public void launchAppPair(AppPairIcon appPairIcon, int cuj) {
+ launchAppPair(appPairIcon, cuj, null);
+ }
+
+ /**
+ * Returns an AppInfo associated with the app for the given ComponentKey, or null if no such
+ * package exists in the AllAppsStore.
+ */
+ @Nullable
+ private AppInfo resolveAppInfoByComponent(@NonNull ComponentKey key) {
+ AllAppsStore appsStore = ActivityContext.lookupContext(mContext)
+ .getAppsView().getAppsStore();
+
+ // First look up the app info in order of:
+ // - The exact activity for the recent task
+ // - The first(?) loaded activity from the package
+ AppInfo appInfo = appsStore.getApp(key);
+ if (appInfo == null) {
+ appInfo = appsStore.getApp(key, PACKAGE_KEY_COMPARATOR);
+ }
+ return appInfo;
+ }
+
+ /**
* Creates a new launchable WorkspaceItemInfo of itemType=ITEM_TYPE_APPLICATION by looking the
* ComponentKey up in the AllAppsStore. If no app is found, attempts a lookup by package
* instead. If that lookup fails, returns null.
*/
@Nullable
- private WorkspaceItemInfo lookupLaunchableItem(@Nullable ComponentKey key) {
- if (key == null) {
+ private WorkspaceItemInfo resolveAppPairWorkspaceInfo(
+ @NonNull WorkspaceItemInfo recentTaskInfo) {
+ // ComponentKey should never be null (see TaskView#getItemInfo)
+ AppInfo appInfo = resolveAppInfoByComponent(recentTaskInfo.getComponentKey());
+ if (appInfo == null) {
return null;
}
-
- AllAppsStore appsStore = ActivityContext.lookupContext(mContext)
- .getAppsView().getAppsStore();
-
- // Lookup by ComponentKey
- AppInfo appInfo = appsStore.getApp(key);
- if (appInfo == null) {
- // Lookup by package
- appInfo = appsStore.getApp(key, PACKAGE_KEY_COMPARATOR);
- }
-
- return appInfo != null ? appInfo.makeWorkspaceItem(mContext) : null;
- }
-
- /**
- * Updates flags for newly created WorkspaceItemInfos.
- */
- private void updateWorkspaceItemFlags(WorkspaceItemInfo wii) {
- PackageManager pm = mContext.getPackageManager();
- ActivityInfo ai = null;
- try {
- ai = pm.getActivityInfo(wii.getTargetComponent(), 0);
- } catch (PackageManager.NameNotFoundException e) {
- Log.w(TAG, "PackageManager lookup failed.");
- }
-
- if (ai != null) {
- wii.setNonResizeable(ai.resizeMode == ActivityInfo.RESIZE_MODE_UNRESIZEABLE);
- }
- }
-
- /**
- * Converts a WorkspaceItemInfo of itemType=ITEM_TYPE_TASK (from a Recents task) to a new
- * WorkspaceItemInfo of itemType=ITEM_TYPE_APPLICATION.
- */
- private WorkspaceItemInfo convertRecentsItemToAppItem(WorkspaceItemInfo recentsItem) {
- if (recentsItem.itemType != LauncherSettings.Favorites.ITEM_TYPE_TASK) {
- Log.w(TAG, "Expected ItemInfo of type ITEM_TYPE_TASK, but received "
- + recentsItem.itemType);
- }
-
- WorkspaceItemInfo launchableItem = recentsItem.clone();
- PackageManager p = mContext.getPackageManager();
- Intent launchIntent = p.getLaunchIntentForPackage(recentsItem.getTargetPackage());
- Log.w(TAG, "Initial intent from Recents: " + launchableItem.intent + "\n"
- + "Intent from PackageManager: " + launchIntent);
- if (launchIntent != null) {
- // If lookup from PackageManager fails, just use the existing intent
- launchableItem.intent = launchIntent;
- }
- launchableItem.itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
- return launchableItem;
+ return appInfo.makeWorkspaceItem(mContext);
}
/**
diff --git a/quickstep/src/com/android/quickstep/util/AssistContentRequester.java b/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
index 0ce54ad..2e3dee6 100644
--- a/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
+++ b/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
@@ -81,7 +81,7 @@
try {
mActivityTaskManager.requestAssistDataForTask(
new AssistDataReceiver(callback, this), taskId, mPackageName,
- mAttributionTag);
+ mAttributionTag, false /* fetchStructure */);
} catch (RemoteException e) {
Log.e(TAG, "Requesting assist content failed for task: " + taskId, e);
}
diff --git a/quickstep/src/com/android/quickstep/util/AssistStateManager.java b/quickstep/src/com/android/quickstep/util/AssistStateManager.java
index 42db65f..7acb28d 100644
--- a/quickstep/src/com/android/quickstep/util/AssistStateManager.java
+++ b/quickstep/src/com/android/quickstep/util/AssistStateManager.java
@@ -33,8 +33,8 @@
public AssistStateManager() {}
- /** Whether search is available. */
- public boolean isSearchAvailable() {
+ /** Return {@code true} if the Settings toggle is enabled. */
+ public boolean isSettingsAllEntrypointsEnabled() {
return false;
}
@@ -43,14 +43,9 @@
return false;
}
- /** Whether CsHelper CtS invocation path is available. */
- public Optional<Boolean> isCsHelperAvailable() {
- return Optional.empty();
- }
-
- /** Whether VIS CtS invocation path is available. */
- public Optional<Boolean> isVisAvailable() {
- return Optional.empty();
+ /** Whether ContextualSearchService invocation path is available. */
+ public boolean isContextualSearchServiceAvailable() {
+ return false;
}
/** Get the Launcher overridden long press nav handle duration to trigger Assistant. */
@@ -90,11 +85,6 @@
return Optional.empty();
}
- /** Return {@code true} if the Settings toggle is enabled. */
- public boolean isSettingsAllEntrypointsEnabled() {
- return false;
- }
-
/** Dump states. */
public void dump(String prefix, PrintWriter writer) {}
diff --git a/quickstep/src/com/android/quickstep/util/AsyncClockEventDelegate.java b/quickstep/src/com/android/quickstep/util/AsyncClockEventDelegate.java
index cda87c0..38ae303 100644
--- a/quickstep/src/com/android/quickstep/util/AsyncClockEventDelegate.java
+++ b/quickstep/src/com/android/quickstep/util/AsyncClockEventDelegate.java
@@ -52,7 +52,7 @@
private final Context mContext;
private final SimpleBroadcastReceiver mReceiver =
- new SimpleBroadcastReceiver(this::onClockEventReceived);
+ new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, this::onClockEventReceived);
private final ArrayMap<BroadcastReceiver, Handler> mTimeEventReceivers = new ArrayMap<>();
private final List<ContentObserver> mFormatObservers = new ArrayList<>();
@@ -64,9 +64,7 @@
private AsyncClockEventDelegate(Context context) {
super(context);
mContext = context;
-
- UI_HELPER_EXECUTOR.execute(() ->
- mReceiver.register(mContext, ACTION_TIME_CHANGED, ACTION_TIMEZONE_CHANGED));
+ mReceiver.register(mContext, ACTION_TIME_CHANGED, ACTION_TIMEZONE_CHANGED);
}
@Override
@@ -127,6 +125,6 @@
public void close() {
mDestroyed = true;
SettingsCache.INSTANCE.get(mContext).unregister(mFormatUri, this);
- UI_HELPER_EXECUTOR.execute(() -> mReceiver.unregisterReceiverSafely(mContext));
+ mReceiver.unregisterReceiverSafely(mContext);
}
}
diff --git a/quickstep/src/com/android/quickstep/util/BaseUnfoldMoveFromCenterAnimator.java b/quickstep/src/com/android/quickstep/util/BaseUnfoldMoveFromCenterAnimator.java
index 328a727..f1e2dd7 100644
--- a/quickstep/src/com/android/quickstep/util/BaseUnfoldMoveFromCenterAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/BaseUnfoldMoveFromCenterAnimator.java
@@ -21,8 +21,11 @@
import android.view.ViewGroup;
import android.view.WindowManager;
+import androidx.annotation.MainThread;
+
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
+import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.updates.RotationChangeProvider;
import java.util.HashMap;
@@ -34,7 +37,7 @@
public abstract class BaseUnfoldMoveFromCenterAnimator implements TransitionProgressListener {
private final UnfoldMoveFromCenterAnimator mMoveFromCenterAnimation;
- private final RotationChangeProvider mRotationChangeProvider;
+ @UnfoldMain private final RotationChangeProvider mRotationChangeProvider;
private final Map<ViewGroup, Boolean> mOriginalClipToPadding = new HashMap<>();
private final Map<ViewGroup, Boolean> mOriginalClipChildren = new HashMap<>();
@@ -48,7 +51,7 @@
private Float mLastTransitionProgress = null;
public BaseUnfoldMoveFromCenterAnimator(WindowManager windowManager,
- RotationChangeProvider rotationChangeProvider) {
+ @UnfoldMain RotationChangeProvider rotationChangeProvider) {
mMoveFromCenterAnimation = new UnfoldMoveFromCenterAnimator(windowManager,
new LauncherViewsMoveFromCenterTranslationApplier());
mRotationChangeProvider = rotationChangeProvider;
@@ -143,8 +146,14 @@
private class UnfoldMoveFromCenterRotationListener implements
RotationChangeProvider.RotationListener {
+ @MainThread
@Override
public void onRotationChanged(@Rotation int newRotation) {
+ onRotationChangedInternal(newRotation);
+ }
+
+ @MainThread
+ private void onRotationChangedInternal(@Rotation int newRotation) {
mMoveFromCenterAnimation.updateDisplayProperties(newRotation);
updateRegisteredViewsIfNeeded();
}
diff --git a/quickstep/src/com/android/quickstep/util/BorderAnimator.kt b/quickstep/src/com/android/quickstep/util/BorderAnimator.kt
index 44eb070..7e51fcf 100644
--- a/quickstep/src/com/android/quickstep/util/BorderAnimator.kt
+++ b/quickstep/src/com/android/quickstep/util/BorderAnimator.kt
@@ -50,7 +50,7 @@
private val disappearanceDurationMs: Long,
private val interpolator: Interpolator,
) {
- private val borderAnimationProgress = AnimatedFloat { updateOutline() }
+ private val borderAnimationProgress = AnimatedFloat { _ -> updateOutline() }
private val borderPaint =
Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = borderColor
@@ -86,7 +86,7 @@
fun createSimpleBorderAnimator(
@Px borderRadiusPx: Int,
@Px borderWidthPx: Int,
- boundsBuilder: (rect: Rect?) -> Unit,
+ boundsBuilder: (Rect) -> Unit,
targetView: View,
@ColorInt borderColor: Int = DEFAULT_BORDER_COLOR,
appearanceDurationMs: Long = DEFAULT_APPEARANCE_ANIMATION_DURATION_MS,
@@ -224,6 +224,7 @@
val borderWidth: Float
get() = borderWidthPx * animationProgress
+
val alignmentAdjustment: Float
// Outset the border by half the width to create an outwards-growth animation
get() = -borderWidth / 2f + alignmentAdjustmentInset
@@ -250,7 +251,7 @@
/** BorderAnimationParams that simply draws the border outside the bounds of the target view. */
private class SimpleParams(
@Px borderWidthPx: Int,
- boundsBuilder: (rect: Rect?) -> Unit,
+ boundsBuilder: (Rect) -> Unit,
targetView: View,
) : BorderAnimationParams(borderWidthPx, boundsBuilder, targetView) {
override val alignmentAdjustmentInset = 0
diff --git a/quickstep/src/com/android/quickstep/util/DesktopTask.java b/quickstep/src/com/android/quickstep/util/DesktopTask.java
index 07f2d68..a727aa2 100644
--- a/quickstep/src/com/android/quickstep/util/DesktopTask.java
+++ b/quickstep/src/com/android/quickstep/util/DesktopTask.java
@@ -18,10 +18,11 @@
import androidx.annotation.NonNull;
-import com.android.quickstep.views.TaskView;
+import com.android.quickstep.views.TaskViewType;
import com.android.systemui.shared.recents.model.Task;
-import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
/**
* A {@link Task} container that can contain N number of tasks that are part of the desktop in
@@ -30,10 +31,10 @@
public class DesktopTask extends GroupTask {
@NonNull
- public final ArrayList<Task> tasks;
+ public final List<Task> tasks;
- public DesktopTask(@NonNull ArrayList<Task> tasks) {
- super(tasks.get(0), null, null, TaskView.Type.DESKTOP);
+ public DesktopTask(@NonNull List<Task> tasks) {
+ super(tasks.get(0), null, null, TaskViewType.DESKTOP);
this.tasks = tasks;
}
@@ -53,6 +54,12 @@
}
@Override
+ @NonNull
+ public List<Task> getTasks() {
+ return tasks;
+ }
+
+ @Override
public DesktopTask copy() {
return new DesktopTask(tasks);
}
@@ -62,4 +69,16 @@
return "type=" + taskViewType + " tasks=" + tasks;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof DesktopTask that)) return false;
+ if (!super.equals(o)) return false;
+ return Objects.equals(tasks, that.tasks);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), tasks);
+ }
}
diff --git a/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt b/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
index 544c64d..2dd727e 100644
--- a/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
+++ b/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
@@ -26,19 +26,21 @@
import androidx.annotation.WorkerThread
import com.android.launcher3.BuildConfig
import com.android.launcher3.util.Executors
+import java.util.concurrent.CopyOnWriteArrayList
/** Utility class to manage a set of device configurations */
class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) {
var config: ConfigType
private set
+
private val allKeys: Set<String>
private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) }
private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ ->
recreateConfig()
}
- private val changeListeners = mutableListOf<Runnable>()
+ private val changeListeners = CopyOnWriteArrayList<Runnable>()
init {
// Initialize the default config once.
@@ -48,12 +50,14 @@
PropReader(
object : PropProvider {
override fun <T : Any> get(key: String, fallback: T): T {
- if (fallback is Int)
+ if (fallback is Int) {
+ allKeys.add(key)
return DeviceConfig.getInt(NAMESPACE_LAUNCHER, key, fallback) as T
- else if (fallback is Boolean)
+ } else if (fallback is Boolean) {
+ allKeys.add(key)
return DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, fallback)
as T
- else return fallback
+ } else return fallback
}
}
)
diff --git a/quickstep/src/com/android/quickstep/util/GroupTask.java b/quickstep/src/com/android/quickstep/util/GroupTask.java
index 7dd6afc..fba08a9 100644
--- a/quickstep/src/com/android/quickstep/util/GroupTask.java
+++ b/quickstep/src/com/android/quickstep/util/GroupTask.java
@@ -20,9 +20,14 @@
import androidx.annotation.Nullable;
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
-import com.android.quickstep.views.TaskView;
+import com.android.quickstep.views.TaskViewType;
import com.android.systemui.shared.recents.model.Task;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
/**
* A {@link Task} container that can contain one or two tasks, depending on if the two tasks
* are represented as an app-pair in the recents task list.
@@ -34,19 +39,18 @@
public final Task task2;
@Nullable
public final SplitBounds mSplitBounds;
- @TaskView.Type
- public final int taskViewType;
+ public final TaskViewType taskViewType;
public GroupTask(@NonNull Task task) {
this(task, null, null);
}
public GroupTask(@NonNull Task t1, @Nullable Task t2, @Nullable SplitBounds splitBounds) {
- this(t1, t2, splitBounds, t2 != null ? TaskView.Type.GROUPED : TaskView.Type.SINGLE);
+ this(t1, t2, splitBounds, t2 != null ? TaskViewType.GROUPED : TaskViewType.SINGLE);
}
protected GroupTask(@NonNull Task t1, @Nullable Task t2, @Nullable SplitBounds splitBounds,
- @TaskView.Type int taskViewType) {
+ TaskViewType taskViewType) {
task1 = t1;
task2 = t2;
mSplitBounds = splitBounds;
@@ -62,6 +66,17 @@
}
/**
+ * Returns a List of all the Tasks in this GroupTask
+ */
+ public List<Task> getTasks() {
+ if (task2 == null) {
+ return Collections.singletonList(task1);
+ } else {
+ return Arrays.asList(task1, task2);
+ }
+ }
+
+ /**
* Create a copy of this instance
*/
public GroupTask copy() {
@@ -76,4 +91,17 @@
return "type=" + taskViewType + " task1=" + task1 + " task2=" + task2;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof GroupTask that)) return false;
+ return taskViewType == that.taskViewType && Objects.equals(task1,
+ that.task1) && Objects.equals(task2, that.task2)
+ && Objects.equals(mSplitBounds, that.mSplitBounds);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(task1, task2, mSplitBounds, taskViewType);
+ }
}
diff --git a/quickstep/src/com/android/quickstep/util/InputConsumerProxy.java b/quickstep/src/com/android/quickstep/util/InputConsumerProxy.java
index cb44a1a..fcf9ab1 100644
--- a/quickstep/src/com/android/quickstep/util/InputConsumerProxy.java
+++ b/quickstep/src/com/android/quickstep/util/InputConsumerProxy.java
@@ -108,19 +108,28 @@
return false;
}
+ final SimpleOrientationTouchTransformer touchTransformer =
+ SimpleOrientationTouchTransformer.INSTANCE.get(mContext);
+ final int viewRotation = mRotationSupplier.get();
+ final boolean needTransform = viewRotation != ev.getSurfaceRotation();
if (action == ACTION_DOWN) {
mTouchInProgress = true;
+ if (needTransform) {
+ touchTransformer.updateTouchingOrientation(viewRotation);
+ }
initInputConsumerIfNeeded(/* isFromTouchDown= */ true);
} else if (action == ACTION_CANCEL || action == ACTION_UP) {
// Finish any pending actions
mTouchInProgress = false;
+ touchTransformer.clearTouchingOrientation();
if (mDestroyPending) {
destroy();
}
}
if (mInputConsumer != null) {
- SimpleOrientationTouchTransformer.INSTANCE.get(mContext).transform(ev,
- mRotationSupplier.get());
+ if (needTransform) {
+ touchTransformer.transform(ev, viewRotation);
+ }
mInputConsumer.onMotionEvent(ev);
}
diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
index 4474f33..26668c8 100644
--- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
+++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
@@ -39,6 +39,7 @@
import com.android.quickstep.util.unfold.PreemptiveUnfoldTransitionProgressProvider;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
+import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.updates.RotationChangeProvider;
import com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProvider;
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
@@ -76,7 +77,7 @@
QuickstepLauncher launcher,
WindowManager windowManager,
UnfoldTransitionProgressProvider unfoldTransitionProgressProvider,
- RotationChangeProvider rotationChangeProvider) {
+ @UnfoldMain RotationChangeProvider rotationChangeProvider) {
mLauncher = launcher;
if (FeatureFlags.PREEMPTIVE_UNFOLD_ANIMATION_START.get()) {
diff --git a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
index b8bc828..15081da 100644
--- a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
+++ b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
@@ -66,6 +66,7 @@
private Float mPreviousVelocity = null;
private OnMotionPauseListener mOnMotionPauseListener;
+ private boolean mIsTrackpadGesture;
private boolean mIsPaused;
// Bias more for the first pause to make it feel extra responsive.
private boolean mHasEverBeenPaused;
@@ -115,6 +116,10 @@
mOnMotionPauseListener = listener;
}
+ public void setIsTrackpadGesture(boolean isTrackpadGesture) {
+ mIsTrackpadGesture = isTrackpadGesture;
+ }
+
/**
* @param disallowPause If true, we will not detect any pauses until this is set to false again.
*/
@@ -179,7 +184,8 @@
// We want to be more aggressive about detecting the first pause to ensure it
// feels as responsive as possible; getting two very slow speeds back to back
// takes too long, so also check for a rapid deceleration.
- boolean isRapidDeceleration = speed < previousSpeed * RAPID_DECELERATION_FACTOR;
+ boolean isRapidDeceleration =
+ speed < previousSpeed * getRapidDecelerationFactor();
isPaused = isRapidDeceleration && speed < mSpeedSomewhatFast;
isPausedReason = new ActiveGestureLog.CompoundString(
"Didn't have back to back slow speeds, checking for rapid ")
@@ -253,6 +259,7 @@
mVelocityProvider.clear();
mPreviousVelocity = null;
setOnMotionPauseListener(null);
+ mIsTrackpadGesture = false;
mIsPaused = mHasEverBeenPaused = false;
mSlowStartTime = 0;
mForcePauseTimeout.cancelAlarm();
@@ -262,6 +269,12 @@
return mIsPaused;
}
+ private float getRapidDecelerationFactor() {
+ return mIsTrackpadGesture ? Float.parseFloat(
+ Utilities.getSystemProperty("trackpad_in_app_swipe_up_deceleration_factor",
+ String.valueOf(RAPID_DECELERATION_FACTOR))) : RAPID_DECELERATION_FACTOR;
+ }
+
public interface OnMotionPauseListener {
/** Called only the first time motion pause is detected. */
void onMotionPauseDetected();
diff --git a/quickstep/src/com/android/quickstep/util/NavBarPosition.java b/quickstep/src/com/android/quickstep/util/NavBarPosition.java
deleted file mode 100644
index 9418512..0000000
--- a/quickstep/src/com/android/quickstep/util/NavBarPosition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.util;
-
-import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
-
-import android.view.Surface;
-
-import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.NavigationMode;
-
-/**
- * Utility class to check nav bar position.
- */
-public class NavBarPosition {
-
- private final boolean mIsTablet;
- private final NavigationMode mMode;
- private final int mDisplayRotation;
-
- public NavBarPosition(NavigationMode mode, Info info) {
- mIsTablet = info.isTablet(info.realBounds);
- mMode = mode;
- mDisplayRotation = info.rotation;
- }
-
- public boolean isRightEdge() {
- return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_90 && !mIsTablet;
- }
-
- public boolean isLeftEdge() {
- return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_270 && !mIsTablet;
- }
-
- public float getRotation() {
- return isLeftEdge() ? 90 : (isRightEdge() ? -90 : 0);
- }
-}
diff --git a/quickstep/src/com/android/quickstep/util/NavBarPosition.kt b/quickstep/src/com/android/quickstep/util/NavBarPosition.kt
new file mode 100644
index 0000000..43cf540
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/NavBarPosition.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util
+
+import android.view.Surface
+import com.android.launcher3.util.DisplayController.Info
+import com.android.launcher3.util.NavigationMode
+import com.android.launcher3.util.NavigationMode.NO_BUTTON
+
+/** Utility class to check nav bar position. */
+data class NavBarPosition(
+ val isTablet: Boolean,
+ val displayRotation: Int,
+ val mode: NavigationMode
+) {
+ constructor(
+ mode: NavigationMode,
+ info: Info
+ ) : this(info.isTablet(info.realBounds), info.rotation, mode)
+
+ val isRightEdge: Boolean
+ get() = mode != NO_BUTTON && displayRotation == Surface.ROTATION_90 && !isTablet
+ val isLeftEdge: Boolean
+ get() = mode != NO_BUTTON && displayRotation == Surface.ROTATION_270 && !isTablet
+
+ val rotation: Float
+ get() = if (isLeftEdge) 90f else if (isRightEdge) -90f else 0f
+}
diff --git a/quickstep/src/com/android/quickstep/util/OverviewToHomeAnim.java b/quickstep/src/com/android/quickstep/util/OverviewToHomeAnim.java
index 132d1c1..492c801 100644
--- a/quickstep/src/com/android/quickstep/util/OverviewToHomeAnim.java
+++ b/quickstep/src/com/android/quickstep/util/OverviewToHomeAnim.java
@@ -62,7 +62,7 @@
* {@link WorkspaceRevealAnim}.
*/
public void animateWithVelocity(float velocity) {
- StateManager<LauncherState> stateManager = mLauncher.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = mLauncher.getStateManager();
LauncherState startState = stateManager.getState();
if (startState != OVERVIEW) {
Log.e(TAG, "animateFromOverviewToHome: unexpected start state " + startState);
diff --git a/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java
index 3d9e09e..cbe0f19 100644
--- a/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java
+++ b/quickstep/src/com/android/quickstep/util/PhoneSplitToConfirmTimings.java
@@ -27,6 +27,8 @@
public int getPlaceholderIconFadeInEnd() { return 133; }
public int getStagedRectSlideStart() { return 0; }
public int getStagedRectSlideEnd() { return 333; }
+ public int getBackingScrimFadeInStart() { return 0; }
+ public int getBackingScrimFadeInEnd() { return 266; }
public int getDuration() { return PHONE_CONFIRM_DURATION; }
}
diff --git a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
index 2a27dea..70ef47c 100644
--- a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
+++ b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
@@ -27,6 +27,7 @@
import static com.android.launcher3.util.OnboardingPrefs.HOME_BOUNCE_SEEN;
import static com.android.launcher3.util.OnboardingPrefs.HOTSEAT_DISCOVERY_TIP_COUNT;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
@@ -48,7 +49,7 @@
* Sets up the initial onboarding behavior for the launcher
*/
public static void setup(QuickstepLauncher launcher) {
- StateManager<LauncherState> stateManager = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = launcher.getStateManager();
if (!HOME_BOUNCE_SEEN.get(launcher)) {
stateManager.addStateListener(new StateListener<LauncherState>() {
@Override
@@ -105,7 +106,8 @@
return;
}
mShouldIncreaseCount = toState == HINT_STATE
- && launcher.getWorkspace().getNextPage() == Workspace.DEFAULT_PAGE;
+ && launcher.getWorkspace().getNextPage() == Workspace.DEFAULT_PAGE
+ && launcher.isCanShowAllAppsEducationView();
}
@Override
diff --git a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
index 0b05c2e..63fe017 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
@@ -16,6 +16,7 @@
package com.android.quickstep.util;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
+import static com.android.quickstep.views.RecentsView.RUNNING_TASK_ATTACH_ALPHA;
import android.animation.Animator;
import android.animation.ObjectAnimator;
@@ -33,8 +34,10 @@
public static final int INDEX_RECENTS_FADE_ANIM = AtomicAnimationFactory.NEXT_INDEX + 0;
public static final int INDEX_RECENTS_TRANSLATE_X_ANIM = AtomicAnimationFactory.NEXT_INDEX + 1;
+ public static final int INDEX_RECENTS_ATTACHED_ALPHA_ANIM =
+ AtomicAnimationFactory.NEXT_INDEX + 2;
- private static final int MY_ANIM_COUNT = 2;
+ private static final int MY_ANIM_COUNT = 3;
protected final CONTAINER mContainer;
@@ -50,6 +53,7 @@
ObjectAnimator alpha = ObjectAnimator.ofFloat(mContainer.getOverviewPanel(),
RecentsView.CONTENT_ALPHA, values);
return alpha;
+ case INDEX_RECENTS_ATTACHED_ALPHA_ANIM:
case INDEX_RECENTS_TRANSLATE_X_ANIM: {
RecentsView rv = mContainer.getOverviewPanel();
return new SpringAnimationBuilder(mContainer)
@@ -57,7 +61,8 @@
.setDampingRatio(0.8f)
.setStiffness(250)
.setValues(values)
- .build(rv, ADJACENT_PAGE_HORIZONTAL_OFFSET);
+ .build(rv, index == INDEX_RECENTS_ATTACHED_ALPHA_ANIM
+ ? RUNNING_TASK_ATTACH_ALPHA : ADJACENT_PAGE_HORIZONTAL_OFFSET);
}
default:
return super.createStateElementAnimation(index, values);
diff --git a/quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt b/quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt
new file mode 100644
index 0000000..0a01d8b
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.util
+
+import com.android.launcher3.Flags.enableLargeDesktopWindowingTile
+import com.android.quickstep.views.DesktopTaskView
+import com.android.quickstep.views.TaskView
+import com.android.quickstep.views.TaskViewType
+
+/**
+ * Helper class for [com.android.quickstep.views.RecentsView]. This util class contains refactored
+ * and extracted functions from RecentsView to facilitate the implementation of unit tests.
+ */
+class RecentsViewUtils {
+
+ /**
+ * Sort task groups to move desktop tasks to the end of the list.
+ *
+ * @param tasks List of group tasks to be sorted.
+ * @return Sorted list of GroupTasks to be used in the RecentsView.
+ */
+ fun sortDesktopTasksToFront(tasks: List<GroupTask>): List<GroupTask> {
+ val (desktopTasks, otherTasks) = tasks.partition { it.taskViewType == TaskViewType.DESKTOP }
+ return otherTasks + desktopTasks
+ }
+
+ fun getFocusedTaskIndex(taskGroups: List<GroupTask>): Int {
+ // The focused task index is placed after the desktop tasks views.
+ return if (enableLargeDesktopWindowingTile()) {
+ taskGroups.count { it.taskViewType == TaskViewType.DESKTOP }
+ } else {
+ 0
+ }
+ }
+
+ /**
+ * Counts [numChildren] that are [DesktopTaskView] instances.
+ *
+ * @param numChildren Quantity of children to transverse
+ * @param getTaskViewAt Function that provides a TaskView given an index
+ */
+ fun getDesktopTaskViewCount(numChildren: Int, getTaskViewAt: (Int) -> TaskView?): Int =
+ (0 until numChildren).count { getTaskViewAt(it) is DesktopTaskView }
+
+ /**
+ * Returns the first TaskView that should be displayed as a large tile.
+ *
+ * @param numChildren Quantity of children to transverse
+ * @param getTaskViewAt Function that provides a TaskView given an index
+ */
+ fun getFirstLargeTaskView(numChildren: Int, getTaskViewAt: (Int) -> TaskView?): TaskView? {
+ return (0 until numChildren).firstNotNullOfOrNull { index ->
+ val taskView = getTaskViewAt(index)
+ if (taskView?.isLargeTile == true) taskView else null
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
index 5505bb3..00b4011 100644
--- a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
+++ b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
@@ -157,6 +157,10 @@
mCurrentY = getTrackedYFromRect(mStartRect);
}
+ public RectF getTargetRect() {
+ return mTargetRect;
+ }
+
private float getTrackedYFromRect(RectF rect) {
switch (mTracking) {
case TRACKING_TOP:
@@ -565,7 +569,11 @@
final float bottomThreshold = deviceProfile.heightPx - padding.bottom;
if (targetRect.bottom > bottomThreshold) {
- tracking = TRACKING_BOTTOM;
+ if (enableScalingRevealHomeAnimation()) {
+ tracking = TRACKING_CENTER;
+ } else {
+ tracking = TRACKING_BOTTOM;
+ }
} else if (targetRect.top < topThreshold) {
tracking = TRACKING_TOP;
} else {
diff --git a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt
index 1bf77f1..f547a7fb 100644
--- a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt
+++ b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt
@@ -16,12 +16,14 @@
package com.android.quickstep.util
+import android.animation.AnimatorSet
import android.graphics.Matrix
+import android.graphics.Path
import android.graphics.RectF
import android.view.View
+import android.view.animation.PathInterpolator
import androidx.core.graphics.transform
import com.android.app.animation.Interpolators
-import com.android.app.animation.Interpolators.EMPHASIZED
import com.android.app.animation.Interpolators.LINEAR
import com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY
import com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_WORKSPACE_STATE
@@ -53,6 +55,19 @@
private const val MIN_ALPHA = 0f
private const val MAX_SIZE = 1f
private const val MIN_SIZE = 0.85f
+
+ /**
+ * Custom interpolator for both the home and wallpaper scaling. Necessary because EMPHASIZED
+ * is too aggressive, but EMPHASIZED_DECELERATE is too soft.
+ */
+ private val SCALE_INTERPOLATOR =
+ PathInterpolator(
+ Path().apply {
+ moveTo(0f, 0f)
+ cubicTo(0.045f, 0.0356f, 0.0975f, 0.2055f, 0.15f, 0.3952f)
+ cubicTo(0.235f, 0.6855f, 0.235f, 1f, 1f, 1f)
+ }
+ )
}
private val animation = PendingAnimation(SCALE_DURATION_MS)
@@ -78,20 +93,20 @@
val hotseat = launcher.hotseat
// Scale the Workspace and Hotseat around the same pivot.
+ workspace.setPivotToScaleWithSelf(hotseat)
animation.addFloat(
workspace,
WORKSPACE_SCALE_PROPERTY_FACTORY[SCALE_INDEX_WORKSPACE_STATE],
MIN_SIZE,
MAX_SIZE,
- EMPHASIZED,
+ SCALE_INTERPOLATOR,
)
- workspace.setPivotToScaleWithSelf(hotseat)
animation.addFloat(
hotseat,
HOTSEAT_SCALE_PROPERTY_FACTORY[SCALE_INDEX_WORKSPACE_STATE],
MIN_SIZE,
MAX_SIZE,
- EMPHASIZED,
+ SCALE_INTERPOLATOR,
)
// Fade in quickly at the beginning of the animation, so the content doesn't look like it's
@@ -114,11 +129,11 @@
// Match the Wallpaper animation to the rest of the content.
val depthController = (launcher as? QuickstepLauncher)?.depthController
- transitionConfig.setInterpolator(StateAnimationConfig.ANIM_DEPTH, EMPHASIZED)
+ transitionConfig.setInterpolator(StateAnimationConfig.ANIM_DEPTH, SCALE_INTERPOLATOR)
depthController?.setStateWithAnimation(LauncherState.NORMAL, transitionConfig, animation)
// Make sure that the contrast scrim animates correctly if needed.
- transitionConfig.setInterpolator(StateAnimationConfig.ANIM_SCRIM_FADE, EMPHASIZED)
+ transitionConfig.setInterpolator(StateAnimationConfig.ANIM_SCRIM_FADE, SCALE_INTERPOLATOR)
launcher.workspace.stateTransitionAnimation.setScrim(
animation,
LauncherState.NORMAL,
@@ -173,7 +188,11 @@
)
}
+ fun getAnimators(): AnimatorSet {
+ return animation.buildAnim()
+ }
+
fun start() {
- animation.buildAnim().start()
+ getAnimators().start()
}
}
diff --git a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
index dbeedd3..ece9583 100644
--- a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
+++ b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
@@ -36,6 +36,8 @@
private val pageSpacing: Int,
private val cornerRadius: Float,
private val interpolator: TimeInterpolator,
+ private val onStartCallback: Runnable,
+ private val onFinishCallback: Runnable,
) : RemoteTransitionStub() {
private val animationDurationMs = 500L
@@ -68,6 +70,7 @@
startT.setCrop(leash, chg.endAbsBounds).setCornerRadius(leash, cornerRadius)
}
}
+ onStartCallback.run()
startT.apply()
anim.addUpdateListener {
@@ -97,6 +100,7 @@
val t = Transaction()
try {
finishCB.onTransitionFinished(null, t)
+ onFinishCallback.run()
} catch (e: RemoteException) {
// Ignore
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
index ee2c2e1..fa5a67a 100644
--- a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
+++ b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
@@ -27,8 +27,10 @@
import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW
import android.content.Context
import android.graphics.Bitmap
+import android.graphics.Color
import android.graphics.Rect
import android.graphics.RectF
+import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.view.RemoteAnimationTarget
import android.view.SurfaceControl
@@ -43,6 +45,7 @@
import com.android.app.animation.Interpolators
import com.android.launcher3.DeviceProfile
import com.android.launcher3.Flags.enableOverviewIconMenu
+import com.android.launcher3.Flags.enableRefactorTaskThumbnail
import com.android.launcher3.InsettableFrameLayout
import com.android.launcher3.QuickstepTransitionManager
import com.android.launcher3.R
@@ -67,9 +70,9 @@
import com.android.quickstep.views.RecentsView
import com.android.quickstep.views.RecentsViewContainer
import com.android.quickstep.views.SplitInstructionsView
+import com.android.quickstep.views.TaskContainer
import com.android.quickstep.views.TaskThumbnailViewDeprecated
import com.android.quickstep.views.TaskView
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer
import com.android.quickstep.views.TaskViewIcon
import com.android.wm.shell.shared.TransitionUtil
import java.util.Optional
@@ -88,7 +91,8 @@
val iconDrawable: Drawable,
val fadeWithThumbnail: Boolean,
val isStagedTask: Boolean,
- val iconView: View?
+ val iconView: View?,
+ val contentDescription: CharSequence?
)
}
@@ -109,21 +113,23 @@
splitSelectSource.drawable,
fadeWithThumbnail = false,
isStagedTask = true,
- iconView = null
+ iconView = null,
+ splitSelectSource.itemInfo.contentDescription
)
} else if (splitSelectStateController.isDismissingFromSplitPair) {
// Initiating split from overview, but on a split pair
val taskView = taskViewSupplier.get()
- for (container: TaskIdAttributeContainer in taskView.taskIdAttributeContainers) {
+ for (container: TaskContainer in taskView.taskContainers) {
if (container.task.getKey().getId() == splitSelectStateController.initialTaskId) {
val drawable = getDrawable(container.iconView, splitSelectSource)
return SplitAnimInitProps(
- container.thumbnailView,
- container.thumbnailView.thumbnail,
- drawable!!,
+ container.snapshotView,
+ container.splitAnimationThumbnail,
+ drawable,
fadeWithThumbnail = true,
isStagedTask = true,
- iconView = container.iconView.asView()
+ iconView = container.iconView.asView(),
+ container.task.titleDescription
)
}
}
@@ -134,56 +140,77 @@
} else {
// Initiating split from overview on fullscreen task TaskView
val taskView = taskViewSupplier.get()
- val drawable = getDrawable(taskView.iconView, splitSelectSource)
- return SplitAnimInitProps(
- taskView.thumbnail,
- taskView.thumbnail.thumbnail,
- drawable!!,
- fadeWithThumbnail = true,
- isStagedTask = true,
- taskView.iconView.asView()
- )
+ taskView.taskContainers.first().let {
+ val drawable = getDrawable(it.iconView, splitSelectSource)
+ return SplitAnimInitProps(
+ it.snapshotView,
+ it.splitAnimationThumbnail,
+ drawable,
+ fadeWithThumbnail = true,
+ isStagedTask = true,
+ iconView = it.iconView.asView(),
+ it.task.titleDescription
+ )
+ }
}
}
/**
* Returns the drawable that's provided in iconView, however if that is null it falls back to
* the drawable that's in splitSelectSource. TaskView's icon drawable can be null if the
- * TaskView is scrolled far enough off screen
+ * TaskView is scrolled far enough off screen.
*
- * @return [Drawable]
+ * @return the [Drawable] icon, or a translucent drawable if none was found
*/
- fun getDrawable(iconView: TaskViewIcon, splitSelectSource: SplitSelectSource?): Drawable? {
- if (iconView.drawable == null && splitSelectSource != null) {
- return splitSelectSource.drawable
- }
- return iconView.drawable
+ fun getDrawable(iconView: TaskViewIcon, splitSelectSource: SplitSelectSource?): Drawable {
+ val drawable =
+ if (iconView.drawable == null && splitSelectSource != null) splitSelectSource.drawable
+ else iconView.drawable
+ return drawable ?: ColorDrawable(Color.TRANSPARENT)
}
/**
* When selecting first app from split pair, second app's thumbnail remains. This animates the
* second thumbnail by expanding it to take up the full taskViewWidth/Height and overlaying it
- * with [TaskThumbnailViewDeprecated]'s splashView. Adds animations to the provided builder.
- * Note: The app that **was not** selected as the first split app should be the container that's
- * passed through.
+ * with [TaskContainer]'s splashView. Adds animations to the provided builder. Note: The app
+ * that **was not** selected as the first split app should be the container that's passed
+ * through.
*
* @param builder Adds animation to this
- * @param taskIdAttributeContainer container of the app that **was not** selected
+ * @param taskContainer container of the app that **was not** selected
* @param isPrimaryTaskSplitting if true, task that was split would be top/left in the pair
- * (opposite of that representing [taskIdAttributeContainer])
+ * (opposite of that representing [taskContainer])
*/
fun addInitialSplitFromPair(
- taskIdAttributeContainer: TaskIdAttributeContainer,
+ taskContainer: TaskContainer,
builder: PendingAnimation,
deviceProfile: DeviceProfile,
taskViewWidth: Int,
taskViewHeight: Int,
isPrimaryTaskSplitting: Boolean
) {
- val thumbnail = taskIdAttributeContainer.thumbnailView
- val iconView: View = taskIdAttributeContainer.iconView.asView()
- builder.add(ObjectAnimator.ofFloat(thumbnail, TaskThumbnailViewDeprecated.SPLASH_ALPHA, 1f))
- thumbnail.setShowSplashForSplitSelection(true)
+ val snapshot = taskContainer.snapshotView
+ val iconView: View = taskContainer.iconView.asView()
+ if (!enableRefactorTaskThumbnail()) {
+ val thumbnailViewDeprecated = taskContainer.thumbnailViewDeprecated
+ builder.add(
+ ObjectAnimator.ofFloat(
+ thumbnailViewDeprecated,
+ TaskThumbnailViewDeprecated.SPLASH_ALPHA,
+ 1f
+ )
+ )
+ thumbnailViewDeprecated.setShowSplashForSplitSelection(true)
+ } else {
+ builder.add(
+ ValueAnimator.ofFloat(0f, 1f).apply {
+ addUpdateListener {
+ taskContainer.taskContainerData.thumbnailSplashProgress.value =
+ it.animatedFraction
+ }
+ }
+ )
+ }
// With the new `IconAppChipView`, we always want to keep the chip pinned to the
// top left of the task / thumbnail.
if (enableOverviewIconMenu()) {
@@ -200,14 +227,10 @@
}
if (deviceProfile.isLeftRightSplit) {
// Center view first so scaling happens uniformly, alternatively we can move pivotX to 0
- val centerThumbnailTranslationX: Float = (taskViewWidth - thumbnail.width) / 2f
- val finalScaleX: Float = taskViewWidth.toFloat() / thumbnail.width
+ val centerThumbnailTranslationX: Float = (taskViewWidth - snapshot.width) / 2f
+ val finalScaleX: Float = taskViewWidth.toFloat() / snapshot.width
builder.add(
- ObjectAnimator.ofFloat(
- thumbnail,
- TaskThumbnailViewDeprecated.SPLIT_SELECT_TRANSLATE_X,
- centerThumbnailTranslationX
- )
+ ObjectAnimator.ofFloat(snapshot, View.TRANSLATION_X, centerThumbnailTranslationX)
)
if (!enableOverviewIconMenu()) {
// icons are anchored from Gravity.END, so need to use negative translation
@@ -216,21 +239,15 @@
ObjectAnimator.ofFloat(iconView, View.TRANSLATION_X, -centerIconTranslationX)
)
}
- builder.add(ObjectAnimator.ofFloat(thumbnail, View.SCALE_X, finalScaleX))
+ builder.add(ObjectAnimator.ofFloat(snapshot, View.SCALE_X, finalScaleX))
// Reset other dimensions
// TODO(b/271468547), can't set Y translate to 0, need to account for top space
- thumbnail.scaleY = 1f
+ snapshot.scaleY = 1f
val translateYResetVal: Float =
if (!isPrimaryTaskSplitting) 0f
else deviceProfile.overviewTaskThumbnailTopMarginPx.toFloat()
- builder.add(
- ObjectAnimator.ofFloat(
- thumbnail,
- TaskThumbnailViewDeprecated.SPLIT_SELECT_TRANSLATE_Y,
- translateYResetVal
- )
- )
+ builder.add(ObjectAnimator.ofFloat(snapshot, View.TRANSLATION_Y, translateYResetVal))
} else {
val thumbnailSize = taskViewHeight - deviceProfile.overviewTaskThumbnailTopMarginPx
// Center view first so scaling happens uniformly, alternatively we can move pivotY to 0
@@ -245,98 +262,69 @@
// thumbnail needs to take that into account. We should migrate to only using
// translations otherwise this asymmetry causes problems..
if (isPrimaryTaskSplitting) {
- centerThumbnailTranslationY = (thumbnailSize - thumbnail.height) / 2f
+ centerThumbnailTranslationY = (thumbnailSize - snapshot.height) / 2f
centerThumbnailTranslationY +=
deviceProfile.overviewTaskThumbnailTopMarginPx.toFloat()
} else {
- centerThumbnailTranslationY = (thumbnailSize - thumbnail.height) / 2f
+ centerThumbnailTranslationY = (thumbnailSize - snapshot.height) / 2f
}
- val finalScaleY: Float = thumbnailSize.toFloat() / thumbnail.height
+ val finalScaleY: Float = thumbnailSize.toFloat() / snapshot.height
builder.add(
- ObjectAnimator.ofFloat(
- thumbnail,
- TaskThumbnailViewDeprecated.SPLIT_SELECT_TRANSLATE_Y,
- centerThumbnailTranslationY
- )
+ ObjectAnimator.ofFloat(snapshot, View.TRANSLATION_Y, centerThumbnailTranslationY)
)
if (!enableOverviewIconMenu()) {
// icons are anchored from Gravity.END, so need to use negative translation
builder.add(ObjectAnimator.ofFloat(iconView, View.TRANSLATION_X, 0f))
}
- builder.add(ObjectAnimator.ofFloat(thumbnail, View.SCALE_Y, finalScaleY))
+ builder.add(ObjectAnimator.ofFloat(snapshot, View.SCALE_Y, finalScaleY))
// Reset other dimensions
- thumbnail.scaleX = 1f
- builder.add(
- ObjectAnimator.ofFloat(
- thumbnail,
- TaskThumbnailViewDeprecated.SPLIT_SELECT_TRANSLATE_X,
- 0f
- )
- )
+ snapshot.scaleX = 1f
+ builder.add(ObjectAnimator.ofFloat(snapshot, View.TRANSLATION_X, 0f))
}
}
/**
- * Creates and returns a view to fade in at .4 animation progress and adds it to the provided
- * [pendingAnimation]. Assumes that animation will be the final split placeholder launch anim.
- *
- * [secondPlaceholderEndingBounds] refers to the second placeholder view that gets added on
- * screen, not the logical second app. For landscape it's the left app and for portrait the top
- * one.
+ * Creates and returns a fullscreen scrim to fade in behind the split confirm animation, and
+ * adds it to the provided [pendingAnimation].
*/
- fun addDividerPlaceholderViewToAnim(
+ fun addScrimBehindAnim(
pendingAnimation: PendingAnimation,
container: RecentsViewContainer,
- secondPlaceholderEndingBounds: Rect,
context: Context
): View {
- val mSplitDividerPlaceholderView = View(context)
+ val scrim = View(context)
val recentsView = container.getOverviewPanel<RecentsView<*, *>>()
- val dp: com.android.launcher3.DeviceProfile = container.getDeviceProfile()
+ val dp: DeviceProfile = container.getDeviceProfile()
// Add it before/under the most recently added first floating taskView
val firstAddedSplitViewIndex: Int =
container
.getDragLayer()
.indexOfChild(recentsView.splitSelectController.firstFloatingTaskView)
- container.getDragLayer().addView(mSplitDividerPlaceholderView, firstAddedSplitViewIndex)
- val lp = mSplitDividerPlaceholderView.layoutParams as InsettableFrameLayout.LayoutParams
+ container.getDragLayer().addView(scrim, firstAddedSplitViewIndex)
+ // Make the scrim fullscreen
+ val lp = scrim.layoutParams as InsettableFrameLayout.LayoutParams
lp.topMargin = 0
+ lp.height = dp.heightPx
+ lp.width = dp.widthPx
- if (dp.isLeftRightSplit) {
- lp.height = secondPlaceholderEndingBounds.height()
- lp.width =
- container
- .asContext()
- .resources
- .getDimensionPixelSize(R.dimen.split_divider_handle_region_height)
- mSplitDividerPlaceholderView.translationX =
- secondPlaceholderEndingBounds.right - lp.width / 2f
- mSplitDividerPlaceholderView.translationY = 0f
- } else {
- lp.height =
- container
- .asContext()
- .resources
- .getDimensionPixelSize(R.dimen.split_divider_handle_region_height)
- lp.width = secondPlaceholderEndingBounds.width()
- mSplitDividerPlaceholderView.translationY =
- secondPlaceholderEndingBounds.top - lp.height / 2f
- mSplitDividerPlaceholderView.translationX = 0f
- }
-
- mSplitDividerPlaceholderView.alpha = 0f
- mSplitDividerPlaceholderView.setBackgroundColor(
+ scrim.alpha = 0f
+ scrim.setBackgroundColor(
container.asContext().resources.getColor(R.color.taskbar_background_dark)
)
- val timings = AnimUtils.getDeviceSplitToConfirmTimings(dp.isTablet)
+ val timings = AnimUtils.getDeviceSplitToConfirmTimings(dp.isTablet) as SplitToConfirmTimings
pendingAnimation.setViewAlpha(
- mSplitDividerPlaceholderView,
+ scrim,
1f,
- Interpolators.clampToProgress(timings.stagedRectScaleXInterpolator, 0.4f, 1f)
+ Interpolators.clampToProgress(
+ timings.backingScrimFadeInterpolator,
+ timings.backingScrimFadeInStartOffset,
+ timings.backingScrimFadeInEndOffset
+ )
)
- return mSplitDividerPlaceholderView
+
+ return scrim
}
/** Does not play any animation if user is not currently in split selection state. */
@@ -508,11 +496,12 @@
apps: Array<RemoteAnimationTarget>?,
wallpapers: Array<RemoteAnimationTarget>?,
nonApps: Array<RemoteAnimationTarget>?,
- stateManager: StateManager<*>,
+ stateManager: StateManager<*, *>,
depthController: DepthController?,
info: TransitionInfo?,
t: Transaction?,
- finishCallback: Runnable
+ finishCallback: Runnable,
+ cornerRadius: Float
) {
if (info == null && t == null) {
// (Legacy animation) Tapping a split tile in Overview
@@ -559,10 +548,21 @@
val appPairLaunchingAppIndex = hasChangesForBothAppPairs(launchingIconView, info)
if (appPairLaunchingAppIndex == -1) {
// Launch split app pair animation
- composeIconSplitLaunchAnimator(launchingIconView, info, t, finishCallback)
+ composeIconSplitLaunchAnimator(
+ launchingIconView,
+ info,
+ t,
+ finishCallback,
+ cornerRadius
+ )
} else {
- composeFullscreenIconSplitLaunchAnimator(launchingIconView, info, t,
- finishCallback, appPairLaunchingAppIndex)
+ composeFullscreenIconSplitLaunchAnimator(
+ launchingIconView,
+ info,
+ t,
+ finishCallback,
+ appPairLaunchingAppIndex
+ )
}
} else {
// Fallback case: simple fade-in animation
@@ -571,7 +571,14 @@
"unexpected null"
}
- composeFadeInSplitLaunchAnimator(initialTaskId, secondTaskId, info, t, finishCallback)
+ composeFadeInSplitLaunchAnimator(
+ initialTaskId,
+ secondTaskId,
+ info,
+ t,
+ finishCallback,
+ cornerRadius
+ )
}
}
@@ -582,7 +589,7 @@
@VisibleForTesting
fun composeRecentsSplitLaunchAnimator(
launchingTaskView: GroupedTaskView,
- stateManager: StateManager<*>,
+ stateManager: StateManager<*, *>,
depthController: DepthController?,
info: TransitionInfo,
t: Transaction,
@@ -610,7 +617,7 @@
apps: Array<RemoteAnimationTarget>,
wallpapers: Array<RemoteAnimationTarget>,
nonApps: Array<RemoteAnimationTarget>,
- stateManager: StateManager<*>,
+ stateManager: StateManager<*, *>,
depthController: DepthController?,
finishCallback: Runnable
) {
@@ -629,18 +636,22 @@
/**
* @return -1 if [transitionInfo] contains both apps of the app pair to be animated, otherwise
- * the integer index corresponding to [launchingIconView]'s contents for the single app
- * to be animated
+ * the integer index corresponding to [launchingIconView]'s contents for the single app to be
+ * animated
*/
- fun hasChangesForBothAppPairs(launchingIconView: AppPairIcon,
- transitionInfo: TransitionInfo) : Int {
+ fun hasChangesForBothAppPairs(
+ launchingIconView: AppPairIcon,
+ transitionInfo: TransitionInfo
+ ): Int {
val intent1 = launchingIconView.info.getFirstApp().intent.component?.packageName
val intent2 = launchingIconView.info.getSecondApp().intent.component?.packageName
var launchFullscreenAppIndex = -1
for (change in transitionInfo.changes) {
val taskInfo: RunningTaskInfo = change.taskInfo ?: continue
- if (TransitionUtil.isOpeningType(change.mode) &&
- taskInfo.windowingMode == WINDOWING_MODE_FULLSCREEN) {
+ if (
+ TransitionUtil.isOpeningType(change.mode) &&
+ taskInfo.windowingMode == WINDOWING_MODE_FULLSCREEN
+ ) {
val baseIntent = taskInfo.baseIntent.component?.packageName
if (baseIntent == intent1) {
if (launchFullscreenAppIndex > -1) {
@@ -667,15 +678,15 @@
* To find the root shell leash that we want to fade in, we do the following: The Changes we
* receive in transitionInfo are structured like this
*
- * Root (grandparent)
+ * (0) Root (grandparent)
* |
- * |--> Split Root 1 (left/top side parent) (WINDOWING_MODE_MULTI_WINDOW)
+ * |--> (1) Split Root 1 (left/top side parent) (WINDOWING_MODE_MULTI_WINDOW)
* | |
- * | --> App 1 (left/top side child) (WINDOWING_MODE_MULTI_WINDOW)
+ * | --> (1a) App 1 (left/top side child) (WINDOWING_MODE_MULTI_WINDOW)
* |--> Divider
- * |--> Split Root 2 (right/bottom side parent) (WINDOWING_MODE_MULTI_WINDOW)
+ * |--> (2) Split Root 2 (right/bottom side parent) (WINDOWING_MODE_MULTI_WINDOW)
* |
- * --> App 2 (right/bottom side child) (WINDOWING_MODE_MULTI_WINDOW)
+ * --> (2a) App 2 (right/bottom side child) (WINDOWING_MODE_MULTI_WINDOW)
*
* We want to animate the Root (grandparent) so that it affects both apps and the divider. To do
* this, we find one of the nodes with WINDOWING_MODE_MULTI_WINDOW (one of the left-side ones,
@@ -690,13 +701,18 @@
launchingIconView: AppPairIcon,
transitionInfo: TransitionInfo,
t: Transaction,
- finishCallback: Runnable
+ finishCallback: Runnable,
+ windowRadius: Float
) {
// If launching an app pair from Taskbar inside of an app context (no access to Launcher),
// use the scale-up animation
if (launchingIconView.context is TaskbarActivityContext) {
- composeScaleUpLaunchAnimation(transitionInfo, t, finishCallback,
- WINDOWING_MODE_MULTI_WINDOW)
+ composeScaleUpLaunchAnimation(
+ transitionInfo,
+ t,
+ finishCallback,
+ WINDOWING_MODE_MULTI_WINDOW
+ )
return
}
@@ -706,48 +722,26 @@
// Create an AnimatorSet that will run both shell and launcher transitions together
val launchAnimation = AnimatorSet()
- var rootCandidate: Change? = null
- for (change in transitionInfo.changes) {
- val taskInfo: RunningTaskInfo = change.taskInfo ?: continue
+ val splitRoots: Pair<Change, List<Change>>? =
+ SplitScreenUtils.extractTopParentAndChildren(transitionInfo)
+ check(splitRoots != null) { "Could not find split roots" }
- // TODO (b/316490565): Replace this logic when SplitBounds is available to
- // startAnimation() and we can know the precise taskIds of launching tasks.
- // Find a change that has WINDOWING_MODE_MULTI_WINDOW.
- if (
- taskInfo.windowingMode == WINDOWING_MODE_MULTI_WINDOW &&
- (change.mode == TRANSIT_OPEN || change.mode == TRANSIT_TO_FRONT)
- ) {
- // Check if it is a left/top app.
- val isLeftTopApp =
- (dp.isLeftRightSplit && change.endAbsBounds.left == 0) ||
- (!dp.isLeftRightSplit && change.endAbsBounds.top == 0)
- if (isLeftTopApp) {
- // Found one!
- rootCandidate = change
- break
- }
- }
- }
-
- // If we could not find a proper root candidate, something went wrong.
- check(rootCandidate != null) { "Could not find a split root candidate" }
+ // Will point to change (0) in diagram above
+ val mainRootCandidate = splitRoots.first
+ // Will contain changes (1) and (2) in diagram above
+ val leafRoots: List<Change> = splitRoots.second
// Find the place where our left/top app window meets the divider (used for the
// launcher side animation)
+ val leftTopApp =
+ leafRoots.single { change ->
+ (dp.isLeftRightSplit && change.endAbsBounds.left == 0) ||
+ (!dp.isLeftRightSplit && change.endAbsBounds.top == 0)
+ }
val dividerPos =
- if (dp.isLeftRightSplit) rootCandidate.endAbsBounds.right
- else rootCandidate.endAbsBounds.bottom
-
- // Recurse up the tree until parent is null, then we've found our root.
- var parentToken: WindowContainerToken? = rootCandidate.parent
- while (parentToken != null) {
- rootCandidate = transitionInfo.getChange(parentToken) ?: break
- parentToken = rootCandidate.parent
- }
-
- // Make sure nothing weird happened, like getChange() returning null.
- check(rootCandidate != null) { "Failed to find a root leash" }
+ if (dp.isLeftRightSplit) leftTopApp.endAbsBounds.right
+ else leftTopApp.endAbsBounds.bottom
// Create a new floating view in Launcher, positioned above the launching icon
val drawableArea = launchingIconView.iconDrawableArea
@@ -766,29 +760,50 @@
)
floatingView.bringToFront()
- launchAnimation.play(
- getIconLaunchValueAnimator(t, dp, finishCallback, launcher, floatingView,
- rootCandidate))
+ val iconLaunchValueAnimator =
+ getIconLaunchValueAnimator(
+ t,
+ dp,
+ finishCallback,
+ launcher,
+ floatingView,
+ mainRootCandidate
+ )
+ iconLaunchValueAnimator.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationStart(animation: Animator, isReverse: Boolean) {
+ for (c in leafRoots) {
+ t.setCornerRadius(c.leash, windowRadius)
+ t.apply()
+ }
+ }
+ }
+ )
+ launchAnimation.play(iconLaunchValueAnimator)
launchAnimation.start()
}
/**
- * Similar to [composeIconSplitLaunchAnimator], but instructs [FloatingAppPairView] to animate
- * a single fullscreen icon + background instead of for a pair
+ * Similar to [composeIconSplitLaunchAnimator], but instructs [FloatingAppPairView] to animate a
+ * single fullscreen icon + background instead of for a pair
*/
@VisibleForTesting
fun composeFullscreenIconSplitLaunchAnimator(
- launchingIconView: AppPairIcon,
- transitionInfo: TransitionInfo,
- t: Transaction,
- finishCallback: Runnable,
- launchFullscreenIndex: Int
+ launchingIconView: AppPairIcon,
+ transitionInfo: TransitionInfo,
+ t: Transaction,
+ finishCallback: Runnable,
+ launchFullscreenIndex: Int
) {
// If launching an app pair from Taskbar inside of an app context (no access to Launcher),
// use the scale-up animation
if (launchingIconView.context is TaskbarActivityContext) {
- composeScaleUpLaunchAnimation(transitionInfo, t, finishCallback,
- WINDOWING_MODE_FULLSCREEN)
+ composeScaleUpLaunchAnimation(
+ transitionInfo,
+ t,
+ finishCallback,
+ WINDOWING_MODE_FULLSCREEN
+ )
return
}
@@ -799,16 +814,18 @@
// Create an AnimatorSet that will run both shell and launcher transitions together
val launchAnimation = AnimatorSet()
- val appInfo = launchingIconView.info
- .getContents()[launchFullscreenIndex] as WorkspaceItemInfo
+ val appInfo =
+ launchingIconView.info.getContents()[launchFullscreenIndex] as WorkspaceItemInfo
val intentToLaunch = appInfo.intent.component?.packageName
var rootCandidate: Change? = null
for (change in transitionInfo.changes) {
val taskInfo: RunningTaskInfo = change.taskInfo ?: continue
val baseIntent = taskInfo.baseIntent.component?.packageName
- if (TransitionUtil.isOpeningType(change.mode) &&
+ if (
+ TransitionUtil.isOpeningType(change.mode) &&
taskInfo.windowingMode == WINDOWING_MODE_FULLSCREEN &&
- baseIntent == intentToLaunch) {
+ baseIntent == intentToLaunch
+ ) {
rootCandidate = change
}
}
@@ -832,26 +849,28 @@
appIcon.setBounds(0, 0, dp.iconSizePx, dp.iconSizePx)
val floatingView =
- FloatingAppPairView.getFloatingAppPairView(
- launcher,
- drawableArea,
- appIcon,
- null /*appIcon2*/,
- 0 /*dividerPos*/
- )
+ FloatingAppPairView.getFloatingAppPairView(
+ launcher,
+ drawableArea,
+ appIcon,
+ null /*appIcon2*/,
+ 0 /*dividerPos*/
+ )
floatingView.bringToFront()
launchAnimation.play(
- getIconLaunchValueAnimator(t, dp, finishCallback, launcher, floatingView,
- rootCandidate))
+ getIconLaunchValueAnimator(t, dp, finishCallback, launcher, floatingView, rootCandidate)
+ )
launchAnimation.start()
}
- private fun getIconLaunchValueAnimator(t: Transaction,
- dp: com.android.launcher3.DeviceProfile,
- finishCallback: Runnable,
- launcher: QuickstepLauncher,
- floatingView: FloatingAppPairView,
- rootCandidate: Change) : ValueAnimator {
+ private fun getIconLaunchValueAnimator(
+ t: Transaction,
+ dp: com.android.launcher3.DeviceProfile,
+ finishCallback: Runnable,
+ launcher: QuickstepLauncher,
+ floatingView: FloatingAppPairView,
+ rootCandidate: Change
+ ): ValueAnimator {
val progressUpdater = ValueAnimator.ofFloat(0f, 1f)
val timings = AnimUtils.getDeviceAppPairLaunchTimings(dp.isTablet)
progressUpdater.setDuration(timings.getDuration().toLong())
@@ -860,12 +879,12 @@
// Shell animation: the apps are revealed toward end of the launch animation
progressUpdater.addUpdateListener { valueAnimator: ValueAnimator ->
val progress =
- Interpolators.clampToProgress(
- Interpolators.LINEAR,
- valueAnimator.animatedFraction,
- timings.appRevealStartOffset,
- timings.appRevealEndOffset
- )
+ Interpolators.clampToProgress(
+ Interpolators.LINEAR,
+ valueAnimator.animatedFraction,
+ timings.appRevealStartOffset,
+ timings.appRevealEndOffset
+ )
// Set the alpha of the shell layer (2 apps + divider)
t.setAlpha(rootCandidate.leash, progress)
@@ -873,65 +892,65 @@
}
progressUpdater.addUpdateListener(
- object : MultiValueUpdateListener() {
- var mDx =
- FloatProp(
- floatingView.startingPosition.left,
- dp.widthPx / 2f - floatingView.startingPosition.width() / 2f,
- Interpolators.clampToProgress(
- timings.getStagedRectXInterpolator(),
- timings.stagedRectSlideStartOffset,
- timings.stagedRectSlideEndOffset
- )
- )
- var mDy =
- FloatProp(
- floatingView.startingPosition.top,
- dp.heightPx / 2f - floatingView.startingPosition.height() / 2f,
- Interpolators.clampToProgress(
- Interpolators.EMPHASIZED,
- timings.stagedRectSlideStartOffset,
- timings.stagedRectSlideEndOffset
- )
- )
- var mScaleX =
- FloatProp(
- 1f /* start */,
- dp.widthPx / floatingView.startingPosition.width(),
- Interpolators.clampToProgress(
- Interpolators.EMPHASIZED,
- timings.stagedRectSlideStartOffset,
- timings.stagedRectSlideEndOffset
- )
- )
- var mScaleY =
- FloatProp(
- 1f /* start */,
- dp.heightPx / floatingView.startingPosition.height(),
- Interpolators.clampToProgress(
- Interpolators.EMPHASIZED,
- timings.stagedRectSlideStartOffset,
- timings.stagedRectSlideEndOffset
- )
- )
+ object : MultiValueUpdateListener() {
+ var mDx =
+ FloatProp(
+ floatingView.startingPosition.left,
+ dp.widthPx / 2f - floatingView.startingPosition.width() / 2f,
+ Interpolators.clampToProgress(
+ timings.getStagedRectXInterpolator(),
+ timings.stagedRectSlideStartOffset,
+ timings.stagedRectSlideEndOffset
+ )
+ )
+ var mDy =
+ FloatProp(
+ floatingView.startingPosition.top,
+ dp.heightPx / 2f - floatingView.startingPosition.height() / 2f,
+ Interpolators.clampToProgress(
+ Interpolators.EMPHASIZED,
+ timings.stagedRectSlideStartOffset,
+ timings.stagedRectSlideEndOffset
+ )
+ )
+ var mScaleX =
+ FloatProp(
+ 1f /* start */,
+ dp.widthPx / floatingView.startingPosition.width(),
+ Interpolators.clampToProgress(
+ Interpolators.EMPHASIZED,
+ timings.stagedRectSlideStartOffset,
+ timings.stagedRectSlideEndOffset
+ )
+ )
+ var mScaleY =
+ FloatProp(
+ 1f /* start */,
+ dp.heightPx / floatingView.startingPosition.height(),
+ Interpolators.clampToProgress(
+ Interpolators.EMPHASIZED,
+ timings.stagedRectSlideStartOffset,
+ timings.stagedRectSlideEndOffset
+ )
+ )
- override fun onUpdate(percent: Float, initOnly: Boolean) {
- floatingView.progress = percent
- floatingView.x = mDx.value
- floatingView.y = mDy.value
- floatingView.scaleX = mScaleX.value
- floatingView.scaleY = mScaleY.value
- floatingView.invalidate()
- }
+ override fun onUpdate(percent: Float, initOnly: Boolean) {
+ floatingView.progress = percent
+ floatingView.x = mDx.value
+ floatingView.y = mDy.value
+ floatingView.scaleX = mScaleX.value
+ floatingView.scaleY = mScaleY.value
+ floatingView.invalidate()
}
+ }
)
progressUpdater.addListener(
- object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator) {
- safeRemoveViewFromDragLayer(launcher, floatingView)
- finishCallback.run()
- }
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ safeRemoveViewFromDragLayer(launcher, floatingView)
+ finishCallback.run()
}
+ }
)
return progressUpdater
@@ -939,9 +958,8 @@
/**
* This is a scale-up-and-fade-in animation (34% to 100%) for launching an app in Overview when
- * there is no visible associated tile to expand from.
- * [windowingMode] helps determine whether we are looking for a split or a single fullscreen
- * [Change]
+ * there is no visible associated tile to expand from. [windowingMode] helps determine whether
+ * we are looking for a split or a single fullscreen [Change]
*/
@VisibleForTesting
fun composeScaleUpLaunchAnimation(
@@ -1034,7 +1052,8 @@
secondTaskId: Int,
transitionInfo: TransitionInfo,
t: Transaction,
- finishCallback: Runnable
+ finishCallback: Runnable,
+ cornerRadius: Float
) {
var splitRoot1: Change? = null
var splitRoot2: Change? = null
@@ -1095,12 +1114,12 @@
animator.setDuration(QuickstepTransitionManager.SPLIT_LAUNCH_DURATION.toLong())
animator.addUpdateListener { valueAnimator: ValueAnimator ->
val progress =
- Interpolators.clampToProgress(
- Interpolators.LINEAR,
- valueAnimator.animatedFraction,
- 0.8f,
- 1f
- )
+ Interpolators.clampToProgress(
+ Interpolators.LINEAR,
+ valueAnimator.animatedFraction,
+ 0.8f,
+ 1f
+ )
for (leash in openingTargets) {
animTransaction.setAlpha(leash, progress)
}
@@ -1112,6 +1131,7 @@
override fun onAnimationStart(animation: Animator) {
for (leash in openingTargets) {
animTransaction.show(leash).setAlpha(leash, 0.0f)
+ animTransaction.setCornerRadius(leash, cornerRadius)
}
animTransaction.apply()
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitScreenUtils.kt b/quickstep/src/com/android/quickstep/util/SplitScreenUtils.kt
index 38bbe60..d982e81 100644
--- a/quickstep/src/com/android/quickstep/util/SplitScreenUtils.kt
+++ b/quickstep/src/com/android/quickstep/util/SplitScreenUtils.kt
@@ -16,11 +16,20 @@
package com.android.quickstep.util
+import android.util.Log
+import android.view.WindowManager.TRANSIT_OPEN
+import android.view.WindowManager.TRANSIT_TO_FRONT
+import android.window.TransitionInfo
+import android.window.TransitionInfo.Change
+import android.window.TransitionInfo.FLAG_FIRST_CUSTOM
import com.android.launcher3.util.SplitConfigurationOptions
-import com.android.wm.shell.util.SplitBounds
+import com.android.wm.shell.shared.split.SplitBounds
+import java.lang.IllegalStateException
class SplitScreenUtils {
companion object {
+ private const val TAG = "SplitScreenUtils"
+
// TODO(b/254378592): Remove these methods when the two classes are reunited
/** Converts the shell version of SplitBounds to the launcher version */
@JvmStatic
@@ -31,28 +40,58 @@
null
} else {
SplitConfigurationOptions.SplitBounds(
- shellSplitBounds.leftTopBounds, shellSplitBounds.rightBottomBounds,
- shellSplitBounds.leftTopTaskId, shellSplitBounds.rightBottomTaskId,
+ shellSplitBounds.leftTopBounds,
+ shellSplitBounds.rightBottomBounds,
+ shellSplitBounds.leftTopTaskId,
+ shellSplitBounds.rightBottomTaskId,
shellSplitBounds.snapPosition
)
}
}
- /** Converts the launcher version of SplitBounds to the shell version */
- @JvmStatic
- fun convertLauncherSplitBoundsToShell(
- launcherSplitBounds: SplitConfigurationOptions.SplitBounds?
- ): SplitBounds? {
- return if (launcherSplitBounds == null) {
- null
+ /**
+ * Given a TransitionInfo, generates the tree structure for those changes and extracts out
+ * the top most root and it's two immediate children.
+ * Changes can be provided in any order.
+ *
+ * @return a [Pair] where first -> top most split root,
+ * second -> [List] of 2, leftTop/bottomRight stage roots
+ */
+ fun extractTopParentAndChildren(transitionInfo: TransitionInfo):
+ Pair<Change, List<Change>>? {
+ val parentToChildren = mutableMapOf<Change, MutableList<Change>>()
+ val hasParent = mutableSetOf<Change>()
+ // filter out anything that isn't opening and the divider
+ val taskChanges: List<Change> = transitionInfo.changes
+ .filter { change -> (change.mode == TRANSIT_OPEN ||
+ change.mode == TRANSIT_TO_FRONT) && change.flags < FLAG_FIRST_CUSTOM}
+ .toList()
+
+ // 1. Build Parent-Child Relationships
+ for (change in taskChanges) {
+ // TODO (b/316490565): Replace this logic when SplitBounds is available to
+ // startAnimation() and we can know the precise taskIds of launching tasks.
+ change.parent?.let { parent ->
+ parentToChildren
+ .getOrPut(transitionInfo.getChange(parent)!!) { mutableListOf() }
+ .add(change)
+ hasParent.add(change)
+ }
+ }
+
+ // 2. Find Top Parent
+ val topParent = taskChanges.firstOrNull { it !in hasParent }
+
+ // 3. Extract Immediate Children
+ return if (topParent != null) {
+ val immediateChildren = parentToChildren.getOrDefault(topParent, emptyList())
+ if (immediateChildren.size != 2) {
+ throw IllegalStateException("incorrect split stage root size")
+ }
+ Pair(topParent, immediateChildren)
} else {
- SplitBounds(
- launcherSplitBounds.leftTopBounds,
- launcherSplitBounds.rightBottomBounds,
- launcherSplitBounds.leftTopTaskId,
- launcherSplitBounds.rightBottomTaskId,
- launcherSplitBounds.snapPosition
- )
+ Log.w(TAG, "No top parent found")
+ null
}
}
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt b/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt
index 06edb14..8258ab8 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt
@@ -38,36 +38,40 @@
import java.io.PrintWriter
/**
- * Holds/transforms/signs/seals/delivers information for the transient state of the user
- * selecting a first app to start split with and then choosing a second app.
- * This class DOES NOT associate itself with drag-and-drop split screen starts because they come
- * from the bad part of town.
+ * Holds/transforms/signs/seals/delivers information for the transient state of the user selecting a
+ * first app to start split with and then choosing a second app. This class DOES NOT associate
+ * itself with drag-and-drop split screen starts because they come from the bad part of town.
*
* After setting the correct fields for initial/second.* variables, this converts them into the
- * correct [PendingIntent] and [ShortcutInfo] objects where applicable and sends the necessary
- * data back via [getSplitLaunchData]. Note: there should be only one "initial" field and one
- * "second" field set, with the rest remaining null. (Exception: [Intent] and [UserHandle] are
- * always passed in together as a set, and are converted to a single [PendingIntent] or
+ * correct [PendingIntent] and [ShortcutInfo] objects where applicable and sends the necessary data
+ * back via [getSplitLaunchData]. Note: there should be only one "initial" field and one "second"
+ * field set, with the rest remaining null. (Exception: [Intent] and [UserHandle] are always passed
+ * in together as a set, and are converted to a single [PendingIntent] or
* [ShortcutInfo]+[PendingIntent] before launch.)
*
* [SplitLaunchType] indicates the type of tasks/apps/intents being launched given the provided
* state
*/
-class SplitSelectDataHolder(
- var context: Context?
-) {
+class SplitSelectDataHolder(var context: Context?) {
val TAG = SplitSelectDataHolder::class.simpleName
/**
- * Order of the constant indicates the order of which task/app was selected.
- * Ex. SPLIT_TASK_SHORTCUT means primary split app identified by task, secondary is shortcut
+ * Order of the constant indicates the order of which task/app was selected. Ex.
+ * SPLIT_TASK_SHORTCUT means primary split app identified by task, secondary is shortcut
* SPLIT_SHORTCUT_TASK means primary split app is determined by shortcut, secondary is task
*/
companion object {
- @IntDef(SPLIT_TASK_TASK, SPLIT_TASK_PENDINGINTENT, SPLIT_TASK_SHORTCUT,
- SPLIT_PENDINGINTENT_TASK, SPLIT_PENDINGINTENT_PENDINGINTENT, SPLIT_SHORTCUT_TASK,
- SPLIT_SINGLE_TASK_FULLSCREEN, SPLIT_SINGLE_INTENT_FULLSCREEN,
- SPLIT_SINGLE_SHORTCUT_FULLSCREEN)
+ @IntDef(
+ SPLIT_TASK_TASK,
+ SPLIT_TASK_PENDINGINTENT,
+ SPLIT_TASK_SHORTCUT,
+ SPLIT_PENDINGINTENT_TASK,
+ SPLIT_PENDINGINTENT_PENDINGINTENT,
+ SPLIT_SHORTCUT_TASK,
+ SPLIT_SINGLE_TASK_FULLSCREEN,
+ SPLIT_SINGLE_INTENT_FULLSCREEN,
+ SPLIT_SINGLE_SHORTCUT_FULLSCREEN
+ )
@Retention(AnnotationRetention.SOURCE)
annotation class SplitLaunchType
@@ -84,8 +88,7 @@
const val SPLIT_SINGLE_SHORTCUT_FULLSCREEN = 8
}
- @StagePosition
- private var initialStagePosition: Int = STAGE_POSITION_UNDEFINED
+ @StagePosition private var initialStagePosition: Int = STAGE_POSITION_UNDEFINED
private var itemInfo: ItemInfo? = null
private var secondItemInfo: ItemInfo? = null
private var splitEvent: EventEnum? = null
@@ -108,12 +111,16 @@
/**
* @param alreadyRunningTask if set to [android.app.ActivityTaskManager.INVALID_TASK_ID]
- * then @param intent will be used to launch the initial task
+ * then @param intent will be used to launch the initial task
* @param intent will be ignored if @param alreadyRunningTask is set
*/
- fun setInitialTaskSelect(intent: Intent?, @StagePosition stagePosition: Int,
- itemInfo: ItemInfo?, splitEvent: EventEnum?,
- alreadyRunningTask: Int) {
+ fun setInitialTaskSelect(
+ intent: Intent?,
+ @StagePosition stagePosition: Int,
+ itemInfo: ItemInfo?,
+ splitEvent: EventEnum?,
+ alreadyRunningTask: Int
+ ) {
if (alreadyRunningTask != INVALID_TASK_ID) {
initialTaskId = alreadyRunningTask
} else {
@@ -127,15 +134,21 @@
* To be called after first task selected from using a split shortcut from the fullscreen
* running app.
*/
- fun setInitialTaskSelect(info: RunningTaskInfo,
- @StagePosition stagePosition: Int, itemInfo: ItemInfo?,
- splitEvent: EventEnum?) {
+ fun setInitialTaskSelect(
+ info: RunningTaskInfo,
+ @StagePosition stagePosition: Int,
+ itemInfo: ItemInfo?,
+ splitEvent: EventEnum?
+ ) {
initialTaskId = info.taskId
setInitialData(stagePosition, splitEvent, itemInfo)
}
- private fun setInitialData(@StagePosition stagePosition: Int,
- event: EventEnum?, item: ItemInfo?) {
+ private fun setInitialData(
+ @StagePosition stagePosition: Int,
+ event: EventEnum?,
+ item: ItemInfo?
+ ) {
itemInfo = item
initialStagePosition = stagePosition
splitEvent = event
@@ -143,6 +156,7 @@
/**
* To be called as soon as user selects the second task (even if animations aren't complete)
+ *
* @param taskId The second task that will be launched.
*/
fun setSecondTask(taskId: Int, itemInfo: ItemInfo) {
@@ -152,6 +166,7 @@
/**
* To be called as soon as user selects the second app (even if animations aren't complete)
+ *
* @param intent The second intent that will be launched.
* @param user The user of that intent.
*/
@@ -162,8 +177,9 @@
}
/**
- * To be called as soon as user selects the second app (even if animations aren't complete)
- * Sets [secondUser] from that of the pendingIntent
+ * To be called as soon as user selects the second app (even if animations aren't complete) Sets
+ * [secondUser] from that of the pendingIntent
+ *
* @param pendingIntent The second PendingIntent that will be launched.
*/
fun setSecondTask(pendingIntent: PendingIntent, itemInfo: ItemInfo) {
@@ -173,9 +189,9 @@
}
/**
- * Similar to [setSecondTask] except this is to be called for widgets which can pass through
- * an extra intent from their RemoteResponse.
- * See [android.widget.RemoteViews.RemoteResponse.getLaunchOptions].first
+ * Similar to [setSecondTask] except this is to be called for widgets which can pass through an
+ * extra intent from their RemoteResponse. See
+ * [android.widget.RemoteViews.RemoteResponse.getLaunchOptions].first
*/
fun setSecondWidget(pendingIntent: PendingIntent, widgetIntent: Intent?, itemInfo: ItemInfo) {
setSecondTask(pendingIntent, itemInfo)
@@ -184,8 +200,7 @@
private fun getShortcutInfo(intent: Intent?, user: UserHandle?): ShortcutInfo? {
val intentPackage = intent?.getPackage() ?: return null
- val shortcutId = intent.getStringExtra(ShortcutKey.EXTRA_SHORTCUT_ID)
- ?: return null
+ val shortcutId = intent.getStringExtra(ShortcutKey.EXTRA_SHORTCUT_ID) ?: return null
try {
val context: Context =
if (user != null) {
@@ -200,9 +215,7 @@
return null
}
- /**
- * Converts intents to pendingIntents, associating the [user] with the intent if provided
- */
+ /** Converts intents to pendingIntents, associating the [user] with the intent if provided */
private fun getPendingIntent(intent: Intent?, user: UserHandle?): PendingIntent? {
if (intent != initialIntent && intent != secondIntent) {
throw IllegalStateException("Invalid intent to convert to PendingIntent")
@@ -211,12 +224,21 @@
return if (intent == null) {
null
} else if (user != null) {
- PendingIntent.getActivityAsUser(context, 0, intent,
- PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT,
- null /* options */, user)
+ PendingIntent.getActivityAsUser(
+ context,
+ 0,
+ intent,
+ PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT,
+ null /* options */,
+ user
+ )
} else {
- PendingIntent.getActivity(context, 0, intent,
- PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT)
+ PendingIntent.getActivity(
+ context,
+ 0,
+ intent,
+ PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT
+ )
}
}
@@ -224,7 +246,7 @@
* @return [SplitLaunchData] with the necessary fields populated as determined by
* [SplitLaunchData.splitLaunchType]. This is to be used for launching splitscreen
*/
- fun getSplitLaunchData() : SplitLaunchData {
+ fun getSplitLaunchData(): SplitLaunchData {
// Convert all intents to shortcut infos to see if determine if we launch shortcut or intent
convertIntentsToFinalTypes()
val splitLaunchType = getSplitLaunchType()
@@ -241,7 +263,7 @@
* [SplitLaunchData.splitLaunchType]. This is to be used for launching an initially selected
* split task in fullscreen
*/
- fun getFullscreenLaunchData() : SplitLaunchData {
+ fun getFullscreenLaunchData(): SplitLaunchData {
// Convert all intents to shortcut infos to determine if we launch shortcut or intent
convertIntentsToFinalTypes()
val splitLaunchType = getFullscreenLaunchType()
@@ -249,21 +271,22 @@
return generateSplitLaunchData(splitLaunchType)
}
- private fun generateSplitLaunchData(@SplitLaunchType splitLaunchType: Int) : SplitLaunchData {
+ private fun generateSplitLaunchData(@SplitLaunchType splitLaunchType: Int): SplitLaunchData {
return SplitLaunchData(
- splitLaunchType,
- initialTaskId,
- secondTaskId,
- initialPendingIntent,
- secondPendingIntent,
- widgetSecondIntent,
- initialUser?.identifier ?: -1,
- secondUser?.identifier ?: -1,
- initialShortcut,
- secondShortcut,
- itemInfo,
- splitEvent,
- initialStagePosition)
+ splitLaunchType,
+ initialTaskId,
+ secondTaskId,
+ initialPendingIntent,
+ secondPendingIntent,
+ widgetSecondIntent,
+ initialUser?.identifier ?: -1,
+ secondUser?.identifier ?: -1,
+ initialShortcut,
+ secondShortcut,
+ itemInfo,
+ splitEvent,
+ initialStagePosition
+ )
}
/**
@@ -273,8 +296,7 @@
* Note that both [initialIntent] and [secondIntent] will be nullified on method return
*
* One caveat is that if [secondPendingIntent] is set, we will use that and *not* attempt to
- * convert [secondIntent].
- * This also leaves [widgetSecondIntent] untouched.
+ * convert [secondIntent]. This also leaves [widgetSecondIntent] untouched.
*/
private fun convertIntentsToFinalTypes() {
initialShortcut = getShortcutInfo(initialIntent, initialUser)
@@ -297,8 +319,8 @@
}
/**
- * Only valid data fields at this point should be tasks, shortcuts, or pendingIntents
- * Intents need to be converted in [convertIntentsToFinalTypes] prior to calling this method
+ * Only valid data fields at this point should be tasks, shortcuts, or pendingIntents Intents
+ * need to be converted in [convertIntentsToFinalTypes] prior to calling this method
*/
@VisibleForTesting
@SplitLaunchType
@@ -354,41 +376,40 @@
}
data class SplitLaunchData(
- @SplitLaunchType
- val splitLaunchType: Int,
- var initialTaskId: Int = INVALID_TASK_ID,
- var secondTaskId: Int = INVALID_TASK_ID,
- var initialPendingIntent: PendingIntent? = null,
- var secondPendingIntent: PendingIntent? = null,
- var widgetSecondIntent: Intent? = null,
- var initialUserId: Int = -1,
- var secondUserId: Int = -1,
- var initialShortcut: ShortcutInfo? = null,
- var secondShortcut: ShortcutInfo? = null,
- var itemInfo: ItemInfo? = null,
- var splitEvent: EventEnum? = null,
- val initialStagePosition: Int = STAGE_POSITION_UNDEFINED
+ @SplitLaunchType val splitLaunchType: Int,
+ var initialTaskId: Int = INVALID_TASK_ID,
+ var secondTaskId: Int = INVALID_TASK_ID,
+ var initialPendingIntent: PendingIntent? = null,
+ var secondPendingIntent: PendingIntent? = null,
+ var widgetSecondIntent: Intent? = null,
+ var initialUserId: Int = -1,
+ var secondUserId: Int = -1,
+ var initialShortcut: ShortcutInfo? = null,
+ var secondShortcut: ShortcutInfo? = null,
+ var itemInfo: ItemInfo? = null,
+ var splitEvent: EventEnum? = null,
+ val initialStagePosition: Int = STAGE_POSITION_UNDEFINED
)
/**
- * @return `true` if first task has been selected and waiting for the second task to be
- * chosen
+ * @return `true` if first task has been selected and waiting for the second task to be chosen
*/
fun isSplitSelectActive(): Boolean {
return isInitialTaskIntentSet() && !isSecondTaskIntentSet()
}
/**
- * @return `true` if the first and second task have been chosen and split is waiting to
- * be launched
+ * @return `true` if the first and second task have been chosen and split is waiting to be
+ * launched
*/
fun isBothSplitAppsConfirmed(): Boolean {
return isInitialTaskIntentSet() && isSecondTaskIntentSet()
}
private fun isInitialTaskIntentSet(): Boolean {
- return initialTaskId != INVALID_TASK_ID || initialIntent != null ||
- initialPendingIntent != null
+ return initialTaskId != INVALID_TASK_ID ||
+ initialIntent != null ||
+ initialPendingIntent != null
}
fun getInitialTaskId(): Int {
@@ -416,8 +437,9 @@
}
private fun isSecondTaskIntentSet(): Boolean {
- return secondTaskId != INVALID_TASK_ID || secondIntent != null
- || secondPendingIntent != null
+ return secondTaskId != INVALID_TASK_ID ||
+ secondIntent != null ||
+ secondPendingIntent != null
}
fun resetState() {
@@ -437,7 +459,7 @@
}
fun dump(prefix: String, writer: PrintWriter) {
- writer.println("$prefix ${javaClass.simpleName}")
+ writer.println("$prefix SplitSelectDataHolder")
writer.println("$prefix\tinitialStagePosition= $initialStagePosition")
writer.println("$prefix\tinitialTaskId= $initialTaskId")
writer.println("$prefix\tsecondTaskId= $secondTaskId")
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index df1879e..ae6757f 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -16,7 +16,6 @@
package com.android.quickstep.util;
-import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTED_SECOND_APP;
@@ -35,8 +34,8 @@
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_PENDINGINTENT;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_SHORTCUT;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_TASK_TASK;
-import static com.android.wm.shell.common.split.SplitScreenConstants.KEY_EXTRA_WIDGET_INTENT;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_50_50;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.KEY_EXTRA_WIDGET_INTENT;
+import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -56,13 +55,11 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
-import android.os.SystemClock;
import android.os.UserHandle;
import android.util.Log;
import android.util.Pair;
-import android.view.RemoteAnimationAdapter;
-import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
+import android.view.View;
import android.window.IRemoteTransitionFinishedCallback;
import android.window.RemoteTransition;
import android.window.RemoteTransitionStub;
@@ -94,17 +91,15 @@
import com.android.quickstep.RecentsModel;
import com.android.quickstep.SplitSelectionListener;
import com.android.quickstep.SystemUiProxy;
-import com.android.quickstep.TaskAnimationManager;
import com.android.quickstep.views.FloatingTaskView;
import com.android.quickstep.views.GroupedTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
import com.android.quickstep.views.SplitInstructionsView;
-import com.android.systemui.animation.RemoteAnimationRunnerCompat;
import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosition;
+import com.android.systemui.shared.system.QuickStepContract;
+import com.android.wm.shell.shared.split.SplitScreenConstants.PersistentSnapPosition;
import com.android.wm.shell.splitscreen.ISplitSelectListener;
import java.io.PrintWriter;
@@ -154,9 +149,10 @@
/**
* Should be a constant from {@link com.android.internal.jank.Cuj} or -1, does not need to be
- * set for all launches.
+ * set for all launches. Used in conjunction with {@link #mLaunchingViewCuj} below.
*/
private int mLaunchCuj = -1;
+ private View mLaunchingViewCuj;
private FloatingTaskView mFirstFloatingTaskView;
private SplitInstructionsView mSplitInstructionsView;
@@ -275,17 +271,15 @@
// Loop through tasks in reverse, since they are ordered with recent tasks last
for (int j = taskGroups.size() - 1; j >= 0; j--) {
GroupTask groupTask = taskGroups.get(j);
- Task task1 = groupTask.task1;
- // Don't add duplicate Tasks
- if (isInstanceOfComponent(task1, key)
- && !Arrays.asList(lastActiveTasks).contains(task1)) {
- lastActiveTask = task1;
- break;
+ // Account for desktop cases where there can be N tasks in the group
+ for (Task task : groupTask.getTasks()) {
+ if (isInstanceOfComponent(task, key)
+ && !Arrays.asList(lastActiveTasks).contains(task)) {
+ lastActiveTask = task;
+ break;
+ }
}
- Task task2 = groupTask.task2;
- if (isInstanceOfComponent(task2, key)
- && !Arrays.asList(lastActiveTasks).contains(task2)) {
- lastActiveTask = task2;
+ if (lastActiveTask != null) {
break;
}
}
@@ -459,77 +453,41 @@
Bundle optionsBundle = options1.toBundle();
Bundle extrasBundle = new Bundle(1);
extrasBundle.putParcelable(KEY_EXTRA_WIDGET_INTENT, widgetIntent);
- if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
- final RemoteTransition remoteTransition = getShellRemoteTransition(firstTaskId,
- secondTaskId, callback, "LaunchSplitPair");
- switch (launchData.getSplitLaunchType()) {
- case SPLIT_TASK_TASK ->
- mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId,
- null /* options2 */, initialStagePosition, snapPosition,
- remoteTransition, shellInstanceId);
+ final RemoteTransition remoteTransition = getRemoteTransition(firstTaskId,
+ secondTaskId, callback, "LaunchSplitPair");
+ switch (launchData.getSplitLaunchType()) {
+ case SPLIT_TASK_TASK ->
+ mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId,
+ null /* options2 */, initialStagePosition, snapPosition,
+ remoteTransition, shellInstanceId);
- case SPLIT_TASK_PENDINGINTENT ->
- mSystemUiProxy.startIntentAndTask(secondPI, secondUserId, optionsBundle,
- firstTaskId, extrasBundle, initialStagePosition, snapPosition,
- remoteTransition, shellInstanceId);
+ case SPLIT_TASK_PENDINGINTENT ->
+ mSystemUiProxy.startIntentAndTask(secondPI, secondUserId, optionsBundle,
+ firstTaskId, extrasBundle, initialStagePosition, snapPosition,
+ remoteTransition, shellInstanceId);
- case SPLIT_TASK_SHORTCUT ->
- mSystemUiProxy.startShortcutAndTask(secondShortcut, optionsBundle,
- firstTaskId, null /*options2*/, initialStagePosition, snapPosition,
- remoteTransition, shellInstanceId);
+ case SPLIT_TASK_SHORTCUT ->
+ mSystemUiProxy.startShortcutAndTask(secondShortcut, optionsBundle,
+ firstTaskId, null /*options2*/, initialStagePosition, snapPosition,
+ remoteTransition, shellInstanceId);
- case SPLIT_PENDINGINTENT_TASK ->
- mSystemUiProxy.startIntentAndTask(firstPI, firstUserId, optionsBundle,
- secondTaskId, null /*options2*/, initialStagePosition, snapPosition,
- remoteTransition, shellInstanceId);
+ case SPLIT_PENDINGINTENT_TASK ->
+ mSystemUiProxy.startIntentAndTask(firstPI, firstUserId, optionsBundle,
+ secondTaskId, null /*options2*/, initialStagePosition, snapPosition,
+ remoteTransition, shellInstanceId);
- case SPLIT_PENDINGINTENT_PENDINGINTENT ->
- mSystemUiProxy.startIntents(firstPI, firstUserId, firstShortcut,
- optionsBundle, secondPI, secondUserId, secondShortcut, extrasBundle,
- initialStagePosition, snapPosition, remoteTransition,
- shellInstanceId);
+ case SPLIT_PENDINGINTENT_PENDINGINTENT ->
+ mSystemUiProxy.startIntents(firstPI, firstUserId, firstShortcut,
+ optionsBundle, secondPI, secondUserId, secondShortcut, extrasBundle,
+ initialStagePosition, snapPosition, remoteTransition,
+ shellInstanceId);
- case SPLIT_SHORTCUT_TASK ->
- mSystemUiProxy.startShortcutAndTask(firstShortcut, optionsBundle,
- secondTaskId, null /*options2*/, initialStagePosition, snapPosition,
- remoteTransition, shellInstanceId);
- }
- } else {
- final RemoteAnimationAdapter adapter = getLegacyRemoteAdapter(firstTaskId, secondTaskId,
- callback);
- switch (launchData.getSplitLaunchType()) {
- case SPLIT_TASK_TASK ->
- mSystemUiProxy.startTasksWithLegacyTransition(firstTaskId, optionsBundle,
- secondTaskId, null /* options2 */, initialStagePosition,
- snapPosition, adapter, shellInstanceId);
-
- case SPLIT_TASK_PENDINGINTENT ->
- mSystemUiProxy.startIntentAndTaskWithLegacyTransition(secondPI,
- secondUserId, optionsBundle, firstTaskId, null /*options2*/,
- initialStagePosition, snapPosition, adapter, shellInstanceId);
-
- case SPLIT_TASK_SHORTCUT ->
- mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(secondShortcut,
- optionsBundle, firstTaskId, null /*options2*/, initialStagePosition,
- snapPosition, adapter, shellInstanceId);
-
- case SPLIT_PENDINGINTENT_TASK ->
- mSystemUiProxy.startIntentAndTaskWithLegacyTransition(firstPI, firstUserId,
- optionsBundle, secondTaskId, null /*options2*/,
- initialStagePosition, snapPosition, adapter, shellInstanceId);
-
- case SPLIT_PENDINGINTENT_PENDINGINTENT ->
- mSystemUiProxy.startIntentsWithLegacyTransition(firstPI, firstUserId,
- firstShortcut, optionsBundle, secondPI, secondUserId,
- secondShortcut, null /*options2*/, initialStagePosition,
- snapPosition, adapter, shellInstanceId);
-
- case SPLIT_SHORTCUT_TASK ->
- mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(firstShortcut,
- optionsBundle, secondTaskId, null /*options2*/,
- initialStagePosition, snapPosition, adapter, shellInstanceId);
- }
+ case SPLIT_SHORTCUT_TASK ->
+ mSystemUiProxy.startShortcutAndTask(firstShortcut, optionsBundle,
+ secondTaskId, null /*options2*/, initialStagePosition, snapPosition,
+ remoteTransition, shellInstanceId);
}
+
}
/**
@@ -575,20 +533,13 @@
}
Bundle optionsBundle = options1.toBundle();
- if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
- final RemoteTransition transition = remoteTransition == null
- ? getShellRemoteTransition(
- firstTaskId, secondTaskId, callback, "LaunchExistingPair")
- : remoteTransition;
- mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId, null /* options2 */,
- stagePosition, snapPosition, transition, null /*shellInstanceId*/);
- } else {
- final RemoteAnimationAdapter adapter = getLegacyRemoteAdapter(firstTaskId,
- secondTaskId, callback);
- mSystemUiProxy.startTasksWithLegacyTransition(firstTaskId, optionsBundle, secondTaskId,
- null /* options2 */, stagePosition, snapPosition, adapter,
- null /*shellInstanceId*/);
- }
+ final RemoteTransition transition = remoteTransition == null
+ ? getRemoteTransition(
+ firstTaskId, secondTaskId, callback, "LaunchExistingPair")
+ : remoteTransition;
+ mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId, null /* options2 */,
+ stagePosition, snapPosition, transition, null /*shellInstanceId*/);
+
}
/**
@@ -614,34 +565,16 @@
ActivityThread.currentActivityThread().getApplicationThread(),
"LaunchAppFullscreen");
InstanceId instanceId = mSessionInstanceIds.first;
- if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
- switch (launchData.getSplitLaunchType()) {
- case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasks(firstTaskId,
- optionsBundle, secondTaskId, null /* options2 */, initialStagePosition,
- SNAP_TO_50_50, remoteTransition, instanceId);
- case SPLIT_SINGLE_INTENT_FULLSCREEN -> mSystemUiProxy.startIntentAndTask(firstPI,
- firstUserId, optionsBundle, secondTaskId, null /*options2*/,
- initialStagePosition, SNAP_TO_50_50, remoteTransition, instanceId);
- case SPLIT_SINGLE_SHORTCUT_FULLSCREEN -> mSystemUiProxy.startShortcutAndTask(
- initialShortcut, optionsBundle, firstTaskId, null /* options2 */,
- initialStagePosition, SNAP_TO_50_50, remoteTransition, instanceId);
- }
- } else {
- final RemoteAnimationAdapter adapter = getLegacyRemoteAdapter(firstTaskId,
- secondTaskId, callback);
- switch (launchData.getSplitLaunchType()) {
- case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasksWithLegacyTransition(
- firstTaskId, optionsBundle, secondTaskId, null /* options2 */,
- initialStagePosition, SNAP_TO_50_50, adapter, instanceId);
- case SPLIT_SINGLE_INTENT_FULLSCREEN ->
- mSystemUiProxy.startIntentAndTaskWithLegacyTransition(firstPI, firstUserId,
- optionsBundle, secondTaskId, null /*options2*/,
- initialStagePosition, SNAP_TO_50_50, adapter, instanceId);
- case SPLIT_SINGLE_SHORTCUT_FULLSCREEN ->
- mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(
- initialShortcut, optionsBundle, firstTaskId, null /* options2 */,
- initialStagePosition, SNAP_TO_50_50, adapter, instanceId);
- }
+ switch (launchData.getSplitLaunchType()) {
+ case SPLIT_SINGLE_TASK_FULLSCREEN -> mSystemUiProxy.startTasks(firstTaskId,
+ optionsBundle, secondTaskId, null /* options2 */, initialStagePosition,
+ SNAP_TO_50_50, remoteTransition, instanceId);
+ case SPLIT_SINGLE_INTENT_FULLSCREEN -> mSystemUiProxy.startIntentAndTask(firstPI,
+ firstUserId, optionsBundle, secondTaskId, null /*options2*/,
+ initialStagePosition, SNAP_TO_50_50, remoteTransition, instanceId);
+ case SPLIT_SINGLE_SHORTCUT_FULLSCREEN -> mSystemUiProxy.startShortcutAndTask(
+ initialShortcut, optionsBundle, firstTaskId, null /* options2 */,
+ initialStagePosition, SNAP_TO_50_50, remoteTransition, instanceId);
}
}
@@ -659,7 +592,7 @@
mSplitFromDesktopController = controller;
}
- private RemoteTransition getShellRemoteTransition(int firstTaskId, int secondTaskId,
+ private RemoteTransition getRemoteTransition(int firstTaskId, int secondTaskId,
@Nullable Consumer<Boolean> callback, String transitionName) {
final RemoteSplitLaunchTransitionRunner animationRunner =
new RemoteSplitLaunchTransitionRunner(firstTaskId, secondTaskId, callback);
@@ -667,14 +600,6 @@
ActivityThread.currentActivityThread().getApplicationThread(), transitionName);
}
- private RemoteAnimationAdapter getLegacyRemoteAdapter(int firstTaskId, int secondTaskId,
- @Nullable Consumer<Boolean> callback) {
- final RemoteSplitLaunchAnimationRunner animationRunner =
- new RemoteSplitLaunchAnimationRunner(firstTaskId, secondTaskId, callback);
- return new RemoteAnimationAdapter(animationRunner, 300, 150,
- ActivityThread.currentActivityThread().getApplicationThread());
- }
-
/**
* Will initialize {@link #mSessionInstanceIds} if null and log the first split event from
* {@link #mSplitSelectDataHolder}
@@ -727,7 +652,12 @@
return mSplitAnimationController;
}
- public void setLaunchingCuj(int launchCuj) {
+ /**
+ * Set params to invoke a trace session for the given view and CUJ when we begin animating the
+ * split launch AFTER we get a response from Shell.
+ */
+ public void setLaunchingCuj(View launchingView, int launchCuj) {
+ mLaunchingViewCuj = launchingView;
mLaunchCuj = launchCuj;
}
@@ -765,6 +695,9 @@
&& mLaunchingTaskView.getRecentsView() != null
&& mLaunchingTaskView.getRecentsView().isTaskViewVisible(
mLaunchingTaskView);
+ if (mLaunchingViewCuj != null && mLaunchCuj != -1) {
+ InteractionJankMonitorWrapper.begin(mLaunchingViewCuj, mLaunchCuj);
+ }
mSplitAnimationController.playSplitLaunchAnimation(
shouldLaunchFromTaskView ? mLaunchingTaskView : null,
mLaunchingIconView,
@@ -778,7 +711,8 @@
info, t, () -> {
finishAdapter.run();
cleanup(true /*success*/);
- });
+ },
+ QuickStepContract.getWindowCornerRadius(mContainer.asContext()));
});
}
@@ -805,53 +739,6 @@
}
/**
- * LEGACY
- * Remote animation runner for animation to launch an app.
- */
- private class RemoteSplitLaunchAnimationRunner extends RemoteAnimationRunnerCompat {
-
- private final int mInitialTaskId;
- private final int mSecondTaskId;
- private final Consumer<Boolean> mSuccessCallback;
-
- RemoteSplitLaunchAnimationRunner(int initialTaskId, int secondTaskId,
- @Nullable Consumer<Boolean> successCallback) {
- mInitialTaskId = initialTaskId;
- mSecondTaskId = secondTaskId;
- mSuccessCallback = successCallback;
- }
-
- @Override
- public void onAnimationStart(int transit, RemoteAnimationTarget[] apps,
- RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps,
- Runnable finishedCallback) {
- postAsyncCallback(mHandler,
- () -> mSplitAnimationController.playSplitLaunchAnimation(mLaunchingTaskView,
- mLaunchingIconView, mInitialTaskId, mSecondTaskId, apps, wallpapers,
- nonApps, mStateManager, mDepthController, null /* info */, null /* t */,
- () -> {
- finishedCallback.run();
- if (mSuccessCallback != null) {
- mSuccessCallback.accept(true);
- }
- resetState();
- }));
- }
-
- @Override
- public void onAnimationCancelled() {
- postAsyncCallback(mHandler, () -> {
- if (mSuccessCallback != null) {
- // Launching legacy tasks while recents animation is running will always cause
- // onAnimationCancelled to be called (should be fixed w/ shell transitions?)
- mSuccessCallback.accept(mRecentsAnimationRunning);
- }
- resetState();
- });
- }
- }
-
- /**
* To be called whenever we exit split selection state. If
* {@link FeatureFlags#enableSplitContextually()} is set, this should be the
* central way split is getting reset, which should then go through the callbacks to reset
@@ -873,6 +760,7 @@
InteractionJankMonitorWrapper.end(mLaunchCuj);
}
mLaunchCuj = -1;
+ mLaunchingViewCuj = null;
if (mSessionInstanceIds != null) {
mStatsLogManager.logger()
@@ -957,7 +845,7 @@
private final int mSplitPlaceholderSize;
private final int mSplitPlaceholderInset;
private ActivityManager.RunningTaskInfo mTaskInfo;
- private ISplitSelectListener mSplitSelectListener;
+ private DesktopSplitSelectListenerImpl mSplitSelectListener;
private Drawable mAppIcon;
public SplitFromDesktopController(QuickstepLauncher launcher,
@@ -968,21 +856,15 @@
R.dimen.split_placeholder_size);
mSplitPlaceholderInset = mLauncher.getResources().getDimensionPixelSize(
R.dimen.split_placeholder_inset);
- mSplitSelectListener = new ISplitSelectListener.Stub() {
- @Override
- public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo,
- int splitPosition, Rect taskBounds) {
- MAIN_EXECUTOR.execute(() -> enterSplitSelect(taskInfo, splitPosition,
- taskBounds));
- return true;
- }
- };
+ mSplitSelectListener = new DesktopSplitSelectListenerImpl(this);
SystemUiProxy.INSTANCE.get(mLauncher).registerSplitSelectListener(mSplitSelectListener);
}
void onDestroy() {
SystemUiProxy.INSTANCE.get(mLauncher).unregisterSplitSelectListener(
mSplitSelectListener);
+ mSplitSelectListener.release();
+ mSplitSelectListener = null;
}
/**
@@ -1010,14 +892,17 @@
DesktopSplitRecentsAnimationListener listener =
new DesktopSplitRecentsAnimationListener(splitPosition, taskBounds);
- MAIN_EXECUTOR.execute(() -> {
- callbacks.addListener(listener);
- UI_HELPER_EXECUTOR.execute(
- // Transition from app to enter stage split in launcher with
- // recents animation.
- () -> ActivityManagerWrapper.getInstance().startRecentsActivity(
- mOverviewComponentObserver.getOverviewIntent(),
- SystemClock.uptimeMillis(), callbacks, null, null));
+ callbacks.addListener(listener);
+ UI_HELPER_EXECUTOR.execute(() -> {
+ // Transition from app to enter stage split in launcher with recents animation
+ final ActivityOptions options = ActivityOptions.makeBasic();
+ options.setPendingIntentBackgroundActivityStartMode(
+ ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
+ options.setTransientLaunch();
+ SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext())
+ .startRecentsActivity(
+ mOverviewComponentObserver.getOverviewIntent(), options,
+ callbacks);
});
}
@@ -1074,4 +959,35 @@
}
}
}
+
+ /**
+ * Wrapper for the ISplitSelectListener stub to prevent lingering references to the launcher
+ * activity via the controller.
+ */
+ private static class DesktopSplitSelectListenerImpl extends ISplitSelectListener.Stub {
+
+ private SplitFromDesktopController mController;
+
+ DesktopSplitSelectListenerImpl(@NonNull SplitFromDesktopController controller) {
+ mController = controller;
+ }
+
+ /**
+ * Clears any references to the controller.
+ */
+ void release() {
+ mController = null;
+ }
+
+ @Override
+ public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo,
+ int splitPosition, Rect taskBounds) {
+ MAIN_EXECUTOR.execute(() -> {
+ if (mController != null) {
+ mController.enterSplitSelect(taskInfo, splitPosition, taskBounds);
+ }
+ });
+ return true;
+ }
+ }
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java
index d1ec2b6..7557ad1 100644
--- a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java
+++ b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java
@@ -17,6 +17,7 @@
package com.android.quickstep.util;
import static com.android.app.animation.Interpolators.EMPHASIZED;
+import static com.android.app.animation.Interpolators.LINEAR;
import android.view.animation.Interpolator;
@@ -31,6 +32,8 @@
abstract public int getPlaceholderIconFadeInEnd();
abstract public int getStagedRectSlideStart();
abstract public int getStagedRectSlideEnd();
+ abstract public int getBackingScrimFadeInStart();
+ abstract public int getBackingScrimFadeInEnd();
// Common timings
public int getInstructionsFadeStart() { return 0; }
@@ -39,6 +42,7 @@
public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; }
public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; }
public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; }
+ public Interpolator getBackingScrimFadeInterpolator() { return LINEAR; }
abstract public int getDuration();
@@ -48,4 +52,10 @@
public float getInstructionsFadeEndOffset() {
return (float) getInstructionsFadeEnd() / getDuration();
}
+ public float getBackingScrimFadeInStartOffset() {
+ return (float) getBackingScrimFadeInStart() / getDuration();
+ }
+ public float getBackingScrimFadeInEndOffset() {
+ return (float) getBackingScrimFadeInEnd() / getDuration();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
index 2396512..4962367 100644
--- a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
@@ -163,9 +163,8 @@
new RectF(firstTaskStartingBounds), firstTaskEndingBounds,
false /* fadeWithThumbnail */, true /* isStagedTask */);
- View mSplitDividerPlaceholderView = recentsView.getSplitSelectController()
- .getSplitAnimationController().addDividerPlaceholderViewToAnim(pendingAnimation,
- mLauncher, secondTaskEndingBounds, view.getContext());
+ View backingScrim = recentsView.getSplitSelectController().getSplitAnimationController()
+ .addScrimBehindAnim(pendingAnimation, mLauncher, view.getContext());
FloatingTaskView secondFloatingTaskView = FloatingTaskView.getFloatingTaskView(mLauncher,
view, bitmap, icon, secondTaskStartingBounds);
@@ -197,7 +196,7 @@
private void cleanUp() {
mLauncher.getDragLayer().removeView(firstFloatingTaskView);
mLauncher.getDragLayer().removeView(secondFloatingTaskView);
- mLauncher.getDragLayer().removeView(mSplitDividerPlaceholderView);
+ mLauncher.getDragLayer().removeView(backingScrim);
mController.getSplitAnimationController().removeSplitInstructionsView(mLauncher);
mController.resetState();
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
index 85d4f4b..1c417eb 100644
--- a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
@@ -27,9 +27,9 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.ActivityManager;
+import android.app.ActivityOptions;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.os.SystemClock;
import androidx.annotation.BinderThread;
@@ -91,12 +91,17 @@
MAIN_EXECUTOR.execute(() -> {
callbacks.addListener(listener);
- UI_HELPER_EXECUTOR.execute(
- // Transition from fullscreen app to enter stage split in launcher with
- // recents animation.
- () -> ActivityManagerWrapper.getInstance().startRecentsActivity(
- mOverviewComponentObserver.getOverviewIntent(),
- SystemClock.uptimeMillis(), callbacks, null, null));
+ UI_HELPER_EXECUTOR.execute(() -> {
+ // Transition from fullscreen app to enter stage split in launcher with
+ // recents animation
+ final ActivityOptions options = ActivityOptions.makeBasic();
+ options.setPendingIntentBackgroundActivityStartMode(
+ ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
+ options.setTransientLaunch();
+ SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext())
+ .startRecentsActivity(mOverviewComponentObserver.getOverviewIntent(),
+ ActivityOptions.makeBasic(), callbacks);
+ });
});
}
@@ -110,17 +115,17 @@
private final boolean mLeftOrTop;
private final Rect mTempRect = new Rect();
+ private final ActivityManager.RunningTaskInfo mRunningTaskInfo;
private SplitWithKeyboardShortcutRecentsAnimationListener(boolean leftOrTop) {
mLeftOrTop = leftOrTop;
+ mRunningTaskInfo = ActivityManagerWrapper.getInstance().getRunningTask();
}
@Override
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
- ActivityManager.RunningTaskInfo runningTaskInfo =
- ActivityManagerWrapper.getInstance().getRunningTask();
- mController.setInitialTaskSelect(runningTaskInfo,
+ mController.setInitialTaskSelect(mRunningTaskInfo,
mLeftOrTop ? STAGE_POSITION_TOP_OR_LEFT : STAGE_POSITION_BOTTOM_OR_RIGHT,
null /* itemInfo */,
mLeftOrTop ? LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP
@@ -136,14 +141,15 @@
RectF startingTaskRect = new RectF();
final FloatingTaskView floatingTaskView = FloatingTaskView.getFloatingTaskView(
mLauncher, mLauncher.getDragLayer(),
- controller.screenshotTask(runningTaskInfo.taskId).thumbnail,
+ controller.screenshotTask(mRunningTaskInfo.taskId).getThumbnail(),
null /* icon */, startingTaskRect);
+ Task task = Task.from(new Task.TaskKey(mRunningTaskInfo), mRunningTaskInfo,
+ false /* isLocked */);
RecentsModel.INSTANCE.get(mLauncher.getApplicationContext())
.getIconCache()
- .updateIconInBackground(
- Task.from(new Task.TaskKey(runningTaskInfo), runningTaskInfo,
- false /* isLocked */),
- (task) -> floatingTaskView.setIcon(task.icon));
+ .getIconInBackground(
+ task,
+ (icon, contentDescription, title) -> floatingTaskView.setIcon(icon));
floatingTaskView.setAlpha(1);
floatingTaskView.addStagingAnimation(anim, startingTaskRect, mTempRect,
false /* fadeWithThumbnail */, true /* isStagedTask */);
diff --git a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
index f823aff..828322b 100644
--- a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
@@ -39,17 +39,19 @@
import com.android.quickstep.TaskAnimationManager;
import com.android.systemui.shared.pip.PipSurfaceTransactionHelper;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import com.android.wm.shell.pip.PipContentOverlay;
+import com.android.wm.shell.shared.pip.PipContentOverlay;
/**
* Subclass of {@link RectFSpringAnim} that animates an Activity to PiP (picture-in-picture) window
* when swiping up (in gesture navigation mode).
*/
public class SwipePipToHomeAnimator extends RectFSpringAnim {
- private static final String TAG = SwipePipToHomeAnimator.class.getSimpleName();
+ private static final String TAG = "SwipePipToHomeAnimator";
private static final float END_PROGRESS = 1.0f;
+ private static final float PIP_ASPECT_RATIO_MISMATCH_THRESHOLD = 0.01f;
+
private final int mTaskId;
private final ActivityInfo mActivityInfo;
private final SurfaceControl mLeash;
@@ -135,7 +137,12 @@
mDestinationBoundsTransformed.set(destinationBoundsTransformed);
mSurfaceTransactionHelper = new PipSurfaceTransactionHelper(cornerRadius, shadowRadius);
+ final float aspectRatio = destinationBounds.width() / (float) destinationBounds.height();
String reasonForCreateOverlay = null; // For debugging purpose.
+
+ // Slightly larger app bounds to allow for off by 1 pixel source-rect-hint errors.
+ Rect overflowAppBounds = new Rect(appBounds.left - 1, appBounds.top - 1,
+ appBounds.right + 1, appBounds.bottom + 1);
if (sourceRectHint.isEmpty()) {
reasonForCreateOverlay = "Source rect hint is empty";
} else if (sourceRectHint.width() < destinationBounds.width()
@@ -146,17 +153,22 @@
// animation in this case.
reasonForCreateOverlay = "Source rect hint is too small " + sourceRectHint;
sourceRectHint.setEmpty();
- } else if (!appBounds.contains(sourceRectHint)) {
+ } else if (!overflowAppBounds.contains(sourceRectHint)) {
// This is a situation in which the source hint rect is outside the app bounds, so it is
// not a valid rectangle to use for cropping app surface
- sourceRectHint.setEmpty();
reasonForCreateOverlay = "Source rect hint exceeds display bounds " + sourceRectHint;
+ sourceRectHint.setEmpty();
+ } else if (Math.abs(
+ aspectRatio - (sourceRectHint.width() / (float) sourceRectHint.height()))
+ > PIP_ASPECT_RATIO_MISMATCH_THRESHOLD) {
+ // The source rect hint does not aspect ratio
+ reasonForCreateOverlay = "Source rect hint does not match aspect ratio "
+ + sourceRectHint + " aspect ratio " + aspectRatio;
+ sourceRectHint.setEmpty();
}
if (sourceRectHint.isEmpty()) {
- mSourceRectHint.setEmpty();
- mSourceHintRectInsets = null;
-
+ mSourceRectHint.set(getEnterPipWithOverlaySrcRectHint(appBounds, aspectRatio));
// Create a new overlay layer. We do not call detach on this instance, it's propagated
// to other classes like PipTaskOrganizer / RecentsAnimationController to complete
// the cleanup.
@@ -168,11 +180,11 @@
Log.d(TAG, getContentOverlay() + " is created: " + reasonForCreateOverlay);
} else {
mSourceRectHint.set(sourceRectHint);
- mSourceHintRectInsets = new Rect(sourceRectHint.left - appBounds.left,
- sourceRectHint.top - appBounds.top,
- appBounds.right - sourceRectHint.right,
- appBounds.bottom - sourceRectHint.bottom);
}
+ mSourceHintRectInsets = new Rect(mSourceRectHint.left - appBounds.left,
+ mSourceRectHint.top - appBounds.top,
+ appBounds.right - mSourceRectHint.right,
+ appBounds.bottom - mSourceRectHint.bottom);
addAnimatorListener(new AnimationSuccessListener() {
@Override
@@ -202,6 +214,26 @@
addOnUpdateListener(this::onAnimationUpdate);
}
+ /**
+ * Crop a Rect matches the aspect ratio and pivots at the center point.
+ */
+ private Rect getEnterPipWithOverlaySrcRectHint(Rect appBounds, float aspectRatio) {
+ final float appBoundsAspectRatio = appBounds.width() / (float) appBounds.height();
+ final int width, height;
+ int left = appBounds.left;
+ int top = appBounds.top;
+ if (appBoundsAspectRatio < aspectRatio) {
+ width = appBounds.width();
+ height = (int) (width / aspectRatio);
+ top = appBounds.top + (appBounds.height() - height) / 2;
+ } else {
+ height = appBounds.height();
+ width = (int) (height * aspectRatio);
+ left = appBounds.left + (appBounds.width() - width) / 2;
+ }
+ return new Rect(left, top, left + width, top + height);
+ }
+
private void onAnimationUpdate(RectF currentRect, float progress) {
if (mHasAnimationEnded) return;
final SurfaceControl.Transaction tx =
@@ -217,27 +249,7 @@
if (mPipContentOverlay != null) {
mPipContentOverlay.onAnimationUpdate(tx, mCurrentBounds, progress);
}
- final PictureInPictureSurfaceTransaction op;
- if (mSourceHintRectInsets == null) {
- // no source rect hint been set, directly scale the window down
- op = onAnimationScale(progress, tx, mCurrentBounds);
- } else {
- // scale and crop according to the source rect hint
- op = onAnimationScaleAndCrop(progress, tx, mCurrentBounds);
- }
- return op;
- }
-
- /** scale the window directly with no source rect hint being set */
- private PictureInPictureSurfaceTransaction onAnimationScale(
- float progress, SurfaceControl.Transaction tx, Rect bounds) {
- if (mFromRotation == Surface.ROTATION_90 || mFromRotation == Surface.ROTATION_270) {
- final RotatedPosition rotatedPosition = getRotatedPosition(progress);
- return mSurfaceTransactionHelper.scale(tx, mLeash, mAppBounds, bounds,
- rotatedPosition.degree, rotatedPosition.positionX, rotatedPosition.positionY);
- } else {
- return mSurfaceTransactionHelper.scale(tx, mLeash, mAppBounds, bounds);
- }
+ return onAnimationScaleAndCrop(progress, tx, mCurrentBounds);
}
/** scale and crop the window with source rect hint */
@@ -272,6 +284,10 @@
return mAppBounds;
}
+ public Rect getSourceRectHint() {
+ return mSourceRectHint;
+ }
+
@Nullable
public SurfaceControl getContentOverlay() {
return mPipContentOverlay == null ? null : mPipContentOverlay.getLeash();
@@ -430,13 +446,22 @@
return this;
}
+ public Builder setDisplayCutoutInsets(@NonNull Rect displayCutoutInsets) {
+ mDisplayCutoutInsets = new Rect(displayCutoutInsets);
+ return this;
+ }
+
public SwipePipToHomeAnimator build() {
if (mDestinationBoundsTransformed.isEmpty()) {
mDestinationBoundsTransformed.set(mDestinationBounds);
}
// adjust the mSourceRectHint / mAppBounds by display cutout if applicable.
if (mSourceRectHint != null && mDisplayCutoutInsets != null) {
- if (mFromRotation == Surface.ROTATION_90) {
+ if (mFromRotation == Surface.ROTATION_0) {
+ // TODO: this is to special case the issues on Foldable device
+ // with display cutout.
+ mSourceRectHint.offset(mDisplayCutoutInsets.left, mDisplayCutoutInsets.top);
+ } else if (mFromRotation == Surface.ROTATION_90) {
mSourceRectHint.offset(mDisplayCutoutInsets.left, mDisplayCutoutInsets.top);
} else if (mFromRotation == Surface.ROTATION_270) {
mAppBounds.inset(mDisplayCutoutInsets);
@@ -450,15 +475,6 @@
}
}
- private static class RotatedPosition {
- private final float degree;
- private final float positionX;
- private final float positionY;
-
- private RotatedPosition(float degree, float positionX, float positionY) {
- this.degree = degree;
- this.positionX = positionX;
- this.positionY = positionY;
- }
+ private record RotatedPosition(float degree, float positionX, float positionY) {
}
}
diff --git a/quickstep/src/com/android/quickstep/util/SystemUiFlagUtils.kt b/quickstep/src/com/android/quickstep/util/SystemUiFlagUtils.kt
new file mode 100644
index 0000000..5f4388c
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/SystemUiFlagUtils.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util
+
+import com.android.systemui.shared.system.QuickStepContract
+import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags
+
+/** Util class for holding and checking [SystemUiStateFlags] masks. */
+object SystemUiFlagUtils {
+ const val KEYGUARD_SYSUI_FLAGS =
+ (QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING or
+ QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING or
+ QuickStepContract.SYSUI_STATE_DEVICE_DOZING or
+ QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED or
+ QuickStepContract.SYSUI_STATE_HOME_DISABLED or
+ QuickStepContract.SYSUI_STATE_BACK_DISABLED or
+ QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED or
+ QuickStepContract.SYSUI_STATE_WAKEFULNESS_MASK)
+
+ // If any of these SysUi flags (via QuickstepContract) is set, the device to be considered
+ // locked.
+ private const val MASK_ANY_SYSUI_LOCKED =
+ (QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING or
+ QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING or
+ QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED or
+ QuickStepContract.SYSUI_STATE_DEVICE_DREAMING)
+
+ /**
+ * Returns true iff the given [SystemUiStateFlags] imply that the device is considered locked.
+ */
+ @JvmStatic
+ fun isLocked(@SystemUiStateFlags flags: Long): Boolean {
+ return hasAnyFlag(flags, MASK_ANY_SYSUI_LOCKED) &&
+ !hasAnyFlag(flags, QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY)
+ }
+
+ private fun hasAnyFlag(@SystemUiStateFlags flags: Long, flagMask: Long): Boolean {
+ return (flags and flagMask) != 0L
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java
index 3756b4a..d74473c 100644
--- a/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java
+++ b/quickstep/src/com/android/quickstep/util/TabletSplitToConfirmTimings.java
@@ -27,6 +27,8 @@
public int getPlaceholderIconFadeInEnd() { return 250; }
public int getStagedRectSlideStart() { return 0; }
public int getStagedRectSlideEnd() { return 500; }
+ public int getBackingScrimFadeInStart() { return 0; }
+ public int getBackingScrimFadeInEnd() { return 400; }
public int getDuration() { return TABLET_CONFIRM_DURATION; }
}
diff --git a/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java b/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java
index 21c9e09..69137cc 100644
--- a/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java
+++ b/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java
@@ -37,7 +37,7 @@
* @param <V> Type of object stored in the cache
*/
public class TaskKeyByLastActiveTimeCache<V> implements TaskKeyCache<V> {
- private static final String TAG = TaskKeyByLastActiveTimeCache.class.getSimpleName();
+ private static final String TAG = "TaskKeyByLastActiveTimeCache";
private final AtomicInteger mMaxSize;
private final Map<Integer, Entry<V>> mMap;
// To sort task id by last active time
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index fcb865f..e5c54bb 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -27,7 +27,6 @@
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation;
import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation;
-import static com.android.quickstep.util.SplitScreenUtils.convertLauncherSplitBoundsToShell;
import android.animation.TimeInterpolator;
import android.content.Context;
@@ -172,7 +171,6 @@
mTaskRect.set(mFullTaskSize);
mOrientationState.getOrientationHandler()
.setSplitTaskSwipeRect(mDp, mTaskRect, mSplitBounds, mStagePosition);
- mTaskRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
} else if (mIsDesktopTask) {
// For desktop, tasks can take up only part of the screen size.
// Full task size represents the whole screen size, but scaled down to fit in recents.
@@ -186,10 +184,19 @@
mTaskRect.scale(scale);
// Ensure the task rect is inside the full task rect
mTaskRect.offset(mFullTaskSize.left, mFullTaskSize.top);
+
+ Rect taskDimension = new Rect(0, 0, (int) fullscreenTaskDimension.x,
+ (int) fullscreenTaskDimension.y);
+ mTmpCropRect.set(mThumbnailPosition);
+ if (mTmpCropRect.setIntersect(taskDimension, mThumbnailPosition)) {
+ mTmpCropRect.offset(-mThumbnailPosition.left, -mThumbnailPosition.top);
+ } else {
+ mTmpCropRect.setEmpty();
+ }
} else {
mTaskRect.set(mFullTaskSize);
- mTaskRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
}
+ mTaskRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
}
/**
@@ -245,10 +252,8 @@
if (mSplitBounds == null) {
mStagePosition = STAGE_POSITION_UNDEFINED;
} else {
- mStagePosition = mThumbnailPosition.equals(splitInfo.leftTopBounds)
+ mStagePosition = runningTarget.taskId == splitInfo.leftTopTaskId
? STAGE_POSITION_TOP_OR_LEFT : STAGE_POSITION_BOTTOM_OR_RIGHT;
- mPositionHelper.setSplitBounds(convertLauncherSplitBoundsToShell(mSplitBounds),
- mStagePosition);
}
calculateTaskSize();
}
@@ -489,10 +494,12 @@
recentsViewPrimaryTranslation.value);
applyWindowToHomeRotation(mMatrix);
- // Crop rect is the inverse of thumbnail matrix
- mTempRectF.set(0, 0, taskWidth, taskHeight);
- mInversePositionMatrix.mapRect(mTempRectF);
- mTempRectF.roundOut(mTmpCropRect);
+ if (!mIsDesktopTask) {
+ // Crop rect is the inverse of thumbnail matrix
+ mTempRectF.set(0, 0, taskWidth, taskHeight);
+ mInversePositionMatrix.mapRect(mTempRectF);
+ mTempRectF.roundOut(mTmpCropRect);
+ }
params.setProgress(1f - fullScreenProgress);
params.applySurfaceParams(surfaceTransaction == null
@@ -551,7 +558,7 @@
* TaskView
*/
public float getCurrentCornerRadius() {
- float visibleRadius = mCurrentFullscreenParams.mCurrentDrawnCornerRadius;
+ float visibleRadius = mCurrentFullscreenParams.getCurrentDrawnCornerRadius();
mTempPoint[0] = visibleRadius;
mTempPoint[1] = 0;
mInversePositionMatrix.mapVectors(mTempPoint);
diff --git a/quickstep/src/com/android/quickstep/util/TaskVisualsChangeListener.java b/quickstep/src/com/android/quickstep/util/TaskVisualsChangeListener.java
index 66bff73..519ef60 100644
--- a/quickstep/src/com/android/quickstep/util/TaskVisualsChangeListener.java
+++ b/quickstep/src/com/android/quickstep/util/TaskVisualsChangeListener.java
@@ -16,6 +16,7 @@
package com.android.quickstep.util;
+import android.annotation.NonNull;
import android.os.UserHandle;
import com.android.systemui.shared.recents.model.Task;
@@ -36,7 +37,7 @@
/**
* Called when the icon for a task changes
*/
- default void onTaskIconChanged(String pkg, UserHandle user) {}
+ default void onTaskIconChanged(@NonNull String pkg, @NonNull UserHandle user) {}
/**
* Called when the icon for a task changes
diff --git a/quickstep/src/com/android/quickstep/util/TriggerSwipeUpTouchTracker.java b/quickstep/src/com/android/quickstep/util/TriggerSwipeUpTouchTracker.java
index c63a58e..671b2ea 100644
--- a/quickstep/src/com/android/quickstep/util/TriggerSwipeUpTouchTracker.java
+++ b/quickstep/src/com/android/quickstep/util/TriggerSwipeUpTouchTracker.java
@@ -99,6 +99,7 @@
if (mDisableHorizontalSwipe
&& Math.abs(displacementX) > Math.abs(displacementY)) {
// Horizontal gesture is not allowed in this region
+ mOnSwipeUp.onSwipeUpCancelled();
endTouchTracking();
break;
}
@@ -111,6 +112,7 @@
}
case ACTION_CANCEL:
+ mOnSwipeUp.onSwipeUpCancelled();
endTouchTracking();
break;
diff --git a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterHotseatAnimator.java b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterHotseatAnimator.java
index 4aea1b8..a740e0b 100644
--- a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterHotseatAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterHotseatAnimator.java
@@ -21,6 +21,7 @@
import com.android.launcher3.Hotseat;
import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.updates.RotationChangeProvider;
/**
@@ -30,8 +31,9 @@
private final QuickstepLauncher mLauncher;
- public UnfoldMoveFromCenterHotseatAnimator(QuickstepLauncher launcher,
- WindowManager windowManager, RotationChangeProvider rotationChangeProvider) {
+ public UnfoldMoveFromCenterHotseatAnimator(
+ QuickstepLauncher launcher, WindowManager windowManager,
+ @UnfoldMain RotationChangeProvider rotationChangeProvider) {
super(windowManager, rotationChangeProvider);
mLauncher = launcher;
}
diff --git a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
index 0ec3ae0..6e330bb 100644
--- a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
@@ -22,6 +22,7 @@
import com.android.launcher3.ShortcutAndWidgetContainer;
import com.android.launcher3.Workspace;
import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.updates.RotationChangeProvider;
/**
@@ -31,8 +32,9 @@
private final QuickstepLauncher mLauncher;
- public UnfoldMoveFromCenterWorkspaceAnimator(QuickstepLauncher launcher,
- WindowManager windowManager, RotationChangeProvider rotationChangeProvider) {
+ public UnfoldMoveFromCenterWorkspaceAnimator(
+ QuickstepLauncher launcher, WindowManager windowManager,
+ @UnfoldMain RotationChangeProvider rotationChangeProvider) {
super(windowManager, rotationChangeProvider);
mLauncher = launcher;
}
diff --git a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java b/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java
deleted file mode 100644
index 6a9a268..0000000
--- a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.views;
-
-import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE;
-import static com.android.app.animation.Interpolators.LINEAR;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-import android.animation.ValueAnimator;
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.LinearLayout;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.Launcher;
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.uioverrides.QuickstepLauncher;
-
-/**
- * Floating view show on launcher home screen that notifies the user that an app will be launched to
- * the desktop.
- */
-public class DesktopAppSelectView extends LinearLayout {
-
- private static final int SHOW_INITIAL_HEIGHT_DP = 7;
- private static final int SHOW_CONTAINER_SCALE_DURATION = 333;
- private static final int SHOW_CONTAINER_ALPHA_DURATION = 83;
- private static final int SHOW_CONTENT_ALPHA_DELAY = 67;
- private static final int SHOW_CONTENT_ALPHA_DURATION = 83;
- private static final int HIDE_DURATION = 83;
-
- private final RecentsViewContainer mContainer;
-
- private View mText;
- private View mCloseButton;
- @Nullable
- private Runnable mOnCloseCallback;
- private AnimatorSet mShowAnimation;
- private Animator mHideAnimation;
-
- public DesktopAppSelectView(Context context) {
- this(context, null);
- }
-
- public DesktopAppSelectView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public DesktopAppSelectView(Context context, AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, 0);
- }
-
- public DesktopAppSelectView(Context context, AttributeSet attrs, int defStyleAttr,
- int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- mContainer = RecentsViewContainer.containerFromContext(context);
- }
-
- /**
- * Show the popup on launcher home screen
- *
- * @param onCloseCallback optional callback that is called when user clicks the close button
- * @return the created view
- */
- public static DesktopAppSelectView show(Launcher launcher, @Nullable Runnable onCloseCallback) {
- DesktopAppSelectView view = (DesktopAppSelectView) launcher.getLayoutInflater().inflate(
- R.layout.floating_desktop_app_select, launcher.getDragLayer(), false);
- view.setOnCloseClickCallback(onCloseCallback);
- view.show();
- return view;
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mText = findViewById(R.id.desktop_app_select_text);
- mCloseButton = findViewById(R.id.close_button);
- mCloseButton.setOnClickListener(v -> {
- if (mHideAnimation == null) {
- hide();
- if (mOnCloseCallback != null) {
- mOnCloseCallback.run();
- }
- }
- });
- }
-
- private void show() {
- mContainer.getDragLayer().addView(this);
-
- // Set up initial values
- getBackground().setAlpha(0);
- mText.setAlpha(0);
- mCloseButton.setAlpha(0);
- int initialHeightPx = Utilities.dpToPx(SHOW_INITIAL_HEIGHT_DP);
- int finalHeight = getResources().getDimensionPixelSize(
- R.dimen.desktop_mode_floating_app_select_height);
- float initialScale = initialHeightPx / (float) finalHeight;
- setScaleY(initialScale);
- setPivotY(0);
-
- // Animate the container
- ValueAnimator containerBackground = ValueAnimator.ofInt(0, 255);
- containerBackground.addUpdateListener(
- animation -> getBackground().setAlpha((Integer) animation.getAnimatedValue()));
- containerBackground.setDuration(SHOW_CONTAINER_ALPHA_DURATION);
- containerBackground.setInterpolator(LINEAR);
-
- ObjectAnimator containerSize = ObjectAnimator.ofFloat(this, SCALE_Y, 1f);
- containerSize.setDuration(SHOW_CONTAINER_SCALE_DURATION);
- containerSize.setInterpolator(EMPHASIZED_DECELERATE);
-
- // Animate the contents
- ObjectAnimator textAlpha = ObjectAnimator.ofFloat(mText, ALPHA, 1);
- ObjectAnimator buttonAlpha = ObjectAnimator.ofFloat(mCloseButton, ALPHA, 1);
- AnimatorSet contentAlpha = new AnimatorSet();
- contentAlpha.playTogether(textAlpha, buttonAlpha);
- contentAlpha.setStartDelay(SHOW_CONTENT_ALPHA_DELAY);
- contentAlpha.setDuration(SHOW_CONTENT_ALPHA_DURATION);
- contentAlpha.setInterpolator(LINEAR);
-
- // Start the animation
- mShowAnimation = new AnimatorSet();
- mShowAnimation.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- mShowAnimation = null;
- }
- });
- mShowAnimation.playTogether(containerBackground, containerSize, contentAlpha);
- mShowAnimation.start();
- }
-
- /**
- * Hide the floating view
- */
- public void hide() {
- if (mShowAnimation != null) {
- mShowAnimation.cancel();
- }
- mHideAnimation = ObjectAnimator.ofFloat(this, ALPHA, 0);
- mHideAnimation.setDuration(HIDE_DURATION).setInterpolator(LINEAR);
- mHideAnimation.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- mContainer.getDragLayer().removeView(DesktopAppSelectView.this);
- mHideAnimation = null;
- }
- });
- mHideAnimation.start();
- }
-
- /**
- * Add a callback that is called when close button is clicked
- */
- public void setOnCloseClickCallback(@Nullable Runnable callback) {
- mOnCloseCallback = callback;
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java
deleted file mode 100644
index e797819..0000000
--- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.views;
-
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
-
-import static com.android.launcher3.LauncherState.BACKGROUND_APP;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
-
-import android.content.Context;
-import android.graphics.Point;
-import android.graphics.PointF;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
-import android.graphics.drawable.ShapeDrawable;
-import android.graphics.drawable.shapes.RoundRectShape;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.util.SparseArray;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.desktop.DesktopRecentsTransitionController;
-import com.android.launcher3.util.CancellableTask;
-import com.android.launcher3.util.RunnableList;
-import com.android.quickstep.BaseContainerInterface;
-import com.android.quickstep.RecentsModel;
-import com.android.quickstep.TaskThumbnailCache;
-import com.android.quickstep.util.RecentsOrientedState;
-import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.QuickStepContract;
-
-import kotlin.Unit;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.function.Consumer;
-
-/**
- * TaskView that contains all tasks that are part of the desktop.
- */
-// TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks.
-public class DesktopTaskView extends TaskView {
-
- private static final String TAG = DesktopTaskView.class.getSimpleName();
-
- private static final boolean DEBUG = false;
-
- @NonNull
- private List<Task> mTasks = new ArrayList<>();
-
- private final ArrayList<TaskThumbnailViewDeprecated> mSnapshotViews = new ArrayList<>();
-
- /** Maps {@code taskIds} to corresponding {@link TaskThumbnailViewDeprecated}s */
- private final SparseArray<TaskThumbnailViewDeprecated> mSnapshotViewMap = new SparseArray<>();
-
- private final ArrayList<CancellableTask<?>> mPendingThumbnailRequests = new ArrayList<>();
-
- private final TaskView.FullscreenDrawParams mSnapshotDrawParams;
-
- private View mBackgroundView;
-
- private int mChildCountAtInflation;
-
- private final PointF mTempPointF = new PointF();
-
- public DesktopTaskView(Context context) {
- this(context, null);
- }
-
- public DesktopTaskView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public DesktopTaskView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
-
- mSnapshotDrawParams = new FullscreenDrawParams(context) {
- @Override
- public float computeTaskCornerRadius(Context context) {
- return QuickStepContract.getWindowCornerRadius(context);
- }
-
- @Override
- public float computeWindowCornerRadius(Context context) {
- return QuickStepContract.getWindowCornerRadius(context);
- }
- };
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- mBackgroundView = findViewById(R.id.background);
-
- int topMarginPx =
- mContainer.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
- FrameLayout.LayoutParams params = (LayoutParams) mBackgroundView.getLayoutParams();
- params.topMargin = topMarginPx;
- mBackgroundView.setLayoutParams(params);
-
- float[] outerRadii = new float[8];
- Arrays.fill(outerRadii, getTaskCornerRadius());
- RoundRectShape shape = new RoundRectShape(outerRadii, null, null);
- ShapeDrawable background = new ShapeDrawable(shape);
- background.setTint(getResources().getColor(android.R.color.system_neutral2_300,
- getContext().getTheme()));
- mBackgroundView.setBackground(background);
-
- Drawable icon = getResources().getDrawable(R.drawable.ic_desktop, getContext().getTheme());
- Drawable iconBackground = getResources().getDrawable(R.drawable.bg_circle,
- getContext().getTheme());
- setIcon(mIconView, new LayerDrawable(new Drawable[]{iconBackground, icon}));
-
- mChildCountAtInflation = getChildCount();
- }
-
- @Override
- protected Unit updateBorderBounds(@NonNull Rect bounds) {
- bounds.set(mBackgroundView.getLeft(), mBackgroundView.getTop(), mBackgroundView.getRight(),
- mBackgroundView.getBottom());
- return Unit.INSTANCE;
- }
-
- @Override
- public void bind(Task task, RecentsOrientedState orientedState) {
- bind(Collections.singletonList(task), orientedState);
- }
-
- /**
- * Updates this desktop task to the gives task list defined in {@code tasks}
- */
- public void bind(List<Task> tasks, RecentsOrientedState orientedState) {
- if (DEBUG) {
- StringBuilder sb = new StringBuilder();
- sb.append("bind tasks=").append(tasks.size()).append("\n");
- for (Task task : tasks) {
- sb.append(" key=").append(task.key).append("\n");
- }
- Log.d(TAG, sb.toString());
- }
- cancelPendingLoadTasks();
-
- mTasks = new ArrayList<>(tasks);
- mSnapshotViewMap.clear();
-
- // Ensure there are equal number of snapshot views and tasks.
- // More tasks than views, add views. More views than tasks, remove views.
- // TODO(b/251586230): use a ViewPool for creating TaskThumbnailViews
- if (mSnapshotViews.size() > mTasks.size()) {
- int diff = mSnapshotViews.size() - mTasks.size();
- for (int i = 0; i < diff; i++) {
- TaskThumbnailViewDeprecated snapshotView = mSnapshotViews.remove(0);
- removeView(snapshotView);
- }
- } else if (mSnapshotViews.size() < mTasks.size()) {
- int diff = mTasks.size() - mSnapshotViews.size();
- for (int i = 0; i < diff; i++) {
- TaskThumbnailViewDeprecated snapshotView =
- new TaskThumbnailViewDeprecated(getContext());
- mSnapshotViews.add(snapshotView);
- // Add snapshots from to position after the initial child views.
- addView(snapshotView, mChildCountAtInflation,
- new LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
- }
- }
-
- for (int i = 0; i < mTasks.size(); i++) {
- Task task = mTasks.get(i);
- TaskThumbnailViewDeprecated snapshotView = mSnapshotViews.get(i);
- snapshotView.bind(task);
- mSnapshotViewMap.put(task.key.id, snapshotView);
- }
-
- updateTaskIdContainer();
- updateTaskIdAttributeContainer();
-
- setOrientationState(orientedState);
- }
-
- private void updateTaskIdContainer() {
- mTaskIdContainer = new int[mTasks.size()];
- for (int i = 0; i < mTasks.size(); i++) {
- mTaskIdContainer[i] = mTasks.get(i).key.id;
- }
- }
-
- private void updateTaskIdAttributeContainer() {
- mTaskIdAttributeContainer = new TaskIdAttributeContainer[mTasks.size()];
- for (int i = 0; i < mTasks.size(); i++) {
- Task task = mTasks.get(i);
- TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.get(task.key.id);
- mTaskIdAttributeContainer[i] = createAttributeContainer(task, thumbnailView);
- }
- }
-
- private TaskIdAttributeContainer createAttributeContainer(Task task,
- TaskThumbnailViewDeprecated thumbnailView) {
- return new TaskIdAttributeContainer(task, thumbnailView, mIconView,
- STAGE_POSITION_UNDEFINED);
- }
-
- @Nullable
- @Override
- public Task getTask() {
- // TODO(b/249371338): returning first task. This won't work well with multiple tasks.
- return mTasks.size() > 0 ? mTasks.get(0) : null;
- }
-
- @Override
- public TaskThumbnailViewDeprecated getThumbnail() {
- // TODO(b/249371338): returning single thumbnail. This won't work well with multiple tasks.
- Task task = getTask();
- if (task != null) {
- return mSnapshotViewMap.get(task.key.id);
- }
- // Return the place holder snapshot views. Callers expect this to be non-null
- return mTaskThumbnailViewDeprecated;
- }
-
- @Override
- public void onTaskListVisibilityChanged(boolean visible, int changes) {
- cancelPendingLoadTasks();
- if (visible) {
- RecentsModel model = RecentsModel.INSTANCE.get(getContext());
- TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
-
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- for (Task task : mTasks) {
- CancellableTask<?> thumbLoadRequest =
- thumbnailCache.updateThumbnailInBackground(task, thumbnailData -> {
- TaskThumbnailViewDeprecated thumbnailView =
- mSnapshotViewMap.get(task.key.id);
- if (thumbnailView != null) {
- thumbnailView.setThumbnail(task, thumbnailData);
- }
- });
- if (thumbLoadRequest != null) {
- mPendingThumbnailRequests.add(thumbLoadRequest);
- }
- }
- }
- } else {
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- for (Task task : mTasks) {
- TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.get(task.key.id);
- if (thumbnailView != null) {
- thumbnailView.setThumbnail(null, null);
- }
- // Reset the task thumbnail ref
- task.thumbnail = null;
- }
- }
- }
- }
-
- @Override
- protected void setThumbnailOrientation(RecentsOrientedState orientationState) {
- // no-op
- }
-
- @Override
- protected void cancelPendingLoadTasks() {
- for (CancellableTask<?> cancellableTask : mPendingThumbnailRequests) {
- cancellableTask.cancel();
- }
- mPendingThumbnailRequests.clear();
- }
-
- @Nullable
- @Override
- public RunnableList launchTaskAnimated() {
- RunnableList endCallback = new RunnableList();
-
- RecentsView recentsView = getRecentsView();
- DesktopRecentsTransitionController recentsController =
- recentsView.getDesktopRecentsController();
- if (recentsController != null) {
- recentsController.launchDesktopFromRecents(this,
- success -> endCallback.executeAllAndDestroy());
- Log.d(TAG, "launchTaskAnimated - launchDesktopFromRecents: " + Arrays.toString(
- getTaskIds()));
- } else {
- Log.d(TAG, "launchTaskAnimated - recentsController is null: " + Arrays.toString(
- getTaskIds()));
- }
-
- // Callbacks get run from recentsView for case when recents animation already running
- recentsView.addSideTaskLaunchCallback(endCallback);
- return endCallback;
- }
-
- @Override
- public void launchTask(@NonNull Consumer<Boolean> callback, boolean isQuickswitch) {
- launchTasks();
- callback.accept(true);
- }
-
- @Override
- public boolean isDesktopTask() {
- return true;
- }
-
- @Override
- void refreshThumbnails(@Nullable HashMap<Integer, ThumbnailData> thumbnailDatas) {
- // Sets new thumbnails based on the incoming data and refreshes the rest.
- // Create a copy of the thumbnail map, so we can track thumbnails that need refreshing.
- SparseArray<TaskThumbnailViewDeprecated> thumbnailsToRefresh = mSnapshotViewMap.clone();
- if (thumbnailDatas != null) {
- for (Task task : mTasks) {
- int key = task.key.id;
- TaskThumbnailViewDeprecated thumbnailView = thumbnailsToRefresh.get(key);
- ThumbnailData thumbnailData = thumbnailDatas.get(key);
- if (thumbnailView != null && thumbnailData != null) {
- thumbnailView.setThumbnail(task, thumbnailData);
- // Remove this thumbnail from the list that should be refreshed.
- thumbnailsToRefresh.remove(key);
- }
- }
- }
-
- // Refresh the rest that were not updated.
- for (int i = 0; i < thumbnailsToRefresh.size(); i++) {
- thumbnailsToRefresh.valueAt(i).refresh();
- }
- }
-
- @Override
- public TaskThumbnailViewDeprecated[] getThumbnails() {
- TaskThumbnailViewDeprecated[] thumbnails =
- new TaskThumbnailViewDeprecated[mSnapshotViewMap.size()];
- for (int i = 0; i < thumbnails.length; i++) {
- thumbnails[i] = mSnapshotViewMap.valueAt(i);
- }
- return thumbnails;
- }
-
- @Override
- public void onRecycle() {
- resetPersistentViewTransforms();
- // Clear any references to the thumbnail (it will be re-read either from the cache or the
- // system on next bind)
- for (Task task : mTasks) {
- TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.get(task.key.id);
- if (thumbnailView != null) {
- thumbnailView.setThumbnail(task, null);
- }
- }
- setOverlayEnabled(false);
- onTaskListVisibilityChanged(false);
- setVisibility(VISIBLE);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int containerWidth = MeasureSpec.getSize(widthMeasureSpec);
- int containerHeight = MeasureSpec.getSize(heightMeasureSpec);
-
- setMeasuredDimension(containerWidth, containerHeight);
-
- int thumbnailTopMarginPx = mContainer.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
- containerHeight -= thumbnailTopMarginPx;
-
- int thumbnails = mSnapshotViewMap.size();
- if (thumbnails == 0) {
- return;
- }
-
- BaseContainerInterface.getTaskDimension(mContext, mContainer.getDeviceProfile(),
- mTempPointF);
- int windowWidth = (int) mTempPointF.x;
- int windowHeight = (int) mTempPointF.y;
-
- float scaleWidth = containerWidth / (float) windowWidth;
- float scaleHeight = containerHeight / (float) windowHeight;
-
- if (DEBUG) {
- Log.d(TAG,
- "onMeasure: container=[" + containerWidth + "," + containerHeight + "] window=["
- + windowWidth + "," + windowHeight + "] scale=[" + scaleWidth + ","
- + scaleHeight + "]");
- }
-
- // Desktop tile is a shrunk down version of launcher and freeform task thumbnails.
- for (int i = 0; i < mTasks.size(); i++) {
- Task task = mTasks.get(i);
- Rect taskSize = task.appBounds;
- if (taskSize == null) {
- // Default to quarter of the desktop if we did not get app bounds.
- taskSize = new Rect(0, 0, windowWidth / 4, windowHeight / 4);
- }
-
- int thumbWidth = (int) (taskSize.width() * scaleWidth);
- int thumbHeight = (int) (taskSize.height() * scaleHeight);
-
- TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.get(task.key.id);
- if (thumbnailView != null) {
- thumbnailView.measure(MeasureSpec.makeMeasureSpec(thumbWidth, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(thumbHeight, MeasureSpec.EXACTLY));
-
- // Position the task to the same position as it would be on the desktop
- Point positionInParent = task.positionInParent;
- if (positionInParent == null) {
- positionInParent = new Point(0, 0);
- }
- int taskX = (int) (positionInParent.x * scaleWidth);
- int taskY = (int) (positionInParent.y * scaleHeight);
- // move task down by margin size
- taskY += thumbnailTopMarginPx;
- thumbnailView.setX(taskX);
- thumbnailView.setY(taskY);
-
- if (DEBUG) {
- Log.d(TAG, "onMeasure: task=" + task.key + " thumb=[" + thumbWidth + ","
- + thumbHeight + "]" + " pos=[" + taskX + "," + taskY + "]");
- }
- }
- }
- }
-
- @Override
- public void setOverlayEnabled(boolean overlayEnabled) {
- // TODO(b/330685808) support overlay for Screenshot action
- }
-
- @Override
- public void setFullscreenProgress(float progress) {
- // TODO(b/249371338): this copies parent implementation and makes it work for N thumbs
- progress = Utilities.boundToRange(progress, 0, 1);
- mFullscreenProgress = progress;
- mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
- if (mFullscreenProgress > 0) {
- // Don't show background while we are transitioning to/from fullscreen
- mBackgroundView.setVisibility(INVISIBLE);
- } else {
- mBackgroundView.setVisibility(VISIBLE);
- }
- for (int i = 0; i < mSnapshotViewMap.size(); i++) {
- TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.valueAt(i);
- thumbnailView.getTaskOverlay().setFullscreenProgress(progress);
- }
- // Animate icons and DWB banners in/out, except in QuickSwitch state, when tiles are
- // oversized and banner would look disproportionately large.
- if (mContainer.<RecentsView<?, ?>>getOverviewPanel().getStateManager().getState()
- != BACKGROUND_APP) {
- setIconsAndBannersTransitionProgress(progress, true);
- }
- updateSnapshotRadius();
- }
-
- @Override
- protected void updateSnapshotRadius() {
- super.updateSnapshotRadius();
- for (int i = 0; i < mSnapshotViewMap.size(); i++) {
- if (i == 0) {
- // All snapshots share the same params. Only update it with the first snapshot.
- updateFullscreenParams(mSnapshotDrawParams);
- }
- mSnapshotViewMap.valueAt(i).setFullscreenParams(mSnapshotDrawParams);
- }
- }
-
- @Override
- public void setColorTint(float amount, int tintColor) {
- for (int i = 0; i < mSnapshotViewMap.size(); i++) {
- mSnapshotViewMap.valueAt(i).setDimAlpha(amount);
- }
- }
-
- @Override
- protected void applyThumbnailSplashAlpha() {
- for (int i = 0; i < mSnapshotViewMap.size(); i++) {
- mSnapshotViewMap.valueAt(i).setSplashAlpha(mTaskThumbnailSplashAlpha);
- }
- }
-
- @Override
- void setThumbnailVisibility(int visibility, int taskId) {
- for (int i = 0; i < mSnapshotViewMap.size(); i++) {
- mSnapshotViewMap.valueAt(i).setVisibility(visibility);
- }
- }
-
- @Override
- protected boolean confirmSecondSplitSelectApp() {
- // Desktop tile can't be in split screen
- return false;
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt
new file mode 100644
index 0000000..41add54
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt
@@ -0,0 +1,305 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.views
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.graphics.Point
+import android.graphics.PointF
+import android.graphics.Rect
+import android.graphics.drawable.ShapeDrawable
+import android.graphics.drawable.shapes.RoundRectShape
+import android.util.AttributeSet
+import android.util.Log
+import android.view.Gravity
+import android.view.LayoutInflater
+import android.view.View
+import androidx.core.content.res.ResourcesCompat
+import androidx.core.view.updateLayoutParams
+import com.android.launcher3.Flags.enableRefactorTaskThumbnail
+import com.android.launcher3.R
+import com.android.launcher3.testing.TestLogging
+import com.android.launcher3.testing.shared.TestProtocol
+import com.android.launcher3.util.RunnableList
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.launcher3.util.TransformingTouchDelegate
+import com.android.launcher3.util.ViewPool
+import com.android.launcher3.util.rects.set
+import com.android.quickstep.BaseContainerInterface
+import com.android.quickstep.TaskOverlayFactory
+import com.android.quickstep.util.RecentsOrientedState
+import com.android.systemui.shared.recents.model.Task
+
+/** TaskView that contains all tasks that are part of the desktop. */
+class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
+ TaskView(context, attrs, type = TaskViewType.DESKTOP) {
+
+ private val snapshotDrawParams =
+ object : FullscreenDrawParams(context) {
+ // DesktopTaskView thumbnail's corner radius is independent of fullscreenProgress.
+ override fun computeTaskCornerRadius(context: Context) =
+ computeWindowCornerRadius(context)
+ }
+ private val taskThumbnailViewDeprecatedPool =
+ ViewPool<TaskThumbnailViewDeprecated>(
+ context,
+ this,
+ R.layout.task_thumbnail_deprecated,
+ VIEW_POOL_MAX_SIZE,
+ VIEW_POOL_INITIAL_SIZE
+ )
+ private val tempPointF = PointF()
+ private val tempRect = Rect()
+ private lateinit var backgroundView: View
+ private lateinit var iconView: TaskViewIcon
+ private var childCountAtInflation = 0
+
+ override fun onFinishInflate() {
+ super.onFinishInflate()
+ backgroundView =
+ findViewById<View>(R.id.background)!!.apply {
+ updateLayoutParams<LayoutParams> {
+ topMargin = container.deviceProfile.overviewTaskThumbnailTopMarginPx
+ }
+ background =
+ ShapeDrawable(RoundRectShape(FloatArray(8) { taskCornerRadius }, null, null))
+ .apply {
+ setTint(
+ resources.getColor(
+ android.R.color.system_neutral2_300,
+ context.theme
+ )
+ )
+ }
+ }
+ iconView =
+ getOrInflateIconView(R.id.icon).apply {
+ setIcon(
+ this,
+ ResourcesCompat.getDrawable(
+ context.resources,
+ R.drawable.ic_desktop_with_bg,
+ context.theme
+ )
+ )
+ setText(resources.getText(R.string.recent_task_desktop))
+ }
+ childCountAtInflation = childCount
+ }
+
+ /** Updates this desktop task to the gives task list defined in `tasks` */
+ fun bind(
+ tasks: List<Task>,
+ orientedState: RecentsOrientedState,
+ taskOverlayFactory: TaskOverlayFactory
+ ) {
+ if (DEBUG) {
+ val sb = StringBuilder()
+ sb.append("bind tasks=").append(tasks.size).append("\n")
+ tasks.forEach { sb.append(" key=${it.key}\n") }
+ Log.d(TAG, sb.toString())
+ }
+ cancelPendingLoadTasks()
+ taskContainers =
+ tasks.map { task ->
+ val snapshotView =
+ if (enableRefactorTaskThumbnail()) {
+ LayoutInflater.from(context).inflate(R.layout.task_thumbnail, this, false)
+ } else {
+ taskThumbnailViewDeprecatedPool.view
+ }
+
+ addView(
+ snapshotView,
+ // Add snapshotView to the front after initial views e.g. icon and
+ // background.
+ childCountAtInflation
+ )
+ TaskContainer(
+ this,
+ task,
+ snapshotView,
+ iconView,
+ TransformingTouchDelegate(iconView.asView()),
+ SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
+ digitalWellBeingToast = null,
+ showWindowsView = null,
+ taskOverlayFactory
+ )
+ }
+ taskContainers.forEach { it.bind() }
+ setOrientationState(orientedState)
+ }
+
+ override fun onRecycle() {
+ super.onRecycle()
+ visibility = VISIBLE
+ taskContainers.forEach {
+ if (!enableRefactorTaskThumbnail()) {
+ removeView(it.thumbnailViewDeprecated)
+ taskThumbnailViewDeprecatedPool.recycle(it.thumbnailViewDeprecated)
+ }
+ }
+ }
+
+ @SuppressLint("RtlHardcoded")
+ override fun updateTaskSize(
+ lastComputedTaskSize: Rect,
+ lastComputedGridTaskSize: Rect,
+ lastComputedCarouselTaskSize: Rect
+ ) {
+ super.updateTaskSize(
+ lastComputedTaskSize,
+ lastComputedGridTaskSize,
+ lastComputedCarouselTaskSize
+ )
+ if (taskContainers.isEmpty()) {
+ return
+ }
+
+ val thumbnailTopMarginPx = container.deviceProfile.overviewTaskThumbnailTopMarginPx
+
+ val containerWidth = layoutParams.width
+ val containerHeight = layoutParams.height - thumbnailTopMarginPx
+
+ BaseContainerInterface.getTaskDimension(mContext, container.deviceProfile, tempPointF)
+
+ val windowWidth = tempPointF.x.toInt()
+ val windowHeight = tempPointF.y.toInt()
+ val scaleWidth = containerWidth / windowWidth.toFloat()
+ val scaleHeight = containerHeight / windowHeight.toFloat()
+
+ if (DEBUG) {
+ Log.d(
+ TAG,
+ "onMeasure: container=[$containerWidth,$containerHeight]" +
+ "window=[$windowWidth,$windowHeight] scale=[$scaleWidth,$scaleHeight]"
+ )
+ }
+
+ // Desktop tile is a shrunk down version of launcher and freeform task thumbnails.
+ taskContainers.forEach {
+ // Default to quarter of the desktop if we did not get app bounds.
+ val taskSize =
+ it.task.appBounds
+ ?: tempRect.apply {
+ left = 0
+ top = 0
+ right = windowWidth / 4
+ bottom = windowHeight / 4
+ }
+ val positionInParent = it.task.positionInParent ?: ORIGIN
+
+ // Position the task to the same position as it would be on the desktop
+ it.snapshotView.updateLayoutParams<LayoutParams> {
+ gravity = Gravity.LEFT or Gravity.TOP
+ width = (taskSize.width() * scaleWidth).toInt()
+ height = (taskSize.height() * scaleHeight).toInt()
+ leftMargin = (positionInParent.x * scaleWidth).toInt()
+ topMargin =
+ (positionInParent.y * scaleHeight).toInt() +
+ container.deviceProfile.overviewTaskThumbnailTopMarginPx
+ }
+ if (DEBUG) {
+ with(it.snapshotView.layoutParams as LayoutParams) {
+ Log.d(
+ TAG,
+ "onMeasure: task=${it.task.key} size=[$width,$height]" +
+ " margin=[$leftMargin,$topMargin]"
+ )
+ }
+ }
+ }
+ }
+
+ override fun needsUpdate(dataChange: Int, flag: Int) =
+ if (flag == FLAG_UPDATE_CORNER_RADIUS) false else super.needsUpdate(dataChange, flag)
+
+ override fun onIconLoaded(taskContainer: TaskContainer) {
+ // Update contentDescription of snapshotView only, individual task icon is unused.
+ taskContainer.snapshotView.contentDescription = taskContainer.task.titleDescription
+ }
+
+ // Ignoring [onIconUnloaded] as all tasks shares the same Desktop icon
+ override fun onIconUnloaded(taskContainer: TaskContainer) {}
+
+ // thumbnailView is laid out differently and is handled in onMeasure
+ override fun updateThumbnailSize() {}
+
+ override fun getThumbnailBounds(bounds: Rect, relativeToDragLayer: Boolean) {
+ if (relativeToDragLayer) {
+ container.dragLayer.getDescendantRectRelativeToSelf(backgroundView, bounds)
+ } else {
+ bounds.set(backgroundView)
+ }
+ }
+
+ private fun launchTaskWithDesktopController(animated: Boolean): RunnableList? {
+ val recentsView = recentsView ?: return null
+ TestLogging.recordEvent(
+ TestProtocol.SEQUENCE_MAIN,
+ "launchDesktopFromRecents",
+ taskIds.contentToString()
+ )
+ val endCallback = RunnableList()
+ val desktopController = recentsView.desktopRecentsController
+ checkNotNull(desktopController) { "recentsController is null" }
+ desktopController.launchDesktopFromRecents(this, animated) {
+ endCallback.executeAllAndDestroy()
+ }
+ Log.d(
+ TAG,
+ "launchTaskAnimated - launchTaskWithDesktopController: ${taskIds.contentToString()}, withRemoteTransition: $animated"
+ )
+
+ // Callbacks get run from recentsView for case when recents animation already running
+ recentsView.addSideTaskLaunchCallback(endCallback)
+ return endCallback
+ }
+
+ override fun launchTaskAnimated() = launchTaskWithDesktopController(animated = true)
+
+ override fun launchTask(callback: (launched: Boolean) -> Unit, isQuickSwitch: Boolean) {
+ launchTaskWithDesktopController(animated = false)?.add { callback(true) } ?: callback(false)
+ }
+
+ // Desktop tile can't be in split screen
+ override fun confirmSecondSplitSelectApp(): Boolean = false
+
+ // TODO(b/330685808) support overlay for Screenshot action
+ override fun setOverlayEnabled(overlayEnabled: Boolean) {}
+
+ override fun onFullscreenProgressChanged(fullscreenProgress: Float) {
+ backgroundView.alpha = 1 - fullscreenProgress
+ }
+
+ override fun updateCurrentFullscreenParams() {
+ super.updateCurrentFullscreenParams()
+ updateFullscreenParams(snapshotDrawParams)
+ }
+
+ override fun getThumbnailFullscreenParams() = snapshotDrawParams
+
+ companion object {
+ private const val TAG = "DesktopTaskView"
+ private const val DEBUG = false
+ private const val VIEW_POOL_MAX_SIZE = 10
+
+ // As DesktopTaskView is inflated in background, use initialSize=0 to avoid initPool.
+ private const val VIEW_POOL_INITIAL_SIZE = 0
+ private val ORIGIN = Point(0, 0)
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
deleted file mode 100644
index 82ba30b..0000000
--- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.views;
-
-import static android.provider.Settings.ACTION_APP_USAGE_SETTINGS;
-
-import static com.android.launcher3.Utilities.prefixTextWithIcon;
-import static com.android.launcher3.util.Executors.ORDERED_BG_EXECUTOR;
-
-import android.app.ActivityOptions;
-import android.content.ActivityNotFoundException;
-import android.content.Intent;
-import android.content.pm.LauncherApps;
-import android.content.pm.LauncherApps.AppUsageLimit;
-import android.graphics.Outline;
-import android.graphics.Paint;
-import android.icu.text.MeasureFormat;
-import android.icu.text.MeasureFormat.FormatWidth;
-import android.icu.util.Measure;
-import android.icu.util.MeasureUnit;
-import android.os.UserHandle;
-import android.util.Log;
-import android.util.Pair;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewOutlineProvider;
-import android.widget.FrameLayout;
-import android.widget.TextView;
-
-import androidx.annotation.IntDef;
-import androidx.annotation.Nullable;
-import androidx.annotation.StringRes;
-
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
-import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
-import com.android.systemui.shared.recents.model.Task;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.time.Duration;
-import java.util.Locale;
-
-public final class DigitalWellBeingToast {
-
- private static final float THRESHOLD_LEFT_ICON_ONLY = 0.4f;
- private static final float THRESHOLD_RIGHT_ICON_ONLY = 0.6f;
-
- /** Will span entire width of taskView with full text */
- private static final int SPLIT_BANNER_FULLSCREEN = 0;
- /** Used for grid task view, only showing icon and time */
- private static final int SPLIT_GRID_BANNER_LARGE = 1;
- /** Used for grid task view, only showing icon */
- private static final int SPLIT_GRID_BANNER_SMALL = 2;
- @IntDef(value = {
- SPLIT_BANNER_FULLSCREEN,
- SPLIT_GRID_BANNER_LARGE,
- SPLIT_GRID_BANNER_SMALL,
- })
- @Retention(RetentionPolicy.SOURCE)
- @interface SPLIT_BANNER_CONFIG{}
-
- static final Intent OPEN_APP_USAGE_SETTINGS_TEMPLATE = new Intent(ACTION_APP_USAGE_SETTINGS);
- static final int MINUTE_MS = 60000;
-
- private static final String TAG = DigitalWellBeingToast.class.getSimpleName();
-
- private final RecentsViewContainer mContainer;
- private final TaskView mTaskView;
- private final LauncherApps mLauncherApps;
-
- private Task mTask;
- private boolean mHasLimit;
-
- private long mAppUsageLimitTimeMs;
- private long mAppRemainingTimeMs;
- @Nullable
- private View mBanner;
- private ViewOutlineProvider mOldBannerOutlineProvider;
- private float mBannerOffsetPercentage;
- @Nullable
- private SplitBounds mSplitBounds;
- private int mSplitBannerConfig = SPLIT_BANNER_FULLSCREEN;
- private float mSplitOffsetTranslationY;
- private float mSplitOffsetTranslationX;
-
- public DigitalWellBeingToast(RecentsViewContainer container, TaskView taskView) {
- mContainer = container;
- mTaskView = taskView;
- mLauncherApps = container.asContext().getSystemService(LauncherApps.class);
- }
-
- private void setNoLimit() {
- mHasLimit = false;
- mTaskView.setContentDescription(mTask.titleDescription);
- replaceBanner(null);
- mAppUsageLimitTimeMs = -1;
- mAppRemainingTimeMs = -1;
- }
-
- private void setLimit(long appUsageLimitTimeMs, long appRemainingTimeMs) {
- mAppUsageLimitTimeMs = appUsageLimitTimeMs;
- mAppRemainingTimeMs = appRemainingTimeMs;
- mHasLimit = true;
- TextView toast = mContainer.getViewCache().getView(R.layout.digital_wellbeing_toast,
- mContainer.asContext(), mTaskView);
- toast.setText(prefixTextWithIcon(mContainer.asContext(), R.drawable.ic_hourglass_top,
- getText()));
- toast.setOnClickListener(this::openAppUsageSettings);
- replaceBanner(toast);
-
- mTaskView.setContentDescription(
- getContentDescriptionForTask(mTask, appUsageLimitTimeMs, appRemainingTimeMs));
- }
-
- public String getText() {
- return getText(mAppRemainingTimeMs, false /* forContentDesc */);
- }
-
- public boolean hasLimit() {
- return mHasLimit;
- }
-
- public void initialize(Task task) {
- mAppUsageLimitTimeMs = mAppRemainingTimeMs = -1;
- mTask = task;
- ORDERED_BG_EXECUTOR.execute(() -> {
- AppUsageLimit usageLimit = null;
- try {
- usageLimit = mLauncherApps.getAppUsageLimit(
- mTask.getTopComponent().getPackageName(),
- UserHandle.of(mTask.key.userId));
- } catch (Exception e) {
- Log.e(TAG, "Error initializing digital well being toast", e);
- }
- final long appUsageLimitTimeMs =
- usageLimit != null ? usageLimit.getTotalUsageLimit() : -1;
- final long appRemainingTimeMs =
- usageLimit != null ? usageLimit.getUsageRemaining() : -1;
-
- mTaskView.post(() -> {
- if (appUsageLimitTimeMs < 0 || appRemainingTimeMs < 0) {
- setNoLimit();
- } else {
- setLimit(appUsageLimitTimeMs, appRemainingTimeMs);
- }
- });
-
- }
- );
- }
-
- public void setSplitConfiguration(SplitBounds splitBounds) {
- mSplitBounds = splitBounds;
- if (mSplitBounds == null
- || !mContainer.getDeviceProfile().isTablet
- || mTaskView.isFocusedTask()) {
- mSplitBannerConfig = SPLIT_BANNER_FULLSCREEN;
- return;
- }
-
- // For portrait grid only height of task changes, not width. So we keep the text the same
- if (!mContainer.getDeviceProfile().isLeftRightSplit) {
- mSplitBannerConfig = SPLIT_GRID_BANNER_LARGE;
- return;
- }
-
- // For landscape grid, for 30% width we only show icon, otherwise show icon and time
- if (mTask.key.id == mSplitBounds.leftTopTaskId) {
- mSplitBannerConfig = mSplitBounds.leftTaskPercent < THRESHOLD_LEFT_ICON_ONLY ?
- SPLIT_GRID_BANNER_SMALL : SPLIT_GRID_BANNER_LARGE;
- } else {
- mSplitBannerConfig = mSplitBounds.leftTaskPercent > THRESHOLD_RIGHT_ICON_ONLY ?
- SPLIT_GRID_BANNER_SMALL : SPLIT_GRID_BANNER_LARGE;
- }
- }
-
- private String getReadableDuration(
- Duration duration,
- FormatWidth formatWidthHourAndMinute,
- @StringRes int durationLessThanOneMinuteStringId,
- boolean forceFormatWidth) {
- int hours = Math.toIntExact(duration.toHours());
- int minutes = Math.toIntExact(duration.minusHours(hours).toMinutes());
-
- // Apply formatWidthHourAndMinute if both the hour part and the minute part are non-zero.
- if (hours > 0 && minutes > 0) {
- return MeasureFormat.getInstance(Locale.getDefault(), formatWidthHourAndMinute)
- .formatMeasures(
- new Measure(hours, MeasureUnit.HOUR),
- new Measure(minutes, MeasureUnit.MINUTE));
- }
-
- // Apply formatWidthHourOrMinute if only the hour part is non-zero (unless forced).
- if (hours > 0) {
- return MeasureFormat.getInstance(
- Locale.getDefault(),
- forceFormatWidth ? formatWidthHourAndMinute : FormatWidth.WIDE)
- .formatMeasures(new Measure(hours, MeasureUnit.HOUR));
- }
-
- // Apply formatWidthHourOrMinute if only the minute part is non-zero (unless forced).
- if (minutes > 0) {
- return MeasureFormat.getInstance(
- Locale.getDefault()
- , forceFormatWidth ? formatWidthHourAndMinute : FormatWidth.WIDE)
- .formatMeasures(new Measure(minutes, MeasureUnit.MINUTE));
- }
-
- // Use a specific string for usage less than one minute but non-zero.
- if (duration.compareTo(Duration.ZERO) > 0) {
- return mContainer.asContext().getString(durationLessThanOneMinuteStringId);
- }
-
- // Otherwise, return 0-minute string.
- return MeasureFormat.getInstance(
- Locale.getDefault(), forceFormatWidth ? formatWidthHourAndMinute : FormatWidth.WIDE)
- .formatMeasures(new Measure(0, MeasureUnit.MINUTE));
- }
-
- /**
- * Returns text to show for the banner depending on {@link #mSplitBannerConfig}
- * If {@param forContentDesc} is {@code true}, this will always return the full
- * string corresponding to {@link #SPLIT_BANNER_FULLSCREEN}
- */
- private String getText(long remainingTime, boolean forContentDesc) {
- final Duration duration = Duration.ofMillis(
- remainingTime > MINUTE_MS ?
- (remainingTime + MINUTE_MS - 1) / MINUTE_MS * MINUTE_MS :
- remainingTime);
- String readableDuration = getReadableDuration(duration,
- FormatWidth.NARROW,
- R.string.shorter_duration_less_than_one_minute,
- false /* forceFormatWidth */);
- if (forContentDesc || mSplitBannerConfig == SPLIT_BANNER_FULLSCREEN) {
- return mContainer.asContext().getString(
- R.string.time_left_for_app,
- readableDuration);
- }
-
- if (mSplitBannerConfig == SPLIT_GRID_BANNER_SMALL) {
- // show no text
- return "";
- } else { // SPLIT_GRID_BANNER_LARGE
- // only show time
- return readableDuration;
- }
- }
-
- public void openAppUsageSettings(View view) {
- final Intent intent = new Intent(OPEN_APP_USAGE_SETTINGS_TEMPLATE)
- .putExtra(Intent.EXTRA_PACKAGE_NAME,
- mTask.getTopComponent().getPackageName()).addFlags(
- Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- try {
- final RecentsViewContainer container =
- RecentsViewContainer.containerFromContext(view.getContext());
- final ActivityOptions options = ActivityOptions.makeScaleUpAnimation(
- view, 0, 0,
- view.getWidth(), view.getHeight());
- container.asContext().startActivity(intent, options.toBundle());
-
- // TODO: add WW logging on the app usage settings click.
- } catch (ActivityNotFoundException e) {
- Log.e(TAG, "Failed to open app usage settings for task "
- + mTask.getTopComponent().getPackageName(), e);
- }
- }
-
- private String getContentDescriptionForTask(
- Task task, long appUsageLimitTimeMs, long appRemainingTimeMs) {
- return appUsageLimitTimeMs >= 0 && appRemainingTimeMs >= 0 ?
- mContainer.asContext().getString(
- R.string.task_contents_description_with_remaining_time,
- task.titleDescription,
- getText(appRemainingTimeMs, true /* forContentDesc */)) :
- task.titleDescription;
- }
-
- private void replaceBanner(@Nullable View view) {
- resetOldBanner();
- setBanner(view);
- }
-
- private void resetOldBanner() {
- if (mBanner != null) {
- mBanner.setOutlineProvider(mOldBannerOutlineProvider);
- mTaskView.removeView(mBanner);
- mBanner.setOnClickListener(null);
- mContainer.getViewCache().recycleView(R.layout.digital_wellbeing_toast, mBanner);
- }
- }
-
- private void setBanner(@Nullable View view) {
- mBanner = view;
- if (view != null && mTaskView.getRecentsView() != null) {
- setupAndAddBanner();
- setBannerOutline();
- }
- }
-
- private void setupAndAddBanner() {
- FrameLayout.LayoutParams layoutParams =
- (FrameLayout.LayoutParams) mBanner.getLayoutParams();
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- layoutParams.bottomMargin = ((ViewGroup.MarginLayoutParams)
- mTaskView.getThumbnail().getLayoutParams()).bottomMargin;
- RecentsPagedOrientationHandler orientationHandler = mTaskView.getPagedOrientationHandler();
- Pair<Float, Float> translations = orientationHandler
- .getDwbLayoutTranslations(mTaskView.getMeasuredWidth(),
- mTaskView.getMeasuredHeight(), mSplitBounds, deviceProfile,
- mTaskView.getThumbnails(), mTask.key.id, mBanner);
- mSplitOffsetTranslationX = translations.first;
- mSplitOffsetTranslationY = translations.second;
- updateTranslationY();
- updateTranslationX();
- mTaskView.addView(mBanner);
- }
-
- private void setBannerOutline() {
- // TODO(b\273367585) to investigate why mBanner.getOutlineProvider() can be null
- mOldBannerOutlineProvider = mBanner.getOutlineProvider() != null
- ? mBanner.getOutlineProvider()
- : ViewOutlineProvider.BACKGROUND;
-
- mBanner.setOutlineProvider(new ViewOutlineProvider() {
- @Override
- public void getOutline(View view, Outline outline) {
- mOldBannerOutlineProvider.getOutline(view, outline);
- float verticalTranslation = -view.getTranslationY() + mSplitOffsetTranslationY;
- outline.offset(0, Math.round(verticalTranslation));
- }
- });
- mBanner.setClipToOutline(true);
- }
-
- void updateBannerOffset(float offsetPercentage) {
- if (mBanner != null && mBannerOffsetPercentage != offsetPercentage) {
- mBannerOffsetPercentage = offsetPercentage;
- updateTranslationY();
- mBanner.invalidateOutline();
- }
- }
-
- private void updateTranslationY() {
- if (mBanner == null) {
- return;
- }
-
- mBanner.setTranslationY(
- (mBannerOffsetPercentage * mBanner.getHeight()) + mSplitOffsetTranslationY);
- }
-
- private void updateTranslationX() {
- if (mBanner == null) {
- return;
- }
-
- mBanner.setTranslationX(mSplitOffsetTranslationX);
- }
-
- void setBannerColorTint(int color, float amount) {
- if (mBanner == null) {
- return;
- }
- if (amount == 0) {
- mBanner.setLayerType(View.LAYER_TYPE_NONE, null);
- }
- Paint layerPaint = new Paint();
- layerPaint.setColorFilter(Utilities.makeColorTintingColorFilter(color, amount));
- mBanner.setLayerType(View.LAYER_TYPE_HARDWARE, layerPaint);
- mBanner.setLayerPaint(layerPaint);
- }
-
- void setBannerVisibility(int visibility) {
- if (mBanner == null) {
- return;
- }
-
- mBanner.setVisibility(visibility);
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.kt b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.kt
new file mode 100644
index 0000000..731b008
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.kt
@@ -0,0 +1,399 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.views
+
+import android.app.ActivityOptions
+import android.content.ActivityNotFoundException
+import android.content.Intent
+import android.content.pm.LauncherApps
+import android.content.pm.LauncherApps.AppUsageLimit
+import android.graphics.Outline
+import android.graphics.Paint
+import android.icu.text.MeasureFormat
+import android.icu.util.Measure
+import android.icu.util.MeasureUnit
+import android.os.UserHandle
+import android.provider.Settings
+import android.util.Log
+import android.view.View
+import android.view.ViewGroup.MarginLayoutParams
+import android.view.ViewOutlineProvider
+import android.view.accessibility.AccessibilityNodeInfo
+import android.widget.FrameLayout
+import android.widget.TextView
+import androidx.annotation.StringRes
+import androidx.core.util.component1
+import androidx.core.util.component2
+import androidx.core.view.updateLayoutParams
+import com.android.launcher3.R
+import com.android.launcher3.Utilities
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.quickstep.TaskUtils
+import com.android.systemui.shared.recents.model.Task
+import java.time.Duration
+import java.util.Locale
+
+class DigitalWellBeingToast(
+ private val container: RecentsViewContainer,
+ private val taskView: TaskView
+) {
+ private val launcherApps: LauncherApps? =
+ container.asContext().getSystemService(LauncherApps::class.java)
+
+ private val bannerHeight =
+ container
+ .asContext()
+ .resources
+ .getDimensionPixelSize(R.dimen.digital_wellbeing_toast_height)
+
+ private lateinit var task: Task
+
+ private var appRemainingTimeMs: Long = 0
+ private var banner: View? = null
+ private var oldBannerOutlineProvider: ViewOutlineProvider? = null
+ private var splitOffsetTranslationY = 0f
+ private var splitOffsetTranslationX = 0f
+
+ private var isDestroyed = false
+
+ var hasLimit = false
+ var splitBounds: SplitConfigurationOptions.SplitBounds? = null
+ var bannerOffsetPercentage = 0f
+ set(value) {
+ if (field != value) {
+ field = value
+ banner?.let {
+ updateTranslationY()
+ it.invalidateOutline()
+ }
+ }
+ }
+
+ private fun setNoLimit() {
+ hasLimit = false
+ taskView.contentDescription = task.titleDescription
+ replaceBanner(null)
+ appRemainingTimeMs = -1
+ }
+
+ private fun setLimit(appUsageLimitTimeMs: Long, appRemainingTimeMs: Long) {
+ this.appRemainingTimeMs = appRemainingTimeMs
+ hasLimit = true
+ val toast =
+ container.viewCache
+ .getView<TextView>(
+ R.layout.digital_wellbeing_toast,
+ container.asContext(),
+ taskView
+ )
+ .apply {
+ text =
+ Utilities.prefixTextWithIcon(
+ container.asContext(),
+ R.drawable.ic_hourglass_top,
+ getBannerText()
+ )
+ setOnClickListener(::openAppUsageSettings)
+ }
+ replaceBanner(toast)
+
+ taskView.contentDescription =
+ getContentDescriptionForTask(task, appUsageLimitTimeMs, appRemainingTimeMs)
+ }
+
+ fun initialize(task: Task) {
+ check(!isDestroyed) { "Cannot re-initialize a destroyed toast" }
+ this.task = task
+ Executors.ORDERED_BG_EXECUTOR.execute {
+ var usageLimit: AppUsageLimit? = null
+ try {
+ usageLimit =
+ launcherApps?.getAppUsageLimit(
+ this.task.topComponent.packageName,
+ UserHandle.of(this.task.key.userId)
+ )
+ } catch (e: Exception) {
+ Log.e(TAG, "Error initializing digital well being toast", e)
+ }
+ val appUsageLimitTimeMs = usageLimit?.totalUsageLimit ?: -1
+ val appRemainingTimeMs = usageLimit?.usageRemaining ?: -1
+ taskView.post {
+ if (isDestroyed) {
+ return@post
+ }
+ if (appUsageLimitTimeMs < 0 || appRemainingTimeMs < 0) {
+ setNoLimit()
+ } else {
+ setLimit(appUsageLimitTimeMs, appRemainingTimeMs)
+ }
+ }
+ }
+ }
+
+ /** Mark the DWB toast as destroyed and remove banner from TaskView. */
+ fun destroy() {
+ isDestroyed = true
+ taskView.post { replaceBanner(null) }
+ }
+
+ private fun getSplitBannerConfig(): SplitBannerConfig {
+ val splitBounds = splitBounds
+ return when {
+ splitBounds == null || !container.deviceProfile.isTablet || taskView.isLargeTile ->
+ SplitBannerConfig.SPLIT_BANNER_FULLSCREEN
+ // For portrait grid only height of task changes, not width. So we keep the text the
+ // same
+ !container.deviceProfile.isLeftRightSplit -> SplitBannerConfig.SPLIT_GRID_BANNER_LARGE
+ // For landscape grid, for 30% width we only show icon, otherwise show icon and time
+ task.key.id == splitBounds.leftTopTaskId ->
+ if (splitBounds.leftTaskPercent < THRESHOLD_LEFT_ICON_ONLY)
+ SplitBannerConfig.SPLIT_GRID_BANNER_SMALL
+ else SplitBannerConfig.SPLIT_GRID_BANNER_LARGE
+ else ->
+ if (splitBounds.leftTaskPercent > THRESHOLD_RIGHT_ICON_ONLY)
+ SplitBannerConfig.SPLIT_GRID_BANNER_SMALL
+ else SplitBannerConfig.SPLIT_GRID_BANNER_LARGE
+ }
+ }
+
+ private fun getReadableDuration(
+ duration: Duration,
+ @StringRes durationLessThanOneMinuteStringId: Int
+ ): String {
+ val hours = Math.toIntExact(duration.toHours())
+ val minutes = Math.toIntExact(duration.minusHours(hours.toLong()).toMinutes())
+ return when {
+ // Apply FormatWidth.WIDE if both the hour part and the minute part are non-zero.
+ hours > 0 && minutes > 0 ->
+ MeasureFormat.getInstance(Locale.getDefault(), MeasureFormat.FormatWidth.NARROW)
+ .formatMeasures(
+ Measure(hours, MeasureUnit.HOUR),
+ Measure(minutes, MeasureUnit.MINUTE)
+ )
+ // Apply FormatWidth.WIDE if only the hour part is non-zero (unless forced).
+ hours > 0 ->
+ MeasureFormat.getInstance(Locale.getDefault(), MeasureFormat.FormatWidth.WIDE)
+ .formatMeasures(Measure(hours, MeasureUnit.HOUR))
+ // Apply FormatWidth.WIDE if only the minute part is non-zero (unless forced).
+ minutes > 0 ->
+ MeasureFormat.getInstance(Locale.getDefault(), MeasureFormat.FormatWidth.WIDE)
+ .formatMeasures(Measure(minutes, MeasureUnit.MINUTE))
+ // Use a specific string for usage less than one minute but non-zero.
+ duration > Duration.ZERO ->
+ container.asContext().getString(durationLessThanOneMinuteStringId)
+ // Otherwise, return 0-minute string.
+ else ->
+ MeasureFormat.getInstance(Locale.getDefault(), MeasureFormat.FormatWidth.WIDE)
+ .formatMeasures(Measure(0, MeasureUnit.MINUTE))
+ }
+ }
+
+ /**
+ * Returns text to show for the banner depending on [.getSplitBannerConfig] If {@param
+ * forContentDesc} is `true`, this will always return the full string corresponding to
+ * [.SPLIT_BANNER_FULLSCREEN]
+ */
+ @JvmOverloads
+ fun getBannerText(
+ remainingTime: Long = appRemainingTimeMs,
+ forContentDesc: Boolean = false
+ ): String {
+ val duration =
+ Duration.ofMillis(
+ if (remainingTime > MINUTE_MS)
+ (remainingTime + MINUTE_MS - 1) / MINUTE_MS * MINUTE_MS
+ else remainingTime
+ )
+ val readableDuration =
+ getReadableDuration(
+ duration,
+ R.string.shorter_duration_less_than_one_minute /* forceFormatWidth */
+ )
+ val splitBannerConfig = getSplitBannerConfig()
+ return when {
+ forContentDesc || splitBannerConfig == SplitBannerConfig.SPLIT_BANNER_FULLSCREEN ->
+ container.asContext().getString(R.string.time_left_for_app, readableDuration)
+ // show no text
+ splitBannerConfig == SplitBannerConfig.SPLIT_GRID_BANNER_SMALL -> ""
+ // SPLIT_GRID_BANNER_LARGE only show time
+ else -> readableDuration
+ }
+ }
+
+ private fun openAppUsageSettings(view: View) {
+ val intent =
+ Intent(OPEN_APP_USAGE_SETTINGS_TEMPLATE)
+ .putExtra(Intent.EXTRA_PACKAGE_NAME, task.topComponent.packageName)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
+ try {
+ val options = ActivityOptions.makeScaleUpAnimation(view, 0, 0, view.width, view.height)
+ container.asContext().startActivity(intent, options.toBundle())
+
+ // TODO: add WW logging on the app usage settings click.
+ } catch (e: ActivityNotFoundException) {
+ Log.e(
+ TAG,
+ "Failed to open app usage settings for task " + task.topComponent.packageName,
+ e
+ )
+ }
+ }
+
+ private fun getContentDescriptionForTask(
+ task: Task,
+ appUsageLimitTimeMs: Long,
+ appRemainingTimeMs: Long
+ ): String =
+ if (appUsageLimitTimeMs >= 0 && appRemainingTimeMs >= 0)
+ container
+ .asContext()
+ .getString(
+ R.string.task_contents_description_with_remaining_time,
+ task.titleDescription,
+ getBannerText(appRemainingTimeMs, true /* forContentDesc */)
+ )
+ else task.titleDescription
+
+ private fun replaceBanner(view: View?) {
+ resetOldBanner()
+ setBanner(view)
+ }
+
+ private fun resetOldBanner() {
+ val banner = banner ?: return
+ banner.outlineProvider = oldBannerOutlineProvider
+ taskView.removeView(banner)
+ banner.setOnClickListener(null)
+ container.viewCache.recycleView(R.layout.digital_wellbeing_toast, banner)
+ }
+
+ private fun setBanner(banner: View?) {
+ this.banner = banner
+ if (banner != null && taskView.recentsView != null) {
+ setupAndAddBanner()
+ setBannerOutline()
+ }
+ }
+
+ private fun setupAndAddBanner() {
+ val banner = banner ?: return
+ banner.updateLayoutParams<FrameLayout.LayoutParams> {
+ bottomMargin =
+ (taskView.firstSnapshotView.layoutParams as MarginLayoutParams).bottomMargin
+ }
+ val (translationX, translationY) =
+ taskView.pagedOrientationHandler.getDwbLayoutTranslations(
+ taskView.measuredWidth,
+ taskView.measuredHeight,
+ splitBounds,
+ container.deviceProfile,
+ taskView.snapshotViews,
+ task.key.id,
+ banner
+ )
+ splitOffsetTranslationX = translationX
+ splitOffsetTranslationY = translationY
+ updateTranslationY()
+ updateTranslationX()
+ taskView.addView(banner)
+ }
+
+ private fun setBannerOutline() {
+ val banner = banner ?: return
+ // TODO(b\273367585) to investigate why mBanner.getOutlineProvider() can be null
+ val oldBannerOutlineProvider =
+ if (banner.outlineProvider != null) banner.outlineProvider
+ else ViewOutlineProvider.BACKGROUND
+ this.oldBannerOutlineProvider = oldBannerOutlineProvider
+
+ banner.outlineProvider =
+ object : ViewOutlineProvider() {
+ override fun getOutline(view: View, outline: Outline) {
+ oldBannerOutlineProvider.getOutline(view, outline)
+ val verticalTranslation = -view.translationY + splitOffsetTranslationY
+ outline.offset(0, Math.round(verticalTranslation))
+ }
+ }
+ banner.clipToOutline = true
+ }
+
+ private fun updateTranslationY() {
+ banner?.translationY = bannerOffsetPercentage * bannerHeight + splitOffsetTranslationY
+ }
+
+ private fun updateTranslationX() {
+ banner?.translationX = splitOffsetTranslationX
+ }
+
+ fun setBannerColorTint(color: Int, amount: Float) {
+ val banner = banner ?: return
+ if (amount == 0f) {
+ banner.setLayerType(View.LAYER_TYPE_NONE, null)
+ }
+ val layerPaint = Paint()
+ layerPaint.setColorFilter(Utilities.makeColorTintingColorFilter(color, amount))
+ banner.setLayerType(View.LAYER_TYPE_HARDWARE, layerPaint)
+ banner.setLayerPaint(layerPaint)
+ }
+
+ fun setBannerVisibility(visibility: Int) {
+ banner?.visibility = visibility
+ }
+
+ private fun getAccessibilityActionId(): Int =
+ if (splitBounds?.rightBottomTaskId == task.key.id)
+ R.id.action_digital_wellbeing_bottom_right
+ else R.id.action_digital_wellbeing_top_left
+
+ fun getDWBAccessibilityAction(): AccessibilityNodeInfo.AccessibilityAction? {
+ if (!hasLimit) return null
+ val context = container.asContext()
+ val label =
+ if ((taskView.containsMultipleTasks()))
+ context.getString(
+ R.string.split_app_usage_settings,
+ TaskUtils.getTitle(context, task)
+ )
+ else context.getString(R.string.accessibility_app_usage_settings)
+ return AccessibilityNodeInfo.AccessibilityAction(getAccessibilityActionId(), label)
+ }
+
+ fun handleAccessibilityAction(action: Int): Boolean {
+ if (getAccessibilityActionId() != action) return false
+ openAppUsageSettings(taskView)
+ return true
+ }
+
+ companion object {
+ private const val THRESHOLD_LEFT_ICON_ONLY = 0.4f
+ private const val THRESHOLD_RIGHT_ICON_ONLY = 0.6f
+
+ enum class SplitBannerConfig {
+ /** Will span entire width of taskView with full text */
+ SPLIT_BANNER_FULLSCREEN,
+ /** Used for grid task view, only showing icon and time */
+ SPLIT_GRID_BANNER_LARGE,
+ /** Used for grid task view, only showing icon */
+ SPLIT_GRID_BANNER_SMALL
+ }
+
+ val OPEN_APP_USAGE_SETTINGS_TEMPLATE: Intent = Intent(Settings.ACTION_APP_USAGE_SETTINGS)
+ const val MINUTE_MS: Int = 60000
+
+ private const val TAG = "DigitalWellBeingToast"
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/FixedSizeImageView.kt b/quickstep/src/com/android/quickstep/views/FixedSizeImageView.kt
new file mode 100644
index 0000000..c893016
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/FixedSizeImageView.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.views
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.util.AttributeSet
+import android.view.ViewGroup
+import android.widget.ImageView
+
+/**
+ * An [ImageView] that does not requestLayout() unless setLayoutParams is called.
+ *
+ * This is useful, particularly during animations, for [ImageView]s that are not supposed to be
+ * resized.
+ */
+@SuppressLint("AppCompatCustomView")
+class FixedSizeImageView : ImageView {
+ private var shouldRequestLayoutOnChanges = false
+
+ constructor(context: Context) : super(context)
+
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int,
+ ) : super(context, attrs, defStyleAttr)
+
+ override fun setLayoutParams(params: ViewGroup.LayoutParams?) {
+ shouldRequestLayoutOnChanges = true
+ super.setLayoutParams(params)
+ shouldRequestLayoutOnChanges = false
+ }
+
+ override fun requestLayout() {
+ if (shouldRequestLayoutOnChanges) {
+ super.requestLayout()
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/FloatingAppPairBackground.kt b/quickstep/src/com/android/quickstep/views/FloatingAppPairBackground.kt
index e024995..6bbd6b2 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingAppPairBackground.kt
+++ b/quickstep/src/com/android/quickstep/views/FloatingAppPairBackground.kt
@@ -57,6 +57,7 @@
private val container: RecentsViewContainer
private val backgroundPaint = Paint(Paint.ANTI_ALIAS_FLAG)
+ private val dividerPaint = Paint(Paint.ANTI_ALIAS_FLAG)
// Animation interpolators
protected val expandXInterpolator: Interpolator
@@ -105,13 +106,15 @@
)
// Find device-specific measurements
- deviceCornerRadius = QuickStepContract.getWindowCornerRadius(container.asContext())
+ val resources = context.resources
+ deviceCornerRadius = QuickStepContract.getWindowCornerRadius(context)
deviceHalfDividerSize =
- container.asContext().resources.getDimensionPixelSize(R.dimen.multi_window_task_divider_size) / 2f
+ resources.getDimensionPixelSize(R.dimen.multi_window_task_divider_size) / 2f
val dividerCenterPos = dividerPos + deviceHalfDividerSize
desiredSplitRatio =
if (dp.isLeftRightSplit) dividerCenterPos / dp.widthPx
else dividerCenterPos / dp.heightPx
+ dividerPaint.color = resources.getColor(R.color.taskbar_background_dark, null /*theme*/)
}
override fun draw(canvas: Canvas) {
@@ -153,8 +156,12 @@
val leftSide = RectF(0f, 0f, dividerCenterPos - changingDividerSize, height)
// The right half of the background image
val rightSide = RectF(dividerCenterPos + changingDividerSize, 0f, width, height)
+ // Middle part is for divider background
+ val middleRect = RectF(leftSide.right - deviceHalfDividerSize, 0f,
+ rightSide.left + deviceHalfDividerSize, height)
// Draw background
+ canvas.drawRect(middleRect, dividerPaint)
drawCustomRoundedRect(
canvas,
leftSide,
@@ -251,8 +258,12 @@
val topSide = RectF(0f, 0f, width, dividerCenterPos - changingDividerSize)
// The bottom half of the background image
val bottomSide = RectF(0f, dividerCenterPos + changingDividerSize, width, height)
+ // Middle part is for divider background
+ val middleRect = RectF(0f, topSide.bottom - deviceHalfDividerSize,
+ width, bottomSide.top + deviceHalfDividerSize)
// Draw background
+ canvas.drawRect(middleRect, dividerPaint)
drawCustomRoundedRect(
canvas,
topSide,
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 0e451b5..acbb2ec 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -187,7 +187,13 @@
viewBounds, false /* ignoreTransform */, null /* recycle */,
mStartingPosition);
}
-
+ // In some cases originalView is off-screen so we don't get a valid starting position
+ // ex. on rotation
+ // TODO(b/345556328) We shouldn't be animating if starting position of view isn't ready
+ if (mStartingPosition.isEmpty()) {
+ // Set to non empty for now so calculations in #update() don't break
+ mStartingPosition.set(0, 0, 1, 1);
+ }
final BaseDragLayer.LayoutParams lp = new BaseDragLayer.LayoutParams(
Math.round(mStartingPosition.width()),
Math.round(mStartingPosition.height()));
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
deleted file mode 100644
index c7a4203..0000000
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
+++ /dev/null
@@ -1,553 +0,0 @@
-package com.android.quickstep.views;
-
-import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-
-import static com.android.launcher3.Flags.enableOverviewIconMenu;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
-import static com.android.quickstep.util.SplitScreenUtils.convertLauncherSplitBoundsToShell;
-
-import android.app.ActivityTaskManager;
-import android.content.Context;
-import android.graphics.Point;
-import android.graphics.PointF;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.util.Pair;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewStub;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.android.internal.jank.Cuj;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.util.CancellableTask;
-import com.android.launcher3.util.RunnableList;
-import com.android.launcher3.util.SplitConfigurationOptions;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
-import com.android.launcher3.util.TransformingTouchDelegate;
-import com.android.quickstep.RecentsModel;
-import com.android.quickstep.TaskIconCache;
-import com.android.quickstep.TaskThumbnailCache;
-import com.android.quickstep.util.RecentsOrientedState;
-import com.android.quickstep.util.SplitSelectStateController;
-import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.recents.utilities.PreviewPositionHelper;
-import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import com.android.wm.shell.common.split.SplitScreenConstants.PersistentSnapPosition;
-
-import kotlin.Unit;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Optional;
-import java.util.function.Consumer;
-
-/**
- * TaskView that contains and shows thumbnails for not one, BUT TWO(!!) tasks
- *
- * That's right. If you call within the next 5 minutes we'll go ahead and double your order and
- * send you !! TWO !! Tasks along with their TaskThumbnailViews complimentary. On. The. House.
- * And not only that, we'll even clean up your thumbnail request if you don't like it.
- * All the benefits of one TaskView, except DOUBLED!
- *
- * (Icon loading sold separately, fees may apply. Shipping & Handling for Overlays not included).
- */
-public class GroupedTaskView extends TaskView {
-
- private static final String TAG = GroupedTaskView.class.getSimpleName();
- @Nullable
- private Task mSecondaryTask;
- // TODO(b/336612373): Support new TTV for GroupedTaskView
- private TaskThumbnailViewDeprecated mSnapshotView2;
- private TaskViewIcon mIconView2;
- @Nullable
- private CancellableTask<ThumbnailData> mThumbnailLoadRequest2;
- @Nullable
- private CancellableTask mIconLoadRequest2;
- private final float[] mIcon2CenterCoords = new float[2];
- private TransformingTouchDelegate mIcon2TouchDelegate;
- @Nullable
- private SplitBounds mSplitBoundsConfig;
- private final DigitalWellBeingToast mDigitalWellBeingToast2;
-
- public GroupedTaskView(Context context) {
- this(context, null);
- }
-
- public GroupedTaskView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public GroupedTaskView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- mDigitalWellBeingToast2 = new DigitalWellBeingToast(mContainer, this);
- }
-
- @Override
- protected Unit updateBorderBounds(@NonNull Rect bounds) {
- if (mSplitBoundsConfig == null) {
- super.updateBorderBounds(bounds);
- return Unit.INSTANCE;
- }
- bounds.set(
- Math.min(mTaskThumbnailViewDeprecated.getLeft() + Math.round(
- mTaskThumbnailViewDeprecated.getTranslationX()),
- mSnapshotView2.getLeft() + Math.round(mSnapshotView2.getTranslationX())),
- Math.min(mTaskThumbnailViewDeprecated.getTop() + Math.round(
- mTaskThumbnailViewDeprecated.getTranslationY()),
- mSnapshotView2.getTop() + Math.round(mSnapshotView2.getTranslationY())),
- Math.max(mTaskThumbnailViewDeprecated.getRight() + Math.round(
- mTaskThumbnailViewDeprecated.getTranslationX()),
- mSnapshotView2.getRight() + Math.round(mSnapshotView2.getTranslationX())),
- Math.max(mTaskThumbnailViewDeprecated.getBottom() + Math.round(
- mTaskThumbnailViewDeprecated.getTranslationY()),
- mSnapshotView2.getBottom() + Math.round(mSnapshotView2.getTranslationY())));
- return Unit.INSTANCE;
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mSnapshotView2 = findViewById(R.id.bottomright_snapshot);
- ViewStub iconViewStub2 = findViewById(R.id.bottomRight_icon);
- if (enableOverviewIconMenu()) {
- iconViewStub2.setLayoutResource(R.layout.icon_app_chip_view);
- } else {
- iconViewStub2.setLayoutResource(R.layout.icon_view);
- }
- mIconView2 = (TaskViewIcon) iconViewStub2.inflate();
- mIcon2TouchDelegate = new TransformingTouchDelegate(mIconView2.asView());
- }
-
- public void bind(Task primary, Task secondary, RecentsOrientedState orientedState,
- @Nullable SplitBounds splitBoundsConfig) {
- super.bind(primary, orientedState);
- mSecondaryTask = secondary;
- mTaskIdContainer = new int[]{mTaskIdContainer[0], secondary.key.id};
- mTaskIdAttributeContainer = new TaskIdAttributeContainer[]{
- mTaskIdAttributeContainer[0],
- new TaskIdAttributeContainer(secondary, mSnapshotView2,
- mIconView2, STAGE_POSITION_BOTTOM_OR_RIGHT)};
- mTaskIdAttributeContainer[0].setStagePosition(
- SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT);
- mSnapshotView2.bind(secondary);
- mSplitBoundsConfig = splitBoundsConfig;
- if (mSplitBoundsConfig == null) {
- return;
- }
- mTaskThumbnailViewDeprecated.getPreviewPositionHelper().setSplitBounds(
- convertLauncherSplitBoundsToShell(splitBoundsConfig),
- PreviewPositionHelper.STAGE_POSITION_TOP_OR_LEFT);
- mSnapshotView2.getPreviewPositionHelper().setSplitBounds(
- convertLauncherSplitBoundsToShell(splitBoundsConfig),
- PreviewPositionHelper.STAGE_POSITION_BOTTOM_OR_RIGHT);
- }
-
- /**
- * Sets up an on-click listener and the visibility for show_windows icon on top of each task.
- */
- @Override
- public void setUpShowAllInstancesListener() {
- // sets up the listener for the left/top task
- super.setUpShowAllInstancesListener();
- if (mTaskIdAttributeContainer.length < 2) {
- return;
- }
-
- // right/bottom task's base package name
- String taskPackageName = mTaskIdAttributeContainer[1].getTask().key.getPackageName();
-
- // icon of the right/bottom task
- View showWindowsView = findViewById(R.id.show_windows_right);
- updateFilterCallback(showWindowsView, getFilterUpdateCallback(taskPackageName));
- }
-
- @Override
- public void onTaskListVisibilityChanged(boolean visible, int changes) {
- super.onTaskListVisibilityChanged(visible, changes);
- if (visible) {
- RecentsModel model = RecentsModel.INSTANCE.get(getContext());
- TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
- TaskIconCache iconCache = model.getIconCache();
-
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- mThumbnailLoadRequest2 = thumbnailCache.updateThumbnailInBackground(mSecondaryTask,
- thumbnailData -> mSnapshotView2.setThumbnail(
- mSecondaryTask, thumbnailData
- ));
- }
-
- if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
- mIconLoadRequest2 = iconCache.updateIconInBackground(mSecondaryTask,
- (task) -> {
- setIcon(mIconView2, task.icon);
- if (enableOverviewIconMenu()) {
- setText(mIconView2, task.title);
- }
- mDigitalWellBeingToast2.initialize(mSecondaryTask);
- mDigitalWellBeingToast2.setSplitConfiguration(mSplitBoundsConfig);
- mDigitalWellBeingToast.setSplitConfiguration(mSplitBoundsConfig);
- });
- }
- } else {
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- mSnapshotView2.setThumbnail(null, null);
- // Reset the task thumbnail reference as well (it will be fetched from the cache or
- // reloaded next time we need it)
- mSecondaryTask.thumbnail = null;
- }
- if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
- setIcon(mIconView2, null);
- if (enableOverviewIconMenu()) {
- setText(mIconView2, null);
- }
- }
- }
- }
-
- public void updateSplitBoundsConfig(SplitBounds splitBounds) {
- mSplitBoundsConfig = splitBounds;
- invalidate();
- }
-
- @Nullable
- public SplitBounds getSplitBoundsConfig() {
- return mSplitBoundsConfig;
- }
-
- /**
- * Returns the {@link PersistentSnapPosition} of this pair of tasks.
- */
- public @PersistentSnapPosition int getSnapPosition() {
- if (mSplitBoundsConfig == null) {
- throw new IllegalStateException("mSplitBoundsConfig is null");
- }
-
- return mSplitBoundsConfig.snapPosition;
- }
-
- @Override
- public boolean offerTouchToChildren(MotionEvent event) {
- computeAndSetIconTouchDelegate(mIconView2, mIcon2CenterCoords, mIcon2TouchDelegate);
- if (mIcon2TouchDelegate.onTouchEvent(event)) {
- return true;
- }
-
- return super.offerTouchToChildren(event);
- }
-
- @Override
- protected void cancelPendingLoadTasks() {
- super.cancelPendingLoadTasks();
- if (mThumbnailLoadRequest2 != null) {
- mThumbnailLoadRequest2.cancel();
- mThumbnailLoadRequest2 = null;
- }
- if (mIconLoadRequest2 != null) {
- mIconLoadRequest2.cancel();
- mIconLoadRequest2 = null;
- }
- }
-
- @Nullable
- @Override
- public RunnableList launchTaskAnimated() {
- if (mTask == null || mSecondaryTask == null) {
- return null;
- }
-
- RunnableList endCallback = new RunnableList();
- RecentsView recentsView = getRecentsView();
- // Callbacks run from remote animation when recents animation not currently running
- InteractionJankMonitorWrapper.begin(this, Cuj.CUJ_SPLIT_SCREEN_ENTER,
- "Enter form GroupedTaskView");
- launchTaskInternal(success -> {
- endCallback.executeAllAndDestroy();
- InteractionJankMonitorWrapper.end(Cuj.CUJ_SPLIT_SCREEN_ENTER);
- }, false /* freezeTaskList */, true /*launchingExistingTaskview*/);
-
- // Callbacks get run from recentsView for case when recents animation already running
- recentsView.addSideTaskLaunchCallback(endCallback);
- return endCallback;
- }
-
- @Override
- public void launchTask(@NonNull Consumer<Boolean> callback, boolean isQuickswitch) {
- launchTaskInternal(callback, isQuickswitch, false /*launchingExistingTaskview*/);
- }
-
- /**
- * @param launchingExistingTaskView {@link SplitSelectStateController#launchExistingSplitPair}
- * uses existence of GroupedTaskView as control flow of how to animate in the incoming task. If
- * we're launching from overview (from overview thumbnails) then pass in {@code true},
- * otherwise pass in {@code false} for case like quickswitching from home to task
- */
- private void launchTaskInternal(@NonNull Consumer<Boolean> callback, boolean isQuickswitch,
- boolean launchingExistingTaskView) {
- getRecentsView().getSplitSelectController().launchExistingSplitPair(
- launchingExistingTaskView ? this : null, mTask.key.id,
- mSecondaryTask.key.id, SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT,
- callback, isQuickswitch, getSnapPosition());
- Log.d(TAG, "launchTaskInternal - launchExistingSplitPair: " + Arrays.toString(
- getTaskIds()));
- }
-
- @Override
- void refreshThumbnails(@Nullable HashMap<Integer, ThumbnailData> thumbnailDatas) {
- super.refreshThumbnails(thumbnailDatas);
- if (mSecondaryTask != null && thumbnailDatas != null) {
- final ThumbnailData thumbnailData = thumbnailDatas.get(mSecondaryTask.key.id);
- if (thumbnailData != null) {
- mSnapshotView2.setThumbnail(mSecondaryTask, thumbnailData);
- return;
- }
- }
-
- mSnapshotView2.refresh();
- }
-
- @Override
- public TaskThumbnailViewDeprecated[] getThumbnails() {
- return new TaskThumbnailViewDeprecated[]{mTaskThumbnailViewDeprecated, mSnapshotView2};
- }
-
- /**
- * Returns taskId that split selection was initiated with,
- * {@link ActivityTaskManager#INVALID_TASK_ID} if no tasks in this TaskView are part of
- * split selection
- */
- protected int getThisTaskCurrentlyInSplitSelection() {
- int initialTaskId = getRecentsView().getSplitSelectController().getInitialTaskId();
- return containsTaskId(initialTaskId) ? initialTaskId : INVALID_TASK_ID;
- }
-
- @Override
- protected int getLastSelectedChildTaskIndex() {
- SplitSelectStateController splitSelectController =
- getRecentsView().getSplitSelectController();
- if (splitSelectController.isDismissingFromSplitPair()) {
- // return the container index of the task that wasn't initially selected to split with
- // because that is the only remaining app that can be selected. The coordinate checks
- // below aren't reliable since both of those views may be gone/transformed
- int initSplitTaskId = getThisTaskCurrentlyInSplitSelection();
- if (initSplitTaskId != INVALID_TASK_ID) {
- return initSplitTaskId == mTask.key.id ? 1 : 0;
- }
- }
-
- // Check which of the two apps was selected
- if (isCoordInView(mIconView2.asView(), mLastTouchDownPosition)
- || isCoordInView(mSnapshotView2, mLastTouchDownPosition)) {
- return 1;
- }
- return super.getLastSelectedChildTaskIndex();
- }
-
- private boolean isCoordInView(View v, PointF position) {
- float[] localPos = new float[]{position.x, position.y};
- Utilities.mapCoordInSelfToDescendant(v, this, localPos);
- return Utilities.pointInView(v, localPos[0], localPos[1], 0f /* slop */);
- }
-
- @Override
- public void onRecycle() {
- super.onRecycle();
- mSnapshotView2.setThumbnail(mSecondaryTask, null);
- mSplitBoundsConfig = null;
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int widthSize = MeasureSpec.getSize(widthMeasureSpec);
- int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- setMeasuredDimension(widthSize, heightSize);
- if (mSplitBoundsConfig == null || mTaskThumbnailViewDeprecated == null
- || mSnapshotView2 == null) {
- return;
- }
- int initSplitTaskId = getThisTaskCurrentlyInSplitSelection();
- if (initSplitTaskId == INVALID_TASK_ID) {
- getPagedOrientationHandler().measureGroupedTaskViewThumbnailBounds(
- mTaskThumbnailViewDeprecated,
- mSnapshotView2, widthSize, heightSize, mSplitBoundsConfig,
- mContainer.getDeviceProfile(), getLayoutDirection() == LAYOUT_DIRECTION_RTL);
- // Should we be having a separate translation step apart from the measuring above?
- // The following only applies to large screen for now, but for future reference
- // we'd want to abstract this out in PagedViewHandlers to get the primary/secondary
- // translation directions
- mTaskThumbnailViewDeprecated.applySplitSelectTranslateX(
- mTaskThumbnailViewDeprecated.getTranslationX());
- mTaskThumbnailViewDeprecated.applySplitSelectTranslateY(
- mTaskThumbnailViewDeprecated.getTranslationY());
- mSnapshotView2.applySplitSelectTranslateX(mSnapshotView2.getTranslationX());
- mSnapshotView2.applySplitSelectTranslateY(mSnapshotView2.getTranslationY());
- } else {
- // Currently being split with this taskView, let the non-split selected thumbnail
- // take up full thumbnail area
- Optional<TaskIdAttributeContainer> nonSplitContainer = Arrays.stream(
- mTaskIdAttributeContainer).filter(
- container -> container.getTask().key.id != initSplitTaskId).findAny();
- nonSplitContainer.ifPresent(
- taskIdAttributeContainer -> taskIdAttributeContainer.getThumbnailView().measure(
- widthMeasureSpec, MeasureSpec.makeMeasureSpec(
- heightSize - mContainer.getDeviceProfile()
- .overviewTaskThumbnailTopMarginPx,
- MeasureSpec.EXACTLY)));
- }
- if (!enableOverviewIconMenu()) {
- updateIconPlacement();
- }
- }
-
- @Override
- public void setOverlayEnabled(boolean overlayEnabled) {
- if (FeatureFlags.enableAppPairs()) {
- super.setOverlayEnabled(overlayEnabled);
- } else {
- // Intentional no-op to prevent setting smart actions overlay on thumbnails
- }
- }
-
- @Override
- public void setOrientationState(RecentsOrientedState orientationState) {
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- if (enableOverviewIconMenu() && mSplitBoundsConfig != null) {
- ViewGroup.LayoutParams layoutParams = getLayoutParams();
- Pair<Point, Point> groupedTaskViewSizes =
- orientationState.getOrientationHandler().getGroupedTaskViewSizes(
- deviceProfile,
- mSplitBoundsConfig,
- layoutParams.width,
- layoutParams.height
- );
- int iconViewMarginStart = getResources().getDimensionPixelSize(
- R.dimen.task_thumbnail_icon_menu_expanded_top_start_margin);
- int iconViewBackgroundMarginStart = getResources().getDimensionPixelSize(
- R.dimen.task_thumbnail_icon_menu_background_margin_top_start);
- int iconMargins = (iconViewMarginStart + iconViewBackgroundMarginStart) * 2;
- ((IconAppChipView) mIconView).setMaxWidth(groupedTaskViewSizes.first.x - iconMargins);
- ((IconAppChipView) mIconView2).setMaxWidth(groupedTaskViewSizes.second.x - iconMargins);
- }
- // setMaxWidth() needs to be called before mIconView.setIconOrientation which is called in
- // the super below.
- super.setOrientationState(orientationState);
-
- boolean isGridTask = deviceProfile.isTablet && !isFocusedTask();
- mIconView2.setIconOrientation(orientationState, isGridTask);
- updateIconPlacement();
- updateSecondaryDwbPlacement();
- }
-
- private void updateIconPlacement() {
- if (mSplitBoundsConfig == null) {
- return;
- }
-
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
- boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
-
- if (enableOverviewIconMenu()) {
- ViewGroup.LayoutParams layoutParams = getLayoutParams();
- Pair<Point, Point> groupedTaskViewSizes =
- getPagedOrientationHandler()
- .getGroupedTaskViewSizes(
- deviceProfile,
- mSplitBoundsConfig,
- layoutParams.width,
- layoutParams.height
- );
-
- getPagedOrientationHandler().setSplitIconParams(mIconView.asView(), mIconView2.asView(),
- taskIconHeight, groupedTaskViewSizes.first.x, groupedTaskViewSizes.first.y,
- getLayoutParams().height, getLayoutParams().width, isRtl, deviceProfile,
- mSplitBoundsConfig);
- } else {
- getPagedOrientationHandler().setSplitIconParams(mIconView.asView(), mIconView2.asView(),
- taskIconHeight, mTaskThumbnailViewDeprecated.getMeasuredWidth(),
- mTaskThumbnailViewDeprecated.getMeasuredHeight(), getMeasuredHeight(),
- getMeasuredWidth(),
- isRtl, deviceProfile, mSplitBoundsConfig);
- }
- }
-
- private void updateSecondaryDwbPlacement() {
- if (mSecondaryTask == null) {
- return;
- }
- mDigitalWellBeingToast2.initialize(mSecondaryTask);
- }
-
- @Override
- protected void updateSnapshotRadius() {
- super.updateSnapshotRadius();
- mSnapshotView2.setFullscreenParams(mCurrentFullscreenParams);
- }
-
- @Override
- protected void setIconsAndBannersTransitionProgress(float progress, boolean invert) {
- super.setIconsAndBannersTransitionProgress(progress, invert);
- // Value set by super call
- float scale = mIconView.getAlpha();
- mIconView2.setContentAlpha(scale);
- mDigitalWellBeingToast2.updateBannerOffset(1f - scale);
- }
-
- @Override
- public void setColorTint(float amount, int tintColor) {
- super.setColorTint(amount, tintColor);
- mIconView2.setIconColorTint(tintColor, amount);
- mSnapshotView2.setDimAlpha(amount);
- mDigitalWellBeingToast2.setBannerColorTint(tintColor, amount);
- }
-
- @Override
- protected void applyThumbnailSplashAlpha() {
- super.applyThumbnailSplashAlpha();
- mSnapshotView2.setSplashAlpha(mTaskThumbnailSplashAlpha);
- }
-
- @Override
- protected void refreshTaskThumbnailSplash() {
- super.refreshTaskThumbnailSplash();
- mSnapshotView2.refreshSplashView();
- }
-
- @Override
- protected void resetViewTransforms() {
- super.resetViewTransforms();
- mSnapshotView2.resetViewTransforms();
- }
-
- /**
- * Sets visibility for thumbnails and associated elements (DWB banners).
- * IconView is unaffected.
- *
- * When setting INVISIBLE, sets the visibility for the last selected child task.
- * When setting VISIBLE (as a reset), sets the visibility for both tasks.
- */
- @Override
- void setThumbnailVisibility(int visibility, int taskId) {
- if (visibility == VISIBLE) {
- mTaskThumbnailViewDeprecated.setVisibility(visibility);
- mDigitalWellBeingToast.setBannerVisibility(visibility);
- mSnapshotView2.setVisibility(visibility);
- mDigitalWellBeingToast2.setBannerVisibility(visibility);
- } else if (mTaskIdContainer.length > 0 && mTaskIdContainer[0] == taskId) {
- mTaskThumbnailViewDeprecated.setVisibility(visibility);
- mDigitalWellBeingToast.setBannerVisibility(visibility);
- } else {
- mSnapshotView2.setVisibility(visibility);
- mDigitalWellBeingToast2.setBannerVisibility(visibility);
- }
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt
new file mode 100644
index 0000000..ba4d786
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt
@@ -0,0 +1,319 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.views
+
+import android.app.ActivityTaskManager.INVALID_TASK_ID
+import android.content.Context
+import android.graphics.PointF
+import android.util.AttributeSet
+import android.util.Log
+import android.view.View
+import com.android.internal.jank.Cuj
+import com.android.launcher3.Flags.enableOverviewIconMenu
+import com.android.launcher3.R
+import com.android.launcher3.Utilities
+import com.android.launcher3.config.FeatureFlags
+import com.android.launcher3.util.RunnableList
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT
+import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT
+import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
+import com.android.quickstep.TaskOverlayFactory
+import com.android.quickstep.util.RecentsOrientedState
+import com.android.quickstep.util.SplitSelectStateController
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.system.InteractionJankMonitorWrapper
+import com.android.wm.shell.shared.split.SplitScreenConstants.PersistentSnapPosition
+
+/**
+ * TaskView that contains and shows thumbnails for not one, BUT TWO(!!) tasks
+ *
+ * That's right. If you call within the next 5 minutes we'll go ahead and double your order and send
+ * you !! TWO !! Tasks along with their TaskThumbnailViews complimentary. On. The. House. And not
+ * only that, we'll even clean up your thumbnail request if you don't like it. All the benefits of
+ * one TaskView, except DOUBLED!
+ *
+ * (Icon loading sold separately, fees may apply. Shipping & Handling for Overlays not included).
+ */
+class GroupedTaskView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
+ TaskView(context, attrs, type = TaskViewType.GROUPED) {
+ // TODO(b/336612373): Support new TTV for GroupedTaskView
+ var splitBoundsConfig: SplitConfigurationOptions.SplitBounds? = null
+ private set
+
+ @get:PersistentSnapPosition
+ val snapPosition: Int
+ /** Returns the [PersistentSnapPosition] of this pair of tasks. */
+ get() = splitBoundsConfig?.snapPosition ?: STAGE_POSITION_UNDEFINED
+
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec)
+ val widthSize = MeasureSpec.getSize(widthMeasureSpec)
+ val heightSize = MeasureSpec.getSize(heightMeasureSpec)
+ setMeasuredDimension(widthSize, heightSize)
+ val splitBoundsConfig = splitBoundsConfig ?: return
+ val initSplitTaskId = getThisTaskCurrentlyInSplitSelection()
+ if (initSplitTaskId == INVALID_TASK_ID) {
+ pagedOrientationHandler.measureGroupedTaskViewThumbnailBounds(
+ taskContainers[0].snapshotView,
+ taskContainers[1].snapshotView,
+ widthSize,
+ heightSize,
+ splitBoundsConfig,
+ container.deviceProfile,
+ layoutDirection == LAYOUT_DIRECTION_RTL
+ )
+ } else {
+ // Currently being split with this taskView, let the non-split selected thumbnail
+ // take up full thumbnail area
+ taskContainers
+ .firstOrNull { it.task.key.id != initSplitTaskId }
+ ?.snapshotView
+ ?.measure(
+ widthMeasureSpec,
+ MeasureSpec.makeMeasureSpec(
+ heightSize - container.deviceProfile.overviewTaskThumbnailTopMarginPx,
+ MeasureSpec.EXACTLY
+ )
+ )
+ }
+ if (!enableOverviewIconMenu()) {
+ updateIconPlacement()
+ }
+ }
+
+ override fun onRecycle() {
+ super.onRecycle()
+ splitBoundsConfig = null
+ }
+
+ fun bind(
+ primaryTask: Task,
+ secondaryTask: Task,
+ orientedState: RecentsOrientedState,
+ taskOverlayFactory: TaskOverlayFactory,
+ splitBoundsConfig: SplitConfigurationOptions.SplitBounds?,
+ ) {
+ cancelPendingLoadTasks()
+ taskContainers =
+ listOf(
+ createTaskContainer(
+ primaryTask,
+ R.id.snapshot,
+ R.id.icon,
+ R.id.show_windows,
+ STAGE_POSITION_TOP_OR_LEFT,
+ taskOverlayFactory
+ ),
+ createTaskContainer(
+ secondaryTask,
+ R.id.bottomright_snapshot,
+ R.id.bottomRight_icon,
+ R.id.show_windows_right,
+ STAGE_POSITION_BOTTOM_OR_RIGHT,
+ taskOverlayFactory
+ )
+ )
+ taskContainers.forEach { it.bind() }
+
+ this.splitBoundsConfig = splitBoundsConfig
+ taskContainers.forEach { it.digitalWellBeingToast?.splitBounds = splitBoundsConfig }
+ setOrientationState(orientedState)
+ }
+
+ override fun setOrientationState(orientationState: RecentsOrientedState) {
+ if (enableOverviewIconMenu()) {
+ splitBoundsConfig?.let {
+ val groupedTaskViewSizes =
+ orientationState.orientationHandler.getGroupedTaskViewSizes(
+ container.deviceProfile,
+ it,
+ layoutParams.width,
+ layoutParams.height
+ )
+ val iconViewMarginStart =
+ resources.getDimensionPixelSize(
+ R.dimen.task_thumbnail_icon_menu_expanded_top_start_margin
+ )
+ val iconViewBackgroundMarginStart =
+ resources.getDimensionPixelSize(
+ R.dimen.task_thumbnail_icon_menu_background_margin_top_start
+ )
+ val iconMargins = (iconViewMarginStart + iconViewBackgroundMarginStart) * 2
+ // setMaxWidth() needs to be called before mIconView.setIconOrientation which is
+ // called in the super below.
+ (taskContainers[0].iconView as IconAppChipView).setMaxWidth(
+ groupedTaskViewSizes.first.x - iconMargins
+ )
+ (taskContainers[1].iconView as IconAppChipView).setMaxWidth(
+ groupedTaskViewSizes.second.x - iconMargins
+ )
+ }
+ }
+ super.setOrientationState(orientationState)
+ updateIconPlacement()
+ }
+
+ private fun updateIconPlacement() {
+ val splitBoundsConfig = splitBoundsConfig ?: return
+ val taskIconHeight = container.deviceProfile.overviewTaskIconSizePx
+ val isRtl = layoutDirection == LAYOUT_DIRECTION_RTL
+ if (enableOverviewIconMenu()) {
+ val groupedTaskViewSizes =
+ pagedOrientationHandler.getGroupedTaskViewSizes(
+ container.deviceProfile,
+ splitBoundsConfig,
+ layoutParams.width,
+ layoutParams.height
+ )
+ pagedOrientationHandler.setSplitIconParams(
+ taskContainers[0].iconView.asView(),
+ taskContainers[1].iconView.asView(),
+ taskIconHeight,
+ groupedTaskViewSizes.first.x,
+ groupedTaskViewSizes.first.y,
+ layoutParams.height,
+ layoutParams.width,
+ isRtl,
+ container.deviceProfile,
+ splitBoundsConfig
+ )
+ } else {
+ pagedOrientationHandler.setSplitIconParams(
+ taskContainers[0].iconView.asView(),
+ taskContainers[1].iconView.asView(),
+ taskIconHeight,
+ taskContainers[0].snapshotView.measuredWidth,
+ taskContainers[0].snapshotView.measuredHeight,
+ measuredHeight,
+ measuredWidth,
+ isRtl,
+ container.deviceProfile,
+ splitBoundsConfig
+ )
+ }
+ }
+
+ fun updateSplitBoundsConfig(splitBounds: SplitConfigurationOptions.SplitBounds?) {
+ splitBoundsConfig = splitBounds
+ taskContainers.forEach {
+ it.digitalWellBeingToast?.splitBounds = splitBoundsConfig
+ it.digitalWellBeingToast?.initialize(it.task)
+ }
+ invalidate()
+ }
+
+ override fun launchTaskAnimated(): RunnableList? {
+ if (taskContainers.isEmpty()) {
+ Log.d(TAG, "launchTaskAnimated - task is not bound")
+ return null
+ }
+ val recentsView = recentsView ?: return null
+ val endCallback = RunnableList()
+ // Callbacks run from remote animation when recents animation not currently running
+ InteractionJankMonitorWrapper.begin(
+ this,
+ Cuj.CUJ_SPLIT_SCREEN_ENTER,
+ "Enter form GroupedTaskView"
+ )
+ launchTaskInternal(isQuickSwitch = false, launchingExistingTaskView = true) {
+ endCallback.executeAllAndDestroy()
+ InteractionJankMonitorWrapper.end(Cuj.CUJ_SPLIT_SCREEN_ENTER)
+ }
+
+ // Callbacks get run from recentsView for case when recents animation already running
+ recentsView.addSideTaskLaunchCallback(endCallback)
+ return endCallback
+ }
+
+ override fun launchTask(callback: (launched: Boolean) -> Unit, isQuickSwitch: Boolean) {
+ launchTaskInternal(isQuickSwitch, false, callback /*launchingExistingTaskview*/)
+ }
+
+ /**
+ * @param launchingExistingTaskView [SplitSelectStateController.launchExistingSplitPair] uses
+ * existence of GroupedTaskView as control flow of how to animate in the incoming task. If
+ * we're launching from overview (from overview thumbnails) then pass in `true`, otherwise
+ * pass in `false` for case like quickswitching from home to task
+ */
+ private fun launchTaskInternal(
+ isQuickSwitch: Boolean,
+ launchingExistingTaskView: Boolean,
+ callback: (launched: Boolean) -> Unit
+ ) {
+ recentsView?.let {
+ it.splitSelectController.launchExistingSplitPair(
+ if (launchingExistingTaskView) this else null,
+ taskContainers[0].task.key.id,
+ taskContainers[1].task.key.id,
+ STAGE_POSITION_TOP_OR_LEFT,
+ callback,
+ isQuickSwitch,
+ snapPosition
+ )
+ Log.d(TAG, "launchTaskInternal - launchExistingSplitPair: ${taskIds.contentToString()}")
+ }
+ }
+
+ /**
+ * Returns taskId that split selection was initiated with, [INVALID_TASK_ID] if no tasks in this
+ * TaskView are part of split selection
+ */
+ private fun getThisTaskCurrentlyInSplitSelection(): Int {
+ val initialTaskId = recentsView?.splitSelectController?.initialTaskId
+ return if (initialTaskId != null && containsTaskId(initialTaskId)) initialTaskId
+ else INVALID_TASK_ID
+ }
+
+ override fun getLastSelectedChildTaskIndex(): Int {
+ if (recentsView?.splitSelectController?.isDismissingFromSplitPair == true) {
+ // return the container index of the task that wasn't initially selected to split
+ // with because that is the only remaining app that can be selected. The coordinate
+ // checks below aren't reliable since both of those views may be gone/transformed
+ val initSplitTaskId = getThisTaskCurrentlyInSplitSelection()
+ if (initSplitTaskId != INVALID_TASK_ID) {
+ return if (initSplitTaskId == taskContainers[0].task.key.id) 1 else 0
+ }
+ }
+
+ // Check which of the two apps was selected
+ if (
+ taskContainers[1].iconView.asView().containsPoint(lastTouchDownPosition) ||
+ taskContainers[1].snapshotView.containsPoint(lastTouchDownPosition)
+ ) {
+ return 1
+ }
+ return super.getLastSelectedChildTaskIndex()
+ }
+
+ private fun View.containsPoint(position: PointF): Boolean {
+ val localPos = floatArrayOf(position.x, position.y)
+ Utilities.mapCoordInSelfToDescendant(this, this@GroupedTaskView, localPos)
+ return Utilities.pointInView(this, localPos[0], localPos[1], 0f /* slop */)
+ }
+
+ override fun setOverlayEnabled(overlayEnabled: Boolean) {
+ if (FeatureFlags.enableAppPairs()) {
+ super.setOverlayEnabled(overlayEnabled)
+ } else {
+ // Intentional no-op to prevent setting smart actions overlay on thumbnails
+ }
+ }
+
+ companion object {
+ private const val TAG = "GroupedTaskView"
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/IconView.java b/quickstep/src/com/android/quickstep/views/IconView.java
deleted file mode 100644
index 1312ec3..0000000
--- a/quickstep/src/com/android/quickstep/views/IconView.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.views;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.view.Gravity;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.views.ActivityContext;
-import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
-import com.android.quickstep.util.RecentsOrientedState;
-
-/**
- * A view which draws a drawable stretched to fit its size. Unlike ImageView, it avoids relayout
- * when the drawable changes.
- */
-public class IconView extends View implements TaskViewIcon {
-
- @Nullable
- private Drawable mDrawable;
- private int mDrawableWidth, mDrawableHeight;
-
- public IconView(Context context) {
- super(context);
- }
-
- public IconView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public IconView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- /**
- * Sets a {@link Drawable} to be displayed.
- */
- @Override
- public void setDrawable(@Nullable Drawable d) {
- if (mDrawable != null) {
- mDrawable.setCallback(null);
- }
- mDrawable = d;
- if (mDrawable != null) {
- mDrawable.setCallback(this);
- setDrawableSizeInternal(getWidth(), getHeight());
- }
- invalidate();
- }
-
- /**
- * Sets the size of the icon drawable.
- */
- @Override
- public void setDrawableSize(int iconWidth, int iconHeight) {
- mDrawableWidth = iconWidth;
- mDrawableHeight = iconHeight;
- if (mDrawable != null) {
- setDrawableSizeInternal(getWidth(), getHeight());
- }
- }
-
- private void setDrawableSizeInternal(int selfWidth, int selfHeight) {
- Rect selfRect = new Rect(0, 0, selfWidth, selfHeight);
- Rect drawableRect = new Rect();
- Gravity.apply(Gravity.CENTER, mDrawableWidth, mDrawableHeight, selfRect, drawableRect);
- mDrawable.setBounds(drawableRect);
- }
-
- @Override
- @Nullable
- public Drawable getDrawable() {
- return mDrawable;
- }
-
- @Override
- public int getDrawableWidth() {
- return mDrawableWidth;
- }
-
- @Override
- public int getDrawableHeight() {
- return mDrawableHeight;
- }
-
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- if (mDrawable != null) {
- setDrawableSizeInternal(w, h);
- }
- }
-
- @Override
- protected boolean verifyDrawable(Drawable who) {
- return super.verifyDrawable(who) || who == mDrawable;
- }
-
- @Override
- protected void drawableStateChanged() {
- super.drawableStateChanged();
-
- final Drawable drawable = mDrawable;
- if (drawable != null && drawable.isStateful()
- && drawable.setState(getDrawableState())) {
- invalidateDrawable(drawable);
- }
- }
-
- @Override
- protected void onDraw(Canvas canvas) {
- if (mDrawable != null) {
- mDrawable.draw(canvas);
- }
- }
-
- @Override
- public boolean hasOverlappingRendering() {
- return false;
- }
-
- @Override
- public void setContentAlpha(float alpha) {
- setAlpha(alpha);
- }
-
- @Override
- public void setModalAlpha(float alpha) {
- setAlpha(alpha);
- }
-
- @Override
- public void setAlpha(float alpha) {
- super.setAlpha(alpha);
- if (alpha > 0) {
- setVisibility(VISIBLE);
- } else {
- setVisibility(INVISIBLE);
- }
- }
-
- /**
- * Set the tint color of the icon, useful for scrimming or dimming.
- *
- * @param color to blend in.
- * @param amount [0,1] 0 no tint, 1 full tint
- */
- @Override
- public void setIconColorTint(int color, float amount) {
- if (mDrawable != null) {
- mDrawable.setColorFilter(Utilities.makeColorTintingColorFilter(color, amount));
- }
- }
-
- @Override
- public void setIconOrientation(RecentsOrientedState orientationState, boolean isGridTask) {
- RecentsPagedOrientationHandler orientationHandler =
- orientationState.getOrientationHandler();
- boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
- DeviceProfile deviceProfile =
- ActivityContext.lookupContext(getContext()).getDeviceProfile();
-
- FrameLayout.LayoutParams iconParams = (FrameLayout.LayoutParams) getLayoutParams();
-
- int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
- int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
- int taskMargin = deviceProfile.overviewTaskMarginPx;
-
- orientationHandler.setTaskIconParams(iconParams, taskMargin, taskIconHeight,
- thumbnailTopMargin, isRtl);
- iconParams.width = iconParams.height = taskIconHeight;
- setLayoutParams(iconParams);
-
- setRotation(orientationHandler.getDegreesRotated());
- int iconDrawableSize = isGridTask ? deviceProfile.overviewTaskIconDrawableSizeGridPx
- : deviceProfile.overviewTaskIconDrawableSizePx;
- setDrawableSize(iconDrawableSize, iconDrawableSize);
- }
-
- @Override
- public View asView() {
- return this;
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/IconView.kt b/quickstep/src/com/android/quickstep/views/IconView.kt
new file mode 100644
index 0000000..583207f
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/IconView.kt
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.views
+
+import android.content.Context
+import android.graphics.Canvas
+import android.graphics.Rect
+import android.graphics.drawable.Drawable
+import android.util.AttributeSet
+import android.view.Gravity
+import android.view.View
+import android.widget.FrameLayout
+import androidx.core.view.updateLayoutParams
+import com.android.launcher3.DeviceProfile
+import com.android.launcher3.Utilities
+import com.android.launcher3.util.MultiValueAlpha
+import com.android.launcher3.views.ActivityContext
+import com.android.quickstep.util.RecentsOrientedState
+
+/**
+ * A view which draws a drawable stretched to fit its size. Unlike ImageView, it avoids relayout
+ * when the drawable changes.
+ */
+class IconView : View, TaskViewIcon {
+ private val multiValueAlpha: MultiValueAlpha = MultiValueAlpha(this, NUM_ALPHA_CHANNELS)
+ private var drawable: Drawable? = null
+ private var drawableWidth = 0
+ private var drawableHeight = 0
+
+ constructor(context: Context) : super(context)
+
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int,
+ ) : super(context, attrs, defStyleAttr)
+
+ init {
+ multiValueAlpha.setUpdateVisibility(true)
+ }
+
+ /** Sets a [Drawable] to be displayed. */
+ override fun setDrawable(d: Drawable?) {
+ drawable?.callback = null
+
+ drawable = d
+ drawable?.let {
+ it.callback = this
+ setDrawableSizeInternal(width, height)
+ }
+ invalidate()
+ }
+
+ /** Sets the size of the icon drawable. */
+ override fun setDrawableSize(iconWidth: Int, iconHeight: Int) {
+ drawableWidth = iconWidth
+ drawableHeight = iconHeight
+ drawable?.let { setDrawableSizeInternal(width, height) }
+ }
+
+ private fun setDrawableSizeInternal(selfWidth: Int, selfHeight: Int) {
+ val selfRect = Rect(0, 0, selfWidth, selfHeight)
+ val drawableRect = Rect()
+ Gravity.apply(Gravity.CENTER, drawableWidth, drawableHeight, selfRect, drawableRect)
+ drawable?.bounds = drawableRect
+ }
+
+ override fun getDrawable(): Drawable? = drawable
+
+ override fun getDrawableWidth(): Int = drawableWidth
+
+ override fun getDrawableHeight(): Int = drawableHeight
+
+ override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
+ super.onSizeChanged(w, h, oldw, oldh)
+ drawable?.let { setDrawableSizeInternal(w, h) }
+ }
+
+ override fun verifyDrawable(who: Drawable): Boolean =
+ super.verifyDrawable(who) || who === drawable
+
+ override fun drawableStateChanged() {
+ super.drawableStateChanged()
+ drawable?.let {
+ if (it.isStateful && it.setState(drawableState)) {
+ invalidateDrawable(it)
+ }
+ }
+ }
+
+ override fun onDraw(canvas: Canvas) {
+ drawable?.draw(canvas)
+ }
+
+ override fun hasOverlappingRendering(): Boolean = false
+
+ override fun setContentAlpha(alpha: Float) {
+ multiValueAlpha[INDEX_CONTENT_ALPHA].setValue(alpha)
+ }
+
+ override fun setModalAlpha(alpha: Float) {
+ multiValueAlpha[INDEX_MODAL_ALPHA].setValue(alpha)
+ }
+
+ /**
+ * Set the tint color of the icon, useful for scrimming or dimming.
+ *
+ * @param color to blend in.
+ * @param amount [0,1] 0 no tint, 1 full tint
+ */
+ override fun setIconColorTint(color: Int, amount: Float) {
+ drawable?.colorFilter = Utilities.makeColorTintingColorFilter(color, amount)
+ }
+
+ override fun setIconOrientation(orientationState: RecentsOrientedState, isGridTask: Boolean) {
+ val orientationHandler = orientationState.orientationHandler
+ val deviceProfile: DeviceProfile =
+ (ActivityContext.lookupContext(context) as ActivityContext).getDeviceProfile()
+ orientationHandler.setTaskIconParams(
+ iconParams = getLayoutParams() as FrameLayout.LayoutParams,
+ taskIconMargin = deviceProfile.overviewTaskMarginPx,
+ taskIconHeight = deviceProfile.overviewTaskIconSizePx,
+ thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx,
+ isRtl = layoutDirection == LAYOUT_DIRECTION_RTL
+ )
+ updateLayoutParams<FrameLayout.LayoutParams> {
+ height = deviceProfile.overviewTaskIconSizePx
+ width = height
+ }
+ setRotation(orientationHandler.degreesRotated)
+ val iconDrawableSize =
+ if (isGridTask) deviceProfile.overviewTaskIconDrawableSizeGridPx
+ else deviceProfile.overviewTaskIconDrawableSizePx
+ setDrawableSize(iconDrawableSize, iconDrawableSize)
+ }
+
+ override fun asView(): View = this
+
+ companion object {
+ private const val NUM_ALPHA_CHANNELS = 2
+ private const val INDEX_CONTENT_ALPHA = 0
+ private const val INDEX_MODAL_ALPHA = 1
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index 8d1907f..d20d0a5 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -26,7 +26,7 @@
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
-import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
+import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;
import android.annotation.TargetApi;
import android.content.Context;
@@ -37,6 +37,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.desktop.DesktopRecentsTransitionController;
@@ -53,9 +54,12 @@
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.RotationTouchHelper;
import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.util.AnimUtils;
import com.android.quickstep.util.SplitSelectStateController;
import com.android.systemui.shared.recents.model.Task;
+import kotlin.Unit;
+
/**
* {@link RecentsView} used in Launcher activity
*/
@@ -88,10 +92,12 @@
protected void handleStartHome(boolean animated) {
StateManager stateManager = getStateManager();
animated &= stateManager.shouldAnimateStateChange();
- stateManager.goToState(NORMAL, animated);
- if (FeatureFlags.enableSplitContextually()) {
- mSplitSelectStateController.getSplitAnimationController()
- .playPlaceholderDismissAnim(mContainer, LAUNCHER_SPLIT_SELECTION_EXIT_HOME);
+ if (mSplitSelectStateController.isSplitSelectActive()) {
+ AnimUtils.goToNormalStateWithSplitDismissal(stateManager, mContainer,
+ LAUNCHER_SPLIT_SELECTION_EXIT_HOME,
+ mSplitSelectStateController.getSplitAnimationController());
+ } else {
+ stateManager.goToState(NORMAL, animated);
}
AbstractFloatingView.closeAllOpenViews(mContainer, animated);
}
@@ -102,12 +108,12 @@
}
@Override
- public StateManager<LauncherState> getStateManager() {
+ public StateManager<LauncherState, Launcher> getStateManager() {
return mContainer.getStateManager();
}
@Override
- protected void onTaskLaunchAnimationEnd(boolean success) {
+ protected Unit onTaskLaunchAnimationEnd(boolean success) {
if (success) {
getStateManager().moveToRestState();
} else {
@@ -115,6 +121,7 @@
mContainer.getAllAppsController().setState(state);
}
super.onTaskLaunchAnimationEnd(success);
+ return Unit.INSTANCE;
}
@Override
@@ -143,7 +150,7 @@
@Override
public void onStateTransitionStart(LauncherState toState) {
- setOverviewStateEnabled(toState.overviewUi);
+ setOverviewStateEnabled(toState.isRecentsViewVisible);
setOverviewGridEnabled(toState.displayOverviewTasksAsGrid(mContainer.getDeviceProfile()));
setOverviewFullscreenEnabled(toState.getOverviewFullscreenProgress() == 1);
@@ -154,7 +161,7 @@
}
// Set border after select mode changes to avoid showing border during state transition
- if (!toState.overviewUi || toState == OVERVIEW_MODAL_TASK) {
+ if (!toState.isRecentsViewVisible || toState == OVERVIEW_MODAL_TASK) {
setTaskBorderEnabled(false);
}
@@ -178,7 +185,7 @@
setOverviewSelectEnabled(false);
}
- if (finalState.overviewUi && finalState != OVERVIEW_MODAL_TASK) {
+ if (finalState.isRecentsViewVisible && finalState != OVERVIEW_MODAL_TASK) {
setTaskBorderEnabled(true);
}
@@ -203,7 +210,7 @@
public boolean onTouchEvent(MotionEvent ev) {
boolean result = super.onTouchEvent(ev);
// Do not let touch escape to siblings below this view.
- return result || getStateManager().getState().overviewUi;
+ return result || getStateManager().getState().isRecentsViewVisible;
}
@Override
@@ -261,7 +268,7 @@
super.onGestureAnimationStart(runningTasks, rotationTouchHelper);
DesktopVisibilityController desktopVisibilityController =
mContainer.getDesktopVisibilityController();
- if (!enableDesktopWindowingWallpaperActivity() && desktopVisibilityController != null) {
+ if (!WALLPAPER_ACTIVITY.isEnabled(mContext) && desktopVisibilityController != null) {
// TODO: b/333533253 - Remove after flag rollout
desktopVisibilityController.setRecentsGestureStart();
}
@@ -284,7 +291,7 @@
}
}
super.onGestureAnimationEnd();
- if (!enableDesktopWindowingWallpaperActivity() && desktopVisibilityController != null) {
+ if (!WALLPAPER_ACTIVITY.isEnabled(mContext) && desktopVisibilityController != null) {
// TODO: b/333533253 - Remove after flag rollout
desktopVisibilityController.setRecentsGestureEnd(endTarget);
}
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 5188d4a..4a2be2a 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -20,6 +20,7 @@
import android.content.res.Configuration;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
@@ -33,9 +34,8 @@
import com.android.launcher3.Flags;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.TaskOverlayFactory.OverlayUICallbacks;
@@ -43,13 +43,14 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.Arrays;
/**
* View for showing action buttons in Overview
*/
public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayout
implements OnClickListener, Insettable {
-
+ public static final String TAG = "OverviewActionsView";
private final Rect mInsets = new Rect();
@IntDef(flag = true, value = {
@@ -89,31 +90,33 @@
private static final int INDEX_HIDDEN_FLAGS_ALPHA = 3;
private static final int INDEX_SHARE_TARGET_ALPHA = 4;
private static final int INDEX_SCROLL_ALPHA = 5;
- private static final int NUM_ALPHAS = 6;
-
- public @interface ScreenshotButtonHiddenFlags { }
- public static final int FLAG_MULTIPLE_TASKS_HIDE_SCREENSHOT = 1 << 0;
+ private static final int INDEX_GROUPED_ALPHA = 6;
+ private static final int INDEX_3P_LAUNCHER = 7;
+ private static final int NUM_ALPHAS = 8;
public @interface SplitButtonHiddenFlags { }
public static final int FLAG_SMALL_SCREEN_HIDE_SPLIT = 1 << 0;
- public static final int FLAG_MULTIPLE_TASKS_HIDE_SPLIT = 1 << 1;
- public @interface SplitButtonDisabledFlags { }
- public static final int FLAG_SINGLE_TASK_DISABLE_SPLIT = 1 << 0;
+ /**
+ * Holds an AnimatedFloat for each alpha property, used to set or animate alpha values in
+ * {@link #mMultiValueAlphas}.
+ */
+ private final AnimatedFloat[] mAlphaProperties = new AnimatedFloat[NUM_ALPHAS];
- public @interface AppPairButtonHiddenFlags { }
- public static final int FLAG_SINGLE_TASK_HIDE_APP_PAIR = 1 << 0;
- public static final int FLAG_SMALL_SCREEN_HIDE_APP_PAIR = 1 << 1;
- public static final int FLAG_3P_LAUNCHER_HIDE_APP_PAIR = 1 << 2;
+ /** Holds MultiValueAlpha values for all actions bars */
+ private final MultiValueAlpha[] mMultiValueAlphas = new MultiValueAlpha[2];
+ /** Index used for single-task actions in the mMultiValueAlphas array */
+ private static final int ACTIONS_ALPHAS = 0;
+ /** Index used for grouped-task actions in the mMultiValueAlphas array */
+ private static final int GROUP_ACTIONS_ALPHAS = 1;
- private MultiValueAlpha mMultiValueAlpha;
-
+ /** Container for the action buttons below a focused, non-split Overview tile. */
protected LinearLayout mActionButtons;
- // The screenshot button is implemented as a Button in launcher3 and NexusLauncher, but is an
- // ImageButton in go launcher (does not share a common class with Button). Take care when
- // casting this.
- private View mScreenshotButton;
private Button mSplitButton;
+ /**
+ * The "save app pair" button. Currently this is the only button that is not contained in
+ * mActionButtons, since it is the sole button that appears for a grouped task.
+ */
private Button mSaveAppPairButton;
@ActionsHiddenFlags
@@ -122,21 +125,17 @@
@ActionsDisabledFlags
protected int mDisabledFlags;
- @ScreenshotButtonHiddenFlags
- private int mScreenshotButtonHiddenFlags;
-
@SplitButtonHiddenFlags
private int mSplitButtonHiddenFlags;
- @AppPairButtonHiddenFlags
- private int mAppPairButtonHiddenFlags;
-
@Nullable
protected T mCallbacks;
@Nullable
protected DeviceProfile mDp;
private final Rect mTaskSize = new Rect();
+ private boolean mIsGroupedTask = false;
+ private boolean mCanSaveAppPair = false;
public OverviewActionsView(Context context) {
this(context, null);
@@ -153,15 +152,34 @@
@Override
protected void onFinishInflate() {
super.onFinishInflate();
+ // Initialize 2 view containers: one for single tasks, one for grouped tasks.
+ // These will take up the same space on the screen and alternate visibility as needed.
+ // Currently, the only grouped task action is "save app pairs".
mActionButtons = findViewById(R.id.action_buttons);
- mMultiValueAlpha = new MultiValueAlpha(mActionButtons, NUM_ALPHAS);
- mMultiValueAlpha.setUpdateVisibility(true);
+ mSaveAppPairButton = findViewById(R.id.action_save_app_pair);
+ // Initialize a list to hold alphas for mActionButtons and any group action buttons.
+ mMultiValueAlphas[ACTIONS_ALPHAS] = new MultiValueAlpha(mActionButtons, NUM_ALPHAS);
+ mMultiValueAlphas[GROUP_ACTIONS_ALPHAS] =
+ new MultiValueAlpha(mSaveAppPairButton, NUM_ALPHAS);
+ Arrays.stream(mMultiValueAlphas).forEach(a -> a.setUpdateVisibility(true));
+ // To control alpha simultaneously on mActionButtons and any group action buttons, we set up
+ // an AnimatedFloat for each alpha property.
+ for (int i = 0; i < NUM_ALPHAS; i++) {
+ final int index = i;
+ mAlphaProperties[index] = new AnimatedFloat(() -> {
+ for (MultiValueAlpha multiValueAlpha : mMultiValueAlphas) {
+ multiValueAlpha.get(index).setValue(mAlphaProperties[index].value);
+ }
+ }, 1f /* initialValue */);
+ }
- mScreenshotButton = findViewById(R.id.action_screenshot);
- mScreenshotButton.setOnClickListener(this);
+ // The screenshot button is implemented as a Button in launcher3 and NexusLauncher, but is
+ // an ImageButton in go launcher (does not share a common class with Button). Take care when
+ // casting this.
+ View screenshotButton = findViewById(R.id.action_screenshot);
+ screenshotButton.setOnClickListener(this);
mSplitButton = findViewById(R.id.action_split);
mSplitButton.setOnClickListener(this);
- mSaveAppPairButton = findViewById(R.id.action_save_app_pair);
mSaveAppPairButton.setOnClickListener(this);
}
@@ -209,7 +227,7 @@
mHiddenFlags &= ~visibilityFlags;
}
boolean isHidden = mHiddenFlags != 0;
- mMultiValueAlpha.get(INDEX_HIDDEN_FLAGS_ALPHA).setValue(isHidden ? 0 : 1);
+ mAlphaProperties[INDEX_HIDDEN_FLAGS_ALPHA].updateValue(isHidden ? 0 : 1);
}
/**
@@ -234,14 +252,15 @@
* Updates a batch of flags to hide and show actions buttons when a grouped task (split screen)
* is focused.
* @param isGroupedTask True if the focused task is a grouped task.
+ * @param canSaveAppPair True if the focused task is a grouped task and can be saved as an app
+ * pair.
*/
- public void updateForGroupedTask(boolean isGroupedTask) {
- // Update flags to see if split button should be hidden.
- updateSplitButtonHiddenFlags(FLAG_MULTIPLE_TASKS_HIDE_SPLIT, isGroupedTask);
- // Update flags to see if screenshot button should be hidden.
- updateScreenshotButtonHiddenFlags(FLAG_MULTIPLE_TASKS_HIDE_SCREENSHOT, isGroupedTask);
- // Update flags to see if save app pair button should be hidden.
- updateAppPairButtonHiddenFlags(FLAG_SINGLE_TASK_HIDE_APP_PAIR, !isGroupedTask);
+ public void updateForGroupedTask(boolean isGroupedTask, boolean canSaveAppPair) {
+ Log.d(TAG, "updateForGroupedTask() called with: isGroupedTask = [" + isGroupedTask
+ + "], canSaveAppPair = [" + canSaveAppPair + "]");
+ mIsGroupedTask = isGroupedTask;
+ mCanSaveAppPair = canSaveAppPair;
+ updateActionButtonsVisibility();
}
/**
@@ -251,36 +270,34 @@
assert mDp != null;
// Update flags to see if split button should be hidden.
updateSplitButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_SPLIT, !mDp.isTablet);
- // Update flags to see if save app pair button should be hidden.
- updateAppPairButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_APP_PAIR, !mDp.isTablet);
+ updateActionButtonsVisibility();
+ }
+
+ private void updateActionButtonsVisibility() {
+ if (mDp == null) {
+ return;
+ }
+ boolean showSingleTaskActions = !mIsGroupedTask;
+ boolean showGroupActions = mIsGroupedTask && mDp.isTablet && mCanSaveAppPair;
+ Log.d(TAG, "updateActionButtonsVisibility() called: showSingleTaskActions = ["
+ + showSingleTaskActions + "], showGroupActions = [" + showGroupActions + "]");
+ getActionsAlphas().get(INDEX_GROUPED_ALPHA).setValue(showSingleTaskActions ? 1 : 0);
+ getGroupActionsAlphas().get(INDEX_GROUPED_ALPHA).setValue(showGroupActions ? 1 : 0);
}
/**
* Updates flags to hide and show actions buttons for 1p/3p launchers.
*/
public void updateFor3pLauncher(boolean is3pLauncher) {
- updateAppPairButtonHiddenFlags(FLAG_3P_LAUNCHER_HIDE_APP_PAIR, is3pLauncher);
+ getGroupActionsAlphas().get(INDEX_3P_LAUNCHER).setValue(is3pLauncher ? 0 : 1);
}
- /**
- * Updates the proper flags to indicate whether the "Screenshot" button should be hidden.
- *
- * @param flag The flag to update.
- * @param enable Whether to enable the hidden flag: True will cause view to be hidden.
- */
- private void updateScreenshotButtonHiddenFlags(@ScreenshotButtonHiddenFlags int flag,
- boolean enable) {
- if (mScreenshotButton == null) return;
- if (enable) {
- mScreenshotButtonHiddenFlags |= flag;
- } else {
- mScreenshotButtonHiddenFlags &= ~flag;
- }
- int desiredVisibility = mScreenshotButtonHiddenFlags == 0 ? VISIBLE : GONE;
- if (mScreenshotButton.getVisibility() != desiredVisibility) {
- mScreenshotButton.setVisibility(desiredVisibility);
- mActionButtons.requestLayout();
- }
+ private MultiValueAlpha getActionsAlphas() {
+ return mMultiValueAlphas[ACTIONS_ALPHAS];
+ }
+
+ private MultiValueAlpha getGroupActionsAlphas() {
+ return mMultiValueAlphas[GROUP_ACTIONS_ALPHAS];
}
/**
@@ -304,56 +321,32 @@
}
}
- /**
- * Updates the proper flags to indicate whether the "Save app pair" button should be disabled.
- *
- * @param flag The flag to update.
- * @param enable Whether to enable the hidden flag: True will cause view to be hidden.
- */
- private void updateAppPairButtonHiddenFlags(
- @AppPairButtonHiddenFlags int flag, boolean enable) {
- if (!FeatureFlags.enableAppPairs()) {
- return;
- }
-
- if (mSaveAppPairButton == null) return;
- if (enable) {
- mAppPairButtonHiddenFlags |= flag;
- } else {
- mAppPairButtonHiddenFlags &= ~flag;
- }
- int desiredVisibility = mAppPairButtonHiddenFlags == 0 ? VISIBLE : GONE;
- if (mSaveAppPairButton.getVisibility() != desiredVisibility) {
- mSaveAppPairButton.setVisibility(desiredVisibility);
- mActionButtons.requestLayout();
- }
+ public AnimatedFloat getContentAlpha() {
+ return mAlphaProperties[INDEX_CONTENT_ALPHA];
}
- public MultiProperty getContentAlpha() {
- return mMultiValueAlpha.get(INDEX_CONTENT_ALPHA);
+ public AnimatedFloat getVisibilityAlpha() {
+ return mAlphaProperties[INDEX_VISIBILITY_ALPHA];
}
- public MultiProperty getVisibilityAlpha() {
- return mMultiValueAlpha.get(INDEX_VISIBILITY_ALPHA);
+ public AnimatedFloat getFullscreenAlpha() {
+ return mAlphaProperties[INDEX_FULLSCREEN_ALPHA];
}
- public MultiProperty getFullscreenAlpha() {
- return mMultiValueAlpha.get(INDEX_FULLSCREEN_ALPHA);
+ public AnimatedFloat getShareTargetAlpha() {
+ return mAlphaProperties[INDEX_SHARE_TARGET_ALPHA];
}
- public MultiProperty getShareTargetAlpha() {
- return mMultiValueAlpha.get(INDEX_SHARE_TARGET_ALPHA);
- }
-
- public MultiProperty getIndexScrollAlpha() {
- return mMultiValueAlpha.get(INDEX_SCROLL_ALPHA);
+ public AnimatedFloat getIndexScrollAlpha() {
+ return mAlphaProperties[INDEX_SCROLL_ALPHA];
}
/**
* Returns the visibility of the overview actions buttons.
*/
- public @Visibility int getActionsButtonVisibility() {
- return mActionButtons.getVisibility();
+ public boolean areActionsButtonsVisible() {
+ return mActionButtons.getVisibility() == View.VISIBLE
+ || mSaveAppPairButton.getVisibility() == View.VISIBLE;
}
/**
@@ -366,10 +359,17 @@
/** Updates vertical margins for different navigation mode or configuration changes. */
public void updateVerticalMargin(NavigationMode mode) {
+ updateActionBarPosition(mActionButtons);
+ updateActionBarPosition(mSaveAppPairButton);
+ }
+
+ /** Positions actions buttons according to device settings and insets. */
+ private void updateActionBarPosition(View actionBar) {
if (mDp == null) {
return;
}
- LayoutParams actionParams = (LayoutParams) mActionButtons.getLayoutParams();
+
+ LayoutParams actionParams = (LayoutParams) actionBar.getLayoutParams();
actionParams.setMargins(
actionParams.leftMargin, mDp.overviewActionsTopMarginPx,
actionParams.rightMargin, getBottomMargin());
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 62fa6c8..255619a 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -31,12 +31,18 @@
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.app.animation.Interpolators.OVERSHOOT_0_75;
import static com.android.app.animation.Interpolators.clampToProgress;
+import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType;
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
+import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
+import static com.android.launcher3.Flags.enableDesktopTaskAlphaAnimation;
import static com.android.launcher3.Flags.enableGridOnlyOverview;
+import static com.android.launcher3.Flags.enableLargeDesktopWindowingTile;
+import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS;
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
+import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION;
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
@@ -44,6 +50,7 @@
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.Utilities.squaredTouchSlop;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ORIENTATION_CHANGED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_SWIPE_DOWN;
@@ -53,6 +60,7 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
+import static com.android.quickstep.BaseContainerInterface.getTaskDimension;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
import static com.android.quickstep.util.LogUtils.splitFailureMessage;
import static com.android.quickstep.util.TaskGridNavHelper.DIRECTION_DOWN;
@@ -86,6 +94,7 @@
import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.PointF;
@@ -128,6 +137,7 @@
import androidx.core.graphics.ColorUtils;
import com.android.internal.jank.Cuj;
+import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseActivity.MultiWindowModeChangedListener;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
@@ -144,11 +154,13 @@
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.desktop.DesktopRecentsTransitionController;
+import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StateManager;
+import com.android.launcher3.statemanager.StatefulContainer;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.OverScroll;
@@ -167,7 +179,6 @@
import com.android.launcher3.util.VibratorWrapper;
import com.android.launcher3.util.ViewPool;
import com.android.quickstep.BaseContainerInterface;
-import com.android.quickstep.DesktopModeStatus;
import com.android.quickstep.GestureState;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.RecentsAnimationController;
@@ -186,6 +197,14 @@
import com.android.quickstep.TopTaskTracker;
import com.android.quickstep.ViewUtils;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
+import com.android.quickstep.recents.data.RecentTasksRepository;
+import com.android.quickstep.recents.data.RecentsDeviceProfileRepository;
+import com.android.quickstep.recents.data.RecentsDeviceProfileRepositoryImpl;
+import com.android.quickstep.recents.data.RecentsRotationStateRepository;
+import com.android.quickstep.recents.data.RecentsRotationStateRepositoryImpl;
+import com.android.quickstep.recents.di.RecentsDependencies;
+import com.android.quickstep.recents.viewmodel.RecentsViewData;
+import com.android.quickstep.recents.viewmodel.RecentsViewModel;
import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.AnimUtils;
@@ -194,6 +213,7 @@
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.util.RecentsAtomicAnimationFactory;
import com.android.quickstep.util.RecentsOrientedState;
+import com.android.quickstep.util.RecentsViewUtils;
import com.android.quickstep.util.SplitAnimationController.Companion.SplitAnimInitProps;
import com.android.quickstep.util.SplitAnimationTimings;
import com.android.quickstep.util.SplitSelectStateController;
@@ -204,7 +224,6 @@
import com.android.quickstep.util.TaskVisualsChangeListener;
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.util.VibrationConstants;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
import com.android.systemui.plugins.ResourceProvider;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -214,24 +233,32 @@
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.wm.shell.common.pip.IPipAnimationListener;
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
+import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource;
+
+import kotlin.Unit;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
+import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
* A list of recent tasks.
+ *
* @param <CONTAINER_TYPE> : the container that should host recents view
- * @param <STATE_TYPE> : the type of base state that will be used
+ * @param <STATE_TYPE> : the type of base state that will be used
*/
-
-public abstract class RecentsView<CONTAINER_TYPE extends Context & RecentsViewContainer,
+public abstract class RecentsView<
+ CONTAINER_TYPE extends Context & RecentsViewContainer,
STATE_TYPE extends BaseState<STATE_TYPE>> extends PagedView implements Insettable,
TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback,
TaskVisualsChangeListener {
@@ -294,16 +321,37 @@
}
};
+ public static final FloatProperty<RecentsView> RUNNING_TASK_ATTACH_ALPHA =
+ new FloatProperty<RecentsView>("runningTaskAttachAlpha") {
+ @Override
+ public void setValue(RecentsView recentsView, float v) {
+ TaskView runningTask = recentsView.getRunningTaskView();
+ if (runningTask == null) {
+ return;
+ }
+ runningTask.setAttachAlpha(v);
+ }
+
+ @Override
+ public Float get(RecentsView recentsView) {
+ TaskView runningTask = recentsView.getRunningTaskView();
+ if (runningTask == null) {
+ return null;
+ }
+ return runningTask.getAttachAlpha();
+ }
+ };
+
public static final int SCROLL_VIBRATION_PRIMITIVE =
Utilities.ATLEAST_S ? VibrationEffect.Composition.PRIMITIVE_LOW_TICK : -1;
public static final float SCROLL_VIBRATION_PRIMITIVE_SCALE = 0.6f;
public static final VibrationEffect SCROLL_VIBRATION_FALLBACK =
VibrationConstants.EFFECT_TEXTURE_TICK;
+ public static final int UNBOUND_TASK_VIEW_ID = -1;
/**
* Can be used to tint the color of the RecentsView to simulate a scrim that can views
* excluded from. Really should be a proper scrim.
- * TODO(b/187528071): Remove this and replace with a real scrim.
*/
private static final FloatProperty<RecentsView> COLOR_TINT =
new FloatProperty<RecentsView>("colorTint") {
@@ -376,6 +424,9 @@
public void setValue(RecentsView view, float scale) {
view.setScaleX(scale);
view.setScaleY(scale);
+ if (enableRefactorTaskThumbnail()) {
+ view.mRecentsViewModel.updateScale(scale);
+ }
view.mLastComputedTaskStartPushOutDistance = null;
view.mLastComputedTaskEndPushOutDistance = null;
view.runActionOnRemoteHandles(new Consumer<RemoteTargetHandle>() {
@@ -530,6 +581,7 @@
// Progress from 0 to 1 where 0 is a carousel and 1 is a 2 row grid.
private float mGridProgress = 0;
private float mTaskThumbnailSplashAlpha = 0;
+ private boolean mBorderEnabled = false;
private boolean mShowAsGridLastOnLayout = false;
private final IntSet mTopRowIdSet = new IntSet();
private int mClearAllShortTotalWidthTranslation = 0;
@@ -538,7 +590,6 @@
@Nullable
protected GestureState.GestureEndTarget mCurrentGestureEndTarget;
- // TODO(b/187528071): Remove these and replace with a real scrim.
private float mColorTint;
private final int mTintingColor;
@Nullable
@@ -591,7 +642,7 @@
if (taskView == null) {
return;
}
- Task.TaskKey taskKey = taskView.getTask().key;
+ Task.TaskKey taskKey = taskView.getFirstTask().key;
UI_HELPER_EXECUTOR.execute(new CancellableTask<>(
() -> PackageManagerWrapper.getInstance()
.getActivityInfo(taskKey.getComponent(), taskKey.userId) == null,
@@ -629,7 +680,7 @@
protected boolean mRunningTaskTileHidden;
@Nullable
private Task[] mTmpRunningTasks;
- protected int mFocusedTaskViewId = -1;
+ protected int mFocusedTaskViewId = INVALID_TASK_ID;
private boolean mTaskIconScaledDown = false;
private boolean mRunningTaskShowScreenshot = false;
@@ -701,10 +752,12 @@
private final SplitSelectionListener mSplitSelectionListener = new SplitSelectionListener() {
@Override
- public void onSplitSelectionConfirmed() { }
+ public void onSplitSelectionConfirmed() {
+ }
@Override
- public void onSplitSelectionActive() { }
+ public void onSplitSelectionActive() {
+ }
@Override
public void onSplitSelectionExit(boolean launchedSplit) {
@@ -723,7 +776,11 @@
private int mSplitHiddenTaskViewIndex = -1;
@Nullable
private FloatingTaskView mSecondFloatingTaskView;
- private View mSplitDividerPlaceholderView;
+ /**
+ * A fullscreen scrim that goes behind the splitscreen animation to hide color conflicts and
+ * possible flickers. Removed after tasks + divider finish animating in.
+ */
+ private View mSplitScrim;
/**
* The task to be removed and immediately re-added. Should not be added to task pool.
@@ -770,10 +827,25 @@
// keeps track of the state of the filter for tasks in recents view
private final RecentsFilterState mFilterState = new RecentsFilterState();
+ private int mOffsetMidpointIndexOverride = INVALID_PAGE;
+
+ /**
+ * Whether or not any task has been dismissed i.e. swiped away by the user, in the lifetime of
+ * RecentsView being open and displayed to the user. It is reset in the {@link #reset()} method
+ * i.e. when RecentsView closes.
+ */
+ private boolean mAnyTaskHasBeenDismissed;
+
+ private final RecentsViewModel mRecentsViewModel;
+ private final RecentsViewModelHelper mHelper;
+
+ private final RecentsViewUtils mRecentsViewUtils = new RecentsViewUtils();
+
public RecentsView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
BaseContainerInterface sizeStrategy) {
super(context, attrs, defStyleAttr);
setEnableFreeScroll(true);
+
mSizeStrategy = sizeStrategy;
mContainer = RecentsViewContainer.containerFromContext(context);
mOrientationState = new RecentsOrientedState(
@@ -781,6 +853,26 @@
final int rotation = mContainer.getDisplay().getRotation();
mOrientationState.setRecentsRotation(rotation);
+ // Start Recents Dependency graph
+ if (enableRefactorTaskThumbnail()) {
+ RecentsDependencies recentsDependencies = RecentsDependencies.Companion.initialize(
+ this);
+ mRecentsViewModel = new RecentsViewModel(
+ recentsDependencies.inject(RecentTasksRepository.class),
+ recentsDependencies.inject(RecentsViewData.class)
+ );
+ mHelper = new RecentsViewModelHelper(mRecentsViewModel);
+
+ recentsDependencies.provide(RecentsRotationStateRepository.class,
+ () -> new RecentsRotationStateRepositoryImpl(mOrientationState));
+
+ recentsDependencies.provide(RecentsDeviceProfileRepository.class,
+ () -> new RecentsDeviceProfileRepositoryImpl(mContainer));
+ } else {
+ mRecentsViewModel = null;
+ mHelper = null;
+ }
+
mScrollHapticMinGapMillis = getResources()
.getInteger(R.integer.recentsScrollHapticMinGapMillis);
mFastFlingVelocity = getResources()
@@ -986,15 +1078,20 @@
@Override
@Nullable
public Task onTaskThumbnailChanged(int taskId, ThumbnailData thumbnailData) {
+ if (enableRefactorTaskThumbnail()) {
+ return null;
+ }
if (mHandleTaskStackChanges) {
- TaskView taskView = getTaskViewByTaskId(taskId);
- if (taskView != null) {
- for (TaskIdAttributeContainer container :
- taskView.getTaskIdAttributeContainers()) {
- if (container == null || taskId != container.getTask().key.id) {
- continue;
+ if (!enableRefactorTaskThumbnail()) {
+ TaskView taskView = getTaskViewByTaskId(taskId);
+ if (taskView != null) {
+ for (TaskContainer container : taskView.getTaskContainers()) {
+ if (container == null || taskId != container.getTask().key.id) {
+ continue;
+ }
+ container.getThumbnailViewDeprecated().setThumbnail(container.getTask(),
+ thumbnailData);
}
- container.getThumbnailView().setThumbnail(container.getTask(), thumbnailData);
}
}
}
@@ -1002,14 +1099,14 @@
}
@Override
- public void onTaskIconChanged(String pkg, UserHandle user) {
+ public void onTaskIconChanged(@NonNull String pkg, @NonNull UserHandle user) {
for (int i = 0; i < getTaskViewCount(); i++) {
TaskView tv = requireTaskViewAt(i);
- Task task = tv.getTask();
- if (task != null && task.key != null && pkg.equals(task.key.getPackageName())
- && task.key.userId == user.getIdentifier()) {
+ Task task = tv.getFirstTask();
+ if (pkg.equals(task.key.getPackageName()) && task.key.userId == user.getIdentifier()) {
task.icon = null;
- if (tv.getIconView().getDrawable() != null) {
+ if (tv.getTaskContainers().stream().anyMatch(
+ container -> container.getIconView().getDrawable() != null)) {
tv.onTaskListVisibilityChanged(true /* visible */);
}
}
@@ -1018,42 +1115,36 @@
@Override
public void onTaskIconChanged(int taskId) {
+ if (enableRefactorTaskThumbnail()) {
+ return;
+ }
TaskView taskView = getTaskViewByTaskId(taskId);
if (taskView != null) {
taskView.refreshTaskThumbnailSplash();
}
}
- /**
- * Update the thumbnail(s) of the relevant TaskView.
- * @param refreshNow Refresh immediately if it's true.
- */
- @Nullable
- public TaskView updateThumbnail(
- HashMap<Integer, ThumbnailData> thumbnailData, boolean refreshNow) {
- TaskView updatedTaskView = null;
- for (Map.Entry<Integer, ThumbnailData> entry : thumbnailData.entrySet()) {
- Integer id = entry.getKey();
- ThumbnailData thumbnail = entry.getValue();
- TaskView taskView = getTaskViewByTaskId(id);
- if (taskView == null) {
- continue;
+ /** Updates the thumbnail(s) of the relevant TaskView. */
+ public void updateThumbnail(Map<Integer, ThumbnailData> thumbnailData) {
+ if (!enableRefactorTaskThumbnail()) {
+ for (Map.Entry<Integer, ThumbnailData> entry : thumbnailData.entrySet()) {
+ Integer id = entry.getKey();
+ ThumbnailData thumbnail = entry.getValue();
+ TaskView taskView = getTaskViewByTaskId(id);
+ if (taskView == null) {
+ continue;
+ }
+ // taskView could be a GroupedTaskView, so select the relevant task by ID
+ TaskContainer taskContainer = taskView.getTaskContainerById(id);
+ if (taskContainer == null) {
+ continue;
+ }
+ Task task = taskContainer.getTask();
+ TaskThumbnailViewDeprecated taskThumbnailViewDeprecated =
+ taskContainer.getThumbnailViewDeprecated();
+ taskThumbnailViewDeprecated.setThumbnail(task, thumbnail, /*refreshNow=*/false);
}
- // taskView could be a GroupedTaskView, so select the relevant task by ID
- TaskIdAttributeContainer taskAttributes = taskView.getTaskAttributesById(id);
- if (taskAttributes == null) {
- continue;
- }
- Task task = taskAttributes.getTask();
- TaskThumbnailViewDeprecated taskThumbnailViewDeprecated =
- taskAttributes.getThumbnailView();
- taskThumbnailViewDeprecated.setThumbnail(task, thumbnail, refreshNow);
- // thumbnailData can contain 1-2 ids, but they should correspond to the same
- // TaskView, so overwriting is ok
- updatedTaskView = taskView;
}
-
- return updatedTaskView;
}
@Override
@@ -1082,6 +1173,7 @@
/**
* See overridden implementations
+ *
* @return {@code true} if child TaskViews can be launched when user taps on them
*/
protected boolean canLaunchFullscreenTask() {
@@ -1107,6 +1199,9 @@
if (FeatureFlags.enableSplitContextually()) {
mSplitSelectStateController.registerSplitListener(mSplitSelectionListener);
}
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.onAttachedToWindow();
+ }
}
@Override
@@ -1128,6 +1223,10 @@
if (FeatureFlags.enableSplitContextually()) {
mSplitSelectStateController.unregisterSplitListener(mSplitSelectionListener);
}
+ reset();
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.onDetachedFromWindow();
+ }
}
@Override
@@ -1151,7 +1250,6 @@
} else {
mTaskViewPool.recycle(taskView);
}
- taskView.setTaskViewId(-1);
mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
}
}
@@ -1456,6 +1554,7 @@
* Enable or disable showing border on hover and focus change on task views
*/
public void setTaskBorderEnabled(boolean enabled) {
+ mBorderEnabled = enabled;
int taskCount = getTaskViewCount();
for (int i = 0; i < taskCount; i++) {
TaskView taskView = requireTaskViewAt(i);
@@ -1610,10 +1709,10 @@
}
TaskView taskView = getTaskViewAt(mNextPage);
// Snap to fully visible focused task and clear all button.
- boolean shouldSnapToFocusedTask = taskView != null && taskView.isFocusedTask()
+ boolean shouldSnapToLargeTask = taskView != null && taskView.isLargeTile()
&& isTaskViewFullyVisible(taskView);
boolean shouldSnapToClearAll = mNextPage == indexOfChild(mClearAllButton);
- if (!shouldSnapToFocusedTask && !shouldSnapToClearAll) {
+ if (!shouldSnapToLargeTask && !shouldSnapToClearAll) {
return;
}
}
@@ -1673,7 +1772,9 @@
return;
}
- if (mCurrentPage == 0) {
+ int frontIndex = enableLargeDesktopWindowingTile() ? getDesktopTaskViewCount() : 0;
+
+ if (mCurrentPage <= frontIndex) {
return;
}
@@ -1685,8 +1786,9 @@
removeView(runningTaskView);
mMovingTaskView = null;
runningTaskView.resetPersistentViewTransforms();
- addView(runningTaskView, 0);
- setCurrentPage(0);
+
+ addView(runningTaskView, frontIndex);
+ setCurrentPage(frontIndex);
updateTaskSize();
}
@@ -1702,9 +1804,10 @@
return super.isPageScrollsInitialized() && mLoadPlanEverApplied;
}
- protected void applyLoadPlan(ArrayList<GroupTask> taskGroups) {
+ protected void applyLoadPlan(List<GroupTask> taskGroups) {
if (mPendingAnimation != null) {
- mPendingAnimation.addEndListener(success -> applyLoadPlan(taskGroups));
+ final List<GroupTask> finalTaskGroups = taskGroups;
+ mPendingAnimation.addEndListener(success -> applyLoadPlan(finalTaskGroups));
return;
}
@@ -1729,7 +1832,7 @@
int[] currentTaskIds;
TaskView currentTaskView = getTaskViewAt(mCurrentPage);
- if (currentTaskView != null && currentTaskView.getTask() != null) {
+ if (currentTaskView != null) {
currentTaskIds = currentTaskView.getTaskIds();
} else {
currentTaskIds = new int[0];
@@ -1749,22 +1852,25 @@
// Reset the focused task to avoiding initializing TaskViews layout as focused task during
// binding. The focused task view will be updated after all the TaskViews are bound.
- mFocusedTaskViewId = INVALID_TASK_ID;
+ setFocusedTaskViewId(INVALID_TASK_ID);
// Removing views sets the currentPage to 0, so we save this and restore it after
// the new set of views are added
int previousCurrentPage = mCurrentPage;
int previousFocusedPage = indexOfChild(getFocusedChild());
+ // TaskIds will no longer be valid after remove and re-add, clearing mTopRowIdSet.
+ mAnyTaskHasBeenDismissed = false;
+ mTopRowIdSet.clear();
removeAllViews();
// If we are entering Overview as a result of initiating a split from somewhere else
// (e.g. split from Home), we need to make sure the staged app is not drawn as a thumbnail.
- int stagedTaskIdToBeRemovedFromGrid;
+ int stagedTaskIdToBeRemoved;
if (isSplitSelectionActive()) {
- stagedTaskIdToBeRemovedFromGrid = mSplitSelectStateController.getInitialTaskId();
+ stagedTaskIdToBeRemoved = mSplitSelectStateController.getInitialTaskId();
updateCurrentTaskActionsVisibility();
} else {
- stagedTaskIdToBeRemovedFromGrid = INVALID_TASK_ID;
+ stagedTaskIdToBeRemoved = INVALID_TASK_ID;
}
// update the map of instance counts
mFilterState.updateInstanceCountMap(taskGroups);
@@ -1772,50 +1878,50 @@
// Clear out desktop view if it is set
mDesktopTaskView = null;
+ // Move Desktop Tasks to the end of the list
+ if (enableLargeDesktopWindowingTile()) {
+ taskGroups = mRecentsViewUtils.sortDesktopTasksToFront(taskGroups);
+ }
+
// Add views as children based on whether it's grouped or single task. Looping through
// taskGroups backwards populates the thumbnail grid from least recent to most recent.
for (int i = taskGroups.size() - 1; i >= 0; i--) {
GroupTask groupTask = taskGroups.get(i);
- boolean isRemovalNeeded = stagedTaskIdToBeRemovedFromGrid != INVALID_TASK_ID
- && groupTask.containsTask(stagedTaskIdToBeRemovedFromGrid);
+ boolean isRemovalNeeded = stagedTaskIdToBeRemoved != INVALID_TASK_ID
+ && groupTask.containsTask(stagedTaskIdToBeRemoved);
- TaskView taskView;
- if (isRemovalNeeded && groupTask.hasMultipleTasks()) {
- // If we need to remove half of a pair of tasks, force a TaskView with Type.SINGLE
- // to be a temporary container for the remaining task.
- taskView = getTaskViewFromPool(TaskView.Type.SINGLE);
- } else {
- taskView = getTaskViewFromPool(groupTask.taskViewType);
+ if (isRemovalNeeded && !groupTask.hasMultipleTasks()) {
+ // If the task we need to remove is not part of a pair, avoiding creating the
+ // TaskView.
+ continue;
}
- addView(taskView);
-
- if (isRemovalNeeded && groupTask.hasMultipleTasks()) {
- if (groupTask.task1.key.id == stagedTaskIdToBeRemovedFromGrid) {
- taskView.bind(groupTask.task2, mOrientationState);
- } else {
- taskView.bind(groupTask.task1, mOrientationState);
- }
- } else if (isRemovalNeeded) {
- // If the task we need to remove is not part of a pair, bind it to the TaskView
- // first (to prevent problems), then remove the whole thing.
- taskView.bind(groupTask.task1, mOrientationState);
- removeView(taskView);
- } else if (taskView instanceof GroupedTaskView) {
+ // If we need to remove half of a pair of tasks, force a TaskView with Type.SINGLE
+ // to be a temporary container for the remaining task.
+ TaskView taskView = getTaskViewFromPool(
+ isRemovalNeeded ? TaskViewType.SINGLE : groupTask.taskViewType);
+ if (taskView instanceof GroupedTaskView) {
boolean firstTaskIsLeftTopTask =
groupTask.mSplitBounds.leftTopTaskId == groupTask.task1.key.id;
Task leftTopTask = firstTaskIsLeftTopTask ? groupTask.task1 : groupTask.task2;
Task rightBottomTask = firstTaskIsLeftTopTask ? groupTask.task2 : groupTask.task1;
-
((GroupedTaskView) taskView).bind(leftTopTask, rightBottomTask, mOrientationState,
- groupTask.mSplitBounds);
+ mTaskOverlayFactory, groupTask.mSplitBounds);
} else if (taskView instanceof DesktopTaskView) {
- ((DesktopTaskView) taskView).bind(((DesktopTask) groupTask).tasks,
- mOrientationState);
+ // Minimized tasks should not be shown in Overview
+ List<Task> nonMinimizedTasks =
+ ((DesktopTask) groupTask).tasks.stream()
+ .filter(task -> !task.isMinimized)
+ .toList();
+ ((DesktopTaskView) taskView).bind(nonMinimizedTasks, mOrientationState,
+ mTaskOverlayFactory);
mDesktopTaskView = (DesktopTaskView) taskView;
} else {
- taskView.bind(groupTask.task1, mOrientationState);
+ Task task = groupTask.task1.key.id == stagedTaskIdToBeRemoved ? groupTask.task2
+ : groupTask.task1;
+ taskView.bind(task, mOrientationState, mTaskOverlayFactory);
}
+ addView(taskView);
// enables instance filtering if the feature flag for it is on
if (FeatureFlags.ENABLE_MULTI_INSTANCE.get()) {
@@ -1830,11 +1936,14 @@
// Keep same previous focused task
TaskView newFocusedTaskView = getTaskViewByTaskIds(focusedTaskIds);
// If the list changed, maybe the focused task doesn't exist anymore
- if (newFocusedTaskView == null && getTaskViewCount() > 0) {
- newFocusedTaskView = getTaskViewAt(0);
+ int newFocusedTaskViewIndex = mRecentsViewUtils.getFocusedTaskIndex(taskGroups);
+ if (newFocusedTaskView == null && getTaskViewCount() > newFocusedTaskViewIndex) {
+ newFocusedTaskView = getTaskViewAt(newFocusedTaskViewIndex);
}
- mFocusedTaskViewId = newFocusedTaskView != null && !enableGridOnlyOverview()
- ? newFocusedTaskView.getTaskViewId() : INVALID_TASK_ID;
+
+ setFocusedTaskViewId(newFocusedTaskView != null && !enableGridOnlyOverview()
+ ? newFocusedTaskView.getTaskViewId() : INVALID_TASK_ID);
+
updateTaskSize();
updateChildTaskOrientations();
@@ -1874,8 +1983,8 @@
// Set the current page to the running task, but not if settling on new task.
if (hasAllValidTaskIds(runningTaskIds)) {
targetPage = indexOfChild(newRunningTaskView);
- } else if (getTaskViewCount() > 0) {
- targetPage = indexOfChild(requireTaskViewAt(0));
+ } else if (getTaskViewCount() > newFocusedTaskViewIndex) {
+ targetPage = indexOfChild(requireTaskViewAt(newFocusedTaskViewIndex));
}
}
if (targetPage != -1 && mCurrentPage != targetPage) {
@@ -1900,6 +2009,7 @@
// generally map to the same task.
mIgnoreResetTaskId = INVALID_TASK_ID;
}
+
resetTaskVisuals();
onTaskStackUpdated();
updateEnabledOverlays();
@@ -1940,14 +2050,13 @@
return taskViewCount;
}
- public int getGroupedTaskViewCount() {
- int groupViewCount = 0;
- for (int i = 0; i < getChildCount(); i++) {
- if (getChildAt(i) instanceof GroupedTaskView) {
- groupViewCount++;
- }
- }
- return groupViewCount;
+ /**
+ * Transverse RecentsView children to calculate the amount of DesktopTaskViews.
+ *
+ * @return Number of children that are instances of DesktopTaskView
+ */
+ private int getDesktopTaskViewCount() {
+ return mRecentsViewUtils.getDesktopTaskViewCount(getChildCount(), this::getTaskViewAt);
}
/**
@@ -1980,6 +2089,7 @@
taskView.setFullscreenProgress(mFullscreenProgress);
taskView.setModalness(mTaskModalness);
taskView.setTaskThumbnailSplashAlpha(mTaskThumbnailSplashAlpha);
+ taskView.setBorderEnabled(mBorderEnabled);
}
}
// resetTaskVisuals is called at the end of dismiss animation which could update
@@ -2010,6 +2120,9 @@
public void setFullscreenProgress(float fullscreenProgress) {
mFullscreenProgress = fullscreenProgress;
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.updateFullscreenProgress(mFullscreenProgress);
+ }
int taskCount = getTaskViewCount();
for (int i = 0; i < taskCount; i++) {
requireTaskViewAt(i).setFullscreenProgress(mFullscreenProgress);
@@ -2017,7 +2130,7 @@
mClearAllButton.setFullscreenProgress(fullscreenProgress);
// Fade out the actions view quickly (0.1 range)
- mActionsView.getFullscreenAlpha().setValue(
+ mActionsView.getFullscreenAlpha().updateValue(
mapToRange(fullscreenProgress, 0, 0.1f, 1f, 0f, LINEAR));
}
@@ -2073,12 +2186,17 @@
: View.LAYOUT_DIRECTION_RTL);
mClearAllButton.setRotation(getPagedOrientationHandler().getDegreesRotated());
- if (forceRecreateDragLayerControllers
- || !getPagedOrientationHandler().equals(oldOrientationHandler)) {
+ boolean isOrientationHandlerChanged =
+ !getPagedOrientationHandler().equals(oldOrientationHandler);
+ if (forceRecreateDragLayerControllers || isOrientationHandlerChanged) {
// Changed orientations, update controllers so they intercept accordingly.
mContainer.getDragLayer().recreateControllers();
onOrientationChanged();
resetTaskVisuals();
+ // Log fake orientation changed.
+ if (isOrientationHandlerChanged) {
+ logOrientationChanged();
+ }
}
boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
@@ -2140,15 +2258,6 @@
* Updates TaskView scaling and translation required to support variable width.
*/
private void updateTaskSize() {
- updateTaskSize(false);
- }
-
- /**
- * Updates TaskView scaling and translation required to support variable width.
- *
- * @param isTaskDismissal indicates if update was called due to task dismissal
- */
- private void updateTaskSize(boolean isTaskDismissal) {
final int taskCount = getTaskViewCount();
if (taskCount == 0) {
return;
@@ -2163,7 +2272,8 @@
}
for (int i = 0; i < taskCount; i++) {
TaskView taskView = requireTaskViewAt(i);
- taskView.updateTaskSize();
+ taskView.updateTaskSize(mLastComputedTaskSize, mLastComputedGridTaskSize,
+ mLastComputedCarouselTaskSize);
taskView.setNonGridTranslationX(accumulatedTranslationX);
taskView.setNonGridPivotTranslationX(translateXToMiddle);
// Compensate space caused by TaskView scaling.
@@ -2174,7 +2284,7 @@
mClearAllButton.setFullscreenTranslationPrimary(accumulatedTranslationX);
- updateGridProperties(isTaskDismissal);
+ updateGridProperties();
}
public void getTaskSize(Rect outRect) {
@@ -2268,8 +2378,8 @@
}
private void animateActionsViewAlpha(float alphaValue, long duration) {
- mActionsViewAlphaAnimator = ObjectAnimator.ofFloat(
- mActionsView.getVisibilityAlpha(), MULTI_PROPERTY_VALUE, alphaValue);
+ mActionsViewAlphaAnimator = ObjectAnimator.ofFloat(mActionsView.getVisibilityAlpha(),
+ AnimatedFloat.VALUE, alphaValue);
mActionsViewAlphaAnimatorFinalValue = alphaValue;
mActionsViewAlphaAnimator.setDuration(duration);
// Set autocancel to prevent race-conditiony setting of alpha from other animations
@@ -2288,7 +2398,7 @@
mClearAllButton.onRecentsViewScroll(scroll, mOverviewGridEnabled);
// Clear all button alpha was set by the previous line.
- mActionsView.getIndexScrollAlpha().setValue(1 - mClearAllButton.getScrollAlpha());
+ mActionsView.getIndexScrollAlpha().updateValue(1 - mClearAllButton.getScrollAlpha());
}
@Override
@@ -2349,24 +2459,25 @@
upper = Math.min(centerPageIndex + 2, numChildren - 1);
}
+ List<Integer> visibleTaskIds = new ArrayList<>();
+
// Update the task data for the in/visible children
for (int i = 0; i < getTaskViewCount(); i++) {
TaskView taskView = requireTaskViewAt(i);
- TaskIdAttributeContainer[] containers = taskView.getTaskIdAttributeContainers();
- if (containers.length == 0) {
+ List<TaskContainer> containers = taskView.getTaskContainers();
+ if (containers.isEmpty()) {
continue;
}
- int index = indexOfChild(taskView);
boolean visible;
if (showAsGrid()) {
visible = isTaskViewWithinBounds(taskView, visibleStart, visibleEnd);
} else {
- visible = lower <= index && index <= upper;
+ visible = lower <= i && i <= upper;
}
if (visible) {
// Default update all non-null tasks, then remove running ones
- List<Task> tasksToUpdate = Arrays.stream(containers).filter(Objects::nonNull)
- .map(TaskIdAttributeContainer::getTask)
+ List<Task> tasksToUpdate = containers.stream()
+ .map(TaskContainer::getTask)
.collect(Collectors.toCollection(ArrayList::new));
if (mTmpRunningTasks != null) {
for (Task t : mTmpRunningTasks) {
@@ -2375,6 +2486,10 @@
tasksToUpdate.removeIf(task -> task == t);
}
}
+ if (enableRefactorTaskThumbnail()) {
+ visibleTaskIds.addAll(
+ tasksToUpdate.stream().map((task) -> task.key.id).toList());
+ }
if (tasksToUpdate.isEmpty()) {
continue;
}
@@ -2388,10 +2503,10 @@
}
taskView.onTaskListVisibilityChanged(true /* visible */, changes);
}
- mHasVisibleTaskData.put(task.key.id, visible);
+ mHasVisibleTaskData.put(task.key.id, true);
}
} else {
- for (TaskIdAttributeContainer container : containers) {
+ for (TaskContainer container : containers) {
if (container == null) {
continue;
}
@@ -2403,6 +2518,9 @@
}
}
}
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.updateVisibleTasks(visibleTaskIds);
+ }
}
/**
@@ -2428,6 +2546,10 @@
mModel.preloadCacheIfNeeded();
}
+ if (enableRefactorTaskThumbnail()) {
+ return;
+ }
+
// Whenever the high res loading state changes, poke each of the visible tasks to see if
// they want to updated their thumbnail state
for (int i = 0; i < mHasVisibleTaskData.size(); i++) {
@@ -2456,14 +2578,24 @@
/** Returns whether user can start home based on state in {@link OverviewCommandHelper}. */
protected abstract boolean canStartHomeSafely();
- public abstract StateManager<STATE_TYPE> getStateManager();
+ /** Returns the state manager used in RecentsView **/
+ public abstract StateManager<STATE_TYPE,
+ ? extends StatefulContainer<STATE_TYPE>> getStateManager();
public void reset() {
setCurrentTask(-1);
mCurrentPageScrollDiff = 0;
mIgnoreResetTaskId = -1;
mTaskListChangeId = -1;
- mFocusedTaskViewId = -1;
+ setFocusedTaskViewId(INVALID_TASK_ID);
+ mAnyTaskHasBeenDismissed = false;
+
+
+ if (enableRefactorTaskThumbnail()) {
+ // TODO(b/353917593): RecentsView is never destroyed, so its dependencies need to
+ // be cleaned up during the reset, but re-created when RecentsView is "resumed".
+ // RecentsDependencies.Companion.destroy();
+ }
Log.d(TAG, "reset - mEnableDrawingLiveTile: " + mEnableDrawingLiveTile
+ ", mRecentsAnimationController: " + mRecentsAnimationController);
@@ -2486,14 +2618,19 @@
// These are relatively expensive and don't need to be done this frame (RecentsView isn't
// visible anyway), so defer by a frame to get off the critical path, e.g. app to home.
- post(() -> {
- unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
- setCurrentPage(0);
- LayoutUtils.setViewEnabled(mActionsView, true);
- if (mOrientationState.setGestureActive(false)) {
- updateOrientationHandler(/* forceRecreateDragLayerControllers = */ false);
- }
- });
+ post(this::onReset);
+ }
+
+ private void onReset() {
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.onReset();
+ }
+ unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
+ setCurrentPage(0);
+ LayoutUtils.setViewEnabled(mActionsView, true);
+ if (mOrientationState.setGestureActive(false)) {
+ updateOrientationHandler(/* forceRecreateDragLayerControllers = */ false);
+ }
}
public int getRunningTaskViewId() {
@@ -2522,6 +2659,10 @@
return getTaskViewFromTaskViewId(mFocusedTaskViewId);
}
+ private @Nullable TaskView getFirstLargeTaskView() {
+ return mRecentsViewUtils.getFirstLargeTaskView(getChildCount(), this::getTaskViewAt);
+ }
+
@Nullable
private TaskView getTaskViewFromTaskViewId(int taskViewId) {
if (taskViewId == -1) {
@@ -2550,16 +2691,16 @@
* Handle the edge case where Recents could increment task count very high over long
* period of device usage. Probably will never happen, but meh.
*/
- private TaskView getTaskViewFromPool(@TaskView.Type int type) {
+ private TaskView getTaskViewFromPool(TaskViewType type) {
TaskView taskView;
switch (type) {
- case TaskView.Type.GROUPED:
+ case GROUPED:
taskView = mGroupedTaskViewPool.getView();
break;
- case TaskView.Type.DESKTOP:
+ case DESKTOP:
taskView = mDesktopTaskViewPool.getView();
break;
- case TaskView.Type.SINGLE:
+ case SINGLE:
default:
taskView = mTaskViewPool.getView();
}
@@ -2575,6 +2716,7 @@
/**
* Get the index of the task view whose id matches {@param taskId}.
+ *
* @return -1 if there is no task view for the task id, else the index of the task view.
*/
public int getTaskIndexForId(int taskId) {
@@ -2589,6 +2731,9 @@
if (!mModel.isTaskListValid(mTaskListChangeId)) {
mTaskListChangeId = mModel.getTasks(this::applyLoadPlan, RecentsFilterState
.getFilter(mFilterState.getPackageNameToFilter()));
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.refreshAllTaskData();
+ }
}
}
@@ -2611,10 +2756,17 @@
showCurrentTask(mActiveGestureRunningTasks);
setEnableFreeScroll(false);
setEnableDrawingLiveTile(false);
- setRunningTaskHidden(true);
+ setRunningTaskHidden(!shouldUpdateRunningTaskAlpha());
setTaskIconScaledDown(true);
}
+ /**
+ * Returns whether the running task's attach alpha should be updated during the attach animation
+ */
+ public boolean shouldUpdateRunningTaskAlpha() {
+ return enableDesktopTaskAlphaAnimation() && getRunningTaskView() instanceof DesktopTaskView;
+ }
+
private boolean isGestureActive() {
return mActiveGestureRunningTasks != null;
}
@@ -2633,6 +2785,21 @@
// Let system take care of the rotation
return;
}
+
+ if (mRunningTaskShowScreenshot) {
+ animateRotation(newRotation);
+ } else {
+ // Animate the rotation and stops running task
+ switchToScreenshot(() -> {
+ animateRotation(newRotation);
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
+ null /* onFinishComplete */);
+ });
+ }
+ }
+
+ private void animateRotation(int newRotation) {
+ AbstractFloatingView.closeAllOpenViewsExcept(mContainer, false, TYPE_REBIND_SAFE);
AnimatorSet pa = setRecentsChangedOrientation(true);
pa.addListener(AnimatorListeners.forSuccessCallback(() -> {
setLayoutRotation(newRotation, mOrientationState.getDisplayRotation());
@@ -2642,17 +2809,9 @@
pa.start();
}
- public AnimatorSet setRecentsChangedOrientation(boolean fadeInChildren) {
- getRunningTaskIndex();
- int runningIndex = getCurrentPage();
+ public AnimatorSet setRecentsChangedOrientation(boolean fadeOut) {
AnimatorSet as = new AnimatorSet();
- for (int i = 0; i < getTaskViewCount(); i++) {
- View taskView = requireTaskViewAt(i);
- if (runningIndex == i && taskView.getAlpha() != 0) {
- continue;
- }
- as.play(ObjectAnimator.ofFloat(taskView, View.ALPHA, fadeInChildren ? 0 : 1));
- }
+ as.play(ObjectAnimator.ofFloat(this, View.ALPHA, fadeOut ? 0 : 1));
return as;
}
@@ -2749,7 +2908,7 @@
int[] runningTaskIds = Arrays.stream(runningTasks).mapToInt(task -> task.key.id).toArray();
TaskView matchingTaskView = null;
if (hasDesktopTask(runningTasks) && runningTaskIds.length == 1) {
- // TODO(b/249371338): Unsure if it's expected, desktop runningTasks only have a single
+ // TODO(b/342635213): Unsure if it's expected, desktop runningTasks only have a single
// taskId, therefore we match any DesktopTaskView that contains the runningTaskId.
TaskView taskview = getTaskViewByTaskId(runningTaskIds[0]);
if (taskview instanceof DesktopTaskView) {
@@ -2772,6 +2931,7 @@
if (runningTasks.length == 0) {
return;
}
+
int runningTaskViewId = -1;
boolean needGroupTaskView = runningTasks.length > 1;
boolean needDesktopTask = hasDesktopTask(runningTasks);
@@ -2780,28 +2940,26 @@
// Add an empty view for now until the task plan is loaded and applied
final TaskView taskView;
if (needDesktopTask) {
- taskView = getTaskViewFromPool(TaskView.Type.DESKTOP);
+ taskView = getTaskViewFromPool(TaskViewType.DESKTOP);
mTmpRunningTasks = Arrays.copyOf(runningTasks, runningTasks.length);
- addView(taskView, 0);
((DesktopTaskView) taskView).bind(Arrays.asList(mTmpRunningTasks),
- mOrientationState);
+ mOrientationState, mTaskOverlayFactory);
} else if (needGroupTaskView) {
- taskView = getTaskViewFromPool(TaskView.Type.GROUPED);
+ taskView = getTaskViewFromPool(TaskViewType.GROUPED);
mTmpRunningTasks = new Task[]{runningTasks[0], runningTasks[1]};
- addView(taskView, 0);
// When we create a placeholder task view mSplitBoundsConfig will be null, but with
// the actual app running we won't need to show the thumbnail until all the tasks
// load later anyways
- ((GroupedTaskView)taskView).bind(mTmpRunningTasks[0], mTmpRunningTasks[1],
- mOrientationState, mSplitBoundsConfig);
+ ((GroupedTaskView) taskView).bind(mTmpRunningTasks[0], mTmpRunningTasks[1],
+ mOrientationState, mTaskOverlayFactory, mSplitBoundsConfig);
} else {
- taskView = getTaskViewFromPool(TaskView.Type.SINGLE);
- addView(taskView, 0);
+ taskView = getTaskViewFromPool(TaskViewType.SINGLE);
// The temporary running task is only used for the duration between the start of the
// gesture and the task list is loaded and applied
mTmpRunningTasks = new Task[]{runningTasks[0]};
- taskView.bind(mTmpRunningTasks[0], mOrientationState);
+ taskView.bind(mTmpRunningTasks[0], mOrientationState, mTaskOverlayFactory);
}
+ addView(taskView, 0);
runningTaskViewId = taskView.getTaskViewId();
if (wasEmpty) {
addView(mClearAllButton);
@@ -2818,7 +2976,11 @@
boolean runningTaskTileHidden = mRunningTaskTileHidden;
setCurrentTask(runningTaskViewId);
- mFocusedTaskViewId = enableGridOnlyOverview() ? INVALID_TASK_ID : runningTaskViewId;
+
+ boolean shouldFocusRunningTask = !(enableGridOnlyOverview()
+ || (enableLargeDesktopWindowingTile()
+ && getRunningTaskView() instanceof DesktopTaskView));
+ setFocusedTaskViewId(shouldFocusRunningTask ? runningTaskViewId : INVALID_TASK_ID);
runOnPageScrollsInitialized(() -> setCurrentPage(getRunningTaskIndex()));
setRunningTaskViewShowScreenshot(false);
setRunningTaskHidden(runningTaskTileHidden);
@@ -2860,21 +3022,20 @@
}
private void setRunningTaskViewId(int runningTaskViewId) {
- int prevRunningTaskViewId = mRunningTaskViewId;
mRunningTaskViewId = runningTaskViewId;
- if (Flags.enableRefactorTaskThumbnail()) {
- TaskView previousRunningTaskView = getTaskViewFromTaskViewId(prevRunningTaskViewId);
- if (previousRunningTaskView != null) {
- previousRunningTaskView.notifyIsRunningTaskUpdated();
- }
- TaskView newRunningTaskView = getTaskViewFromTaskViewId(runningTaskViewId);
- if (newRunningTaskView != null) {
- newRunningTaskView.notifyIsRunningTaskUpdated();
- }
+ if (enableRefactorTaskThumbnail()) {
+ TaskView runningTaskView = getTaskViewFromTaskViewId(runningTaskViewId);
+ mRecentsViewModel.updateRunningTask(
+ runningTaskView != null ? runningTaskView.getTaskIdSet()
+ : Collections.emptySet());
}
}
+ private void setFocusedTaskViewId(int viewId) {
+ mFocusedTaskViewId = viewId;
+ }
+
private int getTaskViewIdFromTaskId(int taskId) {
TaskView taskView = getTaskViewByTaskId(taskId);
return taskView != null ? taskView.getTaskViewId() : -1;
@@ -2886,12 +3047,13 @@
public void setRunningTaskHidden(boolean isHidden) {
mRunningTaskTileHidden = isHidden;
TaskView runningTask = getRunningTaskView();
- if (runningTask != null) {
- runningTask.setStableAlpha(isHidden ? 0 : mContentAlpha);
- if (!isHidden) {
- AccessibilityManagerCompat.sendCustomAccessibilityEvent(runningTask,
- AccessibilityEvent.TYPE_VIEW_FOCUSED, null);
- }
+ if (runningTask == null) {
+ return;
+ }
+ runningTask.setStableAlpha(isHidden ? 0 : mContentAlpha);
+ if (!isHidden) {
+ AccessibilityManagerCompat.sendCustomAccessibilityEvent(
+ runningTask, AccessibilityEvent.TYPE_VIEW_FOCUSED, null);
}
}
@@ -2899,7 +3061,14 @@
mRunningTaskShowScreenshot = showScreenshot;
TaskView runningTaskView = getRunningTaskView();
if (runningTaskView != null) {
- runningTaskView.setShowScreenshot(mRunningTaskShowScreenshot);
+ runningTaskView.setShouldShowScreenshot(mRunningTaskShowScreenshot);
+ if (!enableRefactorTaskThumbnail()) {
+ runningTaskView.getTaskContainers().forEach(
+ taskContainer -> taskContainer.getThumbnailViewDeprecated().refresh());
+ }
+ }
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.setRunningTaskShowScreenshot(showScreenshot);
}
}
@@ -2924,7 +3093,6 @@
int taskCount = getTaskViewCount();
for (int i = 0; i < taskCount; i++) {
TaskView taskView = requireTaskViewAt(i);
- taskView.setIconScaleAnimStartProgress(0f);
taskView.animateIconScaleAndDimIntoView();
}
}
@@ -2932,22 +3100,11 @@
/**
* Updates TaskView and ClearAllButtion scaling and translation required to turn into grid
* layout.
- * This method is used when no task dismissal has occurred.
+ *
+ * Skips rebalance.
*/
private void updateGridProperties() {
- updateGridProperties(false, Integer.MAX_VALUE);
- }
-
- /**
- * Updates TaskView and ClearAllButtion scaling and translation required to turn into grid
- * layout.
- *
- * This method is used when task dismissal has occurred, but rebalance is not needed.
- *
- * @param isTaskDismissal indicates if update was called due to task dismissal
- */
- private void updateGridProperties(boolean isTaskDismissal) {
- updateGridProperties(isTaskDismissal, Integer.MAX_VALUE);
+ updateGridProperties(Integer.MAX_VALUE);
}
/**
@@ -2957,11 +3114,10 @@
* This method only calculates the potential position and depends on {@link #setGridProgress} to
* apply the actual scaling and translation.
*
- * @param isTaskDismissal indicates if update was called due to task dismissal
* @param startRebalanceAfter which view index to start rebalancing from. Use Integer.MAX_VALUE
- * to skip rebalance
+ * to skip rebalance
*/
- private void updateGridProperties(boolean isTaskDismissal, int startRebalanceAfter) {
+ private void updateGridProperties(int startRebalanceAfter) {
int taskCount = getTaskViewCount();
if (taskCount == 0) {
return;
@@ -2984,15 +3140,17 @@
float[] gridTranslations = new float[taskCount];
int focusedTaskIndex = Integer.MAX_VALUE;
+ Set<Integer> largeTasksIndices = new HashSet<>();
int focusedTaskShift = 0;
- int focusedTaskWidthAndSpacing = 0;
+ int largeTaskWidthAndSpacing = 0;
int snappedTaskRowWidth = 0;
int snappedPage = isKeyboardTaskFocusPending() ? mKeyboardTaskFocusIndex : getNextPage();
TaskView snappedTaskView = getTaskViewAt(snappedPage);
TaskView homeTaskView = getHomeTaskView();
TaskView nextFocusedTaskView = null;
- if (!isTaskDismissal) {
+ // Don't clear the top row, if the user has dismissed a task, to maintain the task order.
+ if (!mAnyTaskHasBeenDismissed) {
mTopRowIdSet.clear();
}
for (int i = 0; i < taskCount; i++) {
@@ -3001,12 +3159,11 @@
// Evenly distribute tasks between rows unless rearranging due to task dismissal, in
// which case keep tasks in their respective rows. For the running task, don't join
// the grid.
- if (taskView.isFocusedTask()) {
+ boolean isLargeTile = taskView.isLargeTile();
+
+ if (isLargeTile) {
topRowWidth += taskWidthAndSpacing;
bottomRowWidth += taskWidthAndSpacing;
-
- focusedTaskIndex = i;
- focusedTaskWidthAndSpacing = taskWidthAndSpacing;
gridTranslations[i] += focusedTaskShift;
gridTranslations[i] += mIsRtl ? taskWidthAndSpacing : -taskWidthAndSpacing;
@@ -3014,6 +3171,12 @@
taskView.setGridTranslationY((mLastComputedTaskSize.height() + taskTopMargin
- taskView.getLayoutParams().height) / 2f);
+ if (taskView.getTaskViewId() == mFocusedTaskViewId) {
+ focusedTaskIndex = i;
+ }
+ largeTasksIndices.add(i);
+ largeTaskWidthAndSpacing = taskWidthAndSpacing;
+
if (taskView == snappedTaskView) {
// If focused task is snapped, the row width is just task width and spacing.
snappedTaskRowWidth = taskWidthAndSpacing;
@@ -3022,7 +3185,7 @@
if (i > focusedTaskIndex) {
// For tasks after the focused task, shift by focused task's width and spacing.
gridTranslations[i] +=
- mIsRtl ? focusedTaskWidthAndSpacing : -focusedTaskWidthAndSpacing;
+ mIsRtl ? largeTaskWidthAndSpacing : -largeTaskWidthAndSpacing;
} else {
// For task before the focused task, accumulate the width and spacing to
// calculate the distance focused task need to shift.
@@ -3032,7 +3195,7 @@
// Rebalance the grid starting after a certain index
boolean isTopRow;
- if (isTaskDismissal) {
+ if (mAnyTaskHasBeenDismissed) {
if (i > startRebalanceAfter) {
mTopRowIdSet.remove(taskViewId);
isTopRow = topRowWidth <= bottomRowWidth;
@@ -3058,7 +3221,7 @@
// Move horizontally into empty space.
float widthOffset = 0;
for (int j = i - 1; !topSet.contains(j) && j >= 0; j--) {
- if (j == focusedTaskIndex) {
+ if (largeTasksIndices.contains(j)) {
continue;
}
widthOffset += requireTaskViewAt(j).getLayoutParams().width + mPageSpacing;
@@ -3077,7 +3240,7 @@
// Move horizontally into empty space.
float widthOffset = 0;
for (int j = i - 1; !bottomSet.contains(j) && j >= 0; j--) {
- if (j == focusedTaskIndex) {
+ if (largeTasksIndices.contains(j)) {
continue;
}
widthOffset += requireTaskViewAt(j).getLayoutParams().width + mPageSpacing;
@@ -3127,12 +3290,22 @@
// accordingly. Update longRowWidth if ClearAllButton has been moved.
float clearAllShortTotalWidthTranslation = 0;
int longRowWidth = Math.max(topRowWidth, bottomRowWidth);
- if (longRowWidth < mLastComputedGridSize.width()) {
- mClearAllShortTotalWidthTranslation =
- (mIsRtl
- ? mLastComputedTaskSize.right
- : deviceProfile.widthPx - mLastComputedTaskSize.left)
- - longRowWidth - deviceProfile.overviewGridSideMargin;
+
+ // If Recents contains only large task sizes, it should only consider 1 large size
+ // for ClearAllButton translation. The space at the left side of the large task will be
+ // empty and it should be move ClearAllButton further away as well.
+ // TODO(b/359573248): Validate the translation for ClearAllButton for grid only.
+ boolean hasOnlyLargeTasks = taskCount == largeTasksIndices.size();
+ if (enableLargeDesktopWindowingTile() && hasOnlyLargeTasks) {
+ longRowWidth = largeTaskWidthAndSpacing;
+ }
+
+ // If first task is not in the expected position (mLastComputedTaskSize) and being too close
+ // to ClearAllButton, then apply extra translation to ClearAllButton.
+ int firstTaskStart = mLastComputedGridSize.left + longRowWidth;
+ int expectedFirstTaskStart = mLastComputedTaskSize.right;
+ if (firstTaskStart < expectedFirstTaskStart) {
+ mClearAllShortTotalWidthTranslation = expectedFirstTaskStart - firstTaskStart;
clearAllShortTotalWidthTranslation = mIsRtl
? -mClearAllShortTotalWidthTranslation : mClearAllShortTotalWidthTranslation;
if (snappedTaskRowWidth == longRowWidth) {
@@ -3147,10 +3320,10 @@
float clearAllTotalTranslationX =
clearAllAccumulatedTranslation + clearAllShorterRowCompensation
+ clearAllShortTotalWidthTranslation + snappedTaskNonGridScrollAdjustment;
- if (focusedTaskIndex < taskCount) {
+ if (!largeTasksIndices.isEmpty()) {
// Shift by focused task's width and spacing if a task is focused.
clearAllTotalTranslationX +=
- mIsRtl ? focusedTaskWidthAndSpacing : -focusedTaskWidthAndSpacing;
+ mIsRtl ? largeTaskWidthAndSpacing : -largeTaskWidthAndSpacing;
}
// Make sure there are enough space between snapped page and ClearAllButton, for the case
@@ -3162,9 +3335,9 @@
(mIsRtl
? mLastComputedTaskSize.left
: deviceProfile.widthPx - mLastComputedTaskSize.right)
- - deviceProfile.overviewGridSideMargin - mPageSpacing
- + (mTaskWidth - snappedTaskView.getLayoutParams().width)
- - mClearAllShortTotalWidthTranslation;
+ - deviceProfile.overviewGridSideMargin - mPageSpacing
+ + (mTaskWidth - snappedTaskView.getLayoutParams().width)
+ - mClearAllShortTotalWidthTranslation;
if (distanceFromClearAll < minimumDistance) {
int distanceDifference = minimumDistance - distanceFromClearAll;
snappedTaskGridTranslationX += mIsRtl ? distanceDifference : -distanceDifference;
@@ -3190,7 +3363,6 @@
mClearAllButton.setGridScrollOffset(
mIsRtl ? mLastComputedTaskSize.left - mLastComputedGridSize.left
: mLastComputedTaskSize.right - mLastComputedGridSize.right);
-
setGridProgress(mGridProgress);
}
@@ -3198,11 +3370,11 @@
if (taskView1 == null || taskView2 == null) {
return false;
}
- int taskViewId1 = taskView1.getTaskViewId();
- int taskViewId2 = taskView2.getTaskViewId();
- if (taskViewId1 == mFocusedTaskViewId || taskViewId2 == mFocusedTaskViewId) {
+ if (taskView1.isLargeTile() || taskView2.isLargeTile()) {
return false;
}
+ int taskViewId1 = taskView1.getTaskViewId();
+ int taskViewId2 = taskView2.getTaskViewId();
return (mTopRowIdSet.contains(taskViewId1) && mTopRowIdSet.contains(taskViewId2)) || (
!mTopRowIdSet.contains(taskViewId1) && !mTopRowIdSet.contains(taskViewId2));
}
@@ -3223,6 +3395,10 @@
}
private void setTaskThumbnailSplashAlpha(float taskThumbnailSplashAlpha) {
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.updateThumbnailSplashProgress(taskThumbnailSplashAlpha);
+ return;
+ }
int taskCount = getTaskViewCount();
if (taskCount == 0) {
return;
@@ -3244,12 +3420,12 @@
mLayoutTransition.addTransitionListener(new TransitionListener() {
@Override
public void startTransition(LayoutTransition transition, ViewGroup viewGroup,
- View view, int i) {
+ View view, int i) {
}
@Override
public void endTransition(LayoutTransition transition, ViewGroup viewGroup,
- View view, int i) {
+ View view, int i) {
// When the unpinned task is added, snap to first page and disable transitions
if (view instanceof TaskView) {
snapToPage(0);
@@ -3352,6 +3528,7 @@
mSplitSelectStateController.getSplitAnimationController().
playAnimPlaceholderToFullscreen(mContainer, view,
Optional.of(() -> resetFromSplitSelectionState())));
+ firstFloatingTaskView.setContentDescription(splitAnimInitProps.getContentDescription());
// SplitInstructionsView: animate in
safeRemoveDragLayerView(mSplitSelectStateController.getSplitInstructionsView());
@@ -3401,11 +3578,13 @@
/**
* Creates a {@link PendingAnimation} for dismissing the specified {@link TaskView}.
- * @param dismissedTaskView the {@link TaskView} to be dismissed
- * @param animateTaskView whether the {@link TaskView} to be dismissed should be animated
- * @param shouldRemoveTask whether the associated {@link Task} should be removed from
- * ActivityManager after dismissal
- * @param duration duration of the animation
+ *
+ * @param dismissedTaskView the {@link TaskView} to be dismissed
+ * @param animateTaskView whether the {@link TaskView} to be dismissed should be
+ * animated
+ * @param shouldRemoveTask whether the associated {@link Task} should be removed from
+ * ActivityManager after dismissal
+ * @param duration duration of the animation
* @param dismissingForSplitSelection task dismiss animation is used for entering split
* selection state from app icon
*/
@@ -3448,11 +3627,11 @@
isStagingFocusedTask = true;
} else {
nextFocusedTaskFromTop =
- mTopRowIdSet.size() > 0 && mTopRowIdSet.size() >= (taskCount - 1) / 2f;
+ !mTopRowIdSet.isEmpty() && mTopRowIdSet.size() >= (taskCount - 1) / 2f;
// Pick the next focused task from the preferred row.
for (int i = 0; i < taskCount; i++) {
TaskView taskView = requireTaskViewAt(i);
- if (taskView == dismissedTaskView) {
+ if (taskView == dismissedTaskView || taskView.isLargeTile()) {
continue;
}
boolean isTopRow = mTopRowIdSet.contains(taskView.getTaskViewId());
@@ -3670,7 +3849,7 @@
float animationEndProgress = isSplitSelectionActive()
? Utilities.boundToRange(splitTimings.getGridSlideStartOffset()
- + splitTimings.getGridSlideDurationOffset(), 0f, 1f)
+ + splitTimings.getGridSlideDurationOffset(), 0f, 1f)
: 1f;
// Slide tiles in horizontally to fill dismissed area
@@ -3714,16 +3893,16 @@
// dismissed index or next focused index. Offset successive task dismissal
// durations for a staggered effect.
distanceFromDismissedTask++;
- int staggerColumn = isStagingFocusedTask
+ int staggerColumn = isStagingFocusedTask
? (int) Math.ceil(distanceFromDismissedTask / 2f)
: distanceFromDismissedTask;
// Set timings based on if user is initiating splitscreen on the focused task,
// or splitting/dismissing some other task.
float animationStartProgress = isStagingFocusedTask
? Utilities.boundToRange(
- splitTimings.getGridSlideStartOffset()
- + (splitTimings.getGridSlideStaggerOffset()
- * staggerColumn),
+ splitTimings.getGridSlideStartOffset()
+ + (splitTimings.getGridSlideStaggerOffset()
+ * staggerColumn),
0f,
dismissTranslationInterpolationEnd)
: Utilities.boundToRange(
@@ -3732,9 +3911,9 @@
* staggerColumn, 0f, dismissTranslationInterpolationEnd);
float animationEndProgress = isStagingFocusedTask
? Utilities.boundToRange(
- splitTimings.getGridSlideStartOffset()
- + (splitTimings.getGridSlideStaggerOffset() * staggerColumn)
- + splitTimings.getGridSlideDurationOffset(),
+ splitTimings.getGridSlideStartOffset()
+ + (splitTimings.getGridSlideStaggerOffset() * staggerColumn)
+ + splitTimings.getGridSlideDurationOffset(),
0f,
dismissTranslationInterpolationEnd)
: dismissTranslationInterpolationEnd;
@@ -3743,7 +3922,7 @@
if (taskView == nextFocusedTaskView) {
// Enlarge the task to be focused next, and translate into focus position.
float scale = mTaskWidth / (float) mLastComputedGridTaskSize.width();
- anim.setFloat(taskView, TaskView.SNAPSHOT_SCALE, scale,
+ anim.setFloat(taskView, TaskView.DISMISS_SCALE, scale,
clampToProgress(LINEAR, animationStartProgress,
dismissTranslationInterpolationEnd));
anim.setFloat(taskView, taskView.getPrimaryDismissTranslationProperty(),
@@ -3757,7 +3936,7 @@
anim.setFloat(taskView, taskView.getSecondaryDismissTranslationProperty(),
secondaryTranslation, clampToProgress(LINEAR, animationStartProgress,
dismissTranslationInterpolationEnd));
- anim.setFloat(taskView, TaskView.FOCUS_TRANSITION, 0f,
+ anim.add(taskView.getFocusTransitionScaleAndDimOutAnimator(),
clampToProgress(LINEAR, 0f, ANIMATION_DISMISS_PROGRESS_MIDPOINT));
} else {
float primaryTranslation =
@@ -3813,20 +3992,19 @@
resetTaskVisuals();
if (success) {
+ mAnyTaskHasBeenDismissed = true;
if (shouldRemoveTask) {
- if (dismissedTaskView.getTask() != null) {
- if (dismissedTaskView.isRunningTask()) {
- finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
- () -> removeTaskInternal(dismissedTaskViewId));
- } else {
- removeTaskInternal(dismissedTaskViewId);
- }
- announceForAccessibility(
- getResources().getString(R.string.task_view_closed));
- mContainer.getStatsLogManager().logger()
- .withItemInfo(dismissedTaskView.getItemInfo())
- .log(LAUNCHER_TASK_DISMISS_SWIPE_UP);
+ if (dismissedTaskView.isRunningTask()) {
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
+ () -> removeTaskInternal(dismissedTaskViewId));
+ } else {
+ removeTaskInternal(dismissedTaskViewId);
}
+ announceForAccessibility(
+ getResources().getString(R.string.task_view_closed));
+ mContainer.getStatsLogManager().logger()
+ .withItemInfo(dismissedTaskView.getFirstItemInfo())
+ .log(LAUNCHER_TASK_DISMISS_SWIPE_UP);
}
int pageToSnapTo = mCurrentPage;
@@ -3875,7 +4053,8 @@
taskViewIdArray.removeValue(
finalNextFocusedTaskView.getTaskViewId());
}
- if (snappedIndex < taskViewIdArray.size()) {
+ if (snappedIndex >= 0
+ && snappedIndex < taskViewIdArray.size()) {
taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
} else if (snappedIndex == taskViewIdArray.size()) {
// If the snapped task is the last item from the
@@ -3916,13 +4095,13 @@
} else {
// Update focus task and its size.
if (finalIsFocusedTaskDismissed && finalNextFocusedTaskView != null) {
- mFocusedTaskViewId = enableGridOnlyOverview()
+ setFocusedTaskViewId(enableGridOnlyOverview()
? INVALID_TASK_ID
- : finalNextFocusedTaskView.getTaskViewId();
+ : finalNextFocusedTaskView.getTaskViewId());
mTopRowIdSet.remove(mFocusedTaskViewId);
finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
}
- updateTaskSize(/*isTaskDismissal=*/ true);
+ updateTaskSize();
updateChildTaskOrientations();
// Update scroll and snap to page.
updateScrollSynchronously();
@@ -3950,16 +4129,16 @@
RecentsView.this);
int taskSize = (int) (
getPagedOrientationHandler().getMeasuredSize(
- taskView) * taskView
- .getSizeAdjustment(/*fullscreenEnabled=*/false));
+ taskView) * taskView
+ .getSizeAdjustment(/*fullscreenEnabled=*/
+ false));
int taskEnd = taskStart + taskSize;
shouldRebalance = taskEnd >= screenEnd - mPageSpacing;
}
if (shouldRebalance) {
- updateGridProperties(/*isTaskDismissal=*/ true,
- highestVisibleTaskIndex);
+ updateGridProperties(highestVisibleTaskIndex);
updateScrollSynchronously();
}
}
@@ -4009,7 +4188,9 @@
* * Device is large screen
*/
private void updateCurrentTaskActionsVisibility() {
- boolean isCurrentSplit = getCurrentPageTaskView() instanceof GroupedTaskView;
+ TaskView taskView = getCurrentPageTaskView();
+ boolean isCurrentSplit = taskView instanceof GroupedTaskView;
+ GroupedTaskView groupedTaskView = isCurrentSplit ? (GroupedTaskView) taskView : null;
// Update flags to see if entire actions bar should be hidden.
if (!FeatureFlags.enableAppPairs()) {
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SCREEN, isCurrentSplit);
@@ -4017,9 +4198,11 @@
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SELECT_ACTIVE, isSplitSelectionActive());
// Update flags to see if actions bar should show buttons for a single task or a pair of
// tasks.
- mActionsView.updateForGroupedTask(isCurrentSplit);
+ boolean canSaveAppPair = isCurrentSplit && supportsAppPairs() &&
+ getSplitSelectController().getAppPairsController().canSaveAppPair(groupedTaskView);
+ mActionsView.updateForGroupedTask(isCurrentSplit, canSaveAppPair);
- boolean isCurrentDesktop = getCurrentPageTaskView() instanceof DesktopTaskView;
+ boolean isCurrentDesktop = taskView instanceof DesktopTaskView;
mActionsView.updateHiddenFlags(HIDDEN_DESKTOP, isCurrentDesktop);
}
@@ -4057,8 +4240,9 @@
IntArray bottomArray = new IntArray(bottomRowIdArraySize);
int taskViewCount = getTaskViewCount();
for (int i = 0; i < taskViewCount; i++) {
- int taskViewId = requireTaskViewAt(i).getTaskViewId();
- if (!mTopRowIdSet.contains(taskViewId) && taskViewId != mFocusedTaskViewId) {
+ TaskView taskView = requireTaskViewAt(i);
+ int taskViewId = taskView.getTaskViewId();
+ if (!mTopRowIdSet.contains(taskViewId) && !taskView.isLargeTile()) {
bottomArray.add(taskViewId);
}
}
@@ -4164,6 +4348,7 @@
}
// Init task grid nav helper with top/bottom id arrays.
+ // TODO(b/361070854): Add keyboard navigation for all large tiles.
TaskGridNavHelper taskGridNavHelper = new TaskGridNavHelper(getTopRowIdArray(),
getBottomRowIdArray(), mFocusedTaskViewId);
@@ -4293,7 +4478,7 @@
int alphaInt = Math.round(alpha * 255);
mEmptyMessagePaint.setAlpha(alphaInt);
mEmptyIcon.setAlpha(alphaInt);
- mActionsView.getContentAlpha().setValue(mContentAlpha);
+ mActionsView.getContentAlpha().updateValue(mContentAlpha);
if (alpha > 0) {
setVisibility(VISIBLE);
@@ -4339,7 +4524,10 @@
public void updateRecentsRotation() {
final int rotation = TraceHelper.allowIpcs(
"RecentsView.updateRecentsRotation", () -> mContainer.getDisplay().getRotation());
- mOrientationState.setRecentsRotation(rotation);
+ // Log real orientation change.
+ if (mOrientationState.setRecentsRotation(rotation)) {
+ logOrientationChanged();
+ }
}
public void setLayoutRotation(int touchRotation, int displayRotation) {
@@ -4465,19 +4653,34 @@
setPivotY(mTempPointF.y);
}
+ /**
+ * Sets whether we should force-override the page offset mid-point to the current task, rather
+ * than the running task, when updating page offsets.
+ */
+ public void setOffsetMidpointIndexOverride(int offsetMidpointIndexOverride) {
+ if (!enableAdditionalHomeAnimations()) {
+ return;
+ }
+ mOffsetMidpointIndexOverride = offsetMidpointIndexOverride;
+ updatePageOffsets();
+ }
+
private void updatePageOffsets() {
float offset = mAdjacentPageHorizontalOffset;
float modalOffset = ACCELERATE_0_75.getInterpolation(mTaskModalness);
int count = getChildCount();
boolean showAsGrid = showAsGrid();
- TaskView runningTask = mRunningTaskViewId == -1 || !mRunningTaskTileHidden
+ TaskView runningTask = mRunningTaskViewId == INVALID_PAGE || !mRunningTaskTileHidden
? null : getRunningTaskView();
- int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
+ int midpoint = mOffsetMidpointIndexOverride == INVALID_PAGE
+ ? (runningTask == null ? INVALID_PAGE : indexOfChild(runningTask))
+ : mOffsetMidpointIndexOverride;
int modalMidpoint = getCurrentPage();
- boolean isModalGridWithoutFocusedTask =
- showAsGrid && enableGridOnlyOverview() && mTaskModalness > 0;
- if (isModalGridWithoutFocusedTask) {
+ boolean shouldCalculateOffsetForAllTasks = showAsGrid
+ && (enableGridOnlyOverview() || enableLargeDesktopWindowingTile())
+ && mTaskModalness > 0;
+ if (shouldCalculateOffsetForAllTasks) {
modalMidpoint = indexOfChild(mSelectedTask);
}
@@ -4516,7 +4719,7 @@
: i < midpoint
? leftOffsetSize
: rightOffsetSize;
- if (isModalGridWithoutFocusedTask) {
+ if (shouldCalculateOffsetForAllTasks) {
gridOffsetSize = getHorizontalOffsetSize(i, modalMidpoint, modalOffset);
gridOffsetSize = Math.abs(gridOffsetSize) * (i <= modalMidpoint ? 1 : -1);
}
@@ -4525,8 +4728,11 @@
: showAsGrid
? gridOffsetSize
: i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
- float totalTranslationX = translation + modalTranslation;
View child = getChildAt(i);
+ boolean skipTranslationOffset = enableDesktopTaskAlphaAnimation()
+ && i == getRunningTaskIndex()
+ && child instanceof DesktopTaskView;
+ float totalTranslationX = (skipTranslationOffset ? 0f : translation) + modalTranslation;
FloatProperty translationPropertyX = child instanceof TaskView
? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty()
: getPagedOrientationHandler().getPrimaryViewTranslate();
@@ -4574,6 +4780,7 @@
/**
* Computes the distance to offset the given child such that it is completely offscreen when
* translating away from the given midpoint.
+ *
* @param offsetProgress From 0 to 1 where 0 means no offset and 1 means offset offscreen.
*/
private float getHorizontalOffsetSize(int childIndex, int midpointIndex, float offsetProgress) {
@@ -4717,7 +4924,8 @@
*/
public void resetModalVisuals() {
if (mSelectedTask != null) {
- mSelectedTask.getThumbnail().getTaskOverlay().resetModalVisuals();
+ mSelectedTask.taskContainers.forEach(
+ taskContainer -> taskContainer.getOverlay().resetModalVisuals());
}
}
@@ -4735,8 +4943,8 @@
public void initiateSplitSelect(TaskView taskView, @StagePosition int stagePosition,
StatsLogManager.EventEnum splitEvent) {
mSplitHiddenTaskView = taskView;
- mSplitSelectStateController.setInitialTaskSelect(null /*intent*/,
- stagePosition, taskView.getItemInfo(), splitEvent, taskView.mTask.key.id);
+ mSplitSelectStateController.setInitialTaskSelect(null /*intent*/, stagePosition,
+ taskView.getFirstItemInfo(), splitEvent, taskView.getFirstTask().key.id);
mSplitSelectStateController.setAnimateCurrentTaskDismissal(
true /*animateCurrentTaskDismissal*/);
mSplitHiddenTaskViewIndex = indexOfChild(taskView);
@@ -4760,7 +4968,7 @@
mSplitSelectStateController.setDismissingFromSplitPair(mSplitHiddenTaskView != null
&& mSplitHiddenTaskView instanceof GroupedTaskView);
mSplitSelectStateController.setInitialTaskSelect(splitSelectSource.intent,
- splitSelectSource.position.stagePosition, splitSelectSource.itemInfo,
+ splitSelectSource.position.stagePosition, splitSelectSource.getItemInfo(),
splitSelectSource.splitEvent, splitSelectSource.alreadyRunningTaskId);
updateDesktopTaskVisibility(false /* visible */);
}
@@ -4787,19 +4995,23 @@
// Animate pair thumbnail into full thumbnail
boolean primaryTaskSelected = mSplitHiddenTaskView.getTaskIds()[0]
== mSplitSelectStateController.getInitialTaskId();
- TaskIdAttributeContainer taskIdAttributeContainer = mSplitHiddenTaskView
- .getTaskIdAttributeContainers()[primaryTaskSelected ? 1 : 0];
- TaskThumbnailViewDeprecated thumbnail = taskIdAttributeContainer.getThumbnailView();
+ TaskContainer taskContainer = mSplitHiddenTaskView
+ .getTaskContainers().get(primaryTaskSelected ? 1 : 0);
mSplitSelectStateController.getSplitAnimationController()
- .addInitialSplitFromPair(taskIdAttributeContainer, builder,
+ .addInitialSplitFromPair(taskContainer, builder,
mContainer.getDeviceProfile(),
mSplitHiddenTaskView.getWidth(), mSplitHiddenTaskView.getHeight(),
primaryTaskSelected);
- builder.addOnFrameCallback(() ->{
- thumbnail.refreshSplashView();
+ builder.addOnFrameCallback(() -> {
+ if (!enableRefactorTaskThumbnail()) {
+ taskContainer.getThumbnailViewDeprecated().refreshSplashView();
+ }
mSplitHiddenTaskView.updateSnapshotRadius();
});
} else if (isInitiatingSplitFromTaskView) {
+ if (Flags.enableHoverOfChildElementsInTaskview()) {
+ mSplitHiddenTaskView.setBorderEnabled(false);
+ }
// Splitting from Overview for fullscreen task
createTaskDismissAnimation(builder, mSplitHiddenTaskView, true, false, duration,
true /* dismissingForSplitSelection*/);
@@ -4816,17 +5028,21 @@
* @param containerTaskView If our second selected app is currently running in Recents, this is
* the "container" TaskView from Recents. If we are starting a fresh
* instance of the app from an Intent, this will be null.
- * @param task The Task corresponding to our second selected app. If we are starting a fresh
- * instance of the app from an Intent, this will be null.
- * @param drawable The Drawable corresponding to our second selected app's icon.
- * @param secondView The View representing the current space on the screen where the second app
- * is (either the ThumbnailView or the tapped icon).
- * @param intent If we are launching a fresh instance of the app, this is the Intent for it. If
- * the second app is already running in Recents, this will be null.
- * @param user If we are launching a fresh instance of the app, this is the UserHandle for it.
- * If the second app is already running in Recents, this will be null.
+ * @param task The Task corresponding to our second selected app. If we are
+ * starting a fresh
+ * instance of the app from an Intent, this will be null.
+ * @param drawable The Drawable corresponding to our second selected app's icon.
+ * @param secondView The View representing the current space on the screen where the
+ * second app
+ * is (either the ThumbnailView or the tapped icon).
+ * @param intent If we are launching a fresh instance of the app, this is the Intent
+ * for it. If
+ * the second app is already running in Recents, this will be null.
+ * @param user If we are launching a fresh instance of the app, this is the
+ * UserHandle for it.
+ * If the second app is already running in Recents, this will be null.
* @return true if waiting for confirmation of second app or if split animations are running,
- * false otherwise
+ * false otherwise
*/
public boolean confirmSplitSelect(TaskView containerTaskView, Task task, Drawable drawable,
View secondView, @Nullable Bitmap thumbnail, Intent intent, UserHandle user,
@@ -4871,9 +5087,8 @@
mSplitSelectStateController.getActiveSplitStagePosition(), firstTaskEndingBounds,
secondTaskEndingBounds);
- mSplitDividerPlaceholderView = mSplitSelectStateController
- .getSplitAnimationController().addDividerPlaceholderViewToAnim(pendingAnimation,
- mContainer, secondTaskEndingBounds, getContext());
+ mSplitScrim = mSplitSelectStateController.getSplitAnimationController()
+ .addScrimBehindAnim(pendingAnimation, mContainer, getContext());
FloatingTaskView firstFloatingTaskView =
mSplitSelectStateController.getFirstFloatingTaskView();
firstFloatingTaskView.getBoundsOnScreen(firstTaskStartingBounds);
@@ -4915,7 +5130,7 @@
"Second tile selected");
// Fade out all other views underneath placeholders
- ObjectAnimator tvFade = ObjectAnimator.ofFloat(this, RecentsView.CONTENT_ALPHA,1, 0);
+ ObjectAnimator tvFade = ObjectAnimator.ofFloat(this, RecentsView.CONTENT_ALPHA, 1, 0);
pendingAnimation.add(tvFade, DECELERATE_2, SpringProperty.DEFAULT);
pendingAnimation.buildAnim().start();
return true;
@@ -4928,7 +5143,7 @@
safeRemoveDragLayerView(mSplitSelectStateController.getFirstFloatingTaskView());
safeRemoveDragLayerView(mSecondFloatingTaskView);
safeRemoveDragLayerView(mSplitSelectStateController.getSplitInstructionsView());
- safeRemoveDragLayerView(mSplitDividerPlaceholderView);
+ safeRemoveDragLayerView(mSplitScrim);
mSecondFloatingTaskView = null;
mSplitSelectSource = null;
mSplitSelectStateController.getSplitAnimationController()
@@ -5063,7 +5278,7 @@
if (mShowEmptyMessage && hasValidSize && mEmptyTextLayout == null) {
int availableWidth = mLastMeasureSize.x - mEmptyMessagePadding - mEmptyMessagePadding;
mEmptyTextLayout = StaticLayout.Builder.obtain(mEmptyMessage, 0, mEmptyMessage.length(),
- mEmptyMessagePaint, availableWidth)
+ mEmptyMessagePaint, availableWidth)
.setAlignment(Layout.Alignment.ALIGN_CENTER)
.build();
int totalHeight = mEmptyTextLayout.getHeight()
@@ -5105,23 +5320,34 @@
* to the right.
*/
@SuppressLint("Recycle")
- public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) {
+ public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView taskView) {
AnimatorSet anim = new AnimatorSet();
- int taskIndex = indexOfChild(tv);
+ int taskIndex = indexOfChild(taskView);
int centerTaskIndex = getCurrentPage();
float toScale = getMaxScaleForFullScreen();
boolean showAsGrid = showAsGrid();
- boolean launchingCenterTask = showAsGrid
- ? tv.isFocusedTask() && isTaskViewFullyVisible(tv)
- : taskIndex == centerTaskIndex;
- if (launchingCenterTask) {
+ boolean zoomInTaskView = showAsGrid ? taskView.isLargeTile() : taskIndex == centerTaskIndex;
+ if (zoomInTaskView) {
anim.play(ObjectAnimator.ofFloat(this, RECENTS_SCALE_PROPERTY, toScale));
anim.play(ObjectAnimator.ofFloat(this, FULLSCREEN_PROGRESS, 1));
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(@NonNull Animator animation, boolean isReverse) {
+ taskView.getThumbnailBounds(mTempRect, /*relativeToDragLayer=*/true);
+ getTaskDimension(mContext, mContainer.getDeviceProfile(), mTempPointF);
+ Rect fullscreenBounds = new Rect(0, 0, (int) mTempPointF.x,
+ (int) mTempPointF.y);
+ Utilities.getPivotsForScalingRectToRect(mTempRect, fullscreenBounds,
+ mTempPointF);
+ setPivotX(mTempPointF.x);
+ setPivotY(mTempPointF.y);
+ }
+ });
} else if (!showAsGrid) {
// We are launching an adjacent task, so parallax the center and other adjacent task.
- float displacementX = tv.getWidth() * (toScale - 1f);
+ float displacementX = taskView.getWidth() * (toScale - 1f);
float primaryTranslation = mIsRtl ? -displacementX : displacementX;
anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex),
getPagedOrientationHandler().getPrimaryViewTranslate(), primaryTranslation));
@@ -5149,6 +5375,17 @@
}
}
anim.play(ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, 0, 1));
+ if (taskView instanceof DesktopTaskView) {
+ anim.play(ObjectAnimator.ofArgb(mContainer.getScrimView(), VIEW_BACKGROUND_COLOR,
+ Color.TRANSPARENT));
+ }
+ DepthController depthController = getDepthController();
+ if (depthController != null) {
+ float targetDepth = taskView instanceof DesktopTaskView ? 0 : BACKGROUND_APP.getDepth(
+ mContainer);
+ anim.play(ObjectAnimator.ofFloat(depthController.stateDepth, MULTI_PROPERTY_VALUE,
+ targetDepth));
+ }
return anim;
}
@@ -5174,7 +5411,7 @@
}
public PendingAnimation createTaskLaunchAnimation(
- TaskView tv, long duration, Interpolator interpolator) {
+ TaskView taskView, long duration, Interpolator interpolator) {
if (FeatureFlags.IS_STUDIO_BUILD && mPendingAnimation != null) {
throw new IllegalStateException("Another pending animation is still running");
}
@@ -5189,13 +5426,13 @@
updateGridProperties();
updateScrollSynchronously();
- int targetSysUiFlags = tv.getThumbnail().getSysUiStatusNavFlags();
- final boolean[] passedOverviewThreshold = new boolean[] {false};
- ValueAnimator progressAnim = ValueAnimator.ofFloat(0, 1);
- progressAnim.addUpdateListener(animator -> {
+ int targetSysUiFlags = taskView.getTaskContainers().getFirst().getSysUiStatusNavFlags();
+ final boolean[] passedOverviewThreshold = new boolean[]{false};
+ AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(taskView);
+ anim.play(new AnimatedFloat(v -> {
// Once we pass a certain threshold, update the sysui flags to match the target
// tasks' flags
- if (animator.getAnimatedFraction() > UPDATE_SYSUI_FLAGS_THRESHOLD) {
+ if (v > UPDATE_SYSUI_FLAGS_THRESHOLD) {
mContainer.getSystemUiController().updateUiState(
UI_STATE_FULLSCREEN_TASK, targetSysUiFlags);
} else {
@@ -5203,8 +5440,7 @@
}
// Passing the threshold from taskview to fullscreen app will vibrate
- final boolean passed = animator.getAnimatedFraction() >=
- SUCCESS_TRANSITION_PROGRESS;
+ final boolean passed = v >= SUCCESS_TRANSITION_PROGRESS;
if (passed != passedOverviewThreshold[0]) {
passedOverviewThreshold[0] = passed;
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
@@ -5214,19 +5450,7 @@
mRecentsAnimationController.setWillFinishToHome(!passed);
}
}
- });
-
- AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv);
-
- DepthController depthController = getDepthController();
- if (depthController != null) {
- ObjectAnimator depthAnimator = ObjectAnimator.ofFloat(depthController.stateDepth,
- MULTI_PROPERTY_VALUE, BACKGROUND_APP.getDepth(mContainer));
- anim.play(depthAnimator);
- }
- anim.play(ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, 0f, 1f));
-
- anim.play(progressAnim);
+ }).animateToValue(0f, 1f));
anim.setInterpolator(interpolator);
mPendingAnimation = new PendingAnimation(duration);
@@ -5235,9 +5459,18 @@
remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.addOverviewToAppAnim(mPendingAnimation, interpolator));
mPendingAnimation.addOnFrameCallback(this::redrawLiveTile);
+ if (taskView instanceof DesktopTaskView && mRemoteTargetHandles != null) {
+ mPendingAnimation.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ runActionOnRemoteHandles(remoteTargetHandle ->
+ remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(false));
+ }
+ });
+ }
mPendingAnimation.addEndListener(isSuccess -> {
if (isSuccess) {
- if (tv instanceof GroupedTaskView && hasAllValidTaskIds(tv.getTaskIds())
+ if (taskView instanceof GroupedTaskView && hasAllValidTaskIds(taskView.getTaskIds())
&& mRemoteTargetHandles != null) {
// TODO(b/194414938): make this part of the animations instead.
TaskViewUtils.createSplitAuxiliarySurfacesAnimator(
@@ -5247,17 +5480,14 @@
dividerAnimator.end();
});
}
- if (tv.isRunningTask()) {
+ if (taskView.isRunningTask()) {
finishRecentsAnimation(false /* toRecents */, null);
onTaskLaunchAnimationEnd(true /* success */);
} else {
- tv.launchTask(this::onTaskLaunchAnimationEnd);
+ taskView.launchTask(this::onTaskLaunchAnimationEnd);
}
- Task task = tv.getTask();
- if (task != null) {
- mContainer.getStatsLogManager().logger().withItemInfo(tv.getItemInfo())
- .log(LAUNCHER_TASK_LAUNCH_SWIPE_DOWN);
- }
+ mContainer.getStatsLogManager().logger().withItemInfo(taskView.getFirstItemInfo())
+ .log(LAUNCHER_TASK_LAUNCH_SWIPE_DOWN);
} else {
onTaskLaunchAnimationEnd(false);
}
@@ -5266,10 +5496,11 @@
return mPendingAnimation;
}
- protected void onTaskLaunchAnimationEnd(boolean success) {
+ protected Unit onTaskLaunchAnimationEnd(boolean success) {
if (success) {
resetTaskVisuals();
}
+ return Unit.INSTANCE;
}
@Override
@@ -5278,6 +5509,43 @@
updateCurrentTaskActionsVisibility();
loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
updateEnabledOverlays();
+
+ if (enableRefactorTaskThumbnail()) {
+ int screenStart = 0;
+ int screenEnd = 0;
+ int centerPageIndex = 0;
+ if (showAsGrid()) {
+ screenStart = getPagedOrientationHandler().getPrimaryScroll(this);
+ int pageOrientedSize = getPagedOrientationHandler().getMeasuredSize(this);
+ screenEnd = screenStart + pageOrientedSize;
+ } else {
+ centerPageIndex = getPageNearestToCenterOfScreen();
+ }
+
+ Set<Integer> fullyVisibleTaskIds = new HashSet<>();
+
+ // Update the task data for the in/visible children
+ for (int i = 0; i < getTaskViewCount(); i++) {
+ TaskView taskView = requireTaskViewAt(i);
+ List<TaskContainer> containers = taskView.getTaskContainers();
+ if (containers.isEmpty()) {
+ continue;
+ }
+ boolean isFullyVisible;
+ if (showAsGrid()) {
+ isFullyVisible = isTaskViewFullyWithinBounds(taskView, screenStart,
+ screenEnd);
+ } else {
+ isFullyVisible = i == centerPageIndex;
+ }
+ if (isFullyVisible) {
+ List<Integer> taskIds = containers.stream().map(
+ taskContainer -> taskContainer.getTask().key.id).toList();
+ fullyVisibleTaskIds.addAll(taskIds);
+ }
+ }
+ mRecentsViewModel.updateTasksFullyVisible(fullyVisibleTaskIds);
+ }
}
@Override
@@ -5359,7 +5627,7 @@
}
RemoteTargetGluer gluer;
- if (recentsAnimationTargets.hasDesktopTasks()) {
+ if (recentsAnimationTargets.hasDesktopTasks(mContext)) {
gluer = new RemoteTargetGluer(getContext(), getSizeStrategy(), recentsAnimationTargets,
true /* forDesktop */);
mRemoteTargetHandles = gluer.assignTargetsForDesktop(recentsAnimationTargets);
@@ -5541,8 +5809,8 @@
}
private int getFirstViewIndex() {
- TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
- return focusedTaskView != null ? indexOfChild(focusedTaskView) : 0;
+ TaskView firstTaskView = mShowAsGridLastOnLayout ? getFirstLargeTaskView() : null;
+ return firstTaskView != null ? indexOfChild(firstTaskView) : 0;
}
private int getLastViewIndex() {
@@ -5560,7 +5828,7 @@
}
// Returns focus task if there are no grid tasks.
- return indexOfChild(getFocusedTaskView());
+ return indexOfChild(getFirstLargeTaskView());
}
/**
@@ -5675,6 +5943,7 @@
* Sets whether or not we should clamp the scroll offset.
* This is used to avoid x-axis movement when swiping up transient taskbar.
* Should only be set at the beginning and end of the gesture, otherwise a jump may occur.
+ *
* @param clampScrollOffset When true, we clamp the scroll to 0 before the clamp threshold is
* met.
*/
@@ -5707,11 +5976,11 @@
// Don't dampen the scroll (due to overscroll) if the adjacent tasks are offscreen, so that
// the page can move freely given there's no visual indication why it shouldn't.
int overScrollShift = mAdjacentPageHorizontalOffset > 0
- ? (int) Utilities.mapRange(
- mAdjacentPageHorizontalOffset,
- getOverScrollShift(),
- getUndampedOverScrollShift())
- : getOverScrollShift();
+ ? (int) Utilities.mapRange(
+ mAdjacentPageHorizontalOffset,
+ getOverScrollShift(),
+ getUndampedOverScrollShift())
+ : getOverScrollShift();
return getScrollForPage(pageIndex) - getPagedOrientationHandler().getPrimaryScroll(this)
+ overScrollShift + getOffsetFromScrollPosition(pageIndex);
}
@@ -5775,7 +6044,7 @@
public boolean isOnGridBottomRow(TaskView taskView) {
return showAsGrid()
&& !mTopRowIdSet.contains(taskView.getTaskViewId())
- && taskView.getTaskViewId() != mFocusedTaskViewId;
+ && !taskView.isLargeTile();
}
public Consumer<MotionEvent> getEventDispatcher(float navbarRotation) {
@@ -5828,6 +6097,10 @@
if (mOverlayEnabled != overlayEnabled) {
mOverlayEnabled = overlayEnabled;
updateEnabledOverlays();
+
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.setOverlayEnabled(overlayEnabled);
+ }
}
}
@@ -5875,32 +6148,28 @@
return;
}
- switchToScreenshotInternal(onFinishRunnable);
- }
-
- private void switchToScreenshotInternal(Runnable onFinishRunnable) {
TaskView taskView = getRunningTaskView();
if (taskView == null) {
onFinishRunnable.run();
return;
}
- taskView.setShowScreenshot(true);
- for (TaskIdAttributeContainer container : taskView.getTaskIdAttributeContainers()) {
- if (container == null) {
- continue;
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.switchToScreenshot(taskView, mRecentsAnimationController, onFinishRunnable);
+ } else {
+ setRunningTaskViewShowScreenshot(true);
+ for (TaskContainer container : taskView.getTaskContainers()) {
+ ThumbnailData thumbnailData =
+ mRecentsAnimationController.screenshotTask(container.getTask().key.id);
+ TaskThumbnailViewDeprecated thumbnailView = container.getThumbnailViewDeprecated();
+ if (thumbnailData != null) {
+ thumbnailView.setThumbnail(container.getTask(), thumbnailData);
+ } else {
+ thumbnailView.refresh();
+ }
}
-
- ThumbnailData td =
- mRecentsAnimationController.screenshotTask(container.getTask().key.id);
- TaskThumbnailViewDeprecated thumbnailView = container.getThumbnailView();
- if (td != null) {
- thumbnailView.setThumbnail(container.getTask(), td);
- } else {
- thumbnailView.refresh();
- }
+ ViewUtils.postFrameDrawn(taskView, onFinishRunnable);
}
- ViewUtils.postFrameDrawn(taskView, onFinishRunnable);
}
/**
@@ -5914,9 +6183,13 @@
Runnable onFinishRunnable) {
final TaskView taskView = getRunningTaskView();
if (taskView != null) {
- taskView.setShowScreenshot(true);
- taskView.refreshThumbnails(thumbnailDatas);
- ViewUtils.postFrameDrawn(taskView, onFinishRunnable);
+ if (enableRefactorTaskThumbnail()) {
+ mHelper.switchToScreenshot(taskView, thumbnailDatas, onFinishRunnable);
+ } else {
+ taskView.setShouldShowScreenshot(true);
+ taskView.refreshThumbnails(thumbnailDatas);
+ ViewUtils.postFrameDrawn(taskView, onFinishRunnable);
+ }
} else {
onFinishRunnable.run();
}
@@ -5981,10 +6254,13 @@
}
/** Tint the RecentsView and TaskViews in to simulate a scrim. */
- // TODO(b/187528071): Replace this tinting with a scrim on top of RecentsView
private void setColorTint(float tintAmount) {
mColorTint = tintAmount;
+ if (enableRefactorTaskThumbnail()) {
+ mRecentsViewModel.setTintAmount(tintAmount);
+ }
+
for (int i = 0; i < getTaskViewCount(); i++) {
requireTaskViewAt(i).setColorTint(mColorTint, mTintingColor);
}
@@ -6009,7 +6285,7 @@
public boolean showAsGrid() {
return mOverviewGridEnabled || (mCurrentGestureEndTarget != null
&& mSizeStrategy.stateFromGestureEndTarget(mCurrentGestureEndTarget)
- .displayOverviewTasksAsGrid(mContainer.getDeviceProfile()));
+ .displayOverviewTasksAsGrid(mContainer.getDeviceProfile()));
}
private boolean showAsFullscreen() {
@@ -6050,7 +6326,7 @@
/**
* @return Corner radius in pixel value for PiP window, which is updated via
- * {@link #mIPipAnimationListener}
+ * {@link #mIPipAnimationListener}
*/
public int getPipCornerRadius() {
return mPipCornerRadius;
@@ -6058,7 +6334,7 @@
/**
* @return Shadow radius in pixel value for PiP window, which is updated via
- * {@link #mIPipAnimationListener}
+ * {@link #mIPipAnimationListener}
*/
public int getPipShadowRadius() {
return mPipShadowRadius;
@@ -6256,24 +6532,44 @@
/**
* Moves the provided task into desktop mode, and invoke {@code successCallback} if succeeded.
*/
- public void moveTaskToDesktop(TaskIdAttributeContainer taskContainer,
+ public void moveTaskToDesktop(TaskContainer taskContainer,
+ DesktopModeTransitionSource transitionSource,
Runnable successCallback) {
if (!DesktopModeStatus.canEnterDesktopMode(mContext)) {
return;
}
switchToScreenshot(() -> finishRecentsAnimation(/* toRecents= */true, /* shouldPip= */false,
- () -> moveTaskToDesktopInternal(taskContainer, successCallback)));
+ () -> moveTaskToDesktopInternal(taskContainer, successCallback, transitionSource)));
}
- private void moveTaskToDesktopInternal(TaskIdAttributeContainer taskContainer,
- Runnable successCallback) {
+ private void moveTaskToDesktopInternal(TaskContainer taskContainer,
+ Runnable successCallback, DesktopModeTransitionSource transitionSource) {
if (mDesktopRecentsTransitionController == null) {
return;
}
- mDesktopRecentsTransitionController.moveToDesktop(taskContainer.getTask().key.id);
+ mDesktopRecentsTransitionController.moveToDesktop(taskContainer.getTask().key.id,
+ transitionSource);
successCallback.run();
}
+ // Logs when the orientation of Overview changes. We log both real and fake orientation changes.
+ private void logOrientationChanged() {
+ // Only log when Overview is showing.
+ if (mOverviewStateEnabled) {
+ mContainer.getStatsLogManager()
+ .logger()
+ .withContainerInfo(
+ LauncherAtom.ContainerInfo.newBuilder()
+ .setTaskSwitcherContainer(
+ LauncherAtom.TaskSwitcherContainer.newBuilder()
+ .setOrientationHandler(
+ getPagedOrientationHandler()
+ .getHandlerTypeForLogging()))
+ .build())
+ .log(LAUNCHER_OVERVIEW_ORIENTATION_CHANGED);
+ }
+ }
+
public interface TaskLaunchListener {
void onTaskLaunched();
}
diff --git a/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
similarity index 80%
rename from src/com/android/quickstep/views/RecentsViewContainer.java
rename to quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 0c3f4f1..060c71e 100644
--- a/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -27,6 +27,7 @@
import android.view.Window;
import com.android.launcher3.BaseActivity;
+import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.ScrimView;
@@ -165,4 +166,36 @@
* Begins transition from overview back to homescreen
*/
void returnToHomescreen();
+
+ /**
+ * True if the overview panel is visible.
+ * @return Boolean
+ */
+ boolean isRecentsViewVisible();
+
+ /**
+ * Overwrites any logged item in Launcher that doesn't have a container with the
+ * {@link com.android.launcher3.touch.PagedOrientationHandler} in use for Overview.
+ *
+ * @param itemInfoBuilder {@link LauncherAtom.ItemInfo.Builder}
+ */
+ default void applyOverwritesToLogItem(LauncherAtom.ItemInfo.Builder itemInfoBuilder) {
+ if (!itemInfoBuilder.getContainerInfo().hasTaskSwitcherContainer()) {
+ return;
+ }
+
+ if (!isRecentsViewVisible()) {
+ return;
+ }
+
+ RecentsView<?, ?> recentsView = getOverviewPanel();
+ var orientationForLogging =
+ recentsView.getPagedOrientationHandler().getHandlerTypeForLogging();
+ itemInfoBuilder.setContainerInfo(
+ LauncherAtom.ContainerInfo.newBuilder()
+ .setTaskSwitcherContainer(
+ LauncherAtom.TaskSwitcherContainer.newBuilder()
+ .setOrientationHandler(orientationForLogging))
+ .build());
+ }
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewModelHelper.kt b/quickstep/src/com/android/quickstep/views/RecentsViewModelHelper.kt
new file mode 100644
index 0000000..f5b2176
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewModelHelper.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.views
+
+import com.android.quickstep.RecentsAnimationController
+import com.android.quickstep.ViewUtils
+import com.android.quickstep.recents.viewmodel.RecentsViewModel
+import com.android.systemui.shared.recents.model.ThumbnailData
+import kotlinx.coroutines.CoroutineName
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.SupervisorJob
+import kotlinx.coroutines.cancel
+import kotlinx.coroutines.launch
+
+/** Helper for [RecentsView] to interact with the [RecentsViewModel]. */
+class RecentsViewModelHelper(private val recentsViewModel: RecentsViewModel) {
+ private lateinit var viewAttachedScope: CoroutineScope
+
+ fun onAttachedToWindow() {
+ viewAttachedScope =
+ CoroutineScope(SupervisorJob() + Dispatchers.Main + CoroutineName("RecentsView"))
+ }
+
+ fun onDetachedFromWindow() {
+ viewAttachedScope.cancel("RecentsView detaching from window")
+ }
+
+ fun switchToScreenshot(
+ taskView: TaskView,
+ recentsAnimationController: RecentsAnimationController,
+ onFinishRunnable: Runnable,
+ ) {
+ val updatedThumbnails =
+ taskView.taskContainers.associate {
+ it.task.key.id to recentsAnimationController.screenshotTask(it.task.key.id)
+ }
+ switchToScreenshot(taskView, updatedThumbnails, onFinishRunnable)
+ }
+
+ fun switchToScreenshot(
+ taskView: TaskView,
+ updatedThumbnails: Map<Int, ThumbnailData>?,
+ onFinishRunnable: Runnable,
+ ) {
+ // Update recentsViewModel and apply the thumbnailOverride ASAP, before waiting inside
+ // viewAttachedScope.
+ recentsViewModel.setRunningTaskShowScreenshot(true)
+ viewAttachedScope.launch {
+ recentsViewModel.waitForRunningTaskShowScreenshotToUpdate()
+ if (updatedThumbnails != null) {
+ recentsViewModel.waitForThumbnailsToUpdate(updatedThumbnails)
+ }
+ ViewUtils.postFrameDrawn(taskView, onFinishRunnable)
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
index a56d51e..f6393e4 100644
--- a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
@@ -16,15 +16,16 @@
package com.android.quickstep.views;
-import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_CANCEL_BUTTON;
+import static com.android.settingslib.widget.theme.R.dimen.settingslib_preferred_minimum_touch_target;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
import android.content.Context;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.FloatProperty;
+import android.view.TouchDelegate;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -39,11 +40,8 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StateManager;
-import com.android.launcher3.statemanager.StatefulActivity;
-import com.android.launcher3.states.StateAnimationConfig;
-
+import com.android.quickstep.util.AnimUtils;
import com.android.quickstep.util.SplitSelectStateController;
/**
@@ -56,7 +54,6 @@
public class SplitInstructionsView extends LinearLayout {
private static final int BOUNCE_DURATION = 250;
private static final float BOUNCE_HEIGHT = 20;
- private static final int DURATION_DEFAULT_SPLIT_DISMISS = 350;
private final RecentsViewContainer mContainer;
public boolean mIsCurrentlyAnimating = false;
@@ -133,6 +130,28 @@
cancelTextView.setVisibility(VISIBLE);
cancelTextView.setOnClickListener((v) -> exitSplitSelection());
instructionTextView.setText(R.string.toast_contextual_split_select_app);
+
+ // After layout, expand touch target of cancel button to meet minimum a11y measurements.
+ post(() -> {
+ int minTouchSize = getResources()
+ .getDimensionPixelSize(settingslib_preferred_minimum_touch_target);
+ Rect r = new Rect();
+ cancelTextView.getHitRect(r);
+
+ if (r.width() < minTouchSize) {
+ // add 1 to ensure ceiling on int division
+ int expandAmount = (minTouchSize + 1 - r.width()) / 2;
+ r.left -= expandAmount;
+ r.right += expandAmount;
+ }
+ if (r.height() < minTouchSize) {
+ int expandAmount = (minTouchSize + 1 - r.height()) / 2;
+ r.top -= expandAmount;
+ r.bottom += expandAmount;
+ }
+
+ setTouchDelegate(new TouchDelegate(r, cancelTextView));
+ });
}
// Set accessibility title, will be announced by a11y tools.
@@ -142,25 +161,11 @@
private void exitSplitSelection() {
RecentsView recentsView = mContainer.getOverviewPanel();
SplitSelectStateController splitSelectController = recentsView.getSplitSelectController();
-
StateManager stateManager = recentsView.getStateManager();
- BaseState startState = stateManager.getState();
- long duration = startState.getTransitionDuration(mContainer.asContext(), false);
- if (duration == 0) {
- // Case where we're in contextual on workspace (NORMAL), which by default has 0
- // transition duration
- duration = DURATION_DEFAULT_SPLIT_DISMISS;
- }
- StateAnimationConfig config = new StateAnimationConfig();
- config.duration = duration;
- AnimatorSet stateAnim = stateManager.createAtomicAnimation(
- startState, NORMAL, config);
- AnimatorSet dismissAnim = splitSelectController.getSplitAnimationController()
- .createPlaceholderDismissAnim(mContainer,
- LAUNCHER_SPLIT_SELECTION_EXIT_CANCEL_BUTTON, duration);
- stateAnim.play(dismissAnim);
- stateManager.setCurrentAnimation(stateAnim, NORMAL);
- stateAnim.start();
+
+ AnimUtils.goToNormalStateWithSplitDismissal(stateManager, mContainer,
+ LAUNCHER_SPLIT_SELECTION_EXIT_CANCEL_BUTTON,
+ splitSelectController.getSplitAnimationController());
}
void ensureProperRotation() {
diff --git a/quickstep/src/com/android/quickstep/views/TaskContainer.kt b/quickstep/src/com/android/quickstep/views/TaskContainer.kt
new file mode 100644
index 0000000..af32ba2
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/TaskContainer.kt
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.views
+
+import android.content.Intent
+import android.graphics.Bitmap
+import android.view.View
+import com.android.launcher3.Flags.enableRefactorTaskThumbnail
+import com.android.launcher3.Flags.privateSpaceRestrictAccessibilityDrag
+import com.android.launcher3.LauncherSettings
+import com.android.launcher3.model.data.ItemInfoWithIcon
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.pm.UserCache
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.launcher3.util.TransformingTouchDelegate
+import com.android.quickstep.TaskOverlayFactory
+import com.android.quickstep.TaskUtils
+import com.android.quickstep.recents.di.RecentsDependencies
+import com.android.quickstep.recents.di.get
+import com.android.quickstep.recents.di.getScope
+import com.android.quickstep.recents.di.inject
+import com.android.quickstep.recents.viewmodel.TaskContainerViewModel
+import com.android.quickstep.task.thumbnail.TaskThumbnailView
+import com.android.quickstep.task.viewmodel.TaskContainerData
+import com.android.quickstep.task.viewmodel.TaskThumbnailViewModel
+import com.android.systemui.shared.recents.model.Task
+
+/** Holder for all Task dependent information. */
+class TaskContainer(
+ val taskView: TaskView,
+ val task: Task,
+ val snapshotView: View,
+ val iconView: TaskViewIcon,
+ /**
+ * This technically can be a vanilla [android.view.TouchDelegate] class, however that class
+ * requires setting the touch bounds at construction, so we'd repeatedly be created many
+ * instances unnecessarily as scrolling occurs, whereas [TransformingTouchDelegate] allows touch
+ * delegated bounds only to be updated.
+ */
+ val iconTouchDelegate: TransformingTouchDelegate,
+ /** Defaults to STAGE_POSITION_UNDEFINED if in not a split screen task view */
+ @SplitConfigurationOptions.StagePosition val stagePosition: Int,
+ val digitalWellBeingToast: DigitalWellBeingToast?,
+ val showWindowsView: View?,
+ taskOverlayFactory: TaskOverlayFactory
+) {
+ val overlay: TaskOverlayFactory.TaskOverlay<*> = taskOverlayFactory.createOverlay(this)
+ lateinit var taskContainerData: TaskContainerData
+
+ private val taskThumbnailViewModel: TaskThumbnailViewModel by
+ RecentsDependencies.inject(snapshotView)
+
+ // TODO(b/335649589): Ideally create and obtain this from DI.
+ private val taskContainerViewModel: TaskContainerViewModel by lazy {
+ TaskContainerViewModel(
+ sysUiStatusNavFlagsUseCase = RecentsDependencies.get(),
+ getThumbnailUseCase = RecentsDependencies.get(),
+ splashAlphaUseCase = RecentsDependencies.get(),
+ )
+ }
+
+ init {
+ if (enableRefactorTaskThumbnail()) {
+ require(snapshotView is TaskThumbnailView)
+ taskContainerData = RecentsDependencies.get(this)
+ RecentsDependencies.getScope(snapshotView).apply {
+ val taskViewScope = RecentsDependencies.getScope(taskView)
+ linkTo(taskViewScope)
+
+ val taskContainerScope = RecentsDependencies.getScope(this@TaskContainer)
+ linkTo(taskContainerScope)
+ }
+ } else {
+ require(snapshotView is TaskThumbnailViewDeprecated)
+ }
+ }
+
+ val splitAnimationThumbnail: Bitmap?
+ get() =
+ if (enableRefactorTaskThumbnail()) {
+ taskContainerViewModel.getThumbnail(task.key.id)
+ } else {
+ thumbnailViewDeprecated.thumbnail
+ }
+
+ val thumbnailView: TaskThumbnailView
+ get() {
+ require(enableRefactorTaskThumbnail())
+ return snapshotView as TaskThumbnailView
+ }
+
+ val thumbnailViewDeprecated: TaskThumbnailViewDeprecated
+ get() {
+ require(!enableRefactorTaskThumbnail())
+ return snapshotView as TaskThumbnailViewDeprecated
+ }
+
+ // TODO(b/334826842): Support shouldShowSplashView for new TTV.
+ val shouldShowSplashView: Boolean
+ get() =
+ if (enableRefactorTaskThumbnail())
+ taskContainerViewModel.shouldShowThumbnailSplash(task.key.id)
+ else thumbnailViewDeprecated.shouldShowSplashView()
+
+ val sysUiStatusNavFlags: Int
+ get() =
+ if (enableRefactorTaskThumbnail())
+ taskContainerViewModel.getSysUiStatusNavFlags(task.key.id)
+ else thumbnailViewDeprecated.sysUiStatusNavFlags
+
+ /** Builds proto for logging */
+ val itemInfo: WorkspaceItemInfo
+ get() =
+ WorkspaceItemInfo().apply {
+ itemType = LauncherSettings.Favorites.ITEM_TYPE_TASK
+ container = LauncherSettings.Favorites.CONTAINER_TASKSWITCHER
+ val componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key)
+ user = componentKey.user
+ intent = Intent().setComponent(componentKey.componentName)
+ title = task.title
+ taskView.recentsView?.let { screenId = it.indexOfChild(taskView) }
+ if (privateSpaceRestrictAccessibilityDrag()) {
+ if (
+ UserCache.getInstance(taskView.context)
+ .getUserInfo(componentKey.user)
+ .isPrivate
+ ) {
+ runtimeStatusFlags =
+ runtimeStatusFlags or ItemInfoWithIcon.FLAG_NOT_PINNABLE
+ }
+ }
+ }
+
+ fun bind() {
+ if (enableRefactorTaskThumbnail()) {
+ bindThumbnailView()
+ } else {
+ thumbnailViewDeprecated.bind(task, overlay)
+ }
+ overlay.init()
+ }
+
+ fun destroy() {
+ digitalWellBeingToast?.destroy()
+ if (enableRefactorTaskThumbnail()) {
+ taskView.removeView(thumbnailView)
+ }
+ overlay.destroy()
+ }
+
+ fun bindThumbnailView() {
+ taskThumbnailViewModel.bind(task.key.id)
+ }
+
+ fun setOverlayEnabled(enabled: Boolean) {
+ if (!enableRefactorTaskThumbnail()) {
+ thumbnailViewDeprecated.setOverlayEnabled(enabled)
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index 443f83c..63bc509 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -18,8 +18,7 @@
import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.launcher3.Flags.enableOverviewIconMenu;
-import static com.android.launcher3.testing.shared.TestProtocol.TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE;
-import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
+import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.quickstep.views.TaskThumbnailViewDeprecated.DIM_ALPHA;
@@ -56,7 +55,6 @@
import com.android.quickstep.TaskUtils;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.util.TaskCornerRadius;
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
/**
* Contains options for a recent task when long-pressing its icon.
@@ -76,7 +74,7 @@
private ValueAnimator mRevealAnimator;
@Nullable private Runnable mOnClosingStartCallback;
private TaskView mTaskView;
- private TaskIdAttributeContainer mTaskContainer;
+ private TaskContainer mTaskContainer;
private LinearLayout mOptionLayout;
private float mMenuTranslationYBeforeOpen;
private float mMenuTranslationXBeforeOpen;
@@ -114,11 +112,7 @@
@Override
protected void handleClose(boolean animate) {
- if (animate || enableOverviewIconMenu()) {
- animateClose();
- } else {
- closeComplete();
- }
+ animateClose();
}
@Override
@@ -163,7 +157,10 @@
}
}
- public static boolean showForTask(TaskIdAttributeContainer taskContainer,
+ /**
+ * Show a task menu for the given taskContainer.
+ */
+ public static boolean showForTask(TaskContainer taskContainer,
@Nullable Runnable onClosingStartCallback) {
RecentsViewContainer container = RecentsViewContainer.containerFromContext(
taskContainer.getTaskView().getContext());
@@ -173,11 +170,14 @@
return taskMenuView.populateAndShowForTask(taskContainer);
}
- public static boolean showForTask(TaskIdAttributeContainer taskContainer) {
+ /**
+ * Show a task menu for the given taskContainer.
+ */
+ public static boolean showForTask(TaskContainer taskContainer) {
return showForTask(taskContainer, null);
}
- private boolean populateAndShowForTask(TaskIdAttributeContainer taskContainer) {
+ private boolean populateAndShowForTask(TaskContainer taskContainer) {
if (isAttachedToWindow()) {
return false;
}
@@ -198,7 +198,7 @@
return true;
}
- private void addMenuOptions(TaskIdAttributeContainer taskContainer) {
+ private void addMenuOptions(TaskContainer taskContainer) {
if (enableOverviewIconMenu()) {
removeView(mTaskName);
} else {
@@ -226,7 +226,7 @@
mOptionLayout.addView(menuOptionView);
}
- private void orientAroundTaskView(TaskIdAttributeContainer taskContainer) {
+ private void orientAroundTaskView(TaskContainer taskContainer) {
RecentsView recentsView = mContainer.getOverviewPanel();
RecentsPagedOrientationHandler orientationHandler =
recentsView.getPagedOrientationHandler();
@@ -237,12 +237,13 @@
mContainer.getDragLayer().getDescendantRectRelativeToSelf(
enableOverviewIconMenu()
? getIconView().findViewById(R.id.icon_view_menu_anchor)
- : taskContainer.getThumbnailView(),
+ : taskContainer.getSnapshotView(),
sTempRect);
Rect insets = mContainer.getDragLayer().getInsets();
BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) getLayoutParams();
- params.width = orientationHandler.getTaskMenuWidth(taskContainer.getThumbnailView(),
- deviceProfile, taskContainer.getStagePosition());
+ params.width = orientationHandler.getTaskMenuWidth(
+ taskContainer.getSnapshotView(), deviceProfile,
+ taskContainer.getStagePosition());
// Gravity set to Left instead of Start as sTempRect.left measures Left distance not Start
params.gravity = Gravity.LEFT;
setLayoutParams(params);
@@ -275,10 +276,10 @@
// Margin that insets the menuView inside the taskView
float taskInsetMargin = getResources().getDimension(R.dimen.task_card_margin);
setTranslationX(orientationHandler.getTaskMenuX(thumbnailAlignedX,
- mTaskContainer.getThumbnailView(), deviceProfile, taskInsetMargin,
+ mTaskContainer.getSnapshotView(), deviceProfile, taskInsetMargin,
getIconView()));
setTranslationY(orientationHandler.getTaskMenuY(
- thumbnailAlignedY, mTaskContainer.getThumbnailView(),
+ thumbnailAlignedY, mTaskContainer.getSnapshotView(),
mTaskContainer.getStagePosition(), this, taskInsetMargin,
getIconView()));
}
@@ -301,7 +302,6 @@
private void animateOpenOrClosed(boolean closing) {
if (mOpenCloseAnimator != null && mOpenCloseAnimator.isRunning()) {
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE, "getting canceled");
mOpenCloseAnimator.cancel();
}
mOpenCloseAnimator = new AnimatorSet();
@@ -315,7 +315,7 @@
.createRevealAnimator(this, closing, revealAnimationStartProgress);
mRevealAnimator.setInterpolator(enableOverviewIconMenu() ? Interpolators.EMPHASIZED
: Interpolators.DECELERATE);
-
+ AnimatorSet.Builder openCloseAnimatorBuilder = mOpenCloseAnimator.play(mRevealAnimator);
if (enableOverviewIconMenu()) {
IconAppChipView iconAppChip = (IconAppChipView) mTaskContainer.getIconView().asView();
@@ -333,11 +333,13 @@
closing ? mMenuTranslationYBeforeOpen
: mMenuTranslationYBeforeOpen + additionalTranslationY);
translationYAnim.setInterpolator(EMPHASIZED);
+ openCloseAnimatorBuilder.with(translationYAnim);
ObjectAnimator menuTranslationYAnim = ObjectAnimator.ofFloat(
iconAppChip.getMenuTranslationY(),
MULTI_PROPERTY_VALUE, closing ? 0 : additionalTranslationY);
menuTranslationYAnim.setInterpolator(EMPHASIZED);
+ openCloseAnimatorBuilder.with(menuTranslationYAnim);
float additionalTranslationX = 0;
if (mContainer.getDeviceProfile().isLandscape
@@ -353,29 +355,30 @@
closing ? mMenuTranslationXBeforeOpen
: mMenuTranslationXBeforeOpen - additionalTranslationX);
translationXAnim.setInterpolator(EMPHASIZED);
+ openCloseAnimatorBuilder.with(translationXAnim);
ObjectAnimator menuTranslationXAnim = ObjectAnimator.ofFloat(
iconAppChip.getMenuTranslationX(),
MULTI_PROPERTY_VALUE, closing ? 0 : -additionalTranslationX);
menuTranslationXAnim.setInterpolator(EMPHASIZED);
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE,
- "TaskMenuView.java.animateOpenOrClosed: running translation animations");
-
- mOpenCloseAnimator.playTogether(translationYAnim, translationXAnim,
- menuTranslationXAnim, menuTranslationYAnim);
+ openCloseAnimatorBuilder.with(menuTranslationXAnim);
}
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE,
- "TaskMenuView.java.animateOpenOrClosed: running animation 2");
- mOpenCloseAnimator.playTogether(mRevealAnimator,
- ObjectAnimator.ofFloat(
- mTaskContainer.getThumbnailView(), DIM_ALPHA,
- closing ? 0 : TaskView.MAX_PAGE_SCRIM_ALPHA),
- ObjectAnimator.ofFloat(this, ALPHA, closing ? 0 : 1));
+ openCloseAnimatorBuilder.with(ObjectAnimator.ofFloat(this, ALPHA, closing ? 0 : 1));
+ if (enableRefactorTaskThumbnail()) {
+ mRevealAnimator.addUpdateListener(animation -> {
+ float animatedFraction = animation.getAnimatedFraction();
+ float openProgress = closing ? (1 - animatedFraction) : animatedFraction;
+ mTaskContainer.getTaskContainerData()
+ .getTaskMenuOpenProgress().setValue(openProgress);
+ });
+ } else {
+ openCloseAnimatorBuilder.with(ObjectAnimator.ofFloat(
+ mTaskContainer.getThumbnailViewDeprecated(), DIM_ALPHA,
+ closing ? 0 : TaskView.MAX_PAGE_SCRIM_ALPHA));
+ }
mOpenCloseAnimator.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE,
- "TaskMenuView.java.animateOpenOrClosed: onAnimationStart");
setVisibility(VISIBLE);
if (closing && mOnClosingStartCallback != null) {
mOnClosingStartCallback.run();
@@ -383,16 +386,7 @@
}
@Override
- public void onAnimationCancel(Animator animation) {
- super.onAnimationCancel(animation);
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE,
- "TaskMenuView.java.animateOpenOrClosed: onAnimationCancel");
- }
-
- @Override
public void onAnimationSuccess(Animator animator) {
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE,
- "TaskMenuView.java.animateOpenOrClosed: onAnimationSuccess");
if (closing) {
closeComplete();
}
@@ -403,7 +397,6 @@
}
private void closeComplete() {
- testLogD(TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE, "TaskMenuView.java.closeComplete");
mIsOpen = false;
mContainer.getDragLayer().removeView(this);
mRevealAnimator = null;
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuViewWithArrow.kt b/quickstep/src/com/android/quickstep/views/TaskMenuViewWithArrow.kt
index a138db0..19d706f 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuViewWithArrow.kt
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuViewWithArrow.kt
@@ -37,16 +37,16 @@
import com.android.launcher3.popup.SystemShortcut
import com.android.launcher3.util.Themes
import com.android.quickstep.TaskOverlayFactory
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer
class TaskMenuViewWithArrow<T> : ArrowPopup<T> where T : RecentsViewContainer, T : Context {
companion object {
const val TAG = "TaskMenuViewWithArrow"
- fun <T> showForTask(
- taskContainer: TaskIdAttributeContainer,
- alignedOptionIndex: Int = 0
- ): Boolean where T : RecentsViewContainer, T : Context {
+ fun showForTask(
+ taskContainer: TaskContainer,
+ alignedOptionIndex: Int = 0,
+ onClosedCallback: Runnable? = null
+ ): Boolean {
val container: RecentsViewContainer =
RecentsViewContainer.containerFromContext(taskContainer.taskView.context)
val taskMenuViewWithArrow =
@@ -54,14 +54,20 @@
R.layout.task_menu_with_arrow,
container.dragLayer,
false
- ) as TaskMenuViewWithArrow<T>
+ ) as TaskMenuViewWithArrow<*>
- return taskMenuViewWithArrow.populateAndShowForTask(taskContainer, alignedOptionIndex)
+ return taskMenuViewWithArrow.populateAndShowForTask(
+ taskContainer,
+ alignedOptionIndex,
+ onClosedCallback
+ )
}
}
constructor(context: Context) : super(context)
+
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
+
constructor(
context: Context,
attrs: AttributeSet,
@@ -83,22 +89,24 @@
private var alignedOptionIndex: Int = 0
private val extraSpaceForRowAlignment: Int
get() = optionMeasuredHeight * alignedOptionIndex
+
private val menuPaddingEnd = context.resources.getDimensionPixelSize(R.dimen.task_card_margin)
private lateinit var taskView: TaskView
private lateinit var optionLayout: LinearLayout
- private lateinit var taskContainer: TaskIdAttributeContainer
+ private lateinit var taskContainer: TaskContainer
private var optionMeasuredHeight = 0
private val arrowHorizontalPadding: Int
get() =
- if (taskView.isFocusedTask)
+ if (taskView.isLargeTile)
resources.getDimensionPixelSize(R.dimen.task_menu_horizontal_padding)
else 0
private var iconView: IconView? = null
private var scrim: View? = null
private val scrimAlpha = 0.8f
+ private var onClosedCallback: Runnable? = null
override fun isOfType(type: Int): Boolean = type and TYPE_TASK_MENU != 0
@@ -141,8 +149,9 @@
}
private fun populateAndShowForTask(
- taskContainer: TaskIdAttributeContainer,
- alignedOptionIndex: Int
+ taskContainer: TaskContainer,
+ alignedOptionIndex: Int,
+ onClosedCallback: Runnable?
): Boolean {
if (isAttachedToWindow) {
return false
@@ -151,6 +160,7 @@
taskView = taskContainer.taskView
this.taskContainer = taskContainer
this.alignedOptionIndex = alignedOptionIndex
+ this.onClosedCallback = onClosedCallback
if (!populateMenu()) return false
addScrim()
show()
@@ -253,6 +263,7 @@
super.closeComplete()
popupContainer.removeView(scrim)
popupContainer.removeView(iconView)
+ onClosedCallback?.run()
}
/**
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
index 9802beb..56ca043 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
@@ -28,16 +28,13 @@
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
-import android.graphics.Insets;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
-import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
-import android.os.Build;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.Property;
@@ -45,7 +42,6 @@
import android.widget.ImageView;
import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
import androidx.core.graphics.ColorUtils;
import com.android.launcher3.DeviceProfile;
@@ -53,6 +49,7 @@
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.SystemUiController.SystemUiControllerFlags;
+import com.android.launcher3.util.ViewPool;
import com.android.quickstep.TaskOverlayFactory.TaskOverlay;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.views.TaskView.FullscreenDrawParams;
@@ -60,13 +57,15 @@
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.recents.utilities.PreviewPositionHelper;
+import java.util.Objects;
+
/**
* A task in the Recents view.
*
* @deprecated This class will be replaced by the new [TaskThumbnailView].
*/
@Deprecated
-public class TaskThumbnailViewDeprecated extends View {
+public class TaskThumbnailViewDeprecated extends View implements ViewPool.Reusable {
private static final MainThreadInitializedObject<FullscreenDrawParams> TEMP_PARAMS =
new MainThreadInitializedObject<>(FullscreenDrawParams::new);
@@ -96,39 +95,8 @@
}
};
- /** Use to animate thumbnail translationX while first app in split selection is initiated */
- public static final Property<TaskThumbnailViewDeprecated, Float> SPLIT_SELECT_TRANSLATE_X =
- new FloatProperty<TaskThumbnailViewDeprecated>("splitSelectTranslateX") {
- @Override
- public void setValue(TaskThumbnailViewDeprecated thumbnail,
- float splitSelectTranslateX) {
- thumbnail.applySplitSelectTranslateX(splitSelectTranslateX);
- }
-
- @Override
- public Float get(TaskThumbnailViewDeprecated thumbnailView) {
- return thumbnailView.mSplitSelectTranslateX;
- }
- };
-
- /** Use to animate thumbnail translationY while first app in split selection is initiated */
- public static final Property<TaskThumbnailViewDeprecated, Float> SPLIT_SELECT_TRANSLATE_Y =
- new FloatProperty<TaskThumbnailViewDeprecated>("splitSelectTranslateY") {
- @Override
- public void setValue(TaskThumbnailViewDeprecated thumbnail,
- float splitSelectTranslateY) {
- thumbnail.applySplitSelectTranslateY(splitSelectTranslateY);
- }
-
- @Override
- public Float get(TaskThumbnailViewDeprecated thumbnailView) {
- return thumbnailView.mSplitSelectTranslateY;
- }
- };
-
private final RecentsViewContainer mContainer;
- @Nullable
- private TaskOverlay mOverlay;
+ private TaskOverlay<?> mOverlay;
private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private final Paint mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private final Paint mSplashBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@@ -158,8 +126,6 @@
private boolean mOverlayEnabled;
/** Used as a placeholder when the original thumbnail animates out to. */
private boolean mShowSplashForSplitSelection;
- private float mSplitSelectTranslateX;
- private float mSplitSelectTranslateY;
public TaskThumbnailViewDeprecated(Context context) {
this(context, null);
@@ -187,8 +153,9 @@
/**
* Updates the thumbnail to draw the provided task
*/
- public void bind(Task task) {
- getTaskOverlay().reset();
+ public void bind(Task task, TaskOverlay<?> overlay) {
+ mOverlay = overlay;
+ mOverlay.reset();
mTask = task;
int color = task == null ? Color.BLACK : task.colorBackground | 0xFF000000;
mPaint.setColor(color);
@@ -210,14 +177,16 @@
public void setThumbnail(@Nullable Task task, @Nullable ThumbnailData thumbnailData,
boolean refreshNow) {
mTask = task;
- boolean thumbnailWasNull = mThumbnailData == null;
- mThumbnailData =
- (thumbnailData != null && thumbnailData.thumbnail != null) ? thumbnailData : null;
+ ThumbnailData oldThumbnailData = mThumbnailData;
+ mThumbnailData = (thumbnailData != null && thumbnailData.getThumbnail() != null)
+ ? thumbnailData : null;
if (mTask != null) {
updateSplashView(mTask.icon);
}
if (refreshNow) {
- refresh(thumbnailWasNull && mThumbnailData != null);
+ Long oldSnapshotId = oldThumbnailData != null ? oldThumbnailData.getSnapshotId() : null;
+ Long snapshotId = mThumbnailData != null ? mThumbnailData.getSnapshotId() : null;
+ refresh(snapshotId != null && !Objects.equals(oldSnapshotId, snapshotId));
}
}
@@ -237,8 +206,8 @@
* @param shouldRefreshOverlay whether to re-initialize overlay
*/
private void refresh(boolean shouldRefreshOverlay) {
- if (mThumbnailData != null && mThumbnailData.thumbnail != null) {
- Bitmap bm = mThumbnailData.thumbnail;
+ if (mThumbnailData != null && mThumbnailData.getThumbnail() != null) {
+ Bitmap bm = mThumbnailData.getThumbnail();
bm.prepareToDraw();
mBitmapShader = new BitmapShader(bm, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mPaint.setShader(mBitmapShader);
@@ -250,7 +219,7 @@
mBitmapShader = null;
mThumbnailData = null;
mPaint.setShader(null);
- getTaskOverlay().reset();
+ mOverlay.reset();
}
updateThumbnailPaintFilter();
}
@@ -278,49 +247,10 @@
invalidate();
}
- public TaskOverlay getTaskOverlay() {
- if (mOverlay == null) {
- mOverlay = getTaskView().getRecentsView().getTaskOverlayFactory().createOverlay(this);
- }
- return mOverlay;
- }
-
public float getDimAlpha() {
return mDimAlpha;
}
- /**
- * Get the scaled insets that are being used to draw the task view. This is a subsection of
- * the full snapshot.
- *
- * @return the insets in snapshot bitmap coordinates.
- */
- @RequiresApi(api = Build.VERSION_CODES.Q)
- public Insets getScaledInsets() {
- if (mThumbnailData == null) {
- return Insets.NONE;
- }
-
- RectF bitmapRect = new RectF(
- 0, 0,
- mThumbnailData.thumbnail.getWidth(), mThumbnailData.thumbnail.getHeight());
- RectF viewRect = new RectF(0, 0, getMeasuredWidth(), getMeasuredHeight());
-
- // The position helper matrix tells us how to transform the bitmap to fit the view, the
- // inverse tells us where the view would be in the bitmaps coordinates. The insets are the
- // difference between the bitmap bounds and the projected view bounds.
- Matrix boundsToBitmapSpace = new Matrix();
- mPreviewPositionHelper.getMatrix().invert(boundsToBitmapSpace);
- RectF boundsInBitmapSpace = new RectF();
- boundsToBitmapSpace.mapRect(boundsInBitmapSpace, viewRect);
-
- DeviceProfile dp = mContainer.getDeviceProfile();
- int bottomInset = dp.isTablet
- ? Math.round(bitmapRect.bottom - boundsInBitmapSpace.bottom) : 0;
- return Insets.of(0, 0, 0, bottomInset);
- }
-
-
@SystemUiControllerFlags
public int getSysUiStatusNavFlags() {
if (mThumbnailData != null) {
@@ -347,7 +277,7 @@
canvas.save();
// Draw the insets if we're being drawn fullscreen (we do this for quick switch).
drawOnCanvas(canvas, 0, 0, getMeasuredWidth(), getMeasuredHeight(),
- mFullscreenParams.mCurrentDrawnCornerRadius);
+ mFullscreenParams.getCurrentDrawnCornerRadius());
canvas.restore();
}
@@ -357,13 +287,13 @@
public void setFullscreenParams(TaskView.FullscreenDrawParams fullscreenParams) {
mFullscreenParams = fullscreenParams;
- getTaskOverlay().setFullscreenParams(fullscreenParams);
invalidate();
}
public void drawOnCanvas(Canvas canvas, float x, float y, float width, float height,
float cornerRadius) {
- if (mTask != null && getTaskView().isRunningTask() && !getTaskView().showScreenshot()) {
+ if (mTask != null && getTaskView().isRunningTask()
+ && !getTaskView().getShouldShowScreenshot()) {
canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mClearPaint);
canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius,
mDimmingPaintAfterClearing);
@@ -404,31 +334,6 @@
}
}
- /** See {@link #SPLIT_SELECT_TRANSLATE_X} */
- protected void applySplitSelectTranslateX(float splitSelectTranslateX) {
- mSplitSelectTranslateX = splitSelectTranslateX;
- applyTranslateX();
- }
-
- /** See {@link #SPLIT_SELECT_TRANSLATE_Y} */
- protected void applySplitSelectTranslateY(float splitSelectTranslateY) {
- mSplitSelectTranslateY = splitSelectTranslateY;
- applyTranslateY();
- }
-
- private void applyTranslateX() {
- setTranslationX(mSplitSelectTranslateX);
- }
-
- private void applyTranslateY() {
- setTranslationY(mSplitSelectTranslateY);
- }
-
- protected void resetViewTransforms() {
- mSplitSelectTranslateX = 0;
- mSplitSelectTranslateY = 0;
- }
-
public TaskView getTaskView() {
return (TaskView) getParent();
}
@@ -501,13 +406,13 @@
}
private boolean isThumbnailAspectRatioDifferentFromThumbnailData() {
- if (mThumbnailData == null || mThumbnailData.thumbnail == null) {
+ if (mThumbnailData == null || mThumbnailData.getThumbnail() == null) {
return false;
}
float thumbnailViewAspect = getWidth() / (float) getHeight();
- float thumbnailDataAspect =
- mThumbnailData.thumbnail.getWidth() / (float) mThumbnailData.thumbnail.getHeight();
+ float thumbnailDataAspect = mThumbnailData.getThumbnail().getWidth()
+ / (float) mThumbnailData.getThumbnail().getHeight();
return isRelativePercentDifferenceGreaterThan(thumbnailViewAspect,
thumbnailDataAspect, MAX_PCT_BEFORE_ASPECT_RATIOS_CONSIDERED_DIFFERENT);
@@ -533,10 +438,12 @@
*/
private void refreshOverlay() {
if (mOverlayEnabled) {
- getTaskOverlay().initOverlay(mTask, mThumbnailData, mPreviewPositionHelper.getMatrix(),
+ mOverlay.initOverlay(mTask,
+ mThumbnailData != null ? mThumbnailData.getThumbnail() : null,
+ mPreviewPositionHelper.getMatrix(),
mPreviewPositionHelper.isOrientationChanged());
} else {
- getTaskOverlay().reset();
+ mOverlay.reset();
}
}
@@ -558,10 +465,9 @@
DeviceProfile dp = mContainer.getDeviceProfile();
mPreviewPositionHelper.setOrientationChanged(false);
if (mBitmapShader != null && mThumbnailData != null) {
- mPreviewRect.set(0, 0, mThumbnailData.thumbnail.getWidth(),
- mThumbnailData.thumbnail.getHeight());
- int currentRotation = getTaskView().getRecentsView().getPagedViewOrientedState()
- .getRecentsActivityRotation();
+ mPreviewRect.set(0, 0, mThumbnailData.getThumbnail().getWidth(),
+ mThumbnailData.getThumbnail().getHeight());
+ int currentRotation = getTaskView().getOrientedState().getRecentsActivityRotation();
boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData,
getMeasuredWidth(), getMeasuredHeight(), dp.isTablet, currentRotation, isRtl);
@@ -593,7 +499,7 @@
if (mThumbnailData == null) {
return null;
}
- return mThumbnailData.thumbnail;
+ return mThumbnailData.getThumbnail();
}
/**
@@ -606,4 +512,13 @@
}
return mThumbnailData.isRealSnapshot && !mTask.isLocked;
}
+
+ public Matrix getThumbnailMatrix() {
+ return mPreviewPositionHelper.getMatrix();
+ }
+
+ @Override
+ public void onRecycle() {
+ // Do nothing
+ }
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
deleted file mode 100644
index 1e2a259..0000000
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ /dev/null
@@ -1,2019 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.views;
-
-import static android.view.Display.DEFAULT_DISPLAY;
-import static android.widget.Toast.LENGTH_SHORT;
-
-import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN;
-import static com.android.app.animation.Interpolators.LINEAR;
-import static com.android.launcher3.Flags.enableCursorHoverStates;
-import static com.android.launcher3.Flags.enableGridOnlyOverview;
-import static com.android.launcher3.Flags.enableOverviewIconMenu;
-import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
-import static com.android.launcher3.LauncherState.BACKGROUND_APP;
-import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP;
-import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE;
-import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
-import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
-import static com.android.quickstep.TaskOverlayFactory.getEnabledShortcuts;
-import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.EXPECTING_TASK_APPEARED;
-import static com.android.quickstep.util.BorderAnimator.DEFAULT_BORDER_COLOR;
-
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-import android.annotation.IdRes;
-import android.app.ActivityOptions;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.PointF;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.util.AttributeSet;
-import android.util.FloatProperty;
-import android.util.Log;
-import android.view.Display;
-import android.view.MotionEvent;
-import android.view.RemoteAnimationTarget;
-import android.view.TouchDelegate;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewStub;
-import android.view.accessibility.AccessibilityNodeInfo;
-import android.widget.FrameLayout;
-import android.widget.Toast;
-
-import androidx.annotation.IntDef;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.VisibleForTesting;
-
-import com.android.app.animation.Interpolators;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.Flags;
-import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.pm.UserCache;
-import com.android.launcher3.popup.SystemShortcut;
-import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.shared.TestProtocol;
-import com.android.launcher3.util.ActivityOptionsWrapper;
-import com.android.launcher3.util.CancellableTask;
-import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.RunnableList;
-import com.android.launcher3.util.SafeCloseable;
-import com.android.launcher3.util.SplitConfigurationOptions;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
-import com.android.launcher3.util.TraceHelper;
-import com.android.launcher3.util.TransformingTouchDelegate;
-import com.android.launcher3.util.ViewPool.Reusable;
-import com.android.quickstep.RecentsModel;
-import com.android.quickstep.RemoteAnimationTargets;
-import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
-import com.android.quickstep.TaskAnimationManager;
-import com.android.quickstep.TaskIconCache;
-import com.android.quickstep.TaskThumbnailCache;
-import com.android.quickstep.TaskUtils;
-import com.android.quickstep.TaskViewUtils;
-import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
-import com.android.quickstep.task.thumbnail.TaskThumbnail;
-import com.android.quickstep.task.thumbnail.TaskThumbnailView;
-import com.android.quickstep.util.ActiveGestureLog;
-import com.android.quickstep.util.BorderAnimator;
-import com.android.quickstep.util.RecentsOrientedState;
-import com.android.quickstep.util.SplitSelectStateController;
-import com.android.quickstep.util.TaskCornerRadius;
-import com.android.quickstep.util.TaskRemovedDuringLaunchListener;
-import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.ActivityManagerWrapper;
-import com.android.systemui.shared.system.QuickStepContract;
-
-import kotlin.Unit;
-
-import java.lang.annotation.Retention;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.Consumer;
-import java.util.stream.Stream;
-
-
-/**
- * A task in the Recents view.
- */
-public class TaskView extends FrameLayout implements Reusable {
-
- private static final String TAG = TaskView.class.getSimpleName();
- public static final int FLAG_UPDATE_ICON = 1;
- public static final int FLAG_UPDATE_THUMBNAIL = FLAG_UPDATE_ICON << 1;
- public static final int FLAG_UPDATE_CORNER_RADIUS = FLAG_UPDATE_THUMBNAIL << 1;
-
- public static final int FLAG_UPDATE_ALL = FLAG_UPDATE_ICON | FLAG_UPDATE_THUMBNAIL
- | FLAG_UPDATE_CORNER_RADIUS;
-
- /**
- * Used in conjunction with {@link #onTaskListVisibilityChanged(boolean, int)}, providing more
- * granularity on which components of this task require an update
- */
- @Retention(SOURCE)
- @IntDef({FLAG_UPDATE_ALL, FLAG_UPDATE_ICON, FLAG_UPDATE_THUMBNAIL, FLAG_UPDATE_CORNER_RADIUS})
- public @interface TaskDataChanges {
- }
-
- /**
- * Type of task view
- */
- @Retention(SOURCE)
- @IntDef({Type.SINGLE, Type.GROUPED, Type.DESKTOP})
- public @interface Type {
- int SINGLE = 1;
- int GROUPED = 2;
- int DESKTOP = 3;
- }
-
- /** The maximum amount that a task view can be scrimmed, dimmed or tinted. */
- public static final float MAX_PAGE_SCRIM_ALPHA = 0.4f;
-
- private static final float EDGE_SCALE_DOWN_FACTOR_CAROUSEL = 0.03f;
- private static final float EDGE_SCALE_DOWN_FACTOR_GRID = 0.00f;
-
- public static final long SCALE_ICON_DURATION = 120;
- private static final long DIM_ANIM_DURATION = 700;
-
- /**
- * This technically can be a vanilla {@link TouchDelegate} class, however that class requires
- * setting the touch bounds at construction, so we'd repeatedly be created many instances
- * unnecessarily as scrolling occurs, whereas {@link TransformingTouchDelegate} allows touch
- * delegated bounds only to be updated.
- */
- private TransformingTouchDelegate mIconTouchDelegate;
-
- private static final List<Rect> SYSTEM_GESTURE_EXCLUSION_RECT =
- Collections.singletonList(new Rect());
-
- public static final FloatProperty<TaskView> FOCUS_TRANSITION =
- new FloatProperty<>("focusTransition") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setIconsAndBannersTransitionProgress(v, false /* invert */);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mFocusTransitionProgress;
- }
- };
-
- private static final FloatProperty<TaskView> SPLIT_SELECT_TRANSLATION_X =
- new FloatProperty<>("splitSelectTranslationX") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setSplitSelectTranslationX(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mSplitSelectTranslationX;
- }
- };
-
- private static final FloatProperty<TaskView> SPLIT_SELECT_TRANSLATION_Y =
- new FloatProperty<>("splitSelectTranslationY") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setSplitSelectTranslationY(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mSplitSelectTranslationY;
- }
- };
-
- private static final FloatProperty<TaskView> DISMISS_TRANSLATION_X =
- new FloatProperty<>("dismissTranslationX") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setDismissTranslationX(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mDismissTranslationX;
- }
- };
-
- private static final FloatProperty<TaskView> DISMISS_TRANSLATION_Y =
- new FloatProperty<>("dismissTranslationY") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setDismissTranslationY(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mDismissTranslationY;
- }
- };
-
- private static final FloatProperty<TaskView> TASK_OFFSET_TRANSLATION_X =
- new FloatProperty<>("taskOffsetTranslationX") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setTaskOffsetTranslationX(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mTaskOffsetTranslationX;
- }
- };
-
- private static final FloatProperty<TaskView> TASK_OFFSET_TRANSLATION_Y =
- new FloatProperty<>("taskOffsetTranslationY") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setTaskOffsetTranslationY(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mTaskOffsetTranslationY;
- }
- };
-
- private static final FloatProperty<TaskView> TASK_RESISTANCE_TRANSLATION_X =
- new FloatProperty<>("taskResistanceTranslationX") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setTaskResistanceTranslationX(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mTaskResistanceTranslationX;
- }
- };
-
- private static final FloatProperty<TaskView> TASK_RESISTANCE_TRANSLATION_Y =
- new FloatProperty<>("taskResistanceTranslationY") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setTaskResistanceTranslationY(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mTaskResistanceTranslationY;
- }
- };
-
- public static final FloatProperty<TaskView> GRID_END_TRANSLATION_X =
- new FloatProperty<>("gridEndTranslationX") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setGridEndTranslationX(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mGridEndTranslationX;
- }
- };
-
- public static final FloatProperty<TaskView> SNAPSHOT_SCALE =
- new FloatProperty<>("snapshotScale") {
- @Override
- public void setValue(TaskView taskView, float v) {
- taskView.setSnapshotScale(v);
- }
-
- @Override
- public Float get(TaskView taskView) {
- return taskView.mTaskThumbnailViewDeprecated.getScaleX();
- }
- };
-
- @Nullable
- protected Task mTask;
- @Nullable // can be null when enableRefactorTaskThumbnail() == true
- protected TaskThumbnailViewDeprecated mTaskThumbnailViewDeprecated;
- protected TaskThumbnailView mTaskThumbnailView;
- protected TaskViewIcon mIconView;
- protected final DigitalWellBeingToast mDigitalWellBeingToast;
- protected float mFullscreenProgress;
- private float mGridProgress;
- protected float mTaskThumbnailSplashAlpha;
- private float mNonGridScale = 1;
- private float mDismissScale = 1;
- protected final FullscreenDrawParams mCurrentFullscreenParams;
- protected final RecentsViewContainer mContainer;
-
- // Various causes of changing primary translation, which we aggregate to setTranslationX/Y().
- private float mDismissTranslationX;
- private float mDismissTranslationY;
- private float mTaskOffsetTranslationX;
- private float mTaskOffsetTranslationY;
- private float mTaskResistanceTranslationX;
- private float mTaskResistanceTranslationY;
- // The following translation variables should only be used in the same orientation as Launcher.
- private float mBoxTranslationY;
- // The following grid translations scales with mGridProgress.
- private float mGridTranslationX;
- private float mGridTranslationY;
- // The following grid translation is used to animate closing the gap between grid and clear all.
- private float mGridEndTranslationX;
- // Applied as a complement to gridTranslation, for adjusting the carousel overview and quick
- // switch.
- private float mNonGridTranslationX;
- private float mNonGridPivotTranslationX;
- // Used when in SplitScreenSelectState
- private float mSplitSelectTranslationY;
- private float mSplitSelectTranslationX;
-
- @Nullable
- private ObjectAnimator mIconAndDimAnimator;
- private float mIconScaleAnimStartProgress = 0;
- private float mFocusTransitionProgress = 1;
- private float mModalness = 0;
- private float mStableAlpha = 1;
-
- private int mTaskViewId = -1;
- protected int[] mTaskIdContainer = new int[0];
- protected TaskIdAttributeContainer[] mTaskIdAttributeContainer =
- new TaskIdAttributeContainer[0];
-
- private boolean mShowScreenshot;
- private boolean mBorderEnabled;
-
- // The current background requests to load the task thumbnail and icon
- @Nullable
- private CancellableTask mThumbnailLoadRequest;
- @Nullable
- private CancellableTask mIconLoadRequest;
-
- private boolean mEndQuickswitchCuj;
-
- private final float[] mIconCenterCoords = new float[2];
-
- protected final PointF mLastTouchDownPosition = new PointF();
-
- private boolean mIsClickableAsLiveTile = true;
-
- @Nullable
- private final BorderAnimator mFocusBorderAnimator;
-
- @Nullable
- private final BorderAnimator mHoverBorderAnimator;
-
- public TaskView(Context context) {
- this(context, null);
- }
-
- public TaskView(Context context, @Nullable AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public TaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, 0);
- }
-
- public TaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
- int defStyleRes) {
- this(context, attrs, defStyleAttr, defStyleRes, null, null);
- }
-
- @VisibleForTesting
- public TaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
- int defStyleRes, BorderAnimator focusBorderAnimator,
- BorderAnimator hoverBorderAnimator) {
- super(context, attrs, defStyleAttr, defStyleRes);
- mContainer = RecentsViewContainer.containerFromContext(context);
- setOnClickListener(this::onClick);
-
- mCurrentFullscreenParams = new FullscreenDrawParams(context);
- mDigitalWellBeingToast = new DigitalWellBeingToast(mContainer, this);
-
- boolean keyboardFocusHighlightEnabled = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get()
- || Flags.enableFocusOutline();
- boolean cursorHoverStatesEnabled = enableCursorHoverStates();
-
- setWillNotDraw(!keyboardFocusHighlightEnabled && !cursorHoverStatesEnabled);
-
- TypedArray styledAttrs = context.obtainStyledAttributes(
- attrs, R.styleable.TaskView, defStyleAttr, defStyleRes);
-
- if (focusBorderAnimator != null) {
- mFocusBorderAnimator = focusBorderAnimator;
- } else {
- mFocusBorderAnimator = keyboardFocusHighlightEnabled
- ? BorderAnimator.createSimpleBorderAnimator(
- /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius,
- /* borderWidthPx= */ context.getResources().getDimensionPixelSize(
- R.dimen.keyboard_quick_switch_border_width),
- /* boundsBuilder= */ this::updateBorderBounds,
- /* targetView= */ this,
- /* borderColor= */ styledAttrs.getColor(
- R.styleable.TaskView_focusBorderColor, DEFAULT_BORDER_COLOR))
- : null;
- }
-
- if (hoverBorderAnimator != null) {
- mHoverBorderAnimator = hoverBorderAnimator;
- } else {
- mHoverBorderAnimator = cursorHoverStatesEnabled
- ? BorderAnimator.createSimpleBorderAnimator(
- /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius,
- /* borderWidthPx= */ context.getResources().getDimensionPixelSize(
- R.dimen.task_hover_border_width),
- /* boundsBuilder= */ this::updateBorderBounds,
- /* targetView= */ this,
- /* borderColor= */ styledAttrs.getColor(
- R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR))
- : null;
- }
- styledAttrs.recycle();
- }
-
- protected Unit updateBorderBounds(@NonNull Rect bounds) {
- View snapshotView = getSnapshotView();
- bounds.set(snapshotView.getLeft() + Math.round(snapshotView.getTranslationX()),
- snapshotView.getTop() + Math.round(snapshotView.getTranslationY()),
- snapshotView.getRight() + Math.round(snapshotView.getTranslationX()),
- snapshotView.getBottom() + Math.round(snapshotView.getTranslationY()));
- return Unit.INSTANCE;
- }
-
- public void setTaskViewId(int id) {
- this.mTaskViewId = id;
- }
-
- public int getTaskViewId() {
- return mTaskViewId;
- }
-
- /**
- * Updates [TaskThumbnailView] to reflect the latest [Task] state (i.e., task isRunning).
- */
- public void notifyIsRunningTaskUpdated() {
- // TODO(b/335649589): TaskView's VM will already have access to TaskThumbnailView's VM
- // so there will be no need to access TaskThumbnailView's VM through the TaskThumbnailView
- if (mTask != null) {
- bindTaskThumbnailView();
- }
- }
-
- /**
- * Builds proto for logging
- */
- public WorkspaceItemInfo getItemInfo() {
- return getItemInfo(mTask);
- }
-
- /**
- * Builds proto for logging
- */
- @VisibleForTesting
- public WorkspaceItemInfo getItemInfo(@Nullable Task task) {
- WorkspaceItemInfo stubInfo = new WorkspaceItemInfo();
- stubInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_TASK;
- stubInfo.container = LauncherSettings.Favorites.CONTAINER_TASKSWITCHER;
- if (task == null) {
- return stubInfo;
- }
-
- ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
- stubInfo.user = componentKey.user;
- stubInfo.intent = new Intent().setComponent(componentKey.componentName);
- stubInfo.title = task.title;
- if (getRecentsView() != null) {
- stubInfo.screenId = getRecentsView().indexOfChild(this);
- }
- if (Flags.privateSpaceRestrictAccessibilityDrag()) {
- if (UserCache.getInstance(getContext()).getUserInfo(componentKey.user).isPrivate()) {
- stubInfo.runtimeStatusFlags |= FLAG_NOT_PINNABLE;
- }
- }
- return stubInfo;
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mTaskThumbnailViewDeprecated = findViewById(R.id.snapshot);
- if (enableRefactorTaskThumbnail()) {
- mTaskThumbnailView = new TaskThumbnailView(mContext);
- mTaskThumbnailView.setLayoutParams(mTaskThumbnailViewDeprecated.getLayoutParams());
- int indexOfSnapshotView = indexOfChild(mTaskThumbnailViewDeprecated);
- addView(mTaskThumbnailView, indexOfSnapshotView);
- mTaskThumbnailViewDeprecated.setVisibility(View.GONE);
- }
- ViewStub iconViewStub = findViewById(R.id.icon);
- if (enableOverviewIconMenu()) {
- iconViewStub.setLayoutResource(R.layout.icon_app_chip_view);
- } else {
- iconViewStub.setLayoutResource(R.layout.icon_view);
- }
- mIconView = (TaskViewIcon) iconViewStub.inflate();
- mIconTouchDelegate = new TransformingTouchDelegate(mIconView.asView());
- }
-
- @Override
- @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
- public void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
- super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
- if (mFocusBorderAnimator != null && mBorderEnabled) {
- mFocusBorderAnimator.setBorderVisibility(gainFocus, /* animated= */ true);
- }
- }
-
- @Override
- public boolean onHoverEvent(MotionEvent event) {
- if (mHoverBorderAnimator != null && mBorderEnabled) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_HOVER_ENTER:
- mHoverBorderAnimator.setBorderVisibility(/* visible= */ true, /* animated= */
- true);
- break;
- case MotionEvent.ACTION_HOVER_EXIT:
- mHoverBorderAnimator.setBorderVisibility(/* visible= */ false, /* animated= */
- true);
- break;
- default:
- break;
- }
- }
- return super.onHoverEvent(event);
- }
-
- /**
- * Enable or disable showing border on hover and focus change
- */
- public void setBorderEnabled(boolean enabled) {
- if (mBorderEnabled == enabled) {
- return;
- }
-
- mBorderEnabled = enabled;
- // Set the animation correctly in case it misses the hover/focus event during state
- // transition
- if (mHoverBorderAnimator != null) {
- mHoverBorderAnimator.setBorderVisibility(/* visible= */
- enabled && isHovered(), /* animated= */ true);
- }
-
- if (mFocusBorderAnimator != null) {
- mFocusBorderAnimator.setBorderVisibility(/* visible= */
- enabled && isFocused(), /* animated= */true);
- }
- }
-
- @Override
- public boolean onInterceptHoverEvent(MotionEvent event) {
- if (enableCursorHoverStates()) {
- // avoid triggering hover event on child elements which would cause HOVER_EXIT for this
- // task view
- return true;
- } else {
- return super.onInterceptHoverEvent(event);
- }
- }
-
- @Override
- public void draw(Canvas canvas) {
- // Draw border first so any child views outside of the thumbnail bounds are drawn above it.
- if (mFocusBorderAnimator != null) {
- mFocusBorderAnimator.drawBorder(canvas);
- }
- if (mHoverBorderAnimator != null) {
- mHoverBorderAnimator.drawBorder(canvas);
- }
- super.draw(canvas);
- }
-
- /**
- * Whether the taskview should take the touch event from parent. Events passed to children
- * that might require special handling.
- */
- public boolean offerTouchToChildren(MotionEvent event) {
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
- computeAndSetIconTouchDelegate(mIconView, mIconCenterCoords, mIconTouchDelegate);
- }
- return mIconTouchDelegate != null && mIconTouchDelegate.onTouchEvent(event);
- }
-
- protected void computeAndSetIconTouchDelegate(TaskViewIcon view, float[] tempCenterCoords,
- TransformingTouchDelegate transformingTouchDelegate) {
- if (view == null) {
- return;
- }
- float viewHalfWidth = view.getWidth() / 2f;
- float viewHalfHeight = view.getHeight() / 2f;
- tempCenterCoords[0] = viewHalfWidth;
- tempCenterCoords[1] = viewHalfHeight;
- getDescendantCoordRelativeToAncestor(view.asView(), mContainer.getDragLayer(),
- tempCenterCoords, false);
- transformingTouchDelegate.setBounds(
- (int) (tempCenterCoords[0] - viewHalfWidth),
- (int) (tempCenterCoords[1] - viewHalfHeight),
- (int) (tempCenterCoords[0] + viewHalfWidth),
- (int) (tempCenterCoords[1] + viewHalfHeight));
- }
-
- /**
- * The modalness of this view is how it should be displayed when it is shown on its own in the
- * modal state of overview.
- *
- * @param modalness [0, 1] 0 being in context with other tasks, 1 being shown on its own.
- */
- public void setModalness(float modalness) {
- if (mModalness == modalness) {
- return;
- }
- mModalness = modalness;
- mIconView.setModalAlpha(1 - modalness);
- mDigitalWellBeingToast.updateBannerOffset(modalness);
- }
-
- public DigitalWellBeingToast getDigitalWellBeingToast() {
- return mDigitalWellBeingToast;
- }
-
- /**
- * Updates this task view to the given {@param task}.
- */
- public void bind(Task task, RecentsOrientedState orientedState) {
- cancelPendingLoadTasks();
- mTask = task;
- mTaskIdContainer = new int[]{mTask.key.id};
- mTaskIdAttributeContainer = new TaskIdAttributeContainer[]{
- new TaskIdAttributeContainer(task, mTaskThumbnailViewDeprecated, mIconView,
- STAGE_POSITION_UNDEFINED)};
- if (enableRefactorTaskThumbnail()) {
- bindTaskThumbnailView();
- } else {
- mTaskThumbnailViewDeprecated.bind(task);
- }
- setOrientationState(orientedState);
- }
-
- private void bindTaskThumbnailView() {
- // TODO(b/335649589): TaskView's VM will already have access to TaskThumbnailView's VM
- // so there will be no need to access TaskThumbnailView's VM through the TaskThumbnailView
- mTaskThumbnailView.getViewModel().bind(new TaskThumbnail(mTask, isRunningTask()));
- }
-
- /**
- * Sets up an on-click listener and the visibility for show_windows icon on top of the task.
- */
- public void setUpShowAllInstancesListener() {
- if (mTaskIdAttributeContainer.length == 0) {
- return;
- }
- String taskPackageName = mTaskIdAttributeContainer[0].mTask.key.getPackageName();
-
- // icon of the top/left task
- View showWindowsView = findViewById(R.id.show_windows);
- updateFilterCallback(showWindowsView, getFilterUpdateCallback(taskPackageName));
- }
-
- /**
- * Returns a callback that updates the state of the filter and the recents overview
- *
- * @param taskPackageName package name of the task to filter by
- */
- @Nullable
- protected View.OnClickListener getFilterUpdateCallback(String taskPackageName) {
- View.OnClickListener cb = (view) -> {
- // update and apply a new filter
- getRecentsView().setAndApplyFilter(taskPackageName);
- };
-
- if (!getRecentsView().getFilterState().shouldShowFilterUI(taskPackageName)) {
- cb = null;
- }
- return cb;
- }
-
- /**
- * Sets the correct visibility and callback on the provided filterView based on whether
- * the callback is null or not
- */
- protected void updateFilterCallback(@NonNull View filterView,
- @Nullable View.OnClickListener callback) {
- // Filtering changes alpha instead of the visibility since visibility
- // can be altered separately through RecentsView#resetFromSplitSelectionState()
- if (callback == null) {
- filterView.setAlpha(0);
- } else {
- filterView.setAlpha(1);
- }
-
- filterView.setOnClickListener(callback);
- }
-
- public TaskIdAttributeContainer[] getTaskIdAttributeContainers() {
- return mTaskIdAttributeContainer;
- }
-
- @Nullable
- public Task getTask() {
- return mTask;
- }
-
- /**
- * Check if given {@code taskId} is tracked in this view
- */
- public boolean containsTaskId(int taskId) {
- return Arrays.stream(mTaskIdContainer).anyMatch(myTaskId -> myTaskId == taskId);
- }
-
- /**
- * Returns a copy of integer array containing taskIds of all tasks in the TaskView.
- */
- public int[] getTaskIds() {
- return Arrays.copyOf(mTaskIdContainer, mTaskIdContainer.length);
- }
-
- public boolean containsMultipleTasks() {
- return mTaskIdContainer.length > 1;
- }
-
- /**
- * Returns the TaskIdAttributeContainer corresponding to a given taskId, or null if the TaskView
- * does not contain a Task with that ID.
- */
- @Nullable
- public TaskIdAttributeContainer getTaskAttributesById(int taskId) {
- for (TaskIdAttributeContainer attributes : mTaskIdAttributeContainer) {
- if (attributes.getTask().key.id == taskId) {
- return attributes;
- }
- }
-
- return null;
- }
-
- public TaskThumbnailViewDeprecated getThumbnail() {
- return mTaskThumbnailViewDeprecated;
- }
-
- void refreshThumbnails(@Nullable HashMap<Integer, ThumbnailData> thumbnailDatas) {
- if (enableRefactorTaskThumbnail()) {
- // TODO(b/334825222) add thumbnail logic
- return;
- }
- if (mTask != null && thumbnailDatas != null) {
- final ThumbnailData thumbnailData = thumbnailDatas.get(mTask.key.id);
- if (thumbnailData != null) {
- mTaskThumbnailViewDeprecated.setThumbnail(mTask, thumbnailData);
- return;
- }
- }
-
- mTaskThumbnailViewDeprecated.refresh();
- }
-
- /** TODO(b/197033698) Remove all usages of above method and migrate to this one */
- public TaskThumbnailViewDeprecated[] getThumbnails() {
- return new TaskThumbnailViewDeprecated[]{mTaskThumbnailViewDeprecated};
- }
-
- public TaskViewIcon getIconView() {
- return mIconView;
- }
-
- @Override
- public boolean dispatchTouchEvent(MotionEvent ev) {
- RecentsView recentsView = getRecentsView();
- if (recentsView == null || getTask() == null) {
- return false;
- }
- SplitSelectStateController splitSelectStateController =
- recentsView.getSplitSelectController();
- // Disable taps for split selection animation unless we have multiple tasks
- boolean disableTapsForSplitSelect =
- splitSelectStateController.isSplitSelectActive()
- && splitSelectStateController.getInitialTaskId() == getTask().key.id
- && !containsMultipleTasks();
- if (disableTapsForSplitSelect) {
- return false;
- }
-
- if (ev.getAction() == MotionEvent.ACTION_DOWN) {
- mLastTouchDownPosition.set(ev.getX(), ev.getY());
- }
- return super.dispatchTouchEvent(ev);
- }
-
- private void onClick(View view) {
- if (getTask() == null) {
- Log.d("b/310064698", "onClick - task is null");
- return;
- }
- if (confirmSecondSplitSelectApp()) {
- Log.d("b/310064698", mTask + " - onClick - split select is active");
- return;
- }
- RunnableList callbackList = launchTasks();
- Log.d("b/310064698", mTask + " - onClick - callbackList: " + callbackList);
- if (callbackList != null) {
- callbackList.add(() -> Log.d("b/310064698", Arrays.toString(
- getTaskIds()) + " - onClick - launchCompleted"));
- }
- mContainer.getStatsLogManager().logger().withItemInfo(getItemInfo())
- .log(LAUNCHER_TASK_LAUNCH_TAP);
- }
-
- /**
- * @return {@code true} if user is already in split select mode and this tap was to choose the
- * second app. {@code false} otherwise
- */
- protected boolean confirmSecondSplitSelectApp() {
- int index = getLastSelectedChildTaskIndex();
- if (index >= mTaskIdAttributeContainer.length) {
- return false;
- }
- TaskIdAttributeContainer container = mTaskIdAttributeContainer[index];
- if (container != null) {
- return getRecentsView().confirmSplitSelect(this, container.getTask(),
- container.getIconView().getDrawable(), container.getThumbnailView(),
- container.getThumbnailView().getThumbnail(), /* intent */ null,
- /* user */ null, container.getItemInfo());
- }
- return false;
- }
-
- /**
- * Returns the task index of the last selected child task (0 or 1).
- * If we contain multiple tasks and this TaskView is used as part of split selection, the
- * selected child task index will be that of the remaining task.
- */
- protected int getLastSelectedChildTaskIndex() {
- return 0;
- }
-
- /**
- * Starts the task associated with this view and animates the startup.
- *
- * @return CompletionStage to indicate the animation completion or null if the launch failed.
- */
- @Nullable
- public RunnableList launchTaskAnimated() {
- if (mTask != null) {
- TestLogging.recordEvent(
- TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask);
- ActivityOptionsWrapper opts = mContainer.getActivityLaunchOptions(this, null);
- opts.options.setLaunchDisplayId(
- getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId());
- if (ActivityManagerWrapper.getInstance()
- .startActivityFromRecents(mTask.key, opts.options)) {
- Log.d(TAG, "launchTaskAnimated - startActivityFromRecents: " + Arrays.toString(
- getTaskIds()));
- ActiveGestureLog.INSTANCE.trackEvent(EXPECTING_TASK_APPEARED);
- RecentsView recentsView = getRecentsView();
- if (recentsView.getRunningTaskViewId() != -1) {
- recentsView.onTaskLaunchedInLiveTileMode();
-
- // Return a fresh callback in the live tile case, so that it's not accidentally
- // triggered by QuickstepTransitionManager.AppLaunchAnimationRunner.
- RunnableList callbackList = new RunnableList();
- recentsView.addSideTaskLaunchCallback(callbackList);
- return callbackList;
- }
- if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
- // If the recents transition is running (ie. in live tile mode), then the start
- // of a new task will merge into the existing transition and it currently will
- // not be run independently, so we need to rely on the onTaskAppeared() call
- // for the new task to trigger the side launch callback to flush this runnable
- // list (which is usually flushed when the app launch animation finishes)
- recentsView.addSideTaskLaunchCallback(opts.onEndCallback);
- }
- return opts.onEndCallback;
- } else {
- notifyTaskLaunchFailed(TAG);
- return null;
- }
- } else {
- Log.d(TAG, "launchTaskAnimated - mTask is null" + Arrays.toString(getTaskIds()));
- return null;
- }
- }
-
- /**
- * Starts the task associated with this view without any animation
- */
- public void launchTask(@NonNull Consumer<Boolean> callback) {
- launchTask(callback, false /* isQuickswitch */);
- }
-
- /**
- * Starts the task associated with this view without any animation
- */
- public void launchTask(@NonNull Consumer<Boolean> callback, boolean isQuickswitch) {
- if (mTask != null) {
- TestLogging.recordEvent(
- TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask);
-
- TaskRemovedDuringLaunchListener failureListener = new TaskRemovedDuringLaunchListener(
- getContext().getApplicationContext());
- if (isQuickswitch) {
- // We only listen for failures to launch in quickswitch because the during this
- // gesture launcher is in the background state, vs other launches which are in
- // the actual overview state
- failureListener.register(mContainer, mTask.key.id, () -> {
- notifyTaskLaunchFailed(TAG);
- RecentsView rv = getRecentsView();
- if (rv != null) {
- // Disable animations for now, as it is an edge case and the app usually
- // covers launcher and also any state transition animation also gets
- // clobbered by QuickstepTransitionManager.createWallpaperOpenAnimations
- // when launcher shows again
- rv.startHome(false /* animated */);
- if (rv.mSizeStrategy.getTaskbarController() != null) {
- // LauncherTaskbarUIController depends on the launcher state when
- // checking whether to handle resume, but that can come in before
- // startHome() changes the state, so force-refresh here to ensure the
- // taskbar is updated
- rv.mSizeStrategy.getTaskbarController().refreshResumedState();
- }
- }
- });
- }
- // Indicate success once the system has indicated that the transition has started
- ActivityOptions opts = ActivityOptions.makeCustomTaskAnimation(getContext(), 0, 0,
- MAIN_EXECUTOR.getHandler(),
- elapsedRealTime -> callback.accept(true),
- elapsedRealTime -> failureListener.onTransitionFinished());
- opts.setLaunchDisplayId(
- getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId());
- if (isQuickswitch) {
- opts.setFreezeRecentTasksReordering();
- }
- // TODO(b/334826842) add splash functionality to new TTV
- if (!enableRefactorTaskThumbnail()) {
- opts.setDisableStartingWindow(mTaskThumbnailViewDeprecated.shouldShowSplashView());
- }
- Task.TaskKey key = mTask.key;
- UI_HELPER_EXECUTOR.execute(() -> {
- if (!ActivityManagerWrapper.getInstance().startActivityFromRecents(key, opts)) {
- // If the call to start activity failed, then post the result immediately,
- // otherwise, wait for the animation start callback from the activity options
- // above
- MAIN_EXECUTOR.post(() -> {
- notifyTaskLaunchFailed(TAG);
- callback.accept(false);
- });
- }
- Log.d(TAG,
- "launchTask - startActivityFromRecents: " + Arrays.toString(getTaskIds()));
- });
- } else {
- callback.accept(false);
- Log.d(TAG, "launchTask - mTask is null" + Arrays.toString(getTaskIds()));
- }
- }
-
- /**
- * Launch of the current task (both live and inactive tasks) with an animation.
- */
- @Nullable
- public RunnableList launchTasks() {
- RecentsView recentsView = getRecentsView();
- RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
- if (isRunningTask() && remoteTargetHandles != null) {
- if (!mIsClickableAsLiveTile) {
- Log.e(TAG, "TaskView is not clickable as a live tile; returning to home.");
- return null;
- }
-
- mIsClickableAsLiveTile = false;
- RemoteAnimationTargets targets;
- if (remoteTargetHandles.length == 1) {
- targets = remoteTargetHandles[0].getTransformParams().getTargetSet();
- } else {
- RemoteAnimationTarget[] apps = Arrays.stream(remoteTargetHandles)
- .flatMap(handle -> Stream.of(
- handle.getTransformParams().getTargetSet().apps))
- .toArray(RemoteAnimationTarget[]::new);
- RemoteAnimationTarget[] wallpapers = Arrays.stream(remoteTargetHandles)
- .flatMap(handle -> Stream.of(
- handle.getTransformParams().getTargetSet().wallpapers))
- .toArray(RemoteAnimationTarget[]::new);
- targets = new RemoteAnimationTargets(apps, wallpapers,
- remoteTargetHandles[0].getTransformParams().getTargetSet().nonApps,
- remoteTargetHandles[0].getTransformParams().getTargetSet().targetMode);
- }
- if (targets == null) {
- // If the recents animation is cancelled somehow between the parent if block and
- // here, try to launch the task as a non live tile task.
- RunnableList runnableList = launchTaskAnimated();
- if (runnableList == null) {
- Log.e(TAG, "Recents animation cancelled and cannot launch task as non-live tile"
- + "; returning to home");
- }
- mIsClickableAsLiveTile = true;
- return runnableList;
- }
-
- RunnableList runnableList = new RunnableList();
- AnimatorSet anim = new AnimatorSet();
- TaskViewUtils.composeRecentsLaunchAnimator(
- anim, this, targets.apps,
- targets.wallpapers, targets.nonApps, true /* launcherClosing */,
- recentsView.getStateManager(), recentsView,
- recentsView.getDepthController());
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animator) {
- if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) {
- launchTaskAnimated();
- }
- mIsClickableAsLiveTile = true;
- runEndCallback();
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- runEndCallback();
- }
-
- private void runEndCallback() {
- runnableList.executeAllAndDestroy();
- }
- });
- anim.start();
- Log.d(TAG, "launchTasks - composeRecentsLaunchAnimator: " + Arrays.toString(
- getTaskIds()));
- recentsView.onTaskLaunchedInLiveTileMode();
- return runnableList;
- } else {
- return launchTaskAnimated();
- }
- }
-
- /**
- * See {@link TaskDataChanges}
- *
- * @param visible If this task view will be visible to the user in overview or hidden
- */
- public void onTaskListVisibilityChanged(boolean visible) {
- onTaskListVisibilityChanged(visible, FLAG_UPDATE_ALL);
- }
-
- /**
- * See {@link TaskDataChanges}
- *
- * @param visible If this task view will be visible to the user in overview or hidden
- */
- public void onTaskListVisibilityChanged(boolean visible, @TaskDataChanges int changes) {
- if (mTask == null) {
- return;
- }
- cancelPendingLoadTasks();
- if (visible) {
- // These calls are no-ops if the data is already loaded, try and load the high
- // resolution thumbnail if the state permits
- RecentsModel model = RecentsModel.INSTANCE.get(getContext());
- TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
- TaskIconCache iconCache = model.getIconCache();
-
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- mThumbnailLoadRequest = thumbnailCache.updateThumbnailInBackground(
- mTask, thumbnail -> {
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334825222) add thumbnail state
- mTaskThumbnailViewDeprecated.setThumbnail(mTask, thumbnail);
- }
- });
- }
- if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
- mIconLoadRequest = iconCache.updateIconInBackground(mTask,
- (task) -> {
- setIcon(mIconView, task.icon);
- if (enableOverviewIconMenu()) {
- setText(mIconView, task.title);
- }
- mDigitalWellBeingToast.initialize(task);
- });
- }
- if (needsUpdate(changes, FLAG_UPDATE_CORNER_RADIUS)) {
- mCurrentFullscreenParams.updateCornerRadius(getContext());
- }
- } else {
- if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334825222) add thumbnail state
- mTaskThumbnailViewDeprecated.setThumbnail(null, null);
- }
- // Reset the task thumbnail reference as well (it will be fetched from the cache or
- // reloaded next time we need it)
- mTask.thumbnail = null;
- }
- if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
- setIcon(mIconView, null);
- if (enableOverviewIconMenu()) {
- setText(mIconView, null);
- }
- }
- }
- }
-
- protected boolean needsUpdate(@TaskDataChanges int dataChange, @TaskDataChanges int flag) {
- return (dataChange & flag) == flag;
- }
-
- protected void cancelPendingLoadTasks() {
- if (mThumbnailLoadRequest != null) {
- mThumbnailLoadRequest.cancel();
- mThumbnailLoadRequest = null;
- }
- if (mIconLoadRequest != null) {
- mIconLoadRequest.cancel();
- mIconLoadRequest = null;
- }
- }
-
- private boolean showTaskMenu(TaskViewIcon iconView) {
- if (!getRecentsView().canLaunchFullscreenTask()) {
- // Don't show menu when selecting second split screen app
- return true;
- }
-
- if (!mContainer.getDeviceProfile().isTablet
- && !getRecentsView().isClearAllHidden()) {
- getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
- return false;
- } else {
- mContainer.getStatsLogManager().logger().withItemInfo(getItemInfo())
- .log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS);
- return showTaskMenuWithContainer(iconView);
- }
- }
-
- protected boolean showTaskMenuWithContainer(TaskViewIcon iconView) {
- Optional<TaskIdAttributeContainer> menuContainer = Arrays.stream(
- mTaskIdAttributeContainer).filter(
- container -> container.getIconView() == iconView).findAny();
- if (menuContainer.isEmpty()) {
- return false;
- }
- DeviceProfile dp = mContainer.getDeviceProfile();
- if (enableOverviewIconMenu() && iconView instanceof IconAppChipView) {
- ((IconAppChipView) iconView).revealAnim(/* isRevealing= */ true);
- return TaskMenuView.showForTask(menuContainer.get(),
- () -> ((IconAppChipView) iconView).revealAnim(/* isRevealing= */ false));
- } else if (dp.isTablet) {
- int alignedOptionIndex = 0;
- if (getRecentsView().isOnGridBottomRow(menuContainer.get().getTaskView())
- && dp.isLandscape) {
- if (Flags.enableGridOnlyOverview()) {
- // With no focused task, there is less available space below the tasks, so align
- // the arrow to the third option in the menu.
- alignedOptionIndex = 2;
- } else {
- // Bottom row of landscape grid aligns arrow to second option to avoid clipping
- alignedOptionIndex = 1;
- }
- }
- return TaskMenuViewWithArrow.Companion.showForTask(menuContainer.get(),
- alignedOptionIndex);
- } else {
- return TaskMenuView.showForTask(menuContainer.get());
- }
- }
-
- protected void setIcon(TaskViewIcon iconView, @Nullable Drawable icon) {
- if (icon != null) {
- iconView.setDrawable(icon);
- iconView.setOnClickListener(v -> {
- if (confirmSecondSplitSelectApp()) {
- return;
- }
- showTaskMenu(iconView);
- });
- iconView.setOnLongClickListener(v -> {
- requestDisallowInterceptTouchEvent(true);
- return showTaskMenu(iconView);
- });
- } else {
- iconView.setDrawable(null);
- iconView.setOnClickListener(null);
- iconView.setOnLongClickListener(null);
- }
- }
-
- protected void setText(TaskViewIcon iconView, CharSequence text) {
- iconView.setText(text);
- }
-
- public void setOrientationState(RecentsOrientedState orientationState) {
- mIconView.setIconOrientation(orientationState, isGridTask());
- setThumbnailOrientation(orientationState);
- }
-
- protected void setThumbnailOrientation(RecentsOrientedState orientationState) {
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
-
- // TODO(b/271468547), we should default to setting trasnlations only on the snapshot instead
- // of a hybrid of both margins and translations
- LayoutParams snapshotParams = (LayoutParams) getSnapshotView().getLayoutParams();
- snapshotParams.topMargin = thumbnailTopMargin;
- getSnapshotView().setLayoutParams(snapshotParams);
-
- // TODO(b/335606129) Investigate the usage of [TaskOverlay] in the new TaskThumbnailView.
- // and if it's still necessary we should support that in the new TTV class.
- if (!enableRefactorTaskThumbnail()) {
- mTaskThumbnailViewDeprecated.getTaskOverlay().updateOrientationState(orientationState);
- }
- mDigitalWellBeingToast.initialize(mTask);
- }
-
- /**
- * Returns whether the task is part of overview grid and not being focused.
- */
- public boolean isGridTask() {
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- return deviceProfile.isTablet && !isFocusedTask();
- }
-
- /** Whether this task view represents the desktop */
- public boolean isDesktopTask() {
- return false;
- }
-
- /**
- * Called to animate a smooth transition when going directly from an app into Overview (and
- * vice versa). Icons fade in, and DWB banners slide in with a "shift up" animation.
- */
- protected void setIconsAndBannersTransitionProgress(float progress, boolean invert) {
- if (invert) {
- progress = 1 - progress;
- }
- mFocusTransitionProgress = progress;
- float iconScalePercentage = (float) SCALE_ICON_DURATION / DIM_ANIM_DURATION;
- float lowerClamp = invert ? 1f - iconScalePercentage : 0;
- float upperClamp = invert ? 1 : iconScalePercentage;
- float scale = Interpolators.clampToProgress(FAST_OUT_SLOW_IN, lowerClamp, upperClamp)
- .getInterpolation(progress);
- mIconView.setContentAlpha(scale);
- mDigitalWellBeingToast.updateBannerOffset(1f - scale);
- }
-
- public void setIconScaleAnimStartProgress(float startProgress) {
- mIconScaleAnimStartProgress = startProgress;
- }
-
- public void animateIconScaleAndDimIntoView() {
- if (mIconAndDimAnimator != null) {
- mIconAndDimAnimator.cancel();
- }
- mIconAndDimAnimator = ObjectAnimator.ofFloat(this, FOCUS_TRANSITION, 1);
- mIconAndDimAnimator.setCurrentFraction(mIconScaleAnimStartProgress);
- mIconAndDimAnimator.setDuration(DIM_ANIM_DURATION).setInterpolator(LINEAR);
- mIconAndDimAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mIconAndDimAnimator = null;
- }
- });
- mIconAndDimAnimator.start();
- }
-
- protected void setIconScaleAndDim(float iconScale) {
- setIconScaleAndDim(iconScale, false);
- }
-
- private void setIconScaleAndDim(float iconScale, boolean invert) {
- if (mIconAndDimAnimator != null) {
- mIconAndDimAnimator.cancel();
- }
- setIconsAndBannersTransitionProgress(iconScale, invert);
- }
-
- protected void resetPersistentViewTransforms() {
- mNonGridTranslationX = mGridTranslationX =
- mGridTranslationY = mBoxTranslationY = mNonGridPivotTranslationX = 0f;
- resetViewTransforms();
- }
-
- protected void resetViewTransforms() {
- // fullscreenTranslation and accumulatedTranslation should not be reset, as
- // resetViewTransforms is called during Quickswitch scrolling.
- mDismissTranslationX = mTaskOffsetTranslationX =
- mTaskResistanceTranslationX = mSplitSelectTranslationX = mGridEndTranslationX = 0f;
- mDismissTranslationY = mTaskOffsetTranslationY = mTaskResistanceTranslationY = 0f;
- if (getRecentsView() == null || !getRecentsView().isSplitSelectionActive()) {
- mSplitSelectTranslationY = 0f;
- }
-
- setSnapshotScale(1f);
- applyTranslationX();
- applyTranslationY();
- setTranslationZ(0);
- setAlpha(mStableAlpha);
- setIconScaleAndDim(1);
- setColorTint(0, 0);
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/335399428) add split select functionality to new TTV
- mTaskThumbnailViewDeprecated.resetViewTransforms();
- }
- }
-
- public void setStableAlpha(float parentAlpha) {
- mStableAlpha = parentAlpha;
- setAlpha(mStableAlpha);
- }
-
- @Override
- public void onRecycle() {
- resetPersistentViewTransforms();
- // Clear any references to the thumbnail (it will be re-read either from the cache or the
- // system on next bind)
- // TODO(b/334825222): Implement thumbnail/snapshot for the new [TaskThumbnailView].
- if (enableRefactorTaskThumbnail()) {
- notifyIsRunningTaskUpdated();
- } else {
- mTaskThumbnailViewDeprecated.setThumbnail(mTask, null);
- }
- setOverlayEnabled(false);
- onTaskListVisibilityChanged(false);
- mBorderEnabled = false;
- }
-
- public float getTaskCornerRadius() {
- return mCurrentFullscreenParams.mCornerRadius;
- }
-
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- super.onLayout(changed, left, top, right, bottom);
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
- if (deviceProfile.isTablet) {
- setPivotX(getLayoutDirection() == LAYOUT_DIRECTION_RTL ? 0 : right - left);
- setPivotY(thumbnailTopMargin);
- } else {
- setPivotX((right - left) * 0.5f);
- setPivotY(thumbnailTopMargin + (getHeight() - thumbnailTopMargin) * 0.5f);
- }
- SYSTEM_GESTURE_EXCLUSION_RECT.get(0).set(0, 0, getWidth(), getHeight());
- setSystemGestureExclusionRects(SYSTEM_GESTURE_EXCLUSION_RECT);
- }
-
- /**
- * How much to scale down pages near the edge of the screen.
- */
- public static float getEdgeScaleDownFactor(DeviceProfile deviceProfile) {
- return deviceProfile.isTablet ? EDGE_SCALE_DOWN_FACTOR_GRID
- : EDGE_SCALE_DOWN_FACTOR_CAROUSEL;
- }
-
- private void setNonGridScale(float nonGridScale) {
- mNonGridScale = nonGridScale;
- applyScale();
- }
-
- public float getNonGridScale() {
- return mNonGridScale;
- }
-
- private void setSnapshotScale(float dismissScale) {
- mDismissScale = dismissScale;
- applyScale();
- }
-
- /**
- * Moves TaskView between carousel and 2 row grid.
- *
- * @param gridProgress 0 = carousel; 1 = 2 row grid.
- */
- public void setGridProgress(float gridProgress) {
- mGridProgress = gridProgress;
- applyTranslationX();
- applyTranslationY();
- applyScale();
- }
-
- private void applyScale() {
- float scale = 1;
- scale *= getPersistentScale();
- scale *= mDismissScale;
- setScaleX(scale);
- setScaleY(scale);
- updateSnapshotRadius();
- }
-
- /**
- * Returns multiplication of scale that is persistent (e.g. fullscreen and grid), and does not
- * change according to a temporary state.
- */
- public float getPersistentScale() {
- float scale = 1;
- scale *= Utilities.mapRange(mGridProgress, mNonGridScale, 1f);
- return scale;
- }
-
- /**
- * Updates alpha of task thumbnail splash on swipe up/down.
- */
- public void setTaskThumbnailSplashAlpha(float taskThumbnailSplashAlpha) {
- mTaskThumbnailSplashAlpha = taskThumbnailSplashAlpha;
- applyThumbnailSplashAlpha();
- }
-
- protected void applyThumbnailSplashAlpha() {
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334826842) add splash functionality to new TTV
- mTaskThumbnailViewDeprecated.setSplashAlpha(mTaskThumbnailSplashAlpha);
- }
- }
-
- protected void refreshTaskThumbnailSplash() {
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334826842) add splash functionality to new TTV
- mTaskThumbnailViewDeprecated.refreshSplashView();
- }
- }
-
- private void setSplitSelectTranslationX(float x) {
- mSplitSelectTranslationX = x;
- applyTranslationX();
- }
-
- private void setSplitSelectTranslationY(float y) {
- mSplitSelectTranslationY = y;
- applyTranslationY();
- }
-
- private void setDismissTranslationX(float x) {
- mDismissTranslationX = x;
- applyTranslationX();
- }
-
- private void setDismissTranslationY(float y) {
- mDismissTranslationY = y;
- applyTranslationY();
- }
-
- private void setTaskOffsetTranslationX(float x) {
- mTaskOffsetTranslationX = x;
- applyTranslationX();
- }
-
- private void setTaskOffsetTranslationY(float y) {
- mTaskOffsetTranslationY = y;
- applyTranslationY();
- }
-
- private void setTaskResistanceTranslationX(float x) {
- mTaskResistanceTranslationX = x;
- applyTranslationX();
- }
-
- private void setTaskResistanceTranslationY(float y) {
- mTaskResistanceTranslationY = y;
- applyTranslationY();
- }
-
- public float getNonGridTranslationX() {
- return mNonGridTranslationX;
- }
-
- /**
- * Updates X coordinate of non-grid translation.
- */
- public void setNonGridTranslationX(float nonGridTranslationX) {
- mNonGridTranslationX = nonGridTranslationX;
- applyTranslationX();
- }
-
- public void setGridTranslationX(float gridTranslationX) {
- mGridTranslationX = gridTranslationX;
- applyTranslationX();
- }
-
- public float getGridTranslationX() {
- return mGridTranslationX;
- }
-
- public void setGridTranslationY(float gridTranslationY) {
- mGridTranslationY = gridTranslationY;
- applyTranslationY();
- }
-
- public float getGridTranslationY() {
- return mGridTranslationY;
- }
-
- private void setGridEndTranslationX(float gridEndTranslationX) {
- mGridEndTranslationX = gridEndTranslationX;
- applyTranslationX();
- }
-
- /**
- * Set translation X for non-grid pivot
- */
- public void setNonGridPivotTranslationX(float nonGridPivotTranslationX) {
- mNonGridPivotTranslationX = nonGridPivotTranslationX;
- applyTranslationX();
- }
-
- public float getScrollAdjustment(boolean gridEnabled) {
- float scrollAdjustment = 0;
- if (gridEnabled) {
- scrollAdjustment += mGridTranslationX;
- } else {
- scrollAdjustment += getNonGridTranslationX();
- }
- return scrollAdjustment;
- }
-
- public float getOffsetAdjustment(boolean gridEnabled) {
- return getScrollAdjustment(gridEnabled);
- }
-
- public float getSizeAdjustment(boolean fullscreenEnabled) {
- float sizeAdjustment = 1;
- if (fullscreenEnabled) {
- sizeAdjustment *= mNonGridScale;
- }
- return sizeAdjustment;
- }
-
- private void setBoxTranslationY(float boxTranslationY) {
- mBoxTranslationY = boxTranslationY;
- applyTranslationY();
- }
-
- private void applyTranslationX() {
- setTranslationX(mDismissTranslationX + mTaskOffsetTranslationX + mTaskResistanceTranslationX
- + mSplitSelectTranslationX + mGridEndTranslationX + getPersistentTranslationX());
- }
-
- private void applyTranslationY() {
- setTranslationY(mDismissTranslationY + mTaskOffsetTranslationY + mTaskResistanceTranslationY
- + mSplitSelectTranslationY + getPersistentTranslationY());
- }
-
- /**
- * Returns addition of translationX that is persistent (e.g. fullscreen and grid), and does not
- * change according to a temporary state (e.g. task offset).
- */
- public float getPersistentTranslationX() {
- return getNonGridTrans(mNonGridTranslationX) + getGridTrans(mGridTranslationX)
- + getNonGridTrans(mNonGridPivotTranslationX);
- }
-
- /**
- * Returns addition of translationY that is persistent (e.g. fullscreen and grid), and does not
- * change according to a temporary state (e.g. task offset).
- */
- public float getPersistentTranslationY() {
- return mBoxTranslationY + getGridTrans(mGridTranslationY);
- }
-
- public FloatProperty<TaskView> getPrimarySplitTranslationProperty() {
- return getPagedOrientationHandler().getPrimaryValue(
- SPLIT_SELECT_TRANSLATION_X, SPLIT_SELECT_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getSecondarySplitTranslationProperty() {
- return getPagedOrientationHandler().getSecondaryValue(
- SPLIT_SELECT_TRANSLATION_X, SPLIT_SELECT_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getPrimaryDismissTranslationProperty() {
- return getPagedOrientationHandler().getPrimaryValue(
- DISMISS_TRANSLATION_X, DISMISS_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getSecondaryDismissTranslationProperty() {
- return getPagedOrientationHandler().getSecondaryValue(
- DISMISS_TRANSLATION_X, DISMISS_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getPrimaryTaskOffsetTranslationProperty() {
- return getPagedOrientationHandler().getPrimaryValue(
- TASK_OFFSET_TRANSLATION_X, TASK_OFFSET_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getSecondaryTaskOffsetTranslationProperty() {
- return getPagedOrientationHandler().getSecondaryValue(
- TASK_OFFSET_TRANSLATION_X, TASK_OFFSET_TRANSLATION_Y);
- }
-
- public FloatProperty<TaskView> getTaskResistanceTranslationProperty() {
- return getPagedOrientationHandler().getSecondaryValue(
- TASK_RESISTANCE_TRANSLATION_X, TASK_RESISTANCE_TRANSLATION_Y);
- }
-
- @Override
- public boolean hasOverlappingRendering() {
- // TODO: Clip-out the icon region from the thumbnail, since they are overlapping.
- return false;
- }
-
- public boolean isEndQuickswitchCuj() {
- return mEndQuickswitchCuj;
- }
-
- public void setEndQuickswitchCuj(boolean endQuickswitchCuj) {
- mEndQuickswitchCuj = endQuickswitchCuj;
- }
-
- @Override
- public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
- super.onInitializeAccessibilityNodeInfo(info);
-
- info.addAction(
- new AccessibilityNodeInfo.AccessibilityAction(R.string.accessibility_close,
- getContext().getText(R.string.accessibility_close)));
-
- final Context context = getContext();
- for (TaskIdAttributeContainer taskContainer : mTaskIdAttributeContainer) {
- for (SystemShortcut s : TraceHelper.allowIpcs(
- "TV.a11yInfo", () -> getEnabledShortcuts(this, taskContainer))) {
- info.addAction(s.createAccessibilityAction(context));
- }
- }
-
- if (mDigitalWellBeingToast.hasLimit()) {
- info.addAction(
- new AccessibilityNodeInfo.AccessibilityAction(
- R.string.accessibility_app_usage_settings,
- getContext().getText(R.string.accessibility_app_usage_settings)));
- }
-
- final RecentsView recentsView = getRecentsView();
- final AccessibilityNodeInfo.CollectionItemInfo itemInfo =
- AccessibilityNodeInfo.CollectionItemInfo.obtain(
- 0, 1, recentsView.getTaskViewCount() - recentsView.indexOfChild(this) - 1,
- 1, false);
- info.setCollectionItemInfo(itemInfo);
- }
-
- @Override
- public boolean performAccessibilityAction(int action, Bundle arguments) {
- if (action == R.string.accessibility_close) {
- getRecentsView().dismissTask(this, true /*animateTaskView*/,
- true /*removeTask*/);
- return true;
- }
-
- if (action == R.string.accessibility_app_usage_settings) {
- mDigitalWellBeingToast.openAppUsageSettings(this);
- return true;
- }
-
- for (TaskIdAttributeContainer taskContainer : mTaskIdAttributeContainer) {
- for (SystemShortcut s : getEnabledShortcuts(this,
- taskContainer)) {
- if (s.hasHandlerForAction(action)) {
- s.onClick(this);
- return true;
- }
- }
- }
-
- return super.performAccessibilityAction(action, arguments);
- }
-
- @Nullable
- public RecentsView getRecentsView() {
- return (RecentsView) getParent();
- }
-
- RecentsPagedOrientationHandler getPagedOrientationHandler() {
- return getRecentsView().mOrientationState.getOrientationHandler();
- }
-
- private void notifyTaskLaunchFailed(String tag) {
- String msg = "Failed to launch task";
- if (mTask != null) {
- msg += " (task=" + mTask.key.baseIntent + " userId=" + mTask.key.userId + ")";
- }
- Log.w(tag, msg);
- Toast.makeText(getContext(), R.string.activity_not_available, LENGTH_SHORT).show();
- }
-
- /**
- * Hides the icon and shows insets when this TaskView is about to be shown fullscreen.
- *
- * @param progress: 0 = show icon and no insets; 1 = don't show icon and show full insets.
- */
- public void setFullscreenProgress(float progress) {
- progress = Utilities.boundToRange(progress, 0, 1);
- mFullscreenProgress = progress;
- mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334826840) Add corner rounding to new TTV
- mTaskThumbnailViewDeprecated.getTaskOverlay().setFullscreenProgress(progress);
- }
-
- RecentsView recentsView = mContainer.getOverviewPanel();
- // Animate icons and DWB banners in/out, except in QuickSwitch state, when tiles are
- // oversized and banner would look disproportionately large.
- if (recentsView.getStateManager().getState() != BACKGROUND_APP) {
- setIconsAndBannersTransitionProgress(progress, true);
- }
-
- updateSnapshotRadius();
- }
-
- protected void updateSnapshotRadius() {
- updateCurrentFullscreenParams();
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334826840) Add corner rounding to new TTV
- mTaskThumbnailViewDeprecated.setFullscreenParams(mCurrentFullscreenParams);
- }
- }
-
- void updateCurrentFullscreenParams() {
- updateFullscreenParams(mCurrentFullscreenParams);
- }
-
- protected void updateFullscreenParams(TaskView.FullscreenDrawParams fullscreenParams) {
- if (getRecentsView() == null) {
- return;
- }
- fullscreenParams.setProgress(mFullscreenProgress, getRecentsView().getScaleX(),
- getScaleX());
- }
-
- /**
- * Updates TaskView scaling and translation required to support variable width if enabled, while
- * ensuring TaskView fits into screen in fullscreen.
- */
- void updateTaskSize() {
- ViewGroup.LayoutParams params = getLayoutParams();
- float nonGridScale;
- float boxTranslationY;
- int expectedWidth;
- int expectedHeight;
- DeviceProfile deviceProfile = mContainer.getDeviceProfile();
- final int thumbnailPadding = deviceProfile.overviewTaskThumbnailTopMarginPx;
- final Rect lastComputedTaskSize = getRecentsView().getLastComputedTaskSize();
- final int taskWidth = lastComputedTaskSize.width();
- final int taskHeight = lastComputedTaskSize.height();
- if (deviceProfile.isTablet) {
- int boxWidth;
- int boxHeight;
- boolean isFocusedTask = isFocusedTask();
- if (isFocusedTask) {
- // Task will be focused and should use focused task size. Use focusTaskRatio
- // that is associated with the original orientation of the focused task.
- boxWidth = taskWidth;
- boxHeight = taskHeight;
- } else {
- // Otherwise task is in grid, and should use lastComputedGridTaskSize.
- Rect lastComputedGridTaskSize = getRecentsView().getLastComputedGridTaskSize();
- boxWidth = lastComputedGridTaskSize.width();
- boxHeight = lastComputedGridTaskSize.height();
- }
-
- // Bound width/height to the box size.
- expectedWidth = boxWidth;
- expectedHeight = boxHeight + thumbnailPadding;
-
- // Scale to to fit task Rect.
- if (enableGridOnlyOverview()) {
- final Rect lastComputedCarouselTaskSize =
- getRecentsView().getLastComputedCarouselTaskSize();
- nonGridScale = lastComputedCarouselTaskSize.width() / (float) taskWidth;
- } else {
- nonGridScale = taskWidth / (float) boxWidth;
- }
-
- // Align to top of task Rect.
- boxTranslationY = (expectedHeight - thumbnailPadding - taskHeight) / 2.0f;
- } else {
- nonGridScale = 1f;
- boxTranslationY = 0f;
- expectedWidth = enableOverviewIconMenu() ? taskWidth : LayoutParams.MATCH_PARENT;
- expectedHeight = enableOverviewIconMenu()
- ? taskHeight + thumbnailPadding
- : LayoutParams.MATCH_PARENT;
- }
-
- setNonGridScale(nonGridScale);
- setBoxTranslationY(boxTranslationY);
- if (params.width != expectedWidth || params.height != expectedHeight) {
- params.width = expectedWidth;
- params.height = expectedHeight;
- setLayoutParams(params);
- }
- }
-
- private float getGridTrans(float endTranslation) {
- return Utilities.mapRange(mGridProgress, 0, endTranslation);
- }
-
- private float getNonGridTrans(float endTranslation) {
- return endTranslation - getGridTrans(endTranslation);
- }
-
- public boolean isRunningTask() {
- if (getRecentsView() == null) {
- return false;
- }
- return this == getRecentsView().getRunningTaskView();
- }
-
- public boolean isFocusedTask() {
- if (getRecentsView() == null) {
- return false;
- }
- return this == getRecentsView().getFocusedTaskView();
- }
-
- public void setShowScreenshot(boolean showScreenshot) {
- mShowScreenshot = showScreenshot;
- }
-
- public boolean showScreenshot() {
- if (!isRunningTask()) {
- return true;
- }
- return mShowScreenshot;
- }
-
- public void setOverlayEnabled(boolean overlayEnabled) {
- // TODO(b/335606129) Investigate the usage of [TaskOverlay] in the new TaskThumbnailView.
- // and if it's still necessary we should support that in the new TTV class.
- if (!enableRefactorTaskThumbnail()) {
- mTaskThumbnailViewDeprecated.setOverlayEnabled(overlayEnabled);
- }
- }
-
- public void initiateSplitSelect(SplitPositionOption splitPositionOption) {
- getRecentsView().initiateSplitSelect(this, splitPositionOption.stagePosition,
- getLogEventForPosition(splitPositionOption.stagePosition));
- }
-
- /**
- * Set a color tint on the snapshot and supporting views.
- */
- public void setColorTint(float amount, int tintColor) {
- if (!enableRefactorTaskThumbnail()) {
- // TODO(b/334832108) Add scrim to new TTV
- mTaskThumbnailViewDeprecated.setDimAlpha(amount);
- }
- mIconView.setIconColorTint(tintColor, amount);
- mDigitalWellBeingToast.setBannerColorTint(tintColor, amount);
- }
-
-
- private int getRootViewDisplayId() {
- Display display = getRootView().getDisplay();
- return display != null ? display.getDisplayId() : DEFAULT_DISPLAY;
- }
-
- /**
- * Sets visibility for the thumbnail and associated elements (DWB banners and action chips).
- * IconView is unaffected.
- *
- * @param taskId is only used when setting visibility to a non-{@link View#VISIBLE} value
- */
- void setThumbnailVisibility(int visibility, int taskId) {
- for (int i = 0; i < getChildCount(); i++) {
- View child = getChildAt(i);
- if (child != mIconView) {
- child.setVisibility(visibility);
- }
- }
- }
-
- private View getSnapshotView() {
- return enableRefactorTaskThumbnail() ? mTaskThumbnailView : mTaskThumbnailViewDeprecated;
- }
-
- /**
- * We update and subsequently draw these in {@link #setFullscreenProgress(float)}.
- */
- public static class FullscreenDrawParams implements SafeCloseable {
-
- private float mCornerRadius;
- private float mWindowCornerRadius;
-
- public float mCurrentDrawnCornerRadius;
-
- public FullscreenDrawParams(Context context) {
- updateCornerRadius(context);
- }
-
- /** Recomputes the start and end corner radius for the given Context. */
- public void updateCornerRadius(Context context) {
- mCornerRadius = computeTaskCornerRadius(context);
- mWindowCornerRadius = computeWindowCornerRadius(context);
- }
-
- @VisibleForTesting
- public float computeTaskCornerRadius(Context context) {
- return TaskCornerRadius.get(context);
- }
-
- @VisibleForTesting
- public float computeWindowCornerRadius(Context context) {
- return QuickStepContract.getWindowCornerRadius(context);
- }
-
- /**
- * Sets the progress in range [0, 1]
- */
- public void setProgress(float fullscreenProgress, float parentScale, float taskViewScale) {
- mCurrentDrawnCornerRadius =
- Utilities.mapRange(fullscreenProgress, mCornerRadius, mWindowCornerRadius)
- / parentScale / taskViewScale;
- }
-
- @Override
- public void close() {
- }
- }
-
- public class TaskIdAttributeContainer {
- private final TaskThumbnailViewDeprecated mThumbnailView;
- private final Task mTask;
- private final TaskViewIcon mIconView;
- /** Defaults to STAGE_POSITION_UNDEFINED if in not a split screen task view */
- private @SplitConfigurationOptions.StagePosition int mStagePosition;
- @IdRes
- private final int mA11yNodeId;
-
- public TaskIdAttributeContainer(Task task, TaskThumbnailViewDeprecated thumbnailView,
- TaskViewIcon iconView, int stagePosition) {
- this.mTask = task;
- this.mThumbnailView = thumbnailView;
- this.mIconView = iconView;
- this.mStagePosition = stagePosition;
- this.mA11yNodeId = (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) ?
- R.id.split_bottomRight_appInfo : R.id.split_topLeft_appInfo;
- }
-
- public TaskThumbnailViewDeprecated getThumbnailView() {
- return mThumbnailView;
- }
-
- public Task getTask() {
- return mTask;
- }
-
- public WorkspaceItemInfo getItemInfo() {
- return TaskView.this.getItemInfo(mTask);
- }
-
- public TaskView getTaskView() {
- return TaskView.this;
- }
-
- public TaskViewIcon getIconView() {
- return mIconView;
- }
-
- public int getStagePosition() {
- return mStagePosition;
- }
-
- void setStagePosition(@SplitConfigurationOptions.StagePosition int stagePosition) {
- this.mStagePosition = stagePosition;
- }
-
- public int getA11yNodeId() {
- return mA11yNodeId;
- }
- }
-}
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt
new file mode 100644
index 0000000..815f8fa
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/TaskView.kt
@@ -0,0 +1,1793 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.views
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.animation.AnimatorSet
+import android.animation.ObjectAnimator
+import android.annotation.IdRes
+import android.app.ActivityOptions
+import android.content.Context
+import android.graphics.Canvas
+import android.graphics.PointF
+import android.graphics.Rect
+import android.graphics.drawable.Drawable
+import android.os.Bundle
+import android.util.AttributeSet
+import android.util.FloatProperty
+import android.util.Log
+import android.view.Display
+import android.view.LayoutInflater
+import android.view.MotionEvent
+import android.view.View
+import android.view.View.OnClickListener
+import android.view.ViewGroup
+import android.view.ViewStub
+import android.view.accessibility.AccessibilityNodeInfo
+import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
+import android.widget.FrameLayout
+import android.widget.Toast
+import androidx.annotation.IntDef
+import androidx.annotation.VisibleForTesting
+import androidx.core.view.updateLayoutParams
+import com.android.app.animation.Interpolators
+import com.android.launcher3.Flags.enableCursorHoverStates
+import com.android.launcher3.Flags.enableFocusOutline
+import com.android.launcher3.Flags.enableGridOnlyOverview
+import com.android.launcher3.Flags.enableHoverOfChildElementsInTaskview
+import com.android.launcher3.Flags.enableLargeDesktopWindowingTile
+import com.android.launcher3.Flags.enableOverviewIconMenu
+import com.android.launcher3.Flags.enableRefactorTaskThumbnail
+import com.android.launcher3.R
+import com.android.launcher3.Utilities
+import com.android.launcher3.anim.AnimatedFloat
+import com.android.launcher3.config.FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.testing.TestLogging
+import com.android.launcher3.testing.shared.TestProtocol
+import com.android.launcher3.util.CancellableTask
+import com.android.launcher3.util.DisplayController
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.MultiPropertyFactory
+import com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE
+import com.android.launcher3.util.MultiValueAlpha
+import com.android.launcher3.util.RunnableList
+import com.android.launcher3.util.SafeCloseable
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
+import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption
+import com.android.launcher3.util.SplitConfigurationOptions.StagePosition
+import com.android.launcher3.util.TraceHelper
+import com.android.launcher3.util.TransformingTouchDelegate
+import com.android.launcher3.util.ViewPool
+import com.android.launcher3.util.rects.set
+import com.android.launcher3.views.ActivityContext
+import com.android.quickstep.RecentsModel
+import com.android.quickstep.RemoteAnimationTargets
+import com.android.quickstep.TaskAnimationManager
+import com.android.quickstep.TaskOverlayFactory
+import com.android.quickstep.TaskViewUtils
+import com.android.quickstep.orientation.RecentsPagedOrientationHandler
+import com.android.quickstep.recents.di.RecentsDependencies
+import com.android.quickstep.recents.di.get
+import com.android.quickstep.task.thumbnail.TaskThumbnailView
+import com.android.quickstep.task.viewmodel.TaskViewModel
+import com.android.quickstep.util.ActiveGestureErrorDetector
+import com.android.quickstep.util.ActiveGestureLog
+import com.android.quickstep.util.BorderAnimator
+import com.android.quickstep.util.BorderAnimator.Companion.createSimpleBorderAnimator
+import com.android.quickstep.util.RecentsOrientedState
+import com.android.quickstep.util.TaskCornerRadius
+import com.android.quickstep.util.TaskRemovedDuringLaunchListener
+import com.android.quickstep.views.RecentsView.UNBOUND_TASK_VIEW_ID
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.android.systemui.shared.system.ActivityManagerWrapper
+import com.android.systemui.shared.system.QuickStepContract
+
+/** A task in the Recents view. */
+open class TaskView
+@JvmOverloads
+constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0,
+ defStyleRes: Int = 0,
+ focusBorderAnimator: BorderAnimator? = null,
+ hoverBorderAnimator: BorderAnimator? = null,
+ private val type: TaskViewType = TaskViewType.SINGLE,
+) : FrameLayout(context, attrs), ViewPool.Reusable {
+ /**
+ * Used in conjunction with [onTaskListVisibilityChanged], providing more granularity on which
+ * components of this task require an update
+ */
+ @Retention(AnnotationRetention.SOURCE)
+ @IntDef(FLAG_UPDATE_ALL, FLAG_UPDATE_ICON, FLAG_UPDATE_THUMBNAIL, FLAG_UPDATE_CORNER_RADIUS)
+ annotation class TaskDataChanges
+
+ private lateinit var taskViewModel: TaskViewModel
+
+ val taskIds: IntArray
+ /** Returns a copy of integer array containing taskIds of all tasks in the TaskView. */
+ get() = taskContainers.map { it.task.key.id }.toIntArray()
+
+ val taskIdSet: Set<Int>
+ /** Returns a copy of integer array containing taskIds of all tasks in the TaskView. */
+ get() = taskContainers.map { it.task.key.id }.toSet()
+
+ val snapshotViews: Array<View>
+ get() = taskContainers.map { it.snapshotView }.toTypedArray()
+
+ val isGridTask: Boolean
+ /** Returns whether the task is part of overview grid and not being focused. */
+ get() = container.deviceProfile.isTablet && !isLargeTile
+
+ val isRunningTask: Boolean
+ get() = this === recentsView?.runningTaskView
+
+ val isLargeTile: Boolean
+ get() =
+ this == recentsView?.focusedTaskView ||
+ (enableLargeDesktopWindowingTile() && type == TaskViewType.DESKTOP)
+
+ val taskCornerRadius: Float
+ get() = currentFullscreenParams.cornerRadius
+
+ val recentsView: RecentsView<*, *>?
+ get() = parent as? RecentsView<*, *>
+
+ val pagedOrientationHandler: RecentsPagedOrientationHandler
+ get() = orientedState.orientationHandler
+
+ @get:Deprecated("Use [taskContainers] instead.")
+ val firstTask: Task
+ /** Returns the first task bound to this TaskView. */
+ get() = taskContainers[0].task
+
+ @get:Deprecated("Use [taskContainers] instead.")
+ val firstSnapshotView: View
+ /** Returns the first snapshotView of the TaskView. */
+ get() = taskContainers[0].snapshotView
+
+ @get:Deprecated("Use [taskContainers] instead.")
+ val firstItemInfo: ItemInfo
+ get() = taskContainers[0].itemInfo
+
+ private val currentFullscreenParams = FullscreenDrawParams(context)
+ protected val container: RecentsViewContainer =
+ RecentsViewContainer.containerFromContext(context)
+ protected val lastTouchDownPosition = PointF()
+
+ // Derived view properties
+ protected val persistentScale: Float
+ /**
+ * Returns multiplication of scale that is persistent (e.g. fullscreen and grid), and does
+ * not change according to a temporary state.
+ */
+ get() = Utilities.mapRange(gridProgress, nonGridScale, 1f)
+
+ protected val persistentTranslationX: Float
+ /**
+ * Returns addition of translationX that is persistent (e.g. fullscreen and grid), and does
+ * not change according to a temporary state (e.g. task offset).
+ */
+ get() =
+ (getNonGridTrans(nonGridTranslationX) +
+ getGridTrans(this.gridTranslationX) +
+ getNonGridTrans(nonGridPivotTranslationX))
+
+ protected val persistentTranslationY: Float
+ /**
+ * Returns addition of translationY that is persistent (e.g. fullscreen and grid), and does
+ * not change according to a temporary state (e.g. task offset).
+ */
+ get() = boxTranslationY + getGridTrans(gridTranslationY)
+
+ protected val primarySplitTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getPrimaryValue(
+ SPLIT_SELECT_TRANSLATION_X,
+ SPLIT_SELECT_TRANSLATION_Y
+ )
+
+ protected val secondarySplitTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getSecondaryValue(
+ SPLIT_SELECT_TRANSLATION_X,
+ SPLIT_SELECT_TRANSLATION_Y
+ )
+
+ protected val primaryDismissTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getPrimaryValue(DISMISS_TRANSLATION_X, DISMISS_TRANSLATION_Y)
+
+ protected val secondaryDismissTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getSecondaryValue(DISMISS_TRANSLATION_X, DISMISS_TRANSLATION_Y)
+
+ protected val primaryTaskOffsetTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getPrimaryValue(
+ TASK_OFFSET_TRANSLATION_X,
+ TASK_OFFSET_TRANSLATION_Y
+ )
+
+ protected val secondaryTaskOffsetTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getSecondaryValue(
+ TASK_OFFSET_TRANSLATION_X,
+ TASK_OFFSET_TRANSLATION_Y
+ )
+
+ protected val taskResistanceTranslationProperty: FloatProperty<TaskView>
+ get() =
+ pagedOrientationHandler.getSecondaryValue(
+ TASK_RESISTANCE_TRANSLATION_X,
+ TASK_RESISTANCE_TRANSLATION_Y
+ )
+
+ private val tempCoordinates = FloatArray(2)
+ private val focusBorderAnimator: BorderAnimator?
+ private val hoverBorderAnimator: BorderAnimator?
+ private val rootViewDisplayId: Int
+ get() = rootView.display?.displayId ?: Display.DEFAULT_DISPLAY
+
+ /** Returns a list of all TaskContainers in the TaskView. */
+ lateinit var taskContainers: List<TaskContainer>
+ protected set
+
+ lateinit var orientedState: RecentsOrientedState
+
+ var taskViewId = UNBOUND_TASK_VIEW_ID
+ var isEndQuickSwitchCuj = false
+
+ // Various animation progress variables.
+ // progress: 0 = show icon and no insets; 1 = don't show icon and show full insets.
+ protected var fullscreenProgress = 0f
+ set(value) {
+ field = Utilities.boundToRange(value, 0f, 1f)
+ onFullscreenProgressChanged(field)
+ }
+
+ // gridProgress 0 = carousel; 1 = 2 row grid.
+ protected var gridProgress = 0f
+ set(value) {
+ field = value
+ onGridProgressChanged()
+ }
+
+ /**
+ * The modalness of this view is how it should be displayed when it is shown on its own in the
+ * modal state of overview. 0 being in context with other tasks, 1 being shown on its own.
+ */
+ protected var modalness = 0f
+ set(value) {
+ if (field == value) {
+ return
+ }
+ field = value
+ onModalnessUpdated(field)
+ }
+
+ protected var taskThumbnailSplashAlpha = 0f
+ set(value) {
+ field = value
+ applyThumbnailSplashAlpha()
+ }
+
+ protected var nonGridScale = 1f
+ set(value) {
+ field = value
+ applyScale()
+ }
+
+ private var dismissScale = 1f
+ set(value) {
+ field = value
+ applyScale()
+ }
+
+ private var dismissTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ private var dismissTranslationY = 0f
+ set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ private var taskOffsetTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ private var taskOffsetTranslationY = 0f
+ set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ private var taskResistanceTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ private var taskResistanceTranslationY = 0f
+ set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ // The following translation variables should only be used in the same orientation as Launcher.
+ private var boxTranslationY = 0f
+ set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ // The following grid translations scales with mGridProgress.
+ protected var gridTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ var gridTranslationY = 0f
+ protected set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ // The following grid translation is used to animate closing the gap between grid and clear all.
+ private var gridEndTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ // Applied as a complement to gridTranslation, for adjusting the carousel overview and quick
+ // switch.
+ protected var nonGridTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ protected var nonGridPivotTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ // Used when in SplitScreenSelectState
+ private var splitSelectTranslationY = 0f
+ set(value) {
+ field = value
+ applyTranslationY()
+ }
+
+ private var splitSelectTranslationX = 0f
+ set(value) {
+ field = value
+ applyTranslationX()
+ }
+
+ private val taskViewAlpha = MultiValueAlpha(this, NUM_ALPHA_CHANNELS)
+
+ protected var stableAlpha
+ set(value) {
+ taskViewAlpha.get(ALPHA_INDEX_STABLE).value = value
+ }
+ get() = taskViewAlpha.get(ALPHA_INDEX_STABLE).value
+
+ protected var attachAlpha
+ set(value) {
+ taskViewAlpha.get(ALPHA_INDEX_ATTACH).value = value
+ }
+ get() = taskViewAlpha.get(ALPHA_INDEX_ATTACH).value
+
+ protected var shouldShowScreenshot = false
+ get() = !isRunningTask || field
+
+ /** Enable or disable showing border on hover and focus change */
+ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
+ var borderEnabled = false
+ set(value) {
+ if (field == value) {
+ return
+ }
+ field = value
+ // Set the animation correctly in case it misses the hover/focus event during state
+ // transition
+ hoverBorderAnimator?.setBorderVisibility(visible = field && isHovered, animated = true)
+ focusBorderAnimator?.setBorderVisibility(visible = field && isFocused, animated = true)
+ }
+
+ /**
+ * Used to cache the hover border state so we don't repeatedly call the border animator with
+ * every hover event when the user hasn't crossed the threshold of the [thumbnailBounds].
+ */
+ private var hoverBorderVisible = false
+ set(value) {
+ if (field == value) {
+ return
+ }
+ field = value
+ Log.d(
+ TAG,
+ "${taskIds.contentToString()} - setting border animator visibility to: $field"
+ )
+ hoverBorderAnimator?.setBorderVisibility(visible = field, animated = true)
+ }
+
+ // Used to cache thumbnail bounds to avoid recalculating on every hover move.
+ private var thumbnailBounds = Rect()
+
+ private var focusTransitionProgress = 1f
+ set(value) {
+ field = value
+ onFocusTransitionProgressUpdated(field)
+ }
+
+ private val focusTransitionPropertyFactory =
+ MultiPropertyFactory(
+ this,
+ FOCUS_TRANSITION,
+ FOCUS_TRANSITION_INDEX_COUNT,
+ { x: Float, y: Float -> x * y },
+ 1f
+ )
+ private val focusTransitionFullscreen =
+ focusTransitionPropertyFactory.get(FOCUS_TRANSITION_INDEX_FULLSCREEN)
+ private val focusTransitionScaleAndDim =
+ focusTransitionPropertyFactory.get(FOCUS_TRANSITION_INDEX_SCALE_AND_DIM)
+
+ /**
+ * Returns an animator of [focusTransitionScaleAndDim] that transition out with a built-in
+ * interpolator.
+ */
+ fun getFocusTransitionScaleAndDimOutAnimator(): ObjectAnimator =
+ AnimatedFloat { v ->
+ focusTransitionScaleAndDim.value =
+ FOCUS_TRANSITION_FAST_OUT_INTERPOLATOR.getInterpolation(v)
+ }
+ .animateToValue(1f, 0f)
+
+ private var iconAndDimAnimator: ObjectAnimator? = null
+ // The current background requests to load the task thumbnail and icon
+ private val pendingThumbnailLoadRequests = mutableListOf<CancellableTask<*>>()
+ private val pendingIconLoadRequests = mutableListOf<CancellableTask<*>>()
+ private var isClickableAsLiveTile = true
+
+ init {
+ setOnClickListener { _ -> onClick() }
+
+ if (enableRefactorTaskThumbnail()) {
+ taskViewModel = RecentsDependencies.get(this, "TaskViewType" to type)
+ }
+
+ val keyboardFocusHighlightEnabled =
+ (ENABLE_KEYBOARD_QUICK_SWITCH.get() || enableFocusOutline())
+ val cursorHoverStatesEnabled = enableCursorHoverStates()
+ setWillNotDraw(!keyboardFocusHighlightEnabled && !cursorHoverStatesEnabled)
+ context.obtainStyledAttributes(attrs, R.styleable.TaskView, defStyleAttr, defStyleRes).use {
+ this.focusBorderAnimator =
+ focusBorderAnimator
+ ?: if (keyboardFocusHighlightEnabled)
+ createSimpleBorderAnimator(
+ currentFullscreenParams.cornerRadius.toInt(),
+ context.resources.getDimensionPixelSize(
+ R.dimen.keyboard_quick_switch_border_width
+ ),
+ { bounds: Rect -> getThumbnailBounds(bounds) },
+ this,
+ it.getColor(
+ R.styleable.TaskView_focusBorderColor,
+ BorderAnimator.DEFAULT_BORDER_COLOR
+ )
+ )
+ else null
+ this.hoverBorderAnimator =
+ hoverBorderAnimator
+ ?: if (cursorHoverStatesEnabled)
+ createSimpleBorderAnimator(
+ currentFullscreenParams.cornerRadius.toInt(),
+ context.resources.getDimensionPixelSize(
+ R.dimen.task_hover_border_width
+ ),
+ { bounds: Rect -> getThumbnailBounds(bounds) },
+ this,
+ it.getColor(
+ R.styleable.TaskView_hoverBorderColor,
+ BorderAnimator.DEFAULT_BORDER_COLOR
+ )
+ )
+ else null
+ }
+ }
+
+ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
+ public override fun onFocusChanged(
+ gainFocus: Boolean,
+ direction: Int,
+ previouslyFocusedRect: Rect?,
+ ) {
+ super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
+ if (borderEnabled) {
+ focusBorderAnimator?.setBorderVisibility(gainFocus, /* animated= */ true)
+ }
+ }
+
+ override fun onHoverEvent(event: MotionEvent): Boolean {
+ if (borderEnabled) {
+ when (event.action) {
+ MotionEvent.ACTION_HOVER_ENTER -> {
+ hoverBorderVisible =
+ if (enableHoverOfChildElementsInTaskview()) {
+ getThumbnailBounds(thumbnailBounds)
+ event.isWithinThumbnailBounds()
+ } else {
+ true
+ }
+ }
+ MotionEvent.ACTION_HOVER_MOVE ->
+ if (enableHoverOfChildElementsInTaskview())
+ hoverBorderVisible = event.isWithinThumbnailBounds()
+ MotionEvent.ACTION_HOVER_EXIT -> hoverBorderVisible = false
+ else -> {}
+ }
+ }
+ return super.onHoverEvent(event)
+ }
+
+ override fun onInterceptHoverEvent(event: MotionEvent): Boolean =
+ if (enableHoverOfChildElementsInTaskview()) super.onInterceptHoverEvent(event)
+ else if (enableCursorHoverStates()) true else super.onInterceptHoverEvent(event)
+
+ override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
+ val recentsView = recentsView ?: return false
+ val splitSelectStateController = recentsView.splitSelectController
+ // Disable taps for split selection animation unless we have a task not being selected
+ if (
+ splitSelectStateController.isSplitSelectActive &&
+ taskContainers.none { it.task.key.id != splitSelectStateController.initialTaskId }
+ ) {
+ return false
+ }
+ if (ev.action == MotionEvent.ACTION_DOWN) {
+ with(lastTouchDownPosition) {
+ x = ev.x
+ y = ev.y
+ }
+ }
+ return super.dispatchTouchEvent(ev)
+ }
+
+ override fun draw(canvas: Canvas) {
+ // Draw border first so any child views outside of the thumbnail bounds are drawn above it.
+ focusBorderAnimator?.drawBorder(canvas)
+ hoverBorderAnimator?.drawBorder(canvas)
+ super.draw(canvas)
+ }
+
+ override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
+ super.onLayout(changed, left, top, right, bottom)
+ val thumbnailTopMargin = container.deviceProfile.overviewTaskThumbnailTopMarginPx
+ if (container.deviceProfile.isTablet) {
+ pivotX = (if (layoutDirection == LAYOUT_DIRECTION_RTL) 0 else right - left).toFloat()
+ pivotY = thumbnailTopMargin.toFloat()
+ } else {
+ pivotX = (right - left) * 0.5f
+ pivotY = thumbnailTopMargin + (height - thumbnailTopMargin) * 0.5f
+ }
+ systemGestureExclusionRects =
+ SYSTEM_GESTURE_EXCLUSION_RECT.onEach {
+ it.right = width
+ it.bottom = height
+ }
+ if (enableHoverOfChildElementsInTaskview()) {
+ getThumbnailBounds(thumbnailBounds)
+ }
+ }
+
+ override fun onRecycle() {
+ resetPersistentViewTransforms()
+ // Clear any references to the thumbnail (it will be re-read either from the cache or the
+ // system on next bind)
+ if (!enableRefactorTaskThumbnail()) {
+ taskContainers.forEach { it.thumbnailViewDeprecated.setThumbnail(it.task, null) }
+ }
+ setOverlayEnabled(false)
+ onTaskListVisibilityChanged(false)
+ borderEnabled = false
+ hoverBorderVisible = false
+ taskViewId = UNBOUND_TASK_VIEW_ID
+ taskContainers.forEach { it.destroy() }
+ }
+
+ // TODO: Clip-out the icon region from the thumbnail, since they are overlapping.
+ override fun hasOverlappingRendering() = false
+
+ override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo) {
+ super.onInitializeAccessibilityNodeInfo(info)
+ with(info) {
+ addAction(
+ AccessibilityAction(
+ R.id.action_close,
+ context.getText(R.string.accessibility_close)
+ )
+ )
+
+ taskContainers.forEach {
+ TraceHelper.allowIpcs("TV.a11yInfo") {
+ TaskOverlayFactory.getEnabledShortcuts(this@TaskView, it).forEach { shortcut ->
+ addAction(shortcut.createAccessibilityAction(context))
+ }
+ }
+ }
+
+ // Add DWB accessibility action at the end of the list
+ taskContainers.forEach {
+ it.digitalWellBeingToast?.getDWBAccessibilityAction()?.let(::addAction)
+ }
+
+ recentsView?.let {
+ collectionItemInfo =
+ AccessibilityNodeInfo.CollectionItemInfo.obtain(
+ 0,
+ 1,
+ it.taskViewCount - it.indexOfChild(this@TaskView) - 1,
+ 1,
+ false
+ )
+ }
+ }
+ }
+
+ override fun performAccessibilityAction(action: Int, arguments: Bundle?): Boolean {
+ // TODO(b/343708271): Add support for multiple tasks per action.
+ if (action == R.id.action_close) {
+ recentsView?.dismissTask(this, true /*animateTaskView*/, true /*removeTask*/)
+ return true
+ }
+
+ taskContainers.forEach {
+ if (it.digitalWellBeingToast?.handleAccessibilityAction(action) == true) {
+ return true
+ }
+
+ TaskOverlayFactory.getEnabledShortcuts(this, it).forEach { shortcut ->
+ if (shortcut.hasHandlerForAction(action)) {
+ shortcut.onClick(this)
+ return true
+ }
+ }
+ }
+
+ return super.performAccessibilityAction(action, arguments)
+ }
+
+ /** Updates this task view to the given {@param task}. */
+ open fun bind(
+ task: Task,
+ orientedState: RecentsOrientedState,
+ taskOverlayFactory: TaskOverlayFactory,
+ ) {
+
+ cancelPendingLoadTasks()
+ taskContainers =
+ listOf(
+ createTaskContainer(
+ task,
+ R.id.snapshot,
+ R.id.icon,
+ R.id.show_windows,
+ STAGE_POSITION_UNDEFINED,
+ taskOverlayFactory
+ )
+ )
+ taskContainers.forEach { it.bind() }
+ setOrientationState(orientedState)
+ }
+
+ protected fun createTaskContainer(
+ task: Task,
+ @IdRes thumbnailViewId: Int,
+ @IdRes iconViewId: Int,
+ @IdRes showWindowViewId: Int,
+ @StagePosition stagePosition: Int,
+ taskOverlayFactory: TaskOverlayFactory,
+ ): TaskContainer {
+ val thumbnailViewDeprecated: TaskThumbnailViewDeprecated = findViewById(thumbnailViewId)!!
+ val snapshotView =
+ if (enableRefactorTaskThumbnail()) {
+ thumbnailViewDeprecated.visibility = GONE
+ val indexOfSnapshotView = indexOfChild(thumbnailViewDeprecated)
+ LayoutInflater.from(context).inflate(R.layout.task_thumbnail, this, false).also {
+ addView(it, indexOfSnapshotView, thumbnailViewDeprecated.layoutParams)
+ }
+ } else {
+ thumbnailViewDeprecated
+ }
+ val iconView = getOrInflateIconView(iconViewId)
+ return TaskContainer(
+ this,
+ task,
+ snapshotView,
+ iconView,
+ TransformingTouchDelegate(iconView.asView()),
+ stagePosition,
+ DigitalWellBeingToast(container, this),
+ findViewById(showWindowViewId)!!,
+ taskOverlayFactory
+ )
+ }
+
+ protected fun getOrInflateIconView(@IdRes iconViewId: Int): TaskViewIcon {
+ val iconView = findViewById<View>(iconViewId)!!
+ return iconView as? TaskViewIcon
+ ?: (iconView as ViewStub)
+ .apply {
+ layoutResource =
+ if (enableOverviewIconMenu()) R.layout.icon_app_chip_view
+ else R.layout.icon_view
+ }
+ .inflate() as TaskViewIcon
+ }
+
+ fun containsMultipleTasks() = taskContainers.size > 1
+
+ /**
+ * Returns the TaskContainer corresponding to a given taskId, or null if the TaskView does not
+ * contain a Task with that ID.
+ */
+ fun getTaskContainerById(taskId: Int) = taskContainers.firstOrNull { it.task.key.id == taskId }
+
+ /** Check if given `taskId` is tracked in this view */
+ fun containsTaskId(taskId: Int) = getTaskContainerById(taskId) != null
+
+ open fun setOrientationState(orientationState: RecentsOrientedState) {
+ this.orientedState = orientationState
+ taskContainers.forEach { it.iconView.setIconOrientation(orientationState, isGridTask) }
+ setThumbnailOrientation(orientationState)
+ }
+
+ protected open fun setThumbnailOrientation(orientationState: RecentsOrientedState) {
+ taskContainers.forEach {
+ it.overlay.updateOrientationState(orientationState)
+ it.digitalWellBeingToast?.initialize(it.task)
+ }
+ }
+
+ /**
+ * Updates TaskView scaling and translation required to support variable width if enabled, while
+ * ensuring TaskView fits into screen in fullscreen.
+ */
+ open fun updateTaskSize(
+ lastComputedTaskSize: Rect,
+ lastComputedGridTaskSize: Rect,
+ lastComputedCarouselTaskSize: Rect,
+ ) {
+ val thumbnailPadding = container.deviceProfile.overviewTaskThumbnailTopMarginPx
+ val taskWidth = lastComputedTaskSize.width()
+ val taskHeight = lastComputedTaskSize.height()
+ val nonGridScale: Float
+ val boxTranslationY: Float
+ val expectedWidth: Int
+ val expectedHeight: Int
+ if (container.deviceProfile.isTablet) {
+ val boxWidth: Int
+ val boxHeight: Int
+
+ // Focused task and Desktop tasks should use focusTaskRatio that is associated
+ // with the original orientation of the focused task.
+ if (isLargeTile) {
+ boxWidth = taskWidth
+ boxHeight = taskHeight
+ } else {
+ // Otherwise task is in grid, and should use lastComputedGridTaskSize.
+ boxWidth = lastComputedGridTaskSize.width()
+ boxHeight = lastComputedGridTaskSize.height()
+ }
+
+ // Bound width/height to the box size.
+ expectedWidth = boxWidth
+ expectedHeight = boxHeight + thumbnailPadding
+
+ // Scale to to fit task Rect.
+ nonGridScale =
+ if (enableGridOnlyOverview()) {
+ lastComputedCarouselTaskSize.width() / taskWidth.toFloat()
+ } else {
+ taskWidth / boxWidth.toFloat()
+ }
+
+ // Align to top of task Rect.
+ boxTranslationY = (expectedHeight - thumbnailPadding - taskHeight) / 2.0f
+ } else {
+ nonGridScale = 1f
+ boxTranslationY = 0f
+ expectedWidth = if (enableOverviewIconMenu()) taskWidth else LayoutParams.MATCH_PARENT
+ expectedHeight =
+ if (enableOverviewIconMenu()) taskHeight + thumbnailPadding
+ else LayoutParams.MATCH_PARENT
+ }
+ this.nonGridScale = nonGridScale
+ this.boxTranslationY = boxTranslationY
+ updateLayoutParams<ViewGroup.LayoutParams> {
+ width = expectedWidth
+ height = expectedHeight
+ }
+ updateThumbnailSize()
+ }
+
+ protected open fun updateThumbnailSize() {
+ // TODO(b/271468547), we should default to setting translations only on the snapshot instead
+ // of a hybrid of both margins and translations
+ taskContainers[0].snapshotView.updateLayoutParams<LayoutParams> {
+ topMargin = container.deviceProfile.overviewTaskThumbnailTopMarginPx
+ }
+ }
+
+ /** Returns the thumbnail's bounds, optionally relative to the screen. */
+ @JvmOverloads
+ open fun getThumbnailBounds(bounds: Rect, relativeToDragLayer: Boolean = false) {
+ bounds.setEmpty()
+ taskContainers.forEach {
+ val thumbnailBounds = Rect()
+ if (relativeToDragLayer) {
+ container.dragLayer.getDescendantRectRelativeToSelf(
+ it.snapshotView,
+ thumbnailBounds
+ )
+ } else {
+ thumbnailBounds.set(it.snapshotView)
+ }
+ bounds.union(thumbnailBounds)
+ }
+ }
+
+ /**
+ * See [TaskDataChanges]
+ *
+ * @param visible If this task view will be visible to the user in overview or hidden
+ */
+ fun onTaskListVisibilityChanged(visible: Boolean) {
+ onTaskListVisibilityChanged(visible, FLAG_UPDATE_ALL)
+ }
+
+ /**
+ * See [TaskDataChanges]
+ *
+ * @param visible If this task view will be visible to the user in overview or hidden
+ */
+ open fun onTaskListVisibilityChanged(visible: Boolean, @TaskDataChanges changes: Int) {
+ cancelPendingLoadTasks()
+ val recentsModel = RecentsModel.INSTANCE.get(context)
+ // These calls are no-ops if the data is already loaded, try and load the high
+ // resolution thumbnail if the state permits
+ if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL) && !enableRefactorTaskThumbnail()) {
+ taskContainers.forEach {
+ if (visible) {
+ recentsModel.thumbnailCache
+ .getThumbnailInBackground(it.task) { thumbnailData ->
+ it.task.thumbnail = thumbnailData
+ it.thumbnailViewDeprecated.setThumbnail(it.task, thumbnailData)
+ }
+ ?.also { request -> pendingThumbnailLoadRequests.add(request) }
+ } else {
+ it.thumbnailViewDeprecated.setThumbnail(null, null)
+ // Reset the task thumbnail reference as well (it will be fetched from the
+ // cache or reloaded next time we need it)
+ it.task.thumbnail = null
+ }
+ }
+ }
+ if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
+ taskContainers.forEach {
+ if (visible) {
+ recentsModel.iconCache
+ .getIconInBackground(it.task) { icon, contentDescription, title ->
+ it.task.icon = icon
+ it.task.titleDescription = contentDescription
+ it.task.title = title
+ onIconLoaded(it)
+ }
+ ?.also { request -> pendingIconLoadRequests.add(request) }
+ } else {
+ onIconUnloaded(it)
+ }
+ }
+ }
+ if (needsUpdate(changes, FLAG_UPDATE_CORNER_RADIUS)) {
+ currentFullscreenParams.updateCornerRadius(context)
+ }
+ }
+
+ protected open fun needsUpdate(@TaskDataChanges dataChange: Int, @TaskDataChanges flag: Int) =
+ (dataChange and flag) == flag
+
+ protected open fun cancelPendingLoadTasks() {
+ pendingThumbnailLoadRequests.forEach { it.cancel() }
+ pendingThumbnailLoadRequests.clear()
+ pendingIconLoadRequests.forEach { it.cancel() }
+ pendingIconLoadRequests.clear()
+ }
+
+ protected open fun onIconLoaded(taskContainer: TaskContainer) {
+ setIcon(taskContainer.iconView, taskContainer.task.icon)
+ if (enableOverviewIconMenu()) {
+ setText(taskContainer.iconView, taskContainer.task.title)
+ }
+ taskContainer.digitalWellBeingToast?.initialize(taskContainer.task)
+ }
+
+ protected open fun onIconUnloaded(taskContainer: TaskContainer) {
+ setIcon(taskContainer.iconView, null)
+ if (enableOverviewIconMenu()) {
+ setText(taskContainer.iconView, null)
+ }
+ }
+
+ protected fun setIcon(iconView: TaskViewIcon, icon: Drawable?) {
+ with(iconView) {
+ if (icon != null) {
+ setDrawable(icon)
+ setOnClickListener {
+ if (!confirmSecondSplitSelectApp()) {
+ showTaskMenu(this)
+ }
+ }
+ setOnLongClickListener {
+ requestDisallowInterceptTouchEvent(true)
+ showTaskMenu(this)
+ }
+ } else {
+ setDrawable(null)
+ setOnClickListener(null)
+ setOnLongClickListener(null)
+ }
+ }
+ }
+
+ protected fun setText(iconView: TaskViewIcon, text: CharSequence?) {
+ iconView.setText(text)
+ }
+
+ open fun refreshThumbnails(thumbnailDatas: Map<Int, ThumbnailData?>?) {
+ if (enableRefactorTaskThumbnail()) {
+ return
+ }
+
+ taskContainers.forEach {
+ val thumbnailData = thumbnailDatas?.get(it.task.key.id)
+ if (thumbnailData != null) {
+ it.thumbnailViewDeprecated.setThumbnail(it.task, thumbnailData)
+ } else {
+ it.thumbnailViewDeprecated.refresh()
+ }
+ }
+ }
+
+ private fun onClick() {
+ if (confirmSecondSplitSelectApp()) {
+ Log.d("b/310064698", "${taskIds.contentToString()} - onClick - split select is active")
+ return
+ }
+ val callbackList =
+ launchTasks()?.apply {
+ add {
+ Log.d("b/310064698", "${taskIds.contentToString()} - onClick - launchCompleted")
+ }
+ }
+ Log.d("b/310064698", "${taskIds.contentToString()} - onClick - callbackList: $callbackList")
+ container.statsLogManager
+ .logger()
+ .withItemInfo(firstItemInfo)
+ .log(LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP)
+ }
+
+ /**
+ * Starts the task associated with this view and animates the startup.
+ *
+ * @return CompletionStage to indicate the animation completion or null if the launch failed.
+ */
+ open fun launchTaskAnimated(): RunnableList? {
+ TestLogging.recordEvent(
+ TestProtocol.SEQUENCE_MAIN,
+ "startActivityFromRecentsAsync",
+ taskIds.contentToString()
+ )
+ val opts =
+ container.getActivityLaunchOptions(this, null).apply {
+ options.launchDisplayId = display?.displayId ?: Display.DEFAULT_DISPLAY
+ }
+ if (
+ ActivityManagerWrapper.getInstance()
+ .startActivityFromRecents(taskContainers[0].task.key, opts.options)
+ ) {
+ Log.d(
+ TAG,
+ "launchTaskAnimated - startActivityFromRecents: ${taskIds.contentToString()}"
+ )
+ ActiveGestureLog.INSTANCE.trackEvent(
+ ActiveGestureErrorDetector.GestureEvent.EXPECTING_TASK_APPEARED
+ )
+ val recentsView = recentsView ?: return null
+ if (recentsView.runningTaskViewId != -1) {
+ recentsView.onTaskLaunchedInLiveTileMode()
+
+ // Return a fresh callback in the live tile case, so that it's not accidentally
+ // triggered by QuickstepTransitionManager.AppLaunchAnimationRunner.
+ return RunnableList().also { recentsView.addSideTaskLaunchCallback(it) }
+ }
+ if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
+ // If the recents transition is running (ie. in live tile mode), then the start
+ // of a new task will merge into the existing transition and it currently will
+ // not be run independently, so we need to rely on the onTaskAppeared() call
+ // for the new task to trigger the side launch callback to flush this runnable
+ // list (which is usually flushed when the app launch animation finishes)
+ recentsView.addSideTaskLaunchCallback(opts.onEndCallback)
+ }
+ return opts.onEndCallback
+ } else {
+ notifyTaskLaunchFailed()
+ return null
+ }
+ }
+
+ /** Starts the task associated with this view without any animation */
+ fun launchTask(callback: (launched: Boolean) -> Unit) {
+ launchTask(callback, isQuickSwitch = false)
+ }
+
+ /** Starts the task associated with this view without any animation */
+ open fun launchTask(callback: (launched: Boolean) -> Unit, isQuickSwitch: Boolean) {
+ TestLogging.recordEvent(
+ TestProtocol.SEQUENCE_MAIN,
+ "startActivityFromRecentsAsync",
+ taskIds.contentToString()
+ )
+ val firstContainer = taskContainers[0]
+ val failureListener = TaskRemovedDuringLaunchListener(context.applicationContext)
+ if (isQuickSwitch) {
+ // We only listen for failures to launch in quickswitch because the during this
+ // gesture launcher is in the background state, vs other launches which are in
+ // the actual overview state
+ failureListener.register(container, firstContainer.task.key.id) {
+ notifyTaskLaunchFailed()
+ recentsView?.let {
+ // Disable animations for now, as it is an edge case and the app usually
+ // covers launcher and also any state transition animation also gets
+ // clobbered by QuickstepTransitionManager.createWallpaperOpenAnimations
+ // when launcher shows again
+ it.startHome(false /* animated */)
+ // LauncherTaskbarUIController depends on the launcher state when
+ // checking whether to handle resume, but that can come in before
+ // startHome() changes the state, so force-refresh here to ensure the
+ // taskbar is updated
+ it.mSizeStrategy.taskbarController?.refreshResumedState()
+ }
+ }
+ }
+ // Indicate success once the system has indicated that the transition has started
+ val opts =
+ ActivityOptions.makeCustomTaskAnimation(
+ context,
+ 0,
+ 0,
+ Executors.MAIN_EXECUTOR.handler,
+ { callback(true) }
+ ) {
+ failureListener.onTransitionFinished()
+ }
+ .apply {
+ launchDisplayId = display?.displayId ?: Display.DEFAULT_DISPLAY
+ if (isQuickSwitch) {
+ setFreezeRecentTasksReordering()
+ }
+ // TODO(b/334826842) no work required - add splash functionality to new TTV -
+ // cold start e.g. restart device. Small splash moving to bigger splash
+ disableStartingWindow = firstContainer.shouldShowSplashView
+ }
+ Executors.UI_HELPER_EXECUTOR.execute {
+ if (
+ !ActivityManagerWrapper.getInstance()
+ .startActivityFromRecents(firstContainer.task.key, opts)
+ ) {
+ // If the call to start activity failed, then post the result immediately,
+ // otherwise, wait for the animation start callback from the activity options
+ // above
+ Executors.MAIN_EXECUTOR.post {
+ notifyTaskLaunchFailed()
+ callback(false)
+ }
+ }
+ Log.d(TAG, "launchTask - startActivityFromRecents: ${taskIds.contentToString()}")
+ }
+ }
+
+ /** Launch of the current task (both live and inactive tasks) with an animation. */
+ fun launchTasks(): RunnableList? {
+ val recentsView = recentsView ?: return null
+ val remoteTargetHandles = recentsView.mRemoteTargetHandles
+ if (!isRunningTask || remoteTargetHandles == null) {
+ return launchTaskAnimated()
+ }
+ if (!isClickableAsLiveTile) {
+ Log.e(TAG, "TaskView is not clickable as a live tile; returning to home.")
+ return null
+ }
+ isClickableAsLiveTile = false
+ val targets =
+ if (remoteTargetHandles.size == 1) {
+ remoteTargetHandles[0].transformParams.targetSet
+ } else {
+ val apps =
+ remoteTargetHandles.flatMap { it.transformParams.targetSet.apps.asIterable() }
+ val wallpapers =
+ remoteTargetHandles.flatMap {
+ it.transformParams.targetSet.wallpapers.asIterable()
+ }
+ RemoteAnimationTargets(
+ apps.toTypedArray(),
+ wallpapers.toTypedArray(),
+ remoteTargetHandles[0].transformParams.targetSet.nonApps,
+ remoteTargetHandles[0].transformParams.targetSet.targetMode
+ )
+ }
+ if (targets == null) {
+ // If the recents animation is cancelled somehow between the parent if block and
+ // here, try to launch the task as a non live tile task.
+ val runnableList = launchTaskAnimated()
+ if (runnableList == null) {
+ Log.e(
+ TAG,
+ "Recents animation cancelled and cannot launch task as non-live tile" +
+ "; returning to home"
+ )
+ }
+ isClickableAsLiveTile = true
+ return runnableList
+ }
+ TestLogging.recordEvent(
+ TestProtocol.SEQUENCE_MAIN,
+ "composeRecentsLaunchAnimator",
+ taskIds.contentToString()
+ )
+ val runnableList = RunnableList()
+ with(AnimatorSet()) {
+ TaskViewUtils.composeRecentsLaunchAnimator(
+ this,
+ this@TaskView,
+ targets.apps,
+ targets.wallpapers,
+ targets.nonApps,
+ true /* launcherClosing */,
+ recentsView.stateManager,
+ recentsView,
+ recentsView.depthController
+ )
+ addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animator: Animator) {
+ if (taskContainers.any { it.task.key.displayId != rootViewDisplayId }) {
+ launchTaskAnimated()
+ }
+ isClickableAsLiveTile = true
+ runEndCallback()
+ }
+
+ override fun onAnimationCancel(animation: Animator) {
+ runEndCallback()
+ }
+
+ private fun runEndCallback() {
+ runnableList.executeAllAndDestroy()
+ }
+ }
+ )
+ start()
+ }
+ Log.d(TAG, "launchTasks - composeRecentsLaunchAnimator: ${taskIds.contentToString()}")
+ recentsView.onTaskLaunchedInLiveTileMode()
+ return runnableList
+ }
+
+ private fun notifyTaskLaunchFailed() {
+ val sb = StringBuilder("Failed to launch task \n")
+ taskContainers.forEach {
+ sb.append("(task=${it.task.key.baseIntent} userId=${it.task.key.userId})\n")
+ }
+ Log.w(TAG, sb.toString())
+ Toast.makeText(context, R.string.activity_not_available, Toast.LENGTH_SHORT).show()
+ }
+
+ fun initiateSplitSelect(splitPositionOption: SplitPositionOption) {
+ recentsView?.initiateSplitSelect(
+ this,
+ splitPositionOption.stagePosition,
+ SplitConfigurationOptions.getLogEventForPosition(splitPositionOption.stagePosition)
+ )
+ }
+
+ /**
+ * Returns `true` if user is already in split select mode and this tap was to choose the second
+ * app. `false` otherwise
+ */
+ protected open fun confirmSecondSplitSelectApp(): Boolean {
+ val index = getLastSelectedChildTaskIndex()
+ if (index >= taskContainers.size) {
+ return false
+ }
+ val container = taskContainers[index]
+ val recentsView = recentsView ?: return false
+ return recentsView.confirmSplitSelect(
+ this,
+ container.task,
+ container.iconView.drawable,
+ container.snapshotView,
+ container.splitAnimationThumbnail,
+ /* intent */ null,
+ /* user */ null,
+ container.itemInfo
+ )
+ }
+
+ /**
+ * Returns the task index of the last selected child task (0 or 1). If we contain multiple tasks
+ * and this TaskView is used as part of split selection, the selected child task index will be
+ * that of the remaining task.
+ */
+ protected open fun getLastSelectedChildTaskIndex() = 0
+
+ private fun showTaskMenu(iconView: TaskViewIcon): Boolean {
+ val recentsView = recentsView ?: return false
+ if (!recentsView.canLaunchFullscreenTask()) {
+ // Don't show menu when selecting second split screen app
+ return true
+ }
+ if (!container.deviceProfile.isTablet && !recentsView.isClearAllHidden) {
+ recentsView.snapToPage(recentsView.indexOfChild(this))
+ return false
+ }
+ val menuContainer = taskContainers.firstOrNull { it.iconView === iconView } ?: return false
+ container.statsLogManager
+ .logger()
+ .withItemInfo(menuContainer.itemInfo)
+ .log(LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS)
+ return showTaskMenuWithContainer(menuContainer)
+ }
+
+ private fun showTaskMenuWithContainer(menuContainer: TaskContainer): Boolean {
+ val recentsView = recentsView ?: return false
+ if (enableHoverOfChildElementsInTaskview()) {
+ // Disable hover on all TaskView's whilst menu is showing.
+ recentsView.setTaskBorderEnabled(false)
+ }
+ return if (enableOverviewIconMenu() && menuContainer.iconView is IconAppChipView) {
+ menuContainer.iconView.revealAnim(/* isRevealing= */ true)
+ TaskMenuView.showForTask(menuContainer) {
+ menuContainer.iconView.revealAnim(/* isRevealing= */ false)
+ if (enableHoverOfChildElementsInTaskview()) {
+ recentsView.setTaskBorderEnabled(true)
+ }
+ }
+ } else if (container.deviceProfile.isTablet) {
+ val alignedOptionIndex =
+ if (
+ recentsView.isOnGridBottomRow(menuContainer.taskView) &&
+ container.deviceProfile.isLandscape
+ ) {
+ if (enableGridOnlyOverview()) {
+ // With no focused task, there is less available space below the tasks, so
+ // align the arrow to the third option in the menu.
+ 2
+ } else {
+ // Bottom row of landscape grid aligns arrow to second option to avoid
+ // clipping
+ 1
+ }
+ } else {
+ 0
+ }
+ TaskMenuViewWithArrow.showForTask(menuContainer, alignedOptionIndex) {
+ if (enableHoverOfChildElementsInTaskview()) {
+ recentsView.setTaskBorderEnabled(true)
+ }
+ }
+ } else {
+ TaskMenuView.showForTask(menuContainer) {
+ if (enableHoverOfChildElementsInTaskview()) {
+ recentsView.setTaskBorderEnabled(true)
+ }
+ }
+ }
+ }
+
+ /**
+ * Whether the taskview should take the touch event from parent. Events passed to children that
+ * might require special handling.
+ */
+ open fun offerTouchToChildren(event: MotionEvent): Boolean {
+ taskContainers.forEach {
+ if (event.action == MotionEvent.ACTION_DOWN) {
+ computeAndSetIconTouchDelegate(it.iconView, tempCoordinates, it.iconTouchDelegate)
+ if (it.iconTouchDelegate.onTouchEvent(event)) {
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ private fun computeAndSetIconTouchDelegate(
+ view: TaskViewIcon,
+ tempCenterCoordinates: FloatArray,
+ transformingTouchDelegate: TransformingTouchDelegate,
+ ) {
+ val viewHalfWidth = view.width / 2f
+ val viewHalfHeight = view.height / 2f
+ Utilities.getDescendantCoordRelativeToAncestor(
+ view.asView(),
+ container.dragLayer,
+ tempCenterCoordinates.apply {
+ this[0] = viewHalfWidth
+ this[1] = viewHalfHeight
+ },
+ false
+ )
+ transformingTouchDelegate.setBounds(
+ (tempCenterCoordinates[0] - viewHalfWidth).toInt(),
+ (tempCenterCoordinates[1] - viewHalfHeight).toInt(),
+ (tempCenterCoordinates[0] + viewHalfWidth).toInt(),
+ (tempCenterCoordinates[1] + viewHalfHeight).toInt()
+ )
+ }
+
+ /** Sets up an on-click listener and the visibility for show_windows icon on top of the task. */
+ open fun setUpShowAllInstancesListener() {
+ taskContainers.forEach {
+ it.showWindowsView?.let { showWindowsView ->
+ updateFilterCallback(
+ showWindowsView,
+ getFilterUpdateCallback(it.task.key.packageName)
+ )
+ }
+ }
+ }
+
+ /**
+ * Returns a callback that updates the state of the filter and the recents overview
+ *
+ * @param taskPackageName package name of the task to filter by
+ */
+ private fun getFilterUpdateCallback(taskPackageName: String?) =
+ if (recentsView?.filterState?.shouldShowFilterUI(taskPackageName) == true)
+ OnClickListener { recentsView?.setAndApplyFilter(taskPackageName) }
+ else null
+
+ /**
+ * Sets the correct visibility and callback on the provided filterView based on whether the
+ * callback is null or not
+ */
+ private fun updateFilterCallback(filterView: View, callback: OnClickListener?) {
+ // Filtering changes alpha instead of the visibility since visibility
+ // can be altered separately through RecentsView#resetFromSplitSelectionState()
+ with(filterView) {
+ alpha = if (callback == null) 0f else 1f
+ setOnClickListener(callback)
+ }
+ }
+
+ /**
+ * Called to animate a smooth transition when going directly from an app into Overview (and vice
+ * versa). Icons fade in, and DWB banners slide in with a "shift up" animation.
+ */
+ private fun onFocusTransitionProgressUpdated(focusTransitionProgress: Float) {
+ taskContainers.forEach {
+ it.iconView.setContentAlpha(focusTransitionProgress)
+ it.digitalWellBeingToast?.bannerOffsetPercentage = 1f - focusTransitionProgress
+ }
+ }
+
+ fun animateIconScaleAndDimIntoView() {
+ iconAndDimAnimator?.cancel()
+ iconAndDimAnimator =
+ ObjectAnimator.ofFloat(focusTransitionScaleAndDim, MULTI_PROPERTY_VALUE, 0f, 1f).apply {
+ duration = SCALE_ICON_DURATION
+ interpolator = Interpolators.LINEAR
+ addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ iconAndDimAnimator = null
+ }
+ }
+ )
+ start()
+ }
+ }
+
+ fun setIconScaleAndDim(iconScale: Float) {
+ iconAndDimAnimator?.cancel()
+ focusTransitionScaleAndDim.value = iconScale
+ }
+
+ /** Set a color tint on the snapshot and supporting views. */
+ open fun setColorTint(amount: Float, tintColor: Int) {
+ taskContainers.forEach {
+ if (!enableRefactorTaskThumbnail()) {
+ it.thumbnailViewDeprecated.dimAlpha = amount
+ }
+ it.iconView.setIconColorTint(tintColor, amount)
+ it.digitalWellBeingToast?.setBannerColorTint(tintColor, amount)
+ }
+ }
+
+ /**
+ * Sets visibility for the thumbnail and associated elements (DWB banners and action chips).
+ * IconView is unaffected.
+ *
+ * @param taskId is only used when setting visibility to a non-[View.VISIBLE] value
+ */
+ open fun setThumbnailVisibility(visibility: Int, taskId: Int) {
+ taskContainers.forEach {
+ if (visibility == VISIBLE || it.task.key.id == taskId) {
+ it.snapshotView.visibility = visibility
+ it.digitalWellBeingToast?.setBannerVisibility(visibility)
+ it.showWindowsView?.visibility = visibility
+ it.overlay.setVisibility(visibility)
+ }
+ }
+ }
+
+ open fun setOverlayEnabled(overlayEnabled: Boolean) {
+ if (!enableRefactorTaskThumbnail()) {
+ taskContainers.forEach { it.setOverlayEnabled(overlayEnabled) }
+ }
+ }
+
+ protected open fun refreshTaskThumbnailSplash() {
+ if (!enableRefactorTaskThumbnail()) {
+ taskContainers.forEach { it.thumbnailViewDeprecated.refreshSplashView() }
+ }
+ }
+
+ protected fun getScrollAdjustment(gridEnabled: Boolean) =
+ if (gridEnabled) gridTranslationX else nonGridTranslationX
+
+ protected fun getOffsetAdjustment(gridEnabled: Boolean) = getScrollAdjustment(gridEnabled)
+
+ fun getSizeAdjustment(fullscreenEnabled: Boolean) = if (fullscreenEnabled) nonGridScale else 1f
+
+ private fun applyScale() {
+ val scale = persistentScale * dismissScale
+ scaleX = scale
+ scaleY = scale
+ if (enableRefactorTaskThumbnail()) {
+ taskViewModel.updateScale(scale)
+ }
+ updateSnapshotRadius()
+ }
+
+ protected open fun applyThumbnailSplashAlpha() {
+ if (!enableRefactorTaskThumbnail()) {
+ taskContainers.forEach {
+ it.thumbnailViewDeprecated.setSplashAlpha(taskThumbnailSplashAlpha)
+ }
+ }
+ }
+
+ private fun applyTranslationX() {
+ translationX =
+ dismissTranslationX +
+ taskOffsetTranslationX +
+ taskResistanceTranslationX +
+ splitSelectTranslationX +
+ gridEndTranslationX +
+ persistentTranslationX
+ }
+
+ private fun applyTranslationY() {
+ translationY =
+ dismissTranslationY +
+ taskOffsetTranslationY +
+ taskResistanceTranslationY +
+ splitSelectTranslationY +
+ persistentTranslationY
+ }
+
+ private fun onGridProgressChanged() {
+ applyTranslationX()
+ applyTranslationY()
+ applyScale()
+ }
+
+ protected open fun onFullscreenProgressChanged(fullscreenProgress: Float) {
+ taskContainers.forEach {
+ it.iconView.setVisibility(if (fullscreenProgress < 1) VISIBLE else INVISIBLE)
+ it.overlay.setFullscreenProgress(fullscreenProgress)
+ }
+ focusTransitionFullscreen.value =
+ FOCUS_TRANSITION_FAST_OUT_INTERPOLATOR.getInterpolation(1 - fullscreenProgress)
+ updateSnapshotRadius()
+ }
+
+ protected open fun updateSnapshotRadius() {
+ updateCurrentFullscreenParams()
+ taskContainers.forEach {
+ if (!enableRefactorTaskThumbnail()) {
+ it.thumbnailViewDeprecated.setFullscreenParams(getThumbnailFullscreenParams())
+ }
+ it.overlay.setFullscreenParams(getThumbnailFullscreenParams())
+ }
+ }
+
+ protected open fun updateCurrentFullscreenParams() {
+ updateFullscreenParams(currentFullscreenParams)
+ }
+
+ protected fun updateFullscreenParams(fullscreenParams: FullscreenDrawParams) {
+ recentsView?.let { fullscreenParams.setProgress(fullscreenProgress, it.scaleX, scaleX) }
+ }
+
+ protected open fun getThumbnailFullscreenParams(): FullscreenDrawParams =
+ currentFullscreenParams
+
+ private fun onModalnessUpdated(modalness: Float) {
+ taskContainers.forEach {
+ it.iconView.setModalAlpha(1 - modalness)
+ it.digitalWellBeingToast?.bannerOffsetPercentage = modalness
+ }
+ }
+
+ fun resetPersistentViewTransforms() {
+ nonGridTranslationX = 0f
+ gridTranslationX = 0f
+ gridTranslationY = 0f
+ boxTranslationY = 0f
+ nonGridPivotTranslationX = 0f
+ taskContainers.forEach {
+ it.snapshotView.translationX = 0f
+ it.snapshotView.translationY = 0f
+ }
+ resetViewTransforms()
+ }
+
+ fun getTaskContainerForTaskThumbnailView(taskThumbnailView: TaskThumbnailView): TaskContainer? =
+ taskContainers.firstOrNull { it.thumbnailView == taskThumbnailView }
+
+ open fun resetViewTransforms() {
+ // fullscreenTranslation and accumulatedTranslation should not be reset, as
+ // resetViewTransforms is called during QuickSwitch scrolling.
+ dismissTranslationX = 0f
+ taskOffsetTranslationX = 0f
+ taskResistanceTranslationX = 0f
+ splitSelectTranslationX = 0f
+ gridEndTranslationX = 0f
+ dismissTranslationY = 0f
+ taskOffsetTranslationY = 0f
+ taskResistanceTranslationY = 0f
+ if (recentsView?.isSplitSelectionActive != true) {
+ splitSelectTranslationY = 0f
+ }
+ dismissScale = 1f
+ translationZ = 0f
+ attachAlpha = 1f
+ setIconScaleAndDim(1f)
+ setColorTint(0f, 0)
+ }
+
+ private fun getGridTrans(endTranslation: Float) =
+ Utilities.mapRange(gridProgress, 0f, endTranslation)
+
+ private fun getNonGridTrans(endTranslation: Float) =
+ endTranslation - getGridTrans(endTranslation)
+
+ /** We update and subsequently draw these in [fullscreenProgress]. */
+ open class FullscreenDrawParams(context: Context) : SafeCloseable {
+ var cornerRadius = 0f
+ private var windowCornerRadius = 0f
+ var currentDrawnCornerRadius = 0f
+
+ init {
+ updateCornerRadius(context)
+ }
+
+ /** Recomputes the start and end corner radius for the given Context. */
+ fun updateCornerRadius(context: Context) {
+ cornerRadius = computeTaskCornerRadius(context)
+ windowCornerRadius = computeWindowCornerRadius(context)
+ }
+
+ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
+ open fun computeTaskCornerRadius(context: Context): Float {
+ return TaskCornerRadius.get(context)
+ }
+
+ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
+ open fun computeWindowCornerRadius(context: Context): Float {
+ val activityContext: ActivityContext? = ActivityContext.lookupContextNoThrow(context)
+
+ // The corner radius is fixed to match when Taskbar is persistent mode
+ return if (
+ activityContext != null &&
+ activityContext.deviceProfile?.isTaskbarPresent == true &&
+ DisplayController.isTransientTaskbar(context)
+ ) {
+ context.resources
+ .getDimensionPixelSize(R.dimen.persistent_taskbar_corner_radius)
+ .toFloat()
+ } else {
+ QuickStepContract.getWindowCornerRadius(context)
+ }
+ }
+
+ /** Sets the progress in range [0, 1] */
+ fun setProgress(fullscreenProgress: Float, parentScale: Float, taskViewScale: Float) {
+ currentDrawnCornerRadius =
+ Utilities.mapRange(fullscreenProgress, cornerRadius, windowCornerRadius) /
+ parentScale /
+ taskViewScale
+ }
+
+ override fun close() {}
+ }
+
+ private fun MotionEvent.isWithinThumbnailBounds(): Boolean {
+ return thumbnailBounds.contains(x.toInt(), y.toInt())
+ }
+
+ companion object {
+ private const val TAG = "TaskView"
+ const val FLAG_UPDATE_ICON = 1
+ const val FLAG_UPDATE_THUMBNAIL = FLAG_UPDATE_ICON shl 1
+ const val FLAG_UPDATE_CORNER_RADIUS = FLAG_UPDATE_THUMBNAIL shl 1
+ const val FLAG_UPDATE_ALL =
+ (FLAG_UPDATE_ICON or FLAG_UPDATE_THUMBNAIL or FLAG_UPDATE_CORNER_RADIUS)
+
+ const val FOCUS_TRANSITION_INDEX_FULLSCREEN = 0
+ const val FOCUS_TRANSITION_INDEX_SCALE_AND_DIM = 1
+ const val FOCUS_TRANSITION_INDEX_COUNT = 2
+
+ private const val ALPHA_INDEX_STABLE = 0
+ private const val ALPHA_INDEX_ATTACH = 1
+
+ private const val NUM_ALPHA_CHANNELS = 2
+
+ /** The maximum amount that a task view can be scrimmed, dimmed or tinted. */
+ const val MAX_PAGE_SCRIM_ALPHA = 0.4f
+ const val SCALE_ICON_DURATION: Long = 120
+ private const val DIM_ANIM_DURATION: Long = 700
+ private const val FOCUS_TRANSITION_THRESHOLD =
+ SCALE_ICON_DURATION.toFloat() / DIM_ANIM_DURATION
+ val FOCUS_TRANSITION_FAST_OUT_INTERPOLATOR =
+ Interpolators.clampToProgress(
+ Interpolators.FAST_OUT_SLOW_IN,
+ 1f - FOCUS_TRANSITION_THRESHOLD,
+ 1f
+ )!!
+ private val SYSTEM_GESTURE_EXCLUSION_RECT = listOf(Rect())
+
+ private val FOCUS_TRANSITION: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("focusTransition") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.focusTransitionProgress = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.focusTransitionProgress
+ }
+
+ private val SPLIT_SELECT_TRANSLATION_X: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("splitSelectTranslationX") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.splitSelectTranslationX = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.splitSelectTranslationX
+ }
+
+ private val SPLIT_SELECT_TRANSLATION_Y: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("splitSelectTranslationY") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.splitSelectTranslationY = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.splitSelectTranslationY
+ }
+
+ private val DISMISS_TRANSLATION_X: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("dismissTranslationX") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.dismissTranslationX = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.dismissTranslationX
+ }
+
+ private val DISMISS_TRANSLATION_Y: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("dismissTranslationY") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.dismissTranslationY = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.dismissTranslationY
+ }
+
+ private val TASK_OFFSET_TRANSLATION_X: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("taskOffsetTranslationX") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.taskOffsetTranslationX = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.taskOffsetTranslationX
+ }
+
+ private val TASK_OFFSET_TRANSLATION_Y: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("taskOffsetTranslationY") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.taskOffsetTranslationY = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.taskOffsetTranslationY
+ }
+
+ private val TASK_RESISTANCE_TRANSLATION_X: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("taskResistanceTranslationX") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.taskResistanceTranslationX = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.taskResistanceTranslationX
+ }
+
+ private val TASK_RESISTANCE_TRANSLATION_Y: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("taskResistanceTranslationY") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.taskResistanceTranslationY = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.taskResistanceTranslationY
+ }
+
+ @JvmField
+ val GRID_END_TRANSLATION_X: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("gridEndTranslationX") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.gridEndTranslationX = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.gridEndTranslationX
+ }
+
+ @JvmField
+ val DISMISS_SCALE: FloatProperty<TaskView> =
+ object : FloatProperty<TaskView>("dismissScale") {
+ override fun setValue(taskView: TaskView, v: Float) {
+ taskView.dismissScale = v
+ }
+
+ override fun get(taskView: TaskView) = taskView.dismissScale
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/TaskViewType.kt b/quickstep/src/com/android/quickstep/views/TaskViewType.kt
new file mode 100644
index 0000000..b2a32a9
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/TaskViewType.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.views
+
+/** Type of the [TaskView] */
+enum class TaskViewType {
+ SINGLE,
+ GROUPED,
+ DESKTOP
+}
diff --git a/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewScreenshotTest.kt b/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewScreenshotTest.kt
new file mode 100644
index 0000000..d77ac5c
--- /dev/null
+++ b/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewScreenshotTest.kt
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar.bubbles
+
+import android.app.Notification
+import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.Paint
+import android.util.PathParser
+import android.view.LayoutInflater
+import androidx.test.core.app.ApplicationProvider
+import com.android.launcher3.R
+import com.android.wm.shell.common.bubbles.BubbleInfo
+import com.google.android.apps.nexuslauncher.imagecomparison.goldenpathmanager.ViewScreenshotGoldenPathManager
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4
+import platform.test.runner.parameterized.Parameters
+import platform.test.screenshot.DeviceEmulationSpec
+import platform.test.screenshot.Displays
+import platform.test.screenshot.ViewScreenshotTestRule
+import platform.test.screenshot.getEmulatedDevicePathConfig
+
+/** Screenshot tests for [BubbleView]. */
+@RunWith(ParameterizedAndroidJunit4::class)
+class BubbleViewScreenshotTest(emulationSpec: DeviceEmulationSpec) {
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+
+ companion object {
+ @Parameters(name = "{0}")
+ @JvmStatic
+ fun getTestSpecs() =
+ DeviceEmulationSpec.forDisplays(
+ Displays.Phone,
+ isDarkTheme = false,
+ isLandscape = false
+ )
+ }
+
+ @get:Rule
+ val screenshotRule =
+ ViewScreenshotTestRule(
+ emulationSpec,
+ ViewScreenshotGoldenPathManager(getEmulatedDevicePathConfig(emulationSpec))
+ )
+
+ @Test
+ fun bubbleView_hasUnseenContent() {
+ screenshotRule.screenshotTest("bubbleView_hasUnseenContent") { activity ->
+ activity.actionBar?.hide()
+ setupBubbleView()
+ }
+ }
+
+ @Test
+ fun bubbleView_seen() {
+ screenshotRule.screenshotTest("bubbleView_seen") { activity ->
+ activity.actionBar?.hide()
+ setupBubbleView(suppressNotification = true)
+ }
+ }
+
+ @Test
+ fun bubbleView_badgeHidden() {
+ screenshotRule.screenshotTest("bubbleView_badgeHidden") { activity ->
+ activity.actionBar?.hide()
+ setupBubbleView().apply { setBadgeScale(0f) }
+ }
+ }
+
+ private fun setupBubbleView(suppressNotification: Boolean = false): BubbleView {
+ val inflater = LayoutInflater.from(context)
+
+ val iconSize = 100
+ // BubbleView uses launcher's badge to icon ratio and expects the badge image to already
+ // have the right size
+ val badgeToIconRatio = 0.444f
+ val badgeRadius = iconSize * badgeToIconRatio / 2
+ val icon = createCircleBitmap(radius = iconSize / 2, color = Color.LTGRAY)
+ val badge = createCircleBitmap(radius = badgeRadius.toInt(), color = Color.RED)
+
+ val flags =
+ if (suppressNotification) Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION else 0
+ val bubbleInfo =
+ BubbleInfo("key", flags, null, null, 0, context.packageName, null, null, false)
+ val bubbleView = inflater.inflate(R.layout.bubblebar_item_view, null) as BubbleView
+ val dotPath =
+ PathParser.createPathFromPathData(
+ context.resources.getString(com.android.internal.R.string.config_icon_mask)
+ )
+ val bubble =
+ BubbleBarBubble(bubbleInfo, bubbleView, badge, icon, Color.BLUE, dotPath, "test app")
+ bubbleView.setBubble(bubble)
+ bubbleView.showDotIfNeeded(1f)
+ return bubbleView
+ }
+
+ private fun createCircleBitmap(radius: Int, color: Int): Bitmap {
+ val bitmap = Bitmap.createBitmap(radius * 2, radius * 2, Bitmap.Config.ARGB_8888)
+ val canvas = Canvas(bitmap)
+ canvas.drawARGB(0, 0, 0, 0)
+ val paint = Paint()
+ paint.color = color
+ canvas.drawCircle(radius.toFloat(), radius.toFloat(), radius.toFloat(), paint)
+ return bitmap
+ }
+}
diff --git a/quickstep/tests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt
similarity index 79%
rename from quickstep/tests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt
index a532762..0005df6 100644
--- a/quickstep/tests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/model/QuickstepModelDelegateTest.kt
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.launcher3.model
import android.app.prediction.AppPredictor
@@ -19,7 +34,7 @@
import org.mockito.Mock
import org.mockito.Mockito.never
import org.mockito.Mockito.verify
-import org.mockito.Mockito.verifyZeroInteractions
+import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations
/** Unit tests for [QuickstepModelDelegate]. */
@@ -57,25 +72,25 @@
underTest.onAppTargetEvent(mockedAppTargetEvent, CONTAINER_PREDICTION)
verify(allAppsPredictor).notifyAppTargetEvent(mockedAppTargetEvent)
- verifyZeroInteractions(hotseatPredictor)
- verifyZeroInteractions(widgetRecommendationPredictor)
+ verifyNoMoreInteractions(hotseatPredictor)
+ verifyNoMoreInteractions(widgetRecommendationPredictor)
}
@Test
fun onWidgetPrediction_notifyWidgetRecommendationPredictor() {
underTest.onAppTargetEvent(mockedAppTargetEvent, CONTAINER_WIDGETS_PREDICTION)
- verifyZeroInteractions(allAppsPredictor)
+ verifyNoMoreInteractions(allAppsPredictor)
verify(widgetRecommendationPredictor).notifyAppTargetEvent(mockedAppTargetEvent)
- verifyZeroInteractions(hotseatPredictor)
+ verifyNoMoreInteractions(hotseatPredictor)
}
@Test
fun onHotseatPrediction_notifyHotseatPredictor() {
underTest.onAppTargetEvent(mockedAppTargetEvent, CONTAINER_HOTSEAT_PREDICTION)
- verifyZeroInteractions(allAppsPredictor)
- verifyZeroInteractions(widgetRecommendationPredictor)
+ verifyNoMoreInteractions(allAppsPredictor)
+ verifyNoMoreInteractions(widgetRecommendationPredictor)
verify(hotseatPredictor).notifyAppTargetEvent(mockedAppTargetEvent)
}
@@ -83,8 +98,8 @@
fun onOtherClient_notifyHotseatPredictor() {
underTest.onAppTargetEvent(mockedAppTargetEvent, CONTAINER_WALLPAPERS)
- verifyZeroInteractions(allAppsPredictor)
- verifyZeroInteractions(widgetRecommendationPredictor)
+ verifyNoMoreInteractions(allAppsPredictor)
+ verifyNoMoreInteractions(widgetRecommendationPredictor)
verify(hotseatPredictor).notifyAppTargetEvent(mockedAppTargetEvent)
}
diff --git a/quickstep/tests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt
similarity index 92%
rename from quickstep/tests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt
index 5c7b4ab..4ea74df 100644
--- a/quickstep/tests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/model/WidgetsPredictionsRequesterTest.kt
@@ -30,11 +30,12 @@
import com.android.launcher3.InvariantDeviceProfile
import com.android.launcher3.LauncherAppState
import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.WidgetPredictionsRequester.LAUNCH_LOCATION
import com.android.launcher3.model.WidgetPredictionsRequester.buildBundleForPredictionSession
import com.android.launcher3.model.WidgetPredictionsRequester.filterPredictions
import com.android.launcher3.model.WidgetPredictionsRequester.notOnUiSurfaceFilter
import com.android.launcher3.util.ActivityContextWrapper
-import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.util.ComponentKey
import com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
import com.google.common.truth.Truth.assertThat
@@ -62,7 +63,7 @@
private lateinit var widgetItem1b: WidgetItem
private lateinit var widgetItem2: WidgetItem
- private lateinit var allWidgets: Map<PackageUserKey, List<WidgetItem>>
+ private lateinit var allWidgets: Map<ComponentKey, WidgetItem>
@Mock private lateinit var iconCache: IconCache
@@ -93,9 +94,9 @@
allWidgets =
mapOf(
- PackageUserKey(APP_1_PACKAGE_NAME, mUserHandle) to
- listOf(widgetItem1a, widgetItem1b),
- PackageUserKey(APP_2_PACKAGE_NAME, mUserHandle) to listOf(widgetItem2),
+ ComponentKey(widgetItem1a.componentName, widgetItem1a.user) to widgetItem1a,
+ ComponentKey(widgetItem1b.componentName, widgetItem1b.user) to widgetItem1b,
+ ComponentKey(widgetItem2.componentName, widgetItem2.user) to widgetItem2,
)
}
@@ -103,7 +104,7 @@
fun buildBundleForPredictionSession_includesAddedAppWidgets() {
val existingWidgets = arrayListOf(widget1aInfo, widget1bInfo, widget2Info)
- val bundle = buildBundleForPredictionSession(existingWidgets, TEST_UI_SURFACE)
+ val bundle = buildBundleForPredictionSession(existingWidgets)
val addedWidgetsBundleExtra =
bundle.getParcelableArrayList(BUNDLE_KEY_ADDED_APP_WIDGETS, AppTarget::class.java)
@@ -156,7 +157,7 @@
}
@Test
- fun filterPredictions_appPredictions_returnsWidgetFromPackage() {
+ fun filterPredictions_appPredictions_returnsEmptyList() {
val widgetsAlreadyOnSurface = arrayListOf(widget1bInfo)
val filter: Predicate<WidgetItem> = notOnUiSurfaceFilter(widgetsAlreadyOnSurface)
@@ -176,8 +177,7 @@
),
)
- assertThat(filterPredictions(predictions, allWidgets, filter))
- .containsExactly(widgetItem1a, widgetItem2)
+ assertThat(filterPredictions(predictions, allWidgets, filter)).isEmpty()
}
private fun createWidgetItem(
@@ -214,7 +214,7 @@
.setClassName(providerClassName)
.build()
return AppTargetEvent.Builder(appTarget, AppTargetEvent.ACTION_PIN)
- .setLaunchLocation(TEST_UI_SURFACE)
+ .setLaunchLocation(LAUNCH_LOCATION)
.build()
}
}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarControllerTestUtil.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarControllerTestUtil.kt
new file mode 100644
index 0000000..a57fb70
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarControllerTestUtil.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+
+object TaskbarControllerTestUtil {
+ inline fun runOnMainSync(crossinline runTest: () -> Unit) {
+ getInstrumentation().runOnMainSync { runTest() }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarDesktopModeControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarDesktopModeControllerTest.kt
new file mode 100644
index 0000000..72bbfc9
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarDesktopModeControllerTest.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar
+
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.taskbar.TaskbarBackgroundRenderer.Companion.MAX_ROUNDNESS
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule
+import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@LauncherMultivalentJUnit.EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarDesktopModeControllerTest {
+
+ private val context =
+ TaskbarWindowSandboxContext.create(
+ InstrumentationRegistry.getInstrumentation().targetContext
+ )
+
+ @get:Rule(order = 0) val taskbarUnitTestRule = TaskbarUnitTestRule(this, context)
+
+ @TaskbarUnitTestRule.InjectController
+ lateinit var taskbarDesktopModeController: TaskbarDesktopModeController
+
+ @Test
+ fun whenTaskbarRequiresCornerRoundness_shouldReturnDefaultCornerRoundness() {
+ assertThat(taskbarDesktopModeController.getTaskbarCornerRoundness(true))
+ .isEqualTo(MAX_ROUNDNESS)
+ }
+
+ @Test
+ fun whenTaskbarRequiresCornerRoundness_shouldReturnZeroAsCornerRoundness() {
+ assertThat(taskbarDesktopModeController.getTaskbarCornerRoundness(false)).isEqualTo(0f)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarEduTooltipControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarEduTooltipControllerTest.kt
new file mode 100644
index 0000000..961d4dc
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarEduTooltipControllerTest.kt
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.test
+
+import android.util.Log
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.Utilities
+import com.android.launcher3.taskbar.TOOLTIP_STEP_FEATURES
+import com.android.launcher3.taskbar.TOOLTIP_STEP_NONE
+import com.android.launcher3.taskbar.TOOLTIP_STEP_PINNING
+import com.android.launcher3.taskbar.TOOLTIP_STEP_SWIPE
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.TaskbarControllerTestUtil.runOnMainSync
+import com.android.launcher3.taskbar.TaskbarEduTooltipController
+import com.android.launcher3.taskbar.rules.TaskbarModeRule
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.PINNED
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.THREE_BUTTONS
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.TRANSIENT
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.TaskbarMode
+import com.android.launcher3.taskbar.rules.TaskbarPinningPreferenceRule
+import com.android.launcher3.taskbar.rules.TaskbarPreferenceRule
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.android.launcher3.util.OnboardingPrefs
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+@Ignore
+class TaskbarEduTooltipControllerTest {
+
+ private val context =
+ TaskbarWindowSandboxContext.create(
+ InstrumentationRegistry.getInstrumentation().targetContext
+ )
+
+ @get:Rule(order = 0)
+ val tooltipStepPreferenceRule =
+ TaskbarPreferenceRule(
+ context,
+ OnboardingPrefs.TASKBAR_EDU_TOOLTIP_STEP.prefItem,
+ )
+
+ @get:Rule(order = 1)
+ val searchEduPreferenceRule =
+ TaskbarPreferenceRule(
+ context,
+ OnboardingPrefs.TASKBAR_SEARCH_EDU_SEEN,
+ )
+
+ @get:Rule(order = 2) val taskbarPinningPreferenceRule = TaskbarPinningPreferenceRule(context)
+
+ @get:Rule(order = 3) val taskbarModeRule = TaskbarModeRule(context)
+
+ @get:Rule(order = 4) val taskbarUnitTestRule = TaskbarUnitTestRule(this, context)
+
+ @InjectController lateinit var taskbarEduTooltipController: TaskbarEduTooltipController
+
+ private val taskbarContext: TaskbarActivityContext
+ get() = taskbarUnitTestRule.activityContext
+
+ private val wasInTestHarness = Utilities.isRunningInTestHarness()
+
+ @Before
+ fun setUp() {
+ Log.e("Taskbar", "TaskbarEduTooltipControllerTest test started")
+ Utilities.disableRunningInTestHarnessForTests()
+ }
+
+ @After
+ fun tearDown() {
+ if (wasInTestHarness) {
+ Utilities.enableRunningInTestHarnessForTests()
+ }
+ Log.e("Taskbar", "TaskbarEduTooltipControllerTest test completed")
+ }
+
+ @Test
+ @TaskbarMode(THREE_BUTTONS)
+ fun testMaybeShowSwipeEdu_whenTaskbarIsInThreeButtonMode_doesNotShowSwipeEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_SWIPE
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_SWIPE)
+ runOnMainSync { taskbarEduTooltipController.maybeShowSwipeEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_SWIPE)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowSwipeEdu_whenSwipeEduAlreadyShown_doesNotShowSwipeEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_FEATURES
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_FEATURES)
+ runOnMainSync { taskbarEduTooltipController.maybeShowSwipeEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_FEATURES)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowSwipeEdu_whenUserHasNotSeen_doesShowSwipeEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_SWIPE
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_SWIPE)
+ runOnMainSync { taskbarEduTooltipController.maybeShowSwipeEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_FEATURES)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowFeaturesEdu_whenFeatureEduAlreadyShown_doesNotShowFeatureEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_NONE
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_NONE)
+ runOnMainSync { taskbarEduTooltipController.maybeShowFeaturesEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_NONE)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowFeaturesEdu_whenUserHasNotSeen_doesShowFeatureEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_FEATURES
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_FEATURES)
+ runOnMainSync { taskbarEduTooltipController.maybeShowFeaturesEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_NONE)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(THREE_BUTTONS)
+ fun testMaybeShowPinningEdu_whenTaskbarIsInThreeButtonMode_doesNotShowPinningEdu() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_PINNING
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_PINNING)
+ runOnMainSync { taskbarEduTooltipController.maybeShowFeaturesEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_PINNING)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowPinningEdu_whenUserHasNotSeen_doesShowPinningEdu() {
+ // Test standalone pinning edu, where user has seen taskbar edu before, but not pinning edu.
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_PINNING
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_PINNING)
+ runOnMainSync { taskbarEduTooltipController.maybeShowFeaturesEdu() }
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_NONE)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testIsBeforeTooltipFeaturesStep_whenUserHasNotSeenFeatureEdu_shouldReturnTrue() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_SWIPE
+ assertThat(taskbarEduTooltipController.isBeforeTooltipFeaturesStep).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testIsBeforeTooltipFeaturesStep_whenUserHasSeenFeatureEdu_shouldReturnFalse() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_NONE
+ assertThat(taskbarEduTooltipController.isBeforeTooltipFeaturesStep).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testHide_whenTooltipIsOpen_shouldCloseTooltip() {
+ tooltipStepPreferenceRule.value = TOOLTIP_STEP_SWIPE
+ assertThat(taskbarEduTooltipController.tooltipStep).isEqualTo(TOOLTIP_STEP_SWIPE)
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ runOnMainSync { taskbarEduTooltipController.maybeShowSwipeEdu() }
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isTrue()
+ runOnMainSync { taskbarEduTooltipController.hide() }
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testMaybeShowSearchEdu_whenTaskbarIsTransient_shouldNotShowSearchEdu() {
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ runOnMainSync { taskbarEduTooltipController.init(taskbarContext.controllers) }
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+
+ @Test
+ @TaskbarMode(PINNED)
+ fun testMaybeShowSearchEdu_whenTaskbarIsPinnedAndUserHasSeenSearchEdu_shouldNotShowSearchEdu() {
+ searchEduPreferenceRule.value = true
+ assertThat(taskbarEduTooltipController.userHasSeenSearchEdu).isTrue()
+ runOnMainSync { taskbarEduTooltipController.hide() }
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ runOnMainSync { taskbarEduTooltipController.init(taskbarContext.controllers) }
+ assertThat(taskbarEduTooltipController.isTooltipOpen).isFalse()
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java
index 0f06d98..399aea6 100644
--- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java
@@ -4,6 +4,8 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_A11Y;
@@ -26,6 +28,7 @@
import android.os.Handler;
import android.view.View;
+import android.view.inputmethod.Flags;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
@@ -109,8 +112,27 @@
@Test
public void testPressImeSwitcher() {
+ mNavButtonController.init(mockTaskbarControllers);
mNavButtonController.onButtonClick(BUTTON_IME_SWITCH, mockView);
+ verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP);
+ verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS);
verify(mockSystemUiProxy, times(1)).onImeSwitcherPressed();
+ verify(mockSystemUiProxy, never()).onImeSwitcherLongPress();
+ }
+
+ @Test
+ public void testLongPressImeSwitcher() {
+ mNavButtonController.init(mockTaskbarControllers);
+ mNavButtonController.onButtonLongClick(BUTTON_IME_SWITCH, mockView);
+ verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP);
+ verify(mockSystemUiProxy, never()).onImeSwitcherPressed();
+ if (Flags.imeSwitcherRevamp()) {
+ verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS);
+ verify(mockSystemUiProxy, times(1)).onImeSwitcherLongPress();
+ } else {
+ verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS);
+ verify(mockSystemUiProxy, never()).onImeSwitcherLongPress();
+ }
}
@Test
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarViewControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarViewControllerTest.kt
new file mode 100644
index 0000000..4aac1dc
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarViewControllerTest.kt
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar
+
+import android.view.View
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.taskbar.TaskbarViewController.DIVIDER_VIEW_POSITION_OFFSET
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+/**
+ * Legend for the comments below:
+ * A: All Apps Button
+ * H: Hotseat item
+ * |: Divider
+ * R: Recent item
+ *
+ * The comments are formatted in two lines:
+ * // Items in taskbar, e.g. A | HHHHHH
+ * // Index of items relative to Hotseat: -1 -.5 012345
+ */
+class TaskbarViewControllerTest {
+
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+ @get:Rule val taskbarUnitTestRule = TaskbarUnitTestRule(this, context)
+
+ @InjectController lateinit var taskbarViewController: TaskbarViewController
+
+ @Test
+ fun testGetPositionInHotseat_allAppsButton_nonRtl() {
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ 6,
+ /* child = */ View(context),
+ /* isRtl = */ false,
+ /* isAllAppsButton = */ true,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ -1
+ )
+ // [>A<] | [HHHHHH]
+ // -1 -.5 012345
+ assertThat(position).isEqualTo(-1)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_allAppsButton_rtl() {
+ val numShownHotseatIcons = 6
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ true,
+ /* isAllAppsButton = */ true,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ -1
+ )
+ // [HHHHHH] | [>A<]
+ // 012345 5.5 6
+ assertThat(position).isEqualTo(numShownHotseatIcons)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_dividerView_notForRecents_nonRtl() {
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ 6,
+ /* child = */ View(context),
+ /* isRtl = */ false,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ true,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ -1
+ )
+ // [A] >|< [HHHHHH]
+ // -1 -.5 012345
+ assertThat(position).isEqualTo(-DIVIDER_VIEW_POSITION_OFFSET)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_dividerView_forRecents_nonRtl() {
+ val numShownHotseatIcons = 6
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ false,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ true,
+ /* isDividerForRecents = */ true,
+ /* recentTaskIndex = */ -1
+ )
+ // [A] [HHHHHH] >|< [RR]
+ // -1 012345 5.5 67
+ assertThat(position).isEqualTo(numShownHotseatIcons - DIVIDER_VIEW_POSITION_OFFSET)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_dividerView_notForRecents_rtl() {
+ val numShownHotseatIcons = 6
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ true,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ true,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ -1
+ )
+ // [HHHHHH] >|< [A]
+ // 012345 5.5 6
+ assertThat(position).isEqualTo(numShownHotseatIcons - DIVIDER_VIEW_POSITION_OFFSET)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_dividerView_forRecents_rtl() {
+ val numShownHotseatIcons = 6
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ true,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ true,
+ /* isDividerForRecents = */ true,
+ /* recentTaskIndex = */ -1
+ )
+ // [HHHHHH][A] >|< [RR]
+ // 012345 6 6.5 78
+ assertThat(position).isEqualTo(numShownHotseatIcons + DIVIDER_VIEW_POSITION_OFFSET)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_recentTasks_firstRecentIndex_nonRtl() {
+ val numShownHotseatIcons = 6
+ val recentTaskIndex = 0
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ false,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ recentTaskIndex
+ )
+ // [A][HHHHHH] | [>R<R]
+ // -1 012345 5.5 6 7
+ assertThat(position).isEqualTo(numShownHotseatIcons + recentTaskIndex)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_recentTasks_secondRecentIndex_nonRtl() {
+ val numShownHotseatIcons = 6
+ val recentTaskIndex = 1
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ false,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ recentTaskIndex
+ )
+ // [A][HHHHHH] | [R>R<]
+ // -1 012345 5.5 6 7
+ assertThat(position).isEqualTo(numShownHotseatIcons + recentTaskIndex)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_recentTasks_firstRecentIndex_rtl() {
+ val numShownHotseatIcons = 6
+ val recentTaskIndex = 0
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ true,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ recentTaskIndex
+ )
+ // [HHHHHH][A] | [>R<R]
+ // 012345 6 6.5 7 8
+ assertThat(position).isEqualTo(numShownHotseatIcons + 1 + recentTaskIndex)
+ }
+
+ @Test
+ fun testGetPositionInHotseat_recentTasks_secondRecentIndex_rtl() {
+ val numShownHotseatIcons = 6
+ val recentTaskIndex = 1
+ val position =
+ taskbarViewController.getPositionInHotseat(
+ /* numShownHotseatIcons = */ numShownHotseatIcons,
+ /* child = */ View(context),
+ /* isRtl = */ true,
+ /* isAllAppsButton = */ false,
+ /* isTaskbarDividerView = */ false,
+ /* isDividerForRecents = */ false,
+ /* recentTaskIndex = */ recentTaskIndex
+ )
+ // [HHHHHH][A] | [R>R<]
+ // 012345 6 6.5 7 8
+ assertThat(position).isEqualTo(numShownHotseatIcons + 1 + recentTaskIndex)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsControllerTest.kt
new file mode 100644
index 0000000..43d924a
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsControllerTest.kt
@@ -0,0 +1,218 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.allapps
+
+import android.animation.AnimatorTestRule
+import android.content.ComponentName
+import android.content.Intent
+import android.os.Process
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.BubbleTextView
+import com.android.launcher3.appprediction.PredictionRowView
+import com.android.launcher3.model.data.AppInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.notification.NotificationKeyData
+import com.android.launcher3.taskbar.TaskbarControllerTestUtil.runOnMainSync
+import com.android.launcher3.taskbar.overlay.TaskbarOverlayController
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.util.TestUtil
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarAllAppsControllerTest {
+
+ @get:Rule
+ val taskbarUnitTestRule =
+ TaskbarUnitTestRule(
+ this,
+ TaskbarWindowSandboxContext.create(getInstrumentation().targetContext),
+ )
+ @get:Rule val animatorTestRule = AnimatorTestRule(this)
+
+ @InjectController lateinit var allAppsController: TaskbarAllAppsController
+ @InjectController lateinit var overlayController: TaskbarOverlayController
+
+ @Test
+ fun testToggle_once_showsAllApps() {
+ runOnMainSync { allAppsController.toggle() }
+ assertThat(allAppsController.isOpen).isTrue()
+ }
+
+ @Test
+ fun testToggle_twice_closesAllApps() {
+ runOnMainSync {
+ allAppsController.toggle()
+ allAppsController.toggle()
+ }
+ assertThat(allAppsController.isOpen).isFalse()
+ }
+
+ @Test
+ fun testToggle_taskbarRecreated_allAppsReopened() {
+ runOnMainSync { allAppsController.toggle() }
+ taskbarUnitTestRule.recreateTaskbar()
+ assertThat(allAppsController.isOpen).isTrue()
+ }
+
+ @Test
+ fun testSetApps_beforeOpened_cachesInfo() {
+ val overlayContext =
+ TestUtil.getOnUiThread {
+ allAppsController.setApps(TEST_APPS, 0, emptyMap())
+ allAppsController.toggle()
+ overlayController.requestWindow()
+ }
+
+ assertThat(overlayContext.appsView.appsStore.apps).isEqualTo(TEST_APPS)
+ }
+
+ @Test
+ fun testSetApps_afterOpened_updatesStore() {
+ val overlayContext =
+ TestUtil.getOnUiThread {
+ allAppsController.toggle()
+ allAppsController.setApps(TEST_APPS, 0, emptyMap())
+ overlayController.requestWindow()
+ }
+
+ assertThat(overlayContext.appsView.appsStore.apps).isEqualTo(TEST_APPS)
+ }
+
+ @Test
+ fun testSetPredictedApps_beforeOpened_cachesInfo() {
+ val predictedApps =
+ TestUtil.getOnUiThread {
+ allAppsController.setPredictedApps(TEST_PREDICTED_APPS)
+ allAppsController.toggle()
+
+ overlayController
+ .requestWindow()
+ .appsView
+ .floatingHeaderView
+ .findFixedRowByType(PredictionRowView::class.java)
+ .predictedApps
+ }
+
+ assertThat(predictedApps).isEqualTo(TEST_PREDICTED_APPS)
+ }
+
+ @Test
+ fun testSetPredictedApps_afterOpened_cachesInfo() {
+ val predictedApps =
+ TestUtil.getOnUiThread {
+ allAppsController.toggle()
+ allAppsController.setPredictedApps(TEST_PREDICTED_APPS)
+
+ overlayController
+ .requestWindow()
+ .appsView
+ .floatingHeaderView
+ .findFixedRowByType(PredictionRowView::class.java)
+ .predictedApps
+ }
+
+ assertThat(predictedApps).isEqualTo(TEST_PREDICTED_APPS)
+ }
+
+ @Test
+ fun testUpdateNotificationDots_appInfo_hasDot() {
+ runOnMainSync {
+ allAppsController.setApps(TEST_APPS, 0, emptyMap())
+ allAppsController.toggle()
+ taskbarUnitTestRule.activityContext.popupDataProvider.onNotificationPosted(
+ PackageUserKey.fromItemInfo(TEST_APPS[0]),
+ NotificationKeyData("key"),
+ )
+ }
+
+ // Ensure the recycler view fully inflates before trying to grab an icon.
+ val btv =
+ TestUtil.getOnUiThread {
+ overlayController
+ .requestWindow()
+ .appsView
+ .activeRecyclerView
+ .findViewHolderForAdapterPosition(0)
+ ?.itemView as? BubbleTextView
+ }
+ assertThat(btv?.hasDot()).isTrue()
+ }
+
+ @Test
+ fun testUpdateNotificationDots_predictedApp_hasDot() {
+ runOnMainSync {
+ allAppsController.setPredictedApps(TEST_PREDICTED_APPS)
+ allAppsController.toggle()
+ taskbarUnitTestRule.activityContext.popupDataProvider.onNotificationPosted(
+ PackageUserKey.fromItemInfo(TEST_PREDICTED_APPS[0]),
+ NotificationKeyData("key"),
+ )
+ }
+
+ val btv =
+ TestUtil.getOnUiThread {
+ overlayController
+ .requestWindow()
+ .appsView
+ .floatingHeaderView
+ .findFixedRowByType(PredictionRowView::class.java)
+ .getChildAt(0) as BubbleTextView
+ }
+ assertThat(btv.hasDot()).isTrue()
+ }
+
+ @Test
+ fun testToggleSearch_searchEditTextFocused() {
+ runOnMainSync { allAppsController.toggleSearch() }
+ runOnMainSync {
+ // All Apps is now attached to window. Open animation is posted but not started.
+ }
+
+ runOnMainSync {
+ // Animation has started. Advance to end of animation.
+ animatorTestRule.advanceTimeBy(overlayController.openDuration.toLong())
+ }
+ val editText = overlayController.requestWindow().appsView.searchUiManager.editText
+ assertThat(editText?.hasFocus()).isTrue()
+ }
+
+ private companion object {
+ private val TEST_APPS =
+ Array(16) {
+ AppInfo(
+ ComponentName(
+ getInstrumentation().context,
+ "com.android.launcher3.tests.Activity$it",
+ ),
+ "Test App $it",
+ Process.myUserHandle(),
+ Intent(),
+ )
+ }
+
+ private val TEST_PREDICTED_APPS = TEST_APPS.take(4).map { WorkspaceItemInfo(it) }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarInputConsumerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarInputConsumerTest.kt
new file mode 100644
index 0000000..785ec66
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarInputConsumerTest.kt
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles
+
+import android.view.MotionEvent
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController
+import com.android.quickstep.inputconsumers.BubbleBarInputConsumer
+import com.google.common.truth.Truth.assertThat
+import java.util.Optional
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.any
+import org.mockito.kotlin.whenever
+
+/**
+ * Tests for bubble bar input consumer, namely the static method that indicates whether the input
+ * consumer should handle the event.
+ */
+@RunWith(AndroidJUnit4::class)
+class BubbleBarInputConsumerTest {
+
+ private lateinit var bubbleControllers: BubbleControllers
+
+ @Mock private lateinit var taskbarActivityContext: TaskbarActivityContext
+ @Mock private lateinit var bubbleBarController: BubbleBarController
+ @Mock private lateinit var bubbleBarViewController: BubbleBarViewController
+ @Mock private lateinit var bubbleStashController: BubbleStashController
+ @Mock private lateinit var bubbleStashedHandleViewController: BubbleStashedHandleViewController
+ @Mock private lateinit var bubbleDragController: BubbleDragController
+ @Mock private lateinit var bubbleDismissController: BubbleDismissController
+ @Mock private lateinit var bubbleBarPinController: BubbleBarPinController
+ @Mock private lateinit var bubblePinController: BubblePinController
+ @Mock private lateinit var bubbleCreator: BubbleCreator
+
+ @Mock private lateinit var motionEvent: MotionEvent
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+
+ bubbleControllers =
+ BubbleControllers(
+ bubbleBarController,
+ bubbleBarViewController,
+ bubbleStashController,
+ Optional.of(bubbleStashedHandleViewController),
+ bubbleDragController,
+ bubbleDismissController,
+ bubbleBarPinController,
+ bubblePinController,
+ bubbleCreator
+ )
+ }
+
+ @Test
+ fun testIsEventOnBubbles_noTaskbarActivityContext() {
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(null, motionEvent)).isFalse()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_bubblesNotEnabled() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(false)
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isFalse()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_noBubbleControllers() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(null)
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isFalse()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_noBubbles() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(bubbleControllers)
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(false)
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isFalse()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_eventOnStashedHandle() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(bubbleControllers)
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ whenever(bubbleStashController.isStashed).thenReturn(true)
+ whenever(bubbleStashedHandleViewController.isEventOverHandle(any())).thenReturn(true)
+
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isTrue()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_eventNotOnStashedHandle() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(bubbleControllers)
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ whenever(bubbleStashController.isStashed).thenReturn(true)
+ whenever(bubbleStashedHandleViewController.isEventOverHandle(any())).thenReturn(false)
+
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isFalse()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_eventOnVisibleBubbleView() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(bubbleControllers)
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ whenever(bubbleStashController.isStashed).thenReturn(false)
+ whenever(bubbleBarViewController.isBubbleBarVisible).thenReturn(true)
+ whenever(bubbleBarViewController.isEventOverBubbleBar(any())).thenReturn(true)
+
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isTrue()
+ }
+
+ @Test
+ fun testIsEventOnBubbles_eventNotOnVisibleBubbleView() {
+ whenever(taskbarActivityContext.isBubbleBarEnabled).thenReturn(true)
+ whenever(taskbarActivityContext.bubbleControllers).thenReturn(bubbleControllers)
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ whenever(bubbleStashController.isStashed).thenReturn(false)
+ whenever(bubbleBarViewController.isBubbleBarVisible).thenReturn(true)
+ whenever(bubbleBarViewController.isEventOverBubbleBar(any())).thenReturn(false)
+
+ assertThat(BubbleBarInputConsumer.isEventOnBubbles(taskbarActivityContext, motionEvent))
+ .isFalse()
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewTest.kt
new file mode 100644
index 0000000..8bad3b9
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/BubbleViewTest.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.Path
+import android.graphics.drawable.ColorDrawable
+import android.view.LayoutInflater
+import androidx.core.graphics.drawable.toBitmap
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.R
+import com.android.wm.shell.common.bubbles.BubbleInfo
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class BubbleViewTest {
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+ private lateinit var bubbleView: BubbleView
+ private lateinit var overflowView: BubbleView
+ private lateinit var bubble: BubbleBarBubble
+
+ @Test
+ fun hasUnseenContent_bubble() {
+ setupBubbleViews()
+ assertThat(bubbleView.hasUnseenContent()).isTrue()
+
+ bubbleView.markSeen()
+ assertThat(bubbleView.hasUnseenContent()).isFalse()
+ }
+
+ @Test
+ fun hasUnseenContent_overflow() {
+ setupBubbleViews()
+ assertThat(overflowView.hasUnseenContent()).isFalse()
+ }
+
+ private fun setupBubbleViews() {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ val inflater = LayoutInflater.from(context)
+
+ val bitmap = ColorDrawable(Color.WHITE).toBitmap(width = 20, height = 20)
+ overflowView = inflater.inflate(R.layout.bubblebar_item_view, null, false) as BubbleView
+ overflowView.setOverflow(BubbleBarOverflow(overflowView), bitmap)
+
+ val bubbleInfo =
+ BubbleInfo("key", 0, null, null, 0, context.packageName, null, null, false)
+ bubbleView = inflater.inflate(R.layout.bubblebar_item_view, null, false) as BubbleView
+ bubble =
+ BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "")
+ bubbleView.setBubble(bubble)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ }
+}
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/bubbles/OWNERS b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/OWNERS
similarity index 100%
rename from quickstep/tests/src/com/android/launcher3/taskbar/bubbles/OWNERS
rename to quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/OWNERS
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimatorTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimatorTest.kt
new file mode 100644
index 0000000..d5a76a2
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleAnimatorTest.kt
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.animation
+
+import androidx.core.animation.AnimatorTestRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class BubbleAnimatorTest {
+
+ @get:Rule val animatorTestRule = AnimatorTestRule()
+
+ private lateinit var bubbleAnimator: BubbleAnimator
+
+ @Test
+ fun animateNewBubble_isRunning() {
+ bubbleAnimator =
+ BubbleAnimator(
+ iconSize = 40f,
+ expandedBarIconSpacing = 10f,
+ bubbleCount = 5,
+ onLeft = false
+ )
+ val listener = TestBubbleAnimatorListener()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ bubbleAnimator.animateNewBubble(selectedBubbleIndex = 2, listener)
+ }
+
+ assertThat(bubbleAnimator.isRunning).isTrue()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+ assertThat(bubbleAnimator.isRunning).isFalse()
+ }
+
+ @Test
+ fun animateRemovedBubble_isRunning() {
+ bubbleAnimator =
+ BubbleAnimator(
+ iconSize = 40f,
+ expandedBarIconSpacing = 10f,
+ bubbleCount = 5,
+ onLeft = false
+ )
+ val listener = TestBubbleAnimatorListener()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ bubbleAnimator.animateRemovedBubble(
+ bubbleIndex = 2,
+ selectedBubbleIndex = 3,
+ removingLastBubble = false,
+ listener
+ )
+ }
+
+ assertThat(bubbleAnimator.isRunning).isTrue()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+ assertThat(bubbleAnimator.isRunning).isFalse()
+ }
+
+ @Test
+ fun animateNewAndRemoveOld_isRunning() {
+ bubbleAnimator =
+ BubbleAnimator(
+ iconSize = 40f,
+ expandedBarIconSpacing = 10f,
+ bubbleCount = 5,
+ onLeft = false
+ )
+ val listener = TestBubbleAnimatorListener()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ bubbleAnimator.animateNewAndRemoveOld(
+ selectedBubbleIndex = 3,
+ removedBubbleIndex = 2,
+ listener
+ )
+ }
+
+ assertThat(bubbleAnimator.isRunning).isTrue()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+ assertThat(bubbleAnimator.isRunning).isFalse()
+ }
+
+ private class TestBubbleAnimatorListener : BubbleAnimator.Listener {
+
+ override fun onAnimationUpdate(animatedFraction: Float) {}
+
+ override fun onAnimationCancel() {}
+
+ override fun onAnimationEnd() {}
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
index f46fdac..7928ce9 100644
--- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
@@ -24,6 +24,7 @@
import android.view.View
import android.view.View.VISIBLE
import android.widget.FrameLayout
+import androidx.core.animation.AnimatorTestRule
import androidx.core.graphics.drawable.toBitmap
import androidx.dynamicanimation.animation.DynamicAnimation
import androidx.test.core.app.ApplicationProvider
@@ -34,15 +35,18 @@
import com.android.launcher3.taskbar.bubbles.BubbleBarBubble
import com.android.launcher3.taskbar.bubbles.BubbleBarOverflow
import com.android.launcher3.taskbar.bubbles.BubbleBarView
-import com.android.launcher3.taskbar.bubbles.BubbleStashController
import com.android.launcher3.taskbar.bubbles.BubbleView
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController
import com.android.wm.shell.common.bubbles.BubbleInfo
import com.android.wm.shell.shared.animation.PhysicsAnimator
import com.android.wm.shell.shared.animation.PhysicsAnimatorTestUtils
import com.google.common.truth.Truth.assertThat
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.atLeastOnce
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@@ -51,62 +55,46 @@
@RunWith(AndroidJUnit4::class)
class BubbleBarViewAnimatorTest {
+ @get:Rule val animatorTestRule = AnimatorTestRule()
+
private val context = ApplicationProvider.getApplicationContext<Context>()
- private val animatorScheduler = TestBubbleBarViewAnimatorScheduler()
+ private lateinit var animatorScheduler: TestBubbleBarViewAnimatorScheduler
+ private lateinit var overflowView: BubbleView
+ private lateinit var bubbleView: BubbleView
+ private lateinit var bubble: BubbleBarBubble
+ private lateinit var bubbleBarView: BubbleBarView
+ private lateinit var bubbleStashController: BubbleStashController
+ private val onExpandedNoOp = Runnable {}
@Before
fun setUp() {
+ animatorScheduler = TestBubbleBarViewAnimatorScheduler()
PhysicsAnimatorTestUtils.prepareForTest()
}
@Test
fun animateBubbleInForStashed() {
- lateinit var overflowView: BubbleView
- lateinit var bubbleView: BubbleView
- lateinit var bubble: BubbleBarBubble
- val bubbleBarView = BubbleBarView(context)
- InstrumentationRegistry.getInstrumentation().runOnMainSync {
- bubbleBarView.layoutParams = FrameLayout.LayoutParams(0, 0)
- val inflater = LayoutInflater.from(context)
-
- val bitmap = ColorDrawable(Color.WHITE).toBitmap(width = 20, height = 20)
- overflowView =
- inflater.inflate(R.layout.bubblebar_item_view, bubbleBarView, false) as BubbleView
- overflowView.setOverflow(BubbleBarOverflow(overflowView), bitmap)
- bubbleBarView.addView(overflowView)
-
- val bubbleInfo = BubbleInfo("key", 0, null, null, 0, context.packageName, null, false)
- bubbleView =
- inflater.inflate(R.layout.bubblebar_item_view, bubbleBarView, false) as BubbleView
- bubble =
- BubbleBarBubble(bubbleInfo, bubbleView, bitmap, bitmap, Color.WHITE, Path(), "")
- bubbleView.setBubble(bubble)
- bubbleBarView.addView(bubbleView)
- }
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
-
- val bubbleStashController = mock<BubbleStashController>()
- whenever(bubbleStashController.isStashed).thenReturn(true)
- whenever(bubbleStashController.diffBetweenHandleAndBarCenters)
- .thenReturn(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS)
- whenever(bubbleStashController.stashedHandleTranslationForNewBubbleAnimation)
- .thenReturn(HANDLE_TRANSLATION)
- whenever(bubbleStashController.bubbleBarTranslationYForTaskbar)
- .thenReturn(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ setUpBubbleBar()
+ setUpBubbleStashController()
val handle = View(context)
val handleAnimator = PhysicsAnimator.getInstance(handle)
- whenever(bubbleStashController.stashedHandlePhysicsAnimator).thenReturn(handleAnimator)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
val animator =
- BubbleBarViewAnimator(bubbleBarView, bubbleStashController, animatorScheduler)
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
InstrumentationRegistry.getInstrumentation().runOnMainSync {
- animator.animateBubbleInForStashed(bubble)
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
}
// let the animation start and wait for it to complete
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
assertThat(handle.alpha).isEqualTo(0)
@@ -116,29 +104,761 @@
assertThat(bubbleBarView.scaleX).isEqualTo(1)
assertThat(bubbleBarView.scaleY).isEqualTo(1)
assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
- assertThat(bubbleBarView.isAnimatingNewBubble).isTrue()
+ assertThat(animator.isAnimating).isTrue()
// execute the hide bubble animation
assertThat(animatorScheduler.delayedBlock).isNotNull()
InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!)
// let the animation start and wait for it to complete
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
assertThat(handle.alpha).isEqualTo(1)
assertThat(handle.translationY).isEqualTo(0)
assertThat(bubbleBarView.alpha).isEqualTo(0)
- assertThat(bubbleBarView.isAnimatingNewBubble).isFalse()
+ assertThat(animator.isAnimating).isFalse()
verify(bubbleStashController).stashBubbleBarImmediate()
}
@Test
fun animateBubbleInForStashed_tapAnimatingBubble() {
- lateinit var overflowView: BubbleView
- lateinit var bubbleView: BubbleView
- lateinit var bubble: BubbleBarBubble
- val bubbleBarView = BubbleBarView(context)
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // let the animation start and wait for it to complete
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ assertThat(handle.alpha).isEqualTo(0)
+ assertThat(handle.translationY)
+ .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE)
+ assertThat(bubbleBarView.scaleX).isEqualTo(1)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(animator.isAnimating).isTrue()
+
+ verify(bubbleStashController, atLeastOnce()).updateTaskbarTouchRegion()
+
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ animator.onBubbleBarTouchedWhileAnimating()
+
+ assertThat(animatorScheduler.delayedBlock).isNull()
+ assertThat(bubbleBarView.alpha).isEqualTo(1)
+ assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(animator.isAnimating).isFalse()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_touchTaskbarArea_whileShowing() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true }
+
+ handleAnimator.assertIsRunning()
+ assertThat(animator.isAnimating).isTrue()
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.onStashStateChangingWhileAnimating()
+ }
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+ assertThat(animator.isAnimating).isFalse()
+ verify(bubbleStashController).onNewBubbleAnimationInterrupted(any(), any())
+
+ // PhysicsAnimatorTestUtils posts the cancellation to the main thread so we need to wait
+ // again
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ handleAnimator.assertIsNotRunning()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_touchTaskbarArea_whileHiding() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // let the animation start and wait for it to complete
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // execute the hide bubble animation
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!)
+
+ // wait for the hide animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ handleAnimator.assertIsRunning()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.onStashStateChangingWhileAnimating()
+ }
+
+ assertThat(animator.isAnimating).isFalse()
+ verify(bubbleStashController).onNewBubbleAnimationInterrupted(any(), any())
+
+ // PhysicsAnimatorTestUtils posts the cancellation to the main thread so we need to wait
+ // again
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ handleAnimator.assertIsNotRunning()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_showAnimationCanceled() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true }
+
+ handleAnimator.assertIsRunning()
+ assertThat(animator.isAnimating).isTrue()
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ handleAnimator.cancel()
+ handleAnimator.assertIsNotRunning()
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(animatorScheduler.delayedBlock).isNull()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_autoExpanding() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = true)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ assertThat(handle.alpha).isEqualTo(0)
+ assertThat(handle.translationY)
+ .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE)
+ assertThat(bubbleBarView.scaleX).isEqualTo(1)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.isExpanded).isTrue()
+
+ // verify there is no hide animation
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_expandedWhileAnimatingIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true }
+
+ handleAnimator.assertIsRunning()
+ assertThat(animator.isAnimating).isTrue()
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // let the animation finish
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ assertThat(handle.alpha).isEqualTo(0)
+ assertThat(handle.translationY)
+ .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR)
+ verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateBubbleInForStashed_expandedWhileFullyIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleInForStashed(bubble, isExpanding = false)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ // wait for the animation to end
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ assertThat(animator.isAnimating).isTrue()
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ assertThat(handle.alpha).isEqualTo(0)
+ assertThat(handle.translationY)
+ .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR)
+ verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateToInitialState_inApp() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_TASKBAR)
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateToInitialState(bubble, isInApp = true, isExpanding = false)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ barAnimator.assertIsNotRunning()
+ assertThat(animator.isAnimating).isTrue()
+ assertThat(bubbleBarView.alpha).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
+
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!)
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.alpha).isEqualTo(0)
+ assertThat(handle.translationY).isEqualTo(0)
+ assertThat(handle.alpha).isEqualTo(1)
+
+ verify(bubbleStashController).stashBubbleBarImmediate()
+ }
+
+ @Test
+ fun animateToInitialState_inApp_autoExpanding() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_TASKBAR)
+
+ val handle = View(context)
+ val handleAnimator = PhysicsAnimator.getInstance(handle)
+ whenever(bubbleStashController.getStashedHandlePhysicsAnimator()).thenReturn(handleAnimator)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateToInitialState(bubble, isInApp = true, isExpanding = true)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ barAnimator.assertIsNotRunning()
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.alpha).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
+
+ assertThat(animatorScheduler.delayedBlock).isNull()
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateToInitialState_inHome() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateToInitialState(bubble, isInApp = false, isExpanding = false)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ barAnimator.assertIsNotRunning()
+ assertThat(animator.isAnimating).isTrue()
+ assertThat(bubbleBarView.alpha).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!)
+
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.alpha).isEqualTo(1)
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ verify(bubbleStashController).showBubbleBarImmediate()
+ }
+
+ @Test
+ fun animateToInitialState_expandedWhileAnimatingIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateToInitialState(bubble, isInApp = false, isExpanding = false)
+ }
+
+ val bubbleBarAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(bubbleBarAnimator) { true }
+
+ bubbleBarAnimator.assertIsRunning()
+ assertThat(animator.isAnimating).isTrue()
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // let the animation finish
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+ assertThat(animator.isAnimating).isFalse()
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateToInitialState_expandedWhileFullyIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateToInitialState(bubble, isInApp = false, isExpanding = false)
+ }
+
+ // wait for the animation to start
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ assertThat(animator.isAnimating).isTrue()
+ // verify the hide bubble animation is pending
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateBubbleBarForCollapsed() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpandedNoOp,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleBarForCollapsed(bubble, isExpanding = false)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ // verify we started animating
+ assertThat(animator.isAnimating).isTrue()
+
+ // advance the animation handler by the duration of the initial lift
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+
+ // the lift animation is complete; the spring back animation should start now
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ barAnimator.assertIsRunning()
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!)
+
+ assertThat(animator.isAnimating).isFalse()
+ // the bubble bar translation y should be back to its initial value
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ verify(bubbleStashController).showBubbleBarImmediate()
+ }
+
+ @Test
+ fun animateBubbleBarForCollapsed_autoExpanding() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleBarForCollapsed(bubble, isExpanding = true)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ // verify we started animating
+ assertThat(animator.isAnimating).isTrue()
+
+ // advance the animation handler by the duration of the initial lift
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+
+ // the lift animation is complete; the spring back animation should start now
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ barAnimator.assertIsRunning()
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // verify there is no hide animation
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+ assertThat(bubbleBarView.isExpanded).isTrue()
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateBubbleBarForCollapsed_expandingWhileAnimatingIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleBarForCollapsed(bubble, isExpanding = false)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ // verify we started animating
+ assertThat(animator.isAnimating).isTrue()
+
+ // advance the animation handler by the duration of the initial lift
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+
+ // the lift animation is complete; the spring back animation should start now
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ barAnimator.assertIsRunning()
+ PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(barAnimator) { true }
+
+ // verify there is a pending hide animation
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ assertThat(animator.isAnimating).isTrue()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // let the animation finish
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+ assertThat(bubbleBarView.isExpanded).isTrue()
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ @Test
+ fun animateBubbleBarForCollapsed_expandingWhileFullyIn() {
+ setUpBubbleBar()
+ setUpBubbleStashController()
+ whenever(bubbleStashController.bubbleBarTranslationY)
+ .thenReturn(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+
+ val barAnimator = PhysicsAnimator.getInstance(bubbleBarView)
+
+ var notifiedExpanded = false
+ val onExpanded = Runnable { notifiedExpanded = true }
+ val animator =
+ BubbleBarViewAnimator(
+ bubbleBarView,
+ bubbleStashController,
+ onExpanded,
+ animatorScheduler
+ )
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.animateBubbleBarForCollapsed(bubble, isExpanding = false)
+ }
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ // verify we started animating
+ assertThat(animator.isAnimating).isTrue()
+
+ // advance the animation handler by the duration of the initial lift
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animatorTestRule.advanceTimeBy(250)
+ }
+
+ // the lift animation is complete; the spring back animation should start now
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {}
+ barAnimator.assertIsRunning()
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // verify there is a pending hide animation
+ assertThat(animatorScheduler.delayedBlock).isNotNull()
+ assertThat(animator.isAnimating).isTrue()
+
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ animator.expandedWhileAnimating()
+ }
+
+ // verify that the hide animation was canceled
+ assertThat(animatorScheduler.delayedBlock).isNull()
+
+ assertThat(animator.isAnimating).isFalse()
+ assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT)
+ assertThat(bubbleBarView.isExpanded).isTrue()
+ verify(bubbleStashController).showBubbleBarImmediate()
+ assertThat(notifiedExpanded).isTrue()
+ }
+
+ private fun setUpBubbleBar() {
+ bubbleBarView = BubbleBarView(context)
InstrumentationRegistry.getInstrumentation().runOnMainSync {
bubbleBarView.layoutParams = FrameLayout.LayoutParams(0, 0)
val inflater = LayoutInflater.from(context)
@@ -149,7 +869,8 @@
overflowView.setOverflow(BubbleBarOverflow(overflowView), bitmap)
bubbleBarView.addView(overflowView)
- val bubbleInfo = BubbleInfo("key", 0, null, null, 0, context.packageName, null, false)
+ val bubbleInfo =
+ BubbleInfo("key", 0, null, null, 0, context.packageName, null, null, false)
bubbleView =
inflater.inflate(R.layout.bubblebar_item_view, bubbleBarView, false) as BubbleView
bubble =
@@ -158,52 +879,37 @@
bubbleBarView.addView(bubbleView)
}
InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ }
- val bubbleStashController = mock<BubbleStashController>()
+ private fun setUpBubbleStashController() {
+ bubbleStashController = mock<BubbleStashController>()
whenever(bubbleStashController.isStashed).thenReturn(true)
- whenever(bubbleStashController.diffBetweenHandleAndBarCenters)
+ whenever(bubbleStashController.getDiffBetweenHandleAndBarCenters())
.thenReturn(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS)
- whenever(bubbleStashController.stashedHandleTranslationForNewBubbleAnimation)
+ whenever(bubbleStashController.getStashedHandleTranslationForNewBubbleAnimation())
.thenReturn(HANDLE_TRANSLATION)
whenever(bubbleStashController.bubbleBarTranslationYForTaskbar)
.thenReturn(BAR_TRANSLATION_Y_FOR_TASKBAR)
+ }
- val handle = View(context)
- val handleAnimator = PhysicsAnimator.getInstance(handle)
- whenever(bubbleStashController.stashedHandlePhysicsAnimator).thenReturn(handleAnimator)
-
- val animator =
- BubbleBarViewAnimator(bubbleBarView, bubbleStashController, animatorScheduler)
-
- InstrumentationRegistry.getInstrumentation().runOnMainSync {
- animator.animateBubbleInForStashed(bubble)
- }
-
- // let the animation start and wait for it to complete
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
- PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
-
- assertThat(handle.alpha).isEqualTo(0)
- assertThat(handle.translationY)
- .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR)
+ private fun verifyBubbleBarIsExpandedWithTranslation(ty: Float) {
assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE)
assertThat(bubbleBarView.scaleX).isEqualTo(1)
assertThat(bubbleBarView.scaleY).isEqualTo(1)
- assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
- assertThat(bubbleBarView.isAnimatingNewBubble).isTrue()
+ assertThat(bubbleBarView.translationY).isEqualTo(ty)
+ assertThat(bubbleBarView.isExpanded).isTrue()
+ }
- verify(bubbleStashController).updateTaskbarTouchRegion()
+ private fun <T> PhysicsAnimator<T>.assertIsRunning() {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ assertThat(isRunning()).isTrue()
+ }
+ }
- // verify the hide bubble animation is pending
- assertThat(animatorScheduler.delayedBlock).isNotNull()
-
- animator.onBubbleClickedWhileAnimating()
-
- assertThat(animatorScheduler.delayedBlock).isNull()
- assertThat(bubbleBarView.alpha).isEqualTo(1)
- assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE)
- assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR)
- assertThat(bubbleBarView.isAnimatingNewBubble).isFalse()
+ private fun <T> PhysicsAnimator<T>.assertIsNotRunning() {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ assertThat(isRunning()).isFalse()
+ }
}
private class TestBubbleBarViewAnimatorScheduler : BubbleBarViewAnimator.Scheduler {
@@ -230,3 +936,4 @@
private const val DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS = -20f
private const val HANDLE_TRANSLATION = -30f
private const val BAR_TRANSLATION_Y_FOR_TASKBAR = -50f
+private const val BAR_TRANSLATION_Y_FOR_HOTSEAT = -40f
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashControllerTest.kt
new file mode 100644
index 0000000..c0a5dfa
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/PersistentBubbleStashControllerTest.kt
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import android.animation.AnimatorTestRule
+import android.content.Context
+import android.widget.FrameLayout
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.anim.AnimatedFloat
+import com.android.launcher3.taskbar.TaskbarInsetsController
+import com.android.launcher3.taskbar.bubbles.BubbleBarView
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
+import com.android.launcher3.util.MultiValueAlpha
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.clearInvocations
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+/** Unit tests for [PersistentBubbleStashController]. */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class PersistentBubbleStashControllerTest {
+
+ companion object {
+ const val BUBBLE_BAR_HEIGHT = 100f
+ const val HOTSEAT_TRANSLATION_Y = -45f
+ const val TASK_BAR_TRANSLATION_Y = -5f
+ }
+
+ @get:Rule val animatorTestRule: AnimatorTestRule = AnimatorTestRule(this)
+
+ @get:Rule val rule: MockitoRule = MockitoJUnit.rule()
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+ private lateinit var bubbleBarView: BubbleBarView
+
+ @Mock lateinit var bubbleBarViewController: BubbleBarViewController
+
+ @Mock lateinit var taskbarInsetsController: TaskbarInsetsController
+
+ private lateinit var persistentTaskBarStashController: PersistentBubbleStashController
+ private lateinit var translationY: AnimatedFloat
+ private lateinit var scale: AnimatedFloat
+ private lateinit var alpha: MultiValueAlpha
+
+ @Before
+ fun setUp() {
+ persistentTaskBarStashController =
+ PersistentBubbleStashController(DefaultDimensionsProvider())
+ setUpBubbleBarView()
+ setUpBubbleBarController()
+ persistentTaskBarStashController.init(
+ taskbarInsetsController,
+ bubbleBarViewController,
+ null,
+ ImmediateAction()
+ )
+ }
+
+ @Test
+ fun setBubblesShowingOnHomeUpdatedToFalse_barPositionYUpdated_controllersNotified() {
+ // Given bubble bar is on home and has bubbles
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(false)
+ persistentTaskBarStashController.isBubblesShowingOnHome = true
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ // When switch out of the home screen
+ getInstrumentation().runOnMainSync {
+ persistentTaskBarStashController.isBubblesShowingOnHome = false
+ }
+
+ // Then translation Y is animating and the bubble bar controller is notified
+ assertThat(translationY.isAnimating).isTrue()
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_TRANSLATION_DURATION)
+ // Check translation Y is correct and the insets controller is notified
+ assertThat(bubbleBarView.translationY).isEqualTo(TASK_BAR_TRANSLATION_Y)
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun setBubblesShowingOnHomeUpdatedToTrue_barPositionYUpdated_controllersNotified() {
+ // Given bubble bar has bubbles
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ // When switch to home screen
+ getInstrumentation().runOnMainSync {
+ persistentTaskBarStashController.isBubblesShowingOnHome = true
+ }
+
+ // Then translation Y is animating and the bubble bar controller is notified
+ assertThat(translationY.isAnimating).isTrue()
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_TRANSLATION_DURATION)
+
+ // Check translation Y is correct and the insets controller is notified
+ assertThat(bubbleBarView.translationY).isEqualTo(HOTSEAT_TRANSLATION_Y)
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun setBubblesShowingOnOverviewUpdatedToFalse_controllersNotified() {
+ // Given bubble bar is on overview
+ persistentTaskBarStashController.isBubblesShowingOnOverview = true
+ clearInvocations(bubbleBarViewController)
+
+ // When switch out of the overview screen
+ persistentTaskBarStashController.isBubblesShowingOnOverview = false
+
+ // Then bubble bar controller is notified
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ @Test
+ fun setBubblesShowingOnOverviewUpdatedToTrue_controllersNotified() {
+ // When switch to the overview screen
+ persistentTaskBarStashController.isBubblesShowingOnOverview = true
+
+ // Then bubble bar controller is notified
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+ }
+
+ @Test
+ fun isSysuiLockedSwitchedToFalseForOverview_unlockAnimationIsShown() {
+ // Given screen is locked and bubble bar has bubbles
+ persistentTaskBarStashController.isSysuiLocked = true
+ persistentTaskBarStashController.isBubblesShowingOnOverview = true
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ // When switch to the overview screen
+ getInstrumentation().runOnMainSync {
+ persistentTaskBarStashController.isSysuiLocked = false
+ }
+
+ // Then
+ assertThat(translationY.isAnimating).isTrue()
+ assertThat(scale.isAnimating).isTrue()
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_STASH_DURATION)
+
+ // Then bubble bar is fully visible at the correct location
+ assertThat(bubbleBarView.scaleX).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1f)
+ assertThat(bubbleBarView.translationY).isEqualTo(TASK_BAR_TRANSLATION_Y)
+ assertThat(bubbleBarView.alpha).isEqualTo(1f)
+ // Insets controller is notified
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun showBubbleBarImmediateToY() {
+ // Given bubble bar is fully transparent and scaled to 0 at 0 y position
+ val targetY = 341f
+ bubbleBarView.alpha = 0f
+ bubbleBarView.scaleX = 0f
+ bubbleBarView.scaleY = 0f
+ bubbleBarView.translationY = 0f
+
+ // When
+ persistentTaskBarStashController.showBubbleBarImmediate(targetY)
+
+ // Then all property values are updated
+ assertThat(bubbleBarView.translationY).isEqualTo(targetY)
+ assertThat(bubbleBarView.alpha).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleX).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1f)
+ }
+
+ @Test
+ fun isTransientTaskbar_false() {
+ assertThat(persistentTaskBarStashController.isTransientTaskBar).isFalse()
+ }
+
+ @Test
+ fun hasHandleView_false() {
+ assertThat(persistentTaskBarStashController.hasHandleView).isFalse()
+ }
+
+ @Test
+ fun isStashed_false() {
+ assertThat(persistentTaskBarStashController.isStashed).isFalse()
+ }
+
+ @Test
+ fun bubbleBarTranslationYForTaskbar() {
+ // Give bubble bar is on home
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(false)
+ persistentTaskBarStashController.isBubblesShowingOnHome = true
+
+ // Then bubbleBarTranslationY would be HOTSEAT_TRANSLATION_Y
+ assertThat(persistentTaskBarStashController.bubbleBarTranslationY)
+ .isEqualTo(HOTSEAT_TRANSLATION_Y)
+
+ // Give bubble bar is not on home
+ persistentTaskBarStashController.isBubblesShowingOnHome = false
+
+ // Then bubbleBarTranslationY would be TASK_BAR_TRANSLATION_Y
+ assertThat(persistentTaskBarStashController.bubbleBarTranslationY)
+ .isEqualTo(TASK_BAR_TRANSLATION_Y)
+ }
+
+ private fun advanceTimeBy(advanceMs: Long) {
+ // Advance animator for on-device tests
+ getInstrumentation().runOnMainSync { animatorTestRule.advanceTimeBy(advanceMs) }
+ }
+
+ private fun setUpBubbleBarView() {
+ getInstrumentation().runOnMainSync {
+ bubbleBarView = BubbleBarView(context)
+ bubbleBarView.layoutParams = FrameLayout.LayoutParams(0, 0)
+ }
+ }
+
+ private fun setUpBubbleBarController() {
+ translationY = AnimatedFloat(Runnable { bubbleBarView.translationY = translationY.value })
+ scale =
+ AnimatedFloat(
+ Runnable {
+ val scale: Float = scale.value
+ bubbleBarView.scaleX = scale
+ bubbleBarView.scaleY = scale
+ }
+ )
+ alpha = MultiValueAlpha(bubbleBarView, 1 /* num alpha channels */)
+
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+ whenever(bubbleBarViewController.bubbleBarTranslationY).thenReturn(translationY)
+ whenever(bubbleBarViewController.bubbleBarScale).thenReturn(scale)
+ whenever(bubbleBarViewController.bubbleBarAlpha).thenReturn(alpha)
+ whenever(bubbleBarViewController.bubbleBarCollapsedHeight).thenReturn(BUBBLE_BAR_HEIGHT)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/StashingTestUtils.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/StashingTestUtils.kt
new file mode 100644
index 0000000..0f8a2c3
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/StashingTestUtils.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+class ImmediateAction : BubbleStashController.ControllersAfterInitAction {
+ override fun runAfterInit(action: Runnable) = action.run()
+}
+
+class DefaultDimensionsProvider(
+ private val taskBarBottomSpace: Int = TASKBAR_BOTTOM_SPACE,
+ private val taskBarHeight: Int = TASKBAR_HEIGHT,
+ private val hotseatBottomSpace: Int = HOTSEAT_BOTTOM_SPACE,
+ private val hotseatHeight: Int = HOTSEAT_HEIGHT
+) : BubbleStashController.TaskbarHotseatDimensionsProvider {
+ override fun getTaskbarBottomSpace(): Int = taskBarBottomSpace
+
+ override fun getTaskbarHeight(): Int = taskBarHeight
+
+ override fun getHotseatBottomSpace(): Int = hotseatBottomSpace
+
+ override fun getHotseatHeight(): Int = hotseatHeight
+
+ companion object {
+ const val TASKBAR_BOTTOM_SPACE = 0
+ const val TASKBAR_HEIGHT = 110
+ const val HOTSEAT_BOTTOM_SPACE = 20
+ const val HOTSEAT_HEIGHT = 150
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt
new file mode 100644
index 0000000..b5809c2
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt
@@ -0,0 +1,336 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.bubbles.stashing
+
+import android.animation.AnimatorTestRule
+import android.content.Context
+import android.view.View
+import android.widget.FrameLayout
+import androidx.dynamicanimation.animation.DynamicAnimation
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.anim.AnimatedFloat
+import com.android.launcher3.taskbar.StashedHandleView
+import com.android.launcher3.taskbar.TaskbarInsetsController
+import com.android.launcher3.taskbar.bubbles.BubbleBarView
+import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
+import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController
+import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.STASHED_BAR_SCALE
+import com.android.launcher3.util.MultiValueAlpha
+import com.android.wm.shell.shared.animation.PhysicsAnimator
+import com.android.wm.shell.shared.animation.PhysicsAnimatorTestUtils
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.any
+import org.mockito.kotlin.atLeastOnce
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+/** Unit tests for [TransientBubbleStashController]. */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class TransientBubbleStashControllerTest {
+
+ companion object {
+ const val TASKBAR_BOTTOM_SPACE = 5
+ const val BUBBLE_BAR_HEIGHT = 100f
+ const val HOTSEAT_TRANSLATION_Y = -45f
+ const val TASK_BAR_TRANSLATION_Y = -TASKBAR_BOTTOM_SPACE
+ const val HANDLE_VIEW_HEIGHT = 4
+ const val BUBBLE_BAR_STASHED_TRANSLATION_Y = 48
+ }
+
+ @get:Rule val animatorTestRule: AnimatorTestRule = AnimatorTestRule(this)
+
+ @get:Rule val rule: MockitoRule = MockitoJUnit.rule()
+
+ @Mock lateinit var bubbleStashedHandleViewController: BubbleStashedHandleViewController
+
+ @Mock lateinit var bubbleBarViewController: BubbleBarViewController
+
+ @Mock lateinit var taskbarInsetsController: TaskbarInsetsController
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+ private lateinit var bubbleBarView: BubbleBarView
+ private lateinit var stashedHandleView: StashedHandleView
+ private lateinit var barTranslationY: AnimatedFloat
+ private lateinit var barScale: AnimatedFloat
+ private lateinit var barAlpha: MultiValueAlpha
+ private lateinit var stashedHandleAlpha: MultiValueAlpha
+ private lateinit var stashedHandleScale: AnimatedFloat
+ private lateinit var stashedHandleTranslationY: AnimatedFloat
+ private lateinit var stashPhysicsAnimator: PhysicsAnimator<View>
+
+ private lateinit var mTransientBubbleStashController: TransientBubbleStashController
+
+ @Before
+ fun setUp() {
+ val taskbarHotseatDimensionsProvider =
+ DefaultDimensionsProvider(taskBarBottomSpace = TASKBAR_BOTTOM_SPACE)
+ mTransientBubbleStashController =
+ TransientBubbleStashController(taskbarHotseatDimensionsProvider, context.resources)
+ setUpBubbleBarView()
+ setUpBubbleBarController()
+ setUpStashedHandleView()
+ setUpBubbleStashedHandleViewController()
+ PhysicsAnimatorTestUtils.prepareForTest()
+ mTransientBubbleStashController.init(
+ taskbarInsetsController,
+ bubbleBarViewController,
+ bubbleStashedHandleViewController,
+ ImmediateAction()
+ )
+ }
+
+ @Test
+ fun setBubblesShowingOnHomeUpdatedToTrue_barPositionYUpdated_controllersNotified() {
+ // Given bubble bar is on home and has bubbles
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ // When switch out of the home screen
+ getInstrumentation().runOnMainSync {
+ mTransientBubbleStashController.isBubblesShowingOnHome = true
+ }
+
+ // Then BubbleBarView is animating, BubbleBarViewController controller is notified
+ assertThat(barTranslationY.isAnimating).isTrue()
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_TRANSLATION_DURATION)
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+ // Then translation Y is correct and the insets controller is notified
+ assertThat(barTranslationY.isAnimating).isFalse()
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ assertThat(bubbleBarView.translationY).isEqualTo(HOTSEAT_TRANSLATION_Y)
+ }
+
+ @Test
+ fun setBubblesShowingOnOverviewUpdatedToTrue_barPositionYUpdated_controllersNotified() {
+ // Given bubble bar is on home and has bubbles
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+
+ // When switch out of the home screen
+ getInstrumentation().runOnMainSync {
+ mTransientBubbleStashController.isBubblesShowingOnOverview = true
+ }
+
+ // Then BubbleBarView is animating, BubbleBarViewController controller is notified
+ assertThat(barTranslationY.isAnimating).isTrue()
+ verify(bubbleBarViewController).onBubbleBarConfigurationChanged(/* animate= */ true)
+
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_TRANSLATION_DURATION)
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+ // Then translation Y is correct and the insets controller is notified
+ assertThat(barTranslationY.isAnimating).isFalse()
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ assertThat(bubbleBarView.translationY).isEqualTo(TASK_BAR_TRANSLATION_Y)
+ }
+
+ @Test
+ fun updateStashedAndExpandedState_stashAndCollapse_bubbleBarHidden_stashedHandleShown() {
+ // Given bubble bar has bubbles and not stashed
+ mTransientBubbleStashController.isStashed = false
+ whenever(bubbleBarViewController.isHiddenForNoBubbles).thenReturn(false)
+
+ // When stash
+ getInstrumentation().runOnMainSync {
+ mTransientBubbleStashController.updateStashedAndExpandedState(
+ stash = true,
+ expand = false
+ )
+ }
+
+ // Wait until animations ends
+ advanceTimeBy(BubbleStashController.BAR_STASH_DURATION)
+ PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
+
+ // Then check BubbleBarController is notified
+ verify(bubbleBarViewController).onStashStateChanging()
+ // Bubble bar is stashed
+ assertThat(mTransientBubbleStashController.isStashed).isTrue()
+ assertThat(bubbleBarView.translationY).isEqualTo(BUBBLE_BAR_STASHED_TRANSLATION_Y)
+ assertThat(bubbleBarView.alpha).isEqualTo(0f)
+ assertThat(bubbleBarView.scaleX).isEqualTo(STASHED_BAR_SCALE)
+ assertThat(bubbleBarView.scaleY).isEqualTo(STASHED_BAR_SCALE)
+ // Handle view is visible
+ assertThat(stashedHandleView.translationY).isEqualTo(0)
+ assertThat(stashedHandleView.alpha).isEqualTo(1)
+ }
+
+ @Test
+ fun isSysuiLockedSwitchedToFalseForOverview_unlockAnimationIsShown() {
+ // Given screen is locked and bubble bar has bubbles
+ getInstrumentation().runOnMainSync {
+ mTransientBubbleStashController.isSysuiLocked = true
+ mTransientBubbleStashController.isBubblesShowingOnOverview = true
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+ }
+ advanceTimeBy(BubbleStashController.BAR_TRANSLATION_DURATION)
+
+ // When switch to the overview screen
+ getInstrumentation().runOnMainSync { mTransientBubbleStashController.isSysuiLocked = false }
+
+ // Then
+ assertThat(barTranslationY.isAnimating).isTrue()
+ assertThat(barScale.isAnimating).isTrue()
+ // Wait until animation ends
+ advanceTimeBy(BubbleStashController.BAR_STASH_DURATION)
+
+ // Then bubble bar is fully visible at the correct location
+ assertThat(bubbleBarView.scaleX).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1f)
+ assertThat(bubbleBarView.translationY)
+ .isEqualTo(PersistentBubbleStashControllerTest.TASK_BAR_TRANSLATION_Y)
+ assertThat(bubbleBarView.alpha).isEqualTo(1f)
+ // Insets controller is notified
+ verify(taskbarInsetsController, atLeastOnce())
+ .onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun showBubbleBarImmediateToY() {
+ // Given bubble bar is fully transparent and scaled to 0 at 0 y position
+ val targetY = 341f
+ bubbleBarView.alpha = 0f
+ bubbleBarView.scaleX = 0f
+ bubbleBarView.scaleY = 0f
+ bubbleBarView.translationY = 0f
+ stashedHandleView.translationY = targetY
+
+ // When
+ mTransientBubbleStashController.showBubbleBarImmediate(targetY)
+
+ // Then all property values are updated
+ assertThat(bubbleBarView.translationY).isEqualTo(targetY)
+ assertThat(bubbleBarView.alpha).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleX).isEqualTo(1f)
+ assertThat(bubbleBarView.scaleY).isEqualTo(1f)
+ // Handle is transparent
+ assertThat(stashedHandleView.alpha).isEqualTo(0)
+ // Insets controller is notified
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun stashBubbleBarImmediate() {
+ // When
+ mTransientBubbleStashController.stashBubbleBarImmediate()
+
+ // Then all property values are updated
+ assertThat(bubbleBarView.translationY).isEqualTo(BUBBLE_BAR_STASHED_TRANSLATION_Y)
+ assertThat(bubbleBarView.alpha).isEqualTo(0)
+ assertThat(bubbleBarView.scaleX).isEqualTo(STASHED_BAR_SCALE)
+ assertThat(bubbleBarView.scaleY).isEqualTo(STASHED_BAR_SCALE)
+ // Handle is visible at correct Y position
+ assertThat(stashedHandleView.alpha).isEqualTo(1)
+ assertThat(stashedHandleView.translationY).isEqualTo(0)
+ // Insets controller is notified
+ verify(taskbarInsetsController).onTaskbarOrBubblebarWindowHeightOrInsetsChanged()
+ }
+
+ @Test
+ fun getTouchableHeight_stashed_stashHeightReturned() {
+ // When
+ mTransientBubbleStashController.isStashed = true
+ val height = mTransientBubbleStashController.getTouchableHeight()
+
+ // Then
+ assertThat(height).isEqualTo(HANDLE_VIEW_HEIGHT)
+ }
+
+ @Test
+ fun getTouchableHeight_unstashed_barHeightReturned() {
+ // When BubbleBar is not stashed
+ mTransientBubbleStashController.isStashed = false
+ val height = mTransientBubbleStashController.getTouchableHeight()
+
+ // Then bubble bar height is returned
+ assertThat(height).isEqualTo(BUBBLE_BAR_HEIGHT.toInt())
+ }
+
+ private fun advanceTimeBy(advanceMs: Long) {
+ // Advance animator for on-device tests
+ getInstrumentation().runOnMainSync { animatorTestRule.advanceTimeBy(advanceMs) }
+ }
+
+ private fun setUpBubbleBarView() {
+ getInstrumentation().runOnMainSync {
+ bubbleBarView = BubbleBarView(context)
+ bubbleBarView.layoutParams = FrameLayout.LayoutParams(0, 0)
+ }
+ }
+
+ private fun setUpStashedHandleView() {
+ getInstrumentation().runOnMainSync {
+ stashedHandleView = StashedHandleView(context)
+ stashedHandleView.layoutParams = FrameLayout.LayoutParams(0, 0)
+ }
+ }
+
+ private fun setUpBubbleBarController() {
+ barTranslationY =
+ AnimatedFloat(Runnable { bubbleBarView.translationY = barTranslationY.value })
+ barScale =
+ AnimatedFloat(
+ Runnable {
+ val scale: Float = barScale.value
+ bubbleBarView.scaleX = scale
+ bubbleBarView.scaleY = scale
+ }
+ )
+ barAlpha = MultiValueAlpha(bubbleBarView, 1 /* num alpha channels */)
+
+ whenever(bubbleBarViewController.hasBubbles()).thenReturn(true)
+ whenever(bubbleBarViewController.bubbleBarTranslationY).thenReturn(barTranslationY)
+ whenever(bubbleBarViewController.bubbleBarScale).thenReturn(barScale)
+ whenever(bubbleBarViewController.bubbleBarAlpha).thenReturn(barAlpha)
+ whenever(bubbleBarViewController.bubbleBarCollapsedHeight).thenReturn(BUBBLE_BAR_HEIGHT)
+ }
+
+ private fun setUpBubbleStashedHandleViewController() {
+ stashedHandleTranslationY =
+ AnimatedFloat(Runnable { stashedHandleView.translationY = barTranslationY.value })
+ stashedHandleScale =
+ AnimatedFloat(
+ Runnable {
+ val scale: Float = barScale.value
+ bubbleBarView.scaleX = scale
+ bubbleBarView.scaleY = scale
+ }
+ )
+ stashedHandleAlpha = MultiValueAlpha(stashedHandleView, 1 /* num alpha channels */)
+ stashPhysicsAnimator = PhysicsAnimator.getInstance(stashedHandleView)
+ whenever(bubbleStashedHandleViewController.stashedHandleAlpha)
+ .thenReturn(stashedHandleAlpha)
+ whenever(bubbleStashedHandleViewController.physicsAnimator).thenReturn(stashPhysicsAnimator)
+ whenever(bubbleStashedHandleViewController.stashedHeight).thenReturn(HANDLE_VIEW_HEIGHT)
+ whenever(bubbleStashedHandleViewController.setTranslationYForSwipe(any())).thenAnswer {
+ invocation ->
+ (invocation.arguments[0] as Float).also { stashedHandleView.translationY = it }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayControllerTest.kt
new file mode 100644
index 0000000..4fa821d
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayControllerTest.kt
@@ -0,0 +1,250 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.overlay
+
+import android.app.ActivityManager.RunningTaskInfo
+import android.view.MotionEvent
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.AbstractFloatingView
+import com.android.launcher3.AbstractFloatingView.TYPE_OPTIONS_POPUP
+import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS
+import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY
+import com.android.launcher3.AbstractFloatingView.hasOpenView
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.TaskbarControllerTestUtil.runOnMainSync
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.android.launcher3.util.TestUtil.getOnUiThread
+import com.android.systemui.shared.system.TaskStackChangeListeners
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023"])
+class TaskbarOverlayControllerTest {
+
+ @get:Rule
+ val taskbarUnitTestRule =
+ TaskbarUnitTestRule(
+ this,
+ TaskbarWindowSandboxContext.create(getInstrumentation().targetContext),
+ )
+ @InjectController lateinit var overlayController: TaskbarOverlayController
+
+ private val taskbarContext: TaskbarActivityContext
+ get() = taskbarUnitTestRule.activityContext
+
+ @Test
+ fun testRequestWindow_twice_reusesWindow() {
+ val (context1, context2) =
+ getOnUiThread {
+ Pair(overlayController.requestWindow(), overlayController.requestWindow())
+ }
+ assertThat(context1).isSameInstanceAs(context2)
+ }
+
+ @Test
+ fun testRequestWindow_afterHidingExistingWindow_createsNewWindow() {
+ val context1 = getOnUiThread { overlayController.requestWindow() }
+ runOnMainSync { overlayController.hideWindow() }
+
+ val context2 = getOnUiThread { overlayController.requestWindow() }
+ assertThat(context1).isNotSameInstanceAs(context2)
+ }
+
+ @Test
+ fun testRequestWindow_afterHidingOverlay_createsNewWindow() {
+ val context1 = getOnUiThread { overlayController.requestWindow() }
+ runOnMainSync {
+ TestOverlayView.show(context1)
+ overlayController.hideWindow()
+ }
+
+ val context2 = getOnUiThread { overlayController.requestWindow() }
+ assertThat(context1).isNotSameInstanceAs(context2)
+ }
+
+ @Test
+ fun testRequestWindow_addsProxyView() {
+ runOnMainSync { TestOverlayView.show(overlayController.requestWindow()) }
+ assertThat(hasOpenView(taskbarContext, TYPE_TASKBAR_OVERLAY_PROXY)).isTrue()
+ }
+
+ @Test
+ fun testRequestWindow_closeProxyView_closesOverlay() {
+ val overlay = getOnUiThread { TestOverlayView.show(overlayController.requestWindow()) }
+ runOnMainSync {
+ AbstractFloatingView.closeOpenContainer(taskbarContext, TYPE_TASKBAR_OVERLAY_PROXY)
+ }
+ assertThat(overlay.isOpen).isFalse()
+ }
+
+ @Test
+ fun testRequestWindow_attachesDragLayer() {
+ val dragLayer = getOnUiThread { overlayController.requestWindow().dragLayer }
+ // Allow drag layer to attach before checking.
+ runOnMainSync { assertThat(dragLayer.isAttachedToWindow).isTrue() }
+ }
+
+ @Test
+ fun testHideWindow_closesOverlay() {
+ val overlay = getOnUiThread { TestOverlayView.show(overlayController.requestWindow()) }
+ runOnMainSync { overlayController.hideWindow() }
+ assertThat(overlay.isOpen).isFalse()
+ }
+
+ @Test
+ fun testHideWindow_detachesDragLayer() {
+ val dragLayer = getOnUiThread { overlayController.requestWindow().dragLayer }
+
+ // Wait for drag layer to be attached to window before hiding.
+ runOnMainSync {
+ overlayController.hideWindow()
+ assertThat(dragLayer.isAttachedToWindow).isFalse()
+ }
+ }
+
+ @Test
+ fun testTwoOverlays_closeOne_windowStaysOpen() {
+ val (overlay1, overlay2) =
+ getOnUiThread {
+ val context = overlayController.requestWindow()
+ Pair(TestOverlayView.show(context), TestOverlayView.show(context))
+ }
+
+ runOnMainSync { overlay1.close(false) }
+ assertThat(overlay2.isOpen).isTrue()
+ assertThat(hasOpenView(taskbarContext, TYPE_TASKBAR_OVERLAY_PROXY)).isTrue()
+ }
+
+ @Test
+ fun testTwoOverlays_closeAll_closesWindow() {
+ val (overlay1, overlay2) =
+ getOnUiThread {
+ val context = overlayController.requestWindow()
+ Pair(TestOverlayView.show(context), TestOverlayView.show(context))
+ }
+
+ runOnMainSync {
+ overlay1.close(false)
+ overlay2.close(false)
+ }
+ assertThat(hasOpenView(taskbarContext, TYPE_TASKBAR_OVERLAY_PROXY)).isFalse()
+ }
+
+ @Test
+ fun testRecreateTaskbar_closesWindow() {
+ runOnMainSync { TestOverlayView.show(overlayController.requestWindow()) }
+ taskbarUnitTestRule.recreateTaskbar()
+ assertThat(hasOpenView(taskbarContext, TYPE_TASKBAR_OVERLAY_PROXY)).isFalse()
+ }
+
+ @Test
+ fun testTaskMovedToFront_closesOverlay() {
+ val overlay = getOnUiThread { TestOverlayView.show(overlayController.requestWindow()) }
+ TaskStackChangeListeners.getInstance().listenerImpl.onTaskMovedToFront(RunningTaskInfo())
+ // Make sure TaskStackChangeListeners' Handler posts the callback before checking state.
+ runOnMainSync { assertThat(overlay.isOpen).isFalse() }
+ }
+
+ @Test
+ fun testTaskStackChanged_allAppsClosed_overlayStaysOpen() {
+ val overlay = getOnUiThread { TestOverlayView.show(overlayController.requestWindow()) }
+ runOnMainSync { taskbarContext.controllers.sharedState?.allAppsVisible = false }
+
+ TaskStackChangeListeners.getInstance().listenerImpl.onTaskStackChanged()
+ runOnMainSync { assertThat(overlay.isOpen).isTrue() }
+ }
+
+ @Test
+ fun testTaskStackChanged_allAppsOpen_closesOverlay() {
+ val overlay = getOnUiThread { TestOverlayView.show(overlayController.requestWindow()) }
+ runOnMainSync { taskbarContext.controllers.sharedState?.allAppsVisible = true }
+
+ TaskStackChangeListeners.getInstance().listenerImpl.onTaskStackChanged()
+ runOnMainSync { assertThat(overlay.isOpen).isFalse() }
+ }
+
+ @Test
+ fun testUpdateLauncherDeviceProfile_overlayNotRebindSafe_closesOverlay() {
+ val context = getOnUiThread { overlayController.requestWindow() }
+ val overlay = getOnUiThread {
+ TestOverlayView.show(context).apply { type = TYPE_OPTIONS_POPUP }
+ }
+
+ runOnMainSync {
+ overlayController.updateLauncherDeviceProfile(
+ overlayController.launcherDeviceProfile
+ .toBuilder(context)
+ .setGestureMode(false)
+ .build()
+ )
+ }
+
+ assertThat(overlay.isOpen).isFalse()
+ }
+
+ @Test
+ fun testUpdateLauncherDeviceProfile_overlayRebindSafe_overlayStaysOpen() {
+ val context = getOnUiThread { overlayController.requestWindow() }
+ val overlay = getOnUiThread {
+ TestOverlayView.show(context).apply { type = TYPE_TASKBAR_ALL_APPS }
+ }
+
+ runOnMainSync {
+ overlayController.updateLauncherDeviceProfile(
+ overlayController.launcherDeviceProfile
+ .toBuilder(context)
+ .setGestureMode(false)
+ .build()
+ )
+ }
+
+ assertThat(overlay.isOpen).isTrue()
+ }
+
+ private class TestOverlayView
+ private constructor(
+ private val overlayContext: TaskbarOverlayContext,
+ ) : AbstractFloatingView(overlayContext, null) {
+
+ var type = TYPE_OPTIONS_POPUP
+
+ private fun show() {
+ mIsOpen = true
+ overlayContext.dragLayer.addView(this)
+ }
+
+ override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean = false
+
+ override fun handleClose(animate: Boolean) = overlayContext.dragLayer.removeView(this)
+
+ override fun isOfType(type: Int): Boolean = (type and this.type) != 0
+
+ companion object {
+ /** Adds a generic View to the Overlay window for testing. */
+ fun show(context: TaskbarOverlayContext): TestOverlayView {
+ return TestOverlayView(context).apply { show() }
+ }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRule.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRule.kt
new file mode 100644
index 0000000..c48947e
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRule.kt
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.TaskbarMode
+import com.android.launcher3.util.DisplayController
+import com.android.launcher3.util.MainThreadInitializedObject
+import com.android.launcher3.util.NavigationMode
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.spy
+
+/**
+ * Allows tests to specify which Taskbar [Mode] to run under.
+ *
+ * [context] should match the test's target context, so that [MainThreadInitializedObject] instances
+ * are properly sandboxed.
+ *
+ * Annotate tests with [TaskbarMode] to set a mode. If the annotation is omitted for any tests, this
+ * rule is a no-op.
+ *
+ * Make sure this rule precedes any rules that depend on [DisplayController], or else the instance
+ * might be inconsistent across the test lifecycle.
+ */
+class TaskbarModeRule(private val context: TaskbarWindowSandboxContext) : TestRule {
+ /** The selected Taskbar mode. */
+ enum class Mode {
+ TRANSIENT,
+ PINNED,
+ THREE_BUTTONS,
+ }
+
+ /** Overrides Taskbar [mode] for a test. */
+ @Retention(AnnotationRetention.RUNTIME)
+ @Target(AnnotationTarget.FUNCTION)
+ annotation class TaskbarMode(val mode: Mode)
+
+ override fun apply(base: Statement, description: Description): Statement {
+ val taskbarMode = description.getAnnotation(TaskbarMode::class.java) ?: return base
+
+ return object : Statement() {
+ override fun evaluate() {
+ val mode = taskbarMode.mode
+
+ getInstrumentation().runOnMainSync {
+ context.applicationContext.putObject(
+ DisplayController.INSTANCE,
+ object : DisplayController(context) {
+ override fun getInfo(): Info {
+ return spy(super.getInfo()) {
+ on { isTransientTaskbar } doReturn (mode == Mode.TRANSIENT)
+ on { isPinnedTaskbar } doReturn (mode == Mode.PINNED)
+ on { navigationMode } doReturn
+ when (mode) {
+ Mode.TRANSIENT,
+ Mode.PINNED -> NavigationMode.NO_BUTTON
+ Mode.THREE_BUTTONS -> NavigationMode.THREE_BUTTONS
+ }
+ }
+ }
+ },
+ )
+ }
+
+ base.evaluate()
+ }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRuleTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRuleTest.kt
new file mode 100644
index 0000000..f7e4576
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarModeRuleTest.kt
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.PINNED
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.THREE_BUTTONS
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.Mode.TRANSIENT
+import com.android.launcher3.taskbar.rules.TaskbarModeRule.TaskbarMode
+import com.android.launcher3.util.DisplayController
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.android.launcher3.util.NavigationMode
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarModeRuleTest {
+
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+
+ @get:Rule val taskbarModeRule = TaskbarModeRule(context)
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testTaskbarMode_transient_overridesDisplayController() {
+ assertThat(DisplayController.isTransientTaskbar(context)).isTrue()
+ assertThat(DisplayController.isPinnedTaskbar(context)).isFalse()
+ assertThat(DisplayController.getNavigationMode(context)).isEqualTo(NavigationMode.NO_BUTTON)
+ }
+
+ @Test
+ @TaskbarMode(TRANSIENT)
+ fun testTaskbarMode_transient_overridesDeviceProfile() {
+ val dp = InvariantDeviceProfile.INSTANCE.get(context).getDeviceProfile(context)
+ assertThat(dp.isTransientTaskbar).isTrue()
+ assertThat(dp.isGestureMode).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(PINNED)
+ fun testTaskbarMode_pinned_overridesDisplayController() {
+ assertThat(DisplayController.isTransientTaskbar(context)).isFalse()
+ assertThat(DisplayController.isPinnedTaskbar(context)).isTrue()
+ assertThat(DisplayController.getNavigationMode(context)).isEqualTo(NavigationMode.NO_BUTTON)
+ }
+
+ @Test
+ @TaskbarMode(PINNED)
+ fun testTaskbarMode_pinned_overridesDeviceProfile() {
+ val dp = InvariantDeviceProfile.INSTANCE.get(context).getDeviceProfile(context)
+ assertThat(dp.isTransientTaskbar).isFalse()
+ assertThat(dp.isGestureMode).isTrue()
+ }
+
+ @Test
+ @TaskbarMode(THREE_BUTTONS)
+ fun testTaskbarMode_threeButtons_overridesDisplayController() {
+ assertThat(DisplayController.isTransientTaskbar(context)).isFalse()
+ assertThat(DisplayController.isPinnedTaskbar(context)).isFalse()
+ assertThat(DisplayController.getNavigationMode(context))
+ .isEqualTo(NavigationMode.THREE_BUTTONS)
+ }
+
+ @Test
+ @TaskbarMode(THREE_BUTTONS)
+ fun testTaskbarMode_threeButtons_overridesDeviceProfile() {
+ val dp = InvariantDeviceProfile.INSTANCE.get(context).getDeviceProfile(context)
+ assertThat(dp.isTransientTaskbar).isFalse()
+ assertThat(dp.isGestureMode).isFalse()
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRule.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRule.kt
new file mode 100644
index 0000000..d417790
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRule.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import android.platform.test.flag.junit.FlagsParameterization
+import android.platform.test.flag.junit.SetFlagsRule
+import com.android.launcher3.Flags.FLAG_ENABLE_TASKBAR_PINNING
+import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING
+import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING_IN_DESKTOP_MODE
+import com.android.launcher3.util.DisplayController
+import org.junit.rules.RuleChain
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+
+/**
+ * Rule that allows modifying the Taskbar pinned preferences.
+ *
+ * The original preference values are restored on teardown.
+ *
+ * If this rule is being used with [TaskbarUnitTestRule], make sure this rule is applied first.
+ *
+ * This rule is overkill if a test does not need to change the mode during Taskbar's lifecycle. If
+ * the mode is static, use [TaskbarModeRule] instead, which forces the mode. A test can class can
+ * declare both this rule and [TaskbarModeRule] but using both for a test method is unsupported.
+ */
+class TaskbarPinningPreferenceRule(context: TaskbarWindowSandboxContext) : TestRule {
+
+ private val setFlagsRule =
+ SetFlagsRule(FlagsParameterization(mapOf(FLAG_ENABLE_TASKBAR_PINNING to true)))
+ private val pinningRule = TaskbarPreferenceRule(context, TASKBAR_PINNING)
+ private val desktopPinningRule = TaskbarPreferenceRule(context, TASKBAR_PINNING_IN_DESKTOP_MODE)
+ private val ruleChain =
+ RuleChain.outerRule(setFlagsRule).around(pinningRule).around(desktopPinningRule)
+
+ var isPinned by pinningRule::value
+ var isPinnedInDesktopMode by desktopPinningRule::value
+
+ override fun apply(base: Statement, description: Description): Statement {
+ return object : Statement() {
+ override fun evaluate() {
+ DisplayController.enableTaskbarModePreferenceForTests(true)
+ try {
+ ruleChain.apply(base, description).evaluate()
+ } finally {
+ DisplayController.enableTaskbarModePreferenceForTests(false)
+ }
+ }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRuleTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRuleTest.kt
new file mode 100644
index 0000000..a515405
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPinningPreferenceRuleTest.kt
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.util.DisplayController
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.android.launcher3.util.window.WindowManagerProxy
+import com.google.android.apps.nexuslauncher.deviceemulator.TestWindowManagerProxy
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.Description
+import org.junit.runner.RunWith
+import org.junit.runners.model.Statement
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarPinningPreferenceRuleTest {
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+
+ private val preferenceRule = TaskbarPinningPreferenceRule(context)
+
+ @Test
+ fun testEnablePinning_verifyDisplayController() {
+ onSetup {
+ preferenceRule.isPinned = true
+ preferenceRule.isPinnedInDesktopMode = false
+ assertThat(DisplayController.isPinnedTaskbar(context)).isTrue()
+ }
+ }
+
+ @Test
+ fun testDisablePinning_verifyDisplayController() {
+ onSetup {
+ preferenceRule.isPinned = false
+ preferenceRule.isPinnedInDesktopMode = false
+ assertThat(DisplayController.isPinnedTaskbar(context)).isFalse()
+ }
+ }
+
+ @Test
+ fun testEnableDesktopPinning_verifyDisplayController() {
+ context.applicationContext.putObject(
+ WindowManagerProxy.INSTANCE,
+ TestWindowManagerProxy(context).apply { isInDesktopMode = true },
+ )
+
+ onSetup {
+ preferenceRule.isPinned = false
+ preferenceRule.isPinnedInDesktopMode = true
+ assertThat(DisplayController.isPinnedTaskbar(context)).isTrue()
+ }
+ }
+
+ @Test
+ fun testDisableDesktopPinning_verifyDisplayController() {
+ context.applicationContext.putObject(
+ WindowManagerProxy.INSTANCE,
+ TestWindowManagerProxy(context).apply { isInDesktopMode = true },
+ )
+
+ onSetup {
+ preferenceRule.isPinned = false
+ preferenceRule.isPinnedInDesktopMode = false
+ assertThat(DisplayController.isPinnedTaskbar(context)).isFalse()
+ }
+ }
+
+ @Test
+ fun testTearDown_afterTogglingPinnedPreference_preferenceReset() {
+ val wasPinned = preferenceRule.isPinned
+ onSetup { preferenceRule.isPinned = !preferenceRule.isPinned }
+ assertThat(preferenceRule.isPinned).isEqualTo(wasPinned)
+ }
+
+ @Test
+ fun testTearDown_afterTogglingDesktopPreference_preferenceReset() {
+ val wasPinnedInDesktopMode = preferenceRule.isPinnedInDesktopMode
+ onSetup { preferenceRule.isPinnedInDesktopMode = !preferenceRule.isPinnedInDesktopMode }
+ assertThat(preferenceRule.isPinnedInDesktopMode).isEqualTo(wasPinnedInDesktopMode)
+ }
+
+ /** Executes [runTest] after the [preferenceRule] setup phase completes. */
+ private fun onSetup(runTest: () -> Unit) {
+ preferenceRule
+ .apply(
+ object : Statement() {
+ override fun evaluate() = runTest()
+ },
+ DESCRIPTION,
+ )
+ .evaluate()
+ }
+
+ private companion object {
+ private val DESCRIPTION =
+ Description.createSuiteDescription(TaskbarPinningPreferenceRule::class.java)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRule.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRule.kt
new file mode 100644
index 0000000..a76a77d
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRule.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.ConstantItem
+import com.android.launcher3.LauncherPrefs
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+
+/**
+ * Rule for modifying a Taskbar preference.
+ *
+ * The original preference value is restored on teardown.
+ */
+class TaskbarPreferenceRule<T : Any>(
+ context: TaskbarWindowSandboxContext,
+ private val constantItem: ConstantItem<T>
+) : TestRule {
+
+ private val prefs = LauncherPrefs.get(context)
+
+ var value: T
+ get() = prefs.get(constantItem)
+ set(value) = getInstrumentation().runOnMainSync { prefs.put(constantItem, value) }
+
+ override fun apply(base: Statement, description: Description): Statement {
+ return object : Statement() {
+ override fun evaluate() {
+ val originalValue = value
+ try {
+ base.evaluate()
+ } finally {
+ value = originalValue
+ }
+ }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRuleTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRuleTest.kt
new file mode 100644
index 0000000..46817d2
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarPreferenceRuleTest.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.Description
+import org.junit.runner.RunWith
+import org.junit.runners.model.Statement
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarPreferenceRuleTest {
+
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+ private val preferenceRule = TaskbarPreferenceRule(context, TASKBAR_PINNING)
+
+ @Test
+ fun testSetup_toggleBoolean_updatesPreferences() {
+ val originalValue = preferenceRule.value
+ onSetup {
+ preferenceRule.value = !preferenceRule.value
+ assertThat(preferenceRule.value).isNotEqualTo(originalValue)
+ }
+ }
+
+ @Test
+ fun testTeardown_afterTogglingBoolean_preferenceReset() {
+ val originalValue = preferenceRule.value
+ onSetup { preferenceRule.value = !preferenceRule.value }
+ assertThat(preferenceRule.value).isEqualTo(originalValue)
+ }
+
+ private fun onSetup(runTest: () -> Unit) {
+ preferenceRule
+ .apply(
+ object : Statement() {
+ override fun evaluate() = runTest()
+ },
+ DESCRIPTION,
+ )
+ .evaluate()
+ }
+
+ private companion object {
+ private val DESCRIPTION =
+ Description.createSuiteDescription(TaskbarPreferenceRule::class.java)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRule.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRule.kt
new file mode 100644
index 0000000..bbcf566
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRule.kt
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import android.app.Instrumentation
+import android.app.PendingIntent
+import android.content.IIntentSender
+import android.content.Intent
+import android.provider.Settings
+import android.provider.Settings.Secure.NAV_BAR_KIDS_MODE
+import android.provider.Settings.Secure.USER_SETUP_COMPLETE
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.rule.ServiceTestRule
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.TaskbarManager
+import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarNavButtonCallbacks
+import com.android.launcher3.taskbar.TaskbarViewController
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR
+import com.android.launcher3.util.LauncherMultivalentJUnit.Companion.isRunningInRobolectric
+import com.android.launcher3.util.TestUtil
+import com.android.quickstep.AllAppsActionManager
+import com.android.quickstep.TouchInteractionService
+import com.android.quickstep.TouchInteractionService.TISBinder
+import org.junit.Assume.assumeTrue
+import org.junit.rules.RuleChain
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+
+/**
+ * Manages the Taskbar lifecycle for unit tests.
+ *
+ * Tests should pass in themselves as [testInstance]. They also need to provide their target
+ * [context] through the constructor.
+ *
+ * See [InjectController] for grabbing controller(s) under test with minimal boilerplate.
+ *
+ * The rule interacts with [TaskbarManager] on the main thread. A good rule of thumb for tests is
+ * that code that is executed on the main thread in production should also happen on that thread
+ * when tested.
+ *
+ * `@UiThreadTest` is incompatible with this rule. The annotation causes this rule to run on the
+ * main thread, but it needs to be run on the test thread for it to work properly. Instead, only run
+ * code that requires the main thread using something like [Instrumentation.runOnMainSync] or
+ * [TestUtil.getOnUiThread].
+ *
+ * ```
+ * @Test
+ * fun example() {
+ * instrumentation.runOnMainSync { doWorkThatPostsMessage() }
+ * // Second lambda will not execute until message is processed.
+ * instrumentation.runOnMainSync { verifyMessageResults() }
+ * }
+ * ```
+ */
+class TaskbarUnitTestRule(
+ private val testInstance: Any,
+ private val context: TaskbarWindowSandboxContext,
+) : TestRule {
+
+ private val instrumentation = InstrumentationRegistry.getInstrumentation()
+ private val serviceTestRule = ServiceTestRule()
+
+ private val userSetupCompleteRule = TaskbarSecureSettingRule(USER_SETUP_COMPLETE)
+ private val kidsModeRule = TaskbarSecureSettingRule(NAV_BAR_KIDS_MODE)
+ private val settingRules = RuleChain.outerRule(userSetupCompleteRule).around(kidsModeRule)
+
+ private lateinit var taskbarManager: TaskbarManager
+
+ val activityContext: TaskbarActivityContext
+ get() {
+ return taskbarManager.currentActivityContext
+ ?: throw RuntimeException("Failed to obtain TaskbarActivityContext.")
+ }
+
+ override fun apply(base: Statement, description: Description): Statement {
+ return settingRules.apply(createStatement(base, description), description)
+ }
+
+ private fun createStatement(base: Statement, description: Description): Statement {
+ return object : Statement() {
+ override fun evaluate() {
+
+ // Only run test when Taskbar is enabled.
+ instrumentation.runOnMainSync {
+ assumeTrue(
+ LauncherAppState.getIDP(context).getDeviceProfile(context).isTaskbarPresent
+ )
+ }
+
+ // Process secure setting annotations.
+ instrumentation.runOnMainSync {
+ userSetupCompleteRule.putInt(
+ if (description.getAnnotation(UserSetupMode::class.java) != null) {
+ 0
+ } else {
+ 1
+ }
+ )
+ kidsModeRule.putInt(
+ if (description.getAnnotation(NavBarKidsMode::class.java) != null) 1 else 0
+ )
+ }
+
+ // Check for existing Taskbar instance from Launcher process.
+ val launcherTaskbarManager: TaskbarManager? =
+ if (!isRunningInRobolectric) {
+ try {
+ val tisBinder =
+ serviceTestRule.bindService(
+ Intent(context, TouchInteractionService::class.java)
+ ) as? TISBinder
+ tisBinder?.taskbarManager
+ } catch (_: Exception) {
+ null
+ }
+ } else {
+ null
+ }
+
+ taskbarManager =
+ TestUtil.getOnUiThread {
+ object :
+ TaskbarManager(
+ context,
+ AllAppsActionManager(context, UI_HELPER_EXECUTOR) {
+ PendingIntent(IIntentSender.Default())
+ },
+ object : TaskbarNavButtonCallbacks {},
+ ) {
+ override fun recreateTaskbar() {
+ super.recreateTaskbar()
+ if (currentActivityContext != null) injectControllers()
+ }
+ }
+ }
+
+ try {
+ TaskbarViewController.enableModelLoadingForTests(false)
+
+ // Replace Launcher Taskbar window with test instance.
+ instrumentation.runOnMainSync {
+ launcherTaskbarManager?.setSuspended(true)
+ taskbarManager.onUserUnlocked() // Required to complete initialization.
+ }
+
+ base.evaluate()
+ } finally {
+ // Revert Taskbar window.
+ instrumentation.runOnMainSync {
+ taskbarManager.destroy()
+ launcherTaskbarManager?.setSuspended(false)
+ }
+
+ TaskbarViewController.enableModelLoadingForTests(true)
+ }
+ }
+ }
+ }
+
+ /** Simulates Taskbar recreation lifecycle. */
+ fun recreateTaskbar() = instrumentation.runOnMainSync { taskbarManager.recreateTaskbar() }
+
+ private fun injectControllers() {
+ val controllers = activityContext.controllers
+ val controllerFieldsByType = controllers.javaClass.fields.associateBy { it.type }
+ testInstance.javaClass.fields
+ .filter { it.isAnnotationPresent(InjectController::class.java) }
+ .forEach {
+ it.set(
+ testInstance,
+ controllerFieldsByType[it.type]?.get(controllers)
+ ?: throw NoSuchElementException("Failed to find controller for ${it.type}"),
+ )
+ }
+ }
+
+ /**
+ * Annotates test controller fields to inject the corresponding controllers from the current
+ * [TaskbarControllers] instance.
+ *
+ * Controllers are injected during test setup and upon calling [recreateTaskbar].
+ *
+ * Multiple controllers can be injected if needed.
+ */
+ @Retention(AnnotationRetention.RUNTIME)
+ @Target(AnnotationTarget.FIELD)
+ annotation class InjectController
+
+ /** Overrides [USER_SETUP_COMPLETE] to be `false` for tests. */
+ @Retention(AnnotationRetention.RUNTIME)
+ @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
+ annotation class UserSetupMode
+
+ /** Overrides [NAV_BAR_KIDS_MODE] to be `true` for tests. */
+ @Retention(AnnotationRetention.RUNTIME)
+ @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
+ annotation class NavBarKidsMode
+
+ /** Rule for Taskbar integer-based secure settings. */
+ private inner class TaskbarSecureSettingRule(private val settingName: String) : TestRule {
+
+ override fun apply(base: Statement, description: Description): Statement {
+ return object : Statement() {
+ override fun evaluate() {
+ val originalValue =
+ Settings.Secure.getInt(context.contentResolver, settingName, /* def= */ 0)
+ try {
+ base.evaluate()
+ } finally {
+ instrumentation.runOnMainSync { putInt(originalValue) }
+ }
+ }
+ }
+ }
+
+ /** Puts [value] into secure settings under [settingName]. */
+ fun putInt(value: Int) = Settings.Secure.putInt(context.contentResolver, settingName, value)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRuleTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRuleTest.kt
new file mode 100644
index 0000000..5d4fdc5
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarUnitTestRuleTest.kt
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.TaskbarKeyguardController
+import com.android.launcher3.taskbar.TaskbarManager
+import com.android.launcher3.taskbar.TaskbarStashController
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.NavBarKidsMode
+import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.UserSetupMode
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
+import com.google.common.truth.Truth.assertThat
+import org.junit.Assert.assertThrows
+import org.junit.Test
+import org.junit.runner.Description
+import org.junit.runner.RunWith
+import org.junit.runners.model.Statement
+
+@RunWith(LauncherMultivalentJUnit::class)
+@EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarUnitTestRuleTest {
+
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+
+ @Test
+ fun testSetup_taskbarInitialized() {
+ onSetup { assertThat(activityContext).isInstanceOf(TaskbarActivityContext::class.java) }
+ }
+
+ @Test
+ fun testRecreateTaskbar_activityContextChanged() {
+ onSetup {
+ val context1 = activityContext
+ recreateTaskbar()
+ val context2 = activityContext
+ assertThat(context1).isNotSameInstanceAs(context2)
+ }
+ }
+
+ @Test
+ fun testTeardown_taskbarDestroyed() {
+ val testRule = TaskbarUnitTestRule(this, context)
+ testRule.apply(EMPTY_STATEMENT, DESCRIPTION).evaluate()
+ assertThrows(RuntimeException::class.java) { testRule.activityContext }
+ }
+
+ @Test
+ fun testInjectController_validControllerType_isInjected() {
+ val testClass =
+ object {
+ @InjectController lateinit var controller: TaskbarStashController
+ val isInjected: Boolean
+ get() = ::controller.isInitialized
+ }
+
+ TaskbarUnitTestRule(testClass, context).apply(EMPTY_STATEMENT, DESCRIPTION).evaluate()
+
+ onSetup(TaskbarUnitTestRule(testClass, context)) {
+ assertThat(testClass.isInjected).isTrue()
+ }
+ }
+
+ @Test
+ fun testInjectController_multipleControllers_areInjected() {
+ val testClass =
+ object {
+ @InjectController lateinit var controller1: TaskbarStashController
+ @InjectController lateinit var controller2: TaskbarKeyguardController
+ val areInjected: Boolean
+ get() = ::controller1.isInitialized && ::controller2.isInitialized
+ }
+
+ onSetup(TaskbarUnitTestRule(testClass, context)) {
+ assertThat(testClass.areInjected).isTrue()
+ }
+ }
+
+ @Test
+ fun testInjectController_invalidControllerType_exceptionThrown() {
+ val testClass =
+ object {
+ @InjectController lateinit var manager: TaskbarManager // Not a controller.
+ }
+
+ // We cannot use #assertThrows because we also catch an assumption violated exception when
+ // running #evaluate on devices that do not support Taskbar.
+ val result =
+ try {
+ TaskbarUnitTestRule(testClass, context)
+ .apply(EMPTY_STATEMENT, DESCRIPTION)
+ .evaluate()
+ } catch (e: NoSuchElementException) {
+ e
+ }
+ assertThat(result).isInstanceOf(NoSuchElementException::class.java)
+ }
+
+ @Test
+ fun testInjectController_recreateTaskbar_controllerChanged() {
+ val testClass =
+ object {
+ @InjectController lateinit var controller: TaskbarStashController
+ }
+
+ onSetup(TaskbarUnitTestRule(testClass, context)) {
+ val controller1 = testClass.controller
+ recreateTaskbar()
+ val controller2 = testClass.controller
+ assertThat(controller1).isNotSameInstanceAs(controller2)
+ }
+ }
+
+ @Test
+ fun testUserSetupMode_default_isComplete() {
+ onSetup { assertThat(activityContext.isUserSetupComplete).isTrue() }
+ }
+
+ @Test
+ fun testUserSetupMode_withAnnotation_isIncomplete() {
+ @UserSetupMode class Mode
+ onSetup(description = Description.createSuiteDescription(Mode::class.java)) {
+ assertThat(activityContext.isUserSetupComplete).isFalse()
+ }
+ }
+
+ @Test
+ fun testNavBarKidsMode_default_navBarNotForcedVisible() {
+ onSetup { assertThat(activityContext.isNavBarForceVisible).isFalse() }
+ }
+
+ @Test
+ fun testNavBarKidsMode_withAnnotation_navBarForcedVisible() {
+ @NavBarKidsMode class Mode
+ onSetup(description = Description.createSuiteDescription(Mode::class.java)) {
+ assertThat(activityContext.isNavBarForceVisible).isTrue()
+ }
+ }
+
+ /**
+ * Executes [runTest] after the [testRule] setup phase completes.
+ *
+ * A [description] can also be provided to mimic annotating a test or test class.
+ */
+ private fun onSetup(
+ testRule: TaskbarUnitTestRule = TaskbarUnitTestRule(this, context),
+ description: Description = DESCRIPTION,
+ runTest: TaskbarUnitTestRule.() -> Unit,
+ ) {
+ testRule
+ .apply(
+ object : Statement() {
+ override fun evaluate() = runTest(testRule)
+ },
+ description,
+ )
+ .evaluate()
+ }
+
+ private companion object {
+ private val EMPTY_STATEMENT =
+ object : Statement() {
+ override fun evaluate() = Unit
+ }
+ private val DESCRIPTION =
+ Description.createSuiteDescription(TaskbarUnitTestRuleTest::class.java)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContext.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContext.kt
new file mode 100644
index 0000000..ee21df8
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContext.kt
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import android.content.Context
+import android.content.ContextWrapper
+import android.os.Bundle
+import android.view.Display
+import com.android.launcher3.util.MainThreadInitializedObject
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext
+
+/**
+ * Sandbox wrapper where [createWindowContext] provides contexts that are still sandboxed within
+ * [application].
+ *
+ * Taskbar can create window contexts, which need to operate under the same sandbox application, but
+ * [Context.getApplicationContext] by default returns the actual application. For this reason,
+ * [SandboxContext] overrides [getApplicationContext] to return itself, which prevents leaving the
+ * sandbox. [SandboxContext] and the real application have different sets of
+ * [MainThreadInitializedObject] instances, so overriding the application prevents the latter set
+ * from leaking into the sandbox. Similarly, this implementation overrides [getApplicationContext]
+ * to return the original sandboxed [application], and it wraps created windowed contexts to
+ * propagate this [application].
+ */
+class TaskbarWindowSandboxContext
+private constructor(private val application: SandboxContext, base: Context) : ContextWrapper(base) {
+
+ override fun createWindowContext(type: Int, options: Bundle?): Context {
+ return TaskbarWindowSandboxContext(application, super.createWindowContext(type, options))
+ }
+
+ override fun createWindowContext(display: Display, type: Int, options: Bundle?): Context {
+ return TaskbarWindowSandboxContext(
+ application,
+ super.createWindowContext(display, type, options),
+ )
+ }
+
+ override fun getApplicationContext(): SandboxContext = application
+
+ companion object {
+ /** Creates a [TaskbarWindowSandboxContext] to sandbox [base] for Taskbar tests. */
+ fun create(base: Context): TaskbarWindowSandboxContext {
+ return SandboxContext(base).let { TaskbarWindowSandboxContext(it, it) }
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContextTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContextTest.kt
new file mode 100644
index 0000000..4834d48
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/rules/TaskbarWindowSandboxContextTest.kt
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar.rules
+
+import android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+@LauncherMultivalentJUnit.EmulatedDevices(["pixelFoldable2023", "pixelTablet2023"])
+class TaskbarWindowSandboxContextTest {
+
+ private val context = TaskbarWindowSandboxContext.create(getInstrumentation().targetContext)
+
+ @Test
+ fun testCreateWindowContext_applicationContextSandboxed() {
+ val windowContext = context.createWindowContext(TYPE_APPLICATION_OVERLAY, null)
+ assertThat(windowContext.applicationContext).isInstanceOf(SandboxContext::class.java)
+ }
+
+ @Test
+ fun testCreateWindowContext_nested_applicationContextSandboxed() {
+ val windowContext = context.createWindowContext(TYPE_APPLICATION_OVERLAY, null)
+ val nestedContext = windowContext.createWindowContext(TYPE_APPLICATION_OVERLAY, null)
+ assertThat(nestedContext.applicationContext).isInstanceOf(SandboxContext::class.java)
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/FullscreenDrawParamsTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/FullscreenDrawParamsTest.kt
similarity index 88%
rename from quickstep/tests/src/com/android/quickstep/FullscreenDrawParamsTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/quickstep/FullscreenDrawParamsTest.kt
index db06b6b..5d62a4c 100644
--- a/quickstep/tests/src/com/android/quickstep/FullscreenDrawParamsTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/FullscreenDrawParamsTest.kt
@@ -53,7 +53,7 @@
)
val expectedRadius = TaskCornerRadius.get(context)
- assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
+ assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
}
@Test
@@ -67,7 +67,7 @@
)
val expectedRadius = QuickStepContract.getWindowCornerRadius(context)
- assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
+ assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
}
@Test
@@ -81,7 +81,7 @@
)
val expectedRadius = TaskCornerRadius.get(context)
- assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
+ assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
}
@Test
@@ -95,7 +95,7 @@
)
val expectedRadius = QuickStepContract.getWindowCornerRadius(context)
- assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
+ assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
}
@Test
@@ -117,7 +117,7 @@
/* parentScale= */ 1.0f,
/* taskViewScale= */ 1.0f
)
- assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display1TaskRadius)
+ assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display1TaskRadius)
spyParams.updateCornerRadius(display2Context)
spyParams.setProgress(
@@ -125,7 +125,7 @@
/* parentScale= */ 1.0f,
/* taskViewScale= */ 1.0f
)
- assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display2TaskRadius)
+ assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display2TaskRadius)
}
@Test
@@ -147,7 +147,7 @@
/* parentScale= */ 1.0f,
/* taskViewScale= */ 1.0f
)
- assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display1WindowRadius)
+ assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display1WindowRadius)
spyParams.updateCornerRadius(display2Context)
spyParams.setProgress(
@@ -155,6 +155,6 @@
/* parentScale= */ 1.0f,
/* taskViewScale= */ 1.0f,
)
- assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display2WindowRadius)
+ assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display2WindowRadius)
}
}
diff --git a/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
similarity index 100%
rename from quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherRestoreEventLoggerImplTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherRestoreEventLoggerImplTest.kt
new file mode 100644
index 0000000..24f9696
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherRestoreEventLoggerImplTest.kt
@@ -0,0 +1,139 @@
+package com.android.quickstep
+
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.Flags
+import com.android.launcher3.LauncherSettings.Favorites
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+@EnableFlags(Flags.FLAG_ENABLE_LAUNCHER_BR_METRICS_FIXED)
+class LauncherRestoreEventLoggerImplTest {
+
+ @get:Rule val setFlagsRule = SetFlagsRule()
+
+ private val mLauncherModelHelper = LauncherModelHelper()
+ private val mSandboxContext: SandboxModelContext = mLauncherModelHelper.sandboxContext
+ private lateinit var loggerUnderTest: LauncherRestoreEventLoggerImpl
+
+ @Before
+ fun setup() {
+ loggerUnderTest = LauncherRestoreEventLoggerImpl(mSandboxContext)
+ }
+
+ @After
+ fun teardown() {
+ loggerUnderTest.restoreEventLogger.clearData()
+ mLauncherModelHelper.destroy()
+ }
+
+ @Test
+ fun `logLauncherItemsRestoreFailed logs multiple items as failing restore`() {
+ // Given
+ val expectedDataType = "application"
+ val expectedError = "test_failure"
+ // When
+ loggerUnderTest.logLauncherItemsRestoreFailed(
+ dataType = expectedDataType,
+ count = 5,
+ error = expectedError
+ )
+ // Then
+ val actualResult = loggerUnderTest.restoreEventLogger.loggingResults.first()
+ assertThat(actualResult.dataType).isEqualTo(expectedDataType)
+ assertThat(actualResult.successCount).isEqualTo(0)
+ assertThat(actualResult.failCount).isEqualTo(5)
+ assertThat(actualResult.errors.keys).containsExactly(expectedError)
+ }
+
+ @Test
+ fun `logLauncherItemsRestored logs multiple items as restored`() {
+ // Given
+ val expectedDataType = "application"
+ // When
+ loggerUnderTest.logLauncherItemsRestored(dataType = expectedDataType, count = 5)
+ // Then
+ val actualResult = loggerUnderTest.restoreEventLogger.loggingResults.first()
+ assertThat(actualResult.dataType).isEqualTo(expectedDataType)
+ assertThat(actualResult.successCount).isEqualTo(5)
+ assertThat(actualResult.failCount).isEqualTo(0)
+ assertThat(actualResult.errors.keys).isEmpty()
+ }
+
+ @Test
+ fun `logSingleFavoritesItemRestored logs a single Favorites Item as restored`() {
+ // Given
+ val expectedDataType = "widget"
+ // When
+ loggerUnderTest.logSingleFavoritesItemRestored(favoritesId = Favorites.ITEM_TYPE_APPWIDGET)
+ // Then
+ val actualResult = loggerUnderTest.restoreEventLogger.loggingResults.first()
+ assertThat(actualResult.dataType).isEqualTo(expectedDataType)
+ assertThat(actualResult.successCount).isEqualTo(1)
+ assertThat(actualResult.failCount).isEqualTo(0)
+ assertThat(actualResult.errors.keys).isEmpty()
+ }
+
+ @Test
+ fun `logSingleFavoritesItemRestoreFailed logs a single Favorites Item as failing restore`() {
+ // Given
+ val expectedDataType = "widget"
+ val expectedError = "test_failure"
+ // When
+ loggerUnderTest.logSingleFavoritesItemRestoreFailed(
+ favoritesId = Favorites.ITEM_TYPE_APPWIDGET,
+ error = expectedError
+ )
+ // Then
+ val actualResult = loggerUnderTest.restoreEventLogger.loggingResults.first()
+ assertThat(actualResult.dataType).isEqualTo(expectedDataType)
+ assertThat(actualResult.successCount).isEqualTo(0)
+ assertThat(actualResult.failCount).isEqualTo(1)
+ assertThat(actualResult.errors.keys).containsExactly(expectedError)
+ }
+
+ @Test
+ fun `logFavoritesItemsRestoreFailed logs multiple Favorites Items as failing restore`() {
+ // Given
+ val expectedDataType = "deep_shortcut"
+ val expectedError = "test_failure"
+ // When
+ loggerUnderTest.logFavoritesItemsRestoreFailed(
+ favoritesId = Favorites.ITEM_TYPE_DEEP_SHORTCUT,
+ count = 5,
+ error = expectedError
+ )
+ // Then
+ val actualResult = loggerUnderTest.restoreEventLogger.loggingResults.first()
+ assertThat(actualResult.dataType).isEqualTo(expectedDataType)
+ assertThat(actualResult.successCount).isEqualTo(0)
+ assertThat(actualResult.failCount).isEqualTo(5)
+ assertThat(actualResult.errors.keys).containsExactly(expectedError)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherSwipeHandlerV2Test.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherSwipeHandlerV2Test.kt
new file mode 100644
index 0000000..1f88743
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/LauncherSwipeHandlerV2Test.kt
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep
+
+import android.graphics.PointF
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.R
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.systemui.contextualeducation.GestureType
+import com.android.systemui.shared.system.InputConsumerController
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.spy
+import org.mockito.junit.MockitoJUnit
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class LauncherSwipeHandlerV2Test {
+
+ @Mock private lateinit var taskAnimationManager: TaskAnimationManager
+
+ private lateinit var gestureState: GestureState
+ @Mock private lateinit var inputConsumerController: InputConsumerController
+
+ @Mock private lateinit var systemUiProxy: SystemUiProxy
+
+ private lateinit var underTest: LauncherSwipeHandlerV2
+
+ @get:Rule val mockitoRule = MockitoJUnit.rule()
+
+ private val launcherModelHelper = LauncherModelHelper()
+ private val sandboxContext = launcherModelHelper.sandboxContext
+
+ private val flingSpeed =
+ -(sandboxContext.resources.getDimension(R.dimen.quickstep_fling_threshold_speed) + 1)
+
+ @Before
+ fun setup() {
+ sandboxContext.putObject(SystemUiProxy.INSTANCE, systemUiProxy)
+ val deviceState = mock(RecentsAnimationDeviceState::class.java)
+ whenever(deviceState.rotationTouchHelper).thenReturn(mock(RotationTouchHelper::class.java))
+ gestureState = spy(GestureState(OverviewComponentObserver(sandboxContext, deviceState), 0))
+
+ underTest =
+ LauncherSwipeHandlerV2(
+ sandboxContext,
+ deviceState,
+ taskAnimationManager,
+ gestureState,
+ 0,
+ false,
+ inputConsumerController
+ )
+ underTest.onGestureStarted(/* isLikelyToStartNewTask= */ false)
+ }
+
+ @Test
+ fun goHomeFromAppByTrackpad_updateEduStats() {
+ gestureState.setTrackpadGestureType(GestureState.TrackpadGestureType.THREE_FINGER)
+ underTest.onGestureEnded(flingSpeed, PointF())
+ verify(systemUiProxy)
+ .updateContextualEduStats(
+ /* isTrackpadGesture= */ eq(true),
+ eq(GestureType.HOME.toString())
+ )
+ }
+
+ @Test
+ fun goHomeFromAppByTouch_updateEduStats() {
+ underTest.onGestureEnded(flingSpeed, PointF())
+ verify(systemUiProxy)
+ .updateContextualEduStats(
+ /* isTrackpadGesture= */ eq(false),
+ eq(GestureType.HOME.toString())
+ )
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/MultiStateCallbackTest.java b/quickstep/tests/multivalentTests/src/com/android/quickstep/MultiStateCallbackTest.java
new file mode 100644
index 0000000..0ff142a
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/MultiStateCallbackTest.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.launcher3.util.LauncherMultivalentJUnit;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.function.Consumer;
+
+@SmallTest
+@RunWith(LauncherMultivalentJUnit.class)
+public class MultiStateCallbackTest {
+
+ private int mFlagCount = 0;
+ private int getNextStateFlag() {
+ int index = 1 << mFlagCount;
+ mFlagCount++;
+ return index;
+ }
+
+ private final MultiStateCallback mMultiStateCallback = new MultiStateCallback(new String[0]);
+ private final Runnable mCallback = spy(new Runnable() {
+ @Override
+ public void run() {}
+ });
+ private final Consumer<Boolean> mListener = spy(new Consumer<Boolean>() {
+ @Override
+ public void accept(Boolean isOn) {}
+ });
+
+ @Test
+ public void testSetState_trackedProperly() {
+ int watchedAnime = getNextStateFlag();
+
+ assertThat(mMultiStateCallback.getState()).isEqualTo(0);
+ assertThat(mMultiStateCallback.hasStates(watchedAnime)).isFalse();
+
+ mMultiStateCallback.setState(watchedAnime);
+
+ assertThat(mMultiStateCallback.getState()).isEqualTo(watchedAnime);
+ assertThat(mMultiStateCallback.hasStates(watchedAnime)).isTrue();
+ }
+
+ @Test
+ public void testSetState_withMultipleStates_trackedProperly() {
+ int watchedAnime = getNextStateFlag();
+ int sharedMemes = getNextStateFlag();
+
+ mMultiStateCallback.setState(watchedAnime);
+ mMultiStateCallback.setState(sharedMemes);
+
+ assertThat(mMultiStateCallback.getState()).isEqualTo(watchedAnime | sharedMemes);
+ assertThat(mMultiStateCallback.hasStates(watchedAnime)).isTrue();
+ assertThat(mMultiStateCallback.hasStates(sharedMemes)).isTrue();
+ assertThat(mMultiStateCallback.hasStates(watchedAnime | sharedMemes)).isTrue();
+ }
+
+ @Test
+ public void testClearState_trackedProperly() {
+ int lovedAnime = getNextStateFlag();
+
+ mMultiStateCallback.setState(lovedAnime);
+ mMultiStateCallback.clearState(lovedAnime);
+
+ assertThat(mMultiStateCallback.getState()).isEqualTo(0);
+ assertThat(mMultiStateCallback.hasStates(lovedAnime)).isFalse();
+ }
+
+ @Test
+ public void testClearState_withMultipleState_trackedProperly() {
+ int lovedAnime = getNextStateFlag();
+ int talkedAboutAnime = getNextStateFlag();
+
+ mMultiStateCallback.setState(lovedAnime);
+ mMultiStateCallback.setState(talkedAboutAnime);
+ mMultiStateCallback.clearState(talkedAboutAnime);
+
+ assertThat(mMultiStateCallback.getState()).isEqualTo(lovedAnime);
+ assertThat(mMultiStateCallback.hasStates(lovedAnime)).isTrue();
+ assertThat(mMultiStateCallback.hasStates(talkedAboutAnime)).isFalse();
+ assertThat(mMultiStateCallback.hasStates(lovedAnime | talkedAboutAnime)).isFalse();
+ }
+
+ @Test
+ public void testCallbackDoesNotRun_withoutState() {
+ int watchedOnePiece = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedOnePiece, mCallback);
+
+ verify(mCallback, never()).run();
+ }
+
+ @Test
+ public void testCallbackDoesNotRun_whenNotTracked() {
+ int watchedJujutsuKaisen = getNextStateFlag();
+
+ mMultiStateCallback.setState(watchedJujutsuKaisen);
+
+ verify(mCallback, never()).run();
+ }
+
+ @Test
+ public void testCallbackRuns_afterTrackedAndStateSet() {
+ int watchedHunterXHunter = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedHunterXHunter, mCallback);
+ mMultiStateCallback.setState(watchedHunterXHunter);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackRuns_onUiThread() {
+ int watchedHunterXHunter = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedHunterXHunter, mCallback);
+ mMultiStateCallback.setStateOnUiThread(watchedHunterXHunter);
+
+ runOnMainSync(() -> verify(mCallback, times(1)).run());
+ }
+
+ @Test
+ public void testCallbackRuns_agnosticallyToCallOrder() {
+ int watchedFullMetalAlchemist = getNextStateFlag();
+
+ mMultiStateCallback.setState(watchedFullMetalAlchemist);
+ mMultiStateCallback.runOnceAtState(watchedFullMetalAlchemist, mCallback);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackRuns_onlyOnceAfterStateSet() {
+ int watchedBleach = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedBleach, mCallback);
+ mMultiStateCallback.setState(watchedBleach);
+ mMultiStateCallback.setState(watchedBleach);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackRuns_onlyOnceAfterClearState() {
+ int rememberedGreatShow = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(rememberedGreatShow, mCallback);
+ mMultiStateCallback.setState(rememberedGreatShow);
+ mMultiStateCallback.clearState(rememberedGreatShow);
+ mMultiStateCallback.setState(rememberedGreatShow);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackDoesNotRun_withoutFullStateSet() {
+ int watchedMobPsycho = getNextStateFlag();
+ int watchedVinlandSaga = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedMobPsycho | watchedVinlandSaga, mCallback);
+ mMultiStateCallback.setState(watchedMobPsycho);
+
+ verify(mCallback, times(0)).run();
+ }
+
+ @Test
+ public void testCallbackRuns_withFullStateSet_agnosticallyToCallOrder() {
+ int watchedReZero = getNextStateFlag();
+ int watchedJojosBizareAdventure = getNextStateFlag();
+
+ mMultiStateCallback.setState(watchedJojosBizareAdventure);
+ mMultiStateCallback.runOnceAtState(watchedReZero | watchedJojosBizareAdventure, mCallback);
+ mMultiStateCallback.setState(watchedReZero);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackRuns_withFullStateSet_asIntegerMask() {
+ int watchedPokemon = getNextStateFlag();
+ int watchedDigimon = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedPokemon | watchedDigimon, mCallback);
+ mMultiStateCallback.setState(watchedPokemon | watchedDigimon);
+
+ verify(mCallback, times(1)).run();
+ }
+
+ @Test
+ public void testCallbackDoesNotRun_afterClearState() {
+ int watchedMonster = getNextStateFlag();
+ int watchedPingPong = getNextStateFlag();
+
+ mMultiStateCallback.runOnceAtState(watchedMonster | watchedPingPong, mCallback);
+ mMultiStateCallback.setState(watchedMonster);
+ mMultiStateCallback.clearState(watchedMonster);
+ mMultiStateCallback.setState(watchedPingPong);
+
+ verify(mCallback, times(0)).run();
+ }
+
+ @Test
+ public void testlistenerRuns_multipleTimes() {
+ int watchedSteinsGate = getNextStateFlag();
+
+ mMultiStateCallback.addChangeListener(watchedSteinsGate, mListener);
+ mMultiStateCallback.setState(watchedSteinsGate);
+
+ // Called exactly one
+ verify(mListener, times(1)).accept(anyBoolean());
+ // Called exactly once with isOn = true
+ verify(mListener, times(1)).accept(eq(true));
+ // Never called with isOn = false
+ verify(mListener, times(0)).accept(eq(false));
+
+ mMultiStateCallback.clearState(watchedSteinsGate);
+
+ // Called exactly twice
+ verify(mListener, times(2)).accept(anyBoolean());
+ // Called exactly once with isOn = true
+ verify(mListener, times(1)).accept(eq(true));
+ // Called exactly once with isOn = false
+ verify(mListener, times(1)).accept(eq(false));
+ }
+
+ @Test
+ public void testlistenerDoesNotRun_forUnchangedState() {
+ int watchedSteinsGate = getNextStateFlag();
+
+ mMultiStateCallback.addChangeListener(watchedSteinsGate, mListener);
+ mMultiStateCallback.setState(watchedSteinsGate);
+ mMultiStateCallback.setState(watchedSteinsGate);
+
+ // State remained unchanged
+ verify(mListener, times(1)).accept(anyBoolean());
+ // Called exactly once with isOn = true
+ verify(mListener, times(1)).accept(eq(true));
+ }
+
+ private static void runOnMainSync(Runnable runnable) {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(runnable);
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumerTest.java b/quickstep/tests/multivalentTests/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumerTest.java
new file mode 100644
index 0000000..80b9489
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumerTest.java
@@ -0,0 +1,452 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.inputconsumers;
+
+import static android.view.MotionEvent.ACTION_CANCEL;
+import static android.view.MotionEvent.ACTION_DOWN;
+import static android.view.MotionEvent.ACTION_HOVER_ENTER;
+import static android.view.MotionEvent.ACTION_MOVE;
+import static android.view.MotionEvent.ACTION_UP;
+
+import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.os.SystemClock;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;
+import com.android.quickstep.DeviceConfigWrapper;
+import com.android.quickstep.GestureState;
+import com.android.quickstep.InputConsumer;
+import com.android.quickstep.NavHandle;
+import com.android.quickstep.RecentsAnimationDeviceState;
+import com.android.quickstep.TopTaskTracker;
+import com.android.quickstep.util.TestExtensions;
+import com.android.systemui.shared.system.InputMonitorCompat;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class NavHandleLongPressInputConsumerTest {
+
+ private static final float TOUCH_SLOP = 10;
+ private static final float SQUARED_TOUCH_SLOP = 100;
+
+ private final AtomicBoolean mLongPressTriggered = new AtomicBoolean();
+ private final Runnable mLongPressRunnable = () -> mLongPressTriggered.set(true);
+ private NavHandleLongPressInputConsumer mUnderTest;
+ private SandboxContext mContext;
+ private float mScreenWidth;
+ @Mock InputConsumer mDelegate;
+ @Mock InputMonitorCompat mInputMonitor;
+ @Mock RecentsAnimationDeviceState mDeviceState;
+ @Mock NavHandle mNavHandle;
+ @Mock GestureState mGestureState;
+ @Mock NavHandleLongPressHandler mNavHandleLongPressHandler;
+ @Mock TopTaskTracker mTopTaskTracker;
+ @Mock TopTaskTracker.CachedTaskInfo mTaskInfo;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ when(mTopTaskTracker.getCachedTopTask(anyBoolean())).thenReturn(mTaskInfo);
+ when(mDeviceState.getSquaredTouchSlop()).thenReturn(SQUARED_TOUCH_SLOP);
+ when(mDelegate.allowInterceptByParent()).thenReturn(true);
+ MAIN_EXECUTOR.getHandler().removeCallbacks(mLongPressRunnable);
+ mLongPressTriggered.set(false);
+ when(mNavHandleLongPressHandler.getLongPressRunnable(any())).thenReturn(mLongPressRunnable);
+ initializeObjectUnderTest();
+ }
+
+ @After
+ public void tearDown() {
+ mContext.onDestroy();
+ }
+
+ @Test
+ public void testGetType() {
+ assertThat(mUnderTest.getType() & InputConsumer.TYPE_NAV_HANDLE_LONG_PRESS).isNotEqualTo(0);
+ }
+
+ @Test
+ public void testDelegateDisallowsTouchIntercept() {
+ when(mDelegate.allowInterceptByParent()).thenReturn(false);
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+
+ verify(mDelegate).onMotionEvent(any());
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ verify(mNavHandleLongPressHandler, never()).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testDelegateDisallowsTouchInterceptAfterTouchDown() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+
+ // Delegate should still get touches unless long press is triggered.
+ verify(mDelegate).onMotionEvent(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+
+ when(mDelegate.allowInterceptByParent()).thenReturn(false);
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_MOVE));
+
+ // Delegate should still get motion events unless long press is triggered.
+ verify(mDelegate, times(2)).onMotionEvent(any());
+ // But our handler should be cancelled.
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressTriggered() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_ACTIVE);
+ assertTrue(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressTriggeredWithSlightVerticalMovement() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ mUnderTest.onMotionEvent(generateCenteredMotionEventWithYOffset(ACTION_MOVE,
+ -(TOUCH_SLOP - 1)));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_ACTIVE);
+ assertTrue(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressTriggeredWithSlightHorizontalMovement() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_MOVE,
+ mScreenWidth / 2f - (TOUCH_SLOP - 1), 0));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_ACTIVE);
+ assertTrue(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressTriggeredWithExtendedTwoStageDuration() {
+ try (AutoCloseable flag = overrideTwoStageFlag(true)) {
+ // Reinitialize to pick up updated flag state.
+ initializeObjectUnderTest();
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_MOVE,
+ mScreenWidth / 2f - (TOUCH_SLOP - 1), 0));
+ // We have entered the second stage, so the normal timeout shouldn't trigger.
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+
+ // After an extended time, the long press should trigger.
+ float extendedDurationMultiplier =
+ (DeviceConfigWrapper.get().getTwoStageDurationPercentage() / 100f);
+ SystemClock.sleep((long) (ViewConfiguration.getLongPressTimeout()
+ * (extendedDurationMultiplier - 1))); // -1 because we already waited 1x
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_ACTIVE);
+ assertTrue(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Test
+ public void testLongPressTriggeredWithNormalDurationInFirstStage() {
+ try (AutoCloseable flag = overrideTwoStageFlag(true)) {
+ // Reinitialize to pick up updated flag state.
+ initializeObjectUnderTest();
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ // We have not entered the second stage, so the normal timeout should trigger.
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_ACTIVE);
+ assertTrue(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchUp() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout() - 10);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_UP));
+ // Wait past the long press timeout, to be extra sure it wouldn't have triggered.
+ SystemClock.sleep(20);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchCancel() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout() - 10);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_CANCEL));
+ // Wait past the long press timeout, to be extra sure it wouldn't have triggered.
+ SystemClock.sleep(20);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchSlopPassedVertically() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout() - 10);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEventWithYOffset(ACTION_MOVE,
+ -(TOUCH_SLOP + 1)));
+ // Wait past the long press timeout, to be extra sure it wouldn't have triggered.
+ SystemClock.sleep(20);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchSlopPassedHorizontally() {
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout() - 10);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_MOVE,
+ mScreenWidth / 2f - (TOUCH_SLOP + 1), 0));
+ // Wait past the long press timeout, to be extra sure it wouldn't have triggered.
+ SystemClock.sleep(20);
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchSlopPassedVertically_twoStageEnabled() {
+ try (AutoCloseable flag = overrideTwoStageFlag(true)) {
+ // Reinitialize to pick up updated flag state.
+ initializeObjectUnderTest();
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ // Enter the second stage.
+ mUnderTest.onMotionEvent(generateCenteredMotionEventWithYOffset(ACTION_MOVE,
+ -(TOUCH_SLOP - 1)));
+ // Normal duration shouldn't trigger.
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ // Move out of the second stage.
+ mUnderTest.onMotionEvent(generateCenteredMotionEventWithYOffset(ACTION_MOVE,
+ -(TOUCH_SLOP + 1)));
+ // Wait past the extended long press timeout, to be sure it wouldn't have triggered.
+ float extendedDurationMultiplier =
+ (DeviceConfigWrapper.get().getTwoStageDurationPercentage() / 100f);
+ SystemClock.sleep((long) (ViewConfiguration.getLongPressTimeout()
+ * (extendedDurationMultiplier - 1))); // -1 because we already waited 1x
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ // Touch cancelled.
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Test
+ public void testLongPressAbortedByTouchSlopPassedHorizontally_twoStageEnabled() {
+ try (AutoCloseable flag = overrideTwoStageFlag(true)) {
+ // Reinitialize to pick up updated flag state.
+ initializeObjectUnderTest();
+
+ mUnderTest.onMotionEvent(generateCenteredMotionEvent(ACTION_DOWN));
+ // Enter the second stage.
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_MOVE,
+ mScreenWidth / 2f - (TOUCH_SLOP - 1), 0));
+ // Normal duration shouldn't trigger.
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+
+ // Move out of the second stage.
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_MOVE,
+ mScreenWidth / 2f - (TOUCH_SLOP + 1), 0));
+ // Wait past the extended long press timeout, to be sure it wouldn't have triggered.
+ float extendedDurationMultiplier =
+ (DeviceConfigWrapper.get().getTwoStageDurationPercentage() / 100f);
+ SystemClock.sleep((long) (ViewConfiguration.getLongPressTimeout()
+ * (extendedDurationMultiplier - 1))); // -1 because we already waited 1x
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, times(1)).onTouchStarted(any());
+ // Touch cancelled.
+ verify(mNavHandleLongPressHandler, times(1)).onTouchFinished(any(), any());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Test
+ public void testTouchOutsideNavHandleIgnored() {
+ // Touch the far left side of the screen. (y=0 is top of navbar region, picked arbitrarily)
+ mUnderTest.onMotionEvent(generateMotionEvent(ACTION_DOWN, 0, 0));
+ SystemClock.sleep(ViewConfiguration.getLongPressTimeout());
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ // Should be ignored because the x position was not centered in the navbar region.
+ assertThat(mUnderTest.mState).isEqualTo(DelegateInputConsumer.STATE_INACTIVE);
+ assertFalse(mLongPressTriggered.get());
+ verify(mNavHandleLongPressHandler, never()).onTouchStarted(any());
+ verify(mNavHandleLongPressHandler, never()).onTouchFinished(any(), any());
+ }
+
+ @Test
+ public void testHoverPassedToDelegate() {
+ // Regardless of whether the delegate wants us to intercept, we tell it about hover events.
+ when(mDelegate.allowInterceptByParent()).thenReturn(false);
+ mUnderTest.onHoverEvent(generateCenteredMotionEvent(ACTION_HOVER_ENTER));
+
+ verify(mDelegate).onHoverEvent(any());
+
+ when(mDelegate.allowInterceptByParent()).thenReturn(true);
+ mUnderTest.onHoverEvent(generateCenteredMotionEvent(ACTION_HOVER_ENTER));
+
+ verify(mDelegate, times(2)).onHoverEvent(any());
+ }
+
+ private void initializeObjectUnderTest() {
+ if (mContext != null) {
+ mContext.onDestroy();
+ }
+ mContext = new SandboxContext(getApplicationContext());
+ mContext.putObject(TopTaskTracker.INSTANCE, mTopTaskTracker);
+ mScreenWidth = DisplayController.INSTANCE.get(mContext).getInfo().currentSize.x;
+ mUnderTest = new NavHandleLongPressInputConsumer(mContext, mDelegate, mInputMonitor,
+ mDeviceState, mNavHandle, mGestureState);
+ mUnderTest.setNavHandleLongPressHandler(mNavHandleLongPressHandler);
+ }
+
+ /** Generate a motion event centered horizontally in the screen. */
+ private MotionEvent generateCenteredMotionEvent(int motionAction) {
+ return generateCenteredMotionEventWithYOffset(motionAction, 0);
+ }
+
+ /** Generate a motion event centered horizontally in the screen, with y offset. */
+ private MotionEvent generateCenteredMotionEventWithYOffset(int motionAction, float y) {
+ return generateMotionEvent(motionAction, mScreenWidth / 2f, y);
+ }
+
+ private static MotionEvent generateMotionEvent(int motionAction, float x, float y) {
+ return MotionEvent.obtain(0, 0, motionAction, x, y, 0);
+ }
+
+ private static AutoCloseable overrideTwoStageFlag(boolean value) {
+ return TestExtensions.overrideNavConfigFlag(
+ "ENABLE_LPNH_TWO_STAGES",
+ value,
+ () -> DeviceConfigWrapper.get().getEnableLpnhTwoStages());
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/logging/SettingsChangeLoggerTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/logging/SettingsChangeLoggerTest.kt
new file mode 100644
index 0000000..d2479bc
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/logging/SettingsChangeLoggerTest.kt
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.logging
+
+import android.content.Context
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.LauncherPrefs
+import com.android.launcher3.LauncherPrefs.Companion.ALLOW_ROTATION
+import com.android.launcher3.LauncherPrefs.Companion.THEMED_ICONS
+import com.android.launcher3.SessionCommitReceiver.ADD_ICON_PREFERENCE_KEY
+import com.android.launcher3.logging.InstanceId
+import com.android.launcher3.logging.StatsLogManager
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ADD_NEW_APPS_TO_HOME_SCREEN_ENABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALL_APPS_SUGGESTIONS_ENABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_ROTATION_DISABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_ROTATION_ENABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED
+import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED
+import com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY
+import com.google.android.apps.nexuslauncher.PrefKey.KEY_ENABLE_MINUS_ONE
+import com.google.android.apps.nexuslauncher.PrefKey.OVERVIEW_SUGGESTED_ACTIONS
+import com.google.android.apps.nexuslauncher.PrefKey.SMARTSPACE_ON_HOME_SCREEN
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Captor
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.any
+import org.mockito.kotlin.atLeastOnce
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@RunWith(AndroidJUnit4::class)
+class SettingsChangeLoggerTest {
+ private val mContext: Context = ApplicationProvider.getApplicationContext()
+
+ private val mInstanceId = InstanceId.fakeInstanceId(1)
+
+ private lateinit var mSystemUnderTest: SettingsChangeLogger
+
+ @Mock private lateinit var mStatsLogManager: StatsLogManager
+
+ @Mock private lateinit var mMockLogger: StatsLogManager.StatsLogger
+
+ @Captor private lateinit var mEventCaptor: ArgumentCaptor<StatsLogManager.EventEnum>
+
+ private var mDefaultThemedIcons = false
+ private var mDefaultAllowRotation = false
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+
+ whenever(mStatsLogManager.logger()).doReturn(mMockLogger)
+ whenever(mStatsLogManager.logger().withInstanceId(any())).doReturn(mMockLogger)
+ mDefaultThemedIcons = LauncherPrefs.get(mContext).get(THEMED_ICONS)
+ mDefaultAllowRotation = LauncherPrefs.get(mContext).get(ALLOW_ROTATION)
+ // To match the default value of THEMED_ICONS
+ LauncherPrefs.get(mContext).put(THEMED_ICONS, false)
+ // To match the default value of ALLOW_ROTATION
+ LauncherPrefs.get(mContext).put(item = ALLOW_ROTATION, value = false)
+
+ mSystemUnderTest = SettingsChangeLogger(mContext, mStatsLogManager)
+ }
+
+ @After
+ fun tearDown() {
+ LauncherPrefs.get(mContext).put(THEMED_ICONS, mDefaultThemedIcons)
+ LauncherPrefs.get(mContext).put(ALLOW_ROTATION, mDefaultAllowRotation)
+ }
+
+ @Test
+ fun loggingPrefs_correctDefaultValue() {
+ val systemUnderTest = SettingsChangeLogger(mContext, mStatsLogManager)
+
+ assertThat(systemUnderTest.loggingPrefs[ALLOW_ROTATION_PREFERENCE_KEY]!!.defaultValue)
+ .isFalse()
+ assertThat(systemUnderTest.loggingPrefs[ADD_ICON_PREFERENCE_KEY]!!.defaultValue).isTrue()
+ assertThat(systemUnderTest.loggingPrefs[OVERVIEW_SUGGESTED_ACTIONS]!!.defaultValue).isTrue()
+ assertThat(systemUnderTest.loggingPrefs[SMARTSPACE_ON_HOME_SCREEN]!!.defaultValue).isTrue()
+ assertThat(systemUnderTest.loggingPrefs[KEY_ENABLE_MINUS_ONE]!!.defaultValue).isTrue()
+ }
+
+ @Test
+ fun logSnapshot_defaultValue() {
+ mSystemUnderTest.logSnapshot(mInstanceId)
+
+ verify(mMockLogger, atLeastOnce()).log(mEventCaptor.capture())
+ val capturedEvents = mEventCaptor.allValues
+ assertThat(capturedEvents.isNotEmpty()).isTrue()
+ verifyDefaultEvent(capturedEvents)
+ assertThat(capturedEvents.any { it.id == LAUNCHER_HOME_SCREEN_ROTATION_DISABLED.id })
+ .isTrue()
+ }
+
+ @Test
+ fun logSnapshot_updateAllowRotation() {
+ LauncherPrefs.get(mContext).put(item = ALLOW_ROTATION, value = true)
+
+ // This a new object so the values of mLoggablePrefs will be different
+ SettingsChangeLogger(mContext, mStatsLogManager).logSnapshot(mInstanceId)
+
+ verify(mMockLogger, atLeastOnce()).log(mEventCaptor.capture())
+ val capturedEvents = mEventCaptor.allValues
+ assertThat(capturedEvents.isNotEmpty()).isTrue()
+ verifyDefaultEvent(capturedEvents)
+ assertThat(capturedEvents.any { it.id == LAUNCHER_HOME_SCREEN_ROTATION_ENABLED.id })
+ .isTrue()
+ }
+
+ private fun verifyDefaultEvent(capturedEvents: MutableList<StatsLogManager.EventEnum>) {
+ assertThat(capturedEvents.any { it.id == LAUNCHER_NOTIFICATION_DOT_ENABLED.id }).isTrue()
+ assertThat(capturedEvents.any { it.id == LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON.id })
+ .isTrue()
+ assertThat(capturedEvents.any { it.id == LAUNCHER_THEMED_ICON_DISABLED.id }).isTrue()
+ assertThat(capturedEvents.any { it.id == LAUNCHER_ADD_NEW_APPS_TO_HOME_SCREEN_ENABLED.id })
+ .isTrue()
+ assertThat(capturedEvents.any { it.id == LAUNCHER_ALL_APPS_SUGGESTIONS_ENABLED.id })
+ .isTrue()
+ assertThat(capturedEvents.any { it.id == LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED.id })
+ .isTrue()
+ // LAUNCHER_GOOGLE_APP_SWIPE_LEFT_ENABLED
+ assertThat(capturedEvents.any { it.id == 617 }).isTrue()
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeHighResLoadingStateNotifier.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeHighResLoadingStateNotifier.kt
new file mode 100644
index 0000000..7d09efd
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeHighResLoadingStateNotifier.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback
+
+class FakeHighResLoadingStateNotifier : HighResLoadingStateNotifier {
+ val listeners = mutableListOf<HighResLoadingStateChangedCallback>()
+
+ override fun addCallback(callback: HighResLoadingStateChangedCallback) {
+ listeners.add(callback)
+ }
+
+ override fun removeCallback(callback: HighResLoadingStateChangedCallback) {
+ listeners.remove(callback)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentTasksDataSource.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentTasksDataSource.kt
new file mode 100644
index 0000000..eaeb513
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentTasksDataSource.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.util.GroupTask
+import java.util.function.Consumer
+
+class FakeRecentTasksDataSource : RecentTasksDataSource {
+ var taskList: List<GroupTask> = listOf()
+
+ override fun getTasks(callback: Consumer<List<GroupTask>>?): Int {
+ callback?.accept(taskList)
+ return 0
+ }
+
+ fun seedTasks(tasks: List<GroupTask>) {
+ taskList = tasks
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsDeviceProfileRepository.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsDeviceProfileRepository.kt
new file mode 100644
index 0000000..fc2f029
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsDeviceProfileRepository.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+class FakeRecentsDeviceProfileRepository : RecentsDeviceProfileRepository {
+ private var recentsDeviceProfile =
+ RecentsDeviceProfile(
+ isLargeScreen = false,
+ )
+
+ override fun getRecentsDeviceProfile() = recentsDeviceProfile
+
+ fun setRecentsDeviceProfile(newValue: RecentsDeviceProfile) {
+ recentsDeviceProfile = newValue
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsRotationStateRepository.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsRotationStateRepository.kt
new file mode 100644
index 0000000..c328672
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeRecentsRotationStateRepository.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.view.Surface
+
+class FakeRecentsRotationStateRepository : RecentsRotationStateRepository {
+ private var recentsRotationState =
+ RecentsRotationState(
+ activityRotation = Surface.ROTATION_0,
+ orientationHandlerRotation = Surface.ROTATION_0
+ )
+
+ override fun getRecentsRotationState() = recentsRotationState
+
+ fun setRecentsRotationState(newValue: RecentsRotationState) {
+ recentsRotationState = newValue
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskIconDataSource.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskIconDataSource.kt
new file mode 100644
index 0000000..5de876a
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskIconDataSource.kt
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.graphics.drawable.Drawable
+import com.android.launcher3.util.CancellableTask
+import com.android.quickstep.TaskIconCache
+import com.android.quickstep.task.thumbnail.data.TaskIconDataSource
+import com.android.systemui.shared.recents.model.Task
+import com.google.common.truth.Truth.assertThat
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+class FakeTaskIconDataSource : TaskIconDataSource {
+
+ val taskIdToDrawable: MutableMap<Int, Drawable> =
+ (0..10).associateWith { mockCopyableDrawable() }.toMutableMap()
+
+ val taskIdToUpdatingTask: MutableMap<Int, () -> Unit> = mutableMapOf()
+ var shouldLoadSynchronously: Boolean = true
+
+ /** Retrieves and sets an icon on [task] from [taskIdToDrawable]. */
+ override fun getIconInBackground(
+ task: Task,
+ callback: TaskIconCache.GetTaskIconCallback
+ ): CancellableTask<*>? {
+ val wrappedCallback = {
+ callback.onTaskIconReceived(
+ taskIdToDrawable.getValue(task.key.id),
+ "content desc ${task.key.id}",
+ "title ${task.key.id}"
+ )
+ }
+ if (shouldLoadSynchronously) {
+ wrappedCallback()
+ } else {
+ taskIdToUpdatingTask[task.key.id] = wrappedCallback
+ }
+ return null
+ }
+
+ companion object {
+ fun mockCopyableDrawable(): Drawable {
+ val mutableDrawable = mock<Drawable>()
+ val immutableDrawable =
+ mock<Drawable>().apply { whenever(mutate()).thenReturn(mutableDrawable) }
+ val constantState =
+ mock<Drawable.ConstantState>().apply {
+ whenever(newDrawable()).thenReturn(immutableDrawable)
+ }
+ return mutableDrawable.apply { whenever(this.constantState).thenReturn(constantState) }
+ }
+ }
+}
+
+fun Task.assertHasIconDataFromSource(fakeTaskIconDataSource: FakeTaskIconDataSource) {
+ assertThat(icon).isEqualTo(fakeTaskIconDataSource.taskIdToDrawable[key.id])
+ assertThat(titleDescription).isEqualTo("content desc ${key.id}")
+ assertThat(title).isEqualTo("title ${key.id}")
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskThumbnailDataSource.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskThumbnailDataSource.kt
new file mode 100644
index 0000000..d12c0b0
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskThumbnailDataSource.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.graphics.Bitmap
+import com.android.launcher3.util.CancellableTask
+import com.android.quickstep.task.thumbnail.data.TaskThumbnailDataSource
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import java.util.function.Consumer
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+class FakeTaskThumbnailDataSource : TaskThumbnailDataSource {
+
+ val taskIdToBitmap: MutableMap<Int, Bitmap> =
+ (0..10).associateWith { mock<Bitmap>() }.toMutableMap()
+ val taskIdToUpdatingTask: MutableMap<Int, () -> Unit> = mutableMapOf()
+ var shouldLoadSynchronously: Boolean = true
+
+ /** Retrieves and sets a thumbnail on [task] from [taskIdToBitmap]. */
+ override fun getThumbnailInBackground(
+ task: Task,
+ callback: Consumer<ThumbnailData>
+ ): CancellableTask<ThumbnailData>? {
+ val thumbnailData = mock<ThumbnailData>()
+ whenever(thumbnailData.thumbnail).thenReturn(taskIdToBitmap[task.key.id])
+ val wrappedCallback = {
+ task.thumbnail = thumbnailData
+ callback.accept(thumbnailData)
+ }
+ if (shouldLoadSynchronously) {
+ wrappedCallback()
+ } else {
+ taskIdToUpdatingTask[task.key.id] = wrappedCallback
+ }
+ return null
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskVisualsChangeNotifier.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskVisualsChangeNotifier.kt
new file mode 100644
index 0000000..765f0d1
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTaskVisualsChangeNotifier.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.quickstep.util.TaskVisualsChangeListener
+
+class FakeTaskVisualsChangeNotifier : TaskVisualsChangeNotifier {
+ val listeners = mutableListOf<TaskVisualsChangeListener>()
+
+ override fun addThumbnailChangeListener(listener: TaskVisualsChangeListener) {
+ listeners.add(listener)
+ }
+
+ override fun removeThumbnailChangeListener(listener: TaskVisualsChangeListener) {
+ listeners.remove(listener)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTasksRepository.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTasksRepository.kt
new file mode 100644
index 0000000..7a17872
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/FakeTasksRepository.kt
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.map
+
+class FakeTasksRepository : RecentTasksRepository {
+ private var thumbnailDataMap: Map<Int, ThumbnailData> = emptyMap()
+ private var taskIconDataMap: Map<Int, TaskIconQueryResponse> = emptyMap()
+ private var tasks: MutableStateFlow<List<Task>> = MutableStateFlow(emptyList())
+ private var visibleTasks: MutableStateFlow<List<Int>> = MutableStateFlow(emptyList())
+
+ override fun getAllTaskData(forceRefresh: Boolean): Flow<List<Task>> = tasks
+
+ override fun getTaskDataById(taskId: Int): Flow<Task?> =
+ combine(getAllTaskData(), visibleTasks) { taskList, visibleTasks ->
+ taskList.filter { visibleTasks.contains(it.key.id) }
+ }
+ .map { taskList ->
+ val task = taskList.firstOrNull { it.key.id == taskId } ?: return@map null
+ Task(task).apply {
+ thumbnail = task.thumbnail
+ icon = task.icon
+ titleDescription = task.titleDescription
+ title = task.title
+ }
+ }
+
+ override fun getThumbnailById(taskId: Int): Flow<ThumbnailData?> =
+ getTaskDataById(taskId).map { it?.thumbnail }
+
+ override fun setVisibleTasks(visibleTaskIdList: List<Int>) {
+ visibleTasks.value = visibleTaskIdList
+ tasks.value =
+ tasks.value.map {
+ it.apply {
+ thumbnail = thumbnailDataMap[it.key.id]
+ taskIconDataMap[it.key.id].let { taskIconData ->
+ icon = taskIconData?.icon
+ titleDescription = taskIconData?.contentDescription
+ title = taskIconData?.title
+ }
+ }
+ }
+ }
+
+ fun seedTasks(tasks: List<Task>) {
+ this.tasks.value = tasks
+ }
+
+ fun seedThumbnailData(thumbnailDataMap: Map<Int, ThumbnailData>) {
+ this.thumbnailDataMap = thumbnailDataMap
+ }
+
+ fun seedIconData(iconDataMap: Map<Int, TaskIconQueryResponse>) {
+ this.taskIconDataMap = iconDataMap
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImplTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImplTest.kt
new file mode 100644
index 0000000..abe4142
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsDeviceProfileRepositoryImplTest.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.FakeInvariantDeviceProfileTest
+import com.android.quickstep.views.RecentsViewContainer
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [RecentsDeviceProfileRepositoryImpl] */
+@RunWith(AndroidJUnit4::class)
+class RecentsDeviceProfileRepositoryImplTest : FakeInvariantDeviceProfileTest() {
+ private val recentsViewContainer = mock<RecentsViewContainer>()
+
+ private val systemUnderTest = RecentsDeviceProfileRepositoryImpl(recentsViewContainer)
+
+ @Test
+ fun deviceProfileMappedCorrectly() {
+ initializeVarsForTablet()
+ val tabletDeviceProfile = newDP()
+ whenever(recentsViewContainer.deviceProfile).thenReturn(tabletDeviceProfile)
+
+ assertThat(systemUnderTest.getRecentsDeviceProfile())
+ .isEqualTo(RecentsDeviceProfile(isLargeScreen = true))
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImplTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImplTest.kt
new file mode 100644
index 0000000..017f037
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/RecentsRotationStateRepositoryImplTest.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.view.Surface.ROTATION_270
+import android.view.Surface.ROTATION_90
+import com.android.quickstep.orientation.SeascapePagedViewHandler
+import com.android.quickstep.util.RecentsOrientedState
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [RecentsRotationStateRepositoryImpl] */
+class RecentsRotationStateRepositoryImplTest {
+ private val recentsOrientedState = mock<RecentsOrientedState>()
+
+ private val systemUnderTest = RecentsRotationStateRepositoryImpl(recentsOrientedState)
+
+ @Test
+ fun orientedStateMappedCorrectly() {
+ whenever(recentsOrientedState.recentsActivityRotation).thenReturn(ROTATION_90)
+ whenever(recentsOrientedState.orientationHandler).thenReturn(SeascapePagedViewHandler())
+
+ assertThat(systemUnderTest.getRecentsRotationState())
+ .isEqualTo(
+ RecentsRotationState(
+ activityRotation = ROTATION_90,
+ orientationHandlerRotation = ROTATION_270
+ )
+ )
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegateTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegateTest.kt
new file mode 100644
index 0000000..41f6bfd
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TaskVisualsChangedDelegateTest.kt
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.content.ComponentName
+import android.content.Intent
+import android.os.UserHandle
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskIconChangedCallback
+import com.android.quickstep.recents.data.TaskVisualsChangedDelegate.TaskThumbnailChangedCallback
+import com.android.systemui.shared.recents.model.Task.TaskKey
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+class TaskVisualsChangedDelegateTest {
+ private val taskVisualsChangeNotifier = FakeTaskVisualsChangeNotifier()
+ private val highResLoadingStateNotifier = FakeHighResLoadingStateNotifier()
+
+ val systemUnderTest =
+ TaskVisualsChangedDelegateImpl(taskVisualsChangeNotifier, highResLoadingStateNotifier)
+
+ @Test
+ fun addingFirstListener_addsListenerToNotifiers() {
+ systemUnderTest.registerTaskThumbnailChangedCallback(createTaskKey(id = 1), mock())
+
+ assertThat(taskVisualsChangeNotifier.listeners.single()).isEqualTo(systemUnderTest)
+ assertThat(highResLoadingStateNotifier.listeners.single()).isEqualTo(systemUnderTest)
+ }
+
+ @Test
+ fun addingAndRemovingListener_removesListenerFromNotifiers() {
+ systemUnderTest.registerTaskThumbnailChangedCallback(createTaskKey(id = 1), mock())
+ systemUnderTest.unregisterTaskThumbnailChangedCallback(createTaskKey(id = 1))
+
+ assertThat(taskVisualsChangeNotifier.listeners).isEmpty()
+ assertThat(highResLoadingStateNotifier.listeners).isEmpty()
+ }
+
+ @Test
+ fun addingTwoAndRemovingOneListener_doesNotRemoveListenerFromNotifiers() {
+ systemUnderTest.registerTaskThumbnailChangedCallback(createTaskKey(id = 1), mock())
+ systemUnderTest.registerTaskThumbnailChangedCallback(createTaskKey(id = 2), mock())
+ systemUnderTest.unregisterTaskThumbnailChangedCallback(createTaskKey(id = 1))
+
+ assertThat(taskVisualsChangeNotifier.listeners.single()).isEqualTo(systemUnderTest)
+ assertThat(highResLoadingStateNotifier.listeners.single()).isEqualTo(systemUnderTest)
+ }
+
+ @Test
+ fun onTaskIconChangedWithTaskId_notifiesCorrectListenerOnly() {
+ val expectedListener = mock<TaskIconChangedCallback>()
+ val additionalListener = mock<TaskIconChangedCallback>()
+ systemUnderTest.registerTaskIconChangedCallback(createTaskKey(id = 1), expectedListener)
+ systemUnderTest.registerTaskIconChangedCallback(createTaskKey(id = 2), additionalListener)
+
+ systemUnderTest.onTaskIconChanged(1)
+
+ verify(expectedListener).onTaskIconChanged()
+ verifyNoMoreInteractions(additionalListener)
+ }
+
+ @Test
+ fun onTaskIconChangedWithoutTaskId_notifiesCorrectListenerOnly() {
+ val expectedListener = mock<TaskIconChangedCallback>()
+ val listener = mock<TaskIconChangedCallback>()
+ // Correct match
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 1, pkg = ALTERNATIVE_PACKAGE_NAME, userId = 1),
+ expectedListener
+ )
+ // 1 out of 2 match
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 2, pkg = PACKAGE_NAME, userId = 1),
+ listener
+ )
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 3, pkg = ALTERNATIVE_PACKAGE_NAME, userId = 2),
+ listener
+ )
+ // 0 out of 2 match
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 4, pkg = PACKAGE_NAME, userId = 2),
+ listener
+ )
+
+ systemUnderTest.onTaskIconChanged(ALTERNATIVE_PACKAGE_NAME, UserHandle(1))
+
+ verify(expectedListener).onTaskIconChanged()
+ verifyNoMoreInteractions(listener)
+ }
+
+ @Test
+ fun replacedTaskIconChangedCallbacks_notCalled() {
+ val replacedListener = mock<TaskIconChangedCallback>()
+ val newListener = mock<TaskIconChangedCallback>()
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 1, pkg = ALTERNATIVE_PACKAGE_NAME, userId = 1),
+ replacedListener
+ )
+ systemUnderTest.registerTaskIconChangedCallback(
+ createTaskKey(id = 1, pkg = ALTERNATIVE_PACKAGE_NAME, userId = 1),
+ newListener
+ )
+
+ systemUnderTest.onTaskIconChanged(ALTERNATIVE_PACKAGE_NAME, UserHandle(1))
+
+ verifyNoMoreInteractions(replacedListener)
+ verify(newListener).onTaskIconChanged()
+ }
+
+ @Test
+ fun onTaskThumbnailChanged_notifiesCorrectListenerOnly() {
+ val expectedListener = mock<TaskThumbnailChangedCallback>()
+ val additionalListener = mock<TaskThumbnailChangedCallback>()
+ val expectedThumbnailData = ThumbnailData(snapshotId = 12345)
+ systemUnderTest.registerTaskThumbnailChangedCallback(
+ createTaskKey(id = 1),
+ expectedListener
+ )
+ systemUnderTest.registerTaskThumbnailChangedCallback(
+ createTaskKey(id = 2),
+ additionalListener
+ )
+
+ systemUnderTest.onTaskThumbnailChanged(1, expectedThumbnailData)
+
+ verify(expectedListener).onTaskThumbnailChanged(expectedThumbnailData)
+ verifyNoMoreInteractions(additionalListener)
+ }
+
+ @Test
+ fun onHighResLoadingStateChanged_notifiesAllListeners() {
+ val expectedListener = mock<TaskThumbnailChangedCallback>()
+ val additionalListener = mock<TaskThumbnailChangedCallback>()
+ systemUnderTest.registerTaskThumbnailChangedCallback(
+ createTaskKey(id = 1),
+ expectedListener
+ )
+ systemUnderTest.registerTaskThumbnailChangedCallback(
+ createTaskKey(id = 2),
+ additionalListener
+ )
+
+ systemUnderTest.onHighResLoadingStateChanged(true)
+
+ verify(expectedListener).onHighResLoadingStateChanged()
+ verify(additionalListener).onHighResLoadingStateChanged()
+ }
+
+ @Test
+ fun replacedTaskThumbnailChangedCallbacks_notCalled() {
+ val replacedListener1 = mock<TaskThumbnailChangedCallback>()
+ val newListener1 = mock<TaskThumbnailChangedCallback>()
+ val expectedThumbnailData = ThumbnailData(snapshotId = 12345)
+ systemUnderTest.registerTaskThumbnailChangedCallback(
+ createTaskKey(id = 1),
+ replacedListener1
+ )
+ systemUnderTest.registerTaskThumbnailChangedCallback(createTaskKey(id = 1), newListener1)
+
+ systemUnderTest.onTaskThumbnailChanged(1, expectedThumbnailData)
+
+ verifyNoMoreInteractions(replacedListener1)
+ verify(newListener1).onTaskThumbnailChanged(expectedThumbnailData)
+ }
+
+ private fun createTaskKey(id: Int = 1, pkg: String = PACKAGE_NAME, userId: Int = 1) =
+ TaskKey(id, 0, Intent().setPackage(pkg), ComponentName("", ""), userId, 0)
+
+ private companion object {
+ const val PACKAGE_NAME = "com.test.test"
+ const val ALTERNATIVE_PACKAGE_NAME = "com.test.test2"
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TasksRepositoryTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TasksRepositoryTest.kt
new file mode 100644
index 0000000..f31467f
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/data/TasksRepositoryTest.kt
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.data
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.drawable.Drawable
+import com.android.launcher3.util.TestDispatcherProvider
+import com.android.quickstep.task.thumbnail.TaskThumbnailViewModelTest
+import com.android.quickstep.util.DesktopTask
+import com.android.quickstep.util.GroupTask
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.toList
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.UnconfinedTestDispatcher
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+@OptIn(ExperimentalCoroutinesApi::class)
+class TasksRepositoryTest {
+ private val tasks = (0..5).map(::createTaskWithId)
+ private val defaultTaskList =
+ listOf(
+ GroupTask(tasks[0]),
+ GroupTask(tasks[1], tasks[2], null),
+ DesktopTask(tasks.subList(3, 6))
+ )
+ private val recentsModel = FakeRecentTasksDataSource()
+ private val taskThumbnailDataSource = FakeTaskThumbnailDataSource()
+ private val taskIconDataSource = FakeTaskIconDataSource()
+ private val taskVisualsChangeNotifier = FakeTaskVisualsChangeNotifier()
+ private val highResLoadingStateNotifier = FakeHighResLoadingStateNotifier()
+ private val taskVisualsChangedDelegate =
+ TaskVisualsChangedDelegateImpl(taskVisualsChangeNotifier, highResLoadingStateNotifier)
+
+ private val dispatcher = UnconfinedTestDispatcher()
+ private val testScope = TestScope(dispatcher)
+ private val systemUnderTest =
+ TasksRepository(
+ recentsModel,
+ taskThumbnailDataSource,
+ taskIconDataSource,
+ taskVisualsChangedDelegate,
+ testScope.backgroundScope,
+ TestDispatcherProvider(dispatcher)
+ )
+
+ @Test
+ fun getAllTaskDataReturnsFlattenedListOfTasks() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+
+ assertThat(systemUnderTest.getAllTaskData(forceRefresh = true).first()).isEqualTo(tasks)
+ }
+
+ @Test
+ fun getTaskDataByIdReturnsSpecificTask() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ assertThat(systemUnderTest.getTaskDataById(2).first()).isEqualTo(tasks[2])
+ }
+
+ @Test
+ fun setVisibleTasksPopulatesThumbnails() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ val bitmap1 = taskThumbnailDataSource.taskIdToBitmap[1]
+ val bitmap2 = taskThumbnailDataSource.taskIdToBitmap[2]
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ assertThat(systemUnderTest.getTaskDataById(1).first()!!.thumbnail!!.thumbnail)
+ .isEqualTo(bitmap1)
+ assertThat(systemUnderTest.getTaskDataById(2).first()!!.thumbnail!!.thumbnail)
+ .isEqualTo(bitmap2)
+ }
+
+ @Test
+ fun setVisibleTasksPopulatesIcons() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ systemUnderTest
+ .getTaskDataById(1)
+ .first()!!
+ .assertHasIconDataFromSource(taskIconDataSource)
+ systemUnderTest
+ .getTaskDataById(2)
+ .first()!!
+ .assertHasIconDataFromSource(taskIconDataSource)
+ }
+
+ @Test
+ fun changingVisibleTasksContainsAlreadyPopulatedThumbnails() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ val bitmap2 = taskThumbnailDataSource.taskIdToBitmap[2]
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ assertThat(systemUnderTest.getTaskDataById(2).first()!!.thumbnail!!.thumbnail)
+ .isEqualTo(bitmap2)
+
+ // Prevent new loading of Bitmaps
+ taskThumbnailDataSource.shouldLoadSynchronously = false
+ systemUnderTest.setVisibleTasks(listOf(2, 3))
+
+ assertThat(systemUnderTest.getTaskDataById(2).first()!!.thumbnail!!.thumbnail)
+ .isEqualTo(bitmap2)
+ }
+
+ @Test
+ fun changingVisibleTasksContainsAlreadyPopulatedIcons() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ systemUnderTest
+ .getTaskDataById(2)
+ .first()!!
+ .assertHasIconDataFromSource(taskIconDataSource)
+
+ // Prevent new loading of Drawables
+ taskThumbnailDataSource.shouldLoadSynchronously = false
+ systemUnderTest.setVisibleTasks(listOf(2, 3))
+
+ systemUnderTest
+ .getTaskDataById(2)
+ .first()!!
+ .assertHasIconDataFromSource(taskIconDataSource)
+ }
+
+ @Test
+ fun retrievedImagesAreDiscardedWhenTaskBecomesInvisible() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ val bitmap2 = taskThumbnailDataSource.taskIdToBitmap[2]
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ val task2 = systemUnderTest.getTaskDataById(2).first()!!
+ assertThat(task2.thumbnail!!.thumbnail).isEqualTo(bitmap2)
+ task2.assertHasIconDataFromSource(taskIconDataSource)
+
+ // Prevent new loading of Bitmaps
+ taskThumbnailDataSource.shouldLoadSynchronously = false
+ taskIconDataSource.shouldLoadSynchronously = false
+ systemUnderTest.setVisibleTasks(listOf(0, 1))
+
+ val task2AfterVisibleTasksChanged = systemUnderTest.getTaskDataById(2).first()!!
+ assertThat(task2AfterVisibleTasksChanged.thumbnail).isNull()
+ assertThat(task2AfterVisibleTasksChanged.icon).isNull()
+ assertThat(task2AfterVisibleTasksChanged.titleDescription).isNull()
+ assertThat(task2AfterVisibleTasksChanged.title).isNull()
+ }
+
+ @Test
+ fun retrievedThumbnailsCauseEmissionOnTaskDataFlow() =
+ testScope.runTest {
+ // Setup fakes
+ recentsModel.seedTasks(defaultTaskList)
+ val bitmap2 = taskThumbnailDataSource.taskIdToBitmap[2]
+ taskThumbnailDataSource.shouldLoadSynchronously = false
+
+ // Setup TasksRepository
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+ systemUnderTest.setVisibleTasks(listOf(1, 2))
+
+ // Assert there is no bitmap in first emission
+ assertThat(systemUnderTest.getTaskDataById(2).first()!!.thumbnail).isNull()
+
+ // Simulate bitmap loading after first emission
+ taskThumbnailDataSource.taskIdToUpdatingTask.getValue(2).invoke()
+
+ // Check for second emission
+ assertThat(systemUnderTest.getTaskDataById(2).first()!!.thumbnail!!.thumbnail)
+ .isEqualTo(bitmap2)
+ }
+
+ @Test
+ fun onTaskThumbnailChanged_setsNewThumbnailDataOnTask() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1))
+
+ val expectedThumbnailData = createThumbnailData()
+ val expectedPreviousBitmap = taskThumbnailDataSource.taskIdToBitmap[1]
+ val taskDataFlow = systemUnderTest.getTaskDataById(1)
+
+ val task1ThumbnailValues = mutableListOf<ThumbnailData?>()
+ testScope.backgroundScope.launch {
+ taskDataFlow.map { it?.thumbnail }.toList(task1ThumbnailValues)
+ }
+ taskVisualsChangedDelegate.onTaskThumbnailChanged(1, expectedThumbnailData)
+
+ assertThat(task1ThumbnailValues[1]!!.thumbnail).isEqualTo(expectedPreviousBitmap)
+ assertThat(task1ThumbnailValues.last()).isEqualTo(expectedThumbnailData)
+ }
+
+ @Test
+ fun onHighResLoadingStateChanged_setsNewThumbnailDataOnTask() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1))
+
+ val expectedBitmap = mock<Bitmap>()
+ val expectedPreviousBitmap = taskThumbnailDataSource.taskIdToBitmap[1]
+ val taskDataFlow = systemUnderTest.getTaskDataById(1)
+
+ val task1ThumbnailValues = mutableListOf<Bitmap?>()
+ testScope.backgroundScope.launch {
+ taskDataFlow.map { it?.thumbnail?.thumbnail }.toList(task1ThumbnailValues)
+ }
+ taskThumbnailDataSource.taskIdToBitmap[1] = expectedBitmap
+ taskVisualsChangedDelegate.onHighResLoadingStateChanged(true)
+
+ assertThat(task1ThumbnailValues[1]).isEqualTo(expectedPreviousBitmap)
+ assertThat(task1ThumbnailValues.last()).isEqualTo(expectedBitmap)
+ }
+
+ @Test
+ fun onTaskIconChanged_setsNewIconOnTask() =
+ testScope.runTest {
+ recentsModel.seedTasks(defaultTaskList)
+ systemUnderTest.getAllTaskData(forceRefresh = true)
+
+ systemUnderTest.setVisibleTasks(listOf(1))
+
+ val expectedIcon = FakeTaskIconDataSource.mockCopyableDrawable()
+ val expectedPreviousIcon = taskIconDataSource.taskIdToDrawable[1]
+ val taskDataFlow = systemUnderTest.getTaskDataById(1)
+
+ val task1IconValues = mutableListOf<Drawable?>()
+ testScope.backgroundScope.launch {
+ taskDataFlow.map { it?.icon }.toList(task1IconValues)
+ }
+ taskIconDataSource.taskIdToDrawable[1] = expectedIcon
+ taskVisualsChangedDelegate.onTaskIconChanged(1)
+
+ assertThat(task1IconValues[1]).isEqualTo(expectedPreviousIcon)
+ assertThat(task1IconValues.last()).isEqualTo(expectedIcon)
+ }
+
+ private fun createTaskWithId(taskId: Int) =
+ Task(Task.TaskKey(taskId, 0, Intent(), ComponentName("", ""), 0, 2000))
+
+ private fun createThumbnailData(): ThumbnailData {
+ val bitmap = mock<Bitmap>()
+ whenever(bitmap.width).thenReturn(TaskThumbnailViewModelTest.THUMBNAIL_WIDTH)
+ whenever(bitmap.height).thenReturn(TaskThumbnailViewModelTest.THUMBNAIL_HEIGHT)
+
+ return ThumbnailData(thumbnail = bitmap)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCaseTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCaseTest.kt
new file mode 100644
index 0000000..02f1d11
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailPositionUseCaseTest.kt
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import android.graphics.Matrix
+import android.graphics.Rect
+import android.view.Surface.ROTATION_90
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.quickstep.recents.data.FakeRecentsDeviceProfileRepository
+import com.android.quickstep.recents.data.FakeRecentsRotationStateRepository
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MatrixScaling
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MissingThumbnail
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.android.systemui.shared.recents.utilities.PreviewPositionHelper
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+/** Test for [GetThumbnailPositionUseCase] */
+@RunWith(AndroidJUnit4::class)
+class GetThumbnailPositionUseCaseTest {
+ private val task =
+ Task(Task.TaskKey(TASK_ID, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.BLACK
+ }
+ private val thumbnailData =
+ ThumbnailData(
+ thumbnail =
+ mock<Bitmap>().apply {
+ whenever(width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(height).thenReturn(THUMBNAIL_HEIGHT)
+ }
+ )
+
+ private val deviceProfileRepository = FakeRecentsDeviceProfileRepository()
+ private val rotationStateRepository = FakeRecentsRotationStateRepository()
+ private val tasksRepository = FakeTasksRepository()
+ private val previewPositionHelper = mock<PreviewPositionHelper>()
+
+ private val systemUnderTest =
+ GetThumbnailPositionUseCase(
+ deviceProfileRepository,
+ rotationStateRepository,
+ tasksRepository,
+ previewPositionHelper
+ )
+
+ @Test
+ fun invisibleTask_returnsIdentityMatrix() = runTest {
+ tasksRepository.seedTasks(listOf(task))
+
+ assertThat(systemUnderTest.run(TASK_ID, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl = true))
+ .isInstanceOf(MissingThumbnail::class.java)
+ }
+
+ @Test
+ fun visibleTaskWithoutThumbnailData_returnsIdentityMatrix() = runTest {
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.setVisibleTasks(listOf(TASK_ID))
+
+ assertThat(systemUnderTest.run(TASK_ID, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl = true))
+ .isInstanceOf(MissingThumbnail::class.java)
+ }
+
+ @Test
+ fun visibleTaskWithThumbnailData_returnsTransformedMatrix() = runTest {
+ tasksRepository.seedThumbnailData(mapOf(TASK_ID to thumbnailData))
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.setVisibleTasks(listOf(TASK_ID))
+
+ val isLargeScreen = true
+ deviceProfileRepository.setRecentsDeviceProfile(
+ deviceProfileRepository.getRecentsDeviceProfile().copy(isLargeScreen = isLargeScreen)
+ )
+ val activityRotation = ROTATION_90
+ rotationStateRepository.setRecentsRotationState(
+ rotationStateRepository
+ .getRecentsRotationState()
+ .copy(activityRotation = activityRotation)
+ )
+ val isRtl = true
+ val isRotated = true
+
+ whenever(previewPositionHelper.matrix).thenReturn(MATRIX)
+ whenever(previewPositionHelper.isOrientationChanged).thenReturn(isRotated)
+
+ assertThat(systemUnderTest.run(TASK_ID, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .isEqualTo(MatrixScaling(MATRIX, isRotated))
+
+ verify(previewPositionHelper)
+ .updateThumbnailMatrix(
+ Rect(0, 0, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT),
+ thumbnailData,
+ CANVAS_WIDTH,
+ CANVAS_HEIGHT,
+ isLargeScreen,
+ activityRotation,
+ isRtl
+ )
+ }
+
+ companion object {
+ const val TASK_ID = 2
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+ const val CANVAS_WIDTH = 300
+ const val CANVAS_HEIGHT = 600
+ val MATRIX =
+ Matrix().apply {
+ setValues(floatArrayOf(2.3f, 4.5f, 2.6f, 7.4f, 3.4f, 2.3f, 2.5f, 6.0f, 3.4f))
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailUseCaseTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailUseCaseTest.kt
new file mode 100644
index 0000000..12a94cf
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/GetThumbnailUseCaseTest.kt
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.task.viewmodel.TaskOverlayViewModelTest
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [GetThumbnailUseCase] */
+class GetThumbnailUseCaseTest {
+ private val task =
+ Task(Task.TaskKey(TASK_ID, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.BLACK
+ }
+ private val thumbnailData =
+ ThumbnailData(
+ thumbnail =
+ mock<Bitmap>().apply {
+ whenever(width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(height).thenReturn(THUMBNAIL_HEIGHT)
+ }
+ )
+
+ private val tasksRepository = FakeTasksRepository()
+ private val systemUnderTest = GetThumbnailUseCase(tasksRepository)
+
+ @Test
+ fun taskNotSeeded_returnsNull() {
+ assertThat(systemUnderTest.run(TASK_ID)).isNull()
+ }
+
+ @Test
+ fun taskNotLoaded_returnsNull() {
+ tasksRepository.seedTasks(listOf(task))
+
+ assertThat(systemUnderTest.run(TASK_ID)).isNull()
+ }
+
+ @Test
+ fun taskNotVisible_returnsNull() {
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.seedThumbnailData(mapOf(TaskOverlayViewModelTest.TASK_ID to thumbnailData))
+
+ assertThat(systemUnderTest.run(TASK_ID)).isNull()
+ }
+
+ @Test
+ fun taskVisible_returnsThumbnail() {
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.seedThumbnailData(mapOf(TaskOverlayViewModelTest.TASK_ID to thumbnailData))
+ tasksRepository.setVisibleTasks(listOf(TaskOverlayViewModelTest.TASK_ID))
+
+ assertThat(systemUnderTest.run(TASK_ID)).isEqualTo(thumbnailData.thumbnail)
+ }
+
+ companion object {
+ const val TASK_ID = 0
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCaseTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCaseTest.kt
new file mode 100644
index 0000000..ba4e206
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/usecase/SysUiStatusNavFlagsUseCaseTest.kt
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.usecase
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [SysUiStatusNavFlagsUseCase] */
+class SysUiStatusNavFlagsUseCaseTest {
+ private lateinit var tasksRepository: FakeTasksRepository
+ private lateinit var sysUiStatusNavFlagsUseCase: SysUiStatusNavFlagsUseCase
+
+ @Before
+ fun setup() {
+ tasksRepository = FakeTasksRepository()
+ sysUiStatusNavFlagsUseCase = SysUiStatusNavFlagsUseCase(tasksRepository)
+ initTaskRepository()
+ }
+
+ @Test
+ fun onLightAppearanceReturnExpectedFlags() {
+ assertThat(sysUiStatusNavFlagsUseCase.getSysUiStatusNavFlags(FIRST_TASK_ID))
+ .isEqualTo(FLAGS_APPEARANCE_LIGHT_THEME)
+ }
+
+ @Test
+ fun onDarkAppearanceReturnExpectedFlags() {
+ assertThat(sysUiStatusNavFlagsUseCase.getSysUiStatusNavFlags(SECOND_TASK_ID))
+ .isEqualTo(FLAGS_APPEARANCE_DARK_THEME)
+ }
+
+ @Test
+ fun whenThumbnailIsNullReturnDefault() {
+ assertThat(sysUiStatusNavFlagsUseCase.getSysUiStatusNavFlags(UNKNOWN_TASK_ID))
+ .isEqualTo(FLAGS_DEFAULT)
+ }
+
+ private fun initTaskRepository() {
+ val firstTask =
+ Task(Task.TaskKey(FIRST_TASK_ID, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.BLACK
+ }
+ val firstThumbnailData =
+ ThumbnailData(
+ thumbnail =
+ mock<Bitmap>().apply {
+ whenever(width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(height).thenReturn(THUMBNAIL_HEIGHT)
+ },
+ appearance = APPEARANCE_LIGHT_THEME
+ )
+
+ val secondTask =
+ Task(Task.TaskKey(SECOND_TASK_ID, 0, Intent(), ComponentName("", ""), 0, 2005)).apply {
+ colorBackground = Color.BLACK
+ }
+ val secondThumbnailData =
+ ThumbnailData(
+ thumbnail =
+ mock<Bitmap>().apply {
+ whenever(width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(height).thenReturn(THUMBNAIL_HEIGHT)
+ },
+ appearance = APPEARANCE_DARK_THEME
+ )
+
+ tasksRepository.seedTasks(listOf(firstTask, secondTask))
+ tasksRepository.seedThumbnailData(
+ mapOf(FIRST_TASK_ID to firstThumbnailData, SECOND_TASK_ID to secondThumbnailData)
+ )
+ tasksRepository.setVisibleTasks(listOf(FIRST_TASK_ID, SECOND_TASK_ID))
+ }
+
+ companion object {
+ const val FIRST_TASK_ID = 0
+ const val SECOND_TASK_ID = 100
+ const val UNKNOWN_TASK_ID = 404
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+ const val APPEARANCE_LIGHT_THEME = 24
+ const val FLAGS_APPEARANCE_LIGHT_THEME = 5
+ const val APPEARANCE_DARK_THEME = 0
+ const val FLAGS_APPEARANCE_DARK_THEME = 10
+ const val FLAGS_DEFAULT = 0
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/viewmodel/RecentsViewModelTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/viewmodel/RecentsViewModelTest.kt
new file mode 100644
index 0000000..fe67313
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/recents/viewmodel/RecentsViewModelTest.kt
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.recents.viewmodel
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import android.view.Surface
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.task.thumbnail.TaskThumbnailViewModelTest
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+class RecentsViewModelTest {
+ private val tasksRepository = FakeTasksRepository()
+ private val recentsViewData = RecentsViewData()
+ private val systemUnderTest = RecentsViewModel(tasksRepository, recentsViewData)
+
+ private val tasks = (0..5).map(::createTaskWithId)
+
+ @Test
+ fun taskVisibilityControlThumbnailsAvailability() = runTest {
+ val thumbnailData1 = createThumbnailData()
+ val thumbnailData2 = createThumbnailData()
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.seedThumbnailData(mapOf(1 to thumbnailData1, 2 to thumbnailData2))
+
+ val thumbnailDataFlow1 = tasksRepository.getThumbnailById(1)
+ val thumbnailDataFlow2 = tasksRepository.getThumbnailById(2)
+
+ systemUnderTest.refreshAllTaskData()
+
+ assertThat(thumbnailDataFlow1.first()).isNull()
+ assertThat(thumbnailDataFlow2.first()).isNull()
+
+ systemUnderTest.updateVisibleTasks(listOf(1, 2))
+
+ assertThat(thumbnailDataFlow1.first()).isEqualTo(thumbnailData1)
+ assertThat(thumbnailDataFlow2.first()).isEqualTo(thumbnailData2)
+
+ systemUnderTest.updateVisibleTasks(listOf(1))
+
+ assertThat(thumbnailDataFlow1.first()).isEqualTo(thumbnailData1)
+ assertThat(thumbnailDataFlow2.first()).isNull()
+
+ systemUnderTest.onReset()
+
+ assertThat(thumbnailDataFlow1.first()).isNull()
+ assertThat(thumbnailDataFlow2.first()).isNull()
+ }
+
+ private fun createTaskWithId(taskId: Int) =
+ Task(Task.TaskKey(taskId, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.argb(taskId, taskId, taskId, taskId)
+ }
+
+ private fun createThumbnailData(rotation: Int = Surface.ROTATION_0): ThumbnailData {
+ val bitmap = mock<Bitmap>()
+ whenever(bitmap.width).thenReturn(TaskThumbnailViewModelTest.THUMBNAIL_WIDTH)
+ whenever(bitmap.height).thenReturn(TaskThumbnailViewModelTest.THUMBNAIL_HEIGHT)
+
+ return ThumbnailData(thumbnail = bitmap, rotation = rotation)
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCaseTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCaseTest.kt
new file mode 100644
index 0000000..a584d71
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/SplashAlphaUseCaseTest.kt
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.thumbnail
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import android.graphics.drawable.Drawable
+import android.view.Surface
+import android.view.Surface.ROTATION_90
+import com.android.quickstep.recents.data.FakeRecentsRotationStateRepository
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.recents.data.TaskIconQueryResponse
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.viewmodel.TaskContainerData
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+class SplashAlphaUseCaseTest {
+ private val recentsViewData = RecentsViewData()
+ private val taskContainerData = TaskContainerData()
+ private val taskThumbnailViewData = TaskThumbnailViewData()
+ private val recentTasksRepository = FakeTasksRepository()
+ private val recentsRotationStateRepository = FakeRecentsRotationStateRepository()
+ private val systemUnderTest =
+ SplashAlphaUseCase(
+ recentsViewData,
+ taskContainerData,
+ taskThumbnailViewData,
+ recentTasksRepository,
+ recentsRotationStateRepository
+ )
+
+ @Test
+ fun execute_withNullThumbnail_showsSplash() = runTest {
+ assertThat(systemUnderTest.execute(0).first()).isEqualTo(SPLASH_HIDDEN)
+ }
+
+ @Test
+ fun execute_withTaskSpecificSplashAlpha_showsSplash() = runTest {
+ setupTask(2)
+ taskContainerData.thumbnailSplashProgress.value = 0.7f
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(0.7f)
+ }
+
+ @Test
+ fun execute_withNoGlobalSplashEnabled_doesntShowSplash() = runTest {
+ setupTask(2)
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(SPLASH_HIDDEN)
+ }
+
+ @Test
+ fun execute_withSameAspectRatioAndRotation_withGlobalSplashEnabled_doesntShowSplash() =
+ runTest {
+ setupTask(2)
+ recentsViewData.thumbnailSplashProgress.value = 0.5f
+ taskThumbnailViewData.width.value = THUMBNAIL_WIDTH * 2
+ taskThumbnailViewData.height.value = THUMBNAIL_HEIGHT * 2
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(SPLASH_HIDDEN)
+ }
+
+ @Test
+ fun execute_withDifferentAspectRatioAndSameRotation_showsSplash() = runTest {
+ setupTask(2)
+ recentsViewData.thumbnailSplashProgress.value = 0.5f
+ taskThumbnailViewData.width.value = THUMBNAIL_WIDTH
+ taskThumbnailViewData.height.value = THUMBNAIL_HEIGHT * 2
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(0.5f)
+ }
+
+ @Test
+ fun execute_withSameAspectRatioAndDifferentRotation_showsSplash() = runTest {
+ setupTask(2, createThumbnailData(rotation = ROTATION_90))
+ recentsViewData.thumbnailSplashProgress.value = 0.5f
+ taskThumbnailViewData.width.value = THUMBNAIL_WIDTH * 2
+ taskThumbnailViewData.height.value = THUMBNAIL_HEIGHT * 2
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(0.5f)
+ }
+
+ @Test
+ fun execute_withDifferentAspectRatioAndRotation_showsSplash() = runTest {
+ setupTask(2, createThumbnailData(rotation = ROTATION_90))
+ recentsViewData.thumbnailSplashProgress.value = 0.5f
+ taskThumbnailViewData.width.value = THUMBNAIL_WIDTH
+ taskThumbnailViewData.height.value = THUMBNAIL_HEIGHT * 2
+
+ assertThat(systemUnderTest.execute(2).first()).isEqualTo(0.5f)
+ }
+
+ private val tasks = (0..5).map(::createTaskWithId)
+
+ private fun setupTask(taskId: Int, thumbnailData: ThumbnailData = createThumbnailData()) {
+ recentTasksRepository.seedThumbnailData(mapOf(taskId to thumbnailData))
+ val expectedIconData = createIconData("Task $taskId")
+ recentTasksRepository.seedIconData(mapOf(taskId to expectedIconData))
+ recentTasksRepository.seedTasks(tasks)
+ recentTasksRepository.setVisibleTasks(listOf(taskId))
+ }
+
+ private fun createThumbnailData(
+ rotation: Int = Surface.ROTATION_0,
+ width: Int = THUMBNAIL_WIDTH,
+ height: Int = THUMBNAIL_HEIGHT
+ ): ThumbnailData {
+ val bitmap = mock<Bitmap>()
+ whenever(bitmap.width).thenReturn(width)
+ whenever(bitmap.height).thenReturn(height)
+
+ return ThumbnailData(thumbnail = bitmap, rotation = rotation)
+ }
+
+ private fun createIconData(title: String) = TaskIconQueryResponse(mock<Drawable>(), "", title)
+
+ private fun createTaskWithId(taskId: Int) =
+ Task(Task.TaskKey(taskId, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.argb(taskId, taskId, taskId, taskId)
+ }
+
+ companion object {
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+
+ const val SPLASH_HIDDEN = 0f
+ const val SPLASH_SHOWN = 1f
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModelTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModelTest.kt
index e71192f..fcf4e56 100644
--- a/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModelTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/thumbnail/TaskThumbnailViewModelTest.kt
@@ -16,39 +16,295 @@
package com.android.quickstep.task.thumbnail
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import android.graphics.Matrix
+import android.graphics.drawable.Drawable
+import android.view.Surface
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.recents.data.TaskIconQueryResponse
+import com.android.quickstep.recents.usecase.GetThumbnailPositionUseCase
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MatrixScaling
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MissingThumbnail
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.BackgroundOnly
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.LiveTile
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Snapshot
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.SnapshotSplash
+import com.android.quickstep.task.thumbnail.TaskThumbnailUiState.Uninitialized
+import com.android.quickstep.task.viewmodel.TaskContainerData
+import com.android.quickstep.task.viewmodel.TaskThumbnailViewModel
+import com.android.quickstep.task.viewmodel.TaskViewData
+import com.android.quickstep.views.TaskViewType
import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+/** Test for [TaskThumbnailView] */
@RunWith(AndroidJUnit4::class)
class TaskThumbnailViewModelTest {
- private val systemUnderTest = TaskThumbnailViewModel()
+ private var taskViewType = TaskViewType.SINGLE
+ private val recentsViewData = RecentsViewData()
+ private val taskViewData by lazy { TaskViewData(taskViewType) }
+ private val taskContainerData = TaskContainerData()
+ private val tasksRepository = FakeTasksRepository()
+ private val mGetThumbnailPositionUseCase = mock<GetThumbnailPositionUseCase>()
+ private val splashAlphaUseCase: SplashAlphaUseCase = mock()
+ private val systemUnderTest by lazy {
+ TaskThumbnailViewModel(
+ recentsViewData,
+ taskViewData,
+ taskContainerData,
+ tasksRepository,
+ mGetThumbnailPositionUseCase,
+ splashAlphaUseCase,
+ )
+ }
+
+ private val tasks = (0..5).map(::createTaskWithId)
@Test
- fun initialStateIsUninitialized() {
- assertThat(systemUnderTest.uiState.value).isEqualTo(TaskThumbnailUiState.Uninitialized)
+ fun initialStateIsUninitialized() = runTest {
+ assertThat(systemUnderTest.uiState.first()).isEqualTo(Uninitialized)
}
@Test
- fun bindRunningTask_thenStateIs_LiveTile() {
- val taskThumbnail = TaskThumbnail(Task(), isRunning = true)
- systemUnderTest.bind(taskThumbnail)
+ fun bindRunningTask_thenStateIs_LiveTile() = runTest {
+ val taskId = 1
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(taskId))
+ recentsViewData.runningTaskIds.value = setOf(taskId)
+ systemUnderTest.bind(taskId)
- assertThat(systemUnderTest.uiState.value).isEqualTo(TaskThumbnailUiState.LiveTile)
+ assertThat(systemUnderTest.uiState.first()).isEqualTo(LiveTile)
}
@Test
- fun bindRunningTaskThenStoppedTask_thenStateIs_Uninitialized() {
- // TODO(b/334825222): Change the expectation here when snapshot state is implemented
- val task = Task()
- val runningTask = TaskThumbnail(task, isRunning = true)
- val stoppedTask = TaskThumbnail(task, isRunning = false)
- systemUnderTest.bind(runningTask)
- assertThat(systemUnderTest.uiState.value).isEqualTo(TaskThumbnailUiState.LiveTile)
+ fun bindRunningTaskShouldShowScreenshot_thenStateIs_SnapshotSplash() = runTest {
+ val taskId = 1
+ val expectedThumbnailData = createThumbnailData()
+ tasksRepository.seedThumbnailData(mapOf(taskId to expectedThumbnailData))
+ val expectedIconData = createIconData("Task 1")
+ tasksRepository.seedIconData(mapOf(taskId to expectedIconData))
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(taskId))
+ recentsViewData.runningTaskIds.value = setOf(taskId)
+ recentsViewData.runningTaskShowScreenshot.value = true
+ systemUnderTest.bind(taskId)
- systemUnderTest.bind(stoppedTask)
- assertThat(systemUnderTest.uiState.value).isEqualTo(TaskThumbnailUiState.Uninitialized)
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(
+ SnapshotSplash(
+ Snapshot(
+ backgroundColor = Color.rgb(1, 1, 1),
+ bitmap = expectedThumbnailData.thumbnail!!,
+ thumbnailRotation = Surface.ROTATION_0,
+ ),
+ expectedIconData.icon
+ )
+ )
+ }
+
+ @Test
+ fun setRecentsFullscreenProgress_thenCornerRadiusProgressIsPassedThrough() = runTest {
+ recentsViewData.fullscreenProgress.value = 0.5f
+
+ assertThat(systemUnderTest.cornerRadiusProgress.first()).isEqualTo(0.5f)
+
+ recentsViewData.fullscreenProgress.value = 0.6f
+
+ assertThat(systemUnderTest.cornerRadiusProgress.first()).isEqualTo(0.6f)
+ }
+
+ @Test
+ fun setRecentsFullscreenProgress_thenCornerRadiusProgressIsConstantForDesktop() = runTest {
+ taskViewType = TaskViewType.DESKTOP
+ recentsViewData.fullscreenProgress.value = 0.5f
+
+ assertThat(systemUnderTest.cornerRadiusProgress.first()).isEqualTo(1f)
+
+ recentsViewData.fullscreenProgress.value = 0.6f
+
+ assertThat(systemUnderTest.cornerRadiusProgress.first()).isEqualTo(1f)
+ }
+
+ @Test
+ fun setAncestorScales_thenScaleIsCalculated() = runTest {
+ recentsViewData.scale.value = 0.5f
+ taskViewData.scale.value = 0.6f
+
+ assertThat(systemUnderTest.inheritedScale.first()).isEqualTo(0.3f)
+ }
+
+ @Test
+ fun bindRunningTaskThenStoppedTaskWithoutThumbnail_thenStateChangesToBackgroundOnly() =
+ runTest {
+ val runningTaskId = 1
+ val stoppedTaskId = 2
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(runningTaskId, stoppedTaskId))
+ recentsViewData.runningTaskIds.value = setOf(runningTaskId)
+ systemUnderTest.bind(runningTaskId)
+ assertThat(systemUnderTest.uiState.first()).isEqualTo(LiveTile)
+
+ systemUnderTest.bind(stoppedTaskId)
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(BackgroundOnly(backgroundColor = Color.rgb(2, 2, 2)))
+ }
+
+ @Test
+ fun bindStoppedTaskWithoutThumbnail_thenStateIs_BackgroundOnly_withAlphaRemoved() = runTest {
+ val stoppedTaskId = 2
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(stoppedTaskId))
+
+ systemUnderTest.bind(stoppedTaskId)
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(BackgroundOnly(backgroundColor = Color.rgb(2, 2, 2)))
+ }
+
+ @Test
+ fun bindLockedTaskWithThumbnail_thenStateIs_BackgroundOnly() = runTest {
+ val taskId = 2
+ tasksRepository.seedThumbnailData(mapOf(taskId to createThumbnailData()))
+ tasks[taskId].isLocked = true
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(taskId))
+
+ systemUnderTest.bind(taskId)
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(BackgroundOnly(backgroundColor = Color.rgb(2, 2, 2)))
+ }
+
+ @Test
+ fun bindStoppedTaskWithThumbnail_thenStateIs_SnapshotSplash_withAlphaRemoved() = runTest {
+ val taskId = 2
+ val expectedThumbnailData = createThumbnailData(rotation = Surface.ROTATION_270)
+ tasksRepository.seedThumbnailData(mapOf(taskId to expectedThumbnailData))
+ val expectedIconData = createIconData("Task 2")
+ tasksRepository.seedIconData(mapOf(taskId to expectedIconData))
+ tasksRepository.seedTasks(tasks)
+ tasksRepository.setVisibleTasks(listOf(taskId))
+
+ systemUnderTest.bind(taskId)
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(
+ SnapshotSplash(
+ Snapshot(
+ backgroundColor = Color.rgb(2, 2, 2),
+ bitmap = expectedThumbnailData.thumbnail!!,
+ thumbnailRotation = Surface.ROTATION_270,
+ ),
+ expectedIconData.icon
+ )
+ )
+ }
+
+ @Test
+ fun bindNonVisibleStoppedTask_whenMadeVisible_thenStateIsSnapshotSplash() = runTest {
+ val taskId = 2
+ val expectedThumbnailData = createThumbnailData()
+ tasksRepository.seedThumbnailData(mapOf(taskId to expectedThumbnailData))
+ val expectedIconData = createIconData("Task 2")
+ tasksRepository.seedIconData(mapOf(taskId to expectedIconData))
+ tasksRepository.seedTasks(tasks)
+
+ systemUnderTest.bind(taskId)
+ assertThat(systemUnderTest.uiState.first()).isEqualTo(Uninitialized)
+
+ tasksRepository.setVisibleTasks(listOf(taskId))
+ assertThat(systemUnderTest.uiState.first())
+ .isEqualTo(
+ SnapshotSplash(
+ Snapshot(
+ backgroundColor = Color.rgb(2, 2, 2),
+ bitmap = expectedThumbnailData.thumbnail!!,
+ thumbnailRotation = Surface.ROTATION_0,
+ ),
+ expectedIconData.icon
+ )
+ )
+ }
+
+ @Test
+ fun getSnapshotMatrix_MissingThumbnail() = runTest {
+ val taskId = 2
+ val isRtl = true
+
+ whenever(mGetThumbnailPositionUseCase.run(taskId, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .thenReturn(MissingThumbnail)
+
+ systemUnderTest.bind(taskId)
+ assertThat(systemUnderTest.getThumbnailPositionState(CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .isEqualTo(Matrix.IDENTITY_MATRIX)
+ }
+
+ @Test
+ fun getSnapshotMatrix_MatrixScaling() = runTest {
+ val taskId = 2
+ val isRtl = true
+
+ whenever(mGetThumbnailPositionUseCase.run(taskId, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .thenReturn(MatrixScaling(MATRIX, isRotated = false))
+
+ systemUnderTest.bind(taskId)
+ assertThat(systemUnderTest.getThumbnailPositionState(CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .isEqualTo(MATRIX)
+ }
+
+ @Test
+ fun getForegroundScrimDimProgress_returnsForegroundMaxScrim() = runTest {
+ recentsViewData.tintAmount.value = 0.32f
+ taskContainerData.taskMenuOpenProgress.value = 0f
+ assertThat(systemUnderTest.dimProgress.first()).isEqualTo(0.32f)
+ }
+
+ @Test
+ fun getTaskMenuScrimDimProgress_returnsTaskMenuScrim() = runTest {
+ recentsViewData.tintAmount.value = 0f
+ taskContainerData.taskMenuOpenProgress.value = 1f
+ assertThat(systemUnderTest.dimProgress.first()).isEqualTo(0.4f)
+ }
+
+ @Test
+ fun getForegroundScrimDimProgress_returnsNoScrim() = runTest {
+ recentsViewData.tintAmount.value = 0f
+ taskContainerData.taskMenuOpenProgress.value = 0f
+ assertThat(systemUnderTest.dimProgress.first()).isEqualTo(0f)
+ }
+
+ private fun createTaskWithId(taskId: Int) =
+ Task(Task.TaskKey(taskId, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.argb(taskId, taskId, taskId, taskId)
+ }
+
+ private fun createThumbnailData(rotation: Int = Surface.ROTATION_0): ThumbnailData {
+ val bitmap = mock<Bitmap>()
+ whenever(bitmap.width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(bitmap.height).thenReturn(THUMBNAIL_HEIGHT)
+
+ return ThumbnailData(thumbnail = bitmap, rotation = rotation)
+ }
+
+ private fun createIconData(title: String) = TaskIconQueryResponse(mock<Drawable>(), "", title)
+
+ companion object {
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+ const val CANVAS_WIDTH = 300
+ const val CANVAS_HEIGHT = 600
+ val MATRIX =
+ Matrix().apply {
+ setValues(floatArrayOf(2.3f, 4.5f, 2.6f, 7.4f, 3.4f, 2.3f, 2.5f, 6.0f, 3.4f))
+ }
}
}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModelTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModelTest.kt
new file mode 100644
index 0000000..d0887df
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/task/viewmodel/TaskOverlayViewModelTest.kt
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.task.viewmodel
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Bitmap
+import android.graphics.Color
+import android.graphics.Matrix
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.quickstep.recents.data.FakeTasksRepository
+import com.android.quickstep.recents.usecase.GetThumbnailPositionUseCase
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MatrixScaling
+import com.android.quickstep.recents.usecase.ThumbnailPositionState.MissingThumbnail
+import com.android.quickstep.recents.viewmodel.RecentsViewData
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Disabled
+import com.android.quickstep.task.thumbnail.TaskOverlayUiState.Enabled
+import com.android.quickstep.task.viewmodel.TaskOverlayViewModel.ThumbnailPositionState
+import com.android.systemui.shared.recents.model.Task
+import com.android.systemui.shared.recents.model.ThumbnailData
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [TaskOverlayViewModel] */
+@RunWith(AndroidJUnit4::class)
+class TaskOverlayViewModelTest {
+ private val task =
+ Task(Task.TaskKey(TASK_ID, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ colorBackground = Color.BLACK
+ }
+ private val thumbnailData =
+ ThumbnailData(
+ thumbnail =
+ mock<Bitmap>().apply {
+ whenever(width).thenReturn(THUMBNAIL_WIDTH)
+ whenever(height).thenReturn(THUMBNAIL_HEIGHT)
+ }
+ )
+ private val recentsViewData = RecentsViewData()
+ private val tasksRepository = FakeTasksRepository()
+ private val mGetThumbnailPositionUseCase = mock<GetThumbnailPositionUseCase>()
+ private val systemUnderTest =
+ TaskOverlayViewModel(task, recentsViewData, mGetThumbnailPositionUseCase, tasksRepository)
+
+ @Test
+ fun initialStateIsDisabled() = runTest {
+ assertThat(systemUnderTest.overlayState.first()).isEqualTo(Disabled)
+ }
+
+ @Test
+ fun recentsViewOverlayDisabled_Disabled() = runTest {
+ recentsViewData.overlayEnabled.value = false
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf(TASK_ID)
+
+ assertThat(systemUnderTest.overlayState.first()).isEqualTo(Disabled)
+ }
+
+ @Test
+ fun taskNotFullyVisible_Disabled() = runTest {
+ recentsViewData.overlayEnabled.value = true
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf()
+
+ assertThat(systemUnderTest.overlayState.first()).isEqualTo(Disabled)
+ }
+
+ @Test
+ fun noThumbnail_Enabled() = runTest {
+ recentsViewData.overlayEnabled.value = true
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf(TASK_ID)
+ task.isLocked = false
+
+ assertThat(systemUnderTest.overlayState.first())
+ .isEqualTo(
+ Enabled(
+ isRealSnapshot = false,
+ thumbnail = null,
+ )
+ )
+ }
+
+ @Test
+ fun withThumbnail_RealSnapshot_NotLocked_Enabled() = runTest {
+ recentsViewData.overlayEnabled.value = true
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf(TASK_ID)
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.seedThumbnailData(mapOf(TASK_ID to thumbnailData))
+ tasksRepository.setVisibleTasks(listOf(TASK_ID))
+ thumbnailData.isRealSnapshot = true
+ task.isLocked = false
+
+ assertThat(systemUnderTest.overlayState.first())
+ .isEqualTo(
+ Enabled(
+ isRealSnapshot = true,
+ thumbnail = thumbnailData.thumbnail,
+ )
+ )
+ }
+
+ @Test
+ fun withThumbnail_RealSnapshot_Locked_Enabled() = runTest {
+ recentsViewData.overlayEnabled.value = true
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf(TASK_ID)
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.seedThumbnailData(mapOf(TASK_ID to thumbnailData))
+ tasksRepository.setVisibleTasks(listOf(TASK_ID))
+ thumbnailData.isRealSnapshot = true
+ task.isLocked = true
+
+ assertThat(systemUnderTest.overlayState.first())
+ .isEqualTo(
+ Enabled(
+ isRealSnapshot = false,
+ thumbnail = thumbnailData.thumbnail,
+ )
+ )
+ }
+
+ @Test
+ fun withThumbnail_FakeSnapshot_Enabled() = runTest {
+ recentsViewData.overlayEnabled.value = true
+ recentsViewData.settledFullyVisibleTaskIds.value = setOf(TASK_ID)
+ tasksRepository.seedTasks(listOf(task))
+ tasksRepository.seedThumbnailData(mapOf(TASK_ID to thumbnailData))
+ tasksRepository.setVisibleTasks(listOf(TASK_ID))
+ thumbnailData.isRealSnapshot = false
+ task.isLocked = false
+
+ assertThat(systemUnderTest.overlayState.first())
+ .isEqualTo(
+ Enabled(
+ isRealSnapshot = false,
+ thumbnail = thumbnailData.thumbnail,
+ )
+ )
+ }
+
+ @Test
+ fun getThumbnailMatrix_MissingThumbnail() = runTest {
+ val isRtl = true
+
+ whenever(mGetThumbnailPositionUseCase.run(TASK_ID, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .thenReturn(MissingThumbnail)
+
+ assertThat(systemUnderTest.getThumbnailPositionState(CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .isEqualTo(ThumbnailPositionState(Matrix.IDENTITY_MATRIX, isRotated = false))
+ }
+
+ @Test
+ fun getThumbnailMatrix_MatrixScaling() = runTest {
+ val isRtl = true
+ val isRotated = true
+
+ whenever(mGetThumbnailPositionUseCase.run(TASK_ID, CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .thenReturn(MatrixScaling(MATRIX, isRotated))
+
+ assertThat(systemUnderTest.getThumbnailPositionState(CANVAS_WIDTH, CANVAS_HEIGHT, isRtl))
+ .isEqualTo(ThumbnailPositionState(MATRIX, isRotated))
+ }
+
+ companion object {
+ const val TASK_ID = 0
+ const val THUMBNAIL_WIDTH = 100
+ const val THUMBNAIL_HEIGHT = 200
+ const val CANVAS_WIDTH = 300
+ const val CANVAS_HEIGHT = 600
+ val MATRIX =
+ Matrix().apply {
+ setValues(floatArrayOf(2.3f, 4.5f, 2.6f, 7.4f, 3.4f, 2.3f, 2.5f, 6.0f, 3.4f))
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/taskbar/customization/TaskbarSpecsEvaluatorTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/taskbar/customization/TaskbarSpecsEvaluatorTest.kt
new file mode 100644
index 0000000..d66197a
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/taskbar/customization/TaskbarSpecsEvaluatorTest.kt
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.taskbar.customization
+
+import com.android.launcher3.taskbar.TaskbarActivityContext
+import com.android.launcher3.taskbar.customization.TaskbarFeatureEvaluator
+import com.android.launcher3.taskbar.customization.TaskbarIconSpecs
+import com.android.launcher3.taskbar.customization.TaskbarSpecsEvaluator
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.whenever
+
+@RunWith(LauncherMultivalentJUnit::class)
+class TaskbarSpecsEvaluatorTest {
+
+ private val taskbarFeatureEvaluator = mock<TaskbarFeatureEvaluator>()
+ private val taskbarActivityContext = mock<TaskbarActivityContext>()
+ private var taskbarSpecsEvaluator =
+ spy(TaskbarSpecsEvaluator(taskbarActivityContext, taskbarFeatureEvaluator, 0, 0))
+
+ @Test
+ fun testGetIconSizeByGrid_whenTaskbarIsTransient_withValidRowAndColumnInLandscape() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ doReturn(true).whenever(taskbarFeatureEvaluator).isLandscape
+ assertThat(taskbarSpecsEvaluator.getIconSizeByGrid(4, 4))
+ .isEqualTo(TaskbarIconSpecs.iconSize52dp)
+ }
+
+ @Test
+ fun testGetIconSizeByGrid_whenTaskbarIsTransient_withValidRowAndColumnInPortrait() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ doReturn(false).whenever(taskbarFeatureEvaluator).isLandscape
+ assertThat(taskbarSpecsEvaluator.getIconSizeByGrid(4, 4))
+ .isEqualTo(TaskbarIconSpecs.iconSize48dp)
+ }
+
+ @Test
+ fun testGetIconSizeByGrid_whenTaskbarIsTransient_withInvalidRowAndColumn() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeByGrid(1, 2))
+ .isEqualTo(TaskbarIconSpecs.defaultTransientIconSize)
+ }
+
+ @Test
+ fun testGetIconSizeByGrid_whenTaskbarIsPersistent() {
+ doReturn(false).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeByGrid(6, 5))
+ .isEqualTo(TaskbarIconSpecs.defaultPersistentIconSize)
+ }
+
+ @Test
+ fun testGetIconSizeStepDown_whenTaskbarIsPersistent() {
+ doReturn(false).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepDown(TaskbarIconSpecs.iconSize44dp))
+ .isEqualTo(TaskbarIconSpecs.defaultPersistentIconSize)
+ }
+
+ @Test
+ fun testGetIconSizeStepDown_whenTaskbarIsTransientAndIconSizeAreInBound() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepDown(TaskbarIconSpecs.iconSize52dp))
+ .isEqualTo(TaskbarIconSpecs.iconSize48dp)
+ }
+
+ @Test
+ fun testGetIconSizeStepDown_whenTaskbarIsTransientAndIconSizeAreOutOfBound() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepDown(TaskbarIconSpecs.iconSize44dp))
+ .isEqualTo(TaskbarIconSpecs.iconSize44dp)
+ }
+
+ @Test
+ fun testGetIconSizeStepUp_whenTaskbarIsPersistent() {
+ doReturn(false).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepUp(TaskbarIconSpecs.iconSize40dp))
+ .isEqualTo(TaskbarIconSpecs.iconSize40dp)
+ }
+
+ @Test
+ fun testGetIconSizeStepUp_whenTaskbarIsTransientAndIconSizeAreInBound() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepUp(TaskbarIconSpecs.iconSize44dp))
+ .isEqualTo(TaskbarIconSpecs.iconSize48dp)
+ }
+
+ @Test
+ fun testGetIconSizeStepUp_whenTaskbarIsTransientAndIconSizeAreOutOfBound() {
+ doReturn(true).whenever(taskbarFeatureEvaluator).isTransient
+ assertThat(taskbarSpecsEvaluator.getIconSizeStepUp(TaskbarIconSpecs.iconSize52dp))
+ .isEqualTo(TaskbarIconSpecs.iconSize52dp)
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/util/AppPairsControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/AppPairsControllerTest.kt
similarity index 98%
rename from quickstep/tests/src/com/android/quickstep/util/AppPairsControllerTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/quickstep/util/AppPairsControllerTest.kt
index ece67af..99d3121 100644
--- a/quickstep/tests/src/com/android/quickstep/util/AppPairsControllerTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/AppPairsControllerTest.kt
@@ -28,9 +28,9 @@
import com.android.quickstep.TopTaskTracker.CachedTaskInfo
import com.android.systemui.shared.recents.model.Task
import com.android.systemui.shared.recents.model.Task.TaskKey
-import com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_30_70
-import com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_50_50
-import com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_70_30
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_30_70
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_70_30
import java.util.function.Consumer
import org.junit.Assert.assertEquals
import org.junit.Before
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/util/DesktopTaskTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/DesktopTaskTest.kt
new file mode 100644
index 0000000..7aed579
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/DesktopTaskTest.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.util
+
+import android.content.ComponentName
+import android.content.Intent
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.systemui.shared.recents.model.Task
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+class DesktopTaskTest {
+
+ @Test
+ fun testDesktopTask_sameInstance_isEqual() {
+ val task = DesktopTask(createTasks(1))
+ assertThat(task).isEqualTo(task)
+ }
+
+ @Test
+ fun testDesktopTask_identicalConstructor_isEqual() {
+ val task1 = DesktopTask(createTasks(1))
+ val task2 = DesktopTask(createTasks(1))
+ assertThat(task1).isEqualTo(task2)
+ }
+
+ @Test
+ fun testDesktopTask_copy_isEqual() {
+ val task1 = DesktopTask(createTasks(1))
+ val task2 = task1.copy()
+ assertThat(task1).isEqualTo(task2)
+ }
+
+ @Test
+ fun testDesktopTask_differentId_isNotEqual() {
+ val task1 = DesktopTask(createTasks(1))
+ val task2 = DesktopTask(createTasks(2))
+ assertThat(task1).isNotEqualTo(task2)
+ }
+
+ @Test
+ fun testDesktopTask_differentLength_isNotEqual() {
+ val task1 = DesktopTask(createTasks(1))
+ val task2 = DesktopTask(createTasks(1, 2))
+ assertThat(task1).isNotEqualTo(task2)
+ }
+
+ private fun createTasks(vararg ids: Int): List<Task> {
+ return ids.map { Task(Task.TaskKey(it, 0, Intent(), ComponentName("", ""), 0, 0)) }
+ }
+}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/util/GroupTaskTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/GroupTaskTest.kt
new file mode 100644
index 0000000..7b1c066
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/GroupTaskTest.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.util
+
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.Rect
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.quickstep.views.TaskViewType
+import com.android.systemui.shared.recents.model.Task
+import com.android.wm.shell.shared.split.SplitScreenConstants
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(LauncherMultivalentJUnit::class)
+class GroupTaskTest {
+
+ @Test
+ fun testGroupTask_sameInstance_isEqual() {
+ val task = GroupTask(createTask(1))
+ assertThat(task).isEqualTo(task)
+ }
+
+ @Test
+ fun testGroupTask_identicalConstructor_isEqual() {
+ val task1 = GroupTask(createTask(1))
+ val task2 = GroupTask(createTask(1))
+ assertThat(task1).isEqualTo(task2)
+ }
+
+ @Test
+ fun testGroupTask_copy_isEqual() {
+ val task1 = GroupTask(createTask(1))
+ val task2 = task1.copy()
+ assertThat(task1).isEqualTo(task2)
+ }
+
+ @Test
+ fun testGroupTask_differentId_isNotEqual() {
+ val task1 = GroupTask(createTask(1))
+ val task2 = GroupTask(createTask(2))
+ assertThat(task1).isNotEqualTo(task2)
+ }
+
+ @Test
+ fun testGroupTask_equalSplitTasks_isEqual() {
+ val splitBounds =
+ SplitConfigurationOptions.SplitBounds(
+ Rect(),
+ Rect(),
+ 1,
+ 2,
+ SplitScreenConstants.SNAP_TO_50_50
+ )
+ val task1 = GroupTask(createTask(1), createTask(2), splitBounds, TaskViewType.GROUPED)
+ val task2 = GroupTask(createTask(1), createTask(2), splitBounds, TaskViewType.GROUPED)
+ assertThat(task1).isEqualTo(task2)
+ }
+
+ @Test
+ fun testGroupTask_differentSplitTasks_isNotEqual() {
+ val splitBounds1 =
+ SplitConfigurationOptions.SplitBounds(
+ Rect(),
+ Rect(),
+ 1,
+ 2,
+ SplitScreenConstants.SNAP_TO_50_50
+ )
+ val splitBounds2 =
+ SplitConfigurationOptions.SplitBounds(
+ Rect(),
+ Rect(),
+ 1,
+ 2,
+ SplitScreenConstants.SNAP_TO_30_70
+ )
+ val task1 = GroupTask(createTask(1), createTask(2), splitBounds1, TaskViewType.GROUPED)
+ val task2 = GroupTask(createTask(1), createTask(2), splitBounds2, TaskViewType.GROUPED)
+ assertThat(task1).isNotEqualTo(task2)
+ }
+
+ @Test
+ fun testGroupTask_differentType_isNotEqual() {
+ val task1 = GroupTask(createTask(1), null, null, TaskViewType.SINGLE)
+ val task2 = GroupTask(createTask(1), null, null, TaskViewType.DESKTOP)
+ assertThat(task1).isNotEqualTo(task2)
+ }
+
+ private fun createTask(id: Int): Task {
+ return Task(Task.TaskKey(id, 0, Intent(), ComponentName("", ""), 0, 0))
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
similarity index 100%
rename from quickstep/tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
rename to quickstep/tests/multivalentTests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
diff --git a/quickstep/tests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt
similarity index 79%
rename from quickstep/tests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt
rename to quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt
index de98703..5051251 100644
--- a/quickstep/tests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitAnimationControllerTest.kt
@@ -27,15 +27,15 @@
import android.window.TransitionInfo
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.launcher3.apppairs.AppPairIcon
+import com.android.launcher3.model.data.ItemInfo
import com.android.launcher3.statehandlers.DepthController
import com.android.launcher3.statemanager.StateManager
import com.android.launcher3.taskbar.TaskbarActivityContext
import com.android.launcher3.util.SplitConfigurationOptions
import com.android.quickstep.views.GroupedTaskView
import com.android.quickstep.views.IconView
-import com.android.quickstep.views.TaskThumbnailViewDeprecated
+import com.android.quickstep.views.TaskContainer
import com.android.quickstep.views.TaskView
-import com.android.quickstep.views.TaskView.TaskIdAttributeContainer
import com.android.systemui.shared.recents.model.Task
import org.junit.Assert.assertEquals
import org.junit.Before
@@ -59,7 +59,7 @@
private val mockSplitSelectStateController: SplitSelectStateController = mock()
// TaskView
private val mockTaskView: TaskView = mock()
- private val mockThumbnailView: TaskThumbnailViewDeprecated = mock()
+ private val mockSnapshotView: View = mock()
private val mockBitmap: Bitmap = mock()
private val mockIconView: IconView = mock()
private val mockTaskViewDrawable: Drawable = mock()
@@ -67,7 +67,7 @@
private val mockGroupedTaskView: GroupedTaskView = mock()
private val mockTask: Task = mock()
private val mockTaskKey: Task.TaskKey = mock()
- private val mockTaskIdAttributeContainer: TaskIdAttributeContainer = mock()
+ private val mockTaskContainer: TaskContainer = mock()
// AppPairIcon
private val mockAppPairIcon: AppPairIcon = mock()
private val mockContextThemeWrapper: ContextThemeWrapper = mock()
@@ -77,23 +77,27 @@
private val splitSelectSource: SplitConfigurationOptions.SplitSelectSource = mock()
private val mockSplitSourceDrawable: Drawable = mock()
private val mockSplitSourceView: View = mock()
+ private val mockItemInfo: ItemInfo = mock()
- private val stateManager: StateManager<*> = mock()
+ private val stateManager: StateManager<*, *> = mock()
private val depthController: DepthController = mock()
private val transitionInfo: TransitionInfo = mock()
private val transaction: Transaction = mock()
- lateinit var splitAnimationController: SplitAnimationController
+ private lateinit var splitAnimationController: SplitAnimationController
@Before
fun setup() {
- whenever(mockTaskView.thumbnail).thenReturn(mockThumbnailView)
- whenever(mockThumbnailView.thumbnail).thenReturn(mockBitmap)
- whenever(mockTaskView.iconView).thenReturn(mockIconView)
+ whenever(mockTaskContainer.snapshotView).thenReturn(mockSnapshotView)
+ whenever(mockTaskContainer.splitAnimationThumbnail).thenReturn(mockBitmap)
+ whenever(mockTaskContainer.iconView).thenReturn(mockIconView)
+ whenever(mockTaskContainer.task).thenReturn(mockTask)
whenever(mockIconView.drawable).thenReturn(mockTaskViewDrawable)
+ whenever(mockTaskView.taskContainers).thenReturn(List(1) { mockTaskContainer })
whenever(splitSelectSource.drawable).thenReturn(mockSplitSourceDrawable)
whenever(splitSelectSource.view).thenReturn(mockSplitSourceView)
+ whenever(splitSelectSource.itemInfo).thenReturn(mockItemInfo)
splitAnimationController = SplitAnimationController(mockSplitSelectStateController)
}
@@ -177,14 +181,12 @@
// Remove icon view from GroupedTaskView
whenever(mockIconView.drawable).thenReturn(null)
- whenever(mockTaskIdAttributeContainer.task).thenReturn(mockTask)
- whenever(mockTaskIdAttributeContainer.iconView).thenReturn(mockIconView)
- whenever(mockTaskIdAttributeContainer.thumbnailView).thenReturn(mockThumbnailView)
+ whenever(mockTaskContainer.task).thenReturn(mockTask)
+ whenever(mockTaskContainer.iconView).thenReturn(mockIconView)
whenever(mockTask.getKey()).thenReturn(mockTaskKey)
whenever(mockTaskKey.getId()).thenReturn(taskId)
whenever(mockSplitSelectStateController.initialTaskId).thenReturn(taskId)
- whenever(mockGroupedTaskView.taskIdAttributeContainers)
- .thenReturn(Array(1) { mockTaskIdAttributeContainer })
+ whenever(mockGroupedTaskView.taskContainers).thenReturn(List(1) { mockTaskContainer })
val splitAnimInitProps: SplitAnimationController.Companion.SplitAnimInitProps =
splitAnimationController.getFirstAnimInitViews(
{ mockGroupedTaskView },
@@ -227,7 +229,8 @@
depthController,
null /* info */,
null /* t */,
- {} /* finishCallback */
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
verify(spySplitAnimationController)
@@ -263,7 +266,8 @@
depthController,
transitionInfo,
transaction,
- {} /* finishCallback */
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
verify(spySplitAnimationController)
@@ -276,10 +280,8 @@
whenever(mockAppPairIcon.context).thenReturn(mockContextThemeWrapper)
doNothing()
.whenever(spySplitAnimationController)
- .composeIconSplitLaunchAnimator(any(), any(), any(), any())
- doReturn(-1)
- .whenever(spySplitAnimationController)
- .hasChangesForBothAppPairs(any(), any())
+ .composeIconSplitLaunchAnimator(any(), any(), any(), any(), any())
+ doReturn(-1).whenever(spySplitAnimationController).hasChangesForBothAppPairs(any(), any())
spySplitAnimationController.playSplitLaunchAnimation(
null /* launchingTaskView */,
@@ -293,11 +295,12 @@
depthController,
transitionInfo,
transaction,
- {} /* finishCallback */
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
verify(spySplitAnimationController)
- .composeIconSplitLaunchAnimator(any(), any(), any(), any())
+ .composeIconSplitLaunchAnimator(any(), any(), any(), any(), any())
}
@Test
@@ -305,29 +308,28 @@
val spySplitAnimationController = spy(splitAnimationController)
whenever(mockAppPairIcon.context).thenReturn(mockContextThemeWrapper)
doNothing()
- .whenever(spySplitAnimationController)
- .composeFullscreenIconSplitLaunchAnimator(any(), any(), any(), any(), any())
- doReturn(0)
- .whenever(spySplitAnimationController)
- .hasChangesForBothAppPairs(any(), any())
+ .whenever(spySplitAnimationController)
+ .composeFullscreenIconSplitLaunchAnimator(any(), any(), any(), any(), any())
+ doReturn(0).whenever(spySplitAnimationController).hasChangesForBothAppPairs(any(), any())
spySplitAnimationController.playSplitLaunchAnimation(
- null /* launchingTaskView */,
- mockAppPairIcon,
- taskId,
- taskId2,
- null /* apps */,
- null /* wallpapers */,
- null /* nonApps */,
- stateManager,
- depthController,
- transitionInfo,
- transaction,
- {} /* finishCallback */
+ null /* launchingTaskView */,
+ mockAppPairIcon,
+ taskId,
+ taskId2,
+ null /* apps */,
+ null /* wallpapers */,
+ null /* nonApps */,
+ stateManager,
+ depthController,
+ transitionInfo,
+ transaction,
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
verify(spySplitAnimationController)
- .composeFullscreenIconSplitLaunchAnimator(any(), any(), any(), any(), eq(0))
+ .composeFullscreenIconSplitLaunchAnimator(any(), any(), any(), any(), eq(0))
}
@Test
@@ -337,9 +339,7 @@
doNothing()
.whenever(spySplitAnimationController)
.composeScaleUpLaunchAnimation(any(), any(), any(), any())
- doReturn(-1)
- .whenever(spySplitAnimationController)
- .hasChangesForBothAppPairs(any(), any())
+ doReturn(-1).whenever(spySplitAnimationController).hasChangesForBothAppPairs(any(), any())
spySplitAnimationController.playSplitLaunchAnimation(
null /* launchingTaskView */,
mockAppPairIcon,
@@ -352,11 +352,12 @@
depthController,
transitionInfo,
transaction,
- {} /* finishCallback */
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
- verify(spySplitAnimationController).composeScaleUpLaunchAnimation(any(), any(), any(),
- eq(WINDOWING_MODE_MULTI_WINDOW))
+ verify(spySplitAnimationController)
+ .composeScaleUpLaunchAnimation(any(), any(), any(), eq(WINDOWING_MODE_MULTI_WINDOW))
}
@Test
@@ -364,28 +365,27 @@
val spySplitAnimationController = spy(splitAnimationController)
whenever(mockAppPairIcon.context).thenReturn(mockTaskbarActivityContext)
doNothing()
- .whenever(spySplitAnimationController)
- .composeScaleUpLaunchAnimation(any(), any(), any(), any())
- doReturn(0)
- .whenever(spySplitAnimationController)
- .hasChangesForBothAppPairs(any(), any())
+ .whenever(spySplitAnimationController)
+ .composeScaleUpLaunchAnimation(any(), any(), any(), any())
+ doReturn(0).whenever(spySplitAnimationController).hasChangesForBothAppPairs(any(), any())
spySplitAnimationController.playSplitLaunchAnimation(
- null /* launchingTaskView */,
- mockAppPairIcon,
- taskId,
- taskId2,
- null /* apps */,
- null /* wallpapers */,
- null /* nonApps */,
- stateManager,
- depthController,
- transitionInfo,
- transaction,
- {} /* finishCallback */
+ null /* launchingTaskView */,
+ mockAppPairIcon,
+ taskId,
+ taskId2,
+ null /* apps */,
+ null /* wallpapers */,
+ null /* nonApps */,
+ stateManager,
+ depthController,
+ transitionInfo,
+ transaction,
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
- verify(spySplitAnimationController).composeScaleUpLaunchAnimation(any(), any(), any(),
- eq(WINDOWING_MODE_FULLSCREEN))
+ verify(spySplitAnimationController)
+ .composeScaleUpLaunchAnimation(any(), any(), any(), eq(WINDOWING_MODE_FULLSCREEN))
}
@Test
@@ -393,7 +393,7 @@
val spySplitAnimationController = spy(splitAnimationController)
doNothing()
.whenever(spySplitAnimationController)
- .composeFadeInSplitLaunchAnimator(any(), any(), any(), any(), any())
+ .composeFadeInSplitLaunchAnimator(any(), any(), any(), any(), any(), any())
spySplitAnimationController.playSplitLaunchAnimation(
null /* launchingTaskView */,
@@ -407,10 +407,11 @@
depthController,
transitionInfo,
transaction,
- {} /* finishCallback */
+ {} /* finishCallback */,
+ 1f /* cornerRadius */
)
verify(spySplitAnimationController)
- .composeFadeInSplitLaunchAnimator(any(), any(), any(), any(), any())
+ .composeFadeInSplitLaunchAnimator(any(), any(), any(), any(), any(), any())
}
}
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitSelectStateControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitSelectStateControllerTest.kt
index 0de5f19..fc4c4f6 100644
--- a/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitSelectStateControllerTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/SplitSelectStateControllerTest.kt
@@ -39,7 +39,7 @@
import com.android.quickstep.util.SplitSelectStateController.SplitFromDesktopController
import com.android.quickstep.views.RecentsViewContainer
import com.android.systemui.shared.recents.model.Task
-import com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_50_50
+import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50
import java.util.function.Consumer
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
@@ -62,7 +62,7 @@
private val depthController: DepthController = mock()
private val statsLogManager: StatsLogManager = mock()
private val statsLogger: StatsLogger = mock()
- private val stateManager: StateManager<LauncherState> = mock()
+ private val stateManager: StateManager<LauncherState, StatefulActivity<LauncherState>> = mock()
private val handler: Handler = mock()
private val context: RecentsViewContainer = mock()
private val recentsModel: RecentsModel = mock()
@@ -121,7 +121,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(nonMatchingComponent),
false /* findExactPairMatch */,
@@ -174,7 +174,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(matchingComponent),
false /* findExactPairMatch */,
@@ -215,7 +215,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(nonPrimaryUserComponent),
false /* findExactPairMatch */,
@@ -271,7 +271,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(nonPrimaryUserComponent),
false /* findExactPairMatch */,
@@ -324,7 +324,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(matchingComponent),
false /* findExactPairMatch */,
@@ -378,7 +378,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(nonMatchingComponent, matchingComponent),
false /* findExactPairMatch */,
@@ -431,7 +431,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(matchingComponent, matchingComponent),
false /* findExactPairMatch */,
@@ -497,7 +497,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(matchingComponent, matchingComponent),
false /* findExactPairMatch */,
@@ -549,7 +549,7 @@
// Capture callback from recentsModel#getTasks()
val consumer =
- argumentCaptor<Consumer<ArrayList<GroupTask>>> {
+ argumentCaptor<Consumer<List<GroupTask>>> {
splitSelectStateController.findLastActiveTasksAndRunCallback(
listOf(matchingComponent2, matchingComponent),
true /* findExactPairMatch */,
diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/util/TestExtensions.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/TestExtensions.kt
new file mode 100644
index 0000000..6c526a4
--- /dev/null
+++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/util/TestExtensions.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep.util
+
+import com.android.launcher3.BuildConfig
+import com.android.launcher3.util.SafeCloseable
+import com.android.quickstep.DeviceConfigWrapper.Companion.configHelper
+import com.android.quickstep.util.DeviceConfigHelper.Companion.prefs
+import java.util.concurrent.CountDownLatch
+import java.util.function.BooleanSupplier
+import org.junit.Assert
+import org.junit.Assume
+
+/** Helper methods for testing */
+object TestExtensions {
+
+ @JvmStatic
+ fun overrideNavConfigFlag(
+ key: String,
+ value: Boolean,
+ targetValue: BooleanSupplier
+ ): AutoCloseable {
+ Assume.assumeTrue(BuildConfig.IS_DEBUG_DEVICE)
+ if (targetValue.asBoolean == value) {
+ return AutoCloseable {}
+ }
+
+ navConfigEditWatcher().let {
+ prefs.edit().putBoolean(key, value).commit()
+ it.close()
+ }
+ Assert.assertEquals(value, targetValue.asBoolean)
+
+ val watcher = navConfigEditWatcher()
+ return AutoCloseable {
+ prefs.edit().remove(key).commit()
+ watcher.close()
+ }
+ }
+
+ private fun navConfigEditWatcher(): SafeCloseable {
+ val wait = CountDownLatch(1)
+ val listener = Runnable { wait.countDown() }
+ configHelper.addChangeListener(listener)
+
+ return SafeCloseable {
+ wait.await()
+ configHelper.removeChangeListener(listener)
+ }
+ }
+}
diff --git a/quickstep/tests/multivalentTestsForDeviceless b/quickstep/tests/multivalentTestsForDeviceless
deleted file mode 120000
index fa0fabf..0000000
--- a/quickstep/tests/multivalentTestsForDeviceless
+++ /dev/null
@@ -1 +0,0 @@
-./multivalentTests
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java b/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
index 8702f70..7b57c81 100644
--- a/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
+++ b/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
@@ -184,7 +184,7 @@
}
@Test
- public void widgetsRecommendationRan_shouldReturnPackageWidgetsWhenEmpty() {
+ public void widgetsRecommendationRan_shouldReturnEmptyWidgetsWhenEmpty() {
runOnExecutorSync(MODEL_EXECUTOR, () -> {
// Not installed widget
@@ -204,19 +204,12 @@
newWidgetsPredicationTask(List.of(widget5, widget3, widget4, widget1)));
runOnExecutorSync(MAIN_EXECUTOR, () -> { });
- // THEN only 2 widgets are returned because the launcher only filters out
- // non-exist widgets.
+ // Only widgets suggested by prediction system are returned.
List<PendingAddWidgetInfo> recommendedWidgets = mCallback.mRecommendedWidgets.items
.stream()
.map(itemInfo -> (PendingAddWidgetInfo) itemInfo)
.collect(Collectors.toList());
- assertThat(recommendedWidgets).hasSize(2);
- recommendedWidgets.forEach(pendingAddWidgetInfo ->
- assertThat(pendingAddWidgetInfo.recommendationCategory).isNotNull()
- );
- // Another widget from the same package
- assertWidgetInfo(recommendedWidgets.get(0).info, mApp4Provider2);
- assertWidgetInfo(recommendedWidgets.get(1).info, mApp1Provider1);
+ assertThat(recommendedWidgets).hasSize(0);
});
}
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsControllerTest.kt b/quickstep/tests/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsControllerTest.kt
deleted file mode 100644
index 4fafde8..0000000
--- a/quickstep/tests/src/com/android/launcher3/taskbar/DesktopTaskbarRunningAppsControllerTest.kt
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.taskbar
-
-import android.app.ActivityManager.RunningTaskInfo
-import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
-import android.content.ComponentName
-import android.content.Intent
-import android.os.Process
-import android.os.UserHandle
-import android.testing.AndroidTestingRunner
-import com.android.launcher3.model.data.AppInfo
-import com.android.launcher3.model.data.ItemInfo
-import com.android.launcher3.statehandlers.DesktopVisibilityController
-import com.android.quickstep.RecentsModel
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.Mock
-import org.mockito.junit.MockitoJUnit
-import org.mockito.kotlin.whenever
-
-@RunWith(AndroidTestingRunner::class)
-class DesktopTaskbarRunningAppsControllerTest : TaskbarBaseTestCase() {
-
- @get:Rule val mockitoRule = MockitoJUnit.rule()
-
- @Mock private lateinit var mockRecentsModel: RecentsModel
- @Mock private lateinit var mockDesktopVisibilityController: DesktopVisibilityController
-
- private var nextTaskId: Int = 500
-
- private lateinit var taskbarRunningAppsController: DesktopTaskbarRunningAppsController
- private lateinit var userHandle: UserHandle
-
- @Before
- fun setUp() {
- super.setup()
- userHandle = Process.myUserHandle()
- taskbarRunningAppsController =
- DesktopTaskbarRunningAppsController(mockRecentsModel) {
- mockDesktopVisibilityController
- }
- taskbarRunningAppsController.init(taskbarControllers)
- taskbarRunningAppsController.setApps(
- ALL_APP_PACKAGES.map { createTestAppInfo(packageName = it) }.toTypedArray()
- )
- }
-
- @Test
- fun updateHotseatItemInfos_notInDesktopMode_returnsExistingHotseatItems() {
- setInDesktopMode(false)
- val hotseatItems =
- createHotseatItemsFromPackageNames(listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2))
-
- assertThat(taskbarRunningAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray()))
- .isEqualTo(hotseatItems.toTypedArray())
- }
-
- @Test
- fun updateHotseatItemInfos_notInDesktopMode_runningApps_returnsExistingHotseatItems() {
- setInDesktopMode(false)
- val hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2)
- val hotseatItems = createHotseatItemsFromPackageNames(hotseatPackages)
- val runningTasks =
- createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
- whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
- taskbarRunningAppsController.updateRunningApps()
-
- val newHotseatItems =
- taskbarRunningAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray())
-
- assertThat(newHotseatItems.map { it?.targetPackage }).isEqualTo(hotseatPackages)
- }
-
- @Test
- fun updateHotseatItemInfos_noRunningApps_returnsExistingHotseatItems() {
- setInDesktopMode(true)
- val hotseatItems =
- createHotseatItemsFromPackageNames(listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2))
-
- assertThat(taskbarRunningAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray()))
- .isEqualTo(hotseatItems.toTypedArray())
- }
-
- @Test
- fun updateHotseatItemInfos_returnsExistingHotseatItemsAndRunningApps() {
- setInDesktopMode(true)
- val hotseatItems =
- createHotseatItemsFromPackageNames(listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2))
- val runningTasks =
- createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
- whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
- taskbarRunningAppsController.updateRunningApps()
-
- val newHotseatItems =
- taskbarRunningAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray())
-
- val expectedPackages =
- listOf(
- HOTSEAT_PACKAGE_1,
- HOTSEAT_PACKAGE_2,
- RUNNING_APP_PACKAGE_1,
- RUNNING_APP_PACKAGE_2,
- )
- assertThat(newHotseatItems.map { it?.targetPackage }).isEqualTo(expectedPackages)
- }
-
- @Test
- fun updateHotseatItemInfos_runningAppIsHotseatItem_returnsDistinctItems() {
- setInDesktopMode(true)
- val hotseatItems =
- createHotseatItemsFromPackageNames(listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2))
- val runningTasks =
- createDesktopTasksFromPackageNames(
- listOf(HOTSEAT_PACKAGE_1, RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2)
- )
- whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
- taskbarRunningAppsController.updateRunningApps()
-
- val newHotseatItems =
- taskbarRunningAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray())
-
- val expectedPackages =
- listOf(
- HOTSEAT_PACKAGE_1,
- HOTSEAT_PACKAGE_2,
- RUNNING_APP_PACKAGE_1,
- RUNNING_APP_PACKAGE_2,
- )
- assertThat(newHotseatItems.map { it?.targetPackage }).isEqualTo(expectedPackages)
- }
-
- @Test
- fun getRunningApps_notInDesktopMode_returnsEmptySet() {
- setInDesktopMode(false)
- val runningTasks =
- createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
- whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
- taskbarRunningAppsController.updateRunningApps()
-
- assertThat(taskbarRunningAppsController.runningApps).isEqualTo(emptySet<String>())
- }
-
- @Test
- fun getRunningApps_inDesktopMode_returnsRunningApps() {
- setInDesktopMode(true)
- val runningTasks =
- createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
- whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
- taskbarRunningAppsController.updateRunningApps()
-
- assertThat(taskbarRunningAppsController.runningApps)
- .isEqualTo(setOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
- }
-
- private fun createHotseatItemsFromPackageNames(packageNames: List<String>): List<ItemInfo> {
- return packageNames.map { createTestAppInfo(packageName = it) }
- }
-
- private fun createDesktopTasksFromPackageNames(
- packageNames: List<String>
- ): ArrayList<RunningTaskInfo> {
- return ArrayList(packageNames.map { createDesktopTaskInfo(packageName = it) })
- }
-
- private fun createDesktopTaskInfo(packageName: String): RunningTaskInfo {
- return RunningTaskInfo().apply {
- taskId = nextTaskId++
- configuration.windowConfiguration.windowingMode = WINDOWING_MODE_FREEFORM
- realActivity = ComponentName(packageName, "TestActivity")
- }
- }
-
- private fun createTestAppInfo(
- packageName: String = "testPackageName",
- className: String = "testClassName"
- ) = AppInfo(ComponentName(packageName, className), className /* title */, userHandle, Intent())
-
- private fun setInDesktopMode(inDesktopMode: Boolean) {
- whenever(mockDesktopVisibilityController.areDesktopTasksVisible()).thenReturn(inDesktopMode)
- }
-
- private companion object {
- const val HOTSEAT_PACKAGE_1 = "hotseat1"
- const val HOTSEAT_PACKAGE_2 = "hotseat2"
- const val RUNNING_APP_PACKAGE_1 = "running1"
- const val RUNNING_APP_PACKAGE_2 = "running2"
- const val RUNNING_APP_PACKAGE_3 = "running3"
- val ALL_APP_PACKAGES =
- listOf(
- HOTSEAT_PACKAGE_1,
- HOTSEAT_PACKAGE_2,
- RUNNING_APP_PACKAGE_1,
- RUNNING_APP_PACKAGE_2,
- RUNNING_APP_PACKAGE_3,
- )
- }
-}
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/FallbackTaskbarUIControllerTest.kt b/quickstep/tests/src/com/android/launcher3/taskbar/FallbackTaskbarUIControllerTest.kt
index f3115c6..04012c0 100644
--- a/quickstep/tests/src/com/android/launcher3/taskbar/FallbackTaskbarUIControllerTest.kt
+++ b/quickstep/tests/src/com/android/launcher3/taskbar/FallbackTaskbarUIControllerTest.kt
@@ -37,7 +37,7 @@
lateinit var stateListener: StateManager.StateListener<RecentsState>
private val recentsActivity: RecentsActivity = mock()
- private val stateManager: StateManager<RecentsState> = mock()
+ private val stateManager: StateManager<RecentsState, RecentsActivity> = mock()
@Before
override fun setup() {
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarBaseTestCase.kt b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarBaseTestCase.kt
index 15b1e53..d064f4a 100644
--- a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarBaseTestCase.kt
+++ b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarBaseTestCase.kt
@@ -57,6 +57,7 @@
@Mock lateinit var keyboardQuickSwitchController: KeyboardQuickSwitchController
@Mock lateinit var taskbarPinningController: TaskbarPinningController
@Mock lateinit var optionalBubbleControllers: Optional<BubbleControllers>
+ @Mock lateinit var taskbarDesktopModeController: TaskbarDesktopModeController
lateinit var taskbarControllers: TaskbarControllers
@@ -98,6 +99,7 @@
keyboardQuickSwitchController,
taskbarPinningController,
optionalBubbleControllers,
+ taskbarDesktopModeController
)
}
}
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java
index 9ed3906..67a0ee4 100644
--- a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java
+++ b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java
@@ -39,6 +39,7 @@
import androidx.test.filters.SmallTest;
import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.model.data.FolderInfo;
@@ -66,6 +67,7 @@
@Mock private MotionEvent mMotionEvent;
@Mock private BubbleTextView mHoverBubbleTextView;
@Mock private FolderIcon mHoverFolderIcon;
+ @Mock private AppPairIcon mAppPairIcon;
@Mock private Display mDisplay;
@Mock private TaskbarDragLayer mTaskbarDragLayer;
private Folder mSpyFolderView;
@@ -85,6 +87,7 @@
when(taskbarActivityContext.getDragLayer()).thenReturn(mTaskbarDragLayer);
when(taskbarActivityContext.getMainLooper()).thenReturn(context.getMainLooper());
when(taskbarActivityContext.getDisplay()).thenReturn(mDisplay);
+ when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(false);
when(mTaskbarDragLayer.getChildCount()).thenReturn(1);
mSpyFolderView = spy(new Folder(new ActivityContextWrapper(context), null));
@@ -199,7 +202,7 @@
boolean hoverHandled =
mTaskbarHoverToolTipController.onHover(mHoverFolderIcon, mMotionEvent);
- assertThat(hoverHandled).isFalse();
+ assertThat(hoverHandled).isTrue();
}
@Test
@@ -210,7 +213,50 @@
boolean hoverHandled =
mTaskbarHoverToolTipController.onHover(mHoverFolderIcon, mMotionEvent);
- assertThat(hoverHandled).isFalse();
+ assertThat(hoverHandled).isTrue();
+ }
+
+ @Test
+ public void onHover_hoverEnterAppPair_revealToolTip() {
+ when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
+ when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
+
+ boolean hoverHandled =
+ mTaskbarHoverToolTipController.onHover(mAppPairIcon, mMotionEvent);
+ waitForIdleSync();
+
+ assertThat(hoverHandled).isTrue();
+ verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS,
+ true);
+ }
+
+ @Test
+ public void onHover_hoverExitAppPair_closeToolTip() {
+ when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_EXIT);
+ when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_EXIT);
+
+ boolean hoverHandled =
+ mTaskbarHoverToolTipController.onHover(mAppPairIcon, mMotionEvent);
+ waitForIdleSync();
+
+ assertThat(hoverHandled).isTrue();
+ verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS,
+ false);
+ }
+
+ @Test
+ public void onHover_hoverEnterIconAlignedWithHotseat_noReveal() {
+ when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
+ when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
+ when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(true);
+
+ boolean hoverHandled =
+ mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent);
+ waitForIdleSync();
+
+ assertThat(hoverHandled).isTrue();
+ verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS,
+ true);
}
private void waitForIdleSync() {
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarKeyguardControllerTest.kt b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarKeyguardControllerTest.kt
index ed88c29..e619e7c 100644
--- a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarKeyguardControllerTest.kt
+++ b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarKeyguardControllerTest.kt
@@ -105,7 +105,7 @@
verify(navbarButtonsViewController, times(1)).setBackForBouncer(false)
}
- private fun setFlags(flags: Int) {
+ private fun setFlags(flags: Long) {
taskbarKeyguardController.updateStateForSysuiFlags(flags)
}
}
diff --git a/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt
new file mode 100644
index 0000000..88ffeea
--- /dev/null
+++ b/quickstep/tests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt
@@ -0,0 +1,846 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.taskbar
+
+import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.content.res.Resources
+import android.os.Process
+import android.os.UserHandle
+import android.platform.test.rule.TestWatcher
+import android.testing.AndroidTestingRunner
+import com.android.internal.R
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION
+import com.android.launcher3.model.data.AppInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.TaskItemInfo
+import com.android.launcher3.statehandlers.DesktopVisibilityController
+import com.android.quickstep.RecentsModel
+import com.android.quickstep.RecentsModel.RecentTasksChangedListener
+import com.android.quickstep.TaskIconCache
+import com.android.quickstep.util.DesktopTask
+import com.android.quickstep.util.GroupTask
+import com.android.systemui.shared.recents.model.Task
+import com.google.common.truth.Truth.assertThat
+import java.util.function.Consumer
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.Description
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+import org.mockito.kotlin.never
+import org.mockito.kotlin.times
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@RunWith(AndroidTestingRunner::class)
+class TaskbarRecentAppsControllerTest : TaskbarBaseTestCase() {
+
+ @get:Rule val mockitoRule = MockitoJUnit.rule()
+ @get:Rule
+ val disableControllerForCertainTestsWatcher =
+ object : TestWatcher() {
+ override fun starting(description: Description) {
+ // Update canShowRunningAndRecentAppsAtInit before setUp() is called for each test.
+ canShowRunningAndRecentAppsAtInit =
+ description.methodName !in
+ listOf(
+ "canShowRunningAndRecentAppsAtInitIsFalse_getTasksNeverCalled",
+ )
+ }
+ }
+
+ @Mock private lateinit var mockIconCache: TaskIconCache
+ @Mock private lateinit var mockRecentsModel: RecentsModel
+ @Mock private lateinit var mockContext: Context
+ @Mock private lateinit var mockResources: Resources
+ @Mock private lateinit var mockDesktopVisibilityController: DesktopVisibilityController
+
+ private var taskListChangeId: Int = 1
+
+ private lateinit var recentAppsController: TaskbarRecentAppsController
+ private lateinit var userHandle: UserHandle
+
+ private var canShowRunningAndRecentAppsAtInit = true
+ private var recentTasksChangedListener: RecentTasksChangedListener? = null
+
+ @Before
+ fun setUp() {
+ super.setup()
+ userHandle = Process.myUserHandle()
+
+ // Set desktop mode supported
+ whenever(mockContext.getResources()).thenReturn(mockResources)
+ whenever(mockResources.getBoolean(R.bool.config_isDesktopModeSupported)).thenReturn(true)
+
+ whenever(mockRecentsModel.iconCache).thenReturn(mockIconCache)
+ whenever(mockRecentsModel.unregisterRecentTasksChangedListener()).then {
+ recentTasksChangedListener = null
+ it
+ }
+ recentAppsController =
+ TaskbarRecentAppsController(mockContext, mockRecentsModel) {
+ mockDesktopVisibilityController
+ }
+ recentAppsController.canShowRunningApps = canShowRunningAndRecentAppsAtInit
+ recentAppsController.canShowRecentApps = canShowRunningAndRecentAppsAtInit
+ recentAppsController.init(taskbarControllers)
+
+ recentTasksChangedListener =
+ if (canShowRunningAndRecentAppsAtInit) {
+ val listenerCaptor = ArgumentCaptor.forClass(RecentTasksChangedListener::class.java)
+ verify(mockRecentsModel)
+ .registerRecentTasksChangedListener(listenerCaptor.capture())
+ listenerCaptor.value
+ } else {
+ verify(mockRecentsModel, never()).registerRecentTasksChangedListener(any())
+ null
+ }
+
+ // Make sure updateHotseatItemInfos() is called after commitRunningAppsToUI()
+ whenever(taskbarViewController.commitRunningAppsToUI()).then {
+ recentAppsController.updateHotseatItemInfos(
+ recentAppsController.shownHotseatItems.toTypedArray()
+ )
+ }
+ }
+
+ // See the TestWatcher rule at the top which sets canShowRunningAndRecentAppsAtInit = false.
+ @Test
+ fun canShowRunningAndRecentAppsAtInitIsFalse_getTasksNeverCalled() {
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2),
+ runningTasks = listOf(createTask(1, RUNNING_APP_PACKAGE_1)),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ verify(mockRecentsModel, never()).getTasks(any<Consumer<List<GroupTask>>>())
+ }
+
+ @Test
+ fun canShowRunningAndRecentAppsIsFalseAfterInit_getTasksOnlyCalledInInit() {
+ // getTasks() should have been called once from init().
+ verify(mockRecentsModel, times(1)).getTasks(any<Consumer<List<GroupTask>>>())
+ recentAppsController.canShowRunningApps = false
+ recentAppsController.canShowRecentApps = false
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2),
+ runningTasks = listOf(createTask(1, RUNNING_APP_PACKAGE_1)),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ // Verify that getTasks() was not called again after the init().
+ verify(mockRecentsModel, times(1)).getTasks(any<Consumer<List<GroupTask>>>())
+ }
+
+ @Test
+ fun updateHotseatItemInfos_cantShowRunning_inDesktopMode_returnsAllHotseatItems() {
+ recentAppsController.canShowRunningApps = false
+ setInDesktopMode(true)
+ val hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1)
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = hotseatPackages,
+ runningTasks = emptyList(),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(newHotseatItems.map { it?.targetPackage })
+ .containsExactlyElementsIn(hotseatPackages)
+ }
+
+ @Test
+ fun updateHotseatItemInfos_cantShowRecent_notInDesktopMode_returnsAllHotseatItems() {
+ recentAppsController.canShowRecentApps = false
+ setInDesktopMode(false)
+ val hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1)
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = hotseatPackages,
+ runningTasks = emptyList(),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(newHotseatItems.map { it?.targetPackage })
+ .containsExactlyElementsIn(hotseatPackages)
+ }
+
+ @Test
+ fun updateHotseatItemInfos_canShowRunning_inDesktopMode_returnsNonPredictedHotseatItems() {
+ recentAppsController.canShowRunningApps = true
+ setInDesktopMode(true)
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1),
+ runningTasks = emptyList(),
+ recentTaskPackages = emptyList()
+ )
+ val expectedPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2)
+ assertThat(newHotseatItems.map { it?.targetPackage })
+ .containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun updateHotseatItemInfos_inDesktopMode_hotseatPackageHasRunningTask_hotseatItemLinksToTask() {
+ setInDesktopMode(true)
+
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2),
+ runningTasks = listOf(createTask(id = 1, HOTSEAT_PACKAGE_1)),
+ recentTaskPackages = emptyList()
+ )
+
+ assertThat(newHotseatItems).hasLength(2)
+ assertThat(newHotseatItems[0]).isInstanceOf(TaskItemInfo::class.java)
+ assertThat(newHotseatItems[1]).isNotInstanceOf(TaskItemInfo::class.java)
+ val hotseatItem1 = newHotseatItems[0] as TaskItemInfo
+ assertThat(hotseatItem1.taskId).isEqualTo(1)
+ }
+
+ @Test
+ fun updateHotseatItemInfos_inDesktopMode_twoRunningTasksSamePackage_hotseatCoversFirstTask() {
+ setInDesktopMode(true)
+
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2),
+ runningTasks =
+ listOf(
+ createTask(id = 1, HOTSEAT_PACKAGE_1),
+ createTask(id = 2, HOTSEAT_PACKAGE_1)
+ ),
+ recentTaskPackages = emptyList()
+ )
+
+ // First task is in Hotseat Items
+ assertThat(newHotseatItems).hasLength(2)
+ assertThat(newHotseatItems[0]).isInstanceOf(TaskItemInfo::class.java)
+ assertThat(newHotseatItems[1]).isNotInstanceOf(TaskItemInfo::class.java)
+ val hotseatItem1 = newHotseatItems[0] as TaskItemInfo
+ assertThat(hotseatItem1.taskId).isEqualTo(1)
+ // Second task is in shownTasks
+ val shownTasks = recentAppsController.shownTasks.map { it.task1 }
+ assertThat(shownTasks)
+ .containsExactlyElementsIn(listOf(createTask(id = 2, HOTSEAT_PACKAGE_1)))
+ }
+
+ @Test
+ fun updateHotseatItemInfos_canShowRecent_notInDesktopMode_returnsNonPredictedHotseatItems() {
+ recentAppsController.canShowRecentApps = true
+ setInDesktopMode(false)
+ val newHotseatItems =
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1),
+ runningTasks = emptyList(),
+ recentTaskPackages = emptyList()
+ )
+ val expectedPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2)
+ assertThat(newHotseatItems.map { it?.targetPackage })
+ .containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun onRecentTasksChanged_cantShowRunning_inDesktopMode_shownTasks_returnsEmptyList() {
+ recentAppsController.canShowRunningApps = false
+ setInDesktopMode(true)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1),
+ runningTasks =
+ listOf(
+ createTask(id = 1, RUNNING_APP_PACKAGE_1),
+ createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ ),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.shownTasks).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_cantShowRecent_notInDesktopMode_shownTasks_returnsEmptyList() {
+ recentAppsController.canShowRecentApps = false
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2, PREDICTED_PACKAGE_1),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ assertThat(recentAppsController.shownTasks).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_noRecentTasks_shownTasks_returnsEmptyList() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks =
+ listOf(
+ createTask(id = 1, RUNNING_APP_PACKAGE_1),
+ createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ ),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.shownTasks).isEmpty()
+ assertThat(recentAppsController.minimizedTaskIds).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_noRunningApps_shownTasks_returnsEmptyList() {
+ setInDesktopMode(true)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ assertThat(recentAppsController.shownTasks).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_shownTasks_returnsRunningTasks() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ val shownTasks = recentAppsController.shownTasks.map { it.task1 }
+ assertThat(shownTasks).containsExactlyElementsIn(listOf(task1, task2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_getRunningApps_returnsEmptySet() {
+ setInDesktopMode(false)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.runningTaskIds).isEmpty()
+ assertThat(recentAppsController.minimizedTaskIds).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_getRunningApps_returnsAllDesktopTasks() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.runningTaskIds).containsExactlyElementsIn(listOf(1, 2))
+ assertThat(recentAppsController.minimizedTaskIds).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_getRunningApps_includesHotseat() {
+ setInDesktopMode(true)
+ val runningTasks =
+ listOf(
+ createTask(id = 1, HOTSEAT_PACKAGE_1),
+ createTask(id = 2, RUNNING_APP_PACKAGE_1),
+ createTask(id = 3, RUNNING_APP_PACKAGE_2)
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2),
+ runningTasks = runningTasks,
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ assertThat(recentAppsController.runningTaskIds).containsExactlyElementsIn(listOf(1, 2, 3))
+ assertThat(recentAppsController.minimizedTaskIds).isEmpty()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_allAppsRunningAndInvisibleAppsMinimized() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val task3Minimized = createTask(id = 3, RUNNING_APP_PACKAGE_3, isVisible = false)
+ val runningTasks = listOf(task1, task2, task3Minimized)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = runningTasks,
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.runningTaskIds).containsExactly(1, 2, 3)
+ assertThat(recentAppsController.minimizedTaskIds).containsExactly(3)
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_samePackage_differentTasks_severalRunningTasks() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ assertThat(recentAppsController.runningTaskIds).containsExactlyElementsIn(listOf(1, 2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_shownTasks_maintainsOrder() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task2, task1),
+ recentTaskPackages = emptyList()
+ )
+
+ val shownTasks = recentAppsController.shownTasks.map { it.task1 }
+ assertThat(shownTasks).isEqualTo(listOf(task1, task2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_multiInstance_shownTasks_maintainsOrder() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_1)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task2, task1),
+ recentTaskPackages = emptyList()
+ )
+
+ val shownTasks = recentAppsController.shownTasks.map { it.task1 }
+ assertThat(shownTasks).isEqualTo(listOf(task1, task2))
+ }
+
+ @Test
+ fun updateHotseatItems_inDesktopMode_multiInstanceHotseatPackage_shownItems_maintainsOrder() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_1)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(RUNNING_APP_PACKAGE_1),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ updateRecentTasks( // Trigger a recent-tasks change before calling updateHotseatItems()
+ runningTasks = listOf(task2, task1),
+ recentTaskPackages = emptyList()
+ )
+
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = listOf(RUNNING_APP_PACKAGE_1),
+ runningTasks = listOf(task2, task1),
+ recentTaskPackages = emptyList()
+ )
+
+ val newHotseatItems = recentAppsController.shownHotseatItems
+ assertThat(newHotseatItems).hasSize(1)
+ assertThat(newHotseatItems[0]).isInstanceOf(TaskItemInfo::class.java)
+ assertThat((newHotseatItems[0] as TaskItemInfo).taskId).isEqualTo(1)
+ val shownTasks = recentAppsController.shownTasks.map { it.task1 }
+ assertThat(shownTasks).isEqualTo(listOf(task2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_shownTasks_maintainsRecency() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2, RECENT_PACKAGE_3)
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_2, RECENT_PACKAGE_3, RECENT_PACKAGE_1)
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ // Most recent packages, minus the currently running one (RECENT_PACKAGE_1).
+ assertThat(shownPackages).isEqualTo(listOf(RECENT_PACKAGE_2, RECENT_PACKAGE_3))
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_addTask_shownTasks_maintainsOrder() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val task3 = createTask(id = 3, RUNNING_APP_PACKAGE_3)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2),
+ recentTaskPackages = emptyList()
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task2, task1, task3),
+ recentTaskPackages = emptyList()
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ val expectedOrder =
+ listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2, RUNNING_APP_PACKAGE_3)
+ assertThat(shownPackages).isEqualTo(expectedOrder)
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_addTask_shownTasks_maintainsRecency() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_3, RECENT_PACKAGE_2)
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_2, RECENT_PACKAGE_3, RECENT_PACKAGE_1)
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ // Most recent packages, minus the currently running one (RECENT_PACKAGE_1).
+ assertThat(shownPackages).isEqualTo(listOf(RECENT_PACKAGE_2, RECENT_PACKAGE_3))
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_removeTask_shownTasks_maintainsOrder() {
+ setInDesktopMode(true)
+ val task1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val task2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val task3 = createTask(id = 3, RUNNING_APP_PACKAGE_3)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1, task2, task3),
+ recentTaskPackages = emptyList()
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task2, task1),
+ recentTaskPackages = emptyList()
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ assertThat(shownPackages).isEqualTo(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_removeTask_shownTasks_maintainsRecency() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2, RECENT_PACKAGE_3)
+ )
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_2, RECENT_PACKAGE_3)
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ // Most recent packages, minus the currently running one (RECENT_PACKAGE_3).
+ assertThat(shownPackages).isEqualTo(listOf(RECENT_PACKAGE_2))
+ }
+
+ @Test
+ fun onRecentTasksChanged_enterDesktopMode_shownTasks_onlyIncludesRunningTasks() {
+ setInDesktopMode(false)
+ val runningTask1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val runningTask2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(runningTask1, runningTask2),
+ recentTaskPackages = recentTaskPackages
+ )
+
+ setInDesktopMode(true)
+ recentTasksChangedListener!!.onRecentTasksChanged()
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ assertThat(shownPackages).containsExactly(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2)
+ }
+
+ @Test
+ fun onRecentTasksChanged_exitDesktopMode_shownTasks_onlyIncludesRecentTasks() {
+ setInDesktopMode(true)
+ val runningTask1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val runningTask2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2, RECENT_PACKAGE_3)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(runningTask1, runningTask2),
+ recentTaskPackages = recentTaskPackages
+ )
+ setInDesktopMode(false)
+ recentTasksChangedListener!!.onRecentTasksChanged()
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ // Don't expect RECENT_PACKAGE_3 because it is currently running.
+ val expectedPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ assertThat(shownPackages).containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_hasRecentTasks_shownTasks_returnsRecentTasks() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2, RECENT_PACKAGE_3)
+ )
+ val shownPackages = recentAppsController.shownTasks.flatMap { it.packageNames }
+ // RECENT_PACKAGE_3 is the top task (visible to user) so should be excluded.
+ val expectedPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ assertThat(shownPackages).containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_hasRecentAndRunningTasks_shownTasks_returnsRecentTaskAndDesktopTile() {
+ setInDesktopMode(false)
+ val runningTask1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val runningTask2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(runningTask1, runningTask2),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ val shownPackages = recentAppsController.shownTasks.map { it.packageNames }
+ // Only 2 recent tasks shown: Desktop Tile + 1 Recent Task
+ val desktopTilePackages = listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2)
+ val recentTaskPackages = listOf(RECENT_PACKAGE_1)
+ val expectedPackages = listOf(desktopTilePackages, recentTaskPackages)
+ assertThat(shownPackages).containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_hasRecentAndSplitTasks_shownTasks_returnsRecentTaskAndPair() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_SPLIT_PACKAGES_1, RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ val shownPackages = recentAppsController.shownTasks.map { it.packageNames }
+ // Only 2 recent tasks shown: Pair + 1 Recent Task
+ val pairPackages = RECENT_SPLIT_PACKAGES_1.split("_")
+ val recentTaskPackages = listOf(RECENT_PACKAGE_1)
+ val expectedPackages = listOf(pairPackages, recentTaskPackages)
+ assertThat(shownPackages).containsExactlyElementsIn(expectedPackages)
+ }
+
+ @Test
+ fun onRecentTasksChanged_notInDesktopMode_noActualChangeToRecents_commitRunningAppsToUI_notCalled() {
+ setInDesktopMode(false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+ // Call onRecentTasksChanged() again with the same tasks, verify it's a no-op.
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = emptyList(),
+ recentTaskPackages = listOf(RECENT_PACKAGE_1, RECENT_PACKAGE_2)
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+ }
+
+ @Test
+ fun onRecentTasksChanged_inDesktopMode_noActualChangeToRunning_commitRunningAppsToUI_notCalled() {
+ setInDesktopMode(true)
+ val runningTask1 = createTask(id = 1, RUNNING_APP_PACKAGE_1)
+ val runningTask2 = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(runningTask1, runningTask2),
+ recentTaskPackages = emptyList()
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+ // Call onRecentTasksChanged() again with the same tasks, verify it's a no-op.
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(runningTask1, runningTask2),
+ recentTaskPackages = emptyList()
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+ }
+
+ @Test
+ fun onRecentTasksChanged_onlyMinimizedChanges_commitRunningAppsToUI_isCalled() {
+ setInDesktopMode(true)
+ val task1Minimized = createTask(id = 1, RUNNING_APP_PACKAGE_1, isVisible = false)
+ val task2Visible = createTask(id = 2, RUNNING_APP_PACKAGE_2)
+ val task2Minimized = createTask(id = 2, RUNNING_APP_PACKAGE_2, isVisible = false)
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1Minimized, task2Visible),
+ recentTaskPackages = emptyList()
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+
+ // Call onRecentTasksChanged() again with a new minimized app, verify we update UI.
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = emptyList(),
+ runningTasks = listOf(task1Minimized, task2Minimized),
+ recentTaskPackages = emptyList()
+ )
+
+ verify(taskbarViewController, times(2)).commitRunningAppsToUI()
+ }
+
+ @Test
+ fun onRecentTasksChanged_hotseatAppStartsRunning_commitRunningAppsToUI_isCalled() {
+ setInDesktopMode(true)
+ val hotseatPackages = listOf(HOTSEAT_PACKAGE_1, HOTSEAT_PACKAGE_2)
+ val originalTasks = listOf(createTask(id = 1, RUNNING_APP_PACKAGE_1))
+ val newTasks =
+ listOf(createTask(id = 1, RUNNING_APP_PACKAGE_1), createTask(id = 2, HOTSEAT_PACKAGE_1))
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = hotseatPackages,
+ runningTasks = originalTasks,
+ recentTaskPackages = emptyList()
+ )
+ verify(taskbarViewController, times(1)).commitRunningAppsToUI()
+
+ // Call onRecentTasksChanged() again with a new running app, verify we update UI.
+ prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages = hotseatPackages,
+ runningTasks = newTasks,
+ recentTaskPackages = emptyList()
+ )
+
+ verify(taskbarViewController, times(2)).commitRunningAppsToUI()
+ }
+
+ private fun prepareHotseatAndRunningAndRecentApps(
+ hotseatPackages: List<String>,
+ runningTasks: List<Task>,
+ recentTaskPackages: List<String>,
+ ): Array<ItemInfo?> {
+ val hotseatItems = createHotseatItemsFromPackageNames(hotseatPackages)
+ recentAppsController.updateHotseatItemInfos(hotseatItems.toTypedArray())
+ updateRecentTasks(runningTasks, recentTaskPackages)
+ return recentAppsController.shownHotseatItems.toTypedArray()
+ }
+
+ private fun updateRecentTasks(
+ runningTasks: List<Task>,
+ recentTaskPackages: List<String>,
+ ) {
+ val recentTasks = createRecentTasksFromPackageNames(recentTaskPackages)
+ val allTasks =
+ ArrayList<GroupTask>().apply {
+ if (!runningTasks.isEmpty()) {
+ add(DesktopTask(ArrayList(runningTasks)))
+ }
+ addAll(recentTasks)
+ }
+ doAnswer {
+ val callback: Consumer<ArrayList<GroupTask>> = it.getArgument(0)
+ callback.accept(allTasks)
+ taskListChangeId
+ }
+ .whenever(mockRecentsModel)
+ .getTasks(any<Consumer<List<GroupTask>>>())
+ recentTasksChangedListener?.onRecentTasksChanged()
+ }
+
+ private fun createHotseatItemsFromPackageNames(packageNames: List<String>): List<ItemInfo> {
+ return packageNames
+ .map {
+ createTestAppInfo(packageName = it).apply {
+ container =
+ if (it.startsWith("predicted")) {
+ CONTAINER_HOTSEAT_PREDICTION
+ } else {
+ CONTAINER_HOTSEAT
+ }
+ }
+ }
+ .map { it.makeWorkspaceItem(taskbarActivityContext) }
+ }
+
+ private fun createTestAppInfo(
+ packageName: String = "testPackageName",
+ className: String = "testClassName"
+ ) = AppInfo(ComponentName(packageName, className), className /* title */, userHandle, Intent())
+
+ private fun createRecentTasksFromPackageNames(packageNames: List<String>): List<GroupTask> {
+ return packageNames.map { packageName ->
+ if (packageName.startsWith("split")) {
+ val splitPackages = packageName.split("_")
+ GroupTask(
+ createTask(100, splitPackages[0]),
+ createTask(101, splitPackages[1]),
+ /* splitBounds = */ null
+ )
+ } else {
+ // Use the number at the end of the test packageName as the id.
+ val id = 1000 + packageName[packageName.length - 1].code
+ GroupTask(createTask(id, packageName))
+ }
+ }
+ }
+
+ private fun createTask(id: Int, packageName: String, isVisible: Boolean = true): Task {
+ return Task(
+ Task.TaskKey(
+ id,
+ WINDOWING_MODE_FREEFORM,
+ Intent().apply { `package` = packageName },
+ ComponentName(packageName, "TestActivity"),
+ userHandle.identifier,
+ 0
+ )
+ )
+ .apply { this.isVisible = isVisible }
+ }
+
+ private fun setInDesktopMode(inDesktopMode: Boolean) {
+ whenever(mockDesktopVisibilityController.areDesktopTasksVisible()).thenReturn(inDesktopMode)
+ }
+
+ private val GroupTask.packageNames: List<String>
+ get() = tasks.map { task -> task.key.packageName }
+
+ private companion object {
+ const val HOTSEAT_PACKAGE_1 = "hotseat1"
+ const val HOTSEAT_PACKAGE_2 = "hotseat2"
+ const val PREDICTED_PACKAGE_1 = "predicted1"
+ const val RUNNING_APP_PACKAGE_1 = "running1"
+ const val RUNNING_APP_PACKAGE_2 = "running2"
+ const val RUNNING_APP_PACKAGE_3 = "running3"
+ const val RECENT_PACKAGE_1 = "recent1"
+ const val RECENT_PACKAGE_2 = "recent2"
+ const val RECENT_PACKAGE_3 = "recent3"
+ const val RECENT_SPLIT_PACKAGES_1 = "split1_split2"
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt b/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
index 0f9d96c..885a7f6 100644
--- a/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
@@ -16,12 +16,12 @@
package com.android.quickstep
-import com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn
-import com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession
-import com.android.dx.mockito.inline.extended.StaticMockitoSession
import android.content.ComponentName
import android.content.Intent
import android.platform.test.flag.junit.SetFlagsRule
+import com.android.dx.mockito.inline.extended.ExtendedMockito
+import com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession
+import com.android.dx.mockito.inline.extended.StaticMockitoSession
import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.AbstractFloatingViewHelper
import com.android.launcher3.logging.StatsLogManager
@@ -29,22 +29,31 @@
import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.uioverrides.QuickstepLauncher
import com.android.launcher3.util.SplitConfigurationOptions
+import com.android.launcher3.util.TransformingTouchDelegate
+import com.android.quickstep.TaskOverlayFactory.TaskOverlay
import com.android.quickstep.views.LauncherRecentsView
+import com.android.quickstep.views.TaskContainer
+import com.android.quickstep.views.TaskThumbnailViewDeprecated
import com.android.quickstep.views.TaskView
+import com.android.quickstep.views.TaskViewIcon
import com.android.systemui.shared.recents.model.Task
import com.android.systemui.shared.recents.model.Task.TaskKey
import com.android.window.flags.Flags
+import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
+import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource
import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
-import org.mockito.quality.Strictness
import org.mockito.kotlin.any
+import org.mockito.kotlin.doReturn
import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
+import org.mockito.quality.Strictness
/** Test for DesktopSystemShortcut */
class DesktopSystemShortcutTest {
@@ -58,21 +67,30 @@
private val taskView: TaskView = mock()
private val workspaceItemInfo: WorkspaceItemInfo = mock()
private val abstractFloatingViewHelper: AbstractFloatingViewHelper = mock()
+ private val thumbnailViewDeprecated: TaskThumbnailViewDeprecated = mock()
+ private val iconView: TaskViewIcon = mock()
+ private val transformingTouchDelegate: TransformingTouchDelegate = mock()
private val factory: TaskShortcutFactory =
DesktopSystemShortcut.createFactory(abstractFloatingViewHelper)
+ private val overlayFactory: TaskOverlayFactory = mock()
+ private val overlay: TaskOverlay<*> = mock()
private lateinit var mockitoSession: StaticMockitoSession
@Before
- fun setUp(){
- mockitoSession = mockitoSession().strictness(Strictness.LENIENT)
- .spyStatic(DesktopModeStatus::class.java).startMocking()
- doReturn(true).`when` { DesktopModeStatus.enforceDeviceRestrictions() }
- doReturn(true).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
+ fun setUp() {
+ mockitoSession =
+ mockitoSession()
+ .strictness(Strictness.LENIENT)
+ .spyStatic(DesktopModeStatus::class.java)
+ .startMocking()
+ ExtendedMockito.doReturn(true).`when` { DesktopModeStatus.enforceDeviceRestrictions() }
+ ExtendedMockito.doReturn(true).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
+ whenever(overlayFactory.createOverlay(any())).thenReturn(overlay)
}
@After
- fun tearDown(){
+ fun tearDown() {
mockitoSession.finishMocking()
}
@@ -84,13 +102,7 @@
Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
isDockable = true
}
- val taskContainer =
- taskView.TaskIdAttributeContainer(
- task,
- null,
- null,
- SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
- )
+ val taskContainer = createTaskContainer(task)
val shortcuts = factory.getShortcuts(launcher, taskContainer)
assertThat(shortcuts).isNull()
@@ -99,19 +111,9 @@
@Test
fun createDesktopTaskShortcutFactory_desktopModeEnabled_DeviceNotSupported() {
setFlagsRule.enableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE)
- doReturn(false).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
+ ExtendedMockito.doReturn(false).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
- val task =
- Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
- isDockable = true
- }
- val taskContainer =
- taskView.TaskIdAttributeContainer(
- task,
- null,
- null,
- SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
- )
+ val taskContainer = createTaskContainer(createTask())
val shortcuts = factory.getShortcuts(launcher, taskContainer)
assertThat(shortcuts).isNull()
@@ -120,20 +122,11 @@
@Test
fun createDesktopTaskShortcutFactory_desktopModeEnabled_DeviceNotSupported_OverrideEnabled() {
setFlagsRule.enableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE)
- doReturn(false).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
- doReturn(false).`when` { DesktopModeStatus.enforceDeviceRestrictions() }
+ ExtendedMockito.doReturn(false).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
+ ExtendedMockito.doReturn(false).`when` { DesktopModeStatus.enforceDeviceRestrictions() }
- val task =
- Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
- isDockable = true
- }
- val taskContainer =
- taskView.TaskIdAttributeContainer(
- task,
- null,
- null,
- SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
- )
+ val taskContainer = spy(createTaskContainer(createTask()))
+ doReturn(workspaceItemInfo).whenever(taskContainer).itemInfo
val shortcuts = factory.getShortcuts(launcher, taskContainer)
assertThat(shortcuts).isNotNull()
@@ -143,17 +136,8 @@
fun createDesktopTaskShortcutFactory_undockable() {
setFlagsRule.enableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE)
- val task =
- Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
- isDockable = false
- }
- val taskContainer =
- taskView.TaskIdAttributeContainer(
- task,
- null,
- null,
- SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
- )
+ val unDockableTask = createTask().apply { isDockable = false }
+ val taskContainer = createTaskContainer(unDockableTask)
val shortcuts = factory.getShortcuts(launcher, taskContainer)
assertThat(shortcuts).isNull()
@@ -163,27 +147,18 @@
fun desktopSystemShortcutClicked() {
setFlagsRule.enableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE)
- val task =
- Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
- isDockable = true
- }
- val taskContainer =
- taskView.TaskIdAttributeContainer(
- task,
- null,
- null,
- SplitConfigurationOptions.STAGE_POSITION_UNDEFINED
- )
+ val task = createTask()
+ val taskContainer = spy(createTaskContainer(task))
whenever(launcher.getOverviewPanel<LauncherRecentsView>()).thenReturn(recentsView)
whenever(launcher.statsLogManager).thenReturn(statsLogManager)
whenever(statsLogManager.logger()).thenReturn(statsLogger)
whenever(statsLogger.withItemInfo(any())).thenReturn(statsLogger)
- whenever(taskView.getItemInfo(task)).thenReturn(workspaceItemInfo)
- whenever(recentsView.moveTaskToDesktop(any(), any())).thenAnswer {
- val successCallback = it.getArgument<Runnable>(1)
+ whenever(recentsView.moveTaskToDesktop(any(), any(), any())).thenAnswer {
+ val successCallback = it.getArgument<Runnable>(2)
successCallback.run()
}
+ doReturn(workspaceItemInfo).whenever(taskContainer).itemInfo
val shortcuts = factory.getShortcuts(launcher, taskContainer)
assertThat(shortcuts).hasSize(1)
@@ -196,8 +171,33 @@
val allTypesExceptRebindSafe =
AbstractFloatingView.TYPE_ALL and AbstractFloatingView.TYPE_REBIND_SAFE.inv()
verify(abstractFloatingViewHelper).closeOpenViews(launcher, true, allTypesExceptRebindSafe)
- verify(recentsView).moveTaskToDesktop(eq(taskContainer), any())
+ verify(recentsView)
+ .moveTaskToDesktop(
+ eq(taskContainer),
+ eq(DesktopModeTransitionSource.APP_FROM_OVERVIEW),
+ any()
+ )
verify(statsLogger).withItemInfo(workspaceItemInfo)
verify(statsLogger).log(LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_DESKTOP_TAP)
}
+
+ private fun createTask(): Task {
+ return Task(TaskKey(1, 0, Intent(), ComponentName("", ""), 0, 2000)).apply {
+ isDockable = true
+ }
+ }
+
+ private fun createTaskContainer(task: Task): TaskContainer {
+ return TaskContainer(
+ taskView,
+ task,
+ thumbnailViewDeprecated,
+ iconView,
+ transformingTouchDelegate,
+ SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
+ digitalWellBeingToast = null,
+ showWindowsView = null,
+ overlayFactory
+ )
+ }
}
diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
index 2858929..2e456a7 100644
--- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
+++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
@@ -248,6 +248,7 @@
}
@Test
+ @ScreenRecordRule.ScreenRecord // b/355042336
public void testOverview() throws IOException {
startAppFast(getAppPackageName());
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
diff --git a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
index 094fd4c..4459ed6 100644
--- a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
+++ b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
@@ -162,8 +162,8 @@
final Context targetContext = getInstrumentation().getTargetContext();
final DisplayController.DisplayInfoChangeListener listener =
(context, info, flags) -> {
- if (LauncherInstrumentation.getNavigationModel(info.navigationMode.resValue)
- == expectedMode) {
+ if (LauncherInstrumentation.getNavigationModel(
+ info.getNavigationMode().resValue) == expectedMode) {
latch.countDown();
}
};
diff --git a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
index 298dd6c..f5d082d 100644
--- a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
+++ b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
@@ -21,6 +21,7 @@
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
@@ -288,6 +289,34 @@
assertTrue(mTouchTransformer.touchInValidSwipeRegions(inRegion2.getX(), inRegion2.getY()));
}
+ @Test
+ public void testSimpleOrientationTouchTransformer() {
+ final DisplayController displayController = mock(DisplayController.class);
+ doReturn(mInfo).when(displayController).getInfo();
+ final SimpleOrientationTouchTransformer transformer =
+ new SimpleOrientationTouchTransformer(getApplicationContext(), displayController);
+ final MotionEvent move1 = generateMotionEvent(MotionEvent.ACTION_MOVE, 100, 10);
+ transformer.transform(move1, Surface.ROTATION_90);
+ // The position is transformed to 90 degree.
+ assertEquals(10, move1.getX(), 0f /* delta */);
+ assertEquals(NORMAL_SCREEN_SIZE.getWidth() - 100, move1.getY(), 0f /* delta */);
+
+ // If the touching state is specified, the position is still transformed to 90 degree even
+ // if the given rotation is changed.
+ final MotionEvent move2 = generateMotionEvent(MotionEvent.ACTION_MOVE, 100, 10);
+ transformer.updateTouchingOrientation(Surface.ROTATION_90);
+ transformer.transform(move2, Surface.ROTATION_0);
+ assertEquals(move1.getX(), move2.getX(), 0f /* delta */);
+ assertEquals(move1.getY(), move2.getY(), 0f /* delta */);
+
+ // If the touching state is cleared, it restores to use the given rotation.
+ final MotionEvent move3 = generateMotionEvent(MotionEvent.ACTION_MOVE, 100, 10);
+ transformer.clearTouchingOrientation();
+ transformer.transform(move3, Surface.ROTATION_0);
+ assertEquals(100, move3.getX(), 0f /* delta */);
+ assertEquals(10, move3.getY(), 0f /* delta */);
+ }
+
private DisplayController.Info createDisplayInfo(Size screenSize, int rotation) {
Point displaySize = new Point(screenSize.getWidth(), screenSize.getHeight());
RotationUtils.rotateSize(displaySize, rotation);
diff --git a/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java b/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
index ed5526f..244b897 100644
--- a/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
+++ b/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
@@ -16,6 +16,8 @@
package com.android.quickstep;
+import static com.google.common.truth.Truth.assertThat;
+
import static junit.framework.TestCase.assertNull;
import static org.junit.Assert.assertEquals;
@@ -27,12 +29,17 @@
import android.app.ActivityManager;
import android.app.KeyguardManager;
+import android.content.Context;
+import android.content.res.Resources;
import androidx.test.filters.SmallTest;
+import com.android.internal.R;
import com.android.launcher3.util.LooperExecutor;
import com.android.quickstep.util.GroupTask;
-import com.android.wm.shell.util.GroupedRecentTaskInfo;
+import com.android.quickstep.views.TaskViewType;
+import com.android.systemui.shared.recents.model.Task;
+import com.android.wm.shell.shared.GroupedRecentTaskInfo;
import org.junit.Before;
import org.junit.Test;
@@ -40,14 +47,23 @@
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
@SmallTest
public class RecentTasksListTest {
@Mock
- private SystemUiProxy mockSystemUiProxy;
+ private Context mContext;
+ @Mock
+ private Resources mResources;
+ @Mock
+ private SystemUiProxy mSystemUiProxy;
+ @Mock
+ private TopTaskTracker mTopTaskTracker;
// Class under test
private RecentTasksList mRecentTasksList;
@@ -57,22 +73,27 @@
MockitoAnnotations.initMocks(this);
LooperExecutor mockMainThreadExecutor = mock(LooperExecutor.class);
KeyguardManager mockKeyguardManager = mock(KeyguardManager.class);
- mRecentTasksList = new RecentTasksList(mockMainThreadExecutor, mockKeyguardManager,
- mockSystemUiProxy);
+
+ // Set desktop mode supported
+ when(mContext.getResources()).thenReturn(mResources);
+ when(mResources.getBoolean(R.bool.config_isDesktopModeSupported)).thenReturn(true);
+
+ mRecentTasksList = new RecentTasksList(mContext, mockMainThreadExecutor,
+ mockKeyguardManager, mSystemUiProxy, mTopTaskTracker);
}
@Test
- public void onRecentTasksChanged_doesNotFetchTasks() {
+ public void onRecentTasksChanged_doesNotFetchTasks() throws Exception {
mRecentTasksList.onRecentTasksChanged();
- verify(mockSystemUiProxy, times(0))
+ verify(mSystemUiProxy, times(0))
.getRecentTasks(anyInt(), anyInt());
}
@Test
- public void loadTasksInBackground_onlyKeys_noValidTaskDescription() {
+ public void loadTasksInBackground_onlyKeys_noValidTaskDescription() throws Exception {
GroupedRecentTaskInfo recentTaskInfos = GroupedRecentTaskInfo.forSplitTasks(
new ActivityManager.RecentTaskInfo(), new ActivityManager.RecentTaskInfo(), null);
- when(mockSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
+ when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
List<GroupTask> taskList = mRecentTasksList.loadTasksInBackground(Integer.MAX_VALUE, -1,
@@ -84,7 +105,19 @@
}
@Test
- public void loadTasksInBackground_moreThanKeys_hasValidTaskDescription() {
+ public void loadTasksInBackground_GetRecentTasksException() throws Exception {
+ when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
+ .thenThrow(new SystemUiProxy.GetRecentTasksException("task load failed"));
+
+ RecentTasksList.TaskLoadResult taskList = mRecentTasksList.loadTasksInBackground(
+ Integer.MAX_VALUE, -1, false);
+
+ assertThat(taskList.mRequestId).isEqualTo(-1);
+ assertThat(taskList).isEmpty();
+ }
+
+ @Test
+ public void loadTasksInBackground_moreThanKeys_hasValidTaskDescription() throws Exception {
String taskDescription = "Wheeee!";
ActivityManager.RecentTaskInfo task1 = new ActivityManager.RecentTaskInfo();
task1.taskDescription = new ActivityManager.TaskDescription(taskDescription);
@@ -92,7 +125,7 @@
task2.taskDescription = new ActivityManager.TaskDescription();
GroupedRecentTaskInfo recentTaskInfos = GroupedRecentTaskInfo.forSplitTasks(task1, task2,
null);
- when(mockSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
+ when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
List<GroupTask> taskList = mRecentTasksList.loadTasksInBackground(Integer.MAX_VALUE, -1,
@@ -102,4 +135,53 @@
assertEquals(taskDescription, taskList.get(0).task1.taskDescription.getLabel());
assertNull(taskList.get(0).task2.taskDescription.getLabel());
}
+
+ @Test
+ public void loadTasksInBackground_freeformTask_createsDesktopTask() throws Exception {
+ ActivityManager.RecentTaskInfo[] tasks = {
+ createRecentTaskInfo(1 /* taskId */),
+ createRecentTaskInfo(4 /* taskId */),
+ createRecentTaskInfo(5 /* taskId */)};
+ GroupedRecentTaskInfo recentTaskInfos = GroupedRecentTaskInfo.forFreeformTasks(
+ tasks, Collections.emptySet() /* minimizedTaskIds */);
+ when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
+ .thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
+
+ List<GroupTask> taskList = mRecentTasksList.loadTasksInBackground(
+ Integer.MAX_VALUE /* numTasks */, -1 /* requestId */, false /* loadKeysOnly */);
+
+ assertEquals(1, taskList.size());
+ assertEquals(TaskViewType.DESKTOP, taskList.get(0).taskViewType);
+ List<Task> actualFreeformTasks = taskList.get(0).getTasks();
+ assertEquals(3, actualFreeformTasks.size());
+ assertEquals(1, actualFreeformTasks.get(0).key.id);
+ assertEquals(4, actualFreeformTasks.get(1).key.id);
+ assertEquals(5, actualFreeformTasks.get(2).key.id);
+ }
+
+ @Test
+ public void loadTasksInBackground_freeformTask_onlyMinimizedTasks_doesNotCreateDesktopTask()
+ throws Exception {
+ ActivityManager.RecentTaskInfo[] tasks = {
+ createRecentTaskInfo(1 /* taskId */),
+ createRecentTaskInfo(4 /* taskId */),
+ createRecentTaskInfo(5 /* taskId */)};
+ Set<Integer> minimizedTaskIds =
+ Arrays.stream(new Integer[]{1, 4, 5}).collect(Collectors.toSet());
+ GroupedRecentTaskInfo recentTaskInfos =
+ GroupedRecentTaskInfo.forFreeformTasks(tasks, minimizedTaskIds);
+ when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
+ .thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
+
+ List<GroupTask> taskList = mRecentTasksList.loadTasksInBackground(
+ Integer.MAX_VALUE /* numTasks */, -1 /* requestId */, false /* loadKeysOnly */);
+
+ assertEquals(0, taskList.size());
+ }
+
+ private ActivityManager.RecentTaskInfo createRecentTaskInfo(int taskId) {
+ ActivityManager.RecentTaskInfo recentTaskInfo = new ActivityManager.RecentTaskInfo();
+ recentTaskInfo.taskId = taskId;
+ return recentTaskInfo;
+ }
}
diff --git a/quickstep/tests/src/com/android/quickstep/RecentsAnimationDeviceStateTest.kt b/quickstep/tests/src/com/android/quickstep/RecentsAnimationDeviceStateTest.kt
index 2916952..80fbce7 100644
--- a/quickstep/tests/src/com/android/quickstep/RecentsAnimationDeviceStateTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/RecentsAnimationDeviceStateTest.kt
@@ -9,8 +9,19 @@
import com.android.launcher3.util.DisplayController.CHANGE_ROTATION
import com.android.launcher3.util.DisplayController.Info
import com.android.launcher3.util.NavigationMode
-import com.android.launcher3.util.window.WindowManagerProxy
import com.android.quickstep.util.GestureExclusionManager
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DREAMING
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_MAGNIFICATION_OVERLAP
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING
+import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TOUCHPAD_GESTURES_DISABLED
+import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -18,6 +29,7 @@
import org.mockito.Mockito.reset
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.doReturn
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.whenever
@@ -27,7 +39,6 @@
class RecentsAnimationDeviceStateTest {
@Mock private lateinit var exclusionManager: GestureExclusionManager
- @Mock private lateinit var windowManagerProxy: WindowManagerProxy
@Mock private lateinit var info: Info
private val context = ApplicationProvider.getApplicationContext() as Context
@@ -79,7 +90,7 @@
@Test
fun onDisplayInfoChanged_noButton_registerExclusionListener() {
- whenever(windowManagerProxy.getNavigationMode(context)).thenReturn(NavigationMode.NO_BUTTON)
+ doReturn(NavigationMode.NO_BUTTON).whenever(info).getNavigationMode()
underTest.onDisplayInfoChanged(context, info, CHANGE_ROTATION or CHANGE_NAVIGATION_MODE)
@@ -107,4 +118,88 @@
verifyZeroInteractions(exclusionManager)
}
+
+ @Test
+ fun trackpadGesturesNotAllowedForSelectedStates() {
+ val disablingStates = GESTURE_DISABLING_SYSUI_STATES +
+ SYSUI_STATE_TOUCHPAD_GESTURES_DISABLED
+
+ allSysUiStates().forEach { state ->
+ val canStartGesture = !disablingStates.contains(state)
+ underTest.setSystemUiFlags(state)
+ assertThat(underTest.canStartTrackpadGesture()).isEqualTo(canStartGesture)
+ }
+ }
+
+ @Test
+ fun trackpadGesturesNotAllowedIfHomeAndOverviewIsDisabled() {
+ val stateToExpectedResult = mapOf(
+ SYSUI_STATE_HOME_DISABLED to true,
+ SYSUI_STATE_OVERVIEW_DISABLED to true,
+ DEFAULT_STATE
+ .enable(SYSUI_STATE_OVERVIEW_DISABLED)
+ .enable(SYSUI_STATE_HOME_DISABLED) to false
+ )
+
+ stateToExpectedResult.forEach { (state, allowed) ->
+ underTest.setSystemUiFlags(state)
+ assertThat(underTest.canStartTrackpadGesture()).isEqualTo(allowed)
+ }
+ }
+
+ @Test
+ fun systemGesturesNotAllowedForSelectedStates() {
+ val disablingStates = GESTURE_DISABLING_SYSUI_STATES + SYSUI_STATE_NAV_BAR_HIDDEN
+
+ allSysUiStates().forEach { state ->
+ val canStartGesture = !disablingStates.contains(state)
+ underTest.setSystemUiFlags(state)
+ assertThat(underTest.canStartSystemGesture()).isEqualTo(canStartGesture)
+ }
+ }
+
+ @Test
+ fun systemGesturesNotAllowedWhenGestureStateDisabledAndNavBarVisible() {
+ val stateToExpectedResult = mapOf(
+ DEFAULT_STATE
+ .enable(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY)
+ .disable(SYSUI_STATE_NAV_BAR_HIDDEN) to true,
+ DEFAULT_STATE
+ .enable(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY)
+ .enable(SYSUI_STATE_NAV_BAR_HIDDEN) to true,
+ DEFAULT_STATE
+ .disable(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY)
+ .disable(SYSUI_STATE_NAV_BAR_HIDDEN) to true,
+ DEFAULT_STATE
+ .disable(SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY)
+ .enable(SYSUI_STATE_NAV_BAR_HIDDEN) to false,
+ )
+
+ stateToExpectedResult.forEach {(state, gestureAllowed) ->
+ underTest.setSystemUiFlags(state)
+ assertThat(underTest.canStartSystemGesture()).isEqualTo(gestureAllowed)
+ }
+ }
+
+ private fun allSysUiStates(): List<Long> {
+ // SYSUI_STATES_* are binary flags
+ return (0..SYSUI_STATES_COUNT).map { 1L shl it }
+ }
+
+ companion object {
+ private val GESTURE_DISABLING_SYSUI_STATES = listOf(
+ SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED,
+ SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING,
+ SYSUI_STATE_QUICK_SETTINGS_EXPANDED,
+ SYSUI_STATE_MAGNIFICATION_OVERLAP,
+ SYSUI_STATE_DEVICE_DREAMING,
+ SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION,
+ )
+ private const val SYSUI_STATES_COUNT = 33
+ private const val DEFAULT_STATE = 0L
+ }
+
+ private fun Long.enable(state: Long) = this or state
+
+ private fun Long.disable(state: Long) = this and state.inv()
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplDigitalWellBeingToastTest.java b/quickstep/tests/src/com/android/quickstep/TaplDigitalWellBeingToastTest.java
index 4aa7cb0..e981570 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplDigitalWellBeingToastTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplDigitalWellBeingToastTest.java
@@ -31,6 +31,7 @@
import com.android.launcher3.Launcher;
import com.android.quickstep.views.DigitalWellBeingToast;
import com.android.quickstep.views.RecentsView;
+import com.android.quickstep.views.TaskContainer;
import com.android.quickstep.views.TaskView;
import org.junit.Test;
@@ -66,15 +67,15 @@
mLauncher.goHome();
final DigitalWellBeingToast toast = getToast();
- waitForLauncherCondition("Toast is not visible", launcher -> toast.hasLimit());
- assertEquals("Toast text: ", "5 minutes left today", toast.getText());
+ waitForLauncherCondition("Toast is not visible", launcher -> toast.getHasLimit());
+ assertEquals("Toast text: ", "5 minutes left today", toast.getBannerText());
// Unset time limit for app.
runWithShellPermission(
() -> usageStatsManager.unregisterAppUsageLimitObserver(observerId));
mLauncher.goHome();
- assertFalse("Toast is visible", getToast().hasLimit());
+ assertFalse("Toast is visible", getToast().getHasLimit());
} finally {
runWithShellPermission(
() -> usageStatsManager.unregisterAppUsageLimitObserver(observerId));
@@ -86,9 +87,10 @@
final TaskView task = getOnceNotNull("No latest task", launcher -> getLatestTask(launcher));
return getFromLauncher(launcher -> {
- assertTrue("Latest task is not Calculator",
- CALCULATOR_PACKAGE.equals(task.getTask().getTopComponent().getPackageName()));
- return task.getDigitalWellBeingToast();
+ TaskContainer taskContainer = task.getTaskContainers().get(0);
+ assertTrue("Latest task is not Calculator", CALCULATOR_PACKAGE.equals(
+ taskContainer.getTask().getTopComponent().getPackageName()));
+ return taskContainer.getDigitalWellBeingToast();
});
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
index fa10b61..2087016 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
@@ -69,7 +69,6 @@
}
@Test
- @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/288939273
public void testSplitTaskTapBothIconMenus() {
createAndLaunchASplitPair();
@@ -88,6 +87,8 @@
}
private void createAndLaunchASplitPair() {
+ clearAllRecentTasks();
+
startTestActivity(2);
startTestActivity(3);
diff --git a/quickstep/tests/src/com/android/quickstep/TaplPrivateSpaceTest.java b/quickstep/tests/src/com/android/quickstep/TaplPrivateSpaceTest.java
index 7708233..23a29f7 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplPrivateSpaceTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplPrivateSpaceTest.java
@@ -27,6 +27,8 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import com.android.launcher3.allapps.PrivateProfileManager;
+import com.android.launcher3.tapl.HomeAllApps;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.tapl.PrivateSpaceContainer;
import com.android.launcher3.util.TestUtil;
@@ -47,6 +49,7 @@
private static final String PRIVATE_PROFILE_NAME = "LauncherPrivateProfile";
private static final String INSTALLED_APP_NAME = "Aardwolf";
+ private static final int MAX_STATE_TOGGLE_TRIES = 2;
private static final String TAG = "TaplPrivateSpaceTest";
@Override
@@ -96,14 +99,21 @@
}
@Test
- @ScreenRecordRule.ScreenRecord // b/334946529
public void testPrivateSpaceContainerIsPresent() {
// Scroll to the bottom of All Apps
executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
+ // Freeze All Apps
+ HomeAllApps homeAllApps = mLauncher.getAllApps();
+ homeAllApps.freeze();
- // Verify Unlocked View elements are present.
- assertNotNull("Private Space Unlocked View not found, or is not correct",
- mLauncher.getAllApps().getPrivateSpaceUnlockedView());
+ try {
+ // Verify Unlocked View elements are present.
+ assertNotNull("Private Space Unlocked View not found, or is not correct",
+ homeAllApps.getPrivateSpaceUnlockedView());
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
}
@Test
@@ -117,10 +127,18 @@
waitForLauncherUIUpdate();
// Scroll to the bottom of All Apps
executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
+ // Freeze All Apps
+ HomeAllApps homeAllApps = mLauncher.getAllApps();
+ homeAllApps.freeze();
- // Verify the Installed App is displayed in correct position.
- PrivateSpaceContainer psContainer = mLauncher.getAllApps().getPrivateSpaceUnlockedView();
- psContainer.verifyInstalledAppIsPresent(INSTALLED_APP_NAME);
+ try {
+ // Verify the Installed App is displayed in correct position.
+ PrivateSpaceContainer psContainer = homeAllApps.getPrivateSpaceUnlockedView();
+ psContainer.verifyInstalledAppIsPresent(INSTALLED_APP_NAME);
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
}
@Test
@@ -134,8 +152,93 @@
waitForLauncherUIUpdate();
// Scroll to the bottom of All Apps
executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
- // Get the "uninstall" menu item.
- mLauncher.getAllApps().getAppIcon(INSTALLED_APP_NAME).openMenu().getMenuItem("Uninstall");
+ // Freeze All Apps
+ HomeAllApps homeAllApps = mLauncher.getAllApps();
+ homeAllApps.freeze();
+
+ try {
+ // Get the "uninstall" menu item.
+ homeAllApps.getAppIcon(INSTALLED_APP_NAME).openMenu().getMenuItem("Uninstall app");
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
+ }
+
+ @Test
+ @ScreenRecordRule.ScreenRecord // b/334946529
+ public void testPrivateSpaceLockingBehaviour() throws IOException {
+ // Scroll to the bottom of All Apps
+ executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
+ HomeAllApps homeAllApps = mLauncher.getAllApps();
+
+ // Disable Private Space
+ togglePrivateSpaceWithRetry(PrivateProfileManager.STATE_DISABLED, homeAllApps);
+ // Scroll to the bottom of All Apps
+ executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
+
+ homeAllApps.freeze();
+ try {
+ // Verify Locked View elements are present.
+ homeAllApps.getPrivateSpaceLockedView();
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
+
+ // Enable Private Space
+ togglePrivateSpaceWithRetry(PrivateProfileManager.STATE_ENABLED, homeAllApps);
+ // Scroll to the bottom of All Apps
+ executeOnLauncher(launcher -> launcher.getAppsView().resetAndScrollToPrivateSpaceHeader());
+
+ homeAllApps.freeze();
+ try {
+ // Verify UnLocked View elements are present.
+ homeAllApps.getPrivateSpaceUnlockedView();
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
+ }
+
+ private void togglePrivateSpace(int state, HomeAllApps homeAllApps) {
+ homeAllApps.freeze();
+ try {
+ // Try Toggling Private Space
+ homeAllApps.togglePrivateSpace();
+ } finally {
+ // UnFreeze
+ homeAllApps.unfreeze();
+ }
+ PrivateProfileManager manager = getFromLauncher(l -> l.getAppsView()
+ .getPrivateProfileManager());
+ waitForLauncherCondition("Private profile toggle to state: " + state + " failed",
+ launcher -> {
+ manager.reset();
+ return manager.getCurrentState() == state;
+ },
+ LauncherInstrumentation.WAIT_TIME_MS);
+ // Wait for Launcher UI to be updated with Private Space Items.
+ waitForLauncherUIUpdate();
+ }
+
+ private void togglePrivateSpaceWithRetry(int state, HomeAllApps homeAllApps) {
+ int togglePsCount = 0;
+ boolean shouldRetry;
+ do {
+ togglePsCount ++;
+ try {
+ togglePrivateSpace(state, homeAllApps);
+ // No need to retry if the toggle was successful.
+ shouldRetry = false;
+ } catch (AssertionError error) {
+ if (togglePsCount < MAX_STATE_TOGGLE_TRIES) {
+ shouldRetry = true;
+ } else {
+ throw error;
+ }
+ }
+ } while (shouldRetry);
}
private void waitForPrivateSpaceSetup() {
diff --git a/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java b/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
index 1886ce6..a8f39af 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
@@ -31,6 +31,10 @@
static final int STRESS_REPEAT_COUNT = 10;
+ private enum TestCase {
+ TO_HOME, TO_OVERVIEW,
+ }
+
@Override
@Before
public void setUp() throws Exception {
@@ -41,28 +45,55 @@
}
@Test
- @NavigationModeSwitch
+ @NavigationModeSwitch(mode = NavigationModeSwitchRule.Mode.THREE_BUTTON)
public void testStressPressHome() {
- for (int i = 0; i < STRESS_REPEAT_COUNT; ++i) {
- // Destroy Launcher activity.
- closeLauncherActivity();
-
- // The test action.
- mLauncher.goHome();
- }
+ runTest(TestCase.TO_HOME);
}
@Test
- @NavigationModeSwitch
+ @NavigationModeSwitch(mode = NavigationModeSwitchRule.Mode.ZERO_BUTTON)
+ public void testStressSwipeHome() {
+ runTest(TestCase.TO_HOME);
+ }
+
+ @Test
+ @NavigationModeSwitch(mode = NavigationModeSwitchRule.Mode.THREE_BUTTON)
+ public void testStressPressOverview() {
+ runTest(TestCase.TO_OVERVIEW);
+ }
+
+ @Test
+ @NavigationModeSwitch(mode = NavigationModeSwitchRule.Mode.ZERO_BUTTON)
public void testStressSwipeToOverview() {
+ runTest(TestCase.TO_OVERVIEW);
+ }
+
+ private void runTest(TestCase testCase) {
for (int i = 0; i < STRESS_REPEAT_COUNT; ++i) {
// Destroy Launcher activity.
closeLauncherActivity();
// The test action.
- mLauncher.getLaunchedAppState().switchToOverview();
+ switch (testCase) {
+ case TO_OVERVIEW:
+ mLauncher.getLaunchedAppState().switchToOverview();
+ break;
+ case TO_HOME:
+ mLauncher.goHome();
+ break;
+ default:
+ throw new IllegalStateException("Cannot run test case: " + testCase);
+ }
}
- closeLauncherActivity();
- mLauncher.goHome();
+ switch (testCase) {
+ case TO_OVERVIEW:
+ closeLauncherActivity();
+ mLauncher.goHome();
+ break;
+ case TO_HOME:
+ default:
+ // No-Op
+ break;
+ }
}
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt b/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt
new file mode 100644
index 0000000..694a382
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep
+
+import android.platform.test.rule.AllowedDevices
+import android.platform.test.rule.DeviceProduct
+import android.platform.test.rule.IgnoreLimit
+import androidx.test.uiautomator.By
+import androidx.test.uiautomator.Until
+import com.android.launcher3.BuildConfig
+import com.android.launcher3.ui.AbstractLauncherUiTest
+import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape
+import com.android.launcher3.uioverrides.QuickstepLauncher
+import com.google.common.truth.Truth.assertWithMessage
+import org.junit.Before
+import org.junit.Test
+
+/** Test Desktop windowing in Overview. */
+@AllowedDevices(allowed = [DeviceProduct.CF_TABLET, DeviceProduct.TANGORPRO])
+@IgnoreLimit(ignoreLimit = BuildConfig.IS_STUDIO_BUILD)
+class TaplTestsOverviewDesktop : AbstractLauncherUiTest<QuickstepLauncher?>() {
+ @Before
+ fun setup() {
+ val overview = mLauncher.goHome().switchToOverview()
+ if (overview.hasTasks()) {
+ overview.dismissAllTasks()
+ }
+ startTestAppsWithCheck()
+ mLauncher.goHome()
+ }
+
+ @Test
+ @PortraitLandscape
+ fun enterDesktopViaOverviewMenu() {
+ // Move last launched TEST_ACTIVITY_2 into Desktop
+ mLauncher.workspace
+ .switchToOverview()
+ .getTestActivityTask(TEST_ACTIVITY_2)
+ .tapMenu()
+ .tapDesktopMenuItem()
+ assertTestAppLaunched(TEST_ACTIVITY_2)
+
+ // Scroll back to TEST_ACTIVITY_1, then move it into Desktop
+ mLauncher
+ .goHome()
+ .switchToOverview()
+ .apply { flingForward() }
+ .getTestActivityTask(TEST_ACTIVITY_1)
+ .tapMenu()
+ .tapDesktopMenuItem()
+ TEST_ACTIVITIES.forEach { assertTestAppLaunched(it) }
+
+ // Launch static DesktopTaskView
+ val desktop =
+ mLauncher.goHome().switchToOverview().getTestActivityTask(TEST_ACTIVITIES).open()
+ TEST_ACTIVITIES.forEach { assertTestAppLaunched(it) }
+
+ // Launch live-tile DesktopTaskView
+ desktop.switchToOverview().getTestActivityTask(TEST_ACTIVITIES).open()
+ TEST_ACTIVITIES.forEach { assertTestAppLaunched(it) }
+ }
+
+ private fun startTestAppsWithCheck() {
+ TEST_ACTIVITIES.forEach {
+ startTestActivity(it)
+ executeOnLauncher { launcher ->
+ assertWithMessage(
+ "Launcher activity is the top activity; expecting TestActivity$it"
+ )
+ .that(isInLaunchedApp(launcher))
+ .isTrue()
+ }
+ }
+ }
+
+ private fun assertTestAppLaunched(index: Int) {
+ assertWithMessage("TestActivity$index not opened in Desktop")
+ .that(
+ mDevice.wait(
+ Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity$index")),
+ DEFAULT_UI_TIMEOUT
+ )
+ )
+ .isTrue()
+ }
+
+ companion object {
+ const val TEST_ACTIVITY_1 = 2
+ const val TEST_ACTIVITY_2 = 3
+ val TEST_ACTIVITIES = listOf(TEST_ACTIVITY_1, TEST_ACTIVITY_2)
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
index df73e09..c419cd2 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
@@ -15,18 +15,15 @@
*/
package com.android.quickstep;
-import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
-
import android.graphics.Rect;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
-import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -34,9 +31,9 @@
@RunWith(AndroidJUnit4.class)
public class TaplTestsPersistentTaskbar extends AbstractTaplTestsTaskbar {
+ //TODO(b/359277238): fix falling tests
+ @Ignore
@Test
- @TaskbarModeSwitch(mode = PERSISTENT)
- @PortraitLandscape
@NavigationModeSwitch
public void testTaskbarFillsWidth() {
// Width check is performed inside TAPL whenever getTaskbar() is called.
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 81a2d54..597227a 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -181,12 +181,6 @@
public void testOverviewActions() throws Exception {
assumeFalse("Skipping Overview Actions tests for grid only overview",
mLauncher.isTablet() && mLauncher.isGridOnlyOverviewEnabled());
- // Experimenting for b/165029151:
- final Overview overview = mLauncher.goHome().switchToOverview();
- if (overview.hasTasks()) overview.dismissAllTasks();
- mLauncher.goHome();
- //
-
startTestAppsWithCheck();
OverviewActions actionsView =
mLauncher.goHome().switchToOverview().getOverviewActions();
@@ -362,6 +356,7 @@
@Test
@TaskbarModeSwitch
+ @ScreenRecord // b/358607191
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
assumeTrue(mLauncher.isTablet());
startTestActivity(2);
@@ -407,6 +402,7 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
+ @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/325659406
public void testQuickSwitchFromHome() throws Exception {
startTestActivity(2);
mLauncher.goHome().quickSwitchToPreviousApp();
@@ -434,9 +430,7 @@
@Test
@PortraitLandscape
@TaskbarModeSwitch()
- @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/309820115
@Ignore("b/315376057")
- @ScreenRecord // b/309820115
public void testOverviewForTablet() throws Exception {
assumeTrue(mLauncher.isTablet());
@@ -527,6 +521,8 @@
isInState(() -> LauncherState.NORMAL));
}
+ //TODO(b/359277238): fix falling tests
+ @Ignore
@Test
@PortraitLandscape
@TaskbarModeSwitch
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
index 2a54057..733ea4e 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
@@ -33,9 +33,7 @@
import com.android.launcher3.tapl.Overview;
import com.android.launcher3.tapl.Taskbar;
import com.android.launcher3.tapl.TaskbarAppIcon;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.rule.TestStabilityRule;
-import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
import com.android.wm.shell.Flags;
import org.junit.After;
@@ -74,15 +72,6 @@
}
@Test
- @PortraitLandscape
- public void testSplitFromOverview() {
- createAndLaunchASplitPair();
- }
-
- @Test
- @PortraitLandscape
- @TaskbarModeSwitch
- @TestStabilityRule.Stability(flavors = PLATFORM_POSTSUBMIT | LOCAL) // b/295225524
public void testSplitAppFromHomeWithItself() throws Exception {
// Currently only tablets have Taskbar in Overview, so test is only active on tablets
assumeTrue(mLauncher.isTablet());
@@ -129,8 +118,6 @@
overview.getCurrentTask()
.tapMenu()
.hasMenuItem("Save app pair"));
- } else {
- overview.getOverviewActions().assertHasAction("Save app pair");
}
}
@@ -154,11 +141,7 @@
// Currently only tablets have Taskbar in Overview, so test is only active on tablets
assumeTrue(mLauncher.isTablet());
- if (!mLauncher.getRecentTasks().isEmpty()) {
- // Clear all recent tasks
- mLauncher.goHome().switchToOverview().dismissAllTasks();
- }
-
+ clearAllRecentTasks();
startAppFast(getAppPackageName());
Overview overview = mLauncher.goHome().switchToOverview();
@@ -175,6 +158,8 @@
}
private void createAndLaunchASplitPair() {
+ clearAllRecentTasks();
+
startTestActivity(2);
startTestActivity(3);
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
index ec245ee..c24e974 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
@@ -24,6 +24,7 @@
import androidx.test.filters.LargeTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.rule.ScreenRecordRule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -133,6 +134,7 @@
@Test
@PortraitLandscape
+ @ScreenRecordRule.ScreenRecord // b/349439239
public void testLaunchAppInSplitscreen_fromTaskbarAllApps() {
getTaskbar().openAllApps()
.getAppIcon(TEST_APP_NAME)
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
index 374722e..710ad6f 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
@@ -33,6 +33,7 @@
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -43,8 +44,14 @@
private static final String READ_DEVICE_CONFIG_PERMISSION =
"android.permission.READ_DEVICE_CONFIG";
+ @Before
+ public void setup() {
+ mLauncher.injectFakeTrackpad();
+ }
+
@After
public void tearDown() {
+ mLauncher.ejectFakeTrackpad();
mLauncher.setTrackpadGestureType(TrackpadGestureType.NONE);
}
@@ -104,8 +111,8 @@
}
@Test
- @NavigationModeSwitch
@PortraitLandscape
+ @NavigationModeSwitch
public void testQuickSwitchFromHome() throws Exception {
assumeTrue(mLauncher.isTablet());
diff --git a/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java b/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java
deleted file mode 100644
index 208920a..0000000
--- a/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep;
-
-import static androidx.test.InstrumentationRegistry.getContext;
-import static androidx.test.InstrumentationRegistry.getInstrumentation;
-
-import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID;
-import static com.android.launcher3.testcomponent.TestCommandReceiver.EXTRA_VALUE;
-import static com.android.launcher3.testcomponent.TestCommandReceiver.SET_LIST_VIEW_SERVICE_BINDER;
-import static com.android.launcher3.util.WidgetUtils.createWidgetInfo;
-import static com.android.quickstep.NavigationModeSwitchRule.Mode.ZERO_BUTTON;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.spy;
-
-import android.appwidget.AppWidgetManager;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-import android.util.SparseArray;
-import android.view.View;
-import android.view.ViewConfiguration;
-import android.widget.RemoteViews;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.filters.Suppress;
-import androidx.test.uiautomator.By;
-import androidx.test.uiautomator.UiDevice;
-import androidx.test.uiautomator.Until;
-
-import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.LauncherModel;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
-import com.android.launcher3.model.data.LauncherAppWidgetInfo;
-import com.android.launcher3.tapl.LaunchedAppState;
-import com.android.launcher3.testcomponent.ListViewService;
-import com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory;
-import com.android.launcher3.testcomponent.TestCommandReceiver;
-import com.android.launcher3.ui.TestViewHelpers;
-import com.android.launcher3.util.Executors;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
-import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.lang.reflect.Field;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.IntConsumer;
-
-/**
- * Test to verify view inflation does not happen during swipe up.
- * To verify view inflation, we setup a stub ViewConfiguration and check if any call to that class
- * does from a View.init method or not.
- *
- * Alternative approaches considered:
- * Overriding LayoutInflater: This does not cover views initialized
- * directly (ex: new LinearLayout)
- * Using ExtendedMockito: Mocking static methods from platform classes (loaded in zygote) makes
- * the main thread extremely slow and untestable
- */
-@LargeTest
-@RunWith(AndroidJUnit4.class)
-public class TaplViewInflationDuringSwipeUp extends AbstractQuickStepTest {
-
- private SparseArray<ViewConfiguration> mConfigMap;
- private InitTracker mInitTracker;
- private LauncherModel mModel;
-
- @Before
- public void setUp() throws Exception {
- // Workaround for b/142351228, when there are no activities, the system may not destroy the
- // activity correctly for activities under instrumentation, which can leave two concurrent
- // activities, which changes the order in which the activities are cleaned up (overlapping
- // stop and start) leading to all sort of issues. To workaround this, ensure that the test
- // is started only after starting another app.
- startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
-
- super.setUp();
-
- mModel = LauncherAppState.getInstance(mTargetContext).getModel();
- Executors.MODEL_EXECUTOR.submit(mModel.getModelDbController()::createEmptyDB).get();
-
- // Get static configuration map
- Field field = ViewConfiguration.class.getDeclaredField("sConfigurations");
- field.setAccessible(true);
- mConfigMap = (SparseArray<ViewConfiguration>) field.get(null);
-
- mInitTracker = new InitTracker();
- }
-
- @Test
- @NavigationModeSwitch(mode = ZERO_BUTTON)
- @Suppress // until b/190618549 is fixed
- public void testSwipeUpFromApp() throws Exception {
- try {
- // Go to overview once so that all views are initialized and cached
- startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
- mLauncher.getLaunchedAppState().switchToOverview().dismissAllTasks();
-
- // Track view creations
- mInitTracker.startTracking();
-
- startTestActivity(2);
- mLauncher.getLaunchedAppState().switchToOverview();
-
- assertEquals("Views inflated during swipe up", 0, mInitTracker.viewInitCount);
- } finally {
- mConfigMap.clear();
- }
- }
-
- @Test
- @NavigationModeSwitch(mode = ZERO_BUTTON)
- @Suppress // until b/190729479 is fixed
- public void testSwipeUpFromApp_widget_update() {
- String stubText = "Some random stub text";
-
- executeSwipeUpTestWithWidget(
- widgetId -> { },
- widgetId -> AppWidgetManager.getInstance(getContext())
- .updateAppWidget(widgetId, createMainWidgetViews(stubText)),
- stubText);
- }
-
- @Test
- @NavigationModeSwitch(mode = ZERO_BUTTON)
- @Suppress // until b/190729479 is fixed
- public void testSwipeUp_with_list_widgets() {
- SimpleViewsFactory viewFactory = new SimpleViewsFactory();
- viewFactory.viewCount = 1;
- Bundle args = new Bundle();
- args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
- TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
-
- try {
- executeSwipeUpTestWithWidget(
- widgetId -> {
- // Initialize widget
- RemoteViews views = createMainWidgetViews("List widget title");
- views.setRemoteAdapter(android.R.id.list,
- new Intent(getContext(), ListViewService.class));
- AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
- verifyWidget(viewFactory.getLabel(0));
- },
- widgetId -> {
- // Update widget
- viewFactory.viewCount = 2;
- AppWidgetManager.getInstance(getContext())
- .notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
- },
- viewFactory.getLabel(1)
- );
- } finally {
- TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
- }
- }
-
- private void executeSwipeUpTestWithWidget(IntConsumer widgetIdCreationCallback,
- IntConsumer updateBeforeSwipeUp, String finalWidgetText) {
- try {
- LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(false);
-
- // Make sure the widget is big enough to show a list of items
- info.minSpanX = 2;
- info.minSpanY = 2;
- info.spanX = 2;
- info.spanY = 2;
- AtomicInteger widgetId = new AtomicInteger();
-
- commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext)
- .addItem(() -> {
- LauncherAppWidgetInfo item = createWidgetInfo(info, mTargetContext, true);
- item.screenId = FIRST_SCREEN_ID;
- widgetId.set(item.appWidgetId);
- return item;
- }));
-
- assertTrue("Widget is not present",
- mLauncher.goHome().tryGetWidget(info.label, DEFAULT_UI_TIMEOUT) != null);
-
- // Verify widget id
- widgetIdCreationCallback.accept(widgetId.get());
-
- // Go to overview once so that all views are initialized and cached
- startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
- mLauncher.getLaunchedAppState().switchToOverview().dismissAllTasks();
-
- // Track view creations
- mInitTracker.startTracking();
-
- startTestActivity(2);
- LaunchedAppState launchedAppState = mLauncher.getLaunchedAppState();
-
- // Update widget
- updateBeforeSwipeUp.accept(widgetId.get());
-
- launchedAppState.switchToOverview();
- assertEquals("Views inflated during swipe up", 0, mInitTracker.viewInitCount);
-
- // Widget is updated when going home
- mInitTracker.disableLog();
- mLauncher.goHome();
- verifyWidget(finalWidgetText);
- assertNotEquals(1, mInitTracker.viewInitCount);
- } finally {
- mConfigMap.clear();
- }
- }
-
- private void verifyWidget(String text) {
- assertNotNull("Widget not updated",
- UiDevice.getInstance(getInstrumentation())
- .wait(Until.findObject(By.text(text)), DEFAULT_UI_TIMEOUT));
- }
-
- private RemoteViews createMainWidgetViews(String title) {
- Context c = getContext();
- int layoutId = c.getResources().getIdentifier(
- "test_layout_widget_list", "layout", c.getPackageName());
- RemoteViews views = new RemoteViews(c.getPackageName(), layoutId);
- views.setTextViewText(android.R.id.text1, title);
- return views;
- }
-
- private class InitTracker implements Answer {
-
- public int viewInitCount = 0;
-
- public boolean log = true;
-
- @Override
- public Object answer(InvocationOnMock invocation) throws Throwable {
- Exception ex = new Exception();
-
- boolean found = false;
- for (StackTraceElement ste : ex.getStackTrace()) {
- if ("<init>".equals(ste.getMethodName())
- && View.class.getName().equals(ste.getClassName())) {
- found = true;
- break;
- }
- }
- if (found) {
- viewInitCount++;
- if (log) {
- Log.d("InitTracker", "New view inflated", ex);
- }
-
- }
- return invocation.callRealMethod();
- }
-
- public void disableLog() {
- log = false;
- }
-
- public void startTracking() {
- ViewConfiguration vc = ViewConfiguration.get(mTargetContext);
- ViewConfiguration spyVC = spy(vc);
- mConfigMap.put(mConfigMap.keyAt(mConfigMap.indexOfValue(vc)), spyVC);
- doAnswer(this).when(spyVC).getScaledTouchSlop();
- }
- }
-}
diff --git a/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java b/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java
new file mode 100644
index 0000000..3a83ae3
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.quickstep;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import android.app.ActivityOptions;
+import android.content.Context;
+import android.content.Intent;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@SmallTest
+public class TaskAnimationManagerTest {
+
+ @Mock
+ private Context mContext;
+
+ @Mock
+ private SystemUiProxy mSystemUiProxy;
+
+ private TaskAnimationManager mTaskAnimationManager;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mTaskAnimationManager = new TaskAnimationManager(mContext) {
+ @Override
+ SystemUiProxy getSystemUiProxy() {
+ return mSystemUiProxy;
+ }
+ };
+ }
+
+ @Test
+ public void startRecentsActivity_allowBackgroundLaunch() {
+ assumeTrue(TaskAnimationManager.ENABLE_SHELL_TRANSITIONS);
+
+ final LauncherActivityInterface activityInterface = mock(LauncherActivityInterface.class);
+ final GestureState gestureState = mock(GestureState.class);
+ final RecentsAnimationCallbacks.RecentsAnimationListener listener =
+ mock(RecentsAnimationCallbacks.RecentsAnimationListener.class);
+ doReturn(activityInterface).when(gestureState).getContainerInterface();
+ mTaskAnimationManager.startRecentsAnimation(gestureState, new Intent(), listener);
+
+ final ArgumentCaptor<ActivityOptions> optionsCaptor =
+ ArgumentCaptor.forClass(ActivityOptions.class);
+ verify(mSystemUiProxy).startRecentsActivity(any(), optionsCaptor.capture(), any());
+ assertEquals(ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS,
+ optionsCaptor.getValue().getPendingIntentBackgroundActivityStartMode());
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/TaskViewTest.java b/quickstep/tests/src/com/android/quickstep/TaskViewTest.java
index 512557b..dc1da69 100644
--- a/quickstep/tests/src/com/android/quickstep/TaskViewTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaskViewTest.java
@@ -88,18 +88,6 @@
}
@Test
- public void showBorderOnHoverEvent() {
- mTaskView.setBorderEnabled(/* enabled= */ true);
- MotionEvent event = MotionEvent.obtain(0, 0, MotionEvent.ACTION_HOVER_ENTER, 0.0f, 0.0f, 0);
- mTaskView.onHoverEvent(MotionEvent.obtain(event));
- verify(mHoverAnimator, times(1)).setBorderVisibility(/* visible= */ true, /* animated= */
- true);
- mTaskView.onFocusChanged(true, 0, new Rect());
- verify(mFocusAnimator, times(1)).setBorderVisibility(/* visible= */ true, /* animated= */
- true);
- }
-
- @Test
public void showBorderOnBorderEnabled() {
presetBorderStatus(/* enabled= */ false);
mTaskView.setBorderEnabled(/* enabled= */ true);
diff --git a/res/anim-v33/shared_x_axis_activity_close_enter.xml b/res/anim-v33/shared_x_axis_activity_close_enter.xml
deleted file mode 100644
index 3d7ad2b..0000000
--- a/res/anim-v33/shared_x_axis_activity_close_enter.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:shareInterpolator="false"
- android:showBackdrop="true">
-
- <alpha
- android:fromAlpha="0.0"
- android:toAlpha="1.0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/standard_decelerate_interpolator"
- android:startOffset="100"
- android:duration="350" />
-
- <translate
- android:fromXDelta="-25%"
- android:toXDelta="0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/emphasized_interpolator"
- android:startOffset="0"
- android:duration="450" />
-
-</set>
\ No newline at end of file
diff --git a/res/anim-v33/shared_x_axis_activity_close_exit.xml b/res/anim-v33/shared_x_axis_activity_close_exit.xml
deleted file mode 100644
index fb63602..0000000
--- a/res/anim-v33/shared_x_axis_activity_close_exit.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:shareInterpolator="false">
-
- <alpha
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/standard_accelerate_interpolator"
- android:startOffset="0"
- android:duration="100" />
-
- <translate
- android:fromXDelta="0"
- android:toXDelta="25%"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/emphasized_interpolator"
- android:startOffset="0"
- android:duration="450" />
-
-</set>
\ No newline at end of file
diff --git a/res/anim-v33/shared_x_axis_activity_open_enter.xml b/res/anim-v33/shared_x_axis_activity_open_enter.xml
deleted file mode 100644
index cba74ba..0000000
--- a/res/anim-v33/shared_x_axis_activity_open_enter.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:shareInterpolator="false"
- android:showBackdrop="true">
-
- <alpha
- android:fromAlpha="0.0"
- android:toAlpha="1.0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/standard_decelerate_interpolator"
- android:startOffset="100"
- android:duration="350" />
-
- <translate
- android:fromXDelta="25%"
- android:toXDelta="0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/emphasized_interpolator"
- android:startOffset="0"
- android:duration="450" />
-
-</set>
\ No newline at end of file
diff --git a/res/anim-v33/shared_x_axis_activity_open_exit.xml b/res/anim-v33/shared_x_axis_activity_open_exit.xml
deleted file mode 100644
index 22e878d..0000000
--- a/res/anim-v33/shared_x_axis_activity_open_exit.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:shareInterpolator="false">
-
- <alpha
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/standard_accelerate_interpolator"
- android:startOffset="0"
- android:duration="100" />
-
- <translate
- android:fromXDelta="0"
- android:toXDelta="-25%"
- android:fillEnabled="true"
- android:fillBefore="true"
- android:fillAfter="true"
- android:interpolator="@interpolator/emphasized_interpolator"
- android:startOffset="0"
- android:duration="450" />
-
-</set>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_bright.xml b/res/color-night-v31/material_color_surface_bright.xml
deleted file mode 100644
index f34ed6c..0000000
--- a/res/color-night-v31/material_color_surface_bright.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="24" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_container.xml b/res/color-night-v31/material_color_surface_container.xml
deleted file mode 100644
index 002b88e..0000000
--- a/res/color-night-v31/material_color_surface_container.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="12" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_container_high.xml b/res/color-night-v31/material_color_surface_container_high.xml
deleted file mode 100644
index edd36fc..0000000
--- a/res/color-night-v31/material_color_surface_container_high.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="17" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_container_highest.xml b/res/color-night-v31/material_color_surface_container_highest.xml
deleted file mode 100644
index e54f953..0000000
--- a/res/color-night-v31/material_color_surface_container_highest.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="22" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_container_low.xml b/res/color-night-v31/material_color_surface_container_low.xml
deleted file mode 100644
index 40f0d4c..0000000
--- a/res/color-night-v31/material_color_surface_container_low.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="10" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_container_lowest.xml b/res/color-night-v31/material_color_surface_container_lowest.xml
index 24f559b..4396f6d 100644
--- a/res/color-night-v31/material_color_surface_container_lowest.xml
+++ b/res/color-night-v31/material_color_surface_container_lowest.xml
@@ -1,6 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -14,6 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/system_neutral1_500" android:lStar="4" />
</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_dim.xml b/res/color-night-v31/material_color_surface_dim.xml
deleted file mode 100644
index a645f24..0000000
--- a/res/color-night-v31/material_color_surface_dim.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_inverse.xml b/res/color-night-v31/material_color_surface_inverse.xml
deleted file mode 100644
index ac63072..0000000
--- a/res/color-night-v31/material_color_surface_inverse.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="98" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface_variant.xml b/res/color-night-v31/material_color_surface_variant.xml
deleted file mode 100644
index a645f24..0000000
--- a/res/color-night-v31/material_color_surface_variant.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
-</selector>
\ No newline at end of file
diff --git a/res/color-night-v31/popup_shade_first.xml b/res/color-night-v31/popup_shade_first.xml
index 83822a6..28995e3 100644
--- a/res/color-night-v31/popup_shade_first.xml
+++ b/res/color-night-v31/popup_shade_first.xml
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorSurfaceContainer"/>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?attr/materialColorSurfaceContainer"/>
</selector>
diff --git a/res/color-night-v31/material_color_surface.xml b/res/color-night-v31/taskbar_stroke.xml
similarity index 78%
rename from res/color-night-v31/material_color_surface.xml
rename to res/color-night-v31/taskbar_stroke.xml
index a645f24..db7a510 100644
--- a/res/color-night-v31/material_color_surface.xml
+++ b/res/color-night-v31/taskbar_stroke.xml
@@ -1,6 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -14,6 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
+ <item android:color="#9AA0A6" />
</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface.xml b/res/color-v31/material_color_surface.xml
deleted file mode 100644
index b049851..0000000
--- a/res/color-v31/material_color_surface.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="98" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_bright.xml b/res/color-v31/material_color_surface_bright.xml
deleted file mode 100644
index b049851..0000000
--- a/res/color-v31/material_color_surface_bright.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="98" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_container.xml b/res/color-v31/material_color_surface_container.xml
deleted file mode 100644
index b031c08..0000000
--- a/res/color-v31/material_color_surface_container.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="94" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_container_high.xml b/res/color-v31/material_color_surface_container_high.xml
deleted file mode 100644
index a996d51..0000000
--- a/res/color-v31/material_color_surface_container_high.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="92" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_container_highest.xml b/res/color-v31/material_color_surface_container_highest.xml
deleted file mode 100644
index e7a535a..0000000
--- a/res/color-v31/material_color_surface_container_highest.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="90" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_container_low.xml b/res/color-v31/material_color_surface_container_low.xml
deleted file mode 100644
index b8fe01e..0000000
--- a/res/color-v31/material_color_surface_container_low.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="96" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_container_lowest.xml b/res/color-v31/material_color_surface_container_lowest.xml
index 25e8666..f726aea 100644
--- a/res/color-v31/material_color_surface_container_lowest.xml
+++ b/res/color-v31/material_color_surface_container_lowest.xml
@@ -1,6 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -14,6 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/system_neutral1_500" android:lStar="100" />
</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_dim.xml b/res/color-v31/material_color_surface_dim.xml
deleted file mode 100644
index e2d226f..0000000
--- a/res/color-v31/material_color_surface_dim.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="87" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_inverse.xml b/res/color-v31/material_color_surface_inverse.xml
deleted file mode 100644
index e189862..0000000
--- a/res/color-v31/material_color_surface_inverse.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/material_color_surface_variant.xml b/res/color-v31/material_color_surface_variant.xml
deleted file mode 100644
index e2d226f..0000000
--- a/res/color-v31/material_color_surface_variant.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="87" />
-</selector>
\ No newline at end of file
diff --git a/res/color-v31/popup_shade_first.xml b/res/color-v31/popup_shade_first.xml
index 1278bb4..be73698 100644
--- a/res/color-v31/popup_shade_first.xml
+++ b/res/color-v31/popup_shade_first.xml
@@ -13,7 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorSurfaceContainer"/>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?attr/materialColorSurfaceContainer"/>
</selector>
diff --git a/res/color/overview_button.xml b/res/color/overview_button.xml
index 1dd8da6..0b317bd 100644
--- a/res/color/overview_button.xml
+++ b/res/color/overview_button.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:alpha="1"
- android:color="?androidprv:attr/materialColorOnSurface"
+ android:color="?attr/materialColorOnSurface"
android:state_enabled="true" />
<item
android:alpha="?android:disabledAlpha"
- android:color="?androidprv:attr/materialColorOnSurface"
+ android:color="?attr/materialColorOnSurface"
android:state_enabled="false" />
</selector>
\ No newline at end of file
diff --git a/res/color/popup_shade_first.xml b/res/color/popup_shade_first.xml
index 1278bb4..be73698 100644
--- a/res/color/popup_shade_first.xml
+++ b/res/color/popup_shade_first.xml
@@ -13,7 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorSurfaceContainer"/>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?attr/materialColorSurfaceContainer"/>
</selector>
diff --git a/res/color-night-v31/material_color_surface.xml b/res/color/taskbar_stroke.xml
similarity index 77%
copy from res/color-night-v31/material_color_surface.xml
copy to res/color/taskbar_stroke.xml
index a645f24..b691082 100644
--- a/res/color-night-v31/material_color_surface.xml
+++ b/res/color/taskbar_stroke.xml
@@ -1,6 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -14,6 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
+ <item android:color="#BDC1C6" />
</selector>
\ No newline at end of file
diff --git a/res/drawable/add_item_dialog_background.xml b/res/drawable/add_item_dialog_background.xml
index e279fa0..39af989 100644
--- a/res/drawable/add_item_dialog_background.xml
+++ b/res/drawable/add_item_dialog_background.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
- <solid android:color="@color/material_color_surface_container_highest" />
+ <solid android:color="?attr/widgetPickerPrimarySurfaceColor" />
<corners
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius" />
diff --git a/res/drawable/all_apps_tabs_background.xml b/res/drawable/all_apps_tabs_background.xml
index 1e7cff2..62927af 100644
--- a/res/drawable/all_apps_tabs_background.xml
+++ b/res/drawable/all_apps_tabs_background.xml
@@ -30,7 +30,7 @@
android:state_selected="false">
<shape android:shape="rectangle">
<corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
- <solid android:color="@color/material_color_surface_bright" />
+ <solid android:color="?attr/materialColorSurfaceBright" />
</shape>
</item>
@@ -39,7 +39,7 @@
android:state_selected="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
- <solid android:color="@color/material_color_primary" />
+ <solid android:color="?attr/materialColorPrimary" />
</shape>
</item>
</selector>
diff --git a/res/drawable/bg_letter_list_text.xml b/res/drawable/bg_letter_list_text.xml
new file mode 100644
index 0000000..427702b
--- /dev/null
+++ b/res/drawable/bg_letter_list_text.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="?attr/materialColorSurfaceContainer" />
+ <corners android:radius="100dp"/>
+ <size
+ android:width="@dimen/bg_letter_list_text_size"
+ android:height="@dimen/bg_letter_list_text_size"/>
+</shape>
\ No newline at end of file
diff --git a/res/drawable/bg_ps_mask_left_corner.xml b/res/drawable/bg_ps_mask_left_corner.xml
new file mode 100644
index 0000000..43eeedb
--- /dev/null
+++ b/res/drawable/bg_ps_mask_left_corner.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <vector
+ android:viewportWidth="28"
+ android:viewportHeight="28"
+ android:width="@dimen/ps_floating_mask_corner_radius"
+ android:height="@dimen/ps_floating_mask_corner_radius">
+ <path
+ android:pathData="M0 28H28C24.3228 28 20.6821 27.2759 17.2847 25.8687C13.8877 24.4614 10.8013 22.3989 8.20117 19.7988C5.60107 17.1987 3.53857 14.1123 2.13135 10.7153C0.724121 7.31787 0 3.67725 0 0V28Z"
+ android:fillType="evenOdd"
+ android:fillColor="?attr/allAppsScrimColor" />
+ </vector>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/bg_ps_mask_right_corner.xml b/res/drawable/bg_ps_mask_right_corner.xml
new file mode 100644
index 0000000..d63b866
--- /dev/null
+++ b/res/drawable/bg_ps_mask_right_corner.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <vector
+ android:viewportWidth="28"
+ android:viewportHeight="28"
+ android:width="@dimen/ps_floating_mask_corner_radius"
+ android:height="@dimen/ps_floating_mask_corner_radius">
+ <path
+ android:pathData="M28 28V0C28 3.67725 27.2759 7.31787 25.8687 10.7153C24.4614 14.1123 22.3989 17.1987 19.7988 19.7988C17.1987 22.3989 14.1123 24.4614 10.7153 25.8687C7.31787 27.2759 3.67725 28 0 28H28Z"
+ android:fillType="evenOdd"
+ android:fillColor="?attr/allAppsScrimColor" />
+ </vector>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml b/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml
index 379e0e5..a19465d 100644
--- a/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml
+++ b/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml
@@ -15,8 +15,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" >
- <solid android:color="?androidprv:attr/materialColorOutlineVariant"/>
+ <solid android:color="?attr/materialColorOutlineVariant"/>
<corners android:radius="@dimen/bottom_sheet_handle_corner_radius" />
</shape>
diff --git a/res/drawable/button_top_rounded_bordered_ripple.xml b/res/drawable/button_top_rounded_bordered_ripple.xml
index f5b6886..13959f6 100644
--- a/res/drawable/button_top_rounded_bordered_ripple.xml
+++ b/res/drawable/button_top_rounded_bordered_ripple.xml
@@ -25,7 +25,7 @@
android:topRightRadius="12dp"
android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp" />
- <solid android:color="@color/material_color_surface_container_highest"/>
+ <solid android:color="?attr/materialColorSurfaceContainerHighest"/>
<stroke
android:width="2dp"
android:color="@color/button_bg"/>
diff --git a/res/drawable/cloud_download_24px.xml b/res/drawable/cloud_download_24px.xml
new file mode 100644
index 0000000..6f7c95a
--- /dev/null
+++ b/res/drawable/cloud_download_24px.xml
@@ -0,0 +1,11 @@
+<!-- GM3 icon cloud_download:vd_theme_24 -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="960"
+ android:viewportHeight="960"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M260,800Q169,800 104.5,737Q40,674 40,583Q40,505 87,444Q134,383 210,366Q227,294 295,229Q363,164 440,164Q473,164 496.5,187.5Q520,211 520,244L520,486L584,424L640,480L480,640L320,480L376,424L440,486L440,244Q364,258 322,317.5Q280,377 280,440L260,440Q202,440 161,481Q120,522 120,580Q120,638 161,679Q202,720 260,720L740,720Q782,720 811,691Q840,662 840,620Q840,578 811,549Q782,520 740,520L680,520L680,440Q680,392 658,350.5Q636,309 600,280L600,187Q674,222 717,290.5Q760,359 760,440L760,440L760,440Q829,448 874.5,499.5Q920,551 920,620Q920,695 867.5,747.5Q815,800 740,800L260,800ZM480,442Q480,442 480,442Q480,442 480,442L480,442Q480,442 480,442Q480,442 480,442L480,442Q480,442 480,442Q480,442 480,442L480,442Q480,442 480,442Q480,442 480,442Q480,442 480,442Q480,442 480,442L480,442Q480,442 480,442Q480,442 480,442Q480,442 480,442Q480,442 480,442L480,442L480,442Q480,442 480,442Q480,442 480,442Z"/>
+</vector>
diff --git a/res/drawable/cloud_download_semibold_24px.xml b/res/drawable/cloud_download_semibold_24px.xml
new file mode 100644
index 0000000..ef15f9f
--- /dev/null
+++ b/res/drawable/cloud_download_semibold_24px.xml
@@ -0,0 +1,11 @@
+<!-- From GM3 icon cloud_download:wght600_vd_theme_24 -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="960"
+ android:viewportHeight="960"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M260,819.22Q162.22,819.22 92.35,751.7Q22.48,684.17 22.48,586.63Q22.48,503.03 70.61,437.64Q118.74,372.26 198.13,354.13Q217.39,283.26 284.26,217.98Q351.13,152.7 428.7,152.7Q467.91,152.7 496.22,179.3Q524.52,205.91 524.52,244L524.52,484.3L584,425.7L646.22,487.91L480,654.13L313.78,487.91L376,425.7L435.48,484.3L435.48,252.48Q365.13,269.87 326.8,327.11Q288.48,384.35 288.48,446.78L261.7,446.78Q206.51,446.78 167.49,485.8Q128.48,524.81 128.48,580Q128.48,635.74 167,674.48Q205.51,713.22 260,713.22L740,713.22Q778.04,713.22 804.78,686.48Q831.52,659.74 831.52,620Q831.52,581.39 804.78,554.09Q778.04,526.78 738.3,526.78L675.48,526.78L675.48,441.7Q675.48,396.52 656.3,358.98Q637.13,321.44 604.52,292.44L604.52,171.74Q680.78,206.74 726.33,275.8Q771.87,344.87 776.39,428.13L776.39,428.13L776.39,428.13Q847.09,442.35 892.31,496.96Q937.52,551.57 937.52,623.39Q937.52,704.99 879.91,762.1Q822.3,819.22 740,819.22L260,819.22ZM480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Z"/>
+</vector>
diff --git a/res/drawable/ic_bubble_button.xml b/res/drawable/ic_bubble_button.xml
new file mode 100644
index 0000000..1ed212e
--- /dev/null
+++ b/res/drawable/ic_bubble_button.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="20dp"
+ android:height="20dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M23,5v8h-2V5H3v14h10v2v0H3c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2h18C22.1,3 23,3.9 23,5zM10,8v2.59L5.71,6.29L4.29,7.71L8.59,12H6v2h6V8H10zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/>
+</vector>
diff --git a/res/drawable/ic_close_work_edu.xml b/res/drawable/ic_close_work_edu.xml
new file mode 100644
index 0000000..e4053e3
--- /dev/null
+++ b/res/drawable/ic_close_work_edu.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="960"
+ android:viewportHeight="960">
+ <path
+ android:fillColor="?attr/materialColorOnSurface"
+ android:pathData="M256,760L200,704L424,480L200,256L256,200L480,424L704,200L760,256L536,480L760,704L704,760L480,536L256,760Z"/>
+</vector>
diff --git a/res/drawable/ic_desktop_with_bg.xml b/res/drawable/ic_desktop_with_bg.xml
new file mode 100644
index 0000000..f54285c
--- /dev/null
+++ b/res/drawable/ic_desktop_with_bg.xml
@@ -0,0 +1,29 @@
+<!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+ <path
+ android:pathData="M24,2L24,2A22,22 0,0 1,46 24L46,24A22,22 0,0 1,24 46L24,46A22,22 0,0 1,2 24L2,24A22,22 0,0 1,24 2z"
+ android:fillColor="#ffffff"/>
+ <path
+ android:pathData="M32,30H16V18H32V30ZM32,32C33.1,32 34,31.1 34,30V18C34,16.9 33.1,16 32,16H16C14.9,16 14,16.9 14,18V30C14,31.1 14.9,32 16,32H32ZM30,20H23V22H28V24H30V20ZM18,23H27V28H18V23Z"
+ android:fillColor="#000000"
+ android:fillType="evenOdd"/>
+</vector>
diff --git a/res/drawable/ic_more_vert_dots.xml b/res/drawable/ic_more_vert_dots.xml
new file mode 100644
index 0000000..c4659f8
--- /dev/null
+++ b/res/drawable/ic_more_vert_dots.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
+</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_plus.xml b/res/drawable/ic_plus.xml
index 3ab926a..d004f42 100644
--- a/res/drawable/ic_plus.xml
+++ b/res/drawable/ic_plus.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="19dp"
+ android:width="@dimen/widget_cell_add_button_drawable_width"
android:height="18dp"
android:viewportWidth="19"
android:viewportHeight="18">
diff --git a/res/drawable/ic_private_space_with_background.xml b/res/drawable/ic_private_space_with_background.xml
index cb37c9a..cc73f6d 100644
--- a/res/drawable/ic_private_space_with_background.xml
+++ b/res/drawable/ic_private_space_with_background.xml
@@ -13,14 +13,13 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:viewportWidth="48"
android:viewportHeight="48"
android:width="48dp"
android:height="48dp">
<path
android:pathData="M48 24A24 24 0 0 1 0 24A24 24 0 0 1 48 24Z"
- android:fillColor="?androidprv:attr/materialColorSurfaceContainerLowest" />
+ android:fillColor="?attr/materialColorSurfaceContainerLowest" />
<path
android:pathData="M24.0021 10.6641L13.3354 14.6641V22.7841C13.3354 29.5174 17.8821 35.7974 24.0021 37.3307C30.1221 35.7974 34.6688 29.5174 34.6688 22.7841V14.6641L24.0021 10.6641ZM32.0021 22.7841C32.0021 28.1174 28.6021 33.0507 24.0021 34.5574C19.4021 33.0507 16.0021 28.1307 16.0021 22.7841V16.5174L24.0021 13.5174L32.0021 16.5174V22.7841Z"
android:fillType="evenOdd"
diff --git a/res/drawable/icon_menu_arrow_background.xml b/res/drawable/icon_menu_arrow_background.xml
index 2eb1dfc..6345c2b 100644
--- a/res/drawable/icon_menu_arrow_background.xml
+++ b/res/drawable/icon_menu_arrow_background.xml
@@ -15,14 +15,13 @@
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:autoMirrored="true">
<gradient
android:type="linear"
android:angle="0"
android:startColor="#00000000"
android:centerX="0.25"
- android:centerColor="?androidprv:attr/materialColorSurfaceBright"
- android:endColor="?androidprv:attr/materialColorSurfaceBright" />
+ android:centerColor="?attr/materialColorSurfaceBright"
+ android:endColor="?attr/materialColorSurfaceBright" />
<corners android:radius="@dimen/dialogCornerRadius" />
</shape>
\ No newline at end of file
diff --git a/res/drawable/private_space_app_divider.xml b/res/drawable/private_space_app_divider.xml
index 7d069ef..1ea12b3 100644
--- a/res/drawable/private_space_app_divider.xml
+++ b/res/drawable/private_space_app_divider.xml
@@ -17,5 +17,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/materialColorOutlineVariant"/>
- <size android:height="1dp" />
+ <size android:height="@dimen/all_apps_divider_height" />
</shape>
\ No newline at end of file
diff --git a/res/drawable/private_space_install_app_icon.xml b/res/drawable/private_space_install_app_icon.xml
index 4c167ba..cfec2b1 100644
--- a/res/drawable/private_space_install_app_icon.xml
+++ b/res/drawable/private_space_install_app_icon.xml
@@ -23,9 +23,9 @@
android:pathData="M30 0H30A30 30 0 0 1 60 30V30A30 30 0 0 1 30 60H30A30 30 0 0 1 0 30V30A30 30 0 0 1 30 0Z" />
<path
android:pathData="M30 0H30A30 30 0 0 1 60 30V30A30 30 0 0 1 30 60H30A30 30 0 0 1 0 30V30A30 30 0 0 1 30 0Z"
- android:fillColor="@color/material_color_surface_bright" />
+ android:fillColor="@color/material_color_surface_container_lowest" />
<path
android:pathData="M29 31h-6v-2h6v-6h2v6h6v2h-6v6h-2v-6Z"
- android:fillColor="@color/material_color_on_surface_variant" />
+ android:fillColor="@color/material_color_on_surface" />
</group>
</vector>
diff --git a/res/drawable/rounded_action_button.xml b/res/drawable/rounded_action_button.xml
index 81e94f7..ebfa996 100644
--- a/res/drawable/rounded_action_button.xml
+++ b/res/drawable/rounded_action_button.xml
@@ -7,7 +7,7 @@
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
- ~ Unless required by applicable law or agreed to in writing, software
+ ~ Unless required by applicable law or agreed to in writing, soft]ware
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
@@ -16,15 +16,11 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?androidprv:attr/colorSurfaceVariant" />
+ <solid android:color="?attr/materialColorSurfaceContainerLow" />
<corners android:radius="@dimen/rounded_button_radius" />
<stroke
android:width="1dp"
- android:color="?androidprv:attr/colorSurfaceVariant" />
- <padding
- android:left="@dimen/rounded_button_padding"
- android:right="@dimen/rounded_button_padding" />
+ android:color="?attr/materialColorSurfaceContainerLow" />
</shape>
diff --git a/res/drawable/widget_picker_tabs_background.xml b/res/drawable/widget_picker_tabs_background.xml
index a874dd8..f6607b7 100644
--- a/res/drawable/widget_picker_tabs_background.xml
+++ b/res/drawable/widget_picker_tabs_background.xml
@@ -13,36 +13,39 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="@color/accent_ripple_color">
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetBottom="@dimen/widget_apps_tabs_vertical_padding"
+ android:insetTop="@dimen/widget_apps_tabs_vertical_padding">
+ <ripple
+ android:color="@color/accent_ripple_color">
- <item android:id="@android:id/mask">
- <shape android:shape="rectangle">
- <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
- <solid android:color="@color/accent_ripple_color" />
- </shape>
- </item>
+ <item android:id="@android:id/mask">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
+ <solid android:color="@color/accent_ripple_color" />
+ </shape>
+ </item>
- <item>
- <selector android:enterFadeDuration="100">
- <item
- android:id="@+id/unselected"
- android:state_selected="false">
- <shape android:shape="rectangle">
- <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
- <solid android:color="?attr/widgetPickerTabBackgroundUnselected"/>
- </shape>
- </item>
+ <item>
+ <selector android:enterFadeDuration="100">
+ <item
+ android:id="@+id/unselected"
+ android:state_selected="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
+ <solid android:color="?attr/widgetPickerTabBackgroundUnselected" />
+ </shape>
+ </item>
- <item
- android:id="@+id/selected"
- android:state_selected="true">
- <shape android:shape="rectangle">
- <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
- <solid android:color="?attr/widgetPickerTabBackgroundSelected"/>
- </shape>
- </item>
- </selector>
- </item>
-
-</ripple>
\ No newline at end of file
+ <item
+ android:id="@+id/selected"
+ android:state_selected="true">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
+ <solid android:color="?attr/widgetPickerTabBackgroundSelected" />
+ </shape>
+ </item>
+ </selector>
+ </item>
+ </ripple>
+</inset>
\ No newline at end of file
diff --git a/res/drawable/work_card.xml b/res/drawable/work_card.xml
index 4a66cac..01ec947 100644
--- a/res/drawable/work_card.xml
+++ b/res/drawable/work_card.xml
@@ -16,9 +16,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?androidprv:attr/colorSurface" />
+ <solid android:color="?attr/materialColorSurfaceContainerHighest" />
<corners android:radius="@dimen/work_edu_card_radius" />
</shape>
diff --git a/res/layout/all_apps_fast_scroller.xml b/res/layout/all_apps_fast_scroller.xml
index 0f1d933..7e16ca5 100644
--- a/res/layout/all_apps_fast_scroller.xml
+++ b/res/layout/all_apps_fast_scroller.xml
@@ -36,4 +36,17 @@
android:layout_marginEnd="@dimen/fastscroll_end_margin"
launcher:canThumbDetach="true" />
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/scroll_letter_layout"
+ android:layout_width="@dimen/fastscroll_width"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/all_apps_header"
+ android:layout_marginTop="@dimen/all_apps_header_bottom_padding"
+ android:layout_marginEnd="@dimen/fastscroll_list_letter_end_margin"
+ android:clipToPadding="false"
+ android:outlineProvider="none"
+ />
</merge>
\ No newline at end of file
diff --git a/res/color-night-v31/material_color_surface.xml b/res/layout/bubble_bar_overflow_button.xml
similarity index 63%
copy from res/color-night-v31/material_color_surface.xml
copy to res/layout/bubble_bar_overflow_button.xml
index a645f24..cb54990 100644
--- a/res/color-night-v31/material_color_surface.xml
+++ b/res/layout/bubble_bar_overflow_button.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- ~ Copyright (C) 2022 The Android Open Source Project
+ ~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -12,8 +12,10 @@
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
- ~ limitations under the License.
+ ~ limitations under the License
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_500" android:lStar="6" />
-</selector>
\ No newline at end of file
+<com.android.launcher3.taskbar.bubbles.BubbleView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/bubble_overflow_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
\ No newline at end of file
diff --git a/res/layout/fast_scroller_letter_list_text_view.xml b/res/layout/fast_scroller_letter_list_text_view.xml
new file mode 100644
index 0000000..493b6fc
--- /dev/null
+++ b/res/layout/fast_scroller_letter_list_text_view.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<com.android.launcher3.allapps.LetterListTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="@dimen/fastscroll_list_letter_size"
+ android:layout_height="@dimen/fastscroll_list_letter_size"
+ android:textSize="@dimen/fastscroll_list_letter_text_size"
+ android:importantForAccessibility="no"
+ android:gravity="center"
+ android:clickable="false">
+</com.android.launcher3.allapps.LetterListTextView>
\ No newline at end of file
diff --git a/res/layout/launcher.xml b/res/layout/launcher.xml
index a709fbc..83c8d6c 100644
--- a/res/layout/launcher.xml
+++ b/res/layout/launcher.xml
@@ -51,7 +51,7 @@
<!-- Keep these behind the workspace so that they are not visible when
we go into AllApps -->
- <com.android.launcher3.pageindicators.WorkspacePageIndicator
+ <com.android.launcher3.pageindicators.PageIndicatorDots
android:id="@+id/page_indicator"
android:layout_width="match_parent"
android:layout_height="@dimen/workspace_page_indicator_height"
diff --git a/res/layout/page_indicator_dots.xml b/res/layout/page_indicator_dots.xml
deleted file mode 100644
index d5fe51e..0000000
--- a/res/layout/page_indicator_dots.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2022 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<com.android.launcher3.pageindicators.PageIndicatorDots xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/page_indicator"
- android:layout_width="match_parent"
- android:layout_height="@dimen/workspace_page_indicator_height"
- android:layout_gravity="bottom | center_horizontal"
- android:theme="@style/HomeScreenElementTheme" />
\ No newline at end of file
diff --git a/res/layout/private_space_divider.xml b/res/layout/private_space_divider.xml
index fff8629..f72e139 100644
--- a/res/layout/private_space_divider.xml
+++ b/res/layout/private_space_divider.xml
@@ -18,8 +18,8 @@
android:importantForAccessibility="no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/ps_app_divider_padding"
- android:paddingRight="@dimen/ps_app_divider_padding"
+ android:paddingHorizontal="@dimen/ps_app_divider_horizontal_padding"
+ android:paddingVertical="@dimen/ps_app_divider_vertical_padding"
android:src="@drawable/private_space_app_divider"
android:scaleType="fitXY"
android:focusable="false" />
\ No newline at end of file
diff --git a/res/layout/private_space_header.xml b/res/layout/private_space_header.xml
index cefe394..6bce220 100644
--- a/res/layout/private_space_header.xml
+++ b/res/layout/private_space_header.xml
@@ -37,12 +37,13 @@
android:gravity="center_vertical"
android:layout_alignParentEnd="true"
android:animateLayoutChanges="false">
- <ImageButton
+ <com.android.launcher3.allapps.PrivateSpaceSettingsButton
android:id="@+id/ps_settings_button"
android:layout_width="@dimen/ps_header_image_height"
android:layout_height="@dimen/ps_header_image_height"
android:background="@drawable/ps_settings_background"
android:src="@drawable/ic_ps_settings"
+ android:visibility="gone"
android:contentDescription="@string/ps_container_settings" />
<LinearLayout
android:id="@+id/ps_lock_unlock_button"
@@ -60,7 +61,7 @@
android:layout_marginBottom="@dimen/ps_lock_icon_margin_bottom"
android:importantForAccessibility="no"
android:src="@drawable/ic_lock"
- app:tint="@color/material_color_primary_fixed_dim"
+ app:tint="?attr/materialColorPrimaryFixedDim"
android:scaleType="center"/>
<TextView
android:id="@+id/lock_text"
@@ -68,10 +69,12 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/ps_lock_icon_text_margin_start_expanded"
android:layout_marginEnd="@dimen/ps_lock_icon_text_margin_end_expanded"
- android:textColor="@color/material_color_on_primary_fixed"
+ android:textColor="?attr/materialColorOnPrimaryFixed"
android:textSize="14sp"
android:text="@string/ps_container_lock_title"
+ android:maxLines="1"
android:visibility="gone"
+ android:alpha="0"
style="@style/TextHeadline"/>
</LinearLayout>
</LinearLayout>
@@ -97,6 +100,7 @@
android:gravity="center_vertical"
android:layout_marginStart="@dimen/ps_header_layout_margin"
android:text="@string/ps_container_title"
+ android:maxLines="1"
android:theme="@style/PrivateSpaceHeaderTextStyle"
android:importantForAccessibility="no"/>
diff --git a/res/layout/private_space_mask_view.xml b/res/layout/private_space_mask_view.xml
new file mode 100644
index 0000000..44e2797
--- /dev/null
+++ b/res/layout/private_space_mask_view.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<com.android.launcher3.allapps.FloatingMaskView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginLeft="@dimen/ps_floating_mask_end_padding"
+ android:layout_marginRight="@dimen/ps_floating_mask_end_padding"
+ android:importantForAccessibility="noHideDescendants"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/left_corner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_constraintStart_toStartOf="parent"
+ android:importantForAccessibility="no"
+ android:background="@drawable/bg_ps_mask_left_corner"/>
+
+ <ImageView
+ android:id="@+id/right_corner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:scaleType="centerCrop"
+ app:layout_constraintEnd_toEndOf="parent"
+ android:importantForAccessibility="no"
+ android:background="@drawable/bg_ps_mask_right_corner"/>
+
+ <ImageView
+ android:id="@+id/bottom_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:layout_constraintStart_toStartOf="@id/left_corner"
+ app:layout_constraintEnd_toEndOf="@id/right_corner"
+ app:layout_constraintTop_toBottomOf="@id/left_corner"
+ android:importantForAccessibility="no"
+ android:background="?attr/allAppsScrimColor"/>
+
+</com.android.launcher3.allapps.FloatingMaskView>
\ No newline at end of file
diff --git a/res/layout/widget_cell_content.xml b/res/layout/widget_cell_content.xml
index 8f786bf..b6412db 100644
--- a/res/layout/widget_cell_content.xml
+++ b/res/layout/widget_cell_content.xml
@@ -46,20 +46,22 @@
android:layout_gravity="center_vertical"
android:id="@+id/widget_text_container"
android:orientation="vertical">
- <!-- The name of the widget. -->
- <TextView
- android:id="@+id/widget_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:fadingEdge="horizontal"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal|center_vertical"
- android:singleLine="true"
- android:maxLines="1"
- android:textColor="?android:attr/textColorPrimary"
- android:drawablePadding="@dimen/widget_cell_app_icon_padding"
- android:textSize="@dimen/widget_cell_font_size" />
+ <!-- The name of the widget. -->
+ <TextView
+ android:id="@+id/widget_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:fadingEdge="horizontal"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal|center_vertical"
+ android:singleLine="true"
+ android:maxLines="1"
+ android:textColor="?attr/widgetCellTitleColor"
+ android:textSize="@dimen/widget_cell_title_font_size"
+ android:textFontWeight="@integer/widget_cell_title_font_weight"
+ android:lineHeight="@dimen/widget_cell_title_line_height"
+ android:drawablePadding="@dimen/widget_cell_app_icon_padding" />
<!-- The original dimensions of the widget -->
<TextView
@@ -67,21 +69,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
- android:textColor="?android:attr/textColorSecondary"
- android:textSize="@dimen/widget_cell_font_size"
- android:alpha="0.7" />
+ android:textColor="?attr/widgetCellSubtitleColor"
+ android:textSize="@dimen/widget_cell_dims_font_size"
+ android:textFontWeight="@integer/widget_cell_dims_font_weight"
+ android:lineHeight="@dimen/widget_cell_dims_line_height" />
<TextView
android:id="@+id/widget_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
- android:textSize="@dimen/widget_cell_font_size"
- android:textColor="?android:attr/textColorSecondary"
+ android:textColor="?attr/widgetCellSubtitleColor"
+ android:textSize="@dimen/widget_cell_description_font_size"
+ android:textFontWeight="@integer/widget_cell_description_font_weight"
+ android:lineHeight="@dimen/widget_cell_description_line_height"
android:maxLines="3"
android:ellipsize="end"
- android:fadingEdge="horizontal"
- android:alpha="0.7" />
+ android:fadingEdge="horizontal" />
</LinearLayout>
<Button
@@ -94,12 +98,16 @@
android:paddingEnd="@dimen/widget_cell_add_button_end_padding"
android:text="@string/widget_add_button_label"
android:textColor="?attr/widgetPickerAddButtonTextColor"
- android:textSize="@dimen/widget_cell_font_size"
+ android:textSize="@dimen/widget_cell_add_button_font_size"
+ android:fontWeight="@integer/widget_cell_add_button_font_weight"
+ android:lineHeight="@dimen/widget_cell_add_button_line_height"
android:gravity="center"
android:visibility="gone"
android:drawableStart="@drawable/ic_plus"
- android:drawablePadding="8dp"
+ android:drawablePadding="@dimen/widget_cell_add_button_drawable_padding"
android:drawableTint="?attr/widgetPickerAddButtonTextColor"
+ android:maxLines="1"
+ style="@style/Button.Rounded.Colored"
android:background="@drawable/widget_cell_add_button_background" />
</FrameLayout>
</merge>
diff --git a/res/layout/widgets_full_sheet_paged_view.xml b/res/layout/widgets_full_sheet_paged_view.xml
index 8dc785a..622f0d6 100644
--- a/res/layout/widgets_full_sheet_paged_view.xml
+++ b/res/layout/widgets_full_sheet_paged_view.xml
@@ -104,7 +104,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/widget_picker_tabs_background"
android:text="@string/widgets_full_sheet_personal_tab"
@@ -117,7 +116,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/widget_picker_tabs_background"
android:text="@string/widgets_full_sheet_work_tab"
diff --git a/res/layout/widgets_list_row_header.xml b/res/layout/widgets_list_row_header.xml
index 6d26ce3..98f9dac 100644
--- a/res/layout/widgets_list_row_header.xml
+++ b/res/layout/widgets_list_row_header.xml
@@ -48,8 +48,10 @@
android:layout_gravity="start|center_vertical"
android:ellipsize="end"
android:maxLines="1"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="16sp"
+ android:textColor="?attr/widgetPickerHeaderAppTitleColor"
+ android:textSize="@dimen/widget_picker_header_app_title_font_size"
+ android:textFontWeight="@integer/widget_picker_header_app_title_font_weight"
+ android:lineHeight="@dimen/widget_picker_header_app_title_line_height"
tools:text="App name" />
<TextView
@@ -58,8 +60,10 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
- android:textColor="?android:attr/textColorSecondary"
- android:alpha="0.7"
+ android:textColor="?attr/widgetPickerHeaderAppSubtitleColor"
+ android:textSize="@dimen/widget_picker_header_app_subtitle_font_size"
+ android:textFontWeight="@integer/widget_picker_header_app_subtitle_font_weight"
+ android:lineHeight="@dimen/widget_picker_header_app_subtitle_line_height"
tools:text="m widgets, n shortcuts" />
</LinearLayout>
diff --git a/res/layout/widgets_list_row_header_two_pane.xml b/res/layout/widgets_list_row_header_two_pane.xml
index bdb2aed..d4baf0a 100644
--- a/res/layout/widgets_list_row_header_two_pane.xml
+++ b/res/layout/widgets_list_row_header_two_pane.xml
@@ -51,7 +51,9 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?attr/widgetPickerHeaderAppTitleColor"
- android:textSize="16sp"
+ android:textSize="@dimen/widget_picker_header_app_title_font_size"
+ android:textFontWeight="@integer/widget_picker_header_app_title_font_weight"
+ android:lineHeight="@dimen/widget_picker_header_app_title_line_height"
android:duplicateParentState="true"
tools:text="App name" />
@@ -62,7 +64,9 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?attr/widgetPickerHeaderAppSubtitleColor"
- android:alpha="0.7"
+ android:textSize="@dimen/widget_picker_header_app_subtitle_font_size"
+ android:textFontWeight="@integer/widget_picker_header_app_subtitle_font_weight"
+ android:lineHeight="@dimen/widget_picker_header_app_subtitle_line_height"
android:duplicateParentState="true"
tools:text="m widgets, n shortcuts" />
diff --git a/res/layout/widgets_two_pane_sheet.xml b/res/layout/widgets_two_pane_sheet.xml
index bb2b7bd..ce5eed9 100644
--- a/res/layout/widgets_two_pane_sheet.xml
+++ b/res/layout/widgets_two_pane_sheet.xml
@@ -48,20 +48,23 @@
android:textSize="24sp" />
<TextView
- android:id="@+id/no_widgets_text"
- style="@style/PrimaryHeadline"
+ android:id="@+id/widget_picker_description"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center"
- android:textSize="18sp"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:layout_below="@id/title"
+ android:maxLines="1"
+ android:paddingHorizontal="@dimen/widget_list_horizontal_margin_two_pane"
+ android:textColor="?attr/widgetPickerDescriptionColor"
android:visibility="gone"
- tools:text="@string/no_widgets_available" />
+ android:lineHeight="20sp"
+ android:textSize="14sp" />
<LinearLayout
android:id="@+id/linear_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_below="@id/title">
+ android:layout_below="@id/widget_picker_description">
<FrameLayout
android:id="@+id/recycler_view_container"
@@ -124,6 +127,16 @@
android:background="@drawable/widgets_surface_background"
android:importantForAccessibility="yes"
android:id="@+id/right_pane">
+ <TextView
+ android:id="@+id/no_widgets_text"
+ style="@style/PrimaryHeadline"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:textSize="18sp"
+ android:visibility="gone"
+ tools:text="@string/no_widgets_available" />
+
<!-- Shown when there are recommendations to display -->
<LinearLayout
android:id="@+id/widget_recommendations_container"
diff --git a/res/layout/widgets_two_pane_sheet_paged_view.xml b/res/layout/widgets_two_pane_sheet_paged_view.xml
index 887efb8..1cbd2ba 100644
--- a/res/layout/widgets_two_pane_sheet_paged_view.xml
+++ b/res/layout/widgets_two_pane_sheet_paged_view.xml
@@ -55,18 +55,39 @@
android:clipToOutline="true"
android:orientation="vertical">
- <FrameLayout
+ <LinearLayout
android:id="@+id/search_bar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="horizontal"
android:background="?attr/widgetPickerPrimarySurfaceColor"
- android:clipToPadding="false"
- android:elevation="0.1dp"
- android:paddingBottom="8dp"
+ android:gravity="center_vertical"
launcher:layout_sticky="true">
+ <FrameLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:clipToPadding="false"
+ android:elevation="0.1dp"
+ android:paddingBottom="8dp">
- <include layout="@layout/widgets_search_bar" />
- </FrameLayout>
+ <include layout="@layout/widgets_search_bar" />
+ </FrameLayout>
+
+ <ImageButton
+ android:id="@+id/widget_picker_widget_options_menu"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_marginStart="8dp"
+ android:layout_marginBottom="8dp"
+ android:layout_gravity="bottom"
+ android:background="@drawable/full_rounded_transparent_ripple"
+ android:contentDescription="@string/widget_picker_widget_options_button_description"
+ android:padding="12dp"
+ android:src="@drawable/ic_more_vert_dots"
+ android:visibility="gone"
+ android:tint="?attr/widgetPickerWidgetOptionsMenuColor" />
+ </LinearLayout>
<FrameLayout
android:layout_width="match_parent"
@@ -94,7 +115,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/widget_picker_tabs_background"
android:text="@string/widgets_full_sheet_personal_tab"
@@ -107,7 +127,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/widget_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/widget_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/widget_picker_tabs_background"
android:text="@string/widgets_full_sheet_work_tab"
diff --git a/res/layout/widgets_two_pane_sheet_recyclerview.xml b/res/layout/widgets_two_pane_sheet_recyclerview.xml
index f3d3b16..c6b3b74 100644
--- a/res/layout/widgets_two_pane_sheet_recyclerview.xml
+++ b/res/layout/widgets_two_pane_sheet_recyclerview.xml
@@ -39,19 +39,40 @@
android:clipToOutline="true"
android:orientation="vertical">
- <FrameLayout
+ <LinearLayout
android:id="@+id/search_bar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
android:background="?attr/widgetPickerPrimarySurfaceColor"
- android:clipToPadding="false"
- android:elevation="0.1dp"
- android:paddingBottom="16dp"
android:paddingHorizontal="@dimen/widget_list_horizontal_margin_two_pane"
launcher:layout_sticky="true">
+ <FrameLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:clipToPadding="false"
+ android:elevation="0.1dp"
+ android:paddingBottom="16dp">
- <include layout="@layout/widgets_search_bar" />
- </FrameLayout>
+ <include layout="@layout/widgets_search_bar" />
+ </FrameLayout>
+
+ <ImageButton
+ android:id="@+id/widget_picker_widget_options_menu"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_marginStart="8dp"
+ android:layout_marginBottom="16dp"
+ android:layout_gravity="bottom"
+ android:background="@drawable/full_rounded_transparent_ripple"
+ android:contentDescription="@string/widget_picker_widget_options_button_description"
+ android:padding="12dp"
+ android:src="@drawable/ic_more_vert_dots"
+ android:visibility="gone"
+ android:tint="?attr/widgetPickerWidgetOptionsMenuColor" />
+ </LinearLayout>
<FrameLayout
android:layout_width="match_parent"
diff --git a/res/layout/work_apps_edu.xml b/res/layout/work_apps_edu.xml
index f557fb6..a45d585 100644
--- a/res/layout/work_apps_edu.xml
+++ b/res/layout/work_apps_edu.xml
@@ -44,17 +44,16 @@
<FrameLayout
android:layout_width="@dimen/rounded_button_width"
android:layout_height="@dimen/rounded_button_width"
- android:background="@drawable/rounded_action_button"
- android:padding="@dimen/rounded_button_padding">
+ android:background="@drawable/rounded_action_button">
<ImageButton
android:id="@+id/action_btn"
android:layout_width="@dimen/x_icon_size"
android:layout_height="@dimen/x_icon_size"
+ android:scaleType="centerInside"
android:layout_gravity="center"
android:contentDescription="@string/accessibility_close"
- android:padding="@dimen/x_icon_padding"
android:background="@android:color/transparent"
- android:src="@drawable/ic_remove_no_shadow" />
+ android:src="@drawable/ic_close_work_edu" />
</FrameLayout>
</LinearLayout>
</com.android.launcher3.allapps.WorkEduCard>
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index d6b6a62..490a7c2 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Legstukke gedeaktiveer in Veiligmodus"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Kortpad is nie beskikbaar nie"</string>
<string name="home_screen" msgid="5629429142036709174">"Tuis"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Stel <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as verstektuisskermapp in Instellings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Verdeelde skerm"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Programinligting vir %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Gebruikinstellings vir %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Stoor apppaar"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Hierdie apppaar word nie op hierdie toestel gesteun nie"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Apppaar is nie beskikbaar nie"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Raak en hou om \'n legstuk te skuif."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dubbeltik en hou om \'n legstuk te skuif of gebruik gepasmaakte handelinge."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Meer opsies"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Wys alle legstukke"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d breed by %2$d hoog"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>-legstuk"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Voorstelle"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Noodsaaklikhede"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Nuus en tydskrifte"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Jou ontspansone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Vermaak"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosiaal"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Gesondheid en fiksheid"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weer"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Voorgestel vir jou"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-legstukke aan die regterkant, soektog en opsies aan die linkerkant"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# legstuk}other{# legstukke}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deïnstalleer"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Appinligting"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installeer privaat"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Deïnstalleer app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installeer"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Moenie voorstel nie"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Vasspeldvoorspelling"</string>
+ <string name="bubble" msgid="3072951361014076670">"Borrel"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installeer kortpaaie"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Laat \'n program toe om kortpaaie by te voeg sonder gebruikerinmenging."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lees tuis-instellings en -kortpaaie"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installeer tans; <xliff:g id="PROGRESS">%2$s</xliff:g> voltooi"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> laai tans af, <xliff:g id="PROGRESS">%2$s</xliff:g> voltooid"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> wag tans om te installeer"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is geargiveer. Tik om af te laai."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is geargiveer. Tik om af te laai en terug te stel."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Programopdatering word vereis"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Die program vir hierdie ikoon is nie opgedateer nie. Jy kan dit handmatig opdateer om hierdie kortpad weer te aktiveer, of die ikoon verwyder."</string>
<string name="dialog_update" msgid="2178028071796141234">"Dateer op"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tik om op te stel of oop te maak"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privaat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Privaat Ruimte-instellings"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privaat, ontsluit."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privaat, gesluit."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Sluit"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Privaat Ruimte-oorgang"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installeer apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installeer"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installeer apps in privaat ruimte"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Oorvloei"</string>
</resources>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 3f48d38..7292eec 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ምግብሮች በደህንነቱ የተጠበቀ ሁኔታ ተሰናክለዋል"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"አቋራጭ አይገኝም"</string>
<string name="home_screen" msgid="5629429142036709174">"መነሻ"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"በቅንብሮች ውስጥ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>ን እንደ ነባሪ የHome መተግበሪያ ያቀናብሩ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"የተከፈለ ማያ ገፅ"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"የመተግበሪያ መረጃ ለ%1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"የ%1$s የአጠቃቀም ቅንብሮች"</string>
<string name="save_app_pair" msgid="5647523853662686243">"የመተግበሪያ ጥምረትን ያስቀምጡ"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ይህ የመተግበሪያ ጥምረት በዚህ መሣሪያ ላይ አይደገፍም"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"የመተግበሪያ ጥምረት አይገኝም"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ምግብርን ለማንቀሳቀስ ይንኩ እና ይያዙ።"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ምግብርን ለማንቀሳቀስ ወይም ብጁ እርምጃዎችን ለመጠቀም ሁለቴ መታ ያድርጉ እና ይያዙ።"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ተጨማሪ አማራጮች"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ሁሉንም ምግብሮች አሳይ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ስፋት በ%2$d ከፍታ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"የ<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ምግብር"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"የአስተያየት ጥቆማዎች"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ጠቃሚ ነገሮች"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ዜና እና መጽሔቶች"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"የሚያርፉበት ቦታዎ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"መዝናኛ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ማህበራዊ"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ጤና እና የአካል ብቃት"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"የአየር ሁኔታ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ለእርስዎ የተጠቆሙ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ምግብሮች በቀኝ በኩል፣ ፍለጋ እና አማራጮች በግራ በኩል"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ምግብር}one{# ምግብሮች}other{# ምግብሮች}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"አራግፍ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"የመተግበሪያ መረጃ"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"በግል ይጫኑ"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"መተግበሪያን አራግፍ"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ጫን"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"መተግበሪያውን አይጠቁሙ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"የፒን ግምት"</string>
+ <string name="bubble" msgid="3072951361014076670">"አረፋ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"አቋራጮችን ይጭናል"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"መተግበሪያው ያለተጠቃሚ ጣልቃ ገብነት አቋራጭ እንዲያክል ያስችለዋል።"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"የመነሻ ቅንብሮች እና አቋራጮችን ያነባል"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> በመጫን ላይ፣ <xliff:g id="PROGRESS">%2$s</xliff:g> ተጠናቅቋል"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> በመውረድ ላይ፣ <xliff:g id="PROGRESS">%2$s</xliff:g> ተጠናቋል"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ለመጫን በመጠበቅ ላይ"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> በማህደር ተቀምጧል። ለማውረድ መታ ያድርጉ።"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> በማህደር ተቀምጧል። ለማወረድ እና ወደነበረበት ለመመለስ መታ ያድርጉ።"</string>
<string name="dialog_update_title" msgid="114234265740994042">"መተግበሪያ ማዘመን አስፈላጊ ነው"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"የዚህ አዶ መተግበሪያ አልተዘመነም። ይህን አቋራጭ ዳግም ለማንቃት በራስዎ ማዘመን ወይም አዶውን ማስወገድ ይችላሉ።"</string>
<string name="dialog_update" msgid="2178028071796141234">"አዘምን"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"ለማዋቀር ወይም ለመክፈት መታ ያድርጉ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"የግል"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"የግል ቦታ ቅንብሮች"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"የግል፣ የተከፈተ።"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"የግል፣ የተቆለፈ።"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ቆልፍ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"የግል ቦታ ሽግግር"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"መተግበሪያዎችን ይጫኑ"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ይጫኑ"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"መተግበሪያዎችን ወደ የግል ቦታ ይጫኑ"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ትርፍ ፍሰት"</string>
</resources>
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 3b6fc7c..06fc0a8 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"الأدوات غير مفعّلة في الوضع الآمن"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"الاختصار غير متاح"</string>
<string name="home_screen" msgid="5629429142036709174">"الشاشة الرئيسية"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"يمكن ضبط \"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>\" كتطبيق الشاشة الرئيسية التلقائي من خلال \"الإعدادات\""</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"تقسيم الشاشة"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"معلومات تطبيق %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"إعدادات استخدام \"%1$s\""</string>
<string name="save_app_pair" msgid="5647523853662686243">"حفظ استخدام التطبيقين معًا"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"لا يمكن استخدام هذين التطبيقَين في الوقت نفسه على هذا الجهاز"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ميزة \"استخدام تطبيقين في الوقت نفسه\" غير متوفّرة"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"انقر مع الاستمرار لنقل أداة."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"انقر مرتين مع تثبيت إصبعك لنقل أداة أو استخدام الإجراءات المخصّصة."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"خيارات إضافية"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"عرض كل التطبيقات المصغّرة"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"العرض %1$d الطول %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"أداة <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"اقتراحات"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"الأساسيات"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"الأخبار والمجلات"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"محتوى ترفيهي مقترَح"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"الترفيه"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"التواصل الاجتماعي"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"الصحة واللياقة البدنية"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"الطقس"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"اقتراحاتنا لك"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"تطبيقات \"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>\" المصغّرة على اليسار، والبحث والخيارات على اليمين"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{تطبيق مصغّر واحد}zero{# تطبيق مصغّر}two{تطبيقان مصغّران}few{# تطبيقات مصغّرة}many{# تطبيقًا مصغّرًا}other{# تطبيق مصغّر}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"إلغاء التثبيت"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"معلومات عن التطبيق"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"تثبيت في مساحة خاصّة"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"إلغاء تثبيت التطبيق"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"تثبيت"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"عدم اقتراح التطبيق"</string>
<string name="pin_prediction" msgid="4196423321649756498">"تثبيت التطبيق المتوقّع"</string>
+ <string name="bubble" msgid="3072951361014076670">"فقاعة"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"تثبيت اختصارات"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"للسماح لتطبيق ما بإضافة اختصارات بدون تدخل المستخدم."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"الاطلاع على الإعدادات والاختصارات على الشاشة الرئيسية"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"جارٍ تثبيت <xliff:g id="NAME">%1$s</xliff:g>، مستوى التقدم: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"جارٍ تنزيل <xliff:g id="NAME">%1$s</xliff:g>، اكتمل <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> في انتظار التثبيت"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"تمت أرشفة تطبيق <xliff:g id="NAME">%1$s</xliff:g>. انقر للتنزيل."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"تمت أرشفة تطبيق \"<xliff:g id="NAME">%1$s</xliff:g>\". انقر لتنزيله واستعادته."</string>
<string name="dialog_update_title" msgid="114234265740994042">"مطلوب تحديث التطبيق"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"لم يتمّ تحديث التطبيق الخاص بهذا الرمز. يمكنك تحديث التطبيق يدويًا لإعادة تفعيل هذا الاختصار أو إزالة الرمز."</string>
<string name="dialog_update" msgid="2178028071796141234">"تحديث"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"فلتر"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"تعذَّر <xliff:g id="WHAT">%1$s</xliff:g>."</string>
<string name="private_space_label" msgid="2359721649407947001">"مساحة خاصة"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"النقر للإعداد أو الفتح"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"انقر للإعداد أو الفتح"</string>
<string name="ps_container_title" msgid="4391796149519594205">"المساحة الخاصة"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"إعدادات المساحة الخاصة"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"المساحة الخاصة غير مُقفلة."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"المساحة الخاصة مُقفلة."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"قفل"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"النقل إلى المساحة الخاصة"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"تثبيت التطبيقات"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"تثبيت"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"تثبيت التطبيقات في المساحة الخاصّة"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"القائمة الكاملة"</string>
</resources>
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
index 8107dd4..cd6e347 100644
--- a/res/values-as/strings.xml
+++ b/res/values-as/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ৱিজেটবোৰক সুৰক্ষিত ম\'ডত অক্ষম কৰা হ’ল"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"শ্বৰ্টকাট নাই"</string>
<string name="home_screen" msgid="5629429142036709174">"গৃহ স্ক্ৰীন"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ছেটিঙত <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>ক ডিফ’ল্ট গৃহপৃষ্ঠা এপ্ হিচাপে ছেট কৰক"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"বিভাজিত স্ক্ৰীন"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$sৰ বাবে এপৰ তথ্য"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$sৰ বাবে ব্যৱহাৰৰ ছেটিং"</string>
<string name="save_app_pair" msgid="5647523853662686243">"এপৰ পেয়াৰ ছেভ কৰক"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"এই ডিভাইচটোত এই এপ্ পেয়াৰ কৰাৰ সুবিধাটো সমৰ্থিত নহয়"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"এপ্ পেয়াৰ কৰাৰ সুবিধাটো উপলব্ধ নহয়"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ৱিজেট স্থানান্তৰ কৰিবলৈ টিপি ধৰি ৰাখক।"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"কোনো ৱিজেট স্থানান্তৰ কৰিবলৈ দুবাৰ টিপি ধৰি ৰাখক অথবা কাষ্টম কাৰ্য ব্যৱহাৰ কৰক।"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"অধিক বিকল্প"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"আটাইবোৰ ৱিজেট দেখুৱাওক"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d বহল x %2$d ওখ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ৱিজেট"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"পৰামৰ্শ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"অত্যাৱশ্যকীয়সমূহ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"বাতৰি আৰু আলোচনী"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"আপোনাৰ পচন্দৰ স্থান"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"মনোৰঞ্জন"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"সামাজিক"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"স্বাস্থ্য আৰু সুস্থতা"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"বতৰ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"আপোনাৰ বাবে পৰামৰ্শ হিচাপে আগবঢ়োৱা"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ৱিজেট সোঁফালে, সন্ধান আৰু বিকল্পসমূহ বাওঁফালে"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# টা ৱিজেট}one{# টা ৱিজেট}other{# টা ৱিজেট}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"আনইনষ্টল কৰক"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"এপ্ সম্পৰ্কীয় তথ্য"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"গোপনে ইনষ্টল কৰক"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"এপ্ আনইনষ্টল কৰক"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ইনষ্টল কৰক"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"পৰামৰ্শ নিদিব"</string>
<string name="pin_prediction" msgid="4196423321649756498">"পূৰ্বানুমান কৰা এপ্টো পিন কৰক"</string>
+ <string name="bubble" msgid="3072951361014076670">"বাবল"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"শ্বৰ্টকাট ইনষ্টল কৰিব পাৰে"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ব্য়ৱহাৰকাৰীৰ হস্তক্ষেপ অবিহনেই কোনো এপক শ্বৰ্টকাটবোৰ যোগ কৰাৰ অনুমতি দিয়ে।"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"গৃহ স্ক্ৰীনত ছেটিং আৰু শ্বৰ্টকাটসমূহ পঢ়া"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ইনষ্টল কৰি থকা হৈছে, <xliff:g id="PROGRESS">%2$s</xliff:g> সম্পূৰ্ণ হৈছে"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ডাউনল’ড কৰি থকা হৈছে, <xliff:g id="PROGRESS">%2$s</xliff:g> সম্পূৰ্ণ হ’ল"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ইনষ্টল হোৱালৈ অপেক্ষা কৰি থকা হৈছে"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> আৰ্কাইভ কৰা হৈছে। ডাউনল’ড কৰিবলৈ টিপক।"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> আৰ্কাইভ কৰা হৈছে। ডাউনল’ড আৰু পুনঃস্থাপন কৰিবলৈ টিপক।"</string>
<string name="dialog_update_title" msgid="114234265740994042">"এপ্টো আপডে’ট কৰা প্ৰয়োজন"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"এই চিহ্নটোৰ এপ্টো আপডে’ট কৰা হোৱা নাই। আপুনি এই শ্বৰ্টকাটটো পুনৰ সক্ষম কৰিবলৈ মেনুৱেলী আপডে’ট কৰিব পাৰে অথবা চিহ্নটো আঁতৰাব পাৰে।"</string>
<string name="dialog_update" msgid="2178028071796141234">"আপডে’ট কৰক"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"ছেট আপ কৰিবলৈ টিপক অথবা খোলক"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ব্যক্তিগত"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ব্যক্তিগত স্পে’চৰ ছেটিং"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ব্যক্তিগত, আনলক কৰা আছে।"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ব্যক্তিগত, লক কৰা আছে।"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"লক কৰক"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ব্যক্তিগত স্পে’চৰ স্থানান্তৰণ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"এপ্ ইনষ্টল কৰক"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ইনষ্টল কৰক"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"এপ্সমূহ প্ৰাইভেট স্পেচত ইনষ্টল কৰক"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"অ’ভাৰফ্ল’"</string>
</resources>
diff --git a/res/values-az/strings.xml b/res/values-az/strings.xml
index d2d0c2b..b8d660f 100644
--- a/res/values-az/strings.xml
+++ b/res/values-az/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Vidcetlər Güvənli rejimdə deaktiv edilib"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Qısayol əlçatan deyil"</string>
<string name="home_screen" msgid="5629429142036709174">"Əsas səhifə"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Ayarlarda <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> tətbiqini defolt əsas ekran tətbiqi kimi ayarlayın"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ekran bölünməsi"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s ilə bağlı tətbiq məlumatı"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s üzrə istifadə ayarları"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Tətbiq cütünü saxlayın"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Bu tətbiq cütü bu cihazda dəstəklənmir"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Tətbiq cütü əlçatan deyil"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Vidceti daşımaq üçün toxunub saxlayın."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Vidceti daşımaq üçün iki dəfə toxunub saxlayın və ya fərdi əməliyyatlardan istifadə edin."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Digər seçimlər"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Bütün vidcetləri göstərin"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%2$d hündürlük %1$d enində"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> vidceti"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Təkliflər"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Əsaslar"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Xəbər və jurnallar"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"İstirahət zonası"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Əyləncə"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosial"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sağlamlıq və fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Hava"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Təklif edirik"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> vidcetləri sağda, axtarış və seçimlər solda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# vidcet}other{# vidcet}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Sistemdən sil"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Tətbiq haqqında"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Məxfi quraşdırın"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Tətbiqi sistemdən silin"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Quraşdırın"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Tətbiq təklif olunmasın"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Proqnozlaşdırılan tətbiqi bərkidin"</string>
+ <string name="bubble" msgid="3072951361014076670">"Qabarcıq"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"qısayolları quraşdır"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Tətbiqə istifadəçi müdaxiləsi olmadan qısayolları əlavə etməyə icazə verir."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Əsas səhifə ayarlarını və qısayollarını oxumaq"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> quraşdırır, <xliff:g id="PROGRESS">%2$s</xliff:g> tamamlanıb"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> endirilir, <xliff:g id="PROGRESS">%2$s</xliff:g> tamamlandı"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> yüklənmək üçün gözləyir"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> arxivləndi. Endirmək üçün toxunun."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> arxivləndi. Toxunaraq endirin və bərpa edin."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Tətbiqin güncəllənməsi tələb edilir"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Bu ikona üçün tətbiq güncəllənməyib. Bu qısayolu yenidən aktivləşdirmək üçün manual olaraq güncəlləyə və ya ikonanı silə bilərsiniz."</string>
<string name="dialog_update" msgid="2178028071796141234">"Güncəlləyin"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Davam etdirin"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtr"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Alınmadı: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Şəxsi yer"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Məxfi sahə"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Toxunaraq ayarlayın və ya açın"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Şəxsi"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Şəxsi məkan ayarları"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Şəxsi, kilidli deyil."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Şəxsi, kilidli."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Kilidləyin"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Şəxsi məkana keçid"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Tətbiqlər quraşdırın"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Quraşdırın"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Tətbiqləri şəxsi sahədə quraşdırın"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Kənara çıxma"</string>
</resources>
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index d37c241..4d4764e 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Vidžeti su onemogućeni u Bezbednom režimu"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Prečica nije dostupna"</string>
<string name="home_screen" msgid="5629429142036709174">"Početni ekran"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Podesite <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> kao podrazumevanu početnu aplikaciju u Podešavanjima"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Podeljeni ekran"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informacije o aplikaciji za: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Podešavanja potrošnje za %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Sačuvaj par aplikacija"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ovaj par aplikacija nije podržan na ovom uređaju"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Par aplikacija nije dostupan"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Dodirnite i zadržite radi pomeranja vidžeta."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvaput dodirnite i zadržite da biste pomerali vidžet ili koristite prilagođene radnje."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Još opcija"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Prikaži sve vidžete"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d×%2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"širina od %1$d i visina od %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> vidžet"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Dodaj na početni ekran"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Dodali ste vidžet <xliff:g id="WIDGET_NAME">%1$s</xliff:g> na početni ekran"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Predlozi"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Neophodne aplikacije"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Osnovno"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Novosti i časopisi"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zona za opuštanje"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Zabava"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Društvene mreže"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdravlje i fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Vreme"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Predloženo za vas"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Vidžeti <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> sa desne strane, pretraga i opcije sa leve strane"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# vidžet}one{# vidžet}few{# vidžeta}other{# vidžeta}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deinstaliraj"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Podaci o aplikaciji"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instaliraj na privatni"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Deinstalirajte aplikaciju"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instaliraj"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne predlaži aplikaciju"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Zakači predviđanje"</string>
+ <string name="bubble" msgid="3072951361014076670">"Oblačić"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instaliranje prečica"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Dozvoljava aplikaciji da dodaje prečice bez intervencije korisnika."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"čitanje podešavanja i prečica na početnom ekranu"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> se instalira, <xliff:g id="PROGRESS">%2$s</xliff:g> gotovo"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> se preuzima, završeno je <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> čeka na instaliranje"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dodirnite da biste je preuzeli."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dodirnite da biste je preuzeli i vratili."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Treba da ažurirate aplikaciju"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacija za ovu ikonu nije ažurirana. Možete da je ručno ažurirate da biste ponovo omogućili ovu prečicu ili uklonite ikonu."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ažuriraj"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Dodirnite da biste podesili ili otvorili"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privatno"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Podešavanja privatnog prostora"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privatno, otključano."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privatno, zaključano."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zaključavanje"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Prenos privatnog prostora"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalirajte aplikacije"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalirajte"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instaliraj aplikacije u privatan prostor"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Preklopno"</string>
</resources>
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
index d52ed4f..641509e 100644
--- a/res/values-be/strings.xml
+++ b/res/values-be/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Віджэты адключаны ў Бяспечным рэжыме"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Ярлык недаступны"</string>
<string name="home_screen" msgid="5629429142036709174">"Галоўны экран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Зрабіць <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> стандартнай праграмай для галоўнага экрана, перайшоўшы ў Налады"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Падзелены экран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Інфармацыя пра праграму для: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s: налады выкарыстання"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Захаваць спалучэнне праграм"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Дадзенае спалучэнне праграм не падтрымліваецца на гэтай прыладзе"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Спалучэнне праграм недаступнае"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Націсніце і ўтрымлівайце віджэт для перамяшчэння."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Дакраніцеся двойчы і ўтрымлівайце, каб перамясціць віджэт або выкарыстоўваць спецыяльныя дзеянні."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Дадатковыя параметры"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Паказваць усе віджэты"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Шырына: %1$d, вышыня: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Віджэт \"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>\""</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Прапановы"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Асноўнае"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Навіны і часопісы"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Зона адпачынку"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Забавы"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Сацыяльныя сеткі"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здароўе і фітнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Надвор\'е"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Рэкамендавана для вас"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Віджэты праграмы \"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>\" справа, пошук і параметры злева"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# віджэт}one{# віджэт}few{# віджэты}many{# віджэтаў}other{# віджэта}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Дэінсталяваць"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Звесткі аб праграме"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Усталяваць прыватна"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Выдаліць праграму"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Усталяваць"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Не прапаноўваць праграму"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Замацаваць прапанаваную праграму"</string>
+ <string name="bubble" msgid="3072951361014076670">"Бурбалка"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Стварэнне ярлыкоў"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Дазваляе праграмам дадаваць ярлыкі без умяшання карыстальніка."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"счытваць налады і ярлыкі на галоўным экране"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Усталёўваецца праграма \"<xliff:g id="NAME">%1$s</xliff:g>\", завершана <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Ідзе спампоўка <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> завершана"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> чакае ўсталёўкі"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Праграма \"<xliff:g id="NAME">%1$s</xliff:g>\" знаходзіцца ў архіве. Націсніце, каб спампаваць."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Праграма \"<xliff:g id="NAME">%1$s</xliff:g>\" знаходзіцца ў архіве. Націсніце, каб спампаваць яе і аднавіць."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Неабходна абнавіць праграму"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Гэта версія праграмы састарэла. Абнавіце праграму ўручную, каб зноў карыстацца гэтым ярлыком, або выдаліце значок."</string>
<string name="dialog_update" msgid="2178028071796141234">"Абнавіць"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Актываваць"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Фільтр"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Не ўдалося: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Прыватная вобласць"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Прыватная прастора"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Націсніце, каб наладзіць або адкрыць"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Прыватная"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Налады прыватнай вобласці"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Прыватная прастора, разблакіравана."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Прыватная прастора, заблакіравана."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Заблакіраваць"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Пераход у прыватную вобласць"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Усталяваць праграмы"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Усталяваць"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Усталяваць праграмы ў прыватнай прасторы"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Дадатковае меню"</string>
</resources>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index e4f5e5a..3ce3c5f 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Приспособленията са деактивирани в безопасния режим"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Няма достъп до прекия път"</string>
<string name="home_screen" msgid="5629429142036709174">"Начален екран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"От настройките задайте <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> като основното приложение за начален екран"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Разделен екран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Информация за приложението за %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Настройки за използването на %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Запазване на двойката приложения"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Тази двойка приложения не се поддържа на устройството"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Двойката приложения не е налице"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Докоснете и задръжте за преместване на приспособление"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Докоснете двукратно и задръжте за преместване на приспособление или използвайте персонал. действия."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Още опции"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Показв. на всички присп."</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Ширина %1$d и височина %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> приспособление"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Предложения"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Приспособления, които трябва да изпробвате"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Новини и списания"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Зоната ви за разпускане"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Развлечения"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Социални мрежи"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здраве и фитнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Времето"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Предложено за вас"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Приспособленията за <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> са отдясно, търсенето и опциите – отляво"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# приспособление}other{# приспособления}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Деинсталиране"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Информация за прилож."</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Инстал. в частно простр."</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Деинсталиране на приложението"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Инсталиране"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Без предлагане на приложение"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Фиксиране на предвиждането"</string>
+ <string name="bubble" msgid="3072951361014076670">"Балонче"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"инсталиране на преки пътища"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Разрешава на приложението да добавя преки пътища без намеса на потребителя."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"четене на настройките и преките пътища на началния екран"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> се инсталира, <xliff:g id="PROGRESS">%2$s</xliff:g> завършено"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> се изтегля. Завършено: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> изчаква инсталиране"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Приложението <xliff:g id="NAME">%1$s</xliff:g> е архивирано. Докоснете за изтегляне."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Приложението <xliff:g id="NAME">%1$s</xliff:g> е архивирано. Докоснете за изтегляне и възстановяване."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Изисква се актуализация на приложението"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Приложението за тази икона не е актуализирано. Можете да го актуализирате ръчно, за да активирате отново този пряк път, или да премахнете иконата."</string>
<string name="dialog_update" msgid="2178028071796141234">"Актуализиране"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Отмяна на паузата"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Филтър"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Неуспешно: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Лично пространство"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Частно пространство"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Докоснете за настройване или отваряне"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Лично"</string>
- <string name="ps_container_settings" msgid="6059734123353320479">"Настройки за личното пространство"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_settings" msgid="6059734123353320479">"Настройки за частното пространство"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Частно, отключено."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Частно, заключено."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Заключване"</string>
- <string name="ps_container_transition" msgid="8667331812048014412">"Преминаване към личното пространство"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Инсталиране на приложения"</string>
+ <string name="ps_container_transition" msgid="8667331812048014412">"Преминаване към частното пространство"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Инсталиране"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Инсталиране на приложения в частно пространство"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Препълване"</string>
</resources>
diff --git a/res/values-bn/strings.xml b/res/values-bn/strings.xml
index 3da344d..9b23590 100644
--- a/res/values-bn/strings.xml
+++ b/res/values-bn/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"সুরক্ষিত মোডে উইজেট নিষ্ক্রিয় থাকে"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"শর্টকাটগুলি অনুপলব্ধ"</string>
<string name="home_screen" msgid="5629429142036709174">"হোম"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"সেটিংসে গিয়ে <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> অ্যাপকে ডিফল্ট হোম অ্যাপ হিসেবে সেট করুন"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"স্প্লিট স্ক্রিন"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s-এর জন্য অ্যাপ সম্পর্কিত তথ্য"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s-এর জন্য ব্যবহারের সেটিংস"</string>
<string name="save_app_pair" msgid="5647523853662686243">"অ্যাপ পেয়ার সেভ করুন"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"এই ডিভাইসে এই অ্যাপ পেয়ারটি কাজ করে না"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"অ্যাপ পেয়ার উপলভ্য নেই"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"কোনও উইজেট সরাতে সেটি টাচ করে ধরে রাখুন।"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"একটি উইজেট সরাতে বা কাস্টম অ্যাকশন ব্যবহার করতে ডবল ট্যাপ করে ধরে রাখুন।"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"আরও বিকল্প"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"সব উইজেট দেখুন"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%2$d উচ্চতা অনুযায়ী %1$d প্রস্থ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>টি উইজেট"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"সাজেশন"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"প্রয়োজনীয় জিনিস"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"খবর ও ম্যাগাজিন"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"আপনার চিল জোন"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"বিনোদন"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"সোশ্যাল"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"স্বাস্থ্য ও ফিটনেস"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"আবহাওয়া"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"আপনার জন্য সাজেস্ট করা হয়েছে"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> উইজেট ডানদিকে, সার্চ ও বিকল্প বাঁদিকে রয়েছে"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{#টি উইজেট}one{#টি উইজেট}other{#টি উইজেট}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"সরান"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"আনইনস্টল করুন"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"অ্যাপের তথ্য"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ব্যক্তিগত প্রোফাইলে ইনস্টল করুন"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"প্রাইভেট প্রোফাইলে ইনস্টল করুন"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"অ্যাপ আনইনস্টল করুন"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ইনস্টল করুন"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"অ্যাপ সাজেস্ট করবেন না"</string>
<string name="pin_prediction" msgid="4196423321649756498">"আপনার প্রয়োজন হতে পারে এমন অ্যাপ পিন করুন"</string>
+ <string name="bubble" msgid="3072951361014076670">"বাবল"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"শর্টকাটগুলি ইনস্টল করে"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"একটি অ্যাপ্লিকেশানকে ব্যবহারকারীর হস্তক্ষেপ ছাড়াই শর্টকাটগুলি যোগ করার অনুমতি দেয়৷"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"হোম স্ক্রিনে সেটিংস ও শর্টকাট পড়ুন"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ইনস্টল করা হচ্ছে, <xliff:g id="PROGRESS">%2$s</xliff:g> সম্পূর্ণ হয়েছে"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ডাউনলোড হচ্ছে <xliff:g id="PROGRESS">%2$s</xliff:g> সম্পন্ন হয়েছে"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ইনস্টলের অপেক্ষায় রয়েছে"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> আর্কাইভ করা হয়েছে। ডাউনলোড করতে ট্যাপ করুন।"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> আর্কাইভ করা হয়েছে। ডাউনলোড করতে এবং ফিরিয়ে আনতে ট্যাপ করুন।"</string>
<string name="dialog_update_title" msgid="114234265740994042">"অ্যাপটি আপডেট করা প্রয়োজন"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"এই আইকনের জন্য অ্যাপটি আপডেট করা নেই। এই শর্টকার্ট আবার চালু করতে, আপনি ম্যানুয়ালি আপডেট করতে বা সরিয়ে দিতে পারবেন।"</string>
<string name="dialog_update" msgid="2178028071796141234">"আপডেট করুন"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"সেট-আপ করতে বা খুলতে ট্যাপ করুন"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ব্যক্তিগত"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ব্যক্তিগত স্পেসের সেটিংস"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ব্যক্তিগত, আনলক করা আছে।"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ব্যক্তিগত, লক করা আছে।"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"লক"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ব্যক্তিগত স্পেস ট্রানজিট করা"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"অ্যাপ ইনস্টল করুন"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ইনস্টল করুন"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"প্রাইভেট স্পেসে অ্যাপ ইনস্টল করুন"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ওভারফ্লো"</string>
</resources>
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
index a150428..4a34da7 100644
--- a/res/values-bs/strings.xml
+++ b/res/values-bs/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Vidžeti su onemogućeni u sigurnom načinu rada."</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Prečica nije dostupna"</string>
<string name="home_screen" msgid="5629429142036709174">"Početni ekran"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Postavite <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> kao zadanu aplikaciju za početni ekran u Postavkama"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Podijeljeni ekran"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informacije o aplikaciji %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Postavke korištenja za: %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Sačuvaj par aplikacija"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Par aplikacija nije podržan na uređaju"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Par aplikacija nije dostupan"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Dodirnite i zadržite da pomjerite vidžet."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvaput dodirnite i zadržite da pomjerite vidžet ili da koristite prilagođene radnje."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Više opcija"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Prikazuj sve vidžete"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Širina %1$d, visina %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Vidžet <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Prijedlozi"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Osnovne aplikacije"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Vijesti i časopisi"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Vaša zona opuštanja"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Zabava"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Društvene mreže"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdravlje i fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Vrijeme"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Predloženo za vas"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Vidžeti aplikacije <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> su na desnoj, a pretraživanje i opcije na lijevoj strani"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# vidžet}one{# vidžet}few{# vidžeta}other{# vidžeta}}"</string>
@@ -65,7 +66,7 @@
<string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Posao"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Razgovori"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"Pisanje bilješki"</string>
- <string name="widget_add_button_label" msgid="2761267068711937179">"Dodaj"</string>
+ <string name="widget_add_button_label" msgid="2761267068711937179">"Dodajte"</string>
<string name="widget_add_button_content_description" msgid="1810530016360039643">"Dodavanje vidžeta <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
<string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"Dodirnite da promijenite postavke vidžeta"</string>
<string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"Promjena postavki vidžeta"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Ukloni"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deinstaliraj"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Inform. o aplikaciji"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instaliraj u priv. pr."</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instaliraj u Privatno"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Deinstalirajte aplikaciju"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instaliraj"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne predlaži aplikaciju"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Zakači predviđanje"</string>
+ <string name="bubble" msgid="3072951361014076670">"Oblačić"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instaliraj prečice"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Dopušta aplikaciji dodavanje prečica bez posredovanja korisnika."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"čita postavke na početnom ekranu i prečice"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instaliranje aplikacije <xliff:g id="NAME">%1$s</xliff:g>, završeno je <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> se preuzima, završeno <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> čeka da se instalira"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Arhivirana je aplikacija <xliff:g id="NAME">%1$s</xliff:g>. Dodirnite je da je preuzmete."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Arhivirana je aplikacija <xliff:g id="NAME">%1$s</xliff:g>. Dodirnite da je preuzmete i vratite."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Potrebno je ažurirati aplikaciju"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacija za ovu ikonu nije ažurirana. Možete je ažurirati ručno da ponovo omogućite ovu prečicu ili možete ukloniti ikonu."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ažuriraj"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Ponovo pokreni"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtrirajte"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Nije uspjelo: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Privatan prostor"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Privatni prostor"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Dodirnite da postavite ili otvorite"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privatno"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Postavke privatnog prostora"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privatno, otključano."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privatno, zaključano."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zaključaj"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Prelazak u privatan prostor"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instaliranje aplikacija"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalirajte"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instaliranje aplikacija u privatni prostor"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Preklopni meni"</string>
</resources>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index a284738..c341ec7 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"En Mode segur, els widgets estan desactivats."</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"La drecera no està disponible"</string>
<string name="home_screen" msgid="5629429142036709174">"Inici"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Defineix <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> com a aplicació d\'inici predeterminada a Configuració"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Pantalla dividida"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informació de l\'aplicació %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Configuració d\'ús de %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Desa la parella d\'aplicacions"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Aquesta parella d\'aplicacions no s\'admet en aquest dispositiu"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"La parella d\'aplicacions no està disponible"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Fes doble toc i mantén premut per moure un widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Fes doble toc i mantén premut per moure un widget o per utilitzar accions personalitzades."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Més opcions"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostra tots els widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d d\'amplada per %2$d d\'alçada"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget de <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggeriments"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essencials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Notícies i revistes"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"La teva zona de relax"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entreteniment"</string>
- <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Salut i fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Temps"</string>
+ <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Xarxes socials"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggeriments per a tu"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets de <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> a la dreta, cerca i opcions a l\'esquerra"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstal·la"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Informació de l\'aplicació"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instal·la en privat"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstal·la l\'aplicació"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instal·la"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"No suggereixis l\'aplicació"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixa la predicció"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bombolla"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instal·la dreceres"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permet que una aplicació afegeixi dreceres sense la intervenció de l\'usuari."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"llegir la configuració i les dreceres de la pantalla d\'inici"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"S\'està instal·lant <xliff:g id="NAME">%1$s</xliff:g>; s\'ha completat un <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"S\'està baixant <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> completat"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"S\'està esperant per instal·lar <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"L\'aplicació <xliff:g id="NAME">%1$s</xliff:g> està arxivada. Toca per baixar."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"L\'aplicació <xliff:g id="NAME">%1$s</xliff:g> està arxivada. Toca per baixar-la i restaurar-la."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Cal actualitzar l\'aplicació"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"L\'aplicació d\'aquesta icona no està actualitzada. Pots actualitzar-la manualment per tornar a activar aquesta drecera o pots suprimir la icona."</string>
<string name="dialog_update" msgid="2178028071796141234">"Actualitza"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Toca per configurar o obrir"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Configuració d\'Espai privat"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat, desbloquejat."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat, bloquejat."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Bloqueja"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Canvia a Espai privat"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instal·la apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instal·la"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instal·la les aplicacions a Espai privat"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menú addicional"</string>
</resources>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 1b43fe3..d3512c9 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"V nouzovém režimu jsou widgety zakázány."</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Zkratka není k dispozici"</string>
<string name="home_screen" msgid="5629429142036709174">"Domů"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Nastavit <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> jako výchozí vstupní aplikaci v Nastavení"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Rozdělit obrazovku"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informace o aplikaci %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Nastavení využití pro aplikaci %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Uložit dvojici aplikací"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Tento pár aplikací není na tomto zařízení podporován"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Dvojice aplikací není k dispozici"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Widget přesunete klepnutím a podržením."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvojitým klepnutím a podržením přesunete widget, případně použijte vlastní akce."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Další možnosti"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Zobrazit všechny widgety"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"šířka %1$d, výška %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Přidat na plochu"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g> byl přidán na plochu"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Návrhy"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Základní"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Nejdůležitější aplikace"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Zprávy a časopisy"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Vaše klidová zóna"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Zábava"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sociální sítě"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdraví a fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Počasí"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Návrhy pro vás"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgety <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> vpravo, vyhledávání a možnosti vlevo"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{ # widget}few{# widgety}many{# widgetu}other{# widgetů}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Odinstalovat"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"O aplikaci"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalovat soukromě"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Odinstalovat aplikaci"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Nainstalovat"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nenavrhovat aplikaci"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Připnout předpověď"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bublat"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalace zástupce"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Umožňuje aplikaci přidat zástupce bez zásahu uživatele."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"čtení nastavení a zkratek plochy"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instalace aplikace <xliff:g id="NAME">%1$s</xliff:g>, dokončeno <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Stahování aplikace <xliff:g id="NAME">%1$s</xliff:g> (dokončeno <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Instalace aplikace <xliff:g id="NAME">%1$s</xliff:g> čeká na zahájení"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikace <xliff:g id="NAME">%1$s</xliff:g> je archivována. Klepnutím ji stáhnete."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikace <xliff:g id="NAME">%1$s</xliff:g> je archivována. Klepnutím ji můžete stáhnout a obnovit."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Je nutná aktualizace aplikace"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikace pro tuto ikonu není nainstalována. Můžete ji ručně aktualizovat, aby zkratka znovu fungovala, případně můžete ikonu odstranit."</string>
<string name="dialog_update" msgid="2178028071796141234">"Aktualizovat"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Klepnutím nastavíte nebo otevřete"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Soukromé"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Nastavení soukromého prostoru"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Soukromé, odemčeno."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Soukromé, uzamčeno."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zamknout"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Převádění soukromého prostoru"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalovat aplikace"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Nainstalovat"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalovat aplikace do soukromého prostoru"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Rozbalovací nabídka"</string>
</resources>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 0cc7d2e..8aae860 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets er deaktiveret i Beskyttet tilstand"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Genvejen er ikke tilgængelig"</string>
<string name="home_screen" msgid="5629429142036709174">"Startskærm"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Angiv <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> som standardstartapp i Indstillinger"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Opdel skærm"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Appinfo for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Indstillinger for brug af %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Gem appsammenknytning"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Denne appsammenknytning understøttes ikke på enheden"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Appsammenknytning er ikke tilgængelig"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Hold en widget nede for at flytte den."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Tryk to gange, og hold en widget nede for at flytte den eller bruge tilpassede handlinger."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Flere valgmuligheder"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Vis alle widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d i bredden og %2$d i højden"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widgetten <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Forslag"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Vigtige ting"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Aviser og blade"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Dit afslapningshjørne"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Underholdning"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Socialt"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sundhed og fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Vejr"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Forslag til dig"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-widgets til højre, søgning og valgmuligheder til venstre"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Afinstaller"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Appinfo"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installer (privat)"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Afinstaller appen"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installer"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Foreslå ikke en app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fastgør forslaget"</string>
+ <string name="bubble" msgid="3072951361014076670">"Boble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installere genveje"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Tillader, at en app tilføjer genveje uden brugerens indgriben."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"læs indstillinger og genveje for startskærm"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installeres. <xliff:g id="PROGRESS">%2$s</xliff:g> fuldført"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloades. <xliff:g id="PROGRESS">%2$s</xliff:g> er gennemført"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> venter på at installere"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> er arkiveret Tryk for at downloade."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> er arkiveret Tryk for at downloade og gendanne."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Appen skal opdateres"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Appen, der tilhører dette ikon, er ikke opdateret. Du kan opdatere appen manuelt for at genaktivere denne genvej, eller du kan fjerne ikonet."</string>
<string name="dialog_update" msgid="2178028071796141234">"Opdater"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tryk for at konfigurere eller åbne"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Indstillinger for privat rum"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat, oplåst."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat, låst."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lås"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Ændringer af tilstanden for det private område"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installer apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installer"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installer apps i privat område"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overløb"</string>
</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 88cefc8..374f5a1 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -27,15 +27,19 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets im abgesicherten Modus deaktiviert"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Verknüpfung nicht verfügbar"</string>
<string name="home_screen" msgid="5629429142036709174">"Startbildschirm"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> in den Einstellungen als Stand-Start-App festlegen"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Splitscreen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App-Info für %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Nutzungseinstellungen für %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"App-Paar speichern"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Dieses App-Paar wird auf diesem Gerät nicht unterstützt"</string>
<string name="app_pair_needs_unfold" msgid="4588897528143807002">"Gerät aufklappen, um dieses App-Paar zu verwenden"</string>
<string name="app_pair_not_available" msgid="3556767440808032031">"App-Paar nicht verfügbar"</string>
- <string name="long_press_widget_to_add" msgid="3587712543577675817">"Zum Verschieben des Widgets berühren und halten"</string>
+ <string name="long_press_widget_to_add" msgid="3587712543577675817">"Zum Verschieben des Widgets gedrückt halten"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Doppeltippen und halten, um ein Widget zu bewegen oder benutzerdefinierte Aktionen zu nutzen."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Weitere Optionen"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Alle Widgets anzeigen"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d breit und %2$d hoch"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget „<xliff:g id="WIDGET_NAME">%1$s</xliff:g>“"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Vorschläge"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Must-haves"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Nachrichten und Zeitschriften"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zum Entspannen"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Unterhaltung"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Soziale Netzwerke"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Gesundheit und Fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Wetter"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Vorschläge für dich"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-Widgets rechts, Suche und Optionen links"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# Widget}other{# Widgets}}"</string>
@@ -75,7 +76,7 @@
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle Apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Benachrichtigungen"</string>
- <string name="long_press_shortcut_to_add" msgid="5405328730817637737">"Zum Verschieben einer Verknüpfung berühren und halten"</string>
+ <string name="long_press_shortcut_to_add" msgid="5405328730817637737">"Zum Verschieben einer Verknüpfung gedrückt halten"</string>
<string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"Doppeltippen und halten, um eine Verknüpfung zu bewegen oder benutzerdefinierte Aktionen zu nutzen."</string>
<string name="out_of_space" msgid="6455557115204099579">"Auf diesem Startbildschirm ist kein Platz mehr vorhanden"</string>
<string name="hotseat_out_of_space" msgid="7448809638125333693">"Ablage \"Favoriten\" ist voll."</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Entfernen"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deinstallieren"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App-Info"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Privat installieren"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Vertraul. installieren"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"App deinstallieren"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installieren"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"App nicht vorschlagen"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Vorgeschlagene App fixieren"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Verknüpfungen installieren"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Ermöglicht einer App das Hinzufügen von Verknüpfungen ohne Eingreifen des Nutzers"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Einstellungen und Verknüpfungen auf dem Startbildschirm lesen"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> wird installiert, <xliff:g id="PROGRESS">%2$s</xliff:g> abgeschlossen"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> wird heruntergeladen, <xliff:g id="PROGRESS">%2$s</xliff:g> abgeschlossen"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Warten auf Installation von <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ist archiviert. Zum Herunterladen tippen."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ist archiviert. Tippe, um die App herunterzuladen und wiederherzustellen."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App-Update erforderlich"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Die App für dieses Symbol wurde noch nicht aktualisiert. Du kannst sie manuell aktualisieren, um die Verknüpfung wieder zu aktivieren, oder das Symbol entfernen."</string>
<string name="dialog_update" msgid="2178028071796141234">"Aktualisieren"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Nicht mehr pausieren"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filter"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Fehler: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Privates Profil"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Vertrauliches Profil"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Zum Einrichten oder Öffnen tippen"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
- <string name="ps_container_settings" msgid="6059734123353320479">"Einstellungen für privaten Bereich"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_title" msgid="4391796149519594205">"Vertraulich"</string>
+ <string name="ps_container_settings" msgid="6059734123353320479">"Einstellungen für vertrauliches Profil"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat, entsperrt."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat, gesperrt."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Sperren"</string>
- <string name="ps_container_transition" msgid="8667331812048014412">"Sperrzustand des privaten Bereichs wird gerade geändert"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Apps installieren"</string>
- <string name="ps_add_button_content_description" msgid="3254274107740952556">"Apps im privaten Bereich installieren"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Weitere Optionen"</string>
+ <string name="ps_container_transition" msgid="8667331812048014412">"Sperrzustand des vertraulichen Profils wird gerade geändert"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installieren"</string>
+ <string name="ps_add_button_content_description" msgid="3254274107740952556">"Apps im vertraulichen Profil installieren"</string>
</resources>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 650d814..cafe86e 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Τα γραφικά στοιχεία απενεργοποιήθηκαν στην ασφαλή λειτουργία"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Η συντόμευση δεν είναι διαθέσιμη"</string>
<string name="home_screen" msgid="5629429142036709174">"Αρχική οθόνη"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Ορίστε το <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ως την προεπιλεγμένη εφαρμογή αρχικής οθόνης στις Ρυθμίσεις"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Διαχωρισμός οθόνης"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Πληροφορίες εφαρμογής για %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Ρυθμίσεις χρήσης για %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Αποθήκευση ζεύγους εφαρμογών"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Αυτό το ζεύγος εφαρμογών δεν υποστηρίζεται σε αυτή τη συσκευή"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Το ζεύγος εφαρμογών δεν είναι διαθέσιμο"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Πατήστε παρατετ. για μετακίνηση γραφ. στοιχείου."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Πατήστε δύο φορές παρατεταμένα για μετακίνηση γραφικού στοιχείου ή χρήση προσαρμοσμένων ενεργειών."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Περισσότερες επιλογές"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Εμφ. συνόλου γραφ. στοιχ."</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Πλάτος %1$d επί ύψος %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Γραφικό στοιχείο <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Προτάσεις"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Απαραίτητα"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Ειδήσεις και περιοδικά"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Ο δικός σας τρόπος χαλάρωσης"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Ψυχαγωγία"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Κοινωνικά δίκτυα"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Υγεία και φυσική κατάσταση"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Καιρός"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Προτεινόμενα για εσάς"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Γραφικά στοιχεία <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> στα δεξιά, αναζήτηση και επιλογές στα αριστερά"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# γραφικό στοιχείο}other{# γραφικά στοιχεία}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Απεγκατάσταση"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Πληροφ. εφαρμογής"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Εγκατ. στο απόρρητο"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Απεγκατάσταση εφαρμογής"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Εγκατάσταση"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Να μην προτείνεται η εφαρμογή"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Να μην προτείνεται"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Καρφίτσωμα πρόβλεψης"</string>
+ <string name="bubble" msgid="3072951361014076670">"Συννεφάκι"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"εγκατάσταση συντομεύσεων"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Επιτρέπει σε μια εφαρμογή την προσθήκη συντομεύσεων χωρίς την παρέμβαση του χρήστη."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ανάγνωση ρυθμίσεων και συντομεύσεων αρχικής οθόνης"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Έχει ολοκληρωθεί το <xliff:g id="PROGRESS">%2$s</xliff:g> της εγκατάστασης της εφαρμογής <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Λήψη <xliff:g id="NAME">%1$s</xliff:g>, ολοκληρώθηκε <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> σε αναμονή για εγκατάσταση"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Η εφαρμογή <xliff:g id="NAME">%1$s</xliff:g> είναι αρχειοθετημένη. Πατήστε για λήψη."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Η εφαρμογή <xliff:g id="NAME">%1$s</xliff:g> είναι αρχειοθετημένη. Πατήστε για λήψη και επαναφορά."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Απαιτείται ενημέρωση της εφαρμογής"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Η εφαρμογή για αυτό το εικονίδιο δεν έχει ενημερωθεί. Μπορείτε να την ενημερώσετε μη αυτόματα για να ενεργοποιήσετε ξανά τη συγκεκριμένη συντόμευση ή να καταργήσετε το εικονίδιο."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ενημέρωση"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Πάτημα για ρύθμιση ή άνοιγμα"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Ιδιωτικό"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Ρυθμίσεις Ιδιωτικού χώρου"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Ιδιωτικό, ξεκλειδωμένο."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Ιδιωτικό, κλειδωμένο."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Κλείδωμα"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Μετάβαση στον Ιδιωτικό χώρο"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Εγκατάσταση εφαρμογών"</string>
- <string name="ps_add_button_content_description" msgid="3254274107740952556">"Εγκατάσταση εφαρμογών στον απόρρητο χώρο"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Υπερχείλιση"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Εγκατάσταση"</string>
+ <string name="ps_add_button_content_description" msgid="3254274107740952556">"Εγκατάσταση εφαρμογών στον ιδιωτικό χώρο"</string>
</resources>
diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
index 90de272..1b0722d 100644
--- a/res/values-en-rAU/strings.xml
+++ b/res/values-en-rAU/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets disabled in Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shortcut isn\'t available"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Set <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as the default home app in Settings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App info for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Usage settings for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Save app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"This app pair isn\'t supported on this device"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App pair isn\'t available"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Touch and hold to move a widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Double-tap & hold to move a widget or use custom actions."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"More options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Show all widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d wide by %2$d high"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"News and magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Your chill zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Health and fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weather"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggested for you"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgets on right, search and options on left"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Install in private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstall app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Install"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Don\'t suggest app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin prediction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"install shortcuts"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Allows an app to add shortcuts without user intervention."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"read Home settings and shortcuts"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installing, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloading, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> waiting to install"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download and restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App update required"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"The app for this icon isn\'t updated. You can update manually to re-enable this shortcut or remove the icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tap to set up or open"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Private"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Private Space Settings"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Private, unlocked."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, locked."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space transitioning"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Install apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Install apps to private space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index a36e96c..de41d2c 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets disabled in Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shortcut isn\'t available"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Set <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as default home app in Settings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App info for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Usage settings for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Save app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"This app pair isn\'t supported on this device"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App pair isn\'t available"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Touch and hold to move a widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Double-tap and hold to move a widget or use custom actions."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"More options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Show all widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d wide by %2$d high"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"News & magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Your Chill Zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Health & fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weather"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggested for you"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgets on right, search and options on left"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Install in private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstall app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Install"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Don\'t suggest app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin Prediction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"install shortcuts"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Allows an app to add shortcuts without user intervention."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"read home settings and shortcuts"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installing, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloading, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> waiting to install"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download and restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App update required"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"The app for this icon isn\'t updated. You can update manually to re-enable this shortcut, or remove the icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -193,7 +196,6 @@
<string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, locked."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space Transitioning"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Install apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Install apps to Private Space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 90de272..1b0722d 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets disabled in Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shortcut isn\'t available"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Set <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as the default home app in Settings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App info for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Usage settings for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Save app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"This app pair isn\'t supported on this device"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App pair isn\'t available"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Touch and hold to move a widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Double-tap & hold to move a widget or use custom actions."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"More options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Show all widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d wide by %2$d high"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"News and magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Your chill zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Health and fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weather"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggested for you"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgets on right, search and options on left"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Install in private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstall app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Install"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Don\'t suggest app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin prediction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"install shortcuts"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Allows an app to add shortcuts without user intervention."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"read Home settings and shortcuts"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installing, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloading, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> waiting to install"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download and restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App update required"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"The app for this icon isn\'t updated. You can update manually to re-enable this shortcut or remove the icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tap to set up or open"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Private"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Private Space Settings"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Private, unlocked."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, locked."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space transitioning"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Install apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Install apps to private space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index 90de272..1b0722d 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets disabled in Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shortcut isn\'t available"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Set <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as the default home app in Settings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App info for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Usage settings for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Save app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"This app pair isn\'t supported on this device"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App pair isn\'t available"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Touch and hold to move a widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Double-tap & hold to move a widget or use custom actions."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"More options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Show all widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d wide by %2$d high"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"News and magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Your chill zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Health and fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weather"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggested for you"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgets on right, search and options on left"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Install in private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstall app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Install"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Don\'t suggest app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin prediction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"install shortcuts"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Allows an app to add shortcuts without user intervention."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"read Home settings and shortcuts"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installing, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloading, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> waiting to install"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download and restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App update required"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"The app for this icon isn\'t updated. You can update manually to re-enable this shortcut or remove the icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tap to set up or open"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Private"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Private Space Settings"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Private, unlocked."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, locked."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space transitioning"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Install apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Install apps to private space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
index 04c2dcf..a856340 100644
--- a/res/values-en-rXC/strings.xml
+++ b/res/values-en-rXC/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets disabled in Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shortcut isn\'t available"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Set <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> as default home app in Settings"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App info for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Usage settings for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Save app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"This app pair isn\'t supported on this device"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App pair isn\'t available"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Touch & hold to move a widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Double-tap & hold to move a widget or use custom actions."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"More options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Show all widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d wide by %2$d high"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"News & magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Your Chill Zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Health & fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weather"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggested for you"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgets on right, search and options on left"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Install in private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstall app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Install"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Don\'t suggest app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin Prediction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"install shortcuts"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Allows an app to add shortcuts without user intervention."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"read home settings and shortcuts"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installing, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> downloading, <xliff:g id="PROGRESS">%2$s</xliff:g> complete"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> waiting to install"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is archived. Tap to download and restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App update required"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"The app for this icon isn\'t updated. You can update manually to re-enable this shortcut, or remove the icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -193,7 +196,6 @@
<string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, locked."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space Transitioning"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Install apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Install apps to Private Space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 932fcd8..ba1b0af 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets inhabilitados en modo seguro"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"El acceso directo no está disponible"</string>
<string name="home_screen" msgid="5629429142036709174">"Pantalla principal"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Establece <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> como la app de inicio predeterminada en Configuración"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Pantalla dividida"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Información de la app de %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Configuración del uso de %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Guardar vinculación"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"No se admite esta vinculación de apps en este dispositivo"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"La vinculación de apps no está disponible"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Mantén presionado para mover un widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Presiona dos veces y mantén presionado para mover un widget o usar acciones personalizadas."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Más opciones"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostrar todos los widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de ancho por %2$d de alto"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugerencias"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Imprescindibles"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Noticias y revistas"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zona de descanso"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entretenimiento"</string>
- <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Salud y bienestar"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Clima"</string>
+ <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Redes sociales"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugerencias para ti"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets de <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> a la derecha, búsqueda y opciones a la izquierda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -61,7 +62,7 @@
<string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"Borra el texto del cuadro de búsqueda"</string>
<string name="no_widgets_available" msgid="4337693382501046170">"Los widgets y accesos directos no están disponibles"</string>
<string name="no_search_results" msgid="3787956167293097509">"No se encontraron widgets ni accesos directos"</string>
- <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Personales"</string>
+ <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Personal"</string>
<string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Trabajo"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Conversaciones"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"Tomar notas"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Quitar"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Información de app"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instala en privado"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalar en privado"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalar app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalar"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"No sugerir app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fijar predicción"</string>
+ <string name="bubble" msgid="3072951361014076670">"Burbuja"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar accesos directos"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite que una aplicación agregue accesos directos sin que el usuario intervenga."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"leer parámetros de configuración y accesos directos de la página principal"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Se está instalando <xliff:g id="NAME">%1$s</xliff:g>; <xliff:g id="PROGRESS">%2$s</xliff:g> completado"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Se completó el <xliff:g id="PROGRESS">%2$s</xliff:g> de la descarga de <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Instalación de <xliff:g id="NAME">%1$s</xliff:g> en espera"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> está archivada. Presiona para descargar."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> está archivada. Presiona para descargar y restablecer."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Es necesario actualizar la app"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"No se actualizó la app de este ícono. Puedes actualizarla manualmente para rehabilitar el acceso directo, o bien quitar el ícono."</string>
<string name="dialog_update" msgid="2178028071796141234">"Actualizar"</string>
@@ -170,8 +173,8 @@
<string name="action_deep_shortcut" msgid="2864038805849372848">"Accesos directos"</string>
<string name="action_dismiss_notification" msgid="5909461085055959187">"Descartar"</string>
<string name="accessibility_close" msgid="2277148124685870734">"Cerrar"</string>
- <string name="all_apps_personal_tab" msgid="4190252696685155002">"Personales"</string>
- <string name="all_apps_work_tab" msgid="4884822796154055118">"De trabajo"</string>
+ <string name="all_apps_personal_tab" msgid="4190252696685155002">"Personal"</string>
+ <string name="all_apps_work_tab" msgid="4884822796154055118">"Trabajo"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"Perfil de trabajo"</string>
<string name="work_profile_edu_work_apps" msgid="7895468576497746520">"Las apps de trabajo tienen una insignia y el administrador de TI las puede ver"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"Entendido"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Presiona para configurar o abrir"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privado"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Configuración de Espacio privado"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privado (desbloqueado)"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privado (bloqueado)"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Bloqueo"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Pasar a Espacio privado"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instala apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalar"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instala las apps en el espacio privado"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Ampliada"</string>
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index f7daeb3..ad12192 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets inhabilitados en modo Seguro"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Acceso directo no disponible"</string>
<string name="home_screen" msgid="5629429142036709174">"Inicio"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Define <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> como aplicación de inicio predeterminada en Ajustes"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Pantalla dividida"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Información de la aplicación %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Ajustes de uso para %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Guardar apps emparejadas"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"El dispositivo no admite esta aplicación emparejada"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"La aplicación emparejada no está disponible"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Mantén pulsado un widget para moverlo"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Toca dos veces y mantén pulsado un widget para moverlo o usar acciones personalizadas."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Más opciones"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostrar todos los widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de ancho por %2$d de alto"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget de <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugerencias"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Imprescindibles"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Noticias y revistas"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Tu zona de descanso"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entretenimiento"</string>
- <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Salud y actividad física"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"El tiempo"</string>
+ <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Redes sociales"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugerencias para ti"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets de <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> a la derecha, búsqueda y opciones a la izquierda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Información de la aplicación"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Descargar en privado"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalar aplicación"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalar"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"No sugerir aplicación"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fijar predicción"</string>
+ <string name="bubble" msgid="3072951361014076670">"Burbuja"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar accesos directos"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite que una aplicación añada accesos directos sin intervención del usuario."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"leer ajustes y accesos directos de la pantalla de inicio"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instalando <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> completado"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Descargando <xliff:g id="NAME">%1$s</xliff:g> (<xliff:g id="PROGRESS">%2$s</xliff:g> completado)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Esperando para instalar <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> está archivada. Toca para descargarla."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> está archivada. Toca para descargar y restaurar."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Debes actualizar la aplicación"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"La aplicación de este icono no está actualizada. Puedes actualizarla manualmente para volver a habilitar este acceso directo o puedes eliminar el icono."</string>
<string name="dialog_update" msgid="2178028071796141234">"Actualizar"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Toca para configurarlo o abrirlo"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privado"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Ajustes del espacio privado"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privado, desbloqueado."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privado, bloqueado."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Bloquear"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Cambiar a espacio privado"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Descarg. apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalar"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Descargar aplicaciones en el espacio privado"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Desplegable"</string>
</resources>
diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml
index 6ebdff0..96d0b2c 100644
--- a/res/values-et/strings.xml
+++ b/res/values-et/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Turvarežiimis on vidinad keelatud"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Otsetee pole saadaval"</string>
<string name="home_screen" msgid="5629429142036709174">"Avakuva"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Määrake rakendus <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> seadetes avakuva vaikerakenduseks"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Jagatud ekraanikuva"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Rakenduse teave: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Kasutuse seaded: %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Salvesta rakendusepaar"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"See rakendusepaar ei ole selles seadmes toetatud"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Rakendusepaar ei ole saadaval"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Vidina teisaldamiseks puudutage ja hoidke all."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Vidina teisaldamiseks või kohandatud toimingute kasutamiseks topeltpuudutage ja hoidke all."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Rohkem valikuid"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Kuva kõik vidinad"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d lai ja %2$d kõrge"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Vidin <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Soovitused"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Põhiasjad"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Uudised ja ajakirjad"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Teie lõõgastumiskoht"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Meelelahutus"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Suhtlus"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Tervis ja vormisolek"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Ilm"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Teile soovitatud"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Teenuse <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> vidinad paremal, otsing ja valikud vasakul"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# vidin}other{# vidinat}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalli"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Rakenduse teave"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Privaatselt installimine"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalli rakendus"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installimine"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ära soovita rakendust"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Kinnita ennustus"</string>
+ <string name="bubble" msgid="3072951361014076670">"Mull"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installi otseteed"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Võimaldab rakendusel lisada otseteid kasutaja sekkumiseta."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"avakuva seadete ja otseteede lugemine"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Üksust <xliff:g id="NAME">%1$s</xliff:g> installitakse, <xliff:g id="PROGRESS">%2$s</xliff:g> on valmis"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Rakenduse <xliff:g id="NAME">%1$s</xliff:g> allalaadimine, <xliff:g id="PROGRESS">%2$s</xliff:g> on valmis"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> on installimise ootel"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> on arhiivitud. Puudutage allalaadimiseks."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> on arhiivitud. Puudutage allalaadimiseks ja taastamiseks."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Rakendust tuleb värskendada"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Selle ikooni rakendust pole värskendatud. Otsetee uuesti lubamiseks võite rakendust käsitsi värskendada või ikooni eemaldada."</string>
<string name="dialog_update" msgid="2178028071796141234">"Värskenda"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Seadistamiseks või avamiseks puudutage"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privaatne"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Privaatse ruumi seaded"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privaatne, võrgulukuta."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privaatne, lukustatud."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lukk"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Privaatse ruumi üleviimine"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Rakenduste installimine"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installi"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Rakenduste installimine privaatses ruumis"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Ületäide"</string>
</resources>
diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml
index 9bd26e6..bc9b8c1 100644
--- a/res/values-eu/strings.xml
+++ b/res/values-eu/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgetak desgaitu egin dira modu seguruan"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Lasterbideak ez daude erabilgarri"</string>
<string name="home_screen" msgid="5629429142036709174">"Orri nagusia"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Ezarri <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> hasierako aplikazio lehenetsi gisa ezarpenetan"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Pantaila zatitzea"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s aplikazioari buruzko informazioa"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s aplikazioaren erabilera-ezarpenak"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Gorde aplikazio parea"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Aplikazio pare hori ez da onartzen gailu honetan"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Aplikazio parea ez dago erabilgarri"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Eduki sakatuta widget bat mugitzeko."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Sakatu birritan eta eduki sakatuta widget bat mugitzeko edo ekintza pertsonalizatuak erabiltzeko."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Aukera gehiago"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Erakutsi widget guztiak"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d zabal eta %2$d luze"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widgeta"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Iradokizunak"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Oinarrizkoak"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Albisteak eta aldizkariak"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Lasaitzeko gunea"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Aisia"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sare sozialak"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Osasuna eta ongizatea"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Eguraldia"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Zuri iradokiak"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> zerbitzuaren widgetak eskuinean, bilaketa eta aukerak ezkerrean"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widget}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalatu"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Aplikazioaren informazioa"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalatu pribatuan"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalatu aplikazioa"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalatu"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ez iradoki aplikazioa"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Ainguratu iragarpena"</string>
+ <string name="bubble" msgid="3072951361014076670">"Burbuila"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Instalatu lasterbideak"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Erabiltzaileak ezer egin gabe lasterbideak gehitzeko baimena ematen die aplikazioei."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"irakurri hasierako pantailako ezarpenak eta lasterbideak"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> instalatzen, <xliff:g id="PROGRESS">%2$s</xliff:g> osatuta"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> deskargatzen, <xliff:g id="PROGRESS">%2$s</xliff:g> osatuta"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> instalatzeko zain"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> artxibatuta dago. Deskargatzeko, sakatu hau."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> artxibatuta dago. Sakatu deskargatzeko eta leheneratzeko."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Aplikazioa eguneratu egin behar da"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Ikonoaren aplikazioa ez dago eguneratuta. Lasterbidea berriro gaitzeko, eskuz egunera dezakezu aplikazioa. Bestela, kendu ikonoa."</string>
<string name="dialog_update" msgid="2178028071796141234">"Eguneratu"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Sakatu konfiguratzeko edo irekitzeko"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Pribatua"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Eremu pribatuaren ezarpenak"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Pribatua, desblokeatuta."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Pribatua, blokeatuta."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Blokeatu"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Eremu pribaturako trantsizioa"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalatu aplikazioak"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalatu"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalatu aplikazioak eremu pribatuan"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Luzapena"</string>
</resources>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 46f5859..c167194 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -24,51 +24,52 @@
<string name="activity_not_found" msgid="8071924732094499514">"برنامه نصب نشده است."</string>
<string name="activity_not_available" msgid="7456344436509528827">"برنامه در دسترس نیست"</string>
<string name="safemode_shortcut_error" msgid="9160126848219158407">"برنامه بارگیری شده در حالت ایمن غیرفعال شد"</string>
- <string name="safemode_widget_error" msgid="4863470563535682004">"ابزارکها در حالت ایمن غیرفعال هستند"</string>
+ <string name="safemode_widget_error" msgid="4863470563535682004">"ابزارهها در حالت ایمن غیرفعال هستند"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"میانبر دردسترس نیست"</string>
<string name="home_screen" msgid="5629429142036709174">"صفحه اصلی"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"تنظیم <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> بهعنوان برنامه صفحه اصلی پیشفرض در «تنظیمات»"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"صفحهٔ دونیمه"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"اطلاعات برنامه %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"تنظیمات مصرف برای %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ذخیره جفت برنامه"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"از این جفت برنامه در این دستگاه پشتیبانی نمیشود"</string>
<string name="app_pair_needs_unfold" msgid="4588897528143807002">"برای استفاده از این جفت برنامه، دستگاه را باز کنید"</string>
<string name="app_pair_not_available" msgid="3556767440808032031">"جفت برنامه دردسترس نیست"</string>
- <string name="long_press_widget_to_add" msgid="3587712543577675817">"برای جابهجا کردن ابزارک، لمس کنید و نگه دارید."</string>
- <string name="long_accessible_way_to_add" msgid="2733588281439571974">"برای جابهجا کردن ابزارک یا استفاده از کنشهای سفارشی، دوضربه بزنید و نگه دارید."</string>
+ <string name="long_press_widget_to_add" msgid="3587712543577675817">"برای جابهجا کردن ابزاره، لمس کنید و نگه دارید."</string>
+ <string name="long_accessible_way_to_add" msgid="2733588281439571974">"برای جابهجا کردن ابزاره یا استفاده از کنشهای سفارشی، دو تکضرب بزنید و نگه دارید."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"گزینههای بیشتر"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"نمایش همه ابزارهها"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d عرض در %2$d طول"</string>
- <string name="widget_preview_context_description" msgid="9045841361655787574">"ابزارک <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
- <string name="widget_preview_name_and_dims_content_description" msgid="8489038126122831595">"ابزارک <xliff:g id="WIDGET_NAME">%1$s</xliff:g>، %2$d عرض در %3$d ارتفاع"</string>
- <string name="add_item_request_drag_hint" msgid="8730547755622776606">"ابزارک را لمس کنید و نگه دارید تا بتوانید آن را در صفحه اصلی حرکت دهید"</string>
+ <string name="widget_preview_context_description" msgid="9045841361655787574">"ابزاره <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
+ <string name="widget_preview_name_and_dims_content_description" msgid="8489038126122831595">"ابزاره <xliff:g id="WIDGET_NAME">%1$s</xliff:g>، %2$d عرض در %3$d ارتفاع"</string>
+ <string name="add_item_request_drag_hint" msgid="8730547755622776606">"ابزاره را لمس کنید و نگه دارید تا بتوانید آن را در صفحه اصلی حرکت دهید"</string>
<string name="add_to_home_screen" msgid="9168649446635919791">"افزودن به صفحه اصلی"</string>
- <string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"ابزارک <xliff:g id="WIDGET_NAME">%1$s</xliff:g> به صفحه اصلی اضافه شد"</string>
+ <string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"ابزاره <xliff:g id="WIDGET_NAME">%1$s</xliff:g> به صفحه اصلی اضافه شد"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"پیشنهادها"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"بایدها"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ضروریات"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"اخبار و مجله"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"منطقه آرامش شما"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"سرگرمی"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"اجتماعی"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"سلامتی و تناسب اندام"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"آبوهوا"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"پیشنهاداتی برای شما"</string>
- <string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ابزارکهای <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> در سمت چپ، جستجو و گزینهها در سمت راست"</string>
- <string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ابزارک}one{# ابزارک}other{# ابزارک}}"</string>
+ <string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ابزارههای <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> در سمت چپ، «جستجو» و گزینهها در سمت راست"</string>
+ <string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ابزاره}one{# ابزاره}other{# ابزاره}}"</string>
<string name="shortcuts_count" msgid="8471715556199592381">"{count,plural, =1{# میانبر}one{# میانبر}other{# میانبر}}"</string>
<string name="widgets_and_shortcuts_count" msgid="7209136747878365116">"<xliff:g id="WIDGETS_COUNT">%1$s</xliff:g>،<xliff:g id="SHORTCUTS_COUNT">%2$s</xliff:g>"</string>
- <string name="widget_button_text" msgid="2880537293434387943">"ابزارکها"</string>
+ <string name="widget_button_text" msgid="2880537293434387943">"ابزارهها"</string>
<string name="widgets_full_sheet_search_bar_hint" msgid="8484659090860596457">"جستجو"</string>
<string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"پاک کردن نوشتار از چارگوش جستجو"</string>
- <string name="no_widgets_available" msgid="4337693382501046170">"ابزارک و میانبری دردسترس نیست"</string>
- <string name="no_search_results" msgid="3787956167293097509">"هیچ ابزارک یا میانبری پیدا نشد"</string>
- <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"ابزارکهای شخصی"</string>
- <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"کار"</string>
+ <string name="no_widgets_available" msgid="4337693382501046170">"ابزاره و میانبری دردسترس نیست"</string>
+ <string name="no_search_results" msgid="3787956167293097509">"هیچ ابزاره یا میانبری پیدا نشد"</string>
+ <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"ابزارههای شخصی"</string>
+ <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"ابزارههای کاری"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"مکالمهها"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"یادداشتبرداری"</string>
<string name="widget_add_button_label" msgid="2761267068711937179">"افزودن"</string>
- <string name="widget_add_button_content_description" msgid="1810530016360039643">"افزودن ابزارک <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
- <string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"برای تغییر تنظیمات ابزارک، ضربه بزنید"</string>
- <string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"تغییر تنظیمات ابزارک"</string>
+ <string name="widget_add_button_content_description" msgid="1810530016360039643">"افزودن ابزاره <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
+ <string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"برای تغییر تنظیمات ابزاره، تکضرب بزنید"</string>
+ <string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"تغییر تنظیمات ابزاره"</string>
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"جستجوی برنامهها"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"درحال بارگیری برنامهها…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"هیچ برنامهای در مطابقت با «<xliff:g id="QUERY">%1$s</xliff:g>» پیدا نشد"</string>
@@ -76,7 +77,7 @@
<string name="all_apps_label" msgid="5015784846527570951">"همه برنامهها"</string>
<string name="notifications_header" msgid="1404149926117359025">"اعلانها"</string>
<string name="long_press_shortcut_to_add" msgid="5405328730817637737">"برای جابهجا کردن میانبر، لمس کنید و نگه دارید."</string>
- <string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"برای جابهجا کردن میانبر یا استفاده از کنشهای سفارشی، دوضربه بزنید و نگه دارید."</string>
+ <string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"برای جابهجا کردن میانبر یا استفاده از کنشهای سفارشی، دو تکضرب بزنید و نگه دارید."</string>
<string name="out_of_space" msgid="6455557115204099579">"فضای خالی در این صفحه اصلی وجود ندارد"</string>
<string name="hotseat_out_of_space" msgid="7448809638125333693">"فضای بیشتری در سینی موارد دلخواه وجود ندارد"</string>
<string name="all_apps_button_label" msgid="8130441508702294465">"فهرست برنامهها"</string>
@@ -87,18 +88,20 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"حذف نصب"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"اطلاعات برنامه"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"نصب در نمایه خصوصی"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"حذف نصب برنامه"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"نصب"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"برنامه پیشنهاد داده نشود"</string>
<string name="pin_prediction" msgid="4196423321649756498">"سنجاق کردن پیشنهاد"</string>
+ <string name="bubble" msgid="3072951361014076670">"حبابک"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"نصب میانبرها"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"به برنامه اجازه میدهد میانبرها را بدون دخالت کاربر اضافه کند."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"خواندن تنظیمات و میانبرهای صفحه اصلی"</string>
<string name="permdesc_read_settings" msgid="4208061150510996676">"به برنامه اجازه میدهد تنظیمات و میانبرهای صفحه اصلی را بخواند."</string>
<string name="permlab_write_settings" msgid="4820028712156303762">"نوشتن تنظیمات و میانبرهای صفحه اصلی"</string>
<string name="permdesc_write_settings" msgid="726859348127868466">"به برنامه اجازه میدهد تنظیمات و میانبرهای صفحه اصلی را تغییر دهد."</string>
- <string name="gadget_error_text" msgid="740356548025791839">"ابزارک را نمیتوان بار کرد"</string>
- <string name="gadget_setup_text" msgid="8348374825537681407">"تنظیمات ابزارک"</string>
- <string name="gadget_complete_setup_text" msgid="309040266978007925">"برای تکمیل راهاندازی ضربه بزنید"</string>
+ <string name="gadget_error_text" msgid="740356548025791839">"ابزاره را نمیتوان بار کرد"</string>
+ <string name="gadget_setup_text" msgid="8348374825537681407">"تنظیمات ابزاره"</string>
+ <string name="gadget_complete_setup_text" msgid="309040266978007925">"برای تکمیل راهاندازی تکضرب بزنید"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"این برنامه سیستمی است و حذف نصب نمیشود."</string>
<string name="folder_hint_text" msgid="5174843001373488816">"ویرایش نام"</string>
<string name="disabled_app_label" msgid="6673129024321402780">"<xliff:g id="APP_NAME">%1$s</xliff:g> غیرفعال شد"</string>
@@ -107,8 +110,8 @@
<string name="workspace_scroll_format" msgid="8458889198184077399">"صفحه اصلی %1$d از %2$d"</string>
<string name="workspace_new_page" msgid="257366611030256142">"صفحه اصلی جدید"</string>
<string name="folder_opened" msgid="94695026776264709">"پوشه باز شده، <xliff:g id="WIDTH">%1$d</xliff:g> در <xliff:g id="HEIGHT">%2$d</xliff:g>"</string>
- <string name="folder_tap_to_close" msgid="4625795376335528256">"برای بستن پوشه، ضربه بزنید"</string>
- <string name="folder_tap_to_rename" msgid="4017685068016979677">"برای ذخیره تغییر نام، ضربه بزنید"</string>
+ <string name="folder_tap_to_close" msgid="4625795376335528256">"برای بستن پوشه، تکضرب بزنید"</string>
+ <string name="folder_tap_to_rename" msgid="4017685068016979677">"برای ذخیره تغییر نام، تکضرب بزنید"</string>
<string name="folder_closed" msgid="4100806530910930934">"پوشه بسته شد"</string>
<string name="folder_renamed" msgid="1794088362165669656">"نام پوشه به <xliff:g id="NAME">%1$s</xliff:g> تغییر کرد"</string>
<string name="folder_name_format_exact" msgid="8626242716117004803">"پوشه: <xliff:g id="NAME">%1$s</xliff:g>، <xliff:g id="SIZE">%2$d</xliff:g> مورد"</string>
@@ -138,13 +141,13 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> درحال نصب است، <xliff:g id="PROGRESS">%2$s</xliff:g> تکمیل شده است"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"درحال بارگیری <xliff:g id="NAME">%1$s</xliff:g>، <xliff:g id="PROGRESS">%2$s</xliff:g> کامل شد"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> درانتظار نصب"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> بایگانی شده است. برای بارگیری ضربه بزنید."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> بایگانی شده است. برای بارگیری و بازیابی تکضرب بزنید."</string>
<string name="dialog_update_title" msgid="114234265740994042">"برنامه باید بهروز شود"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"برنامه برای این نماد بهروز نشده است. میتوانید آن را بهصورت دستی بهروز کنید تا میانبر دوباره فعال شود، یا نماد را بردارید."</string>
<string name="dialog_update" msgid="2178028071796141234">"بهروزرسانی"</string>
<string name="dialog_remove" msgid="6510806469849709407">"برداشتن"</string>
- <string name="widgets_list" msgid="796804551140113767">"فهرست ابزارکها"</string>
- <string name="widgets_list_closed" msgid="6141506579418771922">"فهرست ابزارکها بسته شد"</string>
+ <string name="widgets_list" msgid="796804551140113767">"فهرست ابزارهها"</string>
+ <string name="widgets_list_closed" msgid="6141506579418771922">"فهرست ابزارهها بسته شد"</string>
<string name="action_add_to_workspace" msgid="215894119683164916">"افزودن به صفحه اصلی"</string>
<string name="action_move_here" msgid="2170188780612570250">"انتقال مورد به اینجا"</string>
<string name="item_added_to_workspace" msgid="4211073925752213539">"مورد به صفحه اصلی اضافه شد"</string>
@@ -166,7 +169,7 @@
<string name="action_increase_height" msgid="459390020612501122">"افزایش ارتفاع"</string>
<string name="action_decrease_width" msgid="1374549771083094654">"کاهش عرض"</string>
<string name="action_decrease_height" msgid="282377193880900022">"کاهش ارتفاع"</string>
- <string name="widget_resized" msgid="9130327887929620">"اندازه ابزارک به عرض <xliff:g id="NUMBER_0">%1$s</xliff:g> ارتفاع <xliff:g id="NUMBER_1">%2$s</xliff:g> تغییر کرد"</string>
+ <string name="widget_resized" msgid="9130327887929620">"اندازه ابزاره به عرض <xliff:g id="NUMBER_0">%1$s</xliff:g> ارتفاع <xliff:g id="NUMBER_1">%2$s</xliff:g> تغییر کرد"</string>
<string name="action_deep_shortcut" msgid="2864038805849372848">"میانبرها"</string>
<string name="action_dismiss_notification" msgid="5909461085055959187">"رد کردن"</string>
<string name="accessibility_close" msgid="2277148124685870734">"بستن"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"فیلتر"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"ناموفق بود: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"فضای خصوصی"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"برای راهاندازی یا باز کردن، ضربه بزنید"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"برای راهاندازی یا باز کردن، تکضرب بزنید"</string>
<string name="ps_container_title" msgid="4391796149519594205">"خصوصی"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"تنظیمات «فضای خصوصی»"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"خصوصی، باز."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"خصوصی، قفل."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"قفل کردن"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"انتقال «فضای خصوصی»"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"نصب برنامهها"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"نصب"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"نصب برنامهها در «فضای خصوصی»"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"سرریز"</string>
</resources>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index b27f654..007d077 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgetit poistettu käytöstä vikasietotilassa"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Pikakuvake ei ole käytettävissä."</string>
<string name="home_screen" msgid="5629429142036709174">"Etusivu"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Valitse <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> oletusaloitusnäyttösovellukseksi asetuksissa"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Jaettu näyttö"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Sovellustiedot: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Käyttöasetus tälle: %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Tallenna sovelluspari"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Sovellusparia ei tueta tällä laitteella"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Sovelluspari ei ole saatavilla"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Kosketa pitkään, niin voit siirtää widgetiä."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Kaksoisnapauta ja paina pitkään, niin voit siirtää widgetiä tai käyttää muokattuja toimintoja."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Lisäasetukset"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Näytä kaikki widgetit"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Leveys: %1$d, korkeus: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Ehdotukset"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Kaikki tarvittava"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Uutiset ja aikakauslehdet"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Ota rennosti"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Viihde"</string>
- <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosiaalinen"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Terveys ja kuntoilu"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Sää"</string>
+ <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Some"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sinulle ehdotetut"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widgetit oikealla, haku ja vaihtoehdot vasemmalla"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgetiä}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Poista asennus"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Sovelluksen tiedot"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Asenna yksityisesti"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Poista sovellus"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Asenna"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Älä ehdota sovellusta"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Kiinnitä sovellus"</string>
+ <string name="bubble" msgid="3072951361014076670">"Kupla"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"asenna pikakuvakkeita"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Antaa sovelluksen lisätä pikakuvakkeita itsenäisesti ilman käyttäjän valintaa."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lukea aloitusnäytön asetuksia ja pikakuvakkeita"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> asennetaan, <xliff:g id="PROGRESS">%2$s</xliff:g> valmis"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> latautuu, valmiina <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> odottaa asennusta"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> on arkistoitu. Lataa napauttamalla."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> on arkistoitu. Lataa ja palauta napauttamalla."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Sovelluspäivitys vaaditaan"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Kuvakkeen sovellusta ei ole päivitetty. Voit ottaa pikakuvakkeen uudelleen käyttöön päivittämällä sovelluksen tai poistaa kuvakkeen."</string>
<string name="dialog_update" msgid="2178028071796141234">"Päivitä"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Ota käyttöön tai avaa napauttamalla"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Yksityinen"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Yksityisen tilan asetukset"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Yksityinen, lukitsematon."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Yksityinen, lukittu."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lukko"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Yksityisen tilan siirtäminen"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Asenna sovelluksia"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Asenna"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Asenna sovelluksia yksityiseen tilaan"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Ylivuoto"</string>
</resources>
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml
index c99a0fd..c443505 100644
--- a/res/values-fr-rCA/strings.xml
+++ b/res/values-fr-rCA/strings.xml
@@ -21,21 +21,25 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name" msgid="649227358658669779">"Lanceur3"</string>
<string name="work_folder_name" msgid="3753320833950115786">"Travail"</string>
- <string name="activity_not_found" msgid="8071924732094499514">"L\'application n\'est pas installée."</string>
- <string name="activity_not_available" msgid="7456344436509528827">"Application indisponible"</string>
- <string name="safemode_shortcut_error" msgid="9160126848219158407">"L\'application téléchargée est désactivée en mode sans échec."</string>
+ <string name="activity_not_found" msgid="8071924732094499514">"L\'appli n\'est pas installée."</string>
+ <string name="activity_not_available" msgid="7456344436509528827">"Appli indisponible"</string>
+ <string name="safemode_shortcut_error" msgid="9160126848219158407">"L\'appli téléchargée est désactivée en mode sans échec."</string>
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets désactivés en mode sans échec"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Le raccourci n\'est pas disponible"</string>
<string name="home_screen" msgid="5629429142036709174">"Accueil"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Définissez <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> comme appli d\'accueil par défaut dans les paramètres"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Écran divisé"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Renseignements sur l\'appli pour %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Paramètres d\'utilisation pour %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Enr. paire d\'applis"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
- <string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Cette paire d\'applications n\'est pas prise en charge sur cet appareil"</string>
- <string name="app_pair_needs_unfold" msgid="4588897528143807002">"Déplier l\'appareil pour utiliser cette paire d\'applications"</string>
- <string name="app_pair_not_available" msgid="3556767440808032031">"La Paire d\'applications n\'est pas offerte"</string>
+ <string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Cette paire d\'applis n\'est pas prise en charge sur cet appareil"</string>
+ <string name="app_pair_needs_unfold" msgid="4588897528143807002">"Déplier l\'appareil pour utiliser cette paire d\'applis"</string>
+ <string name="app_pair_not_available" msgid="3556767440808032031">"La Paire d\'applis n\'est pas offerte"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Maintenez le doigt sur un widget pour le déplacer."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Touchez 2x un widget et maintenez le doigt dessus pour le déplacer ou utiliser des actions personnalisées."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Autres options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Afficher tous les widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de largeur sur %2$d de hauteur"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentiels"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Actualités et magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zone de divertissement"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Divertissement"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Médias sociaux"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Santé et mise en forme"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Météo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suggestions personnalisées"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> à droite, recherche et options à gauche"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}other{# widgets}}"</string>
@@ -69,39 +70,41 @@
<string name="widget_add_button_content_description" msgid="1810530016360039643">"Ajoutez le widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
<string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"Touchez pour modifier les paramètres du widget"</string>
<string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"Modifier les paramètres du widget"</string>
- <string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Rechercher dans les applications"</string>
- <string name="all_apps_loading_message" msgid="5813968043155271636">"Chargement des applications en cours…"</string>
- <string name="all_apps_no_search_results" msgid="3200346862396363786">"Aucune application trouvée correspondant à « <xliff:g id="QUERY">%1$s</xliff:g> »"</string>
- <string name="label_application" msgid="8531721983832654978">"Application"</string>
- <string name="all_apps_label" msgid="5015784846527570951">"Toutes les applications"</string>
+ <string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Rechercher dans les applis"</string>
+ <string name="all_apps_loading_message" msgid="5813968043155271636">"Chargement des applis en cours…"</string>
+ <string name="all_apps_no_search_results" msgid="3200346862396363786">"Aucune appli trouvée correspondant à « <xliff:g id="QUERY">%1$s</xliff:g> »"</string>
+ <string name="label_application" msgid="8531721983832654978">"Appli"</string>
+ <string name="all_apps_label" msgid="5015784846527570951">"Toutes les applis"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
<string name="long_press_shortcut_to_add" msgid="5405328730817637737">"Maintenez le doigt sur un raccourci pour le déplacer."</string>
<string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"Touchez deux fois un raccourci et maintenez le doigt dessus pour le déplacer ou utiliser des actions personnalisées."</string>
<string name="out_of_space" msgid="6455557115204099579">"Pas d\'espace libre sur cet écran d\'accueil"</string>
<string name="hotseat_out_of_space" msgid="7448809638125333693">"Il n\'y a plus d\'espace dans la zone des favoris"</string>
- <string name="all_apps_button_label" msgid="8130441508702294465">"Liste des applications"</string>
+ <string name="all_apps_button_label" msgid="8130441508702294465">"Liste des applis"</string>
<string name="all_apps_search_results" msgid="5889367432531296759">"Résultats de recherche"</string>
- <string name="all_apps_button_personal_label" msgid="1315764287305224468">"Liste des applications personnelles"</string>
- <string name="all_apps_button_work_label" msgid="7270707118948892488">"Liste des applications professionnelles"</string>
+ <string name="all_apps_button_personal_label" msgid="1315764287305224468">"Liste des applis personnelles"</string>
+ <string name="all_apps_button_work_label" msgid="7270707118948892488">"Liste des applis professionnelles"</string>
<string name="remove_drop_target_label" msgid="7812859488053230776">"Supprimer"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Désinstaller"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Détails de l\'appli"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installer dans privé"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Désinstaller l\'appli"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installer"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne pas suggérer d\'application"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne pas suggérer d\'appli"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Épingler la prédiction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bulle"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installer des raccourcis"</string>
- <string name="permdesc_install_shortcut" msgid="923466509822011139">"Permet à une application d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur."</string>
+ <string name="permdesc_install_shortcut" msgid="923466509822011139">"Permet à une appli d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lire les paramètres et les raccourcis de la page d\'accueil"</string>
- <string name="permdesc_read_settings" msgid="4208061150510996676">"Permet à l\'application de lire les paramètres et les raccourcis de l\'écran d\'accueil."</string>
+ <string name="permdesc_read_settings" msgid="4208061150510996676">"Permet à l\'appli de lire les paramètres et les raccourcis de l\'écran d\'accueil."</string>
<string name="permlab_write_settings" msgid="4820028712156303762">"modifier les paramètres et les raccourcis de la page d\'accueil"</string>
- <string name="permdesc_write_settings" msgid="726859348127868466">"Permet à l\'application de modifier les paramètres et les raccourcis de l\'écran d\'accueil."</string>
+ <string name="permdesc_write_settings" msgid="726859348127868466">"Permet à l\'appli de modifier les paramètres et les raccourcis de l\'écran d\'accueil."</string>
<string name="gadget_error_text" msgid="740356548025791839">"Impossible de charger le widget"</string>
<string name="gadget_setup_text" msgid="8348374825537681407">"Paramètres du widget"</string>
<string name="gadget_complete_setup_text" msgid="309040266978007925">"Touchez pour terminer la configuration"</string>
- <string name="uninstall_system_app_text" msgid="4172046090762920660">"Impossible de désinstaller cette application, car il s\'agit d\'une application système."</string>
+ <string name="uninstall_system_app_text" msgid="4172046090762920660">"Impossible de désinstaller cette appli, car il s\'agit d\'une appli système."</string>
<string name="folder_hint_text" msgid="5174843001373488816">"Modifier le nom"</string>
- <string name="disabled_app_label" msgid="6673129024321402780">"L\'application <xliff:g id="APP_NAME">%1$s</xliff:g> est désactivée"</string>
+ <string name="disabled_app_label" msgid="6673129024321402780">"L\'appli <xliff:g id="APP_NAME">%1$s</xliff:g> est désactivée"</string>
<string name="dotted_app_label" msgid="1865617679843363410">"{count,plural, =1{{app_name} a # notification}one{{app_name} a # notification}other{{app_name} a # notifications}}"</string>
<string name="default_scroll_format" msgid="7475544710230993317">"Page %1$d sur %2$d"</string>
<string name="workspace_scroll_format" msgid="8458889198184077399">"Écran d\'accueil %1$d sur %2$d"</string>
@@ -113,7 +116,7 @@
<string name="folder_renamed" msgid="1794088362165669656">"Nouveau nom du dossier : <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="folder_name_format_exact" msgid="8626242716117004803">"Dossier : <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> élément(s)"</string>
<string name="folder_name_format_overflow" msgid="4270108890534995199">"Dossier : <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> éléments ou plus"</string>
- <string name="app_pair_name_format" msgid="8134106404716224054">"Paire d\'applications : <xliff:g id="APP1">%1$s</xliff:g> et <xliff:g id="APP2">%2$s</xliff:g>"</string>
+ <string name="app_pair_name_format" msgid="8134106404716224054">"Paire d\'applis : <xliff:g id="APP1">%1$s</xliff:g> et <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Fond d\'écran et style"</string>
<string name="edit_home_screen" msgid="8947858375782098427">"Modifier l\'écran d\'accueil"</string>
<string name="settings_button_text" msgid="8873672322605444408">"Paramètres d\'accueil"</string>
@@ -124,23 +127,23 @@
<string name="notification_dots_desc_on" msgid="1679848116452218908">"Activé"</string>
<string name="notification_dots_desc_off" msgid="1760796511504341095">"Désactivé"</string>
<string name="title_missing_notification_access" msgid="7503287056163941064">"L\'accès aux notifications est requis"</string>
- <string name="msg_missing_notification_access" msgid="281113995110910548">"Pour afficher les points de notification, activez les notifications d\'application pour <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="msg_missing_notification_access" msgid="281113995110910548">"Pour afficher les points de notification, activez les notifications d\'appli pour <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="title_change_settings" msgid="1376365968844349552">"Modifier les paramètres"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"Afficher les points de notification"</string>
<string name="developer_options_title" msgid="700788437593726194">"Options pour les développeurs"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Ajouter les icônes des applications à l\'écran d\'accueil"</string>
- <string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Pour les nouvelles applications"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Ajouter les icônes des applis à l\'écran d\'accueil"</string>
+ <string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Pour les nouvelles applis"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"Inconnu"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"Supprimer"</string>
<string name="abandoned_search" msgid="891119232568284442">"Rechercher"</string>
- <string name="abandoned_promises_title" msgid="7096178467971716750">"Cette application n\'est pas installée"</string>
- <string name="abandoned_promise_explanation" msgid="3990027586878167529">"L\'application liée à cette icône n\'est pas installée. Vous pouvez la supprimer ou rechercher l\'application et l\'installer manuellement."</string>
- <string name="app_installing_title" msgid="5864044122733792085">"Installation de l\'application <xliff:g id="NAME">%1$s</xliff:g> en cours, <xliff:g id="PROGRESS">%2$s</xliff:g> terminée"</string>
+ <string name="abandoned_promises_title" msgid="7096178467971716750">"Cette appli n\'est pas installée"</string>
+ <string name="abandoned_promise_explanation" msgid="3990027586878167529">"L\'appli liée à cette icône n\'est pas installée. Vous pouvez la supprimer ou rechercher l\'appli et l\'installer manuellement."</string>
+ <string name="app_installing_title" msgid="5864044122733792085">"Installation de l\'appli <xliff:g id="NAME">%1$s</xliff:g> en cours, <xliff:g id="PROGRESS">%2$s</xliff:g> terminée"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Téléchargement de <xliff:g id="NAME">%1$s</xliff:g> : <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> en attente d\'installation"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"L\'application <xliff:g id="NAME">%1$s</xliff:g> est archivée. Toucher pour télécharger."</string>
- <string name="dialog_update_title" msgid="114234265740994042">"Mise à jour de l\'application requise"</string>
- <string name="dialog_update_message" msgid="4176784553982226114">"L\'application pour cette icône n\'est pas à jour. Vous pouvez soit la mettre à jour manuellement pour réactiver ce raccourci, soit retirer l\'icône."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"L\'appli <xliff:g id="NAME">%1$s</xliff:g> est archivée. Touchez le bouton pour télécharger et restaurer l\'appli."</string>
+ <string name="dialog_update_title" msgid="114234265740994042">"Mise à jour de l\'appli requise"</string>
+ <string name="dialog_update_message" msgid="4176784553982226114">"L\'appli pour cette icône n\'est pas à jour. Vous pouvez soit la mettre à jour manuellement pour réactiver ce raccourci, soit retirer l\'icône."</string>
<string name="dialog_update" msgid="2178028071796141234">"Mettre à jour"</string>
<string name="dialog_remove" msgid="6510806469849709407">"Retirer"</string>
<string name="widgets_list" msgid="796804551140113767">"Liste des widgets"</string>
@@ -173,29 +176,26 @@
<string name="all_apps_personal_tab" msgid="4190252696685155002">"Personnel"</string>
<string name="all_apps_work_tab" msgid="4884822796154055118">"Travail"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"Profil professionnel"</string>
- <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"Les applications professionnelles sont indiquées par un badge et elles sont visibles pour votre administrateur informatique"</string>
+ <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"Les applis professionnelles sont indiquées par un badge et elles sont visibles pour votre administrateur informatique"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"OK"</string>
- <string name="work_apps_paused_title" msgid="3040901117349444598">"Les applications professionnelles sont interrompues"</string>
- <string name="work_apps_paused_info_body" msgid="1687828929959237477">"Vous ne recevrez pas de notifications de vos applications professionnelles"</string>
- <string name="work_apps_paused_body" msgid="261634750995824906">"Les applications professionnelles ne peuvent ni vous envoyer de notifications, ni utiliser la pile, ni accéder à votre position"</string>
- <string name="work_apps_paused_telephony_unavailable_body" msgid="8358872357502756790">"Vous ne recevrez pas d\'appels téléphoniques, de messages texte ni de notifications de vos applications professionnelles"</string>
- <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"Les applications professionnelles sont indiquées par un badge et sont visibles pour votre administrateur informatique"</string>
+ <string name="work_apps_paused_title" msgid="3040901117349444598">"Les applis professionnelles sont interrompues"</string>
+ <string name="work_apps_paused_info_body" msgid="1687828929959237477">"Vous ne recevrez pas de notifications de vos applis professionnelles"</string>
+ <string name="work_apps_paused_body" msgid="261634750995824906">"Les applis professionnelles ne peuvent ni vous envoyer de notifications, ni utiliser la pile, ni accéder à votre position"</string>
+ <string name="work_apps_paused_telephony_unavailable_body" msgid="8358872357502756790">"Vous ne recevrez pas d\'appels téléphoniques, de messages texte ni de notifications de vos applis professionnelles"</string>
+ <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"Les applis professionnelles sont indiquées par un badge et sont visibles pour votre administrateur informatique"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"OK"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Mettre en pause les applications professionnelles"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Mettre en pause les applis professionnelles"</string>
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Réactiver"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtrer"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Échec : <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Espace privé"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Toucher pour configurer ou ouvrir"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Touchez pour configurer ou ouvrir"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privé"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Paramètres de l\'Espace privé"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privé, déverrouillé."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privé, verrouillé."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Verrouiller"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Transition vers l\'Espace privé"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installer des applications"</string>
- <string name="ps_add_button_content_description" msgid="3254274107740952556">"Installer des applications dans l\'Espace privé"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menu à développer"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installer"</string>
+ <string name="ps_add_button_content_description" msgid="3254274107740952556">"Installer des applis dans l\'Espace privé"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index fa80186..4f5d111 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -27,15 +27,19 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Les widgets sont désactivés en mode sécurisé."</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Raccourci non disponible"</string>
<string name="home_screen" msgid="5629429142036709174">"Accueil"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Définissez <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> comme application d\'accueil par défaut dans Paramètres"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Écran partagé"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Infos sur l\'appli pour %1$s"</string>
- <string name="save_app_pair" msgid="5647523853662686243">"Enregistrer la paire d\'applis"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Paramètres d\'utilisation pour %1$s"</string>
+ <string name="save_app_pair" msgid="5647523853662686243">"Enregistrer une paire d\'applis"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Cette paire d\'applications n\'est pas prise en charge sur cet appareil"</string>
<string name="app_pair_needs_unfold" msgid="4588897528143807002">"Dépliez l\'appareil pour utiliser cette paire d\'applications"</string>
<string name="app_pair_not_available" msgid="3556767440808032031">"La paire d\'applications n\'est pas disponible"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Appuyez de manière prolongée sur un widget pour le déplacer."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Appuyez deux fois et maintenez la pression pour déplacer widget ou utiliser actions personnalisées."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Autres options"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Afficher tous les widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d x %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de largeur et %2$d de hauteur"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Ajouter à l\'écran d\'accueil"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g> ajouté à l\'écran d\'accueil"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggestions"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Les bases"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Indispensables"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Actualités et magazines"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Votre espace détente"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Divertissement"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Réseaux sociaux"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Santé et bien-être"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Météo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Recommandations"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> à droite, recherche et options à gauche"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Désinstaller"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Infos sur l\'appli"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installer en mode privé"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Désinstaller l\'appli"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installer"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne pas suggérer d\'application"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne pas suggérer d\'appli"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Épingler la prédiction"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bulle"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installer des raccourcis"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permettre à une application d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Lire les paramètres et les raccourcis de la page d\'accueil"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Installation de <xliff:g id="NAME">%1$s</xliff:g>… (<xliff:g id="PROGRESS">%2$s</xliff:g> terminés)"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> en cours de téléchargement, <xliff:g id="PROGRESS">%2$s</xliff:g> effectué(s)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> en attente d\'installation"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"L\'application <xliff:g id="NAME">%1$s</xliff:g> est archivée. Appuyez pour télécharger."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"L\'application <xliff:g id="NAME">%1$s</xliff:g> est archivée. Appuyez pour la télécharger et la restaurer."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Mise à jour de l\'appli requise"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"L\'appli correspondant à cette icône n\'est pas mise à jour. Vous pouvez la mettre à jour manuellement pour réactiver le raccourci ou supprimer l\'icône."</string>
<string name="dialog_update" msgid="2178028071796141234">"Modifier"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Appuyer pour ouvrir ou configurer"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privé"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Paramètres d\'Espace privé"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privé, déverrouillé"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privé, verrouillé"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Verrouiller"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Transition vers Espace privé"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installer applis"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installer"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installer des applis dans l\'espace privé"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Dépassement"</string>
</resources>
diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml
index cf50f41..ff7c029 100644
--- a/res/values-gl/strings.xml
+++ b/res/values-gl/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Os widgets están desactivados no modo seguro"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"O atallo non está dispoñible"</string>
<string name="home_screen" msgid="5629429142036709174">"Inicio"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Define <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> como aplicación de inicio predeterminada en Configuración"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Pantalla dividida"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Información da aplicación para %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Configuración de uso para %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Gardar parella de apps"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"O dispositivo non admite este emparellamento de aplicacións"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Non está dispoñible o emparellamento de aplicacións"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Mantén premido un widget para movelo."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Toca dúas veces un widget e manteno premido para movelo ou utiliza accións personalizadas."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Máis opcións"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostrar todos os widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de largo por %2$d de alto"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suxestións"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Esenciais"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Noticias e revistas"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Reláxate"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entretemento"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Redes sociais"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Saúde e forma física"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"O tempo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Suxestións personalizadas"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets de <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> á dereita, busca e opcións á esquerda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Información da app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalar en privado"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalar aplicación"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalar"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Non suxerir aplicación"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Non suxerir app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixar predición"</string>
+ <string name="bubble" msgid="3072951361014076670">"Burbulla"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar atallos"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite a unha aplicación engadir atallos sen intervención do usuario."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ler a configuración e os atallos da pantalla de inicio"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instalando <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> completado"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Descargando <xliff:g id="NAME">%1$s</xliff:g> (<xliff:g id="PROGRESS">%2$s</xliff:g> completado)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Esperando para instalar <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> está no arquivo. Toca para descargar esta aplicación."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> está no arquivo. Toca para descargar e restaurar."</string>
<string name="dialog_update_title" msgid="114234265740994042">"É necesario actualizar a aplicación"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"A aplicación á que corresponde esta icona non está actualizada. Podes actualizala manualmente para activar de novo este atallo, ou ben quitar a icona."</string>
<string name="dialog_update" msgid="2178028071796141234">"Actualizar"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Toca para configuralo ou abrilo"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privado"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Configuración do espazo privado"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privado, desbloqueado."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privado, bloqueado."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Bloquear"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Transición ao espazo privado"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalar apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalar"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalar as aplicacións no espazo privado"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menú adicional"</string>
</resources>
diff --git a/res/values-gu/strings.xml b/res/values-gu/strings.xml
index 72a8b47..872faef 100644
--- a/res/values-gu/strings.xml
+++ b/res/values-gu/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"સુરક્ષિત મોડમાં વિજેટ્સ અક્ષમ કર્યા"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"શૉર્ટકટ ઉપલબ્ધ નથી"</string>
<string name="home_screen" msgid="5629429142036709174">"હોમ સ્ક્રીન"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"સેટિંગમાં <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>ને ડિફૉલ્ટ હોમ ઍપ તરીકે સેટ કરો"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"સ્ક્રીનને વિભાજિત કરો"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s માટે ઍપ માહિતી"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$sના વપરાશ સંબંધિત સેટિંગ"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ઍપની જોડી સાચવો"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"આ ડિવાઇસ પર, આ ઍપની જોડીને સપોર્ટ આપવામાં આવતો નથી"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ઍપની જોડી ઉપલબ્ધ નથી"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"વિજેટ ખસેડવા ટચ કરીને થોડી વાર દબાવી રાખો."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"વિજેટ ખસેડવા બે વાર ટૅપ કરીને દબાવી રાખો અથવા કસ્ટમ ક્રિયાઓનો ઉપયોગ કરો."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"વધુ વિકલ્પો"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"બધા વિજેટ બતાવો"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d પહોળાઈ X %2$d ઊંચાઈ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> વિજેટ"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"સૂચનો"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"આવશ્યક"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ન્યૂઝ અને સામાયિકો"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"તમારો આરામદાયક ઝોન"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"મનોરંજન"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"સામાજિક"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"આરોગ્ય અને ફિટનેસ"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"હવામાન"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"તમારા માટે સૂચવેલી સેવાઓ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>ની વિજેટ જમણે, શોધ અને વિકલ્પો ડાબે"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# વિજેટ}one{# વિજેટ}other{# વિજેટ}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"અનઇન્સ્ટૉલ કરો"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ઍપની માહિતી"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ખાનગીમાં ઇન્સ્ટૉલ કરો"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ઍપ અનઇન્સ્ટૉલ કરો"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ઇન્સ્ટૉલ કરો"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ઍપ સૂચવશો નહીં"</string>
<string name="pin_prediction" msgid="4196423321649756498">"પૂર્વાનુમાનને પિન કરો"</string>
+ <string name="bubble" msgid="3072951361014076670">"બબલ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"શૉર્ટકટ ઇન્સ્ટૉલ કરો"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"એપ્લિકેશનને વપરાશકર્તા હસ્તક્ષેપ વગર શોર્ટકટ્સ ઉમેરવાની મંજૂરી આપે છે."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"હોમ સેટિંગ અને શૉર્ટકટ વાંચો"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ઇન્સ્ટૉલ કરી રહ્યાં છીએ, <xliff:g id="PROGRESS">%2$s</xliff:g> પૂર્ણ થયું"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ડાઉનલોડ કરી રહ્યાં છે, <xliff:g id="PROGRESS">%2$s</xliff:g> પૂર્ણ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g>, ઇન્સ્ટૉલ થવાની રાહ જોઈ રહ્યું છે"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> આર્કાઇવ કરી છે. ડાઉનલોડ કરવા માટે ટૅપ કરો."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g>ને આર્કાઇવ કર્યું છે. ડાઉનલોડ અને રિસ્ટોર કરવા માટે ટૅપ કરો."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ઍપને અપડેટ કરવી જરૂરી છે"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"આ આઇકન માટે ઍપ અપડેટ કરવામાં આવી નથી. તમે આ શૉર્ટકટ ફરી ચાલુ કરવા અથવા આઇકન કાઢી નાખવા માટે ઍપને મેન્યુઅલી અપડેટ કરી શકો છો."</string>
<string name="dialog_update" msgid="2178028071796141234">"અપડેટ કરો"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"સેટઅપ કરવા કે ખોલવા માટે ટૅપ કરો"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ખાનગી"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ખાનગી સ્પેસના સેટિંગ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ખાનગી સ્પેસ, અનલૉક કરેલી છે."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ખાનગી સ્પેસ, લૉક કરેલી છે."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"લૉક"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ખાનગી સ્પેસ પર સ્થાનાંતરણ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ઍપ ઇન્સ્ટૉલ કરો"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ઇન્સ્ટૉલ કરો"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ખાનગી સ્પેસમાં ઍપ ઇન્સ્ટૉલ કરો"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ઓવરફ્લો"</string>
</resources>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index 2e81ea6..a44b874 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"विजेट सुरक्षित मोड में अक्षम हैं"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"शॉर्टकट उपलब्ध नहीं है"</string>
<string name="home_screen" msgid="5629429142036709174">"होम स्क्रीन"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"सेटिंग में जाकर, <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> को डिफ़ॉल्ट होम ऐप्लिकेशन के तौर पर सेट करें"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"स्प्लिट स्क्रीन"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s के लिए ऐप्लिकेशन की जानकारी"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s के लिए खर्च की सेटिंग"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ऐप पेयर सेव करें"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"साथ में इस्तेमाल किए जा सकने वाले ये ऐप्लिकेशन, इस डिवाइस पर काम नहीं कर सकते"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"साथ में इस्तेमाल किए जा सकने वाले ऐप्लिकेशन की सुविधा उपलब्ध नहीं है"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"किसी विजेट को एक से दूसरी जगह ले जाने के लिए, उसे दबाकर रखें."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"किसी विजेट को एक से दूसरी जगह ले जाने के लिए, उस पर दो बार टैप करके दबाकर रखें या पसंद के मुताबिक कार्रवाइयां इस्तेमाल करें."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ज़्यादा विकल्प"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"सभी विजेट दिखाएं"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d चौड़ाई गुणा %2$d ऊंचाई"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> विजेट"</string>
@@ -46,12 +50,9 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"सुझाव"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ज़रूरी ऐप्लिकेशन"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"खबरों और पत्रिकाओं वाले ऐप्लिकेशन"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"आपके मनोरंजन के लिए"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"मनोरंजन से जुड़े ऐप्लिकेशन"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"सोशल मीडिया ऐप्लिकेशन"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"हेल्थ और फ़िटनेस वाले ऐप्लिकेशन"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"मौसम"</string>
- <string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"आपके लिए सुझाए गए ऐप्लिकेशन"</string>
+ <string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"आपके लिए सुझाए गए"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> के विजेट दाईं ओर, खोज का विजेट और अन्य विकल्प बाईं ओर"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# विजेट}one{# विजेट}other{# विजेट}}"</string>
<string name="shortcuts_count" msgid="8471715556199592381">"{count,plural, =1{# शॉर्टकट}one{# शॉर्टकट}other{# शॉर्टकट}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"अनइंस्टॉल करें"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ऐप्लिकेशन की जानकारी"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"निजी तौर पर इंस्टॉल करें"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ऐप्लिकेशन अनइंस्टॉल करें"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"इंस्टॉल करें"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ऐप्लिकेशन का सुझाव न दें"</string>
- <string name="pin_prediction" msgid="4196423321649756498">"सुझाए गए ऐप्लिकेशन को पिन करें"</string>
+ <string name="pin_prediction" msgid="4196423321649756498">"सुझाए गए ऐप पिन करें"</string>
+ <string name="bubble" msgid="3072951361014076670">"बबल"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"शॉर्टकट इंस्टॉल करें"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ऐप को उपयोगकर्ता के हस्तक्षेप के बिना शॉर्टकट जोड़ने देती है."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"होम स्क्रीन की सेटिंग और शॉर्टकट पढ़ने की अनुमति"</string>
@@ -126,7 +129,7 @@
<string name="title_missing_notification_access" msgid="7503287056163941064">"सूचना के ऐक्सेस की ज़रूरत है"</string>
<string name="msg_missing_notification_access" msgid="281113995110910548">"सूचना बिंदु दिखाने के लिए, <xliff:g id="NAME">%1$s</xliff:g> के ऐप्लिकेशन सूचना चालू करें"</string>
<string name="title_change_settings" msgid="1376365968844349552">"सेटिंग बदलें"</string>
- <string name="notification_dots_service_title" msgid="4284221181793592871">"नई सूचनाएं बताने वाला गोल निशान दिखाएं"</string>
+ <string name="notification_dots_service_title" msgid="4284221181793592871">"सूचनाएं बताने वाले डॉट दिखाएं"</string>
<string name="developer_options_title" msgid="700788437593726194">"डेवलपर के लिए सेटिंग और टूल"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"होम स्क्रीन पर ऐप्लिकेशन के आइकॉन जोड़ें"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"नए ऐप्लिकेशन के लिए"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> इंस्टॉल किया जा रहा है, <xliff:g id="PROGRESS">%2$s</xliff:g> पूरा हो गया"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> डाउनलोड हो रहा है, <xliff:g id="PROGRESS">%2$s</xliff:g> पूरी हुई"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> के इंस्टॉल होने की प्रतीक्षा की जा रही है"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> को संग्रहित किया गया. डाउनलोड करने के लिए टैप करें."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> को संग्रहित किया गया. ऐप्लिकेशन को वापस लाने और डाउनलोड करने के लिए टैप करें."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ऐप्लिकेशन को अपडेट करना ज़रूरी है"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"इस आइकॉन का ऐप्लिकेशन अपडेट नहीं है. इस शॉर्टकट को फिर से चालू करने या आइकॉन को हटाने के लिए, ऐप्लिकेशन को मैन्युअल रूप से अपडेट किया जा सकता है."</string>
<string name="dialog_update" msgid="2178028071796141234">"अपडेट करें"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"सेट अप करने या खोलने के लिए टैप करें"</string>
<string name="ps_container_title" msgid="4391796149519594205">"निजी"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"प्राइवेट स्पेस सेटिंग"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"प्राइवेट स्पेस को अनलॉक किया गया."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"प्राइवेट स्पेस को लॉक किया गया."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"लॉक"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"प्राइवेट स्पेस की सेटिंग में बदलाव किया जा रहा है"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ऐप्लिकेशन इंस्टॉल करें"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"इंस्टॉल करें"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"प्राइवेट स्पेस में ऐप्लिकेशन इंस्टॉल करें"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ओवरफ़्लो"</string>
</resources>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index bf24a1d..d9f2072 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgeti su onemogućeni u Sigurnom načinu rada"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Prečac nije dostupan"</string>
<string name="home_screen" msgid="5629429142036709174">"Početni zaslon"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Postavite aplikaciju <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> kao zadanu aplikaciju početnog zaslona u postavkama"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Podijeljeni zaslon"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informacije o aplikaciji %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Postavke upotrebe za %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Spremi par aplikacija"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Taj par aplikacija nije podržan na ovom uređaju"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Par aplikacija nije dostupan"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Dodirnite i zadržite da biste premjestili widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvaput dodirnite i zadržite pritisak da biste premjestili widget ili upotrijebite prilagođene radnje"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Više opcija"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Prikaži sve widgete"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d širine i %2$d visine"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Prijedlozi"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Osnovno"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Vijesti i časopisi"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Vaša zona za opuštanje"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Zabava"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Društvene mreže"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdravlje i fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Vrijeme"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Prijedlozi za vas"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> –widgeti zdesna, pretraživanje i opcije slijeva"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}few{# widgeta}other{# widgeta}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Ukloni"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deinstaliraj"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Podaci o aplikaciji"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instaliranje u privatni profil"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instaliraj u privatno"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Deinstaliraj aplikaciju"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instaliraj"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne predlaži aplikaciju"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Prikvači predviđenu apl."</string>
+ <string name="bubble" msgid="3072951361014076670">"Oblačić"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instaliranje prečaca"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Aplikaciji omogućuje dodavanje prečaca bez intervencije korisnika."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"čitati postavke i prečace početnog zaslona"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instaliranje aplikacije <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> dovršeno"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Preuzimanje aplikacije <xliff:g id="NAME">%1$s</xliff:g>, dovršeno <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Čekanje na instaliranje aplikacije <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dodirnite za preuzimanje."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dodirnite da biste je preuzeli i vratili."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Aplikacija se treba ažurirati"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacija ove ikone nije ažurirana. Možete ručno ažurirati da biste ponovo omogućili ovaj prečac ili uklonite ikonu."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ažuriraj"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Dodirnite da biste postavili ili otvorili"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privatno"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Postavke privatnog prostora"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privatno, otključano."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privatno, zaključano."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zaključavanje"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Prelazak na privatni prostor"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalirajte aplikacije"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalirajte"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instaliranje aplikacija u privatni prostor"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Dodatni izbornik"</string>
</resources>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 324cced..6bc8b70 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"A modulok ki vannak kapcsolva Csökkentett módban"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"A gyorsparancs nem áll rendelkezésre"</string>
<string name="home_screen" msgid="5629429142036709174">"Kezdőképernyő"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"A(z) <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> appot a Beállításokban adhatja meg alapértelmezett kezdőalkalmazásként."</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Osztott képernyő"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Alkalmazásinformáció a következőhöz: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"A(z) %1$s használati beállításai"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Alkalmazáspár mentése"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ezt az alkalmazáspárt nem támogatja az eszköz"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Az alkalmazáspár nem áll rendelkezésre"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Tartsa lenyomva a modult az áthelyezéshez."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Modul áthelyezéséhez koppintson duplán, tartsa nyomva az ujját, vagy használjon egyéni műveleteket."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"További lehetőségek"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Minden modul mutatása"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d széles és %2$d magas"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> modul"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Javaslatok"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Legfontosabbak"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Újságok és magazinok"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Az Ön relaxáló zónája"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Szórakozás"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Közösségi"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Egészség és fitnesz"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Időjárás"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Neked javasolt"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"A <xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-modulok a jobb, a kereső és a beállítások pedig a bal oldalon találhatók"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# modul}other{# modul}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Törlés"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Eltávolítás"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Alkalmazásinfó"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Telepítés privátra"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Privát telepítés"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Alkalmazás eltávolítása"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Telepítés"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne javasoljon alkalmazást"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne javasoljon appot"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Várható kitűzése"</string>
+ <string name="bubble" msgid="3072951361014076670">"Buborék"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"parancsikonok telepítése"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Lehetővé teszi egy alkalmazás számára, hogy felhasználói beavatkozás nélkül adjon hozzá parancsikonokat."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"kezdőképernyő beállításainak és parancsikonjainak olvasása"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Folyamatban van a(z) <xliff:g id="NAME">%1$s</xliff:g> telepítése, <xliff:g id="PROGRESS">%2$s</xliff:g> kész"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"A(z) <xliff:g id="NAME">%1$s</xliff:g> letöltése, <xliff:g id="PROGRESS">%2$s</xliff:g> kész"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"A(z) <xliff:g id="NAME">%1$s</xliff:g> telepítésre vár"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> archiválva. Koppintson a letöltéshez."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> archiválva. Koppintson a letöltéshez és a visszaállításhoz."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Alkalmazásfrissítés szükséges"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Az ikonhoz tartozó alkalmazás nincs frissítve. A parancsikon újbóli engedélyezéséhez frissítse az alkalmazást, vagy távolítsa ez az ikont."</string>
<string name="dialog_update" msgid="2178028071796141234">"Frissítés"</string>
@@ -187,15 +190,12 @@
<string name="remote_action_failed" msgid="1383965239183576790">"Sikertelen: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Privát terület"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Koppintson a beállításhoz vagy a megnyitáshoz"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Magánterület"</string>
+ <string name="ps_container_title" msgid="4391796149519594205">"Privát"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Privát terület beállításai"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privát, feloldott."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privát, zárolt."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zárolás"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Átállás privát területre…"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"App telepítése"</string>
- <string name="ps_add_button_content_description" msgid="3254274107740952556">"Alkalmazások telepítése magánterületre"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Túlcsordulás"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Telepítés"</string>
+ <string name="ps_add_button_content_description" msgid="3254274107740952556">"Alkalmazások telepítése privát területre"</string>
</resources>
diff --git a/res/values-hy/strings.xml b/res/values-hy/strings.xml
index f1a3a6c..69b320d 100644
--- a/res/values-hy/strings.xml
+++ b/res/values-hy/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Վիջեթներն անջատված են անվտանգ ռեժիմում"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Դյուրանցումն անհասանելի է"</string>
<string name="home_screen" msgid="5629429142036709174">"Հիմնական էկրան"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Սահմանել <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> գործարկիչը որպես մեկնարկի կանխադրված հավելված Կարգավորումներում"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Տրոհել էկրանը"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Տեղեկություններ %1$s հավելվածի մասին"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Օգտագործման կարգավորումներ (%1$s)"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Պահել հավելվ. զույգը"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Հավելվածների զույգը չի աջակցվում այս սարքում"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Հավելվածների զույգը հասանելի չէ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Հպեք և պահեք՝ վիջեթ տեղափոխելու համար։"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Կրկնակի հպեք և պահեք՝ վիջեթ տեղափոխելու համար, կամ օգտվեք հատուկ գործողություններից։"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Այլ ընտրանքներ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Ցույց տալ բոլոր վիջեթները"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Լայնությունը՝ %1$d, բարձրությունը՝ %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> վիջեթ"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Առաջարկներ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Հիմնական"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Նորություններ և ամսագրեր"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Ձեր հանգստի գոտին"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Զվարճանք"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Սոցցանցեր"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Առողջություն և ֆիթնես"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Եղանակ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Առաջարկում ենք"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"«<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>» հավելվածի վիջեթներն աջ կողմում են, իսկ որոնման դաշտը և կարգավորումները՝ ձախ կողմում"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# վիջեթ}one{# վիջեթ}other{# վիջեթ}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Հեռացնել"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Ապատեղադրել"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Հավելվածի մասին"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Տեղադրել անձնականում"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Տեղադրել մասնավորում"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Ապատեղադրել հավելվածը"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Տեղադրել"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Չառաջարկել"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Ամրացնել առաջարկվող հավելվածը"</string>
+ <string name="bubble" msgid="3072951361014076670">"Ամպիկ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Դյուրանցումների տեղադրում"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Հավելվածին թույլ է տալիս ավելացնել դյուրանցումներ՝ առանց օգտագործողի միջամտության:"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"կարդալ հիմնական էկրանի կարգավորումներն ու դյուրանցումները"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> հավելվածը տեղադրվում է, կատարված է <xliff:g id="PROGRESS">%2$s</xliff:g>-ը"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g>–ի ներբեռնում (<xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g>-ի տեղադրման սպասում"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> հավելվածն արխիվացված է։ Հպեք՝ ներբեռնելու համար:"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> հավելվածն արխիվացված է։ Հպեք՝ ներբեռնելու և վերականգնելու համար։"</string>
<string name="dialog_update_title" msgid="114234265740994042">"Պահանջվում է թարմացնել հավելվածը"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Հավելվածը հնացել է։ Թարմացրեք այն ձեռքով, որպեսզի շարունակեք օգտագործել դյուրանցումը, կամ հեռացրեք հավելվածի պատկերակը։"</string>
<string name="dialog_update" msgid="2178028071796141234">"Թարմացնել"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Հպեք կարգավորելու կամ բացելու համար"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Մասնավոր"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Անձնական տարածքի կարգավորումներ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Անձնական, ապակողպված է։"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Անձնական, կողպված է։"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Կողպում"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Անցում մասնավոր տարածք"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Հավելվածների տեղադրում"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Տեղադրել"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Հավելվածների տեղադրում անձնական տարածքում"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Լրացուցիչ ընտրացանկ"</string>
</resources>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index acdbc46..58a429f 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widget dinonaktifkan dalam mode Aman"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Pintasan tidak tersedia"</string>
<string name="home_screen" msgid="5629429142036709174">"Layar utama"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Jadikan <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> sebagai aplikasi layar utama default di Setelan"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Layar terpisah"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Info aplikasi untuk %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Setelan penggunaan untuk %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Simpan pasangan aplikasi"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Pasangan aplikasi ini tidak didukung di perangkat ini"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Pasangan aplikasi tidak tersedia"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Sentuh lama untuk memindahkan widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Ketuk dua kali & tahan untuk memindahkan widget atau gunakan tindakan khusus."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Opsi lainnya"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Tampilkan semua widget"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"lebar %1$d x tinggi %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Saran"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Penting"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Berita & majalah"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zona Nyaman Anda"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Hiburan"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosial"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Kesehatan & kebugaran"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Cuaca"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Disarankan untuk Anda"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widget <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> di bagian kanan, penelusuran dan opsi di bagian kiri"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widget}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Hapus"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Uninstal"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info aplikasi"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instal secara pribadi"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instal di ruang privasi"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uninstal aplikasi"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instal"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Jangan sarankan aplikasi"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Jangan sarankan apl"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pin Prediksi"</string>
+ <string name="bubble" msgid="3072951361014076670">"Balon"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"memasang pintasan"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Mengizinkan aplikasi menambahkan pintasan tanpa campur tangan pengguna."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"membaca setelan dan pintasan layar utama"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> sedang diinstal, <xliff:g id="PROGRESS">%2$s</xliff:g> selesai"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> sedang didownload, <xliff:g id="PROGRESS">%2$s</xliff:g> selesai"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> menunggu dipasang"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> diarsipkan. Ketuk untuk mendownload."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> diarsipkan. Ketuk untuk mendownload dan memulihkan."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Aplikasi perlu diupdate"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikasi untuk ikon ini belum diupdate. Anda dapat mengupdate secara manual untuk mengaktifkan kembali pintasan ini, atau hapus ikon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Update"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Aktifkan lagi"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filter"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Gagal: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Ruang pribadi"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Ruang privasi"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Ketuk untuk menyiapkan atau membuka"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Pribadi"</string>
+ <string name="ps_container_title" msgid="4391796149519594205">"Privasi"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Setelan Ruang Pribadi"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Pribadi, tidak terkunci."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Pribadi, dikunci."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Kunci"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Ruang Pribadi Bertransisi"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instal aplikasi"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instal"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instal aplikasi ke Ruang Pribadi"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menu tambahan"</string>
</resources>
diff --git a/res/values-is/strings.xml b/res/values-is/strings.xml
index a815d7a..95bd21f 100644
--- a/res/values-is/strings.xml
+++ b/res/values-is/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Græjur eru óvirkar í öruggri stillingu"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Flýtileið er ekki tiltæk"</string>
<string name="home_screen" msgid="5629429142036709174">"Heim"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Stilltu <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> sem sjálfgefið heimaforrit í stillingunum"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Skipta skjá"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Upplýsingar um forrit fyrir %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Notkunarstillingar fyrir %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Vista forritapar"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Þetta forritapar er ekki stutt í þessu tæki"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Forritapar er ekki í boði"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Haltu fingri á græju til að færa hana."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Ýttu tvisvar og haltu fingri á græju til að færa hana eða notaðu sérsniðnar aðgerðir."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Fleiri valkostir"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Sýna allar græjur"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d á breidd og %2$d á hæð"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Græjan <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Tillögur"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Það nauðsynlegasta"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Fréttir og tímarit"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Slakaðu á"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Afþreying"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Samfélag"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Heilsa og líkamsrækt"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Veður"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Tillögur fyrir þig"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-græjur til hægri, leit og valkostir til vinstri"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# græja}one{# græja}other{# græjur}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Fjarlægja"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Forritsupplýsingar"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Setja upp á lokuðum prófíl"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Fjarlægja forrit"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Setja upp"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ekki fá tillögu að forriti"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Festa tillögu"</string>
+ <string name="bubble" msgid="3072951361014076670">"Blaðra"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"setja upp flýtileiðir"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Leyfir forriti að bæta við flýtileiðum án íhlutunar notanda."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lesa stillingar og flýtileiðir heimaskjás"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Setur upp <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> lokið"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> í niðurhali, <xliff:g id="PROGRESS">%2$s</xliff:g> lokið"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> bíður uppsetningar"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> er í geymslu. Ýttu til að sækja."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> er í geymslu. Ýttu til að sækja og endurheimta."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Uppfæra þarf forritið"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Forritið fyrir þetta tákn er ekki uppfært. Þú getur uppfært það handvirkt til að kveikja aftur á þessari flýtileið eða fjarlægt táknið."</string>
<string name="dialog_update" msgid="2178028071796141234">"Uppfæra"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Ljúka hléi"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Sía"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Mistókst: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Einkarými"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Leynirými"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Ýttu til að setja upp eða opna"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Lokað"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Stillingar einkarýmis"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Lokað, ólæst."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Lokað, læst."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Læsa"</string>
- <string name="ps_container_transition" msgid="8667331812048014412">"Einkarými að breytast"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Setja upp forrit"</string>
+ <string name="ps_container_transition" msgid="8667331812048014412">"Leynirými að breytast"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Setja upp"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Setja upp forrit í leynirými"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Yfirflæði"</string>
</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 0a76bcf..3c01cd4 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widget disabilitati in modalità provvisoria"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"La scorciatoia non è disponibile"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Imposta <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> come app iniziale predefinita nelle Impostazioni"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Schermo diviso"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informazioni sull\'app %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Impostazioni di utilizzo per %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Salva coppia di app"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Questa coppia di app non è supportata su questo dispositivo"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"La coppia di app non è disponibile"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Tocca e tieni premuto per spostare un widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Tocca due volte e tieni premuto per spostare un widget o per usare le azioni personalizzate."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Altre opzioni"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostra tutti i widget"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d di larghezza per %2$d di altezza"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggerimenti"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essenziali"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Notizie e riviste"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Il tuo angolo di tranquillità"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Intrattenimento"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Salute e fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Meteo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Consigliati per te"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widget di <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> a destra, ricerca e opzioni a sinistra"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widget}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Disinstalla"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Informazioni app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installa in privato"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Disinstalla app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installa"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Non suggerire app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Blocca previsione"</string>
+ <string name="bubble" msgid="3072951361014076670">"Fumetto"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Aggiunta di scorciatoie"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Consente a un\'app di aggiungere scorciatoie automaticamente."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"leggere le impostazioni e le scorciatoie nella schermata Home"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Installazione di <xliff:g id="NAME">%1$s</xliff:g>, completamento: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Download di <xliff:g id="NAME">%1$s</xliff:g> in corso, <xliff:g id="PROGRESS">%2$s</xliff:g> completato"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> in attesa di installazione"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"App <xliff:g id="NAME">%1$s</xliff:g> archiviata. Tocca per scaricare."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"App <xliff:g id="NAME">%1$s</xliff:g> archiviata. Tocca per scaricare e ripristinare."</string>
<string name="dialog_update_title" msgid="114234265740994042">"È necessario aggiornare l\'app"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"L\'app relativa a questa icona non è aggiornata. Puoi eseguire manualmente l\'aggiornamento per riattivare questa scorciatoia oppure rimuovere l\'icona."</string>
<string name="dialog_update" msgid="2178028071796141234">"Aggiorna"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tocca per configurare o aprire"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privato"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Impostazioni dello Spazio privato"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privato, sbloccato."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privato, bloccato."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Blocca"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Transizione dello Spazio privato in corso…"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installa app"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installa"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installa le app su spazi privati"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Extra"</string>
</resources>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index 87c8a22..f198166 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ווידג\'טים מושבתים במצב בטוח"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"קיצור הדרך אינו זמין"</string>
<string name="home_screen" msgid="5629429142036709174">"בית"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"הגדרה של <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> כאפליקציית הבית ב\'הגדרות\'"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"מסך מפוצל"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"פרטים על האפליקציה %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"הגדרות שימוש ב-%1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"שמירת צמד אפליקציות"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"צמד האפליקציות הזה לא נתמך במכשיר הזה"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"צמד האפליקציות לא זמין"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"להעברת ווידג\'ט למקום אחר לוחצים עליו לחיצה ארוכה."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"כדי להעביר ווידג\'ט למקום אחר או להשתמש בפעולות מותאמות אישית, יש ללחוץ פעמיים ולא להרפות."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"אפשרויות נוספות"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"הצגת כל הווידג\'טים"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"רוחב %1$d על גובה %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"ווידג\'ט <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"הוספה למסך הבית"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"הווידג\'ט <xliff:g id="WIDGET_NAME">%1$s</xliff:g> נוסף למסך הבית"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"הצעות"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"האפליקציות שחייבים להכיר"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"הכי חשוב"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"חדשות וכתבי עת"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"המקום שלך לרגיעה"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"בידור"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"רשתות חברתיות"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"בריאות וכושר"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"מזג אוויר"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"הצעות בשבילך"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ווידג\'טים מימין, חיפוש ואפשרויות משמאל"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{ווידג\'ט אחד}one{# ווידג\'טים}two{# ווידג\'טים}other{# ווידג\'טים}}"</string>
@@ -62,7 +63,7 @@
<string name="no_widgets_available" msgid="4337693382501046170">"אין ווידג\'טים או קיצורי דרך"</string>
<string name="no_search_results" msgid="3787956167293097509">"לא נמצאו ווידג\'טים או קיצורי דרך"</string>
<string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"ווידג\'טים אישיים"</string>
- <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"עבודה"</string>
+ <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"ווידג\'טים לעבודה"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"שיחות"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"כתיבת הערות"</string>
<string name="widget_add_button_label" msgid="2761267068711937179">"הוספה"</string>
@@ -85,11 +86,13 @@
<string name="all_apps_button_work_label" msgid="7270707118948892488">"רשימת אפליקציות עבודה"</string>
<string name="remove_drop_target_label" msgid="7812859488053230776">"הסרה"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"להסרת התקנה"</string>
- <string name="app_info_drop_target_label" msgid="692894985365717661">"פרטי אפליקציה"</string>
+ <string name="app_info_drop_target_label" msgid="692894985365717661">"פרטי האפליקציה"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"התקנה במרחב הפרטי"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"הסרת האפליקציה"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"התקנה"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"בלי להציע את האפליקציה"</string>
<string name="pin_prediction" msgid="4196423321649756498">"הצמדת החיזוי"</string>
+ <string name="bubble" msgid="3072951361014076670">"בועה"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"התקנת קיצורי דרך"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"מאפשר לאפליקציה להוסיף קיצורי דרך ללא התערבות המשתמש."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"קריאת ההגדרות וקיצורי הדרך בדף הבית"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> בתהליך התקנה, <xliff:g id="PROGRESS">%2$s</xliff:g> הושלמו"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"הורדת <xliff:g id="NAME">%1$s</xliff:g> מתבצעת, <xliff:g id="PROGRESS">%2$s</xliff:g> הושלמו"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"מחכה להתקנה של <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"אפליקציית <xliff:g id="NAME">%1$s</xliff:g> הועברה לארכיון. יש להקיש כדי להוריד."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"אפליקציית <xliff:g id="NAME">%1$s</xliff:g> הועברה לארכיון. אפשר להקיש כדי להוריד ולשחזר אותה."</string>
<string name="dialog_update_title" msgid="114234265740994042">"נדרש עדכון לאפליקציה"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"האפליקציה של הסמל הזה לא מעודכנת. אפשר לעדכן אותה ידנית כדי להפעיל מחדש את קיצור הדרך הזה, או להסיר את הסמל."</string>
<string name="dialog_update" msgid="2178028071796141234">"עדכון"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"סינון"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"הפעולה נכשלה: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"מרחב פרטי"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"אפשר להקיש כדי להגדיר או לפתוח"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"יש להקיש כדי להגדיר או לפתוח"</string>
<string name="ps_container_title" msgid="4391796149519594205">"פרטי"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"הגדרות המרחב הפרטי"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"פרטי, פתוח."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"פרטי, נעול."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"נעילה"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"מעבר למרחב הפרטי"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"התקנת אפליקציות"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"התקנה"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"התקנת אפליקציות במרחב הפרטי"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"אפשרויות נוספות"</string>
</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index d91f0ee..d2f9a97 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"セーフモードではウィジェットは無効です"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ショートカットは使用できません"</string>
<string name="home_screen" msgid="5629429142036709174">"ホーム"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"[設定] で <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> をデフォルトのホームアプリに設定します"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"分割画面"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s のアプリ情報"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s の使用設定"</string>
<string name="save_app_pair" msgid="5647523853662686243">"アプリのペア設定を保存"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"このデバイスは、このアプリのペア設定に対応していません"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"アプリのペア設定は利用できません"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"長押ししてウィジェットを移動させます。"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ウィジェットをダブルタップして長押ししながら移動するか、カスタム操作を使用してください。"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"その他のオプション"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"すべてのウィジェットを表示"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$dx%2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"幅 %1$d、高さ %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ウィジェット"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"候補"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"基本"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ニュース&雑誌"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"休憩エリア"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"エンタメ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ソーシャル"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"健康&フィットネス"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"天気"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"おすすめ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> のウィジェットは右側に、検索とオプションは左側にあります"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# 件のウィジェット}other{# 件のウィジェット}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"アンインストール"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"アプリ情報"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"非公開インストール"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"アプリをアンインストール"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"インストール"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"アプリを表示しない"</string>
<string name="pin_prediction" msgid="4196423321649756498">"アプリの候補を固定"</string>
+ <string name="bubble" msgid="3072951361014076670">"ふきだし"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ショートカットのインストール"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ユーザー操作なしでショートカットを追加することをアプリに許可します。"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ホームの設定とショートカットの読み取り"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> をインストールしています: <xliff:g id="PROGRESS">%2$s</xliff:g> 完了"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g>をダウンロード中、<xliff:g id="PROGRESS">%2$s</xliff:g>完了"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g>のインストール待ち"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> はアーカイブ済みです。ダウンロードするにはタップします。"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g>はアーカイブ済みです。ダウンロードして復元するには、タップしてください。"</string>
<string name="dialog_update_title" msgid="114234265740994042">"アプリの更新が必要"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"このアイコンのアプリは更新されていません。手動で更新して、このショートカットを再度有効にできます。また、アイコンを削除することもできます。"</string>
<string name="dialog_update" msgid="2178028071796141234">"更新"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"設定したり開いたりするにはタップしてください"</string>
<string name="ps_container_title" msgid="4391796149519594205">"プライベート"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"プライベート スペースの設定"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"非公開で、ロックが解除されています。"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"非公開で、ロックされています。"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ロック"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"プライベート スペース移行中"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"アプリをインストールする"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"インストール"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"プライベート スペースにアプリをインストールします"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"オーバーフロー"</string>
</resources>
diff --git a/res/values-ka/strings.xml b/res/values-ka/strings.xml
index ef74286..e67cc41 100644
--- a/res/values-ka/strings.xml
+++ b/res/values-ka/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"უსაფრთხო რეჟიმში ვიჯეტი გამორთულია"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"მალსახმობი მიუწვდომელია"</string>
<string name="home_screen" msgid="5629429142036709174">"მთავარი გვერდი"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>-ის დაყენება ნაგულისხმევ Home აპად პარამეტრებში"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ეკრანის გაყოფა"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s-ის აპის ინფო"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"გამოყენების პარამეტრები %1$s-ისთვის"</string>
<string name="save_app_pair" msgid="5647523853662686243">"აპთა წყვილის შენახვა"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ამ მოწყობილობაზე აღნიშნული აპთა წყვილი არ არის მხარდაჭერილი"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"აპთა წყვილი მიუწვდომელია"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"შეხებით აირჩიეთ და გეჭიროთ ვიჯეტის გადასაადგილებლად."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ორმაგი შეხებით აირჩიეთ და გეჭიროთ ვიჯეტის გადასაადგილებლად ან მორგებული მოქმედებების გამოსაყენებლად."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"სხვა ვარიანტები"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ყველა ვიჯეტის ჩვენება"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"სიგრძე: %1$d, სიგანე: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ვიჯეტი"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"შეთავაზებები"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"უმნიშვნელოვანესები"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ახალი ამბები და ჟურნალები"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"განტვირთვის ადგილი"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"გართობა"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"სოციალური"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ჯანმრთელობა და ფიტნესი"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"ამინდი"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"თქვენთვის შემოთავაზებული"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ვიჯეტები მდებარეობს მარჯვნივ, ძებნა და პარამეტრები — მარცხნივ"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ვიჯეტი}other{# ვიჯეტი}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"ამოშლა"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"დეინსტალაცია"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"აპის შესახებ"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"პირადში ინსტალაცია"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"კერძოში ინსტალაცია"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"აპის დეინსტალაცია"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ინსტალაცია"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"არ შემომთავაზო აპი"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ჩამაგრების პროგნოზირება"</string>
+ <string name="bubble" msgid="3072951361014076670">"ბუშტი"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"მალსახმობების დაყენება"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"აპისთვის მალსახმობების დამოუკიდებლად დამატების უფლების მიცემა."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"მთავარი ეკრანის პარამეტრებისა და მალსახმობების წაკითხვა"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"ინსტალირდება <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> დასრულებულია"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"მიმდინარეობს <xliff:g id="NAME">%1$s</xliff:g>-ის ჩამოტვირთვა, <xliff:g id="PROGRESS">%2$s</xliff:g> დასრულდა"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ელოდება ინსტალაციას"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> დაარქივებულია. შეეხეთ ჩამოსატვირთად."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> დაარქივებულია. შეეხეთ გადმოსაწერად და აღსადგენად."</string>
<string name="dialog_update_title" msgid="114234265740994042">"საჭიროა აპის განახლება"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ამ ხატულის აპი განახლებული არ არის. შეგიძლიათ, ხელით განაახლოთ ამ მალსახმობის ხელახლა გასააქტიურებლად, ან ამოშალოთ ხატულა."</string>
<string name="dialog_update" msgid="2178028071796141234">"განახლება"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"დასაყენებლად ან გასახსნელად შეეხეთ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"პირადი"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"პირადი სივრცის პარამეტრები"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"პირადი (განბლოკილი)."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"პირადი (ჩაკეტილი)."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ჩაკეტვა"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"პირად სივრცეზე გადასვლა"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"აპების ინსტალაცია"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ინსტალაცია"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"კერძო სივრცეში აპების ინსტალაცია"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"გადავსება"</string>
</resources>
diff --git a/res/values-kk/strings.xml b/res/values-kk/strings.xml
index ff379c8..d5ccae5 100644
--- a/res/values-kk/strings.xml
+++ b/res/values-kk/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Қауіпсіз режимде виджеттер өшіріледі"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Таңбаша қолжетімді емес"</string>
<string name="home_screen" msgid="5629429142036709174">"Негізгі экран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Параметрлерден <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> қолданбасын әдепкі негізгі экран қолданбасы ретінде орнатыңыз."</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Экранды бөлу"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s қолданбасы туралы ақпарат"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s пайдалану параметрлері"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Қолданбаларды жұптау әрекетін сақтау"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Бұл құрылғы қолданбаларды жұптау функциясын қолдамайды."</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Қолданбаларды жұптау функциясы қолжетімді емес."</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Виджетті жылжыту үшін басып тұрыңыз."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Виджетті жылжыту үшін екі рет түртіңіз де, ұстап тұрыңыз немесе арнаулы әрекеттерді пайдаланыңыз."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Басқа опциялар"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Барлық виджетті көрсету"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Ені: %1$d, биіктігі: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> виджеті"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Ұсыныстар"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Ең қажетті"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Жаңалықтар мен журналдар"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Жанға жайлы жер"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Ойын-сауық"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Қоғам"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Денсаулық және фитнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Ауа райы"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Сізге ұсынылғандар"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> виджеттері оң жақта, іздеу мен опциялар сол жақта"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виджет}other{# виджет}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Алып тастау"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Жою"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Қолданба ақпараты"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Жеке профильге орнату"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Құпия профильге орнату"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Қолданбаны жою"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Орнату"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Қолданба ұсынбау"</string>
- <string name="pin_prediction" msgid="4196423321649756498">"Болжанған қолданбаны бекіту"</string>
+ <string name="pin_prediction" msgid="4196423321649756498">"Болжамды бекіту"</string>
+ <string name="bubble" msgid="3072951361014076670">"Қалқыма терезе"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"таңбаша орнату"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Қолданбаға пайдаланушының қатысуынсыз төте пернелерді қосу мүмкіндігін береді."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"негізгі экран параметрлері мен таңбашаларын оқу"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> орнатылуда, <xliff:g id="PROGRESS">%2$s</xliff:g> аяқталды"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> жүктелуде, <xliff:g id="PROGRESS">%2$s</xliff:g> аяқталды"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> орнату күтілуде"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> мұрағатталды. Жүктеп алу үшін түртіңіз."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> мұрағатталды. Жүктеп алу және қалпына келтіру үшін түртіңіз."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Қолданбаны жаңарту қажет"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Осы белгіше үшін қолданба жаңартылмаған. Оны қолмен жаңартып, осы таңбашаны қайта іске қоса аласыз немесе белгішені өшіріп тастаңыз."</string>
<string name="dialog_update" msgid="2178028071796141234">"Жаңарту"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Қайта қосу"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Сүзгі"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Қате шықты: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Жеке бөлме"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Құпия кеңістік"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Реттеу немесе ашу үшін түртіңіз"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Жеке"</string>
- <string name="ps_container_settings" msgid="6059734123353320479">"Жеке бөлме параметрлері"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_settings" msgid="6059734123353320479">"Құпия кеңістік параметрлері"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Құпия (құлыпталмаған)."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Құпия (құлыптаулы)."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Құлыптау"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Жеке бөлмеге өту"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Қолданбалар орнату"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Орнату"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Қолданбаларды \"Құпия кеңістікке\" орнатыңыз."</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Қосымша мәзір"</string>
</resources>
diff --git a/res/values-km/strings.xml b/res/values-km/strings.xml
index e738e6e..3c9135b 100644
--- a/res/values-km/strings.xml
+++ b/res/values-km/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"បានបិទធាតុក្រាហ្វិកក្នុងរបៀបសុវត្ថិភាព"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ផ្លូវកាត់មិនអាចប្រើបានទេ"</string>
<string name="home_screen" msgid="5629429142036709174">"អេក្រង់ដើម"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"កំណត់ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ជាកម្មវិធីអេក្រង់ដើមលំនាំដើមនៅក្នុង \"ការកំណត់\""</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"មុខងារបំបែកអេក្រង់"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"ព័ត៌មានកម្មវិធីសម្រាប់ %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"ការកំណត់ការប្រើប្រាស់សម្រាប់ %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"រក្សាទុកគូកម្មវិធី"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"មិនអាចប្រើគូកម្មវិធីនេះនៅលើឧបករណ៍នេះបានទេ"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"មិនអាចប្រើគូកម្មវិធីបានទេ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ចុចឱ្យជាប់ដើម្បីផ្លាស់ទីធាតុក្រាហ្វិក។"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ចុចពីរដង រួចសង្កត់ឱ្យជាប់ ដើម្បីផ្លាស់ទីធាតុក្រាហ្វិក ឬប្រើសកម្មភាពតាមបំណង។"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ជម្រើសច្រើនទៀត"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"បង្ហាញគ្រប់ធាតុក្រាហ្វិក"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"ទទឺង %1$d គុណនឹងកម្ពស់ %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"ធាតុក្រាហ្វិក <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"ការណែនាំ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"សំខាន់"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ព័ត៌មាន និងទស្សនាវដ្ដី"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"តំបន់បន្ធូរអារម្មណ៍របស់អ្នក"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"កម្សាន្ត"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"សង្គម"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"សុខភាព និងសម្បទា"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"អាកាសធាតុ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ណែនាំជូនអ្នក"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ធាតុក្រាហ្វិក <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> នៅខាងស្ដាំ ការស្វែងរក និងជម្រើសនៅខាងឆ្វេង"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{ធាតុក្រាហ្វិក #}other{ធាតុក្រាហ្វិក #}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"លុប"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ព័ត៌មានកម្មវិធី"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ដំឡើងជាលក្ខណៈឯកជន"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"លុបកម្មវិធី"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ដំឡើង"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"កុំណែនាំកម្មវិធី"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ខ្ទាស់ការព្យាករ"</string>
+ <string name="bubble" msgid="3072951361014076670">"ពពុះ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ដំឡើងផ្លូវកាត់"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"អនុញ្ញាតឲ្យកម្មវិធីបន្ថែមផ្លូវកាត់ ដោយមិនចាំបាច់អំពើពីអ្នកប្រើ។"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"អានការកំណត់ និងផ្លូវកាត់របស់អេក្រង់ដើម"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"កំពុងដំឡើង <xliff:g id="NAME">%1$s</xliff:g>, បានបញ្ចប់ <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"កំពុងដោនឡូត <xliff:g id="NAME">%1$s</xliff:g> បានបញ្ចប់ <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> កំពុងរង់ចាំការដំឡើង"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ត្រូវបានទុកក្នុងបណ្ណសារ។ សូមចុចដើម្បីទាញយក។"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ត្រូវបានទុកក្នុងបណ្ណសារ។ សូមចុចដើម្បីទាញយក និងស្ដារ។"</string>
<string name="dialog_update_title" msgid="114234265740994042">"តម្រូវឱ្យមានកំណែកម្មវិធីថ្មី"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"កម្មវិធីសម្រាប់រូបតំណាងនេះមិនត្រូវបានដំឡើងកំណែទេ។ អ្នកអាចដំឡើងកំណែដោយផ្ទាល់ ដើម្បីបើកផ្លូវកាត់នេះឡើងវិញ ឬលុបរូបតំណាងនេះ។"</string>
<string name="dialog_update" msgid="2178028071796141234">"ដំឡើងកំណែ"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"ចុចដើម្បីរៀបចំ ឬបើក"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ឯកជន"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ការកំណត់ Private Space"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ឯកជន បានដោះសោ។"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ឯកជន ជាប់សោ។"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ចាក់សោ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ការផ្លាស់ប្ដូរ Private Space"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ដំឡើងកម្មវិធី"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ដំឡើង"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ដំឡើងកម្មវិធីទៅលំហឯកជន"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ម៉ឺនុយបន្ថែម"</string>
</resources>
diff --git a/res/values-kn/strings.xml b/res/values-kn/strings.xml
index 7eeae34..ab84833 100644
--- a/res/values-kn/strings.xml
+++ b/res/values-kn/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ಸುರಕ್ಷಿತ ಮೋಡ್ನಲ್ಲಿ ವಿಜೆಟ್ಗಳನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ಶಾರ್ಟ್ಕಟ್ ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="home_screen" msgid="5629429142036709174">"ಹೋಮ್"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ಸೆಟ್ಟಿಂಗ್ಗಳಲ್ಲಿ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ಅನ್ನು ಡೀಫಾಲ್ಟ್ ಹೋಮ್ ಆ್ಯಪ್ ಆಗಿ ಸೆಟ್ ಮಾಡಿ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s ಗಾಗಿ ಆ್ಯಪ್ ಮಾಹಿತಿ"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s ಗೆ ಸಂಬಂಧಿಸಿದ ಬಳಕೆಯ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ಆ್ಯಪ್ ಪೇರ್ ಸೇವ್ ಮಾಡಿ"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ಈ ಆ್ಯಪ್ ಜೋಡಿಯು ಈ ಸಾಧನದಲ್ಲಿ ಬೆಂಬಲಿತವಾಗಿಲ್ಲ"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ಆ್ಯಪ್ ಜೋಡಿ ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ವಿಜೆಟ್ ಸರಿಸಲು ಸ್ಪರ್ಶಿಸಿ ಮತ್ತು ಹಿಡಿದುಕೊಳ್ಳಿ."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ವಿಜೆಟ್ ಸರಿಸಲು ಅಥವಾ ಕಸ್ಟಮ್ ಕ್ರಿಯೆಗಳನ್ನು ಬಳಸಲು ಡಬಲ್-ಟ್ಯಾಪ್ ಮಾಡಿ ಮತ್ತು ಹಿಡಿದುಕೊಳ್ಳಿ."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ಇನ್ನಷ್ಟು ಆಯ್ಕೆಗಳು"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ಎಲ್ಲಾ ವಿಜೆಟ್ ತೋರಿಸಿ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ಅಗಲ ಮತ್ತು %2$d ಎತ್ತರ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ವಿಜೆಟ್"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"ಸಲಹೆಗಳು"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ಅಗತ್ಯತೆಗಳು"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ಸುದ್ದಿ ಮತ್ತು ನಿಯತಕಾಲಿಕೆಗಳು"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"ನೀವು ವಿಶ್ರಾಂತಿ ಪಡೆಯುವ ಸ್ಥಳ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ಮನರಂಜನೆ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ಸಾಮಾಜಿಕ"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ಆರೋಗ್ಯ ಮತ್ತು ಫಿಟ್ನೆಸ್"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"ಹವಾಮಾನ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ನಿಮಗಾಗಿ ಸೂಚಿಸಲಾಗಿರುವುದು"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ಬಲಭಾಗದಲ್ಲಿ <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ವಿಜೆಟ್ಗಳು, ಎಡಭಾಗದಲ್ಲಿ ಹುಡುಕಾಟ ಮತ್ತು ಆಯ್ಕೆಗಳು"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ವಿಜೆಟ್}one{# ವಿಜೆಟ್ಗಳು}other{# ವಿಜೆಟ್ಗಳು}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ಅನ್ಇನ್ಸ್ಟಾಲ್"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ಆ್ಯಪ್ ಮಾಹಿತಿ"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ಖಾಸಗಿಯಾಗಿ ಇನ್ಸ್ಟಾಲ್ ಮಾಡಿ"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ಆ್ಯಪ್ ಅನ್ಇನ್ಸ್ಟಾಲ್ ಮಾಡಿ"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ಸ್ಥಾಪಿಸಿ"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ಆ್ಯಪ್ ಅನ್ನು ಸೂಚಿಸಬೇಡಿ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ಮುನ್ನೋಟ ಪಿನ್ ಮಾಡಿ"</string>
+ <string name="bubble" msgid="3072951361014076670">"ಬಬಲ್"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ಶಾರ್ಟ್ಕಟ್ಗಳನ್ನು ಸ್ಥಾಪಿಸಿ"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ಬಳಕೆದಾರರ ಹಸ್ತಕ್ಷೇಪವಿಲ್ಲದೆ ಶಾರ್ಟ್ಕಟ್ಗಳನ್ನು ಸೇರಿಸಲು ಅಪ್ಲಿಕೇಶನ್ಗೆ ಅನುಮತಿಸುತ್ತದೆ."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ಹೋಮ್ ಸ್ಕ್ರೀನ್ ಸೆಟ್ಟಿಂಗ್ಗಳು ಮತ್ತು ಶಾರ್ಟ್ಕಟ್ಗಳನ್ನು ಓದಿ"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ಇನ್ಸ್ಟಾಲ್ ಮಾಡಲಾಗುತ್ತಿದೆ, <xliff:g id="PROGRESS">%2$s</xliff:g> ಪೂರ್ಣಗೊಂಡಿದೆ"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ಡೌನ್ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ, <xliff:g id="PROGRESS">%2$s</xliff:g> ಪೂರ್ಣಗೊಂಡಿದೆ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ಸ್ಥಾಪಿಸಲು ಕಾಯಲಾಗುತ್ತಿದೆ"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ಅನ್ನು ಆರ್ಕೈವ್ ಮಾಡಲಾಗಿದೆ. ಡೌನ್ಲೋಡ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ಅನ್ನು ಆರ್ಕೈವ್ ಮಾಡಲಾಗಿದೆ. ಡೌನ್ಲೋಡ್ ಮಾಡಲು ಮತ್ತು ಮರುಸ್ಥಾಪಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ಆ್ಯಪ್ ಅಪ್ಡೇಟ್ ಅಗತ್ಯವಿದೆ"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ಈ ಐಕಾನ್ಗಾಗಿ ಆ್ಯಪ್ ಅನ್ನು ಅಪ್ಡೇಟ್ ಮಾಡಲಾಗಿಲ್ಲ. ಈ ಶಾರ್ಟ್ಕಟ್ ಅನ್ನು ಮರು-ಸಕ್ರಿಯಗೊಳಿಸಲು ನೀವು ಹಸ್ತಚಾಲಿತವಾಗಿ ಅಪ್ಡೇಟ್ ಮಾಡಬಹುದು ಅಥವಾ ಐಕಾನ್ ಅನ್ನು ತೆಗೆದುಹಾಕಬಹುದು."</string>
<string name="dialog_update" msgid="2178028071796141234">"ಅಪ್ಡೇಟ್ ಮಾಡಿ"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"ಸೆಟಪ್ ಮಾಡಲು ಅಥವಾ ತೆರೆಯಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ಖಾಸಗಿ"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ಖಾಸಗಿ ಸ್ಪೇಸ್ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ಖಾಸಗಿ, ಅನ್ಲಾಕ್ ಮಾಡಲಾಗಿದೆ."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ಖಾಸಗಿ, ಲಾಕ್ ಮಾಡಲಾಗಿದೆ."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ಲಾಕ್ ಮಾಡಿ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ಖಾಸಗಿ ಸ್ಪೇಸ್ ಪರಿವರ್ತನೆಯಾಗುತ್ತಿದೆ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ಆ್ಯಪ್ಗಳನ್ನು ಇನ್ಸ್ಟಾಲ್ ಮಾಡಿ"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ಇನ್ಸ್ಟಾಲ್"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ಆ್ಯಪ್ಗಳನ್ನು ಪ್ರೈವೇಟ್ ಸ್ಪೇಸ್ನಲ್ಲಿ ಇನ್ಸ್ಟಾಲ್ ಮಾಡಿ"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ಓವರ್ಫ್ಲೋ"</string>
</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 3672434..318cd00 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"안전 모드에서 위젯 사용 중지됨"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"바로가기를 사용할 수 없음"</string>
<string name="home_screen" msgid="5629429142036709174">"홈"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"설정에서 <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> 런처를 기본 홈 앱으로 설정하세요."</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"화면 분할"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s 앱 정보"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s의 사용량 설정"</string>
<string name="save_app_pair" msgid="5647523853662686243">"앱 페어링 저장"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"이 앱 페어링은 이 기기에서 지원되지 않습니다"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"앱 페어링을 사용할 수 없습니다."</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"길게 터치하여 위젯을 이동하세요."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"두 번 탭한 다음 길게 터치하여 위젯을 이동하거나 맞춤 작업을 사용하세요."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"옵션 더보기"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"모든 위젯 표시"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d×%2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"너비 %1$d, 높이 %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"위젯 <xliff:g id="WIDGET_NAME">%1$s</xliff:g>개"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"추천"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"필수"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"뉴스 및 잡지"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"휴식 공간"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"엔터테인먼트"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"소셜"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"건강 및 피트니스"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"날씨"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"추천"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"오른쪽에 <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> 위젯, 왼쪽에 검색 및 옵션"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{위젯 #개}other{위젯 #개}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"삭제"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"제거"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"앱 정보"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"비공개 설치"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"비공개 스페이스에 설치"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"앱 제거"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"설치"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"앱 제안 받지 않음"</string>
<string name="pin_prediction" msgid="4196423321649756498">"예상 앱 고정"</string>
+ <string name="bubble" msgid="3072951361014076670">"풍선"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"바로가기 설치"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"앱이 사용자의 작업 없이 바로가기를 추가할 수 있도록 합니다."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"홈 설정 및 바로가기 읽기"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> 설치 중, <xliff:g id="PROGRESS">%2$s</xliff:g> 완료"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> 다운로드 중, <xliff:g id="PROGRESS">%2$s</xliff:g> 완료"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> 설치 대기 중"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> 앱이 보관처리되었습니다. 다운로드하려면 탭하세요."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> 앱이 보관처리되었습니다. 탭하여 다운로드하고 복원하세요"</string>
<string name="dialog_update_title" msgid="114234265740994042">"앱 업데이트 필요"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"바로가기 아이콘의 앱이 업데이트되지 않았습니다. 직접 업데이트하여 앱 바로가기를 다시 사용할 수 있도록 하거나 아이콘을 삭제하세요."</string>
<string name="dialog_update" msgid="2178028071796141234">"업데이트"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"탭하여 설정 또는 열기"</string>
<string name="ps_container_title" msgid="4391796149519594205">"비공개"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"비공개 스페이스 설정"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"비공개, 잠금 해제됨."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"비공개, 잠김."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"잠금"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"비공개 스페이스 전환"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"앱 설치"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"설치"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"비공개 스페이스에 앱 설치"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"오버플로"</string>
</resources>
diff --git a/res/values-ky/strings.xml b/res/values-ky/strings.xml
index c9731a5..856e2b2 100644
--- a/res/values-ky/strings.xml
+++ b/res/values-ky/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Виджеттер Коопсуз режимде өчүрүлгөн"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Кыска жол жок"</string>
<string name="home_screen" msgid="5629429142036709174">"Башкы экран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Параметрлерден <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> жүргүзгүчүн демейки башкы бет колдонмосу катары коюу"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Экранды бөлүү"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s колдонмосу жөнүндө маалымат"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s колдонмосун пайдалануу параметрлери"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Колдонмолорду сактап коюу"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Бул эки колдонмону бул түзмөктө бир маалда пайдаланууга болбойт"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Эки колдонмону бир маалда пайдаланууга болбойт"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Виджетти кое бербей басып туруп жылдырыңыз."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Виджетти жылдыруу үчүн эки жолу таптап, кармап туруңуз же ыңгайлаштырылган аракеттерди колдонуңуз."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Дагы параметрлер"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Виджеттин баарын көрсөтүү"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Туурасы: %1$d, бийиктиги: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> виджети"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Сунуштар"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Эң зарыл параметрлер"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Жаңылыктар жана журналдар"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Чер жазуу"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Көңүл ачуу"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Коомдук тармактар"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Ден соолук жана дене-бойду чыңдоо"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Аба ырайы"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Сизге сунушталат"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> виджеттери оң, ал эми издөө жана параметрлер сол жакта"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виджет}other{# виджет}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Чыгарып салуу"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Колдонмо тууралуу"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Жеке мейкиндикке орнотуу"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Колдонмону чыгарып салуу"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Орнотуу"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Cунушталбасын"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Божомолдонгон колдонмону кадап коюу"</string>
+ <string name="bubble" msgid="3072951361014076670">"Көбүкчө"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"тез чакырмаларды орнотуу"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Колдонмого колдонуучуга кайрылбастан тез чакырма кошууга уруксат берет."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"үйдүн параметрлерин жана ыкчам баскычтарын окуу"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> орнотулууда, <xliff:g id="PROGRESS">%2$s</xliff:g> аткарылды"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> жүктөлүп алынууда, <xliff:g id="PROGRESS">%2$s</xliff:g> аяктады"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> орнотулушу күтүлүүдө"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> архивделди. Жүктөп алуу үчүн тийип коюңуз."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> архивделди. Жүктөп алуу жана калыбына келтирүү үчүн таптаңыз."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Колдонмону жаңыртыңыз"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Бул сүрөтчөнүн колдонмосу жаңыртылган эмес. Ыкчам баскычты кайра иштетүү үчүн аны кол менен жаңыртып же сүрөтчөнү өчүрүп койсоңуз болот."</string>
<string name="dialog_update" msgid="2178028071796141234">"Жаңыртуу"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Чыпкалоо"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Аткарылган жок: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Жеке мейкиндик"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Тууралоо же ачуу үчүн таптап коюңуз"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Тууралоо же ачуу үчүн тийип коюңуз"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Жеке"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Жеке мейкиндиктин параметрлери"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Купуя, кулпусу ачык."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Купуя, кулпуланган."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Кулпулоо"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Жеке чөйрөгө өтүү"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Колдонмолорду орнотуу"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Орнотуу"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Колдонмолорду Жеке мейкиндикке орнотуe"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Кошумча меню"</string>
</resources>
diff --git a/res/values-lo/strings.xml b/res/values-lo/strings.xml
index 89be107..3d1a6c9 100644
--- a/res/values-lo/strings.xml
+++ b/res/values-lo/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ວິດເຈັດຖືກປິດໃນ Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ບໍ່ສາມາດໃຊ້ທາງລັດໄດ້"</string>
<string name="home_screen" msgid="5629429142036709174">"ໂຮມສະກຣີນ"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ຕັ້ງ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ເປັນແອັບໂຮມເລີ່ມຕົ້ນໃນການຕັ້ງຄ່າ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ແບ່ງໜ້າຈໍ"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"ຂໍ້ມູນແອັບສຳລັບ %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"ການຕັ້ງຄ່າການນຳໃຊ້ສຳລັບ %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ບັນທຶກຈັບຄູ່ແອັບ"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ການຈັບຄູ່ແອັບນີ້ບໍ່ຮອງຮັບຢູ່ອຸປະກອນນີ້"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ການຈັບຄູ່ແອັບບໍ່ມີໃຫ້"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ແຕະຄ້າງໄວ້ເພື່ອຍ້າຍວິດເຈັດ."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ແຕະສອງເທື່ອຄ້າງໄວ້ເພື່ອຍ້າຍວິດເຈັດ ຫຼື ໃຊ້ຄຳສັ່ງກຳນົດເອງ."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ຕົວເລືອກເພີ່ມເຕີມ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ສະແດງວິດເຈັດທັງໝົດ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"ກວ້າງ %1$d ຄູນສູງ %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"ວິດເຈັດ <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"ການແນະນຳ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ສິ່ງຈຳເປັນ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ຂ່າວ ແລະ ວາລະສານ"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"ພື້ນທີ່ພັກຜ່ອນຂອງທ່ານ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ຄວາມບັນເທີງ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ສັງຄົມ"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ສຸຂະພາບ ແລະ ການອອກກຳລັງກາຍ"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"ສະພາບອາກາດ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ແນະນຳສຳລັບທ່ານ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ວິດເຈັດ <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ຢູ່ທາງຂວາ, ການຊອກຫາ ແລະ ຕົວເລືອກຢູ່ທາງຊ້າຍ"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ວິດເຈັດ}other{# ວິດເຈັດ}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ຖອນການຕິດຕັ້ງ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ຂໍ້ມູນແອັບ"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ຕິດຕັ້ງໃນສ່ວນຕົວ"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ຖອນການຕິດຕັ້ງແອັບ"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ຕິດຕັ້ງ"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ຢ່າແນະນຳແອັບ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ປັກໝຸດການຄາດເດົາ"</string>
+ <string name="bubble" msgid="3072951361014076670">"ຟອງ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ຕິດຕັ້ງທາງລັດ"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ອະນຸຍາດໃຫ້ແອັບຯ ເພີ່ມທາງລັດໂດຍບໍ່ຕ້ອງຮັບການຢືນຢັນຈາກຜູ່ໃຊ້."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ອ່ານການຕັ້ງຄ່າໜ້າຫຼັກ ແລະ ທາງລັດ"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"ກຳລັງຕິດຕັ້ງ <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> ສຳເລັດແລ້ວ"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ກຳລັງດາວໂຫຼດ, <xliff:g id="PROGRESS">%2$s</xliff:g> ສຳເລັດ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ກຳລັງລໍຖ້າຕິດຕັ້ງ"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ຖືກເກັບໄວ້ໃນແຟ້ມ. ແຕະເພື່ອດາວໂຫລດ."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ຖືກເກັບໄວ້ໃນແຟ້ມ. ແຕະເພື່ອດາວໂຫຼດ ແລະ ກູ້ຄືນ."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ຈຳເປັນຕ້ອງອັບເດດແອັບ"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ບໍ່ໄດ້ອັບເດດແອັບສຳລັບໄອຄອນນີ້. ທ່ານສາມາດອັບເດດເອງໄດ້ເພື່ອເປີດການນຳໃຊ້ທາງລັດນີ້ຄືນໃໝ່ ຫຼື ລຶບໄອຄອນດັ່ງກ່າວອອກ."</string>
<string name="dialog_update" msgid="2178028071796141234">"ອັບເດດ"</string>
@@ -193,7 +196,6 @@
<string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ສ່ວນຕົວ, ລັອກແລ້ວ."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ລັອກ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ການປ່ຽນແປງພື້ນທີ່ສ່ວນຕົວ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ຕິດຕັ້ງແອັບ"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ຕິດຕັ້ງ"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ຕິດຕັ້ງແອັບໄປໃສ່ພື້ນທີ່ສ່ວນບຸກຄົນ"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ການດຳເນີນການເພີ່ມເຕີມ"</string>
</resources>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index d763891..4c9bd9b 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Valdikliai išjungti Saugiame režime"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Sparčiojo klavišo negalima naudoti"</string>
<string name="home_screen" msgid="5629429142036709174">"Pagrindinis"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Nustatykite „<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>“ kaip numatytąją pagrindinę programą skiltyje „Nustatymai“"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Išskaidyto ekrano režimas"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Programos „%1$s“ informacija"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"„%1$s“ naudojimo nustatymai"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Išsaugoti programų porą"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ši programų pora šiame įrenginyje nepalaikoma"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Programų pora nepasiekiama"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Dukart pal. ir palaik., kad perkeltumėte valdiklį."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dukart palieskite ir palaikykite, kad perkeltumėte valdiklį ar naudotumėte tinkintus veiksmus."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Daugiau parinkčių"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Rodyti visus valdiklius"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d plotis ir %2$d aukštis"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> valdiklis"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Pasiūlymai"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Būtiniausi"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Naujienos ir žurnalai"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Jūsų atsipalaidavimo zona"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Pramogos"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Socialiniai tinklai"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sveikata ir kūno rengyba"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Orai"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Siūloma jums"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> valdikliai dešinėje, paieška ir parinktys kairėje"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# valdiklis}one{# valdiklis}few{# valdikliai}many{# valdiklio}other{# valdiklių}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Pašalinti"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Programos inform."</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Įdiegti privačiai"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Pašalinti programą"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Įdiegti"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nesiūlyti programos"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Prisegti numatymą"</string>
+ <string name="bubble" msgid="3072951361014076670">"Debesėlis"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"įdiegti sparčiuosius klavišus"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Programai leidžiama pridėti sparčiuosius klavišus be naudotojo įsikišimo."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"skaityti pagrindinio ekrano nustatymus ir sparčiuosius klavišus"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Įdiegiama: „<xliff:g id="NAME">%1$s</xliff:g>“; baigta: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Atsisiunčiama programa „<xliff:g id="NAME">%1$s</xliff:g>“, <xliff:g id="PROGRESS">%2$s</xliff:g> baigta"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Laukiama, kol bus įdiegta programa „<xliff:g id="NAME">%1$s</xliff:g>“"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"„<xliff:g id="NAME">%1$s</xliff:g>“ suarchyvuota. Palieskite, kad atsisiųstumėte."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Programa „<xliff:g id="NAME">%1$s</xliff:g>“ suarchyvuota. Palieskite, jei norite atsisiųsti ir atkurti."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Būtina atnaujinti programą"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Šios piktogramos programa neatnaujinta. Galite patys atnaujinti, kad iš naujo įgalintumėte šį spartųjį klavišą, arba pašalinkite piktogramą."</string>
<string name="dialog_update" msgid="2178028071796141234">"Atnaujinti"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Palieskite, kad nustatytumėte arba atidarytumėte"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privatus"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Privačios erdvės nustatymai"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privatus, atrakintas."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privatus, užrakintas."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Užrakinti"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Privačios erdvės perkėlimas"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Programų diegimas"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Įdiegti"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Įdiegti programas privačioje erdvėje"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Perpildymas"</string>
</resources>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index 919158c..0a82705 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Logrīki atspējoti drošajā režīmā"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Saīsne nav pieejama."</string>
<string name="home_screen" msgid="5629429142036709174">"Sākums"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Iestatiet <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> kā noklusējuma sākuma lietotni iestatījumos."</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Sadalīt ekrānu"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s: informācija par lietotni"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Lietojuma iestatījumi: %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Saglabāt lietotņu pāri"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Šis lietotņu pāris netiek atbalstīts šajā ierīcē"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Lietotņu pāris nav pieejams"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Lai pārvietotu logrīku, pieskarieties un turiet."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Lai pārvietotu logrīku, uz tā veiciet dubultskārienu un turiet. Varat arī veikt pielāgotas darbības."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Citas iespējas"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Rādīt visus logrīkus"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d plats un %2$d augsts"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Logrīks <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Ieteikumi"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Produktivitātei"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Ziņas un žurnāli"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Jūsu atpūtas stūrītis"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Izklaide"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sociālie tīkli"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Veselība un fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Laikapstākļi"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Ieteikumi jums"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Pa labi logrīki <xliff:g id="SELECTED_HEADER">%1$s</xliff:g>, pa kreisi meklēšana un iespējas"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# logrīks}zero{# logrīku}one{# logrīks}other{# logrīki}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Atinstalēt"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Par lietotni"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalēt privāti"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Atinstalēt lietotni"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalēt"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Neieteikt lietotni"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Piespraust prognozēto lietotni"</string>
+ <string name="bubble" msgid="3072951361014076670">"Burbulis"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalēt saīsnes"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Ļauj lietotnei pievienot saīsnes, nejautājot lietotājam."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"sākuma ekrāna iestatījumu un saīšņu lasīšana"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Notiek lietotnes “<xliff:g id="NAME">%1$s</xliff:g>” instalēšana. Norise: <xliff:g id="PROGRESS">%2$s</xliff:g>."</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Lietotnes <xliff:g id="NAME">%1$s</xliff:g> lejupielāde (<xliff:g id="PROGRESS">%2$s</xliff:g> pabeigti)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Notiek <xliff:g id="NAME">%1$s</xliff:g> instalēšana"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Lietotne <xliff:g id="NAME">%1$s</xliff:g> ir arhivēta. Pieskarieties, lai lejupielādētu."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Lietotne <xliff:g id="NAME">%1$s</xliff:g> ir arhivēta; lai lejupielādētu un atjaunotu, pieskarieties"</string>
<string name="dialog_update_title" msgid="114234265740994042">"Lietotne ir jāatjaunina"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Šai ikonai paredzētā lietotne nav atjaunināta. Varat to atjaunināt manuāli, lai atkārtoti iespējotu šo saīsni, vai noņemt ikonu."</string>
<string name="dialog_update" msgid="2178028071796141234">"Atjaunināt"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Pieskarieties, lai iestatītu vai atvērtu"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privātā mape"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Privātās mapes iestatījumi"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privāta un nav bloķēta."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privāta un bloķēta."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Bloķēšana"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Pāriet uz privāto mapi"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Lietotņu instalēšana"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalēt"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalējiet lietotnes privātajā telpā."</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Pārpilde"</string>
</resources>
diff --git a/res/values-mk/strings.xml b/res/values-mk/strings.xml
index 0124936..887ca82 100644
--- a/res/values-mk/strings.xml
+++ b/res/values-mk/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Додатоците се оневозможени во безбеден режим"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Кратенката не е достапна"</string>
<string name="home_screen" msgid="5629429142036709174">"Почетен екран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Поставете <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> да биде стандардна апликација за почетен екран во „Поставки“"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Поделен екран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Податоци за апликација за %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Поставки за користење за %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Зачувај го парот апликации"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Паров апликации не е поддржан на уредов"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Парот апликации не е достапен"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Допрете и задржете за да преместите виџет."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Допрете двапати и задржете за да преместите виџет или користете приспособени дејства."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Повеќе опции"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Прикажи ги сите виџети"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d широк на %2$d висок"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Виџет <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Предлози"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Неопходни"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Вести и списанија"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Вашата зона за релаксација"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Забава"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Друштвени"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здравје и фитнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Време"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Препорачано за вас"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> виџети оддесно, „Пребарување“ и „Опции“ одлево"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виџет}one{# виџет}other{# виџети}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Деинсталирај"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Инф. за апликација"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Инстал. во приватен"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Деинсталирај ја апликацијата"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Инсталирај"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Не предлагај апликација"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Не предлагај апл."</string>
<string name="pin_prediction" msgid="4196423321649756498">"Закачи го предвидувањето"</string>
+ <string name="bubble" msgid="3072951361014076670">"Балонче"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"инсталирање кратенки"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Овозможува апликацијата да додава кратенки без интервенција на корисникот."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"да чита поставки и кратенки на почетна страница"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> се инсталира, <xliff:g id="PROGRESS">%2$s</xliff:g> завршено"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Се презема <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> завршено"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> чека да се инсталира"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> е архивирана. Допрете за преземање."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Апликацијата <xliff:g id="NAME">%1$s</xliff:g> е архивирана. Допрете за да преземете и вратите."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Потребно е ажурирање на апликацијата"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Апликацијата за оваа икона не е ажурирана. Може да ажурирате рачно за да повторно се овозможи кратенкава или отстранете ја иконата."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ажурирај"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Допрете за да поставите или отворите"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Приватен простор"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Поставки за „Приватен простор“"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Приватно, отклучено."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Приватно, заклучено."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Заклучи"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Префрлање на „Приватен простор“"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Инсталирајте апликации"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Инсталирајте"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Инсталирање апликации во „Приватен простор“"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Проширено балонче"</string>
</resources>
diff --git a/res/values-ml/strings.xml b/res/values-ml/strings.xml
index 1fc4572..dda5679 100644
--- a/res/values-ml/strings.xml
+++ b/res/values-ml/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"സുരക്ഷിത മോഡിൽ വിജറ്റുകൾ പ്രവർത്തനരഹിതമാക്കി"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"കുറുക്കുവഴി ലഭ്യമല്ല"</string>
<string name="home_screen" msgid="5629429142036709174">"ഹോം"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ക്രമീകരണത്തിൽ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> എന്നത് ഡിഫോൾട്ട് ഹോം ആപ്പായി സജ്ജീകരിക്കുക"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"സ്ക്രീൻ വിഭജന മോഡ്"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s എന്നതിന്റെ ആപ്പ് വിവരങ്ങൾ"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s എന്നതിനുള്ള ഉപയോഗ ക്രമീകരണം"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ആപ്പ് ജോടി സംരക്ഷിക്കുക"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ഈ ഉപകരണത്തിൽ ഈ ആപ്പ് ജോടിക്ക് പിന്തുണയില്ല"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ആപ്പ് ജോടി ലഭ്യമല്ല"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"വിജറ്റ് നീക്കാൻ സ്പർശിച്ച് പിടിക്കുക."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"വിജറ്റ് നീക്കാൻ ഡബിൾ ടാപ്പ് ചെയ്യൂ, ഹോൾഡ് ചെയ്യൂ അല്ലെങ്കിൽ ഇഷ്ടാനുസൃത പ്രവർത്തനങ്ങൾ ഉപയോഗിക്കൂ."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"കൂടുതൽ ഓപ്ഷനുകൾ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"എല്ലാ വിജറ്റും കാണിക്കുക"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d വീതിയും %2$d ഉയരവും"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> വിജറ്റ്"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"നിർദ്ദേശങ്ങൾ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ആവശ്യമായവ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"വാർത്തകളും മാസികകളും"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"നിങ്ങൾക്ക് സുഖപ്രദമായ സ്ഥലം"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"വിനോദം"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"സാമൂഹികം"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ആരോഗ്യവും ശാരീരികക്ഷമതയും"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"കാലാവസ്ഥ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"നിങ്ങൾക്കായി നിർദ്ദേശിച്ചവ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"വലതുവശത്ത് <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> വിജറ്റുകളും ഇടതുവശത്ത് തിരയൽ, ഓപ്ഷനുകൾ എന്നിവയും"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# വിജറ്റ്}other{# വിജറ്റുകൾ}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"അൺഇൻസ്റ്റാൾ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ആപ്പ് വിവരങ്ങൾ"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"സ്വകാര്യമായി ഇൻസ്റ്റാൾ ചെയ്യൂ"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ആപ്പ് അൺഇൻസ്റ്റാൾ ചെയ്യുക"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ഇൻസ്റ്റാൾ ചെയ്യുക"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"ആപ്പ് നിർദ്ദേശിക്കരുത്"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"ആപ്പ് നിർദ്ദേശിക്കേണ്ട"</string>
<string name="pin_prediction" msgid="4196423321649756498">"പ്രവചനം പിൻ ചെയ്യുക"</string>
+ <string name="bubble" msgid="3072951361014076670">"ബബിൾ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"കുറുക്കുവഴികൾ ഇൻസ്റ്റാളുചെയ്യുക"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ഉപയോക്തൃ ഇടപെടൽ ഇല്ലാതെ കുറുക്കുവഴികൾ ചേർക്കാൻ അപ്ലിക്കേഷനെ അനുവദിക്കുന്നു."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ഹോം ക്രമീകരണവും കുറുക്കുവഴികളും വായിക്കുക"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ഇൻസ്റ്റാൾ ചെയ്യുന്നു, <xliff:g id="PROGRESS">%2$s</xliff:g> പൂർത്തിയായി"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ഡൗൺലോഡ് ചെയ്യുന്നു, <xliff:g id="PROGRESS">%2$s</xliff:g> പൂർത്തിയായി"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"ഇൻസ്റ്റാൾ ചെയ്യാൻ <xliff:g id="NAME">%1$s</xliff:g> കാക്കുന്നു"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ആർക്കൈവ് ചെയ്തു. ഡൗൺലോഡ് ചെയ്യാൻ ടാപ്പ് ചെയ്യുക."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ആർക്കൈവ് ചെയ്തു. ഡൗൺലോഡ് ചെയ്യാനും പുനഃസ്ഥാപിക്കാനും ടാപ്പ് ചെയ്യുക."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ആപ്പ് അപ്ഡേറ്റ് ചെയ്യേണ്ടതുണ്ട്"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ഈ ഐക്കണിനുള്ള ആപ്പ് അപ്ഡേറ്റ് ചെയ്തിട്ടില്ല. ഈ കുറുക്കുവഴി വീണ്ടും പ്രവർത്തനക്ഷമമാക്കാൻ നിങ്ങൾക്ക് നേരിട്ട് അപ്ഡേറ്റ് ചെയ്യാം അല്ലെങ്കിൽ ഐക്കൺ നീക്കം ചെയ്യാം."</string>
<string name="dialog_update" msgid="2178028071796141234">"അപ്ഡേറ്റ് ചെയ്യുക"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"സജ്ജീകരിക്കാനോ തുറക്കാനോ ടാപ്പ് ചെയ്യുക"</string>
<string name="ps_container_title" msgid="4391796149519594205">"സ്വകാര്യം"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"സ്വകാര്യ സ്പേസ് ക്രമീകരണം"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"സ്വകാര്യം, അൺലോക്ക് ചെയ്തിരിക്കുന്നു."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"സ്വകാര്യം, ലോക്ക് ചെയ്തു."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ലോക്ക് ചെയ്യുക"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"പ്രൈവറ്റ് സ്പേസ് ട്രാൻസിഷനിംഗ്"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ആപ്പുകൾ ഇൻസ്റ്റാൾ ചെയ്യുക"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ഇൻസ്റ്റാൾ ചെയ്യുക"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"സ്വകാര്യ സ്പേസിലേക്ക് ആപ്പുകൾ ഇൻസ്റ്റാൾ ചെയ്യുക"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ഓവർഫ്ലോ"</string>
</resources>
diff --git a/res/values-mn/strings.xml b/res/values-mn/strings.xml
index 33096c0..49d71c2 100644
--- a/res/values-mn/strings.xml
+++ b/res/values-mn/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Safe горимд виджетүүдийг идэвхгүйжүүлсэн"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Товчлол алга"</string>
<string name="home_screen" msgid="5629429142036709174">"Нүүр"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>-г Тохиргоонд өгөгдмөл үндсэн аппаар тохируулна уу"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Дэлгэцийг хуваах"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s-н аппын мэдээлэл"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s-н ашиглалтын тохиргоо"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Апп хослуулалтыг хадгалах"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Энэ апп хослуулалтыг уг төхөөрөмж дээр дэмждэггүй"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Апп хослуулалт боломжгүй байна"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Виджетийг зөөх бол хүрээд, удаан дарна уу."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Виджетийг зөөх эсвэл захиалгат үйлдлийг ашиглахын тулд хоёр товшоод, удаан дарна уу."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Бусад сонголт"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Бүх виджетийг харуулах"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d өргөн %2$d өндөр"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> жижиг хэрэгсэл"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Зөвлөмжүүд"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Зайлшгүй хэрэгтэй"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Мэдээ, сэтгүүлүүд"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Таны амралтын бүс"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Энтертэйнмент"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Сошиал"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Эрүүл мэнд, фитнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Цаг агаар"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Танд санал болгосон"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Баруун талд <xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-н виджет, зүүн талд хайлт болон сонгуултууд байна"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виджет}other{# виджет}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Устгах"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Аппын мэдээлэл"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Хувийнхад суулгах"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Аппыг устгах"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Суулгах"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Апп бүү санал болго"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Таамаглалыг бэхлэх"</string>
+ <string name="bubble" msgid="3072951361014076670">"Бөмбөлөг"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"товчлол суулгах"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Апп нь хэрэглэгчийн оролцоогүйгээр товчлолыг нэмэж чадна"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"нүүрний тохиргоо болон товчлолыг унших"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g>-г суулгаж байна. <xliff:g id="PROGRESS">%2$s</xliff:g> дууссан"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g>-г татаж байна, <xliff:g id="PROGRESS">%2$s</xliff:g> татсан"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> нь суулгахыг хүлээж байна"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g>-г архивласан. Татахын тулд товшино уу."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g>-г архивласан. Татаж, сэргээхийн тулд товшино уу."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Аппын шинэчлэлт шаардлагатай"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Энэ дүрс тэмдгийн аппыг шинэчлээгүй. Та энэ товчлолыг дахин идэвхжүүлэх эсвэл дүрсийг хасахын тулд гараар шинэчлэх боломжтой."</string>
<string name="dialog_update" msgid="2178028071796141234">"Шинэчлэх"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Тохируулах эсвэл нээхийн тулд товших"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Хувийн"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Private Space-н тохиргоо"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Хувийн, түгжээг тайлсан."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Хувийн, түгжээтэй."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Түгжээ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space-н шилжилт"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Аппуудыг суулгах"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Суулгах"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Хувийн орон зайд аппууд суулгана уу"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Урт цэс"</string>
</resources>
diff --git a/res/values-mr/strings.xml b/res/values-mr/strings.xml
index 1108c45..fdf864a 100644
--- a/res/values-mr/strings.xml
+++ b/res/values-mr/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"विजेट सुरक्षित मोडमध्ये अक्षम झाले"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"शॉर्टकट उपलब्ध नाही"</string>
<string name="home_screen" msgid="5629429142036709174">"होम"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"सेटिंग्ज मध्ये <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> हे डीफॉल्ट होम अॅप म्हणून सेट करा"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"स्प्लिट स्क्रीन"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s साठी ॲपशी संबंधित माहिती"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s साठी वापरासंबंधित सेटिंग्ज"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ॲपची जोडी सेव्ह करा"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"या ॲपची जोडीला या डिव्हाइसवर सपोर्ट नाही"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ॲपची जोडी उपलब्ध नाही"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"विजेट हलवण्यासाठी स्पर्श करा आणि धरून ठेवा."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"विजेट हलवण्यासाठी किंवा कस्टम कृती वापरण्यासाठी दोनदा टॅप करा आणि धरून ठेवा."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"आणखी पर्याय"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"सर्व विजेट दाखवा"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d रूंद बाय %2$d उंच"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> विजेट"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"सूचना"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"आवश्यक गोष्टी"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"बातम्या आणि मासिके"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"तुमचा आरामदायक झोन"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"मनोरंजन"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"सोशल"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"आरोग्य आणि फिटनेस"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"हवामान"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"तुमच्यासाठी सुचवलेले"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"उजवीकडे <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> विजेट, डावीकडे शोध आणि पर्याय"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# विजेट}other{# विजेट}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"अनइंस्टॉल करा"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"अॅप माहिती"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"खाजगीत इंस्टॉल करा"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"अॅप अनइंस्टॉल करा"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"इंस्टॉल करा"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ॲप सुचवू नका"</string>
<string name="pin_prediction" msgid="4196423321649756498">"पूर्वानुमान पिन करा"</string>
+ <string name="bubble" msgid="3072951361014076670">"बबल"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"शॉर्टकट इंस्टॉल करा"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"वापरकर्ता हस्तक्षेपाशिवाय शॉर्टकट जोडण्यास अॅप ला अनुमती देते."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"होम सेटिंग्ज आणि शॉर्टकट वाचा"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> इंस्टॉल करत आहे, <xliff:g id="PROGRESS">%2$s</xliff:g> पूर्ण झाले"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> डाउनलोड होत आहे , <xliff:g id="PROGRESS">%2$s</xliff:g> पूर्ण झाले"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> इंस्टॉल करण्याची प्रतिक्षा करत आहे"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> संग्रहित केले आहे. डाउनलोड करण्यासाठी टॅप करा."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> संग्रहित केले आहे. डाउनलोड करून रिस्टोअर करण्यासाठी टॅप करा."</string>
<string name="dialog_update_title" msgid="114234265740994042">"अॅप अपडेट करणे आवश्यक आहे"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"या आयकनसाठी अॅप अपडेट केलेले नाही. हा शॉटकर्ट पुन्हा सुरू करण्यासाठी तुम्ही मॅन्युअली अपडेट करू शकता किंवा आयकन काढून टाका."</string>
<string name="dialog_update" msgid="2178028071796141234">"अपडेट करा"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"सेट करण्यासाठी किंवा उघडण्यासाठी टॅप करा"</string>
<string name="ps_container_title" msgid="4391796149519594205">"खाजगी"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"खाजगी स्पेस ची सेटिंग्ज"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"खाजगी, अनलॉक केलेली."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"खाजगी, लॉक केलेली."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"लॉक"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"खाजगी स्पेस वर स्विच करणे"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"अॅप्स इंस्टॉल करा"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"इंस्टॉल करा"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"अॅप्स खाजगी स्पेस मध्ये इंस्टॉल करा"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ओव्हरफ्लो"</string>
</resources>
diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml
index b0d4fcf..b86f657 100644
--- a/res/values-ms/strings.xml
+++ b/res/values-ms/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widget dilumpuhkan dalam mod Selamat"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Pintasan tidak tersedia"</string>
<string name="home_screen" msgid="5629429142036709174">"Rumah"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Tetapkan <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> sebagai apl skrin utama lalai dalam Tetapan"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Skrin pisah"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Maklumat apl untuk %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Tetapan penggunaan sebanyak %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Simpan gandingan apl"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Gandingan apl ini tidak disokong pada peranti ini"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Gandingan apl tidak tersedia"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Sentuh & tahan untuk menggerakkan widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Ketik dua kali & tahan untuk menggerakkan widget atau menggunakan tindakan tersuai."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Lagi pilihan"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Tunjukkan semua widget"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Lebar %1$d kali tinggi %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Tambahkan pada skrin utama"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g> ditambahkan pada skrin utama"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Cadangan"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Apl Asas"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Penting"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Berita & majalah"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zon Santai Anda"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Hiburan"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosial"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Kesihatan & kecergasan"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Cuaca"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Dicadangkan untuk anda"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widget <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> pada sebelah kanan, carian dan pilihan pada sebelah kiri"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widget}}"</string>
@@ -62,7 +63,7 @@
<string name="no_widgets_available" msgid="4337693382501046170">"Widget dan pintasan tidak tersedia"</string>
<string name="no_search_results" msgid="3787956167293097509">"Tiada widget atau pintasan yang dijumpai"</string>
<string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Peribadi"</string>
- <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Tempat kerja"</string>
+ <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Kerja"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Perbualan"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"Pengambilan nota"</string>
<string name="widget_add_button_label" msgid="2761267068711937179">"Tambah"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Alih keluar"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Nyahpasang"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Maklumat apl"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Pasang dalam peribadi"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Pasang dalam persendirian"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Nyahpasang apl"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Pasang"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Jangan cadangkan apl"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Sematkan Ramalan"</string>
+ <string name="bubble" msgid="3072951361014076670">"Gelembung"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"pasang pintasan"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Membenarkan apl menambah pintasan tanpa campur tangan pengguna."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"membaca tetapan dan pintasan skrin utama"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> dipasang, <xliff:g id="PROGRESS">%2$s</xliff:g> selesai"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> memuat turun, <xliff:g id="PROGRESS">%2$s</xliff:g> selesai"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> menunggu untuk dipasang"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> diarkibkan. Ketik untuk muat turun."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> diarkibkan. Ketik untuk memuat turun dan memulihkan apl tersebut."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Kemas kini apl diperlukan"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Apl untuk ikon ini tidak dikemas kini. Anda boleh mengemas kini secara manual untuk mendayakan semula pintasan atau mengalih keluar ikon."</string>
<string name="dialog_update" msgid="2178028071796141234">"Kemas kini"</string>
@@ -187,15 +190,12 @@
<string name="remote_action_failed" msgid="1383965239183576790">"Gagal: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Ruang privasi"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Ketik untuk menyediakan atau membuka"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Peribadi"</string>
+ <string name="ps_container_title" msgid="4391796149519594205">"Persendirian"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Tetapan Ruang Peribadi"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Peribadi, tidak berkunci."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Peribadi, dikunci."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Kunci"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Peralihan Ruang Peribadi"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Pasang apl"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Pasang"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Pasang apl pada Ruang Peribadi"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Limpahan"</string>
</resources>
diff --git a/res/values-my/strings.xml b/res/values-my/strings.xml
index 386965f..7e8fd14 100644
--- a/res/values-my/strings.xml
+++ b/res/values-my/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"လုံခြုံရေး မုဒ်ထဲမှာ ဝီဂျက်များကို ပိတ်ထား"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ဖြတ်လမ်း မရနိုင်ပါ"</string>
<string name="home_screen" msgid="5629429142036709174">"ပင်မစာမျက်နှာ"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ဆက်တင်များတွင် <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ကို မူရင်းပင်မစာမျက်နှာအက်ပ်အဖြစ် သတ်မှတ်ရန်"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"မျက်နှာပြင် ခွဲ၍ပြသခြင်း"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s အတွက် အက်ပ်အချက်အလက်"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s အတွက် အသုံးပြုမှုဆက်တင်များ"</string>
<string name="save_app_pair" msgid="5647523853662686243">"အက်ပ်တွဲချိတ်ခြင်း သိမ်းရန်"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ဤအက်ပ်တွဲချိတ်ခြင်းကို ဤစက်တွင် ပံ့ပိုးမထားပါ"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"အက်ပ်တွဲချိတ်ခြင်းကို မရနိုင်ပါ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ဝိဂျက်ကို ရွှေ့ရန် တို့ပြီး ဖိထားပါ။"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ဝိဂျက်ကို ရွှေ့ရန် (သို့) စိတ်ကြိုက်လုပ်ဆောင်ချက်များကို သုံးရန် နှစ်ချက်တို့ပြီး ဖိထားပါ။"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"နောက်ထပ် ရွေးစရာများ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ဝိဂျက်အားလုံး ပြပါ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"အလျား %1$d နှင့် အမြင့် %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ဝိဂျက်"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"အကြံပြုချက်"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"မရှိမဖြစ်များ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"သတင်းနှင့် မဂ္ဂဇင်း"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"သင်အနားယူသောနေရာ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ဖျော်ဖြေရေး"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"လူမှုရေး"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ကျန်းမာကြံ့ခိုင်ရေး"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"မိုးလေဝသ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"သင့်အတွက် အကြံပြုထားသည်များ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ဝိဂျက်များသည် ညာဘက်တွင်ရှိပြီး ရှာဖွေမှုနှင့် ရွေးစရာများသည် ဘယ်ဘက်တွင်ရှိသည်"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{ဝိဂျက် # ခု}other{ဝိဂျက် # ခု}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ဖယ်ရှားရန်"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"အက်ပ်အချက်အလက်"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"သီးသန့်တွင် ထည့်သွင်းရန်"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"အက်ပ်ကို ဖယ်ရှားရန်"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ထည့်သွင်းရန်"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"အက်ပ်အကြံမပြုပါနှင့်"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ခန့်မှန်းချက်ကို ပင်ထိုးရန်"</string>
+ <string name="bubble" msgid="3072951361014076670">"ပူဖောင်းကွက်"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ဖြတ်လမ်းလင့်ခ်များ ထည့်သွင်းခြင်း"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"အသုံးပြုသူ လုပ်ဆောင်မှုမရှိပဲ အပ်ပလီကေးရှင်းကို အတိုကောက်မှတ်သားမှုများ ပြုလုပ်ခွင့် ပေးခြင်း"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ပင်မဆက်တင်နှင့် ဖြတ်လမ်းလင့်ခ်များ ဖတ်ခြင်း"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ကို ထည့်သွင်းနေသည်၊ <xliff:g id="PROGRESS">%2$s</xliff:g> ပြီးပါပြီ"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ဒေါင်းလုဒ်လုပ်နေသည်၊ <xliff:g id="PROGRESS">%2$s</xliff:g> ပြီးပါပြီ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ကိုထည့်သွင်းရန်စောင့်နေသည်"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ကို သိမ်းထားသည်။ ဒေါင်းလုဒ်လုပ်ရန် တို့ပါ။"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ကို သိမ်းထားသည်။ ဒေါင်းလုဒ်လုပ်ပြီး ပြန်ယူရန် တို့ပါ။"</string>
<string name="dialog_update_title" msgid="114234265740994042">"အက်ပ်ကို အပ်ဒိတ်လုပ်ရန် လိုအပ်သည်"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ဤသင်္ကေတအတွက် အက်ပ်ကို အပ်ဒိတ်လုပ်မထားပါ။ ဤဖြတ်လမ်းလင့်ခ်ကို ပြန်ဖွင့်ရန် ကိုယ်တိုင်အပ်ဒိတ်လုပ်နိုင်သည် (သို့) သင်္ကေတကို ဖယ်ရှားနိုင်သည်။"</string>
<string name="dialog_update" msgid="2178028071796141234">"အပ်ဒိတ်လုပ်ရန်"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"စနစ်ထည့်သွင်းရန် (သို့) ဖွင့်ရန် တို့ပါ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"သီးသန့်"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"သီးသန့်ချတ်ခန်း ဆက်တင်များ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"သီးသန့် လော့ခ်ဖွင့်ထားသည်။"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"သီးသန့် လော့ခ်ချထားသည်။"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"လော့ခ်ချခြင်း"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"သီးသန့်ချတ်ခန်း အပြောင်းအလဲ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"အက်ပ်ထည့်ခြင်း"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ထည့်သွင်းရန်"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"‘သီးသန့်နေရာ’ တွင် အက်ပ်များ ထည့်သွင်းနိုင်သည်"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"မီနူးအပို"</string>
</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index 86699de..2a6611f 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Moduler er deaktivert i sikker modus"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Snarveien er ikke tilgjengelig"</string>
<string name="home_screen" msgid="5629429142036709174">"Startskjerm"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Angi <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> som standard startsideapp i innstillingene"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Delt skjerm"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Appinformasjon for %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Bruksinnstillinger for %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Lagre apptilkoblingen"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Denne apptilkoblingen støttes ikke på denne enheten"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Apptilkoblingen er ikke tilgjengelig"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Trykk og hold for å flytte en modul."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dobbelttrykk og hold inne for å flytte en modul eller bruke tilpassede handlinger."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Flere alternativer"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Vis alle moduler"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d bredde x %2$d høyde"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>-modul"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Forslag"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Anbefalt"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Nyheter og tidsskrifter"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Avslappingssonen din"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Underholdning"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosialt"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Kropp og helse"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Været"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Foreslått for deg"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> moduler til høyre, søk og alternativer til venstre"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# modul}other{# moduler}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Avinstaller"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info om appen"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installer privat"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Avinstaller appen"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installer"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ikke foreslå app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fest forslaget"</string>
+ <string name="bubble" msgid="3072951361014076670">"Boble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installere snarveier"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Gir apper tillatelse til å legge til snarveier uten innblanding fra brukeren."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lese startsideinnstillinger og -snarveier"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installerer, <xliff:g id="PROGRESS">%2$s</xliff:g> er fullført"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Laster ned <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> er fullført"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Venter på å installere <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> er arkivert. Trykk for å laste den ned."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> er arkivert. Trykk for å laste ned og gjenopprette."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Appen må oppdateres"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Appen for dette ikonet er ikke oppdatert. Du kan oppdatere manuelt for å aktivere denne snarveien igjen, eller du kan fjerne ikonet."</string>
<string name="dialog_update" msgid="2178028071796141234">"Oppdater"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Trykk for å konfigurere eller åpne"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Innstillinger for Private Space"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat (ulåst)."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat (låst)."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lås"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Private Space-overgang"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installer apper"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installer"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installer apper i privat område"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflyt"</string>
</resources>
diff --git a/res/values-ne/strings.xml b/res/values-ne/strings.xml
index 6e8727b..fa2e59b 100644
--- a/res/values-ne/strings.xml
+++ b/res/values-ne/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"सुरक्षित मोडमा विगेटहरू अक्षम गरियो"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"सर्टकट उपलब्ध छैन"</string>
<string name="home_screen" msgid="5629429142036709174">"होम"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"सेटिङमा गई <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> लाई डिफल्ट होम एपका रूपमा सेट गर्नुहोस्"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"स्प्लिट स्क्रिन"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s का हकमा एपसम्बन्धी जानकारी"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s को प्रयोगसम्बन्धी सेटिङ"</string>
<string name="save_app_pair" msgid="5647523853662686243">"एपको पेयर सेभ गर्नुहोस्"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"यस डिभाइसमा यो एप पेयर प्रयोग गर्न मिल्दैन"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"एप पेयर उपलब्ध छैन"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"कुनै विजेट सार्न डबल ट्याप गरेर छोइराख्नुहोस्।"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"कुनै विजेट सार्न वा आफ्नो रोजाइका कारबाही प्रयोग गर्न डबल ट्याप गरेर छोइराख्नुहोस्।"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"थप विकल्पहरू"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"सबै विजेटहरू देखाउनुहोस्"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d चौडाइ गुणा %2$d उचाइ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> विजेट"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"सुझावहरू"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"अत्यावश्यक कुराहरू"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"समाचार तथा पत्रपत्रिकाहरू"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"तपाईंको Chill Zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"मनोरञ्जन"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"सोसल मिडिया"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"स्वास्थ्य तथा तन्दुरुस्ती"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"मौसम"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"तपाईंका लागि सिफारिस गरिएका"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"दायाँ भागमा <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> विजेटहरू, बायाँ भागमा खोज र विकल्पहरू"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# विजेट}other{# वटा विजेट}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"अनइन्स्टल गर्नुहोस्"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"एपसम्बन्धी जानकारी"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"निजी प्रोफाइलमा इन्स्टल गर्नुहोस्"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"एप अनइन्स्टल गर्नुहोस्"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"स्थापना गर्नुहोस्"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"एप सिफारिस नगर्नुहोस्"</string>
<string name="pin_prediction" msgid="4196423321649756498">"सिफारिस गरिएको एप पिन गर्नुहोस्"</string>
+ <string name="bubble" msgid="3072951361014076670">"बबल"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"सर्टकट स्थापना गर्नेहोस्"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"प्रयोगकर्ताको हस्तक्षेप बिना एउटा एपलाई सर्टकटमा थप्नको लागि अनुमति दिनुहोस्।"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"होम स्क्रिनका सेटिङ र सर्टकटहरू रिड गर्नुहोस्"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> इन्स्टल गरिँदै छ, <xliff:g id="PROGRESS">%2$s</xliff:g> पूरा भयो"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> डाउनलोड गर्दै, <xliff:g id="PROGRESS">%2$s</xliff:g> सम्पन्न"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> स्थापना गर्न प्रतीक्षा गर्दै"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> अभिलेखमा राखिएको छ। डाउनलोड गर्न ट्याप गर्नुहोस्।"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> अभिलेखमा राखिएको छ। डाउनलोड गरी रिस्टोर गर्न ट्याप गर्नुहोस्।"</string>
<string name="dialog_update_title" msgid="114234265740994042">"एप अपडेट गरिनु पर्छ"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"यो आइकनले जनाउने एप अपडेट गरिएको छैन। तपाईं यो सर्टकट फेरि अन गर्न म्यानुअल रूपमा अपडेट गर्न सक्नुहुन्छ वा आइकन नै हटाउनुहोस्।"</string>
<string name="dialog_update" msgid="2178028071796141234">"अपडेट गर्नुहोस्"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"सेटअप गर्न वा खोल्न ट्याप गर्नुहोस्"</string>
<string name="ps_container_title" msgid="4391796149519594205">"निजी"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"निजी स्पेससम्बन्धी सेटिङ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"निजी, अनलक गरिएको।"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"निजी, लक गरिएको।"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"लक गर्नुहोस्"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"निजी स्पेस ट्रान्जिसन गरिँदै छ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"एपहरू इन्स्टल गर्नुहोस्"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"इन्स्टल गर्नुहोस्"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"निजी स्पेसमा एपहरू इन्स्टल गर्नुहोस्"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ओभरफ्लो"</string>
</resources>
diff --git a/res/values-night-v31/colors.xml b/res/values-night-v31/colors.xml
index d23f4d1..0f630e5 100644
--- a/res/values-night-v31/colors.xml
+++ b/res/values-night-v31/colors.xml
@@ -26,6 +26,8 @@
<color name="home_settings_track_off_color">@android:color/system_neutral1_700</color>
<color name="widget_picker_title_color_dark">@android:color/system_neutral1_100</color>
+ <color name="widget_picker_description_color_dark">
+ @android:color/system_neutral2_200</color>
<color name="widget_picker_header_app_title_color_dark">
@android:color/system_neutral1_100</color>
<color name="widget_picker_header_app_subtitle_color_dark">
@@ -56,38 +58,5 @@
<color name="work_fab_icon_color">
@android:color/system_accent1_900</color>
- <color name="material_color_on_secondary_fixed_variant">@android:color/system_accent2_700</color>
- <color name="material_color_on_tertiary_fixed_variant">@android:color/system_accent3_700</color>
- <color name="material_color_on_primary_fixed_variant">@android:color/system_accent1_700</color>
- <color name="material_color_on_secondary_container">@android:color/system_accent2_100</color>
- <color name="material_color_on_tertiary_container">@android:color/system_accent3_100</color>
- <color name="material_color_on_primary_container">@android:color/system_accent1_100</color>
- <color name="material_color_secondary_fixed_dim">@android:color/system_accent2_200</color>
- <color name="material_color_on_error_container">#FFDAD5</color>
- <color name="material_color_on_secondary_fixed">@android:color/system_accent2_900</color>
- <color name="material_color_on_surface_inverse">@android:color/system_neutral1_900</color>
- <color name="material_color_tertiary_fixed_dim">@android:color/system_accent3_200</color>
- <color name="material_color_on_tertiary_fixed">@android:color/system_accent3_900</color>
- <color name="material_color_primary_fixed_dim">@android:color/system_accent1_200</color>
- <color name="material_color_secondary_container">@android:color/system_accent2_700</color>
- <color name="material_color_error_container">#930001</color>
- <color name="material_color_on_primary_fixed">@android:color/system_accent1_900</color>
- <color name="material_color_primary_inverse">@android:color/system_accent1_600</color>
- <color name="material_color_secondary_fixed">@android:color/system_accent2_100</color>
- <color name="material_color_tertiary_container">@android:color/system_accent3_700</color>
- <color name="material_color_tertiary_fixed">@android:color/system_accent3_100</color>
- <color name="material_color_primary_container">@android:color/system_accent1_700</color>
- <color name="material_color_on_background">@android:color/system_neutral1_800</color>
- <color name="material_color_primary_fixed">@android:color/system_accent1_100</color>
- <color name="material_color_on_secondary">@android:color/system_accent2_800</color>
- <color name="material_color_on_tertiary">@android:color/system_accent3_800</color>
- <color name="material_color_on_error">#690001</color>
- <color name="material_color_on_surface_variant">@android:color/system_neutral2_200</color>
- <color name="material_color_outline">@android:color/system_neutral2_400</color>
- <color name="material_color_outline_variant">@android:color/system_neutral2_700</color>
- <color name="material_color_on_primary">@android:color/system_accent1_800</color>
<color name="material_color_on_surface">@android:color/system_neutral1_100</color>
- <color name="material_color_primary">@android:color/system_accent1_200</color>
- <color name="material_color_secondary">@android:color/system_accent2_200</color>
- <color name="material_color_tertiary">@android:color/system_accent3_200</color>
</resources>
\ No newline at end of file
diff --git a/res/values-night-v34/colors.xml b/res/values-night-v34/colors.xml
new file mode 100644
index 0000000..abce763
--- /dev/null
+++ b/res/values-night-v34/colors.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2024, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <color name="widget_picker_secondary_surface_color_dark">
+ @android:color/system_surface_bright_dark</color>
+ <color name="widget_picker_header_app_title_color_dark">
+ @android:color/system_on_surface_dark</color>
+ <color name="widget_picker_header_app_subtitle_color_dark">
+ @android:color/system_on_surface_variant_dark</color>
+ <color name="widget_cell_title_color_dark">
+ @android:color/system_on_surface_dark</color>
+ <color name="widget_cell_subtitle_color_dark">
+ @android:color/system_on_surface_variant_dark</color>
+ <color name="widget_picker_menu_options_color_dark">
+ @android:color/system_on_surface_variant_dark
+ </color>
+</resources>
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index 95b3a63..887a2a5 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -1,64 +1,20 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2023, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<resources>
- <color name="material_color_on_secondary_fixed_variant">#3F4759</color>
- <color name="material_color_on_tertiary_fixed_variant">#583E5B</color>
<color name="material_color_surface_container_lowest">#0D0E11</color>
- <color name="material_color_on_primary_fixed_variant">#2B4678</color>
- <color name="material_color_on_secondary_container">#DBE2F9</color>
- <color name="material_color_on_tertiary_container">#FBD7FC</color>
- <color name="material_color_surface_container_low">#1B1B1F</color>
- <color name="material_color_on_primary_container">#D8E2FF</color>
- <color name="material_color_secondary_fixed_dim">#BFC6DC</color>
- <color name="material_color_on_error_container">#FFDAD5</color>
- <color name="material_color_on_secondary_fixed">#141B2C</color>
- <color name="material_color_on_surface_inverse">#1B1B1F</color>
- <color name="material_color_tertiary_fixed_dim">#DEBCDF</color>
- <color name="material_color_on_tertiary_fixed">#29132D</color>
- <color name="material_color_primary_fixed_dim">#ADC6FF</color>
- <color name="material_color_secondary_container">#3F4759</color>
- <color name="material_color_error_container">#930001</color>
- <color name="material_color_on_primary_fixed">#001A41</color>
- <color name="material_color_primary_inverse">#445E91</color>
- <color name="material_color_secondary_fixed">#DBE2F9</color>
- <color name="material_color_surface_inverse">#FAF9FD</color>
- <color name="material_color_surface_variant">#44474F</color>
- <color name="material_color_tertiary_container">#583E5B</color>
- <color name="material_color_tertiary_fixed">#FBD7FC</color>
- <color name="material_color_primary_container">#2B4678</color>
- <color name="material_color_on_background">#E3E2E6</color>
- <color name="material_color_primary_fixed">#D8E2FF</color>
- <color name="material_color_on_secondary">#293041</color>
- <color name="material_color_on_tertiary">#402843</color>
- <color name="material_color_surface_dim">#121316</color>
- <color name="material_color_surface_bright">#38393C</color>
- <color name="material_color_on_error">#690001</color>
- <color name="material_color_surface">#121316</color>
- <color name="material_color_surface_container_high">#292A2D</color>
- <color name="material_color_surface_container_highest">#343538</color>
- <color name="material_color_on_surface_variant">#C4C6D0</color>
- <color name="material_color_outline">#72747D</color>
- <color name="material_color_outline_variant">#444746</color>
- <color name="material_color_on_primary">#102F60</color>
<color name="material_color_on_surface">#E3E2E6</color>
- <color name="material_color_surface_container">#1F1F23</color>
- <color name="material_color_primary">#ADC6FF</color>
- <color name="material_color_secondary">#BFC6DC</color>
- <color name="material_color_tertiary">#DEBCDF</color>
-</resources>
+</resources>
\ No newline at end of file
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
index 613c2e9..06f0eee 100644
--- a/res/values-night/styles.xml
+++ b/res/values-night/styles.xml
@@ -21,11 +21,69 @@
<style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="android:windowTranslucentStatus">true</item>
+ <!-- Add the dim background here, rather than in the activity layout as the window slides
+ in from the bottom, and we don't want the scrim to slide. -->
+ <item name="android:backgroundDimEnabled">true</item>
</style>
- <style name="WidgetPickerActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
+ <style name="DynamicColorsBaseLauncherTheme" parent="@style/BaseLauncherTheme">
+ <item name="materialColorOnSecondaryFixedVariant">@color/system_on_secondary_fixed_variant</item>
+ <item name="materialColorOnTertiaryFixedVariant">@color/system_on_tertiary_fixed_variant</item>
+ <item name="materialColorSurfaceContainerLowest">@color/system_surface_container_lowest_dark</item>
+ <item name="materialColorOnPrimaryFixedVariant">@color/system_on_primary_fixed_variant</item>
+ <item name="materialColorOnSecondaryContainer">@color/system_on_secondary_container_dark</item>
+ <item name="materialColorOnTertiaryContainer">@color/system_on_tertiary_container_dark</item>
+ <item name="materialColorSurfaceContainerLow">@color/system_surface_container_low_dark</item>
+ <item name="materialColorOnPrimaryContainer">@color/system_on_primary_container_dark</item>
+ <item name="materialColorSecondaryFixedDim">@color/system_secondary_fixed_dim</item>
+ <item name="materialColorOnErrorContainer">@color/system_on_error_container_dark</item>
+ <item name="materialColorOnSecondaryFixed">@color/system_on_secondary_fixed</item>
+ <item name="materialColorOnSurfaceInverse">@color/system_on_surface_light</item>
+ <item name="materialColorTertiaryFixedDim">@color/system_tertiary_fixed_dim</item>
+ <item name="materialColorOnTertiaryFixed">@color/system_on_tertiary_fixed</item>
+ <item name="materialColorPrimaryFixedDim">@color/system_primary_fixed_dim</item>
+ <item name="materialColorSecondaryContainer">@color/system_secondary_container_dark</item>
+ <item name="materialColorErrorContainer">@color/system_error_container_dark</item>
+ <item name="materialColorOnPrimaryFixed">@color/system_on_primary_fixed</item>
+ <item name="materialColorPrimaryInverse">@color/system_primary_light</item>
+ <item name="materialColorSecondaryFixed">@color/system_secondary_fixed</item>
+ <item name="materialColorSurfaceInverse">@color/system_surface_light</item>
+ <item name="materialColorSurfaceVariant">@color/system_surface_variant_dark</item>
+ <item name="materialColorTertiaryContainer">@color/system_tertiary_container_dark</item>
+ <item name="materialColorTertiaryFixed">@color/system_tertiary_fixed</item>
+ <item name="materialColorPrimaryContainer">@color/system_primary_container_dark</item>
+ <item name="materialColorOnBackground">@color/system_on_background_dark</item>
+ <item name="materialColorPrimaryFixed">@color/system_primary_fixed</item>
+ <item name="materialColorOnSecondary">@color/system_on_secondary_dark</item>
+ <item name="materialColorOnTertiary">@color/system_on_tertiary_dark</item>
+ <item name="materialColorSurfaceDim">@color/system_surface_dim_dark</item>
+ <item name="materialColorSurfaceBright">@color/system_surface_bright_dark</item>
+ <item name="materialColorOnError">@color/system_on_error_dark</item>
+ <item name="materialColorSurface">@color/system_surface_dark</item>
+ <item name="materialColorSurfaceContainerHigh">@color/system_surface_container_high_dark</item>
+ <item name="materialColorSurfaceContainerHighest">@color/system_surface_container_highest_dark</item>
+ <item name="materialColorOnSurfaceVariant">@color/system_on_surface_variant_dark</item>
+ <item name="materialColorOutline">@color/system_outline_dark</item>
+ <item name="materialColorOutlineVariant">@color/system_outline_variant_dark</item>
+ <item name="materialColorOnPrimary">@color/system_on_primary_dark</item>
+ <item name="materialColorOnSurface">@color/system_on_surface_dark</item>
+ <item name="materialColorSurfaceContainer">@color/system_surface_container_dark</item>
+ <item name="materialColorPrimary">@color/system_primary_dark</item>
+ <item name="materialColorSecondary">@color/system_secondary_dark</item>
+ <item name="materialColorTertiary">@color/system_tertiary_dark</item>
+ <item name="materialColorError">@color/system_error_dark</item>
+ </style>
+
+ <style name="WidgetPickerActivityTheme" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowIsTranslucent">true</item>
+ <item name="android:windowAnimationStyle">@android:style/Animation</item>
+
+ <item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="pageIndicatorDotColor">@color/page_indicator_dot_color_dark</item>
</style>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 675a1b5..9271b96 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets uitgezet in veilige modus"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Snelkoppeling is niet beschikbaar"</string>
<string name="home_screen" msgid="5629429142036709174">"Startscherm"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Stel <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> in als de standaard startscherm-app in Instellingen"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Gesplitst scherm"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"App-info voor %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Gebruiksinstellingen voor %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"App-paar opslaan"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Dit app-paar wordt niet ondersteund op dit apparaat"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App-paar is niet beschikbaar"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Tik en houd vast om een widget te verplaatsen."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dubbeltik en houd vast om een widget te verplaatsen of aangepaste acties te gebruiken."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Meer opties"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Alle widgets tonen"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d breed en %2$d hoog"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Suggesties"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Nieuws en tijdschriften"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Je chillzone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sociaal"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Gezondheid en fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Weer"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Voorgesteld voor jou"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>-widgets aan de rechterkant, zoeken en opties aan de linkerkant"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deïnstalleren"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"App-info"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Privé installeren"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"App verwijderen"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installeren"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Geen app voorstellen"</string>
- <string name="pin_prediction" msgid="4196423321649756498">"Vastzetvoorspelling"</string>
+ <string name="pin_prediction" msgid="4196423321649756498">"Voorspelling vastzetten"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubbel"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Snelle links instellen"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Een app toestaan snelkoppelingen toe te voegen zonder tussenkomst van de gebruiker."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"instellingen en snelkoppelingen op startscherm lezen"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installeren, <xliff:g id="PROGRESS">%2$s</xliff:g> voltooid"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> wordt gedownload, <xliff:g id="PROGRESS">%2$s</xliff:g> voltooid"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> wacht op installatie"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> is gearchiveerd Tik om te downloaden."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> is gearchiveerd. Tik om te downloaden en te herstellen."</string>
<string name="dialog_update_title" msgid="114234265740994042">"App-update vereist"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"De app voor dit icoon is niet geüpdatet. Je kunt handmatig updaten om deze snelkoppeling weer aan te zetten of het icoon verwijderen."</string>
<string name="dialog_update" msgid="2178028071796141234">"Updaten"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tik om in te stellen of te openen"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privé"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Instellingen voor privéruimte"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privé, niet vergrendeld."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privé, vergrendeld."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Vergrendelen"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Overschakelen naar privéruimte"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Apps installeren"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installeren"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Apps installeren in privégedeelte"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overloop"</string>
</resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index 5b37919..98d52de 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ନିରାପଦ ମୋଡରେ ୱିଜେଟ୍ ଅକ୍ଷମ କରାଗଲା"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ଶର୍ଟକଟ୍ ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="home_screen" msgid="5629429142036709174">"ହୋମ"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ସେଟିଂସରେ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>କୁ ଡିଫଲ୍ଟ Home ଆପ ଭାବରେ ସେଟ କରନ୍ତୁ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ସ୍କ୍ରିନକୁ ସ୍ପ୍ଲିଟ କରନ୍ତୁ"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s ପାଇଁ ଆପ ସୂଚନା"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s ପାଇଁ ବ୍ୟବହାର ସେଟିଂସ"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ଆପ ପେୟାର ସେଭ କରନ୍ତୁ"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ଏହି ଆପ ପେୟାର ଏ ଡିଭାଇସରେ ସମର୍ଥିତ ନୁହେଁ"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ଆପ ପେୟାର ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ଏକ ୱିଜେଟକୁ ମୁଭ୍ କରିବା ପାଇଁ ସ୍ପର୍ଶ କରି ଧରି ରଖନ୍ତୁ।"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ଏକ ୱିଜେଟକୁ ମୁଭ୍ କରିବା ପାଇଁ ଦୁଇଥର-ଟାପ୍ କରି ଧରି ରଖନ୍ତୁ କିମ୍ବା କଷ୍ଟମ୍ କାର୍ଯ୍ୟଗୁଡ଼ିକୁ ବ୍ୟବହାର କରନ୍ତୁ।"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ଅଧିକ ବିକଳ୍ପ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ସମସ୍ତ ୱିଜେଟ ଦେଖାନ୍ତୁ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ଓସାର ଓ %2$d ଉଚ୍ଚ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ୱିଜେଟ୍"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"ପରାମର୍ଶଗୁଡ଼ିକ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ଅତ୍ୟାବଶ୍ୟକୀୟ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ନ୍ୟୁଜ ଓ ମାଗାଜିନ"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"ଆପଣଙ୍କ ଚିଲ ଜୋନ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ମନୋରଞ୍ଜନ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ସୋସିଆଲ"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ସ୍ୱାସ୍ଥ୍ୟ ଓ ଫିଟନେସ"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"ପାଣିପାଗ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ଆପଣଙ୍କ ପାଇଁ ପ୍ରସ୍ତାବିତ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"ଡାହାଣରେ <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ୱିଜେଟଗୁଡ଼ିକ ଅଛି, ବାମରେ ସର୍ଚ୍ଚ ଓ ବିକଳ୍ପଗୁଡ଼ିକ ଅଛି"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ୱିଜେଟ}other{# ୱିଜେଟ}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ଅନଇନଷ୍ଟଲ କରନ୍ତୁ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ଆପ ସୂଚନା"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ପ୍ରାଇଭେଟରେ ଇନଷ୍ଟଲ କର"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ଆପ ଅନଇନଷ୍ଟଲ କରନ୍ତୁ"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ଆପ ପରାମର୍ଶ ଦିଅନ୍ତୁ ନାହିଁ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ପୂର୍ବାନୁମାନକୁ ପିନ୍ କରନ୍ତୁ"</string>
+ <string name="bubble" msgid="3072951361014076670">"ବବଲ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ସର୍ଟକଟ୍ ଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ୟୁଜରଙ୍କ ବିନା ହସ୍ତକ୍ଷେପରେ ଶର୍ଟକଟ୍ ଯୋଡ଼ିବାକୁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ହୋମ ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପଢ଼ନ୍ତୁ"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ଇନଷ୍ଟଲ୍ କରାଯାଉଛି, <xliff:g id="PROGRESS">%2$s</xliff:g> ସମ୍ପୂର୍ଣ୍ଣ ହୋଇଛି"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ଡାଉନଲୋଡ୍ ହେଉଛି, <xliff:g id="PROGRESS">%2$s</xliff:g> ସମ୍ପୂର୍ଣ୍ଣ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ଇନଷ୍ଟଲ୍ ହେବାକୁ ଅପେକ୍ଷା କରିଛି"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g>କୁ ଆର୍କାଇଭ କରାଯାଇଛି। ଡାଉନଲୋଡ୍ କରିବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ।"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g>କୁ ଆର୍କାଇଭ କରାଯାଇଛି। ଡାଉନଲୋଡ ଏବଂ ରିଷ୍ଟୋର କରିବା ପାଇଁ ଟାପ କରନ୍ତୁ।"</string>
<string name="dialog_update_title" msgid="114234265740994042">"ଆପକୁ ଅପଡେଟ କରିବା ଆବଶ୍ୟକ"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ଏହି ଆଇକନ ପାଇଁ ଆପକୁ ଅପଡେଟ କରାଯାଇନାହିଁ। ଏହି ସର୍ଟକଟକୁ ପୁଣି-ସକ୍ଷମ କରିବା ପାଇଁ ଆପଣ ମାନୁଆଲୀ ଅପଡେଟ କରିପାରିବେ କିମ୍ବା ଆଇକନଟିକୁ କାଢ଼ି ଦେଇପାରିବେ।"</string>
<string name="dialog_update" msgid="2178028071796141234">"ଅପଡେଟ କରନ୍ତୁ"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"ସେଟ ଅପ କରିବା କିମ୍ବା ଖୋଲିବାକୁ ଟାପ କରନ୍ତୁ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ପ୍ରାଇଭେଟ"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ପ୍ରାଇଭେଟ ସ୍ପେସ ସେଟିଂସ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ପ୍ରାଇଭେଟ, ଅନଲକ କରାଯାଇଛି।"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ପ୍ରାଇଭେଟ, ଲକ କରାଯାଇଛି।"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ଲକ କରନ୍ତୁ"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ପ୍ରାଇଭେଟ ସ୍ପେସ ଟ୍ରାଞ୍ଜିସନିଂ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ଆପ୍ ଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ଇନଷ୍ଟଲ କରନ୍ତୁ"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ଆପ୍ସକୁ ପ୍ରାଇଭେଟ ସ୍ପେସରେ ଇନଷ୍ଟଲ କରନ୍ତୁ"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ଓଭରଫ୍ଲୋ"</string>
</resources>
diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml
index 911b702..782979e 100644
--- a/res/values-pa/strings.xml
+++ b/res/values-pa/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ਵਿਜੇਟ ਸੁਰੱਖਿਅਤ ਮੋਡ ਵਿੱਚ ਅਸਮਰਥਿਤ"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ਸ਼ਾਰਟਕੱਟ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
<string name="home_screen" msgid="5629429142036709174">"ਮੁੱਖ ਪੰਨਾ"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ਸੈਟਿੰਗਾਂ ਵਿੱਚ ਜਾ ਕੇ <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ਨੂੰ ਪੂਰਵ-ਨਿਰਧਾਰਿਤ ਹੋਮ ਐਪ ਵਜੋਂ ਸੈੱਟ ਕਰੋ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s ਲਈ ਐਪ ਜਾਣਕਾਰੀ"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s ਲਈ ਵਰਤੋਂ ਸੈਟਿੰਗਾਂ"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ਐਪ ਜੋੜਾਬੱਧ ਰੱਖਿਅਤ ਕਰੋ"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ਇਸ ਐਪ ਜੋੜਾਬੱਧ ਦਾ ਇਸ ਡੀਵਾਈਸ \'ਤੇ ਸਮਰਥਨ ਨਹੀਂ ਕੀਤਾ ਜਾਂਦਾ"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ਐਪ ਜੋੜਾਬੱਧ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ਕਿਸੇ ਵਿਜੇਟ ਨੂੰ ਲਿਜਾਉਣ ਲਈ ਸਪਰਸ਼ ਕਰਕੇ ਰੱਖੋ।"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ਵਿਜੇਟ ਲਿਜਾਉਣ ਲਈ ਜਾਂ ਵਿਉਂਂਤੀਆਂ ਕਾਰਵਾਈਆਂ ਵਰਤਣ ਲਈ ਦੋ ਵਾਰ ਟੈਪ ਕਰਕੇ ਦਬਾ ਕੇ ਰੱਖੋ।"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ਹੋਰ ਵਿਕਲਪ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"ਸਭ ਵਿਜੇਟ ਦਿਖਾਓ"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ਚੌੜਾਈ ਅਤੇ %2$d ਲੰਬਾਈ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ਵਿਜੇਟ"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"ਸੁਝਾਅ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"ਲੋੜੀਂਦੀਆਂ"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ਖਬਰਾਂ ਅਤੇ ਰਸਾਲੇ"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"ਤੁਹਾਡੇ ਲਈ ਸਕੂਨਮਈ ਖੇਤਰ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ਮਨੋਰੰਜਨ"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"ਸੋਸ਼ਲ"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ਸਿਹਤ ਅਤੇ ਫਿੱਟਨੈੱਸ"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"ਮੌਸਮ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ਤੁਹਾਡੇ ਲਈ ਸੁਝਾਅ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ਵਿਜੇਟ ਸੱਜੇ ਪਾਸੇ ਹਨ, ਖੋਜ ਵਿਜੇਟ ਅਤੇ ਹੋਰ ਵਿਕਲਪ ਖੱਬੇ ਪਾਸੇ ਹਨ"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ਵਿਜੇਟ}one{# ਵਿਜੇਟ}other{# ਵਿਜੇਟ}}"</string>
@@ -62,7 +63,7 @@
<string name="no_widgets_available" msgid="4337693382501046170">"ਵਿਜੇਟ ਜਾਂ ਸ਼ਾਰਟਕੱਟ ਉਪਲਬਧ ਨਹੀਂ ਹਨ"</string>
<string name="no_search_results" msgid="3787956167293097509">"ਕੋਈ ਵੀ ਵਿਜੇਟ ਜਾਂ ਸ਼ਾਰਟਕੱਟ ਨਹੀਂ ਮਿਲਿਆ"</string>
<string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"ਨਿੱਜੀ"</string>
- <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"ਕਾਰਜ-ਸਥਾਨ"</string>
+ <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"ਕੰਮ"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"ਗੱਲਾਂਬਾਤਾਂ"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"ਨੋਟ ਬਣਾਉਣਾ"</string>
<string name="widget_add_button_label" msgid="2761267068711937179">"ਸ਼ਾਮਲ ਕਰੋ"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"ਹਟਾਓ"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ਅਣਸਥਾਪਤ ਕਰੋ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ਐਪ ਜਾਣਕਾਰੀ"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ਨਿੱਜੀ ਵਜੋਂ ਸਥਾਪਤ ਕਰੋ"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ਪ੍ਰਾਈਵੇਟ ਵਜੋਂ ਸਥਾਪਤ ਕਰੋ"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ਐਪ ਅਣਸਥਾਪਤ ਕਰੋ"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ਸਥਾਪਤ ਕਰੋ"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ਐਪ ਦਾ ਸੁਝਾਅ ਨਾ ਦਿਓ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ਪੂਰਵ-ਅਨੁਮਾਨ ਪਿੰਨ ਕਰੋ"</string>
+ <string name="bubble" msgid="3072951361014076670">"ਬਬਲ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ਸ਼ਾਰਟਕੱਟ ਸਥਾਪਤ ਕਰੋ"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ਇੱਕ ਐਪ ਨੂੰ ਵਰਤੋਂਕਾਰ ਦੇ ਦਖ਼ਲ ਤੋਂ ਬਿਨਾਂ ਸ਼ਾਰਟਕੱਟ ਸ਼ਾਮਲ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿੰਦਾ ਹੈ।"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ਹੋਮ ਸੈਟਿੰਗਾਂ ਅਤੇ ਸ਼ਾਰਟਕੱਟ ਪੜ੍ਹੋ"</string>
@@ -127,7 +130,7 @@
<string name="msg_missing_notification_access" msgid="281113995110910548">"ਸੂਚਨਾ ਬਿੰਦੂਆਂ ਦਿਖਾਉਣ ਲਈ, <xliff:g id="NAME">%1$s</xliff:g> ਲਈ ਐਪ ਸੂਚਨਾਵਾਂ ਚਾਲੂ ਕਰੋ"</string>
<string name="title_change_settings" msgid="1376365968844349552">"ਸੈਟਿੰਗਾਂ ਬਦਲੋ"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"ਸੂਚਨਾ ਬਿੰਦੂ ਦਿਖਾਓ"</string>
- <string name="developer_options_title" msgid="700788437593726194">"ਵਿਕਾਸਕਾਰ ਚੋਣਾਂ"</string>
+ <string name="developer_options_title" msgid="700788437593726194">"ਵਿਕਾਸਕਾਰ ਵਿਕਲਪ"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"ਹੋਮ ਸਕ੍ਰੀਨ \'ਤੇ ਐਪ ਪ੍ਰਤੀਕਾਂ ਨੂੰ ਸ਼ਾਮਲ ਕਰੋ"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"ਨਵੀਆਂ ਐਪਾਂ ਲਈ"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"ਅਗਿਆਤ"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ਨੂੰ ਸਥਾਪਤ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ, <xliff:g id="PROGRESS">%2$s</xliff:g> ਪੂਰਾ ਹੋਇਆ"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ਡਾਉਨਲੋਡ ਹੋਰ ਰਿਹਾ ਹੈ, <xliff:g id="PROGRESS">%2$s</xliff:g> ਸੰਪੂਰਣ"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ਸਥਾਪਤ ਕਰਨ ਦੀ ਉਡੀਕ ਕਰ ਰਿਹਾ ਹੈ"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ਪੁਰਾਲੇਖਬੱਧ ਹੈ। ਡਾਊਨਲੋਡ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ਪੁਰਾਲੇਖਬੱਧ ਹੈ। ਡਾਊਨਲੋਡ ਅਤੇ ਮੁੜ-ਬਹਾਲ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
<string name="dialog_update_title" msgid="114234265740994042">"ਐਪ ਨੂੰ ਅੱਪਡੇਟ ਕਰਨ ਦੀ ਲੋੜ ਹੈ"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ਇਸ ਪ੍ਰਤੀਕ ਲਈ ਐਪ ਨੂੰ ਅੱਪਡੇਟ ਨਹੀਂ ਕੀਤਾ ਗਿਆ ਹੈ। ਇਸ ਸ਼ਾਰਟਕੱਟ ਨੂੰ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਜਾਂ ਪ੍ਰਤੀਕ ਨੂੰ ਹਟਾਉਣ ਲਈ ਤੁਸੀਂ ਹੱਥੀਂ ਅੱਪਡੇਟ ਕਰ ਸਕਦੇ ਹੋ।"</string>
<string name="dialog_update" msgid="2178028071796141234">"ਅੱਪਡੇਟ ਕਰੋ"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"ਰੋਕ ਹਟਾਓ"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"ਫਿਲਟਰ"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"ਇਹ ਕਾਰਵਾਈ ਅਸਫਲ ਹੋਈ: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"ਨਿੱਜੀ ਸਪੇਸ"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"ਪ੍ਰਾਈਵੇਟ ਸਪੇਸ"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"ਸੈੱਟਅੱਪ ਕਰਨ ਜਾਂ ਖੋਲ੍ਹਣ ਲਈ ਟੈਪ ਕਰੋ"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ਨਿੱਜੀ"</string>
- <string name="ps_container_settings" msgid="6059734123353320479">"ਨਿੱਜੀ ਸਪੇਸ ਸੰਬੰਧੀ ਸੈਟਿੰਗਾਂ"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_settings" msgid="6059734123353320479">"ਪ੍ਰਾਈਵੇਟ ਸਪੇਸ ਸੰਬੰਧੀ ਸੈਟਿੰਗਾਂ"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ਨਿੱਜੀ, ਅਣਲਾਕ ਕੀਤਾ ਗਿਆ।"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ਨਿੱਜੀ, ਲਾਕ ਕੀਤਾ ਗਿਆ।"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ਲਾਕ ਕਰੋ"</string>
- <string name="ps_container_transition" msgid="8667331812048014412">"ਨਿੱਜੀ ਸਪੇਸ ਨੂੰ ਤਬਦੀਲ ਕਰਨਾ"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ਐਪਾਂ ਸਥਾਪਤ ਕਰੋ"</string>
+ <string name="ps_container_transition" msgid="8667331812048014412">"ਪ੍ਰਾਈਵੇਟ ਸਪੇਸ ਨੂੰ ਤਬਦੀਲ ਕਰਨਾ"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ਸਥਾਪਤ ਕਰੋ"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ਪ੍ਰਾਈਵੇਟ ਸਪੇਸ ਵਿੱਚ ਐਪਾਂ ਸਥਾਪਤ ਕਰੋ"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ਓਵਰਫ਼ਲੋ"</string>
</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 578127d..71e569c 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widżety są wyłączone w trybie bezpiecznym"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Skrót nie jest dostępny"</string>
<string name="home_screen" msgid="5629429142036709174">"Ekran główny"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Otwórz Ustawienia i ustaw aplikację <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> jako domyślną aplikację ekranu głównego"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Podziel ekran"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informacje o aplikacji: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s – ustawienia użycia"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Zapisz parę aplikacji"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ta para aplikacji nie jest obsługiwana na tym urządzeniu"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Para aplikacji jest niedostępna"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Naciśnij i przytrzymaj, aby przenieść widżet."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Naciśnij dwukrotnie i przytrzymaj, aby przenieść widżet lub użyć działań niestandardowych."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Więcej opcji"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Pokaż wszystkie widżety"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Szerokość %1$d, wysokość %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widżet <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Dodaj do ekranu głównego"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Widżet <xliff:g id="WIDGET_NAME">%1$s</xliff:g> został dodany do ekranu głównego"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugestie"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Niezbędne"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Najbardziej przydatne"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Wiadomości i czasopisma"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Strefa relaksu"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Rozrywka"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Społecznościowe"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdrowie i fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Pogoda"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Proponowane dla Ciebie"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widżety (<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>) po prawej, wyszukiwanie i opcje po lewej"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widżet}few{# widżety}many{# widżetów}other{# widżetu}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Odinstaluj"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"O aplikacji"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Zainstaluj prywatnie"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Odinstaluj aplikację"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Zainstaluj"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nie proponuj aplikacji"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Przypnij podpowiedź"</string>
+ <string name="bubble" msgid="3072951361014076670">"Dymek"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Instalowanie skrótów"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Pozwala aplikacji dodawać skróty bez interwencji użytkownika."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Odczytuje ustawienia i skróty na ekranie głównym"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instaluję aplikację <xliff:g id="NAME">%1$s</xliff:g>, postęp: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Pobieranie elementu <xliff:g id="NAME">%1$s</xliff:g>, ukończono: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> oczekuje na instalację"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikacja <xliff:g id="NAME">%1$s</xliff:g> jest zarchiwizowana. Kliknij, aby ją pobrać."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikacja <xliff:g id="NAME">%1$s</xliff:g> jest zarchiwizowana. Kliknij, aby ją pobrać i przywrócić."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Wymagana aktualizacja aplikacji"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacja z tą ikoną nie jest aktualizowana. Możesz zaktualizować ją ręcznie, aby ponownie uruchomić ten skrót, lub usunąć ikonę."</string>
<string name="dialog_update" msgid="2178028071796141234">"Aktualizuj"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Cofnij wstrzymywanie"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtruj"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Niepowodzenie: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Obszar prywatny"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Przestrzeń prywatna"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Kliknij, aby skonfigurować lub otworzyć"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Prywatne"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Ustawienia obszaru prywatnego"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Prywatna, bez blokady."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Prywatna, zablokowana."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zablokuj"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Przenoszenie obszaru prywatnego"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instaluj aplikacje"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Zainstaluj"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Zainstaluj aplikacje w przestrzeni prywatnej"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Rozwiń menu"</string>
</resources>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 9dde360..1c44d9b 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets desativados no Modo de segurança"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"O atalho não está disponível"</string>
<string name="home_screen" msgid="5629429142036709174">"Página inicial"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Defina a app <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> como a app inicial predefinida nas Definições"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ecrã dividido"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informações da app para %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Definições de utilização para %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Guardar par de apps"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Este par de apps não é suportado neste dispositivo"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"O par de apps não está disponível"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Toque sem soltar para mover um widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Toque duas vezes sem soltar para mover um widget ou utilizar ações personalizadas."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Mais opções"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostrar todos os widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de largura por %2$d de altura"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugestões"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essenciais"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Notícias e revistas"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"A sua zona de relaxamento"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entretenimento"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Redes sociais"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Saúde e fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Meteorologia"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugestões para si"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets de <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> à direita, pesquisa e opções à esquerda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info. da app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalar em privado"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalar app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalar"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Não sugerir app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixar previsão"</string>
+ <string name="bubble" msgid="3072951361014076670">"Balão"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar atalhos"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite a uma app adicionar atalhos sem a intervenção do utilizador."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ler definições e atalhos do ecrã Principal"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"A instalar <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> concluído"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"A transferir o <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> concluído"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"A aguardar a instalação do <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"A app <xliff:g id="NAME">%1$s</xliff:g> está arquivada. Toque para transferir."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"A app <xliff:g id="NAME">%1$s</xliff:g> está arquivada. Toque para transferir e restaurar."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Atualização da app necessária"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"A app deste ícone não está atualizada. Pode atualizar manualmente para reativar este atalho ou remover o ícone."</string>
<string name="dialog_update" msgid="2178028071796141234">"Atualizar"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtrar"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Falhou: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Espaço privado"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Tocar para configurar ou abrir"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Toque para configurar ou abrir"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privado"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Definições do espaço privado"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
- <string name="ps_container_lock_title" msgid="2640257399982364682">"Bloquear"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privado, desbloqueado."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privado, bloqueado."</string>
+ <string name="ps_container_lock_title" msgid="2640257399982364682">"Bloqueio"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Transição do espaço privado"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalar apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalar"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instale apps no espaço privado"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menu adicional"</string>
</resources>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 7932424..3f44591 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets desativados no modo de segurança"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"O atalho não está disponível"</string>
<string name="home_screen" msgid="5629429142036709174">"Início"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Definir <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> como app de início padrão nas Configurações"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Tela dividida"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informações do app %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Configurações de uso de %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Salvar par de apps"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Este Par de apps não está disponível no dispositivo"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"O Par de apps não está disponível"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Toque e pressione para mover um widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Toque duas vezes e mantenha a tela pressionada para mover um widget ou usar ações personalizadas."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Mais opções"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Mostrar todos os widgets"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de largura por %2$d de altura"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugestões"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essenciais"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Notícias e revistas"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Sua zona de relaxamento"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entretenimento"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Saúde e bem-estar"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Clima"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugestões para você"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgets da <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> à direita, pesquisa e opções à esquerda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}other{# widgets}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Informações do app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalar em particular"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Desinstalar app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalar"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Não sugerir esse app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixar previsão"</string>
+ <string name="bubble" msgid="3072951361014076670">"Balão"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar atalhos"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite que um app adicione atalhos sem intervenção do usuário."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ler configurações e atalhos da tela inicial"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Instalando <xliff:g id="NAME">%1$s</xliff:g>. <xliff:g id="PROGRESS">%2$s</xliff:g> concluído"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Fazendo download de <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> concluído"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Aguardando instalação de <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"O app <xliff:g id="NAME">%1$s</xliff:g> está arquivado. Toque para baixar."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"O app <xliff:g id="NAME">%1$s</xliff:g> está arquivado. Toque para baixar e restaurar."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Atualização obrigatória do app"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"O app desse ícone não está atualizado. Você pode remover o ícone ou atualizar o app manualmente para reativar esse atalho."</string>
<string name="dialog_update" msgid="2178028071796141234">"Atualizar"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Ativar"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtrar"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Falha: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
- <string name="private_space_label" msgid="2359721649407947001">"Espaço particular"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Espaço privado"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Toque para configurar ou abrir"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Particular"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Configurações do Espaço particular"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
- <string name="ps_container_lock_title" msgid="2640257399982364682">"Bloquear"</string>
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privada, desbloqueado."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privada, bloqueado."</string>
+ <string name="ps_container_lock_title" msgid="2640257399982364682">"Bloqueio"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Espaço particular em transição"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalar apps"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalar"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalar apps no espaço privado"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Balão flutuante"</string>
</resources>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 13ae5e3..b37d93b 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgeturile sunt dezactivate în modul de siguranță"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Comanda rapidă nu este disponibilă"</string>
<string name="home_screen" msgid="5629429142036709174">"Pagina de pornire"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Setează <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> drept aplicație ecran de pornire prestabilită, în Setări"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ecran împărțit"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informații despre aplicație pentru %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Setări de utilizare pentru %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Salvează perechea de aplicații"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Perechea de aplicații nu este acceptată pe acest dispozitiv"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Perechea de aplicații nu este disponibilă"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Atinge și ține apăsat pentru a muta un widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Atinge de două ori și ține apăsat pentru a muta un widget sau folosește acțiuni personalizate."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Mai multe opțiuni"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Afișează toate widgeturile"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d lățime și %2$d înălțime"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widgetul <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugestii"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Esențiale"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Știri și reviste"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zona de relaxare"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Divertisment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Rețele sociale"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sănătate și fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Meteo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugerate pentru tine"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgeturi pentru <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> în dreapta, căutare și opțiuni în stânga"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}few{# widgeturi}other{# de widgeturi}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Dezinstalează"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Informații despre aplicații"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalează în privat"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Dezinstalează aplicația"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalează"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nu sugera aplicația"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixează predicția"</string>
+ <string name="bubble" msgid="3072951361014076670">"Balon"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalează comenzi rapide"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite unei aplicații să adauge comenzi rapide fără intervenția utilizatorului."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"citește setările și comenzile rapide de pe ecranul de pornire"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> se instalează, <xliff:g id="PROGRESS">%2$s</xliff:g> finalizat"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> se descarcă (finalizat <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> așteaptă instalarea"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> s-a arhivat. Atinge pentru a descărca."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> s-a arhivat. Atinge pentru a descărca și restabili."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Este necesară actualizarea aplicației"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplicația pentru această pictogramă nu este actualizată. Poți să actualizezi manual ca să reactivezi comanda rapidă sau să elimini pictograma."</string>
<string name="dialog_update" msgid="2178028071796141234">"Actualizează"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Atinge pentru a configura sau a deschide"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Setări spațiu privat"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat, deblocat."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat, blocat."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Blochează"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Tranziție pentru spațiul privat"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalează aplicații"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalează"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalează aplicații în Spațiul privat"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Suplimentar"</string>
</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 4df4df0..321bf37 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Виджеты отключены в безопасном режиме"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Ярлык недоступен"</string>
<string name="home_screen" msgid="5629429142036709174">"Главный экран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Установить \"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>\" в качестве приложения главного экрана по умолчанию в настройках"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Разделить экран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Сведения о приложении \"%1$s\""</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Настройки использования приложения \"%1$s\""</string>
<string name="save_app_pair" msgid="5647523853662686243">"Сохранить приложения"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Одновременно использовать эти два приложения на устройстве нельзя."</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Одновременное использование двух приложений недоступно"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Чтобы переместить виджет, нажмите на него и удерживайте"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Чтобы использовать специальные действия или перенести виджет, нажмите на него дважды и удерживайте."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Другие параметры"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Показать все виджеты"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d x %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Ширина %1$d, высота %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Виджет \"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>\""</string>
@@ -43,14 +47,11 @@
<string name="add_item_request_drag_hint" msgid="8730547755622776606">"Нажмите на виджет и удерживайте его, чтобы переместить в нужное место на главном экране."</string>
<string name="add_to_home_screen" msgid="9168649446635919791">"Добавить на главный экран"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Виджет \"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>\" добавлен на главный экран"</string>
- <string name="suggested_widgets_header_title" msgid="1844314680798145222">"Подсказки"</string>
+ <string name="suggested_widgets_header_title" msgid="1844314680798145222">"Рекомендованные"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Основное"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Новости и журналы"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Развлечение и общение"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Развлечения"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Общение"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здоровье и спорт"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Погода"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Рекомендации"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Виджеты приложения \"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>\" находятся справа, а панель поиска и настройки – слева"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виджет}one{# виджет}few{# виджета}many{# виджетов}other{# виджета}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Убрать"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Удалить"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"О приложении"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Приватная установка"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Частная установка"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Удалить приложение"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Установить"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Не рекомендовать"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Закрепить рекомендацию"</string>
+ <string name="bubble" msgid="3072951361014076670">"Подсказка"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Создание ярлыков"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Приложение сможет самостоятельно добавлять ярлыки."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Доступ к данным о настройках и ярлыках на главном экране"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Установка приложения \"<xliff:g id="NAME">%1$s</xliff:g>\" (выполнено <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Скачивается \"<xliff:g id="NAME">%1$s</xliff:g>\" (<xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Ожидание установки \"<xliff:g id="NAME">%1$s</xliff:g>\""</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Приложение \"<xliff:g id="NAME">%1$s</xliff:g>\" находится в архиве. Нажмите, чтобы скачать"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Приложение \"<xliff:g id="NAME">%1$s</xliff:g>\" находится в архиве. Нажмите, чтобы скачать его и восстановить"</string>
<string name="dialog_update_title" msgid="114234265740994042">"Обновите приложение"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Эта версия приложения устарела. Обновите его вручную, чтобы снова пользоваться ярлыком, или удалите значок."</string>
<string name="dialog_update" msgid="2178028071796141234">"Обновить"</string>
@@ -185,17 +188,14 @@
<string name="work_apps_enable_btn_text" msgid="1736198302467317371">"Возобновить"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Фильтр"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Не удалось выполнить действие (<xliff:g id="WHAT">%1$s</xliff:g>)."</string>
- <string name="private_space_label" msgid="2359721649407947001">"Личное пространство"</string>
+ <string name="private_space_label" msgid="2359721649407947001">"Частное пространство"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Нажмите, чтобы настроить или открыть"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Доступно только вам"</string>
+ <string name="ps_container_title" msgid="4391796149519594205">"Частный профиль"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Настройки личного пространства"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Личное, разблокировано."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Личное, заблокировано."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Блокировка"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Переход к личному пространству"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Установить приложения"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Установить"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Установить приложения в личном пространстве"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Дополнительное меню"</string>
</resources>
diff --git a/res/values-si/strings.xml b/res/values-si/strings.xml
index 61ca4de..91c818a 100644
--- a/res/values-si/strings.xml
+++ b/res/values-si/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"සුරක්ෂිත ආකාරය තුළ විජටය අබල කරන ලදි"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"කෙටි මග ලබා ගත නොහැකිය"</string>
<string name="home_screen" msgid="5629429142036709174">"මුල් පිටුව"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> සැකසීම් තුළ පෙරනිමි මුල් පිටුව යෙදුම ලෙස සකසන්න"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"බෙදුම් තිරය"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s සඳහා යෙදුම් තතු"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s සඳහා භාවිත සැකසීම්"</string>
<string name="save_app_pair" msgid="5647523853662686243">"යෙදුම් යුගල සුරකින්න"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"මෙම යෙදුම් යුගලය මෙම උපාංගයෙහි සහාය නොදක්වයි"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"යෙදුම් යුගලයක් නොමැත"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"විජට් එකක් ගෙන යාමට ස්පර්ශ කර අල්ලා ගෙන සිටින්න."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"විජට් එකක් ගෙන යාමට හෝ අභිරුචි ක්රියා භාවිත කිරීමට දෙවරක් තට්ටු කර අල්ලා ගෙන සිටින්න."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"තවත් විකල්ප"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"සියලු ම විජට් පෙන්වන්න"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"පළල %1$d උස %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> විජට්ටුව"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"යෝජනා"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"අත්යවශ්යාංග"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"පුවත් සහ සඟරා"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"ඔබේ නිවුණු කලාපය"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"විනෝදාස්වාදය"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"සමාජයීය"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"සෞඛ්යය සහ යෝග්යතාව"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"කාලගුණ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"ඔබ සඳහා යෝජිත"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"දකුණේ <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> විජට්, වමේ සෙවීම සහ විකල්ප"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{විජට් #}one{විජට් #}other{විජට් #}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"අස්ථාපනය කරන්න"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"යෙදුම් තොරතුරු"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"පෞද්ගලිකව ස්ථාපනය කරන්න"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"යෙදුම අස්ථාපනය කරන්න"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ස්ථාපනය කරන්න"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"යෙදුම යෝජනා නොකරන්න"</string>
<string name="pin_prediction" msgid="4196423321649756498">"පුරෝකථනය අමුණන්න"</string>
+ <string name="bubble" msgid="3072951361014076670">"බුබුළ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"කෙටිමං ස්ථාපනය කරන්න"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"පරිශීලක මැදිහත්වීමෙන් තොරව කෙටිමං එක් කිරීමට යෙදුමකට අවසර දෙයි."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"මුල් පිටු සැකසීම් සහ කෙටි මං කියවන්න"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ස්ථාපනය කරමින්, <xliff:g id="PROGRESS">%2$s</xliff:g> සම්පූර්ණයි"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> බාගත කරමින්, <xliff:g id="PROGRESS">%2$s</xliff:g> සම්පූර්ණයි"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ස්ථාපනය කිරීමට බලා සිටිමින්"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ලේඛනාරක්ෂණය කර ඇත. බාගැනීමට තට්ටු කරන්න"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> සංරක්ෂිතයි. බා ගෙන ප්රතිසාධන කිරීමට තට්ටු කරන්න."</string>
<string name="dialog_update_title" msgid="114234265740994042">"යෙදුම් යාවත්කාලීනයක් අවශ්යයි"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"මෙම නිරූපකය සඳහා යෙදුම යාවත්කාලීන කර නැත. ඔබට මෙම කෙටි මඟ යළි සබල කිරීමට හෝ නිරූපකය ඉවත් කිරීමට හස්තීයව යාවත්කාලීන කළ හැකිය."</string>
<string name="dialog_update" msgid="2178028071796141234">"යාවත්කාලීන කරන්න"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"පිහිටුවීමට හෝ විවෘත කිරීමට තට්ටු කරන්න"</string>
<string name="ps_container_title" msgid="4391796149519594205">"පෞද්ගලික"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"පෞද්ගලික අවකාශ සැකසීම්"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"පුද්ගලි, අගුලු හරින ලදි."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"පුද්ගලික, අගුලු දමන ලදි."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"අගුළු දමන්න"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"පෞද්ගලික අවකාශ සංක්රමණය"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"යෙදුම් ස්ථාපනය කරන්න"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ස්ථාපන කරන්න"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"පෞද්ගලික අවකාශයට යෙදුම් ස්ථාපනය කරන්න"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"පිටාර යාම"</string>
</resources>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index 2711ec9..eaae7c0 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Miniaplikácie sú v núdzovom režime zakázané"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Skratky nie sú k dispozícii"</string>
<string name="home_screen" msgid="5629429142036709174">"Domov"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Nastaviť aplikáciu <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ako predvolenú vstupnú aplikáciu v Nastaveniach"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Rozdeliť obrazovku"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informácie o aplikácii pre %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Nastavenia používania pre %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Uložiť pár aplikácií"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Tento pár aplikácií nie je v tomto zariadení podporovaný"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Pár aplikácií nie je k dispozícii"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Pridržaním presuňte miniaplikáciu."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvojitým klepnutím a pridržaním presuňte miniaplikáciu alebo použite vlastné akcie."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Ďalšie možnosti"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Zobrazovať všetky miniaplikácie"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"šírka %1$d, výška %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Miniaplikácia <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,23 +50,20 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Návrhy"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Všetko dôležité"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Noviny a časopisy"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Vaša komfortná zóna"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Zábava"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sociálne siete"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdravie a kondícia"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Počasie"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Navrhnuté pre vás"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Miniaplikácie <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> vpravo, vyhľadávanie a možnosti vľavo"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# miniaplikácia}few{# miniaplikácie}many{# widgets}other{# miniaplikácií}}"</string>
<string name="shortcuts_count" msgid="8471715556199592381">"{count,plural, =1{# odkaz}few{# odkazy}many{# shortcuts}other{# odkazov}}"</string>
<string name="widgets_and_shortcuts_count" msgid="7209136747878365116">"<xliff:g id="WIDGETS_COUNT">%1$s</xliff:g>, <xliff:g id="SHORTCUTS_COUNT">%2$s</xliff:g>"</string>
<string name="widget_button_text" msgid="2880537293434387943">"Miniaplikácie"</string>
- <string name="widgets_full_sheet_search_bar_hint" msgid="8484659090860596457">"Vyhľadajte"</string>
+ <string name="widgets_full_sheet_search_bar_hint" msgid="8484659090860596457">"Vyhľadávanie"</string>
<string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"Vymazať text z vyhľadávacieho poľa"</string>
<string name="no_widgets_available" msgid="4337693382501046170">"Miniaplikácie a odkazy nie sú k dispozícii"</string>
<string name="no_search_results" msgid="3787956167293097509">"Nenašli sa žiadne miniaplikácie ani odkazy"</string>
<string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Osobné"</string>
- <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Práca"</string>
+ <string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Pracovné"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Konverzácie"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"Zapisovanie poznámok"</string>
<string name="widget_add_button_label" msgid="2761267068711937179">"Pridať"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Odinštalovať"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info o aplikácii"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Inštalovať v súkromí"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Odinštalovať aplikáciu"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Inštalovať"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nenavrhovať aplikáciu"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Pripnúť predpoveď"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bublina"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"inštalácia odkazov"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Povoľuje aplikácii pridať odkazy bez zásahu používateľa."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"čítanie nastavení a odkazov plochy"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Inštaluje sa <xliff:g id="NAME">%1$s</xliff:g>. Dokončené: <xliff:g id="PROGRESS">%2$s</xliff:g>."</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Sťahuje sa aplikácia <xliff:g id="NAME">%1$s</xliff:g>. Stiahnuté: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Aplikácia <xliff:g id="NAME">%1$s</xliff:g> čaká na inštaláciu"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikácia <xliff:g id="NAME">%1$s</xliff:g> je archivovaná. Stiahnite klepnutím."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikácia <xliff:g id="NAME">%1$s</xliff:g> je archivovaná. Klepnutím ju stiahnite a obnovte."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Vyžaduje sa aktualizácia aplikácie"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikácia, ktorú zastupuje táto ikona, nie je aktualizovaná. Môžete ju ručne aktualizovať, aby odkaz znova fungoval, prípadne môžete ikonu odstrániť."</string>
<string name="dialog_update" msgid="2178028071796141234">"Aktualizovať"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Klepnutím nastavte alebo otvorte"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Súkromné"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Nastavenia súkromného priestoru"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Súkromné, odomknuté."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Súkromné, uzamknuté."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Uzamknúť"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Prechod súkromného priestoru"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Inštalovať aplikácie"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Inštalovať"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Inštalácia aplikácií v súkromnom priestore"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Rozšírená ponuka"</string>
</resources>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 7e13ac8..dccf2f1 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Pripomočki so onemogočeni v varnem načinu"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Bližnjica ni na voljo"</string>
<string name="home_screen" msgid="5629429142036709174">"Začetni zaslon"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Nastavitev zaganjalnika <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> kot privzete aplikacije za začetni zaslon v nastavitvah"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Razdeljen zaslon"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Podatki o aplikaciji za: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Nastavitve uporabe za »%1$s«"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Shrani par aplikacij"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ta par aplikacij ni podprt v tej napravi"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Par aplikacij ni na voljo"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Pridržite pripomoček, da ga premaknete."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Dvakrat se dotaknite pripomočka in ga pridržite, da ga premaknete, ali pa uporabite dejanja po meri."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Več možnosti"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Pokaži vse pripomočke"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Širina %1$d, višina %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Pripomoček <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Predlogi"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Osnove"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Novice in revije"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Vaš kotiček za sprostitev"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Razvedrilo"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Družbeno"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Zdravje in fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Vreme"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Predlagano za vas"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Pripomočki <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> na desni, iskanje in možnosti na levi"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# pripomoček}one{# pripomoček}two{# pripomočka}few{# pripomočki}other{# pripomočkov}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Odmesti"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Podatki o aplikaciji"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Namesti v zasebno"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Odmesti aplikacijo"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Namesti"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne predlagaj aplikacij"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Ne predlagaj"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Predvidevanje pripenjanja"</string>
+ <string name="bubble" msgid="3072951361014076670">"Mehurček"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"namestitev bližnjic"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Aplikaciji dovoli dodajanje bližnjic brez posredovanja uporabnika."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"branje nastavitev in bližnjic na začetnem zaslonu"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> se namešča, dokončano: <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Prenašanje aplikacije <xliff:g id="NAME">%1$s</xliff:g>; preneseno <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> čaka na namestitev"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dotaknite se za prenos."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Aplikacija <xliff:g id="NAME">%1$s</xliff:g> je arhivirana. Dotaknite se za prenos in obnovitev."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Zahtevana je posodobitev aplikacije"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacija za to ikono ni posodobljena. Lahko jo ročno posodobite, da znova omogočite to bližnjico, ali pa odstranite ikono."</string>
<string name="dialog_update" msgid="2178028071796141234">"Posodobi"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtriranje"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Ni uspelo: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Zasebni prostor"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Dotaknite se, da nastavite ali odprete"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Dotaknite se, da ga nastavite ali odprete"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Zasebno"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Nastavitve zasebnega prostora"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Zasebno, odklenjeno."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Zasebno, zaklenjeno."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Zaklepanje"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Preklapljanje zasebnega prostora"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Nameščanje aplikacij"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Namestitev"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Nameščanje aplikacij v zasebni prostor"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Oblaček z dodatnimi elementi"</string>
</resources>
diff --git a/res/values-sq/strings.xml b/res/values-sq/strings.xml
index 5f379447..84484e8 100644
--- a/res/values-sq/strings.xml
+++ b/res/values-sq/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Miniaplikacionet janë të çaktivizuara në modalitetin e sigurt"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Shkurtorja nuk është e disponueshme"</string>
<string name="home_screen" msgid="5629429142036709174">"Ekrani bazë"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Cakto <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> si aplikacionin e parazgjedhur të ekranit bazë te \"Cilësimet\""</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ekrani i ndarë"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informacioni i aplikacionit për %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Cilësimet e përdorimit për \"%1$s\""</string>
<string name="save_app_pair" msgid="5647523853662686243">"Ruaj çiftin e aplikacioneve"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ky çift aplikacionesh nuk mbështetet në këtë pajisje"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Çifti i aplikacioneve nuk ofrohet"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Prek dhe mbaj shtypur një miniaplikacion për ta zhvendosur."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Trokit dy herë dhe mbaje shtypur një miniapliikacion për ta zhvendosur atë ose për të përdorur veprimet e personalizuara."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Opsione të tjera"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Shfaq të gjitha miniapl."</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d i gjerë me %2$d i lartë"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> miniaplikacion"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Sugjerime"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Thelbësoret"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Lajme dhe revista"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Zona jote e qetësisë"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Argëtim"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Rrjetet sociale"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Shëndet dhe fitnes"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Moti"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sugjeruar për ty"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Miniaplikacionet e <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> në të djathtë, kërkimi dhe opsionet në të majtë"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# miniaplikacion}other{# miniaplikacione}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Çinstalo"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info mbi aplikacionin"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Instalo në private"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Çinstalo aplikacionin"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Instalo"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Mos sugjero aplikacion"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Gozhdo parashikimin"</string>
+ <string name="bubble" msgid="3072951361014076670">"Flluskë"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalimi i shkurtoreve"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Lejon një aplikacion të shtojë shkurtore pa ndërhyrjen e përdoruesit."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"lexo cilësimet dhe shkurtoret e ekranit bazë"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> po instalohet, <xliff:g id="PROGRESS">%2$s</xliff:g> i përfunduar"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> po shkarkohet, <xliff:g id="PROGRESS">%2$s</xliff:g> të përfunduara"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> po pret të instalohet"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> është arkivuar. Trokit për të shkarkuar."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> është arkivuar. Trokit për ta shkarkuar dhe restauruar."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Kërkohet përditësimi i aplikacionit"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Aplikacioni për këtë ikonë nuk është përditësuar. Mund ta përditësosh manualisht për të riaktivizuar këtë shkurtore ose hiq ikonën."</string>
<string name="dialog_update" msgid="2178028071796141234">"Përditëso"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Trokit për të konfiguruar ose për të hapur"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Private"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Cilësimet e \"Hapësirës private\""</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Private, e shkyçur."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Private, e kyçur."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Kyç"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Kalimi te \"Hapësira private\""</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Instalo aplikacionet"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Instalo"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Instalo aplikacionet në hapësirën private"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Tejkalimi"</string>
</resources>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 4a71666..64383f2 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Виџети су онемогућени у Безбедном режиму"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Пречица није доступна"</string>
<string name="home_screen" msgid="5629429142036709174">"Почетни екран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Подесите <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> као подразумевану почетну апликацију у Подешавањима"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Подељени екран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Информације о апликацији за: %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Подешавања потрошње за %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Сачувај пар апликација"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Овај пар апликација није подржан на овом уређају"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Пар апликација није доступан"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Додирните и задржите ради померања виџета."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Двапут додирните и задржите да бисте померали виџет или користите прилагођене радње."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Још опција"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Прикажи све виџете"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d×%2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"ширина од %1$d и висина од %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> виџет"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Додај на почетни екран"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Додали сте виџет <xliff:g id="WIDGET_NAME">%1$s</xliff:g> на почетни екран"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Предлози"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Неопходне апликације"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Основно"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Новости и часописи"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Зона за опуштање"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Забава"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Друштвене мреже"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здравље и фитнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Време"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Предложено за вас"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Виџети <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> са десне стране, претрага и опције са леве стране"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# виџет}one{# виџет}few{# виџета}other{# виџета}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Деинсталирај"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Подаци о апликацији"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Инсталирај на приватни"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Деинсталирајте апликацију"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Инсталирај"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Не предлажи апликацију"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Закачи предвиђање"</string>
+ <string name="bubble" msgid="3072951361014076670">"Облачић"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"инсталирање пречица"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Дозвољава апликацији да додаје пречице без интервенције корисника."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"читање подешавања и пречица на почетном екрану"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> се инсталира, <xliff:g id="PROGRESS">%2$s</xliff:g> готово"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> се преузима, завршено је <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> чека на инсталирање"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Апликација <xliff:g id="NAME">%1$s</xliff:g> је архивирана. Додирните да бисте је преузели."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Апликација <xliff:g id="NAME">%1$s</xliff:g> је архивирана. Додирните да бисте је преузели и вратили."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Треба да ажурирате апликацију"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Апликација за ову икону није ажурирана. Можете да је ручно ажурирате да бисте поново омогућили ову пречицу или уклоните икону."</string>
<string name="dialog_update" msgid="2178028071796141234">"Ажурирај"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Додирните да бисте подесили или отворили"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Приватно"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Подешавања приватног простора"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Приватно, откључано."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Приватно, закључано."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Закључавање"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Пренос приватног простора"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Инсталирајте апликације"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Инсталирајте"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Инсталирај апликације у приватан простор"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Преклопно"</string>
</resources>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index 4dc5365..47aed86 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Widgets är inaktiverade i felsäkert läge"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Genvägen är inte tillgänglig"</string>
<string name="home_screen" msgid="5629429142036709174">"Startskärm"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Ställ in <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> som standardstartskärmsapp i Inställningar"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Delad skärm"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Appinformation för %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Användningsinställningar för %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Spara app-par"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"De här apparna som ska användas tillsammans stöds inte på den här enheten"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"App-paret är inte tillgängligt"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Tryck länge för att flytta en widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Tryck snabbt två gånger och håll kvar för att flytta en widget eller använda anpassade åtgärder."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Fler alternativ"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Visa alla widgetar"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d bred gånger %2$d hög"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widget för <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Förslag"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Viktigt"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Nyheter och tidskrifter"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Koppla av"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Underhållning"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Socialt"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Hälsa och träning"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Väder"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Våra förslag"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Widgetar för <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> till höger, sökning och alternativ till vänster"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widgetar}}"</string>
@@ -61,7 +62,7 @@
<string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"Rensa texten från sökrutan"</string>
<string name="no_widgets_available" msgid="4337693382501046170">"Widgetar och genvägar är inte tillgängliga"</string>
<string name="no_search_results" msgid="3787956167293097509">"Inga widgetar eller genvägar hittades"</string>
- <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Privata"</string>
+ <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Privat"</string>
<string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Arbete"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Konversationer"</string>
<string name="widget_category_note_taking" msgid="3469689394504266039">"Anteckna"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Avinstallera"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Info om appen"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installera i privat"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Avinstallera appen"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installera"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Föreslå inte app"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fäst förslag"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubbla"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installera genvägar"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Tillåter att en app lägger till genvägar utan åtgärd från användaren."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"läsa inställningar och genvägar på startskärmen"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> installeras. <xliff:g id="PROGRESS">%2$s</xliff:g> har slutförts"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> laddas ned, <xliff:g id="PROGRESS">%2$s</xliff:g> klart"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> väntar på installation"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> har arkiverats. Tryck för att ladda ned."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> har arkiverats. Tryck för att ladda ner och återställa."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Du måste uppdatera appen"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Appen för den här ikonen har inte uppdaterats. Du kan uppdatera den manuellt för att återaktivera genvägen eller ta bort ikonen."</string>
<string name="dialog_update" msgid="2178028071796141234">"Uppdatera"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Tryck för att ställa in eller öppna"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Privat"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Inställningar för privat rum"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Privat, olåst."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Privat, låst."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Lås"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Överföring av privat rum"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Installera appar"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Installera"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Installera appar i privat rum"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Fler alternativ"</string>
</resources>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index 7253483..5eadd1d 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Wijeti zimezimwa katika hali ya Usalama"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Hakuna njia ya mkato"</string>
<string name="home_screen" msgid="5629429142036709174">"Skrini ya kwanza"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Weka <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> iwe programu chaguomsingi ya mwanzo kwenye Mipangilio"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Gawa skrini"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Maelezo ya programu ya %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Mipangilio ya matumizi ya %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Hifadhi jozi ya programu"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Jozi hii ya programu haitumiki kwenye kifaa hiki"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Kipengele cha jozi ya programu hakipatikani"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Gusa na ushikilie ili usogeze wijeti."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Gusa mara mbili na ushikilie ili usogeze wijeti au utumie vitendo maalum."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Chaguo zaidi"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Onyesha wijeti zote"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Upana wa %1$d na kimo cha %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Wijeti ya <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"Weka kwenye skrini ya kwanza"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Umeongeza wijeti ya <xliff:g id="WIDGET_NAME">%1$s</xliff:g> kwenye skrini ya kwanza"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Mapendekezo"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Essentials"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Vya msingi"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Habari na magazeti"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Mahali Pako pa Kupumzika"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Burudani"</string>
- <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Mitandao jamii"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Afya na siha"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Hali ya Hewa"</string>
+ <string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Mitandao ya kijamii"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Unayopendekezewa"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Wijeti za <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ziko upande wa kulia, utafutaji na chaguo ziko upande wa kushoto"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{Wijeti #}other{Wijeti #}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Ondoa"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Maelezo ya programu"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Sakinisha faraghani"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Ondoa programu"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Sakinisha"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Isipendekeze programu"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Bandika Utabiri"</string>
+ <string name="bubble" msgid="3072951361014076670">"Kiputo"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"kuweka njia za mkato"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Huruhusu programu kuongeza njia za mkato bila mtumiaji kuingilia kati."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"kusoma mipangilio ya skrini ya kwanza na njia za mkato"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Inasakinisha <xliff:g id="NAME">%1$s</xliff:g>, imekamilika <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> inapakuliwa, <xliff:g id="PROGRESS">%2$s</xliff:g> imekamilika"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> inasubiri kusakinisha"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> imewekwa kwenye kumbukumbu. Gusa ili uipakue."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> imewekwa kwenye kumbukumbu. Gusa ili upakue na urejeshe."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Unahitaji kusasisha programu"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Programu ya aikoni hii haijasasishwa. Unaweza kusasisha mwenyewe ili uruhusu upya njia hii ya mkato au uondoe aikoni."</string>
<string name="dialog_update" msgid="2178028071796141234">"Sasisha"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Kichujio"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Hitilafu: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Nafasi ya faragha"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Gusa ili uweke mipangilio au ufungue"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Gusa uweke mipangilio au ufungue"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Faragha"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Mipangilio ya Nafasi ya Faragha"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Ya faragha, imefunguliwa."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Ya faragha, imefungwa."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Funga"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Mabadiliko ya Nafasi ya Faragha"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Sakinisha programu"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Weka"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Sakinisha programu kwenye Sehemu ya Faragha"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Menyu ya vipengee vya ziada"</string>
</resources>
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index ebef2b4..d84485a 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"பாதுகாப்புப் பயன்முறையில் விட்ஜெட்கள் முடக்கப்பட்டுள்ளன"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ஷார்ட்கட் இல்லை"</string>
<string name="home_screen" msgid="5629429142036709174">"முகப்பு"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"அமைப்புகளில் <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> என்பதை இயல்பு முகப்பு ஆப்ஸாக அமையுங்கள்"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"திரைப் பிரிப்பு"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$sக்கான ஆப்ஸ் தகவல்கள்"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$sக்கான உபயோக அமைப்புகள்"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ஆப்ஸ் ஜோடியைச் சேமி"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"இந்தச் சாதனத்தில் இந்த ஆப்ஸ் ஜோடி ஆதரிக்கப்படவில்லை"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ஆப்ஸ் ஜோடி கிடைக்கவில்லை"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"விட்ஜெட்டை நகர்த்தத் தொட்டுப் பிடிக்கவும்."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"விட்ஜெட்டை நகர்த்த இருமுறை தட்டிப் பிடிக்கவும் அல்லது பிரத்தியேகச் செயல்களைப் பயன்படுத்தவும்."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"கூடுதல் விருப்பங்கள்"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"விட்ஜெட்டுகளைக் காட்டு"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d அகலத்திற்கு %2$d உயரம்"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> விட்ஜெட்"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"பரிந்துரைகள்"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"அத்தியாவசியமானவை"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"செய்திகள் & பத்திரிக்கைகள்"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"உங்கள் மனதுக்கு இதமானவை"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"பொழுதுபோக்கு"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"சமூகம்"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ஆரோக்கியம் & உடற்பயிற்சி"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"வானிலை"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"உங்களுக்கான பரிந்துரைகள்"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> விட்ஜெட்கள் வலதுபுறத்தில் உள்ளன, தேடல் மற்றும் விருப்பங்கள் இடதுபுறத்தில் உள்ளன"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# விட்ஜெட்}other{# விட்ஜெட்டுகள்}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"நிறுவல் நீக்கு"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ஆப்ஸ் தகவல்"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"தனிப்பட்டதில் நிறுவு"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ஆப்ஸை நிறுவல் நீக்கு"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"நிறுவு"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"பரிந்துரைக்காதே"</string>
- <string name="pin_prediction" msgid="4196423321649756498">"கணிக்கப்பட்ட ஆப்ஸைப் பின் செய்தல்"</string>
+ <string name="pin_prediction" msgid="4196423321649756498">"கணிக்கப்பட்டதைப் பின் செய்"</string>
+ <string name="bubble" msgid="3072951361014076670">"குமிழ்"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"குறுக்குவழிகளை நிறுவுதல்"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"பயனரின் அனுமதி இல்லாமல் குறுக்குவழிகளைச் சேர்க்கப் ஆப்ஸை அனுமதிக்கிறது."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"முகப்புத் திரையின் அமைப்புகளையும் ஷார்ட்கட்களையும் படித்தல்"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> நிறுவப்படுகிறது, <xliff:g id="PROGRESS">%2$s</xliff:g> முடிந்தது"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g>ஐப் பதிவிறக்குகிறது, <xliff:g id="PROGRESS">%2$s</xliff:g> முடிந்தது"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g>ஐ நிறுவுவதற்காகக் காத்திருக்கிறது"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> காப்பிடப்பட்டுள்ளது. பதிவிறக்க தட்டுங்கள்."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> காப்பிடப்பட்டுள்ளது. அதைப் பதிவிறக்கி மீட்டெடுக்க தட்டுங்கள்."</string>
<string name="dialog_update_title" msgid="114234265740994042">"ஆப்ஸைப் புதுப்பியுங்கள்"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"இந்த ஐகானுக்கான ஆப்ஸ் புதுப்பிக்கப்படவில்லை. இந்த ஷார்ட்கட்டை மீண்டும் இயக்கவோ ஐகானை அகற்றவோ நீங்களாகவே புதுப்பிக்கலாம்."</string>
<string name="dialog_update" msgid="2178028071796141234">"புதுப்பி"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"அமைக்கவோ திறக்கவோ தட்டுங்கள்"</string>
<string name="ps_container_title" msgid="4391796149519594205">"தனிப்பட்டது"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"தனிப்பட்ட சேமிப்பிட அமைப்புகள்"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"தனிப்பட்டது, அன்லாக் செய்யப்பட்டுள்ளது."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"தனிப்பட்டது, லாக் செய்யப்பட்டுள்ளது."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"பூட்டு"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"தனிப்பட்ட சேமிப்பிடத்திற்கு மாற்றுகிறது"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ஆப்ஸை நிறுவுதல்"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"நிறுவுக"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"தனிப்பட்ட சேமிப்பிடத்தில் ஆப்ஸை நிறுவும்"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"கூடுதல் விருப்பங்களைக் காட்டும்"</string>
</resources>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 3c41daa..8487e96 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"సురక్షిత మోడ్లో విడ్జెట్లు నిలిపివేయబడ్డాయి"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"షార్ట్కట్ అందుబాటులో లేదు"</string>
<string name="home_screen" msgid="5629429142036709174">"మొదటి ట్యాబ్"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"సెట్టింగ్లలో <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>ను ఆటోమేటిక్ సెట్టింగ్ మొదటి స్క్రీన్ యాప్గా సెట్ చేయండి"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"స్ప్లిట్ స్క్రీన్"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s కోసం యాప్ సమాచారం"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$sకు సంబంధించిన వినియోగ సెట్టింగ్లు"</string>
<string name="save_app_pair" msgid="5647523853662686243">"యాప్ పెయిర్ను సేవ్ చేయండి"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ఈ పరికరంలో ఈ యాప్ పెయిర్ సపోర్ట్ చేయదు"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"యాప్ పెయిర్ అందుబాటులో లేదు"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"విడ్జెట్ను తరలించడానికి తాకి & నొక్కి ఉంచండి."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"విడ్జెట్ను తరలించడానికి లేదా అనుకూల చర్యలను ఉపయోగించడానికి రెండుసార్లు నొక్కండి & హోల్డ్ చేయి."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"మరిన్ని ఆప్షన్లు"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"అన్ని విడ్జెట్లను చూడండి"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d వెడల్పు X %2$d ఎత్తు"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> విడ్జెట్"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"సూచనలు"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"నిత్యావసరాలు"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"వార్తలు & మ్యాగజైన్లు"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"మీరు ప్రశాంతంగా ఉండే ప్రదేశం"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"వినోదం"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"సామాజికం"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"ఆరోగ్యం & ఫిట్నెస్"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"వాతావరణం"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"మీ కోసం సూచించినవి"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"కుడి వైపున <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> విడ్జెట్లు, ఎడమ వైపున సెర్చ్, ఇతర ఆప్షన్లు"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# విడ్జెట్}other{# విడ్జెట్లు}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"అన్ఇన్స్టాల్ చేయండి"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"యాప్ సమాచారం"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ప్రైవేట్ ఇన్స్టాల్"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"యాప్ను అన్ఇన్స్టాల్ చేయండి"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ఇన్స్టాల్ చేయండి"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"యాప్ సూచించకు"</string>
<string name="pin_prediction" msgid="4196423321649756498">"సూచనను పిన్ చేయండి"</string>
+ <string name="bubble" msgid="3072951361014076670">"బబుల్"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"షార్ట్కట్లను ఇన్స్టాల్ చేయడం"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"వినియోగదారు ప్రమేయం లేకుండా షార్ట్కట్లను జోడించడానికి యాప్ను అనుమతిస్తుంది."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"హోమ్ సెట్టింగ్లు, షార్ట్కట్లను చదవండి"</string>
@@ -126,7 +129,7 @@
<string name="title_missing_notification_access" msgid="7503287056163941064">"నోటిఫికేషన్ యాక్సెస్ అవసరం"</string>
<string name="msg_missing_notification_access" msgid="281113995110910548">"నోటిఫికేషన్ డాట్లను చూపించడానికి <xliff:g id="NAME">%1$s</xliff:g>కు యాప్ నోటిఫికేషన్లను ఆన్ చేయండి"</string>
<string name="title_change_settings" msgid="1376365968844349552">"సెట్టింగ్లను మార్చు"</string>
- <string name="notification_dots_service_title" msgid="4284221181793592871">"నోటిఫికేషన్ డాట్లను చూపు"</string>
+ <string name="notification_dots_service_title" msgid="4284221181793592871">"నోటిఫికేషన్ డాట్లను చూపండి"</string>
<string name="developer_options_title" msgid="700788437593726194">"డెవలపర్ ఆప్షన్లు"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"యాప్ చిహ్నాలను మొదటి స్క్రీన్కు జోడించండి"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"కొత్త యాప్ల కోసం"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g>ను ఇన్స్టాల్ చేయడం, <xliff:g id="PROGRESS">%2$s</xliff:g> పూర్తయింది"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> డౌన్లోడ్ అవుతోంది, <xliff:g id="PROGRESS">%2$s</xliff:g> పూర్తయింది"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ఇన్స్టాల్ కావడానికి వేచి ఉంది"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> ఆర్కైవ్ చేయబడింది. డౌన్లోడ్ చేయడానికి ట్యాప్ చేయండి."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> ఆర్కైవ్ చేయబడింది. డౌన్లోడ్ చేయడానికి, రీస్టోర్ చేయడానికి ట్యాప్ చేయండి."</string>
<string name="dialog_update_title" msgid="114234265740994042">"యాప్ను అప్డేట్ చేయడం అవసరం"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"ఈ చిహ్నం కోసం యాప్ అప్డేట్ చేయబడలేదు. మీరు ఈ షార్ట్కట్ను మళ్లీ ఎనేబుల్ చేయడానికి మాన్యువల్గా అప్డేట్ చేయవచ్చు లేదా చిహ్నాన్ని తీసివేయవచ్చు."</string>
<string name="dialog_update" msgid="2178028071796141234">"అప్డేట్ చేయండి"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"సెటప్ చేయడానికి లేదా తెరవడానికి ట్యాప్ చేయండి"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ప్రైవేట్"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"ప్రైవేట్ స్పేస్ సెట్టింగ్లు"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ప్రైవేట్, అన్లాక్ చేయబడింది."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ప్రైవేట్, లాక్ చేయబడింది."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"లాక్ చేయండి"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"ప్రైవేట్ స్పేస్ కేటాయించడం జరుగుతుంది"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"యాప్లను ఇన్స్టాల్ చేయండి"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ఇన్స్టాల్ చేయండి"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ప్రైవేట్ స్పేస్కు యాప్లను ఇన్స్టాల్ చేయండి"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"ఓవర్ఫ్లో"</string>
</resources>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index 880a58e..71f4d15 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"มีการปิดใช้งานวิดเจ็ตในเซฟโหมด"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ทางลัดไม่พร้อมใช้งาน"</string>
<string name="home_screen" msgid="5629429142036709174">"หน้าแรก"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ตั้ง <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> เป็นแอปหน้าแรกเริ่มต้นในการตั้งค่า"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"แยกหน้าจอ"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"ข้อมูลแอปสำหรับ %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"การตั้งค่าการใช้งานสำหรับ %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"บันทึกคู่แอป"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ไม่รองรับคู่แอปนี้ในอุปกรณ์เครื่องนี้"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"การจับคู่อุปกรณ์ไม่พร้อมให้บริการ"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"แตะค้างไว้เพื่อย้ายวิดเจ็ต"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"แตะสองครั้งค้างไว้เพื่อย้ายวิดเจ็ตหรือใช้การดำเนินการที่กำหนดเอง"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"ตัวเลือกเพิ่มเติม"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"แสดงวิดเจ็ตทั้งหมด"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"กว้าง %1$d x สูง %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"วิดเจ็ต <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"คำแนะนำ"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"รายการที่ห้ามพลาด"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"ข่าวสารและนิตยสาร"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"พื้นที่สบายๆ ของคุณ"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"ความบันเทิง"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"โซเชียล"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"สุขภาพและการออกกำลังกาย"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"สภาพอากาศ"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"แนะนำให้คุณ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"วิดเจ็ต<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>ทางด้านขวา การค้นหาและตัวเลือกทางด้านซ้าย"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{วิดเจ็ต # รายการ}other{วิดเจ็ต # รายการ}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"นำออก"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ถอนการติดตั้ง"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ข้อมูลแอป"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ติดตั้งในส่วนตัว"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"ติดตั้งในแบบส่วนตัว"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ถอนการติดตั้งแอป"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ติดตั้ง"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ไม่ต้องแนะนำแอป"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ปักหมุดแอปที่คาดการณ์ไว้"</string>
+ <string name="bubble" msgid="3072951361014076670">"บับเบิล"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ติดตั้งทางลัด"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"อนุญาตให้แอปเพิ่มทางลัดโดยไม่ต้องให้ผู้ใช้จัดการ"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"อ่านการตั้งค่าและทางลัดในหน้าแรก"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"กำลังติดตั้ง <xliff:g id="NAME">%1$s</xliff:g> เสร็จแล้ว <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"กำลังดาวน์โหลด <xliff:g id="NAME">%1$s</xliff:g> เสร็จแล้ว <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> กำลังรอติดตั้ง"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"เก็บถาวร <xliff:g id="NAME">%1$s</xliff:g> แล้ว แตะเพื่อดาวน์โหลด"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"เก็บถาวร <xliff:g id="NAME">%1$s</xliff:g> แล้ว แตะเพื่อดาวน์โหลดและกู้คืน"</string>
<string name="dialog_update_title" msgid="114234265740994042">"ต้องอัปเดตแอป"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"แอปสำหรับไอคอนนี้ยังไม่ได้อัปเดต คุณอัปเดตด้วยตนเองได้โดยเปิดใช้ทางลัดนี้อีกครั้งหรือนำไอคอนออก"</string>
<string name="dialog_update" msgid="2178028071796141234">"อัปเดต"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"แตะเพื่อตั้งค่าหรือเปิด"</string>
<string name="ps_container_title" msgid="4391796149519594205">"ส่วนตัว"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"การตั้งค่าพื้นที่ส่วนตัว"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"ส่วนตัว ปลดล็อกอยู่"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"ส่วนตัว ล็อกอยู่"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"ล็อก"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"การเปลี่ยนไปใช้พื้นที่ส่วนตัว"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ติดตั้งแอป"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"ติดตั้ง"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"ติดตั้งแอปไปยังพื้นที่ส่วนตัว"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"การดำเนินการเพิ่มเติม"</string>
</resources>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index 4ae6ee9..7cf6a44 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Naka-disable ang mga widget sa Safe mode"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Hindi available ang shortcut"</string>
<string name="home_screen" msgid="5629429142036709174">"Home"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Itakda ang <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> bilang default na home app sa Mga Setting"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Split screen"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Impormasyon ng app para sa %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Mga setting ng paggamit para sa %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"I-save ang app pair"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Hindi sinusuportahan sa device na ito ang pares ng app na ito"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Hindi available ang pares ng app"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Pindutin nang matagal para ilipat ang widget."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"I-double tap at pindutin nang matagal para ilipat ang widget o gumamit ng mga custom na pagkilos."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Higit pang opsyon"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Ipakita lahat ng widget"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ang lapad at %2$d ang taas"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Mga Suhestyon"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Mga essential"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Balita at mga magazine"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Ang Iyong Chill Zone"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Entertainment"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Social"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Kalusugan at fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Lagay ng panahon"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Iminumungkahi para sa iyo"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Mga widget ng <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> sa kanan, paghahanap at mga opsyon sa kaliwa"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}one{# widget}other{# na widget}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"I-uninstall"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Impormasyon ng app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Pribadong i-install"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"I-uninstall ang app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"I-install"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Huwag magmungkahi ng app"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Huwag magmungkahi"</string>
<string name="pin_prediction" msgid="4196423321649756498">"I-pin ang Hula"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bubble"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"i-install ang mga shortcut"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Pinapayagan ang isang app na magdagdag ng mga shortcut nang walang panghihimasok ng user."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"basahin ang mga setting at shortcut ng home"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Ini-install ang <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> kumpleto"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Dina-download na ang <xliff:g id="NAME">%1$s</xliff:g>, tapos na ang <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Hinihintay nang mag-install ang <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Naka-archive ang <xliff:g id="NAME">%1$s</xliff:g>. I-tap para i-download."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Naka-archive ang <xliff:g id="NAME">%1$s</xliff:g>. I-tap para i-download at i-restore."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Kinakailangang i-update ang app"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Hindi updated ang app para sa icon na ito. Puwede kang manual na mag-update para ma-enable ulit ang shortcut na ito, o alisin ang icon."</string>
<string name="dialog_update" msgid="2178028071796141234">"I-update"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"I-tap para i-set up o buksan"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Pribado"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Mga Setting ng Pribadong Space"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Pribado, naka-unlock."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Pribado, naka-lock."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"I-lock"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Pag-transition ng Pribadong Space"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Mag-install ng mga app"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"I-install"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Mag-install ng mga app sa Pribadong Space"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Overflow"</string>
</resources>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index d526fc8..d55181c 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Güvenli modda widget\'lar devre dışı"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Kısayol kullanılamıyor"</string>
<string name="home_screen" msgid="5629429142036709174">"Ana ekran"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> başlatıcısını Ayarlar\'da varsayılan ana ekran uygulaması olarak ayarlayın"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Bölünmüş ekran"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s uygulama bilgileri"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s ile ilgili kullanım ayarları"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Uygulama çiftini kaydedin"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Bu uygulama çifti bu cihazda desteklenmiyor"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Uygulama çifti kullanılamıyor"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Widget\'ı taşımak için dokunup basılı tutun."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Widget\'ı taşımak veya özel işlemleri kullanmak için iki kez dokunup basılı tutun."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Diğer seçenekler"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Tüm widget\'ları göster"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"genişlik: %1$d, yükseklik: %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> widget\'ı"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Öneriler"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Önemliler"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Haberler ve dergiler"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Huzur alanınız"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Eğlence"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Sosyal"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sağlık ve fitness"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Hava durumu"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sizin için önerilenler"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> widget\'ları sağda, arama ve seçenekler solda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}other{# widget}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"Sil"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Kaldır"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Uygulama bilgileri"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Özel olarak yükleyin"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Özel olarak yükle"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Uygulamayı kaldır"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Yükle"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Uygulama önerme"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Uygulamayı önerme"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Tahmini Sabitle"</string>
+ <string name="bubble" msgid="3072951361014076670">"Balon"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"kısayolları yükle"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Uygulamaya, kullanıcı müdahalesi olmadan kısayol ekleme izni verir."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ana ekran ayarlarını ve kısayollarını oku"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> yükleniyor, <xliff:g id="PROGRESS">%2$s</xliff:g> tamamlandı"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> indiriliyor, <xliff:g id="PROGRESS">%2$s</xliff:g> tamamlandı"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> uygulaması yüklenmek için bekliyor"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> arşivlendi. İndirmek için dokunun."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> arşivlendi. İndirip geri yüklemek için dokunun."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Uygulama güncellemesi gerekli"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Bu simgenin uygulaması güncellenmemiş. Simgeyi kaldırabilir ya da uygulamayı manuel olarak güncelleyerek bu kısayolu yeniden etkinleştirebilirsiniz."</string>
<string name="dialog_update" msgid="2178028071796141234">"Güncelle"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Kurmak veya açmak için dokunun"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Gizli"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Gizli Alan Ayarları"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Gizli, kilidi açık."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Gizli, kilitli."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Kilit"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Gizli Alana Geçiş"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Uygulamaları yükleme"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Yükle"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Uygulamaları özel alana yükleyin"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Taşma"</string>
</resources>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index a81ce31..b5c1c70 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"У безпечному режимі віджети вимкнено"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Ярлик недоступний"</string>
<string name="home_screen" msgid="5629429142036709174">"Головний екран"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Зробити <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> додатком головного екрана за умовчанням у налаштуваннях"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Розділити екран"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Інформація про додаток для %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Параметри використання (%1$s)"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Зберегти пару додатків"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Ці два додатки не можна одночасно використовувати на цьому пристрої"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Одночасне використання двох додатків недоступне"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Натисніть і втримуйте, щоб перемістити віджет."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Двічі натисніть і втримуйте віджет, щоб перемістити його або виконати інші дії."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Інші опції"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Показати всі віджети"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Ширина – %1$d, висота – %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Віджет <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Пропозиції"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Основне"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Новини й журнали"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Ваша зона розваг"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Розваги"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Соціальні мережі"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Здоров’я і фітнес"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Погода"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Пропозиції для вас"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>: віджети праворуч, пошук і опції ліворуч"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# віджет}one{# віджет}few{# віджети}many{# віджетів}other{# віджета}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Видалити додаток"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Про додаток"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Установити приватно"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Видалити додаток"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Установити"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Не пропонувати додаток"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Закріпити передбачений додаток"</string>
+ <string name="bubble" msgid="3072951361014076670">"Повідомлення"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"створення ярликів"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Дозволяє програмі самостійно додавати ярлики."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"читати налаштування та ярлики головного екрана"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> встановлюється, виконано <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> завантажується, <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> очікує на завантаження"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Додаток <xliff:g id="NAME">%1$s</xliff:g> заархівовано. Натисніть, щоб завантажити."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Додаток <xliff:g id="NAME">%1$s</xliff:g> заархівовано. Натисніть, щоб завантажити й відновити."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Потрібно оновити додаток"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Додаток для цього значка не оновлено. Ви можете оновити його вручну, щоб знову ввімкнути цю швидку команду, або можете вилучити значок."</string>
<string name="dialog_update" msgid="2178028071796141234">"Оновити"</string>
@@ -186,16 +189,13 @@
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Фільтр"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Не вдалося <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Приватний простір"</string>
- <string name="private_space_secondary_label" msgid="9203933341714508907">"Натисніть, щоб налаштувати або відкрити"</string>
+ <string name="private_space_secondary_label" msgid="9203933341714508907">"Натисніть, щоб налаштувати чи відкрити"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Приватні"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Налаштування приватного простору"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Приватний простір, розблоковано."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Приватний простір, заблоковано."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Заблокувати"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Перехід у приватний простір"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Установити додатки"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Установити"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Установити додатки в особистому просторі"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Додаткове меню"</string>
</resources>
diff --git a/res/values-ur/strings.xml b/res/values-ur/strings.xml
index 7c73cab..6fa76dd 100644
--- a/res/values-ur/strings.xml
+++ b/res/values-ur/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"ویجیٹس کو محفوظ وضع میں غیر فعال کر دیا گیا"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"شارٹ کٹ دستیاب نہیں ہے"</string>
<string name="home_screen" msgid="5629429142036709174">"ہوم"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"ترتیبات میں <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> کو بطور ڈیفالٹ ہوم ایپ سیٹ کریں"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"اسپلٹ اسکرین"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s کے لیے ایپ کی معلومات"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s کیلئے استعمال کی ترتیبات"</string>
<string name="save_app_pair" msgid="5647523853662686243">"ایپس کے جوڑے کو محفوظ کریں"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"ایپس کا یہ جوڑا اس آلے پر تعاون یافتہ نہیں ہے"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"ایپ کا جوڑا دستیاب نہیں ہے"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"ویجیٹ منتقل کرنے کے لیے ٹچ کریں اور پکڑ کر رکھیں۔"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"ویجیٹ کو منتقل کرنے یا حسب ضرورت کارروائیاں استعمال کرنے کے لیے دوبار تھپتھپائیں اور پکڑ کر رکھیں۔"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"مزید اختیارات"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"سبھی ویجیٹس دکھائیں"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d چوڑا اور %2$d اونچا"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ویجیٹ"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"تجاویز"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"لوازمات"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"خبریں اور میگزینز"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"آپ کا آرام دہ زون"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"تفریح"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"سماجی"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"صحت اور تندرستی"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"موسم"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"آپ کے لیے تجویز کردہ"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> دائیں طرف وجیٹس، بائیں طرف تلاش اور اختیارات"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ویجیٹ}other{# ویجیٹس}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"اَن انسٹال کریں"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ایپ کی معلومات"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"پرائیویٹ میں انسٹال کریں"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"ایپ کو اَن انسٹال کریں"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"انسٹال کریں"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"ایپ تجویز نہ کریں"</string>
<string name="pin_prediction" msgid="4196423321649756498">"پیشگوئی پن کریں"</string>
+ <string name="bubble" msgid="3072951361014076670">"بلبلہ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"شارٹ کٹس انسٹال کریں"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"کسی ایپ کو صارف کی مداخلت کے بغیر شارٹ کٹس شامل کرنے کی اجازت دیتا ہے۔"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"ہوم ترتیبات اور شارٹ کٹس کو پڑھیں"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> انسٹال کی جا رہی ہے، <xliff:g id="PROGRESS">%2$s</xliff:g> مکمل ہو گئی"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> ڈاؤن لوڈ ہو رہا ہے، <xliff:g id="PROGRESS">%2$s</xliff:g> مکمل ہو گیا"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> انسٹال ہونے کا انتظار کر رہی ہے"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> کو آرکائیو کر لیا گیا ہے۔ ڈاؤن لوڈ کرنے کیلئے تھپتھپائیں۔"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> کو آرکائیو کر لیا گیا ہے۔ ڈاؤن لوڈ اور بحال کرنے کیلئے تھپتھپائیں۔"</string>
<string name="dialog_update_title" msgid="114234265740994042">"ایپ کی اپ ڈیٹ درکار ہے"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"اس آئیکن کیلئے ایپ کو اپ ڈیٹ نہیں کیا گیا ہے۔ آپ اس شارٹ کٹ کو دوبارہ فعال کرنے کے لیے دستی طور پر اپ ڈیٹ کر سکتے ہیں، یا آئیکن کو ہٹا سکتے ہیں۔"</string>
<string name="dialog_update" msgid="2178028071796141234">"اپ ڈیٹ کریں"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"سیٹ اپ کرنے یا کھولنے کے لیے تھپتھپائیں"</string>
<string name="ps_container_title" msgid="4391796149519594205">"نجی"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"نجی اسپیس کی ترتیبات"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"نجی اسپیس غیر مقفل ہے۔"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"نجی اسپیس مقفل ہے۔"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"مقفل کریں"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"نجی اسپیس کی منتقلی"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"ایپس انسٹال کریں"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"انسٹال کریں"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"پرائیویٹ اسپیس میں ایپس انسٹال کریں"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"اوورفلو"</string>
</resources>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 0ee989e..21a8145 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Xavfsiz rejimda vidjetlar o‘chirib qo‘yilgan"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Tezkor tugmadan foydalanib bo‘lmaydi"</string>
<string name="home_screen" msgid="5629429142036709174">"Bosh ekran"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Sozlamalar orqali <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> ilovasini birlamchi bosh ekran ilovasi sifatida belgilash"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ekranni ikkiga ajratish"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s ilovasi axboroti"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s uchun sarf sozlamalari"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Ilova juftini saqlash"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Bu ilova jufti ushbu qurilmada ishlamaydi"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Ikkita ilovadan bir vaqtda foydalanish mumkin emas"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Vidjetni bosib turgan holatda suring."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Ikki marta bosib va bosib turgan holatda vidjetni tanlang yoki maxsus amaldan foydalaning."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Yana"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Barcha vidjetlar"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Eni %1$d, bo‘yi %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ta vidjet"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Takliflar"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Asosiy ilovalar"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Yangiliklar va jurnallar"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Sokin hududingiz"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Hordiq"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Ijtimoiy"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Salomatlik va sport"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Ob-havo"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Sizga tavsiya etiladi"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"<xliff:g id="SELECTED_HEADER">%1$s</xliff:g> vidjetlari oʻngda, qidiruv va sozlamalar chapda"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# ta vidjet}other{# ta vidjet}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"O‘chirib tashlash"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Ilova haqida"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Maxfiy oʻrnatish"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Ilovani oʻchirish"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"O‘rnatish"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Tavsiya qilinmasin"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Tavsiyani mahkamlash"</string>
+ <string name="bubble" msgid="3072951361014076670">"Pufaklar"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"yorliqlar yaratish"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Ilovalarga foydalanuvchidan so‘ramasdan yorliqlar qo‘shishga ruxsat beradi."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"Bosh ekrandagi sozlamalar va yorliqlarni koʻrish"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> oʻrnatlmoqda, <xliff:g id="PROGRESS">%2$s</xliff:g> yakunlandi"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> yuklab olinmoqda, <xliff:g id="PROGRESS">%2$s</xliff:g> bajarildi"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ilovasi o‘rnatilishi kutilmoqda"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"<xliff:g id="NAME">%1$s</xliff:g> arxivlangan. Yuklab olish uchun bosing."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> arxivlangan. Yuklab olish va tiklash uchun bosing."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Ilovani yangilash zarur"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Bu belgi uchun ilova yangilanmagan. Ushbu yorliqni qayta yoqish uchun oddiy usulda yangilashingiz yoki belgini olib tashlashingiz mumkin."</string>
<string name="dialog_update" msgid="2178028071796141234">"Yangilash"</string>
@@ -187,15 +190,12 @@
<string name="remote_action_failed" msgid="1383965239183576790">"Xato: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
<string name="private_space_label" msgid="2359721649407947001">"Shaxsiy xona"</string>
<string name="private_space_secondary_label" msgid="9203933341714508907">"Sozlash yoki ochish uchun bosing"</string>
- <string name="ps_container_title" msgid="4391796149519594205">"Yopiq"</string>
+ <string name="ps_container_title" msgid="4391796149519594205">"Maxfiy"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Shaxsiy xona sozlamalari"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Shaxsiy, ochildi."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Shaxsiy, qulflandi."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Qulflash"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Maxfiy joyga almashtirish"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Ilovalar oʻrnatish"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Oʻrnatish"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Ilovalarni Maxfiy makonga oʻrnatish"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Kengaytirish"</string>
</resources>
diff --git a/res/values-v30/styles.xml b/res/values-v30/styles.xml
index ec5c113..a5c57c8 100644
--- a/res/values-v30/styles.xml
+++ b/res/values-v30/styles.xml
@@ -29,5 +29,6 @@
<item name="android:windowLayoutInDisplayCutoutMode">always</item>
<item name="android:enforceStatusBarContrast">false</item>
<item name="android:enforceNavigationBarContrast">false</item>
+ <item name="materialColorOnPrimaryFixed">#FFFFFFFF</item>
</style>
</resources>
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index fa87221..a5cdfc7 100644
--- a/res/values-v31/colors.xml
+++ b/res/values-v31/colors.xml
@@ -75,6 +75,8 @@
<color name="widget_picker_title_color_light">
@android:color/system_neutral1_900</color>
+ <color name="widget_picker_description_color_light">
+ @android:color/system_neutral2_700</color>
<color name="widget_picker_header_app_title_color_light">
@android:color/system_neutral1_900</color>
<color name="widget_picker_header_app_subtitle_color_light">
@@ -109,38 +111,5 @@
<color name="overview_foreground_scrim_color">@android:color/system_neutral1_1000</color>
- <color name="material_color_on_secondary_fixed_variant">@android:color/system_accent2_700</color>
- <color name="material_color_on_tertiary_fixed_variant">@android:color/system_accent3_700</color>
- <color name="material_color_on_primary_fixed_variant">@android:color/system_accent1_700</color>
- <color name="material_color_on_secondary_container">@android:color/system_accent2_900</color>
- <color name="material_color_on_tertiary_container">@android:color/system_accent3_900</color>
- <color name="material_color_on_primary_container">@android:color/system_accent1_900</color>
- <color name="material_color_secondary_fixed_dim">@android:color/system_accent2_200</color>
- <color name="material_color_on_error_container">#410000</color>
- <color name="material_color_on_secondary_fixed">@android:color/system_accent2_900</color>
- <color name="material_color_on_surface_inverse">@android:color/system_neutral1_100</color>
- <color name="material_color_tertiary_fixed_dim">@android:color/system_accent3_200</color>
- <color name="material_color_on_tertiary_fixed">@android:color/system_accent3_900</color>
- <color name="material_color_primary_fixed_dim">@android:color/system_accent1_200</color>
- <color name="material_color_secondary_container">@android:color/system_accent2_100</color>
- <color name="material_color_error_container">#FFDAD5</color>
- <color name="material_color_on_primary_fixed">@android:color/system_accent1_900</color>
- <color name="material_color_primary_inverse">@android:color/system_accent1_200</color>
- <color name="material_color_secondary_fixed">@android:color/system_accent2_100</color>
- <color name="material_color_tertiary_container">@android:color/system_accent3_100</color>
- <color name="material_color_tertiary_fixed">@android:color/system_accent3_100</color>
- <color name="material_color_primary_container">@android:color/system_accent1_100</color>
- <color name="material_color_on_background">@android:color/system_neutral1_50</color>
- <color name="material_color_primary_fixed">@android:color/system_accent1_100</color>
- <color name="material_color_on_secondary">@android:color/system_accent2_0</color>
- <color name="material_color_on_tertiary">@android:color/system_accent3_0</color>
- <color name="material_color_on_error">#FFFFFF</color>
- <color name="material_color_on_surface_variant">@android:color/system_neutral2_700</color>
- <color name="material_color_outline">@android:color/system_neutral2_500</color>
- <color name="material_color_outline_variant">@android:color/system_neutral2_200</color>
- <color name="material_color_on_primary">@android:color/system_accent1_0</color>
<color name="material_color_on_surface">@android:color/system_neutral1_900</color>
- <color name="material_color_primary">@android:color/system_accent1_600</color>
- <color name="material_color_secondary">@android:color/system_accent2_600</color>
- <color name="material_color_tertiary">@android:color/system_accent3_600</color>
</resources>
diff --git a/res/values-v33/style.xml b/res/values-v33/style.xml
deleted file mode 100644
index 1261b23..0000000
--- a/res/values-v33/style.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-* Copyright (C) 2022 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
--->
-
-<resources>
- <style name="HomeSettings.Theme" parent="@android:style/Theme.DeviceDefault.Settings">
- <item name="android:listPreferredItemPaddingEnd">16dp</item>
- <item name="android:listPreferredItemPaddingStart">24dp</item>
- <item name="android:navigationBarColor">@android:color/transparent</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:switchStyle">@style/SwitchStyle</item>
- <item name="android:textAppearanceListItem">@style/HomeSettings.PreferenceTitle</item>
- <item name="android:windowActionBar">false</item>
- <item name="android:windowNoTitle">true</item>
- <item name="preferenceTheme">@style/HomeSettings.PreferenceTheme</item>
- <item name="android:windowAnimationStyle">@style/Animation.SharedBackground</item>
- </style>
-
- <style name="Animation.SharedBackground" parent="@android:style/Animation.Activity">
- <item name="android:activityOpenEnterAnimation">@anim/shared_x_axis_activity_open_enter</item>
- <item name="android:activityOpenExitAnimation">@anim/shared_x_axis_activity_open_exit</item>
- <item name="android:activityCloseEnterAnimation">@anim/shared_x_axis_activity_close_enter</item>
- <item name="android:activityCloseExitAnimation">@anim/shared_x_axis_activity_close_exit</item>
- </style>
-</resources>
\ No newline at end of file
diff --git a/res/values-v34/colors.xml b/res/values-v34/colors.xml
new file mode 100644
index 0000000..4f3a769
--- /dev/null
+++ b/res/values-v34/colors.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2024, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <color name="widget_picker_secondary_surface_color_light">
+ @android:color/system_surface_bright_light</color>
+ <color name="widget_picker_header_app_title_color_light">
+ @android:color/system_on_surface_light</color>
+ <color name="widget_picker_header_app_subtitle_color_light">
+ @android:color/system_on_surface_variant_light</color>
+ <color name="widget_cell_title_color_light">
+ @android:color/system_on_surface_light</color>
+ <color name="widget_cell_subtitle_color_light">
+ @android:color/system_on_surface_variant_light</color>
+ <color name="widget_picker_menu_options_color_light">
+ @android:color/system_on_surface_variant_light
+ </color>
+
+ <color name="system_primary_container_light">@android:color/system_primary_container_light</color>
+ <color name="system_on_primary_container_light">@android:color/system_on_primary_container_light</color>
+ <color name="system_primary_light">@android:color/system_primary_light</color>
+ <color name="system_on_primary_light">@android:color/system_on_primary_light</color>
+ <color name="system_secondary_container_light">@android:color/system_secondary_container_light</color>
+ <color name="system_on_secondary_container_light">@android:color/system_on_secondary_container_light</color>
+ <color name="system_secondary_light">@android:color/system_secondary_light</color>
+ <color name="system_on_secondary_light">@android:color/system_on_secondary_light</color>
+ <color name="system_tertiary_container_light">@android:color/system_tertiary_container_light</color>
+ <color name="system_on_tertiary_container_light">@android:color/system_on_tertiary_container_light</color>
+ <color name="system_tertiary_light">@android:color/system_tertiary_light</color>
+ <color name="system_on_tertiary_light">@android:color/system_on_tertiary_light</color>
+ <color name="system_background_light">@android:color/system_background_light</color>
+ <color name="system_on_background_light">@android:color/system_on_background_light</color>
+ <color name="system_surface_light">@android:color/system_surface_light</color>
+ <color name="system_on_surface_light">@android:color/system_on_surface_light</color>
+ <color name="system_surface_container_low_light">@android:color/system_surface_container_low_light</color>
+ <color name="system_surface_container_lowest_light">@android:color/system_surface_container_lowest_light</color>
+ <color name="system_surface_container_light">@android:color/system_surface_container_light</color>
+ <color name="system_surface_container_high_light">@android:color/system_surface_container_high_light</color>
+ <color name="system_surface_container_highest_light">@android:color/system_surface_container_highest_light</color>
+ <color name="system_surface_bright_light">@android:color/system_surface_bright_light</color>
+ <color name="system_surface_dim_light">@android:color/system_surface_dim_light</color>
+ <color name="system_surface_variant_light">@android:color/system_surface_variant_light</color>
+ <color name="system_on_surface_variant_light">@android:color/system_on_surface_variant_light</color>
+ <color name="system_outline_light">@android:color/system_outline_light</color>
+ <color name="system_outline_variant_light">@android:color/system_outline_variant_light</color>
+ <color name="system_error_light">@android:color/system_error_light</color>
+ <color name="system_on_error_light">@android:color/system_on_error_light</color>
+ <color name="system_error_container_light">@android:color/system_error_container_light</color>
+ <color name="system_on_error_container_light">@android:color/system_on_error_container_light</color>
+ <color name="system_control_activated_light">@android:color/system_control_activated_light</color>
+ <color name="system_control_normal_light">@android:color/system_control_normal_light</color>
+ <color name="system_control_highlight_light">@android:color/system_control_highlight_light</color>
+ <color name="system_text_primary_inverse_light">@android:color/system_text_primary_inverse_light</color>
+ <color name="system_text_secondary_and_tertiary_inverse_light">@android:color/system_text_secondary_and_tertiary_inverse_light</color>
+ <color name="system_text_primary_inverse_disable_only_light">@android:color/system_text_primary_inverse_disable_only_light</color>
+ <color name="system_text_secondary_and_tertiary_inverse_disabled_light">@android:color/system_text_secondary_and_tertiary_inverse_disabled_light</color>
+ <color name="system_text_hint_inverse_light">@android:color/system_text_hint_inverse_light</color>
+ <color name="system_palette_key_color_primary_light">@android:color/system_palette_key_color_primary_light</color>
+ <color name="system_palette_key_color_secondary_light">@android:color/system_palette_key_color_secondary_light</color>
+ <color name="system_palette_key_color_tertiary_light">@android:color/system_palette_key_color_tertiary_light</color>
+ <color name="system_palette_key_color_neutral_light">@android:color/system_palette_key_color_neutral_light</color>
+ <color name="system_palette_key_color_neutral_variant_light">@android:color/system_palette_key_color_neutral_variant_light</color>
+ <color name="system_primary_container_dark">@android:color/system_primary_container_dark</color>
+ <color name="system_on_primary_container_dark">@android:color/system_on_primary_container_dark</color>
+ <color name="system_primary_dark">@android:color/system_primary_dark</color>
+ <color name="system_on_primary_dark">@android:color/system_on_primary_dark</color>
+ <color name="system_secondary_container_dark">@android:color/system_secondary_container_dark</color>
+ <color name="system_on_secondary_container_dark">@android:color/system_on_secondary_container_dark</color>
+ <color name="system_secondary_dark">@android:color/system_secondary_dark</color>
+ <color name="system_on_secondary_dark">@android:color/system_on_secondary_dark</color>
+ <color name="system_tertiary_container_dark">@android:color/system_tertiary_container_dark</color>
+ <color name="system_on_tertiary_container_dark">@android:color/system_on_tertiary_container_dark</color>
+ <color name="system_tertiary_dark">@android:color/system_tertiary_dark</color>
+ <color name="system_on_tertiary_dark">@android:color/system_on_tertiary_dark</color>
+ <color name="system_background_dark">@android:color/system_background_dark</color>
+ <color name="system_on_background_dark">@android:color/system_on_background_dark</color>
+ <color name="system_surface_dark">@android:color/system_surface_dark</color>
+ <color name="system_on_surface_dark">@android:color/system_on_surface_dark</color>
+ <color name="system_surface_container_low_dark">@android:color/system_surface_container_low_dark</color>
+ <color name="system_surface_container_lowest_dark">@android:color/system_surface_container_lowest_dark</color>
+ <color name="system_surface_container_dark">@android:color/system_surface_container_dark</color>
+ <color name="system_surface_container_high_dark">@android:color/system_surface_container_high_dark</color>
+ <color name="system_surface_container_highest_dark">@android:color/system_surface_container_highest_dark</color>
+ <color name="system_surface_bright_dark">@android:color/system_surface_bright_dark</color>
+ <color name="system_surface_dim_dark">@android:color/system_surface_dim_dark</color>
+ <color name="system_surface_variant_dark">@android:color/system_surface_variant_dark</color>
+ <color name="system_on_surface_variant_dark">@android:color/system_on_surface_variant_dark</color>
+ <color name="system_outline_dark">@android:color/system_outline_dark</color>
+ <color name="system_outline_variant_dark">@android:color/system_outline_variant_dark</color>
+ <color name="system_error_dark">@android:color/system_error_dark</color>
+ <color name="system_on_error_dark">@android:color/system_on_error_dark</color>
+ <color name="system_error_container_dark">@android:color/system_error_container_dark</color>
+ <color name="system_on_error_container_dark">@android:color/system_on_error_container_dark</color>
+ <color name="system_control_activated_dark">@android:color/system_control_activated_dark</color>
+ <color name="system_control_normal_dark">@android:color/system_control_normal_dark</color>
+ <color name="system_control_highlight_dark">@android:color/system_control_highlight_dark</color>
+ <color name="system_text_primary_inverse_dark">@android:color/system_text_primary_inverse_dark</color>
+ <color name="system_text_secondary_and_tertiary_inverse_dark">@android:color/system_text_secondary_and_tertiary_inverse_dark</color>
+ <color name="system_text_primary_inverse_disable_only_dark">@android:color/system_text_primary_inverse_disable_only_dark</color>
+ <color name="system_text_secondary_and_tertiary_inverse_disabled_dark">@android:color/system_text_secondary_and_tertiary_inverse_disabled_dark</color>
+ <color name="system_text_hint_inverse_dark">@android:color/system_text_hint_inverse_dark</color>
+ <color name="system_palette_key_color_primary_dark">@android:color/system_palette_key_color_primary_dark</color>
+ <color name="system_palette_key_color_secondary_dark">@android:color/system_palette_key_color_secondary_dark</color>
+ <color name="system_palette_key_color_tertiary_dark">@android:color/system_palette_key_color_tertiary_dark</color>
+ <color name="system_palette_key_color_neutral_dark">@android:color/system_palette_key_color_neutral_dark</color>
+ <color name="system_palette_key_color_neutral_variant_dark">@android:color/system_palette_key_color_neutral_variant_dark</color>
+ <color name="system_primary_fixed">@android:color/system_primary_fixed</color>
+ <color name="system_primary_fixed_dim">@android:color/system_primary_fixed_dim</color>
+ <color name="system_on_primary_fixed">@android:color/system_on_primary_fixed</color>
+ <color name="system_on_primary_fixed_variant">@android:color/system_on_primary_fixed_variant</color>
+ <color name="system_secondary_fixed">@android:color/system_secondary_fixed</color>
+ <color name="system_secondary_fixed_dim">@android:color/system_secondary_fixed_dim</color>
+ <color name="system_on_secondary_fixed">@android:color/system_on_secondary_fixed</color>
+ <color name="system_on_secondary_fixed_variant">@android:color/system_on_secondary_fixed_variant</color>
+ <color name="system_tertiary_fixed">@android:color/system_tertiary_fixed</color>
+ <color name="system_tertiary_fixed_dim">@android:color/system_tertiary_fixed_dim</color>
+ <color name="system_on_tertiary_fixed">@android:color/system_on_tertiary_fixed</color>
+ <color name="system_on_tertiary_fixed_variant">@android:color/system_on_tertiary_fixed_variant</color>
+</resources>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 86226f0..b0bac73 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Tiện ích bị vô hiệu hóa ở chế độ an toàn"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Lối tắt không khả dụng"</string>
<string name="home_screen" msgid="5629429142036709174">"Màn hình chính"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Đặt <xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> làm trình chạy mặc định trong phần Cài đặt"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Chia đôi màn hình"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Thông tin ứng dụng cho %1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Chế độ cài đặt mức sử dụng %1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Lưu cặp ứng dụng"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Cặp ứng dụng này không hoạt động được trên thiết bị này"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Hiện không có cặp ứng dụng này"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Chạm và giữ để di chuyển một tiện ích."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Nhấn đúp và giữ để di chuyển một tiện ích hoặc sử dụng các thao tác tùy chỉnh."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Lựa chọn khác"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Hiện tất cả tiện ích"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"Rộng %1$d x cao %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Tiện ích <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Nội dung đề xuất"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Các tiện ích thiết yếu"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Tin tức và tạp chí"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Giai điệu thư giãn của bạn"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Giải trí"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Mạng xã hội"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Sức khoẻ và thể chất"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Thời tiết"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Đề xuất cho bạn"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Tiện ích <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> ở bên phải, công cụ tìm kiếm và tuỳ chọn ở bên trái"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# tiện ích}other{# tiện ích}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Gỡ cài đặt"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Thông tin ứng dụng"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Cài đặt ở chế độ riêng tư"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Gỡ cài đặt ứng dụng"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Cài đặt"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Không đề xuất ứng dụng"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Không gợi ý ứng dụng"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Ghim ứng dụng dự đoán"</string>
+ <string name="bubble" msgid="3072951361014076670">"Bong bóng"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"cài đặt lối tắt"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Cho phép ứng dụng thêm lối tắt mà không cần sự can thiệp của người dùng."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"đọc lối tắt và các chế độ cài đặt trên màn hình chính"</string>
@@ -127,7 +130,7 @@
<string name="msg_missing_notification_access" msgid="281113995110910548">"Để hiển thị Dấu chấm thông báo, hãy bật thông báo ứng dụng cho <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="title_change_settings" msgid="1376365968844349552">"Thay đổi cài đặt"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"Hiện dấu chấm thông báo"</string>
- <string name="developer_options_title" msgid="700788437593726194">"Tùy chọn cho nhà phát triển"</string>
+ <string name="developer_options_title" msgid="700788437593726194">"Tuỳ chọn cho nhà phát triển"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Thêm biểu tượng ứng dụng vào màn hình chính"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Cho ứng dụng mới"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"Không xác định"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"Đang cài đặt <xliff:g id="NAME">%1$s</xliff:g>, hoàn tất <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"Đang tải xuống <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="PROGRESS">%2$s</xliff:g> hoàn tất"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"Đang chờ cài đặt <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"Đã lưu trữ <xliff:g id="NAME">%1$s</xliff:g> Nhấn để tải xuống."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"<xliff:g id="NAME">%1$s</xliff:g> đã được lưu trữ. Hãy nhấn để tải xuống và khôi phục."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Cần cập nhật ứng dụng"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"Ứng dụng cho biểu tượng này chưa được cập nhật. Bạn có thể cập nhật theo cách thủ công để bật lại phím tắt này hoặc xóa biểu tượng."</string>
<string name="dialog_update" msgid="2178028071796141234">"Cập nhật"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Nhấn để thiết lập hoặc mở"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Riêng tư"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Cài đặt không gian riêng tư"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Riêng tư, đã mở khoá."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Riêng tư, đã khoá."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Khoá"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Chuyển đổi sang không gian riêng tư"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Cài đặt ứng dụng"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Cài đặt"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Cài đặt ứng dụng vào Không gian riêng tư"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Bong bóng bổ sung"</string>
</resources>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 40951e9..112b945 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"安全模式下不允许使用微件"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"无法使用快捷方式"</string>
<string name="home_screen" msgid="5629429142036709174">"主屏幕"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"在“设置”中将“<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>”设为默认主屏幕应用"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"分屏"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s 的应用信息"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"%1$s的使用设置"</string>
<string name="save_app_pair" msgid="5647523853662686243">"保存应用组合"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"在该设备上无法使用此应用对"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"应用对不可用"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"轻触并按住即可移动微件。"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"点按两次并按住微件即可移动该微件或使用自定义操作。"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"更多选项"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"显示所有微件"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"宽 %1$d,高 %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"“<xliff:g id="WIDGET_NAME">%1$s</xliff:g>”微件"</string>
@@ -44,13 +48,10 @@
<string name="add_to_home_screen" msgid="9168649446635919791">"添加到主屏幕"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"已将“<xliff:g id="WIDGET_NAME">%1$s</xliff:g>”微件添加到主屏幕"</string>
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"建议"</string>
- <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"必备"</string>
+ <string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"必备之选"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"新闻与杂志"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"您的休闲区"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"娱乐"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"社交"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"健康与健身"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"天气"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"为您推荐"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"右边是<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>微件,左边是搜索功能和选项"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# 个微件}other{# 个微件}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"卸载"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"应用信息"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"安装到私密个人资料中"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"卸载应用"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"安装"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"不要提供应用建议"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"不要推荐此应用"</string>
<string name="pin_prediction" msgid="4196423321649756498">"固定预测的应用"</string>
+ <string name="bubble" msgid="3072951361014076670">"气泡框"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"安装快捷方式"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"允许应用自行添加快捷方式。"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"读取主屏幕设置和快捷方式"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"正在安装<xliff:g id="NAME">%1$s</xliff:g>,已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"正在下载<xliff:g id="NAME">%1$s</xliff:g>,已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g>正在等待安装"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"已归档“<xliff:g id="NAME">%1$s</xliff:g>”。点按即可下载。"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"已归档“<xliff:g id="NAME">%1$s</xliff:g>”。点按即可进行下载并恢复。"</string>
<string name="dialog_update_title" msgid="114234265740994042">"需要更新应用"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"此图标对应的应用未更新。您可以手动更新以重新启用该快捷方式,或者移除此图标。"</string>
<string name="dialog_update" msgid="2178028071796141234">"更新"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"点按即可设置或打开"</string>
<string name="ps_container_title" msgid="4391796149519594205">"私密"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"私密空间设置"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"私密,未锁定。"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"私密,已锁定。"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"锁定"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"私密空间转换"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"安装应用"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"安装"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"将应用安装到私密空间"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"菜单"</string>
</resources>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index b6147fd..e63093e 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"在安全模式中無法使用小工具"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"沒有可用的捷徑"</string>
<string name="home_screen" msgid="5629429142036709174">"主畫面"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"在「設定」中將「<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>」設定為預設主頁應用程式"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"分割螢幕"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"%1$s 的應用程式資料"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"「%1$s」的用量設定"</string>
<string name="save_app_pair" msgid="5647523853662686243">"儲存應用程式配對"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"此裝置不支援此應用程式配對"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"應用程式配對無法使用"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"輕觸並按住即可移動小工具。"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"㩒兩下之後㩒住,就可以郁小工具或者用自訂操作。"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"更多選項"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"顯示所有小工具"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d 闊,%2$d 高"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"「<xliff:g id="WIDGET_NAME">%1$s</xliff:g>」小工具"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"建議"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"必備之選"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"新聞和雜誌"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"放鬆專區"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"娛樂"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"社交"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"健康和健身"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"天氣"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"為你推薦"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"右邊係「<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>」小工具,左邊係搜尋功能同選項"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# 個小工具}other{# 個小工具}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"解除安裝"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"應用程式資料"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"安裝在私人資料夾中"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"解除安裝應用程式"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"安裝"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"不要提供應用程式建議"</string>
<string name="pin_prediction" msgid="4196423321649756498">"固定預測"</string>
+ <string name="bubble" msgid="3072951361014076670">"氣泡"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"安裝捷徑"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"允許應用程式無需使用者許可也可新增捷徑。"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"讀取主畫面設定和捷徑"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"正在安裝「<xliff:g id="NAME">%1$s</xliff:g>」(已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"正在下載 <xliff:g id="NAME">%1$s</xliff:g>,已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"正在等待安裝 <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"「<xliff:g id="NAME">%1$s</xliff:g>」已封存。輕按即可下載。"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"「<xliff:g id="NAME">%1$s</xliff:g>」已封存。輕按即可下載並還原。"</string>
<string name="dialog_update_title" msgid="114234265740994042">"必須更新應用程式"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"你尚未更新這個圖示代表的應用程式。你可以手動更新以重新啟用此快速鍵,或者移除圖示。"</string>
<string name="dialog_update" msgid="2178028071796141234">"更新"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"輕按即可設定或開啟"</string>
<string name="ps_container_title" msgid="4391796149519594205">"私人"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"「私人空間」設定"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"私人,未鎖定。"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"私人,已鎖定。"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"上鎖"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"轉為「私人空間」"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"安裝應用程式"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"安裝"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"將應用程式安裝在「私人空間」中"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"顯示更多"</string>
</resources>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 17573d9..25f9703 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"在安全模式下無法使用小工具"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"目前無法使用捷徑"</string>
<string name="home_screen" msgid="5629429142036709174">"主畫面"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"前往「設定」將「<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g>」設為預設主畫面應用程式"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"分割畫面"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"「%1$s」的應用程式資訊"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"「%1$s」的用量設定"</string>
<string name="save_app_pair" msgid="5647523853662686243">"儲存應用程式配對"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"這部裝置不支援這組應用程式配對"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"這個應用程式配對無法使用"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"按住即可移動小工具。"</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"輕觸兩下並按住即可移動小工具或使用自訂操作。"</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"更多選項"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"顯示所有小工具"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"寬度為 %1$d,高度為 %2$d"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"「<xliff:g id="WIDGET_NAME">%1$s</xliff:g>」小工具"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"建議"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"常用項目"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"新聞與雜誌"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"放鬆專區"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"娛樂"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"社群"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"健康與塑身"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"天氣"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"個人化建議"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"右邊是「<xliff:g id="SELECTED_HEADER">%1$s</xliff:g>」小工具,左邊是搜尋功能和選項"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# 項小工具}other{# 項小工具}}"</string>
@@ -86,10 +87,12 @@
<string name="remove_drop_target_label" msgid="7812859488053230776">"移除"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"解除安裝"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"應用程式資訊"</string>
- <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"安裝在私人資料夾中"</string>
+ <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"安裝在私人空間中"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"解除安裝應用程式"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"安裝"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"不要提供應用程式建議"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"不要建議此應用程式"</string>
<string name="pin_prediction" msgid="4196423321649756498">"固定預測的應用程式"</string>
+ <string name="bubble" msgid="3072951361014076670">"泡泡"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"安裝捷徑"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"允許應用程式自動新增捷徑。"</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"讀取主畫面設定和捷徑"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"正在安裝「<xliff:g id="NAME">%1$s</xliff:g>」(已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"正在下載「<xliff:g id="NAME">%1$s</xliff:g>」,已完成 <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"正在等待安裝「<xliff:g id="NAME">%1$s</xliff:g>」"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"已封存「<xliff:g id="NAME">%1$s</xliff:g>」。輕觸即可下載。"</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"「<xliff:g id="NAME">%1$s</xliff:g>」已封存。輕觸即可下載並還原。"</string>
<string name="dialog_update_title" msgid="114234265740994042">"必須更新應用程式"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"這個圖示代表的應用程式未更新。手動更新即可重新啟用這個捷徑,你也可以移除圖示。"</string>
<string name="dialog_update" msgid="2178028071796141234">"更新"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"輕觸即可設定或開啟"</string>
<string name="ps_container_title" msgid="4391796149519594205">"私人"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"私人空間設定"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"私人,未鎖定。"</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"私人,已鎖定。"</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"鎖定"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"轉換私人空間狀態"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"安裝應用程式"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"安裝"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"將應用程式安裝在私人空間中"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"溢位"</string>
</resources>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index a24c0e9..ec1f941 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -27,8 +27,10 @@
<string name="safemode_widget_error" msgid="4863470563535682004">"Amawijethi akhutshaziwe kwimodi yokuphepha"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"Isinqamuleli asitholakali"</string>
<string name="home_screen" msgid="5629429142036709174">"Ikhaya"</string>
+ <string name="set_default_home_app" msgid="5808906607627586381">"Setha i-<xliff:g id="LAUNCHER_NAME">%1$s</xliff:g> njenge-app yasekhaya ezenzakalelayo Kumasethingi"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Hlukanisa isikrini"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Ulwazi lwe-App ye-%1$s"</string>
+ <string name="split_app_usage_settings" msgid="7214375263347964093">"Amasethingi okusetshenziswa ka-%1$s"</string>
<string name="save_app_pair" msgid="5647523853662686243">"Londoloza i-app ebhangqiwe"</string>
<string name="app_pair_default_title" msgid="4045241727446873529">"<xliff:g id="APP1">%1$s</xliff:g> | <xliff:g id="APP2">%2$s</xliff:g>"</string>
<string name="app_pair_unlaunchable_at_screen_size" msgid="3446551575502685376">"Lokhu kubhanqwa kwe-app akusekelwa kule divayisi"</string>
@@ -36,6 +38,8 @@
<string name="app_pair_not_available" msgid="3556767440808032031">"Ukubhangqwa kwe-app akutholakali"</string>
<string name="long_press_widget_to_add" msgid="3587712543577675817">"Thinta uphinde ubambe ukuze uhambise iwijethi."</string>
<string name="long_accessible_way_to_add" msgid="2733588281439571974">"Thepha kabili uphinde ubambe ukuze uhambise iwijethi noma usebenzise izindlela ezingokwezifiso."</string>
+ <string name="widget_picker_widget_options_button_description" msgid="4770099264476852363">"Okungakhethwa kukho okuningi"</string>
+ <string name="widget_picker_show_all_widgets_menu_item_title" msgid="9023638224586908119">"Bonisa wonke amawijethi"</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ububanzi ngokungu-%2$d ukuya phezulu"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Iwijethi elingu-<xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
@@ -46,11 +50,8 @@
<string name="suggested_widgets_header_title" msgid="1844314680798145222">"Iziphakamiso"</string>
<string name="productivity_widget_recommendation_category_label" msgid="3811812719618323750">"Okusemqoka"</string>
<string name="news_widget_recommendation_category_label" msgid="6756167867113741310">"Izindaba nomagazini"</string>
- <string name="social_and_entertainment_widget_recommendation_category_label" msgid="2923840997302308191">"Indawo Ozipholela Kuyo"</string>
<string name="entertainment_widget_recommendation_category_label" msgid="3973107268630717874">"Okokozijabulisa"</string>
<string name="social_widget_recommendation_category_label" msgid="689147679536384717">"Okomphakathi"</string>
- <string name="fitness_widget_recommendation_category_label" msgid="2756483898236585324">"Ezempilo nokufaneleka"</string>
- <string name="weather_widget_recommendation_category_label" msgid="3059715991930798039">"Isimo sezulu"</string>
<string name="others_widget_recommendation_category_label" msgid="5555987036267226245">"Okuphakanyiselwe wena"</string>
<string name="widget_picker_right_pane_accessibility_title" msgid="1673313931455067502">"Amawijethi okuthi <xliff:g id="SELECTED_HEADER">%1$s</xliff:g> kwesokudla, ukusesha nokukhethwayo kwesobunxele"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{iwijethi #}one{amawijethi #}other{amawijethi #}}"</string>
@@ -87,9 +88,11 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Khipha"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Ulwazi nge-app"</string>
<string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Faka ngokugodliwe"</string>
+ <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Khipha i-app"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Faka"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Ungaphakamisi uhlelo lokusebenza"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Ukubikezela Iphinikhodi"</string>
+ <string name="bubble" msgid="3072951361014076670">"Ibhamuza"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"faka izinqamuleli"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Ivumela uhlelo lokusebenza ukufaka izinqamuleli ngaphandle kokungenelela komsebenzisi."</string>
<string name="permlab_read_settings" msgid="5136500343007704955">"funda amasethingi wasekhaya nezinqamuleli"</string>
@@ -125,7 +128,7 @@
<string name="notification_dots_desc_off" msgid="1760796511504341095">"Valiwe"</string>
<string name="title_missing_notification_access" msgid="7503287056163941064">"Ukufinyelela izaziso kuyadingeka"</string>
<string name="msg_missing_notification_access" msgid="281113995110910548">"Ukuze ubonisa amcashazi esaziso, vula izaziso zohlelo lokusebenza ze-<xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="title_change_settings" msgid="1376365968844349552">"Shintsha izilungiselelo"</string>
+ <string name="title_change_settings" msgid="1376365968844349552">"Shintsha amasethingi"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"Bonisa amacashazi esaziso"</string>
<string name="developer_options_title" msgid="700788437593726194">"Izinketho zonjiniyela"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Engeza izithonjana ze-app kusikrini sasekhaya"</string>
@@ -138,7 +141,7 @@
<string name="app_installing_title" msgid="5864044122733792085">"I-<xliff:g id="NAME">%1$s</xliff:g> iyafakwa, seyiqede <xliff:g id="PROGRESS">%2$s</xliff:g>"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"I-<xliff:g id="NAME">%1$s</xliff:g> iyalandwa, <xliff:g id="PROGRESS">%2$s</xliff:g> kuqediwe"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ilinde ukufakwa"</string>
- <string name="app_archived_title" msgid="9124290918876665128">"I-<xliff:g id="NAME">%1$s</xliff:g> ifakwe kungobo yomlando. Thepha ukuze udawunilode."</string>
+ <string name="app_archived_title" msgid="7717956158562544081">"Okuthi <xliff:g id="NAME">%1$s</xliff:g> kufakwe kungobo yomlando. Thepha ukuze udawunilode futhi ubuyisele."</string>
<string name="dialog_update_title" msgid="114234265740994042">"Kudingeka isibuyekezo se-app"</string>
<string name="dialog_update_message" msgid="4176784553982226114">"I-app yalesi sithonjana ibuyekeziwe. Ungabuyekeza mathupha ukuze uphinde unike amandla lesi sinqamuleli, noma ususe isithonjana."</string>
<string name="dialog_update" msgid="2178028071796141234">"Vuselela"</string>
@@ -189,13 +192,10 @@
<string name="private_space_secondary_label" msgid="9203933341714508907">"Thepha ukuze usethe noma uvule"</string>
<string name="ps_container_title" msgid="4391796149519594205">"Okuyimfihlo"</string>
<string name="ps_container_settings" msgid="6059734123353320479">"Amasethingi Esikhala Esiyimfihlo"</string>
- <!-- no translation found for ps_container_unlock_button_content_description (9181551784092204234) -->
- <skip />
- <!-- no translation found for ps_container_lock_button_content_description (5961993384382649530) -->
- <skip />
+ <string name="ps_container_unlock_button_content_description" msgid="9181551784092204234">"Iyimfihlo, ivuliwe."</string>
+ <string name="ps_container_lock_button_content_description" msgid="5961993384382649530">"Iyimfihlo, ikhiyiwe."</string>
<string name="ps_container_lock_title" msgid="2640257399982364682">"Khiya"</string>
<string name="ps_container_transition" msgid="8667331812048014412">"Ukuguqulwa Kwendawo Yangasese"</string>
- <string name="ps_add_button_label" msgid="8611055839242385935">"Faka ama-app"</string>
+ <string name="ps_add_button_label" msgid="8127988716897128773">"Faka"</string>
<string name="ps_add_button_content_description" msgid="3254274107740952556">"Faka ama-app Endaweni Engasese"</string>
- <string name="bubble_bar_overflow_description" msgid="7410995531938041192">"Ukugcwala kakhulu"</string>
</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index f23c790..6151b5f 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -45,6 +45,55 @@
<attr name="focusOutlineColor" format="color" />
<attr name="focusInnerOutlineColor" format="color" />
+ <!-- Recreating Dynamic Color attributes found in the system. This should be the way to go on
+ all launcher projects since they all inherit from launcher3. Avoid creating other color
+ attributes if these can be user directly. -->
+ <attr name="materialColorOnSecondaryFixedVariant" format="color" />
+ <attr name="materialColorOnTertiaryFixedVariant" format="color" />
+ <attr name="materialColorSurfaceContainerLowest" format="color" />
+ <attr name="materialColorOnPrimaryFixedVariant" format="color" />
+ <attr name="materialColorOnSecondaryContainer" format="color" />
+ <attr name="materialColorOnTertiaryContainer" format="color" />
+ <attr name="materialColorSurfaceContainerLow" format="color" />
+ <attr name="materialColorOnPrimaryContainer" format="color" />
+ <attr name="materialColorSecondaryFixedDim" format="color" />
+ <attr name="materialColorOnErrorContainer" format="color" />
+ <attr name="materialColorOnSecondaryFixed" format="color" />
+ <attr name="materialColorOnSurfaceInverse" format="color" />
+ <attr name="materialColorTertiaryFixedDim" format="color" />
+ <attr name="materialColorOnTertiaryFixed" format="color" />
+ <attr name="materialColorPrimaryFixedDim" format="color" />
+ <attr name="materialColorSecondaryContainer" format="color" />
+ <attr name="materialColorErrorContainer" format="color" />
+ <attr name="materialColorOnPrimaryFixed" format="color" />
+ <attr name="materialColorPrimaryInverse" format="color" />
+ <attr name="materialColorSecondaryFixed" format="color" />
+ <attr name="materialColorSurfaceInverse" format="color" />
+ <attr name="materialColorSurfaceVariant" format="color" />
+ <attr name="materialColorTertiaryContainer" format="color" />
+ <attr name="materialColorTertiaryFixed" format="color" />
+ <attr name="materialColorPrimaryContainer" format="color" />
+ <attr name="materialColorOnBackground" format="color" />
+ <attr name="materialColorPrimaryFixed" format="color" />
+ <attr name="materialColorOnSecondary" format="color" />
+ <attr name="materialColorOnTertiary" format="color" />
+ <attr name="materialColorSurfaceDim" format="color" />
+ <attr name="materialColorSurfaceBright" format="color" />
+ <attr name="materialColorOnError" format="color" />
+ <attr name="materialColorSurface" format="color" />
+ <attr name="materialColorSurfaceContainerHigh" format="color" />
+ <attr name="materialColorSurfaceContainerHighest" format="color" />
+ <attr name="materialColorOnSurfaceVariant" format="color" />
+ <attr name="materialColorOutline" format="color" />
+ <attr name="materialColorOutlineVariant" format="color" />
+ <attr name="materialColorOnPrimary" format="color" />
+ <attr name="materialColorOnSurface" format="color" />
+ <attr name="materialColorSurfaceContainer" format="color" />
+ <attr name="materialColorPrimary" format="color" />
+ <attr name="materialColorSecondary" format="color" />
+ <attr name="materialColorTertiary" format="color" />
+ <attr name="materialColorError" format="color" />
+
<attr name="pageIndicatorDotColor" format="color" />
<attr name="folderPreviewColor" format="color" />
<attr name="folderBackgroundColor" format="color" />
@@ -61,6 +110,8 @@
<attr name="preloadIconAccentColor" format="color" />
<attr name="preloadIconBackgroundColor" format="color" />
<attr name="widgetPickerTitleColor" format="color"/>
+ <attr name="widgetPickerDescriptionColor" format="color"/>
+ <attr name="widgetPickerWidgetOptionsMenuColor" format="color"/>
<attr name="widgetPickerPrimarySurfaceColor" format="color"/>
<attr name="widgetPickerSecondarySurfaceColor" format="color"/>
<attr name="widgetPickerHeaderAppTitleColor" format="color"/>
@@ -76,6 +127,8 @@
<attr name="widgetPickerCollapseHandleColor" format="color"/>
<attr name="widgetPickerAddButtonBackgroundColor" format="color"/>
<attr name="widgetPickerAddButtonTextColor" format="color"/>
+ <attr name="widgetCellTitleColor" format="color" />
+ <attr name="widgetCellSubtitleColor" format="color" />
<!-- BubbleTextView specific attributes. -->
<declare-styleable name="BubbleTextView">
@@ -578,51 +631,6 @@
<attr name="collapsable" format="boolean" />
</declare-styleable>
- <attr name="materialColorOnSecondaryFixedVariant" format="color" />
- <attr name="materialColorOnTertiaryFixedVariant" format="color" />
- <attr name="materialColorSurfaceContainerLowest" format="color" />
- <attr name="materialColorOnPrimaryFixedVariant" format="color" />
- <attr name="materialColorOnSecondaryContainer" format="color" />
- <attr name="materialColorOnTertiaryContainer" format="color" />
- <attr name="materialColorSurfaceContainerLow" format="color" />
- <attr name="materialColorOnPrimaryContainer" format="color" />
- <attr name="materialColorSecondaryFixedDim" format="color" />
- <attr name="materialColorOnErrorContainer" format="color" />
- <attr name="materialColorOnSecondaryFixed" format="color" />
- <attr name="materialColorOnSurfaceInverse" format="color" />
- <attr name="materialColorTertiaryFixedDim" format="color" />
- <attr name="materialColorOnTertiaryFixed" format="color" />
- <attr name="materialColorPrimaryFixedDim" format="color" />
- <attr name="materialColorSecondaryContainer" format="color" />
- <attr name="materialColorErrorContainer" format="color" />
- <attr name="materialColorOnPrimaryFixed" format="color" />
- <attr name="materialColorPrimaryInverse" format="color" />
- <attr name="materialColorSecondaryFixed" format="color" />
- <attr name="materialColorTertiaryContainer" format="color" />
- <attr name="materialColorTertiaryFixed" format="color" />
- <attr name="materialColorPrimaryContainer" format="color" />
- <attr name="materialColorOnBackground" format="color" />
- <attr name="materialColorPrimaryFixed" format="color" />
- <attr name="materialColorOnSecondary" format="color" />
- <attr name="materialColorOnTertiary" format="color" />
- <attr name="materialColorOnError" format="color" />
- <attr name="materialColorOnSurfaceVariant" format="color" />
- <attr name="materialColorOutline" format="color" />
- <attr name="materialColorOutlineVariant" format="color" />
- <attr name="materialColorOnPrimary" format="color" />
- <attr name="materialColorOnSurface" format="color" />
- <attr name="materialColorPrimary" format="color" />
- <attr name="materialColorSecondary" format="color" />
- <attr name="materialColorTertiary" format="color" />
- <attr name="materialColorSurfaceInverse" format="color" />
- <attr name="materialColorSurfaceVariant" format="color" />
- <attr name="materialColorSurfaceDim" format="color" />
- <attr name="materialColorSurfaceBright" format="color" />
- <attr name="materialColorSurface" format="color" />
- <attr name="materialColorSurfaceContainerHigh" format="color" />
- <attr name="materialColorSurfaceContainerHighest" format="color" />
- <attr name="materialColorSurfaceContainer" format="color" />
-
<declare-styleable name="WidgetSections">
<!-- Component name of an app widget provider. -->
<attr name="provider" format="string" />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index dfe40fc..3f8bede 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -17,8 +17,7 @@
** limitations under the License.
*/
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The color tints to apply to the text and drag view when hovering
over the delete target or the info target -->
<color name="delete_target_hover_tint">#FFC1C1C1</color>
@@ -104,6 +103,8 @@
<color name="widget_picker_primary_surface_color_light">#EFEDED</color>
<color name="widget_picker_secondary_surface_color_light">#FAF9F8</color>
<color name="widget_picker_title_color_light">#1F1F1F</color>
+ <color name="widget_picker_description_color_light">#4C4D50</color>
+ <color name="widget_picker_menu_options_color_light">@color/system_on_surface_variant_light</color>
<color name="widget_picker_header_app_title_color_light">#1F1F1F</color>
<color name="widget_picker_header_app_subtitle_color_light">#444746</color>
<color name="widget_picker_header_background_color_light">#C2E7FF</color>
@@ -117,10 +118,14 @@
<color name="widget_picker_collapse_handle_color_light">#C4C7C5</color>
<color name="widget_picker_add_button_background_color_light">#0B57D0</color>
<color name="widget_picker_add_button_text_color_light">#0B57D0</color>
+ <color name="widget_cell_title_color_light">@color/system_on_surface_light</color>
+ <color name="widget_cell_subtitle_color_light">@color/system_on_surface_variant_light</color>
<color name="widget_picker_primary_surface_color_dark">#1F2020</color>
<color name="widget_picker_secondary_surface_color_dark">#393939</color>
<color name="widget_picker_title_color_dark">#E3E3E3</color>
+ <color name="widget_picker_description_color_dark">#CCCDCF</color>
+ <color name="widget_picker_menu_options_color_dark">@color/system_on_surface_variant_dark</color>
<color name="widget_picker_header_app_title_color_dark">#E3E3E3</color>
<color name="widget_picker_header_app_subtitle_color_dark">#C4C7C5</color>
<color name="widget_picker_header_background_color_dark">#004A77</color>
@@ -134,49 +139,110 @@
<color name="widget_picker_collapse_handle_color_dark">#444746</color>
<color name="widget_picker_add_button_background_color_dark">#062E6F</color>
<color name="widget_picker_add_button_text_color_dark">#FFFFFF</color>
+ <color name="widget_cell_title_color_dark">@color/system_on_surface_dark</color>
+ <color name="widget_cell_subtitle_color_dark">@color/system_on_surface_variant_dark</color>
- <color name="material_color_on_secondary_fixed_variant">#3F4759</color>
- <color name="material_color_on_tertiary_fixed_variant">#583E5B</color>
<color name="material_color_surface_container_lowest">#FFFFFF</color>
- <color name="material_color_on_primary_fixed_variant">#2B4678</color>
- <color name="material_color_on_secondary_container">#141B2C</color>
- <color name="material_color_on_tertiary_container">#29132D</color>
- <color name="material_color_surface_container_low">#F5F3F7</color>
- <color name="material_color_on_primary_container">#001A41</color>
- <color name="material_color_secondary_fixed_dim">#BFC6DC</color>
- <color name="material_color_on_error_container">#410000</color>
- <color name="material_color_on_secondary_fixed">#141B2C</color>
- <color name="material_color_on_surface_inverse">#E3E2E6</color>
- <color name="material_color_tertiary_fixed_dim">#DEBCDF</color>
- <color name="material_color_on_tertiary_fixed">#29132D</color>
- <color name="material_color_primary_fixed_dim">#ADC6FF</color>
- <color name="material_color_secondary_container">#DBE2F9</color>
- <color name="material_color_error_container">#FFDAD5</color>
- <color name="material_color_on_primary_fixed">#001A41</color>
- <color name="material_color_primary_inverse">#ADC6FF</color>
- <color name="material_color_secondary_fixed">#DBE2F9</color>
- <color name="material_color_surface_inverse">#121316</color>
- <color name="material_color_surface_variant">#E1E2EC</color>
- <color name="material_color_tertiary_container">#FBD7FC</color>
- <color name="material_color_tertiary_fixed">#FBD7FC</color>
- <color name="material_color_primary_container">#D8E2FF</color>
- <color name="material_color_on_background">#1B1B1F</color>
- <color name="material_color_primary_fixed">#D8E2FF</color>
- <color name="material_color_on_secondary">#FFFFFF</color>
- <color name="material_color_on_tertiary">#FFFFFF</color>
- <color name="material_color_surface_dim">#DBD9DD</color>
- <color name="material_color_surface_bright">#FAF9FD</color>
- <color name="material_color_on_error">#FFFFFF</color>
- <color name="material_color_surface">#FAF9FD</color>
- <color name="material_color_surface_container_high">#E9E7EC</color>
- <color name="material_color_surface_container_highest">#E3E2E6</color>
- <color name="material_color_on_surface_variant">#44474F</color>
- <color name="material_color_outline">#72747D</color>
- <color name="material_color_outline_variant">#C4C7C5</color>
- <color name="material_color_on_primary">#FFFFFF</color>
<color name="material_color_on_surface">#1B1B1F</color>
- <color name="material_color_surface_container">#EFEDF1</color>
- <color name="material_color_primary">#445E91</color>
- <color name="material_color_secondary">#575E71</color>
- <color name="material_color_tertiary">#715573</color>
+
+ <color name="system_primary_container_light">#D9E2FF</color>
+ <color name="system_on_primary_container_light">#001945</color>
+ <color name="system_primary_light">#475D92</color>
+ <color name="system_on_primary_light">#FFFFFF</color>
+ <color name="system_secondary_container_light">#DCE2F9</color>
+ <color name="system_on_secondary_container_light">#151B2C</color>
+ <color name="system_secondary_light">#575E71</color>
+ <color name="system_on_secondary_light">#FFFFFF</color>
+ <color name="system_tertiary_container_light">#FDD7FA</color>
+ <color name="system_on_tertiary_container_light">#2A122C</color>
+ <color name="system_tertiary_light">#725572</color>
+ <color name="system_on_tertiary_light">#FFFFFF</color>
+ <color name="system_background_light">#FAF8FF</color>
+ <color name="system_on_background_light">#1A1B20</color>
+ <color name="system_surface_light">#FAF8FF</color>
+ <color name="system_on_surface_light">#1A1B20</color>
+ <color name="system_surface_container_low_light">#F4F3FA</color>
+ <color name="system_surface_container_lowest_light">#FFFFFF</color>
+ <color name="system_surface_container_light">#EEEDF4</color>
+ <color name="system_surface_container_high_light">#E8E7EF</color>
+ <color name="system_surface_container_highest_light">#E2E2E9</color>
+ <color name="system_surface_bright_light">#FAF8FF</color>
+ <color name="system_surface_dim_light">#DAD9E0</color>
+ <color name="system_surface_variant_light">#E1E2EC</color>
+ <color name="system_on_surface_variant_light">#44464F</color>
+ <color name="system_outline_light">#757780</color>
+ <color name="system_outline_variant_light">#C5C6D0</color>
+ <color name="system_error_light">#BA1A1A</color>
+ <color name="system_on_error_light">#FFFFFF</color>
+ <color name="system_error_container_light">#FFDAD6</color>
+ <color name="system_on_error_container_light">#410002</color>
+ <color name="system_control_activated_light">#D9E2FF</color>
+ <color name="system_control_normal_light">#44464F</color>
+ <color name="system_control_highlight_light">#000000</color>
+ <color name="system_text_primary_inverse_light">#E2E2E9</color>
+ <color name="system_text_secondary_and_tertiary_inverse_light">#C5C6D0</color>
+ <color name="system_text_primary_inverse_disable_only_light">#E2E2E9</color>
+ <color name="system_text_secondary_and_tertiary_inverse_disabled_light">#E2E2E9</color>
+ <color name="system_text_hint_inverse_light">#E2E2E9</color>
+ <color name="system_palette_key_color_primary_light">#6076AC</color>
+ <color name="system_palette_key_color_secondary_light">#70778B</color>
+ <color name="system_palette_key_color_tertiary_light">#8C6D8C</color>
+ <color name="system_palette_key_color_neutral_light">#76777D</color>
+ <color name="system_palette_key_color_neutral_variant_light">#757780</color>
+ <color name="system_primary_container_dark">#2F4578</color>
+ <color name="system_on_primary_container_dark">#D9E2FF</color>
+ <color name="system_primary_dark">#B0C6FF</color>
+ <color name="system_on_primary_dark">#152E60</color>
+ <color name="system_secondary_container_dark">#404659</color>
+ <color name="system_on_secondary_container_dark">#DCE2F9</color>
+ <color name="system_secondary_dark">#C0C6DC</color>
+ <color name="system_on_secondary_dark">#2A3042</color>
+ <color name="system_tertiary_container_dark">#593D59</color>
+ <color name="system_on_tertiary_container_dark">#FDD7FA</color>
+ <color name="system_tertiary_dark">#E0BBDD</color>
+ <color name="system_on_tertiary_dark">#412742</color>
+ <color name="system_background_dark">#121318</color>
+ <color name="system_on_background_dark">#E2E2E9</color>
+ <color name="system_surface_dark">#121318</color>
+ <color name="system_on_surface_dark">#E2E2E9</color>
+ <color name="system_surface_container_low_dark">#1A1B20</color>
+ <color name="system_surface_container_lowest_dark">#0C0E13</color>
+ <color name="system_surface_container_dark">#1E1F25</color>
+ <color name="system_surface_container_high_dark">#282A2F</color>
+ <color name="system_surface_container_highest_dark">#33343A</color>
+ <color name="system_surface_bright_dark">#38393F</color>
+ <color name="system_surface_dim_dark">#121318</color>
+ <color name="system_surface_variant_dark">#44464F</color>
+ <color name="system_on_surface_variant_dark">#C5C6D0</color>
+ <color name="system_outline_dark">#8F9099</color>
+ <color name="system_outline_variant_dark">#44464F</color>
+ <color name="system_error_dark">#FFB4AB</color>
+ <color name="system_on_error_dark">#690005</color>
+ <color name="system_error_container_dark">#93000A</color>
+ <color name="system_on_error_container_dark">#FFDAD6</color>
+ <color name="system_control_activated_dark">#2F4578</color>
+ <color name="system_control_normal_dark">#C5C6D0</color>
+ <color name="system_control_highlight_dark">#FFFFFF</color>
+ <color name="system_text_primary_inverse_dark">#1A1B20</color>
+ <color name="system_text_secondary_and_tertiary_inverse_dark">#44464F</color>
+ <color name="system_text_primary_inverse_disable_only_dark">#1A1B20</color>
+ <color name="system_text_secondary_and_tertiary_inverse_disabled_dark">#1A1B20</color>
+ <color name="system_text_hint_inverse_dark">#1A1B20</color>
+ <color name="system_palette_key_color_primary_dark">#6076AC</color>
+ <color name="system_palette_key_color_secondary_dark">#70778B</color>
+ <color name="system_palette_key_color_tertiary_dark">#8C6D8C</color>
+ <color name="system_palette_key_color_neutral_dark">#76777D</color>
+ <color name="system_palette_key_color_neutral_variant_dark">#757780</color>
+ <color name="system_primary_fixed">#D9E2FF</color>
+ <color name="system_primary_fixed_dim">#B0C6FF</color>
+ <color name="system_on_primary_fixed">#001945</color>
+ <color name="system_on_primary_fixed_variant">#2F4578</color>
+ <color name="system_secondary_fixed">#DCE2F9</color>
+ <color name="system_secondary_fixed_dim">#C0C6DC</color>
+ <color name="system_on_secondary_fixed">#151B2C</color>
+ <color name="system_on_secondary_fixed_variant">#404659</color>
+ <color name="system_tertiary_fixed">#FDD7FA</color>
+ <color name="system_tertiary_fixed_dim">#E0BBDD</color>
+ <color name="system_on_tertiary_fixed">#2A122C</color>
+ <color name="system_on_tertiary_fixed_variant">#593D59</color>
</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 648a50c..507ce9a 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -77,6 +77,7 @@
<string name="taskbar_view_callbacks_factory_class" translatable="false"></string>
<string name="launcher_restore_event_logger_class" translatable="false"></string>
<string name="taskbar_edu_tooltip_controller_class" translatable="false"></string>
+ <string name="contextual_edu_manager_class" translatable="false"></string>
<!-- Used for determining category of a widget presented in widget recommendations. -->
<string name="widget_recommendation_category_provider_class" translatable="false"></string>
<string name="api_wrapper_class" translatable="false"></string>
@@ -103,8 +104,8 @@
<item name="swipe_up_rect_scale_stiffness" type="dimen" format="float">200</item>
<item name="swipe_up_rect_scale_higher_stiffness" type="dimen" format="float">400</item>
<!-- Flag: enableScalingRevealHomeAnimation() -->
- <item name="swipe_up_rect_scale_damping_ratio_v2" type="dimen" format="float">0.8</item>
- <item name="swipe_up_rect_scale_stiffness_v2" type="dimen" format="float">650</item>
+ <item name="swipe_up_rect_scale_damping_ratio_v2" type="dimen" format="float">0.99</item>
+ <item name="swipe_up_rect_scale_stiffness_v2" type="dimen" format="float">500</item>
<item name="swipe_up_rect_xy_fling_friction" type="dimen" format="float">1.5</item>
@@ -114,9 +115,9 @@
<item name="swipe_up_rect_xy_stiffness" type="dimen" format="float">200</item>
<!-- Flag: enableScalingRevealHomeAnimation() -->
<item name="swipe_up_rect_x_damping_ratio" type="dimen" format="float">0.965</item>
- <item name="swipe_up_rect_x_stiffness" type="dimen" format="float">300</item>
+ <item name="swipe_up_rect_x_stiffness" type="dimen" format="float">450</item>
<item name="swipe_up_rect_y_damping_ratio" type="dimen" format="float">0.95</item>
- <item name="swipe_up_rect_y_stiffness" type="dimen" format="float">190</item>
+ <item name="swipe_up_rect_y_stiffness" type="dimen" format="float">400</item>
<!-- Taskbar -->
<!-- This is a float because it is converted to dp later in DeviceProfile -->
@@ -155,11 +156,6 @@
<string-array name="filtered_components" ></string-array>
- <!-- Widget component names to be included in weather category of widget suggestions. -->
- <string-array name="weather_recommendations"></string-array>
- <!-- Widget component names to be included in fitness category of widget suggestions. -->
- <string-array name="fitness_recommendations"></string-array>
-
<!-- Swipe back to home related -->
<dimen name="swipe_back_window_scale_x_margin">10dp</dimen>
<dimen name="swipe_back_window_corner_radius">40dp</dimen>
@@ -223,4 +219,11 @@
<string-array name="skip_private_profile_shortcut_packages" translatable="false">
<item>com.android.settings</item>
</string-array>
+
+ <!-- Legacy list of components supporting multiple instances.
+ DO NOT ADD TO THIS LIST. Apps should use the PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI
+ property to declare multi-instance support in V+. This resource should match the resource
+ of the same name in SystemUI. -->
+ <string-array name="config_appsSupportMultiInstancesSplit">
+ </string-array>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1bf59e8..f8c075f 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -81,6 +81,11 @@
<dimen name="fastscroll_popup_text_size">32dp</dimen>
<dimen name="fastscroll_popup_margin">19dp</dimen>
+ <dimen name="fastscroll_list_letter_size">5dp</dimen>
+ <dimen name="fastscroll_list_letter_text_size">14sp</dimen>
+ <dimen name="fastscroll_list_letter_end_margin">-10dp</dimen>
+ <dimen name="bg_letter_list_text_size">20sp</dimen>
+
<!--
Fast scroller draws the content horizontally centered. The end of the track should be
aligned at the end of the container.
@@ -167,31 +172,48 @@
<!-- (x) icon button inside work edu card -->
<dimen name="rounded_button_width">24dp</dimen>
<dimen name="x_icon_size">16dp</dimen>
- <dimen name="x_icon_padding">4dp</dimen>
<!-- rounded button shown inside card views, and snack bars -->
<dimen name="padded_rounded_button_height">48dp</dimen>
<dimen name="rounded_button_height">48dp</dimen>
<dimen name="rounded_button_radius">200dp</dimen>
- <dimen name="rounded_button_padding">8dp</dimen>
-
<!-- Widget tray -->
<dimen name="widget_cell_vertical_padding">8dp</dimen>
<dimen name="widget_cell_horizontal_padding">8dp</dimen>
- <dimen name="widget_cell_font_size">14sp</dimen>
+ <dimen name="widget_cell_title_font_size">14sp</dimen>
+ <integer name="widget_cell_title_font_weight">500</integer>
+ <dimen name="widget_cell_title_line_height">20sp</dimen>
+ <dimen name="widget_cell_dims_font_size">14sp</dimen>
+ <integer name="widget_cell_dims_font_weight">400</integer>
+ <dimen name="widget_cell_dims_line_height">20sp</dimen>
+ <dimen name="widget_cell_description_font_size">12sp</dimen>
+ <integer name="widget_cell_description_font_weight">400</integer>
+ <dimen name="widget_cell_description_line_height">16sp</dimen>
<dimen name="widget_cell_app_icon_size">24dp</dimen>
<dimen name="widget_cell_app_icon_padding">8dp</dimen>
<dimen name="widget_cell_add_button_height">48dp</dimen>
<dimen name="widget_cell_add_button_start_padding">8dp</dimen>
+ <dimen name="widget_cell_add_icon_button_start_padding">16dp</dimen>
<dimen name="widget_cell_add_button_end_padding">16dp</dimen>
<dimen name="widget_cell_add_button_scroll_padding">24dp</dimen>
+ <dimen name="widget_cell_add_button_font_size">14sp</dimen>
+ <integer name="widget_cell_add_button_font_weight">500</integer>
+ <dimen name="widget_cell_add_button_line_height">20sp</dimen>
+ <dimen name="widget_cell_add_button_drawable_padding">8dp</dimen>
+ <dimen name="widget_cell_add_button_drawable_width">19dp</dimen>
<dimen name="widget_tabs_button_horizontal_padding">4dp</dimen>
<dimen name="widget_tabs_horizontal_padding">16dp</dimen>
<dimen name="widget_apps_tabs_vertical_padding">6dp</dimen>
<dimen name="widget_picker_landscape_tablet_left_right_margin">117dp</dimen>
<dimen name="widget_picker_two_panels_left_right_margin">0dp</dimen>
+ <dimen name="widget_picker_header_app_title_font_size">16sp</dimen>
+ <integer name="widget_picker_header_app_title_font_weight">500</integer>
+ <dimen name="widget_picker_header_app_title_line_height">24sp</dimen>
+ <dimen name="widget_picker_header_app_subtitle_font_size">14sp</dimen>
+ <integer name="widget_picker_header_app_subtitle_font_weight">400</integer>
+ <dimen name="widget_picker_header_app_subtitle_line_height">20sp</dimen>
<dimen name="widget_recommendations_table_vertical_padding">8dp</dimen>
<!-- Bottom margin for the search and recommended widgets container without work profile -->
<dimen name="search_and_recommended_widgets_container_bottom_margin">16dp</dimen>
@@ -289,6 +311,7 @@
<dimen name="blur_size_medium_outline">2dp</dimen>
<dimen name="blur_size_click_shadow">4dp</dimen>
<dimen name="click_shadow_high_shift">2dp</dimen>
+ <dimen name="app_title_icon_shadow_inset">0.5dp</dimen>
<!-- Pending widget -->
<dimen name="pending_widget_min_padding">8dp</dimen>
@@ -301,6 +324,8 @@
<dimen name="bg_popup_item_height">52dp</dimen>
<dimen name="bg_popup_item_vertical_padding">12dp</dimen>
<dimen name="pre_drag_view_scale">6dp</dimen>
+ <!-- Minimum size of the widget dragged view to keep it visible under the finger. -->
+ <dimen name="widget_drag_view_min_scale_down_size">70dp</dimen>
<!-- an icon with shortcuts must be dragged this far before the container is removed. -->
<dimen name="deep_shortcuts_start_drag_threshold">16dp</dimen>
<!-- Possibly related to b/235886078, icon needs to be scaled up to match expected visual size of 32 dp -->
@@ -397,6 +422,9 @@
<dimen name="taskbar_running_app_indicator_height">0dp</dimen>
<dimen name="taskbar_running_app_indicator_width">0dp</dimen>
<dimen name="taskbar_running_app_indicator_top_margin">0dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_height">0dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_width">0dp</dimen>
+ <dimen name="taskbar_minimized_app_indicator_top_margin">0dp</dimen>
<!-- Transient taskbar (placeholders to compile in Launcher3 without Quickstep) -->
<dimen name="transient_taskbar_padding">0dp</dimen>
@@ -424,12 +452,16 @@
<!-- Size of the maximum radius for the enforced rounded rectangles. -->
<dimen name="enforced_rounded_corner_max_radius">16dp</dimen>
+ <!-- Size of the radius for the rounded corners of Persistent Taskbar. -->
+ <dimen name="persistent_taskbar_corner_radius">16dp</dimen>
+
<!-- Base Swipe Detector, speed in dp/s -->
<dimen name="base_swift_detector_fling_release_velocity">1dp</dimen>
<!-- Overview placeholder to compile in Launcher3 without Quickstep -->
<dimen name="task_thumbnail_icon_size">0dp</dimen>
<dimen name="task_thumbnail_icon_drawable_size">0dp</dimen>
+ <dimen name="task_thumbnail_splash_icon_size">0dp</dimen>
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
<dimen name="task_thumbnail_icon_menu_drawable_touch_size">0dp</dimen>
<dimen name="task_menu_edge_padding">0dp</dimen>
@@ -456,8 +488,6 @@
<dimen name="split_instructions_bottom_margin_phone_landscape">24dp</dimen>
<dimen name="split_instructions_bottom_margin_phone_portrait">60dp</dimen>
<dimen name="split_instructions_start_margin_cancel">8dp</dimen>
- <dimen name="split_divider_handle_region_width">96dp</dimen>
- <dimen name="split_divider_handle_region_height">48dp</dimen>
<dimen name="focus_outline_radius">16dp</dimen>
<dimen name="focus_inner_outline_radius">14dp</dimen>
@@ -496,7 +526,7 @@
<dimen name="default_ime_height">300dp</dimen>
<!-- Private Space parameters -->
- <dimen name="ps_container_corner_radius">24dp</dimen>
+ <dimen name="ps_container_corner_radius">28dp</dimen>
<dimen name="ps_header_height">72dp</dimen>
<dimen name="ps_header_relative_layout_height">48dp</dimen>
<dimen name="ps_header_image_height">48dp</dimen>
@@ -507,7 +537,8 @@
<dimen name="ps_button_height">40dp</dimen>
<dimen name="ps_button_width">40dp</dimen>
<dimen name="ps_lock_button_width">89dp</dimen>
- <dimen name="ps_app_divider_padding">16dp</dimen>
+ <dimen name="ps_app_divider_horizontal_padding">16dp</dimen>
+ <dimen name="ps_app_divider_vertical_padding">32dp</dimen>
<dimen name="ps_extra_bottom_padding">16dp</dimen>
<dimen name="ps_lock_corner_radius">20dp</dimen>
<dimen name="ps_lock_icon_size">20dp</dimen>
@@ -516,6 +547,8 @@
<dimen name="ps_lock_icon_text_margin_start_expanded">8dp</dimen>
<dimen name="ps_lock_icon_text_margin_end_expanded">6dp</dimen>
<dimen name="ps_lock_button_background_padding">10dp</dimen>
+ <dimen name="ps_floating_mask_corner_radius">28dp</dimen>
+ <dimen name="ps_floating_mask_end_padding">16dp</dimen>
<!-- WindowManagerProxy -->
<dimen name="max_width_and_height_of_small_display_cutout">136px</dimen>
diff --git a/res/values/id.xml b/res/values/id.xml
index 7bb9396..28496b5 100644
--- a/res/values/id.xml
+++ b/res/values/id.xml
@@ -19,9 +19,6 @@
<item type="id" name="view_type_widgets_space" />
<item type="id" name="view_type_widgets_list" />
<item type="id" name="view_type_widgets_header" />
- <!-- Used for A11y actions in staged split to identify each task uniquely -->
- <item type="id" name="split_topLeft_appInfo" />
- <item type="id" name="split_bottomRight_appInfo" />
<!-- Accessibility actions -->
<item type="id" name="action_remove" />
@@ -37,6 +34,12 @@
<item type="id" name="action_remote_action_shortcut" />
<item type="id" name="action_dismiss_prediction" />
<item type="id" name="action_pin_prediction"/>
+ <item type="id" name="action_close"/>
+ <!-- Used for A11y actions in staged split to identify each task uniquely -->
+ <item type="id" name="action_app_info_top_left" />
+ <item type="id" name="action_app_info_bottom_right" />
+ <item type="id" name="action_digital_wellbeing_top_left" />
+ <item type="id" name="action_digital_wellbeing_bottom_right" />
<!-- QSB IDs. DO not change -->
<item type="id" name="search_container_workspace" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c971223..fd724a5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -36,11 +36,14 @@
<string name="shortcut_not_available">Shortcut isn\'t available</string>
<!-- User visible name for the launcher/home screen. [CHAR_LIMIT=30] -->
<string name="home_screen">Home</string>
+ <!-- Description for setting the current launcher as the default home app. [CHAR_LIMIT=none]-->
+ <string name="set_default_home_app">Set <xliff:g id="launcher_name" example="Launcher3">%1$s</xliff:g> as default home app in Settings</string>
<!-- Options for recent tasks -->
<!-- Title for an option to enter split screen mode for a given app -->
<string name="recent_task_option_split_screen">Split screen</string>
<string name="split_app_info_accessibility">App info for %1$s</string>
+ <string name="split_app_usage_settings">Usage settings for %1$s</string>
<!-- App pairs -->
<string name="save_app_pair">Save app pair</string>
@@ -58,6 +61,12 @@
<string name="long_press_widget_to_add">Touch & hold to move a widget.</string>
<!-- Accessibility spoken hint message in widget picker, which allows user to add a widget. Custom action is the label for additional accessibility actions available in this mode [CHAR_LIMIT=100] -->
<string name="long_accessible_way_to_add">Double-tap & hold to move a widget or use custom actions.</string>
+ <!-- Accessibility label for the icon button shown in the widget picker that opens a overflow
+ menu with widgets viewing options. [CHAR_LIMIT=25] -->
+ <string name="widget_picker_widget_options_button_description">More options</string>
+ <!-- Label for the checkbox shown in the widget picker toggles whether to show all widgets or
+ the default set. [CHAR_LIMIT=25] -->
+ <string name="widget_picker_show_all_widgets_menu_item_title">Show all widgets</string>
<!-- The format string for the dimensions of a widget in the drawer -->
<!-- There is a special version of this format string for Farsi -->
<string name="widget_dims_format">%1$d \u00d7 %2$d</string>
@@ -83,13 +92,20 @@
<!-- Widget suggestions header title in the full widgets picker for large screen devices
in landscape mode. [CHAR_LIMIT=50] -->
<string name="suggested_widgets_header_title">Suggestions</string>
+ <!-- Title for the widget suggestions category that displays widgets provided by
+ productivity apps for daily use [CHAR_LIMIT=50] -->
<string name="productivity_widget_recommendation_category_label">Essentials</string>
+ <!-- Title for the widget suggestions category that displays widgets provided by
+ news and magazines related apps [CHAR_LIMIT=50] -->
<string name="news_widget_recommendation_category_label">News & magazines</string>
- <string name="social_and_entertainment_widget_recommendation_category_label">Your Chill Zone</string>
+ <!-- Title for the widget suggestions category that displays widgets provided by
+ entertainment apps [CHAR_LIMIT=50] -->
<string name="entertainment_widget_recommendation_category_label">Entertainment</string>
+ <!-- Title for the widget suggestions category that displays widgets provided by
+ social apps [CHAR_LIMIT=50] -->
<string name="social_widget_recommendation_category_label">Social</string>
- <string name="fitness_widget_recommendation_category_label">Health & fitness</string>
- <string name="weather_widget_recommendation_category_label">Weather</string>
+ <!-- Title for the widget suggestions category that displays general widget suggestions
+ [CHAR_LIMIT=50] -->
<string name="others_widget_recommendation_category_label">Suggested for you</string>
<!-- accessibilityPaneTitle for the right pane when showing suggested widgets. -->
<string name="widget_picker_right_pane_accessibility_title"><xliff:g id="selected_header" example="Calendar">%1$s</xliff:g> widgets on right, search and options on left</string>
@@ -191,13 +207,16 @@
<string name="app_info_drop_target_label">App info</string>
<!-- Label for install to private profile shortcut label. [CHAR_LIMIT=20] -->
<string name="install_private_system_shortcut_label">Install in private</string>
+ <!-- Label for uninstall app private profile shortcut.-->
+ <string name="uninstall_private_system_shortcut_label">Uninstall app</string>
<!-- Label for install drop target. [CHAR_LIMIT=20] -->
<string name="install_drop_target_label">Install</string>
<!-- Label for dismiss prediction. -->
<string name="dismiss_prediction_label">Don\'t suggest app</string>
<!-- Label for pinning predicted app. -->
<string name="pin_prediction">Pin Prediction</string>
-
+ <!-- Label for bubbling a launcher item. [CHAR_LIMIT=20] -->
+ <string name="bubble">Bubble</string>
<!-- Permissions: -->
<skip />
@@ -333,7 +352,7 @@
<!-- Title for an app whose download has been started. -->
<string name="app_waiting_download_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> waiting to install</string>
<!-- Title for an app which is archived. -->
- <string name="app_archived_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> is archived. Tap to download.</string>
+ <string name="app_archived_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> is archived. Tap to download and restore.</string>
<!-- Title shown on the alert dialog prompting the user to update the application in market
@@ -485,11 +504,7 @@
<!-- Description for Private Space Transition button -->
<string name="ps_container_transition">Private Space Transitioning</string>
<!-- Title for Private Space install app icon -->
- <string name="ps_add_button_label">Install apps</string>
+ <string name="ps_add_button_label">Install</string>
<!-- Content description for install app icon -->
<string name="ps_add_button_content_description">Install apps to Private Space</string>
-
- <!-- Strings for bubble bar -->
- <!-- content description for the overflow bubble [CHAR_LIMIT=none] -->
- <string name="bubble_bar_overflow_description">Overflow</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 00b962e..ee7ed26 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -17,7 +17,7 @@
*/
-->
-<resources>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Launcher theme -->
<style name="BaseLauncherTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="disabledIconAlpha">.54</item>
@@ -29,17 +29,65 @@
<item name="android:windowShowWallpaper">true</item>
</style>
- <style name="LauncherTheme" parent="@style/BaseLauncherTheme">
+ <style name="DynamicColorsBaseLauncherTheme" parent="@style/BaseLauncherTheme">
+ <item name="materialColorOnSecondaryFixedVariant">@color/system_on_secondary_fixed_variant</item>
+ <item name="materialColorOnTertiaryFixedVariant">@color/system_on_tertiary_fixed_variant</item>
+ <item name="materialColorSurfaceContainerLowest">@color/system_surface_container_lowest_light</item>
+ <item name="materialColorOnPrimaryFixedVariant">@color/system_on_primary_fixed_variant</item>
+ <item name="materialColorOnSecondaryContainer">@color/system_on_secondary_container_light</item>
+ <item name="materialColorOnTertiaryContainer">@color/system_on_tertiary_container_light</item>
+ <item name="materialColorSurfaceContainerLow">@color/system_surface_container_low_light</item>
+ <item name="materialColorOnPrimaryContainer">@color/system_on_primary_container_light</item>
+ <item name="materialColorSecondaryFixedDim">@color/system_secondary_fixed_dim</item>
+ <item name="materialColorOnErrorContainer">@color/system_on_error_container_light</item>
+ <item name="materialColorOnSecondaryFixed">@color/system_on_secondary_fixed</item>
+ <item name="materialColorOnSurfaceInverse">@color/system_on_surface_dark</item>
+ <item name="materialColorTertiaryFixedDim">@color/system_tertiary_fixed_dim</item>
+ <item name="materialColorOnTertiaryFixed">@color/system_on_tertiary_fixed</item>
+ <item name="materialColorPrimaryFixedDim">@color/system_primary_fixed_dim</item>
+ <item name="materialColorSecondaryContainer">@color/system_secondary_container_light</item>
+ <item name="materialColorErrorContainer">@color/system_error_container_light</item>
+ <item name="materialColorOnPrimaryFixed">@color/system_on_primary_fixed</item>
+ <item name="materialColorPrimaryInverse">@color/system_primary_dark</item>
+ <item name="materialColorSecondaryFixed">@color/system_secondary_fixed</item>
+ <item name="materialColorSurfaceInverse">@color/system_surface_dark</item>
+ <item name="materialColorSurfaceVariant">@color/system_surface_variant_light</item>
+ <item name="materialColorTertiaryContainer">@color/system_tertiary_container_light</item>
+ <item name="materialColorTertiaryFixed">@color/system_tertiary_fixed</item>
+ <item name="materialColorPrimaryContainer">@color/system_primary_container_light</item>
+ <item name="materialColorOnBackground">@color/system_on_background_light</item>
+ <item name="materialColorPrimaryFixed">@color/system_primary_fixed</item>
+ <item name="materialColorOnSecondary">@color/system_on_secondary_light</item>
+ <item name="materialColorOnTertiary">@color/system_on_tertiary_light</item>
+ <item name="materialColorSurfaceDim">@color/system_surface_dim_light</item>
+ <item name="materialColorSurfaceBright">@color/system_surface_bright_light</item>
+ <item name="materialColorOnError">@color/system_on_error_light</item>
+ <item name="materialColorSurface">@color/system_surface_light</item>
+ <item name="materialColorSurfaceContainerHigh">@color/system_surface_container_high_light</item>
+ <item name="materialColorSurfaceContainerHighest">@color/system_surface_container_highest_light</item>
+ <item name="materialColorOnSurfaceVariant">@color/system_on_surface_variant_light</item>
+ <item name="materialColorOutline">@color/system_outline_light</item>
+ <item name="materialColorOutlineVariant">@color/system_outline_variant_light</item>
+ <item name="materialColorOnPrimary">@color/system_on_primary_light</item>
+ <item name="materialColorOnSurface">@color/system_on_surface_light</item>
+ <item name="materialColorSurfaceContainer">@color/system_surface_container_light</item>
+ <item name="materialColorPrimary">@color/system_primary_light</item>
+ <item name="materialColorSecondary">@color/system_secondary_light</item>
+ <item name="materialColorTertiary">@color/system_tertiary_light</item>
+ <item name="materialColorError">@color/system_error_light</item>
+ </style>
+
+
+ <style name="LauncherTheme" parent="@style/DynamicColorsBaseLauncherTheme">
<item name="android:textColorSecondary">#DE000000</item>
<item name="allAppsScrimColor">?attr/materialColorSurfaceDim</item>
- <item name="allappsHeaderProtectionColor">
- @color/material_color_surface_container_highest</item>
+ <item name="allappsHeaderProtectionColor">?attr/materialColorSurfaceContainerHighest</item>
<item name="allAppsNavBarScrimColor">#66FFFFFF</item>
<item name="popupColorPrimary">@color/popup_color_primary_light</item>
<item name="popupColorSecondary">@color/popup_color_secondary_light</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_light</item>
<item name="popupColorBackground">#EFEDED</item>
- <item name="popupTextColor">@color/popup_text_color_light</item>
+ <item name="popupTextColor">@color/system_on_surface_light</item>
<item name="popupShadeFirst">@color/popup_shade_first_light</item>
<item name="popupShadeSecond">@color/popup_shade_second_light</item>
<item name="popupShadeThird">@color/popup_shade_third_light</item>
@@ -53,15 +101,15 @@
<item name="workspaceKeyShadowColor">#89000000</item>
<item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="pageIndicatorDotColor">@color/page_indicator_dot_color_light</item>
- <item name="focusOutlineColor">@color/material_color_secondary_fixed</item>
- <item name="focusInnerOutlineColor">@color/material_color_on_secondary_fixed_variant</item>
+ <item name="focusOutlineColor">?attr/materialColorSecondaryFixed</item>
+ <item name="focusInnerOutlineColor">?attr/materialColorOnSecondaryFixedVariant</item>
<item name="folderPreviewColor">@color/folder_preview_light</item>
<item name="folderBackgroundColor">@color/folder_background_light</item>
<item name="folderIconBorderColor">?android:attr/colorPrimary</item>
<item name="isFolderDarkText">true</item>
<item name="folderTextColor">@color/folder_text_color_light</item>
<item name="folderHintTextColor">@color/folder_hint_text_color_light</item>
- <item name="appPairSurfaceInFolder">@color/material_color_surface_container_lowest</item>
+ <item name="appPairSurfaceInFolder">?attr/materialColorSurfaceContainerLowest</item>
<item name="loadingIconColor">#CCFFFFFF</item>
<item name="iconOnlyShortcutColor">?android:attr/textColorSecondary</item>
<item name="eduHalfSheetBGColor">?android:attr/colorAccent</item>
@@ -78,51 +126,6 @@
<item name="android:statusBarColor">#00000000</item>
<item name="android:navigationBarColor">#00000000</item>
<item name="android:switchStyle">@style/SwitchStyle</item>
-
- <item name="materialColorOnSecondaryFixedVariant">@color/material_color_on_secondary_fixed_variant</item>
- <item name="materialColorOnTertiaryFixedVariant">@color/material_color_on_tertiary_fixed_variant</item>
- <item name="materialColorSurfaceContainerLowest">@color/material_color_surface_container_lowest</item>
- <item name="materialColorOnPrimaryFixedVariant">@color/material_color_on_primary_fixed_variant</item>
- <item name="materialColorOnSecondaryContainer">@color/material_color_on_secondary_container</item>
- <item name="materialColorOnTertiaryContainer">@color/material_color_on_tertiary_container</item>
- <item name="materialColorSurfaceContainerLow">@color/material_color_surface_container_low</item>
- <item name="materialColorOnPrimaryContainer">@color/material_color_on_primary_container</item>
- <item name="materialColorSecondaryFixedDim">@color/material_color_secondary_fixed_dim</item>
- <item name="materialColorOnErrorContainer">@color/material_color_on_error_container</item>
- <item name="materialColorOnSecondaryFixed">@color/material_color_on_secondary_fixed</item>
- <item name="materialColorOnSurfaceInverse">@color/material_color_on_surface_inverse</item>
- <item name="materialColorTertiaryFixedDim">@color/material_color_tertiary_fixed_dim</item>
- <item name="materialColorOnTertiaryFixed">@color/material_color_on_tertiary_fixed</item>
- <item name="materialColorPrimaryFixedDim">@color/material_color_primary_fixed_dim</item>
- <item name="materialColorSecondaryContainer">@color/material_color_secondary_container</item>
- <item name="materialColorErrorContainer">@color/material_color_error_container</item>
- <item name="materialColorOnPrimaryFixed">@color/material_color_on_primary_fixed</item>
- <item name="materialColorPrimaryInverse">@color/material_color_primary_inverse</item>
- <item name="materialColorSecondaryFixed">@color/material_color_secondary_fixed</item>
- <item name="materialColorSurfaceInverse">@color/material_color_surface_inverse</item>
- <item name="materialColorSurfaceVariant">@color/material_color_surface_variant</item>
- <item name="materialColorTertiaryContainer">@color/material_color_tertiary_container</item>
- <item name="materialColorTertiaryFixed">@color/material_color_tertiary_fixed</item>
- <item name="materialColorPrimaryContainer">@color/material_color_primary_container</item>
- <item name="materialColorOnBackground">@color/material_color_on_background</item>
- <item name="materialColorPrimaryFixed">@color/material_color_primary_fixed</item>
- <item name="materialColorOnSecondary">@color/material_color_on_secondary</item>
- <item name="materialColorOnTertiary">@color/material_color_on_tertiary</item>
- <item name="materialColorSurfaceDim">@color/material_color_surface_dim</item>
- <item name="materialColorSurfaceBright">@color/material_color_surface_bright</item>
- <item name="materialColorOnError">@color/material_color_on_error</item>
- <item name="materialColorSurface">@color/material_color_surface</item>
- <item name="materialColorSurfaceContainerHigh">@color/material_color_surface_container_high</item>
- <item name="materialColorSurfaceContainerHighest">@color/material_color_surface_container_highest</item>
- <item name="materialColorOnSurfaceVariant">@color/material_color_on_surface_variant</item>
- <item name="materialColorOutline">@color/material_color_outline</item>
- <item name="materialColorOutlineVariant">@color/material_color_outline_variant</item>
- <item name="materialColorOnPrimary">@color/material_color_on_primary</item>
- <item name="materialColorOnSurface">@color/material_color_on_surface</item>
- <item name="materialColorSurfaceContainer">@color/material_color_surface_container</item>
- <item name="materialColorPrimary">@color/material_color_primary</item>
- <item name="materialColorSecondary">@color/material_color_secondary</item>
- <item name="materialColorTertiary">@color/material_color_tertiary</item>
</style>
<style name="SwitchStyle"
@@ -153,13 +156,13 @@
<item name="android:colorControlHighlight">#19FFFFFF</item>
<item name="android:colorPrimary">#FF212121</item>
<item name="allAppsScrimColor">?attr/materialColorSurfaceDim</item>
- <item name="allappsHeaderProtectionColor">@color/material_color_surface_container_low</item>
+ <item name="allappsHeaderProtectionColor">?attr/materialColorSurfaceContainerLow</item>
<item name="allAppsNavBarScrimColor">#80000000</item>
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
<item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_dark</item>
<item name="popupColorBackground">#1F2020</item>
- <item name="popupTextColor">@color/popup_text_color_dark</item>
+ <item name="popupTextColor">@color/system_on_surface_dark</item>
<item name="popupNotificationDotColor">@color/popup_notification_dot_dark</item>
<item name="popupShadeFirst">@color/popup_shade_first_dark</item>
<item name="popupShadeSecond">@color/popup_shade_second_dark</item>
@@ -173,7 +176,7 @@
<item name="isFolderDarkText">false</item>
<item name="folderTextColor">@color/folder_text_color_dark</item>
<item name="folderHintTextColor">@color/folder_hint_text_color_dark</item>
- <item name="appPairSurfaceInFolder">@color/material_color_surface_container_lowest</item>
+ <item name="appPairSurfaceInFolder">?attr/materialColorSurfaceContainerLowest</item>
<item name="isMainColorDark">true</item>
<item name="loadingIconColor">#99FFFFFF</item>
<item name="iconOnlyShortcutColor">#B3FFFFFF</item>
@@ -243,6 +246,8 @@
<item name="widgetPickerSecondarySurfaceColor">
@color/widget_picker_secondary_surface_color_light</item>
<item name="widgetPickerTitleColor">@color/widget_picker_title_color_light</item>
+ <item name="widgetPickerDescriptionColor">@color/widget_picker_description_color_light</item>
+ <item name="widgetPickerWidgetOptionsMenuColor">@color/widget_picker_menu_options_color_light</item>
<item name="widgetPickerHeaderAppTitleColor">
@color/widget_picker_header_app_title_color_light</item>
<item name="widgetPickerHeaderAppSubtitleColor">
@@ -268,6 +273,10 @@
@color/widget_picker_add_button_background_color_light</item>
<item name="widgetPickerAddButtonTextColor">
@color/widget_picker_add_button_text_color_light</item>
+ <item name="widgetCellTitleColor">
+ @color/widget_cell_title_color_light</item>
+ <item name="widgetCellSubtitleColor">
+ @color/widget_cell_subtitle_color_light</item>
</style>
<style name="WidgetContainerTheme.Dark" parent="AppTheme.Dark">
<item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
@@ -278,6 +287,8 @@
@color/widget_picker_secondary_surface_color_dark</item>
<item name="widgetPickerTitleColor">
@color/widget_picker_title_color_dark</item>
+ <item name="widgetPickerDescriptionColor">@color/widget_picker_description_color_dark</item>
+ <item name="widgetPickerWidgetOptionsMenuColor">@color/widget_picker_menu_options_color_dark</item>
<item name="widgetPickerHeaderAppTitleColor">
@color/widget_picker_header_app_title_color_dark</item>
<item name="widgetPickerHeaderAppSubtitleColor">
@@ -303,6 +314,10 @@
@color/widget_picker_add_button_background_color_dark</item>
<item name="widgetPickerAddButtonTextColor">
@color/widget_picker_add_button_text_color_dark</item>
+ <item name="widgetCellTitleColor">
+ @color/widget_cell_title_color_dark</item>
+ <item name="widgetCellSubtitleColor">
+ @color/widget_cell_subtitle_color_dark</item>
</style>
<style name="FastScrollerPopup" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle">
@@ -419,6 +434,9 @@
<item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowTranslucentStatus">true</item>
+ <!-- Add the dim background here, rather than in the activity layout as the window slides
+ in from the bottom, and we don't want the scrim to slide. -->
+ <item name="android:backgroundDimEnabled">true</item>
</style>
<style name="ProxyActivityStarterTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
@@ -450,7 +468,7 @@
<style name="PrivateSpaceHeaderTextStyle">
<item name="android:textSize">16sp</item>
- <item name="android:textColor">@color/material_color_on_surface</item>
+ <item name="android:textColor">?attr/materialColorOnSurface</item>
<item name="android:fontFamily">google-sans-text-medium</item>
<item name="android:ellipsize">end</item>
</style>
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 876b643..d3ee364 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -138,9 +138,6 @@
public static final int TYPE_TOUCH_CONTROLLER_NO_INTERCEPT = TYPE_ALL & ~TYPE_DISCOVERY_BOUNCE
& ~TYPE_LISTENER & ~TYPE_TASKBAR_OVERLAYS;
- public static final int TYPE_ALL_EXCEPT_ON_BOARD_POPUP = TYPE_ALL & ~TYPE_ON_BOARD_POPUP
- & ~TYPE_PIN_IME_POPUP;
-
protected boolean mIsOpen;
public AbstractFloatingView(Context context, AttributeSet attrs) {
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index b46d7e2..ef56246 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -37,6 +37,8 @@
import com.android.launcher3.celllayout.CellLayoutLayoutParams;
import com.android.launcher3.celllayout.CellPosMapper.CellPos;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.debug.TestEvent;
+import com.android.launcher3.debug.TestEventEmitter;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.logging.InstanceId;
@@ -136,6 +138,7 @@
private final Rect mWidgetViewNewRect = new Rect();
private final @Nullable LauncherAppWidgetHostView.CellChildViewPreLayoutListener
mCellChildViewPreLayoutListener;
+ private final @NonNull OnLayoutChangeListener mWidgetViewLayoutListener;
private int mXDown, mYDown;
@@ -177,6 +180,9 @@
mDragAcrossTwoPanelOpacityMargin = mLauncher.getResources().getDimensionPixelSize(
R.dimen.resize_frame_invalid_drag_across_two_panel_opacity_margin);
mDragLayerRelativeCoordinateHelper = new ViewGroupFocusHelper(mLauncher.getDragLayer());
+
+ mWidgetViewLayoutListener =
+ (v, l, t, r, b, oldL, oldT, oldR, oldB) -> setCornerRadiusFromWidget();
}
@Override
@@ -211,21 +217,27 @@
DragLayer dl = launcher.getDragLayer();
AppWidgetResizeFrame frame = (AppWidgetResizeFrame) launcher.getLayoutInflater()
.inflate(R.layout.app_widget_resize_frame, dl, false);
- if (widget.hasEnforcedCornerRadius()) {
- float enforcedCornerRadius = widget.getEnforcedCornerRadius();
- ImageView imageView = frame.findViewById(R.id.widget_resize_frame);
- Drawable d = imageView.getDrawable();
- if (d instanceof GradientDrawable) {
- GradientDrawable gd = (GradientDrawable) d.mutate();
- gd.setCornerRadius(enforcedCornerRadius);
- }
- }
frame.setupForWidget(widget, cellLayout, dl);
((DragLayer.LayoutParams) frame.getLayoutParams()).customPosition = true;
dl.addView(frame);
frame.mIsOpen = true;
frame.post(() -> frame.snapToWidget(false));
+ TestEventEmitter.INSTANCE.get(widget.getContext()).sendEvent(
+ TestEvent.RESIZE_FRAME_SHOWING
+ );
+ }
+
+ private void setCornerRadiusFromWidget() {
+ if (mWidgetView != null && mWidgetView.hasEnforcedCornerRadius()) {
+ float enforcedCornerRadius = mWidgetView.getEnforcedCornerRadius();
+ ImageView imageView = findViewById(R.id.widget_resize_frame);
+ Drawable d = imageView.getDrawable();
+ if (d instanceof GradientDrawable) {
+ GradientDrawable gd = (GradientDrawable) d.mutate();
+ gd.setCornerRadius(enforcedCornerRadius);
+ }
+ }
}
private void setupForWidget(LauncherAppWidgetHostView widgetView, CellLayout cellLayout,
@@ -317,6 +329,9 @@
.log(LAUNCHER_WIDGET_RESIZE_STARTED);
setOnKeyListener(this);
+
+ setCornerRadiusFromWidget();
+ mWidgetView.addOnLayoutChangeListener(mWidgetViewLayoutListener);
}
public boolean beginResizeIfPointInRegion(int x, int y) {
@@ -729,6 +744,7 @@
mWidgetView.setLayoutTransition(null);
}
mDragLayer.removeView(this);
+ mWidgetView.removeOnLayoutChangeListener(mWidgetViewLayoutListener);
}
private void updateInvalidResizeEffect(CellLayout cellLayout, CellLayout pairedCellLayout,
diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java
index cf86528..175d6ec 100644
--- a/src/com/android/launcher3/AutoInstallsLayout.java
+++ b/src/com/android/launcher3/AutoInstallsLayout.java
@@ -19,6 +19,8 @@
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME;
import static com.android.launcher3.provider.LauncherDbUtils.itemIdMatch;
+import static com.android.launcher3.util.UserIconInfo.TYPE_CLONED;
+import static com.android.launcher3.util.UserIconInfo.TYPE_WORK;
import android.content.ComponentName;
import android.content.ContentValues;
@@ -34,6 +36,7 @@
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Process;
+import android.os.UserHandle;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.AttributeSet;
@@ -56,6 +59,7 @@
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.Partner;
import com.android.launcher3.util.Thunk;
+import com.android.launcher3.util.UserIconInfo;
import com.android.launcher3.widget.LauncherWidgetHolder;
import org.xmlpull.v1.XmlPullParser;
@@ -63,6 +67,7 @@
import java.io.IOException;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.function.Supplier;
@@ -125,34 +130,38 @@
private static final String TAG_INCLUDE = "include";
public static final String TAG_WORKSPACE = "workspace";
private static final String TAG_APP_ICON = "appicon";
- private static final String TAG_AUTO_INSTALL = "autoinstall";
- private static final String TAG_FOLDER = "folder";
- private static final String TAG_APPWIDGET = "appwidget";
+ public static final String TAG_AUTO_INSTALL = "autoinstall";
+ public static final String TAG_FOLDER = "folder";
+ public static final String TAG_APPWIDGET = "appwidget";
protected static final String TAG_SEARCH_WIDGET = "searchwidget";
- private static final String TAG_SHORTCUT = "shortcut";
+ public static final String TAG_SHORTCUT = "shortcut";
private static final String TAG_EXTRA = "extra";
- private static final String ATTR_CONTAINER = "container";
- private static final String ATTR_RANK = "rank";
+ public static final String ATTR_CONTAINER = "container";
+ public static final String ATTR_RANK = "rank";
- private static final String ATTR_PACKAGE_NAME = "packageName";
- private static final String ATTR_CLASS_NAME = "className";
- private static final String ATTR_TITLE = "title";
- private static final String ATTR_TITLE_TEXT = "titleText";
- private static final String ATTR_SCREEN = "screen";
- private static final String ATTR_SHORTCUT_ID = "shortcutId";
+ public static final String ATTR_PACKAGE_NAME = "packageName";
+ public static final String ATTR_CLASS_NAME = "className";
+ public static final String ATTR_TITLE = "title";
+ public static final String ATTR_TITLE_TEXT = "titleText";
+ public static final String ATTR_SCREEN = "screen";
+ public static final String ATTR_SHORTCUT_ID = "shortcutId";
// x and y can be specified as negative integers, in which case -1 represents the
// last row / column, -2 represents the second last, and so on.
- private static final String ATTR_X = "x";
- private static final String ATTR_Y = "y";
+ public static final String ATTR_X = "x";
+ public static final String ATTR_Y = "y";
- private static final String ATTR_SPAN_X = "spanX";
- private static final String ATTR_SPAN_Y = "spanY";
+ public static final String ATTR_SPAN_X = "spanX";
+ public static final String ATTR_SPAN_Y = "spanY";
// Attrs for "Include"
private static final String ATTR_WORKSPACE = "workspace";
+ public static final String ATTR_USER_TYPE = "userType";
+ public static final String USER_TYPE_WORK = "work";
+ public static final String USER_TYPE_CLONED = "cloned";
+
// Style attrs -- "Extra"
private static final String ATTR_KEY = "key";
private static final String ATTR_VALUE = "value";
@@ -168,6 +177,8 @@
protected final SourceResources mSourceRes;
protected final Supplier<XmlPullParser> mInitialLayoutSupplier;
+ private final Map<String, Long> mUserTypeToSerial;
+
private final InvariantDeviceProfile mIdp;
private final int mRowCount;
private final int mColumnCount;
@@ -204,15 +215,25 @@
mRowCount = mIdp.numRows;
mColumnCount = mIdp.numColumns;
mActivityOverride = ApiWrapper.INSTANCE.get(context).getActivityOverrides();
+
+ mUserTypeToSerial = new HashMap<>();
+ UserCache cache = UserCache.getInstance(context);
+ for (UserHandle user : cache.getUserProfiles()) {
+ UserIconInfo uii = cache.getUserInfo(user);
+ switch (uii.type) {
+ case TYPE_WORK -> mUserTypeToSerial.put(USER_TYPE_WORK, uii.userSerial);
+ case TYPE_CLONED -> mUserTypeToSerial.put(USER_TYPE_CLONED, uii.userSerial);
+ }
+ }
}
/**
* Loads the layout in the db and returns the number of entries added on the desktop.
*/
- public int loadLayout(SQLiteDatabase db, IntArray screenIds) {
+ public int loadLayout(SQLiteDatabase db) {
mDb = db;
try {
- return parseLayout(mInitialLayoutSupplier.get(), screenIds);
+ return parseLayout(mInitialLayoutSupplier.get());
} catch (Exception e) {
Log.e(TAG, "Error parsing layout: ", e);
return -1;
@@ -222,7 +243,7 @@
/**
* Parses the layout and returns the number of elements added on the homescreen.
*/
- protected int parseLayout(XmlPullParser parser, IntArray screenIds)
+ protected int parseLayout(XmlPullParser parser)
throws XmlPullParserException, IOException {
beginDocument(parser, mRootTag);
final int depth = parser.getDepth();
@@ -235,7 +256,7 @@
if (type != XmlPullParser.START_TAG) {
continue;
}
- count += parseAndAddNode(parser, tagParserMap, screenIds);
+ count += parseAndAddNode(parser, tagParserMap);
}
return count;
}
@@ -259,14 +280,14 @@
* Parses the current node and returns the number of elements added.
*/
protected int parseAndAddNode(
- XmlPullParser parser, ArrayMap<String, TagParser> tagParserMap, IntArray screenIds)
+ XmlPullParser parser, ArrayMap<String, TagParser> tagParserMap)
throws XmlPullParserException, IOException {
if (TAG_INCLUDE.equals(parser.getName())) {
final int resId = getAttributeResourceValue(parser, ATTR_WORKSPACE, 0);
if (resId != 0) {
// recursively load some more favorites, why not?
- return parseLayout(mSourceRes.getXml(resId), screenIds);
+ return parseLayout(mSourceRes.getXml(resId));
} else {
return 0;
}
@@ -284,22 +305,17 @@
convertToDistanceFromEnd(getAttributeValue(parser, ATTR_X), mColumnCount));
mValues.put(Favorites.CELLY,
convertToDistanceFromEnd(getAttributeValue(parser, ATTR_Y), mRowCount));
+ Long profileId = mUserTypeToSerial.get(getAttributeValue(parser, ATTR_USER_TYPE));
+ if (profileId != null) {
+ mValues.put(Favorites.PROFILE_ID, profileId);
+ }
TagParser tagParser = tagParserMap.get(parser.getName());
if (tagParser == null) {
if (LOGD) Log.d(TAG, "Ignoring unknown element tag: " + parser.getName());
return 0;
}
- int newElementId = tagParser.parseAndAdd(parser);
- if (newElementId >= 0) {
- // Keep track of the set of screens which need to be added to the db.
- if (!screenIds.contains(screenId) &&
- container == Favorites.CONTAINER_DESKTOP) {
- screenIds.add(screenId);
- }
- return 1;
- }
- return 0;
+ return tagParser.parseAndAdd(parser) >= 0 ? 1 : 0;
}
protected int addShortcut(String title, Intent intent, int type) {
@@ -311,10 +327,11 @@
mValues.put(Favorites.SPANY, 1);
mValues.put(Favorites._ID, id);
- if (type == ITEM_TYPE_APPLICATION) {
- ComponentName cn = intent.getComponent();
- if (cn != null && mActivityOverride.containsKey(cn.getPackageName())) {
- LauncherActivityInfo replacementInfo = mActivityOverride.get(cn.getPackageName());
+ ComponentName cn = intent.getComponent();
+ if (cn != null && type == ITEM_TYPE_APPLICATION
+ && !mValues.containsKey(Favorites.PROFILE_ID)) {
+ LauncherActivityInfo replacementInfo = mActivityOverride.get(cn.getPackageName());
+ if (replacementInfo != null) {
mValues.put(Favorites.PROFILE_ID, UserCache.INSTANCE.get(mContext)
.getSerialNumberForUser(replacementInfo.getUser()));
mValues.put(Favorites.INTENT, AppInfo.makeLaunchIntent(replacementInfo).toUri(0));
@@ -420,11 +437,7 @@
}
mValues.put(Favorites.RESTORED, WorkspaceItemInfo.FLAG_AUTOINSTALL_ICON);
- final Intent intent = new Intent(Intent.ACTION_MAIN, null)
- .addCategory(Intent.CATEGORY_LAUNCHER)
- .setComponent(new ComponentName(packageName, className))
- .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
- | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ Intent intent = AppInfo.makeLaunchIntent(new ComponentName(packageName, className));
return addShortcut(mContext.getString(R.string.package_state_unknown), intent,
ITEM_TYPE_APPLICATION);
}
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index cf93a79..177b28c 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -140,14 +140,11 @@
}
protected void onDeviceProfileInitiated() {
- if (mDeviceProfile.isVerticalBarLayout()) {
- mDeviceProfile.updateIsSeascape(this);
- }
}
@Override
public void onDisplayInfoChanged(Context context, Info info, int flags) {
- if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.updateIsSeascape(this)) {
+ if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.isVerticalBarLayout()) {
reapplyUi();
}
}
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 2a8298f..26e900d 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -16,6 +16,8 @@
package com.android.launcher3;
+import static android.graphics.fonts.FontStyle.FONT_WEIGHT_BOLD;
+import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
import static android.text.Layout.Alignment.ALIGN_NORMAL;
import static com.android.launcher3.Flags.enableCursorHoverStates;
@@ -40,11 +42,15 @@
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.icu.text.MessageFormat;
+import android.text.Spannable;
+import android.text.SpannableString;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
+import android.text.style.ImageSpan;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.Property;
import android.util.Size;
import android.util.TypedValue;
@@ -54,6 +60,7 @@
import android.view.ViewDebug;
import android.widget.TextView;
+import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
@@ -96,6 +103,8 @@
public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
IconLabelDotView, DraggableView, Reorderable {
+ public static final String TAG = "BubbleTextView";
+
public static final int DISPLAY_WORKSPACE = 0;
public static final int DISPLAY_ALL_APPS = 1;
public static final int DISPLAY_FOLDER = 2;
@@ -111,6 +120,7 @@
private static final String EMPTY = "";
private static final StringMatcherUtility.StringMatcher MATCHER =
StringMatcherUtility.StringMatcher.getInstance();
+ private static final int BOLD_TEXT_ADJUSTMENT = FONT_WEIGHT_BOLD - FONT_WEIGHT_NORMAL;
private static final int[] STATE_PRESSED = new int[]{android.R.attr.state_pressed};
@@ -166,7 +176,7 @@
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mSkipUserBadge = false;
@ViewDebug.ExportedProperty(category = "launcher")
- private boolean mIsIconVisible = true;
+ protected boolean mIsIconVisible = true;
@ViewDebug.ExportedProperty(category = "launcher")
private int mTextColor;
@ViewDebug.ExportedProperty(category = "launcher")
@@ -186,9 +196,20 @@
// These fields, related to showing running apps, are only used for Taskbar.
private final Size mRunningAppIndicatorSize;
private final int mRunningAppIndicatorTopMargin;
+ private final Size mMinimizedAppIndicatorSize;
+ private final int mMinimizedAppIndicatorTopMargin;
private final Paint mRunningAppIndicatorPaint;
private final Rect mRunningAppIconBounds = new Rect();
- private boolean mIsRunning;
+ private RunningAppState mRunningAppState;
+
+ /**
+ * Various options for the running state of an app.
+ */
+ public enum RunningAppState {
+ NOT_RUNNING,
+ RUNNING,
+ MINIMIZED,
+ }
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mStayPressed;
@@ -259,9 +280,16 @@
mRunningAppIndicatorSize = new Size(
getResources().getDimensionPixelSize(R.dimen.taskbar_running_app_indicator_width),
getResources().getDimensionPixelSize(R.dimen.taskbar_running_app_indicator_height));
+ mMinimizedAppIndicatorSize = new Size(
+ getResources().getDimensionPixelSize(R.dimen.taskbar_minimized_app_indicator_width),
+ getResources().getDimensionPixelSize(
+ R.dimen.taskbar_minimized_app_indicator_height));
mRunningAppIndicatorTopMargin =
getResources().getDimensionPixelSize(
R.dimen.taskbar_running_app_indicator_top_margin);
+ mMinimizedAppIndicatorTopMargin =
+ getResources().getDimensionPixelSize(
+ R.dimen.taskbar_minimized_app_indicator_top_margin);
mRunningAppIndicatorPaint = new Paint();
mRunningAppIndicatorPaint.setColor(getResources().getColor(
R.color.taskbar_running_app_indicator_color, context.getTheme()));
@@ -412,10 +440,21 @@
setDownloadStateContentDescription(info, info.getProgressLevel());
}
+ /**
+ * Directly set the icon and label.
+ */
+ @UiThread
+ public void applyIconAndLabel(Drawable icon, CharSequence label) {
+ applyCompoundDrawables(icon);
+ setText(label);
+ setContentDescription(label);
+ }
+
/** Updates whether the app this view represents is currently running. */
@UiThread
- public void updateRunningState(boolean isRunning) {
- mIsRunning = isRunning;
+ public void updateRunningState(RunningAppState runningAppState) {
+ mRunningAppState = runningAppState;
+ invalidate();
}
protected void setItemInfo(ItemInfoWithIcon itemInfo) {
@@ -465,7 +504,13 @@
mLastOriginalText = label;
mLastModifiedText = mLastOriginalText;
mBreakPointsIntArray = StringMatcherUtility.getListOfBreakpoints(label, MATCHER);
- setText(label);
+ if (Flags.useNewIconForArchivedApps()
+ && info instanceof ItemInfoWithIcon infoWithIcon
+ && infoWithIcon.isInactiveArchive()) {
+ setTextWithArchivingIcon(label);
+ } else {
+ setText(label);
+ }
}
if (info.contentDescription != null) {
setContentDescription(info.isDisabled()
@@ -667,18 +712,20 @@
/** Draws a line under the app icon if this is representing a running app in Desktop Mode. */
protected void drawRunningAppIndicatorIfNecessary(Canvas canvas) {
- if (!mIsRunning || mDisplay != DISPLAY_TASKBAR) {
+ if (mRunningAppState == RunningAppState.NOT_RUNNING || mDisplay != DISPLAY_TASKBAR) {
return;
}
getIconBounds(mRunningAppIconBounds);
// TODO(b/333872717): update color, shape, and size of indicator
- int indicatorTop = mRunningAppIconBounds.bottom + mRunningAppIndicatorTopMargin;
- canvas.drawRect(
- mRunningAppIconBounds.centerX() - mRunningAppIndicatorSize.getWidth() / 2,
- indicatorTop,
- mRunningAppIconBounds.centerX() + mRunningAppIndicatorSize.getWidth() / 2,
- indicatorTop + mRunningAppIndicatorSize.getHeight(),
- mRunningAppIndicatorPaint);
+ boolean isMinimized = mRunningAppState == RunningAppState.MINIMIZED;
+ int indicatorTop =
+ mRunningAppIconBounds.bottom + (isMinimized ? mMinimizedAppIndicatorTopMargin
+ : mRunningAppIndicatorTopMargin);
+ final Size indicatorSize =
+ isMinimized ? mMinimizedAppIndicatorSize : mRunningAppIndicatorSize;
+ canvas.drawRect(mRunningAppIconBounds.centerX() - indicatorSize.getWidth() / 2,
+ indicatorTop, mRunningAppIconBounds.centerX() + indicatorSize.getWidth() / 2,
+ indicatorTop + indicatorSize.getHeight(), mRunningAppIndicatorPaint);
}
@Override
@@ -773,7 +820,13 @@
getLineSpacingExtra());
if (!TextUtils.equals(modifiedString, mLastModifiedText)) {
mLastModifiedText = modifiedString;
- setText(modifiedString);
+ if (Flags.useNewIconForArchivedApps()
+ && getTag() instanceof ItemInfoWithIcon infoWithIcon
+ && infoWithIcon.isInactiveArchive()) {
+ setTextWithArchivingIcon(modifiedString);
+ } else {
+ setText(modifiedString);
+ }
// if text contains NEW_LINE, set max lines to 2
if (TextUtils.indexOf(modifiedString, NEW_LINE) != -1) {
setSingleLine(false);
@@ -794,6 +847,44 @@
super.setTextColor(getModifiedColor());
}
+ /**
+ * Sets text with a start icon for App Archiving.
+ * Uses a bolded drawable if text is bolded.
+ * @param text
+ */
+ private void setTextWithArchivingIcon(CharSequence text) {
+ var drawableId = R.drawable.cloud_download_24px;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S
+ && getResources().getConfiguration().fontWeightAdjustment >= BOLD_TEXT_ADJUSTMENT) {
+ // If System bold text setting is on, then use a bolded icon
+ drawableId = R.drawable.cloud_download_semibold_24px;
+ }
+ setTextWithStartIcon(text, drawableId);
+ }
+
+ /**
+ * Uses a SpannableString to set text with a Drawable at the start of the TextView
+ * @param text text to use for TextView
+ * @param drawableId Drawable Resource to use for drawing image at start of text
+ */
+ @VisibleForTesting
+ public void setTextWithStartIcon(CharSequence text, @DrawableRes int drawableId) {
+ Drawable drawable = getContext().getDrawable(drawableId);
+ if (drawable == null) {
+ setText(text);
+ Log.w(TAG, "setTextWithStartIcon: start icon Drawable not found from resources"
+ + ", will just set text instead.");
+ return;
+ }
+ drawable.setTint(getCurrentTextColor());
+ drawable.setBounds(0, 0, Math.round(getTextSize()), Math.round(getTextSize()));
+ ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_CENTER);
+ // First space will be replaced with Drawable, second space is for space before text.
+ SpannableString spannable = new SpannableString(" " + text);
+ spannable.setSpan(imageSpan, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
+ setText(spannable);
+ }
+
@Override
public void setTextColor(ColorStateList colors) {
mTextColor = colors.getDefaultColor();
@@ -952,12 +1043,11 @@
/** Applies the given progress level to the this icon's progress bar. */
@Nullable
public PreloadIconDrawable applyProgressLevel() {
- if (!(getTag() instanceof ItemInfoWithIcon)
+ if (!(getTag() instanceof ItemInfoWithIcon info)
|| ((ItemInfoWithIcon) getTag()).isInactiveArchive()) {
return null;
}
- ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();
int progressLevel = info.getProgressLevel();
if (progressLevel >= 100) {
setContentDescription(info.contentDescription != null
@@ -977,6 +1067,10 @@
} else {
preloadIconDrawable = makePreloadIcon();
setIcon(preloadIconDrawable);
+ if (info.isArchived() && Flags.useNewIconForArchivedApps()) {
+ // reapply text without cloud icon as soon as unarchiving is triggered
+ applyLabel(info);
+ }
}
return preloadIconDrawable;
}
@@ -1271,13 +1365,4 @@
public boolean canShowLongPressPopup() {
return getTag() instanceof ItemInfo && ShortcutUtil.supportsShortcuts((ItemInfo) getTag());
}
-
- /** Returns the package name of the app this icon represents. */
- public String getTargetPackageName() {
- Object tag = getTag();
- if (tag instanceof ItemInfo itemInfo) {
- return itemInfo.getTargetPackage();
- }
- return null;
- }
}
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 7e9e864..ee72c22 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -86,7 +86,7 @@
public class CellLayout extends ViewGroup {
private static final String TAG = "CellLayout";
- private static final boolean LOGD = false;
+ private static final boolean LOGD = true;
/** The color of the "leave-behind" shape when a folder is opened from Hotseat. */
private static final int FOLDER_LEAVE_BEHIND_COLOR = Color.argb(160, 245, 245, 245);
@@ -166,6 +166,7 @@
private final int[] mDragCellSpan = new int[2];
private boolean mDragging = false;
+ public boolean mHasOnLayoutBeenCalled = false;
private final TimeInterpolator mEaseOutInterpolator;
protected final ShortcutAndWidgetContainer mShortcutsAndWidgets;
@@ -1009,6 +1010,7 @@
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ mHasOnLayoutBeenCalled = true; // b/349929393 - is the required call to onLayout not done?
int left = getPaddingLeft();
left += (int) Math.ceil(getUnusedHorizontalSpace() / 2f);
int right = r - l - getPaddingRight();
diff --git a/src/com/android/launcher3/DevicePaddings.java b/src/com/android/launcher3/DevicePaddings.java
index 08fb47b..8494d11 100644
--- a/src/com/android/launcher3/DevicePaddings.java
+++ b/src/com/android/launcher3/DevicePaddings.java
@@ -47,7 +47,7 @@
private static final String WORKSPACE_BOTTOM_PADDING = "workspaceBottomPadding";
private static final String HOTSEAT_BOTTOM_PADDING = "hotseatBottomPadding";
- private static final String TAG = DevicePaddings.class.getSimpleName();
+ private static final String TAG = "DevicePaddings";
private static final boolean DEBUG = false;
ArrayList<DevicePadding> mDevicePaddings = new ArrayList<>();
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a667c96..5cbf6fb 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -32,6 +32,7 @@
import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import static com.android.launcher3.testing.shared.ResourceUtils.roundPxValueFromFloat;
+import static com.android.wm.shell.Flags.enableTinyTaskbar;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -52,7 +53,6 @@
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.DevicePaddings.DevicePadding;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.IconNormalizer;
import com.android.launcher3.model.data.ItemInfo;
@@ -65,7 +65,6 @@
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType;
import com.android.launcher3.responsive.ResponsiveSpecsProvider;
import com.android.launcher3.util.CellContentDimensions;
-import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.IconSizeSteps;
import com.android.launcher3.util.ResourceHelper;
@@ -298,9 +297,6 @@
// the widgetView, such that the actual view size is same as the widget size.
public final Rect widgetPadding = new Rect();
- // When true, nav bar is on the left side of the screen.
- private boolean mIsSeascape;
-
// Notification dots
public final DotRenderer mDotRendererWorkSpace;
public final DotRenderer mDotRendererAllApps;
@@ -353,7 +349,7 @@
isTablet = info.isTablet(windowBounds);
isPhone = !isTablet;
isTwoPanels = isTablet && isMultiDisplay;
- isTaskbarPresent = isTablet
+ isTaskbarPresent = (isTablet || (enableTinyTaskbar() && isGestureMode))
&& WindowManagerProxy.INSTANCE.get(context).isTaskbarDrawnInProcess();
// Some more constants.
@@ -713,7 +709,7 @@
overviewTaskThumbnailTopMarginPx =
enableOverviewIconMenu() ? 0 : overviewTaskIconSizePx + overviewTaskMarginPx;
// Don't add margin with floating search bar to minimize risk of overlapping.
- overviewActionsTopMarginPx = FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get() ? 0
+ overviewActionsTopMarginPx = Flags.floatingSearchBar() ? 0
: res.getDimensionPixelSize(R.dimen.overview_actions_top_margin);
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
overviewActionsButtonSpacing = res.getDimensionPixelSize(
@@ -993,7 +989,6 @@
return mHotseatColumnSpan;
}
- @VisibleForTesting
public int getHotseatWidthPx() {
return mHotseatWidthPx;
}
@@ -2008,25 +2003,8 @@
return isLandscape && transposeLayoutWithOrientation;
}
- /**
- * Updates orientation information and returns true if it has changed from the previous value.
- */
- public boolean updateIsSeascape(Context context) {
- if (isVerticalBarLayout()) {
- boolean isSeascape = DisplayController.INSTANCE.get(context)
- .getInfo().rotation == Surface.ROTATION_270;
- if (mIsSeascape != isSeascape) {
- mIsSeascape = isSeascape;
- // Hotseat changing sides requires updating workspace left/right paddings
- updateWorkspacePadding();
- return true;
- }
- }
- return false;
- }
-
public boolean isSeascape() {
- return isVerticalBarLayout() && mIsSeascape;
+ return rotationHint == Surface.ROTATION_270 && isVerticalBarLayout();
}
public boolean shouldFadeAdjacentWorkspaceScreens() {
@@ -2402,7 +2380,7 @@
mTransposeLayoutWithOrientation = !mInfo.isTablet(mWindowBounds);
}
if (mIsGestureMode == null) {
- mIsGestureMode = mInfo.navigationMode.hasGestures;
+ mIsGestureMode = mInfo.getNavigationMode().hasGestures;
}
if (mDotRendererCache == null) {
mDotRendererCache = new SparseArray<>();
diff --git a/src/com/android/launcher3/FastScrollRecyclerView.java b/src/com/android/launcher3/FastScrollRecyclerView.java
index eff748a..6622e11 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/FastScrollRecyclerView.java
@@ -25,9 +25,9 @@
import android.view.accessibility.AccessibilityNodeInfo;
import androidx.annotation.Nullable;
+import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.app.animation.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.views.RecyclerViewFastScroller;
@@ -55,9 +55,11 @@
super(context, attrs, defStyleAttr);
}
- public void bindFastScrollbar(RecyclerViewFastScroller scrollbar) {
+ public void bindFastScrollbar(RecyclerViewFastScroller scrollbar,
+ RecyclerViewFastScroller.FastScrollerLocation location) {
mScrollbar = scrollbar;
mScrollbar.setRecyclerView(this);
+ mScrollbar.setFastScrollerLocation(location);
onUpdateScrollbar(0);
}
@@ -164,6 +166,13 @@
public abstract void onUpdateScrollbar(int dy);
/**
+ * Return the fast scroll letter list view in the A-Z list.
+ */
+ public ConstraintLayout getLetterList() {
+ return null;
+ }
+
+ /**
* <p>Override in each subclass of this base class.
*/
public void onFastScrollCompleted() {}
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 37737d8..0d4ebe0 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -82,6 +82,10 @@
return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0;
}
+ boolean isHasVerticalHotseat() {
+ return mHasVerticalHotseat;
+ }
+
public void resetLayout(boolean hasVerticalHotseat) {
ActivityContext activityContext = ActivityContext.lookupContext(getContext());
boolean bubbleBarEnabled = activityContext.isBubbleBarEnabled();
@@ -93,10 +97,9 @@
if (bubbleBarEnabled) {
float adjustedBorderSpace = dp.getHotseatAdjustedBorderSpaceForBubbleBar(getContext());
if (hasBubbles && Float.compare(adjustedBorderSpace, 0f) != 0) {
- getShortcutsAndWidgets().setTranslationProvider(child -> {
- int index = getShortcutsAndWidgets().indexOfChild(child);
+ getShortcutsAndWidgets().setTranslationProvider(cellX -> {
float borderSpaceDelta = adjustedBorderSpace - dp.hotseatBorderSpace;
- return dp.iconSizePx + index * borderSpaceDelta;
+ return dp.iconSizePx + cellX * borderSpaceDelta;
});
if (mQsb instanceof HorizontalInsettableView) {
HorizontalInsettableView insettableQsb = (HorizontalInsettableView) mQsb;
@@ -143,10 +146,7 @@
// update the translation provider for future layout passes of hotseat icons.
if (isBubbleBarVisible) {
- icons.setTranslationProvider(child -> {
- int index = icons.indexOfChild(child);
- return dp.iconSizePx + index * borderSpaceDelta;
- });
+ icons.setTranslationProvider(cellX -> dp.iconSizePx + cellX * borderSpaceDelta);
} else {
icons.setTranslationProvider(null);
}
@@ -162,14 +162,14 @@
animatorSet.play(ObjectAnimator.ofFloat(child, VIEW_TRANSLATE_X, tx));
}
}
- if (mQsb instanceof HorizontalInsettableView) {
- HorizontalInsettableView horizontalInsettableQsb = (HorizontalInsettableView) mQsb;
- ValueAnimator qsbAnimator = ValueAnimator.ofFloat(0f, 1f);
+ if (mQsb instanceof HorizontalInsettableView horizontalInsettableQsb) {
+ final float currentInsetFraction = horizontalInsettableQsb.getHorizontalInsets();
+ final float targetInsetFraction =
+ isBubbleBarVisible ? (float) dp.iconSizePx / dp.hotseatQsbWidth : 0;
+ ValueAnimator qsbAnimator =
+ ValueAnimator.ofFloat(currentInsetFraction, targetInsetFraction);
qsbAnimator.addUpdateListener(animation -> {
- float fraction = qsbAnimator.getAnimatedFraction();
- float insetFraction = isBubbleBarVisible
- ? (float) dp.iconSizePx * fraction / dp.hotseatQsbWidth
- : (float) dp.iconSizePx * (1 - fraction) / dp.hotseatQsbWidth;
+ float insetFraction = (float) animation.getAnimatedValue();
horizontalInsettableQsb.setHorizontalInsets(insetFraction);
});
animatorSet.play(qsbAnimator);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 009d709..3ca6099 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -38,6 +38,7 @@
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_BIND_PENDING_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_CREATE_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_CREATE_SHORTCUT;
+import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_HOME_ROLE;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_PICK_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_RECONFIGURE_APPWIDGET;
import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.RUNTIME_STATE;
@@ -69,6 +70,7 @@
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE;
import static com.android.launcher3.config.FeatureFlags.MULTI_SELECT_EDIT_MODE;
+import static com.android.launcher3.folder.FolderGridOrganizer.createFolderGridOrganizer;
import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE;
import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.SHOW;
import static com.android.launcher3.logging.StatsLogManager.EventEnum;
@@ -133,14 +135,12 @@
import android.os.UserHandle;
import android.text.TextUtils;
import android.text.method.TextKeyListener;
-import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.KeyboardShortcutGroup;
-import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
@@ -151,6 +151,7 @@
import android.view.WindowManager.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.OvershootInterpolator;
+import android.widget.Toast;
import android.window.BackEvent;
import android.window.OnBackAnimationCallback;
@@ -161,6 +162,7 @@
import androidx.annotation.StringRes;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
+import androidx.core.os.BuildCompat;
import androidx.window.embedding.RuleController;
import com.android.launcher3.DropTarget.DragObject;
@@ -177,13 +179,14 @@
import com.android.launcher3.celllayout.CellPosMapper.TwoPanelCellPosMapper;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.debug.TestEvent;
+import com.android.launcher3.debug.TestEventEmitter;
import com.android.launcher3.dot.DotInfo;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.LauncherDragController;
import com.android.launcher3.folder.Folder;
-import com.android.launcher3.folder.FolderGridOrganizer;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
@@ -209,7 +212,6 @@
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.notification.NotificationListener;
-import com.android.launcher3.pageindicators.WorkspacePageIndicator;
import com.android.launcher3.pm.PinRequestHelper;
import com.android.launcher3.popup.ArrowPopup;
import com.android.launcher3.popup.PopupDataProvider;
@@ -261,6 +263,7 @@
import com.android.launcher3.widget.custom.CustomWidgetManager;
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
import com.android.launcher3.widget.util.WidgetSizes;
import com.android.systemui.plugins.LauncherOverlayPlugin;
import com.android.systemui.plugins.PluginListener;
@@ -308,7 +311,7 @@
private static boolean sIsNewProcess = true;
- private StateManager<LauncherState> mStateManager;
+ private StateManager<LauncherState, Launcher> mStateManager;
private static final int ON_ACTIVITY_RESULT_ANIMATION_DELAY = 500;
@@ -366,6 +369,7 @@
private LauncherAccessibilityDelegate mAccessibilityDelegate;
private PopupDataProvider mPopupDataProvider;
+ private WidgetPickerDataProvider mWidgetPickerDataProvider;
// We only want to get the SharedPreferences once since it does an FS stat each time we get
// it from the context.
@@ -527,6 +531,7 @@
mFocusHandler, new CellLayout(mWorkspace.getContext(), mWorkspace));
mPopupDataProvider = new PopupDataProvider(this::updateNotificationDots);
+ mWidgetPickerDataProvider = new WidgetPickerDataProvider();
boolean internalStateHandled = ACTIVITY_TRACKER.handleCreate(this);
if (internalStateHandled) {
@@ -586,10 +591,12 @@
setTitle(R.string.home_screen);
mStartupLatencyLogger.logEnd(LAUNCHER_LATENCY_STARTUP_ACTIVITY_ON_CREATE);
- if (com.android.launcher3.Flags.enableTwoPaneLauncherSettings()) {
+ if (BuildCompat.isAtLeastV()
+ && com.android.launcher3.Flags.enableTwoPaneLauncherSettings()) {
RuleController.getInstance(this).setRules(
RuleController.parseRules(this, R.xml.split_configuration));
}
+ TestEventEmitter.INSTANCE.get(this).sendEvent(TestEvent.LAUNCHER_ON_CREATE);
}
protected ModelCallbacks createModelCallbacks() {
@@ -766,6 +773,7 @@
// initialized properly.
onSaveInstanceState(new Bundle());
mModel.rebindCallbacks();
+ updateDisallowBack();
} finally {
Trace.endSection();
}
@@ -808,7 +816,7 @@
View collectionIcon = getWorkspace().getHomescreenIconByItemId(info.container);
if (collectionIcon instanceof FolderIcon folderIcon
&& collectionIcon.getTag() instanceof FolderInfo) {
- if (new FolderGridOrganizer(getDeviceProfile())
+ if (createFolderGridOrganizer(getDeviceProfile())
.setFolderInfo((FolderInfo) folderIcon.getTag())
.isItemInPreview(info.rank)) {
folderIcon.invalidate();
@@ -889,6 +897,17 @@
}
mPendingActivityResult = null;
+ if (requestCode == REQUEST_HOME_ROLE) {
+ if (resultCode != RESULT_OK) {
+ Toast.makeText(
+ this,
+ this.getString(R.string.set_default_home_app,
+ this.getString(R.string.derived_app_name)),
+ Toast.LENGTH_LONG).show();
+ }
+ return;
+ }
+
// Reset the startActivity waiting flag
final PendingRequestArgs requestArgs = mPendingRequestArgs;
setWaitingForResult(null);
@@ -1263,11 +1282,7 @@
}
// Set screen title for Talkback
- if (state == ALL_APPS) {
- setTitle(R.string.all_apps_label);
- } else {
- setTitle(R.string.home_screen);
- }
+ setTitle(state.getTitle());
}
/**
@@ -1392,15 +1407,6 @@
this, R.attr.isWorkspaceDarkText) ? Color.BLACK : Color.WHITE);
}
- @Override
- public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
- if (WorkspacePageIndicator.class.getName().equals(name)) {
- return LayoutInflater.from(context).inflate(R.layout.page_indicator_dots,
- (ViewGroup) parent, false);
- }
- return super.onCreateView(parent, name, context, attrs);
- }
-
/**
* Add a shortcut to the workspace or to a Folder.
*
@@ -2683,12 +2689,31 @@
writer.println(prefix + "\tmAppWidgetHolder.isListening: "
+ mAppWidgetHolder.isListening());
+ // b/349929393
+ // The only way to reproduce this bug is to ensure that onLayout never gets called. This
+ // theoretically is impossible, so these logs are being added to test if that actually is
+ // what is happening.
+ writer.println(prefix + "\tmWorkspace.mHasOnLayoutBeenCalled="
+ + mWorkspace.mHasOnLayoutBeenCalled);
+ for (int i = 0; i < mWorkspace.getPageCount(); i++) {
+ CellLayout cellLayout = (CellLayout) mWorkspace.getPageAt(i);
+ writer.println(prefix + "\tcellLayout." + i + ".mHasOnLayoutBeenCalled="
+ + cellLayout.mHasOnLayoutBeenCalled);
+ writer.println(prefix + "\tshortcutAndWidgetContainer." + i + ".mHasOnLayoutBeenCalled="
+ + cellLayout.getShortcutsAndWidgets().mHasOnLayoutBeenCalled);
+ }
+
// Extra logging for general debugging
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
+ mWidgetPickerDataProvider.dump(prefix, writer);
mDeviceProfile.dump(this, prefix, writer);
mAppsView.getAppsStore().dump(prefix, writer);
+ mAppsView.getPersonalAppList().dump(prefix, writer);
+ if (mAppsView.shouldShowTabs()) {
+ mAppsView.getWorkAppList().dump(prefix, writer);
+ }
try {
FileLog.flushAll(writer);
@@ -2763,7 +2788,7 @@
}
@Override
- protected void collectStateHandlers(List<StateHandler> out) {
+ public void collectStateHandlers(List<StateHandler<LauncherState>> out) {
out.add(getAllAppsController());
out.add(getWorkspace());
}
@@ -2785,8 +2810,11 @@
}
private void updateDisallowBack() {
- if (Flags.enableDesktopWindowingMode()) {
- // TODO(b/330183377) disable back in launcher when when we productionize
+ if (BuildCompat.isAtLeastV()
+ && Flags.enableDesktopWindowingMode()
+ && !Flags.enableDesktopWindowingWallpaperActivity()
+ && mDeviceProfile.isTablet) {
+ // TODO(b/333533253): Clean up after desktop wallpaper activity flag is rolled out
return;
}
LauncherRootView rv = getRootView();
@@ -2983,7 +3011,7 @@
}
@Override
- public StateManager<LauncherState> getStateManager() {
+ public StateManager<LauncherState, Launcher> getStateManager() {
return mStateManager;
}
@@ -2993,6 +3021,12 @@
return mPopupDataProvider;
}
+ @NonNull
+ @Override
+ public WidgetPickerDataProvider getWidgetPickerDataProvider() {
+ return mWidgetPickerDataProvider;
+ }
+
@Override
public DotInfo getDotInfoForItem(ItemInfo info) {
return mPopupDataProvider.getDotInfoForItem(info);
@@ -3142,4 +3176,4 @@
}
// End of Getters and Setters
-}
\ No newline at end of file
+}
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 03de334..15641ab 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -24,6 +24,7 @@
import static com.android.launcher3.LauncherPrefs.THEMED_ICONS;
import static com.android.launcher3.model.LoaderTask.SMARTSPACE_ON_HOME_SCREEN;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI;
import static com.android.launcher3.util.SettingsCache.PRIVATE_SPACE_HIDE_WHEN_LOCKED_URI;
@@ -39,6 +40,7 @@
import android.util.Log;
import androidx.annotation.Nullable;
+import androidx.core.os.BuildCompat;
import com.android.launcher3.graphics.IconShape;
import com.android.launcher3.icons.IconCache;
@@ -52,6 +54,7 @@
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.LockedUserState;
import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SafeCloseable;
@@ -61,6 +64,9 @@
import com.android.launcher3.util.TraceHelper;
import com.android.launcher3.widget.custom.CustomWidgetManager;
+import java.util.Locale;
+import java.util.Objects;
+
public class LauncherAppState implements SafeCloseable {
public static final String ACTION_FORCE_ROLOAD = "force-reload-launcher";
@@ -106,21 +112,33 @@
mOnTerminateCallback.add(() ->
mContext.getSystemService(LauncherApps.class).unregisterCallback(callbacks));
- if (Flags.enableSupportForArchiving()) {
+ if (BuildCompat.isAtLeastV() && Flags.enableSupportForArchiving()) {
ArchiveCompatibilityParams params = new ArchiveCompatibilityParams();
params.setEnableUnarchivalConfirmation(false);
+ params.setEnableIconOverlay(!Flags.useNewIconForArchivedApps());
launcherApps.setArchiveCompatibility(params);
}
SimpleBroadcastReceiver modelChangeReceiver =
- new SimpleBroadcastReceiver(mModel::onBroadcastIntent);
- modelChangeReceiver.register(mContext, Intent.ACTION_LOCALE_CHANGED,
+ new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, mModel::onBroadcastIntent);
+ final Locale oldLocale = mContext.getResources().getConfiguration().locale;
+ modelChangeReceiver.register(
+ mContext,
+ () -> {
+ // if local has changed before receiver is registered on bg thread,
+ // mModel needs to reload.
+ Locale newLocale = mContext.getResources().getConfiguration().locale;
+ if (!Objects.equals(oldLocale, newLocale)) {
+ mModel.forceReload();
+ }
+ },
+ Intent.ACTION_LOCALE_CHANGED,
ACTION_DEVICE_POLICY_RESOURCE_UPDATED);
if (BuildConfig.IS_STUDIO_BUILD) {
mContext.registerReceiver(modelChangeReceiver, new IntentFilter(ACTION_FORCE_ROLOAD),
RECEIVER_EXPORTED);
}
- mOnTerminateCallback.add(() -> mContext.unregisterReceiver(modelChangeReceiver));
+ mOnTerminateCallback.add(() -> modelChangeReceiver.unregisterReceiverSafely(mContext));
SafeCloseable userChangeListener = UserCache.INSTANCE.get(mContext)
.addUserEventListener(mModel::onUserEvent);
@@ -181,7 +199,7 @@
mIconCache = new IconCache(mContext, mInvariantDeviceProfile,
iconCacheFileName, mIconProvider);
mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext),
- iconCacheFileName != null);
+ PackageManagerHelper.INSTANCE.get(context), iconCacheFileName != null);
mOnTerminateCallback.add(mIconCache::close);
mOnTerminateCallback.add(mModel::destroy);
}
@@ -206,7 +224,7 @@
}
private void refreshAndReloadLauncher() {
- LauncherIcons.clearPool();
+ LauncherIcons.clearPool(mContext);
mIconCache.updateIconParams(
mInvariantDeviceProfile.fillResIconDpi, mInvariantDeviceProfile.iconBitmapSize);
mModel.forceReload();
diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java
index 40873be..8969b60 100644
--- a/src/com/android/launcher3/LauncherApplication.java
+++ b/src/com/android/launcher3/LauncherApplication.java
@@ -17,14 +17,23 @@
import android.app.Application;
+import com.android.launcher3.dagger.DaggerLauncherAppComponent;
+import com.android.launcher3.dagger.LauncherBaseAppComponent;
+
/**
* Main application class for Launcher
*/
public class LauncherApplication extends Application {
+ private LauncherBaseAppComponent mAppComponent;
@Override
public void onCreate() {
super.onCreate();
MainProcessInitializer.initialize(this);
+ mAppComponent = DaggerLauncherAppComponent.builder().build();
+ }
+
+ public LauncherBaseAppComponent getAppComponent() {
+ return mAppComponent;
}
}
diff --git a/src/com/android/launcher3/LauncherConstants.java b/src/com/android/launcher3/LauncherConstants.java
index 1abfeb9..445fb41 100644
--- a/src/com/android/launcher3/LauncherConstants.java
+++ b/src/com/android/launcher3/LauncherConstants.java
@@ -41,6 +41,7 @@
public static final int REQUEST_BIND_PENDING_APPWIDGET = 12;
public static final int REQUEST_RECONFIGURE_APPWIDGET = 13;
+ public static final int REQUEST_HOME_ROLE = 14;
static final int REQUEST_CREATE_SHORTCUT = 1;
static final int REQUEST_CREATE_APPWIDGET = 5;
static final int REQUEST_PICK_APPWIDGET = 9;
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 9b0e0ec..ca1b2a9 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -19,6 +19,7 @@
import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURCE_UPDATED;
import static com.android.launcher3.LauncherAppState.ACTION_FORCE_ROLOAD;
+import static com.android.launcher3.LauncherPrefs.WORK_EDU_STEP;
import static com.android.launcher3.config.FeatureFlags.IS_STUDIO_BUILD;
import static com.android.launcher3.icons.cache.BaseIconCache.EMPTY_CLASS_NAME;
import static com.android.launcher3.model.PackageUpdatedTask.OP_UPDATE;
@@ -48,7 +49,6 @@
import com.android.launcher3.model.AddWorkspaceItemsTask;
import com.android.launcher3.model.AllAppsList;
import com.android.launcher3.model.BaseLauncherBinder;
-import com.android.launcher3.model.BaseModelUpdateTask;
import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.CacheDataUpdatedTask;
@@ -57,6 +57,7 @@
import com.android.launcher3.model.ModelDbController;
import com.android.launcher3.model.ModelDelegate;
import com.android.launcher3.model.ModelLauncherCallbacks;
+import com.android.launcher3.model.ModelTaskController;
import com.android.launcher3.model.ModelWriter;
import com.android.launcher3.model.PackageInstallStateChangedTask;
import com.android.launcher3.model.PackageUpdatedTask;
@@ -82,7 +83,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.CancellationException;
-import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Supplier;
@@ -99,6 +99,8 @@
@NonNull
private final LauncherAppState mApp;
@NonNull
+ private final PackageManagerHelper mPmHelper;
+ @NonNull
private final ModelDbController mModelDbController;
@NonNull
private final Object mLock = new Object();
@@ -153,12 +155,13 @@
LauncherModel(@NonNull final Context context, @NonNull final LauncherAppState app,
@NonNull final IconCache iconCache, @NonNull final AppFilter appFilter,
- final boolean isPrimaryInstance) {
+ @NonNull final PackageManagerHelper pmHelper, final boolean isPrimaryInstance) {
mApp = app;
+ mPmHelper = pmHelper;
mModelDbController = new ModelDbController(context);
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
- mModelDelegate = ModelDelegate.newInstance(context, app, mBgAllAppsList, mBgDataModel,
- isPrimaryInstance);
+ mModelDelegate = ModelDelegate.newInstance(context, app, mPmHelper, mBgAllAppsList,
+ mBgDataModel, isPrimaryInstance);
}
@NonNull
@@ -274,6 +277,9 @@
enqueueModelUpdateTask(new PackageUpdatedTask(
PackageUpdatedTask.OP_USER_AVAILABILITY_CHANGE, user));
}
+ if (Intent.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
+ LauncherPrefs.get(mApp.getContext()).put(WORK_EDU_STEP, 0);
+ }
}
/**
@@ -426,13 +432,9 @@
@Override
public void onInstallSessionCreated(@NonNull final PackageInstallInfo sessionInfo) {
if (FeatureFlags.PROMISE_APPS_IN_ALL_APPS.get()) {
- enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- apps.addPromiseApp(app.getContext(), sessionInfo);
- bindApplicationsIfNeeded();
- }
+ enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ apps.addPromiseApp(mApp.getContext(), sessionInfo);
+ taskController.bindApplicationsIfNeeded();
});
}
}
@@ -440,60 +442,56 @@
@Override
public void onSessionFailure(@NonNull final String packageName,
@NonNull final UserHandle user) {
- enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- IconCache iconCache = app.getIconCache();
- final IntSet removedIds = new IntSet();
- HashSet<WorkspaceItemInfo> archivedWorkspaceItemsToCacheRefresh = new HashSet<>();
- boolean isAppArchived = PackageManagerHelper.INSTANCE.get(mApp.getContext())
- .isAppArchivedForUser(packageName, user);
- synchronized (dataModel) {
- if (isAppArchived) {
- // Remove package icon cache entry for archived app in case of a session
- // failure.
- mApp.getIconCache().remove(
- new ComponentName(packageName, packageName + EMPTY_CLASS_NAME),
- user);
- }
+ enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ IconCache iconCache = mApp.getIconCache();
+ final IntSet removedIds = new IntSet();
+ HashSet<WorkspaceItemInfo> archivedWorkspaceItemsToCacheRefresh = new HashSet<>();
+ boolean isAppArchived = PackageManagerHelper.INSTANCE.get(mApp.getContext())
+ .isAppArchivedForUser(packageName, user);
+ synchronized (dataModel) {
+ if (isAppArchived) {
+ // Remove package icon cache entry for archived app in case of a session
+ // failure.
+ mApp.getIconCache().remove(
+ new ComponentName(packageName, packageName + EMPTY_CLASS_NAME),
+ user);
+ }
- for (ItemInfo info : dataModel.itemsIdMap) {
- if (info instanceof WorkspaceItemInfo
- && ((WorkspaceItemInfo) info).hasPromiseIconUi()
- && user.equals(info.user)
- && info.getIntent() != null) {
- if (TextUtils.equals(packageName, info.getIntent().getPackage())) {
- removedIds.add(info.id);
- }
- if (((WorkspaceItemInfo) info).isArchived()) {
- WorkspaceItemInfo workspaceItem = (WorkspaceItemInfo) info;
- // Refresh icons on the workspace for archived apps.
- iconCache.getTitleAndIcon(workspaceItem,
- workspaceItem.usingLowResIcon());
- archivedWorkspaceItemsToCacheRefresh.add(workspaceItem);
- }
+ for (ItemInfo info : dataModel.itemsIdMap) {
+ if (info instanceof WorkspaceItemInfo
+ && ((WorkspaceItemInfo) info).hasPromiseIconUi()
+ && user.equals(info.user)
+ && info.getIntent() != null) {
+ if (TextUtils.equals(packageName, info.getIntent().getPackage())) {
+ removedIds.add(info.id);
+ }
+ if (((WorkspaceItemInfo) info).isArchived()) {
+ WorkspaceItemInfo workspaceItem = (WorkspaceItemInfo) info;
+ // Refresh icons on the workspace for archived apps.
+ iconCache.getTitleAndIcon(workspaceItem,
+ workspaceItem.usingLowResIcon());
+ archivedWorkspaceItemsToCacheRefresh.add(workspaceItem);
}
}
-
- if (isAppArchived) {
- apps.updateIconsAndLabels(new HashSet<>(List.of(packageName)), user);
- }
}
- if (!removedIds.isEmpty()) {
- deleteAndBindComponentsRemoved(
- ItemInfoMatcher.ofItemIds(removedIds),
- "removed because install session failed");
- }
- if (!archivedWorkspaceItemsToCacheRefresh.isEmpty()) {
- bindUpdatedWorkspaceItems(
- archivedWorkspaceItemsToCacheRefresh.stream().toList());
- }
if (isAppArchived) {
- bindApplicationsIfNeeded();
+ apps.updateIconsAndLabels(new HashSet<>(List.of(packageName)), user);
}
}
+
+ if (!removedIds.isEmpty() && !isAppArchived) {
+ taskController.deleteAndBindComponentsRemoved(
+ ItemInfoMatcher.ofItemIds(removedIds),
+ "removed because install session failed");
+ }
+ if (!archivedWorkspaceItemsToCacheRefresh.isEmpty()) {
+ taskController.bindUpdatedWorkspaceItems(
+ archivedWorkspaceItemsToCacheRefresh.stream().toList());
+ }
+ if (isAppArchived) {
+ taskController.bindApplicationsIfNeeded();
+ }
});
}
@@ -583,13 +581,9 @@
*/
public void onWidgetLabelsUpdated(@NonNull final HashSet<String> updatedPackages,
@NonNull final UserHandle user) {
- enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- dataModel.widgetsModel.onPackageIconsUpdated(updatedPackages, user, app);
- bindUpdatedWidgets(dataModel);
- }
+ enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ dataModel.widgetsModel.onPackageIconsUpdated(updatedPackages, user, mApp);
+ taskController.bindUpdatedWidgets(dataModel);
});
}
@@ -597,8 +591,15 @@
if (mModelDestroyed) {
return;
}
- task.init(mApp, this, mBgDataModel, mBgAllAppsList, MAIN_EXECUTOR);
- MODEL_EXECUTOR.execute(task);
+ MODEL_EXECUTOR.execute(() -> {
+ if (!isModelLoaded()) {
+ // Loader has not yet run.
+ return;
+ }
+ ModelTaskController controller = new ModelTaskController(
+ mApp, mBgDataModel, mBgAllAppsList, this, MAIN_EXECUTOR);
+ task.execute(controller, mBgDataModel, mBgAllAppsList);
+ });
}
/**
@@ -610,18 +611,10 @@
void execute(@NonNull Callbacks callbacks);
}
- /**
- * A runnable which changes/updates the data model of the launcher based on certain events.
- */
- public interface ModelUpdateTask extends Runnable {
+ public interface ModelUpdateTask {
- /**
- * Called before the task is posted to initialize the internal state.
- */
- void init(@NonNull LauncherAppState app, @NonNull LauncherModel model,
- @NonNull BgDataModel dataModel, @NonNull AllAppsList allAppsList,
- @NonNull Executor uiExecutor);
-
+ void execute(@NonNull ModelTaskController taskController,
+ @NonNull BgDataModel dataModel, @NonNull AllAppsList apps);
}
public void updateAndBindWorkspaceItem(@NonNull final WorkspaceItemInfo si,
@@ -638,27 +631,19 @@
*/
public void updateAndBindWorkspaceItem(
@NonNull final Supplier<WorkspaceItemInfo> itemProvider) {
- enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- WorkspaceItemInfo info = itemProvider.get();
- getModelWriter().updateItemInDatabase(info);
- ArrayList<WorkspaceItemInfo> update = new ArrayList<>();
- update.add(info);
- bindUpdatedWorkspaceItems(update);
- }
+ enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ WorkspaceItemInfo info = itemProvider.get();
+ taskController.getModelWriter().updateItemInDatabase(info);
+ ArrayList<WorkspaceItemInfo> update = new ArrayList<>();
+ update.add(info);
+ taskController.bindUpdatedWorkspaceItems(update);
});
}
public void refreshAndBindWidgetsAndShortcuts(@Nullable final PackageUserKey packageUser) {
- enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- dataModel.widgetsModel.update(app, packageUser);
- bindUpdatedWidgets(dataModel);
- }
+ enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ dataModel.widgetsModel.update(taskController.getApp(), packageUser);
+ taskController.bindUpdatedWidgets(dataModel);
});
}
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 3bdd863..102189b 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -38,6 +38,7 @@
import android.view.animation.Interpolator;
import androidx.annotation.FloatRange;
+import androidx.annotation.StringRes;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StateManager;
@@ -83,7 +84,7 @@
public static final int FLAG_HAS_SYS_UI_SCRIM = BaseState.getFlag(4);
// Flag to inticate that all popups should be closed when this state is enabled.
public static final int FLAG_CLOSE_POPUPS = BaseState.getFlag(5);
- public static final int FLAG_OVERVIEW_UI = BaseState.getFlag(6);
+ public static final int FLAG_RECENTS_VIEW_VISIBLE = BaseState.getFlag(6);
// Flag indicating that hotseat and its contents are not accessible.
public static final int FLAG_HOTSEAT_INACCESSIBLE = BaseState.getFlag(7);
@@ -158,14 +159,14 @@
/**
* True if the state has overview panel visible.
*/
- public final boolean overviewUi;
+ public final boolean isRecentsViewVisible;
private final int mFlags;
public LauncherState(int id, int statsLogOrdinal, int flags) {
this.statsLogOrdinal = statsLogOrdinal;
this.mFlags = flags;
- this.overviewUi = (flags & FLAG_OVERVIEW_UI) != 0;
+ this.isRecentsViewVisible = (flags & FLAG_RECENTS_VIEW_VISIBLE) != 0;
this.ordinal = id;
sAllStates[id] = this;
}
@@ -369,6 +370,10 @@
return launcher.getWorkspace().getCurrentPageDescription();
}
+ public @StringRes int getTitle() {
+ return R.string.home_screen;
+ }
+
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
if ((this != NORMAL && this != HINT_STATE)
|| !launcher.getDeviceProfile().shouldFadeAdjacentWorkspaceScreens()) {
@@ -435,7 +440,7 @@
*/
public void onBackInvoked(Launcher launcher) {
if (this != NORMAL) {
- StateManager<LauncherState> lsm = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> lsm = launcher.getStateManager();
LauncherState lastState = lsm.getLastState();
lsm.goToState(lastState, forEndCallback(this::onBackAnimationCompleted));
}
@@ -456,7 +461,7 @@
*/
public void onBackProgressed(
Launcher launcher, @FloatRange(from = 0.0, to = 1.0) float backProgress) {
- StateManager<LauncherState> lsm = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> lsm = launcher.getStateManager();
LauncherState toState = lsm.getLastState();
lsm.onBackProgressed(toState, backProgress);
}
@@ -466,7 +471,7 @@
* predictive back gesture.
*/
public void onBackCancelled(Launcher launcher) {
- StateManager<LauncherState> lsm = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> lsm = launcher.getStateManager();
LauncherState toState = lsm.getLastState();
lsm.onBackCancelled(toState);
}
diff --git a/src/com/android/launcher3/ModelCallbacks.kt b/src/com/android/launcher3/ModelCallbacks.kt
index 7d6d154..d57f8a0 100644
--- a/src/com/android/launcher3/ModelCallbacks.kt
+++ b/src/com/android/launcher3/ModelCallbacks.kt
@@ -3,6 +3,7 @@
import android.annotation.TargetApi
import android.os.Build
import android.os.Trace
+import android.util.Log
import androidx.annotation.UiThread
import com.android.launcher3.Flags.enableSmartspaceRemovalToggle
import com.android.launcher3.LauncherConstants.TraceEvents
@@ -10,6 +11,8 @@
import com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID
import com.android.launcher3.allapps.AllAppsStore
import com.android.launcher3.config.FeatureFlags
+import com.android.launcher3.debug.TestEvent
+import com.android.launcher3.debug.TestEventEmitter
import com.android.launcher3.model.BgDataModel
import com.android.launcher3.model.StringCache
import com.android.launcher3.model.data.AppInfo
@@ -29,6 +32,8 @@
import com.android.launcher3.widget.model.WidgetsListBaseEntry
import java.util.function.Predicate
+private const val TAG = "ModelCallbacks"
+
class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks {
var synchronouslyBoundPages = LIntSet()
@@ -66,6 +71,13 @@
launcher.workspace.removeAllWorkspaceScreens()
// Avoid clearing the widget update listeners for staying up-to-date with widget info
launcher.appWidgetHolder.clearWidgetViews()
+ // TODO(b/335141365): Remove this log after the bug is fixed.
+ Log.d(
+ TAG,
+ "startBinding: " +
+ "hotseat layout was vertical: ${launcher.hotseat?.isHasVerticalHotseat}" +
+ " and is setting to ${launcher.deviceProfile.isVerticalBarLayout}"
+ )
launcher.hotseat?.resetLayout(launcher.deviceProfile.isVerticalBarLayout)
TraceHelper.INSTANCE.endSection()
}
@@ -142,7 +154,11 @@
launcher.viewCache.setCacheSize(R.layout.folder_page, 2)
TraceHelper.INSTANCE.endSection()
launcher.workspace.removeExtraEmptyScreen(/* stripEmptyScreens= */ true)
- launcher.workspace.pageIndicator.setPauseScroll(/*pause=*/ false, deviceProfile.isTwoPanels)
+ launcher.workspace.pageIndicator.setPauseScroll(
+ /*pause=*/ false,
+ deviceProfile.isTwoPanels
+ )
+ TestEventEmitter.INSTANCE.get(launcher).sendEvent(TestEvent.WORKSPACE_FINISH_LOADING)
}
/**
@@ -238,8 +254,8 @@
PopupContainerWithArrow.dismissInvalidPopup(launcher)
}
- override fun bindAllWidgets(allWidgets: List<WidgetsListBaseEntry?>?) {
- launcher.popupDataProvider.allWidgets = allWidgets
+ override fun bindAllWidgets(allWidgets: List<WidgetsListBaseEntry>) {
+ launcher.widgetPickerDataProvider.setWidgets(allWidgets, /* defaultWidgets= */ listOf())
}
/** Returns the ids of the workspaces to bind. */
@@ -288,10 +304,10 @@
}
val widgetsListBaseEntry: WidgetsListBaseEntry =
- launcher.popupDataProvider.allWidgets.firstOrNull { item: WidgetsListBaseEntry ->
+ launcher.widgetPickerDataProvider.get().allWidgets.firstOrNull {
+ item: WidgetsListBaseEntry ->
item.mPkgItem.packageName == BuildConfig.APPLICATION_ID
- }
- ?: return
+ } ?: return
val info =
PendingAddWidgetInfo(
@@ -315,16 +331,14 @@
)
val firstScreenPosition = 0
if (
- (isFirstPagePinnedItemEnabled &&
- !SHOULD_SHOW_FIRST_PAGE_WIDGET) &&
+ (isFirstPagePinnedItemEnabled && !SHOULD_SHOW_FIRST_PAGE_WIDGET) &&
orderedScreenIds.indexOf(FIRST_SCREEN_ID) != firstScreenPosition
) {
orderedScreenIds.removeValue(FIRST_SCREEN_ID)
orderedScreenIds.add(firstScreenPosition, FIRST_SCREEN_ID)
} else if (
- (!isFirstPagePinnedItemEnabled ||
- SHOULD_SHOW_FIRST_PAGE_WIDGET)
- && orderedScreenIds.isEmpty
+ (!isFirstPagePinnedItemEnabled || SHOULD_SHOW_FIRST_PAGE_WIDGET) &&
+ orderedScreenIds.isEmpty
) {
// If there are no screens, we need to have an empty screen
launcher.workspace.addExtraEmptyScreens()
@@ -380,7 +394,7 @@
}
orderedScreenIds
.filterNot { screenId ->
- isFirstPagePinnedItemEnabled &&
+ isFirstPagePinnedItemEnabled &&
!SHOULD_SHOW_FIRST_PAGE_WIDGET &&
screenId == WorkspaceLayoutManager.FIRST_SCREEN_ID
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index cc9f08e..365fbd3 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -788,7 +788,7 @@
if (mScroller.isFinished() && pageScrollChanged) {
// TODO(b/246283207): Remove logging once root cause of flake detected.
if (Utilities.isRunningInTestHarness() && !(this instanceof Workspace)) {
- Log.d("b/246283207", this.getClass().getSimpleName() + "#onLayout() -> "
+ Log.d("b/246283207", TAG + "#onLayout() -> "
+ "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): "
+ getNextPage() + ", getScrollForPage(getNextPage()): "
+ getScrollForPage(getNextPage()));
diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
index b22b690..a8733f2 100644
--- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java
+++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
@@ -64,6 +64,7 @@
private final ActivityContext mActivity;
private boolean mInvertIfRtl = false;
+ public boolean mHasOnLayoutBeenCalled = false;
@Nullable
private TranslationProvider mTranslationProvider = null;
@@ -158,6 +159,11 @@
final PointF appWidgetScale = dp.getAppWidgetScale((ItemInfo) child.getTag());
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
appWidgetScale.x, appWidgetScale.y, mBorderSpace, dp.widgetPadding);
+ } else if (isChildQsb(child)) {
+ lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
+ mBorderSpace);
+ // No need to add padding for Qsb, which is either Smartspace (actual or preview), or
+ // QsbContainerView.
} else {
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
mBorderSpace);
@@ -185,6 +191,10 @@
child.measure(childWidthMeasureSpec, childheightMeasureSpec);
}
+ private boolean isChildQsb(View child) {
+ return child.getId() == R.id.search_container_workspace;
+ }
+
public boolean invertLayoutHorizontally() {
return mInvertIfRtl && Utilities.isRtl(getResources());
}
@@ -192,6 +202,7 @@
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
Trace.beginSection("ShortcutAndWidgetConteiner#onLayout");
+ mHasOnLayoutBeenCalled = true; // b/349929393 - is the required call to onLayout not done?
int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
@@ -236,7 +247,7 @@
}
child.layout(childLeft, childTop, childLeft + lp.width, childTop + lp.height);
if (mTranslationProvider != null) {
- final float tx = mTranslationProvider.getTranslationX(child);
+ final float tx = mTranslationProvider.getTranslationX(lp.getCellX());
if (child instanceof Reorderable) {
((Reorderable) child).getTranslateDelegate()
.getTranslationX(INDEX_BUBBLE_ADJUSTMENT_ANIM)
@@ -321,6 +332,6 @@
/** Provides translation values to apply when laying out child views. */
interface TranslationProvider {
- float getTranslationX(View child);
+ float getTranslationX(int cellX);
}
}
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index b9a62e2..fde7014 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -70,6 +70,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
+import android.view.ViewGroup;
import android.view.animation.Interpolator;
import androidx.annotation.ChecksSdkIntAtLeast;
@@ -104,8 +105,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.function.Predicate;
/**
* Various utilities shared amongst the Launcher's classes.
@@ -114,8 +114,7 @@
private static final String TAG = "Launcher.Utilities";
- private static final Pattern sTrimPattern =
- Pattern.compile("^[\\s|\\p{javaSpaceChar}]*(.*)[\\s|\\p{javaSpaceChar}]*$");
+ private static final String TRIM_PATTERN = "(^\\h+|\\h+$)";
private static final Matrix sMatrix = new Matrix();
private static final Matrix sInverseMatrix = new Matrix();
@@ -132,6 +131,10 @@
@ChecksSdkIntAtLeast(api = VERSION_CODES.UPSIDE_DOWN_CAKE, codename = "U")
public static final boolean ATLEAST_U = Build.VERSION.SDK_INT >= VERSION_CODES.UPSIDE_DOWN_CAKE;
+ @ChecksSdkIntAtLeast(api = VERSION_CODES.VANILLA_ICE_CREAM, codename = "V")
+ public static final boolean ATLEAST_V = Build.VERSION.SDK_INT
+ >= VERSION_CODES.VANILLA_ICE_CREAM;
+
/**
* Set on a motion event dispatched from the nav bar. See {@link MotionEvent#setEdgeFlags(int)}.
*/
@@ -175,6 +178,11 @@
sIsRunningInTestHarness = true;
}
+ /** Disables running test in test harness mode */
+ public static void disableRunningInTestHarnessForTests() {
+ sIsRunningInTestHarness = false;
+ }
+
public static boolean isPropertyEnabled(String propertyName) {
return Log.isLoggable(propertyName, Log.VERBOSE);
}
@@ -375,6 +383,28 @@
}
/**
+ * Scales a {@code RectF} in place about a specified pivot point.
+ *
+ * <p>This method modifies the given {@code RectF} directly to scale it proportionally
+ * by the given {@code scale}, while preserving its center at the specified
+ * {@code (pivotX, pivotY)} coordinates.
+ *
+ * @param rectF the {@code RectF} to scale, modified directly.
+ * @param pivotX the x-coordinate of the pivot point about which to scale.
+ * @param pivotY the y-coordinate of the pivot point about which to scale.
+ * @param scale the factor by which to scale the rectangle. Values less than 1 will
+ * shrink the rectangle, while values greater than 1 will enlarge it.
+ */
+ public static void scaleRectFAboutPivot(RectF rectF, float pivotX, float pivotY, float scale) {
+ rectF.offset(-pivotX, -pivotY);
+ rectF.left *= scale;
+ rectF.top *= scale;
+ rectF.right *= scale;
+ rectF.bottom *= scale;
+ rectF.offset(pivotX, pivotY);
+ }
+
+ /**
* Maps t from one range to another range.
* @param t The value to map.
* @param fromMin The lower bound of the range that t is being mapped from.
@@ -417,10 +447,7 @@
if (s == null) {
return "";
}
-
- // Just strip any sequence of whitespace or java space characters from the beginning and end
- Matcher m = sTrimPattern.matcher(s);
- return m.replaceAll("$1");
+ return s.toString().replaceAll(TRIM_PATTERN, "").trim();
}
/**
@@ -639,7 +666,7 @@
} else {
// Wrap the main icon in AID
try (LauncherIcons li = LauncherIcons.obtain(context)) {
- result = li.wrapToAdaptiveIcon(mainIcon);
+ result = li.wrapToAdaptiveIcon(mainIcon, null);
}
}
if (result == null) {
@@ -694,9 +721,54 @@
}
/**
- * Rotates `inOutBounds` by `delta` 90-degree increments. Rotation is visually CCW. Parent
+ * Rotates `inOutBounds` by `delta` 90-degree increments. Rotation is visually CW. Parent
* sizes represent the "space" that will rotate carrying inOutBounds along with it to determine
* the final bounds.
+ *
+ * As an example if this is the input:
+ * +-------------+
+ * | +-----+ |
+ * | | | |
+ * | +-----+ |
+ * | |
+ * | |
+ * | |
+ * +-------------+
+ * This would be case delta % 4 == 0:
+ * +-------------+
+ * | +-----+ |
+ * | | | |
+ * | +-----+ |
+ * | |
+ * | |
+ * | |
+ * +-------------+
+ * This would be case delta % 4 == 1:
+ * +----------------+
+ * | +--+ |
+ * | | | |
+ * | | | |
+ * | +--+ |
+ * | |
+ * +----------------+
+ * This would be case delta % 4 == 2: // This is case was reverted to previous behaviour which
+ * doesn't match the illustration due to b/353965234
+ * +-------------+
+ * | |
+ * | |
+ * | |
+ * | +-----+ |
+ * | | | |
+ * | +-----+ |
+ * +-------------+
+ * This would be case delta % 4 == 3:
+ * +----------------+
+ * | +--+ |
+ * | | | |
+ * | | | |
+ * | +--+ |
+ * | |
+ * +----------------+
*/
public static void rotateBounds(Rect inOutBounds, int parentWidth, int parentHeight,
int delta) {
@@ -802,6 +874,9 @@
@NonNull Rect inclusionBounds,
@NonNull Rect exclusionBounds,
@AdjustmentDirection int adjustmentDirection) {
+ if (!Rect.intersects(targetViewBounds, exclusionBounds)) {
+ return;
+ }
switch (adjustmentDirection) {
case TRANSLATE_RIGHT:
targetView.setTranslationX(Math.min(
@@ -835,4 +910,27 @@
// No-Op
}
}
+
+ /**
+ * Does a depth-first search through the View hierarchy starting at root, to find a view that
+ * matches the predicate. Returns null if no View was found. View has a findViewByPredicate
+ * member function but it is currently a @hide API.
+ */
+ @Nullable
+ public static <T extends View> T findViewByPredicate(@NonNull View root,
+ @NonNull Predicate<View> predicate) {
+ if (predicate.test(root)) {
+ return (T) root;
+ }
+ if (root instanceof ViewGroup parent) {
+ int count = parent.getChildCount();
+ for (int i = 0; i < count; i++) {
+ View view = findViewByPredicate(parent.getChildAt(i), predicate);
+ if (view != null) {
+ return (T) view;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 584d089..255260e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -80,6 +80,8 @@
import com.android.launcher3.celllayout.CellPosMapper;
import com.android.launcher3.celllayout.CellPosMapper.CellPos;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.debug.TestEvent;
+import com.android.launcher3.debug.TestEventEmitter;
import com.android.launcher3.dot.FolderDotInfo;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
@@ -233,6 +235,7 @@
boolean mChildrenLayersEnabled = true;
private boolean mStripScreensOnPageStopMoving = false;
+ public boolean mHasOnLayoutBeenCalled = false;
private boolean mWorkspaceFadeInAdjacentScreens;
@@ -314,7 +317,6 @@
*/
public Workspace(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
-
mLauncher = Launcher.getLauncher(context);
mStateTransitionAnimation = new WorkspaceStateTransitionAnimation(mLauncher, this);
mWallpaperManager = WallpaperManager.getInstance(context);
@@ -526,7 +528,7 @@
}
updateChildrenLayersEnabled();
- StateManager<LauncherState> stateManager = mLauncher.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = mLauncher.getStateManager();
stateManager.addStateListener(new StateManager.StateListener<LauncherState>() {
@Override
public void onStateTransitionComplete(LauncherState finalState) {
@@ -1444,6 +1446,7 @@
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ mHasOnLayoutBeenCalled = true; // b/349929393 - is the required call to onLayout not done?
if (mUnlockWallpaperFromDefaultPageOnLayout) {
mWallpaperOffset.setLockToDefaultPage(false);
mUnlockWallpaperFromDefaultPageOnLayout = false;
@@ -2218,6 +2221,7 @@
if (d.stateAnnouncer != null && !droppedOnOriginalCell) {
d.stateAnnouncer.completeAction(R.string.item_moved);
}
+ TestEventEmitter.INSTANCE.get(getContext()).sendEvent(TestEvent.WORKSPACE_ON_DROP);
}
@Nullable
diff --git a/src/com/android/launcher3/WorkspaceLayoutManager.java b/src/com/android/launcher3/WorkspaceLayoutManager.java
index 4768773..f11a88f 100644
--- a/src/com/android/launcher3/WorkspaceLayoutManager.java
+++ b/src/com/android/launcher3/WorkspaceLayoutManager.java
@@ -58,6 +58,9 @@
int screenId = presenterPos.screenId;
x = getHotseat().getCellXFromOrder(screenId);
y = getHotseat().getCellYFromOrder(screenId);
+ // TODO(b/335141365): Remove this log after the bug is fixed.
+ Log.d(TAG, "addInScreenFromBind: hotseat inflation with x = " + x
+ + " and y = " + y);
}
addInScreen(child, info.container, presenterPos.screenId, x, y, info.spanX, info.spanY);
}
diff --git a/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java b/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java
deleted file mode 100644
index 79b8187..0000000
--- a/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.accessibility;
-
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.OnHierarchyChangeListener;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.CellLayout;
-import com.android.launcher3.DropTarget.DragObject;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.dragndrop.DragController.DragListener;
-import com.android.launcher3.dragndrop.DragOptions;
-
-import java.util.function.Function;
-
-/**
- * Utility listener to enable/disable accessibility drag flags for a ViewGroup
- * containing CellLayouts
- */
-public class AccessibleDragListenerAdapter implements DragListener, OnHierarchyChangeListener {
-
- private final ViewGroup mViewGroup;
- private final Function<CellLayout, DragAndDropAccessibilityDelegate> mDelegateFactory;
-
- /**
- * @param parent the viewgroup containing all the children
- * @param delegateFactory function to create no delegates
- */
- public AccessibleDragListenerAdapter(ViewGroup parent,
- Function<CellLayout, DragAndDropAccessibilityDelegate> delegateFactory) {
- mViewGroup = parent;
- mDelegateFactory = delegateFactory;
- }
-
- @Override
- public void onDragStart(DragObject dragObject, DragOptions options) {
- mViewGroup.setOnHierarchyChangeListener(this);
- enableAccessibleDrag(true, dragObject);
- }
-
- @Override
- public void onDragEnd() {
- mViewGroup.setOnHierarchyChangeListener(null);
- enableAccessibleDrag(false, null);
- Launcher.getLauncher(mViewGroup.getContext()).getDragController().removeDragListener(this);
- }
-
-
- @Override
- public void onChildViewAdded(View parent, View child) {
- if (parent == mViewGroup) {
- setEnableForLayout((CellLayout) child, true);
- }
- }
-
- @Override
- public void onChildViewRemoved(View parent, View child) {
- if (parent == mViewGroup) {
- setEnableForLayout((CellLayout) child, false);
- }
- }
-
- protected void enableAccessibleDrag(boolean enable, @Nullable DragObject dragObject) {
- for (int i = 0; i < mViewGroup.getChildCount(); i++) {
- setEnableForLayout((CellLayout) mViewGroup.getChildAt(i), enable);
- }
- }
-
- protected final void setEnableForLayout(CellLayout layout, boolean enable) {
- layout.setDragAndDropAccessibilityDelegate(enable ? mDelegateFactory.apply(layout) : null);
- }
-}
diff --git a/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.kt b/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.kt
new file mode 100644
index 0000000..21c2caf
--- /dev/null
+++ b/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.kt
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.accessibility
+
+import android.view.View
+import android.view.ViewGroup
+import com.android.launcher3.CellLayout
+import com.android.launcher3.DropTarget.DragObject
+import com.android.launcher3.dragndrop.DragController
+import com.android.launcher3.dragndrop.DragOptions
+import com.android.launcher3.views.ActivityContext
+import java.util.function.Function
+
+/**
+ * Utility listener to enable/disable accessibility drag flags for a ViewGroup containing
+ * CellLayouts
+ */
+open class AccessibleDragListenerAdapter
+/**
+ * @param parent the viewgroup containing all the children
+ * @param delegateFactory function to create no delegates
+ */
+(
+ private val mViewGroup: ViewGroup,
+ private val mDelegateFactory: Function<CellLayout, DragAndDropAccessibilityDelegate>
+) : DragController.DragListener, ViewGroup.OnHierarchyChangeListener {
+ override fun onDragStart(dragObject: DragObject, options: DragOptions) {
+ mViewGroup.setOnHierarchyChangeListener(this)
+ enableAccessibleDrag(true, dragObject)
+ }
+
+ override fun onDragEnd() {
+ mViewGroup.setOnHierarchyChangeListener(null)
+ enableAccessibleDrag(false, null)
+ val activityContext = ActivityContext.lookupContext(mViewGroup.context) as ActivityContext
+ activityContext.getDragController<DragController<*>>()?.removeDragListener(this)
+ }
+
+ override fun onChildViewAdded(parent: View, child: View) {
+ if (parent === mViewGroup) {
+ setEnableForLayout(child as CellLayout, true)
+ }
+ }
+
+ override fun onChildViewRemoved(parent: View, child: View) {
+ if (parent === mViewGroup) {
+ setEnableForLayout(child as CellLayout, false)
+ }
+ }
+
+ protected open fun enableAccessibleDrag(enable: Boolean, dragObject: DragObject?) {
+ for (i in 0 until mViewGroup.childCount) {
+ setEnableForLayout(mViewGroup.getChildAt(i) as CellLayout, enable)
+ }
+ }
+
+ protected fun setEnableForLayout(layout: CellLayout, enable: Boolean) {
+ layout.setDragAndDropAccessibilityDelegate(
+ if (enable) mDelegateFactory.apply(layout) else null
+ )
+ }
+}
diff --git a/src/com/android/launcher3/accessibility/DragAndDropAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/DragAndDropAccessibilityDelegate.java
index d0fc175..6f73e07 100644
--- a/src/com/android/launcher3/accessibility/DragAndDropAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/DragAndDropAccessibilityDelegate.java
@@ -29,9 +29,9 @@
import androidx.customview.widget.ExploreByTouchHelper;
import com.android.launcher3.CellLayout;
-import com.android.launcher3.Launcher;
import com.android.launcher3.R;
-import com.android.launcher3.dragndrop.DragLayer;
+import com.android.launcher3.views.ActivityContext;
+import com.android.launcher3.views.BaseDragLayer;
import java.util.List;
@@ -47,16 +47,17 @@
protected final CellLayout mView;
protected final Context mContext;
+ protected final ActivityContext mActivityContext;
protected final LauncherAccessibilityDelegate mDelegate;
- protected final DragLayer mDragLayer;
+ protected final BaseDragLayer<?> mDragLayer;
public DragAndDropAccessibilityDelegate(CellLayout forView) {
super(forView);
mView = forView;
mContext = mView.getContext();
- Launcher launcher = Launcher.getLauncher(mContext);
- mDelegate = launcher.getAccessibilityDelegate();
- mDragLayer = launcher.getDragLayer();
+ mActivityContext = ActivityContext.lookupContext(mContext);
+ mDelegate = (LauncherAccessibilityDelegate) mActivityContext.getAccessibilityDelegate();
+ mDragLayer = mActivityContext.getDragLayer();
}
@Override
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 2f623e2..cc4724c 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.Flags.enableExpandingPauseWorkButton;
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.MAIN;
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.SEARCH;
+import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.WORK;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_HEADER;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_DISABLED_CARD;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_EDU_CARD;
@@ -28,6 +29,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE;
+import static com.android.launcher3.views.RecyclerViewFastScroller.FastScrollerLocation.ALL_APPS_SCROLLER;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -64,6 +66,7 @@
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.VisibleForTesting;
+import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.graphics.ColorUtils;
import androidx.recyclerview.widget.RecyclerView;
@@ -71,6 +74,7 @@
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
+import com.android.launcher3.Flags;
import com.android.launcher3.Insettable;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.R;
@@ -166,6 +170,7 @@
protected FloatingHeaderView mHeader;
protected View mBottomSheetBackground;
protected RecyclerViewFastScroller mFastScroller;
+ private ConstraintLayout mFastScrollLetterLayout;
/**
* View that defines the search box. Result is rendered inside {@link #mSearchRecyclerView}.
@@ -280,6 +285,13 @@
mSearchRecyclerView = findViewById(R.id.search_results_list_view);
mFastScroller = findViewById(R.id.fast_scroller);
mFastScroller.setPopupView(findViewById(R.id.fast_scroller_popup));
+ mFastScrollLetterLayout = findViewById(R.id.scroll_letter_layout);
+ if (Flags.letterFastScroller()) {
+ // Set clip children to false otherwise the scroller letters will be clipped.
+ setClipChildren(false);
+ } else {
+ setClipChildren(true);
+ }
mSearchContainer = inflateSearchBar();
if (!isSearchBarFloating()) {
@@ -470,8 +482,9 @@
* @param exitSearch Whether to force exit the search state and return to A-Z apps list.
*/
public void reset(boolean animate, boolean exitSearch) {
+ // Scroll Main and Work RV to top. Search RV is done in `resetSearch`.
for (int i = 0; i < mAH.size(); i++) {
- if (mAH.get(i).mRecyclerView != null) {
+ if (i != SEARCH && mAH.get(i).mRecyclerView != null) {
mAH.get(i).mRecyclerView.scrollToTop();
}
}
@@ -485,10 +498,8 @@
// Reset the base recycler view after transitioning home.
updateHeaderScroll(0);
if (exitSearch) {
- // Reset the search bar after transitioning home.
+ // Reset the search bar and search RV after transitioning home.
MAIN_EXECUTOR.getHandler().post(mSearchUiManager::resetSearch);
- // Animate to A-Z with 0 time to reset the animation with proper state management.
- animateToSearchState(false, 0);
}
if (isSearching()) {
mWorkManager.reset();
@@ -562,7 +573,8 @@
mActivityContext.hideKeyboard();
}
if (mAH.get(currentActivePage).mRecyclerView != null) {
- mAH.get(currentActivePage).mRecyclerView.bindFastScrollbar(mFastScroller);
+ mAH.get(currentActivePage).mRecyclerView.bindFastScrollbar(mFastScroller,
+ ALL_APPS_SCROLLER);
}
// Header keeps track of active recycler view to properly render header protection.
mHeader.setActiveRV(currentActivePage);
@@ -587,12 +599,6 @@
return;
}
- if (!FeatureFlags.ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES.get()) {
- RecyclerView.ItemDecoration decoration = getMainAdapterProvider().getDecorator();
- getSearchRecyclerView().removeItemDecoration(decoration);
- getSearchRecyclerView().addItemDecoration(decoration);
- }
-
// replaceAppsRVcontainer() needs to use both mUsingTabs value to remove the old view AND
// showTabs value to create new view. Hence the mUsingTabs new value assignment MUST happen
// after this call.
@@ -771,6 +777,16 @@
}
}
+ /**
+ * Force header height update with an offset. Used by {@link UniversalSearchInputView} to
+ * request {@link FloatingHeaderView} to update its maxTranslation for multiline search bar.
+ */
+ public void forceUpdateHeaderHeight(int offset) {
+ if (Flags.multilineSearchBar()) {
+ mHeader.updateSearchBarOffset(offset);
+ }
+ }
+
protected void updateHeaderScroll(int scrolledOffset) {
float prog1 = Utilities.boundToRange((float) scrolledOffset / mHeaderThreshold, 0f, 1f);
int headerColor = getHeaderColor(prog1);
@@ -1309,6 +1325,10 @@
return mAH.get(MAIN).mAppsList;
}
+ public AlphabeticalAppsList<T> getWorkAppList() {
+ return mAH.get(WORK).mAppsList;
+ }
+
public FloatingHeaderView getFloatingHeaderView() {
return mHeader;
}
@@ -1491,6 +1511,10 @@
}
}
+ ConstraintLayout getFastScrollerLetterList() {
+ return mFastScrollLetterLayout;
+ }
+
/**
* redraws header protection
*/
@@ -1558,7 +1582,7 @@
void setup(@NonNull View rv, @Nullable Predicate<ItemInfo> matcher) {
mAppsList.updateItemFilter(matcher);
mRecyclerView = (AllAppsRecyclerView) rv;
- mRecyclerView.bindFastScrollbar(mFastScroller);
+ mRecyclerView.bindFastScrollbar(mFastScroller, ALL_APPS_SCROLLER);
mRecyclerView.setEdgeEffectFactory(createEdgeEffectFactory());
mRecyclerView.setApps(mAppsList);
mRecyclerView.setLayoutManager(mLayoutManager);
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index ba34f59..ae45a35 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -15,6 +15,9 @@
*/
package com.android.launcher3.allapps;
+import static androidx.constraintlayout.widget.ConstraintSet.MATCH_CONSTRAINT;
+import static androidx.constraintlayout.widget.ConstraintSet.WRAP_CONTENT;
+
import static com.android.launcher3.config.FeatureFlags.ALL_APPS_GONE_VISIBILITY;
import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_RV_PREINFLATION;
import static com.android.launcher3.logger.LauncherAtom.ContainerInfo;
@@ -36,22 +39,29 @@
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.LayoutInflater;
import android.view.View;
+import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.util.Consumer;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.FastScrollRecyclerView;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.views.ActivityContext;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -66,6 +76,7 @@
protected final int mNumAppsPerRow;
private final AllAppsFastScrollHelper mFastScrollHelper;
private int mCumulativeVerticalScroll;
+ private ConstraintLayout mLetterList;
protected AlphabeticalAppsList<?> mApps;
@@ -238,6 +249,9 @@
return;
}
+ if (Flags.letterFastScroller() && !mScrollbar.isDraggingThumb()) {
+ setLettersToScrollLayout(mApps.getFastScrollerSections());
+ }
// Only show the scrollbar if there is height to be scrolled
int availableScrollBarHeight = getAvailableScrollBarHeight();
int availableScrollHeight = getAvailableScrollHeight();
@@ -305,9 +319,7 @@
@Override
public int getScrollBarTop() {
- return ActivityContext.lookupContext(getContext()).getAppsView().isSearchSupported()
- ? getResources().getDimensionPixelOffset(R.dimen.all_apps_header_top_padding)
- : 0;
+ return getResources().getDimensionPixelOffset(R.dimen.all_apps_header_top_padding);
}
@Override
@@ -321,6 +333,80 @@
return false;
}
+ public void setLettersToScrollLayout(
+ List<AlphabeticalAppsList.FastScrollSectionInfo> fastScrollSections) {
+ if (mLetterList != null) {
+ mLetterList.removeAllViews();
+ }
+ Context context = getContext();
+ ActivityAllAppsContainerView<?> allAppsContainerView =
+ ActivityContext.lookupContext(context).getAppsView();
+ mLetterList = allAppsContainerView.getFastScrollerLetterList();
+ mLetterList.setPadding(0, getScrollBarTop(), 0, getScrollBarMarginBottom());
+ List<LetterListTextView> textViews = new ArrayList<>();
+ for (int i = 0; i < fastScrollSections.size(); i++) {
+ AlphabeticalAppsList.FastScrollSectionInfo sectionInfo = fastScrollSections.get(i);
+ LetterListTextView textView =
+ (LetterListTextView) LayoutInflater.from(context).inflate(
+ R.layout.fast_scroller_letter_list_text_view, mLetterList, false);
+ int viewId = View.generateViewId();
+ textView.setId(viewId);
+ sectionInfo.setId(viewId);
+ textView.setText(sectionInfo.sectionName);
+ if (i == fastScrollSections.size() - 1) {
+ // The last section info is just a duplicate so that user can scroll to the bottom.
+ textView.setVisibility(INVISIBLE);
+ }
+ ConstraintLayout.LayoutParams lp = new ConstraintLayout.LayoutParams(
+ MATCH_CONSTRAINT, WRAP_CONTENT);
+ lp.dimensionRatio = "v,1:1";
+ textView.setLayoutParams(lp);
+ textViews.add(textView);
+ mLetterList.addView(textView);
+ }
+ // Need to add an extra textview to be aligned.
+ LetterListTextView lastLetterListTextView = new LetterListTextView(context);
+ int currentId = View.generateViewId();
+ lastLetterListTextView.setId(currentId);
+ lastLetterListTextView.setVisibility(INVISIBLE);
+ textViews.add(lastLetterListTextView);
+ mLetterList.addView(lastLetterListTextView);
+ constraintTextViewsVertically(mLetterList, textViews);
+ mLetterList.setVisibility(VISIBLE);
+ }
+
+ private void constraintTextViewsVertically(ConstraintLayout constraintLayout,
+ List<LetterListTextView> textViews) {
+ ConstraintSet chain = new ConstraintSet();
+ chain.clone(constraintLayout);
+ for (int i = 0; i < textViews.size(); i++) {
+ LetterListTextView currentView = textViews.get(i);
+ if (i == 0) {
+ chain.connect(currentView.getId(), ConstraintSet.TOP, ConstraintSet.PARENT_ID,
+ ConstraintSet.TOP);
+ } else {
+ chain.connect(currentView.getId(), ConstraintSet.TOP, textViews.get(i-1).getId(),
+ ConstraintSet.BOTTOM);
+ }
+ chain.connect(currentView.getId(), ConstraintSet.START, constraintLayout.getId(),
+ ConstraintSet.START);
+ chain.connect(currentView.getId(), ConstraintSet.END, constraintLayout.getId(),
+ ConstraintSet.END);
+ }
+ int[] viewIds = textViews.stream().mapToInt(TextView::getId).toArray();
+ float[] weights = new float[textViews.size()];
+ Arrays.fill(weights,1); // fill with 1 for equal weights
+ chain.createVerticalChain(constraintLayout.getId(), ConstraintSet.TOP,
+ constraintLayout.getId(), ConstraintSet.BOTTOM, viewIds, weights,
+ ConstraintSet.CHAIN_SPREAD);
+ chain.applyTo(constraintLayout);
+ }
+
+ @Override
+ public ConstraintLayout getLetterList() {
+ return mLetterList;
+ }
+
private void logCumulativeVerticalScroll() {
ActivityContext context = ActivityContext.lookupContext(getContext());
StatsLogManager mgr = context.getStatsLogManager();
diff --git a/src/com/android/launcher3/allapps/AllAppsStore.java b/src/com/android/launcher3/allapps/AllAppsStore.java
index 9623709..a4f130a 100644
--- a/src/com/android/launcher3/allapps/AllAppsStore.java
+++ b/src/com/android/launcher3/allapps/AllAppsStore.java
@@ -42,6 +42,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Consumer;
@@ -260,8 +261,13 @@
public void dump(String prefix, PrintWriter writer) {
writer.println(prefix + "\tAllAppsStore Apps[] size: " + mApps.length);
for (int i = 0; i < mApps.length; i++) {
- writer.println(String.format("%s\tPackage index and name: %d/%s", prefix, i,
- mApps[i].componentName.getPackageName()));
+ writer.println(String.format(Locale.getDefault(),
+ "%s\tPackage index, name, class, and description: %d/%s:%s, %s",
+ prefix,
+ i,
+ mApps[i].componentName.getPackageName(),
+ mApps[i].componentName.getClassName(),
+ mApps[i].contentDescription));
}
}
}
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index a810331..8e44d65 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -15,6 +15,7 @@
*/
package com.android.launcher3.allapps;
+import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_BOTTOM_VIEW_TO_SCROLL_TO;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_LEFT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_RIGHT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_NOTHING;
@@ -25,6 +26,7 @@
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ImageSpan;
+import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
@@ -38,6 +40,7 @@
import com.android.launcher3.util.LabelComparator;
import com.android.launcher3.views.ActivityContext;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -71,11 +74,17 @@
public final CharSequence sectionName;
// The item position
public final int position;
+ // The view id associated with this section
+ public int id = -1;
public FastScrollSectionInfo(CharSequence sectionName, int position) {
this.sectionName = sectionName;
this.position = position;
}
+
+ public void setId(int id) {
+ this.id = id;
+ }
}
@@ -269,6 +278,7 @@
List<AdapterItem> oldItems = new ArrayList<>(mAdapterItems);
// Prepare to update the list of sections, filtered apps, etc.
mFastScrollerSections.clear();
+ Log.d(TAG, "Clearing FastScrollerSections.");
mAdapterItems.clear();
mAccessibilityResultsCount = 0;
@@ -289,12 +299,22 @@
mFastScrollerSections.add(new FastScrollSectionInfo(
mActivityContext.getResources().getString(
R.string.work_profile_edu_section), 0));
+ Log.d(TAG, "Adding FastScrollSection for work edu card.");
}
position = addAppsWithSections(mApps, position);
}
if (Flags.enablePrivateSpace()) {
position = addPrivateSpaceItems(position);
}
+ if (!mFastScrollerSections.isEmpty()) {
+ // After all the adapterItems are added, add a view to the bottom so that user can
+ // scroll all the way down.
+ mAdapterItems.add(new AdapterItem(VIEW_TYPE_BOTTOM_VIEW_TO_SCROLL_TO));
+ mFastScrollerSections.add(new FastScrollSectionInfo(
+ mFastScrollerSections.get(mFastScrollerSections.size() - 1).sectionName,
+ position++));
+ Log.d(TAG, "Adding FastScrollSection duplicate to scroll to the bottom.");
+ }
}
mAccessibilityResultsCount = (int) mAdapterItems.stream()
.filter(AdapterItem::isCountedForAccessibility).count();
@@ -337,6 +357,9 @@
&& !mPrivateApps.isEmpty()) {
// Always add PS Header if Space is present and visible.
position = mPrivateProviderManager.addPrivateSpaceHeader(mAdapterItems);
+ Log.d(TAG, "Adding FastScrollSection for Private Space header. ");
+ mFastScrollerSections.add(new FastScrollSectionInfo(
+ mPrivateProfileAppScrollerBadge, position));
int privateSpaceState = mPrivateProviderManager.getCurrentState();
switch (privateSpaceState) {
case PrivateProfileManager.STATE_DISABLED:
@@ -396,14 +419,14 @@
hasPrivateApps = appList.stream().
allMatch(mPrivateProviderManager.getItemInfoMatcher());
}
+ Log.d(TAG, "Adding apps with sections. HasPrivateApps: " + hasPrivateApps);
for (int i = 0; i < appList.size(); i++) {
AppInfo info = appList.get(i);
// Apply decorator to private apps.
if (hasPrivateApps) {
mAdapterItems.add(AdapterItem.asAppWithDecorationInfo(info,
- new SectionDecorationInfo(mActivityContext.getApplicationContext(),
- getRoundRegions(i, appList.size()),
- true /* decorateTogether */)));
+ new SectionDecorationInfo(mActivityContext,
+ getRoundRegions(i, appList.size()), true /* decorateTogether */)));
} else {
mAdapterItems.add(AdapterItem.asApp(info));
}
@@ -411,6 +434,8 @@
String sectionName = info.sectionName;
// Create a new section if the section names do not match
if (!sectionName.equals(lastSectionName)) {
+ Log.d(TAG, "addAppsWithSections: adding sectionName: " + sectionName
+ + " with appInfoTitle: " + info.title);
lastSectionName = sectionName;
mFastScrollerSections.add(new FastScrollSectionInfo(hasPrivateApps ?
mPrivateProfileAppScrollerBadge : sectionName, position));
@@ -461,6 +486,13 @@
return mPrivateProviderManager;
}
+ public void dump(String prefix, PrintWriter writer) {
+ writer.println(prefix + "SectionInfo[] size: " + mFastScrollerSections.size());
+ for (int i = 0; i < mFastScrollerSections.size(); i++) {
+ writer.println("\tFastScrollSection: " + mFastScrollerSections.get(i).sectionName);
+ }
+ }
+
private static class MyDiffCallback extends DiffUtil.Callback {
private final List<AdapterItem> mOldList;
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
index a21d7be..60bf3ea 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
@@ -26,6 +26,7 @@
import static com.android.launcher3.allapps.UserProfileManager.STATE_ENABLED;
import android.content.Context;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -44,7 +45,6 @@
import com.android.launcher3.R;
import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.model.data.AppInfo;
-import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.views.ActivityContext;
/**
@@ -68,7 +68,8 @@
public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 5;
public static final int VIEW_TYPE_PRIVATE_SPACE_HEADER = 1 << 6;
public static final int VIEW_TYPE_PRIVATE_SPACE_SYS_APPS_DIVIDER = 1 << 7;
- public static final int NEXT_ID = 8;
+ public static final int VIEW_TYPE_BOTTOM_VIEW_TO_SCROLL_TO = 1 << 8;
+ public static final int NEXT_ID = 9;
// Common view type masks
public static final int VIEW_TYPE_MASK_DIVIDER = VIEW_TYPE_ALL_APPS_DIVIDER;
@@ -247,6 +248,8 @@
case VIEW_TYPE_PRIVATE_SPACE_HEADER:
return new ViewHolder(mLayoutInflater.inflate(
R.layout.private_space_header, parent, false));
+ case VIEW_TYPE_BOTTOM_VIEW_TO_SCROLL_TO:
+ return new ViewHolder(new View(mActivityContext));
default:
if (mAdapterProvider.isViewSupported(viewType)) {
return mAdapterProvider.onCreateViewHolder(mLayoutInflater, parent, viewType);
@@ -268,15 +271,24 @@
PrivateProfileManager privateProfileManager = mApps.getPrivateProfileManager();
if (privateProfileManager != null) {
// Set the alpha of the private space icon to 0 upon expanding the header so the
- // alpha can animate -> 1.
+ // alpha can animate -> 1. This should only be in effect when doing a
+ // transitioning between Locked/Unlocked state.
boolean isPrivateSpaceItem =
privateProfileManager.isPrivateSpaceItem(adapterItem);
if (icon.getAlpha() == 0 || icon.getAlpha() == 1) {
icon.setAlpha(isPrivateSpaceItem
- && privateProfileManager.getAnimationScrolling()
- && privateProfileManager.getAnimate()
+ && privateProfileManager.isStateTransitioning()
+ && (privateProfileManager.isScrolling() ||
+ privateProfileManager.getReadyToAnimate())
&& privateProfileManager.getCurrentState() == STATE_ENABLED
? 0 : 1);
+ Log.d(TAG, "onBindViewHolder: "
+ + "isPrivateSpaceItem: " + isPrivateSpaceItem
+ + " isStateTransitioning: " + privateProfileManager.isStateTransitioning()
+ + " isScrolling: " + privateProfileManager.isScrolling()
+ + " readyToAnimate: " + privateProfileManager.getReadyToAnimate()
+ + " currentState: " + privateProfileManager.getCurrentState()
+ + " currentAlpha: " + icon.getAlpha());
}
// Views can still be bounded before the app list is updated hence showing icons
// after collapsing.
@@ -299,7 +311,7 @@
case VIEW_TYPE_PRIVATE_SPACE_HEADER:
RelativeLayout psHeaderLayout = holder.itemView.findViewById(
R.id.ps_header_layout);
- mApps.getPrivateProfileManager().addPrivateSpaceHeaderViewElements(psHeaderLayout);
+ mApps.getPrivateProfileManager().bindPrivateSpaceHeaderViewElements(psHeaderLayout);
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
int roundRegions = ROUND_TOP_LEFT | ROUND_TOP_RIGHT;
if (mApps.getPrivateProfileManager().getCurrentState() == STATE_DISABLED) {
@@ -315,6 +327,7 @@
== STATE_DISABLED ? null : new SectionDecorationInfo(mActivityContext,
ROUND_NOTHING, true /* decorateTogether */);
break;
+ case VIEW_TYPE_BOTTOM_VIEW_TO_SCROLL_TO:
case VIEW_TYPE_ALL_APPS_DIVIDER:
case VIEW_TYPE_WORK_DISABLED_CARD:
// nothing to do
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 92c589c..a2bd5dd 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -30,6 +30,7 @@
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
+import com.android.launcher3.Flags;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder;
@@ -104,6 +105,8 @@
private boolean mFloatingRowsCollapsed;
// Total height of all current floating rows. Collapsed rows == 0 height.
private int mFloatingRowsHeight;
+ // Offset of search bar. Adds to the floating view height when multi-line is supported.
+ private int mSearchBarOffset = 0;
// This is initialized once during inflation and stays constant after that. Fixed views
// cannot be added or removed dynamically.
@@ -198,6 +201,14 @@
}
}
+ /**
+ * Offset floating rows height by search bar
+ */
+ void updateSearchBarOffset(int offset) {
+ mSearchBarOffset = offset;
+ onHeightUpdated();
+ }
+
@Override
public void onPluginDisconnected(AllAppsRow plugin) {
PluginHeaderRow row = mPluginRows.get(plugin);
@@ -258,9 +269,18 @@
mTabLayout.setVisibility(mTabsHidden ? GONE : visibility);
}
+ /** Returns whether search bar has multi-line support, and is currently in multi-line state. */
+ private boolean isSearchBarMultiline() {
+ return Flags.multilineSearchBar() && mSearchBarOffset > 0;
+ }
+
private void updateExpectedHeight() {
updateFloatingRowsHeight();
mMaxTranslation = 0;
+ boolean shouldAddSearchBarHeight = isSearchBarMultiline() && !Flags.floatingSearchBar();
+ if (shouldAddSearchBarHeight) {
+ mMaxTranslation += mSearchBarOffset;
+ }
if (mFloatingRowsCollapsed) {
return;
}
diff --git a/src/com/android/launcher3/allapps/FloatingMaskView.java b/src/com/android/launcher3/allapps/FloatingMaskView.java
new file mode 100644
index 0000000..cee5e18
--- /dev/null
+++ b/src/com/android/launcher3/allapps/FloatingMaskView.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import androidx.annotation.VisibleForTesting;
+import androidx.constraintlayout.widget.ConstraintLayout;
+
+import com.android.launcher3.R;
+import com.android.launcher3.views.ActivityContext;
+
+public class FloatingMaskView extends ConstraintLayout {
+
+ private final ActivityContext mActivityContext;
+ private ImageView mBottomBox;
+
+ public FloatingMaskView(Context context) {
+ this(context, null, 0);
+ }
+
+ public FloatingMaskView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public FloatingMaskView(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mActivityContext = ActivityContext.lookupContext(context);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ mBottomBox = findViewById(R.id.bottom_box);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ setParameters((ViewGroup.MarginLayoutParams) getLayoutParams(),
+ mActivityContext.getAppsView().getActiveRecyclerView());
+ }
+
+ @VisibleForTesting
+ void setParameters(ViewGroup.MarginLayoutParams lp, AllAppsRecyclerView recyclerView) {
+ if (lp != null) {
+ lp.rightMargin = recyclerView.getPaddingRight();
+ lp.leftMargin = recyclerView.getPaddingLeft();
+ getBottomBox().setMinimumHeight(recyclerView.getPaddingBottom());
+ }
+ }
+
+ @VisibleForTesting
+ ImageView getBottomBox() {
+ return mBottomBox;
+ }
+}
diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
index 63a168e..1e0f289 100644
--- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
@@ -56,7 +56,7 @@
return false;
}
Launcher launcher = mActivityContext;
- StateManager<LauncherState> manager = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> manager = launcher.getStateManager();
if (manager.isInTransition() && manager.getTargetState() != null) {
return manager.getTargetState().shouldFloatingSearchBarUsePillWhenUnfocused(launcher);
}
@@ -70,7 +70,7 @@
return super.getFloatingSearchBarRestingMarginBottom();
}
Launcher launcher = mActivityContext;
- StateManager<LauncherState> stateManager = launcher.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = launcher.getStateManager();
// We want to rest at the current state's resting position, unless we are in transition and
// the target state's resting position is higher (that way if we are closing the keyboard,
@@ -95,7 +95,7 @@
return super.getFloatingSearchBarRestingMarginStart();
}
- StateManager<LauncherState> stateManager = mActivityContext.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = mActivityContext.getStateManager();
// Special case to not expand the search bar when exiting All Apps on phones.
if (stateManager.getCurrentStableState() == LauncherState.ALL_APPS
@@ -117,7 +117,7 @@
return super.getFloatingSearchBarRestingMarginEnd();
}
- StateManager<LauncherState> stateManager = mActivityContext.getStateManager();
+ StateManager<LauncherState, Launcher> stateManager = mActivityContext.getStateManager();
// Special case to not expand the search bar when exiting All Apps on phones.
if (stateManager.getCurrentStableState() == LauncherState.ALL_APPS
diff --git a/src/com/android/launcher3/allapps/LetterListTextView.java b/src/com/android/launcher3/allapps/LetterListTextView.java
new file mode 100644
index 0000000..9326d79
--- /dev/null
+++ b/src/com/android/launcher3/allapps/LetterListTextView.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps;
+
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.widget.TextView;
+
+import androidx.core.graphics.ColorUtils;
+
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.util.Themes;
+
+/**
+ * A TextView that is used to display the letter list in the fast scroller.
+ */
+public class LetterListTextView extends TextView {
+ private static final float ABSOLUTE_TRANSLATION_X = 30f;
+ private static final float ABSOLUTE_SCALE = 1.4f;
+ private final Drawable mLetterBackground;
+ private final int mLetterListTextWidthAndHeight;
+ private final int mTextColor;
+ private final int mBackgroundColor;
+ private final int mSelectedColor;
+
+ public LetterListTextView(Context context) {
+ this(context, null, 0);
+ }
+
+ public LetterListTextView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public LetterListTextView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ mLetterBackground = context.getDrawable(R.drawable.bg_letter_list_text);
+ mLetterListTextWidthAndHeight = context.getResources().getDimensionPixelSize(
+ R.dimen.fastscroll_list_letter_size);
+ mTextColor = Themes.getAttrColor(context, R.attr.materialColorOnSurface);
+ mBackgroundColor = Themes.getAttrColor(context, R.attr.materialColorSurfaceContainer);
+ mSelectedColor = Themes.getAttrColor(context, R.attr.materialColorOnSecondary);
+ }
+
+ @Override
+ public void onFinishInflate() {
+ super.onFinishInflate();
+ setBackground(mLetterBackground);
+ setTextColor(mTextColor);
+ setClickable(false);
+ setWidth(mLetterListTextWidthAndHeight);
+ setTextSize(mLetterListTextWidthAndHeight);
+ setVisibility(VISIBLE);
+ }
+
+ /**
+ * Animates the letter list text view based on the current finger position.
+ *
+ * @param currentFingerY The Y position of where the finger is placed on the fastScroller in
+ * pixels.
+ */
+ public void animateBasedOnYPosition(int currentFingerY) {
+ if (getBackground() == null) {
+ return;
+ }
+ float cutOffMin = currentFingerY - (getHeight() * 2);
+ float cutOffMax = currentFingerY + (getHeight() * 2);
+ float cutOffDistance = cutOffMax - cutOffMin;
+ // Update the background blend color
+ boolean isWithinAnimationBounds = getY() < cutOffMax && getY() > cutOffMin;
+ if (isWithinAnimationBounds) {
+ getBackground().setColorFilter(new PorterDuffColorFilter(
+ getBlendColorBasedOnYPosition(currentFingerY, cutOffDistance),
+ PorterDuff.Mode.MULTIPLY));
+ } else {
+ getBackground().setColorFilter(new PorterDuffColorFilter(
+ mBackgroundColor, PorterDuff.Mode.MULTIPLY));
+ }
+ translateBasedOnYPosition(currentFingerY, cutOffDistance, isWithinAnimationBounds);
+ scaleBasedOnYPosition(currentFingerY, cutOffDistance, isWithinAnimationBounds);
+ }
+
+ private int getBlendColorBasedOnYPosition(int y, float cutOffDistance) {
+ float raisedCosineBlend = (float) Math.cos(((y - getY()) / (cutOffDistance)) * Math.PI);
+ float blendRatio = Utilities.boundToRange(raisedCosineBlend, 0f, 1f);
+ return ColorUtils.blendARGB(mBackgroundColor, mSelectedColor, blendRatio);
+ }
+
+ private void scaleBasedOnYPosition(int y, float cutOffDistance,
+ boolean isWithinAnimationBounds) {
+ float raisedCosineScale = (float) Math.cos(((y - getY()) / (cutOffDistance)) * Math.PI)
+ * ABSOLUTE_SCALE;
+ if (isWithinAnimationBounds) {
+ raisedCosineScale = Utilities.boundToRange(raisedCosineScale, 1f, ABSOLUTE_SCALE);
+ setScaleX(raisedCosineScale);
+ setScaleY(raisedCosineScale);
+ } else {
+ setScaleX(1);
+ setScaleY(1);
+ }
+ }
+
+ private void translateBasedOnYPosition(int y, float cutOffDistance,
+ boolean isWithinAnimationBounds) {
+ float raisedCosineTranslation =
+ (float) Math.cos(((y - getY()) / (cutOffDistance)) * Math.PI)
+ * ABSOLUTE_TRANSLATION_X;
+ if (isWithinAnimationBounds) {
+ raisedCosineTranslation = -1 * Utilities.boundToRange(raisedCosineTranslation,
+ 0, ABSOLUTE_TRANSLATION_X);
+ setTranslationX(raisedCosineTranslation);
+ } else {
+ setTranslationX(0);
+ }
+ }
+}
diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java
index 551fa94..e215cab 100644
--- a/src/com/android/launcher3/allapps/PrivateProfileManager.java
+++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java
@@ -20,16 +20,17 @@
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
-import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
-import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PRIVATESPACE;
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.MAIN;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_ICON;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_HEADER;
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_SYS_APPS_DIVIDER;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_NOTHING;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_BEGIN;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_END;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_LOCK_TAP;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_BEGIN;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_END;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_UNLOCK_TAP;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE;
@@ -40,16 +41,15 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
-import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.Intent;
import android.os.UserHandle;
import android.os.UserManager;
+import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -57,6 +57,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
+import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
@@ -88,30 +89,57 @@
* logic in the Personal tab.
*/
public class PrivateProfileManager extends UserProfileManager {
- private static final int EXPAND_COLLAPSE_DURATION = 800;
- private static final int SETTINGS_OPACITY_DURATION = 160;
+
+ private static final String TAG = "PrivateProfileManager";
+ private static final int EXPAND_COLLAPSE_DURATION = 400;
+ private static final int SETTINGS_OPACITY_DURATION = 400;
+ private static final int TEXT_UNLOCK_OPACITY_DURATION = 300;
+ private static final int TEXT_LOCK_OPACITY_DURATION = 50;
+ private static final int APP_OPACITY_DURATION = 400;
+ private static final int MASK_VIEW_DURATION = 200;
+ private static final int APP_OPACITY_DELAY = 400;
+ private static final int PILL_TRANSITION_DELAY = 400;
+ private static final int SETTINGS_OPACITY_DELAY = 400;
+ private static final int LOCK_TEXT_OPACITY_DELAY = 500;
+ private static final int MASK_VIEW_DELAY = 400;
+ private static final int NO_DELAY = 0;
+ private static final int CONTAINER_OPACITY_DURATION = 150;
private final ActivityAllAppsContainerView<?> mAllApps;
private final Predicate<UserHandle> mPrivateProfileMatcher;
private final int mPsHeaderHeight;
+ private final int mFloatingMaskViewCornerRadius;
+ private final int mLockTextMarginStart;
+ private final int mLockTextMarginEnd;
private final RecyclerView.OnScrollListener mOnIdleScrollListener =
new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
- mAnimationScrolling = false;
+ mIsScrolling = false;
}
}
};
private Intent mAppInstallerIntent = new Intent();
private PrivateAppsSectionDecorator mPrivateAppsSectionDecorator;
private boolean mPrivateSpaceSettingsAvailable;
+ // Returns if the animation is currently running.
private boolean mIsAnimationRunning;
- private boolean mAnimate;
- private boolean mAnimationScrolling;
+ // mAnimate denotes if private space is ready to be animated.
+ private boolean mReadyToAnimate;
+ // Returns when the recyclerView is currently scrolling.
+ private boolean mIsScrolling;
+ // mIsStateTransitioning indicates that private space is transitioning between states.
+ private boolean mIsStateTransitioning;
private Runnable mOnPSHeaderAdded;
@Nullable
private RelativeLayout mPSHeader;
+ @Nullable
+ private TextView mLockText;
+ @Nullable
+ private PrivateSpaceSettingsButton mPrivateSpaceSettingsButton;
+ @Nullable
+ private ConstraintLayout mFloatingMaskView;
private final String mLockedStateContentDesc;
private final String mUnLockedStateContentDesc;
@@ -131,6 +159,12 @@
.getString(R.string.ps_container_lock_button_content_description);
mUnLockedStateContentDesc = mAllApps.getContext()
.getString(R.string.ps_container_unlock_button_content_description);
+ mFloatingMaskViewCornerRadius = mAllApps.getContext().getResources().getDimensionPixelSize(
+ R.dimen.ps_floating_mask_corner_radius);
+ mLockTextMarginStart = mAllApps.getContext().getResources().getDimensionPixelSize(
+ R.dimen.ps_lock_icon_text_margin_start_expanded);
+ mLockTextMarginEnd = mAllApps.getContext().getResources().getDimensionPixelSize(
+ R.dimen.ps_lock_icon_text_margin_end_expanded);
}
/** Adds Private Space Header to the layout. */
@@ -173,23 +207,6 @@
mAllApps.mAH.get(MAIN).mAdapter.notifyItemInserted(adapterItems.size() - 1);
}
- /**
- * Disables quiet mode for Private Space User Profile.
- * When called from search, a runnable is set and executed in the {@link #reset()} method, when
- * Launcher receives update about profile availability.
- * The runnable is only executed once, and reset after execution.
- * In case the method is called again, before the previously set runnable was executed,
- * the runnable will be updated.
- */
- public void unlockPrivateProfile() {
- setQuietMode(false);
- }
-
- /** Enables quiet mode for Private Space User Profile. */
- void lockPrivateProfile() {
- setQuietMode(true);
- }
-
/** Whether private profile should be hidden on Launcher. */
public boolean isPrivateSpaceHidden() {
return getCurrentState() == STATE_DISABLED && SettingsCache.INSTANCE
@@ -202,45 +219,25 @@
* when animation is not running.
*/
public void reset() {
+ // Ensure the state of the header views is what it should be before animating.
+ updateView();
getMainRecyclerView().setChildAttachedConsumer(null);
int previousState = getCurrentState();
boolean isEnabled = !mAllApps.getAppsStore()
.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED);
int updatedState = isEnabled ? STATE_ENABLED : STATE_DISABLED;
setCurrentState(updatedState);
- if (mPSHeader != null) {
- mPSHeader.setAlpha(1);
+ if (Flags.privateSpaceAddFloatingMaskView()) {
+ mFloatingMaskView = null;
}
- if (transitioningFromLockedToUnlocked(previousState, updatedState)) {
+ // It's possible that previousState is 0 when reset is first called.
+ mIsStateTransitioning = previousState != STATE_UNKNOWN && previousState != updatedState;
+ if (previousState == STATE_DISABLED && updatedState == STATE_ENABLED) {
postUnlock();
- } else if (transitioningFromUnlockedToLocked(previousState, updatedState)){
+ } else if (previousState == STATE_ENABLED && updatedState == STATE_DISABLED){
executeLock();
}
- resetPrivateSpaceDecorator(updatedState);
- }
-
- /**
- * Opens the Private Space Settings Page.
- *
- * @param view the view that was clicked to open the settings page and which will be the same
- * view to animate back. Otherwise if there is no view, simply start the activity.
- */
- public void openPrivateSpaceSettings(View view) {
- if (mPrivateSpaceSettingsAvailable) {
- Context context = mAllApps.getContext();
- Intent intent = ApiWrapper.INSTANCE.get(context).getPrivateSpaceSettingsIntent();
- if (view == null) {
- context.startActivity(intent);
- return;
- }
- ActivityContext activityContext = ActivityContext.lookupContext(context);
- AppInfo itemInfo = new AppInfo();
- itemInfo.id = CONTAINER_PRIVATESPACE;
- itemInfo.componentName = intent.getComponent();
- itemInfo.container = CONTAINER_PRIVATESPACE;
- view.setTag(itemInfo);
- activityContext.startActivitySafely(view, intent, itemInfo);
- }
+ addPrivateSpaceDecorator(updatedState);
}
/** Returns whether or not Private Space Settings Page is available. */
@@ -273,8 +270,9 @@
setPrivateSpaceSettingsAvailable(apiWrapper.getPrivateSpaceSettingsIntent() != null);
}
+ /** Adds a private space decorator only when STATE_ENABLED. */
@VisibleForTesting
- void resetPrivateSpaceDecorator(int updatedState) {
+ void addPrivateSpaceDecorator(int updatedState) {
ActivityAllAppsContainerView<?>.AdapterHolder mainAdapterHolder = mAllApps.mAH.get(MAIN);
if (updatedState == STATE_ENABLED) {
// Create a new decorator instance if not already available.
@@ -291,18 +289,31 @@
}
// Add Private Space Decorator to the Recycler view.
mainAdapterHolder.mRecyclerView.addItemDecoration(mPrivateAppsSectionDecorator);
- } else {
- // Remove Private Space Decorator from the Recycler view.
- if (mPrivateAppsSectionDecorator != null && !mIsAnimationRunning) {
- mainAdapterHolder.mRecyclerView.removeItemDecoration(mPrivateAppsSectionDecorator);
- }
}
}
@Override
public void setQuietMode(boolean enable) {
- super.setQuietMode(enable);
- mAnimate = true;
+ UI_HELPER_EXECUTOR.post(() ->
+ mUserCache.getUserProfiles()
+ .stream()
+ .filter(getUserMatcher())
+ .findFirst()
+ .ifPresent(userHandle -> setQuietModeSafely(enable, userHandle)));
+ mReadyToAnimate = true;
+ }
+
+ /**
+ * Sets Quiet Mode for Private Profile.
+ * If {@link SecurityException} is thrown, prompts the user to set this launcher as HOME app.
+ */
+ private void setQuietModeSafely(boolean enable, UserHandle userHandle) {
+ try {
+ mUserManager.requestQuietModeEnabled(enable, userHandle);
+ } catch (SecurityException ex) {
+ ApiWrapper.INSTANCE.get(mAllApps.mActivityContext)
+ .assignDefaultHomeRole(mAllApps.mActivityContext);
+ }
}
/**
@@ -324,7 +335,7 @@
void setAnimationRunning(boolean isAnimationRunning) {
if (!isAnimationRunning) {
- mAnimate = false;
+ mReadyToAnimate = false;
}
mIsAnimationRunning = isAnimationRunning;
}
@@ -333,14 +344,6 @@
return mIsAnimationRunning;
}
- private boolean transitioningFromLockedToUnlocked(int previousState, int updatedState) {
- return previousState == STATE_DISABLED && updatedState == STATE_ENABLED;
- }
-
- private boolean transitioningFromUnlockedToLocked(int previousState, int updatedState) {
- return previousState == STATE_ENABLED && updatedState == STATE_DISABLED;
- }
-
@Override
public Predicate<UserHandle> getUserMatcher() {
return mPrivateProfileMatcher;
@@ -359,109 +362,84 @@
}
/** Add Private Space Header view elements based upon {@link UserProfileState} */
- public void addPrivateSpaceHeaderViewElements(RelativeLayout parent) {
+ public void bindPrivateSpaceHeaderViewElements(RelativeLayout parent) {
mPSHeader = parent;
+ Log.d(TAG, "bindPrivateSpaceHeaderViewElements: " + "Binding private space.");
+ updateView();
if (mOnPSHeaderAdded != null) {
MAIN_EXECUTOR.execute(mOnPSHeaderAdded);
mOnPSHeaderAdded = null;
}
- // Set the transition duration for the settings and lock button to animate.
- ViewGroup settingAndLockGroup = mPSHeader.findViewById(R.id.settingsAndLockGroup);
- if (mAnimate) {
- enableLayoutTransition(settingAndLockGroup);
- } else {
- // Ensure any unwanted animations to not happen.
- settingAndLockGroup.setLayoutTransition(null);
- }
-
- //Add quietMode image and action for lock/unlock button
- ViewGroup lockButton = mPSHeader.findViewById(R.id.ps_lock_unlock_button);
- assert lockButton != null;
- addLockButton(lockButton);
-
- //Trigger lock/unlock action from header.
- addHeaderOnClickListener(mPSHeader);
-
- //Add image and action for private space settings button
- ImageButton settingsButton = mPSHeader.findViewById(R.id.ps_settings_button);
- assert settingsButton != null;
- addPrivateSpaceSettingsButton(settingsButton);
-
- //Add image for private space transitioning view
- ImageView transitionView = parent.findViewById(R.id.ps_transition_image);
- assert transitionView != null;
- addTransitionImage(transitionView);
}
- /**
- * Adds the quietModeButton and attach onClickListener for the header to animate different
- * states when clicked.
- */
- private void addLockButton(ViewGroup lockButton) {
- TextView lockText = lockButton.findViewById(R.id.lock_text);
- switch (getCurrentState()) {
+ /** Update the states of the views that make up the header at the state it is called in. */
+ private void updateView() {
+ if (mPSHeader == null) {
+ return;
+ }
+ Log.d(TAG, "bindPrivateSpaceHeaderViewElements: " + "Updating view with state: "
+ + getCurrentState());
+ mPSHeader.setAlpha(1);
+ ViewGroup lockPill = mPSHeader.findViewById(R.id.ps_lock_unlock_button);
+ assert lockPill != null;
+ mLockText = lockPill.findViewById(R.id.lock_text);
+ assert mLockText != null;
+ mPrivateSpaceSettingsButton = mPSHeader.findViewById(R.id.ps_settings_button);
+ assert mPrivateSpaceSettingsButton != null;
+ //Add image for private space transitioning view
+ ImageView transitionView = mPSHeader.findViewById(R.id.ps_transition_image);
+ assert transitionView != null;
+ switch(getCurrentState()) {
case STATE_ENABLED -> {
- lockText.setVisibility(VISIBLE);
- lockButton.setVisibility(VISIBLE);
- lockButton.setOnClickListener(view -> lockingAction(/* lock */ true));
- lockButton.setContentDescription(mUnLockedStateContentDesc);
+ mPSHeader.setOnClickListener(null);
+ mPSHeader.setClickable(false);
+ // Remove header from accessibility target when enabled.
+ mPSHeader.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+
+ if (!mReadyToAnimate) {
+ // Don't set visibilities when animating as the animation will handle it.
+ mLockText.setVisibility(VISIBLE);
+ mLockText.setAlpha(1);
+ mLockText.setHorizontallyScrolling(false);
+ mPrivateSpaceSettingsButton.setVisibility(
+ isPrivateSpaceSettingsAvailable() ? VISIBLE : GONE);
+ mPrivateSpaceSettingsButton.setClickable(isPrivateSpaceSettingsAvailable());
+ }
+ lockPill.setVisibility(VISIBLE);
+ lockPill.setOnClickListener(view -> lockingAction(/* lock */ true));
+ lockPill.setContentDescription(mUnLockedStateContentDesc);
+
+ transitionView.setVisibility(GONE);
}
case STATE_DISABLED -> {
- lockText.setVisibility(GONE);
- lockButton.setVisibility(VISIBLE);
- lockButton.setOnClickListener(view -> lockingAction(/* lock */ false));
- lockButton.setContentDescription(mLockedStateContentDesc);
- }
- default -> lockButton.setVisibility(GONE);
- }
- }
+ mPSHeader.setOnClickListener(view -> lockingAction(/* lock */ false));
+ mPSHeader.setClickable(true);
+ // Add header as accessibility target when disabled.
+ mPSHeader.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ mPSHeader.setContentDescription(mLockedStateContentDesc);
- private void addHeaderOnClickListener(RelativeLayout header) {
- if (getCurrentState() == STATE_DISABLED) {
- header.setOnClickListener(view -> lockingAction(/* lock */ false));
- header.setClickable(true);
- // Add header as accessibility target when disabled.
- header.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
- header.setContentDescription(mLockedStateContentDesc);
- } else {
- header.setOnClickListener(null);
- header.setClickable(false);
- // Remove header from accessibility target when enabled.
- header.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+ mLockText.setVisibility(GONE);
+ mLockText.setAlpha(0);
+ mLockText.setHorizontallyScrolling(false);
+ lockPill.setVisibility(VISIBLE);
+ lockPill.setOnClickListener(view -> lockingAction(/* lock */ false));
+ lockPill.setContentDescription(mLockedStateContentDesc);
+
+ mPrivateSpaceSettingsButton.setVisibility(GONE);
+ mPrivateSpaceSettingsButton.setClickable(false);
+ transitionView.setVisibility(GONE);
+ }
+ case STATE_TRANSITION -> {
+ transitionView.setVisibility(VISIBLE);
+ lockPill.setVisibility(GONE);
+ }
}
}
/** Sets the enablement of the profile when header or button is clicked. */
private void lockingAction(boolean lock) {
logEvents(lock ? LAUNCHER_PRIVATE_SPACE_LOCK_TAP : LAUNCHER_PRIVATE_SPACE_UNLOCK_TAP);
- if (lock) {
- lockPrivateProfile();
- } else {
- unlockPrivateProfile();
- }
- }
-
- private void addPrivateSpaceSettingsButton(ImageButton settingsButton) {
- if (getCurrentState() == STATE_ENABLED
- && isPrivateSpaceSettingsAvailable()) {
- settingsButton.setVisibility(VISIBLE);
- settingsButton.setAlpha(1f);
- settingsButton.setOnClickListener(
- view -> {
- logEvents(LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP);
- openPrivateSpaceSettings(view);
- });
- } else {
- settingsButton.setVisibility(GONE);
- }
- }
-
- private void addTransitionImage(ImageView transitionImage) {
- if (getCurrentState() == STATE_TRANSITION) {
- transitionImage.setVisibility(VISIBLE);
- } else {
- transitionImage.setVisibility(GONE);
- }
+ setQuietMode(lock);
}
/** Finds the private space header to scroll to and set the private space icons to GONE. */
@@ -480,16 +458,22 @@
return LinearSmoothScroller.SNAP_TO_END;
}
};
- smoothScroller.setTargetPosition(i);
+ // If privateSpaceHidden() then the entire container decorator will be invisible and
+ // we can directly move to an element above the header. There should always be one
+ // element, as PS is present in the bottom of All Apps.
+ smoothScroller.setTargetPosition(isPrivateSpaceHidden() ? i - 1 : i);
RecyclerView.LayoutManager layoutManager = allAppsRecyclerView.getLayoutManager();
if (layoutManager != null) {
startAnimationScroll(allAppsRecyclerView, layoutManager, smoothScroller);
- currentItem.decorationInfo = null;
+ // Preserve decorator if floating mask view exists.
+ if (mFloatingMaskView == null) {
+ currentItem.decorationInfo = null;
+ }
}
break;
}
// Make the private space apps gone to "collapse".
- if (isPrivateSpaceItem(currentItem)) {
+ if (mFloatingMaskView == null && isPrivateSpaceItem(currentItem)) {
RecyclerView.ViewHolder viewHolder =
allAppsRecyclerView.findViewHolderForAdapterPosition(i);
if (viewHolder != null) {
@@ -590,15 +574,20 @@
List<BaseAllAppsAdapter.AdapterItem> allAppsAdapterItems =
mAllApps.getActiveRecyclerView().getApps().getAdapterItems();
ValueAnimator alphaAnim = ObjectAnimator.ofFloat(from, to);
- alphaAnim.setDuration(EXPAND_COLLAPSE_DURATION);
+ alphaAnim.setDuration(APP_OPACITY_DURATION)
+ .setStartDelay(isExpanding ? APP_OPACITY_DELAY : NO_DELAY);
+ alphaAnim.setInterpolator(Interpolators.LINEAR);
alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float newAlpha = (float) valueAnimator.getAnimatedValue();
for (int i = 0; i < allAppsAdapterItems.size(); i++) {
BaseAllAppsAdapter.AdapterItem currentItem = allAppsAdapterItems.get(i);
+ // When not hidden: Fade all PS items except header.
+ // When hidden: Fade all items.
if (isPrivateSpaceItem(currentItem) &&
- currentItem.viewType != VIEW_TYPE_PRIVATE_SPACE_HEADER) {
+ (currentItem.viewType != VIEW_TYPE_PRIVATE_SPACE_HEADER
+ || isPrivateSpaceHidden())) {
RecyclerView.ViewHolder viewHolder =
allAppsRecyclerView.findViewHolderForAdapterPosition(i);
if (viewHolder != null) {
@@ -611,6 +600,51 @@
return alphaAnim;
}
+ private ValueAnimator animatePillTransition(boolean isExpanding) {
+ if (mLockText == null) {
+ return new ValueAnimator().setDuration(0);
+ }
+ mLockText.measure(0,0);
+ int currentWidth = mLockText.getWidth();
+ int fullWidth = mLockText.getMeasuredWidth();
+ float from = isExpanding ? 0 : currentWidth;
+ float to = isExpanding ? fullWidth : 0;
+ ValueAnimator pillAnim = ObjectAnimator.ofFloat(from, to);
+ pillAnim.setStartDelay(isExpanding ? PILL_TRANSITION_DELAY : 0);
+ pillAnim.setDuration(EXPAND_COLLAPSE_DURATION);
+ pillAnim.setInterpolator(Interpolators.STANDARD);
+ pillAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ float translation = (float) valueAnimator.getAnimatedValue();
+ float translationFraction = translation / fullWidth;
+ ViewGroup.MarginLayoutParams layoutParams =
+ (ViewGroup.MarginLayoutParams) mLockText.getLayoutParams();
+ layoutParams.width = (int) translation;
+ layoutParams.setMarginStart((int) (mLockTextMarginStart * translationFraction));
+ layoutParams.setMarginEnd((int) (mLockTextMarginEnd * translationFraction));
+ mLockText.setLayoutParams(layoutParams);
+ mLockText.requestLayout();
+ }
+ });
+ pillAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animator) {
+ if (!isExpanding) {
+ mLockText.setVisibility(GONE);
+ }
+ mLockText.setHorizontallyScrolling(false);
+ }
+
+ @Override
+ public void onAnimationStart(Animator animator) {
+ mLockText.setHorizontallyScrolling(true);
+ mLockText.setVisibility(VISIBLE);
+ }
+ });
+ return pillAnim;
+ }
+
/**
* Using PropertySetter{@link PropertySetter}, we can update the view's attributes within an
* animation. At the moment, collapsing, setting alpha changes, and animating the text is done
@@ -622,32 +656,48 @@
}
if (mPSHeader == null) {
mOnPSHeaderAdded = () -> updatePrivateStateAnimator(expand);
- setAnimationRunning(false);
+ // Set animation to true, because onBind will be called after this return where we want
+ // the views to be updated accordingly so animation can happen.
+ setAnimationRunning(true);
return;
}
- ViewGroup settingsAndLockGroup = mPSHeader.findViewById(R.id.settingsAndLockGroup);
- ViewGroup lockButton = mPSHeader.findViewById(R.id.ps_lock_unlock_button);
- if (settingsAndLockGroup.getLayoutTransition() == null) {
- // Set a new transition if the current ViewGroup does not already contain one as each
- // transition should only happen once when applied.
- enableLayoutTransition(settingsAndLockGroup);
- }
- PropertySetter headerSetter = new AnimatedPropertySetter();
- ImageButton settingsButton = mPSHeader.findViewById(R.id.ps_settings_button);
- updateSettingsGearAlpha(settingsButton, expand, headerSetter);
- AnimatorSet animatorSet = headerSetter.buildAnim();
+ attachFloatingMaskView(expand);
+ AnimatorSet animatorSet = new AnimatedPropertySetter().buildAnim();
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- // Animate the collapsing of the text at the same time while updating lock button.
- lockButton.findViewById(R.id.lock_text).setVisibility(expand ? VISIBLE : GONE);
+ Log.d(TAG, "updatePrivateStateAnimator: Private space animation expanding: "
+ + expand);
+ mStatsLogManager.logger().sendToInteractionJankMonitor(
+ expand
+ ? LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_BEGIN
+ : LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_BEGIN,
+ mAllApps.getActiveRecyclerView());
setAnimationRunning(true);
}
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ detachFloatingMaskView();
+ }
});
animatorSet.addListener(forEndCallback(() -> {
+ mIsStateTransitioning = false;
setAnimationRunning(false);
getMainRecyclerView().setChildAttachedConsumer(child -> child.setAlpha(1));
+ mStatsLogManager.logger().sendToInteractionJankMonitor(
+ expand
+ ? LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_END
+ : LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_END,
+ mAllApps.getActiveRecyclerView());
+ Log.d(TAG, "updatePrivateStateAnimator: lockText visibility: "
+ + mLockText.getVisibility() + " lockTextAlpha: " + mLockText.getAlpha());
+ Log.d(TAG, "updatePrivateStateAnimator: settingsCog visibility: "
+ + mPrivateSpaceSettingsButton.getVisibility()
+ + " settingsCogAlpha: " + mPrivateSpaceSettingsButton.getAlpha());
if (!expand) {
+ mAllApps.mAH.get(MAIN).mRecyclerView.removeItemDecoration(
+ mPrivateAppsSectionDecorator);
// Call onAppsUpdated() because it may be canceled when this animation occurs.
mAllApps.getPersonalAppList().onAppsUpdated();
if (isPrivateSpaceHidden()) {
@@ -657,66 +707,126 @@
}
}));
if (expand) {
- animatorSet.playTogether(animateAlphaOfIcons(true));
+ animatorSet.playTogether(updateSettingsGearAlpha(true),
+ updateLockTextAlpha(true),
+ animateAlphaOfIcons(true),
+ animatePillTransition(true),
+ translateFloatingMaskView(false));
} else {
+ AnimatorSet parallelSet = new AnimatorSet();
+ parallelSet.playTogether(updateSettingsGearAlpha(false),
+ updateLockTextAlpha(false),
+ animateAlphaOfIcons(false),
+ animatePillTransition(false));
if (isPrivateSpaceHidden()) {
- animatorSet.playSequentially(animateAlphaOfIcons(false),
- animateCollapseAnimation(), fadeOutHeaderAlpha());
+ animatorSet.playSequentially(parallelSet,
+ animateAlphaOfPrivateSpaceContainer(),
+ animateCollapseAnimation());
} else {
- animatorSet.playSequentially(animateAlphaOfIcons(false),
+ animatorSet.playSequentially(translateFloatingMaskView(true),
+ parallelSet,
animateCollapseAnimation());
}
}
- animatorSet.setDuration(EXPAND_COLLAPSE_DURATION);
animatorSet.start();
}
+ /** Fades out the private space container (defined by its items' decorators). */
+ private ValueAnimator animateAlphaOfPrivateSpaceContainer() {
+ int from = 255; // 100% opacity.
+ int to = 0; // No opacity.
+ ValueAnimator alphaAnim = ObjectAnimator.ofInt(from, to);
+ AllAppsRecyclerView allAppsRecyclerView = mAllApps.getActiveRecyclerView();
+ List<BaseAllAppsAdapter.AdapterItem> allAppsAdapterItems =
+ allAppsRecyclerView.getApps().getAdapterItems();
+ alphaAnim.setDuration(CONTAINER_OPACITY_DURATION);
+ alphaAnim.addUpdateListener(valueAnimator -> {
+ for (BaseAllAppsAdapter.AdapterItem currentItem : allAppsAdapterItems) {
+ if (isPrivateSpaceItem(currentItem)) {
+ currentItem.setDecorationFillAlpha((int) valueAnimator.getAnimatedValue());
+ }
+ }
+ // Invalidate the parent view, to redraw the decorations with changed alpha.
+ allAppsRecyclerView.invalidate();
+ });
+ return alphaAnim;
+ }
+
/** Fades out the private space container. */
- private ValueAnimator fadeOutHeaderAlpha() {
- if (mPSHeader == null) {
- return new ValueAnimator();
+ private ValueAnimator translateFloatingMaskView(boolean animateIn) {
+ if (!Flags.privateSpaceAddFloatingMaskView() || mFloatingMaskView == null) {
+ return new ValueAnimator().setDuration(0);
}
- float from = 1;
- float to = 0;
+ // Translate base on the height amount. Translates out on expand and in on collapse.
+ float floatingMaskViewHeight = getFloatingMaskViewHeight();
+ float from = animateIn ? floatingMaskViewHeight : 0;
+ float to = animateIn ? 0 : floatingMaskViewHeight;
ValueAnimator alphaAnim = ObjectAnimator.ofFloat(from, to);
- alphaAnim.setDuration(EXPAND_COLLAPSE_DURATION);
+ alphaAnim.setDuration(MASK_VIEW_DURATION);
+ alphaAnim.setStartDelay(MASK_VIEW_DELAY);
alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
- if (mPSHeader != null) {
- mPSHeader.setAlpha((float) valueAnimator.getAnimatedValue());
+ if (mFloatingMaskView == null) {
+ return;
}
+ mFloatingMaskView.setTranslationY((float) valueAnimator.getAnimatedValue());
}
});
return alphaAnim;
}
- /** Animates the layout changes when the text of the button becomes visible/gone. */
- private void enableLayoutTransition(ViewGroup settingsAndLockGroup) {
- LayoutTransition settingsAndLockTransition = new LayoutTransition();
- settingsAndLockTransition.enableTransitionType(LayoutTransition.CHANGING);
- settingsAndLockTransition.setDuration(EXPAND_COLLAPSE_DURATION);
- settingsAndLockTransition.addTransitionListener(new LayoutTransition.TransitionListener() {
+ /** Change the settings gear alpha when expanded or collapsed. */
+ private ValueAnimator updateSettingsGearAlpha(boolean expand) {
+ if (mPrivateSpaceSettingsButton == null || !isPrivateSpaceSettingsAvailable()) {
+ return new ValueAnimator().setDuration(0);
+ }
+ float from = expand ? 0 : 1;
+ float to = expand ? 1 : 0;
+ ValueAnimator settingsAlphaAnim = ObjectAnimator.ofFloat(from, to);
+ settingsAlphaAnim.setDuration(SETTINGS_OPACITY_DURATION);
+ settingsAlphaAnim.setStartDelay(expand ? SETTINGS_OPACITY_DELAY : NO_DELAY);
+ settingsAlphaAnim.setInterpolator(Interpolators.LINEAR);
+ settingsAlphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
- public void startTransition(LayoutTransition transition, ViewGroup viewGroup,
- View view, int i) {
- }
- @Override
- public void endTransition(LayoutTransition transition, ViewGroup viewGroup,
- View view, int i) {
- settingsAndLockGroup.setLayoutTransition(null);
- mAnimate = false;
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ mPrivateSpaceSettingsButton.setAlpha((float) valueAnimator.getAnimatedValue());
}
});
- settingsAndLockGroup.setLayoutTransition(settingsAndLockTransition);
+ settingsAlphaAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animator) {
+ mPrivateSpaceSettingsButton.setVisibility(VISIBLE);
+ mPrivateSpaceSettingsButton.setClickable(false);
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animator) {
+ if (expand) {
+ mPrivateSpaceSettingsButton.setClickable(true);
+ }
+ }
+ });
+ return settingsAlphaAnim;
}
- /** Change the settings gear alpha when expanded or collapsed. */
- private void updateSettingsGearAlpha(ImageButton settingsButton, boolean expand,
- PropertySetter setter) {
- float toAlpha = expand ? 1 : 0;
- setter.setFloat(settingsButton, VIEW_ALPHA, toAlpha, Interpolators.LINEAR)
- .setDuration(SETTINGS_OPACITY_DURATION).setStartDelay(0);
+ private ValueAnimator updateLockTextAlpha(boolean expand) {
+ if (mLockText == null) {
+ return new ValueAnimator().setDuration(0);
+ }
+ float from = expand ? 0 : 1;
+ float to = expand ? 1 : 0;
+ ValueAnimator alphaAnim = ObjectAnimator.ofFloat(from, to);
+ alphaAnim.setDuration(expand ? TEXT_UNLOCK_OPACITY_DURATION : TEXT_LOCK_OPACITY_DURATION);
+ alphaAnim.setStartDelay(expand ? LOCK_TEXT_OPACITY_DELAY : NO_DELAY);
+ alphaAnim.setInterpolator(Interpolators.LINEAR);
+ alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ mLockText.setAlpha((float) valueAnimator.getAnimatedValue());
+ }
+ });
+ return alphaAnim;
}
void expandPrivateSpace() {
@@ -747,25 +857,77 @@
});
}
+ private void attachFloatingMaskView(boolean expand) {
+ if (!Flags.privateSpaceAddFloatingMaskView()) {
+ return;
+ }
+ // Use getLocationOnScreen() as simply checking for mPSHeader.getBottom() is only relative
+ // to its parent.
+ int[] psHeaderLocation = new int[2];
+ mPSHeader.getLocationOnScreen(psHeaderLocation);
+ int psHeaderBottomY = psHeaderLocation[1] + mPsHeaderHeight;
+ // Calculate the topY of the floatingMaskView as if it was added.
+ int floatingMaskViewBottomBoxTopY =
+ (int) (mAllApps.getBottom() - getMainRecyclerView().getPaddingBottom());
+ // Don't attach if the header will be clipped by the floating mask view.
+ if (psHeaderBottomY > floatingMaskViewBottomBoxTopY) {
+ mFloatingMaskView = null;
+ return;
+ }
+ mFloatingMaskView = (FloatingMaskView) mAllApps.getLayoutInflater().inflate(
+ R.layout.private_space_mask_view, mAllApps, false);
+ assert mFloatingMaskView != null;
+ mAllApps.addView(mFloatingMaskView);
+ // Translate off the screen first if its collapsing so this header view isn't visible to
+ // user when animation starts.
+ if (!expand) {
+ mFloatingMaskView.setTranslationY(getFloatingMaskViewHeight());
+ }
+ mFloatingMaskView.setVisibility(VISIBLE);
+ }
+
+ private void detachFloatingMaskView() {
+ if (mFloatingMaskView != null) {
+ mAllApps.removeView(mFloatingMaskView);
+ }
+ mFloatingMaskView = null;
+ }
+
/** Starts the smooth scroll with the provided smoothScroller and add idle listener. */
private void startAnimationScroll(AllAppsRecyclerView allAppsRecyclerView,
RecyclerView.LayoutManager layoutManager, RecyclerView.SmoothScroller smoothScroller) {
- mAnimationScrolling = true;
+ mIsScrolling = true;
layoutManager.startSmoothScroll(smoothScroller);
allAppsRecyclerView.removeOnScrollListener(mOnIdleScrollListener);
allAppsRecyclerView.addOnScrollListener(mOnIdleScrollListener);
}
+ private float getFloatingMaskViewHeight() {
+ return mFloatingMaskViewCornerRadius + getMainRecyclerView().getPaddingBottom();
+ }
+
AllAppsRecyclerView getMainRecyclerView() {
return mAllApps.mAH.get(ActivityAllAppsContainerView.AdapterHolder.MAIN).mRecyclerView;
}
- boolean getAnimate() {
- return mAnimate;
+ /** Returns if private space is readily available to be animated. */
+ boolean getReadyToAnimate() {
+ return mReadyToAnimate;
}
- boolean getAnimationScrolling() {
- return mAnimationScrolling;
+ /** Returns when a smooth scroll is happening. */
+ boolean isScrolling() {
+ return mIsScrolling;
+ }
+
+ /**
+ * Returns when private space is in the process of transitioning. This is different from
+ * getAnimate() since mStateTransitioning checks from the time transitioning starts happening
+ * in reset() as oppose to when private space is animating. This should be used to ensure
+ * Private Space state during onBind().
+ */
+ boolean isStateTransitioning() {
+ return mIsStateTransitioning;
}
int getPsHeaderHeight() {
diff --git a/src/com/android/launcher3/allapps/PrivateSpaceSettingsButton.java b/src/com/android/launcher3/allapps/PrivateSpaceSettingsButton.java
new file mode 100644
index 0000000..43e42ff
--- /dev/null
+++ b/src/com/android/launcher3/allapps/PrivateSpaceSettingsButton.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps;
+
+import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PRIVATESPACE;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP;
+
+import android.content.Context;
+import android.content.Intent;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageButton;
+
+import com.android.launcher3.logging.StatsLogManager;
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.util.ApiWrapper;
+import com.android.launcher3.views.ActivityContext;
+
+public class PrivateSpaceSettingsButton extends ImageButton implements View.OnClickListener {
+
+ private final ActivityContext mActivityContext;
+ private final StatsLogManager mStatsLogManager;
+ private final Intent mPrivateSpaceSettingsIntent;
+
+ public PrivateSpaceSettingsButton(Context context) {
+ this(context, null, 0);
+ }
+
+ public PrivateSpaceSettingsButton(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public PrivateSpaceSettingsButton(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mActivityContext = ActivityContext.lookupContext(context);
+ mStatsLogManager = mActivityContext.getStatsLogManager();
+ mPrivateSpaceSettingsIntent =
+ ApiWrapper.INSTANCE.get(context).getPrivateSpaceSettingsIntent();
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ mStatsLogManager.logger().log(LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP);
+ AppInfo privateSpaceSettingsItemInfo = createPrivateSpaceSettingsAppInfo();
+ view.setTag(privateSpaceSettingsItemInfo);
+ mActivityContext.startActivitySafely(
+ view,
+ mPrivateSpaceSettingsIntent,
+ privateSpaceSettingsItemInfo);
+ }
+
+ AppInfo createPrivateSpaceSettingsAppInfo() {
+ AppInfo itemInfo = new AppInfo();
+ itemInfo.id = CONTAINER_PRIVATESPACE;
+ if (mPrivateSpaceSettingsIntent != null) {
+ itemInfo.componentName = mPrivateSpaceSettingsIntent.getComponent();
+ }
+ itemInfo.container = CONTAINER_PRIVATESPACE;
+ return itemInfo;
+ }
+}
diff --git a/src/com/android/launcher3/allapps/SectionDecorationHandler.java b/src/com/android/launcher3/allapps/SectionDecorationHandler.java
index ac9b146..eaeb8bb 100644
--- a/src/com/android/launcher3/allapps/SectionDecorationHandler.java
+++ b/src/com/android/launcher3/allapps/SectionDecorationHandler.java
@@ -25,7 +25,6 @@
import android.view.View;
import androidx.annotation.Nullable;
-import androidx.core.content.ContextCompat;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
@@ -61,10 +60,10 @@
mContext = context;
mFillAlpha = fillAlpha;
- mFocusColor = ContextCompat.getColor(context,
- R.color.material_color_surface_bright); // UX recommended
- mFillColor = ContextCompat.getColor(context,
- R.color.material_color_surface_container_high); // UX recommended
+ mFocusColor = Themes.getAttrColor(context,
+ R.attr.materialColorSurfaceBright); // UX recommended
+ mFillColor = Themes.getAttrColor(context,
+ R.attr.materialColorSurfaceContainerHigh); // UX recommended
mIsTopLeftRound = isTopLeftRound;
mIsTopRightRound = isTopRightRound;
diff --git a/src/com/android/launcher3/allapps/UserProfileManager.java b/src/com/android/launcher3/allapps/UserProfileManager.java
index 6a1f37a..93b6b29 100644
--- a/src/com/android/launcher3/allapps/UserProfileManager.java
+++ b/src/com/android/launcher3/allapps/UserProfileManager.java
@@ -40,11 +40,13 @@
* {@link PrivateProfileManager} which manages private profile state.
*/
public abstract class UserProfileManager {
+ public static final int STATE_UNKNOWN = 0;
public static final int STATE_ENABLED = 1;
public static final int STATE_DISABLED = 2;
public static final int STATE_TRANSITION = 3;
@IntDef(value = {
+ STATE_UNKNOWN,
STATE_ENABLED,
STATE_DISABLED,
STATE_TRANSITION
@@ -52,13 +54,12 @@
@Retention(RetentionPolicy.SOURCE)
public @interface UserProfileState { }
+ protected final StatsLogManager mStatsLogManager;
+ protected final UserManager mUserManager;
+ protected final UserCache mUserCache;
+
@UserProfileState
private int mCurrentState;
-
- private final UserManager mUserManager;
- private final StatsLogManager mStatsLogManager;
- private final UserCache mUserCache;
-
protected UserProfileManager(UserManager userManager,
StatsLogManager statsLogManager,
UserCache userCache) {
diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
index 19c3ebe..ec45415 100644
--- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
@@ -31,6 +31,7 @@
import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.search.SearchAlgorithm;
import com.android.launcher3.search.SearchCallback;
import com.android.launcher3.views.ActivityContext;
@@ -143,7 +144,7 @@
@Override
public void onFocusChange(View view, boolean hasFocus) {
- if (!hasFocus) {
+ if (!hasFocus && !FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
mInput.hideKeyboard();
}
}
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index ab47097..8121d2a 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -22,13 +22,9 @@
import android.os.Handler;
import androidx.annotation.AnyThread;
-import androidx.annotation.NonNull;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
-import com.android.launcher3.model.AllAppsList;
-import com.android.launcher3.model.BaseModelUpdateTask;
-import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.search.SearchAlgorithm;
import com.android.launcher3.search.SearchCallback;
@@ -67,16 +63,12 @@
@Override
public void doSearch(String query, SearchCallback<AdapterItem> callback) {
- mAppState.getModel().enqueueModelUpdateTask(new BaseModelUpdateTask() {
- @Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
- ArrayList<AdapterItem> result = getTitleMatchResult(apps.data, query);
- if (mAddNoResultsMessage && result.isEmpty()) {
- result.add(getEmptyMessageAdapterItem(query));
- }
- mResultHandler.post(() -> callback.onSearchResult(query, result));
+ mAppState.getModel().enqueueModelUpdateTask((taskController, dataModel, apps) -> {
+ ArrayList<AdapterItem> result = getTitleMatchResult(apps.data, query);
+ if (mAddNoResultsMessage && result.isEmpty()) {
+ result.add(getEmptyMessageAdapterItem(query));
}
+ mResultHandler.post(() -> callback.onSearchResult(query, result));
});
}
diff --git a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
index 64fd237..4a8c96b 100644
--- a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
+++ b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
@@ -19,8 +19,6 @@
import android.view.View;
import android.view.ViewGroup;
-import androidx.recyclerview.widget.RecyclerView;
-
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.allapps.AllAppsGridAdapter;
import com.android.launcher3.model.data.ItemInfo;
@@ -30,13 +28,10 @@
* Provides views for local search results.
*/
public class DefaultSearchAdapterProvider extends SearchAdapterProvider<ActivityContext> {
-
- private final RecyclerView.ItemDecoration mDecoration;
private View mHighlightedView;
public DefaultSearchAdapterProvider(ActivityContext launcher) {
super(launcher);
- mDecoration = new RecyclerView.ItemDecoration() { };
}
@Override
@@ -74,11 +69,6 @@
}
@Override
- public RecyclerView.ItemDecoration getDecorator() {
- return mDecoration;
- }
-
- @Override
public void clearHighlightedItem() {
mHighlightedView = null;
}
diff --git a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
index 15756f5..82c9c90 100644
--- a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
+++ b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
@@ -20,8 +20,6 @@
import android.view.View;
import android.view.ViewGroup;
-import androidx.recyclerview.widget.RecyclerView;
-
import com.android.launcher3.allapps.AllAppsGridAdapter;
import com.android.launcher3.views.ActivityContext;
@@ -50,11 +48,6 @@
public abstract View getHighlightedItem();
/**
- * Returns the item decorator.
- */
- public abstract RecyclerView.ItemDecoration getDecorator();
-
- /**
* Clear the highlighted view.
*/
public abstract void clearHighlightedItem();
diff --git a/src/com/android/launcher3/anim/AnimatedFloat.java b/src/com/android/launcher3/anim/AnimatedFloat.java
index b414ab6..4441164 100644
--- a/src/com/android/launcher3/anim/AnimatedFloat.java
+++ b/src/com/android/launcher3/anim/AnimatedFloat.java
@@ -20,6 +20,8 @@
import android.animation.ObjectAnimator;
import android.util.FloatProperty;
+import java.util.function.Consumer;
+
/**
* A mutable float which allows animating the value
*/
@@ -38,9 +40,9 @@
}
};
- private static final Runnable NO_OP = () -> { };
+ private static final Consumer<Float> NO_OP = t -> { };
- private final Runnable mUpdateCallback;
+ private final Consumer<Float> mUpdateCallback;
private ObjectAnimator mValueAnimator;
// Only non-null when an animation is playing to this value.
private Float mEndValue;
@@ -52,6 +54,10 @@
}
public AnimatedFloat(Runnable updateCallback) {
+ this(v -> updateCallback.run());
+ }
+
+ public AnimatedFloat(Consumer<Float> updateCallback) {
mUpdateCallback = updateCallback;
}
@@ -60,6 +66,11 @@
value = initialValue;
}
+ public AnimatedFloat(Consumer<Float> updateCallback, float initialValue) {
+ this(updateCallback);
+ value = initialValue;
+ }
+
/**
* Returns an animation from the current value to the given value.
*/
@@ -99,7 +110,7 @@
public void updateValue(float v) {
if (Float.compare(v, value) != 0) {
value = v;
- mUpdateCallback.run();
+ mUpdateCallback.accept(value);
}
}
diff --git a/src/com/android/launcher3/anim/PendingAnimation.java b/src/com/android/launcher3/anim/PendingAnimation.java
index e58890f..47a2bdd 100644
--- a/src/com/android/launcher3/anim/PendingAnimation.java
+++ b/src/com/android/launcher3/anim/PendingAnimation.java
@@ -59,6 +59,13 @@
add(anim, springProperty);
}
+ /**
+ * Utility method to sent an interpolator on an animation and add it to the list
+ */
+ public void add(Animator anim, TimeInterpolator interpolator) {
+ add(anim, interpolator, SpringProperty.DEFAULT);
+ }
+
@Override
public void add(Animator anim) {
add(anim, SpringProperty.DEFAULT);
diff --git a/src/com/android/launcher3/apppairs/AppPairIcon.java b/src/com/android/launcher3/apppairs/AppPairIcon.java
index 1f73241..870c876 100644
--- a/src/com/android/launcher3/apppairs/AppPairIcon.java
+++ b/src/com/android/launcher3/apppairs/AppPairIcon.java
@@ -18,10 +18,12 @@
import static com.android.launcher3.BubbleTextView.DISPLAY_FOLDER;
+import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.FloatProperty;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -30,6 +32,8 @@
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Flags;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.Reorderable;
@@ -52,6 +56,26 @@
public class AppPairIcon extends FrameLayout implements DraggableView, Reorderable {
private static final String TAG = "AppPairIcon";
+ // The duration of the scaling animation on hover enter/exit.
+ private static final int HOVER_SCALE_DURATION = 150;
+ // The default scale of the icon when not hovered.
+ private static final Float HOVER_SCALE_DEFAULT = 1f;
+ // The max scale of the icon when hovered.
+ private static final Float HOVER_SCALE_MAX = 1.1f;
+ // Animates the scale of the icon background on hover.
+ private static final FloatProperty<AppPairIcon> HOVER_SCALE_PROPERTY =
+ new FloatProperty<>("hoverScale") {
+ @Override
+ public void setValue(AppPairIcon view, float scale) {
+ view.mIconGraphic.setHoverScale(scale);
+ }
+
+ @Override
+ public Float get(AppPairIcon view) {
+ return view.mIconGraphic.getHoverScale();
+ }
+ };
+
// A view that holds the app pair icon graphic.
private AppPairIconGraphic mIconGraphic;
// A view that holds the app pair's title.
@@ -85,6 +109,11 @@
: activity.getLayoutInflater();
AppPairIcon icon = (AppPairIcon) inflater.inflate(resId, group, false);
+ if (Flags.enableFocusOutline() && activity instanceof Launcher) {
+ icon.setOnFocusChangeListener(((Launcher) activity).getFocusHandler());
+ icon.setDefaultFocusHighlightEnabled(false);
+ }
+
// Sort contents, so that left-hand app comes first
appPairInfo.getContents().sort(Comparator.comparingInt(a -> a.rank));
@@ -243,4 +272,14 @@
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
+
+ @Override
+ public void onHoverChanged(boolean hovered) {
+ super.onHoverChanged(hovered);
+ ObjectAnimator
+ .ofFloat(this, HOVER_SCALE_PROPERTY,
+ hovered ? HOVER_SCALE_MAX : HOVER_SCALE_DEFAULT)
+ .setDuration(HOVER_SCALE_DURATION)
+ .start();
+ }
}
diff --git a/src/com/android/launcher3/apppairs/AppPairIconDrawable.java b/src/com/android/launcher3/apppairs/AppPairIconDrawable.java
index db83d91..114ed2e 100644
--- a/src/com/android/launcher3/apppairs/AppPairIconDrawable.java
+++ b/src/com/android/launcher3/apppairs/AppPairIconDrawable.java
@@ -26,6 +26,7 @@
import androidx.annotation.NonNull;
+import com.android.launcher3.Utilities;
import com.android.launcher3.icons.FastBitmapDrawable;
/**
@@ -128,6 +129,18 @@
height - (mP.getStandardIconPadding() + mP.getOuterPadding())
);
+ // Scale each background from its center edge closest to the center channel.
+ Utilities.scaleRectFAboutPivot(
+ leftSide,
+ leftSide.left + leftSide.width(),
+ leftSide.top + leftSide.centerY(),
+ mP.getHoverScale());
+ Utilities.scaleRectFAboutPivot(
+ rightSide,
+ rightSide.left,
+ rightSide.top + rightSide.centerY(),
+ mP.getHoverScale());
+
drawCustomRoundedRect(canvas, leftSide, new float[]{
mP.getBigRadius(), mP.getBigRadius(),
mP.getSmallRadius(), mP.getSmallRadius(),
@@ -163,6 +176,18 @@
height - (mP.getStandardIconPadding() + mP.getOuterPadding())
);
+ // Scale each background from its center edge closest to the center channel.
+ Utilities.scaleRectFAboutPivot(
+ topSide,
+ topSide.left + topSide.centerX(),
+ topSide.top + topSide.height(),
+ mP.getHoverScale());
+ Utilities.scaleRectFAboutPivot(
+ bottomSide,
+ bottomSide.left + bottomSide.centerX(),
+ bottomSide.top,
+ mP.getHoverScale());
+
drawCustomRoundedRect(canvas, topSide, new float[]{
mP.getBigRadius(), mP.getBigRadius(),
mP.getBigRadius(), mP.getBigRadius(),
diff --git a/src/com/android/launcher3/apppairs/AppPairIconDrawingParams.kt b/src/com/android/launcher3/apppairs/AppPairIconDrawingParams.kt
index 45dc013..5b546d6 100644
--- a/src/com/android/launcher3/apppairs/AppPairIconDrawingParams.kt
+++ b/src/com/android/launcher3/apppairs/AppPairIconDrawingParams.kt
@@ -64,6 +64,8 @@
var isLeftRightSplit: Boolean = true
// The background paint color (based on container).
var bgColor: Int = 0
+ // The scale of the icon background while hovered.
+ var hoverScale: Float = 1f
init {
val activity: ActivityContext = ActivityContext.lookupContext(context)
diff --git a/src/com/android/launcher3/apppairs/AppPairIconGraphic.kt b/src/com/android/launcher3/apppairs/AppPairIconGraphic.kt
index dce97eb..034b686 100644
--- a/src/com/android/launcher3/apppairs/AppPairIconGraphic.kt
+++ b/src/com/android/launcher3/apppairs/AppPairIconGraphic.kt
@@ -139,4 +139,19 @@
super.dispatchDraw(canvas)
drawable.draw(canvas)
}
+
+ /**
+ * Sets the scale of the icon background while hovered.
+ */
+ fun setHoverScale(scale: Float) {
+ drawParams.hoverScale = scale
+ redraw()
+ }
+
+ /**
+ * Gets the scale of the icon background while hovered.
+ */
+ fun getHoverScale(): Float {
+ return drawParams.hoverScale
+ }
}
diff --git a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
index 4f8d53e..d593f80 100644
--- a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
+++ b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
@@ -3,6 +3,7 @@
import android.content.Context;
import android.icu.text.AlphabeticIndex;
import android.os.LocaleList;
+import android.util.Log;
import androidx.annotation.NonNull;
@@ -12,6 +13,9 @@
public class AlphabeticIndexCompat {
+ // TODO(b/336947811): Set to false after root causing is done.
+ private static final boolean DEBUG = true;
+ private static final String TAG = "AlphabeticIndexCompat";
private static final String MID_DOT = "\u2219";
private final String mDefaultMiscLabel;
@@ -49,6 +53,9 @@
public String computeSectionName(@NonNull CharSequence cs) {
String s = Utilities.trim(cs);
String sectionName = mBaseIndex.getBucket(mBaseIndex.getBucketIndex(s)).getLabel();
+ if (DEBUG) {
+ Log.d(TAG, "computeSectionName: cs: " + cs + " sectionName: " + sectionName);
+ }
if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) {
int c = s.codePointAt(0);
boolean startsWithDigit = Character.isDigit(c);
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 60c413e..d0596fa 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -19,6 +19,7 @@
import static com.android.launcher3.config.FeatureFlags.BooleanFlag.DISABLED;
import static com.android.launcher3.config.FeatureFlags.BooleanFlag.ENABLED;
import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification;
+import static com.android.wm.shell.Flags.enableTaskbarOnPhones;
import android.content.res.Resources;
@@ -61,15 +62,6 @@
* and set a default value for the flag. This will be the default value on Debug builds.
* <p>
*/
- // TODO(Block 1): Clean up flags
- public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = getReleaseFlag(
- 270394041, "ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", ENABLED,
- "Enable option to replace decorator-based search result backgrounds with drawables");
-
- public static final BooleanFlag ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION = getReleaseFlag(
- 270394392, "ENABLE_SEARCH_RESULT_LAUNCH_TRANSITION", ENABLED,
- "Enable option to launch search results using the new view container transitions");
-
// TODO(Block 2): Clean up flags
public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(270395073,
"ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH", DISABLED,
@@ -93,11 +85,6 @@
+ "data preparation for loading the home screen");
// TODO(Block 4): Cleanup flags
- public static final BooleanFlag ENABLE_FLOATING_SEARCH_BAR =
- getReleaseFlag(268388460, "ENABLE_FLOATING_SEARCH_BAR", DISABLED,
- "Allow search bar to persist and animate across states, and attach to"
- + " the keyboard from the bottom of the screen");
-
public static final BooleanFlag ENABLE_ALL_APPS_FROM_OVERVIEW =
getDebugFlag(275132633, "ENABLE_ALL_APPS_FROM_OVERVIEW", DISABLED,
"Allow entering All Apps from Overview (e.g. long swipe up from app)");
@@ -157,7 +144,7 @@
DISABLED, "Sends a notification whenever launcher encounters an uncaught exception.");
public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION =
- enableTaskbarNavbarUnification() && !isPhone();
+ enableTaskbarNavbarUnification() && (!isPhone() || enableTaskbarOnPhones());
private static boolean isPhone() {
final boolean isPhone;
@@ -203,9 +190,6 @@
"ENABLE_EXPANDING_PAUSE_WORK_BUTTON", DISABLED,
"Expand and collapse pause work button while scrolling");
- public static final BooleanFlag COLLECT_SEARCH_HISTORY = getReleaseFlag(270391455,
- "COLLECT_SEARCH_HISTORY", DISABLED, "Allow launcher to collect search history for log");
-
// Aconfig migration complete for ENABLE_TWOLINE_ALLAPPS.
public static final BooleanFlag ENABLE_TWOLINE_ALLAPPS = getDebugFlag(270390937,
"ENABLE_TWOLINE_ALLAPPS", DISABLED, "Enables two line label inside all apps.");
diff --git a/src/com/android/launcher3/contextualeducation/ContextualEduStatsManager.java b/src/com/android/launcher3/contextualeducation/ContextualEduStatsManager.java
new file mode 100644
index 0000000..da13546
--- /dev/null
+++ b/src/com/android/launcher3/contextualeducation/ContextualEduStatsManager.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.contextualeducation;
+
+import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
+
+import com.android.launcher3.R;
+import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.ResourceBasedOverride;
+import com.android.launcher3.util.SafeCloseable;
+import com.android.systemui.contextualeducation.GestureType;
+
+/**
+ * A class to update contextual education data. It is a no-op implementation and could be
+ * overridden by changing the resource value [R.string.contextual_edu_manager_class] to provide
+ * a real implementation.
+ */
+public class ContextualEduStatsManager implements ResourceBasedOverride, SafeCloseable {
+ public static final MainThreadInitializedObject<ContextualEduStatsManager> INSTANCE =
+ forOverride(ContextualEduStatsManager.class, R.string.contextual_edu_manager_class);
+
+ /**
+ * Updates contextual education stats when a gesture is triggered
+ * @param isTrackpadGesture indicates if the gesture is triggered by trackpad
+ * @param gestureType type of gesture triggered
+ */
+ public void updateEduStats(boolean isTrackpadGesture, GestureType gestureType) {
+ }
+
+ @Override
+ public void close() {
+ }
+}
diff --git a/src/com/android/launcher3/dagger/LauncherBaseAppComponent.java b/src/com/android/launcher3/dagger/LauncherBaseAppComponent.java
new file mode 100644
index 0000000..3488c95
--- /dev/null
+++ b/src/com/android/launcher3/dagger/LauncherBaseAppComponent.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.dagger;
+
+/**
+ * Launcher base component for Dagger injection.
+ *
+ * This class is not actually annotated as a Dagger component, since it is not used directly as one.
+ * Doing so generates unnecessary code bloat.
+ *
+ * See {@link LauncherAppComponent} for the one actually used by AOSP.
+ */
+public interface LauncherBaseAppComponent {
+ /** Builder for LauncherBaseAppComponent. */
+ interface Builder {
+ LauncherBaseAppComponent build();
+ }
+}
diff --git a/src/com/android/launcher3/debug/TestEventsEmitterProduction.kt b/src/com/android/launcher3/debug/TestEventsEmitterProduction.kt
new file mode 100644
index 0000000..e218b4d
--- /dev/null
+++ b/src/com/android/launcher3/debug/TestEventsEmitterProduction.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.debug
+
+import android.content.Context
+import android.util.Log
+import com.android.launcher3.util.MainThreadInitializedObject
+import com.android.launcher3.util.SafeCloseable
+
+/** Events fired by the launcher. */
+enum class TestEvent(val event: String) {
+ LAUNCHER_ON_CREATE("LAUNCHER_ON_CREATE"),
+ WORKSPACE_ON_DROP("WORKSPACE_ON_DROP"),
+ RESIZE_FRAME_SHOWING("RESIZE_FRAME_SHOWING"),
+ WORKSPACE_FINISH_LOADING("WORKSPACE_FINISH_LOADING"),
+}
+
+/** Interface to create TestEventEmitters. */
+interface TestEventEmitter : SafeCloseable {
+
+ companion object {
+ @JvmField
+ val INSTANCE =
+ MainThreadInitializedObject<TestEventEmitter> { _: Context? ->
+ TestEventsEmitterProduction()
+ }
+ }
+
+ fun sendEvent(event: TestEvent)
+}
+
+/**
+ * TestEventsEmitterProduction shouldn't do anything since it runs on the launcher code and not on
+ * tests. This is just a placeholder and test should override this class.
+ */
+class TestEventsEmitterProduction : TestEventEmitter {
+
+ override fun close() {}
+
+ override fun sendEvent(event: TestEvent) {
+ Log.d("TestEventsEmitterProduction", "Event sent ${event.event}")
+ }
+}
diff --git a/src/com/android/launcher3/dragndrop/AddItemActivity.java b/src/com/android/launcher3/dragndrop/AddItemActivity.java
index ec0a222..85eb39b 100644
--- a/src/com/android/launcher3/dragndrop/AddItemActivity.java
+++ b/src/com/android/launcher3/dragndrop/AddItemActivity.java
@@ -91,7 +91,8 @@
*/
@TargetApi(Build.VERSION_CODES.O)
public class AddItemActivity extends BaseActivity
- implements OnLongClickListener, OnTouchListener, AbstractSlideInView.OnCloseListener {
+ implements OnLongClickListener, OnTouchListener, AbstractSlideInView.OnCloseListener,
+ WidgetCell.PreviewReadyListener {
private static final int SHADOW_SIZE = 10;
@@ -142,6 +143,7 @@
mDragLayer = findViewById(R.id.add_item_drag_layer);
mDragLayer.recreateControllers();
mWidgetCell = findViewById(R.id.widget_cell);
+ mWidgetCell.addPreviewReadyListener(this);
mAccessibilityManager =
getApplicationContext().getSystemService(AccessibilityManager.class);
@@ -454,4 +456,11 @@
.withItemInfo((ItemInfo) mWidgetCell.getWidgetView().getTag())
.log(command);
}
+
+ @Override
+ public void onPreviewAvailable() {
+ // Set the preview height based on "the only" widget's preview.
+ mWidgetCell.setParentAlignedPreviewHeight(mWidgetCell.getPreviewContentHeight());
+ mWidgetCell.post(mWidgetCell::requestLayout);
+ }
}
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index bc5a164..c50c008 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -27,6 +27,7 @@
import android.view.View;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.app.animation.Interpolators;
import com.android.launcher3.DragSource;
@@ -69,8 +70,9 @@
*/
protected DragDriver mDragDriver = null;
+ @VisibleForTesting
/** Options controlling the drag behavior. */
- protected DragOptions mOptions;
+ public DragOptions mOptions;
/** Coordinate for motion down event */
protected final Point mMotionDown = new Point();
@@ -79,7 +81,8 @@
protected final Point mTmpPoint = new Point();
- protected DropTarget.DragObject mDragObject;
+ @VisibleForTesting
+ public DropTarget.DragObject mDragObject;
/** Who can receive drop events */
private final ArrayList<DropTarget> mDropTargets = new ArrayList<>();
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index db693f0..8b1f42b 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -157,7 +157,8 @@
isOverFolderOrSearchBar = isEventOverView(topView, ev) ||
isEventOverAccessibleDropTargetBar(ev);
if (!isOverFolderOrSearchBar) {
- sendTapOutsideFolderAccessibilityEvent(currentFolder.isEditingName());
+ sendTapOutsideFolderAccessibilityEvent(
+ currentFolder.getIsEditingName());
mHoverPointClosesFolder = true;
return true;
}
@@ -167,7 +168,8 @@
isOverFolderOrSearchBar = isEventOverView(topView, ev) ||
isEventOverAccessibleDropTargetBar(ev);
if (!isOverFolderOrSearchBar && !mHoverPointClosesFolder) {
- sendTapOutsideFolderAccessibilityEvent(currentFolder.isEditingName());
+ sendTapOutsideFolderAccessibilityEvent(
+ currentFolder.getIsEditingName());
mHoverPointClosesFolder = true;
return true;
} else if (!isOverFolderOrSearchBar) {
diff --git a/src/com/android/launcher3/dragndrop/LauncherDragController.java b/src/com/android/launcher3/dragndrop/LauncherDragController.java
index f3708a2..29fc613 100644
--- a/src/com/android/launcher3/dragndrop/LauncherDragController.java
+++ b/src/com/android/launcher3/dragndrop/LauncherDragController.java
@@ -28,6 +28,7 @@
import android.view.View;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DragSource;
@@ -36,6 +37,7 @@
import com.android.launcher3.R;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.widget.util.WidgetDragScaleUtils;
/**
* Drag controller for Launcher activity
@@ -43,7 +45,6 @@
public class LauncherDragController extends DragController<Launcher> {
private static final boolean PROFILE_DRAWING_DURING_DRAG = false;
-
private final FlingToDeleteHelper mFlingToDeleteHelper;
public LauncherDragController(Launcher launcher) {
@@ -92,8 +93,13 @@
&& !mOptions.preDragCondition.shouldStartDrag(0);
final Resources res = mActivity.getResources();
- final float scaleDps = mIsInPreDrag
- ? res.getDimensionPixelSize(R.dimen.pre_drag_view_scale) : 0f;
+
+ final float scalePx;
+ if (originalView.getViewType() == DraggableView.DRAGGABLE_WIDGET) {
+ scalePx = mIsInPreDrag ? 0f : getWidgetDragScalePx(drawable, view, dragInfo);
+ } else {
+ scalePx = mIsInPreDrag ? res.getDimensionPixelSize(R.dimen.pre_drag_view_scale) : 0f;
+ }
final DragView dragView = mDragObject.dragView = drawable != null
? new LauncherDragView(
mActivity,
@@ -102,7 +108,7 @@
registrationY,
initialDragViewScale,
dragViewScaleOnDrop,
- scaleDps)
+ scalePx)
: new LauncherDragView(
mActivity,
view,
@@ -112,7 +118,7 @@
registrationY,
initialDragViewScale,
dragViewScaleOnDrop,
- scaleDps);
+ scalePx);
dragView.setItemInfo(dragInfo);
mDragObject.dragComplete = false;
@@ -157,6 +163,29 @@
return dragView;
}
+
+ /**
+ * Returns the scale in terms of pixels (to be applied on width) to scale the preview
+ * during drag and drop.
+ */
+ @VisibleForTesting
+ float getWidgetDragScalePx(@Nullable Drawable drawable, @Nullable View view,
+ ItemInfo dragInfo) {
+ float draggedViewWidthPx = 0;
+ float draggedViewHeightPx = 0;
+
+ if (view != null) {
+ draggedViewWidthPx = view.getMeasuredWidth();
+ draggedViewHeightPx = view.getMeasuredHeight();
+ } else if (drawable != null) {
+ draggedViewWidthPx = drawable.getIntrinsicWidth();
+ draggedViewHeightPx = drawable.getIntrinsicHeight();
+ }
+
+ return WidgetDragScaleUtils.getWidgetDragScalePx(mActivity, mActivity.getDeviceProfile(),
+ draggedViewWidthPx, draggedViewHeightPx, dragInfo);
+ }
+
@Override
protected void exitDrag() {
if (!mActivity.isInState(EDIT_MODE)) {
diff --git a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java
index fbe9e33..bebef70 100644
--- a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java
+++ b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java
@@ -26,7 +26,7 @@
public class SpringLoadedDragController implements OnAlarmListener {
// how long the user must hover over a mini-screen before it unshrinks
private static final long ENTER_SPRING_LOAD_HOVER_TIME = 500;
- private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 2000;
+ private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 3000;
private static final long ENTER_SPRING_LOAD_CANCEL_HOVER_TIME = 950;
Alarm mAlarm;
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index dcc55e6..7bec768 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -26,6 +26,7 @@
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS;
+import static com.android.launcher3.folder.FolderGridOrganizer.createFolderGridOrganizer;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_LABEL_UPDATED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED;
import static com.android.launcher3.testing.shared.TestProtocol.FOLDER_OPENED_MESSAGE;
@@ -65,6 +66,7 @@
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import androidx.core.content.res.ResourcesCompat;
import com.android.launcher3.AbstractFloatingView;
@@ -134,7 +136,8 @@
* We avoid measuring {@link #mContent} with a 0 width or height, as this
* results in CellLayout being measured as UNSPECIFIED, which it does not support.
*/
- private static final int MIN_CONTENT_DIMEN = 5;
+ @VisibleForTesting
+ static final int MIN_CONTENT_DIMEN = 5;
public static final int STATE_CLOSED = 0;
public static final int STATE_ANIMATING = 1;
@@ -142,7 +145,8 @@
@Retention(RetentionPolicy.SOURCE)
@IntDef({STATE_CLOSED, STATE_ANIMATING, STATE_OPEN})
- public @interface FolderState {}
+ public @interface FolderState {
+ }
/**
* Time for which the scroll hint is shown before automatically changing page.
@@ -163,7 +167,7 @@
private static final int FOLDER_COLOR_ANIMATION_DURATION = 200;
private static final int REORDER_DELAY = 250;
- private static final int ON_EXIT_CLOSE_DELAY = 400;
+ static final int ON_EXIT_CLOSE_DELAY = 400;
private static final Rect sTempRect = new Rect();
private static final int MIN_FOLDERS_FOR_HARDWARE_OPTIMIZATION = 10;
@@ -183,10 +187,10 @@
|| itemType == ITEM_TYPE_APP_PAIR;
}
- private final Alarm mReorderAlarm = new Alarm(Looper.getMainLooper());
- private final Alarm mOnExitAlarm = new Alarm(Looper.getMainLooper());
- private final Alarm mOnScrollHintAlarm = new Alarm(Looper.getMainLooper());
- final Alarm mScrollPauseAlarm = new Alarm(Looper.getMainLooper());
+ private Alarm mReorderAlarm = new Alarm(Looper.getMainLooper());
+ private Alarm mOnExitAlarm = new Alarm(Looper.getMainLooper());
+ private Alarm mOnScrollHintAlarm = new Alarm(Looper.getMainLooper());
+ private Alarm mScrollPauseAlarm = new Alarm(Looper.getMainLooper());
final ArrayList<View> mItemsInReadingOrder = new ArrayList<View>();
@@ -196,7 +200,7 @@
// Folder can be displayed in Launcher's activity or a separate window (e.g. Taskbar).
// Anything specific to Launcher should use mLauncherDelegate, otherwise should
// use mActivityContext.
- protected final LauncherDelegate mLauncherDelegate;
+ protected LauncherDelegate mLauncherDelegate;
protected final ActivityContext mActivityContext;
protected DragController mDragController;
@@ -209,7 +213,7 @@
@Thunk
FolderPagedView mContent;
- public FolderNameEditText mFolderName;
+ private FolderNameEditText mFolderName;
private PageIndicatorDots mPageIndicator;
protected View mFooter;
@@ -233,10 +237,10 @@
private OnFolderStateChangedListener mPriorityOnFolderStateChangedListener;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mRearrangeOnClose = false;
- boolean mItemsInvalidated = false;
+ private boolean mItemsInvalidated = false;
private View mCurrentDragView;
private boolean mIsExternalDrag;
- private boolean mDragInProgress = false;
+ private boolean mIsDragInProgress = false;
private boolean mDeleteFolderOnDropCompleted = false;
private boolean mSuppressFolderDeletion = false;
private boolean mItemAddedBackToSelfViaIcon = false;
@@ -249,7 +253,7 @@
private int mScrollAreaOffset;
@Thunk
- int mScrollHintDir = SCROLL_NONE;
+ private int mScrollHintDir = SCROLL_NONE;
@Thunk
int mCurrentScrollDir = SCROLL_NONE;
@@ -314,9 +318,9 @@
| InputType.TYPE_TEXT_FLAG_CAP_WORDS);
mFolderName.forceDisableSuggestions(true);
mFolderName.setPadding(mFolderName.getPaddingLeft(),
- (mFooterHeight - mFolderName.getLineHeight()) / 2,
+ (getFooterHeight() - mFolderName.getLineHeight()) / 2,
mFolderName.getPaddingRight(),
- (mFooterHeight - mFolderName.getLineHeight()) / 2);
+ (getFooterHeight() - mFolderName.getLineHeight()) / 2);
mKeyboardInsetAnimationCallback = new KeyboardInsetAnimationCallback(this);
setWindowInsetsAnimationCallback(mKeyboardInsetAnimationCallback);
@@ -324,42 +328,54 @@
public boolean onLongClick(View v) {
// Return if global dragging is not enabled
- if (!mLauncherDelegate.isDraggingEnabled()) return true;
+ if (!getIsLauncherDraggingEnabled()) return true;
return startDrag(v, new DragOptions());
}
+ @VisibleForTesting
+ boolean getIsLauncherDraggingEnabled() {
+ return mLauncherDelegate.isDraggingEnabled();
+ }
+
public boolean startDrag(View v, DragOptions options) {
Object tag = v.getTag();
if (tag instanceof ItemInfo item) {
mEmptyCellRank = item.rank;
mCurrentDragView = v;
- mDragController.addDragListener(this);
- if (options.isAccessibleDrag) {
- mDragController.addDragListener(new AccessibleDragListenerAdapter(
- mContent, FolderAccessibilityHelper::new) {
- @Override
- protected void enableAccessibleDrag(boolean enable,
- @Nullable DragObject dragObject) {
- super.enableAccessibleDrag(enable, dragObject);
- mFooter.setImportantForAccessibility(enable
- ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
- : IMPORTANT_FOR_ACCESSIBILITY_AUTO);
- }
- });
- }
-
- mLauncherDelegate.beginDragShared(v, this, options);
+ addDragListener(options);
+ callBeginDragShared(v, options);
}
return true;
}
+ void callBeginDragShared(View v, DragOptions options) {
+ mLauncherDelegate.beginDragShared(v, this, options);
+ }
+
+ void addDragListener(DragOptions options) {
+ getDragController().addDragListener(this);
+ if (!options.isAccessibleDrag) {
+ return;
+ }
+ getDragController().addDragListener(new AccessibleDragListenerAdapter(
+ mContent, FolderAccessibilityHelper::new) {
+ @Override
+ protected void enableAccessibleDrag(boolean enable,
+ @Nullable DragObject dragObject) {
+ super.enableAccessibleDrag(enable, dragObject);
+ mFooter.setImportantForAccessibility(enable
+ ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
+ : IMPORTANT_FOR_ACCESSIBILITY_AUTO);
+ }
+ });
+ }
+
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
if (dragObject.dragSource != this) {
return;
}
-
mContent.removeItem(mCurrentDragView);
mItemsInvalidated = true;
@@ -368,29 +384,23 @@
try (SuppressInfoChanges s = new SuppressInfoChanges()) {
mInfo.remove(dragObject.dragInfo, true);
}
- mDragInProgress = true;
+ mIsDragInProgress = true;
mItemAddedBackToSelfViaIcon = false;
}
@Override
public void onDragEnd() {
- if (mIsExternalDrag && mDragInProgress) {
+ if (mIsExternalDrag && mIsDragInProgress) {
completeDragExit();
}
- mDragInProgress = false;
- mDragController.removeDragListener(this);
- }
-
- public boolean isEditingName() {
- return mIsEditingName;
+ mIsDragInProgress = false;
+ getDragController().removeDragListener(this);
}
public void startEditingFolderName() {
- post(() -> {
- showLabelSuggestions();
- mFolderName.setHint("");
- mIsEditingName = true;
- });
+ showLabelSuggestions();
+ mFolderName.setHint("");
+ mIsEditingName = true;
}
@Override
@@ -458,7 +468,11 @@
return mFolderIcon;
}
- public void setDragController(DragController dragController) {
+ DragController getDragController() {
+ return mDragController;
+ }
+
+ void setDragController(DragController dragController) {
mDragController = dragController;
}
@@ -539,7 +553,7 @@
* Show suggested folder title in FolderEditText if the first suggestion is non-empty, push
* rest of the suggestions to InputMethodManager.
*/
- private void showLabelSuggestions() {
+ void showLabelSuggestions() {
if (mInfo.suggestedFolderNames == null) {
return;
}
@@ -633,11 +647,11 @@
*/
public void beginExternalDrag() {
mIsExternalDrag = true;
- mDragInProgress = true;
+ mIsDragInProgress = true;
// Since this folder opened by another controller, it might not get onDrop or
// onDropComplete. Perform cleanup once drag-n-drop ends.
- mDragController.addDragListener(this);
+ getDragController().addDragListener(this);
ArrayList<ItemInfo> items = new ArrayList<>(mInfo.getContents());
mEmptyCellRank = items.size();
@@ -661,16 +675,12 @@
* is played.
*/
private void animateOpen(List<ItemInfo> items, int pageNo) {
- if (items == null || items.size() <= 1) {
- Log.d(TAG, "Couldn't animate folder open because items is: " + items);
+ if (!shouldAnimateOpen(items)) {
return;
}
Folder openFolder = getOpen(mActivityContext);
- if (openFolder != null && openFolder != this) {
- // Close any open folder before opening a folder.
- openFolder.close(true);
- }
+ closeOpenFolder(openFolder);
mContent.bindItems(items);
centerAboutIcon();
@@ -684,7 +694,7 @@
// There was a one-off crash where the folder had a parent already.
if (getParent() == null) {
dragLayer.addView(this);
- mDragController.addDropTarget(this);
+ getDragController().addDropTarget(this);
} else {
if (FeatureFlags.IS_STUDIO_BUILD) {
Log.e(TAG, "Opening folder (" + this + ") which already has a parent:"
@@ -733,7 +743,7 @@
// Do not update the flag if we are in drag mode. The flag will be updated, when we
// actually drop the icon.
- final boolean updateAnimationFlag = !mDragInProgress;
+ final boolean updateAnimationFlag = !mIsDragInProgress;
anim.addListener(new AnimatorListenerAdapter() {
@SuppressLint("InlinedApi")
@@ -763,16 +773,41 @@
addAnimationStartListeners(anim);
// Because t=0 has the folder match the folder icon, we can skip the
// first frame and have the same movement one frame earlier.
+ Log.d("b/311077782", "Folder.animateOpen");
anim.setCurrentPlayTime(Math.min(getSingleFrameMs(getContext()), anim.getTotalDuration()));
anim.start();
// Make sure the folder picks up the last drag move even if the finger doesn't move.
- if (mDragController.isDragging()) {
- mDragController.forceTouchMove();
+ if (getDragController().isDragging()) {
+ getDragController().forceTouchMove();
}
mContent.verifyVisibleHighResIcons(mContent.getNextPage());
}
+ /**
+ * Determines whether we should animate the folder opening.
+ */
+ boolean shouldAnimateOpen(List<ItemInfo> items) {
+ if (items == null || items.size() <= 1) {
+ Log.d(TAG, "Couldn't animate folder open because items is: " + items);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * If there's a folder already open, we want to close it before opening another one.
+ */
+ @VisibleForTesting
+ boolean closeOpenFolder(Folder openFolder) {
+ if (openFolder != null && openFolder != this) {
+ // Close any open folder before opening a folder.
+ openFolder.close(true);
+ return true;
+ }
+ return false;
+ }
+
@Override
protected boolean isOfType(int type) {
return (type & TYPE_FOLDER) != 0;
@@ -786,7 +821,7 @@
mCurrentAnimator.cancel();
}
- if (isEditingName()) {
+ if (mIsEditingName) {
mFolderName.dispatchBackKey();
}
@@ -870,7 +905,7 @@
if (parent != null) {
parent.removeView(this);
}
- mDragController.removeDropTarget(this);
+ getDragController().removeDropTarget(this);
clearFocus();
if (mFolderIcon != null) {
mFolderIcon.setVisibility(View.VISIBLE);
@@ -891,12 +926,12 @@
mRearrangeOnClose = false;
}
if (getItemCount() <= 1) {
- if (!mDragInProgress && !mSuppressFolderDeletion) {
+ if (!mIsDragInProgress && !mSuppressFolderDeletion) {
replaceFolderWithFinalItem();
- } else if (mDragInProgress) {
+ } else if (mIsDragInProgress) {
mDeleteFolderOnDropCompleted = true;
}
- } else if (!mDragInProgress) {
+ } else if (!mIsDragInProgress) {
mContent.unbindItems();
}
mSuppressFolderDeletion = false;
@@ -1016,7 +1051,8 @@
}
}
- private void clearDragInfo() {
+ @VisibleForTesting
+ void clearDragInfo() {
mCurrentDragView = null;
mIsExternalDrag = false;
}
@@ -1057,7 +1093,8 @@
if (getItemCount() <= 1) {
mDeleteFolderOnDropCompleted = true;
}
- if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) {
+ if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon
+ && target != this) {
replaceFolderWithFinalItem();
}
} else {
@@ -1088,7 +1125,7 @@
}
mDeleteFolderOnDropCompleted = false;
- mDragInProgress = false;
+ mIsDragInProgress = false;
mItemAddedBackToSelfViaIcon = false;
mCurrentDragView = null;
@@ -1105,7 +1142,7 @@
}
private void updateItemLocationsInDatabaseBatch(boolean isBind) {
- FolderGridOrganizer verifier = new FolderGridOrganizer(
+ FolderGridOrganizer verifier = createFolderGridOrganizer(
mActivityContext.getDeviceProfile()).setFolderInfo(mInfo);
ArrayList<ItemInfo> items = new ArrayList<>();
@@ -1131,7 +1168,7 @@
}
public void notifyDrop() {
- if (mDragInProgress) {
+ if (mIsDragInProgress) {
mItemAddedBackToSelfViaIcon = true;
}
}
@@ -1174,28 +1211,41 @@
}
protected int getContentAreaHeight() {
- DeviceProfile grid = mActivityContext.getDeviceProfile();
- int maxContentAreaHeight = grid.availableHeightPx - grid.getTotalWorkspacePadding().y
- - mFooterHeight;
- int height = Math.min(maxContentAreaHeight,
+ int height = Math.min(getMaxContentAreaHeight(),
mContent.getDesiredHeight());
return Math.max(height, MIN_CONTENT_DIMEN);
}
- private int getContentAreaWidth() {
+ @VisibleForTesting
+ int getMaxContentAreaHeight() {
+ DeviceProfile grid = mActivityContext.getDeviceProfile();
+ return grid.availableHeightPx - grid.getTotalWorkspacePadding().y
+ - getFooterHeight();
+ }
+
+ @VisibleForTesting
+ int getContentAreaWidth() {
return Math.max(mContent.getDesiredWidth(), MIN_CONTENT_DIMEN);
}
- private int getFolderWidth() {
+ @VisibleForTesting
+ int getFolderWidth() {
return getPaddingLeft() + getPaddingRight() + mContent.getDesiredWidth();
}
- private int getFolderHeight() {
+ @VisibleForTesting
+ int getFolderHeight() {
return getFolderHeight(getContentAreaHeight());
}
- private int getFolderHeight(int contentAreaHeight) {
- return getPaddingTop() + getPaddingBottom() + contentAreaHeight + mFooterHeight;
+ @VisibleForTesting
+ int getFolderHeight(int contentAreaHeight) {
+ return getPaddingTop() + getPaddingBottom() + contentAreaHeight + getFooterHeight();
+ }
+
+ @VisibleForTesting
+ int getFooterHeight() {
+ return mFooterHeight;
}
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
@@ -1365,7 +1415,7 @@
}
// Clear the drag info, as it is no longer being dragged.
- mDragInProgress = false;
+ mIsDragInProgress = false;
if (mContent.getPageCount() > 1) {
// The animation has already been shown while opening the folder.
@@ -1403,7 +1453,7 @@
@Override
public void onAdd(ItemInfo item, int rank) {
- FolderGridOrganizer verifier = new FolderGridOrganizer(
+ FolderGridOrganizer verifier = createFolderGridOrganizer(
mActivityContext.getDeviceProfile()).setFolderInfo(mInfo);
verifier.updateRankAndPos(item, rank);
mLauncherDelegate.getModelWriter().addOrMoveItemInDatabase(item, mInfo.id, 0, item.cellX,
@@ -1434,7 +1484,8 @@
}
}
- private View getViewForInfo(final ItemInfo item) {
+ @VisibleForTesting
+ View getViewForInfo(final ItemInfo item) {
return mContent.iterateOverItems((info, view) -> info == item);
}
@@ -1492,7 +1543,7 @@
if (hasFocus) {
mFromLabelState = mInfo.getFromLabelState();
mFromTitle = mInfo.title;
- startEditingFolderName();
+ post(this::startEditingFolderName);
} else {
StatsLogger statsLogger = mStatsLogManager.logger()
.withItemInfo(mInfo)
@@ -1625,7 +1676,7 @@
/** Navigation bar back key or hardware input back key has been issued. */
@Override
public void onBackInvoked() {
- if (isEditingName()) {
+ if (mIsEditingName) {
mFolderName.dispatchBackKey();
} else {
super.onBackInvoked();
@@ -1637,7 +1688,7 @@
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
BaseDragLayer dl = (BaseDragLayer) getParent();
- if (isEditingName()) {
+ if (mIsEditingName) {
if (!dl.isEventOverView(mFolderName, ev)) {
mFolderName.dispatchBackKey();
return true;
@@ -1684,6 +1735,95 @@
return mContent;
}
+ @VisibleForTesting
+ void setItemAddedBackToSelfViaIcon(boolean value) {
+ mItemAddedBackToSelfViaIcon = value;
+ }
+
+ @VisibleForTesting
+ boolean getItemAddedBackToSelfViaIcon() {
+ return mItemAddedBackToSelfViaIcon;
+ }
+
+ @VisibleForTesting
+ void setIsDragInProgress(boolean value) {
+ mIsDragInProgress = value;
+ }
+
+ @VisibleForTesting
+ boolean getIsDragInProgress() {
+ return mIsDragInProgress;
+ }
+
+ @VisibleForTesting
+ View getCurrentDragView() {
+ return mCurrentDragView;
+ }
+
+ @VisibleForTesting
+ void setCurrentDragView(View view) {
+ mCurrentDragView = view;
+ }
+
+ @VisibleForTesting
+ boolean getItemsInvalidated() {
+ return mItemsInvalidated;
+ }
+
+ @VisibleForTesting
+ void setItemsInvalidated(boolean value) {
+ mItemsInvalidated = value;
+ }
+
+ @VisibleForTesting
+ boolean getIsExternalDrag() {
+ return mIsExternalDrag;
+ }
+
+ @VisibleForTesting
+ void setIsExternalDrag(boolean value) {
+ mIsExternalDrag = value;
+ }
+
+ public boolean getIsEditingName() {
+ return mIsEditingName;
+ }
+
+ @VisibleForTesting
+ void setIsEditingName(boolean value) {
+ mIsEditingName = value;
+ }
+
+ @VisibleForTesting
+ void setFolderName(FolderNameEditText value) {
+ mFolderName = value;
+ }
+
+ @VisibleForTesting
+ FolderNameEditText getFolderName() {
+ return mFolderName;
+ }
+
+ @VisibleForTesting
+ boolean getIsOpen() {
+ return mIsOpen;
+ }
+
+ @VisibleForTesting
+ void setIsOpen(boolean value) {
+ mIsOpen = value;
+ }
+
+ @VisibleForTesting
+ boolean getRearrangeOnClose() {
+ return mRearrangeOnClose;
+ }
+
+ @VisibleForTesting
+ void setRearrangeOnClose(boolean value) {
+ mRearrangeOnClose = value;
+ }
+
/** Returns the height of the current folder's bottom edge from the bottom of the screen. */
private int getHeightFromBottom() {
BaseDragLayer.LayoutParams layoutParams = (BaseDragLayer.LayoutParams) getLayoutParams();
@@ -1693,6 +1833,16 @@
return windowBottomPx - folderBottomPx;
}
+ @VisibleForTesting
+ boolean getDeleteFolderOnDropCompleted() {
+ return mDeleteFolderOnDropCompleted;
+ }
+
+ @VisibleForTesting
+ void setDeleteFolderOnDropCompleted(boolean value) {
+ mDeleteFolderOnDropCompleted = value;
+ }
+
/**
* Save this listener for the special case of when we update the state and concurrently
* add another listener to {@link #mOnFolderStateChangedListeners} to avoid a
@@ -1702,7 +1852,13 @@
mPriorityOnFolderStateChangedListener = listener;
}
- private void setState(@FolderState int newState) {
+ @VisibleForTesting
+ int getState() {
+ return mState;
+ }
+
+ @VisibleForTesting
+ void setState(@FolderState int newState) {
mState = newState;
if (mPriorityOnFolderStateChangedListener != null) {
mPriorityOnFolderStateChangedListener.onFolderStateChanged(mState);
@@ -1714,6 +1870,60 @@
}
}
+ @VisibleForTesting
+ Alarm getOnExitAlarm() {
+ return mOnExitAlarm;
+ }
+
+ @VisibleForTesting
+ void setOnExitAlarm(Alarm value) {
+ mOnExitAlarm = value;
+ }
+
+ @VisibleForTesting
+ Alarm getReorderAlarm() {
+ return mReorderAlarm;
+ }
+
+ @VisibleForTesting
+ void setReorderAlarm(Alarm value) {
+ mReorderAlarm = value;
+ }
+
+ @VisibleForTesting
+ Alarm getOnScrollHintAlarm() {
+ return mOnScrollHintAlarm;
+ }
+
+ @VisibleForTesting
+ void setOnScrollHintAlarm(Alarm value) {
+ mOnScrollHintAlarm = value;
+ }
+
+ @VisibleForTesting
+ Alarm getScrollPauseAlarm() {
+ return mScrollPauseAlarm;
+ }
+
+ @VisibleForTesting
+ void setScrollPauseAlarm(Alarm value) {
+ mScrollPauseAlarm = value;
+ }
+
+ @VisibleForTesting
+ int getScrollHintDir() {
+ return mScrollHintDir;
+ }
+
+ @VisibleForTesting
+ void setScrollHintDir(int value) {
+ mScrollHintDir = value;
+ }
+
+ @VisibleForTesting
+ int getScrollAreaOffset() {
+ return mScrollAreaOffset;
+ }
/**
* Adds the provided listener to the running list of Folder listeners
* {@link #mOnFolderStateChangedListeners}
diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java
index 7ef3209..588a6db 100644
--- a/src/com/android/launcher3/folder/FolderAnimationManager.java
+++ b/src/com/android/launcher3/folder/FolderAnimationManager.java
@@ -21,6 +21,7 @@
import static com.android.launcher3.BubbleTextView.TEXT_ALPHA_PROPERTY;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
+import static com.android.launcher3.folder.FolderGridOrganizer.createFolderGridOrganizer;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -60,6 +61,7 @@
*/
public class FolderAnimationManager {
+ private static final float EXTRA_FOLDER_REVEAL_RADIUS_PERCENTAGE = 0.125F;
private static final int FOLDER_NAME_ALPHA_DURATION = 32;
private static final int LARGE_FOLDER_FOOTER_DURATION = 128;
@@ -98,7 +100,7 @@
mContext = folder.getContext();
mDeviceProfile = folder.mActivityContext.getDeviceProfile();
- mPreviewVerifier = new FolderGridOrganizer(mDeviceProfile);
+ mPreviewVerifier = createFolderGridOrganizer(mDeviceProfile);
mIsOpening = isOpening;
@@ -158,12 +160,9 @@
mFolder.mFooter.setPivotX(0);
mFolder.mFooter.setPivotY(0);
- // We want to create a small X offset for the preview items, so that they follow their
- // expected path to their final locations. ie. an icon should not move right, if it's final
- // location is to its left. This value is arbitrarily defined.
- int previewItemOffsetX = (int) (previewSize / 2);
+ int previewItemOffsetX = 0;
if (Utilities.isRtl(mContext.getResources())) {
- previewItemOffsetX = (int) (lp.width * initialScale - initialSize - previewItemOffsetX);
+ previewItemOffsetX = (int) (lp.width * initialScale - initialSize);
}
final int paddingOffsetX = (int) (mContent.getPaddingLeft() * initialScale);
@@ -239,21 +238,26 @@
play(a, shapeDelegate.createRevealAnimator(
mFolder, startRect, endRect, finalRadius, !mIsOpening));
- // Create reveal animator for the folder content (capture the top 4 icons 2x2)
- int width = mDeviceProfile.folderCellLayoutBorderSpacePx.x
- + mDeviceProfile.folderCellWidthPx * 2;
- int height = mDeviceProfile.folderCellLayoutBorderSpacePx.y
- + mDeviceProfile.folderCellHeightPx * 2;
int page = mIsOpening ? mContent.getCurrentPage() : mContent.getDestinationPage();
- int left = mContent.getPaddingLeft() + page * lp.width;
- Rect contentStart = new Rect(left, 0, left + width, height);
+ if (Utilities.isRtl(mContext.getResources())) {
+ page = (mContent.getPageCount() - 1) - page;
+ }
+ int left = page * lp.width;
+
+ int extraRadius = (int) ((mDeviceProfile.folderIconSizePx / initialScale)
+ * EXTRA_FOLDER_REVEAL_RADIUS_PERCENTAGE);
+ Rect contentStart = new Rect(
+ (int) (left + (startRect.left / initialScale)) - extraRadius,
+ (int) (startRect.top / initialScale) - extraRadius,
+ (int) (left + (startRect.right / initialScale)) + extraRadius,
+ (int) (startRect.bottom / initialScale) + extraRadius);
Rect contentEnd = new Rect(left, 0, left + lp.width, lp.height);
play(a, shapeDelegate.createRevealAnimator(
mFolder.getContent(), contentStart, contentEnd, finalRadius, !mIsOpening));
// Fade in the folder name, as the text can overlap the icons when grid size is small.
- mFolder.mFolderName.setAlpha(mIsOpening ? 0f : 1f);
- play(a, getAnimator(mFolder.mFolderName, View.ALPHA, 0, 1),
+ mFolder.getFolderName().setAlpha(mIsOpening ? 0f : 1f);
+ play(a, getAnimator(mFolder.getFolderName(), View.ALPHA, 0, 1),
mIsOpening ? FOLDER_NAME_ALPHA_DURATION : 0,
mIsOpening ? mDuration - FOLDER_NAME_ALPHA_DURATION : FOLDER_NAME_ALPHA_DURATION);
@@ -314,7 +318,7 @@
mFolder.mFooter.setScaleX(1f);
mFolder.mFooter.setScaleY(1f);
mFolder.mFooter.setTranslationX(0f);
- mFolder.mFolderName.setAlpha(1f);
+ mFolder.getFolderName().setAlpha(1f);
mFolder.setClipChildren(mFolderClipChildren);
mFolder.setClipToPadding(mFolderClipToPadding);
diff --git a/src/com/android/launcher3/folder/FolderGridOrganizer.java b/src/com/android/launcher3/folder/FolderGridOrganizer.java
index 593673d..a7ab7b9 100644
--- a/src/com/android/launcher3/folder/FolderGridOrganizer.java
+++ b/src/com/android/launcher3/folder/FolderGridOrganizer.java
@@ -47,13 +47,20 @@
/**
* Note: must call {@link #setFolderInfo(FolderInfo)} manually for verifier to work.
*/
- public FolderGridOrganizer(DeviceProfile profile) {
- mMaxCountX = profile.numFolderColumns;
- mMaxCountY = profile.numFolderRows;
+ public FolderGridOrganizer(int maxCountX, int maxCountY) {
+ mMaxCountX = maxCountX;
+ mMaxCountY = maxCountY;
mMaxItemsPerPage = mMaxCountX * mMaxCountY;
}
/**
+ * Creates a FolderGridOrganizer for the given DeviceProfile
+ */
+ public static FolderGridOrganizer createFolderGridOrganizer(DeviceProfile profile) {
+ return new FolderGridOrganizer(profile.numFolderColumns, profile.numFolderRows);
+ }
+
+ /**
* Updates the organizer with the provided folder info
*/
public FolderGridOrganizer setFolderInfo(FolderInfo info) {
@@ -194,6 +201,7 @@
int row = rank / mCountX;
return col < PREVIEW_MAX_COLUMNS && row < PREVIEW_MAX_ROWS;
}
+ // If we have less than 4 items do this
return rank < MAX_NUM_ITEMS_IN_PREVIEW;
}
}
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index 00636a3..a0b695a 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -19,6 +19,7 @@
import static com.android.launcher3.Flags.enableCursorHoverStates;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
+import static com.android.launcher3.folder.FolderGridOrganizer.createFolderGridOrganizer;
import static com.android.launcher3.folder.PreviewItemManager.INITIAL_ITEM_ANIMATION_DURATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_PRIMARY;
@@ -223,7 +224,7 @@
icon.setAccessibilityDelegate(activity.getAccessibilityDelegate());
- icon.mPreviewVerifier = new FolderGridOrganizer(activity.getDeviceProfile());
+ icon.mPreviewVerifier = createFolderGridOrganizer(activity.getDeviceProfile());
icon.mPreviewVerifier.setFolderInfo(folderInfo);
icon.updatePreviewItems(false);
@@ -458,7 +459,7 @@
mInfo.setTitle(newTitle, mFolder.mLauncherDelegate.getModelWriter());
onTitleChanged(mInfo.title);
- mFolder.mFolderName.setText(mInfo.title);
+ mFolder.getFolderName().setText(mInfo.title);
// Logging for folder creation flow
StatsLogManager.newInstance(getContext()).logger()
diff --git a/src/com/android/launcher3/folder/FolderNameProvider.java b/src/com/android/launcher3/folder/FolderNameProvider.java
index 5d2bb3a..be5f8f7 100644
--- a/src/com/android/launcher3/folder/FolderNameProvider.java
+++ b/src/com/android/launcher3/folder/FolderNameProvider.java
@@ -28,11 +28,12 @@
import androidx.annotation.WorkerThread;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.model.AllAppsList;
-import com.android.launcher3.model.BaseModelUpdateTask;
import com.android.launcher3.model.BgDataModel;
+import com.android.launcher3.model.ModelTaskController;
import com.android.launcher3.model.StringCache;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.CollectionInfo;
@@ -191,10 +192,11 @@
nameInfos.setLabel(labels.length - 1, label, 1.0f);
}
- private class FolderNameWorker extends BaseModelUpdateTask {
+ private class FolderNameWorker implements ModelUpdateTask {
+
@Override
- public void execute(@NonNull final LauncherAppState app,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController,
+ @NonNull BgDataModel dataModel, @NonNull AllAppsList apps) {
mCollectionInfos = dataModel.collections.clone();
mAppInfos = Arrays.asList(apps.copyData());
}
diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java
index 8eaa0dc..9dc2d24 100644
--- a/src/com/android/launcher3/folder/FolderPagedView.java
+++ b/src/com/android/launcher3/folder/FolderPagedView.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER;
+import static com.android.launcher3.folder.FolderGridOrganizer.createFolderGridOrganizer;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -100,10 +101,21 @@
private boolean mViewsBound = false;
public FolderPagedView(Context context, AttributeSet attrs) {
+ this(
+ context,
+ attrs,
+ createFolderGridOrganizer(ActivityContext.lookupContext(context).getDeviceProfile())
+ );
+ }
+
+ public FolderPagedView(
+ Context context,
+ AttributeSet attrs,
+ FolderGridOrganizer folderGridOrganizer
+ ) {
super(context, attrs);
ActivityContext activityContext = ActivityContext.lookupContext(context);
- DeviceProfile profile = activityContext.getDeviceProfile();
- mOrganizer = new FolderGridOrganizer(profile);
+ mOrganizer = folderGridOrganizer;
mIsRtl = Utilities.isRtl(getResources());
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
@@ -361,8 +373,8 @@
// Update footer
mPageIndicator.setVisibility(getPageCount() > 1 ? View.VISIBLE : View.GONE);
// Set the gravity as LEFT or RIGHT instead of START, as START depends on the actual text.
- mFolder.mFolderName.setGravity(getPageCount() > 1 ?
- (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL);
+ mFolder.getFolderName().setGravity(getPageCount() > 1
+ ? (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL);
}
public int getDesiredWidth() {
diff --git a/src/com/android/launcher3/folder/PreviewItemManager.java b/src/com/android/launcher3/folder/PreviewItemManager.java
index 6311638..2276ac7 100644
--- a/src/com/android/launcher3/folder/PreviewItemManager.java
+++ b/src/com/android/launcher3/folder/PreviewItemManager.java
@@ -23,6 +23,7 @@
import static com.android.launcher3.folder.FolderIcon.DROP_IN_ANIMATION_DURATION;
import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
+import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -41,14 +42,13 @@
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.Flags;
import com.android.launcher3.Utilities;
import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.apppairs.AppPairIconDrawingParams;
import com.android.launcher3.apppairs.AppPairIconGraphic;
-import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.model.data.AppPairInfo;
import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
@@ -442,10 +442,8 @@
@VisibleForTesting
public void setDrawable(PreviewItemDrawingParams p, ItemInfo item) {
if (item instanceof WorkspaceItemInfo wii) {
- if (wii.hasPromiseIconUi() || (wii.runtimeStatusFlags
- & ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK) != 0) {
- PreloadIconDrawable drawable = newPendingIcon(mContext, wii);
- p.drawable = drawable;
+ if (isActivePendingIcon(wii)) {
+ p.drawable = newPendingIcon(mContext, wii);
} else {
p.drawable = wii.newIcon(mContext,
Themes.isThemedIconEnabled(mContext) ? FLAG_THEMED : 0);
@@ -463,4 +461,14 @@
// callback will be released when the folder is opened.
p.drawable.setCallback(mIcon);
}
+
+ /**
+ * Returns true if item is a Promise Icon or actively downloading, and the item is not an
+ * inactive archived app.
+ */
+ private boolean isActivePendingIcon(WorkspaceItemInfo item) {
+ return (item.hasPromiseIconUi()
+ || (item.runtimeStatusFlags & FLAG_SHOW_DOWNLOAD_PROGRESS_MASK) != 0)
+ && !(Flags.useNewIconForArchivedApps() && item.isInactiveArchive());
+ }
}
diff --git a/src/com/android/launcher3/graphics/IconPalette.java b/src/com/android/launcher3/graphics/IconPalette.java
index 778b32a..00f1c67 100644
--- a/src/com/android/launcher3/graphics/IconPalette.java
+++ b/src/com/android/launcher3/graphics/IconPalette.java
@@ -16,22 +16,15 @@
package com.android.launcher3.graphics;
-import android.app.Notification;
import android.content.Context;
import android.graphics.Color;
-import android.util.Log;
-import androidx.core.graphics.ColorUtils;
-
-import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
/**
* Contains colors based on the dominant color of an icon.
*/
public class IconPalette {
-
- private static final boolean DEBUG = false;
private static final String TAG = "IconPalette";
private static final float MIN_PRELOAD_COLOR_SATURATION = 0.2f;
@@ -54,95 +47,4 @@
}
return result;
}
-
- /**
- * Resolves a color such that it has enough contrast to be used as the
- * color of an icon or text on the given background color.
- *
- * @return a color of the same hue with enough contrast against the background.
- *
- * This was copied from com.android.internal.util.NotificationColorUtil.
- */
- public static int resolveContrastColor(Context context, int color, int background) {
- final int resolvedColor = resolveColor(context, color);
-
- int contrastingColor = ensureTextContrast(resolvedColor, background);
-
- if (contrastingColor != resolvedColor) {
- if (DEBUG){
- Log.w(TAG, String.format(
- "Enhanced contrast of notification for %s " +
- "%s (over background) by changing #%s to %s",
- context.getPackageName(),
- contrastChange(resolvedColor, contrastingColor, background),
- Integer.toHexString(resolvedColor), Integer.toHexString(contrastingColor)));
- }
- }
- return contrastingColor;
- }
-
- /**
- * Resolves {@param color} to an actual color if it is {@link Notification#COLOR_DEFAULT}
- *
- * This was copied from com.android.internal.util.NotificationColorUtil.
- */
- private static int resolveColor(Context context, int color) {
- if (color == Notification.COLOR_DEFAULT) {
- return context.getColor(R.color.notification_icon_default_color);
- }
- return color;
- }
-
- /** For debugging. This was copied from com.android.internal.util.NotificationColorUtil. */
- private static String contrastChange(int colorOld, int colorNew, int bg) {
- return String.format("from %.2f:1 to %.2f:1",
- ColorUtils.calculateContrast(colorOld, bg),
- ColorUtils.calculateContrast(colorNew, bg));
- }
-
- /**
- * Finds a text color with sufficient contrast over bg that has the same hue as the original
- * color.
- *
- * This was copied from com.android.internal.util.NotificationColorUtil.
- */
- private static int ensureTextContrast(int color, int bg) {
- return findContrastColor(color, bg, 4.5);
- }
- /**
- * Finds a suitable color such that there's enough contrast.
- *
- * @param fg the color to start searching from.
- * @param bg the color to ensure contrast against.
- * @param minRatio the minimum contrast ratio required.
- * @return a color with the same hue as {@param color}, potentially darkened to meet the
- * contrast ratio.
- *
- * This was copied from com.android.internal.util.NotificationColorUtil.
- */
- private static int findContrastColor(int fg, int bg, double minRatio) {
- if (ColorUtils.calculateContrast(fg, bg) >= minRatio) {
- return fg;
- }
-
- double[] lab = new double[3];
- ColorUtils.colorToLAB(bg, lab);
- double bgL = lab[0];
- ColorUtils.colorToLAB(fg, lab);
- double fgL = lab[0];
- boolean isBgDark = bgL < 50;
-
- double low = isBgDark ? fgL : 0, high = isBgDark ? 100 : fgL;
- final double a = lab[1], b = lab[2];
- for (int i = 0; i < 15 && high - low > 0.00001; i++) {
- final double l = (low + high) / 2;
- fg = ColorUtils.LABToColor(l, a, b);
- if (ColorUtils.calculateContrast(fg, bg) > minRatio) {
- if (isBgDark) high = l; else low = l;
- } else {
- if (isBgDark) low = l; else high = l;
- }
- }
- return ColorUtils.LABToColor(low, a, b);
- }
}
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index 91632c6..2408955 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -76,11 +76,8 @@
import com.android.launcher3.celllayout.CellPosMapper;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderIcon;
-import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
-import com.android.launcher3.model.WidgetItem;
-import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.model.data.AppPairInfo;
import com.android.launcher3.model.data.CollectionInfo;
import com.android.launcher3.model.data.FolderInfo;
@@ -107,7 +104,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.stream.Collectors;
/**
* Utility class for generating the preview of Launcher for a given InvariantDeviceProfile.
@@ -126,44 +123,12 @@
*/
public static class PreviewContext extends SandboxContext {
- private final InvariantDeviceProfile mIdp;
- private final ConcurrentLinkedQueue<LauncherIconsForPreview> mIconPool =
- new ConcurrentLinkedQueue<>();
-
public PreviewContext(Context base, InvariantDeviceProfile idp) {
super(base);
- mIdp = idp;
putObject(InvariantDeviceProfile.INSTANCE, idp);
putObject(LauncherAppState.INSTANCE,
new LauncherAppState(this, null /* iconCacheFileName */));
}
-
- /**
- * Creates a new LauncherIcons for the preview, skipping the global pool
- */
- public LauncherIcons newLauncherIcons(Context context) {
- LauncherIconsForPreview launcherIconsForPreview = mIconPool.poll();
- if (launcherIconsForPreview != null) {
- return launcherIconsForPreview;
- }
- return new LauncherIconsForPreview(context, mIdp.fillResIconDpi, mIdp.iconBitmapSize,
- -1 /* poolId */);
- }
-
- private final class LauncherIconsForPreview extends LauncherIcons {
-
- private LauncherIconsForPreview(Context context, int fillResIconDpi, int iconBitmapSize,
- int poolId) {
- super(context, fillResIconDpi, iconBitmapSize, poolId);
- }
-
- @Override
- public void recycle() {
- // Clear any temporary state variables
- clear();
- mIconPool.offer(this);
- }
- }
}
private final List<OnDeviceProfileChangeListener> mDpChangeListeners = new ArrayList<>();
@@ -221,10 +186,11 @@
launcherWidgetSpanInfo;
CellLayout firstScreen = mRootView.findViewById(R.id.workspace);
- firstScreen.setPadding(mDp.workspacePadding.left + mDp.cellLayoutPaddingPx.left,
+ firstScreen.setPadding(
+ mDp.workspacePadding.left + mDp.cellLayoutPaddingPx.left,
mDp.workspacePadding.top + mDp.cellLayoutPaddingPx.top,
- (mDp.isTwoPanels ? mDp.cellLayoutBorderSpacePx.x / 2
- : mDp.workspacePadding.right) + mDp.cellLayoutPaddingPx.right,
+ mDp.isTwoPanels ? (mDp.cellLayoutBorderSpacePx.x / 2)
+ : (mDp.workspacePadding.right + mDp.cellLayoutPaddingPx.right),
mDp.workspacePadding.bottom + mDp.cellLayoutPaddingPx.bottom
);
mWorkspaceScreens.put(FIRST_SCREEN_ID, firstScreen);
@@ -232,7 +198,7 @@
if (mDp.isTwoPanels) {
CellLayout rightPanel = mRootView.findViewById(R.id.workspace_right);
rightPanel.setPadding(
- mDp.cellLayoutBorderSpacePx.x / 2 + mDp.cellLayoutPaddingPx.left,
+ mDp.cellLayoutBorderSpacePx.x / 2,
mDp.workspacePadding.top + mDp.cellLayoutPaddingPx.top,
mDp.workspacePadding.right + mDp.cellLayoutPaddingPx.right,
mDp.workspacePadding.bottom + mDp.cellLayoutPaddingPx.bottom
@@ -409,15 +375,6 @@
getApplicationContext(), providerInfo));
}
- private void inflateAndAddWidgets(LauncherAppWidgetInfo info, WidgetsModel widgetsModel) {
- WidgetItem widgetItem = widgetsModel.getWidgetProviderInfoByProviderName(
- info.providerName, info.user, mContext);
- if (widgetItem == null) {
- return;
- }
- inflateAndAddWidgets(info, widgetItem.widgetInfo);
- }
-
private void inflateAndAddWidgets(
LauncherAppWidgetInfo info, LauncherAppWidgetProviderInfo providerInfo) {
AppWidgetHostView view = mAppWidgetHost.createView(
@@ -501,17 +458,22 @@
break;
}
}
+ Map<ComponentKey, AppWidgetProviderInfo> widgetsMap = widgetProviderInfoMap;
for (ItemInfo itemInfo : currentAppWidgets) {
switch (itemInfo.itemType) {
case Favorites.ITEM_TYPE_APPWIDGET:
case Favorites.ITEM_TYPE_CUSTOM_APPWIDGET:
- if (widgetProviderInfoMap != null) {
- inflateAndAddWidgets(
- (LauncherAppWidgetInfo) itemInfo, widgetProviderInfoMap);
- } else {
- inflateAndAddWidgets((LauncherAppWidgetInfo) itemInfo,
- dataModel.widgetsModel);
+ if (widgetsMap == null) {
+ widgetsMap = dataModel.widgetsModel.getWidgetsByComponentKey()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue().widgetInfo != null)
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ entry -> entry.getValue().widgetInfo
+ ));
}
+ inflateAndAddWidgets((LauncherAppWidgetInfo) itemInfo, widgetsMap);
break;
default:
break;
@@ -541,6 +503,7 @@
&& !SHOULD_SHOW_FIRST_PAGE_WIDGET) {
CellLayout firstScreen = mWorkspaceScreens.get(FIRST_SCREEN_ID);
View qsb = mHomeElementInflater.inflate(R.layout.qsb_preview, firstScreen, false);
+ // TODO: set bgHandler on qsb when it is BaseTemplateCard, which requires API changes.
CellLayoutLayoutParams lp = new CellLayoutLayoutParams(
0, 0, firstScreen.getCountX(), 1);
lp.canReorder = false;
diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java
index 329f717..44e448e 100644
--- a/src/com/android/launcher3/icons/IconCache.java
+++ b/src/com/android/launcher3/icons/IconCache.java
@@ -57,6 +57,7 @@
import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic;
import com.android.launcher3.icons.cache.BaseIconCache;
import com.android.launcher3.icons.cache.CachingLogic;
+import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.IconRequestInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
@@ -373,8 +374,13 @@
infoInOut.user, activityInfoProvider, mLauncherActivityInfoCachingLogic,
usePkgIcon, useLowResIcon);
applyPackageEntry(packageEntry, infoInOut, entry);
- } else {
+ } else if (useLowResIcon || !entry.bitmap.isNullOrLowRes()
+ || infoInOut.bitmap.isNullOrLowRes()) {
+ // Only use cache entry if it will not downgrade the current bitmap in infoInOut
applyCacheEntry(entry, infoInOut);
+ } else {
+ Log.d(TAG, "getTitleAndIcon: Cache entry bitmap was a downgrade of existing bitmap"
+ + " in ItemInfo. Skipping.");
}
}
@@ -636,4 +642,10 @@
void reapplyItemInfo(ItemInfoWithIcon info);
}
+
+ /** Log persistently to FileLog.d for debugging. */
+ @Override
+ protected void logdPersistently(String tag, String message, @Nullable Exception e) {
+ FileLog.d(tag, message, e);
+ }
}
diff --git a/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java b/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
index 406f697..de2269c 100644
--- a/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
+++ b/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
@@ -18,10 +18,12 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.LauncherActivityInfo;
+import android.os.Build;
import android.os.UserHandle;
import androidx.annotation.NonNull;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.icons.BaseIconFactory.IconOptions;
@@ -64,9 +66,16 @@
@Override
public BitmapInfo loadIcon(@NonNull Context context, @NonNull LauncherActivityInfo object) {
try (LauncherIcons li = LauncherIcons.obtain(context)) {
- return li.createBadgedIconBitmap(LauncherAppState.getInstance(context)
- .getIconProvider().getIcon(object, li.mFillResIconDpi),
- new IconOptions().setUser(object.getUser()));
+ IconOptions iconOptions = new IconOptions().setUser(object.getUser());
+ iconOptions.mIsArchived = Flags.useNewIconForArchivedApps()
+ && Build.VERSION.SDK_INT >= 35
+ && object.getActivityInfo().isArchived;
+ return li.createBadgedIconBitmap(
+ LauncherAppState.getInstance(context)
+ .getIconProvider()
+ .getIcon(object, li.mFillResIconDpi),
+ iconOptions
+ );
}
}
}
diff --git a/src/com/android/launcher3/icons/LauncherIcons.java b/src/com/android/launcher3/icons/LauncherIcons.java
index 7331c6f..884d448 100644
--- a/src/com/android/launcher3/icons/LauncherIcons.java
+++ b/src/com/android/launcher3/icons/LauncherIcons.java
@@ -17,6 +17,7 @@
package com.android.launcher3.icons;
import android.content.Context;
+import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
@@ -25,83 +26,57 @@
import com.android.launcher3.Flags;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.graphics.IconShape;
-import com.android.launcher3.graphics.LauncherPreviewRenderer;
import com.android.launcher3.pm.UserCache;
+import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.UserIconInfo;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
/**
* Wrapper class to provide access to {@link BaseIconFactory} and also to provide pool of this class
* that are threadsafe.
*/
public class LauncherIcons extends BaseIconFactory implements AutoCloseable {
- private static final Object sPoolSync = new Object();
- private static LauncherIcons sPool;
- private static int sPoolId = 0;
+ private static final MainThreadInitializedObject<Pool> POOL =
+ new MainThreadInitializedObject<>(Pool::new);
/**
* Return a new Message instance from the global pool. Allows us to
* avoid allocating new objects in many cases.
*/
public static LauncherIcons obtain(Context context) {
- if (context instanceof LauncherPreviewRenderer.PreviewContext) {
- return ((LauncherPreviewRenderer.PreviewContext) context).newLauncherIcons(context);
- }
-
- int poolId;
- synchronized (sPoolSync) {
- if (sPool != null) {
- LauncherIcons m = sPool;
- sPool = m.next;
- m.next = null;
- return m;
- }
- poolId = sPoolId;
- }
-
- InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(context);
- return new LauncherIcons(context, idp.fillResIconDpi, idp.iconBitmapSize, poolId);
+ return POOL.get(context).obtain();
}
- public static void clearPool() {
- synchronized (sPoolSync) {
- sPool = null;
- sPoolId++;
- }
+ public static void clearPool(Context context) {
+ POOL.get(context).close();
}
- private final int mPoolId;
-
- private LauncherIcons next;
+ private final ConcurrentLinkedQueue<LauncherIcons> mPool;
private MonochromeIconFactory mMonochromeIconFactory;
- protected LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize, int poolId) {
+ protected LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize,
+ ConcurrentLinkedQueue<LauncherIcons> pool) {
super(context, fillResIconDpi, iconBitmapSize,
IconShape.INSTANCE.get(context).getShape().enableShapeDetection());
mMonoIconEnabled = Themes.isThemedIconEnabled(context);
- mPoolId = poolId;
+ mPool = pool;
}
/**
* Recycles a LauncherIcons that may be in-use.
*/
public void recycle() {
- synchronized (sPoolSync) {
- if (sPoolId != mPoolId) {
- return;
- }
- // Clear any temporary state variables
- clear();
-
- next = sPool;
- sPool = this;
- }
+ clear();
+ mPool.add(this);
}
@Override
- protected Drawable getMonochromeDrawable(Drawable base) {
+ protected Drawable getMonochromeDrawable(AdaptiveIconDrawable base) {
Drawable mono = super.getMonochromeDrawable(base);
if (mono != null || !Flags.forceMonochromeAppIcons()) {
return mono;
@@ -122,4 +97,33 @@
public void close() {
recycle();
}
+
+ private static class Pool implements SafeCloseable {
+
+ private final Context mContext;
+
+ @NonNull
+ private ConcurrentLinkedQueue<LauncherIcons> mPool = new ConcurrentLinkedQueue<>();
+
+ private Pool(Context context) {
+ mContext = context;
+ }
+
+ public LauncherIcons obtain() {
+ ConcurrentLinkedQueue<LauncherIcons> pool = mPool;
+ LauncherIcons m = pool.poll();
+
+ if (m == null) {
+ InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(mContext);
+ return new LauncherIcons(mContext, idp.fillResIconDpi, idp.iconBitmapSize, pool);
+ } else {
+ return m;
+ }
+ }
+
+ @Override
+ public void close() {
+ mPool = new ConcurrentLinkedQueue<>();
+ }
+ }
}
diff --git a/src/com/android/launcher3/icons/MonochromeIconFactory.java b/src/com/android/launcher3/icons/MonochromeIconFactory.java
index 511dcc7..2854d51 100644
--- a/src/com/android/launcher3/icons/MonochromeIconFactory.java
+++ b/src/com/android/launcher3/icons/MonochromeIconFactory.java
@@ -100,20 +100,12 @@
* Creates a monochrome version of the provided drawable
*/
@WorkerThread
- public Drawable wrap(Drawable icon) {
- if (icon instanceof AdaptiveIconDrawable) {
- AdaptiveIconDrawable aid = (AdaptiveIconDrawable) icon;
- mFlatCanvas.drawColor(Color.BLACK);
- drawDrawable(aid.getBackground());
- drawDrawable(aid.getForeground());
- generateMono();
- return new ClippedMonoDrawable(this);
- } else {
- mFlatCanvas.drawColor(Color.WHITE);
- drawDrawable(icon);
- generateMono();
- return this;
- }
+ public Drawable wrap(AdaptiveIconDrawable icon) {
+ mFlatCanvas.drawColor(Color.BLACK);
+ drawDrawable(icon.getBackground());
+ drawDrawable(icon.getForeground());
+ generateMono();
+ return new ClippedMonoDrawable(this);
}
@WorkerThread
diff --git a/src/com/android/launcher3/keyboard/ItemFocusIndicatorHelper.java b/src/com/android/launcher3/keyboard/ItemFocusIndicatorHelper.java
index 480e8f3..ec0efe0 100644
--- a/src/com/android/launcher3/keyboard/ItemFocusIndicatorHelper.java
+++ b/src/com/android/launcher3/keyboard/ItemFocusIndicatorHelper.java
@@ -199,6 +199,10 @@
}
protected void changeFocus(T item, boolean hasFocus) {
+ if (mLastFocusedItem != item && !hasFocus) {
+ return;
+ }
+
if (hasFocus) {
endCurrentAnimation();
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index 441bbb5..fbd24d8 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -769,7 +769,34 @@
LAUNCHER_PRIVATE_SPACE_USER_INSTALLED_APPS_COUNT(1672),
@UiEvent(doc = "Number of preinstalled Private profile apps, shown under separator line")
- LAUNCHER_PRIVATE_SPACE_PREINSTALLED_APPS_COUNT(1673)
+ LAUNCHER_PRIVATE_SPACE_PREINSTALLED_APPS_COUNT(1673),
+
+ @UiEvent(doc = "Private space lock animation started")
+ LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_BEGIN(1725),
+
+ @UiEvent(doc = "Private space lock animation finished")
+ LAUNCHER_PRIVATE_SPACE_LOCK_ANIMATION_END(1726),
+
+ @UiEvent(doc = "Private space unlock animation started")
+ LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_BEGIN(1727),
+
+ @UiEvent(doc = "Private space unlock animation finished")
+ LAUNCHER_PRIVATE_SPACE_UNLOCK_ANIMATION_END(1728),
+
+ @UiEvent(doc = "User rotates whilst in Overview / RecentsView")
+ LAUNCHER_OVERVIEW_ORIENTATION_CHANGED(1762),
+
+ @UiEvent(doc = "User launches Overview from 3 button navigation")
+ LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_3_BUTTON(1763),
+
+ @UiEvent(doc = "User launches Overview from alt+tab keyboard quick switch")
+ LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_QUICK_SWITCH(1764),
+
+ @UiEvent(doc = "User launches Overview from meta+tab keyboard shortcut")
+ LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_SHORTCUT(1765),
+
+ @UiEvent(doc = "User long pressed on the taskbar IME switcher button")
+ LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS(1798),
// ADD MORE
;
@@ -1205,7 +1232,7 @@
* Creates a new instance of {@link StatsLogManager} based on provided context.
*/
public static StatsLogManager newInstance(Context context) {
- return Overrides.getObject(StatsLogManager.class,
- context.getApplicationContext(), R.string.stats_log_manager_class);
+ return Overrides.getObject(
+ StatsLogManager.class, context, R.string.stats_log_manager_class);
}
}
diff --git a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
index 3fa6da4..427fb97 100644
--- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
+++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
@@ -26,9 +26,10 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel.CallbackTask;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.icons.IconCache;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.data.AppInfo;
@@ -50,7 +51,7 @@
/**
* Task to add auto-created workspace items.
*/
-public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
+public class AddWorkspaceItemsTask implements ModelUpdateTask {
private static final String LOG = "AddWorkspaceItemsTask";
@@ -77,16 +78,17 @@
mItemSpaceFinder = itemSpaceFinder;
}
+
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
if (mItemList.isEmpty()) {
return;
}
final ArrayList<ItemInfo> addedItemsFinal = new ArrayList<>();
final IntArray addedWorkspaceScreensFinal = new IntArray();
- final Context context = app.getContext();
+ final Context context = taskController.getApp().getContext();
synchronized (dataModel) {
IntArray workspaceScreens = dataModel.collectWorkspaceScreens();
@@ -128,8 +130,8 @@
for (ItemInfo item : filteredItems) {
// Find appropriate space for the item.
- int[] coords = mItemSpaceFinder.findSpaceForItem(app, dataModel, workspaceScreens,
- addedWorkspaceScreensFinal, item.spanX, item.spanY);
+ int[] coords = mItemSpaceFinder.findSpaceForItem(taskController.getApp(), dataModel,
+ workspaceScreens, addedWorkspaceScreensFinal, item.spanX, item.spanY);
int screenId = coords[0];
ItemInfo itemInfo;
@@ -176,8 +178,8 @@
if (hasActivity) {
// App was installed while launcher was in the background,
// or app was already installed for another user.
- itemInfo = new AppInfo(app.getContext(), activities.get(0), item.user)
- .makeWorkspaceItem(app.getContext());
+ itemInfo = new AppInfo(context, activities.get(0), item.user)
+ .makeWorkspaceItem(context);
if (shortcutExists(dataModel, itemInfo.getIntent(), itemInfo.user)) {
// We need this additional check here since we treat all auto added
@@ -187,16 +189,17 @@
continue;
}
+ IconCache cache = taskController.getApp().getIconCache();
WorkspaceItemInfo wii = (WorkspaceItemInfo) itemInfo;
wii.title = "";
- wii.bitmap = app.getIconCache().getDefaultIcon(item.user);
- app.getIconCache().getTitleAndIcon(wii,
+ wii.bitmap = cache.getDefaultIcon(item.user);
+ cache.getTitleAndIcon(wii,
((WorkspaceItemInfo) itemInfo).usingLowResIcon());
}
}
// Add the shortcut to the db
- getModelWriter().addItemToDatabase(itemInfo,
+ taskController.getModelWriter().addItemToDatabase(itemInfo,
LauncherSettings.Favorites.CONTAINER_DESKTOP, screenId,
coords[1], coords[2]);
@@ -209,7 +212,7 @@
}
if (!addedItemsFinal.isEmpty()) {
- scheduleCallbackTask(new CallbackTask() {
+ taskController.scheduleCallbackTask(new CallbackTask() {
@Override
public void execute(@NonNull Callbacks callbacks) {
final ArrayList<ItemInfo> addAnimated = new ArrayList<>();
diff --git a/src/com/android/launcher3/model/AllAppsList.java b/src/com/android/launcher3/model/AllAppsList.java
index 39c1243..64ebbf3 100644
--- a/src/com/android/launcher3/model/AllAppsList.java
+++ b/src/com/android/launcher3/model/AllAppsList.java
@@ -60,7 +60,7 @@
private static final String TAG = "AllAppsList";
private static final Consumer<AppInfo> NO_OP_CONSUMER = a -> { };
-
+ private static final boolean DEBUG = true;
public static final int DEFAULT_APPLICATIONS_NUMBER = 42;
@@ -220,6 +220,11 @@
updatedAppInfos.add(appInfo);
} else if (installInfo.state == PackageInstallInfo.STATUS_FAILED
&& !appInfo.isAppStartable()) {
+ if (DEBUG) {
+ Log.w(TAG, "updatePromiseInstallInfo: removing app due to install"
+ + " failure and appInfo not startable."
+ + " package=" + appInfo.getTargetPackage());
+ }
removeApp(i);
}
}
@@ -301,6 +306,7 @@
Context context, String packageName, UserHandle user) {
final ApiWrapper apiWrapper = ApiWrapper.INSTANCE.get(context);
final UserCache userCache = UserCache.getInstance(context);
+ final PackageManagerHelper pmHelper = PackageManagerHelper.INSTANCE.get(context);
final List<LauncherActivityInfo> matches = context.getSystemService(LauncherApps.class)
.getActivityList(packageName, user);
if (matches.size() > 0) {
@@ -311,7 +317,10 @@
if (user.equals(applicationInfo.user)
&& packageName.equals(applicationInfo.componentName.getPackageName())) {
if (!findActivity(matches, applicationInfo.componentName)) {
- Log.w(TAG, "Changing shortcut target due to app component name change.");
+ if (DEBUG) {
+ Log.w(TAG, "Changing shortcut target due to app component name change."
+ + " package=" + packageName);
+ }
removeApp(i);
}
}
@@ -330,12 +339,16 @@
applicationInfo.sectionName = mIndex.computeSectionName(applicationInfo.title);
applicationInfo.intent = launchIntent;
AppInfo.updateRuntimeFlagsForActivityTarget(applicationInfo, info,
- userCache.getUserInfo(user), apiWrapper);
+ userCache.getUserInfo(user), apiWrapper, pmHelper);
mDataChanged = true;
}
}
} else {
// Remove all data for this package.
+ if (DEBUG) {
+ Log.w(TAG, "updatePromiseInstallInfo: no Activities matched updated package,"
+ + " removing all apps from package=" + packageName);
+ }
for (int i = data.size() - 1; i >= 0; i--) {
final AppInfo applicationInfo = data.get(i);
if (user.equals(applicationInfo.user)
diff --git a/src/com/android/launcher3/model/BaseLauncherBinder.java b/src/com/android/launcher3/model/BaseLauncherBinder.java
index e6ade61..5faa2b8 100644
--- a/src/com/android/launcher3/model/BaseLauncherBinder.java
+++ b/src/com/android/launcher3/model/BaseLauncherBinder.java
@@ -52,6 +52,7 @@
import com.android.launcher3.util.LooperIdleLock;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.RunnableList;
+import com.android.launcher3.widget.model.WidgetsListBaseEntriesBuilder;
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
import java.util.ArrayList;
@@ -195,8 +196,8 @@
if (!WIDGETS_ENABLED) {
return;
}
- final List<WidgetsListBaseEntry> widgets =
- mBgDataModel.widgetsModel.getWidgetsListForPicker(mApp.getContext());
+ List<WidgetsListBaseEntry> widgets = new WidgetsListBaseEntriesBuilder(mApp.getContext())
+ .build(mBgDataModel.widgetsModel.getWidgetsByPackageItem());
executeCallbacksTask(c -> c.bindAllWidgets(widgets), mUiExecutor);
}
diff --git a/src/com/android/launcher3/model/BaseModelUpdateTask.java b/src/com/android/launcher3/model/BaseModelUpdateTask.java
deleted file mode 100644
index 529c30a..0000000
--- a/src/com/android/launcher3/model/BaseModelUpdateTask.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.model;
-
-import android.util.Log;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.LauncherModel;
-import com.android.launcher3.LauncherModel.CallbackTask;
-import com.android.launcher3.LauncherModel.ModelUpdateTask;
-import com.android.launcher3.celllayout.CellPosMapper;
-import com.android.launcher3.model.BgDataModel.Callbacks;
-import com.android.launcher3.model.BgDataModel.FixedContainerItems;
-import com.android.launcher3.model.data.AppInfo;
-import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.PackageUserKey;
-import com.android.launcher3.widget.model.WidgetsListBaseEntry;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.Executor;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-/**
- * Extension of {@link ModelUpdateTask} with some utility methods
- */
-public abstract class BaseModelUpdateTask implements ModelUpdateTask {
-
- private static final boolean DEBUG_TASKS = false;
- private static final String TAG = "BaseModelUpdateTask";
-
- // Nullabilities are explicitly omitted here because these are late-init fields,
- // They will be non-null after init(), which is always the case in enqueueModelUpdateTask().
- private LauncherAppState mApp;
- private LauncherModel mModel;
- private BgDataModel mDataModel;
- private AllAppsList mAllAppsList;
- private Executor mUiExecutor;
-
- public void init(@NonNull final LauncherAppState app, @NonNull final LauncherModel model,
- @NonNull final BgDataModel dataModel, @NonNull final AllAppsList allAppsList,
- @NonNull final Executor uiExecutor) {
- mApp = app;
- mModel = model;
- mDataModel = dataModel;
- mAllAppsList = allAppsList;
- mUiExecutor = uiExecutor;
- }
-
- @Override
- public final void run() {
- boolean isModelLoaded = Objects.requireNonNull(mModel).isModelLoaded();
- if (!isModelLoaded) {
- if (DEBUG_TASKS) {
- Log.d(TAG, "Ignoring model task since loader is pending=" + this);
- }
- // Loader has not yet run.
- return;
- }
- execute(mApp, mDataModel, mAllAppsList);
- }
-
- /**
- * Execute the actual task. Called on the worker thread.
- */
- public abstract void execute(@NonNull LauncherAppState app,
- @NonNull BgDataModel dataModel, @NonNull AllAppsList apps);
-
- /**
- * Schedules a {@param task} to be executed on the current callbacks.
- */
- public final void scheduleCallbackTask(@NonNull final CallbackTask task) {
- for (final Callbacks cb : mModel.getCallbacks()) {
- mUiExecutor.execute(() -> task.execute(cb));
- }
- }
-
- public ModelWriter getModelWriter() {
- // Updates from model task, do not deal with icon position in hotseat. Also no need to
- // verify changes as the ModelTasks always push the changes to callbacks
- return mModel.getWriter(false /* verifyChanges */, CellPosMapper.DEFAULT, null);
- }
-
- public void bindUpdatedWorkspaceItems(@NonNull final List<WorkspaceItemInfo> allUpdates) {
- // Bind workspace items
- List<WorkspaceItemInfo> workspaceUpdates = allUpdates.stream()
- .filter(info -> info.id != ItemInfo.NO_ID)
- .collect(Collectors.toList());
- if (!workspaceUpdates.isEmpty()) {
- scheduleCallbackTask(c -> c.bindWorkspaceItemsChanged(workspaceUpdates));
- }
-
- // Bind extra items if any
- allUpdates.stream()
- .mapToInt(info -> info.container)
- .distinct()
- .mapToObj(mDataModel.extraItems::get)
- .filter(Objects::nonNull)
- .forEach(this::bindExtraContainerItems);
- }
-
- public void bindExtraContainerItems(@NonNull final FixedContainerItems item) {
- scheduleCallbackTask(c -> c.bindExtraContainerItems(item));
- }
-
- public void bindDeepShortcuts(@NonNull final BgDataModel dataModel) {
- final HashMap<ComponentKey, Integer> shortcutMapCopy =
- new HashMap<>(dataModel.deepShortcutMap);
- scheduleCallbackTask(callbacks -> callbacks.bindDeepShortcutMap(shortcutMapCopy));
- }
-
- public void bindUpdatedWidgets(@NonNull final BgDataModel dataModel) {
- final ArrayList<WidgetsListBaseEntry> widgets =
- dataModel.widgetsModel.getWidgetsListForPicker(mApp.getContext());
- scheduleCallbackTask(c -> c.bindAllWidgets(widgets));
- }
-
- public void deleteAndBindComponentsRemoved(final Predicate<ItemInfo> matcher,
- @Nullable final String reason) {
- getModelWriter().deleteItemsFromDatabase(matcher, reason);
-
- // Call the components-removed callback
- scheduleCallbackTask(c -> c.bindWorkspaceComponentsRemoved(matcher));
- }
-
- public void bindApplicationsIfNeeded() {
- if (mAllAppsList.getAndResetChangeFlag()) {
- AppInfo[] apps = mAllAppsList.copyData();
- int flags = mAllAppsList.getFlags();
- Map<PackageUserKey, Integer> packageUserKeytoUidMap = Arrays.stream(apps).collect(
- Collectors.toMap(
- appInfo -> new PackageUserKey(appInfo.componentName.getPackageName(),
- appInfo.user), appInfo -> appInfo.uid, (a, b) -> a));
- scheduleCallbackTask(c -> c.bindAllApplications(apps, flags, packageUserKeytoUidMap));
- }
- }
-}
diff --git a/src/com/android/launcher3/model/CacheDataUpdatedTask.java b/src/com/android/launcher3/model/CacheDataUpdatedTask.java
index 57fefaa..66b4fd9 100644
--- a/src/com/android/launcher3/model/CacheDataUpdatedTask.java
+++ b/src/com/android/launcher3/model/CacheDataUpdatedTask.java
@@ -20,7 +20,7 @@
import androidx.annotation.NonNull;
-import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -31,7 +31,7 @@
/**
* Handles changes due to cache updates.
*/
-public class CacheDataUpdatedTask extends BaseModelUpdateTask {
+public class CacheDataUpdatedTask implements ModelUpdateTask {
public static final int OP_CACHE_UPDATE = 1;
public static final int OP_SESSION_UPDATE = 2;
@@ -52,9 +52,9 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
- IconCache iconCache = app.getIconCache();
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
+ IconCache iconCache = taskController.getApp().getIconCache();
ArrayList<WorkspaceItemInfo> updatedShortcuts = new ArrayList<>();
synchronized (dataModel) {
@@ -69,8 +69,8 @@
});
apps.updateIconsAndLabels(mPackages, mUser);
}
- bindUpdatedWorkspaceItems(updatedShortcuts);
- bindApplicationsIfNeeded();
+ taskController.bindUpdatedWorkspaceItems(updatedShortcuts);
+ taskController.bindApplicationsIfNeeded();
}
public boolean isValidShortcut(@NonNull final WorkspaceItemInfo si) {
diff --git a/src/com/android/launcher3/model/DatabaseHelper.java b/src/com/android/launcher3/model/DatabaseHelper.java
index 132b606..8368256 100644
--- a/src/com/android/launcher3/model/DatabaseHelper.java
+++ b/src/com/android/launcher3/model/DatabaseHelper.java
@@ -505,7 +505,7 @@
public int loadFavorites(SQLiteDatabase db, AutoInstallsLayout loader) {
// TODO: Use multiple loaders with fall-back and transaction.
- int count = loader.loadLayout(db, new IntArray());
+ int count = loader.loadLayout(db);
// Ensure that the max ids are initialized
mMaxItemId = initializeMaxItemId(db);
diff --git a/src/com/android/launcher3/model/FirstScreenBroadcast.java b/src/com/android/launcher3/model/FirstScreenBroadcast.java
index cc20cd1..f443f81 100644
--- a/src/com/android/launcher3/model/FirstScreenBroadcast.java
+++ b/src/com/android/launcher3/model/FirstScreenBroadcast.java
@@ -96,7 +96,7 @@
.collect(groupingBy(SessionInfo::getInstallerPackageName,
mapping(SessionInfo::getAppPackageName, Collectors.toSet())))
.forEach((installer, packages) ->
- sendBroadcastToInstaller(context, installer, packages, firstScreenItems));
+ sendBroadcastToInstaller(context, installer, packages, firstScreenItems));
}
/**
diff --git a/src/com/android/launcher3/model/FirstScreenBroadcastHelper.kt b/src/com/android/launcher3/model/FirstScreenBroadcastHelper.kt
new file mode 100644
index 0000000..aa62c32
--- /dev/null
+++ b/src/com/android/launcher3/model/FirstScreenBroadcastHelper.kt
@@ -0,0 +1,387 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.model
+
+import android.app.PendingIntent
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageInstaller.SessionInfo
+import android.os.Process
+import android.util.Log
+import androidx.annotation.AnyThread
+import androidx.annotation.VisibleForTesting
+import androidx.annotation.WorkerThread
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.model.data.CollectionInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.pm.InstallSessionHelper
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.PackageManagerHelper
+import com.android.launcher3.util.PackageUserKey
+
+/**
+ * Helper class to send broadcasts to package installers that have:
+ * - Pending Items on first screen
+ * - Installed/Archived Items on first screen
+ * - Installed/Archived Widgets on every screen
+ *
+ * The packages are broken down by: folder items, workspace items, hotseat items, and widgets.
+ * Package installers only receive data for items that they are installing or have installed.
+ */
+object FirstScreenBroadcastHelper {
+ @VisibleForTesting const val MAX_BROADCAST_SIZE = 70
+
+ private const val TAG = "FirstScreenBroadcastHelper"
+ private const val DEBUG = true
+ private const val ACTION_FIRST_SCREEN_ACTIVE_INSTALLS =
+ "com.android.launcher3.action.FIRST_SCREEN_ACTIVE_INSTALLS"
+ // String retained as "folderItem" for back-compatibility reasons.
+ private const val PENDING_COLLECTION_ITEM_EXTRA = "folderItem"
+ private const val PENDING_WORKSPACE_ITEM_EXTRA = "workspaceItem"
+ private const val PENDING_HOTSEAT_ITEM_EXTRA = "hotseatItem"
+ private const val PENDING_WIDGET_ITEM_EXTRA = "widgetItem"
+ // Extras containing all installed items, including Archived Apps.
+ private const val INSTALLED_WORKSPACE_ITEMS_EXTRA = "workspaceInstalledItems"
+ private const val INSTALLED_HOTSEAT_ITEMS_EXTRA = "hotseatInstalledItems"
+ // This includes installed widgets on all screens, not just first.
+ private const val ALL_INSTALLED_WIDGETS_ITEM_EXTRA = "widgetInstalledItems"
+ private const val VERIFICATION_TOKEN_EXTRA = "verificationToken"
+
+ /**
+ * Return list of [FirstScreenBroadcastModel] for each installer and their
+ * installing/installed/archived items. If the FirstScreenBroadcastModel data is greater in size
+ * than [MAX_BROADCAST_SIZE], then we will truncate the data until it meets the size limit to
+ * avoid overloading the broadcast.
+ *
+ * @param packageManagerHelper helper for querying PackageManager
+ * @param firstScreenItems every ItemInfo on first screen
+ * @param userKeyToSessionMap map of pending SessionInfo's for installing items
+ * @param allWidgets list of all Widgets added to every screen
+ */
+ @WorkerThread
+ @JvmStatic
+ fun createModelsForFirstScreenBroadcast(
+ packageManagerHelper: PackageManagerHelper,
+ firstScreenItems: List<ItemInfo>,
+ userKeyToSessionMap: Map<PackageUserKey, SessionInfo>,
+ allWidgets: List<LauncherAppWidgetInfo>
+ ): List<FirstScreenBroadcastModel> {
+
+ // installers for installing items
+ val pendingItemInstallerMap: Map<String, MutableSet<String>> =
+ createPendingItemsMap(userKeyToSessionMap)
+ val installingPackages = pendingItemInstallerMap.values.flatten().toSet()
+
+ // installers for installed items on first screen
+ val installedItemInstallerMap: Map<String, MutableSet<ItemInfo>> =
+ createInstalledItemsMap(firstScreenItems, installingPackages, packageManagerHelper)
+
+ // installers for widgets on all screens
+ val allInstalledWidgetsMap: Map<String, MutableSet<LauncherAppWidgetInfo>> =
+ createAllInstalledWidgetsMap(allWidgets, installingPackages, packageManagerHelper)
+
+ val allInstallers: Set<String> =
+ pendingItemInstallerMap.keys +
+ installedItemInstallerMap.keys +
+ allInstalledWidgetsMap.keys
+ val models = mutableListOf<FirstScreenBroadcastModel>()
+ // create broadcast for each installer, with extras for each item category
+ allInstallers.forEach { installer ->
+ val installingItems = pendingItemInstallerMap[installer]
+ val broadcastModel =
+ FirstScreenBroadcastModel(installerPackage = installer).apply {
+ addPendingItems(installingItems, firstScreenItems)
+ addInstalledItems(installer, installedItemInstallerMap)
+ addAllScreenWidgets(installer, allInstalledWidgetsMap)
+ }
+ broadcastModel.truncateModelForBroadcast()
+ models.add(broadcastModel)
+ }
+ return models
+ }
+
+ /** From the model data, create Intents to send broadcasts and fire them. */
+ @WorkerThread
+ @JvmStatic
+ fun sendBroadcastsForModels(context: Context, models: List<FirstScreenBroadcastModel>) {
+ for (model in models) {
+ model.printDebugInfo()
+ val intent =
+ Intent(ACTION_FIRST_SCREEN_ACTIVE_INSTALLS)
+ .setPackage(model.installerPackage)
+ .putExtra(
+ VERIFICATION_TOKEN_EXTRA,
+ PendingIntent.getActivity(
+ context,
+ 0 /* requestCode */,
+ Intent(),
+ PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE
+ )
+ )
+ .putStringArrayListExtra(
+ PENDING_COLLECTION_ITEM_EXTRA,
+ ArrayList(model.pendingCollectionItems)
+ )
+ .putStringArrayListExtra(
+ PENDING_WORKSPACE_ITEM_EXTRA,
+ ArrayList(model.pendingWorkspaceItems)
+ )
+ .putStringArrayListExtra(
+ PENDING_HOTSEAT_ITEM_EXTRA,
+ ArrayList(model.pendingHotseatItems)
+ )
+ .putStringArrayListExtra(
+ PENDING_WIDGET_ITEM_EXTRA,
+ ArrayList(model.pendingWidgetItems)
+ )
+ .putStringArrayListExtra(
+ INSTALLED_WORKSPACE_ITEMS_EXTRA,
+ ArrayList(model.installedWorkspaceItems)
+ )
+ .putStringArrayListExtra(
+ INSTALLED_HOTSEAT_ITEMS_EXTRA,
+ ArrayList(model.installedHotseatItems)
+ )
+ .putStringArrayListExtra(
+ ALL_INSTALLED_WIDGETS_ITEM_EXTRA,
+ ArrayList(
+ model.firstScreenInstalledWidgets +
+ model.secondaryScreenInstalledWidgets
+ )
+ )
+ context.sendBroadcast(intent)
+ }
+ }
+
+ /** Maps Installer packages to Set of app packages from install sessions */
+ private fun createPendingItemsMap(
+ userKeyToSessionMap: Map<PackageUserKey, SessionInfo>
+ ): Map<String, MutableSet<String>> {
+ val myUser = Process.myUserHandle()
+ val result = mutableMapOf<String, MutableSet<String>>()
+ userKeyToSessionMap.forEach { entry ->
+ if (!myUser.equals(InstallSessionHelper.getUserHandle(entry.value))) return@forEach
+ val installer = entry.value.installerPackageName
+ val appPackage = entry.value.appPackageName
+ if (installer.isNullOrEmpty() || appPackage.isNullOrEmpty()) return@forEach
+ result.getOrPut(installer) { mutableSetOf() }.add(appPackage)
+ }
+ return result
+ }
+
+ /**
+ * Maps Installer packages to Set of ItemInfo from first screen. Filter out installing packages.
+ */
+ private fun createInstalledItemsMap(
+ firstScreenItems: List<ItemInfo>,
+ installingPackages: Set<String>,
+ packageManagerHelper: PackageManagerHelper
+ ): Map<String, MutableSet<ItemInfo>> {
+ val result = mutableMapOf<String, MutableSet<ItemInfo>>()
+ firstScreenItems.forEach { item ->
+ val appPackage = getPackageName(item) ?: return@forEach
+ if (installingPackages.contains(appPackage)) return@forEach
+ val installer = packageManagerHelper.getAppInstallerPackage(appPackage)
+ if (installer.isNullOrEmpty()) return@forEach
+ result.getOrPut(installer) { mutableSetOf() }.add(item)
+ }
+ return result
+ }
+
+ /**
+ * Maps Installer packages to Set of AppWidget packages installed on all screens. Filter out
+ * installing packages.
+ */
+ private fun createAllInstalledWidgetsMap(
+ allWidgets: List<LauncherAppWidgetInfo>,
+ installingPackages: Set<String>,
+ packageManagerHelper: PackageManagerHelper
+ ): Map<String, MutableSet<LauncherAppWidgetInfo>> {
+ val result = mutableMapOf<String, MutableSet<LauncherAppWidgetInfo>>()
+ allWidgets
+ .sortedBy { widget -> widget.screenId }
+ .forEach { widget ->
+ val appPackage = getPackageName(widget) ?: return@forEach
+ if (installingPackages.contains(appPackage)) return@forEach
+ val installer = packageManagerHelper.getAppInstallerPackage(appPackage)
+ if (installer.isNullOrEmpty()) return@forEach
+ result.getOrPut(installer) { mutableSetOf() }.add(widget)
+ }
+ return result
+ }
+
+ /**
+ * Add first screen Pending Items from Map to [FirstScreenBroadcastModel] for given installer
+ */
+ private fun FirstScreenBroadcastModel.addPendingItems(
+ installingItems: Set<String>?,
+ firstScreenItems: List<ItemInfo>
+ ) {
+ if (installingItems == null) return
+ for (info in firstScreenItems) {
+ addCollectionItems(info, installingItems)
+ val packageName = getPackageName(info) ?: continue
+ if (!installingItems.contains(packageName)) continue
+ when {
+ info is LauncherAppWidgetInfo -> pendingWidgetItems.add(packageName)
+ info.container == CONTAINER_HOTSEAT -> pendingHotseatItems.add(packageName)
+ info.container == CONTAINER_DESKTOP -> pendingWorkspaceItems.add(packageName)
+ }
+ }
+ }
+
+ /**
+ * Add first screen installed Items from Map to [FirstScreenBroadcastModel] for given installer
+ */
+ private fun FirstScreenBroadcastModel.addInstalledItems(
+ installer: String,
+ installedItemInstallerMap: Map<String, Set<ItemInfo>>,
+ ) {
+ installedItemInstallerMap[installer]?.forEach { info ->
+ val packageName: String = getPackageName(info) ?: return@forEach
+ when (info.container) {
+ CONTAINER_HOTSEAT -> installedHotseatItems.add(packageName)
+ CONTAINER_DESKTOP -> installedWorkspaceItems.add(packageName)
+ }
+ }
+ }
+
+ /** Add Widgets on every screen from Map to [FirstScreenBroadcastModel] for given installer */
+ private fun FirstScreenBroadcastModel.addAllScreenWidgets(
+ installer: String,
+ allInstalledWidgetsMap: Map<String, Set<LauncherAppWidgetInfo>>
+ ) {
+ allInstalledWidgetsMap[installer]?.forEach { widget ->
+ val packageName: String = getPackageName(widget) ?: return@forEach
+ if (widget.screenId == 0) {
+ firstScreenInstalledWidgets.add(packageName)
+ } else {
+ secondaryScreenInstalledWidgets.add(packageName)
+ }
+ }
+ }
+
+ private fun FirstScreenBroadcastModel.addCollectionItems(
+ info: ItemInfo,
+ installingPackages: Set<String>
+ ) {
+ if (info !is CollectionInfo) return
+ pendingCollectionItems.addAll(
+ cloneOnMainThread(info.getAppContents())
+ .mapNotNull { getPackageName(it) }
+ .filter { installingPackages.contains(it) }
+ )
+ }
+
+ /**
+ * Creates a copy of [FirstScreenBroadcastModel] with items truncated to meet
+ * [MAX_BROADCAST_SIZE] in a prioritized order.
+ */
+ @VisibleForTesting
+ fun FirstScreenBroadcastModel.truncateModelForBroadcast() {
+ val totalItemCount = getTotalItemCount()
+ if (totalItemCount <= MAX_BROADCAST_SIZE) return
+ var extraItemCount = totalItemCount - MAX_BROADCAST_SIZE
+
+ while (extraItemCount > 0) {
+ // In this order, remove items until we meet the max size limit.
+ when {
+ pendingCollectionItems.isNotEmpty() ->
+ pendingCollectionItems.apply { remove(last()) }
+ pendingHotseatItems.isNotEmpty() -> pendingHotseatItems.apply { remove(last()) }
+ installedHotseatItems.isNotEmpty() -> installedHotseatItems.apply { remove(last()) }
+ secondaryScreenInstalledWidgets.isNotEmpty() ->
+ secondaryScreenInstalledWidgets.apply { remove(last()) }
+ pendingWidgetItems.isNotEmpty() -> pendingWidgetItems.apply { remove(last()) }
+ firstScreenInstalledWidgets.isNotEmpty() ->
+ firstScreenInstalledWidgets.apply { remove(last()) }
+ pendingWorkspaceItems.isNotEmpty() -> pendingWorkspaceItems.apply { remove(last()) }
+ installedWorkspaceItems.isNotEmpty() ->
+ installedWorkspaceItems.apply { remove(last()) }
+ }
+ extraItemCount--
+ }
+ }
+
+ /** Returns count of all Items held by [FirstScreenBroadcastModel]. */
+ @VisibleForTesting
+ fun FirstScreenBroadcastModel.getTotalItemCount() =
+ pendingCollectionItems.size +
+ pendingWorkspaceItems.size +
+ pendingHotseatItems.size +
+ pendingWidgetItems.size +
+ installedWorkspaceItems.size +
+ installedHotseatItems.size +
+ firstScreenInstalledWidgets.size +
+ secondaryScreenInstalledWidgets.size
+
+ private fun FirstScreenBroadcastModel.printDebugInfo() {
+ if (DEBUG) {
+ Log.d(
+ TAG,
+ "Sending First Screen Broadcast for installer=$installerPackage" +
+ ", total packages=${getTotalItemCount()}"
+ )
+ pendingCollectionItems.forEach {
+ Log.d(TAG, "$installerPackage:Pending Collection item:$it")
+ }
+ pendingWorkspaceItems.forEach {
+ Log.d(TAG, "$installerPackage:Pending Workspace item:$it")
+ }
+ pendingHotseatItems.forEach { Log.d(TAG, "$installerPackage:Pending Hotseat item:$it") }
+ pendingWidgetItems.forEach { Log.d(TAG, "$installerPackage:Pending Widget item:$it") }
+ installedWorkspaceItems.forEach {
+ Log.d(TAG, "$installerPackage:Installed Workspace item:$it")
+ }
+ installedHotseatItems.forEach {
+ Log.d(TAG, "$installerPackage:Installed Hotseat item:$it")
+ }
+ firstScreenInstalledWidgets.forEach {
+ Log.d(TAG, "$installerPackage:Installed Widget item (first screen):$it")
+ }
+ secondaryScreenInstalledWidgets.forEach {
+ Log.d(TAG, "$installerPackage:Installed Widget item (secondary screens):$it")
+ }
+ }
+ }
+
+ private fun getPackageName(info: ItemInfo): String? {
+ var packageName: String? = null
+ if (info is LauncherAppWidgetInfo) {
+ info.providerName?.let { packageName = info.providerName.packageName }
+ } else if (info.targetComponent != null) {
+ packageName = info.targetComponent?.packageName
+ }
+ return packageName
+ }
+
+ /**
+ * Clone the provided list on UI thread. This is used for [FolderInfo.getContents] which is
+ * always modified on UI thread.
+ */
+ @AnyThread
+ private fun cloneOnMainThread(list: ArrayList<WorkspaceItemInfo>): List<WorkspaceItemInfo> {
+ return try {
+ return Executors.MAIN_EXECUTOR.submit<ArrayList<WorkspaceItemInfo>> { ArrayList(list) }
+ .get()
+ } catch (e: Exception) {
+ emptyList()
+ }
+ }
+}
diff --git a/src/com/android/launcher3/model/FirstScreenBroadcastModel.kt b/src/com/android/launcher3/model/FirstScreenBroadcastModel.kt
new file mode 100644
index 0000000..ba5c526
--- /dev/null
+++ b/src/com/android/launcher3/model/FirstScreenBroadcastModel.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+/** Data model for the information used for [FirstScreenBroadcastHelper] Broadcast Extras */
+data class FirstScreenBroadcastModel(
+ // Package name of the installer for all items
+ val installerPackage: String,
+ // Installing items in Folders
+ val pendingCollectionItems: MutableSet<String> = mutableSetOf(),
+ // Installing items on first screen
+ val pendingWorkspaceItems: MutableSet<String> = mutableSetOf(),
+ // Installing items on hotseat
+ val pendingHotseatItems: MutableSet<String> = mutableSetOf(),
+ // Installing widgets on first screen
+ val pendingWidgetItems: MutableSet<String> = mutableSetOf(),
+ // Installed/Archived Items on first screen
+ val installedWorkspaceItems: MutableSet<String> = mutableSetOf(),
+ // Installed/Archived items on hotseat
+ val installedHotseatItems: MutableSet<String> = mutableSetOf(),
+ // Installed/Archived Widgets on first screen
+ val firstScreenInstalledWidgets: MutableSet<String> = mutableSetOf(),
+ // Installed Archived Widgets on secondary screens
+ val secondaryScreenInstalledWidgets: MutableSet<String> = mutableSetOf()
+)
diff --git a/src/com/android/launcher3/model/GridSizeMigrationUtil.java b/src/com/android/launcher3/model/GridSizeMigrationUtil.java
index ad32fc2..f54fc57 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationUtil.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationUtil.java
@@ -213,9 +213,13 @@
Collections.sort(hotseatToBeAdded);
Collections.sort(workspaceToBeAdded);
+ List<Integer> idsInUse = dstWorkspaceItems.stream().map(entry -> entry.id).collect(
+ Collectors.toList());
+ idsInUse.addAll(dstHotseatItems.stream().map(entry -> entry.id).toList());
+
// Migrate hotseat
solveHotseatPlacement(helper, destHotseatSize,
- srcReader, destReader, dstHotseatItems, hotseatToBeAdded);
+ srcReader, destReader, dstHotseatItems, hotseatToBeAdded, idsInUse);
// Migrate workspace.
// First we create a collection of the screens
@@ -230,7 +234,7 @@
Log.d(TAG, "Migrating " + screenId);
}
solveGridPlacement(helper, srcReader,
- destReader, screenId, trgX, trgY, workspaceToBeAdded);
+ destReader, screenId, trgX, trgY, workspaceToBeAdded, idsInUse);
if (workspaceToBeAdded.isEmpty()) {
break;
}
@@ -241,7 +245,7 @@
int screenId = destReader.mLastScreenId + 1;
while (!workspaceToBeAdded.isEmpty()) {
solveGridPlacement(helper, srcReader, destReader, screenId, trgX, trgY,
- workspaceToBeAdded);
+ workspaceToBeAdded, srcWorkspaceItems.stream().map(entry -> entry.id).toList());
screenId++;
}
@@ -257,47 +261,57 @@
private static void calcDiff(@NonNull final List<DbEntry> src,
@NonNull final List<DbEntry> dest, @NonNull final List<DbEntry> toBeAdded,
@NonNull final IntArray toBeRemoved) {
+ HashMap<DbEntry, Integer> entryCountDiff = new HashMap<>();
+ src.forEach(entry ->
+ entryCountDiff.put(entry, entryCountDiff.getOrDefault(entry, 0) + 1));
+ dest.forEach(entry ->
+ entryCountDiff.put(entry, entryCountDiff.getOrDefault(entry, 0) - 1));
+
src.forEach(entry -> {
- if (!dest.contains(entry)) {
+ if (entryCountDiff.get(entry) > 0) {
toBeAdded.add(entry);
+ entryCountDiff.put(entry, entryCountDiff.get(entry) - 1);
}
});
+
dest.forEach(entry -> {
- if (!src.contains(entry)) {
+ if (entryCountDiff.get(entry) < 0) {
toBeRemoved.add(entry.id);
if (entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
entry.mFolderItems.values().forEach(ids -> ids.forEach(toBeRemoved::add));
}
+ entryCountDiff.put(entry, entryCountDiff.get(entry) + 1);
}
});
}
private static void insertEntryInDb(DatabaseHelper helper, DbEntry entry,
- String srcTableName, String destTableName) {
- int id = copyEntryAndUpdate(helper, entry, srcTableName, destTableName);
-
+ String srcTableName, String destTableName, List<Integer> idsInUse) {
+ int id = copyEntryAndUpdate(helper, entry, srcTableName, destTableName, idsInUse);
if (entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER
|| entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR) {
for (Set<Integer> itemIds : entry.mFolderItems.values()) {
for (int itemId : itemIds) {
- copyEntryAndUpdate(helper, itemId, id, srcTableName, destTableName);
+ copyEntryAndUpdate(helper, itemId, id, srcTableName, destTableName, idsInUse);
}
}
}
}
private static int copyEntryAndUpdate(DatabaseHelper helper,
- DbEntry entry, String srcTableName, String destTableName) {
- return copyEntryAndUpdate(helper, entry, -1, -1, srcTableName, destTableName);
+ DbEntry entry, String srcTableName, String destTableName, List<Integer> idsInUse) {
+ return copyEntryAndUpdate(
+ helper, entry, -1, -1, srcTableName, destTableName, idsInUse);
}
- private static int copyEntryAndUpdate(DatabaseHelper helper,
- int id, int folderId, String srcTableName, String destTableName) {
- return copyEntryAndUpdate(helper, null, id, folderId, srcTableName, destTableName);
+ private static int copyEntryAndUpdate(DatabaseHelper helper, int id,
+ int folderId, String srcTableName, String destTableName, List<Integer> idsInUse) {
+ return copyEntryAndUpdate(
+ helper, null, id, folderId, srcTableName, destTableName, idsInUse);
}
- private static int copyEntryAndUpdate(DatabaseHelper helper, DbEntry entry,
- int id, int folderId, String srcTableName, String destTableName) {
+ private static int copyEntryAndUpdate(DatabaseHelper helper, DbEntry entry, int id,
+ int folderId, String srcTableName, String destTableName, List<Integer> idsInUse) {
int newId = -1;
Cursor c = helper.getWritableDatabase().query(srcTableName, null,
LauncherSettings.Favorites._ID + " = '" + (entry != null ? entry.id : id) + "'",
@@ -311,6 +325,9 @@
values.put(LauncherSettings.Favorites.CONTAINER, folderId);
}
newId = helper.generateNewItemId();
+ while (idsInUse.contains(newId)) {
+ newId = helper.generateNewItemId();
+ }
values.put(LauncherSettings.Favorites._ID, newId);
helper.getWritableDatabase().insert(destTableName, null, values);
}
@@ -343,7 +360,7 @@
private static void solveGridPlacement(@NonNull final DatabaseHelper helper,
@NonNull final DbReader srcReader, @NonNull final DbReader destReader,
final int screenId, final int trgX, final int trgY,
- @NonNull final List<DbEntry> sortedItemsToPlace) {
+ @NonNull final List<DbEntry> sortedItemsToPlace, List<Integer> idsInUse) {
final GridOccupancy occupied = new GridOccupancy(trgX, trgY);
final Point trg = new Point(trgX, trgY);
final Point next = new Point(0, screenId == 0
@@ -366,7 +383,8 @@
continue;
}
if (findPlacementForEntry(entry, next, trg, occupied, screenId)) {
- insertEntryInDb(helper, entry, srcReader.mTableName, destReader.mTableName);
+ insertEntryInDb(
+ helper, entry, srcReader.mTableName, destReader.mTableName, idsInUse);
iterator.remove();
}
}
@@ -407,7 +425,7 @@
@NonNull final DatabaseHelper helper, final int hotseatSize,
@NonNull final DbReader srcReader, @NonNull final DbReader destReader,
@NonNull final List<DbEntry> placedHotseatItems,
- @NonNull final List<DbEntry> itemsToPlace) {
+ @NonNull final List<DbEntry> itemsToPlace, List<Integer> idsInUse) {
final boolean[] occupied = new boolean[hotseatSize];
for (DbEntry entry : placedHotseatItems) {
@@ -422,7 +440,8 @@
// to something other than -1.
entry.cellX = i;
entry.cellY = 0;
- insertEntryInDb(helper, entry, srcReader.mTableName, destReader.mTableName);
+ insertEntryInDb(
+ helper, entry, srcReader.mTableName, destReader.mTableName, idsInUse);
occupied[entry.screenId] = true;
}
}
@@ -564,12 +583,12 @@
}
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET: {
entry.mProvider = c.getString(indexAppWidgetProvider);
+ entry.appWidgetId = c.getInt(indexAppWidgetId);
ComponentName cn = ComponentName.unflattenFromString(entry.mProvider);
verifyPackage(cn.getPackageName());
- int widgetId = c.getInt(indexAppWidgetId);
LauncherAppWidgetProviderInfo pInfo = widgetManagerHelper
- .getLauncherAppWidgetInfo(widgetId, cn);
+ .getLauncherAppWidgetInfo(entry.appWidgetId, cn);
Point spans = null;
if (pInfo != null) {
spans = pInfo.getMinSpans();
diff --git a/src/com/android/launcher3/model/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java
index 551c2d8..59d1d00 100644
--- a/src/com/android/launcher3/model/ItemInstallQueue.java
+++ b/src/com/android/launcher3/model/ItemInstallQueue.java
@@ -192,22 +192,18 @@
}
private void queuePendingShortcutInfo(PendingInstallShortcutInfo info) {
- final Exception stackTrace = new Exception();
// Queue the item up for adding if launcher has not loaded properly yet
MODEL_EXECUTOR.post(() -> {
Pair<ItemInfo, Object> itemInfo = info.getItemInfo(mContext);
if (itemInfo == null) {
FileLog.d(LOG,
- "Adding PendingInstallShortcutInfo with no attached info to queue.",
- stackTrace);
+ "Adding PendingInstallShortcutInfo with no attached info to queue.");
} else {
FileLog.d(LOG,
- "Adding PendingInstallShortcutInfo to queue. Attached info: "
- + itemInfo.first,
- stackTrace);
+ "Adding PendingInstallShortcutInfo to queue."
+ + " Attached info: " + itemInfo.first);
}
-
addToQueue(info);
});
flushInstallQueue();
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 0875974..84130c7 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -57,6 +57,7 @@
import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSparseArrayMap;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.UserIconInfo;
import java.net.URISyntaxException;
@@ -73,6 +74,7 @@
private final LauncherAppState mApp;
private final Context mContext;
+ private final PackageManagerHelper mPmHelper;
private final IconCache mIconCache;
private final InvariantDeviceProfile mIDP;
private final @Nullable LauncherRestoreEventLogger mRestoreEventLogger;
@@ -114,6 +116,7 @@
public int restoreFlag;
public LoaderCursor(Cursor cursor, LauncherAppState app, UserManagerState userManagerState,
+ PackageManagerHelper pmHelper,
@Nullable LauncherRestoreEventLogger restoreEventLogger) {
super(cursor);
@@ -121,6 +124,7 @@
allUsers = userManagerState.allUsers;
mContext = app.getContext();
mIconCache = app.getIconCache();
+ mPmHelper = pmHelper;
mIDP = app.getInvariantDeviceProfile();
mRestoreEventLogger = restoreEventLogger;
@@ -368,7 +372,7 @@
if (mActivityInfo != null) {
AppInfo.updateRuntimeFlagsForActivityTarget(info, mActivityInfo, userIconInfo,
- ApiWrapper.INSTANCE.get(mContext));
+ ApiWrapper.INSTANCE.get(mContext), mPmHelper);
}
// from the db
diff --git a/src/com/android/launcher3/model/LoaderTask.java b/src/com/android/launcher3/model/LoaderTask.java
index 876bed4..605accf 100644
--- a/src/com/android/launcher3/model/LoaderTask.java
+++ b/src/com/android/launcher3/model/LoaderTask.java
@@ -47,6 +47,7 @@
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
+import android.provider.Settings;
import android.util.ArrayMap;
import android.util.Log;
import android.util.LongSparseArray;
@@ -195,17 +196,35 @@
}
private void sendFirstScreenActiveInstallsBroadcast() {
- ArrayList<ItemInfo> firstScreenItems = new ArrayList<>();
- ArrayList<ItemInfo> allItems = mBgDataModel.getAllWorkspaceItems();
-
// Screen set is never empty
IntArray allScreens = mBgDataModel.collectWorkspaceScreens();
final int firstScreen = allScreens.get(0);
IntSet firstScreens = IntSet.wrap(firstScreen);
+ ArrayList<ItemInfo> allItems = mBgDataModel.getAllWorkspaceItems();
+ ArrayList<ItemInfo> firstScreenItems = new ArrayList<>();
filterCurrentWorkspaceItems(firstScreens, allItems, firstScreenItems,
new ArrayList<>() /* otherScreenItems are ignored */);
- mFirstScreenBroadcast.sendBroadcasts(mApp.getContext(), firstScreenItems);
+ final int launcherBroadcastInstalledApps = Settings.Secure.getInt(
+ mApp.getContext().getContentResolver(),
+ "launcher_broadcast_installed_apps",
+ /* def= */ 0);
+ boolean shouldAttachArchivingExtras = mIsRestoreFromBackup
+ && (launcherBroadcastInstalledApps == 1
+ || Flags.enableFirstScreenBroadcastArchivingExtras());
+ if (shouldAttachArchivingExtras) {
+ List<FirstScreenBroadcastModel> broadcastModels =
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ mPmHelper,
+ firstScreenItems,
+ mInstallingPkgsCached,
+ mBgDataModel.appWidgets
+ );
+ logASplit("Sending first screen broadcast with additional archiving Extras");
+ FirstScreenBroadcastHelper.sendBroadcastsForModels(mApp.getContext(), broadcastModels);
+ } else {
+ mFirstScreenBroadcast.sendBroadcasts(mApp.getContext(), firstScreenItems);
+ }
}
public void run() {
@@ -249,7 +268,7 @@
mModelDelegate.workspaceLoadComplete();
// Notify the installer packages of packages with active installs on the first screen.
sendFirstScreenActiveInstallsBroadcast();
- logASplit("sendFirstScreenActiveInstallsBroadcast");
+ logASplit("sendFirstScreenBroadcast");
// Take a break
waitForIdle();
@@ -435,7 +454,8 @@
mShortcutKeyToPinnedShortcuts = new HashMap<>();
final LoaderCursor c = new LoaderCursor(
dbController.query(TABLE_NAME, null, selection, null, null),
- mApp, mUserManagerState, mIsRestoreFromBackup ? restoreEventLogger : null);
+ mApp, mUserManagerState, mPmHelper,
+ mIsRestoreFromBackup ? restoreEventLogger : null);
final Bundle extras = c.getExtras();
mDbName = extras == null ? null : extras.getString(ModelDbController.EXTRA_DB_NAME);
try {
@@ -551,7 +571,7 @@
private void processFolderItems() {
// Sort the folder items, update ranks, and make sure all preview items are high res.
List<FolderGridOrganizer> verifiers = mApp.getInvariantDeviceProfile().supportedProfiles
- .stream().map(FolderGridOrganizer::new).toList();
+ .stream().map(FolderGridOrganizer::createFolderGridOrganizer).toList();
for (CollectionInfo collection : mBgDataModel.collections) {
if (!(collection instanceof FolderInfo folder)) {
continue;
@@ -697,7 +717,7 @@
for (int i = 0; i < apps.size(); i++) {
LauncherActivityInfo app = apps.get(i);
AppInfo appInfo = new AppInfo(app, mUserCache.getUserInfo(user),
- ApiWrapper.INSTANCE.get(mApp.getContext()), quietMode);
+ ApiWrapper.INSTANCE.get(mApp.getContext()), mPmHelper, quietMode);
if (Flags.enableSupportForArchiving() && app.getApplicationInfo().isArchived) {
// For archived apps, include progress info in case there is a pending
// install session post restart of device.
diff --git a/src/com/android/launcher3/model/ModelDbController.java b/src/com/android/launcher3/model/ModelDbController.java
index 7e1d40d..da1a221 100644
--- a/src/com/android/launcher3/model/ModelDbController.java
+++ b/src/com/android/launcher3/model/ModelDbController.java
@@ -83,6 +83,7 @@
import org.xmlpull.v1.XmlPullParser;
+import java.io.File;
import java.io.InputStream;
import java.io.StringReader;
@@ -104,10 +105,30 @@
mContext = context;
}
+ private void printDBs(String prefix) {
+ try {
+ File directory = new File(
+ mContext.getDatabasePath(InvariantDeviceProfile.INSTANCE.get(mContext).dbFile)
+ .getParent()
+ );
+ if (directory.exists()) {
+ for (File file : directory.listFiles()) {
+ Log.d("b/353505773", prefix + "Database file: " + file.getName());
+ }
+ } else {
+ Log.d("b/353505773", prefix + "No files found in the database directory");
+ }
+ } catch (Exception e) {
+ Log.e("b/353505773", prefix + e.getMessage());
+ }
+ }
+
private synchronized void createDbIfNotExists() {
if (mOpenHelper == null) {
mOpenHelper = createDatabaseHelper(false /* forMigration */);
+ printDBs("before: ");
RestoreDbTask.restoreIfNeeded(mContext, this);
+ printDBs("after: ");
}
}
diff --git a/src/com/android/launcher3/model/ModelDelegate.java b/src/com/android/launcher3/model/ModelDelegate.java
index 8360b14..2264d35 100644
--- a/src/com/android/launcher3/model/ModelDelegate.java
+++ b/src/com/android/launcher3/model/ModelDelegate.java
@@ -26,6 +26,7 @@
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.shortcuts.ShortcutKey;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.ResourceBasedOverride;
import java.io.FileDescriptor;
@@ -41,15 +42,16 @@
* Creates and initializes a new instance of the delegate
*/
public static ModelDelegate newInstance(
- Context context, LauncherAppState app, AllAppsList appsList, BgDataModel dataModel,
- boolean isPrimaryInstance) {
+ Context context, LauncherAppState app, PackageManagerHelper pmHelper,
+ AllAppsList appsList, BgDataModel dataModel, boolean isPrimaryInstance) {
ModelDelegate delegate = Overrides.getObject(
ModelDelegate.class, context, R.string.model_delegate_class);
- delegate.init(app, appsList, dataModel, isPrimaryInstance);
+ delegate.init(app, pmHelper, appsList, dataModel, isPrimaryInstance);
return delegate;
}
protected final Context mContext;
+ protected PackageManagerHelper mPmHelper;
protected LauncherAppState mApp;
protected AllAppsList mAppsList;
protected BgDataModel mDataModel;
@@ -62,9 +64,10 @@
/**
* Initializes the object with the given params.
*/
- private void init(LauncherAppState app, AllAppsList appsList,
+ private void init(LauncherAppState app, PackageManagerHelper pmHelper, AllAppsList appsList,
BgDataModel dataModel, boolean isPrimaryInstance) {
this.mApp = app;
+ this.mPmHelper = pmHelper;
this.mAppsList = appsList;
this.mDataModel = dataModel;
this.mIsPrimaryInstance = isPrimaryInstance;
diff --git a/src/com/android/launcher3/model/ModelLauncherCallbacks.kt b/src/com/android/launcher3/model/ModelLauncherCallbacks.kt
index b12b2bc..2ee5b80 100644
--- a/src/com/android/launcher3/model/ModelLauncherCallbacks.kt
+++ b/src/com/android/launcher3/model/ModelLauncherCallbacks.kt
@@ -38,6 +38,7 @@
LauncherApps.Callback() {
override fun onPackageAdded(packageName: String, user: UserHandle) {
+ FileLog.d(TAG, "onPackageAdded triggered for packageName=$packageName, user=$user")
taskExecutor.accept(PackageUpdatedTask(OP_ADD, user, packageName))
}
@@ -54,7 +55,7 @@
}
override fun onPackageRemoved(packageName: String, user: UserHandle) {
- FileLog.d(TAG, "package removed received $packageName")
+ FileLog.d(TAG, "onPackageRemoved triggered for packageName=$packageName, user=$user")
taskExecutor.accept(PackageUpdatedTask(OP_REMOVE, user, packageName))
}
diff --git a/src/com/android/launcher3/model/ModelTaskController.kt b/src/com/android/launcher3/model/ModelTaskController.kt
new file mode 100644
index 0000000..cf2cadc
--- /dev/null
+++ b/src/com/android/launcher3/model/ModelTaskController.kt
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherModel
+import com.android.launcher3.LauncherModel.CallbackTask
+import com.android.launcher3.celllayout.CellPosMapper
+import com.android.launcher3.model.BgDataModel.FixedContainerItems
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.widget.model.WidgetsListBaseEntriesBuilder
+import java.util.Objects
+import java.util.concurrent.Executor
+import java.util.function.Predicate
+
+/** Class with utility methods and properties for running a LauncherModel Task */
+class ModelTaskController(
+ val app: LauncherAppState,
+ val dataModel: BgDataModel,
+ val allAppsList: AllAppsList,
+ private val model: LauncherModel,
+ private val uiExecutor: Executor
+) {
+
+ /** Schedules a {@param task} to be executed on the current callbacks. */
+ fun scheduleCallbackTask(task: CallbackTask) {
+ for (cb in model.callbacks) {
+ uiExecutor.execute { task.execute(cb) }
+ }
+ }
+
+ /**
+ * Updates from model task, do not deal with icon position in hotseat. Also no need to verify
+ * changes as the ModelTasks always push the changes to callbacks
+ */
+ fun getModelWriter() = model.getWriter(false /* verifyChanges */, CellPosMapper.DEFAULT, null)
+
+ fun bindUpdatedWorkspaceItems(allUpdates: List<WorkspaceItemInfo>) {
+ // Bind workspace items
+ val workspaceUpdates =
+ allUpdates.stream().filter { info -> info.id != ItemInfo.NO_ID }.toList()
+ if (workspaceUpdates.isNotEmpty()) {
+ scheduleCallbackTask { it.bindWorkspaceItemsChanged(workspaceUpdates) }
+ }
+
+ // Bind extra items if any
+ allUpdates
+ .stream()
+ .mapToInt { info: WorkspaceItemInfo -> info.container }
+ .distinct()
+ .mapToObj { dataModel.extraItems.get(it) }
+ .filter { Objects.nonNull(it) }
+ .forEach { bindExtraContainerItems(it) }
+ }
+
+ fun bindExtraContainerItems(item: FixedContainerItems) {
+ scheduleCallbackTask { it.bindExtraContainerItems(item) }
+ }
+
+ fun bindDeepShortcuts(dataModel: BgDataModel) {
+ val shortcutMapCopy = HashMap(dataModel.deepShortcutMap)
+ scheduleCallbackTask { it.bindDeepShortcutMap(shortcutMapCopy) }
+ }
+
+ fun bindUpdatedWidgets(dataModel: BgDataModel) {
+ val widgets =
+ WidgetsListBaseEntriesBuilder(app.context)
+ .build(dataModel.widgetsModel.widgetsByPackageItem)
+ scheduleCallbackTask { it.bindAllWidgets(widgets) }
+ }
+
+ fun deleteAndBindComponentsRemoved(matcher: Predicate<ItemInfo?>, reason: String?) {
+ getModelWriter().deleteItemsFromDatabase(matcher, reason)
+
+ // Call the components-removed callback
+ scheduleCallbackTask { it.bindWorkspaceComponentsRemoved(matcher) }
+ }
+
+ fun bindApplicationsIfNeeded() {
+ if (allAppsList.getAndResetChangeFlag()) {
+ val apps = allAppsList.copyData()
+ val flags = allAppsList.flags
+ val packageUserKeyToUidMap =
+ apps.associateBy(
+ keySelector = { PackageUserKey(it.componentName!!.packageName, it.user) },
+ valueTransform = { it.uid }
+ )
+ scheduleCallbackTask { it.bindAllApplications(apps, flags, packageUserKeyToUidMap) }
+ }
+ }
+}
diff --git a/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java b/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
index b9fba9d..f924a9f 100644
--- a/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
@@ -19,7 +19,7 @@
import androidx.annotation.NonNull;
-import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -31,7 +31,7 @@
/**
* Handles updates due to incremental download progress updates.
*/
-public class PackageIncrementalDownloadUpdatedTask extends BaseModelUpdateTask {
+public class PackageIncrementalDownloadUpdatedTask implements ModelUpdateTask {
@NonNull
private final UserHandle mUser;
@@ -49,8 +49,8 @@
}
@Override
- public void execute(@NonNull LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList appsList) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList appsList) {
PackageInstallInfo downloadInfo = new PackageInstallInfo(
mPackageName,
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING,
@@ -62,11 +62,11 @@
if (!updatedAppInfos.isEmpty()) {
for (AppInfo appInfo : updatedAppInfos) {
appInfo.runtimeStatusFlags &= ~ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE;
- scheduleCallbackTask(
+ taskController.scheduleCallbackTask(
c -> c.bindIncrementalDownloadProgressUpdated(appInfo));
}
}
- bindApplicationsIfNeeded();
+ taskController.bindApplicationsIfNeeded();
}
final ArrayList<WorkspaceItemInfo> updatedWorkspaceItems = new ArrayList<>();
@@ -79,6 +79,6 @@
}
});
}
- bindUpdatedWorkspaceItems(updatedWorkspaceItems);
+ taskController.bindUpdatedWorkspaceItems(updatedWorkspaceItems);
}
}
diff --git a/src/com/android/launcher3/model/PackageInstallStateChangedTask.java b/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
index 2457a42..d238213 100644
--- a/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
+++ b/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
@@ -15,12 +15,13 @@
*/
package com.android.launcher3.model;
+import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import androidx.annotation.NonNull;
-import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
@@ -33,7 +34,7 @@
/**
* Handles changes due to a sessions updates for a currently installing app.
*/
-public class PackageInstallStateChangedTask extends BaseModelUpdateTask {
+public class PackageInstallStateChangedTask implements ModelUpdateTask {
@NonNull
private final PackageInstallInfo mInstallInfo;
@@ -43,16 +44,17 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
if (mInstallInfo.state == PackageInstallInfo.STATUS_INSTALLED) {
try {
// For instant apps we do not get package-add. Use setting events to update
// any pinned icons.
- ApplicationInfo ai = app.getContext()
+ Context context = taskController.getApp().getContext();
+ ApplicationInfo ai = context
.getPackageManager().getApplicationInfo(mInstallInfo.packageName, 0);
- if (InstantAppResolver.newInstance(app.getContext()).isInstantApp(ai)) {
- app.getModel().newModelCallbacks()
+ if (InstantAppResolver.newInstance(context).isInstantApp(ai)) {
+ taskController.getApp().getModel().newModelCallbacks()
.onPackageAdded(ai.packageName, mInstallInfo.user);
}
} catch (PackageManager.NameNotFoundException e) {
@@ -66,10 +68,11 @@
List<AppInfo> updatedAppInfos = apps.updatePromiseInstallInfo(mInstallInfo);
if (!updatedAppInfos.isEmpty()) {
for (AppInfo appInfo : updatedAppInfos) {
- scheduleCallbackTask(c -> c.bindIncrementalDownloadProgressUpdated(appInfo));
+ taskController.scheduleCallbackTask(
+ c -> c.bindIncrementalDownloadProgressUpdated(appInfo));
}
}
- bindApplicationsIfNeeded();
+ taskController.bindApplicationsIfNeeded();
}
synchronized (dataModel) {
@@ -90,7 +93,8 @@
}
if (!updates.isEmpty()) {
- scheduleCallbackTask(callbacks -> callbacks.bindRestoreItemsChange(updates));
+ taskController.scheduleCallbackTask(
+ callbacks -> callbacks.bindRestoreItemsChange(updates));
}
}
}
diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java
index 6432d33..2febb22 100644
--- a/src/com/android/launcher3/model/PackageUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageUpdatedTask.java
@@ -36,9 +36,9 @@
import com.android.launcher3.Flags;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
-import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.logging.FileLog;
@@ -71,11 +71,11 @@
* or when a user availability changes.
*/
@SuppressWarnings("NewApi")
-public class PackageUpdatedTask extends BaseModelUpdateTask {
+public class PackageUpdatedTask implements ModelUpdateTask {
// TODO(b/290090023): Set to false after root causing is done.
- private static final boolean DEBUG = true;
private static final String TAG = "PackageUpdatedTask";
+ private static final boolean DEBUG = true;
public static final int OP_NONE = 0;
public static final int OP_ADD = 1;
@@ -102,13 +102,14 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList appsList) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList appsList) {
+ final LauncherAppState app = taskController.getApp();
final Context context = app.getContext();
final IconCache iconCache = app.getIconCache();
final String[] packages = mPackages;
- final int N = packages.length;
+ final int packageCount = packages.length;
final FlagOp flagOp;
final HashSet<String> packageSet = new HashSet<>(Arrays.asList(packages));
final Predicate<ItemInfo> matcher = mOp == OP_USER_AVAILABILITY_CHANGE
@@ -116,44 +117,55 @@
: ItemInfoMatcher.ofPackages(packageSet, mUser);
final HashSet<ComponentName> removedComponents = new HashSet<>();
final HashMap<String, List<LauncherActivityInfo>> activitiesLists = new HashMap<>();
-
+ if (DEBUG) {
+ Log.d(TAG, "Package updated: mOp=" + getOpString()
+ + " packages=" + Arrays.toString(packages));
+ }
switch (mOp) {
case OP_ADD: {
- for (int i = 0; i < N; i++) {
- if (DEBUG) Log.d(TAG, "mAllAppsList.addPackage " + packages[i]);
+ for (int i = 0; i < packageCount; i++) {
iconCache.updateIconsForPkg(packages[i], mUser);
if (FeatureFlags.PROMISE_APPS_IN_ALL_APPS.get()) {
+ if (DEBUG) {
+ Log.d(TAG, "OP_ADD: PROMISE_APPS_IN_ALL_APPS enabled:"
+ + " removing promise icon apps from package=" + packages[i]);
+ }
appsList.removePackage(packages[i], mUser);
}
- activitiesLists.put(
- packages[i], appsList.addPackage(context, packages[i], mUser));
+ activitiesLists.put(packages[i],
+ appsList.addPackage(context, packages[i], mUser));
}
flagOp = FlagOp.NO_OP.removeFlag(WorkspaceItemInfo.FLAG_DISABLED_NOT_AVAILABLE);
break;
}
case OP_UPDATE:
- try (SafeCloseable t =
- appsList.trackRemoves(a -> removedComponents.add(a.componentName))) {
- for (int i = 0; i < N; i++) {
- if (DEBUG) Log.d(TAG, "mAllAppsList.updatePackage " + packages[i]);
+ try (SafeCloseable t = appsList.trackRemoves(a -> {
+ Log.d(TAG, "OP_UPDATE - AllAppsList.trackRemoves callback:"
+ + " removed component=" + a.componentName
+ + " id=" + a.id
+ + " Look for earlier AllAppsList logs to find more information.");
+ removedComponents.add(a.componentName);
+ })) {
+ for (int i = 0; i < packageCount; i++) {
iconCache.updateIconsForPkg(packages[i], mUser);
- activitiesLists.put(
- packages[i], appsList.updatePackage(context, packages[i], mUser));
+ activitiesLists.put(packages[i],
+ appsList.updatePackage(context, packages[i], mUser));
}
}
// Since package was just updated, the target must be available now.
flagOp = FlagOp.NO_OP.removeFlag(WorkspaceItemInfo.FLAG_DISABLED_NOT_AVAILABLE);
break;
case OP_REMOVE: {
- for (int i = 0; i < N; i++) {
- FileLog.d(TAG, "Removing app icon: " + packages[i]);
+ for (int i = 0; i < packageCount; i++) {
iconCache.removeIconsForPkg(packages[i], mUser);
}
// Fall through
}
case OP_UNAVAILABLE:
- for (int i = 0; i < N; i++) {
- if (DEBUG) Log.d(TAG, "mAllAppsList.removePackage " + packages[i]);
+ for (int i = 0; i < packageCount; i++) {
+ if (DEBUG) {
+ Log.d(TAG, getOpString() + ": removing package=" + packages[i]);
+ }
appsList.removePackage(packages[i], mUser);
}
flagOp = FlagOp.NO_OP.addFlag(WorkspaceItemInfo.FLAG_DISABLED_NOT_AVAILABLE);
@@ -162,7 +174,6 @@
case OP_UNSUSPEND:
flagOp = FlagOp.NO_OP.setFlag(
WorkspaceItemInfo.FLAG_DISABLED_SUSPENDED, mOp == OP_SUSPEND);
- if (DEBUG) Log.d(TAG, "mAllAppsList.(un)suspend " + N);
appsList.updateDisabledFlags(matcher, flagOp);
break;
case OP_USER_AVAILABILITY_CHANGE: {
@@ -192,7 +203,7 @@
break;
}
- bindApplicationsIfNeeded();
+ taskController.bindApplicationsIfNeeded();
final IntSet removedShortcuts = new IntSet();
// Shortcuts to keep even if the corresponding app was removed
@@ -206,61 +217,84 @@
// For system apps, package manager send OP_UPDATE when an app is enabled.
final boolean isNewApkAvailable = mOp == OP_ADD || mOp == OP_UPDATE;
synchronized (dataModel) {
- dataModel.forAllWorkspaceItemInfos(mUser, si -> {
+ dataModel.forAllWorkspaceItemInfos(mUser, itemInfo -> {
boolean infoUpdated = false;
boolean shortcutUpdated = false;
- ComponentName cn = si.getTargetComponent();
- if (cn != null && matcher.test(si)) {
+ ComponentName cn = itemInfo.getTargetComponent();
+ if (cn != null && matcher.test(itemInfo)) {
String packageName = cn.getPackageName();
- if (si.hasStatusFlag(WorkspaceItemInfo.FLAG_SUPPORTS_WEB_UI)) {
- forceKeepShortcuts.add(si.id);
+ if (itemInfo.hasStatusFlag(WorkspaceItemInfo.FLAG_SUPPORTS_WEB_UI)) {
+ forceKeepShortcuts.add(itemInfo.id);
if (mOp == OP_REMOVE) {
return;
}
}
- if (si.isPromise() && isNewApkAvailable) {
+ if (itemInfo.isPromise() && isNewApkAvailable) {
boolean isTargetValid = !cn.getClassName().equals(
IconCache.EMPTY_CLASS_NAME);
- if (si.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
+ if (itemInfo.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
List<ShortcutInfo> shortcut =
new ShortcutRequest(context, mUser)
.forPackage(cn.getPackageName(),
- si.getDeepShortcutId())
+ itemInfo.getDeepShortcutId())
.query(ShortcutRequest.PINNED);
if (shortcut.isEmpty()) {
isTargetValid = false;
+ if (DEBUG) {
+ Log.d(TAG, "Pinned Shortcut not found for updated"
+ + " package=" + itemInfo.getTargetPackage());
+ }
} else {
- si.updateFromDeepShortcutInfo(shortcut.get(0), context);
+ if (DEBUG) {
+ Log.d(TAG, "Found pinned shortcut for updated"
+ + " package=" + itemInfo.getTargetPackage()
+ + ", isTargetValid=" + isTargetValid);
+ }
+ itemInfo.updateFromDeepShortcutInfo(shortcut.get(0), context);
infoUpdated = true;
}
} else if (isTargetValid) {
isTargetValid = context.getSystemService(LauncherApps.class)
.isActivityEnabled(cn, mUser);
}
- if (!isTargetValid && (si.hasStatusFlag(
+
+ if (!isTargetValid && (itemInfo.hasStatusFlag(
FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)
- || si.isArchived())) {
- if (updateWorkspaceItemIntent(context, si, packageName)) {
+ || itemInfo.isArchived())) {
+ if (updateWorkspaceItemIntent(context, itemInfo, packageName)) {
infoUpdated = true;
- } else if (si.hasPromiseIconUi()) {
- removedShortcuts.add(si.id);
+ } else if (itemInfo.hasPromiseIconUi()) {
+ removedShortcuts.add(itemInfo.id);
+ if (DEBUG) {
+ FileLog.w(TAG, "Removing restored shortcut promise icon"
+ + " that no longer points to valid component."
+ + " id=" + itemInfo.id
+ + ", package=" + itemInfo.getTargetPackage()
+ + ", status=" + itemInfo.status
+ + ", isArchived=" + itemInfo.isArchived());
+ }
return;
}
} else if (!isTargetValid) {
- removedShortcuts.add(si.id);
- FileLog.e(TAG, "Restored shortcut no longer valid "
- + si.getIntent());
+ removedShortcuts.add(itemInfo.id);
+ if (DEBUG) {
+ FileLog.w(TAG, "Removing shortcut that no longer points to"
+ + " valid component."
+ + " id=" + itemInfo.id
+ + " package=" + itemInfo.getTargetPackage()
+ + " status=" + itemInfo.status);
+ }
return;
} else {
- si.status = WorkspaceItemInfo.DEFAULT;
+ itemInfo.status = WorkspaceItemInfo.DEFAULT;
infoUpdated = true;
}
} else if (isNewApkAvailable && removedComponents.contains(cn)) {
- if (updateWorkspaceItemIntent(context, si, packageName)) {
+ if (updateWorkspaceItemIntent(context, itemInfo, packageName)) {
infoUpdated = true;
}
}
@@ -268,7 +302,9 @@
if (isNewApkAvailable) {
List<LauncherActivityInfo> activities = activitiesLists.get(
packageName);
- si.setProgressLevel(
+ // TODO: See if we can migrate this to
+ // AppInfo#updateRuntimeFlagsForActivityTarget
+ itemInfo.setProgressLevel(
activities == null || activities.isEmpty()
? 100
: PackageManagerHelper.getLoadingProgress(
@@ -277,42 +313,42 @@
// In case an app is archived, we need to make sure that archived state
// in WorkspaceItemInfo is refreshed.
if (Flags.enableSupportForArchiving() && !activities.isEmpty()) {
- boolean newArchivalState = activities.get(
- 0).getActivityInfo().isArchived;
- if (newArchivalState != si.isArchived()) {
- si.runtimeStatusFlags ^= FLAG_ARCHIVED;
+ boolean newArchivalState = activities.get(0)
+ .getActivityInfo().isArchived;
+ if (newArchivalState != itemInfo.isArchived()) {
+ itemInfo.runtimeStatusFlags ^= FLAG_ARCHIVED;
infoUpdated = true;
}
}
- if (si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
+ if (itemInfo.itemType == Favorites.ITEM_TYPE_APPLICATION) {
if (activities != null && !activities.isEmpty()) {
- si.setNonResizeable(ApiWrapper.INSTANCE.get(context)
+ itemInfo.setNonResizeable(ApiWrapper.INSTANCE.get(context)
.isNonResizeableActivity(activities.get(0)));
}
- iconCache.getTitleAndIcon(si, si.usingLowResIcon());
+ iconCache.getTitleAndIcon(itemInfo, itemInfo.usingLowResIcon());
infoUpdated = true;
}
}
- int oldRuntimeFlags = si.runtimeStatusFlags;
- si.runtimeStatusFlags = flagOp.apply(si.runtimeStatusFlags);
- if (si.runtimeStatusFlags != oldRuntimeFlags) {
+ int oldRuntimeFlags = itemInfo.runtimeStatusFlags;
+ itemInfo.runtimeStatusFlags = flagOp.apply(itemInfo.runtimeStatusFlags);
+ if (itemInfo.runtimeStatusFlags != oldRuntimeFlags) {
shortcutUpdated = true;
}
}
if (infoUpdated || shortcutUpdated) {
- updatedWorkspaceItems.add(si);
+ updatedWorkspaceItems.add(itemInfo);
}
- if (infoUpdated && si.id != ItemInfo.NO_ID) {
- getModelWriter().updateItemInDatabase(si);
+ if (infoUpdated && itemInfo.id != ItemInfo.NO_ID) {
+ taskController.getModelWriter().updateItemInDatabase(itemInfo);
}
});
for (LauncherAppWidgetInfo widgetInfo : dataModel.appWidgets) {
if (mUser.equals(widgetInfo.user)
&& widgetInfo.hasRestoreFlag(
- LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
+ LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
&& packageSet.contains(widgetInfo.providerName.getPackageName())) {
widgetInfo.restoreStatus &=
~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY
@@ -324,20 +360,21 @@
widgetInfo.restoreStatus |= LauncherAppWidgetInfo.FLAG_UI_NOT_READY;
widgets.add(widgetInfo);
- getModelWriter().updateItemInDatabase(widgetInfo);
+ taskController.getModelWriter().updateItemInDatabase(widgetInfo);
}
}
}
- bindUpdatedWorkspaceItems(updatedWorkspaceItems);
+ taskController.bindUpdatedWorkspaceItems(updatedWorkspaceItems);
if (!removedShortcuts.isEmpty()) {
- deleteAndBindComponentsRemoved(
+ taskController.deleteAndBindComponentsRemoved(
ItemInfoMatcher.ofItemIds(removedShortcuts),
- "removed because the target component is invalid");
+ "removing shortcuts with invalid target components."
+ + " ids=" + removedShortcuts);
}
if (!widgets.isEmpty()) {
- scheduleCallbackTask(c -> c.bindWidgetsRestored(widgets));
+ taskController.scheduleCallbackTask(c -> c.bindWidgetsRestored(widgets));
}
}
@@ -345,14 +382,21 @@
if (mOp == OP_REMOVE) {
// Mark all packages in the broadcast to be removed
Collections.addAll(removedPackages, packages);
+ if (DEBUG) {
+ Log.d(TAG, "OP_REMOVE: removing packages=" + Arrays.toString(packages));
+ }
// No need to update the removedComponents as
// removedPackages is a super-set of removedComponents
} else if (mOp == OP_UPDATE) {
// Mark disabled packages in the broadcast to be removed
final LauncherApps launcherApps = context.getSystemService(LauncherApps.class);
- for (int i=0; i<N; i++) {
+ for (int i = 0; i < packageCount; i++) {
if (!launcherApps.isPackageEnabled(packages[i], mUser)) {
+ if (DEBUG) {
+ Log.d(TAG, "OP_UPDATE:"
+ + " package " + packages[i] + " is disabled, removing package.");
+ }
removedPackages.add(packages[i]);
}
}
@@ -363,7 +407,7 @@
ItemInfoMatcher.ofPackages(removedPackages, mUser)
.or(ItemInfoMatcher.ofComponents(removedComponents, mUser))
.and(ItemInfoMatcher.ofItemIds(forceKeepShortcuts).negate());
- deleteAndBindComponentsRemoved(removeMatch,
+ taskController.deleteAndBindComponentsRemoved(removeMatch,
"removed because the corresponding package or component is removed. "
+ "mOp=" + mOp + " removedPackages=" + removedPackages.stream().collect(
Collectors.joining(",", "[", "]"))
@@ -379,10 +423,10 @@
if (mOp == OP_ADD) {
// Load widgets for the new package. Changes due to app updates are handled through
// AppWidgetHost events, this is just to initialize the long-press options.
- for (int i = 0; i < N; i++) {
+ for (int i = 0; i < packageCount; i++) {
dataModel.widgetsModel.update(app, new PackageUserKey(packages[i], mUser));
}
- bindUpdatedWidgets(dataModel);
+ taskController.bindUpdatedWidgets(dataModel);
}
}
@@ -398,7 +442,8 @@
return false;
}
// Try to find the best match activity.
- Intent intent = new PackageManagerHelper(context).getAppLaunchIntent(packageName, mUser);
+ Intent intent = PackageManagerHelper.INSTANCE.get(context)
+ .getAppLaunchIntent(packageName, mUser);
if (intent != null) {
si.intent = intent;
si.status = WorkspaceItemInfo.DEFAULT;
@@ -406,4 +451,18 @@
}
return false;
}
+
+ private String getOpString() {
+ return switch (mOp) {
+ case OP_NONE -> "NONE";
+ case OP_ADD -> "ADD";
+ case OP_UPDATE -> "UPDATE";
+ case OP_REMOVE -> "REMOVE";
+ case OP_UNAVAILABLE -> "UNAVAILABLE";
+ case OP_SUSPEND -> "SUSPEND";
+ case OP_UNSUSPEND -> "UNSUSPEND";
+ case OP_USER_AVAILABILITY_CHANGE -> "USER_AVAILABILITY_CHANGE";
+ default -> "UNKNOWN";
+ };
+ }
}
diff --git a/src/com/android/launcher3/model/ReloadStringCacheTask.java b/src/com/android/launcher3/model/ReloadStringCacheTask.java
index 34f7057..3d974d6 100644
--- a/src/com/android/launcher3/model/ReloadStringCacheTask.java
+++ b/src/com/android/launcher3/model/ReloadStringCacheTask.java
@@ -17,13 +17,13 @@
import androidx.annotation.NonNull;
-import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
/**
* Handles updates due to changes in Device Policy Management resources triggered by
* {@link android.app.admin.DevicePolicyManager#ACTION_DEVICE_POLICY_RESOURCE_UPDATED}.
*/
-public class ReloadStringCacheTask extends BaseModelUpdateTask {
+public class ReloadStringCacheTask implements ModelUpdateTask {
@NonNull
private ModelDelegate mModelDelegate;
@@ -33,12 +33,12 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList appsList) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
synchronized (dataModel) {
mModelDelegate.loadStringCache(dataModel.stringCache);
StringCache cloneSC = dataModel.stringCache.clone();
- scheduleCallbackTask(c -> c.bindStringCache(cloneSC));
+ taskController.scheduleCallbackTask(c -> c.bindStringCache(cloneSC));
}
}
}
diff --git a/src/com/android/launcher3/model/ShortcutsChangedTask.java b/src/com/android/launcher3/model/ShortcutsChangedTask.java
index 1cb5215..1916d23 100644
--- a/src/com/android/launcher3/model/ShortcutsChangedTask.java
+++ b/src/com/android/launcher3/model/ShortcutsChangedTask.java
@@ -22,6 +22,7 @@
import androidx.annotation.NonNull;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
@@ -38,7 +39,7 @@
/**
* Handles changes due to shortcut manager updates (deep shortcut changes)
*/
-public class ShortcutsChangedTask extends BaseModelUpdateTask {
+public class ShortcutsChangedTask implements ModelUpdateTask {
@NonNull
private final String mPackageName;
@@ -61,8 +62,9 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
+ final LauncherAppState app = taskController.getApp();
final Context context = app.getContext();
// Find WorkspaceItemInfo's that have changed on the workspace.
ArrayList<WorkspaceItemInfo> matchingWorkspaceItems = new ArrayList<>();
@@ -78,8 +80,8 @@
if (!matchingWorkspaceItems.isEmpty()) {
if (mShortcuts.isEmpty()) {
- PackageManagerHelper packageManagerHelper = PackageManagerHelper.INSTANCE.get(
- app.getContext());
+ PackageManagerHelper packageManagerHelper =
+ PackageManagerHelper.INSTANCE.get(context);
// Verify that the app is indeed installed.
if (!packageManagerHelper.isAppInstalled(mPackageName, mUser)
&& !packageManagerHelper.isAppArchivedForUser(mPackageName, mUser)) {
@@ -115,9 +117,9 @@
});
}
- bindUpdatedWorkspaceItems(updatedWorkspaceItemInfos);
+ taskController.bindUpdatedWorkspaceItems(updatedWorkspaceItemInfos);
if (!nonPinnedIds.isEmpty()) {
- deleteAndBindComponentsRemoved(ItemInfoMatcher.ofShortcutKeys(
+ taskController.deleteAndBindComponentsRemoved(ItemInfoMatcher.ofShortcutKeys(
nonPinnedIds.stream()
.map(id -> new ShortcutKey(mPackageName, mUser, id))
.collect(Collectors.toSet())),
@@ -128,7 +130,7 @@
if (mUpdateIdMap) {
// Update the deep shortcut map if the list of ids has changed for an activity.
dataModel.updateDeepShortcutCounts(mPackageName, mUser, mShortcuts);
- bindDeepShortcuts(dataModel);
+ taskController.bindDeepShortcuts(dataModel);
}
}
}
diff --git a/src/com/android/launcher3/model/UserLockStateChangedTask.java b/src/com/android/launcher3/model/UserLockStateChangedTask.java
index 63ca35b..3dc5ff3 100644
--- a/src/com/android/launcher3/model/UserLockStateChangedTask.java
+++ b/src/com/android/launcher3/model/UserLockStateChangedTask.java
@@ -24,6 +24,7 @@
import androidx.annotation.NonNull;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
@@ -40,7 +41,7 @@
/**
* Task to handle changing of lock state of the user
*/
-public class UserLockStateChangedTask extends BaseModelUpdateTask {
+public class UserLockStateChangedTask implements ModelUpdateTask {
@NonNull
private final UserHandle mUser;
@@ -52,8 +53,9 @@
}
@Override
- public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
- @NonNull final AllAppsList apps) {
+ public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
+ @NonNull AllAppsList apps) {
+ LauncherAppState app = taskController.getApp();
Context context = app.getContext();
HashMap<ShortcutKey, ShortcutInfo> pinnedShortcuts = new HashMap<>();
@@ -98,9 +100,10 @@
}
});
}
- bindUpdatedWorkspaceItems(updatedWorkspaceItemInfos);
+ taskController.bindUpdatedWorkspaceItems(updatedWorkspaceItemInfos);
if (!removedKeys.isEmpty()) {
- deleteAndBindComponentsRemoved(ItemInfoMatcher.ofShortcutKeys(removedKeys),
+ taskController.deleteAndBindComponentsRemoved(
+ ItemInfoMatcher.ofShortcutKeys(removedKeys),
"removed during unlock because it's no longer available"
+ " (possibly due to clear data)");
}
@@ -118,6 +121,6 @@
null, mUser,
new ShortcutRequest(context, mUser).query(ShortcutRequest.ALL));
}
- bindDeepShortcuts(dataModel);
+ taskController.bindDeepShortcuts(dataModel);
}
}
diff --git a/src/com/android/launcher3/model/UserManagerState.java b/src/com/android/launcher3/model/UserManagerState.java
index 720f08e..ed32430 100644
--- a/src/com/android/launcher3/model/UserManagerState.java
+++ b/src/com/android/launcher3/model/UserManagerState.java
@@ -17,6 +17,7 @@
import android.os.UserHandle;
import android.os.UserManager;
+import android.util.Log;
import android.util.LongSparseArray;
import android.util.SparseBooleanArray;
@@ -27,6 +28,8 @@
*/
public class UserManagerState {
+ private static final String TAG = "UserManagerState";
+
public final LongSparseArray<UserHandle> allUsers = new LongSparseArray<>();
private final LongSparseArray<Boolean> mQuietUsersSerialNoMap = new LongSparseArray<>();
@@ -39,6 +42,13 @@
for (UserHandle user : userManager.getUserProfiles()) {
long serialNo = userCache.getSerialNumberForUser(user);
boolean isUserQuiet = userManager.isQuietModeEnabled(user);
+ // Mapping different UserHandles to the same serialNo in allUsers could lead to losing
+ // UserHandle and cause a series of problems, such as incorrectly marking app as
+ // disabled and deleting app icons from workspace.
+ if (allUsers.get(serialNo) != null) {
+ Log.w(TAG, String.format("Override allUsers[%d]=%s with %s",
+ serialNo, allUsers.get(serialNo), user));
+ }
allUsers.put(serialNo, user);
mQuietUsersHashCodeMap.put(user.hashCode(), isUserQuiet);
mQuietUsersSerialNoMap.put(serialNo, isUserQuiet);
diff --git a/src/com/android/launcher3/model/WidgetsModel.java b/src/com/android/launcher3/model/WidgetsModel.java
index 5e0edb3..c949ce6 100644
--- a/src/com/android/launcher3/model/WidgetsModel.java
+++ b/src/com/android/launcher3/model/WidgetsModel.java
@@ -26,21 +26,19 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
-import com.android.launcher3.compat.AlphabeticIndexCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.ComponentWithLabelAndIcon;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.pm.ShortcutConfigActivityInfo;
+import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.WidgetManagerHelper;
import com.android.launcher3.widget.WidgetSections;
-import com.android.launcher3.widget.model.WidgetsListBaseEntry;
-import com.android.launcher3.widget.model.WidgetsListContentEntry;
-import com.android.launcher3.widget.model.WidgetsListHeaderEntry;
+import com.android.wm.shell.Flags;
import java.util.ArrayList;
import java.util.Arrays;
@@ -52,7 +50,9 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.function.Function;
import java.util.function.Predicate;
+import java.util.stream.Collectors;
/**
* Widgets data model that is used by the adapters of the widget views and controllers.
@@ -65,68 +65,31 @@
private static final boolean DEBUG = false;
/* Map of widgets and shortcuts that are tracked per package. */
- private final Map<PackageItemInfo, List<WidgetItem>> mWidgetsList = new HashMap<>();
+ private final Map<PackageItemInfo, List<WidgetItem>> mWidgetsByPackageItem = new HashMap<>();
/**
- * Returns a list of {@link WidgetsListBaseEntry} filtered using given widget item filter. All
- * {@link WidgetItem}s in a single row are sorted (based on label and user), but the overall
- * list of {@link WidgetsListBaseEntry}s is not sorted.
- *
- * @see com.android.launcher3.widget.picker.WidgetsListAdapter#setWidgets(List)
+ * Returns all widgets keyed by their component key.
*/
- public synchronized ArrayList<WidgetsListBaseEntry> getFilteredWidgetsListForPicker(
- Context context,
- Predicate<WidgetItem> widgetItemFilter) {
- if (!WIDGETS_ENABLED) {
- return new ArrayList<>();
- }
- ArrayList<WidgetsListBaseEntry> result = new ArrayList<>();
- AlphabeticIndexCompat indexer = new AlphabeticIndexCompat(context);
-
- for (Map.Entry<PackageItemInfo, List<WidgetItem>> entry : mWidgetsList.entrySet()) {
- PackageItemInfo pkgItem = entry.getKey();
- List<WidgetItem> widgetItems = entry.getValue()
- .stream()
- .filter(widgetItemFilter).toList();
- if (!widgetItems.isEmpty()) {
- String sectionName = (pkgItem.title == null) ? "" :
- indexer.computeSectionName(pkgItem.title);
- result.add(WidgetsListHeaderEntry.create(pkgItem, sectionName, widgetItems));
- result.add(new WidgetsListContentEntry(pkgItem, sectionName, widgetItems));
- }
- }
- return result;
- }
-
- /**
- * Returns a list of {@link WidgetsListBaseEntry}. All {@link WidgetItem} in a single row
- * are sorted (based on label and user), but the overall list of
- * {@link WidgetsListBaseEntry}s is not sorted.
- *
- * @see com.android.launcher3.widget.picker.WidgetsListAdapter#setWidgets(List)
- */
- public synchronized ArrayList<WidgetsListBaseEntry> getWidgetsListForPicker(Context context) {
- // return all items
- return getFilteredWidgetsListForPicker(context, /*widgetItemFilter=*/ item -> true);
- }
-
- /** Returns a mapping of packages to their widgets without static shortcuts. */
- public synchronized Map<PackageUserKey, List<WidgetItem>> getAllWidgetsWithoutShortcuts() {
+ public synchronized Map<ComponentKey, WidgetItem> getWidgetsByComponentKey() {
if (!WIDGETS_ENABLED) {
return Collections.emptyMap();
}
- Map<PackageUserKey, List<WidgetItem>> packagesToWidgets = new HashMap<>();
- mWidgetsList.forEach((packageItemInfo, widgetsAndShortcuts) -> {
- List<WidgetItem> widgets = widgetsAndShortcuts.stream()
- .filter(item -> item.widgetInfo != null)
- .collect(toList());
- if (widgets.size() > 0) {
- packagesToWidgets.put(
- new PackageUserKey(packageItemInfo.packageName, packageItemInfo.user),
- widgets);
- }
- });
- return packagesToWidgets;
+ return mWidgetsByPackageItem.values().stream()
+ .flatMap(Collection::stream).distinct()
+ .collect(Collectors.toMap(
+ widget -> new ComponentKey(widget.componentName, widget.user),
+ Function.identity()
+ ));
+ }
+
+ /**
+ * Returns widgets grouped by the package item that they should belong to.
+ */
+ public synchronized Map<PackageItemInfo, List<WidgetItem>> getWidgetsByPackageItem() {
+ if (!WIDGETS_ENABLED) {
+ return Collections.emptyMap();
+ }
+ return new HashMap<>(mWidgetsByPackageItem);
}
/**
@@ -192,15 +155,16 @@
if (packageUser == null) {
// Clear the list if this is an update on all widgets and shortcuts.
- mWidgetsList.clear();
+ mWidgetsByPackageItem.clear();
} else {
// Otherwise, only clear the widgets and shortcuts for the changed package.
- mWidgetsList.remove(packageItemInfoCache.getOrCreate(packageUser));
+ mWidgetsByPackageItem.remove(packageItemInfoCache.getOrCreate(packageUser));
}
// add and update.
- mWidgetsList.putAll(rawWidgetsShortcuts.stream()
+ mWidgetsByPackageItem.putAll(rawWidgetsShortcuts.stream()
.filter(new WidgetValidityCheck(app))
+ .filter(new WidgetFlagCheck())
.flatMap(widgetItem -> getPackageUserKeys(app.getContext(), widgetItem).stream()
.map(key -> new Pair<>(packageItemInfoCache.getOrCreate(key), widgetItem)))
.collect(groupingBy(pair -> pair.first, mapping(pair -> pair.second, toList()))));
@@ -218,7 +182,7 @@
return;
}
WidgetManagerHelper widgetManager = new WidgetManagerHelper(app.getContext());
- for (Entry<PackageItemInfo, List<WidgetItem>> entry : mWidgetsList.entrySet()) {
+ for (Entry<PackageItemInfo, List<WidgetItem>> entry : mWidgetsByPackageItem.entrySet()) {
if (packageNames.contains(entry.getKey().packageName)) {
List<WidgetItem> items = entry.getValue();
int count = items.size();
@@ -239,50 +203,6 @@
}
}
- private PackageItemInfo createPackageItemInfo(
- ComponentName providerName,
- UserHandle user,
- int category
- ) {
- if (category == NO_CATEGORY) {
- return new PackageItemInfo(providerName.getPackageName(), user);
- } else {
- return new PackageItemInfo("" , category, user);
- }
- }
-
- private IntSet getCategories(ComponentName providerName, Context context) {
- IntSet categories = WidgetSections.getWidgetsToCategory(context).get(providerName);
- if (categories != null) {
- return categories;
- }
- categories = new IntSet();
- categories.add(NO_CATEGORY);
- return categories;
- }
-
- public WidgetItem getWidgetProviderInfoByProviderName(
- ComponentName providerName, UserHandle user, Context context) {
- if (!WIDGETS_ENABLED) {
- return null;
- }
- IntSet categories = getCategories(providerName, context);
-
- // Checking if we have a provider in any of the categories.
- for (Integer category: categories) {
- PackageItemInfo key = createPackageItemInfo(providerName, user, category);
- List<WidgetItem> widgets = mWidgetsList.get(key);
- if (widgets != null) {
- return widgets.stream().filter(
- item -> item.componentName.equals(providerName)
- )
- .findFirst()
- .orElse(null);
- }
- }
- return null;
- }
-
/** Returns {@link PackageItemInfo} of a pending widget. */
public static PackageItemInfo newPendingItemInfo(Context context, ComponentName provider,
UserHandle user) {
@@ -360,6 +280,21 @@
}
}
+ private static class WidgetFlagCheck implements Predicate<WidgetItem> {
+
+ private static final String BUBBLES_SHORTCUT_WIDGET =
+ "com.android.systemui/com.android.wm.shell.bubbles.shortcut"
+ + ".CreateBubbleShortcutActivity";
+
+ @Override
+ public boolean test(WidgetItem widgetItem) {
+ if (BUBBLES_SHORTCUT_WIDGET.equals(widgetItem.componentName.flattenToString())) {
+ return Flags.enableRetrievableBubbles();
+ }
+ return true;
+ }
+ }
+
private static final class PackageItemInfoCache {
private final Map<PackageUserKey, PackageItemInfo> mMap = new ArrayMap<>();
diff --git a/src/com/android/launcher3/model/WorkspaceItemProcessor.kt b/src/com/android/launcher3/model/WorkspaceItemProcessor.kt
index cea4380..90e47d6 100644
--- a/src/com/android/launcher3/model/WorkspaceItemProcessor.kt
+++ b/src/com/android/launcher3/model/WorkspaceItemProcessor.kt
@@ -336,7 +336,8 @@
info,
activityInfo,
userCache.getUserInfo(c.user),
- ApiWrapper.INSTANCE[app.context]
+ ApiWrapper.INSTANCE[app.context],
+ pmHelper
)
}
if (
diff --git a/src/com/android/launcher3/model/data/AppInfo.java b/src/com/android/launcher3/model/data/AppInfo.java
index 18aa6e7..a4281f8 100644
--- a/src/com/android/launcher3/model/data/AppInfo.java
+++ b/src/com/android/launcher3/model/data/AppInfo.java
@@ -90,12 +90,12 @@
*/
public AppInfo(Context context, LauncherActivityInfo info, UserHandle user) {
this(info, UserCache.INSTANCE.get(context).getUserInfo(user),
- ApiWrapper.INSTANCE.get(context),
+ ApiWrapper.INSTANCE.get(context), PackageManagerHelper.INSTANCE.get(context),
context.getSystemService(UserManager.class).isQuietModeEnabled(user));
}
public AppInfo(LauncherActivityInfo info, UserIconInfo userIconInfo,
- ApiWrapper apiWrapper, boolean quietModeEnabled) {
+ ApiWrapper apiWrapper, PackageManagerHelper pmHelper, boolean quietModeEnabled) {
this.componentName = info.getComponentName();
this.container = CONTAINER_ALL_APPS;
this.user = userIconInfo.user;
@@ -105,7 +105,7 @@
runtimeStatusFlags |= FLAG_DISABLED_QUIET_USER;
}
uid = info.getApplicationInfo().uid;
- updateRuntimeFlagsForActivityTarget(this, info, userIconInfo, apiWrapper);
+ updateRuntimeFlagsForActivityTarget(this, info, userIconInfo, apiWrapper, pmHelper);
}
public AppInfo(AppInfo info) {
@@ -184,7 +184,7 @@
*/
public static boolean updateRuntimeFlagsForActivityTarget(
ItemInfoWithIcon info, LauncherActivityInfo lai, UserIconInfo userIconInfo,
- ApiWrapper apiWrapper) {
+ ApiWrapper apiWrapper, PackageManagerHelper pmHelper) {
final int oldProgressLevel = info.getProgressLevel();
final int oldRuntimeStatusFlags = info.runtimeStatusFlags;
ApplicationInfo appInfo = lai.getApplicationInfo();
@@ -216,6 +216,8 @@
PackageManagerHelper.getLoadingProgress(lai),
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
info.setNonResizeable(apiWrapper.isNonResizeableActivity(lai));
+ info.setSupportsMultiInstance(
+ pmHelper.supportsMultiInstance(lai.getComponentName()));
return (oldProgressLevel != info.getProgressLevel())
|| (oldRuntimeStatusFlags != info.runtimeStatusFlags);
}
diff --git a/src/com/android/launcher3/model/data/ItemInfo.java b/src/com/android/launcher3/model/data/ItemInfo.java
index 72e85c7..b82d0a0 100644
--- a/src/com/android/launcher3/model/data/ItemInfo.java
+++ b/src/com/android/launcher3/model/data/ItemInfo.java
@@ -73,6 +73,7 @@
* Represents an item in the launcher.
*/
public class ItemInfo {
+ private static final String TAG = "ItemInfo";
public static final boolean DEBUG = false;
public static final int NO_ID = -1;
@@ -285,7 +286,7 @@
@Override
@NonNull
public final String toString() {
- return getClass().getSimpleName() + "(" + dumpProperties() + ")";
+ return TAG + "(" + dumpProperties() + ")";
}
@NonNull
diff --git a/src/com/android/launcher3/model/data/ItemInfoWithIcon.java b/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
index d4c25cb..6ac44ff 100644
--- a/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
+++ b/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
@@ -127,6 +127,11 @@
public static final int FLAG_NOT_RESIZEABLE = 1 << 15;
/**
+ * Flag indicating whether the package related to the item & user supports multiple instances.
+ */
+ public static final int FLAG_SUPPORTS_MULTI_INSTANCE = 1 << 16;
+
+ /**
* Status associated with the system state of the underlying item. This is calculated every
* time a new info is created and not persisted on the disk.
*/
@@ -252,6 +257,24 @@
}
/**
+ * Sets whether this app info supports multi-instance.
+ */
+ protected void setSupportsMultiInstance(boolean supportsMultiInstance) {
+ if (supportsMultiInstance) {
+ runtimeStatusFlags |= FLAG_SUPPORTS_MULTI_INSTANCE;
+ } else {
+ runtimeStatusFlags &= ~FLAG_SUPPORTS_MULTI_INSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this app info supports multi-instance.
+ */
+ public boolean supportsMultiInstance() {
+ return (runtimeStatusFlags & FLAG_SUPPORTS_MULTI_INSTANCE) != 0;
+ }
+
+ /**
* Sets whether this app info is non-resizeable.
*/
public void setNonResizeable(boolean nonResizeable) {
@@ -301,4 +324,11 @@
drawable.setIsDisabled(isDisabled());
return drawable;
}
+
+ @Override
+ protected String dumpProperties() {
+ return super.dumpProperties()
+ + " supportsMultiInstance=" + supportsMultiInstance()
+ + " nonResizeable=" + isNonResizeable();
+ }
}
diff --git a/src/com/android/launcher3/model/data/TaskItemInfo.kt b/src/com/android/launcher3/model/data/TaskItemInfo.kt
new file mode 100644
index 0000000..fc1cd4d
--- /dev/null
+++ b/src/com/android/launcher3/model/data/TaskItemInfo.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model.data
+
+/**
+ * Temporary class holding a Task ID to allow us to reference a Task when clicking a hotseat item.
+ *
+ * TODO(b/315344726): Remove this class when we have proper Taskbar support for multi-instance apps
+ */
+class TaskItemInfo(val taskId: Int, itemInfo: WorkspaceItemInfo) : WorkspaceItemInfo(itemInfo)
diff --git a/src/com/android/launcher3/model/data/WorkspaceItemInfo.java b/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
index 2c533ac..f31bf1e 100644
--- a/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
+++ b/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
@@ -22,8 +22,10 @@
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.text.TextUtils;
+import android.util.Log;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import com.android.launcher3.Flags;
import com.android.launcher3.LauncherSettings;
@@ -96,6 +98,8 @@
public int options;
+ @Nullable
+ private ShortcutInfo mShortcutInfo = null;
public WorkspaceItemInfo() {
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
@@ -174,6 +178,9 @@
public void updateFromDeepShortcutInfo(@NonNull final ShortcutInfo shortcutInfo,
@NonNull final Context context) {
+ if (com.android.wm.shell.Flags.enableBubbleAnything()) {
+ mShortcutInfo = shortcutInfo;
+ }
// {@link ShortcutInfo#getActivity} can change during an update. Recreate the intent
intent = ShortcutKey.makeIntent(shortcutInfo);
title = shortcutInfo.getShortLabel();
@@ -186,9 +193,12 @@
if (shortcutInfo.isEnabled()) {
runtimeStatusFlags &= ~FLAG_DISABLED_BY_PUBLISHER;
} else {
+ Log.w(TAG, "updateFromDeepShortcutInfo: Updated shortcut has been disabled. "
+ + " package=" + shortcutInfo.getPackage()
+ + " disabledReason=" + shortcutInfo.getDisabledReason());
runtimeStatusFlags |= FLAG_DISABLED_BY_PUBLISHER;
}
- disabledMessage = shortcutInfo.getDisabledMessage();
+
if (shortcutInfo.getDisabledReason() == ShortcutInfo.DISABLED_REASON_VERSION_LOWER) {
runtimeStatusFlags |= FLAG_DISABLED_VERSION_LOWER;
} else {
@@ -200,6 +210,11 @@
: Arrays.stream(persons).map(Person::getKey).sorted().toArray(String[]::new);
}
+ @Nullable
+ public ShortcutInfo getDeepShortcutInfo() {
+ return mShortcutInfo;
+ }
+
/**
* {@code true} if the shortcut is disabled due to its app being a lower version.
*/
diff --git a/src/com/android/launcher3/notification/NotificationKeyData.java b/src/com/android/launcher3/notification/NotificationKeyData.java
index 4115b3d..e38824c 100644
--- a/src/com/android/launcher3/notification/NotificationKeyData.java
+++ b/src/com/android/launcher3/notification/NotificationKeyData.java
@@ -22,6 +22,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.Utilities;
@@ -38,6 +39,11 @@
public final String[] personKeysFromNotification;
public int count;
+ @VisibleForTesting
+ public NotificationKeyData(String notificationKey) {
+ this(notificationKey, null, 1, new String[]{});
+ }
+
private NotificationKeyData(String notificationKey, String shortcutId, int count,
String[] personKeysFromNotification) {
this.notificationKey = notificationKey;
diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
index e44ea1d..a691e45 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
@@ -43,6 +43,7 @@
import android.view.animation.OvershootInterpolator;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
@@ -131,7 +132,8 @@
private float mCurrentPosition;
private float mFinalPosition;
private boolean mIsScrollPaused;
- private boolean mIsTwoPanels;
+ @VisibleForTesting
+ boolean mIsTwoPanels;
private ObjectAnimator mAnimator;
private @Nullable ObjectAnimator mAlphaAnimator;
@@ -477,6 +479,21 @@
return sTempRect;
}
+ @VisibleForTesting
+ int getActivePage() {
+ return mActivePage;
+ }
+
+ @VisibleForTesting
+ int getNumPages() {
+ return mNumPages;
+ }
+
+ @VisibleForTesting
+ float getCurrentPosition() {
+ return mCurrentPosition;
+ }
+
private class MyOutlineProver extends ViewOutlineProvider {
@Override
diff --git a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java b/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java
deleted file mode 100644
index bde4e52..0000000
--- a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java
+++ /dev/null
@@ -1,265 +0,0 @@
-package com.android.launcher3.pageindicators;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ObjectAnimator;
-import android.animation.ValueAnimator;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.AttributeSet;
-import android.util.Property;
-import android.view.View;
-import android.view.ViewConfiguration;
-
-import com.android.launcher3.Insettable;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.util.Themes;
-
-/**
- * A PageIndicator that briefly shows a fraction of a line when moving between pages
- *
- * The fraction is 1 / number of pages and the position is based on the progress of the page scroll.
- */
-public class WorkspacePageIndicator extends View implements Insettable, PageIndicator {
-
- private static final int LINE_ANIMATE_DURATION = ViewConfiguration.getScrollBarFadeDuration();
- private static final int LINE_FADE_DELAY = ViewConfiguration.getScrollDefaultDelay();
- public static final int WHITE_ALPHA = (int) (0.70f * 255);
- public static final int BLACK_ALPHA = (int) (0.65f * 255);
-
- private static final int LINE_ALPHA_ANIMATOR_INDEX = 0;
- private static final int NUM_PAGES_ANIMATOR_INDEX = 1;
- private static final int TOTAL_SCROLL_ANIMATOR_INDEX = 2;
- private static final int ANIMATOR_COUNT = 3;
-
- private ValueAnimator[] mAnimators = new ValueAnimator[ANIMATOR_COUNT];
-
- private final Handler mDelayedLineFadeHandler = new Handler(Looper.getMainLooper());
- private final Launcher mLauncher;
-
- private boolean mShouldAutoHide = true;
-
- // The alpha of the line when it is showing.
- private int mActiveAlpha = 0;
- // The alpha that the line is being animated to or already at (either 0 or mActiveAlpha).
- private int mToAlpha;
- // A float value representing the number of pages, to allow for an animation when it changes.
- private float mNumPagesFloat;
- private int mCurrentScroll;
- private int mTotalScroll;
- private Paint mLinePaint;
- private final int mLineHeight;
-
- private static final Property<WorkspacePageIndicator, Integer> PAINT_ALPHA
- = new Property<WorkspacePageIndicator, Integer>(Integer.class, "paint_alpha") {
- @Override
- public Integer get(WorkspacePageIndicator obj) {
- return obj.mLinePaint.getAlpha();
- }
-
- @Override
- public void set(WorkspacePageIndicator obj, Integer alpha) {
- obj.mLinePaint.setAlpha(alpha);
- obj.invalidate();
- }
- };
-
- private static final Property<WorkspacePageIndicator, Float> NUM_PAGES
- = new Property<WorkspacePageIndicator, Float>(Float.class, "num_pages") {
- @Override
- public Float get(WorkspacePageIndicator obj) {
- return obj.mNumPagesFloat;
- }
-
- @Override
- public void set(WorkspacePageIndicator obj, Float numPages) {
- obj.mNumPagesFloat = numPages;
- obj.invalidate();
- }
- };
-
- private static final Property<WorkspacePageIndicator, Integer> TOTAL_SCROLL
- = new Property<WorkspacePageIndicator, Integer>(Integer.class, "total_scroll") {
- @Override
- public Integer get(WorkspacePageIndicator obj) {
- return obj.mTotalScroll;
- }
-
- @Override
- public void set(WorkspacePageIndicator obj, Integer totalScroll) {
- obj.mTotalScroll = totalScroll;
- obj.invalidate();
- }
- };
-
- private Runnable mHideLineRunnable = () -> animateLineToAlpha(0);
-
- public WorkspacePageIndicator(Context context) {
- this(context, null);
- }
-
- public WorkspacePageIndicator(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public WorkspacePageIndicator(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- Resources res = context.getResources();
- mLinePaint = new Paint();
- mLinePaint.setAlpha(0);
-
- mLauncher = Launcher.getLauncher(context);
- mLineHeight = res.getDimensionPixelSize(R.dimen.workspace_page_indicator_line_height);
-
- boolean darkText = Themes.getAttrBoolean(mLauncher, R.attr.isWorkspaceDarkText);
- mActiveAlpha = darkText ? BLACK_ALPHA : WHITE_ALPHA;
- mLinePaint.setColor(darkText ? Color.BLACK : Color.WHITE);
- }
-
- @Override
- protected void onDraw(Canvas canvas) {
- if (mTotalScroll == 0 || mNumPagesFloat == 0) {
- return;
- }
-
- // Compute and draw line rect.
- float progress = Utilities.boundToRange(((float) mCurrentScroll) / mTotalScroll, 0f, 1f);
- int availableWidth = getWidth();
- int lineWidth = (int) (availableWidth / mNumPagesFloat);
- int lineLeft = (int) (progress * (availableWidth - lineWidth));
- int lineRight = lineLeft + lineWidth;
-
- canvas.drawRoundRect(lineLeft, getHeight() / 2 - mLineHeight / 2, lineRight,
- getHeight() / 2 + mLineHeight / 2, mLineHeight, mLineHeight, mLinePaint);
- }
-
- @Override
- public void setScroll(int currentScroll, int totalScroll) {
- if (getAlpha() == 0) {
- return;
- }
- animateLineToAlpha(mActiveAlpha);
-
- mCurrentScroll = currentScroll;
- if (mTotalScroll == 0) {
- mTotalScroll = totalScroll;
- } else if (mTotalScroll != totalScroll) {
- animateToTotalScroll(totalScroll);
- } else {
- invalidate();
- }
-
- if (mShouldAutoHide) {
- hideAfterDelay();
- }
- }
-
- private void hideAfterDelay() {
- mDelayedLineFadeHandler.removeCallbacksAndMessages(null);
- mDelayedLineFadeHandler.postDelayed(mHideLineRunnable, LINE_FADE_DELAY);
- }
-
- @Override
- public void setActiveMarker(int activePage) { }
-
- @Override
- public void setMarkersCount(int numMarkers) {
- if (Float.compare(numMarkers, mNumPagesFloat) != 0) {
- setupAndRunAnimation(ObjectAnimator.ofFloat(this, NUM_PAGES, numMarkers),
- NUM_PAGES_ANIMATOR_INDEX);
- } else {
- if (mAnimators[NUM_PAGES_ANIMATOR_INDEX] != null) {
- mAnimators[NUM_PAGES_ANIMATOR_INDEX].cancel();
- mAnimators[NUM_PAGES_ANIMATOR_INDEX] = null;
- }
- }
- }
-
- @Override
- public void setShouldAutoHide(boolean shouldAutoHide) {
- mShouldAutoHide = shouldAutoHide;
- if (shouldAutoHide && mLinePaint.getAlpha() > 0) {
- hideAfterDelay();
- } else if (!shouldAutoHide) {
- mDelayedLineFadeHandler.removeCallbacksAndMessages(null);
- }
- }
-
- private void animateLineToAlpha(int alpha) {
- if (alpha == mToAlpha) {
- // Ignore the new animation if it is going to the same alpha as the current animation.
- return;
- }
- mToAlpha = alpha;
- setupAndRunAnimation(ObjectAnimator.ofInt(this, PAINT_ALPHA, alpha),
- LINE_ALPHA_ANIMATOR_INDEX);
- }
-
- private void animateToTotalScroll(int totalScroll) {
- setupAndRunAnimation(ObjectAnimator.ofInt(this, TOTAL_SCROLL, totalScroll),
- TOTAL_SCROLL_ANIMATOR_INDEX);
- }
-
- /**
- * Starts the given animator and stores it in the provided index in {@link #mAnimators} until
- * the animation ends.
- *
- * If an animator is already at the index (i.e. it is already playing), it is canceled and
- * replaced with the new animator.
- */
- private void setupAndRunAnimation(ValueAnimator animator, final int animatorIndex) {
- if (mAnimators[animatorIndex] != null) {
- mAnimators[animatorIndex].cancel();
- }
- mAnimators[animatorIndex] = animator;
- mAnimators[animatorIndex].addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mAnimators[animatorIndex] = null;
- }
- });
- mAnimators[animatorIndex].setDuration(LINE_ANIMATE_DURATION);
- mAnimators[animatorIndex].start();
- }
-
- /**
- * Pauses all currently running animations.
- */
- @Override
- public void pauseAnimations() {
- for (int i = 0; i < ANIMATOR_COUNT; i++) {
- if (mAnimators[i] != null) {
- mAnimators[i].pause();
- }
- }
- }
-
- /**
- * Force-ends all currently running or paused animations.
- */
- @Override
- public void skipAnimationsToEnd() {
- for (int i = 0; i < ANIMATOR_COUNT; i++) {
- if (mAnimators[i] != null) {
- mAnimators[i].end();
- }
- }
- }
-
- /**
- * We need to override setInsets to prevent InsettableFrameLayout from applying different
- * margins on the page indicator.
- */
- @Override
- public void setInsets(Rect insets) {
- }
-}
diff --git a/src/com/android/launcher3/pm/InstallSessionTracker.java b/src/com/android/launcher3/pm/InstallSessionTracker.java
index 24d58f3..856c294 100644
--- a/src/com/android/launcher3/pm/InstallSessionTracker.java
+++ b/src/com/android/launcher3/pm/InstallSessionTracker.java
@@ -25,6 +25,7 @@
import android.content.pm.PackageInstaller.SessionInfo;
import android.os.Build;
import android.os.UserHandle;
+import android.util.Log;
import android.util.SparseArray;
import androidx.annotation.NonNull;
@@ -32,7 +33,7 @@
import androidx.annotation.WorkerThread;
import com.android.launcher3.Flags;
-import com.android.launcher3.Utilities;
+import com.android.launcher3.logging.FileLog;
import com.android.launcher3.util.PackageUserKey;
import java.lang.ref.WeakReference;
@@ -42,6 +43,8 @@
@WorkerThread
public class InstallSessionTracker extends PackageInstaller.SessionCallback {
+ public static final String TAG = "InstallSessionTracker";
+
// Lazily initialized
private SparseArray<PackageUserKey> mActiveSessions = null;
@@ -76,6 +79,11 @@
}
SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback);
if (sessionInfo != null) {
+ FileLog.d(TAG, "onCreated: Install session created for"
+ + " appPackageName=" + sessionInfo.getAppPackageName()
+ + ", sessionId=" + sessionInfo.getSessionId()
+ + ", appIcon=" + sessionInfo.getAppIcon()
+ + ", appLabel=" + sessionInfo.getAppLabel());
callback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo));
}
@@ -103,6 +111,10 @@
activeSessions.remove(sessionId);
if (key != null && key.mPackageName != null) {
+ FileLog.d(TAG, "onFinished: active install session finished for"
+ + " appPackageName=" + key.mPackageName
+ + ", sessionId=" + sessionId
+ + ", success=" + success);
String packageName = key.mPackageName;
PackageInstallInfo info = PackageInstallInfo.fromState(
success ? STATUS_INSTALLED : STATUS_FAILED,
@@ -142,6 +154,11 @@
}
SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback);
if (sessionInfo != null) {
+ Log.d(TAG, "onBadgingChanged: badging info changed for"
+ + " appPackageName=" + sessionInfo.getAppPackageName()
+ + ", sessionId=" + sessionInfo.getSessionId()
+ + ", appIcon=" + sessionInfo.getAppIcon()
+ + ", appLabel=" + sessionInfo.getAppLabel());
helper.tryQueuePromiseAppIcon(sessionInfo);
}
}
diff --git a/src/com/android/launcher3/pm/PackageInstallInfo.java b/src/com/android/launcher3/pm/PackageInstallInfo.java
index 1797c1f..23d3b61 100644
--- a/src/com/android/launcher3/pm/PackageInstallInfo.java
+++ b/src/com/android/launcher3/pm/PackageInstallInfo.java
@@ -22,6 +22,7 @@
import androidx.annotation.NonNull;
public final class PackageInstallInfo {
+ private static final String TAG = "PackageInstallInfo";
public static final int STATUS_INSTALLED = 0;
public static final int STATUS_INSTALLING = 1;
@@ -61,7 +62,7 @@
@Override
public String toString() {
- return getClass().getSimpleName() + "(" + dumpProperties() + ")";
+ return TAG + "(" + dumpProperties() + ")";
}
private String dumpProperties() {
diff --git a/src/com/android/launcher3/pm/UserCache.java b/src/com/android/launcher3/pm/UserCache.java
index b7b557d..e861961 100644
--- a/src/com/android/launcher3/pm/UserCache.java
+++ b/src/com/android/launcher3/pm/UserCache.java
@@ -75,7 +75,7 @@
private final List<BiConsumer<UserHandle, String>> mUserEventListeners = new ArrayList<>();
private final SimpleBroadcastReceiver mUserChangeReceiver =
- new SimpleBroadcastReceiver(this::onUsersChanged);
+ new SimpleBroadcastReceiver(MODEL_EXECUTOR, this::onUsersChanged);
private final Context mContext;
@@ -101,6 +101,7 @@
mUserChangeReceiver.register(mContext,
Intent.ACTION_MANAGED_PROFILE_AVAILABLE,
Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE,
+ Intent.ACTION_MANAGED_PROFILE_REMOVED,
ACTION_PROFILE_ADDED,
ACTION_PROFILE_REMOVED,
ACTION_PROFILE_UNLOCKED,
@@ -182,6 +183,11 @@
mUserToSerialMap.put(userHandle, info);
}
+ @VisibleForTesting
+ public void putToPreInstallCache(UserHandle userHandle, List<String> preInstalledApps) {
+ mUserToPreInstallAppMap.put(userHandle, preInstalledApps);
+ }
+
/**
* @see UserManager#getUserProfiles()
*/
diff --git a/src/com/android/launcher3/popup/PopupDataProvider.java b/src/com/android/launcher3/popup/PopupDataProvider.java
index fb463f7..8a5e388 100644
--- a/src/com/android/launcher3/popup/PopupDataProvider.java
+++ b/src/com/android/launcher3/popup/PopupDataProvider.java
@@ -24,28 +24,20 @@
import androidx.annotation.Nullable;
import com.android.launcher3.dot.DotInfo;
-import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.notification.NotificationKeyData;
import com.android.launcher3.notification.NotificationListener;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.ShortcutUtil;
-import com.android.launcher3.widget.PendingAddWidgetInfo;
-import com.android.launcher3.widget.model.WidgetsListBaseEntry;
-import com.android.launcher3.widget.model.WidgetsListContentEntry;
-import com.android.launcher3.widget.picker.WidgetRecommendationCategory;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.function.Consumer;
-import java.util.function.Function;
import java.util.function.Predicate;
-import java.util.stream.Collectors;
/**
* Provides data for the popup menu that appears after long-clicking on apps.
@@ -62,13 +54,6 @@
/** Maps packages to their DotInfo's . */
private Map<PackageUserKey, DotInfo> mPackageUserToDotInfos = new HashMap<>();
- /** All installed widgets. */
- private List<WidgetsListBaseEntry> mAllWidgets = List.of();
- /** Widgets that can be recommended to the users. */
- private List<ItemInfo> mRecommendedWidgets = List.of();
-
- private PopupDataChangeListener mChangeListener = PopupDataChangeListener.INSTANCE;
-
public PopupDataProvider(Consumer<Predicate<PackageUserKey>> notificationDotsChangeListener) {
mNotificationDotsChangeListener = notificationDotsChangeListener;
}
@@ -183,102 +168,8 @@
})) ? dotInfo : null;
}
- /**
- * Sets a list of recommended widgets ordered by their order of appearance in the widgets
- * recommendation UI.
- */
- public void setRecommendedWidgets(List<ItemInfo> recommendedWidgets) {
- mRecommendedWidgets = recommendedWidgets;
- mChangeListener.onRecommendedWidgetsBound();
- }
-
- public void setAllWidgets(List<WidgetsListBaseEntry> allWidgets) {
- mAllWidgets = allWidgets;
- mChangeListener.onWidgetsBound();
- }
-
- public void setChangeListener(PopupDataChangeListener listener) {
- mChangeListener = listener == null ? PopupDataChangeListener.INSTANCE : listener;
- }
-
- public List<WidgetsListBaseEntry> getAllWidgets() {
- return mAllWidgets;
- }
-
- /** Returns a list of recommended widgets. */
- public List<WidgetItem> getRecommendedWidgets() {
- HashMap<ComponentKey, WidgetItem> allWidgetItems = new HashMap<>();
- mAllWidgets.stream()
- .filter(entry -> entry instanceof WidgetsListContentEntry)
- .forEach(entry -> ((WidgetsListContentEntry) entry).mWidgets
- .forEach(widget -> allWidgetItems.put(
- new ComponentKey(widget.componentName, widget.user), widget)));
- return mRecommendedWidgets.stream()
- .map(recommendedWidget -> allWidgetItems.get(
- new ComponentKey(recommendedWidget.getTargetComponent(),
- recommendedWidget.user)))
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
- }
-
- /** Returns the recommended widgets mapped by their category. */
- @NonNull
- public Map<WidgetRecommendationCategory, List<WidgetItem>> getCategorizedRecommendedWidgets() {
- Map<ComponentKey, WidgetItem> allWidgetItems = mAllWidgets.stream()
- .filter(entry -> entry instanceof WidgetsListContentEntry)
- .flatMap(entry -> entry.mWidgets.stream())
- .distinct()
- .collect(Collectors.toMap(
- widget -> new ComponentKey(widget.componentName, widget.user),
- Function.identity()
- ));
- return mRecommendedWidgets.stream()
- .filter(itemInfo -> itemInfo instanceof PendingAddWidgetInfo
- && ((PendingAddWidgetInfo) itemInfo).recommendationCategory != null)
- .collect(Collectors.groupingBy(
- it -> ((PendingAddWidgetInfo) it).recommendationCategory,
- Collectors.collectingAndThen(
- Collectors.toList(),
- list -> list.stream()
- .map(it -> allWidgetItems.get(
- new ComponentKey(it.getTargetComponent(),
- it.user)))
- .filter(Objects::nonNull)
- .collect(Collectors.toList())
- )
- ));
- }
-
- public List<WidgetItem> getWidgetsForPackageUser(PackageUserKey packageUserKey) {
- return mAllWidgets.stream()
- .filter(row -> row instanceof WidgetsListContentEntry
- && row.mPkgItem.packageName.equals(packageUserKey.mPackageName))
- .flatMap(row -> ((WidgetsListContentEntry) row).mWidgets.stream())
- .filter(widget -> packageUserKey.mUser.equals(widget.user))
- .collect(Collectors.toList());
- }
-
- /** Gets the WidgetsListContentEntry for the currently selected header. */
- public WidgetsListContentEntry getSelectedAppWidgets(PackageUserKey packageUserKey) {
- return (WidgetsListContentEntry) mAllWidgets.stream()
- .filter(row -> row instanceof WidgetsListContentEntry
- && PackageUserKey.fromPackageItemInfo(row.mPkgItem).equals(packageUserKey))
- .findAny()
- .orElse(null);
- }
-
public void dump(String prefix, PrintWriter writer) {
writer.println(prefix + "PopupDataProvider:");
writer.println(prefix + "\tmPackageUserToDotInfos:" + mPackageUserToDotInfos);
}
-
- public interface PopupDataChangeListener {
-
- PopupDataChangeListener INSTANCE = new PopupDataChangeListener() { };
-
- default void onWidgetsBound() { }
-
- /** A callback to get notified when recommended widgets are bound. */
- default void onRecommendedWidgetsBound() { }
- }
}
diff --git a/src/com/android/launcher3/popup/PopupLiveUpdateHandler.java b/src/com/android/launcher3/popup/PopupLiveUpdateHandler.java
index 4c94f94..1fd3557 100644
--- a/src/com/android/launcher3/popup/PopupLiveUpdateHandler.java
+++ b/src/com/android/launcher3/popup/PopupLiveUpdateHandler.java
@@ -19,6 +19,8 @@
import android.view.View;
import com.android.launcher3.views.ActivityContext;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider.WidgetPickerDataChangeListener;
/**
* Utility class to handle updates while the popup is visible (like widgets and
@@ -27,7 +29,7 @@
* @param <T> The activity on which the popup shows
*/
public abstract class PopupLiveUpdateHandler<T extends Context & ActivityContext> implements
- PopupDataProvider.PopupDataChangeListener, View.OnAttachStateChangeListener {
+ WidgetPickerDataChangeListener, View.OnAttachStateChangeListener {
protected final T mContext;
protected final PopupContainerWithArrow<T> mPopupContainerWithArrow;
@@ -40,19 +42,25 @@
@Override
public void onViewAttachedToWindow(View view) {
- PopupDataProvider popupDataProvider = mContext.getPopupDataProvider();
+ WidgetPickerDataProvider widgetsDataProvider = mContext.getWidgetPickerDataProvider();
- if (popupDataProvider != null) {
- popupDataProvider.setChangeListener(this);
+ if (widgetsDataProvider != null) {
+ widgetsDataProvider.setChangeListener(this);
}
}
@Override
public void onViewDetachedFromWindow(View view) {
- PopupDataProvider popupDataProvider = mContext.getPopupDataProvider();
+ WidgetPickerDataProvider widgetsDataProvider = mContext.getWidgetPickerDataProvider();
- if (popupDataProvider != null) {
- popupDataProvider.setChangeListener(null);
+ if (widgetsDataProvider != null) {
+ widgetsDataProvider.setChangeListener(null);
}
}
+
+ @Override
+ public void onWidgetsBound() {} // NO_OP
+
+ @Override
+ public void onRecommendedWidgetsBound() {} // NO_OP
}
diff --git a/src/com/android/launcher3/popup/RoundedArrowDrawable.java b/src/com/android/launcher3/popup/RoundedArrowDrawable.java
index 575052c..2610bd6 100644
--- a/src/com/android/launcher3/popup/RoundedArrowDrawable.java
+++ b/src/com/android/launcher3/popup/RoundedArrowDrawable.java
@@ -175,7 +175,10 @@
mPaint.setShadowLayer(shadowBlur, dx, dy, shadowColor);
}
- private static void addDownPointingRoundedTriangleToPath(float width, float height,
+ /**
+ * Adds rounded triangle pointing down to the provided {@link Path path} argument
+ */
+ public static void addDownPointingRoundedTriangleToPath(float width, float height,
float radius, Path path) {
// Calculated for the arrow pointing down, will be flipped later if needed.
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index 6005573..0c90eb9 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -5,14 +5,17 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_APP_INFO_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_DONT_SUGGEST_APP_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP;
+import static com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.findAllWidgetsForPackageUser;
import android.app.ActivityOptions;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.ShortcutInfo;
import android.graphics.Rect;
import android.os.Process;
import android.os.UserHandle;
+import android.util.Log;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ImageView;
@@ -24,11 +27,11 @@
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.AbstractFloatingViewHelper;
import com.android.launcher3.Flags;
+import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.SecondaryDropTarget;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.PrivateProfileManager;
-import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.UserCache;
@@ -39,9 +42,9 @@
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.WidgetsBottomSheet;
+import com.android.launcher3.widget.picker.model.data.WidgetPickerData;
import java.util.Arrays;
-import java.util.List;
/**
* Represents a system shortcut for a given app. The shortcut should have a label and icon, and an
@@ -53,6 +56,7 @@
*/
public abstract class SystemShortcut<T extends ActivityContext> extends ItemInfo
implements View.OnClickListener {
+ private static final String TAG = "SystemShortcut";
private final int mIconResId;
protected final int mLabelResId;
@@ -107,11 +111,12 @@
}
public static final Factory<ActivityContext> WIDGETS = (context, itemInfo, originalView) -> {
- if (itemInfo.getTargetComponent() == null) return null;
- final List<WidgetItem> widgets =
- context.getPopupDataProvider().getWidgetsForPackageUser(new PackageUserKey(
- itemInfo.getTargetComponent().getPackageName(), itemInfo.user));
- if (widgets.isEmpty()) {
+ final PackageUserKey packageUserKey = PackageUserKey.fromItemInfo(itemInfo);
+ if (packageUserKey == null) return null;
+
+ final WidgetPickerData data = context.getWidgetPickerDataProvider().get();
+ if (findAllWidgetsForPackageUser(data, packageUserKey).isEmpty()) {
+ // hides widget picker shortcut if there are no widgets for the package.
return null;
}
return new Widgets(context, itemInfo, originalView);
@@ -360,7 +365,8 @@
UninstallApp(T target, ItemInfo itemInfo, @NonNull View originalView,
@NonNull ComponentName cn) {
- super(R.drawable.ic_uninstall_no_shadow, R.string.uninstall_drop_target_label, target,
+ super(R.drawable.ic_uninstall_no_shadow,
+ R.string.uninstall_private_system_shortcut_label, target,
itemInfo, originalView);
mComponentName = cn;
@@ -381,4 +387,63 @@
mAbstractFloatingViewHelper.closeOpenViews(mTarget, true,
AbstractFloatingView.TYPE_ALL & ~AbstractFloatingView.TYPE_REBIND_SAFE);
}
+
+ public static final Factory<ActivityContext> BUBBLE_SHORTCUT =
+ (activity, itemInfo, originalView) -> {
+ if ((itemInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT)
+ && (itemInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_APPLICATION)
+ && !(itemInfo instanceof WorkspaceItemInfo)) {
+ return null;
+ }
+ return new BubbleShortcut(activity, itemInfo, originalView);
+ };
+
+ public interface BubbleActivityStarter {
+ /** Tell SysUI to show the provided shortcut in a bubble. */
+ void showShortcutBubble(ShortcutInfo info);
+
+ /** Tell SysUI to show the provided intent in a bubble. */
+ void showAppBubble(Intent intent);
+ }
+
+ public static class BubbleShortcut<T extends ActivityContext> extends SystemShortcut<T> {
+
+ private BubbleActivityStarter mStarter;
+
+ public BubbleShortcut(T target, ItemInfo itemInfo, View originalView) {
+ super(R.drawable.ic_bubble_button, R.string.bubble, target,
+ itemInfo, originalView);
+ if (target instanceof BubbleActivityStarter) {
+ mStarter = (BubbleActivityStarter) target;
+ }
+ }
+
+ @Override
+ public void onClick(View view) {
+ dismissTaskMenuView();
+ if (mStarter == null) {
+ Log.w(TAG, "starter null!");
+ return;
+ }
+ // TODO: handle GroupTask (single) items so that recent items in taskbar work
+ if (mItemInfo instanceof WorkspaceItemInfo) {
+ WorkspaceItemInfo workspaceItemInfo = (WorkspaceItemInfo) mItemInfo;
+ ShortcutInfo shortcutInfo = workspaceItemInfo.getDeepShortcutInfo();
+ if (shortcutInfo != null) {
+ mStarter.showShortcutBubble(shortcutInfo);
+ return;
+ }
+ }
+ // If we're here check for an intent
+ Intent intent = mItemInfo.getIntent();
+ if (intent != null) {
+ if (intent.getPackage() == null) {
+ intent.setPackage(mItemInfo.getTargetPackage());
+ }
+ mStarter.showAppBubble(intent);
+ } else {
+ Log.w(TAG, "unable to bubble, no intent: " + mItemInfo);
+ }
+ }
+ }
}
diff --git a/src/com/android/launcher3/provider/LauncherDbUtils.java b/src/com/android/launcher3/provider/LauncherDbUtils.java
index b992a92..3ae643e 100644
--- a/src/com/android/launcher3/provider/LauncherDbUtils.java
+++ b/src/com/android/launcher3/provider/LauncherDbUtils.java
@@ -44,6 +44,7 @@
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
+import com.android.launcher3.util.PackageManagerHelper;
/**
* A set of utility methods for Launcher DB used for DB updates and migration.
@@ -107,9 +108,11 @@
Cursor c = db.query(
Favorites.TABLE_NAME, null, "itemType = 1", null, null, null, null);
UserManagerState ums = new UserManagerState();
+ PackageManagerHelper pmHelper = PackageManagerHelper.INSTANCE.get(context);
ums.init(UserCache.INSTANCE.get(context),
context.getSystemService(UserManager.class));
- LoaderCursor lc = new LoaderCursor(c, LauncherAppState.getInstance(context), ums, null);
+ LoaderCursor lc = new LoaderCursor(c, LauncherAppState.getInstance(context), ums, pmHelper,
+ null);
IntSet deletedShortcuts = new IntSet();
while (lc.moveToNext()) {
diff --git a/src/com/android/launcher3/provider/RestoreDbTask.java b/src/com/android/launcher3/provider/RestoreDbTask.java
index a4ff29f..21897bf 100644
--- a/src/com/android/launcher3/provider/RestoreDbTask.java
+++ b/src/com/android/launcher3/provider/RestoreDbTask.java
@@ -418,9 +418,7 @@
DeviceGridState deviceGridState = new DeviceGridState(context);
FileLog.d(TAG, "restore initiated from backup: DeviceGridState=" + deviceGridState);
LauncherPrefs.get(context).putSync(RESTORE_DEVICE.to(deviceGridState.getDeviceType()));
- if (enableLauncherBrMetricsFixed()) {
- LauncherPrefs.get(context).putSync(IS_FIRST_LOAD_AFTER_RESTORE.to(true));
- }
+ LauncherPrefs.get(context).putSync(IS_FIRST_LOAD_AFTER_RESTORE.to(true));
}
@WorkerThread
diff --git a/src/com/android/launcher3/qsb/QsbContainerView.java b/src/com/android/launcher3/qsb/QsbContainerView.java
index 8e53aff..d6b41b0 100644
--- a/src/com/android/launcher3/qsb/QsbContainerView.java
+++ b/src/com/android/launcher3/qsb/QsbContainerView.java
@@ -61,7 +61,7 @@
*/
public class QsbContainerView extends FrameLayout {
- public static final String SEARCH_PROVIDER_SETTINGS_KEY = "SEARCH_PROVIDER_PACKAGE_NAME";
+ public static final String SEARCH_ENGINE_SETTINGS_KEY = "selected_search_engine";
/**
* Returns the package name for user configured search provider or from searchManager
@@ -71,8 +71,8 @@
@WorkerThread
@Nullable
public static String getSearchWidgetPackageName(@NonNull Context context) {
- String providerPkg = Settings.Global.getString(context.getContentResolver(),
- SEARCH_PROVIDER_SETTINGS_KEY);
+ String providerPkg = Settings.Secure.getString(context.getContentResolver(),
+ SEARCH_ENGINE_SETTINGS_KEY);
if (providerPkg == null) {
SearchManager searchManager = context.getSystemService(SearchManager.class);
ComponentName componentName = searchManager.getGlobalSearchActivity();
diff --git a/src/com/android/launcher3/recyclerview/AllAppsRecyclerViewPool.kt b/src/com/android/launcher3/recyclerview/AllAppsRecyclerViewPool.kt
index 6d6b3b6..6ff51ca 100644
--- a/src/com/android/launcher3/recyclerview/AllAppsRecyclerViewPool.kt
+++ b/src/com/android/launcher3/recyclerview/AllAppsRecyclerViewPool.kt
@@ -17,10 +17,12 @@
package com.android.launcher3.recyclerview
import android.content.Context
+import android.util.Log
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.RecycledViewPool
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.android.launcher3.BubbleTextView
+import com.android.launcher3.BuildConfig
import com.android.launcher3.allapps.BaseAllAppsAdapter
import com.android.launcher3.config.FeatureFlags
import com.android.launcher3.util.CancellableTask
@@ -43,6 +45,12 @@
var hasWorkProfile = false
private var mCancellableTask: CancellableTask<List<ViewHolder>>? = null
+ companion object {
+ private const val TAG = "AllAppsRecyclerViewPool"
+ private const val NULL_LAYOUT_MANAGER_ERROR_STRING =
+ "activeRv's layoutManager should not be null"
+ }
+
/**
* Preinflate app icons. If all apps RV cannot be scrolled down, we don't need to preinflate.
*/
@@ -54,6 +62,15 @@
return
}
+ if (activeRv.layoutManager == null) {
+ if (BuildConfig.IS_STUDIO_BUILD) {
+ throw IllegalStateException(NULL_LAYOUT_MANAGER_ERROR_STRING)
+ } else {
+ Log.e(TAG, NULL_LAYOUT_MANAGER_ERROR_STRING)
+ }
+ return
+ }
+
// Create a separate context dedicated for all apps preinflation thread. The goal is to
// create a separate AssetManager obj internally to avoid lock contention with
// AssetManager obj that is associated with the launcher context on the main thread.
@@ -77,6 +94,7 @@
null
) {
override fun setAppsPerRow(appsPerRow: Int) = Unit
+
override fun getLayoutManager(): RecyclerView.LayoutManager? = null
}
@@ -90,6 +108,11 @@
if (task?.canceled == true) {
break
}
+ // If activeRv's layout manager has been reset to null on main thread, skip
+ // the preinflation as we cannot generate correct LayoutParams
+ if (activeRv.layoutManager == null) {
+ break
+ }
list.add(
adapter.createViewHolder(activeRv, BaseAllAppsAdapter.VIEW_TYPE_ICON)
)
diff --git a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
index 7502a43..2c3035f 100644
--- a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
+++ b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
@@ -135,7 +135,7 @@
hotseatQsbSpace.fixedSize + edgePadding.fixedSize <= maxAvailableSize
private fun logError(message: String) {
- Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
+ Log.e(LOG_TAG, "$LOG_TAG #isValid - $message - $this")
}
companion object {
diff --git a/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt b/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt
index a4b25e5..ef9b7df 100644
--- a/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt
+++ b/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt
@@ -31,7 +31,7 @@
groupOfSpecs
.onEach { group ->
check(group.widthSpecs.isEmpty() && group.heightSpecs.isNotEmpty()) {
- "${this::class.simpleName} is invalid, only heightSpecs are allowed - " +
+ "$LOG_TAG is invalid, only heightSpecs are allowed - " +
"width list size = ${group.widthSpecs.size}; " +
"height list size = ${group.heightSpecs.size}."
}
@@ -65,6 +65,7 @@
}
companion object {
+ private const val LOG_TAG = "ResponsiveCellSpecsProvider"
@JvmStatic
fun create(resourceHelper: ResourceHelper): ResponsiveCellSpecsProvider {
val parser = ResponsiveSpecsParser(resourceHelper)
@@ -137,11 +138,11 @@
}
private fun logError(message: String) {
- Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
+ Log.e(LOG_TAG, "$LOG_TAG#isValid - $message - $this")
}
companion object {
- private const val LOG_TAG = "CellSpec"
+ const val LOG_TAG = "CellSpec"
}
}
@@ -182,6 +183,7 @@
)
companion object {
+ private const val LOG_TAG = "CalculatedCellSpec"
private fun getCalculatedValue(
availableSpace: Int,
spec: SizeSpec,
@@ -191,10 +193,10 @@
}
override fun toString(): String {
- return "${this::class.simpleName}(" +
+ return "$LOG_TAG(" +
"availableSpace=$availableSpace, iconSize=$iconSize, " +
"iconTextSize=$iconTextSize, iconDrawablePadding=$iconDrawablePadding, " +
- "${spec::class.simpleName}.maxAvailableSize=${spec.maxAvailableSize}" +
+ "${CellSpec.LOG_TAG}.maxAvailableSize=${spec.maxAvailableSize}" +
")"
}
}
diff --git a/src/com/android/launcher3/responsive/ResponsiveSpec.kt b/src/com/android/launcher3/responsive/ResponsiveSpec.kt
index 65e0b32..e69324d 100644
--- a/src/com/android/launcher3/responsive/ResponsiveSpec.kt
+++ b/src/com/android/launcher3/responsive/ResponsiveSpec.kt
@@ -154,7 +154,7 @@
}
private fun logError(message: String) {
- Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
+ Log.e(LOG_TAG, "$LOG_TAG#isValid - $message - $this")
}
enum class DimensionType {
diff --git a/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt b/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
index 67eaac0..654608d 100644
--- a/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
+++ b/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
@@ -40,7 +40,7 @@
groupOfSpecs
.onEach { group ->
check(group.widthSpecs.isNotEmpty() && group.heightSpecs.isNotEmpty()) {
- "${this::class.simpleName} is incomplete - " +
+ "$LOG_TAG is incomplete - " +
"width list size = ${group.widthSpecs.size}; " +
"height list size = ${group.heightSpecs.size}."
}
@@ -124,6 +124,7 @@
}
companion object {
+ private const val LOG_TAG = "ResponsiveSpecsProvider"
@JvmStatic
fun create(
resourceHelper: ResourceHelper,
diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
index 0299a23..9b3292d 100644
--- a/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
+++ b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
@@ -59,6 +59,7 @@
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.BaseDragLayer;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
import java.util.HashMap;
import java.util.Map;
@@ -76,6 +77,7 @@
private View mAppsButton;
private PopupDataProvider mPopupDataProvider;
+ private WidgetPickerDataProvider mWidgetPickerDataProvider;
private boolean mAppDrawerShown = false;
@@ -315,6 +317,11 @@
}
@Override
+ public WidgetPickerDataProvider getWidgetPickerDataProvider() {
+ return mWidgetPickerDataProvider;
+ }
+
+ @Override
public OnClickListener getItemOnClickListener() {
return this::onIconClicked;
}
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 52ce4e8..bd9298b 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -44,11 +44,13 @@
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceFragmentCompat.OnPreferenceStartFragmentCallback;
import androidx.preference.PreferenceFragmentCompat.OnPreferenceStartScreenCallback;
+import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceGroup.PreferencePositionCallback;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.BuildConfig;
+import com.android.launcher3.Flags;
import com.android.launcher3.LauncherFiles;
import com.android.launcher3.R;
import com.android.launcher3.states.RotationHelper;
@@ -165,6 +167,7 @@
private boolean mRestartOnResume = false;
private String mHighLightKey;
+
private boolean mPreferenceHighlighted = false;
@Override
@@ -198,11 +201,62 @@
}
}
+ // If the target preference is not in the current preference screen, find the parent
+ // preference screen that contains the target preference and set it as the preference
+ // screen.
+ if (Flags.navigateToChildPreference()
+ && mHighLightKey != null
+ && !isKeyInPreferenceGroup(mHighLightKey, screen)) {
+ final PreferenceScreen parentPreferenceScreen =
+ findParentPreference(screen, mHighLightKey);
+ if (parentPreferenceScreen != null && getActivity() != null) {
+ if (!TextUtils.isEmpty(parentPreferenceScreen.getTitle())) {
+ getActivity().setTitle(parentPreferenceScreen.getTitle());
+ }
+ setPreferenceScreen(parentPreferenceScreen);
+ return;
+ }
+ }
+
if (getActivity() != null && !TextUtils.isEmpty(getPreferenceScreen().getTitle())) {
getActivity().setTitle(getPreferenceScreen().getTitle());
}
}
+ private boolean isKeyInPreferenceGroup(String targetKey, PreferenceGroup parent) {
+ for (int i = 0; i < parent.getPreferenceCount(); i++) {
+ Preference pref = parent.getPreference(i);
+ if (pref.getKey() != null && pref.getKey().equals(targetKey)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Finds the parent preference screen for the given target key.
+ *
+ * @param parent the parent preference screen
+ * @param targetKey the key of the preference to find
+ * @return the parent preference screen that contains the target preference
+ */
+ @Nullable
+ private PreferenceScreen findParentPreference(PreferenceScreen parent, String targetKey) {
+ for (int i = 0; i < parent.getPreferenceCount(); i++) {
+ Preference pref = parent.getPreference(i);
+ if (pref instanceof PreferenceScreen) {
+ PreferenceScreen foundKey = findParentPreference((PreferenceScreen) pref,
+ targetKey);
+ if (foundKey != null) {
+ return foundKey;
+ }
+ } else if (pref.getKey() != null && pref.getKey().equals(targetKey)) {
+ return parent;
+ }
+ }
+ return null;
+ }
+
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
diff --git a/src/com/android/launcher3/statemanager/BaseState.java b/src/com/android/launcher3/statemanager/BaseState.java
index a01d402..b81729a 100644
--- a/src/com/android/launcher3/statemanager/BaseState.java
+++ b/src/com/android/launcher3/statemanager/BaseState.java
@@ -21,7 +21,7 @@
import com.android.launcher3.views.ActivityContext;
/**
- * Interface representing a state of a StatefulActivity
+ * Interface representing a state of a StatefulContainer
*/
public interface BaseState<T extends BaseState> {
diff --git a/src/com/android/launcher3/statemanager/StateManager.java b/src/com/android/launcher3/statemanager/StateManager.java
index eea1a7d..ac07c0f 100644
--- a/src/com/android/launcher3/statemanager/StateManager.java
+++ b/src/com/android/launcher3/statemanager/StateManager.java
@@ -26,6 +26,7 @@
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
+import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@@ -47,8 +48,11 @@
/**
* Class to manage transitions between different states for a StatefulActivity based on different
* states
+ * @param STATE_TYPE Basestate used by the state manager
+ * @param STATEFUL_CONTAINER container object used to manage state
*/
-public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {
+public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>,
+ STATEFUL_CONTAINER extends Context & StatefulContainer<STATE_TYPE>> {
public static final String TAG = "StateManager";
// b/279059025, b/325463989
@@ -56,7 +60,7 @@
private final AnimationState mConfig = new AnimationState();
private final Handler mUiHandler;
- private final StatefulActivity<STATE_TYPE> mActivity;
+ private final STATEFUL_CONTAINER mStatefulContainer;
private final ArrayList<StateListener<STATE_TYPE>> mListeners = new ArrayList<>();
private final STATE_TYPE mBaseState;
@@ -71,12 +75,12 @@
private STATE_TYPE mRestState;
- public StateManager(StatefulActivity<STATE_TYPE> l, STATE_TYPE baseState) {
+ public StateManager(STATEFUL_CONTAINER container, STATE_TYPE baseState) {
mUiHandler = new Handler(Looper.getMainLooper());
- mActivity = l;
+ mStatefulContainer = container;
mBaseState = baseState;
mState = mLastStableState = mCurrentStableState = baseState;
- mAtomicAnimationFactory = l.createAtomicAnimationFactory();
+ mAtomicAnimationFactory = container.createAtomicAnimationFactory();
}
public STATE_TYPE getState() {
@@ -109,10 +113,10 @@
writer.println(prefix + "\tisInTransition:" + isInTransition());
}
- public StateHandler[] getStateHandlers() {
+ public StateHandler<STATE_TYPE>[] getStateHandlers() {
if (mStateHandlers == null) {
- ArrayList<StateHandler> handlers = new ArrayList<>();
- mActivity.collectStateHandlers(handlers);
+ ArrayList<StateHandler<STATE_TYPE>> handlers = new ArrayList<>();
+ mStatefulContainer.collectStateHandlers(handlers);
mStateHandlers = handlers.toArray(new StateHandler[handlers.size()]);
}
return mStateHandlers;
@@ -130,7 +134,7 @@
* Returns true if the state changes should be animated.
*/
public boolean shouldAnimateStateChange() {
- return !mActivity.isForceInvisible() && mActivity.isStarted();
+ return mStatefulContainer.shouldAnimateStateChange();
}
/**
@@ -245,7 +249,7 @@
}
animated &= areAnimatorsEnabled();
- if (mActivity.isInState(state)) {
+ if (mStatefulContainer.isInState(state)) {
if (mConfig.currentAnimation == null) {
// Run any queued runnable
if (listener != null) {
@@ -302,8 +306,8 @@
// Since state mBaseState can be reached from multiple states, just assume that the
// transition plays in reverse and use the same duration as previous state.
mConfig.duration = state == mBaseState
- ? fromState.getTransitionDuration(mActivity, false /* isToState */)
- : state.getTransitionDuration(mActivity, true /* isToState */);
+ ? fromState.getTransitionDuration(mStatefulContainer, false /* isToState */)
+ : state.getTransitionDuration(mStatefulContainer, true /* isToState */);
prepareForAtomicAnimation(fromState, state, mConfig);
AnimatorSet animation = createAnimationToNewWorkspaceInternal(state).buildAnim();
if (listener != null) {
@@ -336,7 +340,7 @@
PendingAnimation builder = new PendingAnimation(config.duration);
prepareForAtomicAnimation(fromState, toState, config);
- for (StateHandler handler : mActivity.getStateManager().getStateHandlers()) {
+ for (StateHandler handler : mStatefulContainer.getStateManager().getStateHandlers()) {
handler.setStateWithAnimation(toState, config, builder);
}
return builder.buildAnim();
@@ -402,7 +406,7 @@
private void onStateTransitionStart(STATE_TYPE state) {
mState = state;
- mActivity.onStateSetStart(mState);
+ mStatefulContainer.onStateSetStart(mState);
if (DEBUG) {
Log.d(TAG, "onStateTransitionStart - state: " + state);
@@ -419,7 +423,7 @@
mCurrentStableState = state;
}
- mActivity.onStateSetEnd(state);
+ mStatefulContainer.onStateSetEnd(state);
if (state == mBaseState) {
setRestState(null);
}
diff --git a/src/com/android/launcher3/statemanager/StatefulActivity.java b/src/com/android/launcher3/statemanager/StatefulActivity.java
index 30ba703..28f2def 100644
--- a/src/com/android/launcher3/statemanager/StatefulActivity.java
+++ b/src/com/android/launcher3/statemanager/StatefulActivity.java
@@ -18,7 +18,6 @@
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
-import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS;
import static com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE;
import android.content.res.Configuration;
@@ -29,11 +28,9 @@
import androidx.annotation.CallSuper;
-import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.LauncherRootView;
import com.android.launcher3.Utilities;
-import com.android.launcher3.statemanager.StateManager.AtomicAnimationFactory;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.util.window.WindowManagerProxy;
import com.android.launcher3.views.BaseDragLayer;
@@ -45,7 +42,7 @@
* @param <STATE_TYPE> Type of state object
*/
public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>>
- extends BaseDraggingActivity {
+ extends BaseDraggingActivity implements StatefulContainer<STATE_TYPE> {
public final Handler mHandler = new Handler();
private final Runnable mHandleDeferredResume = this::handleDeferredResume;
@@ -67,19 +64,9 @@
/**
* Create handlers to control the property changes for this activity
*/
- protected abstract void collectStateHandlers(List<StateHandler> out);
- /**
- * Returns true if the activity is in the provided state
- */
- public boolean isInState(STATE_TYPE state) {
- return getStateManager().getState() == state;
- }
-
- /**
- * Returns the state manager for this activity
- */
- public abstract StateManager<STATE_TYPE> getStateManager();
+ @Override
+ public abstract void collectStateHandlers(List<StateHandler<STATE_TYPE>> out);
protected void inflateRootView(int layoutId) {
mRootView = (LauncherRootView) LayoutInflater.from(this).inflate(layoutId, null);
@@ -106,22 +93,12 @@
if (mDeferredResumePending) {
handleDeferredResume();
}
-
- if (state.hasFlag(FLAG_CLOSE_POPUPS)) {
- AbstractFloatingView.closeAllOpenViews(this, !state.hasFlag(FLAG_NON_INTERACTIVE));
- }
+ StatefulContainer.super.onStateSetStart(state);
}
- /**
- * Called when transition to state ends
- */
- public void onStateSetEnd(STATE_TYPE state) { }
-
- /**
- * Creates a factory for atomic state animations
- */
- public AtomicAnimationFactory<STATE_TYPE> createAtomicAnimationFactory() {
- return new AtomicAnimationFactory(0);
+ @Override
+ public boolean shouldAnimateStateChange() {
+ return !isForceInvisible() && isStarted();
}
@Override
diff --git a/src/com/android/launcher3/statemanager/StatefulContainer.java b/src/com/android/launcher3/statemanager/StatefulContainer.java
new file mode 100644
index 0000000..0cf0a27
--- /dev/null
+++ b/src/com/android/launcher3/statemanager/StatefulContainer.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.statemanager;
+
+
+import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS;
+import static com.android.launcher3.statemanager.BaseState.FLAG_NON_INTERACTIVE;
+
+import androidx.annotation.CallSuper;
+
+import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.views.ActivityContext;
+
+import java.util.List;
+
+/**
+ * Interface for a container that can be managed by a state manager.
+ *
+ * @param <STATE_TYPE> The type of state that the container can be in.
+ */
+public interface StatefulContainer<STATE_TYPE extends BaseState<STATE_TYPE>> extends
+ ActivityContext {
+
+ /**
+ * Creates a factory for atomic state animations
+ */
+ default StateManager.AtomicAnimationFactory<STATE_TYPE> createAtomicAnimationFactory() {
+ return new StateManager.AtomicAnimationFactory<>(0);
+ }
+
+ /**
+ * Create handlers to control the property changes for this activity
+ */
+ void collectStateHandlers(List<StateManager.StateHandler<STATE_TYPE>> out);
+
+ /**
+ * Retrieves state manager for given container
+ */
+ StateManager<STATE_TYPE, ?> getStateManager();
+
+ /**
+ * Called when transition to state ends
+ * @param state current state of State_Type
+ */
+ default void onStateSetEnd(STATE_TYPE state) { }
+
+ /**
+ * Called when transition to state starts
+ * @param state current state of State_Type
+ */
+ @CallSuper
+ default void onStateSetStart(STATE_TYPE state) {
+ if (state.hasFlag(FLAG_CLOSE_POPUPS)) {
+ AbstractFloatingView.closeAllOpenViews(this, !state.hasFlag(FLAG_NON_INTERACTIVE));
+ }
+ }
+
+ /**
+ * Returns true if the activity is in the provided state
+ * @param state current state of State_Type
+ */
+ default boolean isInState(STATE_TYPE state) {
+ return getStateManager().getState() == state;
+ }
+
+ /**
+ * Returns true if state change should transition with animation
+ */
+ boolean shouldAnimateStateChange();
+}
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index db2a6e0..6d9b891 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -501,7 +501,7 @@
/**
* Returns the result by getting a generic property on UI thread
*/
- private static <S, T> Bundle getUIProperty(
+ protected static <S, T> Bundle getUIProperty(
BundleSetter<T> bundleSetter, Function<S, T> provider, Supplier<S> targetSupplier) {
return getFromExecutorSync(MAIN_EXECUTOR, () -> {
S target = targetSupplier.get();
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 50f98f2..3817563 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -411,17 +411,29 @@
mLauncher.getStatsLogManager().logger()
.withSrcState(mStartState.statsLogOrdinal)
.withDstState(targetState.statsLogOrdinal)
- .withContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
- .setWorkspace(
- LauncherAtom.WorkspaceContainer.newBuilder()
- .setPageIndex(mLauncher.getWorkspace().getCurrentPage()))
- .build())
+ .withContainerInfo(getContainerInfo(targetState))
.log(StatsLogManager.getLauncherAtomEvent(mStartState.statsLogOrdinal,
targetState.statsLogOrdinal, mToState.ordinal > mFromState.ordinal
? LAUNCHER_UNKNOWN_SWIPEUP
: LAUNCHER_UNKNOWN_SWIPEDOWN));
}
+ private LauncherAtom.ContainerInfo getContainerInfo(LauncherState targetState) {
+ if (targetState.isRecentsViewVisible) {
+ return LauncherAtom.ContainerInfo.newBuilder()
+ .setTaskSwitcherContainer(
+ LauncherAtom.TaskSwitcherContainer.getDefaultInstance()
+ )
+ .build();
+ }
+
+ return LauncherAtom.ContainerInfo.newBuilder()
+ .setWorkspace(
+ LauncherAtom.WorkspaceContainer.newBuilder()
+ .setPageIndex(mLauncher.getWorkspace().getCurrentPage()))
+ .build();
+ }
+
protected void clearState() {
cancelAnimationControllers();
mGoingBetweenStates = true;
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index 0ed6ea0..78709b8 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -46,7 +46,6 @@
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
@@ -67,10 +66,7 @@
import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.views.FloatingIconView;
-import com.android.launcher3.views.Snackbar;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
-import com.android.launcher3.widget.PendingAddShortcutInfo;
-import com.android.launcher3.widget.PendingAddWidgetInfo;
import com.android.launcher3.widget.PendingAppWidgetHostView;
import com.android.launcher3.widget.WidgetAddFlowHandler;
import com.android.launcher3.widget.WidgetManagerHelper;
@@ -84,7 +80,8 @@
*/
public class ItemClickHandler {
- private static final String TAG = ItemClickHandler.class.getSimpleName();
+ private static final String TAG = "ItemClickHandler";
+ private static final boolean DEBUG = true;
/**
* Instance used for click handling on items
@@ -110,20 +107,22 @@
startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher);
} else if (tag instanceof LauncherAppWidgetInfo) {
if (v instanceof PendingAppWidgetHostView) {
+ if (DEBUG) {
+ String targetPackage = ((LauncherAppWidgetInfo) tag).getTargetPackage();
+ Log.d(TAG, "onClick: PendingAppWidgetHostView clicked for"
+ + " package=" + targetPackage);
+ }
onClickPendingWidget((PendingAppWidgetHostView) v, launcher);
+ } else {
+ if (DEBUG) {
+ String targetPackage = ((LauncherAppWidgetInfo) tag).getTargetPackage();
+ Log.d(TAG, "onClick: LauncherAppWidgetInfo clicked,"
+ + " but not instance of PendingAppWidgetHostView. Returning."
+ + " package=" + targetPackage);
+ }
}
} else if (tag instanceof ItemClickProxy) {
((ItemClickProxy) tag).onItemClicked(v);
- } else if (tag instanceof PendingAddShortcutInfo) {
- CharSequence msg = Utilities.wrapForTts(
- launcher.getText(R.string.long_press_shortcut_to_add),
- launcher.getString(R.string.long_accessible_way_to_add_shortcut));
- Snackbar.show(launcher, msg, null);
- } else if (tag instanceof PendingAddWidgetInfo) {
- CharSequence msg = Utilities.wrapForTts(
- launcher.getText(R.string.long_press_widget_to_add),
- launcher.getString(R.string.long_accessible_way_to_add));
- Snackbar.show(launcher, msg, null);
}
}
@@ -199,6 +198,9 @@
LauncherAppWidgetProviderInfo appWidgetInfo = new WidgetManagerHelper(launcher)
.findProvider(info.providerName, info.user);
if (appWidgetInfo == null) {
+ Log.e(TAG, "onClickPendingWidget: Pending widget ready for click setup,"
+ + " but LauncherAppWidgetProviderInfo was null. Returning."
+ + " component=" + info.getTargetComponent());
return;
}
WidgetAddFlowHandler addFlowHandler = new WidgetAddFlowHandler(appWidgetInfo);
@@ -206,6 +208,10 @@
if (info.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_ID_NOT_VALID)) {
if (!info.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_ID_ALLOCATED)) {
// This should not happen, as we make sure that an Id is allocated during bind.
+ Log.e(TAG, "onClickPendingWidget: Pending widget ready for click setup,"
+ + " and LauncherAppWidgetProviderInfo was found. However,"
+ + " no appWidgetId was allocated. Returning."
+ + " component=" + info.getTargetComponent());
return;
}
addFlowHandler.startBindFlow(launcher, info.appWidgetId, info,
diff --git a/src/com/android/launcher3/util/ApiWrapper.java b/src/com/android/launcher3/util/ApiWrapper.java
index 6429a43..095518c 100644
--- a/src/com/android/launcher3/util/ApiWrapper.java
+++ b/src/com/android/launcher3/util/ApiWrapper.java
@@ -16,10 +16,12 @@
package com.android.launcher3.util;
+import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_HOME_ROLE;
import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
import android.app.ActivityOptions;
import android.app.Person;
+import android.app.role.RoleManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.LauncherActivityInfo;
@@ -33,6 +35,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.BuildConfig;
+import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -136,6 +139,23 @@
return false;
}
+ /**
+ * Starts an Activity which can be used to set this Launcher as the HOME app, via a consent
+ * screen. In case the consent screen cannot be shown, or the user does not set current Launcher
+ * as HOME app, a toast asking the user to do the latter is shown.
+ */
+ public void assignDefaultHomeRole(Context context) {
+ RoleManager roleManager = context.getSystemService(RoleManager.class);
+ assert roleManager != null;
+ if (roleManager.isRoleAvailable(RoleManager.ROLE_HOME)
+ && !roleManager.isRoleHeld(RoleManager.ROLE_HOME)) {
+ Intent roleRequestIntent = roleManager.createRequestRoleIntent(
+ RoleManager.ROLE_HOME);
+ Launcher launcher = Launcher.getLauncher(context);
+ launcher.startActivityForResult(roleRequestIntent, REQUEST_HOME_ROLE);
+ }
+ }
+
@Override
public void close() { }
diff --git a/src/com/android/launcher3/util/CannedAnimationCoordinator.kt b/src/com/android/launcher3/util/CannedAnimationCoordinator.kt
index 85f81f5..749caac 100644
--- a/src/com/android/launcher3/util/CannedAnimationCoordinator.kt
+++ b/src/com/android/launcher3/util/CannedAnimationCoordinator.kt
@@ -113,10 +113,9 @@
// flags accordingly
animationController =
controller.apply {
- activity.stateManager.setCurrentAnimation(
- this,
- USER_CONTROLLED or HANDLE_STATE_APPLY
- )
+ activity
+ .stateManager
+ .setCurrentAnimation(this, USER_CONTROLLED or HANDLE_STATE_APPLY)
}
recreateAnimation(provider)
}
diff --git a/src/com/android/launcher3/util/DimensionUtils.kt b/src/com/android/launcher3/util/DimensionUtils.kt
index 63e919a..821dda7 100644
--- a/src/com/android/launcher3/util/DimensionUtils.kt
+++ b/src/com/android/launcher3/util/DimensionUtils.kt
@@ -31,7 +31,8 @@
fun getTaskbarPhoneDimensions(
deviceProfile: DeviceProfile,
res: Resources,
- isPhoneMode: Boolean
+ isPhoneMode: Boolean,
+ isGestureNav: Boolean,
): Point {
val p = Point()
// Taskbar for large screen
@@ -42,7 +43,7 @@
}
// Taskbar on phone using gesture nav, it will always be stashed
- if (deviceProfile.isGestureMode) {
+ if (isGestureNav) {
p.x = ViewGroup.LayoutParams.MATCH_PARENT
p.y = res.getDimensionPixelSize(R.dimen.taskbar_stashed_size)
return p
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 92fc38f..b1e82bb 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -49,6 +49,7 @@
import android.view.Display;
import androidx.annotation.AnyThread;
+import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
@@ -76,6 +77,7 @@
private static final String TAG = "DisplayController";
private static final boolean DEBUG = false;
+ private static boolean sTaskbarModePreferenceStatusForTests = false;
private static boolean sTransientTaskbarStatusForTests = true;
// TODO(b/254119092) remove all logs with this tag
@@ -109,7 +111,10 @@
private DisplayInfoChangeListener mPriorityListener;
private final ArrayList<DisplayInfoChangeListener> mListeners = new ArrayList<>();
- private final SimpleBroadcastReceiver mReceiver = new SimpleBroadcastReceiver(this::onIntent);
+ // We will register broadcast receiver on main thread to ensure not missing changes on
+ // TARGET_OVERLAY_PACKAGE and ACTION_OVERLAY_CHANGED.
+ private final SimpleBroadcastReceiver mReceiver =
+ new SimpleBroadcastReceiver(MAIN_EXECUTOR, this::onIntent);
private Info mInfo;
private boolean mDestroyed = false;
@@ -170,16 +175,23 @@
* Returns the current navigation mode
*/
public static NavigationMode getNavigationMode(Context context) {
- return INSTANCE.get(context).getInfo().navigationMode;
+ return INSTANCE.get(context).getInfo().getNavigationMode();
}
/**
- * Returns whether taskbar is transient.
+ * Returns whether taskbar is transient or persistent.
+ *
+ * @return {@code true} if transient, {@code false} if persistent.
*/
public static boolean isTransientTaskbar(Context context) {
return INSTANCE.get(context).getInfo().isTransientTaskbar();
}
+ /** Returns whether we are currently in Desktop mode. */
+ public static boolean isInDesktopMode(Context context) {
+ return INSTANCE.get(context).getInfo().isInDesktopMode();
+ }
+
/**
* Handles info change for desktop mode.
*/
@@ -196,6 +208,14 @@
}
/**
+ * Enables respecting taskbar mode preference during test.
+ */
+ @VisibleForTesting
+ public static void enableTaskbarModePreferenceForTests(boolean enable) {
+ sTaskbarModePreferenceStatusForTests = enable;
+ }
+
+ /**
* Returns whether the taskbar is pinned in gesture navigation mode.
*/
public static boolean isPinnedTaskbar(Context context) {
@@ -216,6 +236,7 @@
} else {
// TODO: unregister broadcast receiver
}
+ mReceiver.unregisterReceiverSafely(mContext);
}
/**
@@ -302,7 +323,7 @@
Info newInfo = new Info(displayInfoContext, wmProxy, oldInfo.mPerDisplayBounds);
if (newInfo.densityDpi != oldInfo.densityDpi || newInfo.fontScale != oldInfo.fontScale
- || newInfo.navigationMode != oldInfo.navigationMode) {
+ || newInfo.getNavigationMode() != oldInfo.getNavigationMode()) {
// Cache may not be valid anymore, recreate without cache
newInfo = new Info(displayInfoContext, wmProxy,
wmProxy.estimateInternalDisplayBounds(displayInfoContext));
@@ -318,7 +339,7 @@
if (newInfo.densityDpi != oldInfo.densityDpi || newInfo.fontScale != oldInfo.fontScale) {
change |= CHANGE_DENSITY;
}
- if (newInfo.navigationMode != oldInfo.navigationMode) {
+ if (newInfo.getNavigationMode() != oldInfo.getNavigationMode()) {
change |= CHANGE_NAVIGATION_MODE;
}
if (!newInfo.supportedBounds.equals(oldInfo.supportedBounds)
@@ -369,7 +390,7 @@
// Configuration property
public final float fontScale;
private final int densityDpi;
- public final NavigationMode navigationMode;
+ private final NavigationMode navigationMode;
private final PortraitSize mScreenSizeDp;
// WindowBounds
@@ -405,7 +426,7 @@
navigationMode = wmProxy.getNavigationMode(displayInfoContext);
mPerDisplayBounds.putAll(perDisplayBoundsCache);
- List<WindowBounds> cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
+ List<WindowBounds> cachedValue = getCurrentBounds();
realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
if (cachedValue == null) {
@@ -415,7 +436,7 @@
FileLog.e(TAG, "(Invalid Cache) perDisplayBounds : " + mPerDisplayBounds);
mPerDisplayBounds.clear();
mPerDisplayBounds.putAll(wmProxy.estimateInternalDisplayBounds(displayInfoContext));
- cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
+ cachedValue = getCurrentBounds();
if (cachedValue == null) {
FileLog.e(TAG, "normalizedDisplayInfo not found in estimation: "
+ normalizedDisplayInfo);
@@ -453,7 +474,7 @@
if (navigationMode != NavigationMode.NO_BUTTON) {
return false;
}
- if (Utilities.isRunningInTestHarness()) {
+ if (Utilities.isRunningInTestHarness() && !sTaskbarModePreferenceStatusForTests) {
// TODO(b/258604917): Once ENABLE_TASKBAR_PINNING is enabled, remove usage of
// sTransientTaskbarStatusForTests and update test to directly
// toggle shared preference to switch transient taskbar on/off.
@@ -505,6 +526,12 @@
return Collections.unmodifiableSet(mPerDisplayBounds.keySet());
}
+ /** Returns all {@link WindowBounds}s for the current display. */
+ @Nullable
+ public List<WindowBounds> getCurrentBounds() {
+ return mPerDisplayBounds.get(normalizedDisplayInfo);
+ }
+
public int getDensityDpi() {
return densityDpi;
}
@@ -553,7 +580,7 @@
pw.println(" rotation=" + info.rotation);
pw.println(" fontScale=" + info.fontScale);
pw.println(" densityDpi=" + info.densityDpi);
- pw.println(" navigationMode=" + info.navigationMode.name());
+ pw.println(" navigationMode=" + info.getNavigationMode().name());
pw.println(" isTaskbarPinned=" + info.mIsTaskbarPinned);
pw.println(" isTaskbarPinnedInDesktopMode=" + info.mIsTaskbarPinnedInDesktopMode);
pw.println(" isInDesktopMode=" + info.mIsInDesktopMode);
diff --git a/src/com/android/launcher3/util/FlagDebugUtils.kt b/src/com/android/launcher3/util/FlagDebugUtils.kt
index f281943..33b8330 100644
--- a/src/com/android/launcher3/util/FlagDebugUtils.kt
+++ b/src/com/android/launcher3/util/FlagDebugUtils.kt
@@ -2,6 +2,7 @@
import java.util.StringJoiner
import java.util.function.IntFunction
+import java.util.function.LongFunction
object FlagDebugUtils {
@@ -12,6 +13,13 @@
str.add(flagName)
}
}
+ /** Appends the [flagName] to [str] when the [flag] is set in [flags]. */
+ @JvmStatic
+ fun appendFlag(str: StringJoiner, flags: Long, flag: Long, flagName: String) {
+ if (flags and flag != 0L) {
+ str.add(flagName)
+ }
+ }
/**
* Produces a human-readable representation of the [current] flags, followed by a diff from from
@@ -34,4 +42,30 @@
}
return result.toString()
}
+
+ /**
+ * Produces a human-readable representation of the [current] flags, followed by a diff from from
+ * [previous].
+ *
+ * The resulting string is intented for logging and debugging.
+ */
+ @JvmStatic
+ fun formatFlagChange(
+ current: Long,
+ previous: Long,
+ flagSerializer: LongFunction<String>
+ ): String {
+ val result = StringJoiner(" ")
+ result.add("[" + flagSerializer.apply(current) + "]")
+ val changed = current xor previous
+ val added = current and changed
+ if (added != 0L) {
+ result.add("+[" + flagSerializer.apply(added) + "]")
+ }
+ val removed = previous and changed
+ if (removed != 0L) {
+ result.add("-[" + flagSerializer.apply(removed) + "]")
+ }
+ return result.toString()
+ }
}
diff --git a/src/com/android/launcher3/util/LauncherLayoutBuilder.kt b/src/com/android/launcher3/util/LauncherLayoutBuilder.kt
new file mode 100644
index 0000000..ecc9953
--- /dev/null
+++ b/src/com/android/launcher3/util/LauncherLayoutBuilder.kt
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.util
+
+import android.util.Xml
+import com.android.launcher3.AutoInstallsLayout.ATTR_CLASS_NAME
+import com.android.launcher3.AutoInstallsLayout.ATTR_CONTAINER
+import com.android.launcher3.AutoInstallsLayout.ATTR_PACKAGE_NAME
+import com.android.launcher3.AutoInstallsLayout.ATTR_RANK
+import com.android.launcher3.AutoInstallsLayout.ATTR_SCREEN
+import com.android.launcher3.AutoInstallsLayout.ATTR_SHORTCUT_ID
+import com.android.launcher3.AutoInstallsLayout.ATTR_SPAN_X
+import com.android.launcher3.AutoInstallsLayout.ATTR_SPAN_Y
+import com.android.launcher3.AutoInstallsLayout.ATTR_TITLE
+import com.android.launcher3.AutoInstallsLayout.ATTR_TITLE_TEXT
+import com.android.launcher3.AutoInstallsLayout.ATTR_USER_TYPE
+import com.android.launcher3.AutoInstallsLayout.ATTR_X
+import com.android.launcher3.AutoInstallsLayout.ATTR_Y
+import com.android.launcher3.AutoInstallsLayout.TAG_APPWIDGET
+import com.android.launcher3.AutoInstallsLayout.TAG_AUTO_INSTALL
+import com.android.launcher3.AutoInstallsLayout.TAG_FOLDER
+import com.android.launcher3.AutoInstallsLayout.TAG_SHORTCUT
+import com.android.launcher3.AutoInstallsLayout.TAG_WORKSPACE
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.LauncherSettings.Favorites.containerToString
+import java.io.IOException
+import java.io.StringWriter
+import java.io.Writer
+import org.xmlpull.v1.XmlSerializer
+
+/** Helper class to build xml for Launcher Layout */
+class LauncherLayoutBuilder {
+ private val nodes = ArrayList<Node>()
+
+ fun atHotseat(rank: Int) =
+ ItemTarget(
+ mapOf(
+ ATTR_CONTAINER to containerToString(CONTAINER_HOTSEAT),
+ ATTR_RANK to rank.toString()
+ )
+ )
+
+ fun atWorkspace(x: Int, y: Int, screen: Int) =
+ ItemTarget(
+ mapOf(
+ ATTR_CONTAINER to containerToString(CONTAINER_DESKTOP),
+ ATTR_X to x.toString(),
+ ATTR_Y to y.toString(),
+ ATTR_SCREEN to screen.toString()
+ )
+ )
+
+ @Throws(IOException::class) fun build() = StringWriter().apply { build(this) }.toString()
+
+ @Throws(IOException::class)
+ fun build(writer: Writer) {
+ Xml.newSerializer().apply {
+ setOutput(writer)
+ setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true)
+ startDocument("UTF-8", true)
+ startTag(null, TAG_WORKSPACE)
+ writeNodes(nodes)
+ endTag(null, TAG_WORKSPACE)
+ endDocument()
+ flush()
+ }
+ }
+
+ open inner class ItemTarget(private val baseValues: Map<String, String>) {
+ @JvmOverloads
+ fun putApp(packageName: String, className: String?, userType: String? = null) =
+ addItem(
+ TAG_AUTO_INSTALL,
+ userType,
+ mapOf(
+ ATTR_PACKAGE_NAME to packageName,
+ ATTR_CLASS_NAME to (className ?: packageName)
+ )
+ )
+
+ @JvmOverloads
+ fun putShortcut(packageName: String, shortcutId: String, userType: String? = null) =
+ addItem(
+ TAG_SHORTCUT,
+ userType,
+ mapOf(ATTR_PACKAGE_NAME to packageName, ATTR_SHORTCUT_ID to shortcutId)
+ )
+
+ @JvmOverloads
+ fun putWidget(
+ packageName: String,
+ className: String,
+ spanX: Int,
+ spanY: Int,
+ userType: String? = null
+ ) =
+ addItem(
+ TAG_APPWIDGET,
+ userType,
+ mapOf(
+ ATTR_PACKAGE_NAME to packageName,
+ ATTR_CLASS_NAME to className,
+ ATTR_SPAN_X to spanX.toString(),
+ ATTR_SPAN_Y to spanY.toString()
+ )
+ )
+
+ fun putFolder(titleResId: Int) = putFolder(ATTR_TITLE, titleResId.toString())
+
+ fun putFolder(title: String?) = putFolder(ATTR_TITLE_TEXT, title)
+
+ protected open fun addItem(
+ tag: String,
+ userType: String?,
+ props: Map<String, String>,
+ children: List<Node>? = null
+ ): LauncherLayoutBuilder {
+ nodes.add(
+ Node(
+ tag,
+ HashMap(baseValues).apply {
+ putAll(props)
+ userType?.let { put(ATTR_USER_TYPE, it) }
+ },
+ children
+ )
+ )
+ return this@LauncherLayoutBuilder
+ }
+
+ protected open fun putFolder(titleKey: String, titleValue: String?): FolderBuilder {
+ val folderBuilder = FolderBuilder()
+ addItem(TAG_FOLDER, null, mapOf(titleKey to (titleValue ?: "")), folderBuilder.children)
+ return folderBuilder
+ }
+ }
+
+ inner class FolderBuilder : ItemTarget(mapOf()) {
+
+ val children = ArrayList<Node>()
+
+ fun addApp(packageName: String, className: String?): FolderBuilder {
+ putApp(packageName, className)
+ return this
+ }
+
+ fun addShortcut(packageName: String, shortcutId: String): FolderBuilder {
+ putShortcut(packageName, shortcutId)
+ return this
+ }
+
+ override fun addItem(
+ tag: String,
+ userType: String?,
+ props: Map<String, String>,
+ childrenIgnored: List<Node>?
+ ): LauncherLayoutBuilder {
+ children.add(
+ Node(tag, HashMap(props).apply { userType?.let { put(ATTR_USER_TYPE, it) } })
+ )
+ return this@LauncherLayoutBuilder
+ }
+
+ override fun putFolder(titleKey: String, titleValue: String?): FolderBuilder {
+ throw IllegalArgumentException("Can't have folder inside a folder")
+ }
+
+ fun build() = this@LauncherLayoutBuilder
+ }
+
+ @Throws(IOException::class)
+ private fun XmlSerializer.writeNodes(nodes: List<Node>) {
+ nodes.forEach { node ->
+ startTag(null, node.name)
+ node.attrs.forEach { (key, value) -> attribute(null, key, value) }
+ node.children?.let { writeNodes(it) }
+ endTag(null, node.name)
+ }
+ }
+
+ data class Node(
+ val name: String,
+ val attrs: Map<String, String>,
+ val children: List<Node>? = null
+ )
+}
diff --git a/src/com/android/launcher3/util/LockedUserState.kt b/src/com/android/launcher3/util/LockedUserState.kt
index 94f9e4f..10559f3 100644
--- a/src/com/android/launcher3/util/LockedUserState.kt
+++ b/src/com/android/launcher3/util/LockedUserState.kt
@@ -20,20 +20,28 @@
import android.os.Process
import android.os.UserManager
import androidx.annotation.VisibleForTesting
+import com.android.launcher3.util.Executors.MAIN_EXECUTOR
+import com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR
class LockedUserState(private val mContext: Context) : SafeCloseable {
val isUserUnlockedAtLauncherStartup: Boolean
- var isUserUnlocked: Boolean
- private set
+ var isUserUnlocked = false
+ private set(value) {
+ field = value
+ if (value) {
+ notifyUserUnlocked()
+ }
+ }
+
private val mUserUnlockedActions: RunnableList = RunnableList()
@VisibleForTesting
- val mUserUnlockedReceiver = SimpleBroadcastReceiver {
- if (Intent.ACTION_USER_UNLOCKED == it.action) {
- isUserUnlocked = true
- notifyUserUnlocked()
+ val mUserUnlockedReceiver =
+ SimpleBroadcastReceiver(UI_HELPER_EXECUTOR) {
+ if (Intent.ACTION_USER_UNLOCKED == it.action) {
+ isUserUnlocked = true
+ }
}
- }
init {
// 1) when user reboots devices, launcher process starts at lock screen and both
@@ -42,30 +50,34 @@
// yet isUserUnlockedAtLauncherStartup will remains as false.
// 2) when launcher process restarts after user has unlocked screen, both variable are
// init as true and will not change.
- isUserUnlocked =
- mContext
- .getSystemService(UserManager::class.java)!!
- .isUserUnlocked(Process.myUserHandle())
+ isUserUnlocked = checkIsUserUnlocked()
isUserUnlockedAtLauncherStartup = isUserUnlocked
- if (isUserUnlocked) {
- notifyUserUnlocked()
- } else {
- mUserUnlockedReceiver.register(mContext, Intent.ACTION_USER_UNLOCKED)
+ if (!isUserUnlocked) {
+ mUserUnlockedReceiver.register(
+ mContext,
+ {
+ // If user is unlocked while registering broadcast receiver, we should update
+ // [isUserUnlocked], which will call [notifyUserUnlocked] in setter
+ if (checkIsUserUnlocked()) {
+ MAIN_EXECUTOR.execute { isUserUnlocked = true }
+ }
+ },
+ Intent.ACTION_USER_UNLOCKED
+ )
}
}
+ private fun checkIsUserUnlocked() =
+ mContext.getSystemService(UserManager::class.java)!!.isUserUnlocked(Process.myUserHandle())
+
private fun notifyUserUnlocked() {
mUserUnlockedActions.executeAllAndDestroy()
- Executors.THREAD_POOL_EXECUTOR.execute {
- mUserUnlockedReceiver.unregisterReceiverSafely(mContext)
- }
+ mUserUnlockedReceiver.unregisterReceiverSafely(mContext)
}
/** Stops the receiver from listening for ACTION_USER_UNLOCK broadcasts. */
override fun close() {
- Executors.THREAD_POOL_EXECUTOR.execute {
- mUserUnlockedReceiver.unregisterReceiverSafely(mContext)
- }
+ mUserUnlockedReceiver.unregisterReceiverSafely(mContext)
}
/**
diff --git a/src/com/android/launcher3/util/LogConfig.java b/src/com/android/launcher3/util/LogConfig.java
index d59c339..f183f18 100644
--- a/src/com/android/launcher3/util/LogConfig.java
+++ b/src/com/android/launcher3/util/LogConfig.java
@@ -70,4 +70,11 @@
* When turned on, we enable long press nav handle related logging.
*/
public static final String NAV_HANDLE_LONG_PRESS = "NavHandleLongPress";
+
+
+ /**
+ * When turned on, we enable zero state web data loader related logging.
+ */
+ public static final String ZERO_WEB_DATA_LOADER = "ZeroStateWebDataLoaderLog";
+ public static final String SEARCH_TARGET_UTIL_LOG = "SearchTargetUtilLog";
}
diff --git a/src/com/android/launcher3/util/OnboardingPrefs.kt b/src/com/android/launcher3/util/OnboardingPrefs.kt
index ac6e97c..771594e 100644
--- a/src/com/android/launcher3/util/OnboardingPrefs.kt
+++ b/src/com/android/launcher3/util/OnboardingPrefs.kt
@@ -16,6 +16,7 @@
package com.android.launcher3.util
import android.content.Context
+import androidx.annotation.VisibleForTesting
import com.android.launcher3.LauncherPrefs
import com.android.launcher3.LauncherPrefs.Companion.backedUpItem
@@ -26,7 +27,7 @@
val sharedPrefKey: String,
val maxCount: Int,
) {
- private val prefItem = backedUpItem(sharedPrefKey, 0)
+ @VisibleForTesting val prefItem = backedUpItem(sharedPrefKey, 0)
/** @return The number of times we have seen the given event. */
fun get(c: Context): Int {
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index 3684f56..8c5a76e 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -16,6 +16,8 @@
package com.android.launcher3.util;
+import static android.view.WindowManager.PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI;
+
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE;
import android.content.ActivityNotFoundException;
@@ -73,10 +75,14 @@
@NonNull
private final LauncherApps mLauncherApps;
+ private final String[] mLegacyMultiInstanceSupportedApps;
+
public PackageManagerHelper(@NonNull final Context context) {
mContext = context;
mPm = context.getPackageManager();
mLauncherApps = Objects.requireNonNull(context.getSystemService(LauncherApps.class));
+ mLegacyMultiInstanceSupportedApps = mContext.getResources().getStringArray(
+ R.array.config_appsSupportMultiInstancesSplit);
}
@Override
@@ -146,6 +152,18 @@
}
/**
+ * Returns the installing app package for the given package
+ */
+ public String getAppInstallerPackage(@NonNull final String packageName) {
+ try {
+ return mPm.getInstallSourceInfo(packageName).getInstallingPackageName();
+ } catch (NameNotFoundException e) {
+ Log.e(TAG, "Failed to get installer package for app package:" + packageName, e);
+ return null;
+ }
+ }
+
+ /**
* Returns the application info for the provided package or null
*/
@Nullable
@@ -159,11 +177,23 @@
}
}
+ /**
+ * Returns the preferred launch activity intent for a given package.
+ */
@Nullable
public Intent getAppLaunchIntent(@Nullable final String pkg, @NonNull final UserHandle user) {
+ LauncherActivityInfo info = getAppLaunchInfo(pkg, user);
+ return info != null ? AppInfo.makeLaunchIntent(info) : null;
+ }
+
+ /**
+ * Returns the preferred launch activity for a given package.
+ */
+ @Nullable
+ public LauncherActivityInfo getAppLaunchInfo(@Nullable final String pkg,
+ @NonNull final UserHandle user) {
List<LauncherActivityInfo> activities = mLauncherApps.getActivityList(pkg, user);
- return activities.isEmpty() ? null :
- AppInfo.makeLaunchIntent(activities.get(0));
+ return activities.isEmpty() ? null : activities.get(0);
}
/**
@@ -285,4 +315,47 @@
return (info.flags & ApplicationInfo.FLAG_INSTALLED) != 0 || (
Flags.enableSupportForArchiving() && info.isArchived);
}
+
+ /**
+ * Returns whether the given component or its application has the multi-instance property set.
+ */
+ public boolean supportsMultiInstance(@NonNull ComponentName component) {
+ // Check the legacy hardcoded allowlist first
+ for (String pkg : mLegacyMultiInstanceSupportedApps) {
+ if (pkg.equals(component.getPackageName())) {
+ return true;
+ }
+ }
+
+ // Check app multi-instance properties after V
+ if (!Utilities.ATLEAST_V) {
+ return false;
+ }
+
+ try {
+ // Check if the component has the multi-instance property
+ return mPm.getProperty(PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI, component)
+ .getBoolean();
+ } catch (PackageManager.NameNotFoundException e1) {
+ try {
+ // Check if the application has the multi-instance property
+ return mPm.getProperty(PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI,
+ component.getPackageName())
+ .getBoolean();
+ } catch (PackageManager.NameNotFoundException e2) {
+ // Fall through
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns whether two apps should be considered the same for multi-instance purposes, which
+ * requires additional checks to ensure they can be started as multiple instances.
+ */
+ public static boolean isSameAppForMultiInstance(@NonNull ItemInfo app1,
+ @NonNull ItemInfo app2) {
+ return app1.getTargetPackage().equals(app2.getTargetPackage())
+ && app1.user.equals(app2.user);
+ }
}
diff --git a/src/com/android/launcher3/util/ScreenOnTracker.java b/src/com/android/launcher3/util/ScreenOnTracker.java
index e16e477..8ee799a 100644
--- a/src/com/android/launcher3/util/ScreenOnTracker.java
+++ b/src/com/android/launcher3/util/ScreenOnTracker.java
@@ -19,10 +19,15 @@
import static android.content.Intent.ACTION_SCREEN_ON;
import static android.content.Intent.ACTION_USER_PRESENT;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+
import android.content.Context;
import android.content.Intent;
+import androidx.annotation.VisibleForTesting;
+
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.function.Consumer;
/**
* Utility class for tracking if the screen is currently on or off
@@ -32,7 +37,7 @@
public static final MainThreadInitializedObject<ScreenOnTracker> INSTANCE =
new MainThreadInitializedObject<>(ScreenOnTracker::new);
- private final SimpleBroadcastReceiver mReceiver = new SimpleBroadcastReceiver(this::onReceive);
+ private final SimpleBroadcastReceiver mReceiver;
private final CopyOnWriteArrayList<ScreenOnListener> mListeners = new CopyOnWriteArrayList<>();
private final Context mContext;
@@ -41,8 +46,20 @@
private ScreenOnTracker(Context context) {
// Assume that the screen is on to begin with
mContext = context;
+ mReceiver = new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, this::onReceive);
+ init();
+ }
+
+ @VisibleForTesting
+ ScreenOnTracker(Context context, SimpleBroadcastReceiver receiver) {
+ mContext = context;
+ mReceiver = receiver;
+ init();
+ }
+
+ private void init() {
mIsScreenOn = true;
- mReceiver.register(context, ACTION_SCREEN_ON, ACTION_SCREEN_OFF, ACTION_USER_PRESENT);
+ mReceiver.register(mContext, ACTION_SCREEN_ON, ACTION_SCREEN_OFF, ACTION_USER_PRESENT);
}
@Override
@@ -50,7 +67,8 @@
mReceiver.unregisterReceiverSafely(mContext);
}
- private void onReceive(Intent intent) {
+ @VisibleForTesting
+ void onReceive(Intent intent) {
String action = intent.getAction();
if (ACTION_SCREEN_ON.equals(action)) {
mIsScreenOn = true;
diff --git a/src/com/android/launcher3/util/SettingsCache.java b/src/com/android/launcher3/util/SettingsCache.java
index ccd154a..cd6701d 100644
--- a/src/com/android/launcher3/util/SettingsCache.java
+++ b/src/com/android/launcher3/util/SettingsCache.java
@@ -18,6 +18,8 @@
import static android.provider.Settings.System.ACCELEROMETER_ROTATION;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
@@ -87,7 +89,7 @@
@Override
public void close() {
- mResolver.unregisterContentObserver(this);
+ UI_HELPER_EXECUTOR.execute(() -> mResolver.unregisterContentObserver(this));
}
@Override
@@ -135,7 +137,8 @@
CopyOnWriteArrayList<OnChangeListener> l = new CopyOnWriteArrayList<>();
l.add(changeListener);
mListenerMap.put(uri, l);
- mResolver.registerContentObserver(uri, false, this);
+ UI_HELPER_EXECUTOR.execute(
+ () -> mResolver.registerContentObserver(uri, false, this));
}
}
diff --git a/src/com/android/launcher3/util/ShortcutUtil.java b/src/com/android/launcher3/util/ShortcutUtil.java
index 07b7941..aa4f8af 100644
--- a/src/com/android/launcher3/util/ShortcutUtil.java
+++ b/src/com/android/launcher3/util/ShortcutUtil.java
@@ -54,14 +54,6 @@
? ((WorkspaceItemInfo) info).getPersonKeys() : Utilities.EMPTY_STRING_ARRAY;
}
- /**
- * Returns true if the item is a deep shortcut.
- */
- public static boolean isDeepShortcut(ItemInfo info) {
- return info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
- && info instanceof WorkspaceItemInfo;
- }
-
private static boolean isActive(ItemInfo info) {
boolean isLoading = info instanceof WorkspaceItemInfo
&& ((WorkspaceItemInfo) info).hasPromiseIconUi();
diff --git a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java
index 064bcd0..539a7cb 100644
--- a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java
+++ b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java
@@ -19,9 +19,12 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.os.Handler;
+import android.os.Looper;
import android.os.PatternMatcher;
import android.text.TextUtils;
+import androidx.annotation.AnyThread;
import androidx.annotation.Nullable;
import java.util.function.Consumer;
@@ -30,8 +33,16 @@
private final Consumer<Intent> mIntentConsumer;
- public SimpleBroadcastReceiver(Consumer<Intent> intentConsumer) {
+ // Handler to register/unregister broadcast receiver
+ private final Handler mHandler;
+
+ public SimpleBroadcastReceiver(LooperExecutor looperExecutor, Consumer<Intent> intentConsumer) {
+ this(looperExecutor.getHandler(), intentConsumer);
+ }
+
+ public SimpleBroadcastReceiver(Handler handler, Consumer<Intent> intentConsumer) {
mIntentConsumer = intentConsumer;
+ mHandler = handler;
}
@Override
@@ -39,18 +50,109 @@
mIntentConsumer.accept(intent);
}
- /**
- * Helper method to register multiple actions
- */
+ /** Calls {@link #register(Context, Runnable, String...)} with null completionCallback. */
+ @AnyThread
public void register(Context context, String... actions) {
- context.registerReceiver(this, getFilter(actions));
+ register(context, null, actions);
}
/**
- * Helper method to register multiple actions associated with a paction
+ * Calls {@link #register(Context, Runnable, int, String...)} with null completionCallback.
*/
+ @AnyThread
+ public void register(Context context, int flags, String... actions) {
+ register(context, null, flags, actions);
+ }
+
+ /**
+ * Register broadcast receiver. If this method is called on the same looper with mHandler's
+ * looper, then register will be called synchronously. Otherwise asynchronously. This ensures
+ * register happens on {@link #mHandler}'s looper.
+ *
+ * @param completionCallback callback that will be triggered after registration is completed,
+ * caller usually pass this callback to check if states has changed
+ * while registerReceiver() is executed on a binder call.
+ */
+ @AnyThread
+ public void register(
+ Context context, @Nullable Runnable completionCallback, String... actions) {
+ if (Looper.myLooper() == mHandler.getLooper()) {
+ registerInternal(context, completionCallback, actions);
+ } else {
+ mHandler.post(() -> registerInternal(context, completionCallback, actions));
+ }
+ }
+
+ /** Register broadcast receiver and run completion callback if passed. */
+ @AnyThread
+ private void registerInternal(
+ Context context, @Nullable Runnable completionCallback, String... actions) {
+ context.registerReceiver(this, getFilter(actions));
+ if (completionCallback != null) {
+ completionCallback.run();
+ }
+ }
+
+ /**
+ * Same as {@link #register(Context, Runnable, String...)} above but with additional flags
+ * params.
+ */
+ @AnyThread
+ public void register(
+ Context context, @Nullable Runnable completionCallback, int flags, String... actions) {
+ if (Looper.myLooper() == mHandler.getLooper()) {
+ registerInternal(context, completionCallback, flags, actions);
+ } else {
+ mHandler.post(() -> registerInternal(context, completionCallback, flags, actions));
+ }
+ }
+
+ /** Register broadcast receiver and run completion callback if passed. */
+ @AnyThread
+ private void registerInternal(
+ Context context, @Nullable Runnable completionCallback, int flags, String... actions) {
+ context.registerReceiver(this, getFilter(actions), flags);
+ if (completionCallback != null) {
+ completionCallback.run();
+ }
+ }
+
+ /** Same as {@link #register(Context, Runnable, String...)} above but with pkg name. */
+ @AnyThread
public void registerPkgActions(Context context, @Nullable String pkg, String... actions) {
- context.registerReceiver(this, getPackageFilter(pkg, actions));
+ if (Looper.myLooper() == mHandler.getLooper()) {
+ context.registerReceiver(this, getPackageFilter(pkg, actions));
+ } else {
+ mHandler.post(() -> {
+ context.registerReceiver(this, getPackageFilter(pkg, actions));
+ });
+ }
+ }
+
+ /**
+ * Unregister broadcast receiver. If this method is called on the same looper with mHandler's
+ * looper, then unregister will be called synchronously. Otherwise asynchronously. This ensures
+ * unregister happens on {@link #mHandler}'s looper.
+ */
+ @AnyThread
+ public void unregisterReceiverSafely(Context context) {
+ if (Looper.myLooper() == mHandler.getLooper()) {
+ unregisterReceiverSafelyInternal(context);
+ } else {
+ mHandler.post(() -> {
+ unregisterReceiverSafelyInternal(context);
+ });
+ }
+ }
+
+ /** Unregister broadcast receiver ignoring any errors. */
+ @AnyThread
+ private void unregisterReceiverSafelyInternal(Context context) {
+ try {
+ context.unregisterReceiver(this);
+ } catch (IllegalArgumentException e) {
+ // It was probably never registered or already unregistered. Ignore.
+ }
}
/**
@@ -72,15 +174,4 @@
}
return filter;
}
-
- /**
- * Unregisters the receiver ignoring any errors
- */
- public void unregisterReceiverSafely(Context context) {
- try {
- context.unregisterReceiver(this);
- } catch (IllegalArgumentException e) {
- // It was probably never registered or already unregistered. Ignore.
- }
- }
}
diff --git a/src/com/android/launcher3/util/SplitConfigurationOptions.java b/src/com/android/launcher3/util/SplitConfigurationOptions.java
index 837d7bc..f457e4e 100644
--- a/src/com/android/launcher3/util/SplitConfigurationOptions.java
+++ b/src/com/android/launcher3/util/SplitConfigurationOptions.java
@@ -211,7 +211,7 @@
private Drawable drawable;
public final Intent intent;
public final SplitPositionOption position;
- public final ItemInfo itemInfo;
+ private ItemInfo itemInfo;
public final StatsLogManager.EventEnum splitEvent;
/** Represents the taskId of the first app to start in split screen */
public int alreadyRunningTaskId = INVALID_TASK_ID;
@@ -239,5 +239,9 @@
public View getView() {
return view;
}
+
+ public ItemInfo getItemInfo() {
+ return itemInfo;
+ }
}
}
diff --git a/src/com/android/launcher3/util/VibratorWrapper.java b/src/com/android/launcher3/util/VibratorWrapper.java
index 51749a7..6bae1ba 100644
--- a/src/com/android/launcher3/util/VibratorWrapper.java
+++ b/src/com/android/launcher3/util/VibratorWrapper.java
@@ -31,6 +31,7 @@
import android.provider.Settings;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.Utilities;
@@ -49,14 +50,14 @@
public static final VibrationEffect EFFECT_CLICK =
createPredefined(VibrationEffect.EFFECT_CLICK);
- private static final Uri HAPTIC_FEEDBACK_URI =
- Settings.System.getUriFor(HAPTIC_FEEDBACK_ENABLED);
+ @VisibleForTesting
+ static final Uri HAPTIC_FEEDBACK_URI = Settings.System.getUriFor(HAPTIC_FEEDBACK_ENABLED);
- private static final float LOW_TICK_SCALE = 0.9f;
- private static final float DRAG_TEXTURE_SCALE = 0.03f;
- private static final float DRAG_COMMIT_SCALE = 0.5f;
- private static final float DRAG_BUMP_SCALE = 0.4f;
- private static final int DRAG_TEXTURE_EFFECT_SIZE = 200;
+ @VisibleForTesting static final float LOW_TICK_SCALE = 0.9f;
+ @VisibleForTesting static final float DRAG_TEXTURE_SCALE = 0.03f;
+ @VisibleForTesting static final float DRAG_COMMIT_SCALE = 0.5f;
+ @VisibleForTesting static final float DRAG_BUMP_SCALE = 0.4f;
+ @VisibleForTesting static final int DRAG_TEXTURE_EFFECT_SIZE = 200;
@Nullable
private final VibrationEffect mDragEffect;
@@ -73,22 +74,29 @@
*/
public static final VibrationEffect OVERVIEW_HAPTIC = EFFECT_CLICK;
- private final Context mContext;
private final Vibrator mVibrator;
private final boolean mHasVibrator;
- private final SettingsCache.OnChangeListener mHapticChangeListener =
+
+ private final SettingsCache mSettingsCache;
+
+ @VisibleForTesting
+ final SettingsCache.OnChangeListener mHapticChangeListener =
isEnabled -> mIsHapticFeedbackEnabled = isEnabled;
private boolean mIsHapticFeedbackEnabled;
private VibratorWrapper(Context context) {
- mContext = context;
- mVibrator = context.getSystemService(Vibrator.class);
+ this(context.getSystemService(Vibrator.class), SettingsCache.INSTANCE.get(context));
+ }
+
+ @VisibleForTesting
+ VibratorWrapper(Vibrator vibrator, SettingsCache settingsCache) {
+ mVibrator = vibrator;
mHasVibrator = mVibrator.hasVibrator();
+ mSettingsCache = settingsCache;
if (mHasVibrator) {
- SettingsCache cache = SettingsCache.INSTANCE.get(mContext);
- cache.register(HAPTIC_FEEDBACK_URI, mHapticChangeListener);
- mIsHapticFeedbackEnabled = cache.getValue(HAPTIC_FEEDBACK_URI, 0);
+ mSettingsCache.register(HAPTIC_FEEDBACK_URI, mHapticChangeListener);
+ mIsHapticFeedbackEnabled = mSettingsCache.getValue(HAPTIC_FEEDBACK_URI, 0);
} else {
mIsHapticFeedbackEnabled = false;
}
@@ -98,12 +106,7 @@
// Drag texture, Commit, and Bump should only be used for premium phones.
// Before using these haptics make sure check if the device can use it
- VibrationEffect.Composition dragEffect = VibrationEffect.startComposition();
- for (int i = 0; i < DRAG_TEXTURE_EFFECT_SIZE; i++) {
- dragEffect.addPrimitive(
- PRIMITIVE_LOW_TICK, DRAG_TEXTURE_SCALE);
- }
- mDragEffect = dragEffect.compose();
+ mDragEffect = getDragEffect();
mCommitEffect = VibrationEffect.startComposition().addPrimitive(
VibrationEffect.Composition.PRIMITIVE_TICK, DRAG_COMMIT_SCALE).compose();
mBumpEffect = VibrationEffect.startComposition().addPrimitive(
@@ -124,8 +127,7 @@
@Override
public void close() {
if (mHasVibrator) {
- SettingsCache.INSTANCE.get(mContext)
- .unregister(HAPTIC_FEEDBACK_URI, mHapticChangeListener);
+ mSettingsCache.unregister(HAPTIC_FEEDBACK_URI, mHapticChangeListener);
}
}
@@ -215,4 +217,13 @@
vibrate(primitiveLowTickEffect);
}
}
+
+ static VibrationEffect getDragEffect() {
+ VibrationEffect.Composition dragEffect = VibrationEffect.startComposition();
+ for (int i = 0; i < DRAG_TEXTURE_EFFECT_SIZE; i++) {
+ dragEffect.addPrimitive(
+ PRIMITIVE_LOW_TICK, DRAG_TEXTURE_SCALE);
+ }
+ return dragEffect.compose();
+ }
}
diff --git a/src/com/android/launcher3/util/ViewCache.java b/src/com/android/launcher3/util/ViewCache.java
index 98e6822..b98e977 100644
--- a/src/com/android/launcher3/util/ViewCache.java
+++ b/src/com/android/launcher3/util/ViewCache.java
@@ -21,6 +21,8 @@
import android.view.View;
import android.view.ViewGroup;
+import androidx.annotation.VisibleForTesting;
+
import com.android.launcher3.R;
/**
@@ -67,7 +69,8 @@
}
}
- private static class CacheEntry {
+ @VisibleForTesting
+ static class CacheEntry {
final int mMaxSize;
final View[] mViews;
diff --git a/src/com/android/launcher3/util/ViewPool.java b/src/com/android/launcher3/util/ViewPool.java
index e413d7f..2fa8bf4 100644
--- a/src/com/android/launcher3/util/ViewPool.java
+++ b/src/com/android/launcher3/util/ViewPool.java
@@ -24,6 +24,7 @@
import androidx.annotation.AnyThread;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.util.ViewPool.Reusable;
@@ -43,9 +44,16 @@
public ViewPool(Context context, @Nullable ViewGroup parent,
int layoutId, int maxSize, int initialSize) {
+ this(LayoutInflater.from(context).cloneInContext(context),
+ parent, layoutId, maxSize, initialSize);
+ }
+
+ @VisibleForTesting
+ ViewPool(LayoutInflater inflater, @Nullable ViewGroup parent,
+ int layoutId, int maxSize, int initialSize) {
mLayoutId = layoutId;
mParent = parent;
- mInflater = LayoutInflater.from(context);
+ mInflater = inflater;
mPool = new Object[maxSize];
if (initialSize > 0) {
diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
index b97b889..f8cbe0d 100644
--- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
+++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
@@ -32,7 +32,7 @@
private static final int MIN_PARALLAX_PAGE_SPAN = 4;
private final SimpleBroadcastReceiver mWallpaperChangeReceiver =
- new SimpleBroadcastReceiver(i -> onWallpaperChanged());
+ new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, i -> onWallpaperChanged());
private final Workspace<?> mWorkspace;
private final boolean mIsRtl;
private final Handler mHandler;
@@ -201,7 +201,8 @@
mWallpaperChangeReceiver.unregisterReceiverSafely(mWorkspace.getContext());
mRegistered = false;
} else if (mWindowToken != null && !mRegistered) {
- mWallpaperChangeReceiver.register(mWorkspace.getContext(), ACTION_WALLPAPER_CHANGED);
+ mWallpaperChangeReceiver.register(
+ mWorkspace.getContext(), ACTION_WALLPAPER_CHANGED);
onWallpaperChanged();
mRegistered = true;
}
diff --git a/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt b/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt
new file mode 100644
index 0000000..e9691a8
--- /dev/null
+++ b/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util.coroutines
+
+import kotlinx.coroutines.CoroutineDispatcher
+import kotlinx.coroutines.Dispatchers
+
+interface DispatcherProvider {
+ val default: CoroutineDispatcher
+ val io: CoroutineDispatcher
+ val main: CoroutineDispatcher
+ val unconfined: CoroutineDispatcher
+}
+
+object ProductionDispatchers : DispatcherProvider {
+ override val default: CoroutineDispatcher = Dispatchers.Default
+ override val io: CoroutineDispatcher = Dispatchers.IO
+ override val main: CoroutineDispatcher = Dispatchers.Main
+ override val unconfined: CoroutineDispatcher = Dispatchers.Unconfined
+}
diff --git a/src/com/android/launcher3/util/rects/Rects.kt b/src/com/android/launcher3/util/rects/Rects.kt
new file mode 100644
index 0000000..1e6d717
--- /dev/null
+++ b/src/com/android/launcher3/util/rects/Rects.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util.rects
+
+import android.graphics.Rect
+import android.view.View
+
+/** Copy the coordinates of the [view] relative to its parent into this rectangle. */
+fun Rect.set(view: View) {
+ set(0, 0, view.width, view.height)
+ offset(view.x.toInt(), view.y.toInt())
+}
diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java
index 5ce455a..85aad89 100644
--- a/src/com/android/launcher3/views/AbstractSlideInView.java
+++ b/src/com/android/launcher3/views/AbstractSlideInView.java
@@ -92,7 +92,7 @@
protected @NonNull AnimatorPlaybackController mOpenCloseAnimation;
protected ViewGroup mContent;
- protected final View mColorScrim;
+ protected final @Nullable View mColorScrim;
/**
* Interpolator for {@link #mOpenCloseAnimation} when we are closing due to dragging downwards.
@@ -216,6 +216,9 @@
animation.addFloat(
this, TRANSLATION_SHIFT, fromTranslationShift, toTranslationShift, LINEAR);
+ if (mColorScrim != null) {
+ animation.setViewAlpha(mColorScrim, 1 - toTranslationShift, getScrimInterpolator());
+ }
onOpenCloseAnimationPending(animation);
mOpenCloseAnimation = animation.createPlaybackController();
@@ -254,9 +257,6 @@
protected void setTranslationShift(float translationShift) {
mTranslationShift = translationShift;
mContent.setTranslationY(mTranslationShift * getShiftRange());
- if (mColorScrim != null) {
- mColorScrim.setAlpha(1 - mTranslationShift);
- }
invalidate();
}
@@ -500,6 +500,10 @@
return Interpolators.ACCELERATE;
}
+ protected Interpolator getScrimInterpolator() {
+ return LINEAR;
+ }
+
protected void onCloseComplete() {
mIsOpen = false;
getPopupContainer().removeView(this);
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index cfac91a..d3160e0 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -81,6 +81,7 @@
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.ViewCache;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
import java.util.List;
@@ -266,6 +267,14 @@
return null;
}
+ /**
+ * Returns the {@link WidgetPickerDataProvider} that can be used to read widgets for display.
+ */
+ @Nullable
+ default WidgetPickerDataProvider getWidgetPickerDataProvider() {
+ return null;
+ }
+
@Nullable
default StringCache getStringCache() {
return null;
diff --git a/src/com/android/launcher3/views/ArrowTipView.java b/src/com/android/launcher3/views/ArrowTipView.java
index 2f0da03..bb4f040 100644
--- a/src/com/android/launcher3/views/ArrowTipView.java
+++ b/src/com/android/launcher3/views/ArrowTipView.java
@@ -54,7 +54,7 @@
*/
public class ArrowTipView extends AbstractFloatingView {
- private static final String TAG = ArrowTipView.class.getSimpleName();
+ private static final String TAG = "ArrowTipView";
private static final long AUTO_CLOSE_TIMEOUT_MILLIS = 10 * 1000;
private static final long SHOW_DELAY_MS = 200;
private static final long SHOW_DURATION_MS = 300;
diff --git a/src/com/android/launcher3/views/ClipIconView.java b/src/com/android/launcher3/views/ClipIconView.java
index 172f968..f90a3e4 100644
--- a/src/com/android/launcher3/views/ClipIconView.java
+++ b/src/com/android/launcher3/views/ClipIconView.java
@@ -16,6 +16,7 @@
package com.android.launcher3.views;
import static com.android.app.animation.Interpolators.LINEAR;
+import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
import static com.android.launcher3.Utilities.boundToRange;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
@@ -40,6 +41,7 @@
import android.view.ViewOutlineProvider;
import androidx.annotation.Nullable;
+import androidx.core.util.Consumer;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
@@ -74,6 +76,8 @@
private final Rect mOutline = new Rect();
private final Rect mFinalDrawableBounds = new Rect();
+ @Nullable private TaskViewArtist mTaskViewArtist;
+
public ClipIconView(Context context) {
this(context, null);
}
@@ -90,10 +94,31 @@
}
/**
+ * Sets a {@link TaskViewArtist} that will draw a {@link com.android.quickstep.views.TaskView}
+ * within the clip bounds of this view.
+ */
+ public void setTaskViewArtist(TaskViewArtist taskViewArtist) {
+ if (!enableAdditionalHomeAnimations()) {
+ return;
+ }
+ mTaskViewArtist = taskViewArtist;
+ invalidate();
+ }
+
+ /**
* Update the icon UI to match the provided parameters during an animation frame
*/
public void update(RectF rect, float progress, float shapeProgressStart, float cornerRadius,
boolean isOpening, View container, DeviceProfile dp) {
+ update(rect, progress, shapeProgressStart, cornerRadius, isOpening, container, dp, 255);
+ }
+
+ /**
+ * Update the icon UI to match the provided parameters during an animation frame, optionally
+ * varying the alpha of the {@link TaskViewArtist}
+ */
+ public void update(RectF rect, float progress, float shapeProgressStart, float cornerRadius,
+ boolean isOpening, View container, DeviceProfile dp, int taskViewDrawAlpha) {
MarginLayoutParams lp = (MarginLayoutParams) container.getLayoutParams();
float dX = mIsRtl
@@ -107,6 +132,14 @@
float scaleX = rect.width() / minSize;
float scaleY = rect.height() / minSize;
float scale = Math.max(1f, Math.min(scaleX, scaleY));
+ if (mTaskViewArtist != null) {
+ mTaskViewArtist.taskViewDrawWidth = lp.width;
+ mTaskViewArtist.taskViewDrawHeight = lp.height;
+ mTaskViewArtist.taskViewDrawAlpha = taskViewDrawAlpha;
+ mTaskViewArtist.taskViewDrawScale = (mTaskViewArtist.drawForPortraitLayout
+ ? Math.min(lp.height, lp.width) : Math.max(lp.height, lp.width))
+ / mTaskViewArtist.taskViewMinSize;
+ }
if (Float.isNaN(scale) || Float.isInfinite(scale)) {
// Views are no longer laid out, do not update.
@@ -287,6 +320,19 @@
if (mForeground != null) {
mForeground.draw(canvas);
}
+ if (mTaskViewArtist != null) {
+ canvas.saveLayerAlpha(
+ 0,
+ 0,
+ mTaskViewArtist.taskViewDrawWidth,
+ mTaskViewArtist.taskViewDrawHeight,
+ mTaskViewArtist.taskViewDrawAlpha);
+ float drawScale = mTaskViewArtist.taskViewDrawScale;
+ canvas.translate(drawScale * mTaskViewArtist.taskViewTranslationX,
+ drawScale * mTaskViewArtist.taskViewTranslationY);
+ canvas.scale(drawScale, drawScale);
+ mTaskViewArtist.taskViewDrawCallback.accept(canvas);
+ }
canvas.restoreToCount(count);
}
@@ -303,5 +349,37 @@
mRevealAnimator = null;
mTaskCornerRadius = 0;
mOutline.setEmpty();
+ mTaskViewArtist = null;
+ }
+
+ /**
+ * Utility class to help draw a {@link com.android.quickstep.views.TaskView} within
+ * a {@link ClipIconView} bounds.
+ */
+ public static class TaskViewArtist {
+
+ public final Consumer<Canvas> taskViewDrawCallback;
+ public final float taskViewTranslationX;
+ public final float taskViewTranslationY;
+ public final float taskViewMinSize;
+ public final boolean drawForPortraitLayout;
+
+ public int taskViewDrawAlpha;
+ public float taskViewDrawScale;
+ public int taskViewDrawWidth;
+ public int taskViewDrawHeight;
+
+ public TaskViewArtist(
+ Consumer<Canvas> taskViewDrawCallback,
+ float taskViewTranslationX,
+ float taskViewTranslationY,
+ float taskViewMinSize,
+ boolean drawForPortraitLayout) {
+ this.taskViewDrawCallback = taskViewDrawCallback;
+ this.taskViewTranslationX = taskViewTranslationX;
+ this.taskViewTranslationY = taskViewTranslationY;
+ this.taskViewMinSize = taskViewMinSize;
+ this.drawForPortraitLayout = drawForPortraitLayout;
+ }
}
}
diff --git a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
index bc66a33..ef66ffe 100644
--- a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
+++ b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
@@ -19,11 +19,19 @@
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import android.content.Context;
-import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.text.Spannable;
+import android.text.SpannableString;
+import android.text.style.ImageSpan;
import android.util.AttributeSet;
-import android.widget.TextView;
+import android.util.Log;
+
+import androidx.annotation.DrawableRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.RequiresApi;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.R;
@@ -45,22 +53,65 @@
public DoubleShadowBubbleTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- mShadowInfo = new ShadowInfo(context, attrs, defStyle);
- setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0, mShadowInfo.ambientShadowColor);
+ mShadowInfo = ShadowInfo.Companion.fromContext(context, attrs, defStyle);
+ setShadowLayer(
+ mShadowInfo.getAmbientShadowBlur(),
+ 0,
+ 0,
+ mShadowInfo.getAmbientShadowColor()
+ );
+ }
+
+ @Override
+ public void setTextWithStartIcon(CharSequence text, @DrawableRes int drawableId) {
+ Drawable drawable = getContext().getDrawable(drawableId);
+ if (drawable == null) {
+ setText(text);
+ Log.w(TAG, "setTextWithStartIcon: start icon Drawable not found from resources"
+ + ", will just set text instead.");
+ return;
+ }
+ drawable.setTint(getCurrentTextColor());
+ int textSize = Math.round(getTextSize());
+ ImageSpan imageSpan;
+ if (!skipDoubleShadow() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ drawable = getDoubleShadowDrawable(drawable, textSize);
+ }
+ drawable.setBounds(0, 0, textSize, textSize);
+ imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_CENTER);
+ // First space will be replaced with Drawable, second space is for space before text.
+ SpannableString spannable = new SpannableString(" " + text);
+ spannable.setSpan(imageSpan, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
+ setText(spannable);
+ }
+
+ @RequiresApi(Build.VERSION_CODES.S)
+ private DoubleShadowIconDrawable getDoubleShadowDrawable(
+ @NonNull Drawable drawable, int textSize
+ ) {
+ // add some padding via inset to avoid shadow clipping
+ int iconInsetSize = getContext().getResources()
+ .getDimensionPixelSize(R.dimen.app_title_icon_shadow_inset);
+ return new DoubleShadowIconDrawable(
+ mShadowInfo,
+ drawable,
+ textSize,
+ iconInsetSize
+ );
}
@Override
public void onDraw(Canvas canvas) {
// If text is transparent or shadow alpha is 0, don't draw any shadow
- if (mShadowInfo.skipDoubleShadow(this)) {
+ if (skipDoubleShadow()) {
super.onDraw(canvas);
return;
}
int alpha = Color.alpha(getCurrentTextColor());
// We enhance the shadow by drawing the shadow twice
- getPaint().setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0,
- getTextShadowColor(mShadowInfo.ambientShadowColor, alpha));
+ getPaint().setShadowLayer(mShadowInfo.getAmbientShadowBlur(), 0, 0,
+ getTextShadowColor(mShadowInfo.getAmbientShadowColor(), alpha));
drawWithoutDot(canvas);
canvas.save();
@@ -69,10 +120,10 @@
getScrollY() + getHeight());
getPaint().setShadowLayer(
- mShadowInfo.keyShadowBlur,
- mShadowInfo.keyShadowOffsetX,
- mShadowInfo.keyShadowOffsetY,
- getTextShadowColor(mShadowInfo.keyShadowColor, alpha));
+ mShadowInfo.getKeyShadowBlur(),
+ mShadowInfo.getKeyShadowOffsetX(),
+ mShadowInfo.getKeyShadowOffsetY(),
+ getTextShadowColor(mShadowInfo.getKeyShadowColor(), alpha));
drawWithoutDot(canvas);
canvas.restore();
@@ -80,55 +131,30 @@
drawRunningAppIndicatorIfNecessary(canvas);
}
- public static class ShadowInfo {
- public final float ambientShadowBlur;
- public final int ambientShadowColor;
-
- public final float keyShadowBlur;
- public final float keyShadowOffsetX;
- public final float keyShadowOffsetY;
- public final int keyShadowColor;
-
- public ShadowInfo(Context c, AttributeSet attrs, int defStyle) {
-
- TypedArray a = c.obtainStyledAttributes(
- attrs, R.styleable.ShadowInfo, defStyle, 0);
-
- ambientShadowBlur = a.getDimensionPixelSize(
- R.styleable.ShadowInfo_ambientShadowBlur, 0);
- ambientShadowColor = a.getColor(R.styleable.ShadowInfo_ambientShadowColor, 0);
-
- keyShadowBlur = a.getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowBlur, 0);
- keyShadowOffsetX = a.getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetX, 0);
- keyShadowOffsetY = a.getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetY, 0);
- keyShadowColor = a.getColor(R.styleable.ShadowInfo_keyShadowColor, 0);
- a.recycle();
- }
-
- public boolean skipDoubleShadow(TextView textView) {
- int textAlpha = Color.alpha(textView.getCurrentTextColor());
- int keyShadowAlpha = Color.alpha(keyShadowColor);
- int ambientShadowAlpha = Color.alpha(ambientShadowColor);
- if (textAlpha == 0 || (keyShadowAlpha == 0 && ambientShadowAlpha == 0)) {
- textView.getPaint().clearShadowLayer();
- return true;
- } else if (ambientShadowAlpha > 0 && keyShadowAlpha == 0) {
- textView.getPaint().setShadowLayer(ambientShadowBlur, 0, 0,
- getTextShadowColor(ambientShadowColor, textAlpha));
- return true;
- } else if (keyShadowAlpha > 0 && ambientShadowAlpha == 0) {
- textView.getPaint().setShadowLayer(
- keyShadowBlur,
- keyShadowOffsetX,
- keyShadowOffsetY,
- getTextShadowColor(keyShadowColor, textAlpha));
- return true;
- } else {
- return false;
- }
+ private boolean skipDoubleShadow() {
+ int textAlpha = Color.alpha(getCurrentTextColor());
+ int keyShadowAlpha = Color.alpha(mShadowInfo.getKeyShadowColor());
+ int ambientShadowAlpha = Color.alpha(mShadowInfo.getAmbientShadowColor());
+ if (textAlpha == 0 || (keyShadowAlpha == 0 && ambientShadowAlpha == 0)) {
+ getPaint().clearShadowLayer();
+ return true;
+ } else if (ambientShadowAlpha > 0 && keyShadowAlpha == 0) {
+ getPaint().setShadowLayer(mShadowInfo.getAmbientShadowBlur(), 0, 0,
+ getTextShadowColor(mShadowInfo.getAmbientShadowColor(), textAlpha));
+ return true;
+ } else if (keyShadowAlpha > 0 && ambientShadowAlpha == 0) {
+ getPaint().setShadowLayer(
+ mShadowInfo.getKeyShadowBlur(),
+ mShadowInfo.getKeyShadowOffsetX(),
+ mShadowInfo.getKeyShadowOffsetY(),
+ getTextShadowColor(mShadowInfo.getKeyShadowColor(), textAlpha));
+ return true;
+ } else {
+ return false;
}
}
+
// Multiplies the alpha of shadowColor by textAlpha.
private static int getTextShadowColor(int shadowColor, int textAlpha) {
return setColorAlphaBound(shadowColor,
diff --git a/src/com/android/launcher3/views/DoubleShadowIconDrawable.kt b/src/com/android/launcher3/views/DoubleShadowIconDrawable.kt
new file mode 100644
index 0000000..7ac7c94
--- /dev/null
+++ b/src/com/android/launcher3/views/DoubleShadowIconDrawable.kt
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.views
+
+import android.content.res.ColorStateList
+import android.graphics.BlendMode
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.ColorFilter
+import android.graphics.PixelFormat
+import android.graphics.PorterDuff
+import android.graphics.PorterDuffColorFilter
+import android.graphics.RenderEffect
+import android.graphics.RenderNode
+import android.graphics.Shader
+import android.graphics.drawable.Drawable
+import android.graphics.drawable.InsetDrawable
+import android.os.Build.VERSION_CODES
+import androidx.annotation.RequiresApi
+import androidx.annotation.VisibleForTesting
+
+/**
+ * Launcher wrapper for Drawables to provide a double shadow effect. Currently for use with
+ * [DoubleShadowBubbleTextView] to provide a similar shadow to inline icons.
+ */
+@RequiresApi(VERSION_CODES.S)
+class DoubleShadowIconDrawable(
+ private val shadowInfo: ShadowInfo,
+ iconDrawable: Drawable,
+ private val iconSize: Int,
+ iconInsetSize: Int
+) : Drawable() {
+ private val mIconDrawable: InsetDrawable
+ private val mDoubleShadowNode: RenderNode?
+
+ init {
+ mIconDrawable = InsetDrawable(iconDrawable, iconInsetSize)
+ mIconDrawable.setBounds(0, 0, iconSize, iconSize)
+ mDoubleShadowNode = createShadowRenderNode()
+ }
+
+ @VisibleForTesting
+ fun createShadowRenderNode(): RenderNode {
+ val renderNode = RenderNode("DoubleShadowNode")
+ renderNode.setPosition(0, 0, iconSize, iconSize)
+ // Create render effects
+ val ambientShadow =
+ createShadowRenderEffect(
+ shadowInfo.ambientShadowBlur,
+ 0f,
+ 0f,
+ Color.alpha(shadowInfo.ambientShadowColor).toFloat()
+ )
+ val keyShadow =
+ createShadowRenderEffect(
+ shadowInfo.keyShadowBlur,
+ shadowInfo.keyShadowOffsetX,
+ shadowInfo.keyShadowOffsetY,
+ Color.alpha(shadowInfo.keyShadowColor).toFloat()
+ )
+ val blend = RenderEffect.createBlendModeEffect(ambientShadow, keyShadow, BlendMode.DST_ATOP)
+ renderNode.setRenderEffect(blend)
+ return renderNode
+ }
+
+ @VisibleForTesting
+ fun createShadowRenderEffect(
+ radius: Float,
+ offsetX: Float,
+ offsetY: Float,
+ alpha: Float
+ ): RenderEffect {
+ return RenderEffect.createColorFilterEffect(
+ PorterDuffColorFilter(Color.argb(alpha, 0f, 0f, 0f), PorterDuff.Mode.MULTIPLY),
+ RenderEffect.createOffsetEffect(
+ offsetX,
+ offsetY,
+ RenderEffect.createBlurEffect(radius, radius, Shader.TileMode.CLAMP)
+ )
+ )
+ }
+
+ override fun draw(canvas: Canvas) {
+ if (canvas.isHardwareAccelerated && mDoubleShadowNode != null) {
+ if (!mDoubleShadowNode.hasDisplayList()) {
+ // Record render node if its display list is not recorded or discarded
+ // (which happens when it's no longer drawn by anything).
+ val recordingCanvas = mDoubleShadowNode.beginRecording()
+ mIconDrawable.draw(recordingCanvas)
+ mDoubleShadowNode.endRecording()
+ }
+ canvas.drawRenderNode(mDoubleShadowNode)
+ }
+ mIconDrawable.draw(canvas)
+ }
+
+ override fun getIntrinsicHeight() = iconSize
+
+ override fun getIntrinsicWidth() = iconSize
+
+ override fun getOpacity() = PixelFormat.TRANSPARENT
+
+ override fun setAlpha(alpha: Int) {
+ mIconDrawable.alpha = alpha
+ }
+
+ override fun setColorFilter(colorFilter: ColorFilter?) {
+ mIconDrawable.colorFilter = colorFilter
+ }
+
+ override fun setTint(color: Int) {
+ mIconDrawable.setTint(color)
+ }
+
+ override fun setTintList(tint: ColorStateList?) {
+ mIconDrawable.setTintList(tint)
+ }
+}
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index f560311..37482ac 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -18,6 +18,7 @@
import static android.view.Gravity.LEFT;
import static com.android.app.animation.Interpolators.LINEAR;
+import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
import static com.android.launcher3.Utilities.getFullDrawable;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -55,7 +56,6 @@
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons;
-import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.popup.SystemShortcut;
@@ -69,7 +69,7 @@
public class FloatingIconView extends FrameLayout implements
Animator.AnimatorListener, OnGlobalLayoutListener, FloatingView {
- private static final String TAG = FloatingIconView.class.getSimpleName();
+ private static final String TAG = "FloatingIconView";
// Manages loading the icon on a worker thread
private static @Nullable IconLoadResult sIconLoadResult;
@@ -146,25 +146,49 @@
}
/**
- * Positions this view to match the size and location of {@param rect}.
- * @param alpha The alpha[0, 1] of the entire floating view.
- * @param progress A value from [0, 1] that represents the animation progress.
- * @param shapeProgressStart The progress value at which to start the shape reveal.
- * @param cornerRadius The corner radius of {@param rect}.
- * @param isOpening True if view is used for app open animation, false for app close animation.
+ * Positions this view to match the size and location of {@code rect}.
*/
public void update(float alpha, RectF rect, float progress, float shapeProgressStart,
float cornerRadius, boolean isOpening) {
- setAlpha(alpha);
+ update(alpha, rect, progress, shapeProgressStart, cornerRadius, isOpening, 0);
+ }
+
+ /**
+ * Positions this view to match the size and location of {@code rect}.
+ * <p>
+ * @param alpha The alpha[0, 1] of the entire floating view.
+ * @param progress A value from [0, 1] that represents the animation progress.
+ * @param shapeProgressStart The progress value at which to start the shape reveal.
+ * @param cornerRadius The corner radius of {@code rect}.
+ * @param isOpening True if view is used for app open animation, false for app close animation.
+ * @param taskViewDrawAlpha the drawn {@link com.android.quickstep.views.TaskView} alpha
+ */
+ public void update(float alpha, RectF rect, float progress, float shapeProgressStart,
+ float cornerRadius, boolean isOpening, int taskViewDrawAlpha) {
+ // The non-running task home animation has some very funky first few frames because this
+ // FIV hasn't fully laid out. During those frames, hide this FIV and continue drawing the
+ // TaskView directly while transforming it in the place of this FIV. However, if we fade
+ // the TaskView at all, we need to display this FIV regardless.
+ setAlpha(!enableAdditionalHomeAnimations() || isLaidOut() || taskViewDrawAlpha < 255
+ ? alpha : 0f);
mClipIconView.update(rect, progress, shapeProgressStart, cornerRadius, isOpening, this,
- mLauncher.getDeviceProfile());
+ mLauncher.getDeviceProfile(), taskViewDrawAlpha);
if (mFadeOutView != null) {
- // The alpha goes from 1 to 0 when progress is 0 and 0.33 respectively.
- mFadeOutView.setAlpha(1 - Math.min(1f, mapToRange(progress, 0, 0.33f, 0, 1, LINEAR)));
+ // The alpha goes from 1 to 0 when progress is 0 and 0.15 respectively.
+ // This value minimizes view display time while still allowing the view to fade out.
+ mFadeOutView.setAlpha(1 - Math.min(1f, mapToRange(progress, 0, 0.15f, 0, 1, LINEAR)));
}
}
+ /**
+ * Sets a {@link com.android.quickstep.views.TaskView} that will draw a
+ * {@link com.android.quickstep.views.TaskView} within the {@code mClipIconView} clip bounds
+ */
+ public void setOverlayArtist(ClipIconView.TaskViewArtist taskViewArtist) {
+ mClipIconView.setTaskViewArtist(taskViewArtist);
+ }
+
@Override
public void onAnimationEnd(Animator animator) {
if (mLoadIconSignal != null) {
@@ -179,8 +203,8 @@
}
/**
- * Sets the size and position of this view to match {@param v}.
- *
+ * Sets the size and position of this view to match {@code v}.
+ * <p>
* @param v The view to copy
* @param positionOut Rect that will hold the size and position of v.
*/
@@ -254,10 +278,11 @@
/**
* Loads the icon and saves the results to {@link #sIconLoadResult}.
+ * <p>
* Runs onIconLoaded callback (if any), which signifies that the FloatingIconView is
* ready to display the icon. Otherwise, the FloatingIconView will grab the results when its
* initialized.
- *
+ * <p>
* @param originalView The View that the FloatingIconView will replace.
* @param info ItemInfo of the originalView
* @param pos The position of the view.
@@ -324,8 +349,8 @@
}
/**
- * Sets the drawables of the {@param originalView} onto this view.
- *
+ * Sets the drawables of the {@code originalView} onto this view.
+ * <p>
* @param drawable The drawable of the original view.
* @param badge The badge of the original view.
* @param iconOffset The amount of offset needed to match this view with the original view.
@@ -368,11 +393,11 @@
/**
* Draws the drawable of the BubbleTextView behind ClipIconView
- *
+ * <p>
* This is used to:
* - Have icon displayed while Adaptive Icon is loading
* - Displays the built in shadow to ensure a clean handoff
- *
+ * <p>
* Allows nullable as this may be cleared when drawing is deferred to ClipIconView.
*/
private void setOriginalDrawableBackground(@Nullable Supplier<Drawable> btvIcon) {
@@ -573,11 +598,12 @@
}
/**
- * Creates a floating icon view for {@param originalView}.
+ * Creates a floating icon view for {@code originalView}.
+ * <p>
* @param originalView The view to copy
* @param visibilitySyncView A view whose visibility should update in sync with originalView.
* @param fadeOutView A view that will fade out as the animation progresses.
- * @param hideOriginal If true, it will hide {@param originalView} while this view is visible.
+ * @param hideOriginal If true, it will hide {@code originalView} while this view is visible.
* Else, we will not draw anything in this view.
* @param positionOut Rect that will hold the size and position of v.
* @param isOpening True if this view replaces the icon for app open animation.
diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
index df8f635..63648dd 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -20,6 +20,9 @@
import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
+import static com.android.launcher3.views.RecyclerViewFastScroller.FastScrollerLocation.ALL_APPS_SCROLLER;
+import static com.android.launcher3.views.RecyclerViewFastScroller.FastScrollerLocation.WIDGET_SCROLLER;
+
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
@@ -40,11 +43,15 @@
import android.view.WindowInsets;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.FastScrollRecyclerView;
+import com.android.launcher3.Flags;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
+import com.android.launcher3.allapps.LetterListTextView;
import com.android.launcher3.graphics.FastScrollThumbDrawable;
import com.android.launcher3.util.Themes;
@@ -55,6 +62,19 @@
* The track and scrollbar that shows when you scroll the list.
*/
public class RecyclerViewFastScroller extends View {
+
+ /** FastScrollerLocation describes what RecyclerView the fast scroller is dedicated to. */
+ public enum FastScrollerLocation {
+ UNKNOWN_SCROLLER(0),
+ ALL_APPS_SCROLLER(1),
+ WIDGET_SCROLLER(2);
+
+ public final int location;
+
+ FastScrollerLocation(int location) {
+ this.location = location;
+ }
+ }
private static final String TAG = "RecyclerViewFastScroller";
private static final boolean DEBUG = false;
private static final int FASTSCROLL_THRESHOLD_MILLIS = 40;
@@ -106,9 +126,18 @@
private final Point mThumbDrawOffset = new Point();
private final Paint mTrackPaint;
+ private final int mThumbColor;
+ private final int mThumbLetterScrollerColor;
private float mLastTouchY;
private boolean mIsDragging;
+ /**
+ * Tracks whether a keyboard hide request has been sent due to downward scrolling.
+ * <p>
+ * Set to true when scrolling down and reset when scrolling up to prevents redundant hide
+ * requests during continuous downward scrolls.
+ */
+ private boolean mRequestedHideKeyboard;
private boolean mIsThumbDetached;
private final boolean mCanThumbDetach;
private boolean mIgnoreDragGesture;
@@ -127,10 +156,12 @@
protected FastScrollRecyclerView mRv;
private RecyclerView.OnScrollListener mOnScrollListener;
+ private final ActivityContext mActivityContext;
private int mDownX;
private int mDownY;
private int mLastY;
+ private FastScrollerLocation mFastScrollerLocation;
public RecyclerViewFastScroller(Context context) {
this(context, null);
@@ -143,13 +174,16 @@
public RecyclerViewFastScroller(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
+ mFastScrollerLocation = FastScrollerLocation.UNKNOWN_SCROLLER;
mTrackPaint = new Paint();
mTrackPaint.setColor(Themes.getAttrColor(context, android.R.attr.textColorPrimary));
mTrackPaint.setAlpha(MAX_TRACK_ALPHA);
+ mThumbColor = Themes.getColorAccent(context);
+ mThumbLetterScrollerColor = Themes.getAttrColor(context, R.attr.materialColorSurfaceBright);
mThumbPaint = new Paint();
mThumbPaint.setAntiAlias(true);
- mThumbPaint.setColor(Themes.getColorAccent(context));
+ mThumbPaint.setColor(mThumbColor);
mThumbPaint.setStyle(Paint.Style.FILL);
Resources res = getResources();
@@ -163,7 +197,7 @@
mDeltaThreshold = res.getDisplayMetrics().density * SCROLL_DELTA_THRESHOLD_DP;
mScrollbarLeftOffsetTouchDelegate = res.getDisplayMetrics().density
* SCROLLBAR_LEFT_OFFSET_TOUCH_DELEGATE_DP;
-
+ mActivityContext = ActivityContext.lookupContext(context);
TypedArray ta =
context.obtainStyledAttributes(attrs, R.styleable.RecyclerViewFastScroller, defStyleAttr, 0);
mCanThumbDetach = ta.getBoolean(R.styleable.RecyclerViewFastScroller_canThumbDetach, false);
@@ -248,6 +282,7 @@
mDownX = x;
mDownY = mLastY = y;
mDownTimeStampMillis = ev.getDownTime();
+ mRequestedHideKeyboard = false;
if ((Math.abs(mDy) < mDeltaThreshold &&
mRv.getScrollState() != SCROLL_STATE_IDLE)) {
@@ -260,6 +295,7 @@
}
break;
case MotionEvent.ACTION_MOVE:
+ boolean isScrollingDown = y > mLastY;
mLastY = y;
int absDeltaY = Math.abs(y - mDownY);
int absDeltaX = Math.abs(x - mDownX);
@@ -275,6 +311,14 @@
}
}
if (mIsDragging) {
+ if (isScrollingDown) {
+ if (!mRequestedHideKeyboard) {
+ mActivityContext.hideKeyboard();
+ }
+ mRequestedHideKeyboard = true;
+ } else {
+ mRequestedHideKeyboard = false;
+ }
updateFastScrollSectionNameAndThumbOffset(y);
}
break;
@@ -294,7 +338,6 @@
}
private void calcTouchOffsetAndPrepToFastScroll(int downY, int lastY) {
- ActivityContext.lookupContext(getContext()).hideKeyboard();
mIsDragging = true;
if (mCanThumbDetach) {
mIsThumbDetached = true;
@@ -317,6 +360,18 @@
animatePopupVisibility(!TextUtils.isEmpty(sectionName));
mLastTouchY = boundedY;
setThumbOffsetY((int) mLastTouchY);
+ updateFastScrollerLetterList(y);
+ }
+
+ private void updateFastScrollerLetterList(int y) {
+ if (!shouldUseLetterFastScroller()) {
+ return;
+ }
+ ConstraintLayout mLetterList = mRv.getLetterList();
+ for (int i = 0; i < mLetterList.getChildCount(); i++) {
+ LetterListTextView currentLetter = (LetterListTextView) mLetterList.getChildAt(i);
+ currentLetter.animateBasedOnYPosition(y + mTouchOffsetY);
+ }
}
/** End any active fast scrolling touch handling, if applicable. */
@@ -342,15 +397,35 @@
mThumbDrawOffset.set(getWidth() / 2, mRv.getScrollBarTop());
// Draw the track
float halfW = mWidth / 2;
- canvas.drawRoundRect(-halfW, 0, halfW, mRv.getScrollbarTrackHeight(),
- mWidth, mWidth, mTrackPaint);
-
- canvas.translate(0, mThumbOffsetY);
+ boolean useLetterFastScroller = shouldUseLetterFastScroller();
+ if (useLetterFastScroller) {
+ float translateX;
+ if (mIsDragging) {
+ // halfW * 3 is half circle.
+ translateX = halfW * 3;
+ } else {
+ translateX = halfW * 5;
+ }
+ canvas.translate(translateX, mThumbOffsetY);
+ } else {
+ canvas.drawRoundRect(-halfW, 0, halfW, mRv.getScrollbarTrackHeight(),
+ mWidth, mWidth, mTrackPaint);
+ canvas.translate(0, mThumbOffsetY);
+ }
mThumbDrawOffset.y += mThumbOffsetY;
+
+ /* Draw half circle */
halfW += mThumbPadding;
float r = getScrollThumbRadius();
- mThumbBounds.set(-halfW, 0, halfW, mThumbHeight);
- canvas.drawRoundRect(mThumbBounds, r, r, mThumbPaint);
+ if (useLetterFastScroller) {
+ mThumbPaint.setColor(mThumbLetterScrollerColor);
+ mThumbBounds.set(0, 0, 0, mThumbHeight);
+ canvas.drawCircle(-halfW, halfW, r * 2, mThumbPaint);
+ } else {
+ mThumbPaint.setColor(mThumbColor);
+ mThumbBounds.set(-halfW, 0, halfW, mThumbHeight);
+ canvas.drawRoundRect(mThumbBounds, r, r, mThumbPaint);
+ }
mThumbBounds.roundOut(SYSTEM_GESTURE_EXCLUSION_RECT.get(0));
// swiping very close to the thumb area (not just within it's bound)
// will also prevent back gesture
@@ -363,6 +438,11 @@
canvas.restoreToCount(saveCount);
}
+ boolean shouldUseLetterFastScroller() {
+ return Flags.letterFastScroller()
+ && getScrollerLocation() == FastScrollerLocation.ALL_APPS_SCROLLER;
+ }
+
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
mSystemGestureInsets = insets.getSystemGestureInsets();
@@ -404,19 +484,25 @@
return isNearThumb(x, y);
}
- /**
- * Returns whether the specified x position is near the scroll bar.
- */
- public boolean isNearScrollBar(int x) {
- return x >= (getWidth() - mMaxWidth) / 2 - mScrollbarLeftOffsetTouchDelegate
- && x <= (getWidth() + mMaxWidth) / 2;
+ public FastScrollerLocation getScrollerLocation() {
+ return mFastScrollerLocation;
+ }
+
+ public void setFastScrollerLocation(@NonNull FastScrollerLocation location) {
+ mFastScrollerLocation = location;
}
private void animatePopupVisibility(boolean visible) {
if (mPopupVisible != visible) {
mPopupVisible = visible;
- mPopupView.animate().cancel();
- mPopupView.animate().alpha(visible ? 1f : 0f).setDuration(visible ? 200 : 150).start();
+ if (shouldUseLetterFastScroller()) {
+ mRv.getLetterList().animate().alpha(visible ? 1f : 0f)
+ .setDuration(visible ? 200 : 150).start();
+ } else {
+ mPopupView.animate().cancel();
+ mPopupView.animate().alpha(visible ? 1f : 0f)
+ .setDuration(visible ? 200 : 150).start();
+ }
}
}
diff --git a/src/com/android/launcher3/views/ShadowInfo.kt b/src/com/android/launcher3/views/ShadowInfo.kt
new file mode 100644
index 0000000..4f626ec
--- /dev/null
+++ b/src/com/android/launcher3/views/ShadowInfo.kt
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.views
+
+import android.content.Context
+import android.util.AttributeSet
+import com.android.launcher3.R
+
+/**
+ * Launcher data holder for classes such as [DoubleShadowBubbleTextView] to model shadows for
+ * "double shadow" effect.
+ */
+data class ShadowInfo(
+ val ambientShadowBlur: Float,
+ val ambientShadowColor: Int,
+ val keyShadowBlur: Float,
+ val keyShadowOffsetX: Float,
+ val keyShadowOffsetY: Float,
+ val keyShadowColor: Int
+) {
+
+ companion object {
+ /** Constructs instance of ShadowInfo from Context and given attribute set. */
+ @JvmStatic
+ fun fromContext(context: Context, attrs: AttributeSet?, defStyle: Int): ShadowInfo {
+ val styledAttrs =
+ context.obtainStyledAttributes(attrs, R.styleable.ShadowInfo, defStyle, 0)
+ val shadowInfo =
+ ShadowInfo(
+ ambientShadowBlur =
+ styledAttrs
+ .getDimensionPixelSize(R.styleable.ShadowInfo_ambientShadowBlur, 0)
+ .toFloat(),
+ ambientShadowColor =
+ styledAttrs.getColor(R.styleable.ShadowInfo_ambientShadowColor, 0),
+ keyShadowBlur =
+ styledAttrs
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowBlur, 0)
+ .toFloat(),
+ keyShadowOffsetX =
+ styledAttrs
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetX, 0)
+ .toFloat(),
+ keyShadowOffsetY =
+ styledAttrs
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetY, 0)
+ .toFloat(),
+ keyShadowColor = styledAttrs.getColor(R.styleable.ShadowInfo_keyShadowColor, 0)
+ )
+ styledAttrs.recycle()
+ return shadowInfo
+ }
+ }
+}
diff --git a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
index 4f5d311..5e702aa 100644
--- a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
@@ -145,7 +145,10 @@
@Override
protected int getScrimColor(Context context) {
- return context.getResources().getColor(R.color.widgets_picker_scrim);
+ // Don't add a scrim when using the standalone picker activity. The background dimming is
+ // handled by applying dimBackground in the activity theme, so the scrim doesn't slide in
+ // with the window.
+ return -1;
}
@SuppressLint("NewApi") // Already added API check.
diff --git a/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java b/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java
index 104209e..856f4b3 100644
--- a/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java
@@ -110,7 +110,7 @@
}
View background = RoundedCornerEnforcement.findBackground(this);
if (background == null
- || RoundedCornerEnforcement.hasAppWidgetOptedOut(this, background)) {
+ || RoundedCornerEnforcement.hasAppWidgetOptedOut(background)) {
resetRoundedCorners();
return;
}
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 8892a18..1c0d94c 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -17,6 +17,8 @@
import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.launcher3.Flags.enableWidgetTapToAdd;
+import static com.android.launcher3.LauncherState.NORMAL;
+import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_ADD_BUTTON_TAP;
import android.content.Context;
@@ -42,13 +44,14 @@
import com.android.launcher3.Launcher;
import com.android.launcher3.PendingAddItemInfo;
import com.android.launcher3.R;
-import com.android.launcher3.popup.PopupDataProvider;
+import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.window.WindowManagerProxy;
import com.android.launcher3.views.AbstractSlideInView;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider.WidgetPickerDataChangeListener;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -57,7 +60,7 @@
*/
public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
implements OnClickListener, OnLongClickListener,
- PopupDataProvider.PopupDataChangeListener, Insettable, OnDeviceProfileChangeListener {
+ WidgetPickerDataChangeListener, Insettable, OnDeviceProfileChangeListener {
/** The default number of cells that can fit horizontally in a widget sheet. */
public static final int DEFAULT_MAX_HORIZONTAL_SPANS = 4;
@@ -74,6 +77,7 @@
private boolean mDisableNavBarScrim = false;
@Nullable private WidgetCell mWidgetCellWithAddButton = null;
+ @Nullable private WidgetItem mLastSelectedWidgetItem = null;
public BaseWidgetSheet(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
@@ -102,14 +106,14 @@
WindowInsets windowInsets = WindowManagerProxy.INSTANCE.get(getContext())
.normalizeWindowInsets(getContext(), getRootWindowInsets(), new Rect());
mNavBarScrimHeight = getNavBarScrimHeight(windowInsets);
- mActivityContext.getPopupDataProvider().setChangeListener(this);
+ mActivityContext.getWidgetPickerDataProvider().setChangeListener(this);
mActivityContext.addOnDeviceProfileChangeListener(this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
- mActivityContext.getPopupDataProvider().setChangeListener(null);
+ mActivityContext.getWidgetPickerDataProvider().setChangeListener(null);
mActivityContext.removeOnDeviceProfileChangeListener(this);
}
@@ -161,13 +165,26 @@
}
mWidgetCellWithAddButton = mWidgetCellWithAddButton != wc ? wc : null;
+ if (mWidgetCellWithAddButton != null) {
+ mLastSelectedWidgetItem = mWidgetCellWithAddButton.getWidgetItem();
+ } else {
+ mLastSelectedWidgetItem = null;
+ }
} else {
mActivityContext.getItemOnClickListener().onClick(wc);
}
}
+ @Override
+ protected float getShiftRange() {
+ // We add the extra height added during predictive back / swipe up to the shift range, so
+ // that the idle interpolator knows to animate the view off fully.
+ return mContent.getHeight() + getBottomOffsetPx();
+ }
+
/**
- * Click handler for tap to add button.
+ * Click handler for tap to add button. This handler assumes we are in the Launcher activity and
+ * should not be used when the widget sheet is displayed elsewhere.
*/
private void addWidget(@NonNull PendingAddItemInfo info) {
// Using a boolean flag here to make sure the callback is only run once. This should never
@@ -175,19 +192,23 @@
// needed.
final AtomicBoolean hasRun = new AtomicBoolean(false);
addOnCloseListener(() -> {
- if (!hasRun.get()) {
- Launcher.getLauncher(mActivityContext).getAccessibilityDelegate().addToWorkspace(
- info, /*accessibility=*/ false,
+ if (hasRun.get()) return;
+ hasRun.set(true);
+
+ // Going to NORMAL state will also dismiss the All Apps view if it is showing.
+ Launcher launcher = Launcher.getLauncher(mActivityContext);
+ launcher.getStateManager().goToState(NORMAL, forSuccessCallback(() -> {
+ launcher.getAccessibilityDelegate().addToWorkspace(info,
+ /*accessibility=*/ false,
/*finishCallback=*/ (success) -> {
mActivityContext.getStatsLogManager()
.logger()
.withItemInfo(info)
.log(LAUNCHER_WIDGET_ADD_BUTTON_TAP);
});
- hasRun.set(true);
- }
+ }));
});
- handleClose(true);
+ close(/* animate= */ true);
}
/**
@@ -236,6 +257,14 @@
return 0;
}
+ /**
+ * Returns the component of the widget that is currently showing an add button, if any.
+ */
+ @Nullable
+ protected WidgetItem getLastSelectedWidgetItem() {
+ return mLastSelectedWidgetItem;
+ }
+
@Override
public boolean onLongClick(View v) {
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
@@ -302,8 +331,21 @@
* status bar, into account.
*/
protected void doMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int widthUsed = getInsetsWidth();
+
DeviceProfile deviceProfile = mActivityContext.getDeviceProfile();
+ measureChildWithMargins(mContent, widthMeasureSpec,
+ widthUsed, heightMeasureSpec, deviceProfile.bottomSheetTopPadding);
+ setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
+ MeasureSpec.getSize(heightMeasureSpec));
+ }
+
+ /**
+ * Returns the width used on left and right by the insets / padding.
+ */
+ protected int getInsetsWidth() {
int widthUsed;
+ DeviceProfile deviceProfile = mActivityContext.getDeviceProfile();
if (deviceProfile.isTablet) {
widthUsed = Math.max(2 * getTabletHorizontalMargin(deviceProfile),
2 * (mInsets.left + mInsets.right));
@@ -314,11 +356,7 @@
widthUsed = Math.max(padding.left + padding.right,
2 * (mInsets.left + mInsets.right));
}
-
- measureChildWithMargins(mContent, widthMeasureSpec,
- widthUsed, heightMeasureSpec, deviceProfile.bottomSheetTopPadding);
- setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
- MeasureSpec.getSize(heightMeasureSpec));
+ return widthUsed;
}
/** Returns the horizontal margins to be applied to the widget sheet. **/
diff --git a/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java b/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
index aab78bd..2817299 100644
--- a/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
+++ b/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
@@ -27,12 +27,12 @@
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
-import android.os.AsyncTask;
import android.os.Handler;
import android.util.Log;
import android.util.Size;
import androidx.annotation.NonNull;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState;
@@ -45,6 +45,7 @@
import com.android.launcher3.pm.ShortcutConfigActivityInfo;
import com.android.launcher3.util.CancellableTask;
import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.util.WidgetSizes;
@@ -68,8 +69,7 @@
}
/**
- * Generates the widget preview on {@link AsyncTask#THREAD_POOL_EXECUTOR}. Must be
- * called on UI thread.
+ * Generates the widget preview on {@link Executors#UI_HELPER_EXECUTOR}.
*
* @return a request id which can be used to cancel the request.
*/
@@ -78,7 +78,7 @@
@NonNull WidgetItem item,
@NonNull Size previewSize,
@NonNull Consumer<Bitmap> callback) {
- Handler handler = Executors.UI_HELPER_EXECUTOR.getHandler();
+ Handler handler = getLoaderExecutor().getHandler();
CancellableTask<Bitmap> request = new CancellableTask<>(
() -> generatePreview(item, previewSize.getWidth(), previewSize.getHeight()),
MAIN_EXECUTOR,
@@ -87,6 +87,12 @@
return request;
}
+ @VisibleForTesting
+ @NonNull
+ public static LooperExecutor getLoaderExecutor() {
+ return Executors.UI_HELPER_EXECUTOR;
+ }
+
/**
* Returns a generated preview for a widget and if the preview should be saved in persistent
* storage.
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
index 40c3984..91b899c 100644
--- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
@@ -21,22 +21,17 @@
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
-import android.view.accessibility.AccessibilityNodeInfo;
-import android.widget.RemoteViews;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.util.Executors;
-import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.widget.LauncherWidgetHolder.ProviderChangedListener;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import java.util.Set;
-import java.util.WeakHashMap;
import java.util.function.IntConsumer;
/**
@@ -83,6 +78,11 @@
mViewToRecycle = viewToRecycle;
}
+ @VisibleForTesting
+ @Nullable ListenableHostView getViewToRecycle() {
+ return mViewToRecycle;
+ }
+
@Override
@NonNull
public LauncherAppWidgetHostView onCreateView(Context context, int appWidgetId,
@@ -129,37 +129,4 @@
public void clearViews() {
super.clearViews();
}
-
- public static class ListenableHostView extends LauncherAppWidgetHostView {
-
- private Set<Runnable> mUpdateListeners = Collections.EMPTY_SET;
-
- ListenableHostView(Context context) {
- super(context);
- }
-
- @Override
- public void updateAppWidget(RemoteViews remoteViews) {
- super.updateAppWidget(remoteViews);
- mUpdateListeners.forEach(Runnable::run);
- }
-
- @Override
- public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
- super.onInitializeAccessibilityNodeInfo(info);
- info.setClassName(LauncherAppWidgetHostView.class.getName());
- }
-
- /**
- * Adds a callback to be run everytime the provided app widget updates.
- * @return a closable to remove this callback
- */
- public SafeCloseable addUpdateListener(Runnable callback) {
- if (mUpdateListeners == Collections.EMPTY_SET) {
- mUpdateListeners = Collections.newSetFromMap(new WeakHashMap<>());
- }
- mUpdateListeners.add(callback);
- return () -> mUpdateListeners.remove(callback);
- }
- }
}
diff --git a/src/com/android/launcher3/widget/LauncherWidgetHolder.java b/src/com/android/launcher3/widget/LauncherWidgetHolder.java
index a5e22c5..f499fca 100644
--- a/src/com/android/launcher3/widget/LauncherWidgetHolder.java
+++ b/src/com/android/launcher3/widget/LauncherWidgetHolder.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.BuildConfig.WIDGETS_ENABLED;
import static com.android.launcher3.Flags.enableWorkspaceInflation;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.widget.LauncherAppWidgetProviderInfo.fromProviderInfo;
import android.appwidget.AppWidgetHost;
@@ -36,6 +37,8 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
+import androidx.annotation.WorkerThread;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseDraggingActivity;
@@ -44,13 +47,14 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.util.SafeCloseable;
-import com.android.launcher3.widget.LauncherAppWidgetHost.ListenableHostView;
import com.android.launcher3.widget.custom.CustomWidgetManager;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.IntConsumer;
/**
@@ -77,7 +81,7 @@
protected final SparseArray<LauncherAppWidgetHostView> mViews = new SparseArray<>();
protected final List<ProviderChangedListener> mProviderChangedListeners = new ArrayList<>();
- protected int mFlags = FLAG_STATE_IS_NORMAL;
+ protected AtomicInteger mFlags = new AtomicInteger(FLAG_STATE_IS_NORMAL);
// TODO(b/191735836): Replace with ActivityOptions.KEY_SPLASH_SCREEN_STYLE when un-hidden
private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle";
@@ -96,6 +100,10 @@
context, appWidgetRemovedCallback, mProviderChangedListeners);
}
+ protected LooperExecutor getWidgetHolderExecutor() {
+ return UI_HELPER_EXECUTOR;
+ }
+
/**
* Starts listening to the widget updates from the server side
*/
@@ -104,21 +112,23 @@
return;
}
- try {
- mWidgetHost.startListening();
- } catch (Exception e) {
- if (!Utilities.isBinderSizeError(e)) {
- throw new RuntimeException(e);
+ getWidgetHolderExecutor().execute(() -> {
+ try {
+ mWidgetHost.startListening();
+ } catch (Exception e) {
+ if (!Utilities.isBinderSizeError(e)) {
+ throw new RuntimeException(e);
+ }
+ // We're willing to let this slide. The exception is being caused by the list of
+ // RemoteViews which is being passed back. The startListening relationship will
+ // have been established by this point, and we will end up populating the
+ // widgets upon bind anyway. See issue 14255011 for more context.
}
- // We're willing to let this slide. The exception is being caused by the list of
- // RemoteViews which is being passed back. The startListening relationship will
- // have been established by this point, and we will end up populating the
- // widgets upon bind anyway. See issue 14255011 for more context.
- }
- // TODO: Investigate why widgetHost.startListening() always return non-empty updates
- setListeningFlag(true);
+ // TODO: Investigate why widgetHost.startListening() always return non-empty updates
+ setListeningFlag(true);
- updateDeferredView();
+ MAIN_EXECUTOR.execute(() -> updateDeferredView());
+ });
}
/**
@@ -282,16 +292,23 @@
if (!WIDGETS_ENABLED) {
return;
}
- mWidgetHost.stopListening();
- setListeningFlag(false);
+ getWidgetHolderExecutor().execute(() -> {
+ mWidgetHost.stopListening();
+ setListeningFlag(false);
+ });
}
+ /**
+ * Update {@link FLAG_LISTENING} on {@link mFlags} after making binder calls from
+ * {@link sWidgetHost}.
+ */
+ @WorkerThread
protected void setListeningFlag(final boolean isListening) {
if (isListening) {
- mFlags |= FLAG_LISTENING;
+ mFlags.updateAndGet(old -> old | FLAG_LISTENING);
return;
}
- mFlags &= ~FLAG_LISTENING;
+ mFlags.updateAndGet(old -> old & ~FLAG_LISTENING);
}
/**
@@ -373,7 +390,7 @@
* as a result of using the same flow.
*/
protected LauncherAppWidgetHostView recycleExistingView(LauncherAppWidgetHostView view) {
- if ((mFlags & FLAG_LISTENING) == 0) {
+ if ((mFlags.get() & FLAG_LISTENING) == 0) {
if (view instanceof PendingAppWidgetHostView pv && pv.isDeferredWidget()) {
return view;
} else {
@@ -395,7 +412,7 @@
@NonNull
protected LauncherAppWidgetHostView createViewInternal(
int appWidgetId, @NonNull LauncherAppWidgetProviderInfo appWidget) {
- if ((mFlags & FLAG_LISTENING) == 0) {
+ if ((mFlags.get() & FLAG_LISTENING) == 0) {
// Since the launcher hasn't started listening to widget updates, we can't simply call
// host.createView here because the later will make a binder call to retrieve
// RemoteViews from system process.
@@ -460,25 +477,27 @@
* @return True if the host is listening to the updates, false otherwise
*/
public boolean isListening() {
- return (mFlags & FLAG_LISTENING) != 0;
+ return (mFlags.get() & FLAG_LISTENING) != 0;
}
/**
* Sets or unsets a flag the can change whether the widget host should be in the listening
* state.
*/
- private void setShouldListenFlag(int flag, boolean on) {
+ @VisibleForTesting
+ void setShouldListenFlag(int flag, boolean on) {
if (on) {
- mFlags |= flag;
+ mFlags.updateAndGet(old -> old | flag);
} else {
- mFlags &= ~flag;
+ mFlags.updateAndGet(old -> old & ~flag);
}
final boolean listening = isListening();
- if (!listening && shouldListen(mFlags)) {
+ int currentFlag = mFlags.get();
+ if (!listening && shouldListen(currentFlag)) {
// Postpone starting listening until all flags are on.
startListening();
- } else if (listening && (mFlags & FLAG_ACTIVITY_STARTED) == 0) {
+ } else if (listening && (currentFlag & FLAG_ACTIVITY_STARTED) == 0) {
// Postpone stopping listening until the activity is stopped.
stopListening();
}
diff --git a/src/com/android/launcher3/widget/ListenableHostView.java b/src/com/android/launcher3/widget/ListenableHostView.java
new file mode 100644
index 0000000..b809db0
--- /dev/null
+++ b/src/com/android/launcher3/widget/ListenableHostView.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget;
+
+import android.content.Context;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.widget.RemoteViews;
+
+import com.android.launcher3.util.SafeCloseable;
+
+import java.util.Collections;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+public class ListenableHostView extends LauncherAppWidgetHostView {
+
+ private Set<Runnable> mUpdateListeners = Collections.EMPTY_SET;
+
+ ListenableHostView(Context context) {
+ super(context);
+ }
+
+ @Override
+ public void updateAppWidget(RemoteViews remoteViews) {
+ super.updateAppWidget(remoteViews);
+ mUpdateListeners.forEach(Runnable::run);
+ }
+
+ @Override
+ public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+ super.onInitializeAccessibilityNodeInfo(info);
+ info.setClassName(LauncherAppWidgetHostView.class.getName());
+ }
+
+ /**
+ * Adds a callback to be run everytime the provided app widget updates.
+ * @return a closable to remove this callback
+ */
+ public SafeCloseable addUpdateListener(Runnable callback) {
+ if (mUpdateListeners == Collections.EMPTY_SET) {
+ mUpdateListeners = Collections.newSetFromMap(new WeakHashMap<>());
+ }
+ mUpdateListeners.add(callback);
+ return () -> mUpdateListeners.remove(callback);
+ }
+}
diff --git a/src/com/android/launcher3/widget/RoundedCornerEnforcement.java b/src/com/android/launcher3/widget/RoundedCornerEnforcement.java
index 1e46ffd..2e5e251 100644
--- a/src/com/android/launcher3/widget/RoundedCornerEnforcement.java
+++ b/src/com/android/launcher3/widget/RoundedCornerEnforcement.java
@@ -67,7 +67,7 @@
/**
* Check whether the app widget has opted out of the enforcement.
*/
- public static boolean hasAppWidgetOptedOut(@NonNull View appWidget, @NonNull View background) {
+ public static boolean hasAppWidgetOptedOut(@NonNull View background) {
return background.getId() == android.R.id.background && background.getClipToOutline();
}
diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java
index 6dcaf75..b7ad95e 100644
--- a/src/com/android/launcher3/widget/WidgetCell.java
+++ b/src/com/android/launcher3/widget/WidgetCell.java
@@ -29,6 +29,7 @@
import android.animation.TimeInterpolator;
import android.content.Context;
import android.graphics.Bitmap;
+import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -39,7 +40,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
-import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
@@ -102,6 +102,8 @@
private Size mWidgetSize;
private final DatabaseWidgetPreviewLoader mWidgetPreviewLoader;
+ @Nullable
+ private PreviewReadyListener mPreviewReadyListener = null;
protected CancellableTask mActiveRequest;
private boolean mAnimatePreview = true;
@@ -117,7 +119,8 @@
private CancellableTask mIconLoadRequest;
private boolean mIsShowingAddButton = false;
-
+ // Height enforced by the parent to align all widget cells displayed by it.
+ private int mParentAlignedPreviewHeight;
public WidgetCell(Context context) {
this(context, null);
}
@@ -189,6 +192,8 @@
mWidgetDims.setText(null);
mWidgetDescription.setText(null);
mWidgetDescription.setVisibility(GONE);
+ mPreviewReadyListener = null;
+ mParentAlignedPreviewHeight = 0;
showDescription(true);
showDimensions(true);
@@ -337,8 +342,8 @@
private void updateAppWidgetHostScale(NavigableAppWidgetHostView view) {
// Scale the content such that all of the content is visible
- int contentWidth = view.getWidth();
- int contentHeight = view.getHeight();
+ float contentWidth = view.getWidth();
+ float contentHeight = view.getHeight();
if (view.getChildCount() == 1) {
View content = view.getChildAt(0);
@@ -358,6 +363,19 @@
mAppWidgetHostViewScale = Math.min(pWidth / contentWidth, pHeight / contentHeight);
}
view.setScaleToFit(mAppWidgetHostViewScale);
+
+ // layout based previews maybe ready at this point to inspect their inner height.
+ if (mPreviewReadyListener != null) {
+ mPreviewReadyListener.onPreviewAvailable();
+ mPreviewReadyListener = null;
+ }
+ }
+
+ /**
+ * Returns a view (holding the previews) that can be dragged and dropped.
+ */
+ public View getDragAndDropView() {
+ return mWidgetImageContainer;
}
public WidgetImageView getWidgetView() {
@@ -383,6 +401,12 @@
removeView(mAppWidgetHostViewPreview);
mAppWidgetHostViewPreview = null;
}
+
+ // Drawables of the image previews are available at this point to measure.
+ if (mPreviewReadyListener != null) {
+ mPreviewReadyListener.onPreviewAvailable();
+ mPreviewReadyListener = null;
+ }
}
if (mAnimatePreview) {
@@ -475,12 +499,6 @@
}
@Override
- public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
- super.onInitializeAccessibilityNodeInfo(info);
- info.removeAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK);
- }
-
- @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ViewGroup.LayoutParams containerLp = mWidgetImageContainer.getLayoutParams();
int maxWidth = MeasureSpec.getSize(widthMeasureSpec);
@@ -488,20 +506,71 @@
// mPreviewContainerScale ensures the needed scaling with respect to original widget size.
mAppWidgetHostViewScale = mPreviewContainerScale;
containerLp.width = mPreviewContainerSize.getWidth();
- containerLp.height = mPreviewContainerSize.getHeight();
+ int height = mPreviewContainerSize.getHeight();
// If we don't have enough available width, scale the preview container to fit.
if (containerLp.width > maxWidth) {
containerLp.width = maxWidth;
mAppWidgetHostViewScale = (float) containerLp.width / mPreviewContainerSize.getWidth();
- containerLp.height = Math.round(
- mPreviewContainerSize.getHeight() * mAppWidgetHostViewScale);
+ height = Math.round(mPreviewContainerSize.getHeight() * mAppWidgetHostViewScale);
+ }
+
+ // Use parent aligned height in set.
+ if (mParentAlignedPreviewHeight > 0) {
+ containerLp.height = Math.min(height, mParentAlignedPreviewHeight);
+ } else {
+ containerLp.height = height;
}
// No need to call mWidgetImageContainer.setLayoutParams as we are in measure pass
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+
+ if (changed && isShowingAddButton()) {
+ post(this::setupIconOrTextButton);
+ }
+ }
+
+ /**
+ * Sets the height of the preview as adjusted by the parent to have this cell's content aligned
+ * with other cells displayed by the parent.
+ */
+ public void setParentAlignedPreviewHeight(int previewHeight) {
+ mParentAlignedPreviewHeight = previewHeight;
+ }
+
+ /**
+ * Returns the height of the preview without any empty space.
+ * In case of appwidget host views, it returns the height of first child. This way, if preview
+ * view provided by an app doesn't fill bounds, this will return actual height without white
+ * space.
+ */
+ public int getPreviewContentHeight() {
+ // By default assume scaled height.
+ int height = Math.round(mPreviewContainerScale * mWidgetSize.getHeight());
+
+ if (mWidgetImage != null && mWidgetImage.getDrawable() != null) {
+ // getBitmapBounds returns the scaled bounds.
+ Rect bitmapBounds = mWidgetImage.getBitmapBounds();
+ height = bitmapBounds.height();
+ } else if (mAppWidgetHostViewPreview != null
+ && mAppWidgetHostViewPreview.getChildCount() == 1) {
+ int contentHeight = Math.round(
+ mPreviewContainerScale * mWidgetSize.getHeight());
+ int previewInnerHeight = Math.round(
+ mAppWidgetHostViewScale * mAppWidgetHostViewPreview.getChildAt(
+ 0).getMeasuredHeight());
+ // Use either of the inner scaled height or the scaled widget height
+ height = Math.min(contentHeight, previewInnerHeight);
+ }
+
+ return height;
+ }
+
/**
* Loads a high resolution package icon to show next to the widget title.
*/
@@ -544,12 +613,47 @@
if (mIsShowingAddButton) return;
mIsShowingAddButton = true;
+ setupIconOrTextButton();
mWidgetAddButton.setOnClickListener(callback);
fadeThrough(/* hide= */ mWidgetTextContainer, /* show= */ mWidgetAddButton,
ADD_BUTTON_FADE_DURATION_MS, Interpolators.LINEAR);
}
/**
+ * Depending on the width of the cell, set up the add button to be icon-only or icon+text.
+ */
+ private void setupIconOrTextButton() {
+ String addText = getResources().getString(R.string.widget_add_button_label);
+ Rect textSize = new Rect();
+ mWidgetAddButton.getPaint().getTextBounds(addText, 0, addText.length(), textSize);
+ int startPadding = getResources()
+ .getDimensionPixelSize(R.dimen.widget_cell_add_button_start_padding);
+ int endPadding = getResources()
+ .getDimensionPixelSize(R.dimen.widget_cell_add_button_end_padding);
+ int drawableWidth = getResources()
+ .getDimensionPixelSize(R.dimen.widget_cell_add_button_drawable_width);
+ int drawablePadding = getResources()
+ .getDimensionPixelSize(R.dimen.widget_cell_add_button_drawable_padding);
+ int textButtonWidth = textSize.width() + startPadding + endPadding + drawableWidth
+ + drawablePadding;
+ if (textButtonWidth > getMeasuredWidth()) {
+ // Setup icon-only button
+ mWidgetAddButton.setText(null);
+ int startIconPadding = getResources()
+ .getDimensionPixelSize(R.dimen.widget_cell_add_icon_button_start_padding);
+ mWidgetAddButton.setPaddingRelative(/* start= */ startIconPadding, /* top= */ 0,
+ /* end= */ endPadding, /* bottom= */ 0);
+ mWidgetAddButton.setCompoundDrawablePadding(0);
+ } else {
+ // Setup icon + text button
+ mWidgetAddButton.setText(addText);
+ mWidgetAddButton.setPaddingRelative(/* start= */ startPadding, /* top= */ 0,
+ /* end= */ endPadding, /* bottom= */ 0);
+ mWidgetAddButton.setCompoundDrawablePadding(drawablePadding);
+ }
+ }
+
+ /**
* Hide tap to add button.
*/
public void hideAddButton(boolean animate) {
@@ -591,4 +695,34 @@
set.playSequentially(hideAnim, showAnim);
set.start();
}
+
+ /**
+ * Returns true if this WidgetCell is displaying the same item as info.
+ */
+ public boolean matchesItem(WidgetItem info) {
+ if (info == null || mItem == null) return false;
+ if (info.widgetInfo != null && mItem.widgetInfo != null) {
+ return info.widgetInfo.getUser().equals(mItem.widgetInfo.getUser())
+ && info.widgetInfo.getComponent().equals(mItem.widgetInfo.getComponent());
+ } else if (info.activityInfo != null && mItem.activityInfo != null) {
+ return info.activityInfo.getUser().equals(mItem.activityInfo.getUser())
+ && info.activityInfo.getComponent().equals(mItem.activityInfo.getComponent());
+ }
+ return false;
+ }
+
+ /**
+ * Listener to notify when previews are available.
+ */
+ public void addPreviewReadyListener(PreviewReadyListener previewReadyListener) {
+ mPreviewReadyListener = previewReadyListener;
+ }
+
+ /**
+ * Listener interface for subscribers to listen to preview's availability.
+ */
+ public interface PreviewReadyListener {
+ /** Handler on to invoke when previews are available. */
+ void onPreviewAvailable();
+ }
}
diff --git a/src/com/android/launcher3/widget/WidgetImageView.java b/src/com/android/launcher3/widget/WidgetImageView.java
index f332054..352c0a3 100644
--- a/src/com/android/launcher3/widget/WidgetImageView.java
+++ b/src/com/android/launcher3/widget/WidgetImageView.java
@@ -24,6 +24,8 @@
import android.util.AttributeSet;
import android.view.View;
+import com.android.launcher3.icons.RoundDrawableWrapper;
+
/**
* View that draws a bitmap horizontally centered. If the image width is greater than the view
* width, the image is scaled down appropriately.
@@ -85,6 +87,11 @@
final float scale = bitmapAspectRatio > containerAspectRatio ? myWidth / bitmapWidth
: myHeight / bitmapHeight;
+ // When updating the scale, also update scale on drawable if it has rounding.
+ if (mDrawable instanceof RoundDrawableWrapper && scale <= 1) {
+ ((RoundDrawableWrapper) mDrawable).setCornerRadiusScale(scale);
+ }
+
final float scaledWidth = bitmapWidth * scale;
final float scaledHeight = bitmapHeight * scale;
diff --git a/src/com/android/launcher3/widget/WidgetManagerHelper.java b/src/com/android/launcher3/widget/WidgetManagerHelper.java
index d293d15..23d0585 100644
--- a/src/com/android/launcher3/widget/WidgetManagerHelper.java
+++ b/src/com/android/launcher3/widget/WidgetManagerHelper.java
@@ -26,11 +26,13 @@
import android.os.Build;
import android.os.Bundle;
import android.os.UserHandle;
+import android.util.Log;
import android.widget.RemoteViews;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
@@ -56,8 +58,13 @@
final Context mContext;
public WidgetManagerHelper(Context context) {
+ this(context, AppWidgetManager.getInstance(context));
+ }
+
+ @VisibleForTesting
+ public WidgetManagerHelper(Context context, AppWidgetManager appWidgetManager) {
mContext = context;
- mAppWidgetManager = AppWidgetManager.getInstance(context);
+ mAppWidgetManager = appWidgetManager;
}
/**
@@ -104,6 +111,8 @@
// If exception is thrown because of device is locked, it means a race condition occurs
// that the user got locked again while launcher is processing the event. In this case
// we should return empty list.
+ Log.e(TAG, "getAllProviders: Error getting installed providers for"
+ + " package=" + packageUser.mPackageName, e);
return Collections.emptyList();
}
}
@@ -133,6 +142,8 @@
return LauncherAppWidgetProviderInfo.fromProviderInfo(mContext, info);
}
}
+ Log.w(TAG, "findProvider: No App Widget Provider found for component=" + provider
+ + " user=" + user);
return null;
}
diff --git a/src/com/android/launcher3/widget/WidgetTableRow.java b/src/com/android/launcher3/widget/WidgetTableRow.java
new file mode 100644
index 0000000..a5312ce
--- /dev/null
+++ b/src/com/android/launcher3/widget/WidgetTableRow.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.TableRow;
+
+/**
+ * A row of {@link WidgetCell}s that can be displayed in a table.
+ */
+public class WidgetTableRow extends TableRow implements WidgetCell.PreviewReadyListener {
+ private int mNumOfReadyCells;
+ private int mNumOfCells;
+ private int mResizeDelay;
+
+ public WidgetTableRow(Context context) {
+ super(context);
+ }
+ public WidgetTableRow(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void onPreviewAvailable() {
+ mNumOfReadyCells++;
+
+ // Once all previews are loaded, find max visible height and adjust the preview containers.
+ if (mNumOfReadyCells == mNumOfCells) {
+ resize();
+ }
+ }
+
+ private void resize() {
+ int previewHeight = 0;
+ // get the maximum height of each widget preview
+ for (int i = 0; i < getChildCount(); i++) {
+ WidgetCell widgetCell = (WidgetCell) getChildAt(i);
+ previewHeight = Math.max(widgetCell.getPreviewContentHeight(), previewHeight);
+ }
+ if (mResizeDelay > 0) {
+ postDelayed(() -> setAlpha(1f), mResizeDelay);
+ }
+ if (previewHeight > 0) {
+ for (int i = 0; i < getChildCount(); i++) {
+ WidgetCell widgetCell = (WidgetCell) getChildAt(i);
+ widgetCell.setParentAlignedPreviewHeight(previewHeight);
+ widgetCell.postDelayed(widgetCell::requestLayout, mResizeDelay);
+ }
+ }
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ }
+
+ /**
+ * Sets up the row to display the provided number of numOfCells.
+ *
+ * @param numOfCells number of numOfCells in the row
+ * @param resizeDelayMs time to wait in millis before making any layout size adjustments e.g. we
+ * want to wait for list expand collapse animation before resizing the
+ * cell previews.
+ */
+ public void setupRow(int numOfCells, int resizeDelayMs) {
+ mNumOfCells = numOfCells;
+ mNumOfReadyCells = 0;
+
+ mResizeDelay = resizeDelayMs;
+ // For delayed resize, reveal contents only after resize is done.
+ if (mResizeDelay > 0) {
+ setAlpha(0);
+ }
+ }
+}
diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
index b4c4623..ddbd291 100644
--- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -17,6 +17,7 @@
package com.android.launcher3.widget;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_BOTTOM_WIDGETS_TRAY;
+import static com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.findAllWidgetsForPackageUser;
import android.content.Context;
import android.graphics.Rect;
@@ -31,7 +32,6 @@
import android.view.animation.Interpolator;
import android.widget.ScrollView;
import android.widget.TableLayout;
-import android.widget.TableRow;
import android.widget.TextView;
import androidx.annotation.Px;
@@ -41,6 +41,7 @@
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.PackageUserKey;
+import com.android.launcher3.widget.picker.model.data.WidgetPickerData;
import com.android.launcher3.widget.util.WidgetsTableUtils;
import java.util.List;
@@ -125,10 +126,10 @@
@Override
public void onWidgetsBound() {
- List<WidgetItem> widgets = mActivityContext.getPopupDataProvider().getWidgetsForPackageUser(
- new PackageUserKey(
- mOriginalItemInfo.getTargetComponent().getPackageName(),
- mOriginalItemInfo.user));
+ final WidgetPickerData data = mActivityContext.getWidgetPickerDataProvider().get();
+ final PackageUserKey packageUserKey = PackageUserKey.fromItemInfo(mOriginalItemInfo);
+ List<WidgetItem> widgets = packageUserKey != null ? findAllWidgetsForPackageUser(data,
+ packageUserKey) : List.of();
TableLayout widgetsTable = findViewById(R.id.widgets_table);
widgetsTable.removeAllViews();
@@ -137,11 +138,15 @@
mActivityContext.getDeviceProfile(), mMaxHorizontalSpan,
mWidgetCellHorizontalPadding)
.forEach(row -> {
- TableRow tableRow = new TableRow(getContext());
+ WidgetTableRow tableRow = new WidgetTableRow(getContext());
tableRow.setGravity(Gravity.TOP);
+ tableRow.setupRow(row.size(), /*resizeDelayMs=*/ 0);
row.forEach(widgetItem -> {
WidgetCell widget = addItemCell(tableRow);
widget.applyFromCellItem(widgetItem);
+ if (widget.matchesItem(getLastSelectedWidgetItem())) {
+ widget.callOnClick();
+ }
});
widgetsTable.addView(tableRow);
});
@@ -160,9 +165,10 @@
return super.onControllerInterceptTouchEvent(ev);
}
- protected WidgetCell addItemCell(ViewGroup parent) {
+ protected WidgetCell addItemCell(WidgetTableRow parent) {
WidgetCell widget = (WidgetCell) LayoutInflater.from(getContext())
.inflate(R.layout.widget_cell, parent, false);
+ widget.addPreviewReadyListener(parent);
widget.setOnClickListener(this);
View previewContainer = widget.findViewById(R.id.widget_preview_container);
@@ -243,4 +249,7 @@
}
}
}
+
+ @Override
+ public void onRecommendedWidgetsBound() {} // no op
}
diff --git a/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfo.java b/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfo.java
index 398b1df..5ad9222 100644
--- a/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfo.java
+++ b/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfo.java
@@ -22,6 +22,8 @@
import android.os.Parcel;
import android.os.Parcelable;
+import androidx.annotation.VisibleForTesting;
+
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Utilities;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
@@ -52,6 +54,9 @@
}
}
+ @VisibleForTesting
+ CustomAppWidgetProviderInfo() {}
+
@Override
public void initSpans(Context context, InvariantDeviceProfile idp) {
mIsMinSizeFulfilled = Math.min(spanX, minSpanX) <= idp.numColumns
diff --git a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
index 50012b3..faa5d12 100644
--- a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
+++ b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
@@ -30,6 +30,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.launcher3.R;
import com.android.launcher3.util.MainThreadInitializedObject;
@@ -45,6 +46,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Stream;
@@ -62,9 +64,16 @@
private final HashMap<ComponentName, CustomWidgetPlugin> mPlugins;
private final List<CustomAppWidgetProviderInfo> mCustomWidgets;
private Consumer<PackageUserKey> mWidgetRefreshCallback;
+ private final @NonNull AppWidgetManager mAppWidgetManager;
private CustomWidgetManager(Context context) {
+ this(context, AppWidgetManager.getInstance(context));
+ }
+
+ @VisibleForTesting
+ CustomWidgetManager(Context context, @NonNull AppWidgetManager widgetManager) {
mContext = context;
+ mAppWidgetManager = widgetManager;
mPlugins = new HashMap<>();
mCustomWidgets = new ArrayList<>();
PluginManagerWrapper.INSTANCE.get(context)
@@ -94,7 +103,7 @@
@Override
public void onPluginConnected(CustomWidgetPlugin plugin, Context context) {
- List<AppWidgetProviderInfo> providers = AppWidgetManager.getInstance(context)
+ List<AppWidgetProviderInfo> providers = mAppWidgetManager
.getInstalledProvidersForProfile(Process.myUserHandle());
if (providers.isEmpty()) return;
Parcel parcel = Parcel.obtain();
@@ -113,6 +122,12 @@
mCustomWidgets.removeIf(w -> w.getComponent().equals(cn));
}
+ @VisibleForTesting
+ @NonNull
+ Map<ComponentName, CustomWidgetPlugin> getPlugins() {
+ return mPlugins;
+ }
+
/**
* Inject a callback function to refresh the widgets.
*/
diff --git a/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilder.kt b/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilder.kt
new file mode 100644
index 0000000..1abe4da
--- /dev/null
+++ b/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilder.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.model
+
+import android.content.Context
+import com.android.launcher3.compat.AlphabeticIndexCompat
+import com.android.launcher3.model.WidgetItem
+import com.android.launcher3.model.data.PackageItemInfo
+import java.util.function.Predicate
+
+/**
+ * A helper class that builds the list of [WidgetsListBaseEntry]s used by the UI to display widgets.
+ */
+class WidgetsListBaseEntriesBuilder(val context: Context) {
+
+ /** Builds the widgets list entries in a format understandable by the widget picking UI. */
+ @JvmOverloads
+ fun build(
+ widgetsByPackageItem: Map<PackageItemInfo, List<WidgetItem>>,
+ widgetFilter: Predicate<WidgetItem> = Predicate<WidgetItem> { true },
+ ): List<WidgetsListBaseEntry> {
+ val indexer = AlphabeticIndexCompat(context)
+
+ return buildList {
+ for ((pkgItem, widgetItems) in widgetsByPackageItem.entries) {
+ val filteredWidgetItems = widgetItems.filter { widgetFilter.test(it) }
+ if (filteredWidgetItems.isNotEmpty()) {
+ // Enables fast scroll popup to show right characters in all locales.
+ val sectionName = pkgItem.title?.let { indexer.computeSectionName(it) } ?: ""
+
+ add(WidgetsListHeaderEntry.create(pkgItem, sectionName, filteredWidgetItems))
+ add(WidgetsListContentEntry(pkgItem, sectionName, filteredWidgetItems))
+ }
+ }
+ }
+ }
+}
diff --git a/src/com/android/launcher3/widget/picker/WidgetRecommendationCategory.java b/src/com/android/launcher3/widget/picker/WidgetRecommendationCategory.java
index 072d1d5..a68effd 100644
--- a/src/com/android/launcher3/widget/picker/WidgetRecommendationCategory.java
+++ b/src/com/android/launcher3/widget/picker/WidgetRecommendationCategory.java
@@ -19,6 +19,8 @@
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
+import com.android.launcher3.R;
+
import java.util.Objects;
/**
@@ -26,6 +28,10 @@
* option in the pop-up opened on long press of launcher workspace).
*/
public class WidgetRecommendationCategory implements Comparable<WidgetRecommendationCategory> {
+ public static WidgetRecommendationCategory DEFAULT_WIDGET_RECOMMENDATION_CATEGORY =
+ new WidgetRecommendationCategory(
+ R.string.others_widget_recommendation_category_label, /*order=*/0);
+
/** Resource id that holds the user friendly label for the category. */
@StringRes
public final int categoryTitleRes;
diff --git a/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProvider.java b/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProvider.java
index 80bda22..9253b37 100644
--- a/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProvider.java
+++ b/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProvider.java
@@ -64,14 +64,11 @@
Preconditions.assertWorkerThread();
try (PackageManagerHelper pmHelper = new PackageManagerHelper(context)) {
if (item.widgetInfo != null && item.widgetInfo.getComponent() != null) {
- String widgetComponentName = item.widgetInfo.getComponent().getClassName();
ApplicationInfo applicationInfo = pmHelper.getApplicationInfo(
item.widgetInfo.getComponent().getPackageName(), item.widgetInfo.getUser(),
0 /* flags */);
if (applicationInfo != null) {
- int predictionCategory = applicationInfo.category;
- return getCategoryFromApplicationCategory(context, predictionCategory,
- widgetComponentName);
+ return getCategoryFromApplicationCategory(applicationInfo.category);
}
}
}
@@ -80,29 +77,7 @@
/** Maps application category to an appropriate displayable category. */
private static WidgetRecommendationCategory getCategoryFromApplicationCategory(
- Context context, int applicationCategory, String componentName) {
- // Weather categories don't map to a specific application category, so, we maintain an
- // allowlist.
- String[] weatherRecommendationAllowlist =
- context.getResources().getStringArray(R.array.weather_recommendations);
- for (String allowedWeatherComponentName : weatherRecommendationAllowlist) {
- if (componentName.equalsIgnoreCase(allowedWeatherComponentName)) {
- return new WidgetRecommendationCategory(
- R.string.weather_widget_recommendation_category_label, /*order=*/3);
- }
- }
-
- // Fitness categories don't map to a specific application category, so, we maintain an
- // allowlist.
- String[] fitnessRecommendationAllowlist =
- context.getResources().getStringArray(R.array.fitness_recommendations);
- for (String allowedFitnessComponentName : fitnessRecommendationAllowlist) {
- if (componentName.equalsIgnoreCase(allowedFitnessComponentName)) {
- return new WidgetRecommendationCategory(
- R.string.fitness_widget_recommendation_category_label, /*order=*/2);
- }
- }
-
+ int applicationCategory) {
if (applicationCategory == ApplicationInfo.CATEGORY_PRODUCTIVITY) {
return new WidgetRecommendationCategory(
R.string.productivity_widget_recommendation_category_label, /*order=*/0);
@@ -116,7 +91,7 @@
if (applicationCategory == ApplicationInfo.CATEGORY_SOCIAL) {
return new WidgetRecommendationCategory(
R.string.social_widget_recommendation_category_label,
- /*order=*/5);
+ /*order=*/3);
}
if (applicationCategory == ApplicationInfo.CATEGORY_AUDIO
@@ -124,11 +99,10 @@
|| applicationCategory == ApplicationInfo.CATEGORY_IMAGE) {
return new WidgetRecommendationCategory(
R.string.entertainment_widget_recommendation_category_label,
- /*order=*/6);
+ /*order=*/4);
}
return new WidgetRecommendationCategory(
- R.string.others_widget_recommendation_category_label, /*order=*/4);
+ R.string.others_widget_recommendation_category_label, /*order=*/2);
}
-
}
diff --git a/src/com/android/launcher3/widget/picker/WidgetRecommendationsView.java b/src/com/android/launcher3/widget/picker/WidgetRecommendationsView.java
index 4f73e66..d84a219 100644
--- a/src/com/android/launcher3/widget/picker/WidgetRecommendationsView.java
+++ b/src/com/android/launcher3/widget/picker/WidgetRecommendationsView.java
@@ -16,7 +16,7 @@
package com.android.launcher3.widget.picker;
-import static com.android.launcher3.widget.util.WidgetsTableUtils.groupWidgetItemsUsingRowPxWithoutReordering;
+import static com.android.launcher3.widget.util.WidgetsTableUtils.groupWidgetItemsUsingRowPxWithReordering;
import android.content.ComponentName;
import android.content.Context;
@@ -38,6 +38,7 @@
import com.android.launcher3.pageindicators.PageIndicatorDots;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -53,9 +54,16 @@
*/
public final class WidgetRecommendationsView extends PagedView<PageIndicatorDots> {
private @Px float mAvailableHeight = Float.MAX_VALUE;
+ private @Px float mAvailableWidth = 0;
private static final String INITIALLY_DISPLAYED_WIDGETS_STATE_KEY =
"widgetRecommendationsView:mDisplayedWidgets";
private static final int MAX_CATEGORIES = 3;
+
+ // Whether to show all widgets in a full page without any limitation on height
+ private boolean mShowFullPageViewIfLowDensity = false;
+ // Number of items below which a category is considered low density.
+ private static final int IDEAL_ITEMS_PER_CATEGORY = 2;
+
private TextView mRecommendationPageTitle;
private final List<String> mCategoryTitles = new ArrayList<>();
@@ -87,6 +95,14 @@
}
/**
+ * When there are less than 3 categories or when at least one category has less than 2 widgets,
+ * all widgets will be shown in a single page without being limited by the available height.
+ */
+ public void enableFullPageViewIfLowDensity() {
+ mShowFullPageViewIfLowDensity = true;
+ }
+
+ /**
* Saves the necessary state in the provided bundle. To be called in case of orientation /
* other config changes.
*/
@@ -152,6 +168,7 @@
final @Px float availableHeight, final @Px int availableWidth,
final @Px int cellPadding) {
this.mAvailableHeight = availableHeight;
+ this.mAvailableWidth = availableWidth;
clear();
Set<ComponentName> displayedWidgets = maybeDisplayInTable(recommendedWidgets,
@@ -168,6 +185,22 @@
return displayedWidgets.size();
}
+ private boolean shouldShowFullPageView(
+ Map<WidgetRecommendationCategory, List<WidgetItem>> recommendations) {
+ if (mShowFullPageViewIfLowDensity) {
+ boolean hasLessCategories = recommendations.size() < MAX_CATEGORIES;
+ long lowDensityCategoriesCount = recommendations.values()
+ .stream()
+ .limit(MAX_CATEGORIES)
+ .filter(items -> items.size() < IDEAL_ITEMS_PER_CATEGORY).count();
+
+ // If there less number of categories or if there are at least 2 categorizes with less
+ // widgets, prefer showing single page view.
+ return hasLessCategories || lowDensityCategoriesCount > 1;
+ }
+ return false;
+ }
+
/**
* Displays the recommendations grouped by categories as pages.
* <p>In case of a single category, no title is displayed for it.</p>
@@ -186,7 +219,16 @@
Map<WidgetRecommendationCategory, List<WidgetItem>> recommendations,
DeviceProfile deviceProfile, final @Px float availableHeight,
final @Px int availableWidth, final @Px int cellPadding, final int requestedPage) {
+ if (shouldShowFullPageView(recommendations)) {
+ // Show all widgets in single page with unlimited available height.
+ return setRecommendations(
+ recommendations.values().stream().flatMap(Collection::stream).toList(),
+ deviceProfile, /*availableHeight=*/ Float.MAX_VALUE, availableWidth,
+ cellPadding);
+
+ }
this.mAvailableHeight = availableHeight;
+ this.mAvailableWidth = availableWidth;
Context context = getContext();
// For purpose of recommendations section, we don't want paging dots to be halved in two
// pane display, so, we always provide isTwoPanels = "false".
@@ -280,17 +322,24 @@
boolean hasMultiplePages = getChildCount() > 0;
if (hasMultiplePages) {
- int finalWidth = MeasureSpec.getSize(widthMeasureSpec);
int desiredHeight = 0;
+ int desiredWidth = Math.round(mAvailableWidth);
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
- measureChild(child, widthMeasureSpec, heightMeasureSpec);
+ // Measure children based on available height and width.
+ measureChild(child,
+ MeasureSpec.makeMeasureSpec(desiredWidth, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(Math.round(mAvailableHeight),
+ MeasureSpec.AT_MOST));
// Use height of tallest child as we have limited height.
- desiredHeight = Math.max(desiredHeight, child.getMeasuredHeight());
+ int childHeight = child.getMeasuredHeight();
+ desiredHeight = Math.max(desiredHeight, childHeight);
}
int finalHeight = resolveSizeAndState(desiredHeight, heightMeasureSpec, 0);
+ int finalWidth = resolveSizeAndState(desiredWidth, widthMeasureSpec, 0);
+
setMeasuredDimension(finalWidth, finalHeight);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
@@ -315,7 +364,7 @@
// Since we are limited by space, we don't sort recommendations - to show most relevant
// (if possible).
- List<ArrayList<WidgetItem>> rows = groupWidgetItemsUsingRowPxWithoutReordering(
+ List<ArrayList<WidgetItem>> rows = groupWidgetItemsUsingRowPxWithReordering(
filteredRecommendedWidgets,
context,
deviceProfile,
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 6aaa7d2..c8ad564 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -20,7 +20,7 @@
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.SEARCH;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_SEARCHED;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
-import static com.android.launcher3.widget.picker.WidgetsListAdapter.VIEW_TYPE_WIDGETS_LIST;
+import static com.android.launcher3.views.RecyclerViewFastScroller.FastScrollerLocation.WIDGET_SCROLLER;
import android.animation.Animator;
import android.content.Context;
@@ -56,7 +56,6 @@
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.compat.AccessibilityManagerCompat;
@@ -71,10 +70,12 @@
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
import com.android.launcher3.widget.picker.search.SearchModeListener;
import com.android.launcher3.widget.picker.search.WidgetsSearchBar;
+import com.android.launcher3.widget.picker.search.WidgetsSearchBar.WidgetsSearchDataProvider;
import com.android.launcher3.workprofile.PersonalWorkPagedView;
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.OnActivePageChangedListener;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -119,7 +120,7 @@
WidgetsRecyclerView searchRecyclerView =
mAdapters.get(AdapterHolder.SEARCH).mWidgetsRecyclerView;
if (mIsInSearchMode && searchRecyclerView != null) {
- searchRecyclerView.bindFastScrollbar(mFastScroller);
+ searchRecyclerView.bindFastScrollbar(mFastScroller, WIDGET_SCROLLER);
}
}
@@ -137,7 +138,7 @@
private WidgetsRecyclerView mCurrentTouchEventRecyclerView;
@Nullable
PersonalWorkPagedView mViewPager;
- private boolean mIsInSearchMode;
+ protected boolean mIsInSearchMode;
private boolean mIsNoWidgetsViewNeeded;
@Px
protected int mMaxSpanPerRow;
@@ -247,8 +248,12 @@
mSearchBarContainer = mSearchScrollView.findViewById(R.id.search_bar_container);
mSearchBar = mSearchScrollView.findViewById(R.id.widgets_search_bar);
- mSearchBar.initialize(
- mActivityContext.getPopupDataProvider(), /* searchModeListener= */ this);
+ mSearchBar.initialize(new WidgetsSearchDataProvider() {
+ @Override
+ public List<WidgetsListBaseEntry> getWidgets() {
+ return getWidgetsToDisplay();
+ }
+ }, /* searchModeListener= */ this);
}
private void setDeviceManagementResources() {
@@ -272,7 +277,7 @@
}
private void attachScrollbarToRecyclerView(WidgetsRecyclerView recyclerView) {
- recyclerView.bindFastScrollbar(mFastScroller);
+ recyclerView.bindFastScrollbar(mFastScroller, WIDGET_SCROLLER);
if (mCurrentWidgetsRecyclerView != recyclerView) {
// Only reset the scroll position & expanded apps if the currently shown recycler view
// has been updated.
@@ -286,10 +291,10 @@
protected void updateRecyclerViewVisibility(AdapterHolder adapterHolder) {
// The first item is always an empty space entry. Look for any more items.
boolean isWidgetAvailable = adapterHolder.mWidgetsListAdapter.hasVisibleEntries();
- adapterHolder.mWidgetsRecyclerView.setVisibility(isWidgetAvailable ? VISIBLE : GONE);
if (adapterHolder.mAdapterType == AdapterHolder.SEARCH) {
mNoWidgetsView.setText(R.string.no_search_results);
+ adapterHolder.mWidgetsRecyclerView.setVisibility(isWidgetAvailable ? VISIBLE : GONE);
} else if (adapterHolder.mAdapterType == AdapterHolder.WORK
&& mUserCache.getUserProfiles().stream()
.filter(userHandle -> mUserCache.getUserInfo(userHandle).isWork())
@@ -331,8 +336,7 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- LauncherAppState.getInstance(mActivityContext).getModel()
- .refreshAndBindWidgetsAndShortcuts(null);
+ onWidgetsBound();
}
@Override
@@ -418,19 +422,18 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int availableWidth = MeasureSpec.getSize(widthMeasureSpec);
+ updateMaxSpansPerRow(availableWidth);
doMeasure(widthMeasureSpec, heightMeasureSpec);
-
- if (updateMaxSpansPerRow()) {
- doMeasure(widthMeasureSpec, heightMeasureSpec);
- }
}
- /** Returns {@code true} if the max spans have been updated. */
- private boolean updateMaxSpansPerRow() {
- if (getMeasuredWidth() == 0) return false;
-
- @Px int maxHorizontalSpan = getContentView().getMeasuredWidth()
- - (2 * mContentHorizontalMargin);
+ /** Returns {@code true} if the max spans have been updated.
+ *
+ * @param availableWidth Total width available within parent (includes insets).
+ */
+ private void updateMaxSpansPerRow(int availableWidth) {
+ @Px int maxHorizontalSpan = getAvailableWidthForSuggestions(
+ availableWidth - getInsetsWidth());
if (mMaxSpanPerRow != maxHorizontalSpan) {
mMaxSpanPerRow = maxHorizontalSpan;
mAdapters.get(AdapterHolder.PRIMARY).mWidgetsListAdapter.setMaxHorizontalSpansPxPerRow(
@@ -441,16 +444,15 @@
mAdapters.get(AdapterHolder.WORK).mWidgetsListAdapter.setMaxHorizontalSpansPxPerRow(
maxHorizontalSpan);
}
- onRecommendedWidgetsBound();
- return true;
+ post(this::onRecommendedWidgetsBound);
}
- return false;
}
- protected View getContentView() {
- return mHasWorkProfile
- ? mViewPager
- : mAdapters.get(AdapterHolder.PRIMARY).mWidgetsRecyclerView;
+ /**
+ * Returns the width available to display suggestions.
+ */
+ protected int getAvailableWidthForSuggestions(int pickerAvailableWidth) {
+ return pickerAvailableWidth - (2 * mContentHorizontalMargin);
}
@Override
@@ -467,22 +469,28 @@
setTranslationShift(mTranslationShift);
}
+ /**
+ * Returns all displayable widgets.
+ */
+ protected List<WidgetsListBaseEntry> getWidgetsToDisplay() {
+ return mActivityContext.getWidgetPickerDataProvider().get().getAllWidgets();
+ }
+
@Override
public void onWidgetsBound() {
if (mIsInSearchMode) {
return;
}
- List<WidgetsListBaseEntry> allWidgets =
- mActivityContext.getPopupDataProvider().getAllWidgets();
+ List<WidgetsListBaseEntry> widgets = getWidgetsToDisplay();
AdapterHolder primaryUserAdapterHolder = mAdapters.get(AdapterHolder.PRIMARY);
- primaryUserAdapterHolder.mWidgetsListAdapter.setWidgets(allWidgets);
+ primaryUserAdapterHolder.mWidgetsListAdapter.setWidgets(widgets);
if (mHasWorkProfile) {
mViewPager.setVisibility(VISIBLE);
mTabBar.setVisibility(VISIBLE);
AdapterHolder workUserAdapterHolder = mAdapters.get(AdapterHolder.WORK);
- workUserAdapterHolder.mWidgetsListAdapter.setWidgets(allWidgets);
+ workUserAdapterHolder.mWidgetsListAdapter.setWidgets(widgets);
onActivePageChanged(mViewPager.getCurrentPage());
} else {
onActivePageChanged(0);
@@ -495,7 +503,7 @@
.mWidgetsListAdapter.hasVisibleEntries());
if (mIsNoWidgetsViewNeeded != isNoWidgetsViewNeeded) {
mIsNoWidgetsViewNeeded = isNoWidgetsViewNeeded;
- onRecommendedWidgetsBound();
+ post(this::onRecommendedWidgetsBound);
}
}
@@ -549,9 +557,11 @@
mNoWidgetsView.setVisibility(GONE);
} else {
mAdapters.get(AdapterHolder.SEARCH).mWidgetsRecyclerView.setVisibility(GONE);
+ mAdapters.get(getCurrentAdapterHolderType()).mWidgetsRecyclerView.setVisibility(
+ VISIBLE);
// Visibility of recommended widgets, recycler views and headers are handled in methods
// below.
- onRecommendedWidgetsBound();
+ post(this::onRecommendedWidgetsBound);
onWidgetsBound();
}
}
@@ -566,12 +576,11 @@
if (mIsInSearchMode) {
return;
}
-
if (enableCategorizedWidgetSuggestions()) {
// We avoid applying new recommendations when some are already displayed.
if (mRecommendedWidgetsMap.isEmpty()) {
mRecommendedWidgetsMap =
- mActivityContext.getPopupDataProvider().getCategorizedRecommendedWidgets();
+ mActivityContext.getWidgetPickerDataProvider().get().getRecommendations();
}
mRecommendedWidgetsCount = mWidgetRecommendationsView.setRecommendations(
mRecommendedWidgetsMap,
@@ -583,17 +592,20 @@
);
} else {
if (mRecommendedWidgets.isEmpty()) {
- mRecommendedWidgets =
- mActivityContext.getPopupDataProvider().getRecommendedWidgets();
+ mRecommendedWidgets = mActivityContext.getWidgetPickerDataProvider().get()
+ .getRecommendations()
+ .values().stream()
+ .flatMap(Collection::stream).toList();
+ mRecommendedWidgetsCount = mWidgetRecommendationsView.setRecommendations(
+ mRecommendedWidgets,
+ mDeviceProfile,
+ /* availableHeight= */ getMaxAvailableHeightForRecommendations(),
+ /* availableWidth= */ mMaxSpanPerRow,
+ /* cellPadding= */ mWidgetCellHorizontalPadding
+ );
}
- mRecommendedWidgetsCount = mWidgetRecommendationsView.setRecommendations(
- mRecommendedWidgets,
- mDeviceProfile,
- /* availableHeight= */ getMaxAvailableHeightForRecommendations(),
- /* availableWidth= */ mMaxSpanPerRow,
- /* cellPadding= */ mWidgetCellHorizontalPadding
- );
}
+
mWidgetRecommendationsContainer.setVisibility(
mRecommendedWidgetsCount > 0 ? VISIBLE : GONE);
}
@@ -684,6 +696,18 @@
return sheet;
}
+ /**
+ * Updates the widget picker's title and description in the header to the provided values (if
+ * present).
+ */
+ public void mayUpdateTitleAndDescription(@Nullable String title,
+ @Nullable String descriptionRes) {
+ if (title != null) {
+ mHeaderTitle.setText(title);
+ }
+ // Full sheet doesn't support a description.
+ }
+
@Override
public void saveHierarchyState(SparseArray<Parcelable> sparseArray) {
Bundle bundle = new Bundle();
@@ -1023,35 +1047,7 @@
default:
break;
}
- mWidgetsListItemAnimator = new DefaultItemAnimator() {
- @Override
- public boolean animateChange(RecyclerView.ViewHolder oldHolder,
- RecyclerView.ViewHolder newHolder, int fromLeft, int fromTop, int toLeft,
- int toTop) {
- // As we expand an item, the content / widgets list that appears (with add
- // event) also gets change events as its previews load asynchronously. The
- // super implementation of animateChange cancels the animations on it - breaking
- // the "add animation". Instead, here, we skip "change" animation for content
- // list - because we want it to either appear or disappear. And, the previews
- // themselves have their own animation when loaded, so, we don't need change
- // animations for them anyway. Below, we do-nothing.
- if (oldHolder.getItemViewType() == VIEW_TYPE_WIDGETS_LIST) {
- dispatchChangeStarting(oldHolder, true);
- dispatchChangeFinished(oldHolder, true);
- return true;
- }
- return super.animateChange(oldHolder, newHolder, fromLeft, fromTop, toLeft,
- toTop);
- }
- };
- // Disable change animations because it disrupts the item focus upon adapter item
- // change.
- mWidgetsListItemAnimator.setSupportsChangeAnimations(false);
- // Make the moves a bit faster, so that the amount of time for which user sees the
- // bottom-sheet background before "add" animation starts is less making it smoother.
- mWidgetsListItemAnimator.setChangeDuration(90);
- mWidgetsListItemAnimator.setMoveDuration(90);
- mWidgetsListItemAnimator.setAddDuration(300);
+ mWidgetsListItemAnimator = new WidgetsListItemAnimator();
}
private int getEmptySpaceHeight() {
@@ -1064,8 +1060,8 @@
mWidgetsRecyclerView.setClipToOutline(true);
mWidgetsRecyclerView.setClipChildren(false);
mWidgetsRecyclerView.setAdapter(mWidgetsListAdapter);
- mWidgetsRecyclerView.bindFastScrollbar(mFastScroller);
- mWidgetsRecyclerView.setItemAnimator(mWidgetsListItemAnimator);
+ mWidgetsRecyclerView.bindFastScrollbar(mFastScroller, WIDGET_SCROLLER);
+ mWidgetsRecyclerView.setItemAnimator(isTwoPane() ? null : mWidgetsListItemAnimator);
mWidgetsRecyclerView.setHeaderViewDimensionsProvider(WidgetsFullSheet.this);
if (!isTwoPane()) {
mWidgetsRecyclerView.setEdgeEffectFactory(
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
index d373a3b..d164dd0 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.widget.picker;
+import static android.animation.ValueAnimator.areAnimatorsEnabled;
+
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
@@ -201,7 +203,7 @@
public void reapplyItemInfo(ItemInfoWithIcon info) {
if (getTag() == info) {
mIconLoadRequest = null;
- mEnableIconUpdateAnimation = true;
+ mEnableIconUpdateAnimation = areAnimatorsEnabled();
// Optimization: Starting in N, pre-uploads the bitmap to RenderThread.
info.bitmap.icon.prepareToDraw();
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListItemAnimator.java b/src/com/android/launcher3/widget/picker/WidgetsListItemAnimator.java
new file mode 100644
index 0000000..6a1921e
--- /dev/null
+++ b/src/com/android/launcher3/widget/picker/WidgetsListItemAnimator.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.picker;
+
+import static android.animation.ValueAnimator.areAnimatorsEnabled;
+
+import static com.android.launcher3.widget.picker.WidgetsListAdapter.VIEW_TYPE_WIDGETS_LIST;
+
+import androidx.recyclerview.widget.DefaultItemAnimator;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class WidgetsListItemAnimator extends DefaultItemAnimator {
+ public static final int CHANGE_DURATION_MS = 90;
+ public static final int MOVE_DURATION_MS = 90;
+ public static final int ADD_DURATION_MS = 120;
+
+ // DefaultItemAnimator runs change and move animations before running add animations (i.e.
+ // before expanded list item's content start animating to become visible on screen).
+ public static final int WIDGET_LIST_ITEM_APPEARANCE_START_DELAY =
+ areAnimatorsEnabled() ? (CHANGE_DURATION_MS + MOVE_DURATION_MS) : 0;
+ // Delay after which all item animations are ran and list item's content is visible.
+ public static final int WIDGET_LIST_ITEM_APPEARANCE_DELAY =
+ WIDGET_LIST_ITEM_APPEARANCE_START_DELAY + ADD_DURATION_MS;
+
+ public WidgetsListItemAnimator() {
+ super();
+
+ // Disable change animations because it disrupts the item focus upon adapter item
+ // change.
+ setSupportsChangeAnimations(false);
+ // Make the moves a bit faster, so that the amount of time for which user sees the
+ // bottom-sheet background before "add" animation starts is less making it smoother.
+ setChangeDuration(CHANGE_DURATION_MS);
+ setMoveDuration(MOVE_DURATION_MS);
+ setAddDuration(ADD_DURATION_MS);
+ }
+ @Override
+ public boolean animateChange(RecyclerView.ViewHolder oldHolder,
+ RecyclerView.ViewHolder newHolder, int fromLeft, int fromTop, int toLeft,
+ int toTop) {
+ // As we expand an item, the content / widgets list that appears (with add
+ // event) also gets change events as its previews load asynchronously. The
+ // super implementation of animateChange cancels the animations on it - breaking
+ // the "add animation". Instead, here, we skip "change" animation for content
+ // list - because we want it to either appear or disappear. And, the previews
+ // themselves have their own animation when loaded, so, we don't need change
+ // animations for them anyway. Below, we do-nothing.
+ if (oldHolder.getItemViewType() == VIEW_TYPE_WIDGETS_LIST) {
+ dispatchChangeStarting(oldHolder, true);
+ dispatchChangeFinished(oldHolder, true);
+ return true;
+ }
+ return super.animateChange(oldHolder, newHolder, fromLeft, fromTop, toLeft,
+ toTop);
+ }
+}
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java b/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
index 56352cc..679b0f5 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.widget.picker;
+import static com.android.launcher3.widget.picker.WidgetsListItemAnimator.WIDGET_LIST_ITEM_APPEARANCE_START_DELAY;
+
import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;
@@ -26,7 +28,6 @@
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.widget.TableLayout;
-import android.widget.TableRow;
import androidx.annotation.NonNull;
import androidx.annotation.Px;
@@ -36,6 +37,7 @@
import com.android.launcher3.recyclerview.ViewHolderBinder;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.WidgetCell;
+import com.android.launcher3.widget.WidgetTableRow;
import com.android.launcher3.widget.model.WidgetsListContentEntry;
import com.android.launcher3.widget.util.WidgetsTableUtils;
@@ -111,17 +113,15 @@
for (int i = 0; i < widgetItemsTable.size(); i++) {
List<WidgetItem> widgetItemsPerRow = widgetItemsTable.get(i);
for (int j = 0; j < widgetItemsPerRow.size(); j++) {
- TableRow row = (TableRow) table.getChildAt(i);
+ WidgetTableRow row = (WidgetTableRow) table.getChildAt(i);
row.setVisibility(View.VISIBLE);
WidgetCell widget = (WidgetCell) row.getChildAt(j);
widget.clear();
+ widget.addPreviewReadyListener(row);
WidgetItem widgetItem = widgetItemsPerRow.get(j);
widget.setVisibility(View.VISIBLE);
- // When preview loads, notify adapter to rebind the item and possibly animate
- widget.applyFromCellItem(widgetItem,
- bitmap -> holder.onPreviewLoaded(Pair.create(widgetItem, bitmap)),
- holder.previewCache.get(widgetItem));
+ widget.applyFromCellItem(widgetItem);
widget.requestLayout();
}
}
@@ -143,14 +143,18 @@
for (int i = 0; i < widgetItemsTable.size(); i++) {
List<WidgetItem> widgetItems = widgetItemsTable.get(i);
- TableRow tableRow;
+ WidgetTableRow tableRow;
if (i < table.getChildCount()) {
- tableRow = (TableRow) table.getChildAt(i);
+ tableRow = (WidgetTableRow) table.getChildAt(i);
} else {
- tableRow = new TableRow(table.getContext());
+ tableRow = new WidgetTableRow(table.getContext());
tableRow.setGravity(Gravity.TOP);
table.addView(tableRow);
}
+ // Pass resize delay to let the "move" and "change" animations run before resizing the
+ // row.
+ tableRow.setupRow(widgetItems.size(),
+ /*resizeDelayMs=*/ WIDGET_LIST_ITEM_APPEARANCE_START_DELAY);
if (tableRow.getChildCount() > widgetItems.size()) {
for (int j = widgetItems.size(); j < tableRow.getChildCount(); j++) {
tableRow.getChildAt(j).setVisibility(View.GONE);
@@ -161,6 +165,7 @@
R.layout.widget_cell, tableRow, false);
// set up touch.
widget.setOnClickListener(mIconClickListener);
+ widget.addPreviewReadyListener(tableRow);
View preview = widget.findViewById(R.id.widget_preview_container);
preview.setOnClickListener(mIconClickListener);
preview.setOnLongClickListener(mIconLongClickListener);
@@ -176,7 +181,7 @@
int numOfRows = holder.tableContainer.getChildCount();
holder.previewCache.clear();
for (int i = 0; i < numOfRows; i++) {
- TableRow tableRow = (TableRow) holder.tableContainer.getChildAt(i);
+ WidgetTableRow tableRow = (WidgetTableRow) holder.tableContainer.getChildAt(i);
int numOfCols = tableRow.getChildCount();
for (int j = 0; j < numOfCols; j++) {
WidgetCell widget = (WidgetCell) tableRow.getChildAt(j);
diff --git a/src/com/android/launcher3/widget/picker/WidgetsRecommendationTableLayout.java b/src/com/android/launcher3/widget/picker/WidgetsRecommendationTableLayout.java
index 03af0cb..0bcab60 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsRecommendationTableLayout.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsRecommendationTableLayout.java
@@ -18,7 +18,7 @@
import static com.android.launcher3.Flags.enableCategorizedWidgetSuggestions;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION;
import static com.android.launcher3.widget.util.WidgetSizes.getWidgetSizePx;
-import static com.android.launcher3.widget.util.WidgetsTableUtils.WIDGETS_TABLE_ROW_SIZE_COMPARATOR;
+import static com.android.launcher3.widget.util.WidgetsTableUtils.WIDGETS_TABLE_ROW_COUNT_COMPARATOR;
import static java.lang.Math.max;
@@ -27,9 +27,7 @@
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.TableLayout;
-import android.widget.TableRow;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
@@ -38,6 +36,7 @@
import com.android.launcher3.R;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.widget.WidgetCell;
+import com.android.launcher3.widget.WidgetTableRow;
import com.android.launcher3.widget.picker.util.WidgetPreviewContainerSize;
import java.util.ArrayList;
@@ -58,12 +57,13 @@
public WidgetsRecommendationTableLayout(Context context, AttributeSet attrs) {
super(context, attrs);
- // There are 1 row for title, 1 row for dimension and 2 rows for description.
+ // There are 1 row for title, 1 row for dimension and max 3 rows for description.
mWidgetsRecommendationTableVerticalPadding = 2 * getResources()
.getDimensionPixelSize(R.dimen.widget_recommendations_table_vertical_padding);
mWidgetCellVerticalPadding = 2 * getResources()
.getDimensionPixelSize(R.dimen.widget_cell_vertical_padding);
- mWidgetCellTextViewsHeight = 4 * getResources().getDimension(R.dimen.widget_cell_font_size);
+ mWidgetCellTextViewsHeight =
+ getResources().getDimension(R.dimen.widget_cell_title_line_height);
}
/** Sets a {@link android.view.View.OnLongClickListener} for all widget cells in this table. */
@@ -104,7 +104,8 @@
for (int i = 0; i < recommendationTable.size(); i++) {
List<WidgetItem> widgetItems = recommendationTable.get(i);
- TableRow tableRow = new TableRow(getContext());
+ WidgetTableRow tableRow = new WidgetTableRow(getContext());
+ tableRow.setupRow(widgetItems.size(), /*resizeDelayMs=*/ 0);
tableRow.setGravity(Gravity.TOP);
for (WidgetItem widgetItem : widgetItems) {
WidgetCell widgetCell = addItemCell(tableRow);
@@ -120,9 +121,10 @@
setVisibility(VISIBLE);
}
- private WidgetCell addItemCell(ViewGroup parent) {
+ private WidgetCell addItemCell(WidgetTableRow parent) {
WidgetCell widget = (WidgetCell) LayoutInflater.from(
getContext()).inflate(R.layout.widget_cell, parent, false);
+ widget.addPreviewReadyListener(parent);
widget.setOnClickListener(mWidgetCellOnClickListener);
View previewContainer = widget.findViewById(R.id.widget_preview_container);
@@ -161,6 +163,6 @@
}
// Perform re-ordering once we have filtered out recommendations that fit.
- return filteredRows.stream().sorted(WIDGETS_TABLE_ROW_SIZE_COMPARATOR).toList();
+ return filteredRows.stream().sorted(WIDGETS_TABLE_ROW_COUNT_COMPARATOR).toList();
}
}
diff --git a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
index 79ddadc..d329674 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
@@ -21,25 +21,35 @@
import static com.android.launcher3.UtilitiesKt.CLIP_TO_PADDING_FALSE_MODIFIER;
import static com.android.launcher3.UtilitiesKt.modifyAttributesOnViewTree;
import static com.android.launcher3.UtilitiesKt.restoreAttributesOnViewTree;
+import static com.android.launcher3.widget.picker.WidgetsListItemAnimator.WIDGET_LIST_ITEM_APPEARANCE_DELAY;
+import static com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.findContentEntryForPackageUser;
import android.content.Context;
import android.graphics.Rect;
import android.os.Process;
import android.util.AttributeSet;
+import android.view.Gravity;
import android.view.LayoutInflater;
+import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewGroup;
import android.view.ViewParent;
+import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import android.widget.PopupMenu;
import android.widget.ScrollView;
+import android.widget.TextView;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.Px;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
+import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.recyclerview.ViewHolderBinder;
import com.android.launcher3.util.PackageUserKey;
@@ -55,16 +65,13 @@
* Popup for showing the full list of available widgets with a two-pane layout.
*/
public class WidgetsTwoPaneSheet extends WidgetsFullSheet {
-
- private static final int PERSONAL_TAB = 0;
- private static final int WORK_TAB = 1;
private static final int MINIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP = 268;
private static final int MAXIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP = 395;
private static final String SUGGESTIONS_PACKAGE_NAME = "widgets_list_suggestions_entry";
// This ratio defines the max percentage of content area that the recommendations can display
// with respect to the bottom sheet's height.
- private static final float RECOMMENDATION_SECTION_HEIGHT_RATIO_TWO_PANE = 0.75f;
+ private static final float RECOMMENDATION_SECTION_HEIGHT_RATIO_TWO_PANE = 0.70f;
private FrameLayout mSuggestedWidgetsContainer;
private WidgetsListHeader mSuggestedWidgetsHeader;
private PackageUserKey mSuggestedWidgetsPackageUserKey;
@@ -76,7 +83,20 @@
private boolean mOldIsSwipeToDismissInProgress;
private int mActivePage = -1;
+ @Nullable
private PackageUserKey mSelectedHeader;
+ private TextView mHeaderDescription;
+
+ /**
+ * A menu displayed for options (e.g. "show all widgets" filter) around widget lists in the
+ * picker.
+ */
+ protected View mWidgetOptionsMenu;
+ /**
+ * State of the options in the menu (if displayed to the user).
+ */
+ @Nullable
+ protected WidgetOptionsMenuState mWidgetOptionsMenuState = null;
public WidgetsTwoPaneSheet(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
@@ -114,12 +134,20 @@
mWidgetRecommendationsView.initParentViews(mWidgetRecommendationsContainer);
mWidgetRecommendationsView.setWidgetCellLongClickListener(this);
mWidgetRecommendationsView.setWidgetCellOnClickListener(this);
+ if (!mDeviceProfile.isTwoPanels) {
+ mWidgetRecommendationsView.enableFullPageViewIfLowDensity();
+ }
// To save the currently displayed page, so that, it can be requested when rebinding
// recommendations with different size constraints.
mWidgetRecommendationsView.addPageSwitchListener(
newPage -> mRecommendationsCurrentPage = newPage);
mHeaderTitle = mContent.findViewById(R.id.title);
+ mHeaderDescription = mContent.findViewById(R.id.widget_picker_description);
+
+ mWidgetOptionsMenu = mContent.findViewById(R.id.widget_picker_widget_options_menu);
+ setupWidgetOptionsMenu();
+
mRightPane = mContent.findViewById(R.id.right_pane);
mRightPaneScrollView = mContent.findViewById(R.id.right_pane_scroll_view);
mRightPaneScrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
@@ -135,6 +163,51 @@
}
@Override
+ public void mayUpdateTitleAndDescription(@Nullable String title, @Nullable String description) {
+ if (title != null) {
+ mHeaderTitle.setText(title);
+ }
+ if (description != null) {
+ mHeaderDescription.setText(description);
+ mHeaderDescription.setVisibility(VISIBLE);
+ }
+ }
+
+ protected void setupWidgetOptionsMenu() {
+ mWidgetOptionsMenu.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mWidgetOptionsMenuState != null) {
+ PopupMenu popupMenu = new PopupMenu(mActivityContext, /*anchor=*/ v,
+ Gravity.END);
+ MenuItem menuItem = popupMenu.getMenu().add(
+ R.string.widget_picker_show_all_widgets_menu_item_title);
+ menuItem.setCheckable(true);
+ menuItem.setChecked(mWidgetOptionsMenuState.showAllWidgets);
+ menuItem.setOnMenuItemClickListener(
+ item -> onShowAllWidgetsMenuItemClick(item));
+ popupMenu.show();
+ }
+ }
+ });
+ }
+
+ private boolean onShowAllWidgetsMenuItemClick(MenuItem menuItem) {
+ mWidgetOptionsMenuState.showAllWidgets = !mWidgetOptionsMenuState.showAllWidgets;
+ menuItem.setChecked(mWidgetOptionsMenuState.showAllWidgets);
+
+ // Refresh widgets
+ onWidgetsBound();
+ if (mIsInSearchMode) {
+ mSearchBar.reset();
+ } else if (!mSuggestedWidgetsPackageUserKey.equals(mSelectedHeader)) {
+ mAdapters.get(mActivePage).mWidgetsListAdapter.selectFirstHeaderEntry();
+ mAdapters.get(mActivePage).mWidgetsRecyclerView.scrollToTop();
+ }
+ return true;
+ }
+
+ @Override
protected int getTabletHorizontalMargin(DeviceProfile deviceProfile) {
if (enableCategorizedWidgetSuggestions()) {
// two pane picker is full width for fold as well as tablet.
@@ -194,19 +267,48 @@
layoutParams.width = 0;
}
layoutParams.weight = layoutParams.width == 0 ? 0.33F : 0;
- leftPane.setLayoutParams(layoutParams);
- requestApplyInsets();
- if (mSelectedHeader != null) {
- if (mSelectedHeader.equals(mSuggestedWidgetsPackageUserKey)) {
- mSuggestedWidgetsHeader.callOnClick();
- } else {
- getHeaderChangeListener().onHeaderChanged(mSelectedHeader);
+
+ post(() -> {
+ // The following calls all trigger requestLayout, so we post them to avoid
+ // calling requestLayout during a layout pass. This also fixes the related warnings
+ // in logcat.
+ leftPane.setLayoutParams(layoutParams);
+ requestApplyInsets();
+ if (mSelectedHeader != null) {
+ if (mSelectedHeader.equals(mSuggestedWidgetsPackageUserKey)) {
+ mSuggestedWidgetsHeader.callOnClick();
+ } else {
+ getHeaderChangeListener().onHeaderChanged(mSelectedHeader);
+ }
}
- }
+ });
}
}
@Override
+ protected List<WidgetsListBaseEntry> getWidgetsToDisplay() {
+ List<WidgetsListBaseEntry> allWidgets =
+ mActivityContext.getWidgetPickerDataProvider().get().getAllWidgets();
+ List<WidgetsListBaseEntry> defaultWidgets =
+ mActivityContext.getWidgetPickerDataProvider().get().getDefaultWidgets();
+
+ if (allWidgets.isEmpty() || defaultWidgets.isEmpty()) {
+ // no menu if there are no default widgets to show
+ mWidgetOptionsMenuState = null;
+ mWidgetOptionsMenu.setVisibility(GONE);
+ } else {
+ if (mWidgetOptionsMenuState == null) {
+ mWidgetOptionsMenuState = new WidgetOptionsMenuState();
+ }
+
+ mWidgetOptionsMenu.setVisibility(VISIBLE);
+ return mWidgetOptionsMenuState.showAllWidgets ? allWidgets : defaultWidgets;
+ }
+
+ return allWidgets;
+ }
+
+ @Override
public void onWidgetsBound() {
super.onWidgetsBound();
if (mRecommendedWidgetsCount == 0 && mSelectedHeader == null) {
@@ -222,6 +324,10 @@
if (mSuggestedWidgetsContainer == null && mRecommendedWidgetsCount > 0) {
setupSuggestedWidgets(LayoutInflater.from(getContext()));
mSuggestedWidgetsHeader.callOnClick();
+ } else if (mSelectedHeader != null
+ && mSelectedHeader.equals(mSuggestedWidgetsPackageUserKey)) {
+ // Reselect widget if we are reloading recommendations while it is currently showing.
+ selectWidgetCell(mWidgetRecommendationsContainer, getLastSelectedWidgetItem());
}
}
@@ -254,7 +360,7 @@
WidgetsListHeaderEntry widgetsListHeaderEntry = WidgetsListHeaderEntry.create(
packageItemInfo,
/*titleSectionName=*/ suggestionsHeaderTitle,
- /*items=*/ mActivityContext.getPopupDataProvider().getRecommendedWidgets(),
+ /*items=*/ List.of(), // not necessary
/*visibleWidgetsCount=*/ 0)
.withWidgetListShown();
@@ -267,12 +373,27 @@
mRightPane.removeAllViews();
mRightPane.addView(mWidgetRecommendationsContainer);
mRightPaneScrollView.setScrollY(0);
- mRightPane.setAccessibilityPaneTitle(suggestionsRightPaneTitle);
mSuggestedWidgetsPackageUserKey = PackageUserKey.fromPackageItemInfo(packageItemInfo);
+ final boolean isChangingHeaders = mSelectedHeader == null
+ || !mSelectedHeader.equals(mSuggestedWidgetsPackageUserKey);
+ if (isChangingHeaders) {
+ // If the initial focus view is still focused or widget picker is still opening, it
+ // is likely a programmatic header click.
+ if (mSelectedHeader != null && !mOpenCloseAnimation.getAnimationPlayer().isRunning()
+ && !getAccessibilityInitialFocusView().isAccessibilityFocused()) {
+ mRightPaneScrollView.setAccessibilityPaneTitle(suggestionsRightPaneTitle);
+ focusOnFirstWidgetCell(mWidgetRecommendationsView);
+ }
+ // If switching from another header, unselect any WidgetCells. This is necessary
+ // because we do not clear/recycle the WidgetCells in the recommendations container
+ // when the header is clicked, only when onRecommendationsBound is called. That
+ // means a WidgetCell in the recommendations container may still be selected from
+ // the last time the recommendations were shown.
+ unselectWidgetCell(mWidgetRecommendationsContainer, getLastSelectedWidgetItem());
+ }
mSelectedHeader = mSuggestedWidgetsPackageUserKey;
});
mSuggestedWidgetsContainer.addView(mSuggestedWidgetsHeader);
- mRightPane.setAccessibilityPaneTitle(suggestionsRightPaneTitle);
}
@Override
@@ -289,6 +410,30 @@
}
@Override
+ @Px
+ protected int getAvailableWidthForSuggestions(int pickerAvailableWidth) {
+ int rightPaneWidth = (int) Math.ceil(0.67 * pickerAvailableWidth);
+
+ if (mDeviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) {
+ // See onLayout
+ int leftPaneWidth = (int) (0.33 * pickerAvailableWidth);
+ @Px int minLeftPaneWidthPx = Utilities.dpToPx(MINIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP);
+ @Px int maxLeftPaneWidthPx = Utilities.dpToPx(MAXIMUM_WIDTH_LEFT_PANE_FOLDABLE_DP);
+ if (leftPaneWidth < minLeftPaneWidthPx) {
+ leftPaneWidth = minLeftPaneWidthPx;
+ } else if (leftPaneWidth > maxLeftPaneWidthPx) {
+ leftPaneWidth = maxLeftPaneWidthPx;
+ }
+ rightPaneWidth = pickerAvailableWidth - leftPaneWidth;
+ }
+
+ // Since suggestions are shown in right pane, the available width is 2/3 of total width of
+ // bottom sheet.
+ return rightPaneWidth - getResources().getDimensionPixelSize(
+ R.dimen.widget_list_horizontal_margin_two_pane); // right pane end margin.
+ }
+
+ @Override
public void onActivePageChanged(int currentActivePage) {
super.onActivePageChanged(currentActivePage);
@@ -299,21 +444,31 @@
mActivePage = currentActivePage;
- if (mSuggestedWidgetsHeader == null) {
- mAdapters.get(currentActivePage).mWidgetsListAdapter.selectFirstHeaderEntry();
- mAdapters.get(currentActivePage).mWidgetsRecyclerView.scrollToTop();
- } else if (currentActivePage == PERSONAL_TAB || currentActivePage == WORK_TAB) {
- mSuggestedWidgetsHeader.callOnClick();
- }
+ // When using talkback, swiping left while on right pane, should navigate to the widgets
+ // list on left.
+ mAdapters.get(mActivePage).mWidgetsRecyclerView.setAccessibilityTraversalBefore(
+ mRightPaneScrollView.getId());
+
+ // On page change, select the first item in the list to show in the right pane.
+ mAdapters.get(currentActivePage).mWidgetsListAdapter.selectFirstHeaderEntry();
+ mAdapters.get(currentActivePage).mWidgetsRecyclerView.scrollToTop();
}
@Override
protected void updateRecyclerViewVisibility(AdapterHolder adapterHolder) {
// The first item is always an empty space entry. Look for any more items.
boolean isWidgetAvailable = adapterHolder.mWidgetsListAdapter.hasVisibleEntries();
-
- mRightPane.setVisibility(isWidgetAvailable ? VISIBLE : GONE);
-
+ if (!isWidgetAvailable) {
+ mRightPane.removeAllViews();
+ mRightPane.addView(mNoWidgetsView);
+ // with no widgets message, no header is selected on left
+ if (mSuggestedWidgetsPackageUserKey != null
+ && mSuggestedWidgetsPackageUserKey.equals(mSelectedHeader)
+ && mSuggestedWidgetsHeader != null) {
+ mSuggestedWidgetsHeader.setExpanded(false);
+ }
+ mSelectedHeader = null;
+ }
super.updateRecyclerViewVisibility(adapterHolder);
}
@@ -348,18 +503,23 @@
}
- @Override
- protected View getContentView() {
- return mRightPane;
- }
-
private HeaderChangeListener getHeaderChangeListener() {
return new HeaderChangeListener() {
@Override
public void onHeaderChanged(@NonNull PackageUserKey selectedHeader) {
+ final boolean isSameHeader = mSelectedHeader != null
+ && mSelectedHeader.equals(selectedHeader);
+ // If the initial focus view is still focused or widget picker is still opening, it
+ // is likely a programmatic header click.
+ final boolean isUserClick = mSelectedHeader != null
+ && !mOpenCloseAnimation.getAnimationPlayer().isRunning()
+ && !getAccessibilityInitialFocusView().isAccessibilityFocused();
mSelectedHeader = selectedHeader;
- WidgetsListContentEntry contentEntry = mActivityContext.getPopupDataProvider()
- .getSelectedAppWidgets(selectedHeader);
+ final boolean showDefaultWidgets = mWidgetOptionsMenuState != null
+ && !mWidgetOptionsMenuState.showAllWidgets;
+ WidgetsListContentEntry contentEntry = findContentEntryForPackageUser(
+ mActivityContext.getWidgetPickerDataProvider().get(),
+ selectedHeader, showDefaultWidgets);
if (contentEntry == null || mRightPane == null) {
return;
@@ -384,23 +544,65 @@
contentEntryToBind,
ViewHolderBinder.POSITION_FIRST | ViewHolderBinder.POSITION_LAST,
Collections.EMPTY_LIST);
+ if (isSameHeader) {
+ // Reselect the last selected widget if we are reloading the same header.
+ selectWidgetCell(widgetsRowViewHolder.tableContainer,
+ getLastSelectedWidgetItem());
+ }
widgetsRowViewHolder.mDataCallback = data -> {
mWidgetsListTableViewHolderBinder.bindViewHolder(widgetsRowViewHolder,
contentEntryToBind,
ViewHolderBinder.POSITION_FIRST | ViewHolderBinder.POSITION_LAST,
Collections.singletonList(data));
+ if (isSameHeader) {
+ selectWidgetCell(widgetsRowViewHolder.tableContainer,
+ getLastSelectedWidgetItem());
+ }
};
mRightPane.removeAllViews();
mRightPane.addView(widgetsRowViewHolder.itemView);
+ if (isUserClick) {
+ mRightPaneScrollView.setAccessibilityPaneTitle(getContext().getString(
+ R.string.widget_picker_right_pane_accessibility_title,
+ contentEntry.mPkgItem.title));
+ postDelayed(() -> focusOnFirstWidgetCell(widgetsRowViewHolder.tableContainer),
+ WIDGET_LIST_ITEM_APPEARANCE_DELAY);
+ }
mRightPaneScrollView.setScrollY(0);
- mRightPane.setAccessibilityPaneTitle(
- getContext().getString(
- R.string.widget_picker_right_pane_accessibility_title,
- contentEntry.mPkgItem.title));
}
};
}
+ private static void selectWidgetCell(ViewGroup parent, WidgetItem item) {
+ if (parent == null || item == null) return;
+ WidgetCell cell = Utilities.findViewByPredicate(parent, v -> v instanceof WidgetCell wc
+ && wc.matchesItem(item));
+ if (cell != null && !cell.isShowingAddButton()) {
+ cell.callOnClick();
+ }
+ }
+
+ /**
+ * Requests focus on the first widget cell in the given widget section.
+ */
+ private static void focusOnFirstWidgetCell(ViewGroup parent) {
+ if (parent == null) return;
+ WidgetCell cell = Utilities.findViewByPredicate(parent, v -> v instanceof WidgetCell);
+ if (cell != null) {
+ cell.performAccessibilityAction(
+ AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
+ }
+ }
+
+ private static void unselectWidgetCell(ViewGroup parent, WidgetItem item) {
+ if (parent == null || item == null) return;
+ WidgetCell cell = Utilities.findViewByPredicate(parent, v -> v instanceof WidgetCell wc
+ && wc.matchesItem(item));
+ if (cell != null && cell.isShowingAddButton()) {
+ cell.hideAddButton(/* animate= */ false);
+ }
+ }
+
@Override
public void setInsets(Rect insets) {
super.setInsets(insets);
@@ -451,4 +653,15 @@
*/
void onHeaderChanged(@NonNull PackageUserKey selectedHeader);
}
+
+ /**
+ * Holds the selection state of the options menu (if presented to the user).
+ */
+ protected static class WidgetOptionsMenuState {
+ /**
+ * UI state indicating whether to show default or all widgets.
+ * <p>If true, shows all widgets; else shows the default widgets.</p>
+ */
+ public boolean showAllWidgets = false;
+ }
}
diff --git a/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProvider.kt b/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProvider.kt
new file mode 100644
index 0000000..46d3e7a
--- /dev/null
+++ b/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProvider.kt
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.picker.model
+
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.widget.model.WidgetsListBaseEntry
+import com.android.launcher3.widget.picker.model.data.WidgetPickerData
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.withRecommendedWidgets
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.withWidgets
+import java.io.PrintWriter
+
+/**
+ * Provides [WidgetPickerData] to various views such as widget picker, app-specific widget picker,
+ * widgets shortcut.
+ */
+class WidgetPickerDataProvider {
+ /** All the widgets data provided for the views */
+ private var mWidgetPickerData: WidgetPickerData = WidgetPickerData()
+
+ private var changeListener: WidgetPickerDataChangeListener? = null
+
+ /** Sets a listener to be called back when widget data is updated. */
+ fun setChangeListener(changeListener: WidgetPickerDataChangeListener?) {
+ this.changeListener = changeListener
+ }
+
+ /** Returns the current snapshot of [WidgetPickerData]. */
+ fun get(): WidgetPickerData {
+ return mWidgetPickerData
+ }
+
+ /**
+ * Updates the widgets available to the widget picker.
+ *
+ * Generally called when the widgets model has new data.
+ */
+ @JvmOverloads
+ fun setWidgets(
+ allWidgets: List<WidgetsListBaseEntry>,
+ defaultWidgets: List<WidgetsListBaseEntry> = listOf()
+ ) {
+ mWidgetPickerData =
+ mWidgetPickerData.withWidgets(allWidgets = allWidgets, defaultWidgets = defaultWidgets)
+ changeListener?.onWidgetsBound()
+ }
+
+ /**
+ * Makes the widget recommendations available to the widget picker
+ *
+ * Generally called when new widget predictions are available.
+ */
+ fun setWidgetRecommendations(recommendations: List<ItemInfo>) {
+ mWidgetPickerData = mWidgetPickerData.withRecommendedWidgets(recommendations)
+ changeListener?.onRecommendedWidgetsBound()
+ }
+
+ /** Writes the current state to the provided writer. */
+ fun dump(prefix: String, writer: PrintWriter) {
+ writer.println(prefix + "WidgetPickerDataProvider:")
+ writer.println("$prefix\twidgetPickerData:$mWidgetPickerData")
+ }
+
+ interface WidgetPickerDataChangeListener {
+ /** A callback to get notified when widgets are bound. */
+ fun onWidgetsBound()
+
+ /** A callback to get notified when recommended widgets are bound. */
+ fun onRecommendedWidgetsBound()
+ }
+}
diff --git a/src/com/android/launcher3/widget/picker/model/data/WidgetPickerData.kt b/src/com/android/launcher3/widget/picker/model/data/WidgetPickerData.kt
new file mode 100644
index 0000000..3332ef0
--- /dev/null
+++ b/src/com/android/launcher3/widget/picker/model/data/WidgetPickerData.kt
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.picker.model.data
+
+import com.android.launcher3.model.WidgetItem
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.util.ComponentKey
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.widget.PendingAddWidgetInfo
+import com.android.launcher3.widget.model.WidgetsListBaseEntry
+import com.android.launcher3.widget.model.WidgetsListContentEntry
+import com.android.launcher3.widget.picker.WidgetRecommendationCategory
+import com.android.launcher3.widget.picker.WidgetRecommendationCategory.DEFAULT_WIDGET_RECOMMENDATION_CATEGORY
+
+// This file contains WidgetPickerData and utility functions to operate on it.
+
+/** Widget data for display in the widget picker. */
+data class WidgetPickerData(
+ val allWidgets: List<WidgetsListBaseEntry> = listOf(),
+ val defaultWidgets: List<WidgetsListBaseEntry> = listOf(),
+ val recommendations: Map<WidgetRecommendationCategory, List<WidgetItem>> = mapOf(),
+)
+
+/** Provides utility methods to work with a [WidgetPickerData] object. */
+object WidgetPickerDataUtils {
+ /**
+ * Returns a [WidgetPickerData] with the provided widgets.
+ *
+ * When [defaultWidgets] is not passed, defaults from previous object are not copied over.
+ * Defaults (if supported) should be updated when all widgets are updated.
+ */
+ fun WidgetPickerData.withWidgets(
+ allWidgets: List<WidgetsListBaseEntry>,
+ defaultWidgets: List<WidgetsListBaseEntry> = listOf()
+ ): WidgetPickerData {
+ return copy(allWidgets = allWidgets, defaultWidgets = defaultWidgets)
+ }
+
+ /** Returns a [WidgetPickerData] with the given recommendations set. */
+ fun WidgetPickerData.withRecommendedWidgets(recommendations: List<ItemInfo>): WidgetPickerData {
+ val allWidgetsMap: Map<ComponentKey, WidgetItem> =
+ allWidgets
+ .filterIsInstance<WidgetsListContentEntry>()
+ .flatMap { it.mWidgets }
+ .filterNotNull()
+ .distinct()
+ .associateBy { it } // as ComponentKey
+
+ val categoriesMap =
+ recommendations
+ .filterIsInstance<PendingAddWidgetInfo>()
+ .filter { allWidgetsMap.containsKey(ComponentKey(it.targetComponent, it.user)) }
+ .groupBy { it.recommendationCategory ?: DEFAULT_WIDGET_RECOMMENDATION_CATEGORY }
+ .mapValues { (_, pendingAddWidgetInfos) ->
+ pendingAddWidgetInfos.map {
+ allWidgetsMap[ComponentKey(it.targetComponent, it.user)] as WidgetItem
+ }
+ }
+
+ return copy(recommendations = categoriesMap)
+ }
+
+ /** Finds all [WidgetItem]s available for the provided package user. */
+ @JvmStatic
+ fun findAllWidgetsForPackageUser(
+ widgetPickerData: WidgetPickerData,
+ packageUserKey: PackageUserKey
+ ): List<WidgetItem> {
+ return findContentEntryForPackageUser(widgetPickerData, packageUserKey)?.mWidgets
+ ?: emptyList()
+ }
+
+ /**
+ * Finds and returns the [WidgetsListContentEntry] for the given package user.
+ *
+ * Set [fromDefaultWidgets] to true to limit the content entry to default widgets.
+ */
+ @JvmOverloads
+ @JvmStatic
+ fun findContentEntryForPackageUser(
+ widgetPickerData: WidgetPickerData,
+ packageUserKey: PackageUserKey,
+ fromDefaultWidgets: Boolean = false
+ ): WidgetsListContentEntry? {
+ val widgetsListBaseEntries =
+ if (fromDefaultWidgets) {
+ widgetPickerData.defaultWidgets
+ } else {
+ widgetPickerData.allWidgets
+ }
+
+ return widgetsListBaseEntries.filterIsInstance<WidgetsListContentEntry>().firstOrNull {
+ PackageUserKey.fromPackageItemInfo(it.mPkgItem) == packageUserKey
+ }
+ }
+}
diff --git a/src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java b/src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java
index 65937b6..92caf3e 100644
--- a/src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java
+++ b/src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java
@@ -26,7 +26,6 @@
import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.R;
-import com.android.launcher3.popup.PopupDataProvider;
/**
* View for a search bar with an edit text with a cancel button.
@@ -51,7 +50,8 @@
}
@Override
- public void initialize(PopupDataProvider dataProvider, SearchModeListener searchModeListener) {
+ public void initialize(WidgetsSearchDataProvider dataProvider,
+ SearchModeListener searchModeListener) {
mController = new WidgetsSearchBarController(
new SimpleWidgetsSearchAlgorithm(dataProvider),
mEditText, mCancelButton, searchModeListener);
diff --git a/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithm.java b/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithm.java
index 613066a..0e88787 100644
--- a/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithm.java
+++ b/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithm.java
@@ -21,13 +21,13 @@
import android.os.Handler;
import com.android.launcher3.model.WidgetItem;
-import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.search.SearchAlgorithm;
import com.android.launcher3.search.SearchCallback;
import com.android.launcher3.search.StringMatcherUtility.StringMatcher;
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
import com.android.launcher3.widget.model.WidgetsListContentEntry;
import com.android.launcher3.widget.model.WidgetsListHeaderEntry;
+import com.android.launcher3.widget.picker.search.WidgetsSearchBar.WidgetsSearchDataProvider;
import java.util.ArrayList;
import java.util.List;
@@ -39,9 +39,9 @@
public final class SimpleWidgetsSearchAlgorithm implements SearchAlgorithm<WidgetsListBaseEntry> {
private final Handler mResultHandler;
- private final PopupDataProvider mDataProvider;
+ private final WidgetsSearchDataProvider mDataProvider;
- public SimpleWidgetsSearchAlgorithm(PopupDataProvider dataProvider) {
+ public SimpleWidgetsSearchAlgorithm(WidgetsSearchDataProvider dataProvider) {
mResultHandler = new Handler();
mDataProvider = dataProvider;
}
@@ -63,9 +63,9 @@
* Returns entries for all matched widgets
*/
public static ArrayList<WidgetsListBaseEntry> getFilteredWidgets(
- PopupDataProvider dataProvider, String input) {
+ WidgetsSearchDataProvider dataProvider, String input) {
ArrayList<WidgetsListBaseEntry> results = new ArrayList<>();
- dataProvider.getAllWidgets().stream()
+ dataProvider.getWidgets().stream()
.filter(entry -> entry instanceof WidgetsListHeaderEntry)
.forEach(headerEntry -> {
List<WidgetItem> matchedWidgetItems = filterWidgetItems(
diff --git a/src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java b/src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java
index 44a5e80..ab504e7 100644
--- a/src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java
+++ b/src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java
@@ -16,7 +16,9 @@
package com.android.launcher3.widget.picker.search;
-import com.android.launcher3.popup.PopupDataProvider;
+import com.android.launcher3.widget.model.WidgetsListBaseEntry;
+
+import java.util.List;
/**
* Interface for a widgets picker search bar.
@@ -25,7 +27,7 @@
/**
* Attaches a controller to the search bar which interacts with {@code searchModeListener}.
*/
- void initialize(PopupDataProvider dataProvider, SearchModeListener searchModeListener);
+ void initialize(WidgetsSearchDataProvider dataProvider, SearchModeListener searchModeListener);
/**
* Clears search bar.
@@ -44,4 +46,15 @@
* Sets the vertical location, in pixels, of this search bar relative to its top position.
*/
void setTranslationY(float translationY);
+
+
+ /**
+ * Provides corpus from which search results must be returned.
+ */
+ interface WidgetsSearchDataProvider {
+ /**
+ * Returns the widgets from which the search should return the results.
+ */
+ List<WidgetsListBaseEntry> getWidgets();
+ }
}
diff --git a/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizes.kt b/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizes.kt
index a016676..1ab8f8b 100644
--- a/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizes.kt
+++ b/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizes.kt
@@ -28,6 +28,7 @@
WidgetPreviewContainerSize(spanX = 2, spanY = 3),
WidgetPreviewContainerSize(spanX = 2, spanY = 2),
WidgetPreviewContainerSize(spanX = 4, spanY = 1),
+ WidgetPreviewContainerSize(spanX = 3, spanY = 1),
WidgetPreviewContainerSize(spanX = 2, spanY = 1),
WidgetPreviewContainerSize(spanX = 1, spanY = 1),
)
diff --git a/src/com/android/launcher3/widget/util/WidgetDragScaleUtils.java b/src/com/android/launcher3/widget/util/WidgetDragScaleUtils.java
new file mode 100644
index 0000000..b8e7248
--- /dev/null
+++ b/src/com/android/launcher3/widget/util/WidgetDragScaleUtils.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.util;
+
+import static com.android.launcher3.widget.util.WidgetSizes.getWidgetSizePx;
+
+import android.content.Context;
+import android.util.Size;
+
+import androidx.annotation.Px;
+
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.R;
+import com.android.launcher3.model.data.ItemInfo;
+
+/** Utility classes to evaluate widget scale during drag and drops. **/
+public final class WidgetDragScaleUtils {
+ // Widgets are 5% scaled down relative to their size to have shadow display well inside the
+ // drop target frame (if its possible to scale it down within visible area under the finger).
+ private static final float WIDGET_SCALE_DOWN = 0.05f;
+
+ /**
+ * Returns the scale to be applied to given dragged view to scale it down relative to the
+ * spring loaded workspace. Applies additional scale down offset to get it a little inside
+ * the drop target frame. If the relative scale is smaller than minimum size needed to keep the
+ * view visible under the finger, scale down is performed only until the minimum size.
+ */
+ @Px
+ public static float getWidgetDragScalePx(Context context, DeviceProfile deviceProfile,
+ @Px float draggedViewWidthPx, @Px float draggedViewHeightPx, ItemInfo itemInfo) {
+ int minSize = context.getResources().getDimensionPixelSize(
+ R.dimen.widget_drag_view_min_scale_down_size);
+ Size widgetSizesPx = getWidgetSizePx(deviceProfile, itemInfo.spanX, itemInfo.spanY);
+
+ // We add workspace spring load scale, since the widget's drop target is also scaled, so
+ // the widget size is essentially that smaller.
+ float desiredWidgetScale = deviceProfile.getWorkspaceSpringLoadScale(context)
+ - WIDGET_SCALE_DOWN;
+ float desiredWidgetWidthPx = Math.max(minSize,
+ (desiredWidgetScale * widgetSizesPx.getWidth()));
+ float desiredWidgetHeightPx = Math.max(minSize,
+ desiredWidgetScale * widgetSizesPx.getHeight());
+
+ final float bitmapAspectRatio = draggedViewWidthPx / draggedViewHeightPx;
+ final float containerAspectRatio = desiredWidgetWidthPx / desiredWidgetHeightPx;
+
+ // This downscales large views to fit inside drop target frame. Smaller drawable views may
+ // be up-scaled if they are smaller than the min size;
+ final float scale = bitmapAspectRatio >= containerAspectRatio ? desiredWidgetWidthPx
+ / draggedViewWidthPx : desiredWidgetHeightPx / draggedViewHeightPx;
+ // scale in terms of dp to be applied to the drag shadow during drag and drop
+ return (draggedViewWidthPx * scale) - draggedViewWidthPx;
+ }
+}
diff --git a/src/com/android/launcher3/widget/util/WidgetsTableUtils.java b/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
index edaf474..df72f07 100644
--- a/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
+++ b/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
@@ -69,6 +69,21 @@
});
/**
+ * Comparator that enables displaying rows with more number of items at the top, and then
+ * rest of widgets shown in increasing order of their size (totalW * H).
+ */
+ public static final Comparator<ArrayList<WidgetItem>> WIDGETS_TABLE_ROW_COUNT_COMPARATOR =
+ Comparator.comparingInt(row -> {
+ if (row.size() > 1) {
+ return -row.size();
+ } else {
+ int rowWidth = row.stream().mapToInt(w -> w.spanX).sum();
+ int rowHeight = row.get(0).spanY;
+ return (rowWidth * rowHeight);
+ }
+ });
+
+ /**
* Groups {@code widgetItems} items into a 2D array which matches their appearance in a UI
* table. This takes liberty to rearrange widgets to make the table visually appealing.
*/
diff --git a/src_no_quickstep/com/android/launcher3/dagger/LauncherAppComponent.java b/src_no_quickstep/com/android/launcher3/dagger/LauncherAppComponent.java
new file mode 100644
index 0000000..4d7f937
--- /dev/null
+++ b/src_no_quickstep/com/android/launcher3/dagger/LauncherAppComponent.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.dagger;
+
+import dagger.Component;
+
+import javax.inject.Singleton;
+
+/**
+ * Root component for Dagger injection for Launcher AOSP.
+ */
+@Singleton
+@Component
+public interface LauncherAppComponent extends LauncherBaseAppComponent {
+ /** Builder for aosp LauncherAppComponent. */
+ @Component.Builder
+ interface Builder extends LauncherBaseAppComponent.Builder {
+ LauncherAppComponent build();
+ }
+}
+
diff --git a/src_no_quickstep/com/android/launcher3/uioverrides/states/AllAppsState.java b/src_no_quickstep/com/android/launcher3/uioverrides/states/AllAppsState.java
index b62dbd1..9865516 100644
--- a/src_no_quickstep/com/android/launcher3/uioverrides/states/AllAppsState.java
+++ b/src_no_quickstep/com/android/launcher3/uioverrides/states/AllAppsState.java
@@ -53,6 +53,11 @@
}
@Override
+ public int getTitle() {
+ return R.string.all_apps_label;
+ }
+
+ @Override
public int getVisibleElements(Launcher launcher) {
return ALL_APPS_CONTENT;
}
diff --git a/tests/Android.bp b/tests/Android.bp
index 3822ff8..1fa6e05 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -23,7 +23,8 @@
srcs: [
"src/**/*.java",
"src/**/*.kt",
- ":launcher3-robo-src",
+ "multivalentTests/src/**/*.java",
+ "multivalentTests/src/**/*.kt",
],
exclude_srcs: [
":launcher-non-quickstep-tests-src",
@@ -37,6 +38,8 @@
srcs: [
"multivalentTests/src/**/*.java",
"multivalentTests/src/**/*.kt",
+ "src_deviceless/**/*.java",
+ "src_deviceless/**/*.kt",
],
}
@@ -68,6 +71,9 @@
// Library with all the dependencies for building quickstep
android_library {
name: "Launcher3TestLib",
+ defaults: [
+ "launcher_compose_tests_defaults",
+ ],
srcs: [],
asset_dirs: ["assets"],
resource_dirs: ["res"],
@@ -102,12 +108,16 @@
android_library {
name: "Launcher3TestResources",
resource_dirs: ["res"],
+ asset_dirs: ["assets"],
// TODO(b/319712088): re-enable use_resource_processor
use_resource_processor: false,
}
android_test {
name: "Launcher3Tests",
+ defaults: [
+ "launcher_compose_tests_defaults",
+ ],
srcs: [
":launcher-tests-src",
":launcher-non-quickstep-tests-src",
@@ -150,7 +160,7 @@
}
filegroup {
- name: "launcher-testing-helpers",
+ name: "launcher-testing-helpers-robo",
srcs: [
"src/**/*.java",
"src/**/*.kt",
@@ -164,11 +174,20 @@
// Test classes
"src/**/*Test.java",
"src/**/*Test.kt",
+ "src/**/RoboApiWrapper.kt",
"multivalentTests/src/**/*Test.java",
"multivalentTests/src/**/*Test.kt",
],
}
+filegroup {
+ name: "launcher-testing-helpers",
+ srcs: [
+ ":launcher-testing-helpers-robo",
+ "src/**/RoboApiWrapper.kt",
+ ],
+}
+
android_robolectric_test {
enabled: true,
name: "Launcher3RoboTests",
@@ -176,7 +195,7 @@
":launcher3-robo-src",
// Test util classes
- ":launcher-testing-helpers",
+ ":launcher-testing-helpers-robo",
":launcher-testing-shared",
],
exclude_srcs: [
@@ -188,20 +207,26 @@
java_resource_dirs: ["config"],
static_libs: [
"flag-junit-base",
+ "flag-junit",
"com_android_launcher3_flags_lib",
"com_android_wm_shell_flags_lib",
"androidx.test.uiautomator_uiautomator",
"androidx.core_core-animation-testing",
"androidx.test.ext.junit",
+ "androidx.test.espresso.core",
+ "androidx.test.espresso.contrib",
+ "androidx.test.espresso.intents",
"androidx.test.rules",
"uiautomator-helpers",
- "mockito-robolectric-prebuilt",
- "mockito-kotlin2",
+ "inline-mockito-robolectric-prebuilt",
+ "mockito-kotlin-nodeps",
"platform-parametric-runner-lib",
+ "platform-test-rules-deviceless",
"testables",
"Launcher3TestResources",
"SystemUISharedLib",
"launcher-testing-shared",
+ "android.appwidget.flags-aconfig-java",
],
libs: [
"android.test.runner",
@@ -211,4 +236,5 @@
],
instrumentation_for: "Launcher3",
upstream: true,
+ strict_mode: false,
}
diff --git a/tests/AndroidManifest-common.xml b/tests/AndroidManifest-common.xml
index a9b75ea..4b926a8 100644
--- a/tests/AndroidManifest-common.xml
+++ b/tests/AndroidManifest-common.xml
@@ -407,10 +407,14 @@
</intent-filter>
</activity>
- <!-- [b/197780098] Disable eager initialization of Jetpack libraries. -->
+ <!-- Disable eager initialization of Jetpack libraries. See bug 197780098. -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
tools:node="remove" />
+
+ <property
+ android:name="android.window.PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI"
+ android:value="true"/>
</application>
</manifest>
diff --git a/tests/Launcher3Tests.xml b/tests/Launcher3Tests.xml
index 29c34be..270a610 100644
--- a/tests/Launcher3Tests.xml
+++ b/tests/Launcher3Tests.xml
@@ -44,6 +44,8 @@
<option name="run-command" value="settings put global airplane_mode_on 1" />
<option name="run-command" value="am broadcast -a android.intent.action.AIRPLANE_MODE" />
+ <option name="run-command" value="setprop debug.wm.disable_deprecated_target_sdk_dialog 1"/>
+
<option name="run-command" value="settings put system pointer_location 1" />
<option name="run-command" value="settings put system show_touches 1" />
</target_preparer>
diff --git a/tests/assets/ReorderWidgets/full_reorder_case b/tests/assets/ReorderWidgets/full_reorder_case
index 850e4fd..2890b79 100644
--- a/tests/assets/ReorderWidgets/full_reorder_case
+++ b/tests/assets/ReorderWidgets/full_reorder_case
@@ -17,12 +17,12 @@
# Test 4x4
board: 4x4
xxxx
-bbmm
+bbaa
iimm
-iiaa
+iimm
arguments: 0 2
board: 4x4
xxxx
-bbii
+bbaa
mmii
-mmaa
\ No newline at end of file
+mmii
\ No newline at end of file
diff --git a/tests/assets/ReorderWidgets/push_reorder_case b/tests/assets/ReorderWidgets/push_reorder_case
index 8e845a2..1eacfae 100644
--- a/tests/assets/ReorderWidgets/push_reorder_case
+++ b/tests/assets/ReorderWidgets/push_reorder_case
@@ -17,28 +17,28 @@
#Test 5x5
board: 5x5
xxxxx
-bbbm-
+bbb--
--ccc
--ddd
------
-arguments: 2 1
+----m
+arguments: 2 2
board: 5x5
xxxxx
---m--
bbb--
+--m--
--ccc
--ddd
#6x5 Test
board: 6x5
xxxxxx
-bbbbm-
+bbbb--
--aaa-
--ddd-
-------
-arguments: 2 1
+-----m
+arguments: 2 2
board: 6x5
xxxxxx
---m---
bbbb--
+--m---
--aaa-
--ddd-
\ No newline at end of file
diff --git a/tests/assets/ReorderWidgets/simple_reorder_case b/tests/assets/ReorderWidgets/simple_reorder_case
index 2c50ce4..991ccb5 100644
--- a/tests/assets/ReorderWidgets/simple_reorder_case
+++ b/tests/assets/ReorderWidgets/simple_reorder_case
@@ -21,7 +21,7 @@
--mm-
-----
-----
-arguments: 0 4
+arguments: 0 3
board: 5x5
xxxxx
-----
diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button_decoupleDepth.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button_decoupleDepth.txt
new file mode 100644
index 0000000..46cce24
--- /dev/null
+++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button_decoupleDepth.txt
@@ -0,0 +1,130 @@
+DeviceProfile:
+ 1 dp = 2.625 px
+ isTablet:true
+ isPhone:false
+ transposeLayoutWithOrientation:false
+ isGestureMode:false
+ isLandscape:true
+ isMultiWindowMode:false
+ isTwoPanels:true
+ isLeftRightSplit:true
+ windowX: 0.0px (0.0dp)
+ windowY: 0.0px (0.0dp)
+ widthPx: 2208.0px (841.1429dp)
+ heightPx: 1840.0px (700.9524dp)
+ availableWidthPx: 2208.0px (841.1429dp)
+ availableHeightPx: 1730.0px (659.0476dp)
+ mInsets.left: 0.0px (0.0dp)
+ mInsets.top: 110.0px (41.904762dp)
+ mInsets.right: 0.0px (0.0dp)
+ mInsets.bottom: 0.0px (0.0dp)
+ aspectRatio:1.2
+ isResponsiveGrid:false
+ isScalableGrid:false
+ inv.numRows: 4
+ inv.numColumns: 4
+ inv.numSearchContainerColumns: 4
+ minCellSize: PointF(0.0, 0.0)dp
+ cellWidthPx: 154.0px (58.666668dp)
+ cellHeightPx: 218.0px (83.04762dp)
+ getCellSize().x: 270.0px (102.85714dp)
+ getCellSize().y: 342.0px (130.28572dp)
+ cellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)
+ cellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)
+ cellLayoutPaddingPx.left: 0.0px (0.0dp)
+ cellLayoutPaddingPx.top: 0.0px (0.0dp)
+ cellLayoutPaddingPx.right: 0.0px (0.0dp)
+ cellLayoutPaddingPx.bottom: 0.0px (0.0dp)
+ iconSizePx: 141.0px (53.714287dp)
+ iconTextSizePx: 34.0px (12.952381dp)
+ iconDrawablePaddingPx: 13.0px (4.952381dp)
+ numFolderRows: 3
+ numFolderColumns: 4
+ folderCellWidthPx: 189.0px (72.0dp)
+ folderCellHeightPx: 219.0px (83.42857dp)
+ folderChildIconSizePx: 141.0px (53.714287dp)
+ folderChildTextSizePx: 34.0px (12.952381dp)
+ folderChildDrawablePaddingPx: 5.0px (1.9047619dp)
+ folderCellLayoutBorderSpacePx.x: 0.0px (0.0dp)
+ folderCellLayoutBorderSpacePx.y: 0.0px (0.0dp)
+ folderContentPaddingLeftRight: 21.0px (8.0dp)
+ folderTopPadding: 63.0px (24.0dp)
+ folderFooterHeight: 147.0px (56.0dp)
+ bottomSheetTopPadding: 110.0px (41.904762dp)
+ bottomSheetOpenDuration: 500
+ bottomSheetCloseDuration: 500
+ bottomSheetWorkspaceScale: 0.97
+ bottomSheetDepth: 0.3
+ allAppsShiftRange: 1840.0px (700.9524dp)
+ allAppsOpenDuration: 500
+ allAppsCloseDuration: 500
+ allAppsIconSizePx: 141.0px (53.714287dp)
+ allAppsIconTextSizePx: 34.0px (12.952381dp)
+ allAppsIconDrawablePaddingPx: 21.0px (8.0dp)
+ allAppsCellHeightPx: 361.0px (137.5238dp)
+ allAppsCellWidthPx: 183.0px (69.71429dp)
+ allAppsBorderSpacePxX: 42.0px (16.0dp)
+ allAppsBorderSpacePxY: 42.0px (16.0dp)
+ numShownAllAppsColumns: 8
+ allAppsPadding.top: 110.0px (41.904762dp)
+ allAppsPadding.left: 42.0px (16.0dp)
+ allAppsPadding.right: 42.0px (16.0dp)
+ allAppsLeftRightMargin: 183.0px (69.71429dp)
+ hotseatBarSizePx: 267.0px (101.71429dp)
+ mHotseatColumnSpan: 4
+ mHotseatWidthPx: 0.0px (0.0dp)
+ hotseatCellHeightPx: 159.0px (60.57143dp)
+ hotseatBarBottomSpacePx: 126.0px (48.0dp)
+ mHotseatBarEdgePaddingPx: 0.0px (0.0dp)
+ mHotseatBarWorkspaceSpacePx: 0.0px (0.0dp)
+ hotseatBarEndOffset: 0.0px (0.0dp)
+ hotseatQsbSpace: 0.0px (0.0dp)
+ hotseatQsbHeight: 0.0px (0.0dp)
+ springLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)
+ getHotseatLayoutPadding(context).top: 0.0px (0.0dp)
+ getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp)
+ getHotseatLayoutPadding(context).left: 113.0px (43.04762dp)
+ getHotseatLayoutPadding(context).right: 113.0px (43.04762dp)
+ numShownHotseatIcons: 6
+ hotseatBorderSpace: 0.0px (0.0dp)
+ isQsbInline: false
+ hotseatQsbWidth: 0.0px (0.0dp)
+ isTaskbarPresent:false
+ isTaskbarPresentInApps:true
+ taskbarHeight: 0.0px (0.0dp)
+ stashedTaskbarHeight: 0.0px (0.0dp)
+ taskbarBottomMargin: 0.0px (0.0dp)
+ taskbarIconSize: 0.0px (0.0dp)
+ desiredWorkspaceHorizontalMarginPx: 21.0px (8.0dp)
+ workspacePadding.left: 21.0px (8.0dp)
+ workspacePadding.top: 30.0px (11.428572dp)
+ workspacePadding.right: 21.0px (8.0dp)
+ workspacePadding.bottom: 330.0px (125.71429dp)
+ iconScale: 1.0px (0.3809524dp)
+ cellScaleToFit : 1.0px (0.3809524dp)
+ extraSpace: 498.0px (189.71428dp)
+ unscaled extraSpace: 498.0px (189.71428dp)
+ maxEmptySpace: 0.0px (0.0dp)
+ workspaceTopPadding: 0.0px (0.0dp)
+ workspaceBottomPadding: 0.0px (0.0dp)
+ overviewTaskMarginPx: 0.0px (0.0dp)
+ overviewTaskIconSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)
+ overviewTaskThumbnailTopMarginPx: 0.0px (0.0dp)
+ overviewActionsTopMarginPx: 0.0px (0.0dp)
+ overviewActionsHeight: 0.0px (0.0dp)
+ overviewActionsClaimedSpaceBelow: 0.0px (0.0dp)
+ overviewActionsButtonSpacing: 0.0px (0.0dp)
+ overviewPageSpacing: 0.0px (0.0dp)
+ overviewRowSpacing: 0.0px (0.0dp)
+ overviewGridSideMargin: 0.0px (0.0dp)
+ dropTargetBarTopMarginPx: 0.0px (0.0dp)
+ dropTargetBarSizePx: 147.0px (56.0dp)
+ dropTargetBarBottomMarginPx: 42.0px (16.0dp)
+ getCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)
+ getCellLayoutSpringLoadShrunkBottom(): 1457.0px (555.0476dp)
+ workspaceSpringLoadedMinNextPageVisiblePx: 126.0px (48.0dp)
+ getWorkspaceSpringLoadScale(): 0.8452555px (0.32200208dp)
+ getCellLayoutHeight(): 1370.0px (521.9048dp)
+ getCellLayoutWidth(): 1083.0px (412.57144dp)
diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape_decoupleDepth.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape_decoupleDepth.txt
new file mode 100644
index 0000000..44b99e9
--- /dev/null
+++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape_decoupleDepth.txt
@@ -0,0 +1,130 @@
+DeviceProfile:
+ 1 dp = 2.625 px
+ isTablet:true
+ isPhone:false
+ transposeLayoutWithOrientation:false
+ isGestureMode:true
+ isLandscape:true
+ isMultiWindowMode:false
+ isTwoPanels:true
+ isLeftRightSplit:true
+ windowX: 0.0px (0.0dp)
+ windowY: 0.0px (0.0dp)
+ widthPx: 2208.0px (841.1429dp)
+ heightPx: 1840.0px (700.9524dp)
+ availableWidthPx: 2208.0px (841.1429dp)
+ availableHeightPx: 1730.0px (659.0476dp)
+ mInsets.left: 0.0px (0.0dp)
+ mInsets.top: 110.0px (41.904762dp)
+ mInsets.right: 0.0px (0.0dp)
+ mInsets.bottom: 0.0px (0.0dp)
+ aspectRatio:1.2
+ isResponsiveGrid:false
+ isScalableGrid:false
+ inv.numRows: 4
+ inv.numColumns: 4
+ inv.numSearchContainerColumns: 4
+ minCellSize: PointF(0.0, 0.0)dp
+ cellWidthPx: 154.0px (58.666668dp)
+ cellHeightPx: 218.0px (83.04762dp)
+ getCellSize().x: 270.0px (102.85714dp)
+ getCellSize().y: 342.0px (130.28572dp)
+ cellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)
+ cellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)
+ cellLayoutPaddingPx.left: 0.0px (0.0dp)
+ cellLayoutPaddingPx.top: 0.0px (0.0dp)
+ cellLayoutPaddingPx.right: 0.0px (0.0dp)
+ cellLayoutPaddingPx.bottom: 0.0px (0.0dp)
+ iconSizePx: 141.0px (53.714287dp)
+ iconTextSizePx: 34.0px (12.952381dp)
+ iconDrawablePaddingPx: 13.0px (4.952381dp)
+ numFolderRows: 3
+ numFolderColumns: 4
+ folderCellWidthPx: 189.0px (72.0dp)
+ folderCellHeightPx: 219.0px (83.42857dp)
+ folderChildIconSizePx: 141.0px (53.714287dp)
+ folderChildTextSizePx: 34.0px (12.952381dp)
+ folderChildDrawablePaddingPx: 5.0px (1.9047619dp)
+ folderCellLayoutBorderSpacePx.x: 0.0px (0.0dp)
+ folderCellLayoutBorderSpacePx.y: 0.0px (0.0dp)
+ folderContentPaddingLeftRight: 21.0px (8.0dp)
+ folderTopPadding: 63.0px (24.0dp)
+ folderFooterHeight: 147.0px (56.0dp)
+ bottomSheetTopPadding: 110.0px (41.904762dp)
+ bottomSheetOpenDuration: 500
+ bottomSheetCloseDuration: 500
+ bottomSheetWorkspaceScale: 0.97
+ bottomSheetDepth: 0.3
+ allAppsShiftRange: 1840.0px (700.9524dp)
+ allAppsOpenDuration: 500
+ allAppsCloseDuration: 500
+ allAppsIconSizePx: 141.0px (53.714287dp)
+ allAppsIconTextSizePx: 34.0px (12.952381dp)
+ allAppsIconDrawablePaddingPx: 21.0px (8.0dp)
+ allAppsCellHeightPx: 361.0px (137.5238dp)
+ allAppsCellWidthPx: 183.0px (69.71429dp)
+ allAppsBorderSpacePxX: 42.0px (16.0dp)
+ allAppsBorderSpacePxY: 42.0px (16.0dp)
+ numShownAllAppsColumns: 8
+ allAppsPadding.top: 110.0px (41.904762dp)
+ allAppsPadding.left: 42.0px (16.0dp)
+ allAppsPadding.right: 42.0px (16.0dp)
+ allAppsLeftRightMargin: 183.0px (69.71429dp)
+ hotseatBarSizePx: 267.0px (101.71429dp)
+ mHotseatColumnSpan: 4
+ mHotseatWidthPx: 0.0px (0.0dp)
+ hotseatCellHeightPx: 159.0px (60.57143dp)
+ hotseatBarBottomSpacePx: 126.0px (48.0dp)
+ mHotseatBarEdgePaddingPx: 0.0px (0.0dp)
+ mHotseatBarWorkspaceSpacePx: 0.0px (0.0dp)
+ hotseatBarEndOffset: 0.0px (0.0dp)
+ hotseatQsbSpace: 0.0px (0.0dp)
+ hotseatQsbHeight: 0.0px (0.0dp)
+ springLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)
+ getHotseatLayoutPadding(context).top: 0.0px (0.0dp)
+ getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp)
+ getHotseatLayoutPadding(context).left: 113.0px (43.04762dp)
+ getHotseatLayoutPadding(context).right: 113.0px (43.04762dp)
+ numShownHotseatIcons: 6
+ hotseatBorderSpace: 0.0px (0.0dp)
+ isQsbInline: false
+ hotseatQsbWidth: 0.0px (0.0dp)
+ isTaskbarPresent:false
+ isTaskbarPresentInApps:true
+ taskbarHeight: 0.0px (0.0dp)
+ stashedTaskbarHeight: 0.0px (0.0dp)
+ taskbarBottomMargin: 0.0px (0.0dp)
+ taskbarIconSize: 0.0px (0.0dp)
+ desiredWorkspaceHorizontalMarginPx: 21.0px (8.0dp)
+ workspacePadding.left: 21.0px (8.0dp)
+ workspacePadding.top: 30.0px (11.428572dp)
+ workspacePadding.right: 21.0px (8.0dp)
+ workspacePadding.bottom: 330.0px (125.71429dp)
+ iconScale: 1.0px (0.3809524dp)
+ cellScaleToFit : 1.0px (0.3809524dp)
+ extraSpace: 498.0px (189.71428dp)
+ unscaled extraSpace: 498.0px (189.71428dp)
+ maxEmptySpace: 0.0px (0.0dp)
+ workspaceTopPadding: 0.0px (0.0dp)
+ workspaceBottomPadding: 0.0px (0.0dp)
+ overviewTaskMarginPx: 0.0px (0.0dp)
+ overviewTaskIconSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)
+ overviewTaskThumbnailTopMarginPx: 0.0px (0.0dp)
+ overviewActionsTopMarginPx: 0.0px (0.0dp)
+ overviewActionsHeight: 0.0px (0.0dp)
+ overviewActionsClaimedSpaceBelow: 0.0px (0.0dp)
+ overviewActionsButtonSpacing: 0.0px (0.0dp)
+ overviewPageSpacing: 0.0px (0.0dp)
+ overviewRowSpacing: 0.0px (0.0dp)
+ overviewGridSideMargin: 0.0px (0.0dp)
+ dropTargetBarTopMarginPx: 0.0px (0.0dp)
+ dropTargetBarSizePx: 147.0px (56.0dp)
+ dropTargetBarBottomMarginPx: 42.0px (16.0dp)
+ getCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)
+ getCellLayoutSpringLoadShrunkBottom(): 1457.0px (555.0476dp)
+ workspaceSpringLoadedMinNextPageVisiblePx: 126.0px (48.0dp)
+ getWorkspaceSpringLoadScale(): 0.8452555px (0.32200208dp)
+ getCellLayoutHeight(): 1370.0px (521.9048dp)
+ getCellLayoutWidth(): 1083.0px (412.57144dp)
diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button_decoupleDepth.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button_decoupleDepth.txt
new file mode 100644
index 0000000..e7b72f2
--- /dev/null
+++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button_decoupleDepth.txt
@@ -0,0 +1,130 @@
+DeviceProfile:
+ 1 dp = 2.625 px
+ isTablet:true
+ isPhone:false
+ transposeLayoutWithOrientation:false
+ isGestureMode:false
+ isLandscape:false
+ isMultiWindowMode:false
+ isTwoPanels:true
+ isLeftRightSplit:false
+ windowX: 0.0px (0.0dp)
+ windowY: 0.0px (0.0dp)
+ widthPx: 1840.0px (700.9524dp)
+ heightPx: 2208.0px (841.1429dp)
+ availableWidthPx: 1840.0px (700.9524dp)
+ availableHeightPx: 2075.0px (790.4762dp)
+ mInsets.left: 0.0px (0.0dp)
+ mInsets.top: 133.0px (50.666668dp)
+ mInsets.right: 0.0px (0.0dp)
+ mInsets.bottom: 0.0px (0.0dp)
+ aspectRatio:1.2
+ isResponsiveGrid:false
+ isScalableGrid:false
+ inv.numRows: 4
+ inv.numColumns: 4
+ inv.numSearchContainerColumns: 4
+ minCellSize: PointF(0.0, 0.0)dp
+ cellWidthPx: 154.0px (58.666668dp)
+ cellHeightPx: 218.0px (83.04762dp)
+ getCellSize().x: 224.0px (85.333336dp)
+ getCellSize().y: 430.0px (163.80952dp)
+ cellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)
+ cellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)
+ cellLayoutPaddingPx.left: 0.0px (0.0dp)
+ cellLayoutPaddingPx.top: 0.0px (0.0dp)
+ cellLayoutPaddingPx.right: 0.0px (0.0dp)
+ cellLayoutPaddingPx.bottom: 0.0px (0.0dp)
+ iconSizePx: 141.0px (53.714287dp)
+ iconTextSizePx: 34.0px (12.952381dp)
+ iconDrawablePaddingPx: 13.0px (4.952381dp)
+ numFolderRows: 3
+ numFolderColumns: 4
+ folderCellWidthPx: 189.0px (72.0dp)
+ folderCellHeightPx: 219.0px (83.42857dp)
+ folderChildIconSizePx: 141.0px (53.714287dp)
+ folderChildTextSizePx: 34.0px (12.952381dp)
+ folderChildDrawablePaddingPx: 5.0px (1.9047619dp)
+ folderCellLayoutBorderSpacePx.x: 0.0px (0.0dp)
+ folderCellLayoutBorderSpacePx.y: 0.0px (0.0dp)
+ folderContentPaddingLeftRight: 21.0px (8.0dp)
+ folderTopPadding: 63.0px (24.0dp)
+ folderFooterHeight: 147.0px (56.0dp)
+ bottomSheetTopPadding: 133.0px (50.666668dp)
+ bottomSheetOpenDuration: 500
+ bottomSheetCloseDuration: 500
+ bottomSheetWorkspaceScale: 0.97
+ bottomSheetDepth: 0.3
+ allAppsShiftRange: 2208.0px (841.1429dp)
+ allAppsOpenDuration: 500
+ allAppsCloseDuration: 500
+ allAppsIconSizePx: 141.0px (53.714287dp)
+ allAppsIconTextSizePx: 34.0px (12.952381dp)
+ allAppsIconDrawablePaddingPx: 21.0px (8.0dp)
+ allAppsCellHeightPx: 361.0px (137.5238dp)
+ allAppsCellWidthPx: 183.0px (69.71429dp)
+ allAppsBorderSpacePxX: 42.0px (16.0dp)
+ allAppsBorderSpacePxY: 42.0px (16.0dp)
+ numShownAllAppsColumns: 8
+ allAppsPadding.top: 133.0px (50.666668dp)
+ allAppsPadding.left: 42.0px (16.0dp)
+ allAppsPadding.right: 42.0px (16.0dp)
+ allAppsLeftRightMargin: 1.0px (0.3809524dp)
+ hotseatBarSizePx: 267.0px (101.71429dp)
+ mHotseatColumnSpan: 4
+ mHotseatWidthPx: 0.0px (0.0dp)
+ hotseatCellHeightPx: 159.0px (60.57143dp)
+ hotseatBarBottomSpacePx: 126.0px (48.0dp)
+ mHotseatBarEdgePaddingPx: 0.0px (0.0dp)
+ mHotseatBarWorkspaceSpacePx: 0.0px (0.0dp)
+ hotseatBarEndOffset: 0.0px (0.0dp)
+ hotseatQsbSpace: 0.0px (0.0dp)
+ hotseatQsbHeight: 0.0px (0.0dp)
+ springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp)
+ getHotseatLayoutPadding(context).top: 0.0px (0.0dp)
+ getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp)
+ getHotseatLayoutPadding(context).left: 98.0px (37.333332dp)
+ getHotseatLayoutPadding(context).right: 98.0px (37.333332dp)
+ numShownHotseatIcons: 6
+ hotseatBorderSpace: 0.0px (0.0dp)
+ isQsbInline: false
+ hotseatQsbWidth: 0.0px (0.0dp)
+ isTaskbarPresent:false
+ isTaskbarPresentInApps:true
+ taskbarHeight: 0.0px (0.0dp)
+ stashedTaskbarHeight: 0.0px (0.0dp)
+ taskbarBottomMargin: 0.0px (0.0dp)
+ taskbarIconSize: 0.0px (0.0dp)
+ desiredWorkspaceHorizontalMarginPx: 21.0px (8.0dp)
+ workspacePadding.left: 21.0px (8.0dp)
+ workspacePadding.top: 24.0px (9.142858dp)
+ workspacePadding.right: 21.0px (8.0dp)
+ workspacePadding.bottom: 330.0px (125.71429dp)
+ iconScale: 1.0px (0.3809524dp)
+ cellScaleToFit : 1.0px (0.3809524dp)
+ extraSpace: 849.0px (323.42856dp)
+ unscaled extraSpace: 849.0px (323.42856dp)
+ maxEmptySpace: 0.0px (0.0dp)
+ workspaceTopPadding: 0.0px (0.0dp)
+ workspaceBottomPadding: 0.0px (0.0dp)
+ overviewTaskMarginPx: 0.0px (0.0dp)
+ overviewTaskIconSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)
+ overviewTaskThumbnailTopMarginPx: 0.0px (0.0dp)
+ overviewActionsTopMarginPx: 0.0px (0.0dp)
+ overviewActionsHeight: 0.0px (0.0dp)
+ overviewActionsClaimedSpaceBelow: 0.0px (0.0dp)
+ overviewActionsButtonSpacing: 0.0px (0.0dp)
+ overviewPageSpacing: 0.0px (0.0dp)
+ overviewRowSpacing: 0.0px (0.0dp)
+ overviewGridSideMargin: 0.0px (0.0dp)
+ dropTargetBarTopMarginPx: 0.0px (0.0dp)
+ dropTargetBarSizePx: 147.0px (56.0dp)
+ dropTargetBarBottomMarginPx: 84.0px (32.0dp)
+ getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp)
+ getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp)
+ workspaceSpringLoadedMinNextPageVisiblePx: 126.0px (48.0dp)
+ getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp)
+ getCellLayoutHeight(): 1721.0px (655.619dp)
+ getCellLayoutWidth(): 899.0px (342.4762dp)
diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait_decoupleDepth.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait_decoupleDepth.txt
new file mode 100644
index 0000000..eae50f1
--- /dev/null
+++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait_decoupleDepth.txt
@@ -0,0 +1,130 @@
+DeviceProfile:
+ 1 dp = 2.625 px
+ isTablet:true
+ isPhone:false
+ transposeLayoutWithOrientation:false
+ isGestureMode:true
+ isLandscape:false
+ isMultiWindowMode:false
+ isTwoPanels:true
+ isLeftRightSplit:false
+ windowX: 0.0px (0.0dp)
+ windowY: 0.0px (0.0dp)
+ widthPx: 1840.0px (700.9524dp)
+ heightPx: 2208.0px (841.1429dp)
+ availableWidthPx: 1840.0px (700.9524dp)
+ availableHeightPx: 2075.0px (790.4762dp)
+ mInsets.left: 0.0px (0.0dp)
+ mInsets.top: 133.0px (50.666668dp)
+ mInsets.right: 0.0px (0.0dp)
+ mInsets.bottom: 0.0px (0.0dp)
+ aspectRatio:1.2
+ isResponsiveGrid:false
+ isScalableGrid:false
+ inv.numRows: 4
+ inv.numColumns: 4
+ inv.numSearchContainerColumns: 4
+ minCellSize: PointF(0.0, 0.0)dp
+ cellWidthPx: 154.0px (58.666668dp)
+ cellHeightPx: 218.0px (83.04762dp)
+ getCellSize().x: 224.0px (85.333336dp)
+ getCellSize().y: 430.0px (163.80952dp)
+ cellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)
+ cellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)
+ cellLayoutPaddingPx.left: 0.0px (0.0dp)
+ cellLayoutPaddingPx.top: 0.0px (0.0dp)
+ cellLayoutPaddingPx.right: 0.0px (0.0dp)
+ cellLayoutPaddingPx.bottom: 0.0px (0.0dp)
+ iconSizePx: 141.0px (53.714287dp)
+ iconTextSizePx: 34.0px (12.952381dp)
+ iconDrawablePaddingPx: 13.0px (4.952381dp)
+ numFolderRows: 3
+ numFolderColumns: 4
+ folderCellWidthPx: 189.0px (72.0dp)
+ folderCellHeightPx: 219.0px (83.42857dp)
+ folderChildIconSizePx: 141.0px (53.714287dp)
+ folderChildTextSizePx: 34.0px (12.952381dp)
+ folderChildDrawablePaddingPx: 5.0px (1.9047619dp)
+ folderCellLayoutBorderSpacePx.x: 0.0px (0.0dp)
+ folderCellLayoutBorderSpacePx.y: 0.0px (0.0dp)
+ folderContentPaddingLeftRight: 21.0px (8.0dp)
+ folderTopPadding: 63.0px (24.0dp)
+ folderFooterHeight: 147.0px (56.0dp)
+ bottomSheetTopPadding: 133.0px (50.666668dp)
+ bottomSheetOpenDuration: 500
+ bottomSheetCloseDuration: 500
+ bottomSheetWorkspaceScale: 0.97
+ bottomSheetDepth: 0.3
+ allAppsShiftRange: 2208.0px (841.1429dp)
+ allAppsOpenDuration: 500
+ allAppsCloseDuration: 500
+ allAppsIconSizePx: 141.0px (53.714287dp)
+ allAppsIconTextSizePx: 34.0px (12.952381dp)
+ allAppsIconDrawablePaddingPx: 21.0px (8.0dp)
+ allAppsCellHeightPx: 361.0px (137.5238dp)
+ allAppsCellWidthPx: 183.0px (69.71429dp)
+ allAppsBorderSpacePxX: 42.0px (16.0dp)
+ allAppsBorderSpacePxY: 42.0px (16.0dp)
+ numShownAllAppsColumns: 8
+ allAppsPadding.top: 133.0px (50.666668dp)
+ allAppsPadding.left: 42.0px (16.0dp)
+ allAppsPadding.right: 42.0px (16.0dp)
+ allAppsLeftRightMargin: 1.0px (0.3809524dp)
+ hotseatBarSizePx: 267.0px (101.71429dp)
+ mHotseatColumnSpan: 4
+ mHotseatWidthPx: 0.0px (0.0dp)
+ hotseatCellHeightPx: 159.0px (60.57143dp)
+ hotseatBarBottomSpacePx: 126.0px (48.0dp)
+ mHotseatBarEdgePaddingPx: 0.0px (0.0dp)
+ mHotseatBarWorkspaceSpacePx: 0.0px (0.0dp)
+ hotseatBarEndOffset: 0.0px (0.0dp)
+ hotseatQsbSpace: 0.0px (0.0dp)
+ hotseatQsbHeight: 0.0px (0.0dp)
+ springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp)
+ getHotseatLayoutPadding(context).top: 0.0px (0.0dp)
+ getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp)
+ getHotseatLayoutPadding(context).left: 98.0px (37.333332dp)
+ getHotseatLayoutPadding(context).right: 98.0px (37.333332dp)
+ numShownHotseatIcons: 6
+ hotseatBorderSpace: 0.0px (0.0dp)
+ isQsbInline: false
+ hotseatQsbWidth: 0.0px (0.0dp)
+ isTaskbarPresent:false
+ isTaskbarPresentInApps:true
+ taskbarHeight: 0.0px (0.0dp)
+ stashedTaskbarHeight: 0.0px (0.0dp)
+ taskbarBottomMargin: 0.0px (0.0dp)
+ taskbarIconSize: 0.0px (0.0dp)
+ desiredWorkspaceHorizontalMarginPx: 21.0px (8.0dp)
+ workspacePadding.left: 21.0px (8.0dp)
+ workspacePadding.top: 24.0px (9.142858dp)
+ workspacePadding.right: 21.0px (8.0dp)
+ workspacePadding.bottom: 330.0px (125.71429dp)
+ iconScale: 1.0px (0.3809524dp)
+ cellScaleToFit : 1.0px (0.3809524dp)
+ extraSpace: 849.0px (323.42856dp)
+ unscaled extraSpace: 849.0px (323.42856dp)
+ maxEmptySpace: 0.0px (0.0dp)
+ workspaceTopPadding: 0.0px (0.0dp)
+ workspaceBottomPadding: 0.0px (0.0dp)
+ overviewTaskMarginPx: 0.0px (0.0dp)
+ overviewTaskIconSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizePx: 0.0px (0.0dp)
+ overviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)
+ overviewTaskThumbnailTopMarginPx: 0.0px (0.0dp)
+ overviewActionsTopMarginPx: 0.0px (0.0dp)
+ overviewActionsHeight: 0.0px (0.0dp)
+ overviewActionsClaimedSpaceBelow: 0.0px (0.0dp)
+ overviewActionsButtonSpacing: 0.0px (0.0dp)
+ overviewPageSpacing: 0.0px (0.0dp)
+ overviewRowSpacing: 0.0px (0.0dp)
+ overviewGridSideMargin: 0.0px (0.0dp)
+ dropTargetBarTopMarginPx: 0.0px (0.0dp)
+ dropTargetBarSizePx: 147.0px (56.0dp)
+ dropTargetBarBottomMarginPx: 84.0px (32.0dp)
+ getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp)
+ getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp)
+ workspaceSpringLoadedMinNextPageVisiblePx: 126.0px (48.0dp)
+ getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp)
+ getCellLayoutHeight(): 1721.0px (655.619dp)
+ getCellLayoutWidth(): 899.0px (342.4762dp)
diff --git a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 108db6c..ea58136 100644
--- a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -148,16 +148,13 @@
public static final String REQUEST_HOTSEAT_CELL_CENTER = "hotseat-cell-center";
- public static final String REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET =
- "get-focused-task-height-for-tablet";
- public static final String REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET =
- "get-grid-task-size-rect-for-tablet";
+ public static final String REQUEST_GET_OVERVIEW_TASK_SIZE = "get-overivew-task-size";
+ public static final String REQUEST_GET_OVERVIEW_GRID_TASK_SIZE = "get-overivew-grid-task-size";
public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing";
public static final String REQUEST_GET_OVERVIEW_CURRENT_PAGE_INDEX =
"get-overview-current-page-index";
public static final String REQUEST_GET_SPLIT_SELECTION_ACTIVE = "get-split-selection-active";
public static final String REQUEST_ENABLE_ROTATION = "enable_rotation";
- public static final String REQUEST_ENABLE_SUGGESTION = "enable-suggestion";
public static final String REQUEST_MODEL_QUEUE_CLEARED = "model-queue-cleared";
public static boolean sDebugTracing = false;
@@ -169,28 +166,20 @@
public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
- public static final String TWO_NEXUS_LAUNCHER_ACTIVITY_WHILE_UNLOCKING = "b/273347463";
- public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
public static final String ICON_MISSING = "b/282963545";
- public static final String OVERVIEW_OVER_HOME = "b/279059025";
public static final String UIOBJECT_STALE_ELEMENT = "b/319501259";
public static final String TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE = "b/326908466";
- public static final String TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE = "b/326073471";
public static final String WIDGET_CONFIG_NULL_EXTRA_INTENT = "b/324419890";
- public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209";
public static final String OVERVIEW_SELECT_TOOLTIP_MISALIGNED = "b/332485341";
-
- public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
- public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
- public static final String REQUEST_IS_EMULATE_DISPLAY_RUNNING = "is-emulate-display-running";
- public static final String REQUEST_EMULATE_PRINT_DEVICE = "emulate-print-device";
-
public static final String REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW = "enable-grid-only-overview";
public static final String REQUEST_FLAG_ENABLE_APP_PAIRS = "enable-app-pairs";
public static final String REQUEST_UNSTASH_BUBBLE_BAR_IF_STASHED =
"unstash-bubble-bar-if-stashed";
+ public static final String REQUEST_INJECT_FAKE_TRACKPAD = "inject-fake-trackpad";
+ public static final String REQUEST_EJECT_FAKE_TRACKPAD = "eject-fake-trackpad";
+
/** Logs {@link Log#d(String, String)} if {@link #sDebugTracing} is true. */
public static void testLogD(String tag, String message) {
if (!sDebugTracing) {
diff --git a/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt b/tests/multivalentTests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
similarity index 97%
rename from tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
index e378733..8770859 100644
--- a/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
@@ -57,7 +57,7 @@
*
* For an implementation that mocks InvariantDeviceProfile, use [FakeInvariantDeviceProfileTest]
*/
-@AllowedDevices(allowed = [DeviceProduct.CF_PHONE])
+@AllowedDevices(allowed = [DeviceProduct.CF_PHONE, DeviceProduct.ROBOLECTRIC])
@IgnoreLimit(ignoreLimit = BuildConfig.IS_STUDIO_BUILD)
abstract class AbstractDeviceProfileTest {
protected val testContext: Context = InstrumentationRegistry.getInstrumentation().context
@@ -341,4 +341,9 @@
protected fun Int.dpToPx(): Int {
return ResourceUtils.pxFromDp(this.toFloat(), context!!.resources.displayMetrics)
}
+
+ protected fun String.xmlToId(): Int {
+ val context = InstrumentationRegistry.getInstrumentation().context
+ return context.resources.getIdentifier(this, "xml", context.packageName)
+ }
}
diff --git a/tests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt b/tests/multivalentTests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt
similarity index 91%
rename from tests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt
index 7ff544d..5344d5c 100644
--- a/tests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/AbstractFloatingViewHelperTest.kt
@@ -25,7 +25,7 @@
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.verify
-import org.mockito.kotlin.verifyZeroInteractions
+import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.whenever
/** Test for AbstractFloatingViewHelper */
@@ -60,7 +60,8 @@
AbstractFloatingView.TYPE_ALL
)
- verifyZeroInteractions(view)
+ // b/343530737
+ verifyNoMoreInteractions(view)
verify(folderView).close(true)
verify(taskMenuView).close(true)
}
@@ -73,7 +74,8 @@
AbstractFloatingView.TYPE_TASK_MENU
)
- verifyZeroInteractions(view)
+ // b/343530737
+ verifyNoMoreInteractions(view)
verify(folderView, never()).close(any())
verify(taskMenuView).close(true)
}
@@ -86,7 +88,8 @@
AbstractFloatingView.TYPE_PIN_IME_POPUP
)
- verifyZeroInteractions(view)
+ // b/343530737
+ verifyNoMoreInteractions(view)
verify(folderView, never()).close(any())
verify(taskMenuView, never()).close(any())
}
@@ -99,7 +102,8 @@
AbstractFloatingView.TYPE_FOLDER or AbstractFloatingView.TYPE_TASK_MENU
)
- verifyZeroInteractions(view)
+ // b/343530737
+ verifyNoMoreInteractions(view)
verify(folderView).close(false)
verify(taskMenuView).close(false)
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/AppFilterTest.kt b/tests/multivalentTests/src/com/android/launcher3/AppFilterTest.kt
new file mode 100644
index 0000000..f1c6343
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/AppFilterTest.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3
+
+import android.content.ComponentName
+import android.content.Context
+import android.content.res.Resources
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class AppFilterTest {
+
+ @Mock private lateinit var mockContext: Context
+
+ @Mock // Mock the Resources object as well
+ private lateinit var mockResources: Resources
+
+ private lateinit var appFilter: AppFilter
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ `when`(mockContext.resources).thenReturn(mockResources) // Link the context and resources
+ `when`(mockResources.getStringArray(R.array.filtered_components))
+ .thenReturn(arrayOf("com.example.app1/Activity1"))
+ appFilter = AppFilter(mockContext)
+ }
+
+ @Test
+ fun shouldShowApp_notFiltered_returnsTrue() {
+ val appToShow = ComponentName("com.example.app2", "Activity2")
+ assertThat(appFilter.shouldShowApp(appToShow)).isTrue()
+ }
+
+ @Test
+ fun shouldShowApp_filtered_returnsFalse() {
+ val appToHide = ComponentName("com.example.app1", "Activity1")
+ assertThat(appFilter.shouldShowApp(appToHide)).isFalse()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/AutoInstallsLayoutTest.kt b/tests/multivalentTests/src/com/android/launcher3/AutoInstallsLayoutTest.kt
new file mode 100644
index 0000000..b04bcca
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/AutoInstallsLayoutTest.kt
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3
+
+import android.content.ComponentName
+import android.content.ContentValues
+import android.database.sqlite.SQLiteDatabase
+import android.os.Process.myUserHandle
+import android.os.UserHandle
+import android.util.Xml
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.AutoInstallsLayout.LayoutParserCallback
+import com.android.launcher3.AutoInstallsLayout.SourceResources
+import com.android.launcher3.AutoInstallsLayout.TAG_WORKSPACE
+import com.android.launcher3.AutoInstallsLayout.USER_TYPE_WORK
+import com.android.launcher3.LauncherSettings.Favorites.APPWIDGET_PROVIDER
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.LauncherSettings.Favorites.INTENT
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
+import com.android.launcher3.LauncherSettings.Favorites.PROFILE_ID
+import com.android.launcher3.LauncherSettings.Favorites.SPANX
+import com.android.launcher3.LauncherSettings.Favorites.SPANY
+import com.android.launcher3.LauncherSettings.Favorites._ID
+import com.android.launcher3.model.data.AppInfo
+import com.android.launcher3.pm.UserCache
+import com.android.launcher3.util.ApiWrapper
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.LauncherLayoutBuilder
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
+import com.android.launcher3.util.TestUtil
+import com.android.launcher3.util.UserIconInfo
+import com.android.launcher3.util.UserIconInfo.TYPE_MAIN
+import com.android.launcher3.util.UserIconInfo.TYPE_WORK
+import com.android.launcher3.widget.LauncherWidgetHolder
+import com.google.common.truth.Truth.assertThat
+import java.io.StringReader
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.whenever
+
+/** Tests for [AutoInstallsLayout] */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class AutoInstallsLayoutTest {
+
+ lateinit var modelHelper: LauncherModelHelper
+ lateinit var targetContext: SandboxModelContext
+
+ lateinit var callback: MyCallback
+
+ @Mock lateinit var widgetHolder: LauncherWidgetHolder
+ @Mock lateinit var db: SQLiteDatabase
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ modelHelper = LauncherModelHelper()
+ targetContext = modelHelper.sandboxContext
+ callback = MyCallback()
+ }
+
+ @After
+ fun tearDown() {
+ modelHelper.destroy()
+ }
+
+ @Test
+ fun pending_icon_added_on_home() {
+ LauncherLayoutBuilder()
+ .atWorkspace(1, 1, 0)
+ .putApp("p1", "c1")
+ .toAutoInstallsLayout()
+ .loadLayout(db)
+
+ assertThat(callback.items.size).isEqualTo(1)
+ assertThat(callback.items[0][ITEM_TYPE]).isEqualTo(ITEM_TYPE_APPLICATION)
+ assertThat(callback.items[0][INTENT])
+ .isEqualTo(AppInfo.makeLaunchIntent(ComponentName("p1", "c1")).toUri(0))
+ assertThat(callback.items[0][CONTAINER]).isEqualTo(CONTAINER_DESKTOP)
+ assertThat(callback.items[0].containsKey(PROFILE_ID)).isFalse()
+ }
+
+ @Test
+ fun pending_icon_added_on_hotseat() {
+ LauncherLayoutBuilder()
+ .atHotseat(1)
+ .putApp("p1", "c1")
+ .toAutoInstallsLayout()
+ .loadLayout(db)
+
+ assertThat(callback.items.size).isEqualTo(1)
+ assertThat(callback.items[0][ITEM_TYPE]).isEqualTo(ITEM_TYPE_APPLICATION)
+ assertThat(callback.items[0][CONTAINER]).isEqualTo(CONTAINER_HOTSEAT)
+ }
+
+ @Test
+ fun widget_added_to_home() {
+ LauncherLayoutBuilder()
+ .atWorkspace(1, 1, 0)
+ .putWidget("p1", "c1", 2, 3)
+ .toAutoInstallsLayout()
+ .loadLayout(db)
+
+ assertThat(callback.items.size).isEqualTo(1)
+ assertThat(callback.items[0][ITEM_TYPE]).isEqualTo(ITEM_TYPE_APPWIDGET)
+ assertThat(callback.items[0][CONTAINER]).isEqualTo(CONTAINER_DESKTOP)
+ assertThat(callback.items[0][APPWIDGET_PROVIDER])
+ .isEqualTo(ComponentName("p1", "c1").flattenToString())
+ assertThat(callback.items[0][SPANX]).isEqualTo(2.toString())
+ assertThat(callback.items[0][SPANY]).isEqualTo(3.toString())
+ }
+
+ @Test
+ fun items_added_to_folder() {
+ LauncherLayoutBuilder()
+ .atHotseat(1)
+ .putFolder("Test")
+ .addApp("p1", "c")
+ .addApp("p2", "c")
+ .addApp("p3", "c")
+ .build()
+ .toAutoInstallsLayout()
+ .loadLayout(db)
+
+ assertThat(callback.items.size).isEqualTo(4)
+ assertThat(callback.items[0][ITEM_TYPE]).isEqualTo(ITEM_TYPE_FOLDER)
+ assertThat(callback.items[0][CONTAINER]).isEqualTo(CONTAINER_HOTSEAT)
+
+ val folderId = callback.items[0][_ID]
+ assertThat(callback.items[1][CONTAINER]).isEqualTo(folderId)
+ assertThat(callback.items[2][CONTAINER]).isEqualTo(folderId)
+ assertThat(callback.items[3][CONTAINER]).isEqualTo(folderId)
+ }
+
+ @Test
+ fun work_item_added_to_home() {
+ val apiWrapperMock = spy(ApiWrapper.INSTANCE[targetContext])
+ targetContext.putObject(ApiWrapper.INSTANCE, apiWrapperMock)
+ doReturn(
+ mapOf(
+ myUserHandle() to UserIconInfo(myUserHandle(), TYPE_MAIN, 0),
+ UserHandle.of(20) to UserIconInfo(UserHandle.of(20), TYPE_WORK, 20),
+ )
+ )
+ .whenever(apiWrapperMock)
+ .queryAllUsers()
+
+ val cache = UserCache.getInstance(targetContext)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ assertThat(cache.userProfiles.size).isEqualTo(2)
+ }
+
+ LauncherLayoutBuilder()
+ .atWorkspace(1, 1, 0)
+ .putApp("p1", "c1", USER_TYPE_WORK)
+ .toAutoInstallsLayout()
+ .loadLayout(db)
+
+ assertThat(callback.items.size).isEqualTo(1)
+ assertThat(callback.items[0][ITEM_TYPE]).isEqualTo(ITEM_TYPE_APPLICATION)
+ assertThat(callback.items[0][INTENT])
+ .isEqualTo(AppInfo.makeLaunchIntent(ComponentName("p1", "c1")).toUri(0))
+ assertThat(callback.items[0][CONTAINER]).isEqualTo(CONTAINER_DESKTOP)
+ assertThat(callback.items[0][PROFILE_ID]).isEqualTo(20)
+ }
+
+ private fun LauncherLayoutBuilder.toAutoInstallsLayout() =
+ AutoInstallsLayout(
+ targetContext,
+ widgetHolder,
+ callback,
+ SourceResources.wrap(targetContext.resources),
+ { Xml.newPullParser().also { it.setInput(StringReader(build())) } },
+ TAG_WORKSPACE
+ )
+
+ class MyCallback : LayoutParserCallback {
+
+ val items = ArrayList<ContentValues>()
+
+ override fun generateNewItemId() = items.size
+
+ override fun insertAndCheck(db: SQLiteDatabase?, values: ContentValues): Int {
+ val id = values[_ID]
+ items.add(ContentValues(values))
+ return if (id is Int) id else 0
+ }
+ }
+}
diff --git a/tests/src/com/android/launcher3/DeleteDropTargetTest.kt b/tests/multivalentTests/src/com/android/launcher3/DeleteDropTargetTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/DeleteDropTargetTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/DeleteDropTargetTest.kt
diff --git a/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt b/tests/multivalentTests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
similarity index 94%
rename from tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
index 13d7499..954dc8f 100644
--- a/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
@@ -46,15 +46,14 @@
@IgnoreLimit(ignoreLimit = BuildConfig.IS_STUDIO_BUILD)
abstract class FakeInvariantDeviceProfileTest {
- protected var context: Context? = null
- protected var inv: InvariantDeviceProfile? = null
- protected val info: Info = mock()
- protected var windowBounds: WindowBounds? = null
- protected var isMultiWindowMode: Boolean = false
- protected var transposeLayoutWithOrientation: Boolean = false
- protected var useTwoPanels: Boolean = false
- protected var isGestureMode: Boolean = true
- protected var isTransientTaskbar: Boolean = true
+ protected lateinit var context: Context
+ protected lateinit var inv: InvariantDeviceProfile
+ protected val info = mock<Info>()
+ protected lateinit var windowBounds: WindowBounds
+ private var transposeLayoutWithOrientation = false
+ private var useTwoPanels = false
+ private var isGestureMode = true
+ private var isTransientTaskbar = true
@Rule @JvmField val limitDevicesRule = LimitDevicesRule()
@@ -73,7 +72,7 @@
info,
windowBounds,
SparseArray(),
- isMultiWindowMode,
+ /*isMultiWindowMode=*/ false,
transposeLayoutWithOrientation,
useTwoPanels,
isGestureMode,
@@ -257,10 +256,10 @@
}
protected fun initializeVarsForTwoPanel(
- isLandscape: Boolean = false,
- isGestureMode: Boolean = true,
- rows: Int = 4,
- cols: Int = 4,
+ isLandscape: Boolean = false,
+ isGestureMode: Boolean = true,
+ rows: Int = 4,
+ cols: Int = 4,
) {
val (x, y) = if (isLandscape) Pair(2208, 1840) else Pair(1840, 2208)
diff --git a/tests/src/com/android/launcher3/LauncherPrefsTest.kt b/tests/multivalentTests/src/com/android/launcher3/LauncherPrefsTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/LauncherPrefsTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/LauncherPrefsTest.kt
diff --git a/tests/multivalentTests/src/com/android/launcher3/RoboObjectInitializer.kt b/tests/multivalentTests/src/com/android/launcher3/RoboObjectInitializer.kt
new file mode 100644
index 0000000..c5f9f86
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/RoboObjectInitializer.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3
+
+import com.android.launcher3.util.MainThreadInitializedObject
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxApplication
+import com.android.launcher3.util.SafeCloseable
+
+/**
+ * Initializes [MainThreadInitializedObject] instances for Robolectric tests.
+ *
+ * Unlike instrumentation tests, Robolectric creates a new application instance for each test, which
+ * could cause the various static objects defined in [MainThreadInitializedObject] to leak. Thus, a
+ * [SandboxApplication] for Robolectric tests can implement this interface to limit the lifecycle of
+ * these objects to a single test.
+ */
+interface RoboObjectInitializer {
+
+ /** Overrides an object with [type] to [value]. */
+ fun <T : SafeCloseable> initializeObject(type: MainThreadInitializedObject<T>, value: T)
+}
diff --git a/tests/src/com/android/launcher3/UtilitiesKtTest.kt b/tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt
similarity index 86%
rename from tests/src/com/android/launcher3/UtilitiesKtTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt
index 9aa0369..0d13e77 100644
--- a/tests/src/com/android/launcher3/UtilitiesKtTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt
@@ -17,9 +17,8 @@
package com.android.launcher3
import android.content.Context
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
+import android.widget.LinearLayout
+import android.widget.TextView
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
@@ -27,28 +26,20 @@
import com.android.launcher3.UtilitiesKt.CLIP_TO_PADDING_FALSE_MODIFIER
import com.android.launcher3.UtilitiesKt.modifyAttributesOnViewTree
import com.android.launcher3.UtilitiesKt.restoreAttributesOnViewTree
-import com.android.launcher3.tests.R
import com.google.common.truth.Truth.assertThat
-import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
@RunWith(AndroidJUnit4::class)
class UtilitiesKtTest {
-
val context: Context = InstrumentationRegistry.getInstrumentation().context
- private lateinit var rootView: ViewGroup
- private lateinit var midView: ViewGroup
- private lateinit var childView: View
- @Before
- fun setup() {
- rootView =
- LayoutInflater.from(context).inflate(R.layout.utilities_test_view, null) as ViewGroup
- midView = rootView.requireViewById(R.id.mid_view)
- childView = rootView.requireViewById(R.id.child_view)
- }
+ private val childView = TextView(context)
+
+ private val midView = LinearLayout(context).apply { addView(childView) }
+
+ private val rootView = LinearLayout(context).apply { addView(midView) }
@Test
fun set_clipChildren_false() {
diff --git a/tests/multivalentTests/src/com/android/launcher3/UtilitiesTest.kt b/tests/multivalentTests/src/com/android/launcher3/UtilitiesTest.kt
new file mode 100644
index 0000000..d0aa7a8
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/UtilitiesTest.kt
@@ -0,0 +1,388 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3
+
+import android.content.Context
+import android.content.ContextWrapper
+import android.graphics.Rect
+import android.graphics.RectF
+import android.view.View
+import android.view.ViewGroup
+import androidx.test.core.app.ApplicationProvider.getApplicationContext
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.util.ActivityContextWrapper
+import kotlin.random.Random
+import org.junit.Assert.assertArrayEquals
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class UtilitiesTest {
+
+ companion object {
+ const val SEED = 827
+ }
+
+ private lateinit var mContext: Context
+
+ @Before
+ fun setUp() {
+ mContext = ActivityContextWrapper(getApplicationContext())
+ }
+
+ @Test
+ fun testIsPropertyEnabled() {
+ // This assumes the property "propertyName" is not enabled by default
+ assertFalse(Utilities.isPropertyEnabled("propertyName"))
+ }
+
+ @Test
+ fun testGetDescendantCoordRelativeToAncestor() {
+ val ancestor =
+ object : ViewGroup(mContext) {
+ override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {}
+ }
+ val descendant = View(mContext)
+
+ descendant.x = 50f
+ descendant.y = 30f
+ descendant.scaleX = 2f
+ descendant.scaleY = 2f
+
+ ancestor.addView(descendant)
+
+ val coord = floatArrayOf(10f, 15f)
+ val scale =
+ Utilities.getDescendantCoordRelativeToAncestor(descendant, ancestor, coord, false)
+
+ assertEquals(2f, scale) // Expecting scale to be 2f
+ assertEquals(70f, coord[0])
+ assertEquals(60f, coord[1])
+ }
+
+ @Test
+ fun testRoundArray() {
+ val floatArray = floatArrayOf(1.2f, 3.7f, 5.5f)
+ val intArray = IntArray(3)
+ Utilities.roundArray(floatArray, intArray)
+ assertArrayEquals(intArrayOf(1, 4, 6), intArray)
+ }
+
+ @Test
+ fun testOffsetPoints() {
+ val points = floatArrayOf(1f, 2f, 3f, 4f)
+ Utilities.offsetPoints(points, 5f, 6f)
+
+ val expected = listOf(6f, 8f, 8f, 10f)
+ assertEquals(expected, points.toList())
+ }
+
+ @Test
+ fun testPointInView() {
+ val view = View(mContext)
+ view.layout(0, 0, 100, 100)
+
+ assertTrue(Utilities.pointInView(view, 50f, 50f, 0f)) // Inside view
+ assertFalse(Utilities.pointInView(view, -10f, -10f, 0f)) // Outside view
+ assertTrue(Utilities.pointInView(view, -5f, -5f, 10f)) // Inside slop
+ assertFalse(Utilities.pointInView(view, 115f, 115f, 10f)) // Outside slop
+ }
+
+ @Test
+ fun testNumberBounding() {
+ assertEquals(887.99f, Utilities.boundToRange(887.99f, 0f, 1000f))
+ assertEquals(2.777f, Utilities.boundToRange(887.99f, 0f, 2.777f))
+ assertEquals(900f, Utilities.boundToRange(887.99f, 900f, 1000f))
+
+ assertEquals(9383667L, Utilities.boundToRange(9383667L, -999L, 9999999L))
+ assertEquals(9383668L, Utilities.boundToRange(9383667L, 9383668L, 9999999L))
+ assertEquals(42L, Utilities.boundToRange(9383667L, -999L, 42L))
+
+ assertEquals(345, Utilities.boundToRange(345, 2, 500))
+ assertEquals(400, Utilities.boundToRange(345, 400, 500))
+ assertEquals(300, Utilities.boundToRange(345, 2, 300))
+
+ val random = Random(SEED)
+ for (i in 1..300) {
+ val value = random.nextFloat()
+ val lowerBound = random.nextFloat()
+ val higherBound = lowerBound + random.nextFloat()
+
+ assertEquals(
+ "Utilities.boundToRange doesn't match Kotlin coerceIn",
+ value.coerceIn(lowerBound, higherBound),
+ Utilities.boundToRange(value, lowerBound, higherBound)
+ )
+ assertEquals(
+ "Utilities.boundToRange doesn't match Kotlin coerceIn",
+ value.toInt().coerceIn(lowerBound.toInt(), higherBound.toInt()),
+ Utilities.boundToRange(value.toInt(), lowerBound.toInt(), higherBound.toInt())
+ )
+ assertEquals(
+ "Utilities.boundToRange doesn't match Kotlin coerceIn",
+ value.toLong().coerceIn(lowerBound.toLong(), higherBound.toLong()),
+ Utilities.boundToRange(value.toLong(), lowerBound.toLong(), higherBound.toLong())
+ )
+ assertEquals(
+ "If the lower bound is higher than lower bound, it should return the lower bound",
+ higherBound,
+ Utilities.boundToRange(value, higherBound, lowerBound)
+ )
+ }
+ }
+
+ @Test
+ fun testTranslateOverlappingView() {
+ testConcentricOverlap()
+ leftDownCornerOverlap()
+ noOverlap()
+ }
+
+ /*
+ Test Case: Rectangle Contained Within Another Rectangle
+
+ +-------------+ <-- exclusionBounds
+ | |
+ | +-----+ |
+ | | | | <-- targetViewBounds
+ | | | |
+ | +-----+ |
+ | |
+ +-------------+
+ */
+ private fun testConcentricOverlap() {
+ val targetView = View(ContextWrapper(getApplicationContext()))
+ val targetViewBounds = Rect(40, 40, 60, 60)
+ val inclusionBounds = Rect(0, 0, 100, 100)
+ val exclusionBounds = Rect(30, 30, 70, 70)
+
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_RIGHT
+ )
+ assertEquals(30f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_LEFT
+ )
+ assertEquals(-30f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_DOWN
+ )
+ assertEquals(30f, targetView.translationY)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_UP
+ )
+ assertEquals(-30f, targetView.translationY)
+ }
+
+ /*
+ Test Case: Non-Overlapping Rectangles
+
+ +-----------------+ <-- targetViewBounds
+ | |
+ | |
+ +-----------------+
+
+ +-----------+ <-- exclusionBounds
+ | |
+ | |
+ +-----------+
+ */
+ private fun noOverlap() {
+ val targetView = View(ContextWrapper(getApplicationContext()))
+ val targetViewBounds = Rect(10, 10, 20, 20)
+
+ val inclusionBounds = Rect(0, 0, 100, 100)
+ val exclusionBounds = Rect(30, 30, 40, 40)
+
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_RIGHT
+ )
+ assertEquals(0f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_LEFT
+ )
+ assertEquals(0f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_DOWN
+ )
+ assertEquals(0f, targetView.translationY)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_UP
+ )
+ assertEquals(0f, targetView.translationY)
+ }
+
+ /*
+ Test Case: Rectangles Overlapping at Corners
+
+ +------------+ <-- exclusionBounds
+ | |
+ +-------+ |
+ | | | | <-- targetViewBounds
+ | +------------+
+ | |
+ +-------+
+ */
+ private fun leftDownCornerOverlap() {
+ val targetView = View(ContextWrapper(getApplicationContext()))
+ val targetViewBounds = Rect(20, 20, 30, 30)
+
+ val inclusionBounds = Rect(0, 0, 100, 100)
+ val exclusionBounds = Rect(25, 25, 35, 35)
+
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_RIGHT
+ )
+ assertEquals(15f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_LEFT
+ )
+ assertEquals(-5f, targetView.translationX)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_DOWN
+ )
+ assertEquals(15f, targetView.translationY)
+ Utilities.translateOverlappingView(
+ targetView,
+ targetViewBounds,
+ inclusionBounds,
+ exclusionBounds,
+ Utilities.TRANSLATE_UP
+ )
+ assertEquals(-5f, targetView.translationY)
+ }
+
+ @Test
+ fun trim() {
+ val expectedString = "Hello World"
+ assertEquals(expectedString, Utilities.trim("Hello World "))
+ // Basic trimming
+ assertEquals(expectedString, Utilities.trim(" Hello World "))
+ assertEquals(expectedString, Utilities.trim(" Hello World"))
+
+ // Non-breaking whitespace
+ assertEquals("Hello World", Utilities.trim("\u00A0\u00A0Hello World\u00A0\u00A0"))
+
+ // Whitespace combinations
+ assertEquals(expectedString, Utilities.trim("\t \r\n Hello World \n\r"))
+ assertEquals(expectedString, Utilities.trim("\nHello World "))
+
+ // Null input
+ assertEquals("", Utilities.trim(null))
+
+ // Empty String
+ assertEquals("", Utilities.trim(""))
+ }
+
+ @Test
+ fun getProgress() {
+ // Basic test
+ assertEquals(0.5f, Utilities.getProgress(50f, 0f, 100f), 0.001f)
+
+ // Negative values
+ assertEquals(0.5f, Utilities.getProgress(-20f, -50f, 10f), 0.001f)
+
+ // Outside of range
+ assertEquals(1.2f, Utilities.getProgress(120f, 0f, 100f), 0.001f)
+ }
+
+ @Test
+ fun scaleRectFAboutPivot() {
+ // Enlarge
+ var rectF = RectF(10f, 20f, 50f, 80f)
+ Utilities.scaleRectFAboutPivot(rectF, 30f, 50f, 1.5f)
+ assertEquals(RectF(0f, 5f, 60f, 95f), rectF)
+
+ // Shrink
+ rectF = RectF(10f, 20f, 50f, 80f)
+ Utilities.scaleRectFAboutPivot(rectF, 30f, 50f, 0.5f)
+ assertEquals(RectF(20f, 35f, 40f, 65f), rectF)
+
+ // No scale
+ rectF = RectF(10f, 20f, 50f, 80f)
+ Utilities.scaleRectFAboutPivot(rectF, 30f, 50f, 1.0f)
+ assertEquals(RectF(10f, 20f, 50f, 80f), rectF)
+ }
+
+ @Test
+ fun rotateBounds() {
+ var rect = Rect(20, 70, 60, 80)
+ Utilities.rotateBounds(rect, 100, 100, 0)
+ assertEquals(Rect(20, 70, 60, 80), rect)
+
+ rect = Rect(20, 70, 60, 80)
+ Utilities.rotateBounds(rect, 100, 100, 1)
+ assertEquals(Rect(70, 40, 80, 80), rect)
+
+ // case removed for b/28435189
+ // rect = Rect(20, 70, 60, 80)
+ // Utilities.rotateBounds(rect, 100, 100, 2)
+ // assertEquals(Rect(40, 20, 80, 30), rect)
+
+ rect = Rect(20, 70, 60, 80)
+ Utilities.rotateBounds(rect, 100, 100, 3)
+ assertEquals(Rect(20, 20, 30, 60), rect)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapterTest.kt b/tests/multivalentTests/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapterTest.kt
new file mode 100644
index 0000000..e03ee46
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapterTest.kt
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.accessibility
+
+import android.content.Context
+import android.view.ViewGroup
+import androidx.test.core.app.ApplicationProvider.getApplicationContext
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.CellLayout
+import com.android.launcher3.DropTarget.DragObject
+import com.android.launcher3.dragndrop.DragOptions
+import com.android.launcher3.util.ActivityContextWrapper
+import java.util.function.Function
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.kotlin.any
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class AccessibleDragListenerAdapterTest {
+
+ private lateinit var mockViewGroup: ViewGroup
+ private lateinit var mockChildOne: CellLayout
+ private lateinit var mockChildTwo: CellLayout
+ private lateinit var mDelegateFactory: Function<CellLayout, DragAndDropAccessibilityDelegate>
+ private lateinit var adapter: AccessibleDragListenerAdapter
+ private lateinit var mContext: Context
+
+ @Before
+ fun setup() {
+ mContext = ActivityContextWrapper(getApplicationContext())
+ mockViewGroup = mock(ViewGroup::class.java)
+ mockChildOne = mock(CellLayout::class.java)
+ mockChildTwo = mock(CellLayout::class.java)
+ `when`(mockViewGroup.context).thenReturn(mContext)
+ `when`(mockViewGroup.childCount).thenReturn(2)
+ `when`(mockViewGroup.getChildAt(0)).thenReturn(mockChildOne)
+ `when`(mockViewGroup.getChildAt(1)).thenReturn(mockChildTwo)
+ // Mock Delegate factory
+ mDelegateFactory =
+ mock(Function::class.java) as Function<CellLayout, DragAndDropAccessibilityDelegate>
+ `when`(mDelegateFactory.apply(any()))
+ .thenReturn(mock(DragAndDropAccessibilityDelegate::class.java))
+ adapter = AccessibleDragListenerAdapter(mockViewGroup, mDelegateFactory)
+ }
+
+ @Test
+ fun `onDragStart enables accessible drag for all view children`() {
+ // Create mock view children
+ val mockDragObject = mock(DragObject::class.java)
+ val mockDragOptions = mock(DragOptions::class.java)
+
+ // Action
+ adapter.onDragStart(mockDragObject, mockDragOptions)
+
+ // Assertion
+ verify(mockChildOne).setDragAndDropAccessibilityDelegate(any())
+ verify(mockChildTwo).setDragAndDropAccessibilityDelegate(any())
+ }
+
+ @Test
+ fun `onDragEnd removes the accessibility delegate`() {
+ // Action
+ adapter = AccessibleDragListenerAdapter(mockViewGroup, mDelegateFactory)
+ adapter.onDragEnd()
+
+ // Assertion
+ verify(mockChildOne).setDragAndDropAccessibilityDelegate(null)
+ verify(mockChildTwo).setDragAndDropAccessibilityDelegate(null)
+ }
+
+ @Test
+ fun `onChildViewAdded sets enabled as true for childview`() {
+ // Action
+ adapter = AccessibleDragListenerAdapter(mockViewGroup, mDelegateFactory)
+ adapter.onChildViewAdded(mockViewGroup, mockChildOne)
+
+ // Assertion
+ verify(mockChildOne).setDragAndDropAccessibilityDelegate(any())
+ }
+
+ @Test
+ fun `onChildViewRemoved sets enabled as false for childview`() {
+ // Action
+ adapter = AccessibleDragListenerAdapter(mockViewGroup, mDelegateFactory)
+ adapter.onChildViewRemoved(mockViewGroup, mockChildOne)
+
+ // Assertion
+ verify(mockChildOne).setDragAndDropAccessibilityDelegate(null)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/accessibility/FolderAccessibilityHelperTest.kt b/tests/multivalentTests/src/com/android/launcher3/accessibility/FolderAccessibilityHelperTest.kt
new file mode 100644
index 0000000..1cbe1df
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/accessibility/FolderAccessibilityHelperTest.kt
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.accessibility // Use the original package
+
+// Imports
+import android.content.Context
+import androidx.test.core.app.ApplicationProvider.getApplicationContext
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.CellLayout
+import com.android.launcher3.folder.FolderPagedView
+import com.android.launcher3.util.ActivityContextWrapper
+import kotlin.math.min
+import org.junit.Assert.assertEquals
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class FolderAccessibilityHelperTest {
+
+ // Context
+ private lateinit var mContext: Context
+ // Mocks
+ @Mock private lateinit var mockParent: FolderPagedView
+ @Mock private lateinit var mockLayout: CellLayout
+
+ private var countX = 4
+ private var countY = 3
+ private var index = 1
+
+ // System under test
+ private lateinit var folderAccessibilityHelper: FolderAccessibilityHelper
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ mContext = ActivityContextWrapper(getApplicationContext())
+ `when`(mockLayout.parent).thenReturn(mockParent)
+ `when`(mockLayout.context).thenReturn(mContext)
+
+ // mStartPosition isn't recalculated after the constructor
+ // If you want to create new tests with different starting params,
+ // rebuild the folderAccessibilityHelper object
+ val countX = 4
+ val countY = 3
+ val index = 1
+ `when`(mockParent.indexOfChild(mockLayout)).thenReturn(index)
+ `when`(mockLayout.countX).thenReturn(countX)
+ `when`(mockLayout.countY).thenReturn(countY)
+
+ folderAccessibilityHelper = FolderAccessibilityHelper(mockLayout)
+ }
+
+ // Test for intersectsValidDropTarget()
+ @Test
+ fun testIntersectsValidDropTarget() {
+ // Setup
+ val id = 5
+ val allocatedContentSize = 20
+ // Make layout function public @VisibleForTesting
+ `when`(mockParent.allocatedContentSize).thenReturn(allocatedContentSize)
+
+ // Execute
+ val result = folderAccessibilityHelper.intersectsValidDropTarget(id)
+
+ // Verify
+ val expectedResult = min(id, allocatedContentSize - (index * countX * countY) - 1)
+ assertEquals(expectedResult, result)
+ }
+
+ // Test for getLocationDescriptionForIconDrop()
+ @Test
+ fun testGetLocationDescriptionForIconDrop() {
+ // Setup
+ val id = 5
+
+ // Execute
+ val result = folderAccessibilityHelper.getLocationDescriptionForIconDrop(id)
+
+ // Verify
+ val expectedResult = "Move to position ${id + (index * countX * countY) + 1}"
+ assertEquals(expectedResult, result)
+ }
+
+ // Test for getConfirmationForIconDrop()
+ @Test
+ fun testGetConfirmationForIconDrop() {
+ // Execute
+ val result =
+ folderAccessibilityHelper.getConfirmationForIconDrop(0) // Id doesn't matter here
+
+ // Verify
+ assertEquals("Item moved", result)
+ }
+}
diff --git a/tests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java b/tests/multivalentTests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java
similarity index 95%
rename from tests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java
rename to tests/multivalentTests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java
index d2238ff..d938119 100644
--- a/tests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/allapps/AlphabeticalAppsListTest.java
@@ -65,6 +65,7 @@
private static final int PRIVATE_SPACE_HEADER_ITEM_COUNT = 1;
private static final int MAIN_USER_APP_COUNT = 2;
private static final int PRIVATE_USER_APP_COUNT = 2;
+ private static final int VIEW_AT_END_OF_APP_LIST = 1;
private static final int NUM_APP_COLS = 4;
private static final int NUM_APP_ROWS = 3;
private static final int PRIVATE_SPACE_SYS_APP_SEPARATOR_ITEM_COUNT = 1;
@@ -107,7 +108,8 @@
&& info.user.equals(MAIN_HANDLE));
assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT
- + PRIVATE_USER_APP_COUNT, mAlphabeticalAppsList.getAdapterItems().size());
+ + PRIVATE_USER_APP_COUNT + VIEW_AT_END_OF_APP_LIST,
+ mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(PRIVATE_SPACE_HEADER_ITEM_COUNT,
mAlphabeticalAppsList.getAdapterItems().stream().filter(item ->
item.viewType == VIEW_TYPE_PRIVATE_SPACE_HEADER).toList().size());
@@ -136,7 +138,7 @@
&& info.user.equals(MAIN_HANDLE));
assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT
- + PRIVATE_SPACE_SYS_APP_SEPARATOR_ITEM_COUNT
+ + PRIVATE_SPACE_SYS_APP_SEPARATOR_ITEM_COUNT + VIEW_AT_END_OF_APP_LIST
+ PRIVATE_USER_APP_COUNT, mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(PRIVATE_SPACE_HEADER_ITEM_COUNT,
mAlphabeticalAppsList.getAdapterItems().stream().filter(item ->
@@ -166,7 +168,8 @@
mAlphabeticalAppsList.updateItemFilter(info -> info != null
&& info.user.equals(MAIN_HANDLE));
- assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT,
+ assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT +
+ VIEW_AT_END_OF_APP_LIST,
mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(PRIVATE_SPACE_HEADER_ITEM_COUNT, mAlphabeticalAppsList
.getAdapterItems().stream().filter(item ->
@@ -187,8 +190,8 @@
mAlphabeticalAppsList.updateItemFilter(info -> info != null
&& info.user.equals(MAIN_HANDLE));
- assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT,
- mAlphabeticalAppsList.getAdapterItems().size());
+ assertEquals(MAIN_USER_APP_COUNT + PRIVATE_SPACE_HEADER_ITEM_COUNT +
+ VIEW_AT_END_OF_APP_LIST, mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(PRIVATE_SPACE_HEADER_ITEM_COUNT, mAlphabeticalAppsList
.getAdapterItems().stream().filter(item ->
item.viewType == VIEW_TYPE_PRIVATE_SPACE_HEADER).toList().size());
@@ -206,7 +209,8 @@
mAlphabeticalAppsList.updateItemFilter(info -> info != null
&& info.user.equals(MAIN_HANDLE));
- assertEquals(MAIN_USER_APP_COUNT, mAlphabeticalAppsList.getAdapterItems().size());
+ assertEquals(MAIN_USER_APP_COUNT + VIEW_AT_END_OF_APP_LIST,
+ mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(0, mAlphabeticalAppsList.getAdapterItems().stream().filter(item ->
item.viewType == VIEW_TYPE_PRIVATE_SPACE_HEADER).toList().size());
assertEquals(0, mAlphabeticalAppsList.getAdapterItems().stream().filter(item ->
@@ -222,7 +226,8 @@
mAlphabeticalAppsList.updateItemFilter(info -> info != null
&& info.user.equals(MAIN_HANDLE));
- assertEquals(2, mAlphabeticalAppsList.getAdapterItems().size());
+ assertEquals(MAIN_USER_APP_COUNT + VIEW_AT_END_OF_APP_LIST,
+ mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(0, mAlphabeticalAppsList.getAdapterItems().stream().filter(item ->
item.itemInfo != null
&& item.itemInfo.itemType == VIEW_TYPE_PRIVATE_SPACE_HEADER)
diff --git a/tests/multivalentTests/src/com/android/launcher3/allapps/FloatingHeaderViewTests.kt b/tests/multivalentTests/src/com/android/launcher3/allapps/FloatingHeaderViewTests.kt
new file mode 100644
index 0000000..ac2c553
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/allapps/FloatingHeaderViewTests.kt
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps
+
+import android.content.Context
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.core.app.ApplicationProvider.getApplicationContext
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.Flags
+import com.android.launcher3.util.ActivityContextWrapper
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class FloatingHeaderViewTests {
+
+ @get:Rule val mSetFlagsRule = SetFlagsRule()
+
+ private lateinit var context: Context
+ private lateinit var vut: FloatingHeaderView
+
+ @Before
+ fun setUp() {
+ context = ActivityContextWrapper(getApplicationContext())
+ // TODO(b/352161553): Inflate FloatingHeaderView or R.layout.all_apps_content with proper
+ // FloatingHeaderView#setup
+ vut = FloatingHeaderView(context)
+ vut.onFinishInflate()
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_FLOATING_SEARCH_BAR, Flags.FLAG_MULTILINE_SEARCH_BAR)
+ fun onHeightUpdated_whenNotMultiline_thenZeroHeight() {
+ vut.setFloatingRowsCollapsed(true)
+ val beforeHeight = vut.maxTranslation
+ vut.updateSearchBarOffset(HEADER_HEIGHT_OFFSET)
+
+ vut.onHeightUpdated()
+
+ assertThat(vut.maxTranslation).isEqualTo(beforeHeight)
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_MULTILINE_SEARCH_BAR)
+ @DisableFlags(Flags.FLAG_FLOATING_SEARCH_BAR)
+ fun onHeightUpdated_whenMultiline_thenHeightIsOffset() {
+ vut.setFloatingRowsCollapsed(true)
+ vut.updateSearchBarOffset(HEADER_HEIGHT_OFFSET)
+
+ vut.onHeightUpdated()
+
+ assertThat(vut.maxTranslation).isEqualTo(HEADER_HEIGHT_OFFSET)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MULTILINE_SEARCH_BAR)
+ @EnableFlags(Flags.FLAG_FLOATING_SEARCH_BAR)
+ fun onHeightUpdated_whenFloatingRowsShownAndNotMultiline_thenAddsOnlyFloatingRow() {
+ // Collapse floating rows and expand to trigger header height calculation
+ vut.setFloatingRowsCollapsed(true)
+ vut.setFloatingRowsCollapsed(false)
+ val defaultHeight = vut.maxTranslation
+ vut.updateSearchBarOffset(HEADER_HEIGHT_OFFSET)
+
+ vut.onHeightUpdated()
+
+ assertThat(vut.maxTranslation).isEqualTo(defaultHeight)
+ }
+
+ companion object {
+ private const val HEADER_HEIGHT_OFFSET = 50
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/allapps/PrivateSpaceSettingsButtonTest.java b/tests/multivalentTests/src/com/android/launcher3/allapps/PrivateSpaceSettingsButtonTest.java
new file mode 100644
index 0000000..1eb4173
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/allapps/PrivateSpaceSettingsButtonTest.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps;
+
+import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+
+import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PRIVATESPACE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.util.ActivityContextWrapper;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class PrivateSpaceSettingsButtonTest {
+
+ private PrivateSpaceSettingsButton mVut;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ Context context = new ActivityContextWrapper(getApplicationContext());
+ mVut = new PrivateSpaceSettingsButton(context);
+ }
+
+ @Test
+ public void privateSpaceSettingsAppInfo_hasCorrectIdAndContainer() {
+ AppInfo appInfo = mVut.createPrivateSpaceSettingsAppInfo();
+
+ assertThat(appInfo.id).isEqualTo(CONTAINER_PRIVATESPACE);
+ assertThat(appInfo.container).isEqualTo(CONTAINER_PRIVATESPACE);
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutMethodsTest.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutMethodsTest.kt
new file mode 100644
index 0000000..5bc57b0
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutMethodsTest.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.celllayout
+
+import org.junit.Rule
+import org.junit.Test
+
+// @RunWith(AndroidJUnit4::class) b/353965234
+class CellLayoutMethodsTest {
+
+ @JvmField @Rule var cellLayoutBuilder = UnitTestCellLayoutBuilderRule()
+
+ //@Test
+ fun pointToCellExact() {
+ val width = 1000
+ val height = 1000
+ val columns = 30
+ val rows = 30
+ val cl = cellLayoutBuilder.createCellLayout(columns, rows, false, width, height)
+
+ val res = intArrayOf(0, 0)
+ for (col in 0..<columns) {
+ for (row in 0..<rows) {
+ val x = (width / columns) * col
+ val y = (height / rows) * row
+ cl.pointToCellExact(x, y, res)
+ cl.pointToCellExact(x, y, res)
+ assertValues(col, res, row, columns, rows, width, height, x, y)
+ }
+ }
+
+ cl.pointToCellExact(-10, -10, res)
+ assertValues(0, res, 0, columns, rows, width, height, -10, -10)
+ cl.pointToCellExact(width + 10, height + 10, res)
+ assertValues(columns - 1, res, rows - 1, columns, rows, width, height, -10, -10)
+ }
+
+ private fun assertValues(
+ col: Int,
+ res: IntArray,
+ row: Int,
+ columns: Int,
+ rows: Int,
+ width: Int,
+ height: Int,
+ x: Int,
+ y: Int
+ ) {
+ assert(col == res[0] && row == res[1]) {
+ "Cell Layout with values (c= $columns, r= $rows, w= $width, h= $height) didn't mapped correctly the pixels ($x, $y) to the cells ($col, $row) with result (${res[0]}, ${res[1]})"
+ }
+ }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java
similarity index 98%
rename from tests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java
index 419cb3d..f1403e5 100644
--- a/tests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutTestCaseReader.java
@@ -54,7 +54,7 @@
}
public static class Arguments extends TestSection {
- String[] arguments;
+ public String[] arguments;
public Arguments(String[] arguments) {
super(State.ARGUMENTS);
diff --git a/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
diff --git a/tests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt
index 13dfd5e..a3c7f4f 100644
--- a/tests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/HotseatReorderUnitTest.kt
@@ -22,6 +22,8 @@
import android.view.View
import androidx.core.view.get
import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
import com.android.launcher3.CellLayout
import com.android.launcher3.celllayout.board.CellLayoutBoard
import com.android.launcher3.celllayout.board.IconPoint
@@ -34,6 +36,7 @@
import org.junit.Assert
import org.junit.Rule
import org.junit.Test
+import org.junit.runner.RunWith
private class HotseatReorderTestCase(
val startBoard: CellLayoutBoard,
@@ -44,6 +47,8 @@
}
}
+@SmallTest
+@RunWith(AndroidJUnit4::class)
class HotseatReorderUnitTest {
private val applicationContext: Context =
@@ -99,7 +104,7 @@
val cl = cellLayoutBuilder.createCellLayout(board.width, board.height, false)
// The views have to be sorted or the result can vary
board.icons
- .map(IconPoint::getCoord)
+ .map(IconPoint::coord)
.sortedWith(
Comparator.comparing { p: Any -> (p as Point).x }
.thenComparing { p: Any -> (p as Point).y }
@@ -115,9 +120,7 @@
)
}
board.widgets
- .sortedWith(
- Comparator.comparing(WidgetRect::getCellX).thenComparing(WidgetRect::getCellY)
- )
+ .sortedWith(Comparator.comparing(WidgetRect::cellX).thenComparing(WidgetRect::cellY))
.forEach { widget ->
addViewInCellLayout(
cl,
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java
similarity index 94%
rename from tests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java
index 0ff7c20..a62258c 100644
--- a/tests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTest.java
@@ -17,6 +17,9 @@
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
+import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -37,6 +40,8 @@
import com.android.launcher3.celllayout.testgenerator.RandomBoardGenerator;
import com.android.launcher3.celllayout.testgenerator.RandomMultiBoardGenerator;
import com.android.launcher3.util.ActivityContextWrapper;
+import com.android.launcher3.util.rule.TestStabilityRule;
+import com.android.launcher3.util.rule.TestStabilityRule.Stability;
import com.android.launcher3.views.DoubleShadowBubbleTextView;
import org.junit.Rule;
@@ -68,12 +73,16 @@
private Context mApplicationContext;
@Rule
+ public TestStabilityRule mTestStabilityRule = new TestStabilityRule();
+
+ @Rule
public UnitTestCellLayoutBuilderRule mCellLayoutBuilder = new UnitTestCellLayoutBuilderRule();
/**
* This test reads existing test cases and makes sure the CellLayout produces the same
* output for each of them for a given input.
*/
+ @Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT)
@Test
public void testAllCases() throws IOException {
List<ReorderAlgorithmUnitTestCase> testCases = getTestCases(
@@ -116,6 +125,7 @@
/**
* Same as above but testing the Multipage CellLayout.
*/
+ @Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT)
@Test
public void generateValidTests_Multi() {
Random generator = new Random(SEED);
@@ -144,8 +154,8 @@
public ItemConfiguration solve(CellLayoutBoard board, int x, int y, int spanX,
int spanY, int minSpanX, int minSpanY, boolean isMulti) {
- CellLayout cl = mCellLayoutBuilder.createCellLayout(board.getWidth(), board.getHeight(),
- isMulti);
+ CellLayout cl = mCellLayoutBuilder.createCellLayoutDefaultSize(board.getWidth(),
+ board.getHeight(), isMulti);
// The views have to be sorted or the result can vary
board.getIcons()
@@ -215,9 +225,11 @@
testCase.spanX, testCase.spanY, testCase.minSpanX, testCase.minSpanY,
isMultiCellLayout);
assertEquals("should be a valid solution", solution.isSolution, testCase.isValidSolution);
+ Log.d(TAG, "test case:" + testCase);
if (testCase.isValidSolution) {
CellLayoutBoard finishBoard = boardFromSolution(solution,
testCase.startBoard.getWidth(), testCase.startBoard.getHeight());
+ Log.d(TAG, "finishBoard case:" + finishBoard);
assertTrue("End result and test case result board doesn't match ",
finishBoard.compareTo(testCase.endBoard) == 0);
}
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTestCase.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTestCase.java
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTestCase.java
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderAlgorithmUnitTestCase.java
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt
index 0bec1b2..a9355ec 100644
--- a/tests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderPreviewAnimationTest.kt
@@ -141,11 +141,14 @@
ReorderPreviewAnimation.MODE_PREVIEW,
AnimationValues(dx = 0, dy = 0, scale = 100)
)
- testAnimationAtGivenProgress(
- PREVIEW_DURATION * 99,
- ReorderPreviewAnimation.MODE_PREVIEW,
- AnimationValues(dx = 5, dy = -10, scale = 96)
- )
+ // (b/339313407) Temporarily disable this test as the behavior is
+ // inconsistent between Soong & Gradle builds.
+ //
+ // testAnimationAtGivenProgress(
+ // PREVIEW_DURATION * 99,
+ // ReorderPreviewAnimation.MODE_PREVIEW,
+ // AnimationValues(dx = 5, dy = -10, scale = 96)
+ // )
testAnimationAtGivenProgress(
PREVIEW_DURATION * 98,
ReorderPreviewAnimation.MODE_PREVIEW,
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderTestCase.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderTestCase.java
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/ReorderTestCase.java
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/ReorderTestCase.java
diff --git a/tests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt
similarity index 84%
rename from tests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt
index b63966d..f624be1 100644
--- a/tests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/UnitTestCellLayoutBuilderRule.kt
@@ -64,11 +64,21 @@
dp.inv.numRows = prevNumRows
}
- fun createCellLayout(width: Int, height: Int, isMulti: Boolean): CellLayout {
+ fun createCellLayoutDefaultSize(columns: Int, rows: Int, isMulti: Boolean): CellLayout {
+ return createCellLayout(columns, rows, isMulti)
+ }
+
+ fun createCellLayout(
+ columns: Int,
+ rows: Int,
+ isMulti: Boolean,
+ width: Int = 1000,
+ height: Int = 1000
+ ): CellLayout {
val dp = getDeviceProfile()
// modify the device profile.
- dp.inv.numColumns = if (isMulti) width / 2 else width
- dp.inv.numRows = height
+ dp.inv.numColumns = if (isMulti) columns / 2 else columns
+ dp.inv.numRows = rows
dp.cellLayoutBorderSpacePx = Point(0, 0)
val cl =
if (isMulti) MultipageCellLayout(getWrappedContext(applicationContext, dp))
@@ -76,8 +86,8 @@
// I put a very large number for width and height so that all the items can fit, it doesn't
// need to be exact, just bigger than the sum of cell border
cl.measure(
- View.MeasureSpec.makeMeasureSpec(10000, View.MeasureSpec.EXACTLY),
- View.MeasureSpec.makeMeasureSpec(10000, View.MeasureSpec.EXACTLY)
+ View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY)
)
return cl
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/BoardClasses.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/BoardClasses.kt
new file mode 100644
index 0000000..3cbfc5a
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/BoardClasses.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.celllayout.board
+
+import android.graphics.Point
+import android.graphics.Rect
+
+/** Represents a widget in a CellLayoutBoard */
+data class WidgetRect(
+ val type: Char,
+ val bounds: Rect,
+) {
+ val spanX: Int = bounds.right - bounds.left + 1
+ val spanY: Int = bounds.top - bounds.bottom + 1
+ val cellY: Int = bounds.bottom
+ val cellX: Int = bounds.left
+
+ fun shouldIgnore() = type == CellType.IGNORE
+
+ fun contains(x: Int, y: Int) = bounds.contains(x, y)
+}
+
+/**
+ * [A-Z]: Represents a folder and number of icons in the folder is represented by the order of
+ * letter in the alphabet, A=2, B=3, C=4 ... etc.
+ */
+data class FolderPoint(val coord: Point, val type: Char) {
+ val numberIconsInside: Int = type.code - 'A'.code + 2
+}
+
+/** Represents an icon in a CellLayoutBoard */
+data class IconPoint(val coord: Point, val type: Char = CellType.ICON)
+
+object CellType {
+ // The cells marked by this will be filled by 1x1 widgets and will be ignored when
+ // validating
+ const val IGNORE = 'x'
+
+ // The cells marked by this will be filled by app icons
+ const val ICON = 'i'
+
+ // The cells marked by FOLDER will be filled by folders with 27 app icons inside
+ const val FOLDER = 'Z'
+
+ // Empty space
+ const val EMPTY = '-'
+
+ // Widget that will be saved as "main widget" for easier retrieval
+ const val MAIN_WIDGET = 'm' // Everything else will be consider a widget
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellLayoutBoard.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellLayoutBoard.java
index e5ad888..04bfee9 100644
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellLayoutBoard.java
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellLayoutBoard.java
@@ -88,7 +88,7 @@
public WidgetRect getWidgetOfType(char type) {
return mWidgetsRects.stream()
- .filter(widgetRect -> widgetRect.mType == type).findFirst().orElse(null);
+ .filter(widgetRect -> widgetRect.getType() == type).findFirst().orElse(null);
}
public WidgetRect getWidgetAt(int x, int y) {
@@ -117,8 +117,8 @@
}
private void removeWidgetFromBoard(WidgetRect widget) {
- for (int xi = widget.mBounds.left; xi <= widget.mBounds.right; xi++) {
- for (int yi = widget.mBounds.bottom; yi <= widget.mBounds.top; yi++) {
+ for (int xi = widget.getBounds().left; xi <= widget.getBounds().right; xi++) {
+ for (int yi = widget.getBounds().bottom; yi <= widget.getBounds().top; yi++) {
mWidget[xi][yi] = '-';
}
}
@@ -127,7 +127,7 @@
private void removeOverlappingItems(Rect rect) {
// Remove overlapping widgets and remove them from the board
mWidgetsRects = mWidgetsRects.stream().filter(widget -> {
- if (rect.intersect(widget.mBounds)) {
+ if (rect.intersect(widget.getBounds())) {
removeWidgetFromBoard(widget);
return false;
}
@@ -135,8 +135,8 @@
}).collect(Collectors.toList());
// Remove overlapping icons and remove them from the board
mIconPoints = mIconPoints.stream().filter(iconPoint -> {
- int x = iconPoint.coord.x;
- int y = iconPoint.coord.y;
+ int x = iconPoint.getCoord().x;
+ int y = iconPoint.getCoord().y;
if (rect.contains(x, y)) {
mWidget[x][y] = '-';
return false;
@@ -146,8 +146,8 @@
// Remove overlapping folders and remove them from the board
mFolderPoints = mFolderPoints.stream().filter(folderPoint -> {
- int x = folderPoint.coord.x;
- int y = folderPoint.coord.y;
+ int x = folderPoint.getCoord().x;
+ int y = folderPoint.getCoord().y;
if (rect.contains(x, y)) {
mWidget[x][y] = '-';
return false;
@@ -159,7 +159,7 @@
private void removeOverlappingItems(Point p) {
// Remove overlapping widgets and remove them from the board
mWidgetsRects = mWidgetsRects.stream().filter(widget -> {
- if (IdenticalBoardComparator.Companion.touchesPoint(widget.mBounds, p)) {
+ if (IdenticalBoardComparator.Companion.touchesPoint(widget.getBounds(), p)) {
removeWidgetFromBoard(widget);
return false;
}
@@ -167,8 +167,8 @@
}).collect(Collectors.toList());
// Remove overlapping icons and remove them from the board
mIconPoints = mIconPoints.stream().filter(iconPoint -> {
- int x = iconPoint.coord.x;
- int y = iconPoint.coord.y;
+ int x = iconPoint.getCoord().x;
+ int y = iconPoint.getCoord().y;
if (p.x == x && p.y == y) {
mWidget[x][y] = '-';
return false;
@@ -178,8 +178,8 @@
// Remove overlapping folders and remove them from the board
mFolderPoints = mFolderPoints.stream().filter(folderPoint -> {
- int x = folderPoint.coord.x;
- int y = folderPoint.coord.y;
+ int x = folderPoint.getCoord().x;
+ int y = folderPoint.getCoord().y;
if (p.x == x && p.y == y) {
mWidget[x][y] = '-';
return false;
@@ -226,7 +226,7 @@
public void removeItem(char type) {
mWidgetsRects.stream()
- .filter(widgetRect -> widgetRect.mType == type)
+ .filter(widgetRect -> widgetRect.getType() == type)
.forEach(widgetRect -> removeOverlappingItems(
new Point(widgetRect.getCellX(), widgetRect.getCellY())));
}
@@ -365,10 +365,10 @@
board.mWidth = lines[0].length();
board.mWidgetsRects = getRects(board.mWidget);
board.mWidgetsRects.forEach(widgetRect -> {
- if (widgetRect.mType == CellType.MAIN_WIDGET) {
+ if (widgetRect.getType() == CellType.MAIN_WIDGET) {
board.mMain = widgetRect;
}
- board.mWidgetsMap.put(widgetRect.mType, widgetRect);
+ board.mWidgetsMap.put(widgetRect.getType(), widgetRect);
});
board.mIconPoints = getIconPoints(board.mWidget);
board.mFolderPoints = getFolderPoints(board.mWidget);
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellType.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellType.java
deleted file mode 100644
index 49c146b..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/CellType.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.celllayout.board;
-
-public class CellType {
- // The cells marked by this will be filled by 1x1 widgets and will be ignored when
- // validating
- public static final char IGNORE = 'x';
- // The cells marked by this will be filled by app icons
- public static final char ICON = 'i';
- // The cells marked by FOLDER will be filled by folders with 27 app icons inside
- public static final char FOLDER = 'Z';
- // Empty space
- public static final char EMPTY = '-';
- // Widget that will be saved as "main widget" for easier retrieval
- public static final char MAIN_WIDGET = 'm';
- // Everything else will be consider a widget
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/FolderPoint.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/FolderPoint.java
deleted file mode 100644
index 39ba434..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/FolderPoint.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.celllayout.board;
-
-import android.graphics.Point;
-
-public class FolderPoint {
- public Point coord;
- public char mType;
-
- public FolderPoint(Point coord, char type) {
- this.coord = coord;
- mType = type;
- }
-
- /**
- * [A-Z]: Represents a folder and number of icons in the folder is represented by
- * the order of letter in the alphabet, A=2, B=3, C=4 ... etc.
- */
- public int getNumberIconsInside() {
- return (mType - 'A') + 2;
- }
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IconPoint.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IconPoint.java
deleted file mode 100644
index d3d2970..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IconPoint.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.celllayout.board;
-
-import android.graphics.Point;
-
-public class IconPoint {
- public Point coord;
- public char mType;
-
- public IconPoint(Point coord, char type) {
- this.coord = coord;
- mType = type;
- }
-
- public char getType() {
- return mType;
- }
-
- public void setType(char type) {
- mType = type;
- }
-
- public Point getCoord() {
- return coord;
- }
-
- public void setCoord(Point coord) {
- this.coord = coord;
- }
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IdenticalBoardComparator.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IdenticalBoardComparator.kt
index a4a420c..aacd940 100644
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IdenticalBoardComparator.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/IdenticalBoardComparator.kt
@@ -26,11 +26,11 @@
/** Converts a list of WidgetRect into a map of the count of different widget.bounds */
private fun widgetsToBoundsMap(widgets: List<WidgetRect>) =
- widgets.groupingBy { it.mBounds }.eachCount()
+ widgets.groupingBy { it.bounds }.eachCount()
/** Converts a list of IconPoint into a map of the count of different icon.coord */
private fun iconsToPosCountMap(widgets: List<IconPoint>) =
- widgets.groupingBy { it.getCoord() }.eachCount()
+ widgets.groupingBy { it.coord }.eachCount()
override fun compare(
cellLayoutBoard: CellLayoutBoard,
@@ -47,7 +47,7 @@
widgetsToBoundsMap(
otherCellLayoutBoard.widgets
.filter { !it.shouldIgnore() }
- .filter { !overlapsWithIgnored(ignoredRectangles, it.mBounds) }
+ .filter { !overlapsWithIgnored(ignoredRectangles, it.bounds) }
)
if (widgetsMap != otherWidgetMap) {
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.java
deleted file mode 100644
index 8a427dd..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.celllayout.board;
-
-import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-
-import static com.android.launcher3.ui.TestViewHelpers.findWidgetProvider;
-import static com.android.launcher3.util.WidgetUtils.createWidgetInfo;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.graphics.Rect;
-import android.os.Process;
-import android.os.UserHandle;
-import android.util.Log;
-
-import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
-import com.android.launcher3.model.data.AppInfo;
-import com.android.launcher3.model.data.FolderInfo;
-import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.model.data.LauncherAppWidgetInfo;
-import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
-
-import java.util.function.Supplier;
-import java.util.stream.IntStream;
-
-public class TestWorkspaceBuilder {
-
- private static final String TAG = "CellLayoutBoardBuilder";
- private static final String TEST_ACTIVITY_PACKAGE_PREFIX = "com.android.launcher3.tests.";
- private ComponentName mAppComponentName = new ComponentName(
- "com.google.android.calculator", "com.android.calculator2.Calculator");
- private UserHandle mMyUser;
-
- private Context mContext;
-
- public TestWorkspaceBuilder(Context context) {
- mMyUser = Process.myUserHandle();
- mContext = context;
- }
-
- /**
- * Fills the given rect in WidgetRect with 1x1 widgets. This is useful to equalize cases.
- */
- private FavoriteItemsTransaction fillWithWidgets(WidgetRect widgetRect,
- FavoriteItemsTransaction transaction, int screenId) {
- int initX = widgetRect.getCellX();
- int initY = widgetRect.getCellY();
- for (int x = initX; x < initX + widgetRect.getSpanX(); x++) {
- for (int y = initY; y < initY + widgetRect.getSpanY(); y++) {
- try {
- // this widgets are filling, we don't care if we can't place them
- transaction.addItem(createWidgetInCell(
- new WidgetRect(CellType.IGNORE,
- new Rect(x, y, x, y)), screenId));
- } catch (Exception e) {
- Log.d(TAG, "Unable to place filling widget at " + x + "," + y);
- }
- }
- }
- return transaction;
- }
-
- private AppInfo getApp() {
- return new AppInfo(mAppComponentName, "test icon", mMyUser,
- AppInfo.makeLaunchIntent(mAppComponentName));
- }
-
- /**
- * Helper to set the app to use for the test workspace,
- * using activity-alias from AndroidManifest-common.
- * @param testAppName the android:name field of the test app activity-alias to use
- */
- public void setTestAppActivityAlias(String testAppName) {
- this.mAppComponentName = new ComponentName(
- getInstrumentation().getContext().getPackageName(),
- TEST_ACTIVITY_PACKAGE_PREFIX + testAppName
- );
- }
-
- private void addCorrespondingWidgetRect(WidgetRect widgetRect,
- FavoriteItemsTransaction transaction, int screenId) {
- if (widgetRect.mType == 'x') {
- fillWithWidgets(widgetRect, transaction, screenId);
- } else {
- transaction.addItem(createWidgetInCell(widgetRect, screenId));
- }
- }
-
- /**
- * Builds the given board into the transaction
- */
- public FavoriteItemsTransaction buildFromBoard(CellLayoutBoard board,
- FavoriteItemsTransaction transaction, final int screenId) {
- board.getWidgets().forEach(
- (widgetRect) -> addCorrespondingWidgetRect(widgetRect, transaction, screenId));
- board.getIcons().forEach((iconPoint) ->
- transaction.addItem(() -> createIconInCell(iconPoint, screenId))
- );
- board.getFolders().forEach((folderPoint) ->
- transaction.addItem(() -> createFolderInCell(folderPoint, screenId))
- );
- return transaction;
- }
-
- /**
- * Fills the hotseat row with apps instead of suggestions, for this to work the workspace should
- * be clean otherwise this doesn't overrides the existing icons.
- */
- public FavoriteItemsTransaction fillHotseatIcons(FavoriteItemsTransaction transaction) {
- IntStream.range(0, InvariantDeviceProfile.INSTANCE.get(mContext).numDatabaseHotseatIcons)
- .forEach(i -> transaction.addItem(() -> getHotseatValues(i)));
- return transaction;
- }
-
- private Supplier<ItemInfo> createWidgetInCell(
- WidgetRect widgetRect, int screenId) {
- // Create the widget lazily since the appWidgetId can get lost during setup
- return () -> {
- LauncherAppWidgetProviderInfo info = findWidgetProvider(false);
- LauncherAppWidgetInfo item = createWidgetInfo(info, getApplicationContext(), true);
- item.cellX = widgetRect.getCellX();
- item.cellY = widgetRect.getCellY();
- item.spanX = widgetRect.getSpanX();
- item.spanY = widgetRect.getSpanY();
- item.screenId = screenId;
- return item;
- };
- }
-
- public FolderInfo createFolderInCell(FolderPoint folderPoint, int screenId) {
- FolderInfo folderInfo = new FolderInfo();
- folderInfo.screenId = screenId;
- folderInfo.container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
- folderInfo.cellX = folderPoint.coord.x;
- folderInfo.cellY = folderPoint.coord.y;
- folderInfo.minSpanY = folderInfo.minSpanX = folderInfo.spanX = folderInfo.spanY = 1;
- folderInfo.setOption(FolderInfo.FLAG_MULTI_PAGE_ANIMATION, true, null);
-
- for (int i = 0; i < folderPoint.getNumberIconsInside(); i++) {
- folderInfo.add(getDefaultWorkspaceItem(screenId), false);
- }
-
- return folderInfo;
- }
-
- private WorkspaceItemInfo getDefaultWorkspaceItem(int screenId) {
- WorkspaceItemInfo item = new WorkspaceItemInfo(getApp());
- item.screenId = screenId;
- item.minSpanY = item.minSpanX = item.spanX = item.spanY = 1;
- item.container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
- return item;
- }
-
- private ItemInfo createIconInCell(IconPoint iconPoint, int screenId) {
- WorkspaceItemInfo item = new WorkspaceItemInfo(getApp());
- item.screenId = screenId;
- item.cellX = iconPoint.getCoord().x;
- item.cellY = iconPoint.getCoord().y;
- item.minSpanY = item.minSpanX = item.spanX = item.spanY = 1;
- item.container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
- return item;
- }
-
- private ItemInfo getHotseatValues(int x) {
- WorkspaceItemInfo item = new WorkspaceItemInfo(getApp());
- item.cellX = x;
- item.cellY = 0;
- item.minSpanY = item.minSpanX = item.spanX = item.spanY = 1;
- item.rank = x;
- item.screenId = x;
- item.container = LauncherSettings.Favorites.CONTAINER_HOTSEAT;
- return item;
- }
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt
new file mode 100644
index 0000000..8952b85
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.celllayout.board
+
+import android.content.ComponentName
+import android.content.Context
+import android.graphics.Rect
+import android.os.Process
+import android.os.UserHandle
+import android.util.Log
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.LauncherSettings
+import com.android.launcher3.celllayout.FavoriteItemsTransaction
+import com.android.launcher3.model.data.AppInfo
+import com.android.launcher3.model.data.FolderInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.ui.TestViewHelpers
+import com.android.launcher3.util.WidgetUtils
+import java.util.function.Supplier
+
+class TestWorkspaceBuilder(private val mContext: Context) {
+
+ private var appComponentName =
+ ComponentName("com.google.android.calculator", "com.android.calculator2.Calculator")
+ private val myUser: UserHandle = Process.myUserHandle()
+
+ /** Fills the given rect in WidgetRect with 1x1 widgets. This is useful to equalize cases. */
+ private fun fillWithWidgets(
+ widgetRect: WidgetRect,
+ transaction: FavoriteItemsTransaction,
+ screenId: Int
+ ): FavoriteItemsTransaction {
+ val initX = widgetRect.cellX
+ val initY = widgetRect.cellY
+ for (x in initX until initX + widgetRect.spanX) {
+ for (y in initY until initY + widgetRect.spanY) {
+ try {
+ // this widgets are filling, we don't care if we can't place them
+ transaction.addItem(
+ createWidgetInCell(WidgetRect(CellType.IGNORE, Rect(x, y, x, y)), screenId)
+ )
+ } catch (e: Exception) {
+ Log.d(TAG, "Unable to place filling widget at $x,$y")
+ }
+ }
+ }
+ return transaction
+ }
+
+ private fun app() =
+ AppInfo(appComponentName, "test icon", myUser, AppInfo.makeLaunchIntent(appComponentName))
+
+ /**
+ * Helper to set the app to use for the test workspace, using activity-alias from
+ * AndroidManifest-common.
+ *
+ * @param testAppName the android:name field of the test app activity-alias to use
+ */
+ fun setTestAppActivityAlias(testAppName: String) {
+ appComponentName =
+ ComponentName(
+ InstrumentationRegistry.getInstrumentation().context.packageName,
+ TEST_ACTIVITY_PACKAGE_PREFIX + testAppName
+ )
+ }
+
+ private fun addCorrespondingWidgetRect(
+ widgetRect: WidgetRect,
+ transaction: FavoriteItemsTransaction,
+ screenId: Int
+ ) {
+ if (widgetRect.type == 'x') {
+ fillWithWidgets(widgetRect, transaction, screenId)
+ } else {
+ transaction.addItem(createWidgetInCell(widgetRect, screenId))
+ }
+ }
+
+ /** Builds the given board into the transaction */
+ fun buildFromBoard(
+ board: CellLayoutBoard,
+ transaction: FavoriteItemsTransaction,
+ screenId: Int
+ ): FavoriteItemsTransaction {
+ board.widgets.forEach { addCorrespondingWidgetRect(it, transaction, screenId) }
+ board.icons.forEach { transaction.addItem { createIconInCell(it, screenId) } }
+ board.folders.forEach { transaction.addItem { createFolderInCell(it, screenId) } }
+ return transaction
+ }
+
+ /**
+ * Fills the hotseat row with apps instead of suggestions, for this to work the workspace should
+ * be clean otherwise this doesn't overrides the existing icons.
+ */
+ fun fillHotseatIcons(transaction: FavoriteItemsTransaction): FavoriteItemsTransaction {
+ for (i in 0..<InvariantDeviceProfile.INSTANCE[mContext].numDatabaseHotseatIcons) {
+ transaction.addItem { getHotseatValues(i) }
+ }
+ return transaction
+ }
+
+ private fun createWidgetInCell(widgetRect: WidgetRect, paramScreenId: Int): Supplier<ItemInfo> {
+ // Create the widget lazily since the appWidgetId can get lost during setup
+ return Supplier<ItemInfo> {
+ WidgetUtils.createWidgetInfo(
+ TestViewHelpers.findWidgetProvider(false),
+ ApplicationProvider.getApplicationContext(),
+ true
+ )
+ .apply {
+ cellX = widgetRect.cellX
+ cellY = widgetRect.cellY
+ spanX = widgetRect.spanX
+ spanY = widgetRect.spanY
+ screenId = paramScreenId
+ }
+ }
+ }
+
+ fun createFolderInCell(folderPoint: FolderPoint, paramScreenId: Int): FolderInfo =
+ FolderInfo().apply {
+ screenId = paramScreenId
+ container = LauncherSettings.Favorites.CONTAINER_DESKTOP
+ cellX = folderPoint.coord.x
+ cellY = folderPoint.coord.y
+ spanY = 1
+ spanX = 1
+ minSpanX = 1
+ minSpanY = 1
+ setOption(FolderInfo.FLAG_MULTI_PAGE_ANIMATION, true, null)
+ for (i in 0 until folderPoint.numberIconsInside) {
+ add(getDefaultWorkspaceItem(paramScreenId), false)
+ }
+ }
+
+ private fun getDefaultWorkspaceItem(paramScreenId: Int): WorkspaceItemInfo =
+ WorkspaceItemInfo(app()).apply {
+ screenId = paramScreenId
+ spanY = 1
+ spanX = 1
+ minSpanX = 1
+ minSpanY = 1
+ container = LauncherSettings.Favorites.CONTAINER_DESKTOP
+ }
+
+ private fun createIconInCell(iconPoint: IconPoint, paramScreenId: Int) =
+ WorkspaceItemInfo(app()).apply {
+ screenId = paramScreenId
+ cellX = iconPoint.coord.x
+ cellY = iconPoint.coord.y
+ spanY = 1
+ spanX = 1
+ minSpanX = 1
+ minSpanY = 1
+ container = LauncherSettings.Favorites.CONTAINER_DESKTOP
+ }
+
+ private fun getHotseatValues(x: Int) =
+ WorkspaceItemInfo(app()).apply {
+ cellX = x
+ cellY = 0
+ spanY = 1
+ spanX = 1
+ minSpanX = 1
+ minSpanY = 1
+ rank = x
+ screenId = x
+ container = LauncherSettings.Favorites.CONTAINER_HOTSEAT
+ }
+
+ companion object {
+ private const val TAG = "CellLayoutBoardBuilder"
+ private const val TEST_ACTIVITY_PACKAGE_PREFIX = "com.android.launcher3.tests."
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/WidgetRect.java b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/WidgetRect.java
deleted file mode 100644
index c90ce85..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/WidgetRect.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.celllayout.board;
-
-import android.graphics.Rect;
-
-public class WidgetRect {
- public char mType;
- public Rect mBounds;
-
- public WidgetRect(char type, Rect bounds) {
- this.mType = type;
- this.mBounds = bounds;
- }
-
- public int getSpanX() {
- return mBounds.right - mBounds.left + 1;
- }
-
- public int getSpanY() {
- return mBounds.top - mBounds.bottom + 1;
- }
-
- public int getCellX() {
- return mBounds.left;
- }
-
- public int getCellY() {
- return mBounds.bottom;
- }
-
- boolean shouldIgnore() {
- return this.mType == CellType.IGNORE;
- }
-
- boolean contains(int x, int y) {
- return mBounds.contains(x, y);
- }
-
- @Override
- public String toString() {
- return "WidgetRect type = " + mType + " x = " + getCellX() + " | y " + getCellY()
- + " xs = " + getSpanX() + " ys = " + getSpanY();
- }
-}
diff --git a/tests/src/com/android/launcher3/celllayout/testgenerator/DeterministicRandomGenerator.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/DeterministicRandomGenerator.kt
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/testgenerator/DeterministicRandomGenerator.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/DeterministicRandomGenerator.kt
diff --git a/tests/src/com/android/launcher3/celllayout/testgenerator/RandomBoardGenerator.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/RandomBoardGenerator.kt
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/testgenerator/RandomBoardGenerator.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/RandomBoardGenerator.kt
diff --git a/tests/src/com/android/launcher3/celllayout/testgenerator/RandomMultiBoardGenerator.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/RandomMultiBoardGenerator.kt
similarity index 100%
rename from tests/src/com/android/launcher3/celllayout/testgenerator/RandomMultiBoardGenerator.kt
rename to tests/multivalentTests/src/com/android/launcher3/celllayout/testgenerator/RandomMultiBoardGenerator.kt
diff --git a/tests/multivalentTests/src/com/android/launcher3/folder/FolderNameInfosTest.kt b/tests/multivalentTests/src/com/android/launcher3/folder/FolderNameInfosTest.kt
new file mode 100644
index 0000000..b491f17
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/folder/FolderNameInfosTest.kt
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.folder
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.folder.FolderNameInfos.*
+import org.junit.Test
+import org.junit.runner.RunWith
+
+data class Label(val index: Int, val label: String, val score: Float)
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class FolderNameInfosTest {
+
+ companion object {
+ val statusList =
+ listOf(
+ SUCCESS,
+ HAS_PRIMARY,
+ HAS_SUGGESTIONS,
+ ERROR_NO_PROVIDER,
+ ERROR_APP_LOOKUP_FAILED,
+ ERROR_ALL_APP_LOOKUP_FAILED,
+ ERROR_NO_LABELS_GENERATED,
+ ERROR_LABEL_LOOKUP_FAILED,
+ ERROR_ALL_LABEL_LOOKUP_FAILED,
+ ERROR_NO_PACKAGES,
+ )
+ }
+
+ @Test
+ fun status() {
+ assertStatus(statusList)
+ assertStatus(
+ listOf(
+ ERROR_NO_PROVIDER,
+ ERROR_APP_LOOKUP_FAILED,
+ ERROR_ALL_APP_LOOKUP_FAILED,
+ ERROR_NO_LABELS_GENERATED,
+ ERROR_LABEL_LOOKUP_FAILED,
+ ERROR_ALL_LABEL_LOOKUP_FAILED,
+ ERROR_NO_PACKAGES,
+ )
+ )
+ assertStatus(
+ listOf(
+ SUCCESS,
+ HAS_PRIMARY,
+ HAS_SUGGESTIONS,
+ )
+ )
+ assertStatus(
+ listOf(
+ SUCCESS,
+ HAS_PRIMARY,
+ HAS_SUGGESTIONS,
+ )
+ )
+ }
+
+ fun assertStatus(statusList: List<Int>) {
+ var infos = FolderNameInfos()
+ statusList.forEach { infos.setStatus(it) }
+ assert(infos.status() == statusList.sum()) {
+ "There is an overlap on the status constants!"
+ }
+ }
+
+ @Test
+ fun hasPrimary() {
+ assertHasPrimary(
+ createNameInfos(listOf(Label(0, "label", 1f)), statusList),
+ hasPrimary = true
+ )
+ assertHasPrimary(
+ createNameInfos(listOf(Label(1, "label", 1f)), statusList),
+ hasPrimary = false
+ )
+ assertHasPrimary(
+ createNameInfos(
+ listOf(Label(0, "label", 1f)),
+ listOf(
+ ERROR_NO_PROVIDER,
+ ERROR_APP_LOOKUP_FAILED,
+ ERROR_ALL_APP_LOOKUP_FAILED,
+ ERROR_NO_LABELS_GENERATED,
+ ERROR_LABEL_LOOKUP_FAILED,
+ ERROR_ALL_LABEL_LOOKUP_FAILED,
+ ERROR_NO_PACKAGES,
+ )
+ ),
+ hasPrimary = false
+ )
+ }
+
+ private fun assertHasPrimary(nameInfos: FolderNameInfos, hasPrimary: Boolean) =
+ assert(nameInfos.hasPrimary() == hasPrimary)
+
+ private fun createNameInfos(labels: List<Label>?, statusList: List<Int>?): FolderNameInfos {
+ val infos = FolderNameInfos()
+ labels?.forEach { infos.setLabel(it.index, it.label, it.score) }
+ statusList?.forEach { infos.setStatus(it) }
+ return infos
+ }
+
+ @Test
+ fun hasSuggestions() {
+ assertHasSuggestions(
+ createNameInfos(listOf(Label(0, "label", 1f)), null),
+ hasSuggestions = true
+ )
+ assertHasSuggestions(createNameInfos(null, null), hasSuggestions = false)
+ // There is a max of 4 suggestions
+ assertHasSuggestions(
+ createNameInfos(listOf(Label(5, "label", 1f)), null),
+ hasSuggestions = false
+ )
+ assertHasSuggestions(
+ createNameInfos(
+ listOf(
+ Label(0, "label", 1f),
+ Label(1, "label", 1f),
+ Label(2, "label", 1f),
+ Label(3, "label", 1f)
+ ),
+ null
+ ),
+ hasSuggestions = true
+ )
+ }
+
+ private fun assertHasSuggestions(nameInfos: FolderNameInfos, hasSuggestions: Boolean) =
+ assert(nameInfos.hasSuggestions() == hasSuggestions)
+
+ @Test
+ fun hasContains() {
+ assertContains(
+ createNameInfos(
+ listOf(
+ Label(0, "label1", 1f),
+ Label(1, "label2", 1f),
+ Label(2, "label3", 1f),
+ Label(3, "label4", 1f)
+ ),
+ null
+ ),
+ label = Label(-1, "label3", -1f),
+ contains = true
+ )
+ assertContains(
+ createNameInfos(
+ listOf(
+ Label(0, "label1", 1f),
+ Label(1, "label2", 1f),
+ Label(2, "label3", 1f),
+ Label(3, "label4", 1f)
+ ),
+ null
+ ),
+ label = Label(-1, "label5", -1f),
+ contains = false
+ )
+ assertContains(
+ createNameInfos(null, null),
+ label = Label(-1, "label1", -1f),
+ contains = false
+ )
+ assertContains(
+ createNameInfos(
+ listOf(
+ Label(0, "label1", 1f),
+ Label(1, "label2", 1f),
+ Label(2, "lAbel3", 1f),
+ Label(3, "lEbel4", 1f)
+ ),
+ null
+ ),
+ label = Label(-1, "LaBEl3", -1f),
+ contains = true
+ )
+ }
+
+ private fun assertContains(nameInfos: FolderNameInfos, label: Label, contains: Boolean) =
+ assert(nameInfos.contains(label.label) == contains)
+}
diff --git a/tests/src/com/android/launcher3/folder/FolderNameProviderTest.java b/tests/multivalentTests/src/com/android/launcher3/folder/FolderNameProviderTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/folder/FolderNameProviderTest.java
rename to tests/multivalentTests/src/com/android/launcher3/folder/FolderNameProviderTest.java
diff --git a/tests/multivalentTests/src/com/android/launcher3/folder/FolderPagedViewTest.kt b/tests/multivalentTests/src/com/android/launcher3/folder/FolderPagedViewTest.kt
new file mode 100644
index 0000000..e8681dc
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/folder/FolderPagedViewTest.kt
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.folder
+
+import android.graphics.Point
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import org.junit.Test
+import org.junit.runner.RunWith
+
+data class TestCase(val maxCountX: Int, val maxCountY: Int, val totalItems: Int)
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class FolderPagedViewTest {
+
+ companion object {
+ private fun makeFolderGridOrganizer(testCase: TestCase): FolderGridOrganizer {
+ val folderGridOrganizer = FolderGridOrganizer(testCase.maxCountX, testCase.maxCountY)
+ folderGridOrganizer.setContentSize(testCase.totalItems)
+ return folderGridOrganizer
+ }
+ }
+
+ @Test
+ fun setContentSize() {
+ assertCountXandY(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22),
+ expectedCountX = 4,
+ expectedCountY = 3
+ )
+ assertCountXandY(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 8),
+ expectedCountX = 3,
+ expectedCountY = 3
+ )
+ assertCountXandY(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 3),
+ expectedCountX = 2,
+ expectedCountY = 2
+ )
+ }
+
+ private fun assertCountXandY(testCase: TestCase, expectedCountX: Int, expectedCountY: Int) {
+ val folderGridOrganizer = makeFolderGridOrganizer(testCase)
+ assert(folderGridOrganizer.countX == expectedCountX) {
+ "Error on expected countX $expectedCountX got ${folderGridOrganizer.countX} using test case $testCase"
+ }
+ assert(folderGridOrganizer.countY == expectedCountY) {
+ "Error on expected countY $expectedCountY got ${folderGridOrganizer.countY} using test case $testCase"
+ }
+ }
+
+ @Test
+ fun getPosForRank() {
+ assertFolderRank(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22),
+ expectedPos = Point(0, 0),
+ rank = 0
+ )
+ assertFolderRank(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22),
+ expectedPos = Point(1, 0),
+ rank = 1
+ )
+ assertFolderRank(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22),
+ expectedPos = Point(3, 0),
+ rank = 3
+ )
+ assertFolderRank(
+ TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22),
+ expectedPos = Point(2, 1),
+ rank = 6
+ )
+ val testCase = TestCase(maxCountX = 4, maxCountY = 3, totalItems = 22)
+ // Rank 16 and 38 should yield the same point since 38 % 12 == 2
+ val folderGridOrganizer = makeFolderGridOrganizer(testCase)
+ assertFolderRank(testCase, expectedPos = folderGridOrganizer.getPosForRank(2), rank = 38)
+ }
+
+ private fun assertFolderRank(testCase: TestCase, expectedPos: Point, rank: Int) {
+ val folderGridOrganizer = makeFolderGridOrganizer(testCase)
+ val pos = folderGridOrganizer.getPosForRank(rank)
+ assert(pos == expectedPos) {
+ "Expected pos = $expectedPos doesn't match pos = $pos for the given rank $rank and the give test case $testCase"
+ }
+ }
+
+ @Test
+ fun isItemInPreview() {
+ val folderGridOrganizer = FolderGridOrganizer(5, 8)
+ folderGridOrganizer.setContentSize(ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW - 1)
+ // Very few items
+ for (i in 0..3) {
+ assertItemsInPreview(
+ TestCase(
+ maxCountX = 5,
+ maxCountY = 8,
+ totalItems = ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW - 1
+ ),
+ expectedIsInPreview = true,
+ page = 0,
+ rank = i
+ )
+ }
+ for (i in 4..40) {
+ assertItemsInPreview(
+ TestCase(
+ maxCountX = 5,
+ maxCountY = 8,
+ totalItems = ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW - 1
+ ),
+ expectedIsInPreview = false,
+ page = 0,
+ rank = i
+ )
+ }
+ // Full of items
+ assertItemsInPreview(
+ TestCase(maxCountX = 5, maxCountY = 8, totalItems = 40),
+ expectedIsInPreview = false,
+ page = 0,
+ rank = 2
+ )
+ assertItemsInPreview(
+ TestCase(maxCountX = 5, maxCountY = 8, totalItems = 40),
+ expectedIsInPreview = false,
+ page = 0,
+ rank = 2
+ )
+ assertItemsInPreview(
+ TestCase(maxCountX = 5, maxCountY = 8, totalItems = 40),
+ expectedIsInPreview = true,
+ page = 0,
+ rank = 5
+ )
+ assertItemsInPreview(
+ TestCase(maxCountX = 5, maxCountY = 8, totalItems = 40),
+ expectedIsInPreview = true,
+ page = 0,
+ rank = 6
+ )
+ }
+
+ private fun assertItemsInPreview(
+ testCase: TestCase,
+ expectedIsInPreview: Boolean,
+ page: Int,
+ rank: Int
+ ) {
+ val folderGridOrganizer = makeFolderGridOrganizer(testCase)
+ val isInPreview = folderGridOrganizer.isItemInPreview(page, rank)
+ assert(isInPreview == expectedIsInPreview) {
+ "Item preview state should be $expectedIsInPreview but got $isInPreview, for page $page and rank $rank, for test case $testCase"
+ }
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/folder/FolderTest.kt b/tests/multivalentTests/src/com/android/launcher3/folder/FolderTest.kt
new file mode 100644
index 0000000..4eb335e
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/folder/FolderTest.kt
@@ -0,0 +1,928 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.folder
+
+import android.content.Context
+import android.graphics.Point
+import android.view.KeyEvent
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.TextView
+import androidx.core.view.isVisible
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.Alarm
+import com.android.launcher3.DragSource
+import com.android.launcher3.DropTarget.DragObject
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
+import com.android.launcher3.OnAlarmListener
+import com.android.launcher3.R
+import com.android.launcher3.celllayout.board.FolderPoint
+import com.android.launcher3.celllayout.board.TestWorkspaceBuilder
+import com.android.launcher3.dragndrop.DragController
+import com.android.launcher3.dragndrop.DragOptions
+import com.android.launcher3.dragndrop.DragView
+import com.android.launcher3.folder.Folder.MIN_CONTENT_DIMEN
+import com.android.launcher3.folder.Folder.ON_EXIT_CLOSE_DELAY
+import com.android.launcher3.folder.Folder.SCROLL_LEFT
+import com.android.launcher3.folder.Folder.SCROLL_NONE
+import com.android.launcher3.folder.Folder.STATE_ANIMATING
+import com.android.launcher3.folder.Folder.STATE_CLOSED
+import com.android.launcher3.model.data.FolderInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.ModelTestExtensions.clearModelDb
+import java.util.ArrayList
+import junit.framework.TestCase.assertEquals
+import junit.framework.TestCase.assertFalse
+import junit.framework.TestCase.assertNull
+import junit.framework.TestCase.assertTrue
+import org.junit.After
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito
+import org.mockito.Mockito.spy
+import org.mockito.Mockito.times
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.kotlin.doNothing
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.whenever
+
+/** Tests for [Folder] */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class FolderTest {
+
+ private val context: Context =
+ ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ private val workspaceBuilder = TestWorkspaceBuilder(context)
+ private val folder: Folder = spy(Folder(context, null))
+
+ @After
+ fun tearDown() {
+ LauncherAppState.getInstance(context).model.clearModelDb()
+ }
+
+ @Test
+ fun `Undo a folder with 1 icon when onDropCompleted is called`() {
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = folderInfo
+ folder.mInfo.getContents().removeAt(0)
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val dragLayout = Mockito.mock(View::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ folder.deleteFolderOnDropCompleted = false
+
+ folder.onDropCompleted(dragLayout, dragObject, true)
+
+ verify(folder, times(1)).replaceFolderWithFinalItem()
+ assertEquals(folder.deleteFolderOnDropCompleted, false)
+ }
+
+ @Test
+ fun `Do not undo a folder with 2 icons when onDropCompleted is called`() {
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = folderInfo
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val dragLayout = Mockito.mock(View::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ folder.deleteFolderOnDropCompleted = false
+
+ folder.onDropCompleted(dragLayout, dragObject, true)
+
+ verify(folder, times(0)).replaceFolderWithFinalItem()
+ assertEquals(folder.deleteFolderOnDropCompleted, false)
+ }
+
+ @Test
+ fun `Test that we accept valid item type ITEM_TYPE_APPLICATION`() {
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_APPLICATION
+
+ val willAcceptResult = Folder.willAccept(itemInfo)
+
+ assertTrue(willAcceptResult)
+ }
+
+ @Test
+ fun `Test that we accept valid item type ITEM_TYPE_DEEP_SHORTCUT`() {
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_DEEP_SHORTCUT
+
+ val willAcceptResult = Folder.willAccept(itemInfo)
+
+ assertTrue(willAcceptResult)
+ }
+
+ @Test
+ fun `Test that we accept valid item type ITEM_TYPE_APP_PAIR`() {
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_APP_PAIR
+
+ val willAcceptResult = Folder.willAccept(itemInfo)
+
+ assertTrue(willAcceptResult)
+ }
+
+ @Test
+ fun `Test that we do not accept invalid item type ITEM_TYPE_APPWIDGET`() {
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_APPWIDGET
+
+ val willAcceptResult = Folder.willAccept(itemInfo)
+
+ assertFalse(willAcceptResult)
+ }
+
+ @Test
+ fun `Test that we do not accept invalid item type ITEM_TYPE_FOLDER`() {
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_FOLDER
+
+ val willAcceptResult = Folder.willAccept(itemInfo)
+
+ assertFalse(willAcceptResult)
+ }
+
+ @Test
+ fun `We should not animate open if items is null or less than or equal to 1`() {
+ folder.mInfo = Mockito.mock(FolderInfo::class.java)
+ val shouldAnimateOpenResult = folder.shouldAnimateOpen(null)
+
+ assertFalse(shouldAnimateOpenResult)
+ assertFalse(
+ folder.shouldAnimateOpen(arrayListOf<ItemInfo>(Mockito.mock(ItemInfo::class.java)))
+ )
+ }
+
+ @Test
+ fun `We should animate open if items greater than 1`() {
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = folderInfo
+
+ val shouldAnimateOpenResult = folder.shouldAnimateOpen(folder.mInfo.getContents())
+
+ assertTrue(shouldAnimateOpenResult)
+ }
+
+ @Test
+ fun `Should be true if there is an open folder`() {
+ val closeOpenFolderResult = folder.closeOpenFolder(Mockito.mock(Folder::class.java))
+
+ assertTrue(closeOpenFolderResult)
+ }
+
+ @Test
+ fun `Should be false if the open folder is this folder`() {
+ val closeOpenFolderResult = folder.closeOpenFolder(folder)
+
+ assertFalse(closeOpenFolderResult)
+ }
+
+ @Test
+ fun `Should be false if there is not an open folder`() {
+ val closeOpenFolderResult = folder.closeOpenFolder(null)
+
+ assertFalse(closeOpenFolderResult)
+ }
+
+ @Test
+ fun `If drag is in progress we should set mItemAddedBackToSelfViaIcon to true`() {
+ folder.itemAddedBackToSelfViaIcon = false
+ folder.isDragInProgress = true
+
+ folder.notifyDrop()
+
+ assertTrue(folder.itemAddedBackToSelfViaIcon)
+ }
+
+ @Test
+ fun `If drag is not in progress we should not set mItemAddedBackToSelfViaIcon to true`() {
+ folder.itemAddedBackToSelfViaIcon = false
+ folder.isDragInProgress = false
+
+ folder.notifyDrop()
+
+ assertFalse(folder.itemAddedBackToSelfViaIcon)
+ }
+
+ @Test
+ fun `If launcher dragging is not enabled onLongClick should return true`() {
+ `when`(folder.isLauncherDraggingEnabled).thenReturn(false)
+
+ val onLongClickResult = folder.onLongClick(Mockito.mock(View::class.java))
+
+ assertTrue(onLongClickResult)
+ }
+
+ @Test
+ fun `If launcher dragging is enabled we should return startDrag result`() {
+ `when`(folder.isLauncherDraggingEnabled).thenReturn(true)
+ val viewMock = Mockito.mock(View::class.java)
+ val dragOptions = Mockito.mock(DragOptions::class.java)
+
+ val onLongClickResult = folder.onLongClick(viewMock)
+
+ assertEquals(onLongClickResult, folder.startDrag(viewMock, dragOptions))
+ verify(folder, times(1)).startDrag(viewMock, dragOptions)
+ }
+
+ @Test
+ fun `Verify start drag works as intended when view is instanceof ItemInfo`() {
+ val itemInfo = ItemInfo()
+ itemInfo.rank = 5
+ val viewMock = Mockito.mock(View::class.java)
+ val dragOptions = DragOptions()
+ `when`(viewMock.tag).thenReturn(itemInfo)
+ folder.dragController = Mockito.mock(DragController::class.java)
+
+ folder.startDrag(viewMock, dragOptions)
+
+ assertEquals(folder.mEmptyCellRank, 5)
+ assertEquals(folder.currentDragView, viewMock)
+ verify(folder, times(1)).addDragListener(dragOptions)
+ verify(folder, times(1)).callBeginDragShared(viewMock, dragOptions)
+ }
+
+ @Test
+ fun `Verify start drag works as intended when view is not instanceof ItemInfo`() {
+ val viewMock = Mockito.mock(View::class.java)
+ val dragOptions = DragOptions()
+
+ folder.startDrag(viewMock, dragOptions)
+
+ verify(folder, times(0)).addDragListener(dragOptions)
+ verify(folder, times(0)).callBeginDragShared(viewMock, dragOptions)
+ }
+
+ @Test
+ fun `Verify that onDragStart has an effect if dragSource is this folder`() {
+ folder.itemsInvalidated = false
+ folder.isDragInProgress = false
+ folder.itemAddedBackToSelfViaIcon = true
+ folder.currentDragView = Mockito.mock(View::class.java)
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = spy(folderInfo)
+ val dragObject = DragObject(context)
+ dragObject.dragInfo = Mockito.mock(ItemInfo::class.java)
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ dragObject.dragSource = folder
+
+ folder.onDragStart(dragObject, DragOptions())
+
+ verify(folder.mContent, times(1)).removeItem(folder.currentDragView)
+ verify(folder.mInfo, times(1)).remove(dragObject.dragInfo, true)
+ assertTrue(folder.itemsInvalidated)
+ assertTrue(folder.isDragInProgress)
+ assertFalse(folder.itemAddedBackToSelfViaIcon)
+ }
+
+ @Test
+ fun `Verify that onDragStart has no effects if dragSource is not this folder`() {
+ folder.itemsInvalidated = false
+ folder.isDragInProgress = false
+ folder.itemAddedBackToSelfViaIcon = true
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val dragObject = DragObject(context)
+ dragObject.dragSource = Mockito.mock(DragSource::class.java)
+
+ folder.onDragStart(dragObject, DragOptions())
+
+ verify(folder.mContent, times(0)).removeItem(folder.currentDragView)
+ assertFalse(folder.itemsInvalidated)
+ assertFalse(folder.isDragInProgress)
+ assertTrue(folder.itemAddedBackToSelfViaIcon)
+ }
+
+ @Test
+ fun `Verify onDragEnd that we call completeDragExit and set drag in progress false`() {
+ doNothing().`when`(folder).completeDragExit()
+ folder.isExternalDrag = true
+ folder.isDragInProgress = true
+ folder.dragController = Mockito.mock(DragController::class.java)
+
+ folder.onDragEnd()
+
+ verify(folder, times(1)).completeDragExit()
+ verify(folder.dragController, times(1)).removeDragListener(folder)
+ assertFalse(folder.isDragInProgress)
+ }
+
+ @Test
+ fun `Verify onDragEnd that we do not call completeDragExit and set drag in progress false`() {
+ folder.isExternalDrag = false
+ folder.isDragInProgress = true
+ folder.dragController = Mockito.mock(DragController::class.java)
+
+ folder.onDragEnd()
+
+ verify(folder, times(0)).completeDragExit()
+ verify(folder.dragController, times(1)).removeDragListener(folder)
+ assertFalse(folder.isDragInProgress)
+ }
+
+ @Test
+ fun `startEditingFolderName should set hint to empty and showLabelSuggestions`() {
+ doNothing().`when`(folder).showLabelSuggestions()
+ folder.isEditingName = false
+ folder.folderName = FolderNameEditText(context)
+ folder.folderName.hint = "hello"
+
+ folder.startEditingFolderName()
+
+ verify(folder, times(1)).showLabelSuggestions()
+ assertEquals("", folder.folderName.hint)
+ assertTrue(folder.isEditingName)
+ }
+
+ @Test
+ fun `Ensure we set the title and hint correctly onBackKey when we have a new title`() {
+ val expectedHint = null
+ val expectedTitle = "hello"
+ folder.isEditingName = true
+ folder.folderName = spy(FolderNameEditText(context))
+ folder.folderName.setText(expectedTitle)
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = spy(folderInfo)
+ folder.mInfo.title = "world"
+ folder.mFolderIcon = Mockito.mock(FolderIcon::class.java)
+
+ folder.onBackKey()
+
+ assertEquals(expectedTitle, folder.mInfo.title)
+ verify(folder.mFolderIcon, times(1)).onTitleChanged(expectedTitle)
+ assertEquals(expectedHint, folder.folderName.hint)
+ assertFalse(folder.isEditingName)
+ verify(folder.folderName, times(1)).clearFocus()
+ }
+
+ @Test
+ fun `Ensure we set the title and hint correctly onBackKey when we do not have a new title`() {
+ val expectedHint = context.getString(R.string.folder_hint_text)
+ val expectedTitle = ""
+ folder.isEditingName = true
+ folder.folderName = spy(FolderNameEditText(context))
+ folder.folderName.setText(expectedTitle)
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = spy(folderInfo)
+ folder.mInfo.title = "world"
+ folder.mFolderIcon = Mockito.mock(FolderIcon::class.java)
+
+ folder.onBackKey()
+
+ assertEquals(expectedTitle, folder.mInfo.title)
+ verify(folder.mFolderIcon, times(1)).onTitleChanged(expectedTitle)
+ assertEquals(expectedHint, folder.folderName.hint)
+ assertFalse(folder.isEditingName)
+ verify(folder.folderName, times(1)).clearFocus()
+ }
+
+ @Test
+ fun `ensure onEditorAction calls dispatchBackKey when actionId is IME_ACTION_DONE`() {
+ folder.folderName = Mockito.mock(FolderNameEditText::class.java)
+
+ val result =
+ folder.onEditorAction(
+ Mockito.mock(TextView::class.java),
+ EditorInfo.IME_ACTION_DONE,
+ Mockito.mock(KeyEvent::class.java)
+ )
+
+ assertTrue(result)
+ verify(folder.folderName, times(1)).dispatchBackKey()
+ }
+
+ @Test
+ fun `ensure onEditorAction does not call dispatchBackKey when actionId is not IME_ACTION_DONE`() {
+ folder.folderName = Mockito.mock(FolderNameEditText::class.java)
+
+ val result =
+ folder.onEditorAction(
+ Mockito.mock(TextView::class.java),
+ EditorInfo.IME_ACTION_NONE,
+ Mockito.mock(KeyEvent::class.java)
+ )
+
+ assertFalse(result)
+ verify(folder.folderName, times(0)).dispatchBackKey()
+ }
+
+ @Test
+ fun `in completeDragExit we close the folder when mIsOpen`() {
+ doNothing().`when`(folder).close(true)
+ folder.setIsOpen(true)
+ folder.rearrangeOnClose = false
+
+ folder.completeDragExit()
+
+ verify(folder, times(1)).close(true)
+ assertTrue(folder.rearrangeOnClose)
+ }
+
+ @Test
+ fun `in completeDragExit we want to rearrange on close when it is animating`() {
+ folder.setIsOpen(false)
+ folder.rearrangeOnClose = false
+ folder.state = STATE_ANIMATING
+
+ folder.completeDragExit()
+
+ verify(folder, times(0)).close(true)
+ assertTrue(folder.rearrangeOnClose)
+ }
+
+ @Test
+ fun `in completeDragExit we want to call rearrangeChildren and clearDragInfo when not open and not animating`() {
+ doNothing().`when`(folder).rearrangeChildren()
+ doNothing().`when`(folder).clearDragInfo()
+ folder.setIsOpen(false)
+ folder.rearrangeOnClose = false
+ folder.state = STATE_CLOSED
+
+ folder.completeDragExit()
+
+ verify(folder, times(0)).close(true)
+ assertFalse(folder.rearrangeOnClose)
+ verify(folder, times(1)).rearrangeChildren()
+ verify(folder, times(1)).clearDragInfo()
+ }
+
+ @Test
+ fun `clearDragInfo should set current drag view to null and isExternalDrag to false`() {
+ folder.currentDragView = Mockito.mock(DragView::class.java)
+ folder.isExternalDrag = true
+
+ folder.clearDragInfo()
+
+ assertNull(folder.currentDragView)
+ assertFalse(folder.isExternalDrag)
+ }
+
+ @Test
+ fun `onDragExit should set alarm if drag is not complete`() {
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ dragObject.dragComplete = false
+
+ folder.onDragExit(dragObject)
+
+ verify(folder.onExitAlarm, times(1)).setOnAlarmListener(folder.mOnExitAlarmListener)
+ verify(folder.onExitAlarm, times(1)).setAlarm(ON_EXIT_CLOSE_DELAY.toLong())
+ }
+
+ @Test
+ fun `onDragExit should not set alarm if drag is complete`() {
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ dragObject.dragComplete = true
+
+ folder.onDragExit(dragObject)
+
+ verify(folder.onExitAlarm, times(0)).setOnAlarmListener(folder.mOnExitAlarmListener)
+ verify(folder.onExitAlarm, times(0)).setAlarm(ON_EXIT_CLOSE_DELAY.toLong())
+ }
+
+ @Test
+ fun `onDragExit should not clear scroll hint if already SCROLL_NONE`() {
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ folder.scrollHintDir = SCROLL_NONE
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+
+ folder.onDragExit(dragObject)
+
+ verify(folder.mContent, times(0)).clearScrollHint()
+ }
+
+ @Test
+ fun `onDragExit should clear scroll hint if not SCROLL_NONE and then set scroll hint to scroll none`() {
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ folder.scrollHintDir = SCROLL_LEFT
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+
+ folder.onDragExit(dragObject)
+
+ verify(folder.mContent, times(1)).clearScrollHint()
+ assertEquals(folder.scrollHintDir, SCROLL_NONE)
+ }
+
+ @Test
+ fun `onDragExit we should cancel reorder pause and hint alarms`() {
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ val dragObject = Mockito.mock(DragObject::class.java)
+ folder.scrollHintDir = SCROLL_NONE
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ folder.reorderAlarm = Mockito.mock(Alarm::class.java)
+ folder.onScrollHintAlarm = Mockito.mock(Alarm::class.java)
+ folder.scrollPauseAlarm = Mockito.mock(Alarm::class.java)
+
+ folder.onDragExit(dragObject)
+
+ verify(folder.reorderAlarm, times(1)).cancelAlarm()
+ verify(folder.onScrollHintAlarm, times(1)).cancelAlarm()
+ verify(folder.scrollPauseAlarm, times(1)).cancelAlarm()
+ assertEquals(folder.scrollHintDir, SCROLL_NONE)
+ }
+
+ @Test
+ fun `when calling prepareAccessibilityDrop we should cancel pending reorder alarm and call onAlarm`() {
+ folder.reorderAlarm = Mockito.mock(Alarm::class.java)
+ folder.mReorderAlarmListener = Mockito.mock(OnAlarmListener::class.java)
+ `when`(folder.reorderAlarm.alarmPending()).thenReturn(true)
+
+ folder.prepareAccessibilityDrop()
+
+ verify(folder.reorderAlarm, times(1)).cancelAlarm()
+ verify(folder.mReorderAlarmListener, times(1)).onAlarm(folder.reorderAlarm)
+ }
+
+ @Test
+ fun `when calling prepareAccessibilityDrop we should not do anything if there is no pending alarm`() {
+ folder.reorderAlarm = Mockito.mock(Alarm::class.java)
+ folder.mReorderAlarmListener = Mockito.mock(OnAlarmListener::class.java)
+ `when`(folder.reorderAlarm.alarmPending()).thenReturn(false)
+
+ folder.prepareAccessibilityDrop()
+
+ verify(folder.reorderAlarm, times(0)).cancelAlarm()
+ verify(folder.mReorderAlarmListener, times(0)).onAlarm(folder.reorderAlarm)
+ }
+
+ @Test
+ fun `isDropEnabled should be true as long as state is not STATE_ANIMATING`() {
+ folder.state = STATE_CLOSED
+
+ val isDropEnabled = folder.isDropEnabled
+
+ assertTrue(isDropEnabled)
+ }
+
+ @Test
+ fun `isDropEnabled should be false if state is STATE_ANIMATING`() {
+ folder.state = STATE_ANIMATING
+
+ val isDropEnabled = folder.isDropEnabled
+
+ assertFalse(isDropEnabled)
+ }
+
+ @Test
+ fun `getItemCount should return the number of items in the folder`() {
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = folderInfo
+
+ val itemCount = folder.itemCount
+
+ assertEquals(itemCount, 2)
+ }
+
+ @Test
+ fun `hideItem should set the visibility of the corresponding ItemInfo to invisible`() {
+ val itemInfo = ItemInfo()
+ val view = View(context)
+ view.isVisible = true
+ doReturn(view).whenever(folder).getViewForInfo(itemInfo)
+
+ folder.hideItem(itemInfo)
+
+ assertFalse(view.isVisible)
+ }
+
+ @Test
+ fun `showItem should set the visibility of the corresponding ItemInfo to visible`() {
+ val itemInfo = ItemInfo()
+ val view = View(context)
+ view.isVisible = false
+ doReturn(view).whenever(folder).getViewForInfo(itemInfo)
+
+ folder.showItem(itemInfo)
+
+ assertTrue(view.isVisible)
+ }
+
+ @Test
+ fun `onDragEnter should cancel exit alarm and set the scroll area offset to dragRegionWidth divided by two minus xOffset`() {
+ folder.mPrevTargetRank = 1
+ val dragObject = Mockito.mock(DragObject::class.java)
+ val dragView = Mockito.mock(DragView::class.java)
+ dragObject.dragView = dragView
+ folder.onExitAlarm = Mockito.mock(Alarm::class.java)
+ `when`(dragObject.dragView.getDragRegionWidth()).thenReturn(100)
+ dragObject.xOffset = 20
+
+ folder.onDragEnter(dragObject)
+
+ verify(folder.onExitAlarm, times(1)).cancelAlarm()
+ assertEquals(-1, folder.mPrevTargetRank)
+ assertEquals(30, folder.scrollAreaOffset)
+ }
+
+ @Test
+ fun `acceptDrop should return true with the correct item type as a parameter`() {
+ val dragObject = Mockito.mock(DragObject::class.java)
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_APP_PAIR
+ dragObject.dragInfo = itemInfo
+
+ val result = folder.acceptDrop(dragObject)
+
+ assertTrue(result)
+ }
+
+ @Test
+ fun `acceptDrop should return false with the incorrect item type as a parameter`() {
+ val dragObject = Mockito.mock(DragObject::class.java)
+ val itemInfo = Mockito.mock(ItemInfo::class.java)
+ itemInfo.itemType = ITEM_TYPE_APPWIDGET
+ dragObject.dragInfo = itemInfo
+
+ val result = folder.acceptDrop(dragObject)
+
+ assertFalse(result)
+ }
+
+ @Test
+ fun `rearrangeChildren should return early if content view are not bound`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ folder.itemsInvalidated = false
+ doReturn(false).whenever(folder.mContent).areViewsBound()
+
+ folder.rearrangeChildren()
+
+ verify(folder.mContent, times(0)).arrangeChildren(folder.iconsInReadingOrder)
+ assertFalse(folder.itemsInvalidated)
+ }
+
+ @Test
+ fun `rearrangeChildren should call arrange children and invalidate items`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ folder.itemsInvalidated = false
+ doReturn(true).whenever(folder.mContent).areViewsBound()
+ val iconsInReadingOrderList = ArrayList<View>()
+ `when`(folder.iconsInReadingOrder).thenReturn(iconsInReadingOrderList)
+ doNothing().`when`(folder.mContent).arrangeChildren(iconsInReadingOrderList)
+
+ folder.rearrangeChildren()
+
+ verify(folder.mContent, times(1)).arrangeChildren(folder.iconsInReadingOrder)
+ assertTrue(folder.itemsInvalidated)
+ }
+
+ @Test
+ fun `getItemCount should return the size of info getContents size`() {
+ val folderInfo =
+ workspaceBuilder.createFolderInCell(FolderPoint(Point(1, 0), TWO_ICON_FOLDER_TYPE), 0)
+ folder.mInfo = folderInfo
+
+ val itemCount = folder.itemCount
+
+ assertEquals(2, itemCount)
+ }
+
+ @Test
+ fun `replaceFolderWithFinalItem should set mDestroyed to true if we replace folder with final item`() {
+ val launcherDelegate = Mockito.mock(LauncherDelegate::class.java)
+ folder.mLauncherDelegate = launcherDelegate
+ `when`(folder.mLauncherDelegate.replaceFolderWithFinalItem(folder)).thenReturn(true)
+
+ folder.replaceFolderWithFinalItem()
+
+ assertTrue(folder.isDestroyed)
+ }
+
+ @Test
+ fun `replaceFolderWithFinalItem should set mDestroyed to false if we do not replace folder with final item`() {
+ val launcherDelegate = Mockito.mock(LauncherDelegate::class.java)
+ folder.mLauncherDelegate = launcherDelegate
+ `when`(folder.mLauncherDelegate.replaceFolderWithFinalItem(folder)).thenReturn(false)
+
+ folder.replaceFolderWithFinalItem()
+
+ assertFalse(folder.isDestroyed)
+ }
+
+ @Test
+ fun `getContentAreaHeight should return maxContentAreaHeight`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredHeight).thenReturn(100)
+ `when`(folder.maxContentAreaHeight).thenReturn(50)
+
+ val height = folder.contentAreaHeight
+
+ assertEquals(50, height)
+ }
+
+ @Test
+ fun `getContentAreaHeight should return desiredHeight`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredHeight).thenReturn(50)
+ `when`(folder.maxContentAreaHeight).thenReturn(100)
+
+ val height = folder.contentAreaHeight
+
+ assertEquals(50, height)
+ }
+
+ @Test
+ fun `getContentAreaHeight should return MIN_CONTENT_DIMEN`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredHeight).thenReturn(1)
+ `when`(folder.maxContentAreaHeight).thenReturn(2)
+
+ val height = folder.contentAreaHeight
+
+ assertEquals(MIN_CONTENT_DIMEN, height)
+ }
+
+ @Test
+ fun `getContentAreaWidth should return desired width`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredWidth).thenReturn(50)
+
+ val width = folder.contentAreaWidth
+
+ assertEquals(50, width)
+ }
+
+ @Test
+ fun `getContentAreaWidth should return MIN_CONTENT_DIMEN`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredWidth).thenReturn(1)
+
+ val width = folder.contentAreaWidth
+
+ assertEquals(MIN_CONTENT_DIMEN, width)
+ }
+
+ @Test
+ fun `getFolderWidth should return padding left plus padding right plus desired width`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.mContent.desiredWidth).thenReturn(1)
+ `when`(folder.paddingLeft).thenReturn(10)
+ `when`(folder.paddingRight).thenReturn(10)
+
+ val width = folder.folderWidth
+
+ assertEquals(21, width)
+ }
+
+ @Test
+ fun `getFolderHeight with no params should return getFolderHeight`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.contentAreaHeight).thenReturn(100)
+ `when`(folder.getFolderHeight(folder.contentAreaHeight)).thenReturn(120)
+
+ val height = folder.folderHeight
+
+ assertEquals(120, height)
+ }
+
+ @Test
+ fun `getFolderWidth with contentAreaHeight should return padding top plus padding bottom plus contentAreaHeight plus footer height`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ `when`(folder.footerHeight).thenReturn(100)
+ `when`(folder.paddingTop).thenReturn(10)
+ `when`(folder.paddingBottom).thenReturn(10)
+
+ val height = folder.getFolderHeight(100)
+
+ assertEquals(220, height)
+ }
+
+ @Test
+ fun `onRemove should call removeItem with the correct views`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val items =
+ arrayListOf<ItemInfo>(
+ Mockito.mock(ItemInfo::class.java),
+ Mockito.mock(ItemInfo::class.java)
+ )
+ val view1 = Mockito.mock(View::class.java)
+ val view2 = Mockito.mock(View::class.java)
+ doReturn(view1).whenever(folder).getViewForInfo(items[0])
+ doReturn(view2).whenever(folder).getViewForInfo(items[1])
+ doReturn(2).whenever(folder).itemCount
+
+ folder.onRemove(items)
+
+ verify(folder.mContent, times(1)).removeItem(view1)
+ verify(folder.mContent, times(1)).removeItem(view2)
+ }
+
+ @Test
+ fun `onRemove should set mRearrangeOnClose to true and not call rearrangeChildren if animating`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ folder.state = STATE_ANIMATING
+ val items =
+ arrayListOf<ItemInfo>(
+ Mockito.mock(ItemInfo::class.java),
+ Mockito.mock(ItemInfo::class.java)
+ )
+ val view1 = Mockito.mock(View::class.java)
+ val view2 = Mockito.mock(View::class.java)
+ doReturn(view1).whenever(folder).getViewForInfo(items[0])
+ doReturn(view2).whenever(folder).getViewForInfo(items[1])
+ doReturn(2).whenever(folder).itemCount
+
+ folder.onRemove(items)
+
+ assertTrue(folder.rearrangeOnClose)
+ verify(folder, times(0)).rearrangeChildren()
+ }
+
+ @Test
+ fun `onRemove should set not change mRearrangeOnClose and not call rearrangeChildren if not animating`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ folder.state = STATE_CLOSED
+ folder.rearrangeOnClose = false
+ val items =
+ arrayListOf<ItemInfo>(
+ Mockito.mock(ItemInfo::class.java),
+ Mockito.mock(ItemInfo::class.java)
+ )
+ val view1 = Mockito.mock(View::class.java)
+ val view2 = Mockito.mock(View::class.java)
+ doReturn(view1).whenever(folder).getViewForInfo(items[0])
+ doReturn(view2).whenever(folder).getViewForInfo(items[1])
+ doReturn(2).whenever(folder).itemCount
+
+ folder.onRemove(items)
+
+ assertFalse(folder.rearrangeOnClose)
+ verify(folder, times(1)).rearrangeChildren()
+ }
+
+ @Test
+ fun `onRemove should call close if mIsOpen is true and item count is less than or equal to one`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val items =
+ arrayListOf<ItemInfo>(
+ Mockito.mock(ItemInfo::class.java),
+ Mockito.mock(ItemInfo::class.java)
+ )
+ val view1 = Mockito.mock(View::class.java)
+ val view2 = Mockito.mock(View::class.java)
+ doReturn(view1).whenever(folder).getViewForInfo(items[0])
+ doReturn(view2).whenever(folder).getViewForInfo(items[1])
+ doReturn(1).whenever(folder).itemCount
+ folder.setIsOpen(true)
+ doNothing().`when`(folder).close(true)
+
+ folder.onRemove(items)
+
+ verify(folder, times(1)).close(true)
+ }
+
+ @Test
+ fun `onRemove should call replaceFolderWithFinalItem if mIsOpen is false and item count is less than or equal to one`() {
+ folder.mContent = Mockito.mock(FolderPagedView::class.java)
+ val items =
+ arrayListOf<ItemInfo>(
+ Mockito.mock(ItemInfo::class.java),
+ Mockito.mock(ItemInfo::class.java)
+ )
+ val view1 = Mockito.mock(View::class.java)
+ val view2 = Mockito.mock(View::class.java)
+ doReturn(view1).whenever(folder).getViewForInfo(items[0])
+ doReturn(view2).whenever(folder).getViewForInfo(items[1])
+ doReturn(1).whenever(folder).itemCount
+ folder.setIsOpen(false)
+
+ folder.onRemove(items)
+
+ verify(folder, times(1)).replaceFolderWithFinalItem()
+ }
+
+ companion object {
+ const val TWO_ICON_FOLDER_TYPE = 'A'
+ }
+}
diff --git a/tests/src/com/android/launcher3/folder/PreviewBackgroundTest.java b/tests/multivalentTests/src/com/android/launcher3/folder/PreviewBackgroundTest.java
similarity index 98%
rename from tests/src/com/android/launcher3/folder/PreviewBackgroundTest.java
rename to tests/multivalentTests/src/com/android/launcher3/folder/PreviewBackgroundTest.java
index 7242e9c..b9b7d6a 100644
--- a/tests/src/com/android/launcher3/folder/PreviewBackgroundTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/folder/PreviewBackgroundTest.java
@@ -24,15 +24,15 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import android.testing.AndroidTestingRunner;
-import android.testing.TestableLooper;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.PathInterpolator;
+import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.launcher3.CellLayout;
+import com.android.launcher3.util.LauncherMultivalentJUnit;
import org.junit.Before;
import org.junit.Test;
@@ -41,8 +41,8 @@
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
-@TestableLooper.RunWithLooper(setAsMainLooper = true)
+@UiThreadTest
+@RunWith(LauncherMultivalentJUnit.class)
public class PreviewBackgroundTest {
private static final float REST_SCALE = 1f;
diff --git a/tests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt b/tests/multivalentTests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt
similarity index 75%
rename from tests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt
index da14425..d236551 100644
--- a/tests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/folder/PreviewItemManagerTest.kt
@@ -23,20 +23,29 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
-import com.android.launcher3.LauncherPrefs
+import com.android.launcher3.LauncherPrefs.Companion.THEMED_ICONS
import com.android.launcher3.LauncherPrefs.Companion.get
+import com.android.launcher3.graphics.PreloadIconDrawable
import com.android.launcher3.icons.BaseIconFactory
import com.android.launcher3.icons.FastBitmapDrawable
import com.android.launcher3.icons.UserBadgeDrawable
+import com.android.launcher3.model.ModelTestRule
import com.android.launcher3.model.data.FolderInfo
import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED
+import com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE
+import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.Executors
import com.android.launcher3.util.FlagOp
import com.android.launcher3.util.LauncherLayoutBuilder
import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.TestUtil
import com.android.launcher3.util.UserIconInfo
+import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -45,12 +54,16 @@
@RunWith(AndroidJUnit4::class)
class PreviewItemManagerTest {
+ @get:Rule val modelTestRule = ModelTestRule()
+
private lateinit var previewItemManager: PreviewItemManager
private lateinit var context: Context
private lateinit var folderItems: ArrayList<ItemInfo>
private lateinit var modelHelper: LauncherModelHelper
private lateinit var folderIcon: FolderIcon
+ private var defaultThemedIcons = false
+
@Before
fun setup() {
getInstrumentation().runOnMainSync {
@@ -127,16 +140,20 @@
previewItemManager.mIconSize
)
)
+
+ defaultThemedIcons = get(context).get(THEMED_ICONS)
}
+
@After
@Throws(Exception::class)
fun tearDown() {
+ get(context).put(THEMED_ICONS, defaultThemedIcons)
modelHelper.destroy()
}
@Test
fun checkThemedIconWithThemingOn_iconShouldBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, true)
+ get(context).put(THEMED_ICONS, true)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[0])
@@ -146,7 +163,7 @@
@Test
fun checkThemedIconWithThemingOff_iconShouldNotBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, false)
+ get(context).put(THEMED_ICONS, false)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[0])
@@ -156,7 +173,7 @@
@Test
fun checkUnthemedIconWithThemingOn_iconShouldNotBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, true)
+ get(context).put(THEMED_ICONS, true)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[1])
@@ -166,7 +183,7 @@
@Test
fun checkUnthemedIconWithThemingOff_iconShouldNotBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, false)
+ get(context).put(THEMED_ICONS, false)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[1])
@@ -176,7 +193,7 @@
@Test
fun checkThemedIconWithBadgeWithThemingOn_iconAndBadgeShouldBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, true)
+ get(context).put(THEMED_ICONS, true)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[2])
@@ -189,7 +206,7 @@
@Test
fun checkUnthemedIconWithBadgeWithThemingOn_badgeShouldBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, true)
+ get(context).put(THEMED_ICONS, true)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[3])
@@ -202,7 +219,7 @@
@Test
fun checkUnthemedIconWithBadgeWithThemingOff_iconAndBadgeShouldNotBeThemed() {
- get(context).put(LauncherPrefs.THEMED_ICONS, false)
+ get(context).put(THEMED_ICONS, false)
val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
previewItemManager.setDrawable(drawingParams, folderItems[3])
@@ -213,6 +230,39 @@
)
}
+ @Test
+ fun `Inactive archived app previews are not drawn as preload icon`() {
+ // Given
+ val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
+ val archivedApp =
+ WorkspaceItemInfo().apply {
+ runtimeStatusFlags = runtimeStatusFlags or FLAG_ARCHIVED
+ runtimeStatusFlags = runtimeStatusFlags and FLAG_INSTALL_SESSION_ACTIVE.inv()
+ }
+ // When
+ previewItemManager.setDrawable(drawingParams, archivedApp)
+ // Then
+ assertThat(drawingParams.drawable).isNotInstanceOf(PreloadIconDrawable::class.java)
+ }
+
+ @Test
+ fun `Actively installing archived app previews are drawn as preload icon`() {
+ // Given
+ val drawingParams = PreviewItemDrawingParams(0f, 0f, 0f)
+ val archivedApp =
+ WorkspaceItemInfo().apply {
+ runtimeStatusFlags = runtimeStatusFlags or FLAG_ARCHIVED
+ runtimeStatusFlags = runtimeStatusFlags or FLAG_INSTALL_SESSION_ACTIVE
+ }
+ // When
+ TestUtil.runOnExecutorSync(Executors.MAIN_EXECUTOR) {
+ // Run on main thread because preload drawable triggers animator
+ previewItemManager.setDrawable(drawingParams, archivedApp)
+ }
+ // Then
+ assertThat(drawingParams.drawable).isInstanceOf(PreloadIconDrawable::class.java)
+ }
+
private fun profileFlagOp(type: Int) =
UserIconInfo(Process.myUserHandle(), type).applyBitmapInfoFlags(FlagOp.NO_OP)
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java b/tests/multivalentTests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
index 7e9b68d..58dce0b 100644
--- a/tests/multivalentTests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
@@ -37,15 +37,12 @@
import android.view.animation.PathInterpolator;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import com.android.launcher3.util.rule.RobolectricUiThreadRule;
+import com.android.launcher3.util.LauncherMultivalentJUnit;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -55,14 +52,11 @@
* Tests for FastBitmapDrawable.
*/
@SmallTest
-@RunWith(AndroidJUnit4.class)
+@RunWith(LauncherMultivalentJUnit.class)
@UiThreadTest
public class FastBitmapDrawableTest {
private static final float EPSILON = 0.00001f;
- @Rule
- public final TestRule roboUiThreadRule = new RobolectricUiThreadRule();
-
@Spy
FastBitmapDrawable mFastBitmapDrawable =
spy(new FastBitmapDrawable(Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888)));
diff --git a/tests/src/com/android/launcher3/icons/IconCacheTest.java b/tests/multivalentTests/src/com/android/launcher3/icons/IconCacheTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/icons/IconCacheTest.java
rename to tests/multivalentTests/src/com/android/launcher3/icons/IconCacheTest.java
diff --git a/tests/multivalentTests/src/com/android/launcher3/icons/IconCacheUpdateHandlerTest.kt b/tests/multivalentTests/src/com/android/launcher3/icons/IconCacheUpdateHandlerTest.kt
new file mode 100644
index 0000000..e27926f
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/icons/IconCacheUpdateHandlerTest.kt
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.icons
+
+import android.content.ComponentName
+import android.content.pm.PackageInfo
+import android.database.Cursor
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.icons.cache.BaseIconCache
+import com.android.launcher3.icons.cache.CachingLogic
+import com.android.launcher3.icons.cache.IconCacheUpdateHandler
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.doReturn
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class IconCacheUpdateHandlerTest {
+
+ @Mock private lateinit var cursor: Cursor
+ @Mock private lateinit var user: UserHandle
+ @Mock private lateinit var cachingLogic: CachingLogic<String>
+ @Mock private lateinit var baseIconCache: BaseIconCache
+
+ private var componentMap: HashMap<ComponentName, String> = hashMapOf()
+ private var ignorePackages: Set<String> = setOf()
+ private var packageInfoMap: HashMap<String, PackageInfo> = hashMapOf()
+
+ private val dummyRowData =
+ IconCacheRowData(
+ "com.android.fake/.FakeActivity",
+ System.currentTimeMillis(),
+ 1,
+ 1.0.toLong(),
+ "stateOfConfusion"
+ )
+
+ @Before
+ fun setup() {
+
+ MockitoAnnotations.initMocks(this)
+ // Load in a specific row to the database
+ doReturn(0).`when`(cursor).getColumnIndex(BaseIconCache.IconDB.COLUMN_COMPONENT)
+ doReturn(1).`when`(cursor).getColumnIndex(BaseIconCache.IconDB.COLUMN_LAST_UPDATED)
+ doReturn(2).`when`(cursor).getColumnIndex(BaseIconCache.IconDB.COLUMN_VERSION)
+ doReturn(3).`when`(cursor).getColumnIndex(BaseIconCache.IconDB.COLUMN_ROWID)
+ doReturn(4).`when`(cursor).getColumnIndex(BaseIconCache.IconDB.COLUMN_SYSTEM_STATE)
+ doReturn(dummyRowData.component).`when`(cursor).getString(0)
+ doReturn(dummyRowData.lastUpdated).`when`(cursor).getLong(1)
+ doReturn(dummyRowData.version).`when`(cursor).getInt(2)
+ doReturn(dummyRowData.row).`when`(cursor).getLong(3)
+ doReturn(dummyRowData.systemState).`when`(cursor).getString(4)
+ }
+
+ @Test
+ fun `IconCacheUpdateHandler returns null if the component name is malformed`() {
+ val updateHandlerUnderTest = IconCacheUpdateHandler(packageInfoMap, baseIconCache)
+
+ val result =
+ updateHandlerUnderTest.updateOrDeleteIcon(
+ cursor,
+ componentMap,
+ ignorePackages,
+ user,
+ cachingLogic
+ )
+
+ assert(result == null)
+ }
+}
+
+data class IconCacheRowData(
+ val component: String,
+ val lastUpdated: Long,
+ val version: Int,
+ val row: Long,
+ val systemState: String
+)
diff --git a/tests/multivalentTests/src/com/android/launcher3/icons/UserBadgeDrawableTest.kt b/tests/multivalentTests/src/com/android/launcher3/icons/UserBadgeDrawableTest.kt
new file mode 100644
index 0000000..d611ae8
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/icons/UserBadgeDrawableTest.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.icons
+
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.Paint
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.icons.UserBadgeDrawable.SHADOW_COLOR
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/** Test for [UserBadgeDrawable] */
+@RunWith(AndroidJUnit4::class)
+class UserBadgeDrawableTest {
+ private val context = InstrumentationRegistry.getInstrumentation().targetContext
+ private val canvas = mock<Canvas>()
+ private val systemUnderTest =
+ UserBadgeDrawable(context, R.drawable.ic_work_app_badge, R.color.badge_tint_work, false)
+
+ @Test
+ fun draw_opaque() {
+ val colorList = mutableListOf<Int>()
+ whenever(
+ canvas.drawCircle(
+ any(),
+ any(),
+ any(),
+ any()
+ )
+ ).then { colorList.add(it.getArgument<Paint>(3).color) }
+
+ systemUnderTest.alpha = 255
+ systemUnderTest.draw(canvas)
+
+ assertThat(colorList).containsExactly(SHADOW_COLOR, Color.WHITE)
+ }
+
+ @Test
+ fun draw_transparent() {
+ val colorList = mutableListOf<Int>()
+ whenever(
+ canvas.drawCircle(
+ any(),
+ any(),
+ any(),
+ any()
+ )
+ ).then { colorList.add(it.getArgument<Paint>(3).color) }
+
+ systemUnderTest.alpha = 0
+ systemUnderTest.draw(canvas)
+
+ assertThat(colorList).hasSize(2)
+ assertThat(Color.valueOf(colorList[0]).alpha()).isEqualTo(0)
+ assertThat(Color.valueOf(colorList[1]).alpha()).isEqualTo(0)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/logging/StartupLatencyLoggerTest.kt b/tests/multivalentTests/src/com/android/launcher3/logging/StartupLatencyLoggerTest.kt
index 12f6c8c..713d4d5 100644
--- a/tests/multivalentTests/src/com/android/launcher3/logging/StartupLatencyLoggerTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/logging/StartupLatencyLoggerTest.kt
@@ -2,22 +2,18 @@
import androidx.core.util.isEmpty
import androidx.test.annotation.UiThreadTest
-import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import com.android.launcher3.util.rule.RobolectricUiThreadRule
+import com.android.launcher3.util.LauncherMultivalentJUnit
import com.google.common.truth.Truth.assertThat
import org.junit.Before
-import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
/** Unit test for [ColdRebootStartupLatencyLogger]. */
@SmallTest
-@RunWith(AndroidJUnit4::class)
+@RunWith(LauncherMultivalentJUnit::class)
class StartupLatencyLoggerTest {
- @get:Rule val roboUiThreadRule = RobolectricUiThreadRule()
-
private val underTest = ColdRebootStartupLatencyLogger()
@Before
diff --git a/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt
similarity index 97%
rename from tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt
index 78c61d5..43dc36b 100644
--- a/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.kt
@@ -27,6 +27,7 @@
import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.times
@@ -35,7 +36,7 @@
import org.mockito.kotlin.mock
import org.mockito.kotlin.same
import org.mockito.kotlin.verify
-import org.mockito.kotlin.verifyZeroInteractions
+import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.whenever
/** Tests for [AddWorkspaceItemsTask] */
@@ -43,6 +44,8 @@
@RunWith(AndroidJUnit4::class)
class AddWorkspaceItemsTaskTest : AbstractWorkspaceModelTest() {
+ @get:Rule val modelTestRule = ModelTestRule()
+
private lateinit var mDataModelCallbacks: MyCallbacks
private val mWorkspaceItemSpaceFinder: WorkspaceItemSpaceFinder = mock()
@@ -97,7 +100,8 @@
val addedItems = testAddItems(nonEmptyScreenIds, itemToAdd)
assertThat(addedItems.size).isEqualTo(0)
- verifyZeroInteractions(mWorkspaceItemSpaceFinder)
+ // b/343530737
+ verifyNoMoreInteractions(mWorkspaceItemSpaceFinder)
}
@Test
diff --git a/tests/src/com/android/launcher3/model/AsyncBindingTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/AsyncBindingTest.kt
similarity index 99%
rename from tests/src/com/android/launcher3/model/AsyncBindingTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/AsyncBindingTest.kt
index af367a8..dce75b9 100644
--- a/tests/src/com/android/launcher3/model/AsyncBindingTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/AsyncBindingTest.kt
@@ -64,6 +64,8 @@
@get:Rule val setFlagsRule = SetFlagsRule()
+ @get:Rule val modelTestRule = ModelTestRule()
+
@Spy private var callbacks = MyCallbacks()
@Mock private lateinit var itemInflater: ItemInflater<*>
diff --git a/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java b/tests/multivalentTests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
similarity index 84%
rename from tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
rename to tests/multivalentTests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
index 328558d..535080a 100644
--- a/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.launcher3.model;
import static android.os.Process.myUserHandle;
@@ -11,10 +26,13 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import android.content.Context;
+import android.content.pm.PackageInstaller;
+import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -49,6 +67,9 @@
@Rule(order = 0)
public TestRule testStabilityRule = new TestStabilityRule();
+ @Rule(order = 1)
+ public ModelTestRule mModelTestRule = new ModelTestRule();
+
private static final String PENDING_APP_1 = TEST_PACKAGE + ".pending1";
private static final String PENDING_APP_2 = TEST_PACKAGE + ".pending2";
@@ -128,10 +149,13 @@
@Test
public void testSessionUpdate_updates_pending_apps() {
// Run on model executor so that no other task runs in the middle.
+ PackageInstaller.SessionInfo sessionInfo = ApplicationProvider.getApplicationContext()
+ .getPackageManager().getPackageInstaller().getSessionInfo(mSession1);
+ assertNotNull(sessionInfo);
runOnExecutorSync(MODEL_EXECUTOR, () -> {
LauncherAppState.getInstance(mContext).getIconCache().updateSessionCache(
new PackageUserKey(PENDING_APP_1, myUserHandle()),
- mContext.getPackageManager().getPackageInstaller().getSessionInfo(mSession1));
+ sessionInfo);
// Clear all icons from apps list so that its easy to check what was updated
allItems().forEach(wi -> wi.bitmap = BitmapInfo.LOW_RES_INFO);
diff --git a/tests/src/com/android/launcher3/model/DatabaseHelperTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/DatabaseHelperTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/model/DatabaseHelperTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/DatabaseHelperTest.kt
diff --git a/tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java b/tests/multivalentTests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
rename to tests/multivalentTests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
diff --git a/tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java b/tests/multivalentTests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
similarity index 93%
rename from tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
rename to tests/multivalentTests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
index 10785f7..e14e145 100644
--- a/tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
@@ -22,11 +22,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeTrue;
-import android.content.Context;
import android.content.pm.LauncherApps;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionParams;
+import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -39,6 +39,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -49,8 +50,10 @@
@RunWith(AndroidJUnit4.class)
public class DefaultLayoutProviderTest {
+ @Rule public ModelTestRule rule = new ModelTestRule();
+
private LauncherModelHelper mModelHelper;
- private Context mTargetContext;
+ private LauncherModelHelper.SandboxModelContext mTargetContext;
@Before
public void setUp() {
@@ -114,8 +117,10 @@
SessionParams params = new SessionParams(SessionParams.MODE_FULL_INSTALL);
params.setAppPackageName(pendingAppPkg);
params.setAppIcon(BitmapInfo.LOW_RES_ICON);
+ params.installerPackageName = ApplicationProvider.getApplicationContext().getPackageName();
- PackageInstaller installer = mTargetContext.getPackageManager().getPackageInstaller();
+ PackageInstaller installer = ApplicationProvider.getApplicationContext().getPackageManager()
+ .getPackageInstaller();
installer.createSession(params);
writeLayoutAndLoad(new LauncherLayoutBuilder().atWorkspace(0, 1, 0)
diff --git a/tests/multivalentTests/src/com/android/launcher3/model/FirstScreenBroadcastHelperTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/FirstScreenBroadcastHelperTest.kt
new file mode 100644
index 0000000..d2d9512
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/model/FirstScreenBroadcastHelperTest.kt
@@ -0,0 +1,393 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import android.app.PendingIntent
+import android.content.ComponentName
+import android.content.Intent
+import android.content.pm.PackageInstaller.SessionInfo
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
+import com.android.launcher3.model.FirstScreenBroadcastHelper.MAX_BROADCAST_SIZE
+import com.android.launcher3.model.FirstScreenBroadcastHelper.getTotalItemCount
+import com.android.launcher3.model.FirstScreenBroadcastHelper.truncateModelForBroadcast
+import com.android.launcher3.model.data.FolderInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.util.PackageManagerHelper
+import com.android.launcher3.util.PackageUserKey
+import junit.framework.Assert.assertEquals
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@RunWith(AndroidJUnit4::class)
+class FirstScreenBroadcastHelperTest {
+
+ @get:Rule val modelTestRule = ModelTestRule()
+
+ private val context = spy(InstrumentationRegistry.getInstrumentation().targetContext)
+ private val mockPmHelper = mock<PackageManagerHelper>()
+ private val expectedAppPackage = "appPackageExpected"
+ private val expectedComponentName = ComponentName(expectedAppPackage, "expectedClass")
+ private val expectedInstallerPackage = "installerPackage"
+ private val expectedIntent =
+ Intent().apply {
+ component = expectedComponentName
+ setPackage(expectedAppPackage)
+ }
+ private val unexpectedAppPackage = "appPackageUnexpected"
+ private val unexpectedComponentName = ComponentName(expectedAppPackage, "unexpectedClass")
+ private val firstScreenItems =
+ listOf(
+ WorkspaceItemInfo().apply {
+ container = CONTAINER_DESKTOP
+ intent = expectedIntent
+ },
+ WorkspaceItemInfo().apply {
+ container = CONTAINER_HOTSEAT
+ intent = expectedIntent
+ },
+ LauncherAppWidgetInfo().apply { providerName = expectedComponentName }
+ )
+
+ @Test
+ fun `Broadcast Models are created with Pending Items from first screen`() {
+ // Given
+ val sessionInfoExpected =
+ SessionInfo().apply {
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ }
+ val sessionInfoUnexpected =
+ SessionInfo().apply {
+ installerPackageName = expectedInstallerPackage
+ appPackageName = unexpectedAppPackage
+ }
+ val sessionInfoMap: HashMap<PackageUserKey, SessionInfo> =
+ hashMapOf(
+ PackageUserKey(unexpectedAppPackage, UserHandle(0)) to sessionInfoExpected,
+ PackageUserKey(expectedAppPackage, UserHandle(0)) to sessionInfoUnexpected
+ )
+
+ // When
+ val actualResult =
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ packageManagerHelper = mockPmHelper,
+ firstScreenItems = firstScreenItems,
+ userKeyToSessionMap = sessionInfoMap,
+ allWidgets = listOf()
+ )
+
+ // Then
+ val expectedResult =
+ listOf(
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ pendingWorkspaceItems = mutableSetOf(expectedAppPackage),
+ pendingHotseatItems = mutableSetOf(expectedAppPackage),
+ pendingWidgetItems = mutableSetOf(expectedAppPackage)
+ )
+ )
+
+ assertEquals(expectedResult, actualResult)
+ }
+
+ @Test
+ fun `Broadcast Models are created with Installed Items from first screen`() {
+ // Given
+ whenever(mockPmHelper.getAppInstallerPackage(expectedAppPackage))
+ .thenReturn(expectedInstallerPackage)
+
+ // When
+ val actualResult =
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ packageManagerHelper = mockPmHelper,
+ firstScreenItems = firstScreenItems,
+ userKeyToSessionMap = hashMapOf(),
+ allWidgets =
+ listOf(
+ LauncherAppWidgetInfo().apply {
+ providerName = expectedComponentName
+ screenId = 0
+ }
+ )
+ )
+
+ // Then
+ val expectedResult =
+ listOf(
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ installedHotseatItems = mutableSetOf(expectedAppPackage),
+ installedWorkspaceItems = mutableSetOf(expectedAppPackage),
+ firstScreenInstalledWidgets = mutableSetOf(expectedAppPackage)
+ )
+ )
+ assertEquals(expectedResult, actualResult)
+ }
+
+ @Test
+ fun `Broadcast Models are created with Installed Widgets from every screen`() {
+ // Given
+ val expectedAppPackage2 = "appPackageExpected2"
+ val expectedComponentName2 = ComponentName(expectedAppPackage2, "expectedClass2")
+ whenever(mockPmHelper.getAppInstallerPackage(expectedAppPackage))
+ .thenReturn(expectedInstallerPackage)
+ whenever(mockPmHelper.getAppInstallerPackage(expectedAppPackage2))
+ .thenReturn(expectedInstallerPackage)
+
+ // When
+ val actualResult =
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ packageManagerHelper = mockPmHelper,
+ firstScreenItems = listOf(),
+ userKeyToSessionMap = hashMapOf(),
+ allWidgets =
+ listOf(
+ LauncherAppWidgetInfo().apply {
+ providerName = expectedComponentName
+ screenId = 0
+ },
+ LauncherAppWidgetInfo().apply {
+ providerName = expectedComponentName2
+ screenId = 1
+ },
+ LauncherAppWidgetInfo().apply {
+ providerName = unexpectedComponentName
+ screenId = 0
+ }
+ )
+ )
+
+ // Then
+ val expectedResult =
+ listOf(
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ installedHotseatItems = mutableSetOf(),
+ installedWorkspaceItems = mutableSetOf(),
+ firstScreenInstalledWidgets = mutableSetOf(expectedAppPackage),
+ secondaryScreenInstalledWidgets = mutableSetOf(expectedAppPackage2)
+ )
+ )
+ assertEquals(expectedResult, actualResult)
+ }
+
+ @Test
+ fun `Broadcast Models are created with Pending Items in Collections from the first screen`() {
+ // Given
+ val sessionInfoExpected =
+ SessionInfo().apply {
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ }
+ val sessionInfoUnexpected =
+ SessionInfo().apply {
+ installerPackageName = expectedInstallerPackage
+ appPackageName = unexpectedAppPackage
+ }
+ val sessionInfoMap: HashMap<PackageUserKey, SessionInfo> =
+ hashMapOf(
+ PackageUserKey(unexpectedAppPackage, UserHandle(0)) to sessionInfoExpected,
+ PackageUserKey(expectedAppPackage, UserHandle(0)) to sessionInfoUnexpected,
+ )
+ val expectedItemInfo = WorkspaceItemInfo().apply { intent = expectedIntent }
+ val expectedFolderInfo = FolderInfo().apply { add(expectedItemInfo) }
+ val firstScreenItems = listOf(expectedFolderInfo)
+
+ // When
+ val actualResult =
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ packageManagerHelper = mockPmHelper,
+ firstScreenItems = firstScreenItems,
+ userKeyToSessionMap = sessionInfoMap,
+ allWidgets = listOf()
+ )
+
+ // Then
+ val expectedResult =
+ listOf(
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ pendingCollectionItems = mutableSetOf(expectedAppPackage)
+ )
+ )
+ assertEquals(expectedResult, actualResult)
+ }
+
+ @Test
+ fun `Models with too many items get truncated to max Broadcast size`() {
+ // given
+ val broadcastModel =
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ pendingCollectionItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ pendingWorkspaceItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ pendingHotseatItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ pendingWidgetItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ installedWorkspaceItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ installedHotseatItems =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ firstScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ secondaryScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } }
+ )
+
+ // When
+ broadcastModel.truncateModelForBroadcast()
+
+ // Then
+ assertEquals(MAX_BROADCAST_SIZE, broadcastModel.getTotalItemCount())
+ }
+
+ @Test
+ fun `Broadcast truncates installed Hotseat items before other installed items`() {
+ // Given
+ val broadcastModel =
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ installedWorkspaceItems =
+ mutableSetOf<String>().apply { repeat(50) { add(it.toString()) } },
+ firstScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(10) { add(it.toString()) } },
+ secondaryScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(10) { add((it + 10).toString()) } },
+ installedHotseatItems =
+ mutableSetOf<String>().apply { repeat(10) { add(it.toString()) } },
+ )
+
+ // When
+ broadcastModel.truncateModelForBroadcast()
+
+ // Then
+ assertEquals(MAX_BROADCAST_SIZE, broadcastModel.getTotalItemCount())
+ assertEquals(50, broadcastModel.installedWorkspaceItems.size)
+ assertEquals(10, broadcastModel.firstScreenInstalledWidgets.size)
+ assertEquals(10, broadcastModel.secondaryScreenInstalledWidgets.size)
+ assertEquals(0, broadcastModel.installedHotseatItems.size)
+ }
+
+ @Test
+ fun `Broadcast truncates Widgets before the rest of the first screen items`() {
+ // Given
+ val broadcastModel =
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ installedWorkspaceItems =
+ mutableSetOf<String>().apply { repeat(70) { add(it.toString()) } },
+ firstScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ secondaryScreenInstalledWidgets =
+ mutableSetOf<String>().apply { repeat(20) { add(it.toString()) } },
+ )
+
+ // When
+ broadcastModel.truncateModelForBroadcast()
+
+ // Then
+ assertEquals(MAX_BROADCAST_SIZE, broadcastModel.getTotalItemCount())
+ assertEquals(70, broadcastModel.installedWorkspaceItems.size)
+ assertEquals(0, broadcastModel.firstScreenInstalledWidgets.size)
+ assertEquals(0, broadcastModel.secondaryScreenInstalledWidgets.size)
+ }
+
+ @Test
+ fun `Broadcasts are correctly formed with Extras for each Installer`() {
+ // Given
+ val broadcastModels: List<FirstScreenBroadcastModel> =
+ listOf(
+ FirstScreenBroadcastModel(
+ installerPackage = expectedInstallerPackage,
+ pendingCollectionItems = mutableSetOf("pendingCollectionItem"),
+ pendingWorkspaceItems = mutableSetOf("pendingWorkspaceItem"),
+ pendingHotseatItems = mutableSetOf("pendingHotseatItems"),
+ pendingWidgetItems = mutableSetOf("pendingWidgetItems"),
+ installedWorkspaceItems = mutableSetOf("installedWorkspaceItems"),
+ installedHotseatItems = mutableSetOf("installedHotseatItems"),
+ firstScreenInstalledWidgets = mutableSetOf("firstScreenInstalledWidgetItems"),
+ secondaryScreenInstalledWidgets = mutableSetOf("secondaryInstalledWidgetItems")
+ )
+ )
+ val expectedPendingIntent =
+ PendingIntent.getActivity(
+ context,
+ 0 /* requestCode */,
+ Intent(),
+ PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE
+ )
+
+ // When
+ FirstScreenBroadcastHelper.sendBroadcastsForModels(context, broadcastModels)
+
+ // Then
+ val argumentCaptor = ArgumentCaptor.forClass(Intent::class.java)
+ verify(context).sendBroadcast(argumentCaptor.capture())
+
+ assertEquals(
+ "com.android.launcher3.action.FIRST_SCREEN_ACTIVE_INSTALLS",
+ argumentCaptor.value.action
+ )
+ assertEquals(expectedInstallerPackage, argumentCaptor.value.`package`)
+ assertEquals(
+ expectedPendingIntent,
+ argumentCaptor.value.getParcelableExtra("verificationToken")
+ )
+ assertEquals(
+ arrayListOf("pendingCollectionItem"),
+ argumentCaptor.value.getStringArrayListExtra("folderItem")
+ )
+ assertEquals(
+ arrayListOf("pendingWorkspaceItem"),
+ argumentCaptor.value.getStringArrayListExtra("workspaceItem")
+ )
+ assertEquals(
+ arrayListOf("pendingHotseatItems"),
+ argumentCaptor.value.getStringArrayListExtra("hotseatItem")
+ )
+ assertEquals(
+ arrayListOf("pendingWidgetItems"),
+ argumentCaptor.value.getStringArrayListExtra("widgetItem")
+ )
+ assertEquals(
+ arrayListOf("installedWorkspaceItems"),
+ argumentCaptor.value.getStringArrayListExtra("workspaceInstalledItems")
+ )
+ assertEquals(
+ arrayListOf("installedHotseatItems"),
+ argumentCaptor.value.getStringArrayListExtra("hotseatInstalledItems")
+ )
+ assertEquals(
+ arrayListOf("firstScreenInstalledWidgetItems", "secondaryInstalledWidgetItems"),
+ argumentCaptor.value.getStringArrayListExtra("widgetInstalledItems")
+ )
+ }
+}
diff --git a/tests/src/com/android/launcher3/model/FolderIconLoadTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/FolderIconLoadTest.kt
similarity index 96%
rename from tests/src/com/android/launcher3/model/FolderIconLoadTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/FolderIconLoadTest.kt
index c4a4c9b..d002493 100644
--- a/tests/src/com/android/launcher3/model/FolderIconLoadTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/FolderIconLoadTest.kt
@@ -23,12 +23,14 @@
import com.android.launcher3.util.LauncherLayoutBuilder
import com.android.launcher3.util.LauncherModelHelper
import com.android.launcher3.util.LauncherModelHelper.*
+import com.android.launcher3.util.RoboApiWrapper
import com.android.launcher3.util.TestUtil
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import java.util.concurrent.CountDownLatch
import org.junit.After
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -36,6 +38,9 @@
@SmallTest
@RunWith(AndroidJUnit4::class)
class FolderIconLoadTest {
+
+ @get:Rule(order = 0) val modelTestRule = ModelTestRule()
+
private lateinit var modelHelper: LauncherModelHelper
private val uniqueActivities =
@@ -145,6 +150,7 @@
while (cache.isIconUpdateInProgress) {
val wait = CountDownLatch(1)
Executors.MODEL_EXECUTOR.handler.postDelayed({ wait.countDown() }, 10)
+ RoboApiWrapper.waitForLooperSync(Executors.MODEL_EXECUTOR.handler.looper)
wait.await()
}
TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) { cache.clearMemoryCache() }
diff --git a/tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/GridSizeMigrationUtilTest.kt
diff --git a/tests/src/com/android/launcher3/model/LoaderCursorTest.java b/tests/multivalentTests/src/com/android/launcher3/model/LoaderCursorTest.java
similarity index 96%
rename from tests/src/com/android/launcher3/model/LoaderCursorTest.java
rename to tests/multivalentTests/src/com/android/launcher3/model/LoaderCursorTest.java
index 56ac960..ac911b3 100644
--- a/tests/src/com/android/launcher3/model/LoaderCursorTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/model/LoaderCursorTest.java
@@ -67,6 +67,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -77,8 +78,11 @@
@RunWith(AndroidJUnit4.class)
public class LoaderCursorTest {
+ @Rule public ModelTestRule rule = new ModelTestRule();
+
private LauncherModelHelper mModelHelper;
private LauncherAppState mApp;
+ private PackageManagerHelper mPmHelper;
private MatrixCursor mCursor;
private InvariantDeviceProfile mIDP;
@@ -92,6 +96,7 @@
mContext = mModelHelper.sandboxContext;
mIDP = InvariantDeviceProfile.INSTANCE.get(mContext);
mApp = LauncherAppState.getInstance(mContext);
+ mPmHelper = PackageManagerHelper.INSTANCE.get(mContext);
mCursor = new MatrixCursor(new String[] {
ICON, TITLE, _ID, CONTAINER, ITEM_TYPE,
@@ -101,7 +106,7 @@
});
UserManagerState ums = new UserManagerState();
- mLoaderCursor = new LoaderCursor(mCursor, mApp, ums, null);
+ mLoaderCursor = new LoaderCursor(mCursor, mApp, ums, mPmHelper, null);
ums.allUsers.put(0, Process.myUserHandle());
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/model/ModelTestRule.kt b/tests/multivalentTests/src/com/android/launcher3/model/ModelTestRule.kt
new file mode 100644
index 0000000..ad2c2a4
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/model/ModelTestRule.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import com.android.launcher3.util.RoboApiWrapper
+import org.junit.rules.TestWatcher
+import org.junit.runner.Description
+
+class ModelTestRule : TestWatcher() {
+ override fun starting(description: Description?) {
+ RoboApiWrapper.initialize()
+ }
+}
diff --git a/tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java b/tests/multivalentTests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
similarity index 87%
rename from tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
rename to tests/multivalentTests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
index 4ba61ac..a0d9da9 100644
--- a/tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.launcher3.model;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -22,6 +37,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,6 +48,8 @@
@RunWith(AndroidJUnit4.class)
public class PackageInstallStateChangedTaskTest {
+ @Rule public ModelTestRule mModelTestRule = new ModelTestRule();
+
private static final String PENDING_APP_1 = TEST_PACKAGE + ".pending1";
private static final String PENDING_APP_2 = TEST_PACKAGE + ".pending2";
diff --git a/tests/multivalentTests/src/com/android/launcher3/model/WidgetsModelTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/WidgetsModelTest.kt
new file mode 100644
index 0000000..ff545fe
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/model/WidgetsModelTest.kt
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import android.appwidget.AppWidgetManager
+import android.content.ComponentName
+import android.content.Context
+import android.os.UserHandle
+import android.platform.test.rule.AllowedDevices
+import android.platform.test.rule.DeviceProduct
+import android.platform.test.rule.LimitDevicesRule
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.DeviceProfile
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.data.PackageItemInfo
+import com.android.launcher3.pm.UserCache
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.ComponentKey
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.IntSet
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
+import com.android.launcher3.widget.WidgetSections
+import com.android.launcher3.widget.WidgetSections.NO_CATEGORY
+import com.google.common.truth.Truth.assertThat
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+import org.junit.Assert.fail
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.spy
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.any
+import org.mockito.kotlin.whenever
+
+@AllowedDevices(allowed = [DeviceProduct.ROBOLECTRIC])
+@RunWith(AndroidJUnit4::class)
+class WidgetsModelTest {
+ @Rule @JvmField val limitDevicesRule = LimitDevicesRule()
+ @Rule @JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var appWidgetManager: AppWidgetManager
+ @Mock private lateinit var app: LauncherAppState
+ @Mock private lateinit var iconCacheMock: IconCache
+
+ private lateinit var context: Context
+ private lateinit var idp: InvariantDeviceProfile
+ private lateinit var underTest: WidgetsModel
+
+ private var widgetSectionCategory: Int = 0
+ private lateinit var appAPackage: String
+
+ @Before
+ fun setUp() {
+ val appContext: Context = ApplicationProvider.getApplicationContext()
+ idp = InvariantDeviceProfile.INSTANCE[appContext]
+
+ context =
+ object : ActivityContextWrapper(ApplicationProvider.getApplicationContext()) {
+ override fun getSystemService(name: String): Any? {
+ if (name == "appwidget") {
+ return appWidgetManager
+ }
+ return super.getSystemService(name)
+ }
+
+ override fun getDeviceProfile(): DeviceProfile {
+ return idp.getDeviceProfile(applicationContext).copy(applicationContext)
+ }
+ }
+
+ whenever(iconCacheMock.getTitleNoCache(any<LauncherAppWidgetProviderInfo>()))
+ .thenReturn("title")
+ whenever(app.iconCache).thenReturn(iconCacheMock)
+ whenever(app.context).thenReturn(context)
+ whenever(app.invariantDeviceProfile).thenReturn(idp)
+
+ val widgetToCategoryEntry: Map.Entry<ComponentName, IntSet> =
+ WidgetSections.getWidgetsToCategory(context).entries.first()
+ widgetSectionCategory = widgetToCategoryEntry.value.first()
+ val appAWidgetComponent = widgetToCategoryEntry.key
+ appAPackage = appAWidgetComponent.packageName
+
+ whenever(appWidgetManager.getInstalledProvidersForProfile(any()))
+ .thenReturn(
+ listOf(
+ // First widget from widget sections xml
+ createAppWidgetProviderInfo(appAWidgetComponent),
+ // A widget that belongs to same package as the widget from widget sections
+ // xml, but, because it's not mentioned in xml, it would be included in its
+ // own package section.
+ createAppWidgetProviderInfo(
+ ComponentName.createRelative(appAPackage, APP_A_TEST_WIDGET_NAME)
+ ),
+ // A widget in different package (none of that app's widgets are in widget
+ // sections xml)
+ createAppWidgetProviderInfo(AppBTestWidgetComponent),
+ )
+ )
+
+ val userCache = spy(UserCache.INSTANCE.get(context))
+ whenever(userCache.userProfiles).thenReturn(listOf(UserHandle.CURRENT))
+
+ underTest = WidgetsModel()
+ }
+
+ @Test
+ fun widgetsByPackage_treatsWidgetSectionsAsSeparatePackageItems() {
+ loadWidgets()
+
+ val packages: Map<PackageItemInfo, List<WidgetItem>> = underTest.widgetsByPackageItem
+
+ // expect 3 package items
+ // one for the custom section with widget from appA
+ // one for package section for second widget from appA (that wasn't listed in xml)
+ // and one for package section for appB
+ assertThat(packages).hasSize(3)
+
+ // Each package item when used as a key is distinct (i.e. even if appA is split into custom
+ // package and owner package section, each of them is a distinct key). This ensures that
+ // clicking on a custom widget section doesn't take user to app package section.
+ val distinctPackageUserKeys =
+ packages.map { PackageUserKey.fromPackageItemInfo(it.key) }.distinct()
+ assertThat(distinctPackageUserKeys).hasSize(3)
+
+ val customSections = packages.filter { it.key.widgetCategory == widgetSectionCategory }
+ assertThat(customSections).hasSize(1)
+ val widgetsInCustomSection = customSections.entries.first().value
+ assertThat(widgetsInCustomSection).hasSize(1)
+
+ val packageSections = packages.filter { it.key.widgetCategory == NO_CATEGORY }
+ assertThat(packageSections).hasSize(2)
+
+ // App A's package section
+ val appAPackageSection = packageSections.filter { it.key.packageName == appAPackage }
+ assertThat(appAPackageSection).hasSize(1)
+ val widgetsInAppASection = appAPackageSection.entries.first().value
+ assertThat(widgetsInAppASection).hasSize(1)
+
+ // App B's package section
+ val appBPackageSection =
+ packageSections.filter { it.key.packageName == AppBTestWidgetComponent.packageName }
+ assertThat(appBPackageSection).hasSize(1)
+ val widgetsInAppBSection = appBPackageSection.entries.first().value
+ assertThat(widgetsInAppBSection).hasSize(1)
+ }
+
+ @Test
+ fun widgetComponentMap_returnsWidgets() {
+ loadWidgets()
+
+ val widgetsByComponentKey: Map<ComponentKey, WidgetItem> = underTest.widgetsByComponentKey
+
+ assertThat(widgetsByComponentKey).hasSize(3)
+ widgetsByComponentKey.forEach { entry ->
+ assertThat(entry.key).isEqualTo(entry.value as ComponentKey)
+ }
+ }
+
+ @Test
+ fun widgets_noData_returnsEmpty() {
+ // no loadWidgets()
+
+ assertThat(underTest.widgetsByComponentKey).isEmpty()
+ }
+
+ @Test
+ fun getWidgetsByPackageItem_returnsACopyOfMap() {
+ loadWidgets()
+
+ val latch = CountDownLatch(1)
+ Executors.MODEL_EXECUTOR.execute {
+ var update = true
+
+ // each "widgetsByPackageItem" read returns a different copy of the map held internally.
+ // Modifying one shouldn't impact another.
+ for ((_, _) in underTest.widgetsByPackageItem.entries) {
+ underTest.widgetsByPackageItem.clear()
+ if (update) { // trigger update
+ update = false
+ // Similarly, model could update its code independently while a client is
+ // iterating on the list.
+ underTest.update(app, /* packageUser= */ null)
+ }
+ }
+
+ latch.countDown()
+ }
+ if (!latch.await(LOAD_WIDGETS_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
+ fail("Timed out waiting for test")
+ }
+
+ // No exception
+ }
+
+ private fun loadWidgets() {
+ val latch = CountDownLatch(1)
+ Executors.MODEL_EXECUTOR.execute {
+ underTest.update(app, /* packageUser= */ null)
+ latch.countDown()
+ }
+ if (!latch.await(LOAD_WIDGETS_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
+ fail("Timed out waiting widgets to load")
+ }
+ }
+
+ companion object {
+ // Another widget within app A
+ private const val APP_A_TEST_WIDGET_NAME = "MyProvider"
+
+ private val AppBTestWidgetComponent: ComponentName =
+ ComponentName.createRelative("com.test.package", "TestProvider")
+
+ private const val LOAD_WIDGETS_TIMEOUT_SECONDS = 2L
+ }
+}
diff --git a/tests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt
similarity index 81%
rename from tests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt
index 6bbcf85..1d9c161 100644
--- a/tests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemProcessorTest.kt
@@ -23,11 +23,11 @@
import android.content.pm.LauncherApps
import android.content.pm.PackageInstaller
import android.content.pm.ShortcutInfo
+import android.os.Process
import android.os.UserHandle
-import android.platform.test.annotations.EnableFlags
import android.util.LongSparseArray
-import com.android.dx.mockito.inline.extended.ExtendedMockito
-import com.android.launcher3.Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.launcher3.LauncherAppState
import com.android.launcher3.LauncherSettings.Favorites
import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
@@ -35,7 +35,6 @@
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
-import com.android.launcher3.Utilities
import com.android.launcher3.Utilities.EMPTY_PERSON_ARRAY
import com.android.launcher3.backuprestore.LauncherRestoreEventLogger
import com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RestoreError.Companion.MISSING_INFO
@@ -45,7 +44,6 @@
import com.android.launcher3.model.data.IconRequestInfo
import com.android.launcher3.model.data.ItemInfo
import com.android.launcher3.model.data.LauncherAppWidgetInfo
-import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_RESTORE_STARTED
import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_UI_NOT_READY
import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.pm.UserCache
@@ -56,11 +54,12 @@
import com.android.launcher3.util.UserIconInfo
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
import com.android.launcher3.widget.WidgetInflater
-import com.android.launcher3.widget.WidgetSections
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
+import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.Mock
import org.mockito.Mockito.RETURNS_DEEP_STUBS
@@ -73,10 +72,12 @@
import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
-import org.mockito.quality.Strictness
+@RunWith(AndroidJUnit4::class)
class WorkspaceItemProcessorTest {
+ @get:Rule val modelTestRule = ModelTestRule()
+
@Mock private lateinit var mockIconRequestInfo: IconRequestInfo<WorkspaceItemInfo>
@Mock private lateinit var mockWorkspaceInfo: WorkspaceItemInfo
@Mock private lateinit var mockBgDataModel: BgDataModel
@@ -121,6 +122,7 @@
mock<Context>().apply {
whenever(packageManager).thenReturn(mock())
whenever(packageManager.getUserBadgedLabel(any(), any())).thenReturn("")
+ whenever(applicationContext).thenReturn(ApplicationProvider.getApplicationContext())
}
mockAppState =
mock<LauncherAppState>().apply {
@@ -429,6 +431,7 @@
whenever(disabledMessage).thenReturn("")
whenever(disabledReason).thenReturn(0)
whenever(persons).thenReturn(EMPTY_PERSON_ARRAY)
+ whenever(userHandle).thenReturn(Process.myUserHandle())
}
mIconRequestInfos = mutableListOf()
// Make sure shortcuts map has expected key from expected package
@@ -664,142 +667,6 @@
}
@Test
- fun `When Pending App Widget has not started restore then update db and add item`() {
-
- val mockitoSession =
- ExtendedMockito.mockitoSession()
- .strictness(Strictness.LENIENT)
- .mockStatic(WidgetSections::class.java)
- .startMocking()
- try {
- // Given
- val expectedProvider = "com.google.android.testApp/com.android.testApp.testAppProvider"
- val expectedComponentName =
- ComponentName.unflattenFromString(expectedProvider)!!.flattenToString()
- val expectedRestoreStatus = FLAG_UI_NOT_READY or FLAG_RESTORE_STARTED
- val expectedAppWidgetId = 0
- mockCursor.apply {
- itemType = ITEM_TYPE_APPWIDGET
- user = mUserHandle
- restoreFlag = FLAG_UI_NOT_READY
- container = CONTAINER_DESKTOP
- whenever(isOnWorkspaceOrHotseat).thenCallRealMethod()
- whenever(appWidgetProvider).thenReturn(expectedProvider)
- whenever(appWidgetId).thenReturn(expectedAppWidgetId)
- whenever(spanX).thenReturn(2)
- whenever(spanY).thenReturn(1)
- whenever(options).thenReturn(0)
- whenever(appWidgetSource).thenReturn(20)
- whenever(applyCommonProperties(any())).thenCallRealMethod()
- whenever(
- updater()
- .put(Favorites.APPWIDGET_PROVIDER, expectedComponentName)
- .put(Favorites.APPWIDGET_ID, expectedAppWidgetId)
- .put(Favorites.RESTORED, expectedRestoreStatus)
- .commit()
- )
- .thenReturn(1)
- }
- val inflationResult =
- WidgetInflater.InflationResult(
- type = WidgetInflater.TYPE_PENDING,
- widgetInfo = null
- )
- mockWidgetInflater =
- mock<WidgetInflater>().apply {
- whenever(inflateAppWidget(any())).thenReturn(inflationResult)
- }
- val packageUserKey = PackageUserKey("com.google.android.testApp", mUserHandle)
- mInstallingPkgs[packageUserKey] = PackageInstaller.SessionInfo()
-
- // When
- itemProcessorUnderTest =
- createWorkspaceItemProcessorUnderTest(widgetProvidersMap = mWidgetProvidersMap)
- itemProcessorUnderTest.processItem()
-
- // Then
- val expectedWidgetInfo =
- LauncherAppWidgetInfo().apply {
- appWidgetId = expectedAppWidgetId
- providerName = ComponentName.unflattenFromString(expectedProvider)
- restoreStatus = expectedRestoreStatus
- }
- verify(
- mockCursor
- .updater()
- .put(Favorites.APPWIDGET_PROVIDER, expectedProvider)
- .put(Favorites.APPWIDGET_ID, expectedAppWidgetId)
- .put(Favorites.RESTORED, expectedRestoreStatus)
- )
- .commit()
- val widgetInfoCaptor = ArgumentCaptor.forClass(LauncherAppWidgetInfo::class.java)
- verify(mockCursor).checkAndAddItem(widgetInfoCaptor.capture(), eq(mockBgDataModel))
- val actualWidgetInfo = widgetInfoCaptor.value
- with(actualWidgetInfo) {
- assertThat(providerName).isEqualTo(expectedWidgetInfo.providerName)
- assertThat(restoreStatus).isEqualTo(expectedWidgetInfo.restoreStatus)
- assertThat(targetComponent).isEqualTo(expectedWidgetInfo.targetComponent)
- assertThat(appWidgetId).isEqualTo(expectedWidgetInfo.appWidgetId)
- }
- } finally {
- mockitoSession.finishMocking()
- }
- }
-
- @Test
- @EnableFlags(FLAG_ENABLE_SUPPORT_FOR_ARCHIVING)
- fun `When Archived Pending App Widget then checkAndAddItem`() {
- val mockitoSession =
- ExtendedMockito.mockitoSession().mockStatic(Utilities::class.java).startMocking()
- try {
- // Given
- val expectedProvider = "com.google.android.testApp/com.android.testApp.testAppProvider"
- val expectedComponentName = ComponentName.unflattenFromString(expectedProvider)
- val expectedPackage = expectedComponentName!!.packageName
- mockPmHelper =
- mock<PackageManagerHelper>().apply {
- whenever(isAppArchived(expectedPackage)).thenReturn(true)
- }
- mockCursor =
- mock<LoaderCursor>().apply {
- itemType = ITEM_TYPE_APPWIDGET
- id = 1
- user = UserHandle(1)
- restoreFlag = FLAG_UI_NOT_READY
- container = CONTAINER_DESKTOP
- whenever(isOnWorkspaceOrHotseat).thenCallRealMethod()
- whenever(appWidgetProvider).thenReturn(expectedProvider)
- whenever(appWidgetId).thenReturn(0)
- whenever(spanX).thenReturn(2)
- whenever(spanY).thenReturn(1)
- whenever(options).thenReturn(0)
- whenever(appWidgetSource).thenReturn(20)
- whenever(applyCommonProperties(any())).thenCallRealMethod()
- }
- mInstallingPkgs = hashMapOf()
- val inflationResult =
- WidgetInflater.InflationResult(
- type = WidgetInflater.TYPE_PENDING,
- widgetInfo = null
- )
- mockWidgetInflater =
- mock<WidgetInflater>().apply {
- whenever(inflateAppWidget(any())).thenReturn(inflationResult)
- }
- itemProcessorUnderTest =
- createWorkspaceItemProcessorUnderTest(widgetProvidersMap = mWidgetProvidersMap)
-
- // When
- itemProcessorUnderTest.processItem()
-
- // Then
- verify(mockCursor).checkAndAddItem(any(), any())
- } finally {
- mockitoSession.finishMocking()
- }
- }
-
- @Test
fun `When widget inflation result is TYPE_DELETE then mark deleted`() {
// Given
val expectedProvider = "com.google.android.testApp/com.android.testApp.testAppProvider"
diff --git a/tests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt b/tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt
similarity index 98%
rename from tests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt
index b3d02be..ae8e966 100644
--- a/tests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/model/WorkspaceItemSpaceFinderTest.kt
@@ -21,6 +21,7 @@
import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -29,6 +30,8 @@
@RunWith(AndroidJUnit4::class)
class WorkspaceItemSpaceFinderTest : AbstractWorkspaceModelTest() {
+ @get:Rule val modelTestRule = ModelTestRule()
+
private val mItemSpaceFinder = WorkspaceItemSpaceFinder()
@Before
diff --git a/tests/multivalentTests/src/com/android/launcher3/pm/InstallSessionTrackerTest.kt b/tests/multivalentTests/src/com/android/launcher3/pm/InstallSessionTrackerTest.kt
new file mode 100644
index 0000000..d860710
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/pm/InstallSessionTrackerTest.kt
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.pm
+
+import android.content.pm.LauncherApps
+import android.content.pm.PackageInstaller
+import android.os.Build
+import android.os.UserHandle
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SdkSuppress
+import androidx.test.filters.SmallTest
+import com.android.launcher3.Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING
+import com.android.launcher3.model.ModelTestRule
+import com.android.launcher3.util.Executors.MODEL_EXECUTOR
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.PackageUserKey
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doNothing
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class InstallSessionTrackerTest {
+ @get:Rule(order = 0) val setFlagsRule = SetFlagsRule()
+
+ @get:Rule(order = 1) val modelTestRule = ModelTestRule()
+
+ private val mockInstallSessionHelper: InstallSessionHelper = mock()
+ private val mockCallback: InstallSessionTracker.Callback = mock()
+ private val mockPackageInstaller: PackageInstaller = mock()
+
+ private val launcherModelHelper = LauncherModelHelper()
+ private val sandboxContext = launcherModelHelper.sandboxContext
+
+ lateinit var launcherApps: LauncherApps
+ lateinit var installSessionTracker: InstallSessionTracker
+
+ @Before
+ fun setup() {
+ launcherApps = sandboxContext.spyService(LauncherApps::class.java)
+ installSessionTracker =
+ InstallSessionTracker(
+ mockInstallSessionHelper,
+ mockCallback,
+ mockPackageInstaller,
+ launcherApps
+ )
+ }
+
+ @After
+ fun teardown() {
+ launcherModelHelper.destroy()
+ }
+
+ @Test
+ fun `onCreated triggers callbacks for setting up new install session`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = expectedSessionId
+ appPackageName = "appPackageName"
+ userId = 0
+ }
+ val expectedPackageKey = PackageUserKey("appPackageName", UserHandle(0))
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ // When
+ installSessionTracker.onCreated(expectedSessionId)
+ // Then
+ verify(mockCallback).onInstallSessionCreated(any())
+ verify(mockCallback).onUpdateSessionDisplay(expectedPackageKey, expectedSession)
+ verify(mockInstallSessionHelper).tryQueuePromiseAppIcon(expectedSession)
+ }
+
+ @Test
+ @EnableFlags(FLAG_ENABLE_SUPPORT_FOR_ARCHIVING)
+ fun `onCreated for unarchival triggers onPackageStateChanged`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedSession =
+ spy(PackageInstaller.SessionInfo()).apply {
+ sessionId = expectedSessionId
+ appPackageName = "appPackageName"
+ userId = 0
+ whenever(isUnarchival).thenReturn(true)
+ }
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ // When
+ installSessionTracker.onCreated(expectedSessionId)
+ // Then
+ verify(mockCallback).onPackageStateChanged(any())
+ }
+
+ @Test
+ fun `onFinished triggers onPackageStateChanged if session found in cache`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = expectedSessionId
+ appPackageName = "appPackageName"
+ userId = 0
+ }
+ val expectedPackageKey = PackageUserKey("appPackageName", UserHandle(0))
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ whenever(mockInstallSessionHelper.activeSessions)
+ .thenReturn(hashMapOf(expectedPackageKey to expectedSession))
+ // When
+ installSessionTracker.onFinished(expectedSessionId, /* success */ true)
+ // Then
+ verify(mockCallback).onPackageStateChanged(any())
+ }
+
+ @Test
+ fun `onFinished failure calls onSessionFailure and promise icon removal for existing icon`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedPackage = "appPackageName"
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = expectedSessionId
+ appPackageName = expectedPackage
+ userId = 0
+ }
+ val expectedPackageKey = PackageUserKey(expectedPackage, UserHandle(0))
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ whenever(mockInstallSessionHelper.activeSessions)
+ .thenReturn(hashMapOf(expectedPackageKey to expectedSession))
+ whenever(mockInstallSessionHelper.promiseIconAddedForId(expectedSessionId)).thenReturn(true)
+ // When
+ installSessionTracker.onFinished(expectedSessionId, /* success */ false)
+ // Then
+ verify(mockCallback).onSessionFailure(expectedPackage, expectedPackageKey.mUser)
+ verify(mockInstallSessionHelper).removePromiseIconId(expectedSessionId)
+ }
+
+ @Test
+ fun `onProgressChanged triggers onPackageStateChanged if verified session found`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = expectedSessionId
+ appPackageName = "appPackageName"
+ userId = 0
+ }
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ // When
+ installSessionTracker.onProgressChanged(expectedSessionId, /* progress */ 50f)
+ // Then
+ verify(mockCallback).onPackageStateChanged(any())
+ }
+
+ @Test
+ fun `onBadgingChanged triggers session display update and queues promise icon if verified`() {
+ // Given
+ val expectedSessionId = 1
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = expectedSessionId
+ appPackageName = "appPackageName"
+ userId = 0
+ }
+ val expectedPackageKey = PackageUserKey("appPackageName", UserHandle(0))
+ whenever(mockInstallSessionHelper.getVerifiedSessionInfo(expectedSessionId))
+ .thenReturn(expectedSession)
+ // When
+ installSessionTracker.onBadgingChanged(expectedSessionId)
+ // Then
+ verify(mockCallback).onUpdateSessionDisplay(expectedPackageKey, expectedSession)
+ verify(mockInstallSessionHelper).tryQueuePromiseAppIcon(expectedSession)
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.Q)
+ fun `register triggers registerPackageInstallerSessionCallback for versions from Q`() {
+ // Given
+ doNothing()
+ .whenever(launcherApps)
+ .registerPackageInstallerSessionCallback(MODEL_EXECUTOR, installSessionTracker)
+ // When
+ installSessionTracker.register()
+ // Then
+ verify(launcherApps)
+ .registerPackageInstallerSessionCallback(MODEL_EXECUTOR, installSessionTracker)
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.Q)
+ fun `unregister triggers unregisterPackageInstallerSessionCallback for versions from Q`() {
+ // Given
+ doNothing()
+ .whenever(launcherApps)
+ .unregisterPackageInstallerSessionCallback(installSessionTracker)
+ // When
+ installSessionTracker.unregister()
+ // Then
+ verify(launcherApps).unregisterPackageInstallerSessionCallback(installSessionTracker)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/pm/UserCacheTest.kt b/tests/multivalentTests/src/com/android/launcher3/pm/UserCacheTest.kt
new file mode 100644
index 0000000..482dced
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/pm/UserCacheTest.kt
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.pm
+
+import android.os.Process.myUserHandle
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.model.ModelTestRule
+import com.android.launcher3.util.Executors.MODEL_EXECUTOR
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.TestUtil
+import com.android.launcher3.util.UserIconInfo
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class UserCacheTest {
+
+ @get:Rule val modelTestRule = ModelTestRule()
+
+ private val launcherModelHelper = LauncherModelHelper()
+ private val sandboxContext = launcherModelHelper.sandboxContext
+ private lateinit var userCache: UserCache
+
+ @Before
+ fun setup() {
+ userCache = UserCache.getInstance(sandboxContext)
+ }
+
+ @After
+ fun teardown() {
+ launcherModelHelper.destroy()
+ }
+
+ @Test
+ fun `getBadgeDrawable only returns a UserBadgeDrawable given a user in the cache`() {
+ // Given
+ val expectedIconInfo = UserIconInfo(myUserHandle(), UserIconInfo.TYPE_WORK)
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToCache(myUserHandle(), expectedIconInfo)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualDrawable = UserCache.getBadgeDrawable(sandboxContext, myUserHandle())
+ val unexpectedDrawable = UserCache.getBadgeDrawable(sandboxContext, UserHandle(66))
+ // Then
+ assertThat(actualDrawable).isNotNull()
+ assertThat(unexpectedDrawable).isNull()
+ }
+
+ @Test
+ fun `getPreInstallApps returns list of pre installed apps given a user`() {
+ // Given
+ val expectedApps = listOf("Google")
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToPreInstallCache(myUserHandle(), expectedApps)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualApps = userCache.getPreInstallApps(myUserHandle())
+ // Then
+ assertThat(actualApps).isEqualTo(expectedApps)
+ }
+
+ @Test
+ fun `getUserProfiles returns copy of UserCache profiles`() {
+ // Given
+ val expectedProfiles = listOf(myUserHandle())
+ val expectedIconInfo = UserIconInfo(myUserHandle(), UserIconInfo.TYPE_MAIN)
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToCache(myUserHandle(), expectedIconInfo)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualProfiles = userCache.userProfiles
+ // Then
+ assertThat(actualProfiles).isEqualTo(expectedProfiles)
+ }
+
+ @Test
+ fun `getUserForSerialNumber returns user key matching given entry serial number`() {
+ // Given
+ val expectedSerial = 42L
+ val expectedProfile = UserHandle(42)
+ val expectedIconInfo = UserIconInfo(myUserHandle(), UserIconInfo.TYPE_MAIN, expectedSerial)
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToCache(expectedProfile, expectedIconInfo)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualProfile = userCache.getUserForSerialNumber(expectedSerial)
+ // Then
+ assertThat(actualProfile).isEqualTo(expectedProfile)
+ }
+
+ @Test
+ fun `getUserInfo returns cached UserIconInfo given user key`() {
+ // Given
+ val expectedProfile = UserHandle(1)
+ val expectedIconInfo = UserIconInfo(myUserHandle(), UserIconInfo.TYPE_WORK)
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToCache(expectedProfile, expectedIconInfo)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualIconInfo = userCache.getUserInfo(expectedProfile)
+ // Then
+ assertThat(actualIconInfo).isEqualTo(expectedIconInfo)
+ }
+
+ @Test
+ fun `getSerialNumberForUser returns cached UserIconInfo serial number given user key`() {
+ // Given
+ val expectedSerial = 42L
+ val expectedProfile = UserHandle(1)
+ val expectedIconInfo = UserIconInfo(myUserHandle(), UserIconInfo.TYPE_WORK, expectedSerial)
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ userCache.putToCache(expectedProfile, expectedIconInfo)
+ }
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync()
+ // When
+ val actualSerial = userCache.getSerialNumberForUser(expectedProfile)
+ // Then
+ assertThat(actualSerial).isEqualTo(expectedSerial)
+ }
+}
diff --git a/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java b/tests/multivalentTests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
similarity index 98%
rename from tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
rename to tests/multivalentTests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
index 733f1e9..b3675a6 100644
--- a/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
@@ -38,7 +38,7 @@
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import android.app.backup.BackupManager;
@@ -243,7 +243,8 @@
// Then
assertThat(expectedHost.getAppWidgetIds()).isEqualTo(expectedOldIds);
assertThat(mPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse();
- verifyZeroInteractions(mMockController);
+ // b/343530737
+ verifyNoMoreInteractions(mMockController);
}
@Test
diff --git a/tests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt
similarity index 93%
rename from tests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt
index c99da96..3dca35e 100644
--- a/tests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/AllAppsSpecsTest.kt
@@ -22,7 +22,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -45,7 +44,7 @@
fun parseValidFile() {
val allAppsSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_all_apps_file),
+ TestResourceHelper(context, "valid_all_apps_file".xmlToId()),
ResponsiveSpecType.AllApps
)
@@ -114,7 +113,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_missingTag_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_all_apps_file_case_1),
+ TestResourceHelper(context, "invalid_all_apps_file_case_1".xmlToId()),
ResponsiveSpecType.AllApps
)
}
@@ -122,7 +121,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_moreThanOneValuePerTag_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_all_apps_file_case_2),
+ TestResourceHelper(context, "invalid_all_apps_file_case_2".xmlToId()),
ResponsiveSpecType.AllApps
)
}
@@ -130,7 +129,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_valueBiggerThan1_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_all_apps_file_case_3),
+ TestResourceHelper(context, "invalid_all_apps_file_case_3".xmlToId()),
ResponsiveSpecType.AllApps
)
}
diff --git a/tests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt
similarity index 94%
rename from tests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt
index 1cc5ed2..8346492 100644
--- a/tests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedAllAppsSpecTest.kt
@@ -23,7 +23,6 @@
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Test
@@ -52,7 +51,7 @@
val workspaceSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_workspace_file),
+ TestResourceHelper(context, "valid_workspace_file".xmlToId()),
ResponsiveSpecType.Workspace
)
val widthSpec =
@@ -62,7 +61,7 @@
val allAppsSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_all_apps_file),
+ TestResourceHelper(context, "valid_all_apps_file".xmlToId()),
ResponsiveSpecType.AllApps
)
diff --git a/tests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt
index c4e2d2a..46d6cb9 100644
--- a/tests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedFolderSpecTest.kt
@@ -23,7 +23,6 @@
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -47,12 +46,12 @@
val columns = 6
// Loading workspace specs
- val resourceHelperWorkspace = TestResourceHelper(context, R.xml.valid_workspace_file)
+ val resourceHelperWorkspace = TestResourceHelper(context, "valid_workspace_file".xmlToId())
val workspaceSpecs =
ResponsiveSpecsProvider.create(resourceHelperWorkspace, ResponsiveSpecType.Workspace)
// Loading folders specs
- val resourceHelperFolder = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelperFolder = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs =
ResponsiveSpecsProvider.create(resourceHelperFolder, ResponsiveSpecType.Folder)
val specs = folderSpecs.getSpecsByAspectRatio(aspectRatio)
@@ -123,12 +122,12 @@
val rows = 5
// Loading workspace specs
- val resourceHelperWorkspace = TestResourceHelper(context, R.xml.valid_workspace_file)
+ val resourceHelperWorkspace = TestResourceHelper(context, "valid_workspace_file".xmlToId())
val workspaceSpecs =
ResponsiveSpecsProvider.create(resourceHelperWorkspace, ResponsiveSpecType.Workspace)
// Loading folders specs
- val resourceHelperFolder = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelperFolder = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs =
ResponsiveSpecsProvider.create(resourceHelperFolder, ResponsiveSpecType.Folder)
val specs = folderSpecs.getSpecsByAspectRatio(aspectRatio)
diff --git a/tests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt
index 1a564ac..5ab44f3 100644
--- a/tests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedHotseatSpecTest.kt
@@ -22,7 +22,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Test
@@ -47,7 +46,7 @@
val availableHeight = deviceSpec.naturalSize.second
val hotseatSpecsProvider =
- HotseatSpecsProvider.create(TestResourceHelper(context, TestR.xml.valid_hotseat_file))
+ HotseatSpecsProvider.create(TestResourceHelper(context, "valid_hotseat_file".xmlToId()))
val heightSpec =
hotseatSpecsProvider.getCalculatedSpec(
aspectRatio,
@@ -73,7 +72,7 @@
val availableHeight = deviceSpec.naturalSize.second
val hotseatSpecsProvider =
- HotseatSpecsProvider.create(TestResourceHelper(context, TestR.xml.valid_hotseat_file))
+ HotseatSpecsProvider.create(TestResourceHelper(context, "valid_hotseat_file".xmlToId()))
val heightSpec =
hotseatSpecsProvider.getCalculatedSpec(
aspectRatio,
@@ -99,7 +98,7 @@
val hotseatSpecsProvider =
HotseatSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_hotseat_land_file)
+ TestResourceHelper(context, "valid_hotseat_land_file".xmlToId())
)
val widthSpec =
hotseatSpecsProvider.getCalculatedSpec(aspectRatio, DimensionType.WIDTH, availableWidth)
diff --git a/tests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt
index 0c5d347..dea98b6 100644
--- a/tests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/CalculatedWorkspaceSpecTest.kt
@@ -23,7 +23,6 @@
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Test
@@ -53,7 +52,7 @@
val workspaceSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_workspace_file),
+ TestResourceHelper(context, "valid_workspace_file".xmlToId()),
ResponsiveSpecType.Workspace
)
val widthSpec =
@@ -96,7 +95,7 @@
val workspaceSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_workspace_file),
+ TestResourceHelper(context, "valid_workspace_file".xmlToId()),
ResponsiveSpecType.Workspace
)
val widthSpec =
@@ -138,7 +137,7 @@
val availableHeight = deviceSpec.naturalSize.second - deviceSpec.statusBarNaturalPx - 640
val workspaceSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_workspace_unsorted_file),
+ TestResourceHelper(context, "valid_workspace_unsorted_file".xmlToId()),
ResponsiveSpecType.Workspace
)
val widthSpec =
diff --git a/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/FolderSpecTest.kt
similarity index 91%
rename from tests/src/com/android/launcher3/responsive/FolderSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/FolderSpecTest.kt
index 5cfa49f..d2b264b 100644
--- a/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/FolderSpecTest.kt
@@ -23,7 +23,6 @@
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -44,7 +43,7 @@
@Test
fun parseValidFile() {
- val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelper = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
val specs = folderSpecs.getSpecsByAspectRatio(aspectRatio)
@@ -92,25 +91,25 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_missingTag_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_1)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_1".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_moreThanOneValuePerTag_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_2)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_2".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_valueBiggerThan1_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_3)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_3".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_missingSpecs_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_4)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_4".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
}
@@ -132,7 +131,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_5)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_5".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
folderSpecs.getCalculatedSpec(
aspectRatio,
@@ -161,7 +160,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_5)
+ val resourceHelper = TestResourceHelper(context, "invalid_folders_specs_5".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
folderSpecs.getCalculatedSpec(
aspectRatio,
@@ -190,7 +189,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelper = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
val calculatedWidthSpec =
folderSpecs.getCalculatedSpec(
@@ -227,7 +226,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelper = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
folderSpecs.getCalculatedSpec(
aspectRatio,
@@ -256,7 +255,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelper = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
val calculatedHeightSpec =
folderSpecs.getCalculatedSpec(
@@ -293,7 +292,7 @@
val calculatedWorkspaceSpec =
CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
- val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
+ val resourceHelper = TestResourceHelper(context, "valid_folders_specs".xmlToId())
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
folderSpecs.getCalculatedSpec(
aspectRatio,
diff --git a/tests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt
similarity index 93%
rename from tests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt
index 78cb1ac..58324e1 100644
--- a/tests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/HotseatSpecsProviderTest.kt
@@ -22,7 +22,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -44,7 +43,7 @@
@Test
fun parseValidFile() {
val hotseatSpecsProvider =
- HotseatSpecsProvider.create(TestResourceHelper(context, TestR.xml.valid_hotseat_file))
+ HotseatSpecsProvider.create(TestResourceHelper(context, "valid_hotseat_file".xmlToId()))
val specs = hotseatSpecsProvider.getSpecsByAspectRatio(aspectRatio)
val expectedHeightSpecs =
@@ -76,7 +75,7 @@
fun parseValidLandscapeFile() {
val hotseatSpecsProvider =
HotseatSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_hotseat_land_file)
+ TestResourceHelper(context, "valid_hotseat_land_file".xmlToId())
)
val specs = hotseatSpecsProvider.getSpecsByAspectRatio(aspectRatio)
assertThat(specs.heightSpecs.size).isEqualTo(0)
@@ -107,14 +106,14 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_spaceIsNotFixedSize_throwsError() {
HotseatSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_hotseat_file_case_1)
+ TestResourceHelper(context, "invalid_hotseat_file_case_1".xmlToId())
)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidFixedSize_throwsError() {
HotseatSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_hotseat_file_case_2)
+ TestResourceHelper(context, "invalid_hotseat_file_case_2".xmlToId())
)
}
}
diff --git a/tests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt
similarity index 92%
rename from tests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt
index 50cd358..11161bd 100644
--- a/tests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveCellSpecsProviderTest.kt
@@ -22,7 +22,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -43,7 +42,7 @@
@Test
fun parseValidFile() {
- val testResourceHelper = TestResourceHelper(context, TestR.xml.valid_cell_specs_file)
+ val testResourceHelper = TestResourceHelper(context, "valid_cell_specs_file".xmlToId())
val provider = ResponsiveCellSpecsProvider.create(testResourceHelper)
// Validate Portrait
@@ -98,21 +97,21 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_IsNotFixedSizeOrMatchWorkspace_throwsError() {
ResponsiveCellSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_cell_specs_1)
+ TestResourceHelper(context, "invalid_cell_specs_1".xmlToId())
)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_dimensionTypeIsNotHeight_throwsError() {
ResponsiveCellSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_cell_specs_2)
+ TestResourceHelper(context, "invalid_cell_specs_2".xmlToId())
)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidFixedSize_throwsError() {
ResponsiveCellSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_cell_specs_3)
+ TestResourceHelper(context, "invalid_cell_specs_3".xmlToId())
)
}
}
diff --git a/tests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt
similarity index 93%
rename from tests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt
index 54a1dc5..c74f7a8 100644
--- a/tests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/ResponsiveSpecsProviderTest.kt
@@ -23,7 +23,6 @@
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
import com.android.launcher3.responsive.ResponsiveSpec.DimensionType
-import com.android.launcher3.tests.R
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -44,7 +43,7 @@
@Test
fun parseValidFile() {
- val resourceHelper = TestResourceHelper(context, R.xml.valid_responsive_spec_unsorted)
+ val resourceHelper = TestResourceHelper(context, "valid_responsive_spec_unsorted".xmlToId())
val provider = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
// Validate Portrait
@@ -111,44 +110,44 @@
@Test(expected = IllegalStateException::class)
fun parseValidFile_invalidAspectRatio_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.valid_responsive_spec_unsorted)
+ val resourceHelper = TestResourceHelper(context, "valid_responsive_spec_unsorted".xmlToId())
val provider = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
provider.getSpecsByAspectRatio(0f)
}
@Test(expected = InvalidResponsiveGridSpec::class)
fun parseInvalidFile_missingGroups_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_1)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_1".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
@Test(expected = InvalidResponsiveGridSpec::class)
fun parseInvalidFile_partialGroups_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_2)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_2".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidAspectRatio_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_3)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_3".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidRemainderSpace_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_4)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_4".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidAvailableSpace_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_5)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_5".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_invalidFixedSize_throwsError() {
- val resourceHelper = TestResourceHelper(context, R.xml.invalid_responsive_spec_6)
+ val resourceHelper = TestResourceHelper(context, "invalid_responsive_spec_6".xmlToId())
ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Workspace)
}
diff --git a/tests/src/com/android/launcher3/responsive/SizeSpecTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/SizeSpecTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/responsive/SizeSpecTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/SizeSpecTest.kt
diff --git a/tests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt b/tests/multivalentTests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt
similarity index 94%
rename from tests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt
index 17b0ee4..bc133ba 100644
--- a/tests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/responsive/WorkspaceSpecsTest.kt
@@ -22,7 +22,6 @@
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType
-import com.android.launcher3.tests.R as TestR
import com.android.launcher3.util.TestResourceHelper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -45,7 +44,7 @@
fun parseValidFile() {
val workspaceSpecs =
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.valid_workspace_file),
+ TestResourceHelper(context, "valid_workspace_file".xmlToId()),
ResponsiveSpecType.Workspace
)
@@ -169,7 +168,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_missingTag_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_workspace_file_case_1),
+ TestResourceHelper(context, "invalid_workspace_file_case_1".xmlToId()),
ResponsiveSpecType.Workspace
)
}
@@ -177,7 +176,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_moreThanOneValuePerTag_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_workspace_file_case_2),
+ TestResourceHelper(context, "invalid_workspace_file_case_2".xmlToId()),
ResponsiveSpecType.Workspace
)
}
@@ -185,7 +184,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_valueBiggerThan1_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_workspace_file_case_3),
+ TestResourceHelper(context, "invalid_workspace_file_case_3".xmlToId()),
ResponsiveSpecType.Workspace
)
}
@@ -193,7 +192,7 @@
@Test(expected = IllegalStateException::class)
fun parseInvalidFile_matchWorkspace_true_throwsError() {
ResponsiveSpecsProvider.create(
- TestResourceHelper(context, TestR.xml.invalid_workspace_file_case_4),
+ TestResourceHelper(context, "invalid_workspace_file_case_4".xmlToId()),
ResponsiveSpecType.Workspace
)
}
diff --git a/tests/src/com/android/launcher3/testcomponent/TouchEventGenerator.java b/tests/multivalentTests/src/com/android/launcher3/testcomponent/TouchEventGenerator.java
similarity index 100%
rename from tests/src/com/android/launcher3/testcomponent/TouchEventGenerator.java
rename to tests/multivalentTests/src/com/android/launcher3/testcomponent/TouchEventGenerator.java
diff --git a/tests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java b/tests/multivalentTests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java
similarity index 95%
rename from tests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java
rename to tests/multivalentTests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java
index 260f556..6cfa6ee 100644
--- a/tests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/touch/SingleAxisSwipeDetectorTest.java
@@ -22,9 +22,9 @@
import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyFloat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyFloat;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
@@ -41,6 +41,8 @@
import com.android.launcher3.testcomponent.TouchEventGenerator;
+import com.google.errorprone.annotations.FormatMethod;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,7 +54,8 @@
public class SingleAxisSwipeDetectorTest {
private static final String TAG = SingleAxisSwipeDetectorTest.class.getSimpleName();
- public static void L(String s, Object... parts) {
+ @FormatMethod
+ public static void logD(String s, Object... parts) {
Log.d(TAG, (parts.length == 0) ? s : String.format(s, parts));
}
@@ -82,7 +85,7 @@
mTouchSlop = orgConfig.getScaledTouchSlop();
doReturn(mTouchSlop).when(mMockConfig).getScaledTouchSlop();
- L("mTouchSlop=", mTouchSlop);
+ logD("mTouchSlop= %s", mTouchSlop);
}
@Test
diff --git a/tests/src/com/android/launcher3/ui/ActivityAllAppsContainerViewTest.java b/tests/multivalentTests/src/com/android/launcher3/ui/ActivityAllAppsContainerViewTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/ui/ActivityAllAppsContainerViewTest.java
rename to tests/multivalentTests/src/com/android/launcher3/ui/ActivityAllAppsContainerViewTest.java
diff --git a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java b/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
similarity index 83%
rename from tests/src/com/android/launcher3/ui/BubbleTextViewTest.java
rename to tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
index 90ded10..b933ed2 100644
--- a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
@@ -16,27 +16,44 @@
package com.android.launcher3.ui;
+import static android.graphics.fonts.FontStyle.FONT_WEIGHT_BOLD;
+import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
+import static android.text.style.DynamicDrawableSpan.ALIGN_CENTER;
+
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
import static com.android.launcher3.BubbleTextView.DISPLAY_ALL_APPS;
import static com.android.launcher3.BubbleTextView.DISPLAY_PREDICTION_ROW;
import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT;
import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT_SMALL;
+import static com.android.launcher3.Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING;
+import static com.android.launcher3.Flags.FLAG_USE_NEW_ICON_FOR_ARCHIVED_APPS;
import static com.android.launcher3.LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE;
+import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
+import android.os.Build;
import android.os.UserHandle;
+import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
+import android.text.SpannedString;
+import android.text.style.ImageSpan;
import android.view.ViewGroup;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.Flags;
import com.android.launcher3.LauncherPrefs;
@@ -52,6 +69,7 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
/**
@@ -61,6 +79,8 @@
* two lines, and this is enough to ensure whether the string should be specifically wrapped onto
* the second line and to ensure truncation.
*/
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class BubbleTextViewTest {
@Rule public final SetFlagsRule mSetFlagsRule =
@@ -397,6 +417,62 @@
assertThat(mBubbleTextView.getIcon().hasBadge()).isEqualTo(false);
}
+ @EnableFlags({FLAG_ENABLE_SUPPORT_FOR_ARCHIVING, FLAG_USE_NEW_ICON_FOR_ARCHIVED_APPS})
+ @Test
+ public void applyIconAndLabel_setsImageSpan_whenInactiveArchivedApp() {
+ // Given
+ BubbleTextView spyTextView = spy(mBubbleTextView);
+ mGmailAppInfo.runtimeStatusFlags |= FLAG_ARCHIVED;
+ BubbleTextView expectedTextView = new BubbleTextView(mContext);
+ mContext.getResources().getConfiguration().fontWeightAdjustment = 0;
+ int expectedDrawableId = mContext.getResources().getIdentifier(
+ "cloud_download_24px", /* name */
+ "drawable", /* defType */
+ mContext.getPackageName()
+ );
+ expectedTextView.setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
+ // When
+ spyTextView.applyIconAndLabel(mGmailAppInfo);
+ // Then
+ SpannedString expectedText = (SpannedString) expectedTextView.getText();
+ SpannedString actualText = (SpannedString) spyTextView.getText();
+ ImageSpan actualSpan = actualText.getSpans(
+ 0, /* queryStart */
+ 1, /* queryEnd */
+ ImageSpan.class
+ )[0];
+ ImageSpan expectedSpan = expectedText.getSpans(
+ 0, /* queryStart */
+ 1, /* queryEnd */
+ ImageSpan.class
+ )[0];
+ verify(spyTextView).setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
+ assertThat(actualText.toString()).isEqualTo(expectedText.toString());
+ assertThat(actualSpan.getDrawable().getBounds())
+ .isEqualTo(expectedSpan.getDrawable().getBounds());
+ assertThat(actualSpan.getVerticalAlignment()).isEqualTo(ALIGN_CENTER);
+ }
+
+ @EnableFlags({FLAG_ENABLE_SUPPORT_FOR_ARCHIVING, FLAG_USE_NEW_ICON_FOR_ARCHIVED_APPS})
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.S)
+ @Test
+ public void applyIconAndLabel_setsBoldDrawable_whenBoldedTextForArchivedApp() {
+ // Given
+ int expectedDrawableId = mContext.getResources().getIdentifier(
+ "cloud_download_semibold_24px", /* name */
+ "drawable", /* defType */
+ mContext.getPackageName()
+ );
+ mContext.getResources().getConfiguration().fontWeightAdjustment =
+ FONT_WEIGHT_BOLD - FONT_WEIGHT_NORMAL;
+ BubbleTextView spyTextView = spy(mBubbleTextView);
+ mGmailAppInfo.runtimeStatusFlags |= FLAG_ARCHIVED;
+ // When
+ spyTextView.applyIconAndLabel(mGmailAppInfo);
+ // Then
+ verify(spyTextView).setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
+ }
+
@Test
public void applyIconAndLabel_whenDisplay_DISPLAY_SEARCH_RESULT_hasBadge() {
FlagOp op = FlagOp.NO_OP;
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ActivityContextWrapper.java b/tests/multivalentTests/src/com/android/launcher3/util/ActivityContextWrapper.java
index 191d284..4217d22 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/ActivityContextWrapper.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ActivityContextWrapper.java
@@ -15,6 +15,7 @@
*/
package com.android.launcher3.util;
+import android.R;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.ContextThemeWrapper;
@@ -39,11 +40,16 @@
private final MyDragLayer mMyDragLayer;
public ActivityContextWrapper(Context base) {
- super(base, android.R.style.Theme_DeviceDefault);
+ this(base, R.style.Theme_DeviceDefault);
+ }
+
+ public ActivityContextWrapper(Context base, int theme) {
+ super(base, theme);
mProfile = InvariantDeviceProfile.INSTANCE.get(base).getDeviceProfile(base).copy(base);
mMyDragLayer = new MyDragLayer(this);
}
+
@Override
public BaseDragLayer getDragLayer() {
return mMyDragLayer;
diff --git a/tests/src/com/android/launcher3/util/CellContentDimensionsTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/CellContentDimensionsTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/util/CellContentDimensionsTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/util/CellContentDimensionsTest.kt
diff --git a/tests/src/com/android/launcher3/util/DisplayControllerTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt
similarity index 98%
rename from tests/src/com/android/launcher3/util/DisplayControllerTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt
index 273f0c4..41effa2 100644
--- a/tests/src/com/android/launcher3/util/DisplayControllerTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt
@@ -27,7 +27,6 @@
import android.view.Surface
import androidx.test.annotation.UiThreadTest
import androidx.test.core.app.ApplicationProvider
-import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.launcher3.LauncherPrefs
import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING
@@ -55,7 +54,7 @@
/** Unit tests for {@link DisplayController} */
@SmallTest
-@RunWith(AndroidJUnit4::class)
+@RunWith(LauncherMultivalentJUnit::class)
class DisplayControllerTest {
private val appContext: Context = ApplicationProvider.getApplicationContext()
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ItemInfoMatcherTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ItemInfoMatcherTest.kt
new file mode 100644
index 0000000..daba024
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ItemInfoMatcherTest.kt
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.ComponentName
+import android.content.Intent
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
+import com.android.launcher3.model.data.FolderInfo
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.shortcuts.ShortcutKey
+import com.android.launcher3.util.ItemInfoMatcher.ofShortcutKeys
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ItemInfoMatcherTest {
+
+ @Test
+ fun `ofUser returns Predicate for ItemInfo containing given UserHandle`() {
+ val expectedItemInfo = ItemInfo().apply { user = UserHandle(11) }
+ val unexpectedItemInfo = ItemInfo().apply { user = UserHandle(0) }
+ val itemInfoStream = listOf(expectedItemInfo, unexpectedItemInfo).stream()
+
+ val predicate = ItemInfoMatcher.ofUser(UserHandle(11))
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `ofComponents returns Predicate for ItemInfo containing target Component and UserHandle`() {
+ // Given
+ val expectedUserHandle = UserHandle(0)
+ val expectedComponentName = ComponentName("expectedPackage", "expectedClass")
+ val expectedItemInfo = spy(ItemInfo())
+ expectedItemInfo.user = expectedUserHandle
+ whenever(expectedItemInfo.targetComponent).thenReturn(expectedComponentName)
+
+ val unexpectedComponentName = ComponentName("unexpectedPackage", "unexpectedClass")
+ val unexpectedItemInfo1 = spy(ItemInfo())
+ unexpectedItemInfo1.user = expectedUserHandle
+ whenever(unexpectedItemInfo1.targetComponent).thenReturn(unexpectedComponentName)
+
+ val unexpectedItemInfo2 = spy(ItemInfo())
+ unexpectedItemInfo2.user = UserHandle(10)
+ whenever(unexpectedItemInfo2.targetComponent).thenReturn(expectedComponentName)
+
+ val itemInfoStream =
+ listOf(expectedItemInfo, unexpectedItemInfo1, unexpectedItemInfo2).stream()
+
+ // When
+ val predicate =
+ ItemInfoMatcher.ofComponents(hashSetOf(expectedComponentName), expectedUserHandle)
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `ofPackages returns Predicate for ItemInfo containing UserHandle and target package`() {
+ // Given
+ val expectedUserHandle = UserHandle(0)
+ val expectedPackage = "expectedPackage"
+ val expectedComponentName = ComponentName(expectedPackage, "expectedClass")
+ val expectedItemInfo = spy(ItemInfo())
+ expectedItemInfo.user = expectedUserHandle
+ whenever(expectedItemInfo.targetComponent).thenReturn(expectedComponentName)
+
+ val unexpectedPackage = "unexpectedPackage"
+ val unexpectedComponentName = ComponentName(unexpectedPackage, "unexpectedClass")
+ val unexpectedItemInfo1 = spy(ItemInfo())
+ unexpectedItemInfo1.user = expectedUserHandle
+ whenever(unexpectedItemInfo1.targetComponent).thenReturn(unexpectedComponentName)
+
+ val unexpectedItemInfo2 = spy(ItemInfo())
+ unexpectedItemInfo2.user = UserHandle(10)
+ whenever(unexpectedItemInfo2.targetComponent).thenReturn(expectedComponentName)
+
+ val itemInfoStream =
+ listOf(expectedItemInfo, unexpectedItemInfo1, unexpectedItemInfo2).stream()
+
+ // When
+ val predicate = ItemInfoMatcher.ofPackages(setOf(expectedPackage), expectedUserHandle)
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `ofShortcutKeys returns Predicate for Deep Shortcut Info containing given ShortcutKey`() {
+ // Given
+ val expectedItemInfo = spy(ItemInfo())
+ expectedItemInfo.itemType = ITEM_TYPE_DEEP_SHORTCUT
+ val expectedIntent =
+ Intent().apply {
+ putExtra("shortcut_id", "expectedShortcut")
+ `package` = "expectedPackage"
+ }
+ whenever(expectedItemInfo.intent).thenReturn(expectedIntent)
+
+ val unexpectedIntent =
+ Intent().apply {
+ putExtra("shortcut_id", "unexpectedShortcut")
+ `package` = "unexpectedPackage"
+ }
+ val unexpectedItemInfo = spy(ItemInfo())
+ unexpectedItemInfo.itemType = ITEM_TYPE_DEEP_SHORTCUT
+ whenever(unexpectedItemInfo.intent).thenReturn(unexpectedIntent)
+
+ val itemInfoStream = listOf(expectedItemInfo, unexpectedItemInfo).stream()
+ val expectedShortcutKey = ShortcutKey.fromItemInfo(expectedItemInfo)
+
+ // When
+ val predicate = ItemInfoMatcher.ofShortcutKeys(setOf(expectedShortcutKey))
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `forFolderMatch returns Predicate to match against children within Folder ItemInfo`() {
+ // Given
+ val expectedItemInfo = spy(FolderInfo())
+ expectedItemInfo.itemType = ITEM_TYPE_FOLDER
+ val expectedIntent =
+ Intent().apply {
+ putExtra("shortcut_id", "expectedShortcut")
+ `package` = "expectedPackage"
+ }
+ val expectedChildInfo = spy(ItemInfo())
+ expectedChildInfo.itemType = ITEM_TYPE_DEEP_SHORTCUT
+ whenever(expectedChildInfo.intent).thenReturn(expectedIntent)
+ whenever(expectedItemInfo.getContents()).thenReturn(arrayListOf(expectedChildInfo))
+
+ val unexpectedItemInfo = spy(FolderInfo())
+ unexpectedItemInfo.itemType = ITEM_TYPE_FOLDER
+
+ val itemInfoStream = listOf(expectedItemInfo, unexpectedItemInfo).stream()
+ val expectedShortcutKey = ShortcutKey.fromItemInfo(expectedChildInfo)
+
+ // When
+ val predicate = ItemInfoMatcher.forFolderMatch(ofShortcutKeys(setOf(expectedShortcutKey)))
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `ofItemIds returns Predicate to match ItemInfo that contains given ids`() {
+ // Given
+ val expectedItemInfo = spy(ItemInfo())
+ expectedItemInfo.id = 1
+
+ val unexpectedItemInfo = spy(ItemInfo())
+ unexpectedItemInfo.id = 2
+
+ val itemInfoStream = listOf(expectedItemInfo, unexpectedItemInfo).stream()
+
+ // When
+ val expectedIds = IntSet().apply { add(1) }
+ val predicate = ItemInfoMatcher.ofItemIds(expectedIds)
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+
+ @Test
+ fun `ofItems returns Predicate matching against provided ItemInfo`() {
+ // Given
+ val expectedItemInfo = spy(ItemInfo())
+ expectedItemInfo.id = 1
+
+ val unexpectedItemInfo = spy(ItemInfo())
+ unexpectedItemInfo.id = 2
+
+ val itemInfoStream = listOf(expectedItemInfo, unexpectedItemInfo).stream()
+
+ // When
+ val expectedItems = setOf(expectedItemInfo)
+ val predicate = ItemInfoMatcher.ofItems(expectedItems)
+ val actualResults = itemInfoStream.filter(predicate).toList()
+
+ // Then
+ assertThat(actualResults).containsExactly(expectedItemInfo)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java b/tests/multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java
deleted file mode 100644
index ba01b04..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.android.launcher3.util;
-
-
-import android.text.TextUtils;
-import android.util.Pair;
-import android.util.Xml;
-
-import org.xmlpull.v1.XmlSerializer;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Helper class to build xml for Launcher Layout
- */
-public class LauncherLayoutBuilder {
-
- // Object Tags
- private static final String TAG_WORKSPACE = "workspace";
- private static final String TAG_AUTO_INSTALL = "autoinstall";
- private static final String TAG_FOLDER = "folder";
- private static final String TAG_APPWIDGET = "appwidget";
- private static final String TAG_SHORTCUT = "shortcut";
- private static final String TAG_EXTRA = "extra";
-
- private static final String ATTR_CONTAINER = "container";
- private static final String ATTR_RANK = "rank";
-
- private static final String ATTR_PACKAGE_NAME = "packageName";
- private static final String ATTR_CLASS_NAME = "className";
- private static final String ATTR_TITLE = "title";
- private static final String ATTR_TITLE_TEXT = "titleText";
- private static final String ATTR_SCREEN = "screen";
- private static final String ATTR_SHORTCUT_ID = "shortcutId";
-
- // x and y can be specified as negative integers, in which case -1 represents the
- // last row / column, -2 represents the second last, and so on.
- private static final String ATTR_X = "x";
- private static final String ATTR_Y = "y";
- private static final String ATTR_SPAN_X = "spanX";
- private static final String ATTR_SPAN_Y = "spanY";
-
- private static final String ATTR_CHILDREN = "children";
-
-
- // Style attrs -- "Extra"
- private static final String ATTR_KEY = "key";
- private static final String ATTR_VALUE = "value";
-
- private static final String CONTAINER_DESKTOP = "desktop";
- private static final String CONTAINER_HOTSEAT = "hotseat";
-
- private final ArrayList<Pair<String, HashMap<String, Object>>> mNodes = new ArrayList<>();
-
- public Location atHotseat(int rank) {
- Location l = new Location();
- l.items.put(ATTR_CONTAINER, CONTAINER_HOTSEAT);
- l.items.put(ATTR_RANK, Integer.toString(rank));
- return l;
- }
-
- public Location atWorkspace(int x, int y, int screen) {
- Location l = new Location();
- l.items.put(ATTR_CONTAINER, CONTAINER_DESKTOP);
- l.items.put(ATTR_X, Integer.toString(x));
- l.items.put(ATTR_Y, Integer.toString(y));
- l.items.put(ATTR_SCREEN, Integer.toString(screen));
- return l;
- }
-
- public String build() throws IOException {
- StringWriter writer = new StringWriter();
- build(writer);
- return writer.toString();
- }
-
- public void build(Writer writer) throws IOException {
- XmlSerializer serializer = Xml.newSerializer();
- serializer.setOutput(writer);
-
- serializer.startDocument("UTF-8", true);
- serializer.startTag(null, TAG_WORKSPACE);
- writeNodes(serializer, mNodes);
- serializer.endTag(null, TAG_WORKSPACE);
- serializer.endDocument();
- serializer.flush();
- }
-
- private static void writeNodes(XmlSerializer serializer,
- ArrayList<Pair<String, HashMap<String, Object>>> nodes) throws IOException {
- for (Pair<String, HashMap<String, Object>> node : nodes) {
- ArrayList<Pair<String, HashMap<String, Object>>> children = null;
-
- serializer.startTag(null, node.first);
- for (Map.Entry<String, Object> attr : node.second.entrySet()) {
- if (ATTR_CHILDREN.equals(attr.getKey())) {
- children = (ArrayList<Pair<String, HashMap<String, Object>>>) attr.getValue();
- } else {
- serializer.attribute(null, attr.getKey(), (String) attr.getValue());
- }
- }
-
- if (children != null) {
- writeNodes(serializer, children);
- }
- serializer.endTag(null, node.first);
- }
- }
-
- public class Location {
-
- final HashMap<String, Object> items = new HashMap<>();
-
- public LauncherLayoutBuilder putApp(String packageName, String className) {
- items.put(ATTR_PACKAGE_NAME, packageName);
- items.put(ATTR_CLASS_NAME, TextUtils.isEmpty(className) ? packageName : className);
- mNodes.add(Pair.create(TAG_AUTO_INSTALL, items));
- return LauncherLayoutBuilder.this;
- }
-
- public LauncherLayoutBuilder putShortcut(String packageName, String shortcutId) {
- items.put(ATTR_PACKAGE_NAME, packageName);
- items.put(ATTR_SHORTCUT_ID, shortcutId);
- mNodes.add(Pair.create(TAG_SHORTCUT, items));
- return LauncherLayoutBuilder.this;
- }
-
- public LauncherLayoutBuilder putWidget(String packageName, String className,
- int spanX, int spanY) {
- items.put(ATTR_PACKAGE_NAME, packageName);
- items.put(ATTR_CLASS_NAME, className);
- items.put(ATTR_SPAN_X, Integer.toString(spanX));
- items.put(ATTR_SPAN_Y, Integer.toString(spanY));
- mNodes.add(Pair.create(TAG_APPWIDGET, items));
- return LauncherLayoutBuilder.this;
- }
-
- public FolderBuilder putFolder(int titleResId) {
- items.put(ATTR_TITLE, Integer.toString(titleResId));
- return putFolder();
- }
-
- public FolderBuilder putFolder(String title) {
- items.put(ATTR_TITLE_TEXT, title);
- return putFolder();
- }
-
- private FolderBuilder putFolder() {
- FolderBuilder folderBuilder = new FolderBuilder();
- items.put(ATTR_CHILDREN, folderBuilder.mChildren);
- mNodes.add(Pair.create(TAG_FOLDER, items));
- return folderBuilder;
- }
- }
-
- public class FolderBuilder {
-
- final ArrayList<Pair<String, HashMap<String, Object>>> mChildren = new ArrayList<>();
-
- public FolderBuilder addApp(String packageName, String className) {
- HashMap<String, Object> items = new HashMap<>();
- items.put(ATTR_PACKAGE_NAME, packageName);
- items.put(ATTR_CLASS_NAME, TextUtils.isEmpty(className) ? packageName : className);
- mChildren.add(Pair.create(TAG_AUTO_INSTALL, items));
- return this;
- }
-
- public FolderBuilder addShortcut(String packageName, String shortcutId) {
- HashMap<String, Object> items = new HashMap<>();
- items.put(ATTR_PACKAGE_NAME, packageName);
- items.put(ATTR_SHORTCUT_ID, shortcutId);
- mChildren.add(Pair.create(TAG_SHORTCUT, items));
- return this;
- }
-
- public LauncherLayoutBuilder build() {
- return LauncherLayoutBuilder.this;
- }
- }
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/LauncherModelHelper.java b/tests/multivalentTests/src/com/android/launcher3/util/LauncherModelHelper.java
index 002f496..2d53e29 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/LauncherModelHelper.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/LauncherModelHelper.java
@@ -44,29 +44,28 @@
import android.test.mock.MockContentResolver;
import android.util.ArrayMap;
-import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
-import androidx.test.uiautomator.UiDevice;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
-import com.android.launcher3.LauncherModel.ModelUpdateTask;
-import com.android.launcher3.model.AllAppsList;
import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.BgDataModel.Callbacks;
+import com.android.launcher3.model.ModelDbController;
import com.android.launcher3.testing.TestInformationProvider;
import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStreamWriter;
+import java.util.Arrays;
+import java.util.List;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
/**
* Utility class to help manage Launcher Model and related objects for test.
@@ -89,6 +88,23 @@
public static final String TEST_ACTIVITY13 = "com.android.launcher3.tests.Activity14";
public static final String TEST_ACTIVITY14 = "com.android.launcher3.tests.Activity15";
+ public static final List<String> ACTIVITY_LIST = Arrays.asList(
+ TEST_ACTIVITY,
+ TEST_ACTIVITY2,
+ TEST_ACTIVITY3,
+ TEST_ACTIVITY4,
+ TEST_ACTIVITY5,
+ TEST_ACTIVITY6,
+ TEST_ACTIVITY7,
+ TEST_ACTIVITY8,
+ TEST_ACTIVITY9,
+ TEST_ACTIVITY10,
+ TEST_ACTIVITY11,
+ TEST_ACTIVITY12,
+ TEST_ACTIVITY13,
+ TEST_ACTIVITY14
+ );
+
// Authority for providing a test default-workspace-layout data.
private static final String TEST_PROVIDER_AUTHORITY =
LauncherModelHelper.class.getName().toLowerCase();
@@ -115,17 +131,9 @@
public synchronized BgDataModel getBgDataModel() {
if (mDataModel == null) {
- getModel().enqueueModelUpdateTask(new ModelUpdateTask() {
- @Override
- public void init(@NonNull LauncherAppState app, @NonNull LauncherModel model,
- @NonNull BgDataModel dataModel, @NonNull AllAppsList allAppsList,
- @NonNull Executor uiExecutor) {
- mDataModel = dataModel;
- }
-
- @Override
- public void run() { }
- });
+ getModel().enqueueModelUpdateTask((taskController, dataModel, apps) ->
+ mDataModel = dataModel);
+ runOnExecutorSync(Executors.MODEL_EXECUTOR, () -> { });
}
return mDataModel;
}
@@ -140,7 +148,9 @@
icon.eraseColor(Color.RED);
sp.setAppIcon(icon);
sp.setAppLabel(pkg);
- PackageInstaller pi = sandboxContext.getPackageManager().getPackageInstaller();
+ sp.setInstallerPackageName(ApplicationProvider.getApplicationContext().getPackageName());
+ PackageInstaller pi = ApplicationProvider.getApplicationContext().getPackageManager()
+ .getPackageInstaller();
int sessionId = pi.createSession(sp);
mDestroyTask.add(() -> pi.abandonSession(sessionId));
return sessionId;
@@ -176,11 +186,19 @@
public LauncherModelHelper setupDefaultLayoutProvider(LauncherLayoutBuilder builder)
throws Exception {
InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(sandboxContext);
- idp.numRows = idp.numColumns = idp.numDatabaseHotseatIcons = DEFAULT_GRID_SIZE;
- idp.iconBitmapSize = DEFAULT_BITMAP_SIZE;
+ if (idp.numRows == 0 && idp.numColumns == 0) {
+ idp.numRows = idp.numColumns = idp.numDatabaseHotseatIcons = DEFAULT_GRID_SIZE;
+ }
+ if (idp.iconBitmapSize == 0) {
+ idp.iconBitmapSize = DEFAULT_BITMAP_SIZE;
+ }
- UiDevice.getInstance(getInstrumentation()).executeShellCommand(
- "settings put secure launcher3.layout.provider " + TEST_PROVIDER_AUTHORITY);
+ Settings.Secure.putString(sandboxContext.getContentResolver(), "launcher3.layout.provider",
+ TEST_PROVIDER_AUTHORITY);
+
+ // TODO: use a wrapper class to differentiate the behavior
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ builder.build(new OutputStreamWriter(bos));
ContentProvider cp = new TestInformationProvider() {
@Override
@@ -189,8 +207,6 @@
try {
ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe();
AutoCloseOutputStream outputStream = new AutoCloseOutputStream(pipe[1]);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- builder.build(new OutputStreamWriter(bos));
outputStream.write(bos.toByteArray());
outputStream.flush();
outputStream.close();
@@ -201,9 +217,13 @@
}
};
setupProvider(TEST_PROVIDER_AUTHORITY, cp);
+ RoboApiWrapper.INSTANCE.registerInputStream(sandboxContext.getContentResolver(),
+ ModelDbController.getLayoutUri(TEST_PROVIDER_AUTHORITY, sandboxContext),
+ ()-> new ByteArrayInputStream(bos.toByteArray()));
+
mDestroyTask.add(() -> runOnExecutorSync(MODEL_EXECUTOR, () ->
- UiDevice.getInstance(getInstrumentation()).executeShellCommand(
- "settings delete secure launcher3.layout.provider")));
+ Settings.Secure.putString(sandboxContext.getContentResolver(),
+ "launcher3.layout.provider", "")));
return this;
}
@@ -215,7 +235,7 @@
MAIN_EXECUTOR.submit(() -> getModel().addCallbacksAndLoad(mockCb)).get();
Executors.MODEL_EXECUTOR.submit(() -> { }).get();
- MAIN_EXECUTOR.submit(() -> { }).get();
+ getInstrumentation().waitForIdleSync();
MAIN_EXECUTOR.submit(() -> getModel().removeCallbacks(mockCb)).get();
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/LauncherMultivalentJUnit.kt b/tests/multivalentTests/src/com/android/launcher3/util/LauncherMultivalentJUnit.kt
new file mode 100644
index 0000000..e8560af
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/LauncherMultivalentJUnit.kt
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.util
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.google.common.collect.ImmutableList
+import java.util.Locale
+import kotlin.annotation.AnnotationRetention.RUNTIME
+import kotlin.annotation.AnnotationTarget.CLASS
+import org.junit.runner.Runner
+import org.junit.runners.Suite
+
+/**
+ * A custom runner for multivalent tests with launcher specific features
+ * 1) Adds support for @UiThread annotations in deviceless tests
+ * 2) Allows emulating multiple devices when running in deviceless mode
+ */
+class LauncherMultivalentJUnit(klass: Class<*>?) : Suite(klass, ImmutableList.of()) {
+
+ val runners: List<Runner> =
+ (testClass.getAnnotation(EmulatedDevices::class.java)?.value ?: emptyArray()).let { devices
+ ->
+ if (!isRunningInRobolectric) {
+ return@let null
+ }
+ try {
+ (testClass.javaClass.classLoader.loadClass(ROBOLECTRIC_RUNNER) as Class<Runner>)
+ .getConstructor(Class::class.java, String::class.java)
+ .let { ctor ->
+ if (devices.isEmpty()) listOf(ctor.newInstance(testClass.javaClass, null))
+ else devices.map { ctor.newInstance(testClass.javaClass, it) }
+ }
+ } catch (e: Exception) {
+ null
+ }
+ }
+ ?: listOf(AndroidJUnit4(testClass.javaClass))
+
+ override fun getChildren() = runners
+
+ /**
+ * Annotation to be added to a test so run it on a list of emulated devices for deviceless test
+ */
+ @Retention(RUNTIME) @Target(CLASS) annotation class EmulatedDevices(val value: Array<String>)
+
+ companion object {
+ private const val ROBOLECTRIC_RUNNER = "com.android.launcher3.util.RobolectricDeviceRunner"
+
+ val isRunningInRobolectric: Boolean
+ get() =
+ if (
+ System.getProperty("java.runtime.name")
+ .lowercase(Locale.getDefault())
+ .contains("android")
+ ) {
+ false
+ } else {
+ try {
+ // Check if robolectric runner exists
+ Class.forName("org.robolectric.RobolectricTestRunner") != null
+ } catch (e: ClassNotFoundException) {
+ false
+ }
+ }
+ }
+}
diff --git a/tests/src/com/android/launcher3/util/LockedUserStateTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/LockedUserStateTest.kt
similarity index 95%
rename from tests/src/com/android/launcher3/util/LockedUserStateTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/util/LockedUserStateTest.kt
index 2c4a54f..2711d7a 100644
--- a/tests/src/com/android/launcher3/util/LockedUserStateTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/util/LockedUserStateTest.kt
@@ -28,7 +28,7 @@
import org.junit.runner.RunWith
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
-import org.mockito.kotlin.verifyZeroInteractions
+import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.whenever
/** Unit tests for {@link LockedUserState} */
@@ -58,7 +58,8 @@
val action: Runnable = mock()
val state = LockedUserState(context)
state.runOnUserUnlocked(action)
- verifyZeroInteractions(action)
+ // b/343530737
+ verifyNoMoreInteractions(action)
state.mUserUnlockedReceiver.onReceive(context, Intent(Intent.ACTION_USER_UNLOCKED))
verify(action).run()
}
diff --git a/tests/src/com/android/launcher3/util/PackageManagerHelperTest.java b/tests/multivalentTests/src/com/android/launcher3/util/PackageManagerHelperTest.java
similarity index 93%
rename from tests/src/com/android/launcher3/util/PackageManagerHelperTest.java
rename to tests/multivalentTests/src/com/android/launcher3/util/PackageManagerHelperTest.java
index d1da5f4..b5e797e 100644
--- a/tests/src/com/android/launcher3/util/PackageManagerHelperTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/PackageManagerHelperTest.java
@@ -34,6 +34,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
import org.junit.Rule;
@@ -63,6 +64,8 @@
mContext = mock(Context.class);
mLauncherApps = mock(LauncherApps.class);
when(mContext.getSystemService(eq(LauncherApps.class))).thenReturn(mLauncherApps);
+ when(mContext.getResources()).thenReturn(
+ InstrumentationRegistry.getInstrumentation().getTargetContext().getResources());
mPackageManagerHelper = new PackageManagerHelper(mContext);
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/RunnableListTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/RunnableListTest.kt
new file mode 100644
index 0000000..94bd7c9
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/RunnableListTest.kt
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.reset
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class RunnableListTest {
+
+ @Mock private lateinit var runnable1: Runnable
+ @Mock private lateinit var runnable2: Runnable
+
+ private val underTest = RunnableList()
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ @Test
+ fun not_destroyedByDefault() {
+ assertThat(underTest.isDestroyed).isFalse()
+ }
+
+ @Test
+ fun add_and_run() {
+ underTest.add(runnable1)
+ underTest.add(runnable2)
+
+ underTest.executeAllAndDestroy()
+
+ verify(runnable1).run()
+ verify(runnable2).run()
+ assertThat(underTest.isDestroyed).isTrue()
+ }
+
+ @Test
+ fun add_to_destroyed_runnableList_run_immediately() {
+ underTest.executeAllAndDestroy()
+
+ underTest.add(runnable1)
+
+ verify(runnable1).run()
+ }
+
+ @Test
+ fun second_executeAllAndDestroy_noOp() {
+ underTest.executeAllAndDestroy()
+ underTest.add(runnable1)
+ reset(runnable1)
+
+ underTest.executeAllAndDestroy()
+
+ verifyNoMoreInteractions(runnable1)
+ }
+
+ @Test
+ fun executeAllAndClear_run_not_destroy() {
+ underTest.add(runnable1)
+ underTest.add(runnable2)
+
+ underTest.executeAllAndClear()
+
+ verify(runnable1).run()
+ verify(runnable2).run()
+ assertThat(underTest.isDestroyed).isFalse()
+ }
+
+ @Test
+ fun executeAllAndClear_not_destroy() {
+ underTest.executeAllAndClear()
+ underTest.add(runnable1)
+ reset(runnable1)
+
+ underTest.executeAllAndClear()
+
+ verify(runnable1).run()
+ }
+
+ @Test
+ fun remove_and_run_not_executed() {
+ underTest.add(runnable1)
+ underTest.add(runnable2)
+
+ underTest.remove(runnable1)
+ underTest.executeAllAndClear()
+
+ verifyNoMoreInteractions(runnable1)
+ verify(runnable2).run()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ScreenOnTrackerTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ScreenOnTrackerTest.kt
new file mode 100644
index 0000000..430aad2
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ScreenOnTrackerTest.kt
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.Context
+import android.content.Intent
+import android.content.Intent.ACTION_SCREEN_OFF
+import android.content.Intent.ACTION_SCREEN_ON
+import android.content.Intent.ACTION_USER_PRESENT
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.verify
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ScreenOnTrackerTest {
+
+ @Mock private lateinit var receiver: SimpleBroadcastReceiver
+ @Mock private lateinit var context: Context
+ @Mock private lateinit var listener: ScreenOnTracker.ScreenOnListener
+
+ private lateinit var underTest: ScreenOnTracker
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ underTest = ScreenOnTracker(context, receiver)
+ }
+
+ @Test
+ fun test_default_state() {
+ verify(receiver).register(context, ACTION_SCREEN_ON, ACTION_SCREEN_OFF, ACTION_USER_PRESENT)
+ assertThat(underTest.isScreenOn).isTrue()
+ }
+
+ @Test
+ fun close_unregister_receiver() {
+ underTest.close()
+
+ verify(receiver).unregisterReceiverSafely(context)
+ }
+
+ @Test
+ fun add_listener_then_receive_screen_on_intent_notify_listener() {
+ underTest.addListener(listener)
+
+ underTest.onReceive(Intent(ACTION_SCREEN_ON))
+
+ verify(listener).onScreenOnChanged(true)
+ assertThat(underTest.isScreenOn).isTrue()
+ }
+
+ @Test
+ fun add_listener_then_receive_screen_off_intent_notify_listener() {
+ underTest.addListener(listener)
+
+ underTest.onReceive(Intent(ACTION_SCREEN_OFF))
+
+ verify(listener).onScreenOnChanged(false)
+ assertThat(underTest.isScreenOn).isFalse()
+ }
+
+ @Test
+ fun add_listener_then_receive_user_present_intent_notify_listener() {
+ underTest.addListener(listener)
+
+ underTest.onReceive(Intent(ACTION_USER_PRESENT))
+
+ verify(listener).onUserPresent()
+ assertThat(underTest.isScreenOn).isTrue()
+ }
+
+ @Test
+ fun remove_listener_then_receive_intent_noOp() {
+ underTest.addListener(listener)
+
+ underTest.removeListener(listener)
+
+ underTest.onReceive(Intent(ACTION_USER_PRESENT))
+ verifyNoMoreInteractions(listener)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ShortcutUtilTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ShortcutUtilTest.kt
new file mode 100644
index 0000000..c43e563
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ShortcutUtilTest.kt
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.Utilities
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import org.junit.Assert.assertArrayEquals
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNull
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ShortcutUtilTest {
+
+ @Test
+ fun `supportsShortcuts returns true if the item is active and it is an app`() {
+ // A blank workspace item info should be active and should be ITEM_TYPE_APPLICATION
+ val itemInfo = WorkspaceItemInfo()
+ // Action
+ val result = ShortcutUtil.supportsShortcuts(itemInfo)
+ // Verify
+ assertEquals(true, result)
+ }
+
+ @Test
+ fun `supportsDeepShortcuts returns true if the app is active and an app and widgets are enabled`() {
+ // Setup
+ val itemInfo = WorkspaceItemInfo()
+ // Action
+ val result = ShortcutUtil.supportsDeepShortcuts(itemInfo)
+ // Verify
+ assertEquals(true, result)
+ }
+
+ @Test
+ fun `getShortcutIdIfPinnedShortcut returns null if the item is an app`() {
+ // Setup
+ val itemInfo = WorkspaceItemInfo()
+ // Action
+ val result = ShortcutUtil.getShortcutIdIfPinnedShortcut(itemInfo)
+ // Verify
+ assertNull(result)
+ }
+
+ @Test
+ fun `getPersonKeysIfPinnedShortcut returns empty string array if item type is an app`() {
+ // Setup
+ val itemInfo = WorkspaceItemInfo()
+ // Action
+ val result = ShortcutUtil.getPersonKeysIfPinnedShortcut(itemInfo)
+ // Verify
+ assertArrayEquals(Utilities.EMPTY_STRING_ARRAY, result)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/SimpleBroadcastReceiverTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/SimpleBroadcastReceiverTest.kt
new file mode 100644
index 0000000..d3e27b6
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/SimpleBroadcastReceiverTest.kt
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.os.Handler
+import android.os.Looper
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR
+import com.google.common.truth.Truth.assertThat
+import java.util.function.Consumer
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.ArgumentMatchers.eq
+import org.mockito.ArgumentMatchers.same
+import org.mockito.Captor
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class SimpleBroadcastReceiverTest {
+
+ private lateinit var underTest: SimpleBroadcastReceiver
+
+ @Mock private lateinit var intentConsumer: Consumer<Intent>
+ @Mock private lateinit var context: Context
+ @Mock private lateinit var completionRunnable: Runnable
+ @Captor private lateinit var intentFilterCaptor: ArgumentCaptor<IntentFilter>
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ underTest = SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, intentConsumer)
+ if (Looper.getMainLooper() == null) {
+ Looper.prepareMainLooper()
+ }
+ }
+
+ @Test
+ fun async_register() {
+ underTest.register(context, "test_action_1", "test_action_2")
+ awaitTasksCompleted()
+
+ verify(context).registerReceiver(same(underTest), intentFilterCaptor.capture())
+ val intentFilter = intentFilterCaptor.value
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ @Test
+ fun async_register_withCompletionRunnable() {
+ underTest.register(context, completionRunnable, "test_action_1", "test_action_2")
+ awaitTasksCompleted()
+
+ verify(context).registerReceiver(same(underTest), intentFilterCaptor.capture())
+ verify(completionRunnable).run()
+ val intentFilter = intentFilterCaptor.value
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ @Test
+ fun async_register_withCompletionRunnable_and_flag() {
+ underTest.register(context, completionRunnable, 1, "test_action_1", "test_action_2")
+ awaitTasksCompleted()
+
+ verify(context).registerReceiver(same(underTest), intentFilterCaptor.capture(), eq(1))
+ verify(completionRunnable).run()
+ val intentFilter = intentFilterCaptor.value
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ @Test
+ fun async_register_with_package() {
+ underTest.registerPkgActions(context, "pkg", "test_action_1", "test_action_2")
+
+ awaitTasksCompleted()
+ verify(context).registerReceiver(same(underTest), intentFilterCaptor.capture())
+ val intentFilter = intentFilterCaptor.value
+ assertThat(intentFilter.getDataScheme(0)).isEqualTo("package")
+ assertThat(intentFilter.getDataSchemeSpecificPart(0).path).isEqualTo("pkg")
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ @Test
+ fun sync_register_withCompletionRunnable_and_flag() {
+ underTest = SimpleBroadcastReceiver(Handler(Looper.getMainLooper()), intentConsumer)
+
+ underTest.register(context, completionRunnable, 1, "test_action_1", "test_action_2")
+ getInstrumentation().waitForIdleSync()
+
+ verify(context).registerReceiver(same(underTest), intentFilterCaptor.capture(), eq(1))
+ verify(completionRunnable).run()
+ val intentFilter = intentFilterCaptor.value
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ @Test
+ fun async_unregister() {
+ underTest.unregisterReceiverSafely(context)
+
+ awaitTasksCompleted()
+ verify(context).unregisterReceiver(same(underTest))
+ }
+
+ @Test
+ fun sync_unregister() {
+ underTest = SimpleBroadcastReceiver(Handler(Looper.getMainLooper()), intentConsumer)
+
+ underTest.unregisterReceiverSafely(context)
+ getInstrumentation().waitForIdleSync()
+
+ verify(context).unregisterReceiver(same(underTest))
+ }
+
+ @Test
+ fun getPackageFilter() {
+ val intentFilter =
+ SimpleBroadcastReceiver.getPackageFilter("pkg", "test_action_1", "test_action_2")
+
+ assertThat(intentFilter.getDataScheme(0)).isEqualTo("package")
+ assertThat(intentFilter.getDataSchemeSpecificPart(0).path).isEqualTo("pkg")
+ assertThat(intentFilter.countActions()).isEqualTo(2)
+ assertThat(intentFilter.getAction(0)).isEqualTo("test_action_1")
+ assertThat(intentFilter.getAction(1)).isEqualTo("test_action_2")
+ }
+
+ private fun awaitTasksCompleted() {
+ UI_HELPER_EXECUTOR.submit<Any> { null }.get()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/SystemUiControllerTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/SystemUiControllerTest.kt
new file mode 100644
index 0000000..612fcd4
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/SystemUiControllerTest.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.view.View
+import android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+import android.view.Window
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.util.SystemUiController.FLAG_DARK_NAV
+import com.android.launcher3.util.SystemUiController.FLAG_DARK_STATUS
+import com.android.launcher3.util.SystemUiController.FLAG_LIGHT_NAV
+import com.android.launcher3.util.SystemUiController.FLAG_LIGHT_STATUS
+import com.android.launcher3.util.SystemUiController.UI_STATE_BASE_WINDOW
+import com.android.launcher3.util.SystemUiController.UI_STATE_SCRIM_VIEW
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.ArgumentMatchers.eq
+import org.mockito.Mock
+import org.mockito.Mockito.never
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class SystemUiControllerTest {
+
+ @Mock private lateinit var window: Window
+ @Mock private lateinit var decorView: View
+
+ private lateinit var underTest: SystemUiController
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ `when`(window.decorView).thenReturn(decorView)
+ underTest = SystemUiController(window)
+ }
+
+ @Test
+ fun test_default_state() {
+ assertThat(underTest.toString()).isEqualTo("mStates=[0, 0, 0, 0, 0]")
+ }
+
+ @Test
+ fun update_state_base_window_light() {
+ underTest.updateUiState(UI_STATE_BASE_WINDOW, /* isLight= */ true)
+
+ val visibility =
+ View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+ verify(decorView).systemUiVisibility = eq(visibility)
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(visibility)
+ val flag = FLAG_LIGHT_NAV or FLAG_LIGHT_STATUS
+ assertThat(underTest.toString()).isEqualTo("mStates=[$flag, 0, 0, 0, 0]")
+ }
+
+ @Test
+ fun update_state_scrim_view_light() {
+ underTest.updateUiState(UI_STATE_SCRIM_VIEW, /* isLight= */ true)
+
+ verify(decorView).systemUiVisibility =
+ eq(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(0)
+ val flag = FLAG_LIGHT_NAV or FLAG_LIGHT_STATUS
+ assertThat(underTest.toString()).isEqualTo("mStates=[0, $flag, 0, 0, 0]")
+ }
+
+ @Test
+ fun update_state_base_window_dark() {
+ underTest.updateUiState(UI_STATE_BASE_WINDOW, /* isLight= */ false)
+
+ verify(decorView, never()).systemUiVisibility = anyInt()
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(0)
+ val flag = FLAG_DARK_NAV or FLAG_DARK_STATUS
+ assertThat(underTest.toString()).isEqualTo("mStates=[$flag, 0, 0, 0, 0]")
+ }
+
+ @Test
+ fun update_state_scrim_view_dark() {
+ underTest.updateUiState(UI_STATE_SCRIM_VIEW, /* isLight= */ false)
+
+ verify(decorView, never()).systemUiVisibility = anyInt()
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(0)
+ val flag = FLAG_DARK_NAV or FLAG_DARK_STATUS
+ assertThat(underTest.toString()).isEqualTo("mStates=[0, $flag, 0, 0, 0]")
+ }
+
+ @Test
+ fun get_base_sysui_visibility() {
+ `when`(decorView.systemUiVisibility).thenReturn(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
+
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
+ }
+
+ @Test
+ fun update_state_base_window_light_with_existing_visibility() {
+ `when`(decorView.systemUiVisibility).thenReturn(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
+
+ underTest.updateUiState(UI_STATE_BASE_WINDOW, /* isLight= */ true)
+
+ val visibility =
+ View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or
+ View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or
+ SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ assertThat(underTest.baseSysuiVisibility).isEqualTo(visibility)
+ verify(decorView).systemUiVisibility = eq(visibility)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/TestDispatcherProvider.kt b/tests/multivalentTests/src/com/android/launcher3/util/TestDispatcherProvider.kt
new file mode 100644
index 0000000..39e1ec5
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/TestDispatcherProvider.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import com.android.launcher3.util.coroutines.DispatcherProvider
+import kotlinx.coroutines.CoroutineDispatcher
+
+class TestDispatcherProvider(testDispatcher: CoroutineDispatcher) : DispatcherProvider {
+ override val default: CoroutineDispatcher = testDispatcher
+ override val io: CoroutineDispatcher = testDispatcher
+ override val main: CoroutineDispatcher = testDispatcher
+ override val unconfined: CoroutineDispatcher = testDispatcher
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/TestResourceHelper.kt b/tests/multivalentTests/src/com/android/launcher3/util/TestResourceHelper.kt
new file mode 100644
index 0000000..d95c6f8
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/TestResourceHelper.kt
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.Context
+import android.content.res.TypedArray
+import android.util.AttributeSet
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.R
+import kotlin.IntArray
+
+class TestResourceHelper(private val context: Context, specsFileId: Int) :
+ ResourceHelper(context, specsFileId) {
+
+ val responsiveStyleables = listOf(
+ R.styleable.SizeSpec,
+ R.styleable.WorkspaceSpec,
+ R.styleable.FolderSpec,
+ R.styleable.AllAppsSpec,
+ R.styleable.ResponsiveSpecGroup
+ )
+
+ override fun obtainStyledAttributes(attrs: AttributeSet, styleId: IntArray): TypedArray {
+ val clone =
+ if (responsiveStyleables.any { styleId.contentEquals(it) }) {
+ convertStyleId(styleId)
+ } else {
+ styleId.clone()
+ }
+
+ return context.obtainStyledAttributes(attrs, clone)
+ }
+
+ private fun convertStyleId(styleableArr: IntArray): IntArray {
+ val targetContextRes = getInstrumentation().targetContext.resources
+ val context = getInstrumentation().context
+ return styleableArr
+ .map { attrId -> targetContextRes.getResourceName(attrId).split(":").last() }
+ .map { attrName ->
+ // Get required attr from context instead of targetContext
+ context.resources.getIdentifier(attrName, null, context.packageName)
+ }
+ .toIntArray()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/TestSandboxModelContextWrapper.java b/tests/multivalentTests/src/com/android/launcher3/util/TestSandboxModelContextWrapper.java
index 3f37563..71637f1 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/TestSandboxModelContextWrapper.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/TestSandboxModelContextWrapper.java
@@ -32,6 +32,7 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.popup.PopupDataProvider;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
@@ -57,6 +58,8 @@
protected ActivityAllAppsContainerView<ActivityContextWrapper> mAppsView;
private final PopupDataProvider mPopupDataProvider = new PopupDataProvider(i -> {});
+ private final WidgetPickerDataProvider mWidgetPickerDataProvider =
+ new WidgetPickerDataProvider();
protected final UserCache mUserCache;
public TestSandboxModelContextWrapper(SandboxContext base) {
@@ -76,12 +79,19 @@
mAppsList = mAppsView.getPersonalAppList();
mAllAppsStore = mAppsView.getAppsStore();
}
+
@Nullable
@Override
public PopupDataProvider getPopupDataProvider() {
return mPopupDataProvider;
}
+ @Nullable
+ @Override
+ public WidgetPickerDataProvider getWidgetPickerDataProvider() {
+ return mWidgetPickerDataProvider;
+ }
+
@Override
public ActivityAllAppsContainerView<ActivityContextWrapper> getAppsView() {
return mAppsView;
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/VibratorWrapperTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/VibratorWrapperTest.kt
new file mode 100644
index 0000000..330c394
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/VibratorWrapperTest.kt
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.media.AudioAttributes
+import android.os.SystemClock
+import android.os.VibrationEffect
+import android.os.VibrationEffect.Composition.PRIMITIVE_LOW_TICK
+import android.os.VibrationEffect.Composition.PRIMITIVE_TICK
+import android.os.Vibrator
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.util.VibratorWrapper.HAPTIC_FEEDBACK_URI
+import com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC
+import com.android.launcher3.util.VibratorWrapper.VIBRATION_ATTRS
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Captor
+import org.mockito.Mock
+import org.mockito.Mockito.any
+import org.mockito.Mockito.reset
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.never
+import org.mockito.kotlin.same
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class VibratorWrapperTest {
+
+ @Mock private lateinit var settingsCache: SettingsCache
+ @Mock private lateinit var vibrator: Vibrator
+ @Captor private lateinit var vibrationEffectCaptor: ArgumentCaptor<VibrationEffect>
+
+ private lateinit var underTest: VibratorWrapper
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ `when`(settingsCache.getValue(HAPTIC_FEEDBACK_URI, 0)).thenReturn(true)
+ `when`(vibrator.hasVibrator()).thenReturn(true)
+ `when`(vibrator.areAllPrimitivesSupported(PRIMITIVE_TICK)).thenReturn(true)
+ `when`(vibrator.areAllPrimitivesSupported(PRIMITIVE_LOW_TICK)).thenReturn(true)
+ `when`(vibrator.getPrimitiveDurations(PRIMITIVE_LOW_TICK)).thenReturn(intArrayOf(10))
+
+ underTest = VibratorWrapper(vibrator, settingsCache)
+ }
+
+ @Test
+ fun init_register_onChangeListener() {
+ verify(settingsCache).register(HAPTIC_FEEDBACK_URI, underTest.mHapticChangeListener)
+ }
+
+ @Test
+ fun close_unregister_onChangeListener() {
+ underTest.close()
+
+ verify(settingsCache).unregister(HAPTIC_FEEDBACK_URI, underTest.mHapticChangeListener)
+ }
+
+ @Test
+ fun vibrate() {
+ underTest.vibrate(OVERVIEW_HAPTIC)
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(OVERVIEW_HAPTIC, VIBRATION_ATTRS)
+ }
+
+ @Test
+ fun vibrate_primitive_id() {
+ underTest.vibrate(PRIMITIVE_TICK, 1f, OVERVIEW_HAPTIC)
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(vibrationEffectCaptor.capture(), same(VIBRATION_ATTRS))
+ val expectedEffect =
+ VibrationEffect.startComposition().addPrimitive(PRIMITIVE_TICK, 1f).compose()
+ assertThat(vibrationEffectCaptor.value).isEqualTo(expectedEffect)
+ }
+
+ @Test
+ fun vibrate_with_invalid_primitive_id_use_fallback_effect() {
+ underTest.vibrate(-1, 1f, OVERVIEW_HAPTIC)
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(OVERVIEW_HAPTIC, VIBRATION_ATTRS)
+ }
+
+ @Test
+ fun vibrate_for_taskbar_unstash() {
+ underTest.vibrateForTaskbarUnstash()
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(vibrationEffectCaptor.capture(), same(VIBRATION_ATTRS))
+ val expectedEffect =
+ VibrationEffect.startComposition()
+ .addPrimitive(PRIMITIVE_LOW_TICK, VibratorWrapper.LOW_TICK_SCALE)
+ .compose()
+ assertThat(vibrationEffectCaptor.value).isEqualTo(expectedEffect)
+ }
+
+ @Test
+ fun vibrate_for_drag_bump() {
+ underTest.vibrateForDragBump()
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(vibrationEffectCaptor.capture(), same(VIBRATION_ATTRS))
+ val expectedEffect =
+ VibrationEffect.startComposition()
+ .addPrimitive(PRIMITIVE_LOW_TICK, VibratorWrapper.DRAG_BUMP_SCALE)
+ .compose()
+ assertThat(vibrationEffectCaptor.value).isEqualTo(expectedEffect)
+ }
+
+ @Test
+ fun vibrate_for_drag_commit() {
+ underTest.vibrateForDragCommit()
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(vibrationEffectCaptor.capture(), same(VIBRATION_ATTRS))
+ val expectedEffect =
+ VibrationEffect.startComposition()
+ .addPrimitive(PRIMITIVE_TICK, VibratorWrapper.DRAG_COMMIT_SCALE)
+ .compose()
+ assertThat(vibrationEffectCaptor.value).isEqualTo(expectedEffect)
+ }
+
+ @Test
+ fun vibrate_for_drag_texture() {
+ SystemClock.setCurrentTimeMillis(40000)
+
+ underTest.vibrateForDragTexture()
+
+ awaitTasksCompleted()
+ verify(vibrator).vibrate(vibrationEffectCaptor.capture(), same(VIBRATION_ATTRS))
+ assertThat(vibrationEffectCaptor.value).isEqualTo(VibratorWrapper.getDragEffect())
+ }
+
+ @Test
+ fun vibrate_for_drag_texture_within_time_window_noOp() {
+ SystemClock.setCurrentTimeMillis(40000)
+ underTest.vibrateForDragTexture()
+ awaitTasksCompleted()
+ reset(vibrator)
+
+ underTest.vibrateForDragTexture()
+
+ verifyNoMoreInteractions(vibrator)
+ }
+
+ @Test
+ fun haptic_feedback_disabled_no_vibrate() {
+ `when`(vibrator.hasVibrator()).thenReturn(false)
+ underTest = VibratorWrapper(vibrator, settingsCache)
+
+ underTest.vibrate(OVERVIEW_HAPTIC)
+
+ awaitTasksCompleted()
+ verify(vibrator, never())
+ .vibrate(any(VibrationEffect::class.java), any(AudioAttributes::class.java))
+ }
+
+ @Test
+ fun cancel_vibrate() {
+ underTest.cancelVibrate()
+
+ awaitTasksCompleted()
+ verify(vibrator).cancel()
+ }
+
+ private fun awaitTasksCompleted() {
+ Executors.UI_HELPER_EXECUTOR.submit<Any> { null }.get()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ViewCacheTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ViewCacheTest.kt
new file mode 100644
index 0000000..d82818d
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ViewCacheTest.kt
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.R
+import com.android.launcher3.util.ViewCache.CacheEntry
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ViewCacheTest {
+
+ private lateinit var underTest: ViewCache
+
+ private val context = InstrumentationRegistry.getInstrumentation().context
+ private val layoutId =
+ context.run { resources.getIdentifier("test_layout_appwidget_blue", "layout", packageName) }
+
+ @Before
+ fun setUp() {
+ underTest = ViewCache()
+ underTest.setCacheSize(layoutId, 5)
+ }
+
+ @Test
+ fun get_view_from_empty_cache() {
+ val view: View = underTest.getView(layoutId, context, null)
+
+ val cacheEntry = view.getTag(R.id.cache_entry_tag_id) as ViewCache.CacheEntry
+ assertThat(cacheEntry).isNotNull()
+ assertThat(cacheEntry.mMaxSize).isEqualTo(5)
+ assertThat(cacheEntry.mCurrentSize).isEqualTo(0)
+ assertThat(cacheEntry.mViews[0]).isNull()
+ }
+
+ @Test
+ fun recyclerView() {
+ val view: View = underTest.getView(layoutId, context, null)
+ val cacheEntry = view.getTag(R.id.cache_entry_tag_id) as ViewCache.CacheEntry
+
+ underTest.recycleView(layoutId, view)
+
+ assertThat(cacheEntry.mMaxSize).isEqualTo(5)
+ assertThat(cacheEntry.mCurrentSize).isEqualTo(1)
+ assertThat(cacheEntry.mViews[0]).isSameInstanceAs(view)
+ }
+
+ @Test
+ fun get_view_from_cache() {
+ val view: View = underTest.getView(layoutId, context, null)
+ underTest.recycleView(layoutId, view)
+
+ val newView = underTest.getView<View>(layoutId, context, null)
+
+ assertThat(view).isSameInstanceAs(newView)
+ }
+
+ @Test
+ fun change_tag_id_recyclerView_noOp() {
+ val view: View = underTest.getView(layoutId, context, null)
+ val cacheEntry = view.getTag(R.id.cache_entry_tag_id) as ViewCache.CacheEntry
+
+ view.setTag(R.id.cache_entry_tag_id, CacheEntry(3))
+ underTest.recycleView(layoutId, view)
+
+ assertThat(cacheEntry.mMaxSize).isEqualTo(5)
+ assertThat(cacheEntry.mCurrentSize).isEqualTo(0)
+ assertThat(cacheEntry.mViews[0]).isNull()
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ViewOnDrawExecutorTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ViewOnDrawExecutorTest.kt
new file mode 100644
index 0000000..d26c4d4
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ViewOnDrawExecutorTest.kt
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.view.View
+import android.view.ViewTreeObserver
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.Launcher
+import com.android.launcher3.Workspace
+import com.android.launcher3.pageindicators.PageIndicator
+import java.util.function.Consumer
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.reset
+import org.mockito.kotlin.same
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+@RunWith(AndroidJUnit4::class)
+class ViewOnDrawExecutorTest<T> where T : View, T : PageIndicator {
+
+ @Mock private lateinit var runnable: Runnable
+ @Mock private lateinit var consumer: Consumer<ViewOnDrawExecutor>
+ @Mock private lateinit var launcher: Launcher
+ @Mock private lateinit var workspace: Workspace<T>
+ @Mock private lateinit var rootView: View
+ @Mock private lateinit var viewTreeObserver: ViewTreeObserver
+
+ private lateinit var underTest: ViewOnDrawExecutor
+ private lateinit var runnableList: RunnableList
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ runnableList = RunnableList()
+ runnableList.add(runnable)
+ underTest = ViewOnDrawExecutor(runnableList, consumer)
+
+ `when`(launcher.workspace).thenReturn(workspace)
+ `when`(workspace.rootView).thenReturn(rootView)
+ `when`(workspace.viewTreeObserver).thenReturn(viewTreeObserver)
+ }
+
+ @Test
+ fun attachToLauncher_alreadyAttachedToWindow() {
+ `when`(workspace.isAttachedToWindow).thenReturn(true)
+
+ underTest.attachTo(launcher)
+
+ verify(workspace).addOnAttachStateChangeListener(same(underTest))
+ verify(viewTreeObserver).addOnDrawListener(same(underTest))
+ verify(rootView).invalidate()
+ }
+
+ @Test
+ fun attachToLauncher_notAttachedToWindow() {
+ `when`(workspace.isAttachedToWindow).thenReturn(false)
+
+ underTest.attachTo(launcher)
+
+ verify(workspace).addOnAttachStateChangeListener(same(underTest))
+ verifyNoMoreInteractions(viewTreeObserver)
+ verifyNoMoreInteractions(rootView)
+ }
+
+ @Test
+ fun onViewAttachedToWindow_registerObserver() {
+ `when`(workspace.isAttachedToWindow).thenReturn(false)
+ underTest.attachTo(launcher)
+
+ underTest.onViewAttachedToWindow(rootView)
+
+ verify(viewTreeObserver).addOnDrawListener(same(underTest))
+ verify(rootView).invalidate()
+ }
+
+ @Test
+ fun complete_then_onViewAttachedToWindow_registerObserver() {
+ underTest.markCompleted()
+ reset(viewTreeObserver)
+ reset(rootView)
+
+ underTest.onViewAttachedToWindow(rootView)
+
+ verifyNoMoreInteractions(viewTreeObserver)
+ verifyNoMoreInteractions(rootView)
+ }
+
+ @Test
+ fun onDraw_postRunnable() {
+ underTest.attachTo(launcher)
+
+ underTest.onDraw()
+
+ verify(workspace).post(same(underTest))
+ }
+
+ @Test
+ fun run_before_onDraw_noOp() {
+ underTest.run()
+
+ verifyNoMoreInteractions(runnable)
+ verifyNoMoreInteractions(viewTreeObserver)
+ verifyNoMoreInteractions(workspace)
+ verifyNoMoreInteractions(consumer)
+ }
+
+ @Test
+ fun first_run_executeRunnable() {
+ underTest.attachTo(launcher)
+ underTest.onDraw()
+
+ underTest.run()
+
+ verify(runnable).run()
+ verify(viewTreeObserver).removeOnDrawListener(same(underTest))
+ verify(workspace).removeOnAttachStateChangeListener(same(underTest))
+ verify(consumer).accept(same(underTest))
+ }
+
+ @Test
+ fun second_run_noOp() {
+ underTest.attachTo(launcher)
+ underTest.onDraw()
+ underTest.run()
+ reset(runnable)
+ reset(viewTreeObserver)
+ reset(workspace)
+ reset(consumer)
+
+ underTest.run()
+
+ verifyNoMoreInteractions(runnable)
+ verifyNoMoreInteractions(viewTreeObserver)
+ verifyNoMoreInteractions(workspace)
+ verifyNoMoreInteractions(consumer)
+ }
+
+ @Test
+ fun markCompleted_viewNotAttached() {
+ underTest.markCompleted()
+
+ verify(runnable).run()
+ verify(consumer).accept(underTest)
+ verifyNoMoreInteractions(workspace)
+ }
+
+ @Test
+ fun markCompleted_viewAttached() {
+ underTest.attachTo(launcher)
+
+ underTest.markCompleted()
+
+ verify(runnable).run()
+ verify(consumer).accept(underTest)
+ verify(workspace).removeOnAttachStateChangeListener(same(underTest))
+ verify(viewTreeObserver).removeOnDrawListener(same(underTest))
+ }
+
+ @Test
+ fun cancel_notRun() {
+ underTest.cancel()
+
+ verifyNoMoreInteractions(runnable)
+ verify(consumer).accept(underTest)
+ verifyNoMoreInteractions(workspace)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/ViewPoolTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/ViewPoolTest.kt
new file mode 100644
index 0000000..e535656
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ViewPoolTest.kt
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.test.annotation.UiThreadTest
+import androidx.test.filters.SmallTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.eq
+import org.mockito.Mock
+import org.mockito.Mockito.same
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.any
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+@SmallTest
+@RunWith(LauncherMultivalentJUnit::class)
+@UiThreadTest
+class ViewPoolTest {
+
+ @Mock private lateinit var viewParent: ViewGroup
+ @Mock private lateinit var view: ReusableView
+ @Mock private lateinit var inflater: LayoutInflater
+
+ private lateinit var underTest: ViewPool<ReusableView>
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ `when`(inflater.cloneInContext(any())).thenReturn(inflater)
+ underTest = ViewPool(inflater, viewParent, LAYOUT_ID, 10, 0)
+ }
+
+ @Test
+ fun get_view_from_empty_pool_inflate_new_view() {
+ underTest.view
+
+ verify(inflater).inflate(eq(LAYOUT_ID), same(viewParent), eq(false))
+ }
+
+ @Test
+ fun recycle_view() {
+ underTest.recycle(view)
+
+ val returnedView = underTest.view
+
+ verify(view).onRecycle()
+ assertThat(returnedView).isSameInstanceAs(view)
+ verifyNoMoreInteractions(inflater)
+ }
+
+ @Test
+ fun get_view_twice_from_view_pool_with_one_view() {
+ underTest.recycle(view)
+ underTest.view
+ verifyNoMoreInteractions(inflater)
+
+ underTest.view
+
+ verify(inflater).inflate(eq(LAYOUT_ID), same(viewParent), eq(false))
+ }
+
+ companion object {
+ private const val LAYOUT_ID = 1000
+ }
+
+ private inner class ReusableView(context: Context) : View(context), ViewPool.Reusable {
+ override fun onRecycle() {
+ TODO("Not yet implemented")
+ }
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/WidgetUtils.java b/tests/multivalentTests/src/com/android/launcher3/util/WidgetUtils.java
index 027a31a..deb0ef3 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/WidgetUtils.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/WidgetUtils.java
@@ -15,15 +15,12 @@
*/
package com.android.launcher3.util;
-import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-
-import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
import android.os.Bundle;
-import android.os.Process;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
@@ -87,10 +84,10 @@
* Creates a {@link AppWidgetProviderInfo} for the provided component name
*/
public static AppWidgetProviderInfo createAppWidgetProviderInfo(ComponentName cn) {
- AppWidgetProviderInfo info = AppWidgetManager.getInstance(getApplicationContext())
- .getInstalledProvidersForPackage(
- getInstrumentation().getContext().getPackageName(), Process.myUserHandle())
- .get(0);
+ ActivityInfo activityInfo = new ActivityInfo();
+ activityInfo.applicationInfo = new ApplicationInfo();
+ AppWidgetProviderInfo info = new AppWidgetProviderInfo();
+ info.providerInfo = activityInfo;
info.provider = cn;
return info;
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/rule/RobolectricUiThreadRule.kt b/tests/multivalentTests/src/com/android/launcher3/util/rule/RobolectricUiThreadRule.kt
deleted file mode 100644
index 18cd1e4..0000000
--- a/tests/multivalentTests/src/com/android/launcher3/util/rule/RobolectricUiThreadRule.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.util.rule
-
-import androidx.test.annotation.UiThreadTest
-import androidx.test.platform.app.InstrumentationRegistry
-import java.util.Locale
-import java.util.concurrent.atomic.AtomicReference
-import org.junit.rules.TestRule
-import org.junit.runner.Description
-import org.junit.runners.model.Statement
-
-/**
- * A test rule to add support for @UiThreadTest annotations when running in robolectric until is it
- * natively supported by the robolectric runner:
- * https://github.com/robolectric/robolectric/issues/9026
- */
-class RobolectricUiThreadRule : TestRule {
-
- override fun apply(base: Statement, description: Description): Statement =
- if (!shouldRunOnUiThread(description)) base else UiThreadStatement(base)
-
- private fun shouldRunOnUiThread(description: Description): Boolean {
- if (!isRunningInRobolectric()) {
- // If not running in robolectric, let the default runner handle this
- return false
- }
- var clazz = description.testClass
- try {
- if (
- clazz
- .getDeclaredMethod(description.methodName)
- .getAnnotation(UiThreadTest::class.java) != null
- ) {
- return true
- }
- } catch (_: Exception) {
- // Ignore
- }
-
- while (!clazz.isAnnotationPresent(UiThreadTest::class.java)) {
- clazz = clazz.superclass ?: return false
- }
- return true
- }
-
- private fun isRunningInRobolectric(): Boolean {
- if (
- System.getProperty("java.runtime.name")
- .lowercase(Locale.getDefault())
- .contains("android")
- )
- return false
- return try {
- // Check if robolectric runner exists
- Class.forName("org.robolectric.RobolectricTestRunner") != null
- } catch (e: ClassNotFoundException) {
- false
- }
- }
-
- private class UiThreadStatement(val base: Statement) : Statement() {
-
- override fun evaluate() {
- val exceptionRef = AtomicReference<Throwable>()
- InstrumentationRegistry.getInstrumentation().runOnMainSync {
- try {
- base.evaluate()
- } catch (throwable: Throwable) {
- exceptionRef.set(throwable)
- }
- }
- exceptionRef.get()?.let { throw it }
- }
- }
-}
diff --git a/tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt b/tests/multivalentTests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt
similarity index 100%
rename from tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt
rename to tests/multivalentTests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java b/tests/multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java
index 909aabd..ad2d8c2 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java
@@ -109,6 +109,9 @@
getPackageManager().
getPackageInfo(launcherPackageName, 0)
.versionName;
+ if (launcherVersion == null) {
+ return LOCAL;
+ }
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
diff --git a/tests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt
similarity index 83%
rename from tests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt
index 460058b..ec83b8b 100644
--- a/tests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/GeneratedPreviewTest.kt
@@ -8,7 +8,6 @@
import android.content.Context
import android.content.pm.ActivityInfo
import android.content.pm.ApplicationInfo
-import android.platform.test.annotations.RequiresFlagsDisabled
import android.platform.test.annotations.RequiresFlagsEnabled
import android.platform.test.flag.junit.CheckFlagsRule
import android.platform.test.flag.junit.DeviceFlagsValueProvider
@@ -18,12 +17,12 @@
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import com.android.launcher3.Flags.FLAG_ENABLE_GENERATED_PREVIEWS
import com.android.launcher3.InvariantDeviceProfile
import com.android.launcher3.icons.IconCache
import com.android.launcher3.icons.IconProvider
import com.android.launcher3.model.WidgetItem
-import com.android.launcher3.tests.R
import com.android.launcher3.util.ActivityContextWrapper
import com.android.launcher3.util.Executors
import com.google.common.truth.Truth.assertThat
@@ -34,6 +33,7 @@
@SmallTest
@RunWith(AndroidJUnit4::class)
+@RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
class GeneratedPreviewTest {
@get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()
private val providerName =
@@ -41,7 +41,10 @@
"com.android.launcher3.tests",
"com.android.launcher3.testcomponent.AppWidgetNoConfig"
)
- private val generatedPreviewLayout = R.layout.test_layout_appwidget_blue
+ private val generatedPreviewLayout =
+ getInstrumentation().context.run {
+ resources.getIdentifier("test_layout_appwidget_blue", "layout", packageName)
+ }
private lateinit var context: Context
private lateinit var generatedPreview: RemoteViews
private lateinit var widgetCell: WidgetCell
@@ -101,7 +104,6 @@
}
@Test
- @RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
fun widgetItem_hasGeneratedPreview() {
assertThat(widgetItem.hasGeneratedPreview(WIDGET_CATEGORY_HOME_SCREEN)).isTrue()
assertThat(widgetItem.hasGeneratedPreview(WIDGET_CATEGORY_KEYGUARD)).isFalse()
@@ -109,7 +111,6 @@
}
@Test
- @RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
fun widgetItem_hasGeneratedPreview_noPreview() {
appWidgetProviderInfo.generatedPreviewCategories = 0
createWidgetItem()
@@ -119,7 +120,6 @@
}
@Test
- @RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
fun widgetItem_hasGeneratedPreview_nullPreview() {
appWidgetProviderInfo.generatedPreviewCategories =
WIDGET_CATEGORY_HOME_SCREEN or WIDGET_CATEGORY_KEYGUARD
@@ -131,32 +131,17 @@
}
@Test
- @RequiresFlagsDisabled(FLAG_ENABLE_GENERATED_PREVIEWS)
- fun widgetItem_hasGeneratedPreview_flagDisabled() {
- assertThat(widgetItem.hasGeneratedPreview(WIDGET_CATEGORY_HOME_SCREEN)).isFalse()
- assertThat(widgetItem.hasGeneratedPreview(WIDGET_CATEGORY_KEYGUARD)).isFalse()
- assertThat(widgetItem.hasGeneratedPreview(WIDGET_CATEGORY_SEARCHBOX)).isFalse()
- }
- @Test
- @RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
fun widgetItem_getGeneratedPreview() {
val preview = widgetItem.generatedPreviews.get(WIDGET_CATEGORY_HOME_SCREEN)
assertThat(preview).isEqualTo(generatedPreview)
}
@Test
- @RequiresFlagsEnabled(FLAG_ENABLE_GENERATED_PREVIEWS)
fun widgetCell_showGeneratedPreview() {
widgetCell.applyFromCellItem(widgetItem)
+ DatabaseWidgetPreviewLoader.getLoaderExecutor().submit {}.get()
assertThat(widgetCell.appWidgetHostViewPreview).isNotNull()
assertThat(widgetCell.appWidgetHostViewPreview?.appWidgetInfo)
.isEqualTo(appWidgetProviderInfo)
}
-
- @Test
- @RequiresFlagsDisabled(FLAG_ENABLE_GENERATED_PREVIEWS)
- fun widgetCell_showGeneratedPreview_flagDisabled() {
- widgetCell.applyFromCellItem(widgetItem)
- assertThat(widgetCell.appWidgetHostViewPreview).isNull()
- }
}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/LauncherAppWidgetHostTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/LauncherAppWidgetHostTest.kt
new file mode 100644
index 0000000..79b493a
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/LauncherAppWidgetHostTest.kt
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.Executors
+import java.util.function.IntConsumer
+import org.junit.Assert.assertNotSame
+import org.junit.Assert.assertNull
+import org.junit.Assert.assertSame
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.verify
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class LauncherAppWidgetHostTest {
+
+ @Mock private lateinit var onAppWidgetRemovedCallback: IntConsumer
+
+ private val context = ActivityContextWrapper(getInstrumentation().targetContext)
+ private lateinit var underTest: LauncherAppWidgetHost
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ underTest = LauncherAppWidgetHost(context, onAppWidgetRemovedCallback, emptyList())
+ }
+
+ @Test
+ fun `Host set view to recycle`() {
+ val mockRecycleView = mock(ListenableHostView::class.java)
+
+ assertNull(underTest.viewToRecycle)
+ underTest.recycleViewForNextCreation(mockRecycleView)
+
+ assertSame(mockRecycleView, underTest.viewToRecycle)
+ }
+
+ @Test
+ fun `Host create view`() {
+ val mockRecycleView = mock(ListenableHostView::class.java)
+
+ var resultView = underTest.onCreateView(context, WIDGET_ID, null)
+
+ assertNotSame(mockRecycleView, resultView)
+
+ underTest.recycleViewForNextCreation(mockRecycleView)
+ resultView = underTest.onCreateView(context, WIDGET_ID, null)
+
+ assertSame(mockRecycleView, resultView)
+ }
+
+ @Test
+ fun `Runnable called when app widget removed`() {
+ underTest.onAppWidgetRemoved(WIDGET_ID)
+
+ Executors.MODEL_EXECUTOR.submit {}.get()
+ getInstrumentation().waitForIdleSync()
+
+ verify(onAppWidgetRemovedCallback).accept(WIDGET_ID)
+ }
+
+ companion object {
+ const val WIDGET_ID = 10001
+ }
+}
diff --git a/tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/LauncherWidgetHolderTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/LauncherWidgetHolderTest.kt
new file mode 100644
index 0000000..1a659e2
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/LauncherWidgetHolderTest.kt
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.widget
+
+import androidx.test.annotation.UiThreadTest
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.BuildConfig.WIDGETS_ENABLED
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.LauncherMultivalentJUnit
+import com.android.launcher3.widget.LauncherWidgetHolder.FLAG_ACTIVITY_RESUMED
+import com.android.launcher3.widget.LauncherWidgetHolder.FLAG_ACTIVITY_STARTED
+import com.android.launcher3.widget.LauncherWidgetHolder.FLAG_STATE_IS_NORMAL
+import org.junit.After
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertSame
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.times
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(LauncherMultivalentJUnit::class)
+class LauncherWidgetHolderTest {
+ private lateinit var widgetHolder: LauncherWidgetHolder
+
+ @Before
+ fun setUp() {
+ assertTrue(WIDGETS_ENABLED)
+ widgetHolder =
+ LauncherWidgetHolder(ActivityContextWrapper(getInstrumentation().targetContext)) {}
+ }
+
+ @After
+ fun tearDown() {
+ widgetHolder.destroy()
+ }
+
+ @Test
+ fun widget_holder_start_listening() {
+ val testView = mock(PendingAppWidgetHostView::class.java)
+ widgetHolder.mViews[0] = testView
+ widgetHolder.setListeningFlag(false)
+ assertFalse(widgetHolder.isListening)
+ widgetHolder.startListening()
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ getInstrumentation().waitForIdleSync()
+ assertTrue(widgetHolder.isListening)
+ verify(testView, times(1)).reInflate()
+ widgetHolder.clearWidgetViews()
+ }
+
+ @Test
+ fun holder_start_listening_after_activity_start() {
+ widgetHolder.setShouldListenFlag(FLAG_STATE_IS_NORMAL or FLAG_ACTIVITY_RESUMED, true)
+ widgetHolder.setActivityStarted(false)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertFalse(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ widgetHolder.setActivityStarted(true)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertTrue(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ }
+
+ @Test
+ fun holder_start_listening_after_activity_resume() {
+ widgetHolder.setShouldListenFlag(FLAG_STATE_IS_NORMAL or FLAG_ACTIVITY_STARTED, true)
+ widgetHolder.setActivityResumed(false)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertFalse(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ widgetHolder.setActivityResumed(true)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertTrue(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ }
+
+ @Test
+ fun holder_start_listening_after_state_normal() {
+ widgetHolder.setShouldListenFlag(FLAG_ACTIVITY_RESUMED or FLAG_ACTIVITY_STARTED, true)
+ widgetHolder.setStateIsNormal(false)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertFalse(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ widgetHolder.setStateIsNormal(true)
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertTrue(widgetHolder.shouldListen(widgetHolder.mFlags.get()))
+ }
+
+ @Test
+ @UiThreadTest
+ fun widget_holder_create_view() {
+ val mockProviderInfo = mock(LauncherAppWidgetProviderInfo::class.java)
+ doReturn(false).whenever(mockProviderInfo).isCustomWidget
+ assertEquals(0, widgetHolder.mViews.size())
+ widgetHolder.createView(APP_WIDGET_ID, mockProviderInfo)
+ assertEquals(1, widgetHolder.mViews.size())
+ assertEquals(APP_WIDGET_ID, widgetHolder.mViews.get(0).appWidgetId)
+ widgetHolder.deleteAppWidgetId(APP_WIDGET_ID)
+ assertEquals(0, widgetHolder.mViews.size())
+ }
+
+ @Test
+ fun holder_add_provider_change_listener() {
+ val listener = LauncherWidgetHolder.ProviderChangedListener {}
+ widgetHolder.addProviderChangeListener(listener)
+ getInstrumentation().waitForIdleSync()
+ assertEquals(1, widgetHolder.mProviderChangedListeners.size)
+ assertSame(widgetHolder.mProviderChangedListeners.first(), listener)
+ widgetHolder.removeProviderChangeListener(listener)
+ }
+
+ @Test
+ fun holder_remove_provider_change_listener() {
+ val listener = LauncherWidgetHolder.ProviderChangedListener {}
+ widgetHolder.addProviderChangeListener(listener)
+ widgetHolder.removeProviderChangeListener(listener)
+ getInstrumentation().waitForIdleSync()
+ assertEquals(0, widgetHolder.mProviderChangedListeners.size)
+ }
+
+ @Test
+ fun widget_holder_stop_listening() {
+ widgetHolder.setListeningFlag(true)
+ assertTrue(widgetHolder.isListening)
+ widgetHolder.stopListening()
+ widgetHolder.widgetHolderExecutor.submit {}.get()
+ assertFalse(widgetHolder.isListening)
+ }
+
+ companion object {
+ private const val APP_WIDGET_ID = 0
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/ListenableHostViewTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/ListenableHostViewTest.kt
new file mode 100644
index 0000000..6c71f36
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/ListenableHostViewTest.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget
+
+import android.content.Context
+import android.view.accessibility.AccessibilityNodeInfo
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.util.ActivityContextWrapper
+import com.google.common.truth.Truth
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ListenableHostViewTest {
+
+ private val context: Context
+ get() = ActivityContextWrapper(InstrumentationRegistry.getInstrumentation().targetContext)
+
+ @Test
+ fun updateAppWidget_notifiesListeners() {
+ val hostView = ListenableHostView(context)
+ var wasNotifiedOfUpdate = false
+ val updateListener = Runnable { wasNotifiedOfUpdate = true }
+ hostView.addUpdateListener(updateListener)
+ hostView.beginDeferringUpdates()
+ hostView.updateAppWidget(null)
+ Truth.assertThat(wasNotifiedOfUpdate).isTrue()
+ }
+
+ @Test
+ fun onInitializeAccessibilityNodeInfo_correctlySetsClassName() {
+ val hostView = ListenableHostView(context)
+ val nodeInfo = AccessibilityNodeInfo()
+ hostView.onInitializeAccessibilityNodeInfo(nodeInfo)
+ Truth.assertThat(nodeInfo.className).isEqualTo(LauncherAppWidgetHostView::class.java.name)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/RoundedCornerEnforcementTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/RoundedCornerEnforcementTest.kt
new file mode 100644
index 0000000..db77702
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/RoundedCornerEnforcementTest.kt
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget
+
+import android.content.Context
+import android.content.res.Resources
+import android.graphics.Rect
+import android.view.View
+import android.view.ViewGroup
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.R
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertSame
+import org.junit.Assert.assertTrue
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class RoundedCornerEnforcementTest {
+
+ @Test
+ fun `Widget view has one background`() {
+ val mockWidgetView = mock(LauncherAppWidgetHostView::class.java)
+
+ doReturn(android.R.id.background).whenever(mockWidgetView).id
+
+ assertSame(RoundedCornerEnforcement.findBackground(mockWidgetView), mockWidgetView)
+ }
+
+ @Test
+ fun `Widget opted out of rounded corner enforcement`() {
+ val mockView = mock(View::class.java)
+
+ doReturn(android.R.id.background).whenever(mockView).id
+ doReturn(true).whenever(mockView).clipToOutline
+
+ assertTrue(RoundedCornerEnforcement.hasAppWidgetOptedOut(mockView))
+ }
+
+ @Test
+ fun `Compute rect based on widget view with background`() {
+ val mockBackgroundView = mock(View::class.java)
+ val mockWidgetView = mock(ViewGroup::class.java)
+ val testRect = Rect(0, 0, 0, 0)
+
+ doReturn(WIDTH).whenever(mockBackgroundView).width
+ doReturn(HEIGHT).whenever(mockBackgroundView).height
+ doReturn(LEFT).whenever(mockBackgroundView).left
+ doReturn(TOP).whenever(mockBackgroundView).top
+ doReturn(mockWidgetView).whenever(mockBackgroundView).parent
+
+ RoundedCornerEnforcement.computeRoundedRectangle(
+ mockWidgetView,
+ mockBackgroundView,
+ testRect
+ )
+
+ assertEquals(Rect(50, 75, 250, 275), testRect)
+ }
+
+ @Test
+ fun `Compute system radius`() {
+ val mockContext = mock(Context::class.java)
+ val mockRes = mock(Resources::class.java)
+
+ doReturn(mockRes).whenever(mockContext).resources
+ doReturn(RADIUS)
+ .whenever(mockRes)
+ .getDimension(eq(android.R.dimen.system_app_widget_background_radius))
+ doReturn(LAUNCHER_RADIUS)
+ .whenever(mockRes)
+ .getDimension(eq(R.dimen.enforced_rounded_corner_max_radius))
+
+ assertEquals(RADIUS, RoundedCornerEnforcement.computeEnforcedRadius(mockContext))
+ }
+
+ companion object {
+ const val WIDTH = 200
+ const val HEIGHT = 200
+ const val LEFT = 50
+ const val TOP = 75
+
+ const val RADIUS = 8f
+ const val LAUNCHER_RADIUS = 16f
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/WidgetAddFlowHandlerTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/WidgetAddFlowHandlerTest.kt
new file mode 100644
index 0000000..242ec7c
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/WidgetAddFlowHandlerTest.kt
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget
+
+import android.content.Context
+import android.os.Bundle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.Launcher
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.google.common.truth.Truth
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.any
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class WidgetAddFlowHandlerTest {
+
+ private val context: Context
+ get() = ActivityContextWrapper(InstrumentationRegistry.getInstrumentation().targetContext)
+
+ private val providerInfo =
+ LauncherAppWidgetProviderInfo().apply {
+ configure = InstrumentationRegistry.getInstrumentation().componentName
+ }
+ private val appWidgetHolder: LauncherWidgetHolder = mock<LauncherWidgetHolder>()
+ private val launcher: Launcher =
+ mock<Launcher>().also { whenever(it.appWidgetHolder).thenReturn(appWidgetHolder) }
+ private val appWidgetInfo = LauncherAppWidgetInfo().apply { appWidgetId = 123 }
+ private val requestCode = 123
+ private val flowHandler = WidgetAddFlowHandler(providerInfo)
+
+ @Test
+ fun valuesShouldRemainTheSame_beforeAndAfter_parcelization() {
+ with(Bundle()) {
+ val testKey = "testKey"
+ putParcelable(testKey, flowHandler)
+ Truth.assertThat(getParcelable(testKey, WidgetAddFlowHandler::class.java))
+ .isEqualTo(flowHandler)
+ }
+ }
+
+ @Test
+ fun describeContents_shouldReturn_0() {
+ Truth.assertThat(flowHandler.describeContents()).isEqualTo(0)
+ }
+
+ @Test
+ fun startBindFlow_shouldCorrectly_startLauncherFlowBinding() {
+ flowHandler.startBindFlow(launcher, appWidgetInfo.appWidgetId, appWidgetInfo, requestCode)
+ verify(launcher).setWaitingForResult(any())
+ verify(appWidgetHolder)
+ .startBindFlow(launcher, appWidgetInfo.appWidgetId, providerInfo, requestCode)
+ }
+
+ @Test
+ fun startConfigActivityWithCustomAppWidgetId_shouldAskLauncherToStartConfigActivity() {
+ flowHandler.startConfigActivity(
+ launcher,
+ appWidgetInfo.appWidgetId,
+ ItemInfo(),
+ requestCode
+ )
+ verify(launcher).setWaitingForResult(any())
+ verify(appWidgetHolder)
+ .startConfigActivity(launcher, appWidgetInfo.appWidgetId, requestCode)
+ }
+
+ @Test
+ fun startConfigActivity_shouldAskLauncherToStartConfigActivity() {
+ flowHandler.startConfigActivity(launcher, appWidgetInfo, requestCode)
+ verify(launcher).setWaitingForResult(any())
+ verify(appWidgetHolder)
+ .startConfigActivity(launcher, appWidgetInfo.appWidgetId, requestCode)
+ }
+
+ @Test
+ fun needsConfigure_returnsTrue_ifFlagsAndProviderInfoDetermineSo() {
+ Truth.assertThat(flowHandler.needsConfigure()).isTrue()
+ }
+
+ @Test
+ fun getProviderInfo_returnCorrectProviderInfo() {
+ Truth.assertThat(flowHandler.getProviderInfo(context)).isSameInstanceAs(providerInfo)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/WidgetManagerHelperTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/WidgetManagerHelperTest.kt
new file mode 100644
index 0000000..f1cfb79
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/WidgetManagerHelperTest.kt
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget
+
+import android.appwidget.AppWidgetManager
+import android.content.Context
+import android.content.pm.ActivityInfo
+import android.os.Bundle
+import android.os.Process
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.PackageUserKey
+import com.google.common.truth.Truth
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.verify
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class WidgetManagerHelperTest {
+
+ private val context: Context
+ get() = ActivityContextWrapper(InstrumentationRegistry.getInstrumentation().targetContext)
+
+ private val info =
+ LauncherAppWidgetProviderInfo().apply {
+ provider = InstrumentationRegistry.getInstrumentation().componentName
+ providerInfo =
+ mock(ActivityInfo::class.java).apply { applicationInfo = context.applicationInfo }
+ }
+
+ @Mock private lateinit var appWidgetManager: AppWidgetManager
+
+ private lateinit var underTest: WidgetManagerHelper
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ underTest = WidgetManagerHelper(context, appWidgetManager)
+ }
+
+ @Test
+ fun getAllProviders_returnsCorrectWidgetProviderInfo() {
+ val packageUserKey =
+ mock(PackageUserKey::class.java).apply {
+ mPackageName = context.packageName
+ mUser = Process.myUserHandle()
+ }
+ val desiredResult = listOf(info)
+ whenever(
+ appWidgetManager.getInstalledProvidersForPackage(
+ packageUserKey.mPackageName,
+ packageUserKey.mUser
+ )
+ )
+ .thenReturn(desiredResult)
+ Truth.assertThat(underTest.getAllProviders(packageUserKey)).isSameInstanceAs(desiredResult)
+ }
+
+ @Test
+ fun getLauncherAppWidgetInfo_returnsCorrectInfo_ifWidgetExists() {
+ val id = 123
+ whenever(appWidgetManager.getAppWidgetInfo(id)).thenReturn(info)
+ val componentName = InstrumentationRegistry.getInstrumentation().componentName
+ Truth.assertThat(underTest.getLauncherAppWidgetInfo(id, componentName))
+ .isSameInstanceAs(info)
+ }
+
+ @Test
+ fun bindAppWidgetIdIfAllowed_correctly_forwardsBindCommandToAppWidgetManager() {
+ val id = 124
+ val options = Bundle()
+ underTest.bindAppWidgetIdIfAllowed(id, info, options)
+ verify(appWidgetManager).bindAppWidgetIdIfAllowed(id, info.profile, info.provider, options)
+ }
+
+ @Test
+ fun findProvider_returnsNull_ifNoProviderExists() {
+ val info =
+ underTest.getLauncherAppWidgetInfo(
+ 1,
+ InstrumentationRegistry.getInstrumentation().componentName
+ )
+ Truth.assertThat(info).isNull()
+ }
+
+ @Test
+ fun isAppWidgetRestored_returnsTrue_ifWidgetIsRestored() {
+ val id = 126
+ whenever(appWidgetManager.getAppWidgetOptions(id))
+ .thenReturn(
+ Bundle().apply {
+ putBoolean(WidgetManagerHelper.WIDGET_OPTION_RESTORE_COMPLETED, true)
+ }
+ )
+ Truth.assertThat(underTest.isAppWidgetRestored(id)).isTrue()
+ }
+
+ @Test
+ fun loadGeneratedPreview_returnsWidgetPreview_fromAppWidgetManager() {
+ val widgetCategory = 130
+ with(info) {
+ underTest.loadGeneratedPreview(this, widgetCategory)
+ verify(appWidgetManager).getWidgetPreview(provider, profile, widgetCategory)
+ }
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfoTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfoTest.kt
new file mode 100644
index 0000000..0a3035a
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomAppWidgetProviderInfoTest.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.custom
+
+import android.content.ComponentName
+import android.content.pm.PackageManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import org.junit.Assert.assertEquals
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class CustomAppWidgetProviderInfoTest {
+
+ private lateinit var underTest: CustomAppWidgetProviderInfo
+
+ @Before
+ fun setup() {
+ underTest = CustomAppWidgetProviderInfo()
+ underTest.provider = PROVIDER_NAME
+ }
+
+ @Test
+ fun info_to_string() {
+ assertEquals("WidgetProviderInfo($PROVIDER_NAME)", underTest.toString())
+ }
+
+ @Test
+ fun get_label() {
+ underTest.label = " TEST_LABEL"
+ assertEquals(LABEL_NAME, underTest.getLabel(mock(PackageManager::class.java)))
+ }
+
+ companion object {
+ private val PROVIDER_NAME =
+ ComponentName(getInstrumentation().targetContext.packageName, "TEST_PACKAGE")
+ private const val LABEL_NAME = "TEST_LABEL"
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomWidgetManagerTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomWidgetManagerTest.kt
new file mode 100644
index 0000000..4b5710d
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/custom/CustomWidgetManagerTest.kt
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.custom
+
+import android.appwidget.AppWidgetManager
+import android.content.ComponentName
+import android.os.Process
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
+import com.android.launcher3.util.PluginManagerWrapper
+import com.android.launcher3.util.WidgetUtils
+import com.android.launcher3.widget.LauncherAppWidgetHostView
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
+import com.android.systemui.plugins.CustomWidgetPlugin
+import org.junit.After
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.same
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class CustomWidgetManagerTest {
+
+ @get:Rule val setFlagsRule = SetFlagsRule()
+
+ private val context = SandboxModelContext()
+ private lateinit var underTest: CustomWidgetManager
+
+ @Mock private lateinit var pluginManager: PluginManagerWrapper
+ @Mock private lateinit var mockAppWidgetManager: AppWidgetManager
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ context.putObject(PluginManagerWrapper.INSTANCE, pluginManager)
+ underTest = CustomWidgetManager(context, mockAppWidgetManager)
+ }
+
+ @After
+ fun tearDown() {
+ underTest.close()
+ }
+
+ @Test
+ fun plugin_manager_added_after_initialization() {
+ verify(pluginManager)
+ .addPluginListener(same(underTest), same(CustomWidgetPlugin::class.java), eq(true))
+ }
+
+ @Test
+ fun close_widget_manager_should_remove_plugin_listener() {
+ underTest.close()
+ verify(pluginManager).removePluginListener(same(underTest))
+ }
+
+ @Test
+ fun on_plugin_connected_no_provider_info() {
+ doReturn(emptyList<LauncherAppWidgetProviderInfo>())
+ .whenever(mockAppWidgetManager)
+ .getInstalledProvidersForProfile(any())
+ val mockPlugin = mock(CustomWidgetPlugin::class.java)
+ underTest.onPluginConnected(mockPlugin, context)
+ assertEquals(0, underTest.plugins.size)
+ }
+
+ @Test
+ fun on_plugin_connected_exist_provider_info() {
+ doReturn(listOf(WidgetUtils.createAppWidgetProviderInfo(TEST_COMPONENT_NAME)))
+ .whenever(mockAppWidgetManager)
+ .getInstalledProvidersForProfile(eq(Process.myUserHandle()))
+ val mockPlugin = mock(CustomWidgetPlugin::class.java)
+ underTest.onPluginConnected(mockPlugin, context)
+ assertEquals(1, underTest.plugins.size)
+ }
+
+ @Test
+ fun on_plugin_disconnected() {
+ doReturn(listOf(WidgetUtils.createAppWidgetProviderInfo(TEST_COMPONENT_NAME)))
+ .whenever(mockAppWidgetManager)
+ .getInstalledProvidersForProfile(eq(Process.myUserHandle()))
+ val mockPlugin = mock(CustomWidgetPlugin::class.java)
+ underTest.onPluginConnected(mockPlugin, context)
+ underTest.onPluginDisconnected(mockPlugin)
+ assertEquals(0, underTest.plugins.size)
+ }
+
+ @Test
+ fun on_view_created() {
+ val mockPlugin = mock(CustomWidgetPlugin::class.java)
+ val mockWidgetView = mock(LauncherAppWidgetHostView::class.java)
+ val mockProviderInfo = mock(CustomAppWidgetProviderInfo::class.java)
+ doReturn(mockProviderInfo).whenever(mockWidgetView).appWidgetInfo
+ mockProviderInfo.provider = TEST_COMPONENT_NAME
+ underTest.plugins.put(TEST_COMPONENT_NAME, mockPlugin)
+ underTest.onViewCreated(mockWidgetView)
+ verify(mockPlugin).onViewCreated(eq(mockWidgetView))
+ }
+
+ @Test
+ fun generate_stream() {
+ assertTrue(underTest.stream().toList().isEmpty())
+ doReturn(listOf(WidgetUtils.createAppWidgetProviderInfo(TEST_COMPONENT_NAME)))
+ .whenever(mockAppWidgetManager)
+ .getInstalledProvidersForProfile(eq(Process.myUserHandle()))
+ val mockPlugin = mock(CustomWidgetPlugin::class.java)
+ underTest.onPluginConnected(mockPlugin, context)
+ assertEquals(1, underTest.stream().toList().size)
+ }
+
+ companion object {
+ private const val TEST_CLASS = "TEST_CLASS"
+ private val TEST_COMPONENT_NAME =
+ ComponentName(getInstrumentation().targetContext.packageName, TEST_CLASS)
+ }
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilderTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilderTest.kt
new file mode 100644
index 0000000..5df7caa
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/model/WidgetsListBaseEntriesBuilderTest.kt
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.model
+
+import android.content.ComponentName
+import android.content.Context
+import android.os.UserHandle
+import android.platform.test.rule.AllowedDevices
+import android.platform.test.rule.DeviceProduct
+import android.platform.test.rule.LimitDevicesRule
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.icons.ComponentWithLabel
+import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.WidgetItem
+import com.android.launcher3.model.data.PackageItemInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.WidgetUtils
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.invocation.InvocationOnMock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+
+@RunWith(AndroidJUnit4::class)
+@AllowedDevices(allowed = [DeviceProduct.ROBOLECTRIC])
+class WidgetsListBaseEntriesBuilderTest {
+ @Rule @JvmField val limitDevicesRule = LimitDevicesRule()
+ @Rule @JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var iconCache: IconCache
+
+ private lateinit var userHandle: UserHandle
+ private lateinit var context: Context
+ private lateinit var testInvariantProfile: InvariantDeviceProfile
+ private lateinit var allWidgets: Map<PackageItemInfo, List<WidgetItem>>
+ private lateinit var underTest: WidgetsListBaseEntriesBuilder
+
+ @Before
+ fun setUp() {
+ userHandle = UserHandle.CURRENT
+ context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ testInvariantProfile = LauncherAppState.getIDP(context)
+
+ doAnswer { invocation: InvocationOnMock ->
+ val componentWithLabel = invocation.getArgument<Any>(0) as ComponentWithLabel
+ componentWithLabel.getComponent().shortClassName
+ }
+ .`when`(iconCache)
+ .getTitleNoCache(any<ComponentWithLabel>())
+ underTest = WidgetsListBaseEntriesBuilder(context)
+
+ allWidgets =
+ mapOf(
+ // app 1
+ packageItemInfoWithTitle(APP_1_PACKAGE_NAME, APP_1_PACKAGE_TITLE) to
+ listOf(
+ createWidgetItem(APP_1_PACKAGE_NAME, APP_1_PROVIDER_1_CLASS_NAME),
+ createWidgetItem(APP_1_PACKAGE_NAME, APP_1_PROVIDER_2_CLASS_NAME)
+ ),
+ // app 2
+ packageItemInfoWithTitle(APP_2_PACKAGE_NAME, APP_2_PACKAGE_TITLE) to
+ listOf(createWidgetItem(APP_2_PACKAGE_NAME, APP_2_PROVIDER_1_CLASS_NAME)),
+ // app 3
+ packageItemInfoWithTitle(APP_3_PACKAGE_NAME, APP_3_PACKAGE_TITLE) to
+ listOf(createWidgetItem(APP_3_PACKAGE_NAME, APP_3_PROVIDER_1_CLASS_NAME))
+ )
+ }
+
+ @Test
+ fun widgetsListBaseEntriesBuilder_addsHeaderAndContentEntries_withCorrectSectionName() {
+ val expectedWidgetsCountBySection =
+ listOf(
+ APP_1_EXPECTED_SECTION_NAME to 2,
+ APP_2_EXPECTED_SECTION_NAME to 1,
+ APP_3_EXPECTED_SECTION_NAME to 1
+ )
+
+ val entries = underTest.build(allWidgets)
+
+ assertThat(entries).hasSize(6)
+ val headerEntrySectionAndWidgetSizes =
+ entries.filterIsInstance<WidgetsListHeaderEntry>().map {
+ it.mTitleSectionName to it.mWidgets.size
+ }
+ val contentEntrySectionAndWidgetSizes =
+ entries.filterIsInstance<WidgetsListContentEntry>().map {
+ it.mTitleSectionName to it.mWidgets.size
+ }
+ assertThat(headerEntrySectionAndWidgetSizes)
+ .containsExactlyElementsIn(expectedWidgetsCountBySection)
+ assertThat(contentEntrySectionAndWidgetSizes)
+ .containsExactlyElementsIn(expectedWidgetsCountBySection)
+ }
+
+ @Test
+ fun widgetsListBaseEntriesBuilder_withFilter_addsFilteredHeaderAndContentEntries() {
+ val allowList = listOf(APP_1_PROVIDER_1_CLASS_NAME, APP_3_PROVIDER_1_CLASS_NAME)
+ val expectedWidgetsCountBySection =
+ listOf(
+ APP_1_EXPECTED_SECTION_NAME to 1, // one widget filtered out
+ APP_3_EXPECTED_SECTION_NAME to 1
+ )
+
+ val entries =
+ underTest.build(allWidgets) { w -> allowList.contains(w.componentName.shortClassName) }
+
+ assertThat(entries).hasSize(4) // app 2 filtered out
+ val headerEntrySectionAndWidgetSizes =
+ entries.filterIsInstance<WidgetsListHeaderEntry>().map {
+ it.mTitleSectionName to it.mWidgets.size
+ }
+ val contentEntrySectionAndWidgetSizes =
+ entries.filterIsInstance<WidgetsListContentEntry>().map {
+ it.mTitleSectionName to it.mWidgets.size
+ }
+ assertThat(headerEntrySectionAndWidgetSizes)
+ .containsExactlyElementsIn(expectedWidgetsCountBySection)
+ assertThat(contentEntrySectionAndWidgetSizes)
+ .containsExactlyElementsIn(expectedWidgetsCountBySection)
+ }
+
+ private fun packageItemInfoWithTitle(packageName: String, title: String): PackageItemInfo {
+ val packageItemInfo = PackageItemInfo(packageName, userHandle)
+ packageItemInfo.title = title
+ return packageItemInfo
+ }
+
+ private fun createWidgetItem(packageName: String, widgetProviderName: String): WidgetItem {
+ val providerInfo =
+ WidgetUtils.createAppWidgetProviderInfo(
+ ComponentName.createRelative(packageName, widgetProviderName)
+ )
+ val widgetInfo = LauncherAppWidgetProviderInfo.fromProviderInfo(context, providerInfo)
+ return WidgetItem(widgetInfo, testInvariantProfile, iconCache, context)
+ }
+
+ companion object {
+ const val APP_1_PACKAGE_NAME = "com.example.app1"
+ const val APP_1_PACKAGE_TITLE = "App1"
+ const val APP_1_EXPECTED_SECTION_NAME = "A" // for fast popup
+ const val APP_1_PROVIDER_1_CLASS_NAME = "app1Provider1"
+ const val APP_1_PROVIDER_2_CLASS_NAME = "app1Provider2"
+
+ const val APP_2_PACKAGE_NAME = "com.example.app2"
+ const val APP_2_PACKAGE_TITLE = "SomeApp2"
+ const val APP_2_EXPECTED_SECTION_NAME = "S" // for fast popup
+ const val APP_2_PROVIDER_1_CLASS_NAME = "app2Provider1"
+
+ const val APP_3_PACKAGE_NAME = "com.example.app3"
+ const val APP_3_PACKAGE_TITLE = "OtherApp3"
+ const val APP_3_EXPECTED_SECTION_NAME = "O" // for fast popup
+ const val APP_3_PROVIDER_1_CLASS_NAME = "app3Provider1"
+ }
+}
diff --git a/tests/src/com/android/launcher3/widget/picker/WidgetImageViewTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetImageViewTest.kt
similarity index 100%
rename from tests/src/com/android/launcher3/widget/picker/WidgetImageViewTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetImageViewTest.kt
diff --git a/tests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java
similarity index 91%
rename from tests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java
index 60a4cd3..3024d26 100644
--- a/tests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetRecommendationCategoryProviderTest.java
@@ -25,7 +25,6 @@
import static android.content.pm.ApplicationInfo.CATEGORY_VIDEO;
import static android.content.pm.ApplicationInfo.FLAG_INSTALLED;
-import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static com.google.common.truth.Truth.assertThat;
@@ -35,7 +34,6 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.when;
-import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
@@ -53,6 +51,7 @@
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.WidgetUtils;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.google.common.collect.ImmutableMap;
@@ -79,15 +78,15 @@
R.string.news_widget_recommendation_category_label, /*order=*/1);
private static final WidgetRecommendationCategory SUGGESTED_FOR_YOU =
new WidgetRecommendationCategory(
- R.string.others_widget_recommendation_category_label, /*order=*/4);
+ R.string.others_widget_recommendation_category_label, /*order=*/2);
private static final WidgetRecommendationCategory SOCIAL =
new WidgetRecommendationCategory(
R.string.social_widget_recommendation_category_label,
- /*order=*/5);
+ /*order=*/3);
private static final WidgetRecommendationCategory ENTERTAINMENT =
new WidgetRecommendationCategory(
R.string.entertainment_widget_recommendation_category_label,
- /*order=*/6);
+ /*order=*/4);
private final ApplicationInfo mTestAppInfo = ApplicationInfoBuilder.newBuilder().setPackageName(
TEST_PACKAGE).setName(TEST_APP_NAME).build();
@@ -152,11 +151,8 @@
doAnswer(invocation -> widgetLabel).when(mIconCache).getTitleNoCache(any());
- AppWidgetProviderInfo providerInfo = AppWidgetManager.getInstance(getApplicationContext())
- .getInstalledProvidersForPackage(
- getInstrumentation().getContext().getPackageName(), Process.myUserHandle())
- .get(0);
- providerInfo.provider = ComponentName.createRelative(TEST_PACKAGE, widgetClassName);
+ AppWidgetProviderInfo providerInfo = WidgetUtils.createAppWidgetProviderInfo(ComponentName
+ .createRelative(TEST_PACKAGE, widgetClassName));
LauncherAppWidgetProviderInfo launcherAppWidgetProviderInfo =
LauncherAppWidgetProviderInfo.fromProviderInfo(mContext, providerInfo);
diff --git a/tests/src/com/android/launcher3/widget/picker/WidgetsListHeaderAccessibilityTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListHeaderAccessibilityTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/widget/picker/WidgetsListHeaderAccessibilityTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListHeaderAccessibilityTest.java
diff --git a/tests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java
similarity index 96%
rename from tests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java
index 8fc4481..d4e061a 100644
--- a/tests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListHeaderViewHolderBinderTest.java
@@ -31,6 +31,7 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.os.UserHandle;
+import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;
@@ -79,7 +80,8 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
- mContext = new ActivityContextWrapper(getApplicationContext());
+ mContext = new ActivityContextWrapper(new ContextThemeWrapper(getApplicationContext(),
+ R.style.WidgetContainerTheme));
mTestProfile = new InvariantDeviceProfile();
mTestProfile.numRows = 5;
mTestProfile.numColumns = 5;
diff --git a/tests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java
similarity index 94%
rename from tests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java
index 85fb380..e1cc010 100644
--- a/tests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinderTest.java
@@ -16,6 +16,7 @@
package com.android.launcher3.widget.picker;
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static com.google.common.truth.Truth.assertThat;
@@ -49,8 +50,8 @@
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.util.ActivityContextWrapper;
-import com.android.launcher3.util.Executors;
import com.android.launcher3.util.WidgetUtils;
+import com.android.launcher3.widget.DatabaseWidgetPreviewLoader;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.WidgetCell;
import com.android.launcher3.widget.WidgetManagerHelper;
@@ -112,7 +113,9 @@
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0, EMPTY_LIST);
- Executors.MAIN_EXECUTOR.submit(() -> { }).get();
+ // Wait for the loader to complete the preview loading
+ DatabaseWidgetPreviewLoader.getLoaderExecutor().submit(() -> { }).get();
+ getInstrumentation().waitForIdleSync();
// THEN the table container has one row, which contains 3 widgets.
// View: .SampleWidget0 | .SampleWidget1 | .SampleWidget2
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProviderTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProviderTest.kt
new file mode 100644
index 0000000..1822639
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/WidgetPickerDataProviderTest.kt
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.picker.model
+
+import android.content.ComponentName
+import android.content.Context
+import android.os.UserHandle
+import android.platform.test.rule.AllowedDevices
+import android.platform.test.rule.DeviceProduct
+import android.platform.test.rule.LimitDevicesRule
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherSettings
+import com.android.launcher3.icons.ComponentWithLabel
+import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.WidgetItem
+import com.android.launcher3.model.data.PackageItemInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.WidgetUtils
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
+import com.android.launcher3.widget.PendingAddWidgetInfo
+import com.android.launcher3.widget.model.WidgetsListBaseEntry
+import com.android.launcher3.widget.model.WidgetsListContentEntry
+import com.android.launcher3.widget.model.WidgetsListHeaderEntry
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider.WidgetPickerDataChangeListener
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.invocation.InvocationOnMock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+import org.mockito.kotlin.times
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.verifyNoMoreInteractions
+
+// Tests for the WidgetPickerDataProvider class
+
+@RunWith(AndroidJUnit4::class)
+@AllowedDevices(allowed = [DeviceProduct.ROBOLECTRIC])
+class WidgetPickerDataProviderTest {
+ @Rule @JvmField val limitDevicesRule = LimitDevicesRule()
+ @Rule @JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var changeListener: WidgetPickerDataChangeListener
+
+ @Mock private lateinit var iconCache: IconCache
+
+ private lateinit var userHandle: UserHandle
+ private lateinit var context: Context
+ private lateinit var testInvariantProfile: InvariantDeviceProfile
+
+ private lateinit var appWidgetItem: WidgetItem
+
+ private var underTest = WidgetPickerDataProvider()
+
+ @Before
+ fun setUp() {
+ userHandle = UserHandle.CURRENT
+ context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ testInvariantProfile = LauncherAppState.getIDP(context)
+
+ doAnswer { invocation: InvocationOnMock ->
+ val componentWithLabel = invocation.getArgument<Any>(0) as ComponentWithLabel
+ componentWithLabel.getComponent().shortClassName
+ }
+ .`when`(iconCache)
+ .getTitleNoCache(any<ComponentWithLabel>())
+
+ appWidgetItem = createWidgetItem()
+ }
+
+ @Test
+ fun setWidgets_invokesTheListener_andUpdatedWidgetsAvailable() {
+ assertThat(underTest.get().allWidgets).isEmpty()
+
+ underTest.setChangeListener(changeListener)
+ val allWidgets = appWidgetListBaseEntries()
+ underTest.setWidgets(allWidgets = allWidgets)
+
+ assertThat(underTest.get().allWidgets).containsExactlyElementsIn(allWidgets)
+ verify(changeListener, times(1)).onWidgetsBound()
+ verifyNoMoreInteractions(changeListener)
+ }
+
+ @Test
+ fun setWidgetRecommendations_callsBackTheListener_andUpdatedRecommendationsAvailable() {
+ underTest.setWidgets(allWidgets = appWidgetListBaseEntries())
+ assertThat(underTest.get().recommendations).isEmpty()
+
+ underTest.setChangeListener(changeListener)
+ val recommendations =
+ listOf(
+ PendingAddWidgetInfo(
+ appWidgetItem.widgetInfo,
+ LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION
+ ),
+ )
+ underTest.setWidgetRecommendations(recommendations)
+
+ assertThat(underTest.get().recommendations).hasSize(1)
+ verify(changeListener, times(1)).onRecommendedWidgetsBound()
+ verifyNoMoreInteractions(changeListener)
+ }
+
+ @Test
+ fun setChangeListener_null_noCallback() {
+ underTest.setChangeListener(changeListener)
+ underTest.setChangeListener(null) // reset
+
+ underTest.setWidgets(allWidgets = appWidgetListBaseEntries())
+ val recommendations =
+ listOf(
+ PendingAddWidgetInfo(
+ appWidgetItem.widgetInfo,
+ LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION
+ ),
+ )
+ underTest.setWidgetRecommendations(recommendations)
+
+ verifyNoMoreInteractions(changeListener)
+ }
+
+ private fun createWidgetItem(): WidgetItem {
+ val providerInfo =
+ WidgetUtils.createAppWidgetProviderInfo(
+ ComponentName.createRelative(APP_PACKAGE_NAME, APP_PROVIDER_1_CLASS_NAME)
+ )
+ val widgetInfo = LauncherAppWidgetProviderInfo.fromProviderInfo(context, providerInfo)
+ return WidgetItem(widgetInfo, testInvariantProfile, iconCache, context)
+ }
+
+ private fun appWidgetListBaseEntries(): List<WidgetsListBaseEntry> {
+ val packageItemInfo = PackageItemInfo(APP_PACKAGE_NAME, userHandle)
+ packageItemInfo.title = APP_PACKAGE_TITLE
+ val widgets = listOf(appWidgetItem)
+
+ return buildList {
+ add(WidgetsListHeaderEntry.create(packageItemInfo, APP_SECTION_NAME, widgets))
+ add(WidgetsListContentEntry(packageItemInfo, APP_SECTION_NAME, widgets))
+ }
+ }
+
+ companion object {
+ const val APP_PACKAGE_NAME = "com.example.app"
+ const val APP_PACKAGE_TITLE = "SomeApp"
+ const val APP_SECTION_NAME = "S" // for fast popup
+ const val APP_PROVIDER_1_CLASS_NAME = "appProvider1"
+ }
+}
diff --git a/tests/src/com/android/launcher3/widget/picker/model/WidgetsListContentEntryTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/WidgetsListContentEntryTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/widget/picker/model/WidgetsListContentEntryTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/model/WidgetsListContentEntryTest.java
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/data/WidgetPickerDataTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/data/WidgetPickerDataTest.kt
new file mode 100644
index 0000000..e59e211
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/model/data/WidgetPickerDataTest.kt
@@ -0,0 +1,379 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.widget.picker.model.data
+
+import android.content.ComponentName
+import android.content.Context
+import android.os.UserHandle
+import android.platform.test.rule.AllowedDevices
+import android.platform.test.rule.DeviceProduct
+import android.platform.test.rule.LimitDevicesRule
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.InvariantDeviceProfile
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION
+import com.android.launcher3.icons.ComponentWithLabel
+import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.WidgetItem
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.model.data.PackageItemInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.util.WidgetUtils
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo
+import com.android.launcher3.widget.PendingAddWidgetInfo
+import com.android.launcher3.widget.model.WidgetsListBaseEntry
+import com.android.launcher3.widget.model.WidgetsListContentEntry
+import com.android.launcher3.widget.model.WidgetsListHeaderEntry
+import com.android.launcher3.widget.picker.WidgetRecommendationCategory
+import com.android.launcher3.widget.picker.WidgetRecommendationCategory.DEFAULT_WIDGET_RECOMMENDATION_CATEGORY
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.findAllWidgetsForPackageUser
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.findContentEntryForPackageUser
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.withRecommendedWidgets
+import com.android.launcher3.widget.picker.model.data.WidgetPickerDataUtils.withWidgets
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.invocation.InvocationOnMock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+
+// Tests for code / classes in WidgetPickerData file.
+
+@RunWith(AndroidJUnit4::class)
+@AllowedDevices(allowed = [DeviceProduct.ROBOLECTRIC])
+class WidgetPickerDataTest {
+ @Rule @JvmField val limitDevicesRule = LimitDevicesRule()
+ @Rule @JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var iconCache: IconCache
+
+ private lateinit var userHandle: UserHandle
+ private lateinit var context: Context
+ private lateinit var testInvariantProfile: InvariantDeviceProfile
+
+ private lateinit var app1PackageItemInfo: PackageItemInfo
+ private lateinit var app2PackageItemInfo: PackageItemInfo
+
+ private lateinit var app1WidgetItem1: WidgetItem
+ private lateinit var app1WidgetItem2: WidgetItem
+ private lateinit var app2WidgetItem1: WidgetItem
+
+ @Before
+ fun setUp() {
+ userHandle = UserHandle.CURRENT
+ context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ testInvariantProfile = LauncherAppState.getIDP(context)
+
+ doAnswer { invocation: InvocationOnMock ->
+ val componentWithLabel = invocation.getArgument<Any>(0) as ComponentWithLabel
+ componentWithLabel.getComponent().shortClassName
+ }
+ .`when`(iconCache)
+ .getTitleNoCache(any<ComponentWithLabel>())
+
+ app1PackageItemInfo = packageItemInfoWithTitle(APP_1_PACKAGE_NAME, APP_1_PACKAGE_TITLE)
+ app2PackageItemInfo = packageItemInfoWithTitle(APP_2_PACKAGE_NAME, APP_2_PACKAGE_TITLE)
+
+ app1WidgetItem1 = createWidgetItem(APP_1_PACKAGE_NAME, APP_1_PROVIDER_1_CLASS_NAME)
+ app1WidgetItem2 = createWidgetItem(APP_1_PACKAGE_NAME, APP_1_PROVIDER_2_CLASS_NAME)
+ app2WidgetItem1 = createWidgetItem(APP_2_PACKAGE_NAME, APP_2_PROVIDER_1_CLASS_NAME)
+ }
+
+ @Test
+ fun withWidgets_returnsACopyWithProvidedWidgets() {
+ // only app two
+ val widgetPickerData = WidgetPickerData(allWidgets = appTwoWidgetsListBaseEntries())
+
+ // update: only app 1 and default list set
+ val newAllWidgets: List<WidgetsListBaseEntry> =
+ appOneWidgetsListBaseEntries(includeWidgetTwo = true)
+ val newDefaultWidgets: List<WidgetsListBaseEntry> =
+ appOneWidgetsListBaseEntries(includeWidgetTwo = false)
+
+ val newWidgetData = widgetPickerData.withWidgets(newAllWidgets, newDefaultWidgets)
+
+ assertThat(newWidgetData.allWidgets).containsExactlyElementsIn(newAllWidgets)
+ assertThat(newWidgetData.defaultWidgets).containsExactlyElementsIn(newDefaultWidgets)
+ }
+
+ @Test
+ fun withWidgets_noExplicitDefaults_unsetsOld() {
+ // only app two
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets = appTwoWidgetsListBaseEntries(),
+ defaultWidgets = appTwoWidgetsListBaseEntries()
+ )
+
+ val newWidgetData =
+ widgetPickerData.withWidgets(allWidgets = appOneWidgetsListBaseEntries())
+
+ assertThat(newWidgetData.allWidgets)
+ .containsExactlyElementsIn(appOneWidgetsListBaseEntries())
+ assertThat(newWidgetData.defaultWidgets).isEmpty() // previous values cleared.
+ }
+
+ @Test
+ fun withRecommendedWidgets_returnsACopyWithProvidedRecommendedWidgets() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets = buildList { appTwoWidgetsListBaseEntries() }
+ )
+ val recommendations: List<ItemInfo> =
+ listOf(
+ PendingAddWidgetInfo(
+ app1WidgetItem1.widgetInfo,
+ CONTAINER_WIDGETS_PREDICTION,
+ CATEGORY_1
+ ),
+ PendingAddWidgetInfo(
+ app2WidgetItem1.widgetInfo,
+ CONTAINER_WIDGETS_PREDICTION,
+ CATEGORY_2
+ ),
+ )
+
+ val updatedData = widgetPickerData.withRecommendedWidgets(recommendations)
+
+ assertThat(updatedData.recommendations.keys).containsExactly(CATEGORY_1, CATEGORY_2)
+ assertThat(updatedData.recommendations[CATEGORY_1]).containsExactly(app1WidgetItem1)
+ assertThat(updatedData.recommendations[CATEGORY_2]).containsExactly(app2WidgetItem1)
+ }
+
+ @Test
+ fun withRecommendedWidgets_noCategory_usesDefault() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets = buildList { appTwoWidgetsListBaseEntries() }
+ )
+ val recommendations: List<ItemInfo> =
+ listOf(
+ PendingAddWidgetInfo(app1WidgetItem1.widgetInfo, CONTAINER_WIDGETS_PREDICTION),
+ PendingAddWidgetInfo(app2WidgetItem1.widgetInfo, CONTAINER_WIDGETS_PREDICTION),
+ )
+
+ val updatedData = widgetPickerData.withRecommendedWidgets(recommendations)
+
+ assertThat(updatedData.recommendations.keys)
+ .containsExactly(DEFAULT_WIDGET_RECOMMENDATION_CATEGORY)
+ assertThat(updatedData.recommendations[DEFAULT_WIDGET_RECOMMENDATION_CATEGORY])
+ .containsExactly(app1WidgetItem1, app2WidgetItem1)
+ }
+
+ @Test
+ fun withRecommendedWidgets_emptyRecommendations_clearsOld() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets = buildList { appTwoWidgetsListBaseEntries() },
+ recommendations = mapOf(CATEGORY_1 to listOf(app1WidgetItem1))
+ )
+
+ val updatedData = widgetPickerData.withRecommendedWidgets(listOf())
+
+ assertThat(updatedData.recommendations).isEmpty()
+ }
+
+ @Test
+ fun withRecommendedWidgets_widgetNotInAllWidgets_filteredOut() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries(includeWidgetTwo = false))
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets = buildList { appTwoWidgetsListBaseEntries() },
+ )
+
+ val recommendations: List<ItemInfo> =
+ listOf(
+ PendingAddWidgetInfo(app1WidgetItem2.widgetInfo, CONTAINER_WIDGETS_PREDICTION),
+ PendingAddWidgetInfo(app2WidgetItem1.widgetInfo, CONTAINER_WIDGETS_PREDICTION),
+ )
+ val updatedData = widgetPickerData.withRecommendedWidgets(recommendations)
+
+ assertThat(updatedData.recommendations).hasSize(1)
+ // no app1widget2
+ assertThat(updatedData.recommendations.values.first()).containsExactly(app2WidgetItem1)
+ }
+
+ @Test
+ fun findContentEntryForPackageUser_returnsCorrectEntry() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets = buildList { addAll(appTwoWidgetsListBaseEntries()) }
+ )
+ val app1PackageUserKey = PackageUserKey.fromPackageItemInfo(app1PackageItemInfo)
+
+ val contentEntry = findContentEntryForPackageUser(widgetPickerData, app1PackageUserKey)
+
+ assertThat(contentEntry).isNotNull()
+ assertThat(contentEntry?.mPkgItem).isEqualTo(app1PackageItemInfo)
+ assertThat(contentEntry?.mWidgets).hasSize(2)
+ }
+
+ @Test
+ fun findContentEntryForPackageUser_fromDefaults_returnsEntryFromDefaultWidgets() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets =
+ buildList { addAll(appOneWidgetsListBaseEntries(includeWidgetTwo = false)) }
+ )
+ val app1PackageUserKey = PackageUserKey.fromPackageItemInfo(app1PackageItemInfo)
+
+ val contentEntry =
+ findContentEntryForPackageUser(
+ widgetPickerData = widgetPickerData,
+ packageUserKey = app1PackageUserKey,
+ fromDefaultWidgets = true
+ )
+
+ assertThat(contentEntry).isNotNull()
+ assertThat(contentEntry?.mPkgItem).isEqualTo(app1PackageItemInfo)
+ // only one widget (since default widgets had only one widget for app A
+ assertThat(contentEntry?.mWidgets).hasSize(1)
+ }
+
+ @Test
+ fun findContentEntryForPackageUser_noMatch_returnsNull() {
+ val app2PackageUserKey = PackageUserKey.fromPackageItemInfo(app2PackageItemInfo)
+ val widgetPickerData =
+ WidgetPickerData(allWidgets = buildList { addAll(appOneWidgetsListBaseEntries()) })
+
+ val contentEntry = findContentEntryForPackageUser(widgetPickerData, app2PackageUserKey)
+
+ assertThat(contentEntry).isNull()
+ }
+
+ @Test
+ fun findAllWidgetsForPackageUser_returnsListOfWidgets() {
+ val app1PackageUserKey = PackageUserKey.fromPackageItemInfo(app1PackageItemInfo)
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets =
+ buildList {
+ addAll(appOneWidgetsListBaseEntries())
+ addAll(appTwoWidgetsListBaseEntries())
+ },
+ defaultWidgets =
+ buildList { addAll(appOneWidgetsListBaseEntries(includeWidgetTwo = false)) }
+ )
+
+ val widgets = findAllWidgetsForPackageUser(widgetPickerData, app1PackageUserKey)
+
+ // both widgets returned irrespective of default widgets list
+ assertThat(widgets).hasSize(2)
+ }
+
+ @Test
+ fun findAllWidgetsForPackageUser_noMatch_returnsEmptyList() {
+ val widgetPickerData =
+ WidgetPickerData(
+ allWidgets = buildList { addAll(appTwoWidgetsListBaseEntries()) },
+ )
+ val app1PackageUserKey = PackageUserKey.fromPackageItemInfo(app1PackageItemInfo)
+
+ val widgets = findAllWidgetsForPackageUser(widgetPickerData, app1PackageUserKey)
+
+ assertThat(widgets).isEmpty()
+ }
+
+ private fun packageItemInfoWithTitle(packageName: String, title: String): PackageItemInfo {
+ val packageItemInfo = PackageItemInfo(packageName, userHandle)
+ packageItemInfo.title = title
+ return packageItemInfo
+ }
+
+ private fun createWidgetItem(packageName: String, widgetProviderName: String): WidgetItem {
+ val providerInfo =
+ WidgetUtils.createAppWidgetProviderInfo(
+ ComponentName.createRelative(packageName, widgetProviderName)
+ )
+ val widgetInfo = LauncherAppWidgetProviderInfo.fromProviderInfo(context, providerInfo)
+ return WidgetItem(widgetInfo, testInvariantProfile, iconCache, context)
+ }
+
+ private fun appTwoWidgetsListBaseEntries(): List<WidgetsListBaseEntry> = buildList {
+ val widgets = listOf(app2WidgetItem1)
+ add(WidgetsListHeaderEntry.create(app2PackageItemInfo, APP_2_SECTION_NAME, widgets))
+ add(WidgetsListContentEntry(app2PackageItemInfo, APP_2_SECTION_NAME, widgets))
+ }
+
+ private fun appOneWidgetsListBaseEntries(
+ includeWidgetTwo: Boolean = true
+ ): List<WidgetsListBaseEntry> = buildList {
+ val widgets =
+ if (includeWidgetTwo) {
+ listOf(app1WidgetItem1, app1WidgetItem2)
+ } else {
+ listOf(app1WidgetItem1)
+ }
+
+ add(WidgetsListHeaderEntry.create(app1PackageItemInfo, APP_1_SECTION_NAME, widgets))
+ add(WidgetsListContentEntry(app1PackageItemInfo, APP_1_SECTION_NAME, widgets))
+ }
+
+ companion object {
+ private const val APP_1_PACKAGE_NAME = "com.example.app1"
+ private const val APP_1_PACKAGE_TITLE = "App1"
+ private const val APP_1_SECTION_NAME = "A" // for fast popup
+ private const val APP_1_PROVIDER_1_CLASS_NAME = "app1Provider1"
+ private const val APP_1_PROVIDER_2_CLASS_NAME = "app1Provider2"
+
+ private const val APP_2_PACKAGE_NAME = "com.example.app2"
+ private const val APP_2_PACKAGE_TITLE = "SomeApp2"
+ private const val APP_2_SECTION_NAME = "S" // for fast popup
+ private const val APP_2_PROVIDER_1_CLASS_NAME = "app2Provider1"
+
+ private val CATEGORY_1 =
+ WidgetRecommendationCategory(/* categoryTitleRes= */ 0, /* order= */ 0)
+ private val CATEGORY_2 =
+ WidgetRecommendationCategory(/* categoryTitleRes= */ 1, /* order= */ 1)
+ }
+}
diff --git a/tests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java
similarity index 95%
rename from tests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java
index 9c03ccf..24d66a3 100644
--- a/tests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/search/SimpleWidgetsSearchAlgorithmTest.java
@@ -17,6 +17,7 @@
package com.android.launcher3.widget.picker.search;
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo;
@@ -44,12 +45,12 @@
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.PackageItemInfo;
-import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.search.SearchCallback;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
import com.android.launcher3.widget.model.WidgetsListContentEntry;
import com.android.launcher3.widget.model.WidgetsListHeaderEntry;
+import com.android.launcher3.widget.picker.search.WidgetsSearchBar.WidgetsSearchDataProvider;
import org.junit.Before;
import org.junit.Test;
@@ -78,7 +79,7 @@
private SimpleWidgetsSearchAlgorithm mSimpleWidgetsSearchAlgorithm;
@Mock
- private PopupDataProvider mDataProvider;
+ private WidgetsSearchDataProvider mDataProvider;
@Mock
private SearchCallback<WidgetsListBaseEntry> mSearchCallback;
@@ -105,7 +106,7 @@
mSimpleWidgetsSearchAlgorithm = MAIN_EXECUTOR.submit(
() -> new SimpleWidgetsSearchAlgorithm(mDataProvider)).get();
- doReturn(Collections.EMPTY_LIST).when(mDataProvider).getAllWidgets();
+ doReturn(Collections.EMPTY_LIST).when(mDataProvider).getWidgets();
}
@Test
@@ -113,7 +114,7 @@
doReturn(List.of(mCalendarHeaderEntry, mCalendarContentEntry, mCameraHeaderEntry,
mCameraContentEntry, mClockHeaderEntry, mClockContentEntry))
.when(mDataProvider)
- .getAllWidgets();
+ .getWidgets();
assertEquals(List.of(
WidgetsListHeaderEntry.createForSearch(
@@ -134,7 +135,7 @@
doReturn(List.of(mCalendarHeaderEntry, mCalendarContentEntry, mCameraHeaderEntry,
mCameraContentEntry))
.when(mDataProvider)
- .getAllWidgets();
+ .getWidgets();
assertEquals(List.of(
WidgetsListHeaderEntry.createForSearch(
@@ -161,9 +162,9 @@
doReturn(List.of(mCalendarHeaderEntry, mCalendarContentEntry, mCameraHeaderEntry,
mCameraContentEntry, mClockHeaderEntry, mClockContentEntry))
.when(mDataProvider)
- .getAllWidgets();
+ .getWidgets();
mSimpleWidgetsSearchAlgorithm.doSearch("Ca", mSearchCallback);
- MAIN_EXECUTOR.submit(() -> { }).get();
+ getInstrumentation().waitForIdleSync();
verify(mSearchCallback).onSearchResult(
matches("Ca"), argThat(a -> a != null && !a.isEmpty()));
}
diff --git a/tests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt
similarity index 92%
rename from tests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt
index 040fbf5..7a858e4 100644
--- a/tests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/picker/util/WidgetPreviewContainerSizesTest.kt
@@ -43,6 +43,7 @@
private lateinit var context: Context
private lateinit var deviceProfile: DeviceProfile
private lateinit var testInvariantProfile: InvariantDeviceProfile
+ private lateinit var widgetItemInvariantProfile: InvariantDeviceProfile
@Mock private lateinit var iconCache: IconCache
@@ -51,6 +52,11 @@
MockitoAnnotations.initMocks(this)
context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
testInvariantProfile = LauncherAppState.getIDP(context)
+ widgetItemInvariantProfile =
+ InvariantDeviceProfile().apply {
+ numRows = TEST_GRID_SIZE
+ numColumns = TEST_GRID_SIZE
+ }
deviceProfile = testInvariantProfile.getDeviceProfile(context).copy(context)
}
@@ -60,7 +66,8 @@
val expectedPreviewContainers = testSizes.values.toList()
for ((index, widgetSize) in testSizes.keys.withIndex()) {
- val widgetItem = createWidgetItem(widgetSize, context, testInvariantProfile, iconCache)
+ val widgetItem =
+ createWidgetItem(widgetSize, context, widgetItemInvariantProfile, iconCache)
assertWithMessage("size for $widgetSize should be: ${expectedPreviewContainers[index]}")
.that(WidgetPreviewContainerSize.forItem(widgetItem, deviceProfile))
@@ -70,6 +77,7 @@
companion object {
private const val TEST_PACKAGE = "com.google.test"
+ private const val TEST_GRID_SIZE = 6
private val HANDHELD_TEST_SIZES: Map<Point, WidgetPreviewContainerSize> =
mapOf(
@@ -77,7 +85,8 @@
Point(1, 1) to WidgetPreviewContainerSize(1, 1),
// 2x1
Point(2, 1) to WidgetPreviewContainerSize(2, 1),
- Point(3, 1) to WidgetPreviewContainerSize(2, 1),
+ // 3x1
+ Point(3, 1) to WidgetPreviewContainerSize(3, 1),
// 4x1
Point(4, 1) to WidgetPreviewContainerSize(4, 1),
// 2x2
diff --git a/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java b/tests/multivalentTests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
similarity index 100%
rename from tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
rename to tests/multivalentTests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
diff --git a/tests/multivalentTests/src/com/android/launcher3/widget/util/WidgetDragScaleUtilsTest.kt b/tests/multivalentTests/src/com/android/launcher3/widget/util/WidgetDragScaleUtilsTest.kt
new file mode 100644
index 0000000..63833e4
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/widget/util/WidgetDragScaleUtilsTest.kt
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.widget.util
+
+import android.content.Context
+import android.graphics.Point
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.DeviceProfile
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.R
+import com.android.launcher3.model.data.ItemInfo
+import com.android.launcher3.util.ActivityContextWrapper
+import com.google.common.truth.Truth.assertThat
+import org.junit.Assume.assumeTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.any
+import org.mockito.Mockito
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class WidgetDragScaleUtilsTest {
+ private lateinit var context: Context
+ private lateinit var itemInfo: ItemInfo
+ private lateinit var deviceProfile: DeviceProfile
+
+ @Before
+ fun setup() {
+ context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+
+ itemInfo = ItemInfo()
+
+ deviceProfile =
+ Mockito.spy(LauncherAppState.getIDP(context).getDeviceProfile(context).copy(context))
+
+ doReturn(0.8f)
+ .whenever(deviceProfile).getWorkspaceSpringLoadScale(any(Context::class.java))
+ deviceProfile.cellLayoutBorderSpacePx = Point(CELL_SPACING, CELL_SPACING)
+ deviceProfile.widgetPadding.setEmpty()
+ }
+
+ @Test
+ fun getWidgetDragScalePx_largeDraggedView_downScaled() {
+ val minSize = context.resources.getDimensionPixelSize(
+ R.dimen.widget_drag_view_min_scale_down_size)
+ whenever(deviceProfile.cellSize).thenReturn(Point(minSize * 2, minSize * 2))
+
+ itemInfo.spanX = 2
+ itemInfo.spanY = 2
+
+ val widgetSize = WidgetSizes.getWidgetSizePx(deviceProfile, itemInfo.spanX, itemInfo.spanY)
+ // Assume dragged view was a drawable which was larger than widget's size.
+ val draggedViewWidthPx = widgetSize.width + 0.5f * widgetSize.width
+ val draggedViewHeightPx = widgetSize.height + 0.5f * widgetSize.height
+ // Returns negative scale pixels - i.e. downscaled
+ assertThat(
+ WidgetDragScaleUtils.getWidgetDragScalePx(
+ context,
+ deviceProfile,
+ draggedViewWidthPx,
+ draggedViewHeightPx,
+ itemInfo
+ )
+ )
+ .isLessThan(0)
+ }
+
+ @Test
+ fun getWidgetDragScalePx_draggedViewSameAsWidgetSize_downScaled() {
+ val minSize = context.resources.getDimensionPixelSize(
+ R.dimen.widget_drag_view_min_scale_down_size)
+ whenever(deviceProfile.cellSize).thenReturn(Point(minSize * 2, minSize * 2))
+ itemInfo.spanX = 4
+ itemInfo.spanY = 2
+
+ val widgetSize = WidgetSizes.getWidgetSizePx(deviceProfile, itemInfo.spanX, itemInfo.spanY)
+ // Assume dragged view was a drawable which was larger than widget's size.
+ val draggedViewWidthPx = widgetSize.width.toFloat()
+ val draggedViewHeightPx = widgetSize.height.toFloat()
+ // Returns negative scale pixels - i.e. downscaled
+ // Even if dragged view was of same size as widget's drop target, to accommodate the spring
+ // load scaling of workspace and additionally getting the view inside of drop target frame,
+ // widget would be downscaled.
+ assertThat(
+ WidgetDragScaleUtils.getWidgetDragScalePx(
+ context,
+ deviceProfile,
+ draggedViewWidthPx,
+ draggedViewHeightPx,
+ itemInfo
+ )
+ )
+ .isLessThan(0)
+ }
+
+ @Test
+ fun getWidgetDragScalePx_draggedViewSmallerThanMinSize_scaledSizeIsAtLeastMinSize() {
+ val minSizePx =
+ context.resources.getDimensionPixelSize(R.dimen.widget_drag_view_min_scale_down_size)
+ // Assume min size is greater than cell size, so that, we know the upscale of dragged view
+ // is due to min size enforcement.
+ whenever(deviceProfile.cellSize).thenReturn(Point(minSizePx / 2, minSizePx / 2))
+ itemInfo.spanX = 1
+ itemInfo.spanY = 1
+
+ val draggedViewWidthPx = minSizePx - 15f
+ val draggedViewHeightPx = minSizePx - 15f
+
+ // Returns positive scale pixels - i.e. up-scaled
+ val finalScalePx =
+ WidgetDragScaleUtils.getWidgetDragScalePx(
+ context,
+ deviceProfile,
+ draggedViewWidthPx,
+ draggedViewHeightPx,
+ itemInfo
+ )
+
+ val effectiveWidthPx = draggedViewWidthPx + finalScalePx
+ val scaleFactor = (draggedViewWidthPx + finalScalePx) / draggedViewWidthPx
+ val effectiveHeightPx = scaleFactor * draggedViewHeightPx
+ // Both original height and width were smaller than min size, scaling them down below min
+ // size would have made them not visible under the finger. Here, as expected, widget is
+ // at least as large as min size.
+ assertThat(effectiveWidthPx).isAtLeast(minSizePx)
+ assertThat(effectiveHeightPx).isAtLeast(minSizePx)
+ }
+
+ companion object {
+ const val CELL_SPACING = 10
+ }
+}
diff --git a/tests/multivalentTestsForDeviceless b/tests/multivalentTestsForDeviceless
deleted file mode 120000
index 20ee34a..0000000
--- a/tests/multivalentTestsForDeviceless
+++ /dev/null
@@ -1 +0,0 @@
-multivalentTests
\ No newline at end of file
diff --git a/tests/res/layout/utilities_test_view.xml b/tests/res/layout/utilities_test_view.xml
deleted file mode 100644
index dc2a515..0000000
--- a/tests/res/layout/utilities_test_view.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright (C) 2024 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:id="@+id/root_view">
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:id="@+id/mid_view">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/child_view" />
- </LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/tests/src/com/android/launcher3/allapps/FloatingMaskViewTest.kt b/tests/src/com/android/launcher3/allapps/FloatingMaskViewTest.kt
new file mode 100644
index 0000000..cf03adc
--- /dev/null
+++ b/tests/src/com/android/launcher3/allapps/FloatingMaskViewTest.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.allapps
+
+import android.content.Context
+import android.view.ViewGroup
+import android.view.ViewGroup.MarginLayoutParams
+import android.widget.ImageView
+import androidx.test.core.app.ApplicationProvider
+import com.android.launcher3.util.ActivityContextWrapper
+import com.google.common.truth.Truth
+import org.junit.Before
+import org.junit.Test
+import org.mockito.Mock
+import org.mockito.Mockito
+import org.mockito.MockitoAnnotations
+
+class FloatingMaskViewTest {
+ @Mock
+ private val mockAllAppsRecyclerView: AllAppsRecyclerView? = null
+
+ @Mock
+ private val mockBottomBox: ImageView? = null
+ private var mVut: FloatingMaskView? = null
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ val context: Context = ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ mVut = FloatingMaskView(context)
+ mVut!!.layoutParams = MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT)
+ }
+
+ @Test
+ fun setParameters_paramsMarginEqualRecyclerViewPadding() {
+ val floatingMaskView = Mockito.spy(mVut)
+ Mockito.`when`(mockAllAppsRecyclerView!!.paddingLeft).thenReturn(PADDING_PX)
+ Mockito.`when`(mockAllAppsRecyclerView.paddingRight).thenReturn(PADDING_PX)
+ Mockito.`when`(mockAllAppsRecyclerView.paddingBottom).thenReturn(PADDING_PX)
+ Mockito.`when`(floatingMaskView!!.bottomBox).thenReturn(mockBottomBox)
+ val lp = floatingMaskView.layoutParams as MarginLayoutParams
+
+ floatingMaskView.setParameters(lp, mockAllAppsRecyclerView)
+
+ Truth.assertThat(lp.leftMargin).isEqualTo(PADDING_PX)
+ Truth.assertThat(lp.rightMargin).isEqualTo(PADDING_PX)
+ Mockito.verify(mockBottomBox)?.minimumHeight = PADDING_PX
+ }
+
+ companion object {
+ private const val PADDING_PX = 15
+ }
+}
diff --git a/tests/src/com/android/launcher3/allapps/PrivateProfileManagerTest.java b/tests/src/com/android/launcher3/allapps/PrivateProfileManagerTest.java
index b6b2261..430e496 100644
--- a/tests/src/com/android/launcher3/allapps/PrivateProfileManagerTest.java
+++ b/tests/src/com/android/launcher3/allapps/PrivateProfileManagerTest.java
@@ -22,8 +22,6 @@
import static com.android.launcher3.allapps.UserProfileManager.STATE_ENABLED;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
-import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
@@ -130,7 +128,7 @@
public void lockPrivateProfile_requestsQuietModeAsTrue() throws Exception {
when(mAllAppsStore.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED)).thenReturn(false);
- mPrivateProfileManager.lockPrivateProfile();
+ mPrivateProfileManager.setQuietMode(true /* lock */);
awaitTasksCompleted();
Mockito.verify(mUserManager).requestQuietModeEnabled(true, PRIVATE_HANDLE);
@@ -140,7 +138,7 @@
public void unlockPrivateProfile_requestsQuietModeAsFalse() throws Exception {
when(mAllAppsStore.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED)).thenReturn(true);
- mPrivateProfileManager.unlockPrivateProfile();
+ mPrivateProfileManager.setQuietMode(false /* unlock */);
awaitTasksCompleted();
Mockito.verify(mUserManager).requestQuietModeEnabled(false, PRIVATE_HANDLE);
@@ -149,7 +147,7 @@
@Test
public void quietModeFlagPresent_privateSpaceIsResetToDisabled() {
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
- doNothing().when(privateProfileManager).resetPrivateSpaceDecorator(anyInt());
+ doNothing().when(privateProfileManager).addPrivateSpaceDecorator(anyInt());
doNothing().when(privateProfileManager).executeLock();
doReturn(mAllAppsRecyclerView).when(privateProfileManager).getMainRecyclerView();
when(mAllAppsStore.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED))
@@ -169,14 +167,14 @@
@Test
public void transitioningToUnlocked_resetCallsPostUnlock() throws Exception {
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
- doNothing().when(privateProfileManager).resetPrivateSpaceDecorator(anyInt());
+ doNothing().when(privateProfileManager).addPrivateSpaceDecorator(anyInt());
doReturn(mAllAppsRecyclerView).when(privateProfileManager).getMainRecyclerView();
when(mAllAppsStore.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED))
.thenReturn(false);
doNothing().when(privateProfileManager).expandPrivateSpace();
when(privateProfileManager.getCurrentState()).thenReturn(STATE_DISABLED);
- privateProfileManager.unlockPrivateProfile();
+ privateProfileManager.setQuietMode(false /* unlock */);
privateProfileManager.reset();
awaitTasksCompleted();
@@ -186,7 +184,7 @@
@Test
public void transitioningToLocked_resetCallsExecuteLock() throws Exception {
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
- doNothing().when(privateProfileManager).resetPrivateSpaceDecorator(anyInt());
+ doNothing().when(privateProfileManager).addPrivateSpaceDecorator(anyInt());
doNothing().when(privateProfileManager).executeLock();
doReturn(mAllAppsRecyclerView).when(privateProfileManager).getMainRecyclerView();
when(mAllAppsStore.hasModelFlag(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED))
@@ -194,7 +192,7 @@
doNothing().when(privateProfileManager).expandPrivateSpace();
when(privateProfileManager.getCurrentState()).thenReturn(STATE_ENABLED);
- privateProfileManager.lockPrivateProfile();
+ privateProfileManager.setQuietMode(true /* lock */);
privateProfileManager.reset();
awaitTasksCompleted();
@@ -207,7 +205,7 @@
ArgumentCaptor<Intent> acIntent = ArgumentCaptor.forClass(Intent.class);
mPrivateProfileManager.setPrivateSpaceSettingsAvailable(true);
- mPrivateProfileManager.openPrivateSpaceSettings(null);
+ mContext.startActivity(expectedIntent);
Mockito.verify(mContext).startActivity(acIntent.capture());
assertEquals("Intent Action is different",
diff --git a/tests/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewTest.java b/tests/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewTest.java
index 512b2ac..398f9c5 100644
--- a/tests/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewTest.java
+++ b/tests/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewTest.java
@@ -86,6 +86,8 @@
private static final String CAMERA_PACKAGE_NAME = "com.android.launcher3.tests.camera";
private static final int CONTAINER_HEADER_ELEMENT_COUNT = 1;
private static final int LOCK_UNLOCK_BUTTON_COUNT = 1;
+ private static final int MAIN_USER_APP_COUNT = 1;
+ private static final int VIEW_AT_END_OF_APP_LIST = 1;
private static final int PS_SETTINGS_BUTTON_COUNT_VISIBLE = 1;
private static final int PS_SETTINGS_BUTTON_COUNT_INVISIBLE = 0;
private static final int PS_TRANSITION_IMAGE_COUNT = 1;
@@ -116,7 +118,8 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- mContext = new ActivityContextWrapper(getApplicationContext());
+ mContext = new ActivityContextWrapper(getApplicationContext(),
+ R.style.DynamicColorsBaseLauncherTheme);
when(mAllApps.getContext()).thenReturn(mContext);
when(mUserCache.getUserInfo(PRIVATE_HANDLE)).thenReturn(PRIVATE_ICON_INFO);
when(mUserCache.getUserProfiles())
@@ -133,7 +136,7 @@
Bitmap unlockButton = getBitmap(mContext.getDrawable(R.drawable.ic_lock));
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
when(privateProfileManager.getCurrentState()).thenReturn(STATE_DISABLED);
- privateProfileManager.addPrivateSpaceHeaderViewElements(mPsHeaderLayout);
+ privateProfileManager.bindPrivateSpaceHeaderViewElements(mPsHeaderLayout);
awaitTasksCompleted();
int totalContainerHeaderView = 0;
@@ -168,7 +171,7 @@
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
when(privateProfileManager.getCurrentState()).thenReturn(STATE_ENABLED);
when(privateProfileManager.isPrivateSpaceSettingsAvailable()).thenReturn(true);
- privateProfileManager.addPrivateSpaceHeaderViewElements(mPsHeaderLayout);
+ privateProfileManager.bindPrivateSpaceHeaderViewElements(mPsHeaderLayout);
awaitTasksCompleted();
int totalContainerHeaderView = 0;
@@ -210,7 +213,7 @@
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
when(privateProfileManager.getCurrentState()).thenReturn(STATE_ENABLED);
when(privateProfileManager.isPrivateSpaceSettingsAvailable()).thenReturn(false);
- privateProfileManager.addPrivateSpaceHeaderViewElements(mPsHeaderLayout);
+ privateProfileManager.bindPrivateSpaceHeaderViewElements(mPsHeaderLayout);
awaitTasksCompleted();
int totalContainerHeaderView = 0;
@@ -248,7 +251,7 @@
Bitmap transitionImage = getBitmap(mContext.getDrawable(R.drawable.bg_ps_transition_image));
PrivateProfileManager privateProfileManager = spy(mPrivateProfileManager);
when(privateProfileManager.getCurrentState()).thenReturn(STATE_TRANSITION);
- privateProfileManager.addPrivateSpaceHeaderViewElements(mPsHeaderLayout);
+ privateProfileManager.bindPrivateSpaceHeaderViewElements(mPsHeaderLayout);
awaitTasksCompleted();
int totalContainerHeaderView = 0;
@@ -299,8 +302,8 @@
int rows = (int) (ALL_APPS_HEIGHT - PS_HEADER_HEIGHT - HEADER_PROTECTION_HEIGHT);
int position = rows * NUM_APP_COLS - (NUM_APP_COLS-1) + 1;
- // The number of adapterItems should be the private space apps + one main app + header.
- assertEquals(NUM_PRIVATE_SPACE_APPS + 1 + 1,
+ assertEquals(NUM_PRIVATE_SPACE_APPS + MAIN_USER_APP_COUNT
+ + CONTAINER_HEADER_ELEMENT_COUNT + VIEW_AT_END_OF_APP_LIST,
mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(position,
privateProfileManager.scrollForHeaderToBeVisibleInContainer(
@@ -334,8 +337,8 @@
int rows = (int) (ALL_APPS_HEIGHT - PS_HEADER_HEIGHT - HEADER_PROTECTION_HEIGHT) - 1;
int position = rows * NUM_APP_COLS - (NUM_APP_COLS-1) + 1;
- // The number of adapterItems should be the private space apps + one main app + header.
- assertEquals(NUM_PRIVATE_SPACE_APPS + 1 + 1,
+ assertEquals(NUM_PRIVATE_SPACE_APPS + MAIN_USER_APP_COUNT
+ + CONTAINER_HEADER_ELEMENT_COUNT + VIEW_AT_END_OF_APP_LIST,
mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(position,
privateProfileManager.scrollForHeaderToBeVisibleInContainer(
@@ -369,8 +372,8 @@
int rows = (int) (ALL_APPS_HEIGHT - BIGGER_PS_HEADER_HEIGHT - HEADER_PROTECTION_HEIGHT);
int position = rows * NUM_APP_COLS - (NUM_APP_COLS-1) + 1;
- // The number of adapterItems should be the private space apps + one main app + header.
- assertEquals(NUM_PRIVATE_SPACE_APPS + 1 + 1,
+ assertEquals(NUM_PRIVATE_SPACE_APPS + MAIN_USER_APP_COUNT
+ + CONTAINER_HEADER_ELEMENT_COUNT + VIEW_AT_END_OF_APP_LIST,
mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(position,
privateProfileManager.scrollForHeaderToBeVisibleInContainer(
@@ -398,8 +401,7 @@
mAlphabeticalAppsList.updateItemFilter(info -> info != null
&& info.user.equals(MAIN_HANDLE));
- // The number of adapterItems should be the private space apps + one main app.
- assertEquals(NUM_PRIVATE_SPACE_APPS + 1,
+ assertEquals(NUM_PRIVATE_SPACE_APPS + MAIN_USER_APP_COUNT + VIEW_AT_END_OF_APP_LIST,
mAlphabeticalAppsList.getAdapterItems().size());
assertEquals(SCROLL_NO_WHERE, privateProfileManager.scrollForHeaderToBeVisibleInContainer(
new AllAppsRecyclerView(mContext),
diff --git a/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java b/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
index 20684eb..4e627a9 100644
--- a/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
@@ -75,7 +75,6 @@
}
@Test
- @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/311410127
public void testAllAppsExitSearchAndFocusSearchResults() {
final HomeAllApps allApps = mLauncher.goHome().switchToAllApps();
assertTrue("Launcher internal state is not All Apps",
diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
index f3f6fa5..c7c9dbb 100644
--- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
@@ -25,7 +25,6 @@
import android.content.Intent;
import android.platform.test.annotations.PlatinumTest;
-import androidx.test.filters.FlakyTest;
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.launcher3.Launcher;
@@ -33,7 +32,6 @@
import com.android.launcher3.tapl.AllApps;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import com.android.launcher3.util.rule.ScreenRecordRule;
import org.junit.Test;
@@ -120,7 +118,6 @@
@Test
@PortraitLandscape
@PlatinumTest(focusArea = "launcher")
- @ScreenRecordRule.ScreenRecord // b/322228038
public void testAllAppsFromHome() {
// Test opening all apps
assertNotNull("switchToAllApps() returned null",
@@ -192,7 +189,6 @@
/**
* Makes sure that when pressing back when AllApps is open we go back to the Home screen.
*/
- @FlakyTest(bugId = 256615483)
@Test
@PortraitLandscape
public void testPressBackFromAllAppsToHome() {
diff --git a/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java b/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java
deleted file mode 100644
index 28a1325..0000000
--- a/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.celllayout;
-
-import static android.platform.uiautomator_helpers.DeviceHelpers.getContext;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.graphics.Point;
-import android.net.Uri;
-import android.util.Log;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.MultipageCellLayout;
-import com.android.launcher3.celllayout.board.CellLayoutBoard;
-import com.android.launcher3.celllayout.board.TestWorkspaceBuilder;
-import com.android.launcher3.celllayout.board.WidgetRect;
-import com.android.launcher3.tapl.Widget;
-import com.android.launcher3.tapl.WidgetResizeFrame;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.util.ModelTestExtensions;
-import com.android.launcher3.util.rule.ShellCommandRule;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class TaplReorderWidgetsTest extends AbstractLauncherUiTest<Launcher> {
-
- @Rule
- public ShellCommandRule mGrantWidgetRule = ShellCommandRule.grantWidgetBind();
-
- private static final String TAG = TaplReorderWidgetsTest.class.getSimpleName();
-
- private static final List<String> FOLDABLE_GRIDS = List.of("normal", "practical", "reasonable");
-
- TestWorkspaceBuilder mWorkspaceBuilder;
-
- @Before
- public void setup() throws Throwable {
- mWorkspaceBuilder = new TestWorkspaceBuilder(mTargetContext);
- super.setUp();
- }
-
- @After
- public void tearDown() {
- ModelTestExtensions.INSTANCE.clearModelDb(
- LauncherAppState.getInstance(getContext()).getModel()
- );
- }
-
- /**
- * Validate if the given board represent the current CellLayout
- **/
- private boolean validateBoard(List<CellLayoutBoard> testBoards) {
- ArrayList<CellLayoutBoard> workspaceBoards = workspaceToBoards();
- if (workspaceBoards.size() < testBoards.size()) {
- return false;
- }
- for (int i = 0; i < testBoards.size(); i++) {
- if (testBoards.get(i).compareTo(workspaceBoards.get(i)) != 0) {
- return false;
- }
- }
- return true;
- }
-
- private FavoriteItemsTransaction buildWorkspaceFromBoards(List<CellLayoutBoard> boards,
- FavoriteItemsTransaction transaction) {
- for (int i = 0; i < boards.size(); i++) {
- CellLayoutBoard board = boards.get(i);
- mWorkspaceBuilder.buildFromBoard(board, transaction, i);
- }
- return transaction;
- }
-
- private void printCurrentWorkspace() {
- InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
- ArrayList<CellLayoutBoard> boards = workspaceToBoards();
- for (int i = 0; i < boards.size(); i++) {
- Log.d(TAG, "Screen number " + i);
- Log.d(TAG, ".\n" + boards.get(i).toString(idp.numColumns, idp.numRows));
- }
- }
-
- private ArrayList<CellLayoutBoard> workspaceToBoards() {
- return getFromLauncher(CellLayoutTestUtils::workspaceToBoards);
- }
-
- private WidgetRect getWidgetClosestTo(Point point) {
- ArrayList<CellLayoutBoard> workspaceBoards = workspaceToBoards();
- int maxDistance = 9999;
- WidgetRect bestRect = null;
- for (int i = 0; i < workspaceBoards.get(0).getWidgets().size(); i++) {
- WidgetRect widget = workspaceBoards.get(0).getWidgets().get(i);
- if (widget.getCellX() == 0 && widget.getCellY() == 0) {
- continue;
- }
- int distance = Math.abs(point.x - widget.getCellX())
- + Math.abs(point.y - widget.getCellY());
- if (distance == 0) {
- break;
- }
- if (distance < maxDistance) {
- maxDistance = distance;
- bestRect = widget;
- }
- }
- return bestRect;
- }
-
- /**
- * This function might be odd, its function is to select a widget and leave it in its place.
- * The idea is to make the test broader and also test after a widgets resized because the
- * underlying code does different things in that case
- */
- private void triggerWidgetResize(ReorderTestCase testCase) {
- WidgetRect widgetRect = getWidgetClosestTo(testCase.moveMainTo);
- if (widgetRect == null) {
- // Some test doesn't have a widget in the final position, in those cases we will ignore
- // them
- return;
- }
- Widget widget = mLauncher.getWorkspace().getWidgetAtCell(widgetRect.getCellX(),
- widgetRect.getCellY());
- WidgetResizeFrame resizeFrame = widget.dragWidgetToWorkspace(widgetRect.getCellX(),
- widgetRect.getCellY(), widgetRect.getSpanX(), widgetRect.getSpanY());
- resizeFrame.dismiss();
- }
-
- private void runTestCase(ReorderTestCase testCase) {
- WidgetRect mainWidgetCellPos = CellLayoutBoard.getMainFromList(
- testCase.mStart);
-
- FavoriteItemsTransaction transaction =
- new FavoriteItemsTransaction(mTargetContext);
- transaction = buildWorkspaceFromBoards(testCase.mStart, transaction);
- transaction.commit();
- mLauncher.waitForLauncherInitialized();
- // resetLoaderState triggers the launcher to start loading the workspace which allows
- // waitForLauncherCondition to wait for that condition, otherwise the condition would
- // always be true and it wouldn't wait for the changes to be applied.
- waitForLauncherCondition("Workspace didn't finish loading", l -> !l.isWorkspaceLoading());
-
- triggerWidgetResize(testCase);
-
- Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(),
- mainWidgetCellPos.getCellY());
- assertNotNull(widget);
- WidgetResizeFrame resizeFrame = widget.dragWidgetToWorkspace(testCase.moveMainTo.x,
- testCase.moveMainTo.y, mainWidgetCellPos.getSpanX(), mainWidgetCellPos.getSpanY());
- resizeFrame.dismiss();
-
- boolean isValid = false;
- for (List<CellLayoutBoard> boards : testCase.mEnd) {
- isValid |= validateBoard(boards);
- if (isValid) break;
- }
- printCurrentWorkspace();
- assertTrue("Non of the valid boards match with the current state", isValid);
- }
-
- /**
- * Run only the test define for the current grid size if such test exist
- *
- * @param testCaseMap map containing all the tests per grid size (Point)
- */
- private boolean runTestCaseMap(Map<Point, ReorderTestCase> testCaseMap, String testName) {
- Point iconGridDimensions = mLauncher.getWorkspace().getIconGridDimensions();
- Log.d(TAG, "Running test " + testName + " for grid " + iconGridDimensions);
- if (!testCaseMap.containsKey(iconGridDimensions)) {
- Log.d(TAG, "The test " + testName + " doesn't support " + iconGridDimensions
- + " grid layout");
- return false;
- }
- runTestCase(testCaseMap.get(iconGridDimensions));
-
- return true;
- }
-
- private void runTestCaseMapForAllGrids(Map<Point, ReorderTestCase> testCaseMap,
- String testName) {
- boolean runAtLeastOnce = false;
- for (String grid : FOLDABLE_GRIDS) {
- applyGridOption(grid);
- mLauncher.waitForLauncherInitialized();
- runAtLeastOnce |= runTestCaseMap(testCaseMap, testName);
- }
- Assume.assumeTrue("None of the grids are supported", runAtLeastOnce);
- }
-
- private void applyGridOption(Object argValue) {
- String testProviderAuthority = mTargetContext.getPackageName() + ".grid_control";
- Uri gridUri = new Uri.Builder()
- .scheme(ContentResolver.SCHEME_CONTENT)
- .authority(testProviderAuthority)
- .appendPath("default_grid")
- .build();
- ContentValues values = new ContentValues();
- values.putObject("name", argValue);
- Assert.assertEquals(1,
- mTargetContext.getContentResolver().update(gridUri, values, null, null));
- }
-
- @Test
- public void simpleReorder() throws Exception {
- runTestCaseMap(getTestMap("ReorderWidgets/simple_reorder_case"),
- "push_reorder_case");
- }
-
- @Test
- public void pushTest() throws Exception {
- runTestCaseMap(getTestMap("ReorderWidgets/push_reorder_case"),
- "push_reorder_case");
- }
-
- @Test
- public void fullReorder() throws Exception {
- runTestCaseMap(getTestMap("ReorderWidgets/full_reorder_case"),
- "full_reorder_case");
- }
-
- @Test
- public void moveOutReorder() throws Exception {
- runTestCaseMap(getTestMap("ReorderWidgets/move_out_reorder_case"),
- "move_out_reorder_case");
- }
-
- @Test
- public void multipleCellLayoutsSimpleReorder() throws Exception {
- Assume.assumeTrue("Test doesn't support foldables", getFromLauncher(
- l -> l.getWorkspace().getScreenWithId(0) instanceof MultipageCellLayout));
- runTestCaseMapForAllGrids(getTestMap("ReorderWidgets/multiple_cell_layouts_simple_reorder"),
- "multiple_cell_layouts_simple_reorder");
- }
-
- @Test
- public void multipleCellLayoutsNoSpaceReorder() throws Exception {
- Assume.assumeTrue("Test doesn't support foldables", getFromLauncher(
- l -> l.getWorkspace().getScreenWithId(0) instanceof MultipageCellLayout));
- runTestCaseMapForAllGrids(
- getTestMap("ReorderWidgets/multiple_cell_layouts_no_space_reorder"),
- "multiple_cell_layouts_no_space_reorder");
- }
-
- @Test
- public void multipleCellLayoutsReorderToOtherSide() throws Exception {
- Assume.assumeTrue("Test doesn't support foldables", getFromLauncher(
- l -> l.getWorkspace().getScreenWithId(0) instanceof MultipageCellLayout));
- runTestCaseMapForAllGrids(
- getTestMap("ReorderWidgets/multiple_cell_layouts_reorder_other_side"),
- "multiple_cell_layouts_reorder_other_side");
- }
-
- private void addTestCase(Iterator<CellLayoutTestCaseReader.TestSection> sections,
- Map<Point, ReorderTestCase> testCaseMap) {
- CellLayoutTestCaseReader.Board startBoard =
- ((CellLayoutTestCaseReader.Board) sections.next());
- CellLayoutTestCaseReader.Arguments point =
- ((CellLayoutTestCaseReader.Arguments) sections.next());
- CellLayoutTestCaseReader.Board endBoard =
- ((CellLayoutTestCaseReader.Board) sections.next());
- Point moveTo = new Point(Integer.parseInt(point.arguments[0]),
- Integer.parseInt(point.arguments[1]));
- testCaseMap.put(endBoard.gridSize,
- new ReorderTestCase(startBoard.board, moveTo, endBoard.board));
- }
-
- private Map<Point, ReorderTestCase> getTestMap(String testPath) throws IOException {
- Map<Point, ReorderTestCase> testCaseMap = new HashMap<>();
- Iterator<CellLayoutTestCaseReader.TestSection> iterableSection =
- CellLayoutTestCaseReader.readFromFile(testPath).parse().iterator();
- while (iterableSection.hasNext()) {
- addTestCase(iterableSection, testCaseMap);
- }
- return testCaseMap;
- }
-}
diff --git a/tests/src/com/android/launcher3/celllayout/integrationtest/TestUtils.kt b/tests/src/com/android/launcher3/celllayout/integrationtest/TestUtils.kt
new file mode 100644
index 0000000..bcb9191
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/integrationtest/TestUtils.kt
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.celllayout.integrationtest
+
+import android.graphics.Point
+import android.graphics.Rect
+import android.view.View
+import android.view.ViewGroup
+import com.android.launcher3.CellLayout
+import com.android.launcher3.Utilities
+import com.android.launcher3.Workspace
+import com.android.launcher3.util.CellAndSpan
+import com.android.launcher3.widget.LauncherAppWidgetHostView
+
+object TestUtils {
+ fun <T> searchChildren(viewGroup: ViewGroup, type: Class<T>): T? where T : View {
+ for (i in 0..<viewGroup.childCount) {
+ val child = viewGroup.getChildAt(i)
+ if (type.isInstance(child)) {
+ return type.cast(child)
+ }
+ if (child is ViewGroup) {
+ val result = searchChildren(child, type)
+ if (result != null) {
+ return result
+ }
+ }
+ }
+ return null
+ }
+
+ fun getWidgetAtCell(
+ workspace: Workspace<*>,
+ cellX: Int,
+ cellY: Int
+ ): LauncherAppWidgetHostView {
+ val view =
+ (workspace.getPageAt(workspace.currentPage) as CellLayout).getChildAt(cellX, cellY)
+ assert(view != null) { "There is no view at $cellX , $cellY" }
+ assert(view is LauncherAppWidgetHostView) { "The view at $cellX , $cellY is not a widget" }
+ return view as LauncherAppWidgetHostView
+ }
+
+ fun getCellTopLeftRelativeToWorkspace(
+ workspace: Workspace<*>,
+ cellAndSpan: CellAndSpan
+ ): Point {
+ val target = Rect()
+ val cellLayout = workspace.getPageAt(workspace.currentPage) as CellLayout
+ cellLayout.cellToRect(
+ cellAndSpan.cellX,
+ cellAndSpan.cellY,
+ cellAndSpan.spanX,
+ cellAndSpan.spanY,
+ target
+ )
+ val point = floatArrayOf(target.left.toFloat(), target.top.toFloat())
+ Utilities.getDescendantCoordRelativeToAncestor(cellLayout, workspace, point, false)
+ return Point(point[0].toInt(), point[1].toInt())
+ }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/integrationtest/events/EventsRule.kt b/tests/src/com/android/launcher3/celllayout/integrationtest/events/EventsRule.kt
new file mode 100644
index 0000000..fb61ced
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/integrationtest/events/EventsRule.kt
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.celllayout.integrationtest.events
+
+import android.content.Context
+import com.android.launcher3.debug.TestEvent
+import com.android.launcher3.debug.TestEventEmitter
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+
+/**
+ * Rule to create EventWaiters to wait for events that happens on the Launcher. For reference look
+ * at [TestEvent] for existing events.
+ *
+ * Waiting for event should be used to prevent race conditions, it provides a more precise way of
+ * waiting for events compared to [AbstractLauncherUiTest#waitForLauncherCondition].
+ *
+ * This class overrides the [TestEventEmitter] with [TestEventsEmitterImplementation] and makes sure
+ * to return the [TestEventEmitter] to the previous value when finished.
+ */
+class EventsRule(val context: Context) : TestRule {
+
+ private var prevEventEmitter: TestEventEmitter? = null
+
+ private val eventEmitter = TestEventsEmitterImplementation()
+
+ override fun apply(base: Statement, description: Description?): Statement {
+ return object : Statement() {
+ override fun evaluate() {
+ beforeTest()
+ base.evaluate()
+ afterTest()
+ }
+ }
+ }
+
+ fun createEventWaiter(expectedEvent: TestEvent): EventWaiter {
+ return eventEmitter.createEventWaiter(expectedEvent)
+ }
+
+ private fun beforeTest() {
+ prevEventEmitter = TestEventEmitter.INSTANCE.get(context)
+ TestEventEmitter.INSTANCE.initializeForTesting(eventEmitter)
+ }
+
+ private fun afterTest() {
+ TestEventEmitter.INSTANCE.initializeForTesting(prevEventEmitter)
+ }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/integrationtest/events/TestEventsEmitterImplementation.kt b/tests/src/com/android/launcher3/celllayout/integrationtest/events/TestEventsEmitterImplementation.kt
new file mode 100644
index 0000000..365ad4b
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/integrationtest/events/TestEventsEmitterImplementation.kt
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.celllayout.integrationtest.events
+
+import android.util.Log
+import com.android.launcher3.debug.TestEvent
+import com.android.launcher3.debug.TestEventEmitter
+import java.util.concurrent.TimeUnit
+import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.withTimeoutOrNull
+
+enum class EventStatus() {
+ SUCCESS,
+ FAILURE,
+ TIMEOUT,
+}
+
+class EventWaiter(val eventToWait: TestEvent) {
+ private val deferrable = CompletableDeferred<EventStatus>()
+
+ companion object {
+ private const val TAG = "EventWaiter"
+ }
+
+ fun waitForSignal(timeout: Long = TimeUnit.SECONDS.toMillis(10)) = runBlocking {
+ var status = withTimeoutOrNull(timeout) { deferrable.await() }
+ if (status == null) {
+ status = EventStatus.TIMEOUT
+ }
+ if (status != EventStatus.SUCCESS) {
+ throw Exception("Failure waiting for event $eventToWait, failure = $status")
+ }
+ }
+
+ fun terminate() {
+ deferrable.complete(EventStatus.SUCCESS)
+ }
+}
+
+class TestEventsEmitterImplementation() : TestEventEmitter {
+ companion object {
+ private const val TAG = "TestEvents"
+ }
+
+ private val expectedEvents: ArrayDeque<EventWaiter> = ArrayDeque()
+
+ fun createEventWaiter(expectedEvent: TestEvent): EventWaiter {
+ val eventWaiter = EventWaiter(expectedEvent)
+ expectedEvents.add(eventWaiter)
+ return eventWaiter
+ }
+
+ private fun clearQueue() {
+ expectedEvents.clear()
+ }
+
+ override fun sendEvent(event: TestEvent) {
+ Log.d(TAG, "Signal received $event")
+ Log.d(TAG, "Total expected events ${expectedEvents.size}")
+ if (expectedEvents.isEmpty()) return
+ val eventWaiter = expectedEvents.last()
+ if (eventWaiter.eventToWait == event) {
+ Log.d(TAG, "Removing $event")
+ expectedEvents.removeLast()
+ eventWaiter.terminate()
+ } else {
+ Log.d(TAG, "Not matching $event")
+ }
+ }
+
+ override fun close() {
+ clearQueue()
+ }
+}
diff --git a/tests/src/com/android/launcher3/dragging/TaplDragTest.java b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
index 1c41ded..76c1948 100644
--- a/tests/src/com/android/launcher3/dragging/TaplDragTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
@@ -41,6 +41,7 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.TestUtil;
+import com.android.launcher3.util.rule.ScreenRecordRule;
import org.junit.Test;
@@ -64,6 +65,7 @@
@Test
@PortraitLandscape
@PlatinumTest(focusArea = "launcher")
+ @ScreenRecordRule.ScreenRecord // b/353600888
public void testDragToFolder() {
// TODO: add the use case to drag an icon to an existing folder. Currently it either fails
// on tablets or phones due to difference in resolution.
@@ -96,6 +98,7 @@
* icon left.
*/
@Test
+ @ScreenRecordRule.ScreenRecord // b/353600888
public void testDragOutOfFolder() {
final HomeAppIcon playStoreIcon = createShortcutIfNotExist(STORE_APP_NAME, 0, 1);
final HomeAppIcon photosIcon = createShortcutInCenterIfNotExist(PHOTOS_APP_NAME);
@@ -173,13 +176,13 @@
public void testDragAndCancelAppIcon() {
final HomeAppIcon homeAppIcon = createShortcutInCenterIfNotExist(GMAIL_APP_NAME);
Point positionBeforeDrag =
- mLauncher.getWorkspace().getWorkspaceIconsPositions().get(GMAIL_APP_NAME);
+ mLauncher.getWorkspace().getWorkspaceIconPosition(GMAIL_APP_NAME);
assertNotNull("App not found in Workspace before dragging.", positionBeforeDrag);
mLauncher.getWorkspace().dragAndCancelAppIcon(homeAppIcon);
Point positionAfterDrag =
- mLauncher.getWorkspace().getWorkspaceIconsPositions().get(GMAIL_APP_NAME);
+ mLauncher.getWorkspace().getWorkspaceIconPosition(GMAIL_APP_NAME);
assertNotNull("App not found in Workspace after dragging.", positionAfterDrag);
assertEquals("App not returned to same position in Workspace after drag & cancel",
positionBeforeDrag, positionAfterDrag);
@@ -194,6 +197,7 @@
@PlatinumTest(focusArea = "launcher")
@Test
@PortraitLandscape
+ @ScreenRecordRule.ScreenRecord // b/343953783
public void testDragAppIcon() {
final HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
@@ -221,24 +225,7 @@
public void testDragAppIconToMultipleWorkspaceCells() throws Exception {
long startTime, endTime, elapsedTime;
Point[] targets = TestUtil.getCornersAndCenterPositions(mLauncher);
-
- for (Point target : targets) {
- startTime = SystemClock.uptimeMillis();
- final HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
- allApps.freeze();
- try {
- allApps.getAppIcon(TEST_APP_NAME).dragToWorkspace(target.x, target.y);
- } finally {
- allApps.unfreeze();
- }
- // Reset the workspace for the next shortcut creation.
- reinitializeLauncherData(true);
- endTime = SystemClock.uptimeMillis();
- elapsedTime = endTime - startTime;
- Log.d("testDragAppIconToWorkspaceCellTime",
- "Milliseconds taken to drag app icon to workspace cell: " + elapsedTime);
- }
-
+ reinitializeLauncherData(true);
// test to move a shortcut to other cell.
final HomeAppIcon launcherTestAppIcon = createShortcutInCenterIfNotExist(TEST_APP_NAME);
for (Point target : targets) {
diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
index 70c0333..907aa50 100644
--- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
@@ -46,7 +46,6 @@
import java.io.IOException;
import java.util.Arrays;
-import java.util.Map;
/**
* Test runs in Out of process (Oop) and In process (Ipc)
@@ -60,6 +59,7 @@
*/
@Test
@PortraitLandscape
+ @ScreenRecordRule.ScreenRecord // b/349439239
public void testDeleteFromWorkspace() {
for (String appName : new String[]{GMAIL_APP_NAME, STORE_APP_NAME, TEST_APP_NAME}) {
final HomeAppIcon homeAppIcon = createShortcutInCenterIfNotExist(appName);
@@ -155,18 +155,14 @@
createShortcutIfNotExist(appNames[i], gridPositions[i]);
}
- Map<String, Point> initialPositions =
- mLauncher.getWorkspace().getWorkspaceIconsPositions();
- assertThat(initialPositions.keySet()).containsAtLeastElementsIn(appNames);
+ Point initialPosition =
+ mLauncher.getWorkspace().getWorkspaceIconPosition(DUMMY_APP_NAME);
+ assertThat(initialPosition).isNotNull();
- mLauncher.getWorkspace().getWorkspaceAppIcon(DUMMY_APP_NAME).uninstall();
- mLauncher.getWorkspace().verifyWorkspaceAppIconIsGone(
+ final Workspace workspace = mLauncher.getWorkspace().getWorkspaceAppIcon(
+ DUMMY_APP_NAME).uninstall();
+ workspace.verifyWorkspaceAppIconIsGone(
DUMMY_APP_NAME + " was expected to disappear after uninstall.", DUMMY_APP_NAME);
-
- Log.d(UIOBJECT_STALE_ELEMENT, "second getWorkspaceIconsPositions()");
- Map<String, Point> finalPositions =
- mLauncher.getWorkspace().getWorkspaceIconsPositions();
- assertThat(finalPositions).doesNotContainKey(DUMMY_APP_NAME);
} finally {
TestUtil.uninstallDummyApp();
}
diff --git a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
index 28a001f..d16674c 100644
--- a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
+++ b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
@@ -1,10 +1,13 @@
package com.android.launcher3.model
import android.appwidget.AppWidgetManager
+import android.content.Intent
import android.os.UserHandle
import android.platform.test.flag.junit.SetFlagsRule
+import android.provider.Settings
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
+import com.android.dx.mockito.inline.extended.ExtendedMockito
import com.android.launcher3.Flags
import com.android.launcher3.InvariantDeviceProfile
import com.android.launcher3.LauncherAppState
@@ -14,6 +17,7 @@
import com.android.launcher3.icons.cache.CachingLogic
import com.android.launcher3.icons.cache.IconCacheUpdateHandler
import com.android.launcher3.pm.UserCache
+import com.android.launcher3.provider.RestoreDbTask
import com.android.launcher3.ui.TestViewHelpers
import com.android.launcher3.util.Executors.MODEL_EXECUTOR
import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
@@ -21,21 +25,30 @@
import com.android.launcher3.util.UserIconInfo
import com.google.common.truth.Truth
import java.util.concurrent.CountDownLatch
+import junit.framework.Assert.assertEquals
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers.any
import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.ArgumentMatchers.anyList
+import org.mockito.ArgumentMatchers.anyMap
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.Mockito.times
-import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
+import org.mockito.MockitoSession
import org.mockito.Spy
+import org.mockito.kotlin.anyOrNull
import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+import org.mockito.quality.Strictness
private const val INSERTION_STATEMENT_FILE = "databases/workspace_items.sql"
@@ -43,6 +56,20 @@
@RunWith(AndroidJUnit4::class)
class LoaderTaskTest {
private var context = SandboxModelContext()
+ private val expectedBroadcastModel =
+ FirstScreenBroadcastModel(
+ installerPackage = "installerPackage",
+ pendingCollectionItems = mutableSetOf("pendingCollectionItem"),
+ pendingWidgetItems = mutableSetOf("pendingWidgetItem"),
+ pendingHotseatItems = mutableSetOf("pendingHotseatItem"),
+ pendingWorkspaceItems = mutableSetOf("pendingWorkspaceItem"),
+ installedHotseatItems = mutableSetOf("installedHotseatItem"),
+ installedWorkspaceItems = mutableSetOf("installedWorkspaceItem"),
+ firstScreenInstalledWidgets = mutableSetOf("installedFirstScreenWidget"),
+ secondaryScreenInstalledWidgets = mutableSetOf("installedSecondaryScreenWidget")
+ )
+ private lateinit var mockitoSession: MockitoSession
+
@Mock private lateinit var app: LauncherAppState
@Mock private lateinit var bgAllAppsList: AllAppsList
@Mock private lateinit var modelDelegate: ModelDelegate
@@ -61,7 +88,11 @@
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
-
+ mockitoSession =
+ ExtendedMockito.mockitoSession()
+ .strictness(Strictness.LENIENT)
+ .mockStatic(FirstScreenBroadcastHelper::class.java)
+ .startMocking()
val idp =
InvariantDeviceProfile().apply {
numRows = 5
@@ -90,6 +121,7 @@
@After
fun tearDown() {
context.onDestroy()
+ mockitoSession.finishMocking()
}
@Test
@@ -166,6 +198,141 @@
verify(bgAllAppsList, Mockito.never())
.setFlags(BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED, true)
}
+
+ @Test
+ fun `When launcher_broadcast_installed_apps and is restore then send installed item broadcast`() {
+ // Given
+ val spyContext = spy(context)
+ `when`(app.context).thenReturn(spyContext)
+ whenever(
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ anyOrNull(),
+ anyList(),
+ anyMap(),
+ anyList()
+ )
+ )
+ .thenReturn(listOf(expectedBroadcastModel))
+
+ whenever(
+ FirstScreenBroadcastHelper.sendBroadcastsForModels(
+ spyContext,
+ listOf(expectedBroadcastModel)
+ )
+ )
+ .thenCallRealMethod()
+
+ Settings.Secure.putInt(spyContext.contentResolver, "launcher_broadcast_installed_apps", 1)
+ RestoreDbTask.setPending(spyContext)
+
+ // When
+ LoaderTask(app, bgAllAppsList, BgDataModel(), modelDelegate, launcherBinder)
+ .runSyncOnBackgroundThread()
+
+ // Then
+ val argumentCaptor = ArgumentCaptor.forClass(Intent::class.java)
+ verify(spyContext).sendBroadcast(argumentCaptor.capture())
+ val actualBroadcastIntent = argumentCaptor.value
+ assertEquals(expectedBroadcastModel.installerPackage, actualBroadcastIntent.`package`)
+ assertEquals(
+ ArrayList(expectedBroadcastModel.installedWorkspaceItems),
+ actualBroadcastIntent.getStringArrayListExtra("workspaceInstalledItems")
+ )
+ assertEquals(
+ ArrayList(expectedBroadcastModel.installedHotseatItems),
+ actualBroadcastIntent.getStringArrayListExtra("hotseatInstalledItems")
+ )
+ assertEquals(
+ ArrayList(
+ expectedBroadcastModel.firstScreenInstalledWidgets +
+ expectedBroadcastModel.secondaryScreenInstalledWidgets
+ ),
+ actualBroadcastIntent.getStringArrayListExtra("widgetInstalledItems")
+ )
+ assertEquals(
+ ArrayList(expectedBroadcastModel.pendingCollectionItems),
+ actualBroadcastIntent.getStringArrayListExtra("folderItem")
+ )
+ assertEquals(
+ ArrayList(expectedBroadcastModel.pendingWorkspaceItems),
+ actualBroadcastIntent.getStringArrayListExtra("workspaceItem")
+ )
+ assertEquals(
+ ArrayList(expectedBroadcastModel.pendingHotseatItems),
+ actualBroadcastIntent.getStringArrayListExtra("hotseatItem")
+ )
+ assertEquals(
+ ArrayList(expectedBroadcastModel.pendingWidgetItems),
+ actualBroadcastIntent.getStringArrayListExtra("widgetItem")
+ )
+ }
+
+ @Test
+ fun `When not a restore then installed item broadcast not sent`() {
+ // Given
+ val spyContext = spy(context)
+ `when`(app.context).thenReturn(spyContext)
+ whenever(
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ anyOrNull(),
+ anyList(),
+ anyMap(),
+ anyList()
+ )
+ )
+ .thenReturn(listOf(expectedBroadcastModel))
+
+ whenever(
+ FirstScreenBroadcastHelper.sendBroadcastsForModels(
+ spyContext,
+ listOf(expectedBroadcastModel)
+ )
+ )
+ .thenCallRealMethod()
+
+ Settings.Secure.putInt(spyContext.contentResolver, "launcher_broadcast_installed_apps", 1)
+
+ // When
+ LoaderTask(app, bgAllAppsList, BgDataModel(), modelDelegate, launcherBinder)
+ .runSyncOnBackgroundThread()
+
+ // Then
+ verify(spyContext, times(0)).sendBroadcast(any(Intent::class.java))
+ }
+
+ @Test
+ fun `When launcher_broadcast_installed_apps false then installed item broadcast not sent`() {
+ // Given
+ val spyContext = spy(context)
+ `when`(app.context).thenReturn(spyContext)
+ whenever(
+ FirstScreenBroadcastHelper.createModelsForFirstScreenBroadcast(
+ anyOrNull(),
+ anyList(),
+ anyMap(),
+ anyList()
+ )
+ )
+ .thenReturn(listOf(expectedBroadcastModel))
+
+ whenever(
+ FirstScreenBroadcastHelper.sendBroadcastsForModels(
+ spyContext,
+ listOf(expectedBroadcastModel)
+ )
+ )
+ .thenCallRealMethod()
+
+ Settings.Secure.putInt(spyContext.contentResolver, "launcher_broadcast_installed_apps", 0)
+ RestoreDbTask.setPending(spyContext)
+
+ // When
+ LoaderTask(app, bgAllAppsList, BgDataModel(), modelDelegate, launcherBinder)
+ .runSyncOnBackgroundThread()
+
+ // Then
+ verify(spyContext, times(0)).sendBroadcast(any(Intent::class.java))
+ }
}
private fun LoaderTask.runSyncOnBackgroundThread() {
diff --git a/tests/src/com/android/launcher3/model/PackageUpdatedTaskTest.kt b/tests/src/com/android/launcher3/model/PackageUpdatedTaskTest.kt
new file mode 100644
index 0000000..05f626d
--- /dev/null
+++ b/tests/src/com/android/launcher3/model/PackageUpdatedTaskTest.kt
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import android.content.ComponentName
+import android.content.pm.ActivityInfo
+import android.content.pm.ApplicationInfo
+import android.content.pm.LauncherActivityInfo
+import android.content.pm.LauncherApps
+import android.os.UserHandle
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.launcher3.AppFilter
+import com.android.launcher3.Flags.FLAG_ENABLE_PRIVATE_SPACE
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherSettings
+import com.android.launcher3.icons.IconCache
+import com.android.launcher3.model.PackageUpdatedTask.OP_ADD
+import com.android.launcher3.model.PackageUpdatedTask.OP_REMOVE
+import com.android.launcher3.model.PackageUpdatedTask.OP_SUSPEND
+import com.android.launcher3.model.PackageUpdatedTask.OP_UNAVAILABLE
+import com.android.launcher3.model.PackageUpdatedTask.OP_UNSUSPEND
+import com.android.launcher3.model.PackageUpdatedTask.OP_UPDATE
+import com.android.launcher3.model.PackageUpdatedTask.OP_USER_AVAILABILITY_CHANGE
+import com.android.launcher3.model.data.AppInfo
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.util.Executors
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext
+import com.android.launcher3.util.TestUtil
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@RunWith(AndroidJUnit4::class)
+class PackageUpdatedTaskTest {
+
+ @get:Rule(order = 0) val setFlagsRule = SetFlagsRule()
+ @get:Rule(order = 1) val modelTestRule = ModelTestRule()
+
+ private val mUser = UserHandle(0)
+ private val mDataModel: BgDataModel = BgDataModel()
+ private val mLauncherModelHelper = LauncherModelHelper()
+ private val mContext: SandboxModelContext = spy(mLauncherModelHelper.sandboxContext)
+ private val mAppState: LauncherAppState = spy(LauncherAppState.getInstance(mContext))
+
+ private val expectedPackage = "Test.Package"
+ private val expectedComponent = ComponentName(expectedPackage, "TestClass")
+ private val expectedActivityInfo: LauncherActivityInfo = mock<LauncherActivityInfo>()
+ private val expectedWorkspaceItem = spy(WorkspaceItemInfo())
+
+ private val mockIconCache: IconCache = mock()
+ private val mockTaskController: ModelTaskController = mock<ModelTaskController>()
+ private val mockAppFilter: AppFilter = mock<AppFilter>()
+ private val mockApplicationInfo: ApplicationInfo = mock<ApplicationInfo>()
+ private val mockActivityInfo: ActivityInfo = mock<ActivityInfo>()
+
+ private lateinit var mAllAppsList: AllAppsList
+
+ @Before
+ fun setup() {
+ mAllAppsList = spy(AllAppsList(mockIconCache, mockAppFilter))
+ mLauncherModelHelper.sandboxContext.spyService(LauncherApps::class.java).apply {
+ whenever(getActivityList(expectedPackage, mUser))
+ .thenReturn(listOf(expectedActivityInfo))
+ }
+ whenever(mAppState.iconCache).thenReturn(mockIconCache)
+ whenever(mockTaskController.app).thenReturn(mAppState)
+ whenever(mockAppFilter.shouldShowApp(expectedComponent)).thenReturn(true)
+ mockApplicationInfo.apply {
+ uid = 1
+ isArchived = false
+ }
+ mockActivityInfo.isArchived = false
+ expectedActivityInfo.apply {
+ whenever(applicationInfo).thenReturn(mockApplicationInfo)
+ whenever(activityInfo).thenReturn(mockActivityInfo)
+ whenever(componentName).thenReturn(expectedComponent)
+ }
+ expectedWorkspaceItem.apply {
+ itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
+ container = LauncherSettings.Favorites.CONTAINER_DESKTOP
+ user = mUser
+ whenever(targetPackage).thenReturn(expectedPackage)
+ whenever(targetComponent).thenReturn(expectedComponent)
+ }
+ }
+
+ @After
+ fun tearDown() {
+ mLauncherModelHelper.destroy()
+ }
+
+ @Test
+ fun `OP_ADD triggers model callbacks and adds new items to AllAppsList`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_ADD, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mockIconCache).updateIconsForPkg(expectedPackage, mUser)
+ verify(mAllAppsList).addPackage(mContext, expectedPackage, mUser)
+ verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWorkspaceItem))
+ verify(mockTaskController).bindUpdatedWidgets(mDataModel)
+ assertThat(mAllAppsList.data.firstOrNull()?.componentName)
+ .isEqualTo(AppInfo(mContext, expectedActivityInfo, mUser).componentName)
+ }
+
+ @Test
+ fun `OP_UPDATE triggers model callbacks and updates items in AllAppsList`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_UPDATE, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mockIconCache).updateIconsForPkg(expectedPackage, mUser)
+ verify(mAllAppsList).updatePackage(mContext, expectedPackage, mUser)
+ verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWorkspaceItem))
+ assertThat(mAllAppsList.data.firstOrNull()?.componentName)
+ .isEqualTo(AppInfo(mContext, expectedActivityInfo, mUser).componentName)
+ }
+
+ @Test
+ fun `OP_REMOVE triggers model callbacks and removes packages and icons`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_REMOVE, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mockIconCache).removeIconsForPkg(expectedPackage, mUser)
+ verify(mAllAppsList).removePackage(expectedPackage, mUser)
+ verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWorkspaceItem))
+ assertThat(mAllAppsList.data).isEmpty()
+ }
+
+ @Test
+ fun `OP_UNAVAILABLE triggers model callbacks and removes package from AllAppsList`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_UNAVAILABLE, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mAllAppsList).removePackage(expectedPackage, mUser)
+ verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWorkspaceItem))
+ assertThat(mAllAppsList.data).isEmpty()
+ }
+
+ @Test
+ fun `OP_SUSPEND triggers model callbacks and updates flags in AllAppsList`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_SUSPEND, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ mAllAppsList.add(AppInfo(mContext, expectedActivityInfo, mUser), expectedActivityInfo)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mAllAppsList).updateDisabledFlags(any(), any())
+ verify(mockTaskController).bindUpdatedWorkspaceItems(listOf(expectedWorkspaceItem))
+ assertThat(mAllAppsList.getAndResetChangeFlag()).isTrue()
+ }
+
+ @Test
+ fun `OP_UNSUSPEND triggers no callbacks when app not suspended`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_UNSUSPEND, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mAllAppsList).updateDisabledFlags(any(), any())
+ verify(mockTaskController).bindUpdatedWorkspaceItems(emptyList())
+ assertThat(mAllAppsList.getAndResetChangeFlag()).isFalse()
+ }
+
+ @EnableFlags(FLAG_ENABLE_PRIVATE_SPACE)
+ @Test
+ fun `OP_USER_AVAILABILITY_CHANGE triggers no callbacks if current user not work or private`() {
+ // Given
+ val taskUnderTest = PackageUpdatedTask(OP_USER_AVAILABILITY_CHANGE, mUser, expectedPackage)
+ // When
+ mDataModel.addItem(mContext, expectedWorkspaceItem, true)
+ TestUtil.runOnExecutorSync(Executors.MODEL_EXECUTOR) {
+ taskUnderTest.execute(mockTaskController, mDataModel, mAllAppsList)
+ }
+ mLauncherModelHelper.loadModelSync()
+ // Then
+ verify(mAllAppsList).updateDisabledFlags(any(), any())
+ verify(mockTaskController).bindUpdatedWorkspaceItems(emptyList())
+ assertThat(mAllAppsList.data).isEmpty()
+ }
+}
diff --git a/tests/src/com/android/launcher3/model/WorkspaceItemProcessorExtraTest.kt b/tests/src/com/android/launcher3/model/WorkspaceItemProcessorExtraTest.kt
new file mode 100644
index 0000000..b93c305
--- /dev/null
+++ b/tests/src/com/android/launcher3/model/WorkspaceItemProcessorExtraTest.kt
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.model
+
+import android.appwidget.AppWidgetProviderInfo
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.content.pm.LauncherApps
+import android.content.pm.PackageInstaller
+import android.content.pm.ShortcutInfo
+import android.os.UserHandle
+import android.platform.test.annotations.EnableFlags
+import android.util.LongSparseArray
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.dx.mockito.inline.extended.ExtendedMockito
+import com.android.launcher3.Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING
+import com.android.launcher3.LauncherAppState
+import com.android.launcher3.LauncherSettings.Favorites
+import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
+import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
+import com.android.launcher3.Utilities
+import com.android.launcher3.model.data.IconRequestInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo
+import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_RESTORE_STARTED
+import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_UI_NOT_READY
+import com.android.launcher3.model.data.WorkspaceItemInfo
+import com.android.launcher3.pm.UserCache
+import com.android.launcher3.shortcuts.ShortcutKey
+import com.android.launcher3.util.ComponentKey
+import com.android.launcher3.util.PackageManagerHelper
+import com.android.launcher3.util.PackageUserKey
+import com.android.launcher3.util.UserIconInfo
+import com.android.launcher3.widget.WidgetInflater
+import com.android.launcher3.widget.WidgetSections
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Mock
+import org.mockito.Mockito
+import org.mockito.Mockito.RETURNS_DEEP_STUBS
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+import org.mockito.quality.Strictness
+
+@RunWith(AndroidJUnit4::class)
+class WorkspaceItemProcessorExtraTest {
+
+ @Mock private lateinit var mockIconRequestInfo: IconRequestInfo<WorkspaceItemInfo>
+ @Mock private lateinit var mockWorkspaceInfo: WorkspaceItemInfo
+ @Mock private lateinit var mockBgDataModel: BgDataModel
+ @Mock private lateinit var mockContext: Context
+ @Mock private lateinit var mockAppState: LauncherAppState
+ @Mock private lateinit var mockPmHelper: PackageManagerHelper
+ @Mock private lateinit var mockLauncherApps: LauncherApps
+ @Mock private lateinit var mockCursor: LoaderCursor
+ @Mock private lateinit var mockUserCache: UserCache
+ @Mock private lateinit var mockUserManagerState: UserManagerState
+ @Mock private lateinit var mockWidgetInflater: WidgetInflater
+
+ private var intent: Intent = Intent()
+ private var mUserHandle: UserHandle = UserHandle(0)
+ private var mIconRequestInfos: MutableList<IconRequestInfo<WorkspaceItemInfo>> = mutableListOf()
+ private var mComponentName: ComponentName = ComponentName("package", "class")
+ private var mUnlockedUsersArray: LongSparseArray<Boolean> = LongSparseArray()
+ private var mKeyToPinnedShortcutsMap: MutableMap<ShortcutKey, ShortcutInfo> = mutableMapOf()
+ private var mInstallingPkgs: HashMap<PackageUserKey, PackageInstaller.SessionInfo> = hashMapOf()
+ private var mAllDeepShortcuts: MutableList<ShortcutInfo> = mutableListOf()
+ private var mWidgetProvidersMap: MutableMap<ComponentKey, AppWidgetProviderInfo?> =
+ mutableMapOf()
+ private var mPendingPackages: MutableSet<PackageUserKey> = mutableSetOf()
+
+ private lateinit var itemProcessorUnderTest: WorkspaceItemProcessor
+
+ @Before
+ fun setup() {
+ mUserHandle = UserHandle(0)
+ mockIconRequestInfo = mock<IconRequestInfo<WorkspaceItemInfo>>()
+ mockWorkspaceInfo = mock<WorkspaceItemInfo>()
+ mockBgDataModel = mock<BgDataModel>()
+ mComponentName = ComponentName("package", "class")
+ mUnlockedUsersArray = LongSparseArray<Boolean>(1).apply { put(101, true) }
+ intent =
+ Intent().apply {
+ component = mComponentName
+ `package` = "pkg"
+ putExtra(ShortcutKey.EXTRA_SHORTCUT_ID, "")
+ }
+ mockContext =
+ mock<Context>().apply {
+ whenever(packageManager).thenReturn(mock())
+ whenever(packageManager.getUserBadgedLabel(any(), any())).thenReturn("")
+ whenever(applicationContext).thenReturn(ApplicationProvider.getApplicationContext())
+ }
+ mockAppState =
+ mock<LauncherAppState>().apply {
+ whenever(context).thenReturn(mockContext)
+ whenever(iconCache).thenReturn(mock())
+ whenever(iconCache.getShortcutIcon(any(), any(), any())).then {}
+ }
+ mockPmHelper =
+ mock<PackageManagerHelper>().apply {
+ whenever(getAppLaunchIntent(mComponentName.packageName, mUserHandle))
+ .thenReturn(intent)
+ }
+ mockLauncherApps =
+ mock<LauncherApps>().apply {
+ whenever(isPackageEnabled("package", mUserHandle)).thenReturn(true)
+ whenever(isActivityEnabled(mComponentName, mUserHandle)).thenReturn(true)
+ }
+ mockCursor =
+ Mockito.mock(LoaderCursor::class.java, RETURNS_DEEP_STUBS).apply {
+ user = mUserHandle
+ itemType = ITEM_TYPE_APPLICATION
+ id = 1
+ restoreFlag = 1
+ serialNumber = 101
+ whenever(parseIntent()).thenReturn(intent)
+ whenever(markRestored()).doAnswer { restoreFlag = 0 }
+ whenever(updater().put(Favorites.INTENT, intent.toUri(0)).commit()).thenReturn(1)
+ whenever(getAppShortcutInfo(any(), any(), any(), any()))
+ .thenReturn(mockWorkspaceInfo)
+ whenever(createIconRequestInfo(any(), any())).thenReturn(mockIconRequestInfo)
+ }
+ mockUserCache =
+ mock<UserCache>().apply {
+ val userIconInfo =
+ mock<UserIconInfo>().apply { whenever(isPrivate).thenReturn(false) }
+ whenever(getUserInfo(any())).thenReturn(userIconInfo)
+ }
+
+ mockUserManagerState = mock<UserManagerState>()
+ mockWidgetInflater = mock<WidgetInflater>()
+ mKeyToPinnedShortcutsMap = mutableMapOf()
+ mInstallingPkgs = hashMapOf()
+ mAllDeepShortcuts = mutableListOf()
+ mWidgetProvidersMap = mutableMapOf()
+ mIconRequestInfos = mutableListOf()
+ mPendingPackages = mutableSetOf()
+ }
+
+ @Test
+ fun `When Pending App Widget has not started restore then update db and add item`() {
+
+ val mockitoSession =
+ ExtendedMockito.mockitoSession()
+ .strictness(Strictness.LENIENT)
+ .mockStatic(WidgetSections::class.java)
+ .startMocking()
+ try {
+ // Given
+ val expectedProvider = "com.google.android.testApp/com.android.testApp.testAppProvider"
+ val expectedComponentName =
+ ComponentName.unflattenFromString(expectedProvider)!!.flattenToString()
+ val expectedRestoreStatus = FLAG_UI_NOT_READY or FLAG_RESTORE_STARTED
+ val expectedAppWidgetId = 0
+ mockCursor.apply {
+ itemType = ITEM_TYPE_APPWIDGET
+ user = mUserHandle
+ restoreFlag = FLAG_UI_NOT_READY
+ container = CONTAINER_DESKTOP
+ whenever(isOnWorkspaceOrHotseat).thenCallRealMethod()
+ whenever(appWidgetProvider).thenReturn(expectedProvider)
+ whenever(appWidgetId).thenReturn(expectedAppWidgetId)
+ whenever(spanX).thenReturn(2)
+ whenever(spanY).thenReturn(1)
+ whenever(options).thenReturn(0)
+ whenever(appWidgetSource).thenReturn(20)
+ whenever(applyCommonProperties(any())).thenCallRealMethod()
+ whenever(
+ updater()
+ .put(Favorites.APPWIDGET_PROVIDER, expectedComponentName)
+ .put(Favorites.APPWIDGET_ID, expectedAppWidgetId)
+ .put(Favorites.RESTORED, expectedRestoreStatus)
+ .commit()
+ )
+ .thenReturn(1)
+ }
+ val inflationResult =
+ WidgetInflater.InflationResult(
+ type = WidgetInflater.TYPE_PENDING,
+ widgetInfo = null
+ )
+ mockWidgetInflater =
+ mock<WidgetInflater>().apply {
+ whenever(inflateAppWidget(any())).thenReturn(inflationResult)
+ }
+ val packageUserKey = PackageUserKey("com.google.android.testApp", mUserHandle)
+ mInstallingPkgs[packageUserKey] = PackageInstaller.SessionInfo()
+
+ // When
+ itemProcessorUnderTest =
+ createWorkspaceItemProcessorUnderTest(widgetProvidersMap = mWidgetProvidersMap)
+ itemProcessorUnderTest.processItem()
+
+ // Then
+ val expectedWidgetInfo =
+ LauncherAppWidgetInfo().apply {
+ appWidgetId = expectedAppWidgetId
+ providerName = ComponentName.unflattenFromString(expectedProvider)
+ restoreStatus = expectedRestoreStatus
+ }
+ verify(
+ mockCursor
+ .updater()
+ .put(Favorites.APPWIDGET_PROVIDER, expectedProvider)
+ .put(Favorites.APPWIDGET_ID, expectedAppWidgetId)
+ .put(Favorites.RESTORED, expectedRestoreStatus)
+ )
+ .commit()
+ val widgetInfoCaptor = ArgumentCaptor.forClass(LauncherAppWidgetInfo::class.java)
+ verify(mockCursor).checkAndAddItem(widgetInfoCaptor.capture(), eq(mockBgDataModel))
+ val actualWidgetInfo = widgetInfoCaptor.value
+ with(actualWidgetInfo) {
+ assertThat(providerName).isEqualTo(expectedWidgetInfo.providerName)
+ assertThat(restoreStatus).isEqualTo(expectedWidgetInfo.restoreStatus)
+ assertThat(targetComponent).isEqualTo(expectedWidgetInfo.targetComponent)
+ assertThat(appWidgetId).isEqualTo(expectedWidgetInfo.appWidgetId)
+ }
+ } finally {
+ mockitoSession.finishMocking()
+ }
+ }
+
+ @Test
+ @EnableFlags(FLAG_ENABLE_SUPPORT_FOR_ARCHIVING)
+ fun `When Archived Pending App Widget then checkAndAddItem`() {
+ val mockitoSession =
+ ExtendedMockito.mockitoSession().mockStatic(Utilities::class.java).startMocking()
+ try {
+ // Given
+ val expectedProvider = "com.google.android.testApp/com.android.testApp.testAppProvider"
+ val expectedComponentName = ComponentName.unflattenFromString(expectedProvider)
+ val expectedPackage = expectedComponentName!!.packageName
+ mockPmHelper =
+ mock<PackageManagerHelper>().apply {
+ whenever(isAppArchived(expectedPackage)).thenReturn(true)
+ }
+ mockCursor =
+ mock<LoaderCursor>().apply {
+ itemType = ITEM_TYPE_APPWIDGET
+ id = 1
+ user = UserHandle(1)
+ restoreFlag = FLAG_UI_NOT_READY
+ container = CONTAINER_DESKTOP
+ whenever(isOnWorkspaceOrHotseat).thenCallRealMethod()
+ whenever(appWidgetProvider).thenReturn(expectedProvider)
+ whenever(appWidgetId).thenReturn(0)
+ whenever(spanX).thenReturn(2)
+ whenever(spanY).thenReturn(1)
+ whenever(options).thenReturn(0)
+ whenever(appWidgetSource).thenReturn(20)
+ whenever(applyCommonProperties(any())).thenCallRealMethod()
+ }
+ mInstallingPkgs = hashMapOf()
+ val inflationResult =
+ WidgetInflater.InflationResult(
+ type = WidgetInflater.TYPE_PENDING,
+ widgetInfo = null
+ )
+ mockWidgetInflater =
+ mock<WidgetInflater>().apply {
+ whenever(inflateAppWidget(any())).thenReturn(inflationResult)
+ }
+ itemProcessorUnderTest =
+ createWorkspaceItemProcessorUnderTest(widgetProvidersMap = mWidgetProvidersMap)
+
+ // When
+ itemProcessorUnderTest.processItem()
+
+ // Then
+ verify(mockCursor).checkAndAddItem(any(), any())
+ } finally {
+ mockitoSession.finishMocking()
+ }
+ }
+
+ private fun createWorkspaceItemProcessorUnderTest(
+ cursor: LoaderCursor = mockCursor,
+ memoryLogger: LoaderMemoryLogger? = null,
+ userCache: UserCache = mockUserCache,
+ userManagerState: UserManagerState = mockUserManagerState,
+ launcherApps: LauncherApps = mockLauncherApps,
+ shortcutKeyToPinnedShortcuts: Map<ShortcutKey, ShortcutInfo> = mKeyToPinnedShortcutsMap,
+ app: LauncherAppState = mockAppState,
+ bgDataModel: BgDataModel = mockBgDataModel,
+ widgetProvidersMap: MutableMap<ComponentKey, AppWidgetProviderInfo?> = mWidgetProvidersMap,
+ widgetInflater: WidgetInflater = mockWidgetInflater,
+ pmHelper: PackageManagerHelper = mockPmHelper,
+ iconRequestInfos: MutableList<IconRequestInfo<WorkspaceItemInfo>> = mIconRequestInfos,
+ isSdCardReady: Boolean = false,
+ pendingPackages: MutableSet<PackageUserKey> = mPendingPackages,
+ unlockedUsers: LongSparseArray<Boolean> = mUnlockedUsersArray,
+ installingPkgs: HashMap<PackageUserKey, PackageInstaller.SessionInfo> = mInstallingPkgs,
+ allDeepShortcuts: MutableList<ShortcutInfo> = mAllDeepShortcuts
+ ) =
+ WorkspaceItemProcessor(
+ c = cursor,
+ memoryLogger = memoryLogger,
+ userCache = userCache,
+ userManagerState = userManagerState,
+ launcherApps = launcherApps,
+ app = app,
+ bgDataModel = bgDataModel,
+ widgetProvidersMap = widgetProvidersMap,
+ widgetInflater = widgetInflater,
+ pmHelper = pmHelper,
+ unlockedUsers = unlockedUsers,
+ iconRequestInfos = iconRequestInfos,
+ pendingPackages = pendingPackages,
+ isSdCardReady = isSdCardReady,
+ shortcutKeyToPinnedShortcuts = shortcutKeyToPinnedShortcuts,
+ installingPkgs = installingPkgs,
+ allDeepShortcuts = allDeepShortcuts
+ )
+}
diff --git a/tests/src/com/android/launcher3/model/gridmigration/ValidGridMigrationUnitTest.kt b/tests/src/com/android/launcher3/model/gridmigration/ValidGridMigrationUnitTest.kt
index 58b915f..7182cf3 100644
--- a/tests/src/com/android/launcher3/model/gridmigration/ValidGridMigrationUnitTest.kt
+++ b/tests/src/com/android/launcher3/model/gridmigration/ValidGridMigrationUnitTest.kt
@@ -94,7 +94,13 @@
val srcCountMap = itemsToMap(srcGrid.items)
val resultCountMap = itemsToMap(resultItems)
- val diff = resultCountMap - srcCountMap
+ val diff = resultCountMap.toMutableMap()
+ for ((srcKey, srcValue) in srcCountMap) {
+ val destValue = diff[srcKey]
+ if (destValue != null) {
+ diff[srcKey] = destValue - srcValue
+ }
+ }
diff.forEach { (k, count) ->
assert(count >= 0) { "Source item $k not present on the result" }
diff --git a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
index 9409ac1..60385a7 100644
--- a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
+++ b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
@@ -15,137 +15,105 @@
*/
package com.android.launcher3.nonquickstep
-import android.content.Context
-import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.AbstractDeviceProfileTest
import com.android.launcher3.DeviceProfile
+import com.android.launcher3.Flags
import com.android.launcher3.InvariantDeviceProfile
-import com.google.common.truth.Truth.assertThat
+import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
/** Tests for DeviceProfile. */
@SmallTest
-@RunWith(AndroidJUnit4::class)
+@RunWith(Parameterized::class)
class DeviceProfileDumpTest : AbstractDeviceProfileTest() {
private val folderName: String = "DeviceProfileDumpTest"
- @Test
- fun phonePortrait3Button() {
- initializeVarsForPhone(deviceSpecs["phone"]!!, isGestureMode = false)
- val dp = getDeviceProfileForGrid("5_by_5")
- assertDump(dp, "phonePortrait3Button")
+ @Parameterized.Parameter lateinit var instance: TestCase
+
+ @Before
+ fun setUp() {
+ if (instance.decoupleDepth) {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION)
+ } else {
+ setFlagsRule.disableFlags(Flags.FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION)
+ }
}
@Test
- fun phonePortrait() {
- initializeVarsForPhone(deviceSpecs["phone"]!!)
- val dp = getDeviceProfileForGrid("5_by_5")
+ fun dumpPortraitGesture() {
+ initializeDevice(instance.deviceName, isGestureMode = true, isLandscape = false)
+ val dp = getDeviceProfileForGrid(instance.gridName)
+ dp.isTaskbarPresentInApps = instance.isTaskbarPresentInApps
- assertDump(dp, "phonePortrait")
+ assertDump(dp, instance.filename("Portrait"))
}
@Test
- fun phoneVerticalBar3Button() {
- initializeVarsForPhone(deviceSpecs["phone"]!!, isVerticalBar = true, isGestureMode = false)
- val dp = getDeviceProfileForGrid("5_by_5")
+ fun dumpPortrait3Button() {
+ initializeDevice(instance.deviceName, isGestureMode = false, isLandscape = false)
+ val dp = getDeviceProfileForGrid(instance.gridName)
+ dp.isTaskbarPresentInApps = instance.isTaskbarPresentInApps
- assertDump(dp, "phoneVerticalBar3Button")
+ assertDump(dp, instance.filename("Portrait3Button"))
}
@Test
- fun phoneVerticalBar() {
- initializeVarsForPhone(deviceSpecs["phone"]!!, isVerticalBar = true)
- val dp = getDeviceProfileForGrid("5_by_5")
+ fun dumpLandscapeGesture() {
+ initializeDevice(instance.deviceName, isGestureMode = true, isLandscape = true)
+ val dp = getDeviceProfileForGrid(instance.gridName)
+ dp.isTaskbarPresentInApps = instance.isTaskbarPresentInApps
- assertDump(dp, "phoneVerticalBar")
+ val testName =
+ if (instance.deviceName == "phone") {
+ "VerticalBar"
+ } else {
+ "Landscape"
+ }
+ assertDump(dp, instance.filename(testName))
}
@Test
- fun tabletLandscape3Button() {
- initializeVarsForTablet(deviceSpecs["tablet"]!!, isLandscape = true, isGestureMode = false)
- val dp = getDeviceProfileForGrid("6_by_5")
- dp.isTaskbarPresentInApps = true
+ fun dumpLandscape3Button() {
+ initializeDevice(instance.deviceName, isGestureMode = false, isLandscape = true)
+ val dp = getDeviceProfileForGrid(instance.gridName)
+ dp.isTaskbarPresentInApps = instance.isTaskbarPresentInApps
- assertDump(dp, "tabletLandscape3Button")
+ val testName =
+ if (instance.deviceName == "phone") {
+ "VerticalBar3Button"
+ } else {
+ "Landscape3Button"
+ }
+ assertDump(dp, instance.filename(testName))
}
- @Test
- fun tabletLandscape() {
- initializeVarsForTablet(deviceSpecs["tablet"]!!, isLandscape = true)
- val dp = getDeviceProfileForGrid("6_by_5")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "tabletLandscape")
- }
-
- @Test
- fun tabletPortrait3Button() {
- initializeVarsForTablet(deviceSpecs["tablet"]!!, isGestureMode = false)
- val dp = getDeviceProfileForGrid("6_by_5")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "tabletPortrait3Button")
- }
-
- @Test
- fun tabletPortrait() {
- initializeVarsForTablet(deviceSpecs["tablet"]!!)
- val dp = getDeviceProfileForGrid("6_by_5")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "tabletPortrait")
- }
-
- @Test
- fun twoPanelLandscape3Button() {
- initializeVarsForTwoPanel(
- deviceSpecs["twopanel-tablet"]!!,
- deviceSpecs["twopanel-phone"]!!,
- isLandscape = true,
- isGestureMode = false
- )
- val dp = getDeviceProfileForGrid("4_by_4")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "twoPanelLandscape3Button")
- }
-
- @Test
- fun twoPanelLandscape() {
- initializeVarsForTwoPanel(
- deviceSpecs["twopanel-tablet"]!!,
- deviceSpecs["twopanel-phone"]!!,
- isLandscape = true
- )
- val dp = getDeviceProfileForGrid("4_by_4")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "twoPanelLandscape")
- }
-
- @Test
- fun twoPanelPortrait3Button() {
- initializeVarsForTwoPanel(
- deviceSpecs["twopanel-tablet"]!!,
- deviceSpecs["twopanel-phone"]!!,
- isGestureMode = false
- )
- val dp = getDeviceProfileForGrid("4_by_4")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "twoPanelPortrait3Button")
- }
-
- @Test
- fun twoPanelPortrait() {
- initializeVarsForTwoPanel(deviceSpecs["twopanel-tablet"]!!, deviceSpecs["twopanel-phone"]!!)
- val dp = getDeviceProfileForGrid("4_by_4")
- dp.isTaskbarPresentInApps = true
-
- assertDump(dp, "twoPanelPortrait")
+ private fun initializeDevice(deviceName: String, isGestureMode: Boolean, isLandscape: Boolean) {
+ val deviceSpec = deviceSpecs[instance.deviceName]!!
+ when (deviceName) {
+ "twopanel-phone",
+ "twopanel-tablet" ->
+ initializeVarsForTwoPanel(
+ deviceSpecUnfolded = deviceSpecs["twopanel-tablet"]!!,
+ deviceSpecFolded = deviceSpecs["twopanel-phone"]!!,
+ isLandscape = isLandscape,
+ isGestureMode = isGestureMode,
+ )
+ "tablet" ->
+ initializeVarsForTablet(
+ deviceSpec = deviceSpec,
+ isLandscape = isLandscape,
+ isGestureMode = isGestureMode
+ )
+ else ->
+ initializeVarsForPhone(
+ deviceSpec = deviceSpec,
+ isVerticalBar = isLandscape,
+ isGestureMode = isGestureMode
+ )
+ }
}
private fun getDeviceProfileForGrid(gridName: String): DeviceProfile {
@@ -153,6 +121,48 @@
}
private fun assertDump(dp: DeviceProfile, filename: String) {
- assertDump(dp, folderName, filename);
+ assertDump(dp, folderName, filename)
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getInstances(): List<TestCase> {
+ return listOf(
+ TestCase("phone", gridName = "5_by_5"),
+ TestCase("tablet", gridName = "6_by_5", isTaskbarPresentInApps = true),
+ TestCase("twopanel-tablet", gridName = "4_by_4", isTaskbarPresentInApps = true),
+ TestCase(
+ "twopanel-tablet",
+ gridName = "4_by_4",
+ isTaskbarPresentInApps = true,
+ decoupleDepth = true
+ ),
+ )
+ }
+
+ data class TestCase(
+ val deviceName: String,
+ val gridName: String,
+ val isTaskbarPresentInApps: Boolean = false,
+ val decoupleDepth: Boolean = false
+ ) {
+ fun filename(testName: String = ""): String {
+ val device =
+ when (deviceName) {
+ "tablet" -> "tablet"
+ "twopanel-tablet" -> "twoPanel"
+ "twopanel-phone" -> "twoPanelFolded"
+ else -> "phone"
+ }
+ val depth =
+ if (decoupleDepth) {
+ "_decoupleDepth"
+ } else {
+ ""
+ }
+ return "$device$testName$depth"
+ }
+ }
}
}
diff --git a/tests/src/com/android/launcher3/pageindicators/PageIndicatorDotsTest.kt b/tests/src/com/android/launcher3/pageindicators/PageIndicatorDotsTest.kt
new file mode 100644
index 0000000..9a8f957
--- /dev/null
+++ b/tests/src/com/android/launcher3/pageindicators/PageIndicatorDotsTest.kt
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.pageindicators
+
+import android.content.Context
+import androidx.test.core.app.ApplicationProvider
+import com.android.launcher3.util.ActivityContextWrapper
+import junit.framework.TestCase.assertEquals
+import org.junit.Test
+import org.mockito.Mockito
+
+class PageIndicatorDotsTest {
+
+ private val context: Context =
+ ActivityContextWrapper(ApplicationProvider.getApplicationContext())
+ private val pageIndicatorDots: PageIndicatorDots = Mockito.spy(PageIndicatorDots(context))
+
+ @Test
+ fun `setActiveMarker should set the active page to the parameter passed`() {
+ pageIndicatorDots.setActiveMarker(2)
+
+ assertEquals(2, pageIndicatorDots.activePage)
+ }
+
+ @Test
+ fun `setActiveMarker should set the active page to the parameter passed divided by two in two panel layouts`() {
+ pageIndicatorDots.mIsTwoPanels = true
+
+ pageIndicatorDots.setActiveMarker(5)
+
+ assertEquals(2, pageIndicatorDots.activePage)
+ }
+
+ @Test
+ fun `setMarkersCount should set the number of pages to the passed parameter and if the last page gets removed we want to go to the previous page`() {
+ pageIndicatorDots.setMarkersCount(3)
+
+ assertEquals(3, pageIndicatorDots.numPages)
+ }
+
+ @Test
+ fun `for setMarkersCount if the last page gets removed we want to go to the previous page`() {
+ pageIndicatorDots.setActiveMarker(2)
+
+ pageIndicatorDots.setMarkersCount(2)
+
+ assertEquals(1, pageIndicatorDots.activePage)
+ assertEquals(pageIndicatorDots.activePage.toFloat(), pageIndicatorDots.currentPosition)
+ }
+}
diff --git a/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt b/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt
new file mode 100644
index 0000000..3dd8dbc
--- /dev/null
+++ b/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.pm
+
+import android.content.pm.ApplicationInfo
+import android.content.pm.ApplicationInfo.FLAG_INSTALLED
+import android.content.pm.LauncherApps
+import android.content.pm.PackageInstaller
+import android.content.pm.PackageManager
+import android.graphics.Bitmap
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.LauncherPrefs
+import com.android.launcher3.LauncherPrefs.Companion.PROMISE_ICON_IDS
+import com.android.launcher3.util.Executors.MODEL_EXECUTOR
+import com.android.launcher3.util.IntArray
+import com.android.launcher3.util.LauncherModelHelper
+import com.android.launcher3.util.TestUtil
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class InstallSessionHelperTest {
+
+ private val launcherModelHelper = LauncherModelHelper()
+ private val sandboxContext = spy(launcherModelHelper.sandboxContext)
+ private val packageManager = sandboxContext.packageManager
+ private val expectedAppPackage = "expectedAppPackage"
+ private val expectedInstallerPackage = "expectedInstallerPackage"
+ private val mockPackageInstaller: PackageInstaller = mock()
+
+ private lateinit var installSessionHelper: InstallSessionHelper
+ private lateinit var launcherApps: LauncherApps
+
+ @Before
+ fun setup() {
+ whenever(packageManager.packageInstaller).thenReturn(mockPackageInstaller)
+ whenever(sandboxContext.packageName).thenReturn(expectedInstallerPackage)
+ launcherApps = sandboxContext.spyService(LauncherApps::class.java)
+ installSessionHelper = InstallSessionHelper(sandboxContext)
+ }
+
+ @Test
+ fun `getActiveSessions fetches verified install sessions from LauncherApps`() {
+ // Given
+ val expectedVerifiedSession1 =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 0
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ userId = 0
+ }
+ val expectedVerifiedSession2 =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "app2"
+ userId = 0
+ }
+ val expectedSessions = listOf(expectedVerifiedSession1, expectedVerifiedSession2)
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(expectedSessions)
+ // When
+ val actualSessions = installSessionHelper.getActiveSessions()
+ // Then
+ assertThat(actualSessions.values.toList()).isEqualTo(expectedSessions)
+ }
+
+ @Test
+ fun `getActiveSessionInfo fetches verified install sessions for given user and pkg`() {
+ // Given
+ val expectedVerifiedSession =
+ PackageInstaller.SessionInfo().apply {
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ userId = 0
+ }
+ whenever(launcherApps.allPackageInstallerSessions)
+ .thenReturn(listOf(expectedVerifiedSession))
+ // When
+ val actualSession =
+ installSessionHelper.getActiveSessionInfo(UserHandle(0), expectedAppPackage)
+ // Then
+ assertThat(actualSession).isEqualTo(expectedVerifiedSession)
+ }
+
+ @Test
+ fun `getVerifiedSessionInfo verifies and returns session for given id`() {
+ // Given
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ userId = 0
+ }
+ whenever(mockPackageInstaller.getSessionInfo(1)).thenReturn(expectedSession)
+ // When
+ val actualSession = installSessionHelper.getVerifiedSessionInfo(1)
+ // Then
+ assertThat(actualSession).isEqualTo(expectedSession)
+ }
+
+ @Test
+ fun `isTrustedPackage returns true if LauncherApps finds ApplicationInfo`() {
+ // Given
+ val expectedApplicationInfo =
+ ApplicationInfo().apply {
+ flags = flags or FLAG_INSTALLED
+ enabled = true
+ }
+ doReturn(expectedApplicationInfo)
+ .whenever(launcherApps)
+ .getApplicationInfo(expectedAppPackage, ApplicationInfo.FLAG_SYSTEM, UserHandle(0))
+ // When
+ val actualResult = installSessionHelper.isTrustedPackage(expectedAppPackage, UserHandle(0))
+ // Then
+ assertThat(actualResult).isTrue()
+ }
+
+ @Test
+ fun `getAllVerifiedSessions verifies and returns all active install sessions`() {
+ // Given
+ val expectedVerifiedSession1 =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 0
+ installerPackageName = expectedInstallerPackage
+ appPackageName = expectedAppPackage
+ userId = 0
+ }
+ val expectedVerifiedSession2 =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "app2"
+ userId = 0
+ }
+ val expectedSessions = listOf(expectedVerifiedSession1, expectedVerifiedSession2)
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(expectedSessions)
+ // When
+ val actualSessions = installSessionHelper.allVerifiedSessions
+ // Then
+ assertThat(actualSessions).isEqualTo(expectedSessions)
+ }
+
+ @Test
+ fun `promiseIconAddedForId returns true if there is a promiseIcon with the session id`() {
+ // Given
+ val expectedIdString = IntArray().apply { add(1) }.toConcatString()
+ LauncherPrefs.get(sandboxContext).putSync(Pair(PROMISE_ICON_IDS, expectedIdString))
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "app2"
+ userId = 0
+ }
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(listOf(expectedSession))
+ // When
+ var actualResult = false
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ actualResult = installSessionHelper.promiseIconAddedForId(1)
+ }
+ // Then
+ assertThat(actualResult).isTrue()
+ }
+
+ @Test
+ fun `removePromiseIconId removes promiseIconId for given Session id`() {
+ // Given
+ val expectedIdString = IntArray().apply { add(1) }.toConcatString()
+ LauncherPrefs.get(sandboxContext).putSync(Pair(PROMISE_ICON_IDS, expectedIdString))
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "app2"
+ userId = 0
+ }
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(listOf(expectedSession))
+ // When
+ var actualResult = true
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ installSessionHelper.removePromiseIconId(1)
+ actualResult = installSessionHelper.promiseIconAddedForId(1)
+ }
+ // Then
+ assertThat(actualResult).isFalse()
+ }
+
+ @Test
+ fun `tryQueuePromiseAppIcon will update promise icon ids from eligible sessions`() {
+ // Given
+ val expectedIdString = IntArray().apply { add(1) }.toConcatString()
+ LauncherPrefs.get(sandboxContext).putSync(Pair(PROMISE_ICON_IDS, expectedIdString))
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "appPackage"
+ userId = 0
+ appIcon = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8)
+ appLabel = "appLabel"
+ installReason = PackageManager.INSTALL_REASON_USER
+ }
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(listOf(expectedSession))
+ // When
+ var wasPromiseIconAdded = false
+ var actualPromiseIconIds = ""
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ installSessionHelper.removePromiseIconId(1)
+ installSessionHelper.tryQueuePromiseAppIcon(expectedSession)
+ wasPromiseIconAdded = installSessionHelper.promiseIconAddedForId(1)
+ actualPromiseIconIds = LauncherPrefs.get(sandboxContext).get(PROMISE_ICON_IDS)
+ }
+ // Then
+ assertThat(wasPromiseIconAdded).isTrue()
+ assertThat(actualPromiseIconIds).isEqualTo(expectedIdString)
+ }
+
+ @Test
+ fun `verifySessionInfo is true if can verify given SessionInfo`() {
+ // Given
+ val expectedIdString = IntArray().apply { add(1) }.toConcatString()
+ LauncherPrefs.get(sandboxContext).putSync(Pair(PROMISE_ICON_IDS, expectedIdString))
+ val expectedSession =
+ PackageInstaller.SessionInfo().apply {
+ sessionId = 1
+ installerPackageName = expectedInstallerPackage
+ appPackageName = "appPackage"
+ userId = 0
+ appIcon = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8)
+ appLabel = "appLabel"
+ installReason = PackageManager.INSTALL_REASON_USER
+ }
+ whenever(launcherApps.allPackageInstallerSessions).thenReturn(listOf(expectedSession))
+ // When
+ var actualResult = false
+ TestUtil.runOnExecutorSync(MODEL_EXECUTOR) {
+ actualResult = installSessionHelper.verifySessionInfo(expectedSession)
+ }
+ // Then
+ assertThat(actualResult).isTrue()
+ }
+}
diff --git a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
index e459956..dcfcad5 100644
--- a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
+++ b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
@@ -30,6 +30,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -48,7 +49,6 @@
import android.view.View;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.launcher3.allapps.PrivateProfileManager;
@@ -56,11 +56,15 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.UserCache;
+import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext;
+import com.android.launcher3.util.LauncherMultivalentJUnit;
import com.android.launcher3.util.TestSandboxModelContextWrapper;
import com.android.launcher3.util.UserIconInfo;
import com.android.launcher3.views.BaseDragLayer;
+import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
+import com.android.launcher3.widget.picker.model.data.WidgetPickerData;
import org.junit.After;
import org.junit.Assert;
@@ -71,10 +75,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.ArrayList;
-
@SmallTest
-@RunWith(AndroidJUnit4.class)
+@RunWith(LauncherMultivalentJUnit.class)
public class SystemShortcutTest {
@Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT);
private static final UserHandle PRIVATE_HANDLE = new UserHandle(11);
@@ -84,9 +86,10 @@
private TestSandboxModelContextWrapper mTestContext;
private final SandboxModelContext mSandboxContext = new SandboxModelContext();
private PrivateProfileManager mPrivateProfileManager;
- private PopupDataProvider mPopupDataProvider;
+ private WidgetPickerDataProvider mWidgetPickerDataProvider;
private AppInfo mAppInfo;
@Mock UserCache mUserCache;
+ @Mock ApiWrapper mApiWrapper;
@Mock BaseDragLayer mBaseDragLayer;
@Mock UserIconInfo mUserIconInfo;
@Mock LauncherActivityInfo mLauncherActivityInfo;
@@ -97,6 +100,7 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
mSandboxContext.putObject(UserCache.INSTANCE, mUserCache);
+ mSandboxContext.putObject(ApiWrapper.INSTANCE, mApiWrapper);
mTestContext = new TestSandboxModelContextWrapper(mSandboxContext);
mView = new View(mSandboxContext);
spyOn(mTestContext);
@@ -115,8 +119,8 @@
spyOn(mPrivateProfileManager);
when(mPrivateProfileManager.getProfileUser()).thenReturn(PRIVATE_HANDLE);
- mPopupDataProvider = mTestContext.getPopupDataProvider();
- spyOn(mPopupDataProvider);
+ mWidgetPickerDataProvider = mTestContext.getWidgetPickerDataProvider();
+ spyOn(mWidgetPickerDataProvider);
}
@After
@@ -137,7 +141,7 @@
mAppInfo = new AppInfo();
mAppInfo.componentName = new ComponentName(mTestContext, getClass());
assertNotNull(mAppInfo.getTargetComponent());
- doReturn(new ArrayList<>()).when(mPopupDataProvider).getWidgetsForPackageUser(any());
+ doReturn(new WidgetPickerData()).when(mWidgetPickerDataProvider).get();
spyOn(mAppInfo);
SystemShortcut systemShortcut = SystemShortcut.WIDGETS
.getShortcut(mTestContext, mAppInfo, mView);
@@ -244,7 +248,6 @@
SystemShortcut systemShortcut = SystemShortcut.PRIVATE_PROFILE_INSTALL
.getShortcut(mTestContext, mAppInfo, mView);
- verify(mPrivateProfileManager, times(2)).getProfileUser();
assertNull(systemShortcut);
}
@@ -266,8 +269,7 @@
SystemShortcut systemShortcut = SystemShortcut.PRIVATE_PROFILE_INSTALL
.getShortcut(mTestContext, mAppInfo, mView);
- verify(mPrivateProfileManager, times(3)).getProfileUser();
- verify(mPrivateProfileManager).isEnabled();
+ verify(mPrivateProfileManager, atLeast(1)).isEnabled();
assertNotNull(systemShortcut);
}
diff --git a/tests/src/com/android/launcher3/settings/SettingsActivityTest.java b/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
deleted file mode 100644
index 10e0be8..0000000
--- a/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.settings;
-
-import static androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT;
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem;
-import static androidx.test.espresso.intent.Intents.intended;
-import static androidx.test.espresso.intent.matcher.BundleMatchers.hasEntry;
-import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;
-import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra;
-import static androidx.test.espresso.matcher.ViewMatchers.hasDescendant;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
-import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
-import static androidx.test.espresso.matcher.ViewMatchers.withId;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import static com.android.launcher3.settings.SettingsActivity.DEVELOPER_OPTIONS_KEY;
-import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_ARGS;
-import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_ROOT_KEY;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.equalTo;
-
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-
-import androidx.test.core.app.ActivityScenario;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.espresso.intent.Intents;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import com.android.launcher3.R;
-import com.android.systemui.shared.plugins.PluginPrefs;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-public class SettingsActivityTest {
-
- private Context mApplicationContext;
-
- @Before
- public void setUp() {
- mApplicationContext = ApplicationProvider.getApplicationContext();
- Intents.init();
- }
-
- @After
- public void tearDown() {
- Intents.release();
- }
-
- @Test
- @Ignore // b/199309785
- public void testSettings_aboutTap_launchesActivity() {
- ActivityScenario.launch(SettingsActivity.class);
- onView(withId(R.id.recycler_view)).perform(
- actionOnItem(hasDescendant(withText("About")), click()));
-
- intended(allOf(
- hasComponent(SettingsActivity.class.getName()),
- hasExtra(
- equalTo(EXTRA_FRAGMENT_ARGS),
- hasEntry(ARG_PREFERENCE_ROOT, "about_screen"))));
- }
-
- @Test
- @Ignore // b/199309785
- public void testSettings_developerOptionsTap_launchesActivityWithFragment() {
- PluginPrefs.setHasPlugins(mApplicationContext);
- ActivityScenario.launch(SettingsActivity.class);
- onView(withId(R.id.recycler_view)).perform(
- actionOnItem(hasDescendant(withText("Developer Options")), click()));
-
- intended(allOf(
- hasComponent(SettingsActivity.class.getName()),
- hasExtra(EXTRA_FRAGMENT_ROOT_KEY, DEVELOPER_OPTIONS_KEY)));
- }
-
- @Test
- @Ignore // b/199309785
- public void testSettings_aboutScreenIntent() {
- Bundle fragmentArgs = new Bundle();
- fragmentArgs.putString(ARG_PREFERENCE_ROOT, "about_screen");
-
- Intent intent = new Intent(mApplicationContext, SettingsActivity.class)
- .putExtra(EXTRA_FRAGMENT_ARGS, fragmentArgs);
- ActivityScenario.launch(intent);
-
- onView(withText("About")).check(matches(isDisplayed()));
- onView(withText("Version")).check(matches(isDisplayed()));
- onView(withContentDescription("Navigate up")).check(matches(isDisplayed()));
- }
-
- @Test
- @Ignore // b/199309785
- public void testSettings_developerOptionsFragmentIntent() {
- Intent intent = new Intent(mApplicationContext, SettingsActivity.class)
- .putExtra(EXTRA_FRAGMENT_ROOT_KEY, DEVELOPER_OPTIONS_KEY);
- ActivityScenario.launch(intent);
-
- onView(withText("Developer Options")).check(matches(isDisplayed()));
- onView(withId(R.id.filter_box)).check(matches(isDisplayed()));
- onView(withContentDescription("Navigate up")).check(matches(isDisplayed()));
- }
-
- @Test
- @Ignore // b/199309785
- public void testSettings_backButtonFinishesActivity() {
- Bundle fragmentArgs = new Bundle();
- fragmentArgs.putString(ARG_PREFERENCE_ROOT, "about_screen");
- Intent intent = new Intent(mApplicationContext, SettingsActivity.class)
- .putExtra(EXTRA_FRAGMENT_ARGS, fragmentArgs);
- ActivityScenario<SettingsActivity> scenario = ActivityScenario.launch(intent);
-
- onView(withContentDescription("Navigate up")).perform(click());
- scenario.onActivity(activity -> assertThat(activity.isFinishing()).isTrue());
- }
-}
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 99e15ba..68004bb 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -43,6 +43,7 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.platform.test.flag.junit.SetFlagsRule;
+import android.platform.test.rule.LimitDevicesRule;
import android.system.OsConstants;
import android.util.Log;
@@ -63,7 +64,6 @@
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.testcomponent.TestCommandReceiver;
import com.android.launcher3.util.LooperExecutor;
-import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ExtendedLongPressTimeoutRule;
@@ -98,7 +98,7 @@
public abstract class AbstractLauncherUiTest<LAUNCHER_TYPE extends Launcher> {
public static final long DEFAULT_ACTIVITY_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
- public static final long DEFAULT_BROADCAST_TIMEOUT_SECS = 5;
+ public static final long DEFAULT_BROADCAST_TIMEOUT_SECS = 10;
public static final long DEFAULT_UI_TIMEOUT = TestUtil.DEFAULT_UI_TIMEOUT;
private static final String TAG = "AbstractLauncherUiTest";
@@ -223,6 +223,9 @@
@Rule
public ExtendedLongPressTimeoutRule mLongPressTimeoutRule = new ExtendedLongPressTimeoutRule();
+ @Rule
+ public LimitDevicesRule mlimitDevicesRule = new LimitDevicesRule();
+
public static void initialize(AbstractLauncherUiTest test) throws Exception {
test.reinitializeLauncherData();
test.mDevice.pressHome();
@@ -236,15 +239,12 @@
}
protected void clearPackageData(String pkg) throws IOException, InterruptedException {
- final CountDownLatch count = new CountDownLatch(2);
- final SimpleBroadcastReceiver broadcastReceiver =
- new SimpleBroadcastReceiver(i -> count.countDown());
- broadcastReceiver.registerPkgActions(mTargetContext, pkg,
- Intent.ACTION_PACKAGE_RESTARTED, Intent.ACTION_PACKAGE_DATA_CLEARED);
-
- mDevice.executeShellCommand("pm clear " + pkg);
- assertTrue(pkg + " didn't restart", count.await(10, TimeUnit.SECONDS));
- mTargetContext.unregisterReceiver(broadcastReceiver);
+ assertTrue("pm clear command failed",
+ mDevice.executeShellCommand("pm clear " + pkg)
+ .contains("Success"));
+ assertTrue("pm wait-for-handler command failed",
+ mDevice.executeShellCommand("pm wait-for-handler")
+ .contains("Success"));
}
protected TestRule getRulesInsideActivityMonitor() {
@@ -351,8 +351,6 @@
/** Waits for setup wizard to go away. */
private static void waitForSetupWizardDismissal() {
- if (!TestStabilityRule.isPresubmit()) return;
-
if (sFirstTimeWaitingForWizard) {
try {
getUiDevice().executeShellCommand(
@@ -548,7 +546,7 @@
public Intent blockingGetIntent() throws InterruptedException {
Log.d(WIDGET_CONFIG_NULL_EXTRA_INTENT,
"AbstractLauncherUiTest.blockingGetIntent()");
- latch.await(DEFAULT_BROADCAST_TIMEOUT_SECS, TimeUnit.SECONDS);
+ assertTrue("Timed Out", latch.await(DEFAULT_BROADCAST_TIMEOUT_SECS, TimeUnit.SECONDS));
mTargetContext.unregisterReceiver(this);
Log.d(WIDGET_CONFIG_NULL_EXTRA_INTENT, mIntent == null
? "AbstractLauncherUiTest.onReceive(): mIntent NULL"
@@ -699,4 +697,11 @@
UiDevice.getInstance(getInstrumentation()).pressHome();
mLauncher.waitForLauncherInitialized();
}
+
+ /** Clears all recent tasks */
+ protected void clearAllRecentTasks() {
+ if (!mLauncher.getRecentTasks().isEmpty()) {
+ mLauncher.goHome().switchToOverview().dismissAllTasks();
+ }
+ }
}
diff --git a/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt b/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt
new file mode 100644
index 0000000..1cee71c
--- /dev/null
+++ b/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.ui
+
+import android.graphics.Color
+import android.graphics.drawable.Drawable
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.views.DoubleShadowIconDrawable
+import com.android.launcher3.views.ShadowInfo
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class DoubleShadowIconDrawableTest {
+
+ @Test
+ fun `DoubleShadowIconDrawable is setup correctly from given ShadowInfo`() {
+ // Given
+ val shadowInfo: ShadowInfo = mock()
+ val originalDrawable: Drawable = mock()
+ val iconSize = 2
+ val iconInsetSize = 1
+ // When
+ val drawableUnderTest =
+ DoubleShadowIconDrawable(shadowInfo, originalDrawable, iconSize, iconInsetSize)
+ // Then
+ assertThat(drawableUnderTest.intrinsicHeight).isEqualTo(iconSize)
+ assertThat(drawableUnderTest.intrinsicWidth).isEqualTo(iconSize)
+ }
+
+ @Test
+ fun `createShadowRenderNode creates RenderNode for shadow effects`() {
+ // Given
+ val shadowInfo =
+ ShadowInfo(
+ ambientShadowBlur = 1f,
+ ambientShadowColor = 2,
+ keyShadowBlur = 3f,
+ keyShadowOffsetX = 4f,
+ keyShadowOffsetY = 5f,
+ keyShadowColor = 6
+ )
+ val originalDrawable: Drawable = mock()
+ val iconSize = 2
+ val iconInsetSize = 1
+ // When
+ val shadowDrawableUnderTest =
+ spy(DoubleShadowIconDrawable(shadowInfo, originalDrawable, iconSize, iconInsetSize))
+ shadowDrawableUnderTest.createShadowRenderNode()
+ // Then
+ verify(shadowDrawableUnderTest)
+ .createShadowRenderEffect(
+ shadowInfo.ambientShadowBlur,
+ 0f,
+ 0f,
+ Color.alpha(shadowInfo.ambientShadowColor).toFloat()
+ )
+ verify(shadowDrawableUnderTest)
+ .createShadowRenderEffect(
+ shadowInfo.keyShadowBlur,
+ shadowInfo.keyShadowOffsetX,
+ shadowInfo.keyShadowOffsetY,
+ Color.alpha(shadowInfo.keyShadowColor).toFloat()
+ )
+ }
+}
diff --git a/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt b/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt
new file mode 100644
index 0000000..ef4dc1a
--- /dev/null
+++ b/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.ui
+
+import android.content.Context
+import android.content.res.TypedArray
+import android.util.AttributeSet
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.R
+import com.android.launcher3.views.ShadowInfo
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ShadowInfoTest {
+
+ @Test
+ fun `ShadowInfo is created correctly from context`() {
+ // Given
+ val mockContext: Context = mock()
+ val mockAttrs: AttributeSet = mock()
+ val styledAttrs: TypedArray = mock()
+ val expectedShadowInfo =
+ ShadowInfo(
+ ambientShadowBlur = 1f,
+ ambientShadowColor = 2,
+ keyShadowBlur = 3f,
+ keyShadowOffsetX = 4f,
+ keyShadowOffsetY = 5f,
+ keyShadowColor = 6
+ )
+ doReturn(styledAttrs)
+ .whenever(mockContext)
+ .obtainStyledAttributes(mockAttrs, R.styleable.ShadowInfo, 0, 0)
+ doReturn(1)
+ .whenever(styledAttrs)
+ .getDimensionPixelSize(R.styleable.ShadowInfo_ambientShadowBlur, 0)
+ doReturn(2).whenever(styledAttrs).getColor(R.styleable.ShadowInfo_ambientShadowColor, 0)
+ doReturn(3)
+ .whenever(styledAttrs)
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowBlur, 0)
+ doReturn(4)
+ .whenever(styledAttrs)
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetX, 0)
+ doReturn(5)
+ .whenever(styledAttrs)
+ .getDimensionPixelSize(R.styleable.ShadowInfo_keyShadowOffsetY, 0)
+ doReturn(6).whenever(styledAttrs).getColor(R.styleable.ShadowInfo_keyShadowColor, 0)
+ // When
+ val actualShadowInfo = ShadowInfo.fromContext(mockContext, mockAttrs, 0)
+ // Then
+ assertThat(actualShadowInfo.ambientShadowBlur).isEqualTo(1)
+ assertThat(actualShadowInfo.ambientShadowColor).isEqualTo(2)
+ assertThat(actualShadowInfo.keyShadowBlur).isEqualTo(3)
+ assertThat(actualShadowInfo.keyShadowOffsetX).isEqualTo(4)
+ assertThat(actualShadowInfo.keyShadowOffsetY).isEqualTo(5)
+ assertThat(actualShadowInfo.keyShadowColor).isEqualTo(6)
+ assertThat(actualShadowInfo).isEqualTo(expectedShadowInfo)
+ }
+}
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
index 4a67600..342eedf 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
@@ -21,9 +21,8 @@
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.util.rule.ScreenRecordRule.KeepRecordOnSuccess;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
+import com.android.launcher3.Launcher;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +31,6 @@
@RunWith(AndroidJUnit4.class)
public class TaplTestsLauncher3Test extends AbstractLauncherUiTest<Launcher> {
- @KeepRecordOnSuccess
@ScreenRecord // b/322823478
@Test
public void testDevicePressMenu() throws Exception {
diff --git a/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java b/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java
index 70a3dd0..b2e413d 100644
--- a/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java
+++ b/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java
@@ -45,7 +45,6 @@
import com.android.launcher3.allapps.WorkProfileManager;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.util.TestUtil;
-import com.android.launcher3.util.rule.ScreenRecordRule.KeepRecordOnSuccess;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.TestStabilityRule.Stability;
@@ -76,7 +75,6 @@
String output =
mDevice.executeShellCommand(
"pm create-user --profileOf 0 --managed TestProfile");
- // b/203817455
updateWorkProfileSetupSuccessful("pm create-user", output);
String[] tokens = output.split("\\s+");
@@ -197,7 +195,6 @@
}
- @KeepRecordOnSuccess
@ScreenRecord // b/322823478
@Test
public void testEdu() {
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
index 9dbd866..9b184ae 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
@@ -32,7 +32,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.ui.TestViewHelpers;
-import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.util.rule.TestStabilityRule.Stability;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
@@ -54,7 +53,6 @@
@Test
@PortraitLandscape
- @ScreenRecord // b/316910614
public void testDragIcon() throws Throwable {
mLauncher.enableDebugTracing(); // b/289161193
commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext));
@@ -107,7 +105,6 @@
@Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/316910614
@PlatinumTest(focusArea = "launcher")
@Test
- @ScreenRecord // b/316910614
public void testResizeWidget() throws Throwable {
commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext));
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplBindWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/TaplBindWidgetTest.java
index 28d1faa..d40d3bc 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplBindWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/TaplBindWidgetTest.java
@@ -23,8 +23,6 @@
import static com.android.launcher3.provider.LauncherDbUtils.itemIdMatch;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.WidgetUtils.createWidgetInfo;
-import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
-import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -56,7 +54,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.rule.ShellCommandRule;
-import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.WidgetManagerHelper;
@@ -143,7 +140,6 @@
}
@Test
- @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/310242894
public void testPendingWidget_withConfigScreen() {
// A non-restored widget with config screen get bound and shows a 'Click to setup' UI.
// Do not bind the widget
@@ -193,7 +189,6 @@
}
@Test
- @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/310242894
public void testPendingWidget_notRestored_brokenInstall() {
// A widget which is was being installed once, even if its not being
// installed at the moment is not removed.
diff --git a/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java b/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
index d653317..a148744 100644
--- a/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
+++ b/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
@@ -16,6 +16,8 @@
package com.android.launcher3.ui.workspace;
import static com.android.launcher3.util.TestConstants.AppNames.TEST_APP_NAME;
+import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
+import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -38,6 +40,8 @@
import com.android.launcher3.tapl.HomeAppIconMenuItem;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.rule.ScreenRecordRule;
+import com.android.launcher3.util.rule.TestStabilityRule;
import org.junit.Test;
@@ -111,6 +115,8 @@
}
@Test
+ @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/350557998
+ @ScreenRecordRule.ScreenRecord // b/350557998
public void testShortcutIconWithTheme() throws Exception {
setThemeEnabled(true);
initialize(this);
diff --git a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java b/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java
index 2ce8eef..20c5a25 100644
--- a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java
+++ b/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java
@@ -164,6 +164,7 @@
@Test
@PortraitLandscape
+ @ScreenRecordRule.ScreenRecord // b/352130094
public void testDragIconToPage2() {
Workspace workspace = mLauncher.getWorkspace();
@@ -284,6 +285,7 @@
@Test
@PortraitLandscape
+ @ScreenRecordRule.ScreenRecord // b/330232490
public void testEmptyPagesGetRemovedIfBothPagesAreEmpty() {
Workspace workspace = mLauncher.getWorkspace();
diff --git a/tests/src/com/android/launcher3/util/RoboApiWrapper.kt b/tests/src/com/android/launcher3/util/RoboApiWrapper.kt
new file mode 100644
index 0000000..583652d
--- /dev/null
+++ b/tests/src/com/android/launcher3/util/RoboApiWrapper.kt
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.ContentResolver
+import android.net.Uri
+import android.os.Looper
+import java.io.InputStream
+import java.util.function.Supplier
+
+object RoboApiWrapper {
+
+ fun initialize() {}
+
+ fun registerInputStream(
+ contentResolver: ContentResolver,
+ uri: Uri,
+ inputStreamSupplier: Supplier<InputStream>
+ ) {}
+
+ fun waitForLooperSync(looper: Looper) {}
+}
diff --git a/tests/src/com/android/launcher3/util/TestResourceHelper.kt b/tests/src/com/android/launcher3/util/TestResourceHelper.kt
deleted file mode 100644
index b4d3ba8..0000000
--- a/tests/src/com/android/launcher3/util/TestResourceHelper.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.util
-
-import android.content.Context
-import android.content.res.TypedArray
-import android.util.AttributeSet
-import com.android.launcher3.R
-import com.android.launcher3.tests.R as TestR
-import kotlin.IntArray
-
-class TestResourceHelper(private val context: Context, specsFileId: Int) :
- ResourceHelper(context, specsFileId) {
- override fun obtainStyledAttributes(attrs: AttributeSet, styleId: IntArray): TypedArray {
- val clone =
- when {
- styleId.contentEquals(R.styleable.SizeSpec) -> TestR.styleable.SizeSpec
- styleId.contentEquals(R.styleable.WorkspaceSpec) -> TestR.styleable.WorkspaceSpec
- styleId.contentEquals(R.styleable.FolderSpec) -> TestR.styleable.FolderSpec
- styleId.contentEquals(R.styleable.AllAppsSpec) -> TestR.styleable.AllAppsSpec
- styleId.contentEquals(R.styleable.ResponsiveSpecGroup) ->
- TestR.styleable.ResponsiveSpecGroup
- else -> styleId.clone()
- }
-
- return context.obtainStyledAttributes(attrs, clone)
- }
-}
diff --git a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java
index ff96afb..7a5cf2c 100644
--- a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java
+++ b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java
@@ -49,9 +49,6 @@
return base;
}
- final Boolean keepRecordOnSuccess = description.getAnnotation(KeepRecordOnSuccess.class)
- != null;
-
return new Statement() {
@Override
public void evaluate() throws Throwable {
@@ -73,7 +70,7 @@
device.executeShellCommand("kill -INT " + screenRecordPid);
Log.e(TAG, "Screenrecord captured at: " + outputFile);
output.close();
- if (success && !keepRecordOnSuccess) {
+ if (success) {
automation.executeShellCommand("rm " + outputFile);
}
}
@@ -88,14 +85,4 @@
@Target(ElementType.METHOD)
public @interface ScreenRecord {
}
-
-
- /**
- * Interface to indicate that we should keep the screen record even if the test succeeds, use
- * sparingly since it uses a lof of memory.
- */
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.METHOD)
- public @interface KeepRecordOnSuccess {
- }
}
diff --git a/tests/src_deviceless/com/android/launcher3/util/RoboApiWrapper.kt b/tests/src_deviceless/com/android/launcher3/util/RoboApiWrapper.kt
new file mode 100644
index 0000000..9232268
--- /dev/null
+++ b/tests/src_deviceless/com/android/launcher3/util/RoboApiWrapper.kt
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util
+
+import android.content.ComponentName
+import android.content.ContentResolver
+import android.content.Intent
+import android.content.IntentFilter
+import android.content.pm.ApplicationInfo
+import android.content.pm.LauncherActivityInfo
+import android.content.pm.LauncherApps
+import android.net.Uri
+import android.os.Looper
+import android.os.Process
+import androidx.test.platform.app.InstrumentationRegistry
+import java.io.InputStream
+import java.util.function.Supplier
+import org.mockito.Mockito
+import org.mockito.kotlin.whenever
+import org.robolectric.RuntimeEnvironment
+import org.robolectric.Shadows
+
+object RoboApiWrapper {
+
+ fun initialize() {
+ Shadows.shadowOf(
+ RuntimeEnvironment.getApplication().getSystemService(LauncherApps::class.java)
+ )
+ .addEnabledPackage(
+ Process.myUserHandle(),
+ InstrumentationRegistry.getInstrumentation().context.packageName
+ )
+ LauncherModelHelper.ACTIVITY_LIST.forEach {
+ installApp(ComponentName(InstrumentationRegistry.getInstrumentation().context, it))
+ }
+ }
+
+ private fun installApp(componentName: ComponentName) {
+ val app = RuntimeEnvironment.getApplication()
+ val user = Process.myUserHandle()
+
+ val pm = Shadows.shadowOf(app.packageManager)
+ val ai = pm.addActivityIfNotPresent(componentName)
+ pm.addIntentFilterForActivity(
+ componentName,
+ IntentFilter(Intent.ACTION_MAIN).apply { addCategory(Intent.CATEGORY_LAUNCHER) }
+ )
+
+ val li = Mockito.mock(LauncherActivityInfo::class.java)
+ val appInfo = ApplicationInfo().apply { flags = 0 }
+ Mockito.doReturn(ai).whenever(li).activityInfo
+ Mockito.doReturn(appInfo).whenever(li).applicationInfo
+ Mockito.doReturn(user).whenever(li).user
+ Mockito.doReturn(1f).whenever(li).loadingProgress
+ Mockito.doReturn(componentName).whenever(li).componentName
+
+ Shadows.shadowOf(app.getSystemService(LauncherApps::class.java)).apply {
+ addActivity(user, li)
+ addEnabledPackage(user, componentName.packageName)
+ setActivityEnabled(user, componentName)
+ addApplicationInfo(user, componentName.packageName, ai.applicationInfo)
+ }
+ }
+
+ fun registerInputStream(
+ contentResolver: ContentResolver,
+ uri: Uri,
+ inputStreamSupplier: Supplier<InputStream>
+ ) {
+ Shadows.shadowOf(contentResolver).registerInputStreamSupplier(uri, inputStreamSupplier)
+ }
+
+ fun waitForLooperSync(looper: Looper) {
+ Shadows.shadowOf(looper).runToEndOfTasks()
+ }
+}
diff --git a/tests/src_deviceless/com/android/launcher3/util/RobolectricDeviceRunner.kt b/tests/src_deviceless/com/android/launcher3/util/RobolectricDeviceRunner.kt
new file mode 100644
index 0000000..dc6d716
--- /dev/null
+++ b/tests/src_deviceless/com/android/launcher3/util/RobolectricDeviceRunner.kt
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.util
+
+import androidx.test.annotation.UiThreadTest
+import androidx.test.platform.app.InstrumentationRegistry
+import java.lang.reflect.Method
+import java.util.concurrent.atomic.AtomicReference
+import org.junit.runners.model.FrameworkMethod
+import org.junit.runners.model.Statement
+import org.robolectric.RobolectricTestRunner
+import org.robolectric.internal.bytecode.Sandbox
+import org.robolectric.util.ReflectionHelpers
+import org.robolectric.util.ReflectionHelpers.ClassParameter
+
+/** Runner which emulates the provided display before running the actual test */
+class RobolectricDeviceRunner(testClass: Class<*>?, private val deviceName: String?) :
+ RobolectricTestRunner(testClass) {
+
+ private val nameSuffix = deviceName?.let { "-$it" } ?: ""
+
+ override fun getName() = super.getName() + nameSuffix
+
+ override fun testName(method: FrameworkMethod) = super.testName(method) + nameSuffix
+
+ @Throws(Throwable::class)
+ override fun beforeTest(sandbox: Sandbox, method: FrameworkMethod, bootstrappedMethod: Method) {
+ super.beforeTest(sandbox, method, bootstrappedMethod)
+
+ deviceName ?: return
+
+ val emulator =
+ try {
+ ReflectionHelpers.loadClass(
+ bootstrappedMethod.declaringClass.classLoader,
+ DEVICE_EMULATOR
+ )
+ } catch (e: Exception) {
+ // Ignore, if the device emulator is not present
+ return
+ }
+ ReflectionHelpers.callStaticMethod<Any>(
+ emulator,
+ "updateDevice",
+ ClassParameter.from(String::class.java, deviceName)
+ )
+ }
+
+ override fun getHelperTestRunner(clazz: Class<*>) = MyHelperTestRunner(clazz)
+
+ class MyHelperTestRunner(clazz: Class<*>) : HelperTestRunner(clazz) {
+
+ override fun methodBlock(method: FrameworkMethod): Statement =
+ // this needs to be run in the test classLoader
+ ReflectionHelpers.callStaticMethod(
+ method.declaringClass.classLoader,
+ RobolectricDeviceRunner::class.qualifiedName,
+ "wrapUiThreadMethod",
+ ClassParameter.from(FrameworkMethod::class.java, method),
+ ClassParameter.from(Statement::class.java, super.methodBlock(method))
+ )
+ }
+
+ private class UiThreadStatement(val base: Statement) : Statement() {
+
+ override fun evaluate() {
+ val exceptionRef = AtomicReference<Throwable>()
+ InstrumentationRegistry.getInstrumentation().runOnMainSync {
+ try {
+ base.evaluate()
+ } catch (throwable: Throwable) {
+ exceptionRef.set(throwable)
+ }
+ }
+ exceptionRef.get()?.let { throw it }
+ }
+ }
+
+ companion object {
+
+ private const val DEVICE_EMULATOR = "com.android.launcher3.util.RoboDeviceEmulator"
+
+ @JvmStatic
+ fun wrapUiThreadMethod(method: FrameworkMethod, base: Statement): Statement =
+ if (
+ method.method.isAnnotationPresent(UiThreadTest::class.java) ||
+ method.declaringClass.isAnnotationPresent(UiThreadTest::class.java)
+ ) {
+ UiThreadStatement(base)
+ } else {
+ base
+ }
+ }
+}
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index b490124..71cd19d 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -58,6 +58,7 @@
private static final String FAST_SCROLLER_RES_ID = "fast_scroller";
private static final Pattern EVENT_ALT_ESC_UP = Pattern.compile(
"Key event: KeyEvent.*?action=ACTION_UP.*?keyCode=KEYCODE_ESCAPE.*?metaState=0");
+ private static final String UNLOCK_BUTTON_VIEW_RES_ID = "ps_lock_unlock_button";
private final int mHeight;
private final int mIconHeight;
@@ -433,7 +434,28 @@
public PrivateSpaceContainer getPrivateSpaceUnlockedView() {
final UiObject2 allAppsContainer = verifyActiveContainer();
final UiObject2 appListRecycler = getAppListRecycler(allAppsContainer);
- return new PrivateSpaceContainer(mLauncher, appListRecycler);
+ return new PrivateSpaceContainer(mLauncher, appListRecycler, this, true);
+ }
+
+ /** Returns PrivateSpaceContainer in locked state, if present in view. */
+ @NonNull
+ public PrivateSpaceContainer getPrivateSpaceLockedView() {
+ final UiObject2 allAppsContainer = verifyActiveContainer();
+ final UiObject2 appListRecycler = getAppListRecycler(allAppsContainer);
+ return new PrivateSpaceContainer(mLauncher, appListRecycler, this, false);
+ }
+
+ /**
+ * Toggles Lock/Unlock of Private Space, changing the All Apps Ui.
+ */
+ public void togglePrivateSpace() {
+ final UiObject2 allAppsContainer = verifyActiveContainer();
+ final UiObject2 appListRecycler = getAppListRecycler(allAppsContainer);
+ UiObject2 unLockButtonView = mLauncher.waitForObjectInContainer(appListRecycler,
+ UNLOCK_BUTTON_VIEW_RES_ID);
+ mLauncher.waitForObjectEnabled(unLockButtonView, "Private Space Unlock Button");
+ mLauncher.assertTrue("PS Unlock Button is non-clickable", unLockButtonView.isClickable());
+ unLockButtonView.click();
}
protected abstract void verifyVisibleContainerOnDismiss();
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index 988aa94..b7ebfcd 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -16,7 +16,7 @@
package com.android.launcher3.tapl;
-import static com.android.launcher3.tapl.BaseOverview.TASK_RES_ID;
+import static com.android.launcher3.tapl.BaseOverview.TASK_SELECTOR;
import static com.android.launcher3.tapl.OverviewTask.TASK_START_EVENT;
import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
@@ -117,10 +117,10 @@
// non-tablet overview, snapshots can be on either side of the swiped
// task, but we still check that they become visible after swiping and
// pausing.
- mLauncher.waitForOverviewObject(TASK_RES_ID);
+ mLauncher.waitForObjectBySelector(TASK_SELECTOR);
if (mLauncher.isTablet()) {
List<UiObject2> tasks = mLauncher.getDevice().findObjects(
- mLauncher.getOverviewObjectSelector(TASK_RES_ID));
+ TASK_SELECTOR);
final int centerX = mLauncher.getDevice().getDisplayWidth() / 2;
mLauncher.assertTrue(
"All tasks not to the left of the swiped task",
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 68829e0..0edcfea 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -19,8 +19,11 @@
import static android.view.KeyEvent.KEYCODE_ESCAPE;
import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
+import static com.android.launcher3.tapl.LauncherInstrumentation.log;
import static com.android.launcher3.tapl.OverviewTask.TASK_START_EVENT;
+import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import android.graphics.Rect;
import android.view.KeyEvent;
@@ -34,9 +37,11 @@
import com.android.launcher3.testing.shared.TestProtocol;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import java.util.Optional;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -44,7 +49,10 @@
* Common overview panel for both Launcher and fallback recents
*/
public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
- protected static final String TASK_RES_ID = "task";
+ private static final String TAG = "BaseOverview";
+ protected static final BySelector TASK_SELECTOR = By.res(Pattern.compile(
+ getOverviewPackageName()
+ + ":id/(task_view_single|task_view_grouped|task_view_desktop)"));
private static final Pattern EVENT_ALT_ESC_UP = Pattern.compile(
"Key event: KeyEvent.*?action=ACTION_UP.*?keyCode=KEYCODE_ESCAPE.*?metaState=0");
private static final Pattern EVENT_ENTER_DOWN = Pattern.compile(
@@ -54,10 +62,22 @@
private static final int FLINGS_FOR_DISMISS_LIMIT = 40;
+ private final @Nullable UiObject2 mLiveTileTask;
+
+
BaseOverview(LauncherInstrumentation launcher) {
+ this(launcher, /*launchedFromApp=*/false);
+ }
+
+ BaseOverview(LauncherInstrumentation launcher, boolean launchedFromApp) {
super(launcher);
verifyActiveContainer();
verifyActionsViewVisibility();
+ if (launchedFromApp) {
+ mLiveTileTask = getCurrentTaskUnchecked();
+ } else {
+ mLiveTileTask = null;
+ }
}
@Override
@@ -77,7 +97,7 @@
private void flingForwardImpl() {
try (LauncherInstrumentation.Closable c =
mLauncher.addContextLayer("want to fling forward in overview")) {
- LauncherInstrumentation.log("Overview.flingForward before fling");
+ log("Overview.flingForward before fling");
final UiObject2 overview = verifyActiveContainer();
final int leftMargin =
mLauncher.getTargetInsets().left + mLauncher.getEdgeSensitivityWidth();
@@ -103,7 +123,7 @@
private void flingBackwardImpl() {
try (LauncherInstrumentation.Closable c =
mLauncher.addContextLayer("want to fling backward in overview")) {
- LauncherInstrumentation.log("Overview.flingBackward before fling");
+ log("Overview.flingBackward before fling");
final UiObject2 overview = verifyActiveContainer();
final int rightMargin =
mLauncher.getTargetInsets().right + mLauncher.getEdgeSensitivityWidth();
@@ -258,7 +278,7 @@
if (mLauncher.isTablet()) {
mLauncher.assertTrue("current task is not grid height",
getCurrentTask().getVisibleHeight() == mLauncher
- .getGridTaskRectForTablet().height());
+ .getOverviewGridTaskSize().height());
}
mLauncher.assertTrue("Current task not scrolled off screen",
!getCurrentTask().equals(task));
@@ -274,37 +294,56 @@
*/
@NonNull
public OverviewTask getCurrentTask() {
+ UiObject2 currentTask = getCurrentTaskUnchecked();
+ mLauncher.assertNotNull("Unable to find a task", currentTask);
+ return new OverviewTask(mLauncher, currentTask, this);
+ }
+
+ @Nullable
+ private UiObject2 getCurrentTaskUnchecked() {
final List<UiObject2> taskViews = getTasks();
- mLauncher.assertNotEquals("Unable to find a task", 0, taskViews.size());
+ if (taskViews.isEmpty()) {
+ return null;
+ }
// The widest, and most top-right task should be the current task
- UiObject2 currentTask = Collections.max(taskViews,
+ return Collections.max(taskViews,
Comparator.comparingInt((UiObject2 t) -> t.getVisibleBounds().width())
.thenComparingInt((UiObject2 t) -> t.getVisibleCenter().x)
.thenComparing(Comparator.comparing(
(UiObject2 t) -> t.getVisibleCenter().y).reversed()));
- return new OverviewTask(mLauncher, currentTask, this);
}
- /** Returns an overview task matching TestActivity {@param activityNumber}. */
+ /**
+ * Returns an overview task that contains the specified test activity in its thumbnails.
+ *
+ * @param activityIndex index of TestActivity to match against
+ */
@NonNull
- public OverviewTask getTestActivityTask(int activityNumber) {
+ public OverviewTask getTestActivityTask(int activityIndex) {
+ return getTestActivityTask(Collections.singleton(activityIndex));
+ }
+
+ /**
+ * Returns an overview task that contains all the specified test activities in its thumbnails.
+ *
+ * @param activityNumbers collection of indices of TestActivity to match against
+ */
+ @NonNull
+ public OverviewTask getTestActivityTask(Collection<Integer> activityNumbers) {
final List<UiObject2> taskViews = getTasks();
mLauncher.assertNotEquals("Unable to find a task", 0, taskViews.size());
- final String activityName = "TestActivity" + activityNumber;
- UiObject2 task = null;
- for (UiObject2 taskView : taskViews) {
- // TODO(b/239452415): Use equals instead of descEndsWith
- if (taskView.getParent().hasObject(By.descEndsWith(activityName))) {
- task = taskView;
- break;
- }
- }
- mLauncher.assertNotNull(
- "Unable to find a task with " + activityName + " from the task list", task);
+ Optional<UiObject2> task = taskViews.stream().filter(
+ taskView -> activityNumbers.stream().allMatch(activityNumber ->
+ // TODO(b/239452415): Use equals instead of descEndsWith
+ taskView.hasObject(By.descEndsWith("TestActivity" + activityNumber))
+ )).findFirst();
- return new OverviewTask(mLauncher, task, this);
+ mLauncher.assertTrue("Unable to find a task with test activities " + activityNumbers
+ + " from the task list", task.isPresent());
+
+ return new OverviewTask(mLauncher, task.get(), this);
}
/**
@@ -315,7 +354,7 @@
final List<UiObject2> taskViews = getTasks();
mLauncher.assertNotEquals("Unable to find a task", 0, taskViews.size());
- final int gridTaskWidth = mLauncher.getGridTaskRectForTablet().width();
+ final int gridTaskWidth = mLauncher.getOverviewGridTaskSize().width();
return taskViews.stream().filter(t -> t.getVisibleBounds().width() == gridTaskWidth).map(
t -> new OverviewTask(mLauncher, t, this)).collect(Collectors.toList());
@@ -326,8 +365,7 @@
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to get overview tasks")) {
verifyActiveContainer();
- return mLauncher.getDevice().findObjects(
- mLauncher.getOverviewObjectSelector(TASK_RES_ID));
+ return mLauncher.getDevice().findObjects(TASK_SELECTOR);
}
}
@@ -384,25 +422,32 @@
protected boolean isActionsViewVisible() {
if (!hasTasks() || isClearAllVisible()) {
+ testLogD(TAG, "Not expecting an actions bar: no tasks/'Clear all' is visible");
return false;
}
boolean isTablet = mLauncher.isTablet();
if (isTablet && mLauncher.isGridOnlyOverviewEnabled()) {
+ testLogD(TAG, "Not expecting an actions bar: device is tablet with grid-only Overview");
return false;
}
OverviewTask task = isTablet ? getFocusedTaskForTablet() : getCurrentTask();
if (task == null) {
+ testLogD(TAG, "Not expecting an actions bar: no current task");
return false;
}
// In tablets, if focused task is not in center, overview actions aren't visible.
if (isTablet && Math.abs(task.getExactCenterX() - mLauncher.getExactScreenCenterX()) >= 1) {
+ testLogD(TAG,
+ "Not expecting an actions bar: device is tablet and task is not centered");
return false;
}
if (task.isTaskSplit() && (!mLauncher.isAppPairsEnabled() || !isTablet)) {
+ testLogD(TAG, "Not expecting an actions bar: device is phone and task is split");
// Overview actions aren't visible for split screen tasks, except for save app pair
// button on tablets.
return false;
}
+ testLogD(TAG, "Expecting an actions bar");
return true;
}
@@ -447,12 +492,30 @@
}
private void verifyActionsViewVisibility() {
+ // If no running tasks, no need to verify actions view visibility.
+ if (getTasks().isEmpty()) {
+ return;
+ }
+
+ boolean isTablet = mLauncher.isTablet();
+ OverviewTask task = isTablet ? getFocusedTaskForTablet() : getCurrentTask();
+
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "want to assert overview actions view visibility")) {
+ "want to assert overview actions view visibility="
+ + isActionsViewVisible()
+ + ", focused task is "
+ + (task == null ? "null" : (task.isTaskSplit() ? "split" : "not split"))
+ )) {
+
if (isActionsViewVisible()) {
- mLauncher.waitForOverviewObject("action_buttons");
+ if (task.isTaskSplit()) {
+ mLauncher.waitForOverviewObject("action_save_app_pair");
+ } else {
+ mLauncher.waitForOverviewObject("action_buttons");
+ }
} else {
mLauncher.waitUntilOverviewObjectGone("action_buttons");
+ mLauncher.waitUntilOverviewObjectGone("action_save_app_pair");
}
}
}
@@ -467,17 +530,23 @@
throw new IllegalStateException("Must be run on tablet device.");
}
final List<UiObject2> taskViews = getTasks();
- if (taskViews.size() == 0) {
+ if (taskViews.isEmpty()) {
return null;
}
- int focusedTaskHeight = mLauncher.getFocusedTaskHeightForTablet();
+ Rect focusTaskSize = mLauncher.getOverviewTaskSize();
+ int focusedTaskHeight = focusTaskSize.height();
for (UiObject2 task : taskViews) {
OverviewTask overviewTask = new OverviewTask(mLauncher, task, this);
-
if (overviewTask.getVisibleHeight() == focusedTaskHeight) {
return overviewTask;
}
}
return null;
}
+
+ protected boolean isLiveTile(UiObject2 task) {
+ // UiObject2.equals returns false even when mLiveTileTask and task have the same node, hence
+ // compare only hashCode as a workaround.
+ return mLiveTileTask != null && mLiveTileTask.hashCode() == task.hashCode();
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index 200f2ff..b3ad930 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -33,6 +33,7 @@
import android.view.MotionEvent;
import android.view.ViewConfiguration;
+import androidx.annotation.NonNull;
import androidx.test.uiautomator.Condition;
import androidx.test.uiautomator.UiDevice;
@@ -75,6 +76,20 @@
return false;
}
+ @NonNull
+ @Override
+ public BaseOverview switchToOverview() {
+ try (LauncherInstrumentation.Closable ignored = mLauncher.eventsCheck();
+ LauncherInstrumentation.Closable ignored1 = mLauncher.addContextLayer(
+ "want to switch from background to overview")) {
+ verifyActiveContainer();
+ goToOverviewUnchecked();
+ return mLauncher.is3PLauncher()
+ ? new BaseOverview(mLauncher, /*launchedFromApp=*/true)
+ : new Overview(mLauncher, /*launchedFromApp=*/true);
+ }
+ }
+
/**
* Returns the taskbar.
*
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index aa8d339..d3c423e 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -98,6 +98,7 @@
import java.util.function.BooleanSupplier;
import java.util.function.Function;
import java.util.function.Supplier;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -108,7 +109,7 @@
public final class LauncherInstrumentation {
private static final String TAG = "Tapl";
- private static final int ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME = 15;
+ private static final int ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME = 5;
private static final int GESTURE_STEP_MS = 16;
static final Pattern EVENT_PILFER_POINTERS = Pattern.compile("pilferPointers");
@@ -427,14 +428,14 @@
.getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
}
- int getFocusedTaskHeightForTablet() {
- return getTestInfo(TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET).getInt(
- TestProtocol.TEST_INFO_RESPONSE_FIELD);
+ Rect getOverviewTaskSize() {
+ return getTestInfo(TestProtocol.REQUEST_GET_OVERVIEW_TASK_SIZE)
+ .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, Rect.class);
}
- Rect getGridTaskRectForTablet() {
- return ((Rect) getTestInfo(TestProtocol.REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET)
- .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD));
+ Rect getOverviewGridTaskSize() {
+ return getTestInfo(TestProtocol.REQUEST_GET_OVERVIEW_GRID_TASK_SIZE)
+ .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, Rect.class);
}
int getOverviewPageSpacing() {
@@ -455,10 +456,6 @@
getTestInfo(TestProtocol.REQUEST_ENABLE_ROTATION, Boolean.toString(on));
}
- public void setEnableSuggestion(boolean enableSuggestion) {
- getTestInfo(TestProtocol.REQUEST_ENABLE_SUGGESTION, Boolean.toString(enableSuggestion));
- }
-
public boolean hadNontestEvents() {
return getTestInfo(TestProtocol.REQUEST_GET_HAD_NONTEST_EVENTS)
.getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
@@ -711,7 +708,7 @@
final LogEventChecker eventChecker = mEventChecker;
mEventChecker = null;
if (checkEvents) {
- final String eventMismatch = eventChecker.verify(0, false);
+ final String eventMismatch = eventChecker.verify(0);
if (eventMismatch != null) {
message = message + ";\n" + eventMismatch;
}
@@ -1232,7 +1229,8 @@
void pressBackImpl() {
waitForLauncherInitialized();
final boolean launcherVisible =
- isTablet() ? isLauncherContainerVisible() : isLauncherVisible();
+ (isTablet() || isTaskbarNavbarUnificationEnabled()) ? isLauncherContainerVisible()
+ : isLauncherVisible();
boolean isThreeFingerTrackpadGesture =
mTrackpadGestureType == TrackpadGestureType.THREE_FINGER;
if (getNavigationModel() == NavigationModel.ZERO_BUTTON
@@ -1587,7 +1585,7 @@
return objects;
}
- private UiObject2 waitForObjectBySelector(BySelector selector) {
+ UiObject2 waitForObjectBySelector(BySelector selector) {
Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
"LauncherInstrumentation.waitForObjectBySelector");
final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS);
@@ -2318,6 +2316,14 @@
getTestInfo(TestProtocol.REQUEST_UNSTASH_BUBBLE_BAR_IF_STASHED);
}
+ public void injectFakeTrackpad() {
+ getTestInfo(TestProtocol.REQUEST_INJECT_FAKE_TRACKPAD);
+ }
+
+ public void ejectFakeTrackpad() {
+ getTestInfo(TestProtocol.REQUEST_EJECT_FAKE_TRACKPAD);
+ }
+
/** Blocks the taskbar from automatically stashing based on time. */
public void enableBlockTimeout(boolean enable) {
getTestInfo(enable
@@ -2394,6 +2400,16 @@
disableSensorRotation();
final Integer initialPid = getPid();
final LogEventChecker eventChecker = new LogEventChecker(this);
+ eventChecker.setLogExclusionRule(event -> {
+ Matcher matcher = Pattern.compile("KeyEvent.*flags=0x([0-9a-fA-F]+)").matcher(event);
+ if (matcher.find()) {
+ int keyEventFlags = Integer.parseInt(matcher.group(1), 16);
+ // ignore KeyEvents with FLAG_CANCELED
+ return (keyEventFlags & KeyEvent.FLAG_CANCELED) != 0;
+ }
+ return false;
+ });
+
if (eventChecker.start()) mEventChecker = eventChecker;
return () -> {
@@ -2408,7 +2424,7 @@
if (mEventChecker != null) {
mEventChecker = null;
if (mCheckEventsForSuccessfulGestures) {
- final String message = eventChecker.verify(WAIT_TIME_MS, true);
+ final String message = eventChecker.verify(WAIT_TIME_MS);
if (message != null) {
dumpDiagnostics(message);
checkForAnomaly();
@@ -2451,7 +2467,8 @@
}
float getWindowCornerRadius() {
- // TODO(b/197326121): Check if the touch is overlapping with the corners by offsetting
+ // Return a larger corner radius to ensure gesture calculated from the radius are offset to
+ // prevent overlapping
final float tmpBuffer = 100f;
final Resources resources = getResources();
if (!supportsRoundedCornersOnWindows(resources)) {
diff --git a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
index 672c6e0..3a49160 100644
--- a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
+++ b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
@@ -15,10 +15,6 @@
*/
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_MAIN;
-import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_PILFER;
-import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_TIS;
-
import android.os.SystemClock;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -39,6 +35,8 @@
// Map from an event sequence name to an ordered list of expected events in that sequence.
private final ListMap<Pattern> mExpectedEvents = new ListMap<>();
+ private LogExclusionRule mLogExclusionRule = null;
+
LogEventChecker(LauncherInstrumentation launcher) {
mLauncher = launcher;
}
@@ -52,6 +50,10 @@
mExpectedEvents.add(sequence, pattern);
}
+ void setLogExclusionRule(LogExclusionRule logExclusionRule) {
+ mLogExclusionRule = logExclusionRule;
+ }
+
// Waits for the expected number of events and returns them.
private ListMap<String> finishSync(long waitForExpectedCountMs) {
final long startTime = SystemClock.uptimeMillis();
@@ -78,7 +80,9 @@
final ListMap<String> eventSequences = new ListMap<>();
for (String rawEvent : rawEvents) {
final String[] split = rawEvent.split("/");
- eventSequences.add(split[0], split[1]);
+ if (mLogExclusionRule == null || !mLogExclusionRule.shouldExclude(split[1])) {
+ eventSequences.add(split[0], split[1]);
+ }
}
return eventSequences;
}
@@ -87,25 +91,11 @@
mLauncher.getTestInfo(TestProtocol.REQUEST_STOP_EVENT_LOGGING);
}
- String verify(long waitForExpectedCountMs, boolean successfulGesture) {
+ String verify(long waitForExpectedCountMs) {
final ListMap<String> actualEvents = finishSync(waitForExpectedCountMs);
if (actualEvents == null) return "null event sequences because launcher likely died";
- final String lowLevelDiags = lowLevelMismatchDiagnostics(actualEvents);
- // If we have a sequence mismatch for a successful gesture, we want to provide all low-level
- // details.
- if (successfulGesture) {
- return lowLevelDiags;
- }
-
- final String sequenceMismatchInEnglish = highLevelMismatchDiagnostics(actualEvents);
-
- if (sequenceMismatchInEnglish != null) {
- LauncherInstrumentation.log(lowLevelDiags);
- return "Hint: " + sequenceMismatchInEnglish;
- } else {
- return lowLevelDiags;
- }
+ return lowLevelMismatchDiagnostics(actualEvents);
}
private String lowLevelMismatchDiagnostics(ListMap<String> actualEvents) {
@@ -140,42 +130,6 @@
return hasMismatches ? "Mismatching events: " + sb.toString() : null;
}
- private String highLevelMismatchDiagnostics(ListMap<String> actualEvents) {
- if (!mExpectedEvents.getNonNull(SEQUENCE_TIS).isEmpty()
- && actualEvents.getNonNull(SEQUENCE_TIS).isEmpty()) {
- return "TouchInteractionService didn't receive any of the touch events sent by the "
- + "test";
- }
- if (getMismatchPosition(mExpectedEvents.getNonNull(SEQUENCE_TIS),
- actualEvents.getNonNull(SEQUENCE_TIS)) != -1) {
- // If TIS has a mismatch that we can't convert to high-level diags, don't convert
- // other sequences either.
- return null;
- }
-
- if (mExpectedEvents.getNonNull(SEQUENCE_PILFER).size() == 1
- && actualEvents.getNonNull(SEQUENCE_PILFER).isEmpty()) {
- return "Launcher didn't detect the navigation gesture sent by the test";
- }
- if (mExpectedEvents.getNonNull(SEQUENCE_PILFER).isEmpty()
- && actualEvents.getNonNull(SEQUENCE_PILFER).size() == 1) {
- return "Launcher detected a navigation gesture, but the test didn't send one";
- }
- if (getMismatchPosition(mExpectedEvents.getNonNull(SEQUENCE_PILFER),
- actualEvents.getNonNull(SEQUENCE_PILFER)) != -1) {
- // If Pilfer has a mismatch that we can't convert to high-level diags, don't analyze
- // other sequences.
- return null;
- }
-
- if (!mExpectedEvents.getNonNull(SEQUENCE_MAIN).isEmpty()
- && actualEvents.getNonNull(SEQUENCE_MAIN).isEmpty()) {
- return "None of the touch or keyboard events sent by the test was received by "
- + "Launcher's main thread";
- }
- return null;
- }
-
// If the list of actual events matches the list of expected events, returns -1, otherwise
// the position of the mismatch.
private static int getMismatchPosition(List<Pattern> expected, List<String> actual) {
@@ -229,4 +183,8 @@
return list;
}
}
+
+ interface LogExclusionRule {
+ boolean shouldExclude(String event);
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Overview.java b/tests/tapl/com/android/launcher3/tapl/Overview.java
index 50c2136..deb27e4 100644
--- a/tests/tapl/com/android/launcher3/tapl/Overview.java
+++ b/tests/tapl/com/android/launcher3/tapl/Overview.java
@@ -22,9 +22,12 @@
* Overview pane.
*/
public class Overview extends BaseOverview {
-
Overview(LauncherInstrumentation launcher) {
- super(launcher);
+ this(launcher, /*launchedFromApp=*/false);
+ }
+
+ Overview(LauncherInstrumentation launcher, boolean launchedFromApp) {
+ super(launcher, launchedFromApp);
}
@Override
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
index 486a63b..d7c40a0 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
@@ -17,7 +17,6 @@
package com.android.launcher3.tapl;
import androidx.annotation.NonNull;
-import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;
/**
@@ -111,12 +110,4 @@
}
}
}
-
- /** Asserts that an item matching the given string is present in the overview actions. */
- public void assertHasAction(String text) {
- try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "want to check if the action [" + text + "] is present")) {
- mLauncher.waitForObjectInContainer(mOverviewActions, By.text(text));
- }
- }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
index 6f420af..ab48a21 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -40,16 +40,23 @@
public final class OverviewTask {
private static final String SYSTEMUI_PACKAGE = "com.android.systemui";
static final Pattern TASK_START_EVENT = Pattern.compile("startActivityFromRecentsAsync");
+ static final Pattern TASK_START_EVENT_DESKTOP = Pattern.compile("launchDesktopFromRecents");
+ static final Pattern TASK_START_EVENT_LIVE_TILE = Pattern.compile(
+ "composeRecentsLaunchAnimator");
static final Pattern SPLIT_SELECT_EVENT = Pattern.compile("enterSplitSelect");
static final Pattern SPLIT_START_EVENT = Pattern.compile("launchSplitTasks");
private final LauncherInstrumentation mLauncher;
+ @NonNull
private final UiObject2 mTask;
+ private final TaskViewType mType;
private final BaseOverview mOverview;
- OverviewTask(LauncherInstrumentation launcher, UiObject2 task, BaseOverview overview) {
+ OverviewTask(LauncherInstrumentation launcher, @NonNull UiObject2 task, BaseOverview overview) {
mLauncher = launcher;
+ mLauncher.assertNotNull("task must not be null", task);
mTask = task;
mOverview = overview;
+ mType = getType();
verifyActiveContainer();
}
@@ -149,8 +156,8 @@
return;
}
- boolean taskWasFocused = mLauncher.isTablet() && getVisibleHeight() == mLauncher
- .getFocusedTaskHeightForTablet();
+ boolean taskWasFocused = mLauncher.isTablet()
+ && getVisibleHeight() == mLauncher.getOverviewTaskSize().height();
List<Integer> originalTasksCenterX =
getCurrentTasksCenterXList().stream().sorted().toList();
boolean isClearAllVisibleBeforeDismiss = mOverview.isClearAllVisible();
@@ -220,7 +227,22 @@
return new LaunchedAppState(mLauncher);
}
} else {
- mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT);
+ final Pattern event;
+ if (mOverview.isLiveTile(mTask)) {
+ event = TASK_START_EVENT_LIVE_TILE;
+ } else if (mType == TaskViewType.DESKTOP) {
+ event = TASK_START_EVENT_DESKTOP;
+ } else {
+ event = TASK_START_EVENT;
+ }
+ mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, event);
+
+ if (mType == TaskViewType.DESKTOP) {
+ try (LauncherInstrumentation.Closable ignored = mLauncher.addContextLayer(
+ "launched desktop")) {
+ mLauncher.waitForSystemUiObject("desktop_mode_caption");
+ }
+ }
return new LaunchedAppState(mLauncher);
}
}
@@ -273,6 +295,17 @@
return actual.contains(expected);
}
+ private TaskViewType getType() {
+ String resourceName = mTask.getResourceName();
+ if (resourceName.endsWith("task_view_grouped")) {
+ return TaskViewType.GROUPED;
+ } else if (resourceName.endsWith("task_view_desktop")) {
+ return TaskViewType.DESKTOP;
+ } else {
+ return TaskViewType.SINGLE;
+ }
+ }
+
/**
* Enum used to specify which task is retrieved when it is a split task.
*/
@@ -292,4 +325,10 @@
this.iconAppRes = iconAppRes;
}
}
+
+ private enum TaskViewType {
+ SINGLE,
+ GROUPED,
+ DESKTOP
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
index 902ad5b..90d32f3 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
@@ -97,6 +97,29 @@
}
}
+ /**
+ * Taps the Desktop item from the overview task menu and returns the LaunchedAppState
+ * representing the Desktop.
+ */
+ @NonNull
+ public LaunchedAppState tapDesktopMenuItem() {
+ try (LauncherInstrumentation.Closable ignored = mLauncher.eventsCheck();
+ LauncherInstrumentation.Closable ignored1 = mLauncher.addContextLayer(
+ "before tapping the desktop menu item")) {
+ mLauncher.executeAndWaitForLauncherStop(
+ () -> mLauncher.clickLauncherObject(
+ mLauncher.findObjectInContainer(mMenu, By.text("Desktop"))),
+ "tapped desktop menu item");
+
+ try (LauncherInstrumentation.Closable ignored2 = mLauncher.addContextLayer(
+ "tapped desktop menu item")) {
+ mLauncher.waitUntilSystemLauncherObjectGone("overview_panel");
+ mLauncher.waitForSystemUiObject("desktop_mode_caption");
+ return new LaunchedAppState(mLauncher);
+ }
+ }
+ }
+
/** Returns true if an item matching the given string is present in the menu. */
public boolean hasMenuItem(String expectedMenuItemText) {
UiObject2 menuItem = mLauncher.findObjectInContainer(mMenu, By.text(expectedMenuItemText));
@@ -104,14 +127,6 @@
}
/**
- * Returns the menu item specified by name if present.
- */
- public OverviewTaskMenuItem getMenuItemByName(String menuItemName) {
- return new OverviewTaskMenuItem(mLauncher,
- mLauncher.waitForObjectInContainer(mMenu, By.text(menuItemName)));
- }
-
- /**
* Taps outside task menu to dismiss it.
*/
public void touchOutsideTaskMenuToDismiss() {
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenuItem.java b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenuItem.java
deleted file mode 100644
index e3035bf..0000000
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenuItem.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.tapl;
-
-import android.graphics.Rect;
-
-import androidx.test.uiautomator.UiObject2;
-
-/** Represents an item in the overview task menu. */
-public class OverviewTaskMenuItem {
-
- private final LauncherInstrumentation mLauncher;
- private final UiObject2 mMenuItem;
-
- OverviewTaskMenuItem(LauncherInstrumentation launcher, UiObject2 menuItem) {
- mLauncher = launcher;
- mMenuItem = menuItem;
- }
-
- /**
- * Returns this menu item's visible bounds.
- */
- public Rect getVisibleBounds() {
- return mMenuItem.getVisibleBounds();
- }
-}
diff --git a/tests/tapl/com/android/launcher3/tapl/PrivateSpaceContainer.java b/tests/tapl/com/android/launcher3/tapl/PrivateSpaceContainer.java
index daddd2f..a2814f0 100644
--- a/tests/tapl/com/android/launcher3/tapl/PrivateSpaceContainer.java
+++ b/tests/tapl/com/android/launcher3/tapl/PrivateSpaceContainer.java
@@ -25,20 +25,30 @@
*/
public class PrivateSpaceContainer {
private static final String PS_HEADER_RES_ID = "ps_header_layout";
- private static final String INSTALL_APP_TITLE = "Install apps";
+ private static final String INSTALL_APP_TITLE = "Install";
private static final String DIVIDER_RES_ID = "private_space_divider";
private final LauncherInstrumentation mLauncher;
private final UiObject2 mAppListRecycler;
+ private final AllApps mAppList;
+ private final boolean mPrivateSpaceEnabled;
PrivateSpaceContainer(LauncherInstrumentation launcherInstrumentation,
- UiObject2 appListRecycler) {
+ UiObject2 appListRecycler, AllApps appList, boolean privateSpaceEnabled) {
mLauncher = launcherInstrumentation;
mAppListRecycler = appListRecycler;
+ mAppList = appList;
+ mPrivateSpaceEnabled = privateSpaceEnabled;
- verifyHeaderIsPresent();
- verifyInstallAppButtonIsPresent();
- verifyDividerIsPresent();
+ if (mPrivateSpaceEnabled) {
+ verifyHeaderIsPresent();
+ verifyInstallAppButtonIsPresent();
+ verifyDividerIsPresent();
+ } else {
+ verifyHeaderIsPresent();
+ verifyInstallAppButtonIsNotPresent();
+ verifyDividerIsNotPresent();
+ }
}
// Assert PS Header is in view.
@@ -46,13 +56,18 @@
private void verifyHeaderIsPresent() {
final UiObject2 psHeader = mLauncher.waitForObjectInContainer(mAppListRecycler,
PS_HEADER_RES_ID);
- new PrivateSpaceHeader(mLauncher, psHeader, true);
+ new PrivateSpaceHeader(mLauncher, psHeader, mPrivateSpaceEnabled);
}
// Assert Install App Item is present in view.
private void verifyInstallAppButtonIsPresent() {
- mLauncher.getAllApps().getAppIcon(INSTALL_APP_TITLE);
+ mAppList.getAppIcon(INSTALL_APP_TITLE);
+ }
+
+ // Assert Install App Item is not present in view.
+ private void verifyInstallAppButtonIsNotPresent() {
+ mLauncher.waitUntilLauncherObjectGone(DIVIDER_RES_ID);
}
// Assert Sys App Divider is present in view.
@@ -60,15 +75,20 @@
mLauncher.waitForObjectInContainer(mAppListRecycler, DIVIDER_RES_ID);
}
+ // Assert Sys App Divider is not present in view.
+ private void verifyDividerIsNotPresent() {
+ mLauncher.waitUntilLauncherObjectGone(DIVIDER_RES_ID);
+ }
+
/**
* Verifies that a user installed app is present above the divider.
*/
public void verifyInstalledAppIsPresent(String appName) {
- HomeAppIcon appIcon = mLauncher.getAllApps().getAppIcon(appName);
+ AppIcon appIcon = mAppList.getAppIcon(appName);
final Point iconCenter = appIcon.mObject.getVisibleCenter();
UiObject2 divider = mLauncher.waitForObjectInContainer(mAppListRecycler, DIVIDER_RES_ID);
final Point dividerCenter = divider.getVisibleCenter();
mLauncher.assertTrue("Installed App: " + appName + " is not above the divider",
iconCenter.y < dividerCenter.y);
}
-}
+}
\ No newline at end of file
diff --git a/tests/tapl/com/android/launcher3/tapl/PrivateSpaceHeader.java b/tests/tapl/com/android/launcher3/tapl/PrivateSpaceHeader.java
index 3a7f038..cc64aae 100644
--- a/tests/tapl/com/android/launcher3/tapl/PrivateSpaceHeader.java
+++ b/tests/tapl/com/android/launcher3/tapl/PrivateSpaceHeader.java
@@ -45,7 +45,7 @@
if (mPrivateSpaceEnabled) {
verifyUnlockedState();
} else {
- mLauncher.fail("Private Space found in non enabled state");
+ verifyLockedState();
}
}
@@ -74,4 +74,23 @@
mLauncher.assertEquals("PS lock text is incorrect", "Lock", lockText.getText());
}
+
+ /** Verify Locked State elements in Private Space Header */
+ private void verifyLockedState() {
+ UiObject2 headerText = mLauncher.waitForObjectInContainer(mPrivateSpaceHeader,
+ PS_HEADER_TEXT_RES_ID);
+ mLauncher.assertEquals("PS Header Text is incorrect ",
+ "Private", headerText.getText());
+
+ UiObject2 unLockButtonView = mLauncher.waitForObjectInContainer(mPrivateSpaceHeader,
+ UNLOCK_BUTTON_VIEW_RES_ID);
+ mLauncher.waitForObjectEnabled(unLockButtonView, "Private Space Unlock Button");
+ mLauncher.assertTrue("PS Unlock Button is non-clickable", unLockButtonView.isClickable());
+
+ mLauncher.waitForObjectInContainer(mPrivateSpaceHeader,
+ LOCK_ICON_RES_ID);
+
+ mLauncher.waitUntilLauncherObjectGone(SETTINGS_BUTTON_RES_ID);
+ mLauncher.waitUntilLauncherObjectGone(LOCK_TEXT_RES_ID);
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/SearchResultFromQsb.java b/tests/tapl/com/android/launcher3/tapl/SearchResultFromQsb.java
index 8d3a631..c58d16e 100644
--- a/tests/tapl/com/android/launcher3/tapl/SearchResultFromQsb.java
+++ b/tests/tapl/com/android/launcher3/tapl/SearchResultFromQsb.java
@@ -17,9 +17,12 @@
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
+import android.graphics.Rect;
import android.widget.TextView;
import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.BySelector;
+import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiObject2;
import java.util.ArrayList;
@@ -33,10 +36,12 @@
// This particular ID change should happen with caution
private static final String SEARCH_CONTAINER_RES_ID = "search_results_list_view";
protected final LauncherInstrumentation mLauncher;
+ private final UiObject2 mSearchContainer;
SearchResultFromQsb(LauncherInstrumentation launcher) {
mLauncher = launcher;
mLauncher.waitForLauncherObject("search_container_all_apps");
+ mSearchContainer = mLauncher.waitForSystemLauncherObject(SEARCH_CONTAINER_RES_ID);
}
/** Find the app from search results with app name. */
@@ -51,18 +56,9 @@
/** Find the web suggestion from search suggestion's title text */
public SearchWebSuggestion findWebSuggestion(String text) {
- ArrayList<UiObject2> webSuggestions =
- new ArrayList<>(mLauncher.waitForObjectsInContainer(
- mLauncher.waitForSystemLauncherObject(SEARCH_CONTAINER_RES_ID),
- By.clazz(TextView.class)));
- for (UiObject2 uiObject: webSuggestions) {
- String currentString = uiObject.getText();
- if (currentString.equals(text)) {
- return createWebSuggestion(uiObject);
- }
- }
- mLauncher.fail("Web suggestion title: " + text + " not found");
- return null;
+ UiObject2 webSuggestion = mLauncher.waitForObjectInContainer(mSearchContainer,
+ getSearchResultSelector(text));
+ return createWebSuggestion(webSuggestion);
}
protected SearchWebSuggestion createWebSuggestion(UiObject2 webSuggestion) {
@@ -72,13 +68,25 @@
/** Find the total amount of views being displayed and return the size */
public int getSearchResultItemSize() {
ArrayList<UiObject2> searchResultItems =
- new ArrayList<>(mLauncher.waitForObjectsInContainer(
- mLauncher.waitForSystemLauncherObject(SEARCH_CONTAINER_RES_ID),
+ new ArrayList<>(mLauncher.waitForObjectsInContainer(mSearchContainer,
By.clazz(TextView.class)));
return searchResultItems.size();
}
/**
+ * Scroll down to make next page search results rendered.
+ */
+ public void getNextPageSearchResults() {
+ final int searchContainerHeight = mLauncher.getVisibleBounds(mSearchContainer).height();
+ // Start scrolling from center of the screen to top of the screen.
+ mLauncher.scroll(mSearchContainer,
+ Direction.DOWN,
+ new Rect(0, 0, 0, searchContainerHeight / 2),
+ /* steps= */ 10,
+ /*slowDown= */ false);
+ }
+
+ /**
* Taps outside bottom sheet to dismiss and return to workspace. Available on tablets only.
* @param tapRight Tap on the right of bottom sheet if true, or left otherwise.
*/
@@ -117,4 +125,16 @@
public SearchResultFromQsb getSearchResultForInput() {
return this;
}
+
+ /** Verify a tile is present by checking its title and subtitle. */
+ public void verifyTileIsPresent(String title, String subtitle) {
+ mLauncher.waitForObjectInContainer(mSearchContainer,
+ getSearchResultSelector(title));
+ mLauncher.waitForObjectInContainer(mSearchContainer,
+ getSearchResultSelector(subtitle));
+ }
+
+ private BySelector getSearchResultSelector(String text) {
+ return By.clazz(TextView.class).text(text);
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 4fa93ef..748d576 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -345,17 +345,34 @@
* @return map of text -> center of the view. In case of icons with the same name, the one with
* lower x coordinate is selected.
*/
- public Map<String, Point> getWorkspaceIconsPositions() {
+ public Map<String, Point> getAllWorkspaceIconsPositions() {
final UiObject2 workspace = verifyActiveContainer();
- mLauncher.waitForLauncherInitialized(); // b/319501259
List<UiObject2> workspaceIcons =
mLauncher.waitForObjectsInContainer(workspace, AppIcon.getAnyAppIconSelector());
- return workspaceIcons.stream()
+ return getIconPositionMap(workspaceIcons);
+ }
+
+ /**
+ * @return point where icon is found for given the app name,
+ * point is visible center of the icon.
+ */
+ @NonNull
+ public Point getWorkspaceIconPosition(String appName) {
+ final UiObject2 workspace = verifyActiveContainer();
+
+ UiObject2 workspaceIcon =
+ mLauncher.waitForObjectInContainer(workspace,
+ AppIcon.getAppIconSelector(appName, mLauncher));
+ return workspaceIcon.getVisibleCenter();
+ }
+
+ private Map<String, Point> getIconPositionMap(List<UiObject2> icons) {
+ return icons.stream()
.collect(
Collectors.toMap(
/* keyMapper= */ uiObject21 -> {
- Log.d(UIOBJECT_STALE_ELEMENT, "keyText: " +
- uiObject21.getText());
+ Log.d(UIOBJECT_STALE_ELEMENT, "keyText: "
+ + uiObject21.getText());
return uiObject21.getText();
},
/* valueMapper= */ uiObject2 -> {
@@ -444,6 +461,8 @@
Runnable expectLongClickEvents) {
try (LauncherInstrumentation.Closable c = launcher.addContextLayer(
"uninstalling app icon")) {
+
+ final String appNameToUninstall = homeAppIcon.getAppName();
dragIconToWorkspace(
launcher,
homeAppIcon,
@@ -468,7 +487,10 @@
try (LauncherInstrumentation.Closable c1 = launcher.addContextLayer(
"uninstalled app by dragging to the drop bar")) {
- return new Workspace(launcher);
+ final Workspace newWorkspace = new Workspace(launcher);
+ launcher.waitUntilLauncherObjectGone(
+ AppIcon.getAppIconSelector(appNameToUninstall));
+ return newWorkspace;
}
}
}