Merge "Adding Winscope Launcher trace artifact" into sc-v2-dev
diff --git a/Android.bp b/Android.bp
index 43d28c9..c8d9186 100644
--- a/Android.bp
+++ b/Android.bp
@@ -33,6 +33,9 @@
android_library {
name: "launcher-aosp-tapl",
+ libs: [
+ "framework-statsd",
+ ],
static_libs: [
"androidx.annotation_annotation",
"androidx.test.runner",
@@ -192,6 +195,9 @@
resource_dirs: [
"quickstep/res",
],
+ libs: [
+ "framework-statsd",
+ ],
static_libs: [
"Launcher3ResLib",
"SystemUISharedLib",
@@ -261,6 +267,9 @@
resource_dirs: [
"quickstep/res",
],
+ libs: [
+ "framework-statsd",
+ ],
static_libs: [
"SystemUI-statsd",
"SystemUISharedLib",
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index 4eecf29..eee6db5 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -30,7 +30,6 @@
with some minor changed based on the derivative app.
-->
- <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
diff --git a/go/quickstep/res/values-gu/strings.xml b/go/quickstep/res/values-gu/strings.xml
index 28a2d38..e1a568f 100644
--- a/go/quickstep/res/values-gu/strings.xml
+++ b/go/quickstep/res/values-gu/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">"Lens"</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/quickstep/AndroidManifest.xml b/quickstep/AndroidManifest.xml
index b43d8d1..dc92731 100644
--- a/quickstep/AndroidManifest.xml
+++ b/quickstep/AndroidManifest.xml
@@ -22,11 +22,6 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.android.launcher3">
- <permission
- android:name="${packageName}.permission.HOTSEAT_EDU"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="signatureOrSystem" />
-
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
<uses-permission android:name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
@@ -41,7 +36,6 @@
<uses-permission android:name="android.permission.MANAGE_ACCESSIBILITY"/>
<uses-permission android:name="android.permission.MONITOR_INPUT"/>
- <uses-permission android:name="${packageName}.permission.HOTSEAT_EDU" />
<uses-permission android:name="android.permission.SYSTEM_APPLICATION_OVERLAY" />
<application android:backupAgent="com.android.launcher3.LauncherBackupAgent"
@@ -133,20 +127,6 @@
</intent-filter>
</activity>
- <activity
- android:name=".hybridhotseat.HotseatEduActivity"
- android:theme="@android:style/Theme.NoDisplay"
- android:noHistory="true"
- android:launchMode="singleTask"
- android:clearTaskOnLaunch="true"
- android:permission="${packageName}.permission.HOTSEAT_EDU"
- android:exported="true">
- <intent-filter>
- <action android:name="com.android.launcher3.action.SHOW_HYBRID_HOTSEAT_EDU"/>
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- </activity>
-
</application>
</manifest>
diff --git a/quickstep/res/drawable/bg_overview_clear_all_button.xml b/quickstep/res/drawable/bg_overview_clear_all_button.xml
new file mode 100644
index 0000000..47cbd9f
--- /dev/null
+++ b/quickstep/res/drawable/bg_overview_clear_all_button.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<ripple android:color="?android:attr/colorControlHighlight"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+ <item>
+ <shape android:shape="rectangle"
+ android:tint="?colorButtonNormal">
+ <corners android:radius="18dp" />
+ <solid android:color="?androidprv:attr/colorSurface"/>
+ </shape>
+ </item>
+</ripple>
\ No newline at end of file
diff --git a/quickstep/res/drawable/taskbar_edu_splitscreen.png b/quickstep/res/drawable/taskbar_edu_splitscreen.png
new file mode 100644
index 0000000..f9d2a63
--- /dev/null
+++ b/quickstep/res/drawable/taskbar_edu_splitscreen.png
Binary files differ
diff --git a/quickstep/res/drawable/taskbar_edu_splitscreen.webp b/quickstep/res/drawable/taskbar_edu_splitscreen.webp
deleted file mode 100644
index 2f4402f..0000000
--- a/quickstep/res/drawable/taskbar_edu_splitscreen.webp
+++ /dev/null
Binary files differ
diff --git a/quickstep/res/drawable/taskbar_edu_stashing.png b/quickstep/res/drawable/taskbar_edu_stashing.png
new file mode 100644
index 0000000..f9d2a63
--- /dev/null
+++ b/quickstep/res/drawable/taskbar_edu_stashing.png
Binary files differ
diff --git a/quickstep/res/drawable/taskbar_edu_switch_apps.png b/quickstep/res/drawable/taskbar_edu_switch_apps.png
new file mode 100644
index 0000000..f9d2a63
--- /dev/null
+++ b/quickstep/res/drawable/taskbar_edu_switch_apps.png
Binary files differ
diff --git a/quickstep/res/layout/overview_clear_all_button.xml b/quickstep/res/layout/overview_clear_all_button.xml
index 1ee726e..1dea57e 100644
--- a/quickstep/res/layout/overview_clear_all_button.xml
+++ b/quickstep/res/layout/overview_clear_all_button.xml
@@ -16,7 +16,7 @@
-->
<com.android.quickstep.views.ClearAllButton
xmlns:android="http://schemas.android.com/apk/res/android"
- style="@android:style/Widget.DeviceDefault.Button.Borderless"
+ style="@style/OverviewClearAllButton"
android:id="@+id/clear_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index b4c168c..83ad9f3 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -52,6 +52,7 @@
android:orientation="horizontal"
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+ android:layout_marginEnd="@dimen/taskbar_contextual_button_margin"
android:gravity="center_vertical"
android:layout_gravity="end"/>
diff --git a/quickstep/res/layout/taskbar_contextual_button.xml b/quickstep/res/layout/taskbar_contextual_button.xml
new file mode 100644
index 0000000..cbbbfab
--- /dev/null
+++ b/quickstep/res/layout/taskbar_contextual_button.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<ImageView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="@dimen/taskbar_contextual_buttons_size"
+ android:layout_height="@dimen/taskbar_contextual_buttons_size"
+ android:layout_marginTop="@dimen/taskbar_contextual_button_margin"
+ android:paddingStart="@dimen/taskbar_nav_buttons_spacing"
+ android:background="@drawable/taskbar_icon_click_feedback_roundrect"
+ android:scaleType="center"/>
\ No newline at end of file
diff --git a/quickstep/res/layout/taskbar_edu.xml b/quickstep/res/layout/taskbar_edu.xml
index ef57a53..3796ff9 100644
--- a/quickstep/res/layout/taskbar_edu.xml
+++ b/quickstep/res/layout/taskbar_edu.xml
@@ -43,6 +43,26 @@
launcher:pageIndicator="@+id/content_page_indicator">
<LinearLayout
+ android:id="@+id/page_switch_apps"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="center_horizontal">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/TextAppearance.TaskbarEdu.Title"
+ android:text="@string/taskbar_edu_switch_apps"/>
+
+ <ImageView
+ android:layout_width="322dp"
+ android:layout_height="282dp"
+ android:layout_marginTop="16dp"
+ android:src="@drawable/taskbar_edu_switch_apps"/>
+ </LinearLayout>
+
+ <LinearLayout
android:id="@+id/page_splitscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -52,14 +72,8 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="16dp"
- android:gravity="center_horizontal"
- style="@style/TextHeadline"
- android:text="@string/taskbar_edu_splitscreen"
- android:fontFamily="google-sans"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="24sp"
- android:maxLines="2"/>
+ style="@style/TextAppearance.TaskbarEdu.Title"
+ android:text="@string/taskbar_edu_splitscreen"/>
<ImageView
android:layout_width="322dp"
@@ -69,7 +83,7 @@
</LinearLayout>
<LinearLayout
- android:id="@+id/page_customize"
+ android:id="@+id/page_stashing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@@ -78,46 +92,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="16dp"
- android:gravity="center_horizontal"
- style="@style/TextHeadline"
- android:text="@string/taskbar_edu_customize"
- android:fontFamily="google-sans"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="24sp"
- android:maxLines="2"/>
+ style="@style/TextAppearance.TaskbarEdu.Title"
+ android:text="@string/taskbar_edu_stashing"/>
<ImageView
android:layout_width="322dp"
android:layout_height="282dp"
android:layout_marginTop="16dp"
- android:src="@drawable/taskbar_edu_splitscreen"/>
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/page_dock"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:gravity="center_horizontal">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginHorizontal="16dp"
- android:gravity="center_horizontal"
- style="@style/TextHeadline"
- android:text="@string/taskbar_edu_dock"
- android:fontFamily="google-sans"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="24sp"
- android:maxLines="2"/>
-
- <ImageView
- android:layout_width="322dp"
- android:layout_height="282dp"
- android:layout_marginTop="16dp"
- android:src="@drawable/taskbar_edu_splitscreen"/>
+ android:src="@drawable/taskbar_edu_stashing"/>
</LinearLayout>
</com.android.launcher3.taskbar.TaskbarEduPagedView>
@@ -126,6 +108,7 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginBottom="92dp"
+ android:layout_marginTop="32dp"
app:layout_constraintTop_toBottomOf="@id/content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -146,10 +129,9 @@
<Button
android:id="@+id/edu_end_button"
android:layout_width="wrap_content"
- android:layout_height="36dp"
- android:layout_marginBottom="92dp"
- app:layout_constraintTop_toBottomOf="@id/content"
- app:layout_constraintBottom_toBottomOf="parent"
+ android:layout_height="0dp"
+ app:layout_constraintTop_toTopOf="@id/edu_start_button"
+ app:layout_constraintBottom_toBottomOf="@id/edu_start_button"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/taskbar_edu_next"
style="@style/TaskbarEdu.Button.Next"
diff --git a/quickstep/res/layout/taskbar_nav_button.xml b/quickstep/res/layout/taskbar_nav_button.xml
index 985f928..4ffb8d8 100644
--- a/quickstep/res/layout/taskbar_nav_button.xml
+++ b/quickstep/res/layout/taskbar_nav_button.xml
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/taskbar_nav_buttons_size"
diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml
index 4a83a4b..0af80f9 100644
--- a/quickstep/res/values-af/strings.xml
+++ b/quickstep/res/values-af/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Stelselnavigasie-instellings"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Deel"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Skermkiekie"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Jou organisasie laat nie hierdie program toe nie"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Slaan navigasietutoriaal oor?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Jy kan dit later in die <xliff:g id="NAME">%1$s</xliff:g>-program kry"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Kanselleer"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Slaan oor"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Gebruik 2 programme tegelyk en wissel programme met die taakbalk"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taakbalkopvoeding het verskyn"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taakbalkopvoeding is toegemaak"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Volgende"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Terug"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Maak toe"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Klaar"</string>
</resources>
diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml
index 4bb9c15..7786191 100644
--- a/quickstep/res/values-am/strings.xml
+++ b/quickstep/res/values-am/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ይህ ድርጊት በመተግበሪያው ወይም በእርስዎ ድርጅት አይፈቀድም"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ዝለል"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"በአንድ ጊዜ 2 መተግበሪያዎችን ይጠቀሙ እና በተግባር አሞሌው አማካኝነት መተግበሪያዎችን ይቀያይሩ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"የተግባር አሞሌ ትምህርት ይታያል"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"የተግባር አሞሌ ትምህርት ተዘግቷል"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"ቀጣይ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ተመለስ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ዝጋ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ተጠናቅቋል"</string>
</resources>
diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml
index 6557abb..25b66d5 100644
--- a/quickstep/res/values-ar/strings.xml
+++ b/quickstep/res/values-ar/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"لا يسمح التطبيق أو لا تسمح مؤسستك بهذا الإجراء."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"التخطي"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"يمكنك استخدام تطبيقين في الوقت نفسه والتبديل بينهما من شريط المهام."</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ظهرت لوحة تعليم استخدام شريط المهام."</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"تم إغلاق لوحة تعليم استخدام شريط المهام."</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"الشاشة التالية"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"رجوع"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"إغلاق"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"تم"</string>
</resources>
diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml
index a506618..5379925 100644
--- a/quickstep/res/values-as/strings.xml
+++ b/quickstep/res/values-as/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"এপ্টোৱে অথবা আপোনাৰ প্ৰতিষ্ঠানে এই কাৰ্যটোৰ অনুমতি নিদিয়ে"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"এৰি যাওক"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"এবাৰতে ২ টা এপ্ ব্যৱহাৰ কৰক আৰু টাস্কবাৰ ব্যৱহাৰ কৰি এপ্ সলনি কৰক"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"টাস্কবাৰৰ শিক্ষাৰ পেনেলটো প্ৰদর্শিত হৈছে"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"টাস্কবাৰৰ শিক্ষাৰ পেনেলটো বন্ধ হৈছে"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"পৰৱৰ্তী"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"উভতি যাওক"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"বন্ধ কৰক"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"হ’ল"</string>
</resources>
diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml
index ba235f4..5498817 100644
--- a/quickstep/res/values-az/strings.xml
+++ b/quickstep/res/values-az/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sistem naviqasiya ayarları"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Paylaşın"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Skrinşot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<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>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Naviqasiya dərsliyi ötürülsün?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Bunu sonra <xliff:g id="NAME">%1$s</xliff:g> tətbiqində tapa bilərsiniz"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Ləğv edin"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ötürün"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Eyni anda 2 tətbiqdən istifadə edin və tapşırıq paneli ilə tətbiqlər arasında keçid edin"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Tapşırıq panelindəki təlim bölməsi görünür"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Tapşırıq panelindəki təlim bölməsi bağlanıb"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Sonra"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Geri"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Bağlayın"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Hazırdır"</string>
</resources>
diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml
index 5001491..81d0a08 100644
--- a/quickstep/res/values-b+sr+Latn/strings.xml
+++ b/quickstep/res/values-b+sr+Latn/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Podešavanja kretanja kroz sistem"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Deli"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snimak ekrana"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ili organizacija ne dozvoljavaju ovu radnju"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Želite da preskočite vodič za kretanje?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Možete da pronađete ovo kasnije u aplikaciji <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Otkaži"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Preskoči"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Koristite 2 aplikacije odjednom i menjajte aplikacije pomoću trake zadataka"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Edukativno okno iz trake zadataka se pojavilo"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Edukativno okno iz trake zadataka je zatvoreno"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Dalje"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Nazad"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gotovo"</string>
</resources>
diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml
index 1662423..586d78d 100644
--- a/quickstep/res/values-be/strings.xml
+++ b/quickstep/res/values-be/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Гэта дзеянне не дазволена праграмай ці вашай арганізацыяй"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Прапусціць"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Адначасова выкарыстоўвайце 2 праграмы і пераключайцеся паміж імі на панэлі задач"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"З\'явілася панэль навучання на панэлі задач"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Панэль навучання на панэлі задач закрыта"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Далей"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрыць"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Гатова"</string>
</resources>
diff --git a/quickstep/res/values-bg/strings.xml b/quickstep/res/values-bg/strings.xml
index 7712020..389b085 100644
--- a/quickstep/res/values-bg/strings.xml
+++ b/quickstep/res/values-bg/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Това действие не е разрешено от приложението или организацията ви"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Пропускане"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Използвайте две приложения едновременно и превключвайте между приложенията посредством лентата на задачите"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Показва се урокът за лентата на задачите"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Урокът за лентата на задачите бе затворен"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Напред"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Затваряне"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
</resources>
diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml
index 83f6656..9d3ac80 100644
--- a/quickstep/res/values-bn/strings.xml
+++ b/quickstep/res/values-bn/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"এই অ্যাপ বা আপনার প্রতিষ্ঠান এই অ্যাকশনটি পারফর্ম করার অনুমতি দেয়নি"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"এড়িয়ে যান"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"টাস্কবার এডুকেশন দেখানো হয়েছে"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"টাস্কবার এডুকেশন বন্ধ করা আছে"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"পরবর্তী"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ফিরুন"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"বন্ধ করুন"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"হয়ে গেছে"</string>
</resources>
diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml
index eba8275..0b8d34a 100644
--- a/quickstep/res/values-bs/strings.xml
+++ b/quickstep/res/values-bs/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Postavke navigiranja sistemom"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Dijeli"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snimak ekrana"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Ovu radnju ne dozvoljava aplikacija ili vaša organizacija"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Preskočiti vodič za navigiranje?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"To možete pronaći kasnije u aplikaciji <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Otkaži"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Preskoči"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Koristite 2 aplikacije odjednom i prebacujte između aplikacija putem programske trake"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Edukacija o programskoj traci je prikazana"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Edukacija o programskoj traci je zatvorena"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Naprijed"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Nazad"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gotovo"</string>
</resources>
diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml
index 62d1ed0..673e25b 100644
--- a/quickstep/res/values-ca/strings.xml
+++ b/quickstep/res/values-ca/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Configuració de navegació del sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Comparteix"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Captura de pantalla"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"L\'aplicació o la teva organització no permeten aquesta acció"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Vols ometre el tutorial de navegació?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Pots trobar-lo més tard a l\'aplicació <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel·la"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omet"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Utilitza 2 aplicacions alhora i canvia d\'aplicació amb la barra de tasques"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Ha aparegut el tauler educatiu de la barra de tasques"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"S\'ha tancat el tauler educatiu de la barra de tasques"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Següent"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Enrere"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tanca"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Fet"</string>
</resources>
diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml
index c4e632c..50b6049 100644
--- a/quickstep/res/values-cs/strings.xml
+++ b/quickstep/res/values-cs/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikace nebo organizace zakazuje tuto akci"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Přeskočit výukový program k navigaci?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Program později najdete v aplikaci <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Zrušit"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Přeskočit"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Používejte 2 aplikace naráz a přepínejte mezi aplikacemi pomocí hlavního panelu"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Zobrazila se výuka k hlavnímu panelu"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Výuka k hlavnímu panelu byla zavřena"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Další"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Zpět"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zavřít"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Hotovo"</string>
</resources>
diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml
index ed63f40..5e91710 100644
--- a/quickstep/res/values-da/strings.xml
+++ b/quickstep/res/values-da/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Indstillinger for systemnavigation"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Del"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller din organisation tillader ikke denne handling"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Vil du springe selvstudiet for navigation over?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Du kan finde dette senere i appen <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Annuller"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Spring over"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Brug to apps på samme tid, og skift mellem dem via proceslinjen"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Vejledningen om proceslinjen blev åbnet"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Vejledningen om proceslinjen blev lukket"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Næste"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Tilbage"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Luk"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Luk"</string>
</resources>
diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml
index 0ff759e..999a241 100644
--- a/quickstep/res/values-de/strings.xml
+++ b/quickstep/res/values-de/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Die App oder deine Organisation lässt diese Aktion nicht zu"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Navigationstutorial überspringen?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Du findest es später auch in der <xliff:g id="NAME">%1$s</xliff:g> App"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Abbrechen"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Überspringen"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Du kannst 2 Apps auf einmal verwenden und über die Taskleiste zwischen ihnen wechseln"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Anleitung für Taskleiste eingeblendet"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Anleitung für Taskleiste geschlossen"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Weiter"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Zurück"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Schließen"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Fertig"</string>
</resources>
diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml
index 1c5e24a..063d769 100644
--- a/quickstep/res/values-el/strings.xml
+++ b/quickstep/res/values-el/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Αυτή η ενέργεια δεν επιτρέπεται από την εφαρμογή ή τον οργανισμό σας."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Παράβλεψη"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Χρησιμοποιήστε 2 εφαρμογές ταυτόχρονα και κάντε εναλλαγή εφαρμογών με τη γραμμή εργασιών"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Η εκπαίδευση για τη γραμμή εργασιών εμφανίστηκε"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Η εκπαίδευση για τη γραμμή εργασιών έκλεισε"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Επόμενο"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Πίσω"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Κλείσιμο"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Τέλος"</string>
</resources>
diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml
index c045bcd..78d5bcc 100644
--- a/quickstep/res/values-en-rAU/strings.xml
+++ b/quickstep/res/values-en-rAU/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"System navigation settings"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Share"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Skip navigation tutorial?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"You can find this later in the <xliff:g id="NAME">%1$s</xliff:g> app"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Skip"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use two apps at once and switch apps with the taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
</resources>
diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml
index c045bcd..78d5bcc 100644
--- a/quickstep/res/values-en-rCA/strings.xml
+++ b/quickstep/res/values-en-rCA/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"System navigation settings"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Share"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Skip navigation tutorial?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"You can find this later in the <xliff:g id="NAME">%1$s</xliff:g> app"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Skip"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use two apps at once and switch apps with the taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
</resources>
diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml
index c045bcd..78d5bcc 100644
--- a/quickstep/res/values-en-rGB/strings.xml
+++ b/quickstep/res/values-en-rGB/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"System navigation settings"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Share"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Skip navigation tutorial?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"You can find this later in the <xliff:g id="NAME">%1$s</xliff:g> app"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Skip"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use two apps at once and switch apps with the taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
</resources>
diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml
index c045bcd..78d5bcc 100644
--- a/quickstep/res/values-en-rIN/strings.xml
+++ b/quickstep/res/values-en-rIN/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"System navigation settings"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Share"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Skip navigation tutorial?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"You can find this later in the <xliff:g id="NAME">%1$s</xliff:g> app"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Skip"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use two apps at once and switch apps with the taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
</resources>
diff --git a/quickstep/res/values-en-rXC/strings.xml b/quickstep/res/values-en-rXC/strings.xml
index 1550285..c0ce050 100644
--- a/quickstep/res/values-en-rXC/strings.xml
+++ b/quickstep/res/values-en-rXC/strings.xml
@@ -79,12 +79,17 @@
<string name="allset_navigation_settings" msgid="4713404605961476027">""<annotation id="link">"System navigation settings"</annotation>""</string>
<string name="action_share" msgid="2648470652637092375">"Share"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <string name="action_split" msgid="2098009717623550676">"Split"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organization"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Skip navigation tutorial?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"You can find this later in the <xliff:g id="NAME">%1$s</xliff:g> app"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancel"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Skip"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use 2 apps at once and switch apps with the taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
+ <string name="taskbar_edu_stashing" msgid="5212374387411764031">"Touch & hold to hide the taskbar"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Done"</string>
</resources>
diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml
index 02f6ea6..08a5f6b 100644
--- a/quickstep/res/values-es-rUS/strings.xml
+++ b/quickstep/res/values-es-rUS/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Configuración de navegación del sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Compartir"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Captura de pantalla"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"La app o tu organización no permiten realizar esta acción"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"¿Omitir el instructivo de navegación?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Puedes encontrarlo en la app de <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancelar"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omitir"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Usa 2 apps a la vez e intercámbialas con la barra de tareas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Se abrió la barra de herramientas Educación"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Se cerró la barra de herramientas Educación"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Siguiente"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atrás"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Cerrar"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Listo"</string>
</resources>
diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml
index b4fee8b..3c2a726 100644
--- a/quickstep/res/values-es/strings.xml
+++ b/quickstep/res/values-es/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Ajustes de navegación del sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Compartir"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Hacer captura"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"No puedes hacerlo porque la aplicación o tu organización no lo permiten"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"¿Saltar tutorial de navegación?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Puedes consultarlo en otro momento en la aplicación <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancelar"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Saltar"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Usa dos aplicaciones a la vez y cambia de aplicación con la barra de tareas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Ha aparecido una nota sobre la barra de tareas"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Nota sobre la barra de tareas cerrada"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Siguiente"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atrás"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Cerrar"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Hecho"</string>
</resources>
diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml
index 9f8737c..53d6660 100644
--- a/quickstep/res/values-et/strings.xml
+++ b/quickstep/res/values-et/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Rakendus või teie organisatsioon on selle toimingu keelanud"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Kas jätta navigeerimise õpetused vahele?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Leiate selle hiljem rakendusest <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Tühista"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Jäta vahele"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Tegumiribal kahe rakenduse korraga kasutamine ja rakenduste vahel vahetamine"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Tegumiriba juhised kuvati"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Tegumiriba juhised on suletud"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Järgmine"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Tagasi"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Sule"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Valmis"</string>
</resources>
diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml
index e4186a4..1627648 100644
--- a/quickstep/res/values-eu/strings.xml
+++ b/quickstep/res/values-eu/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sisteman nabigatzeko ezarpenak"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Partekatu"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Atera pantaila-argazki bat"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikazioak edo erakundeak ez du eman ekintza hori gauzatzeko baimena"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Nabigazio-tutoriala saltatu nahi duzu?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"<xliff:g id="NAME">%1$s</xliff:g> aplikazioan dago eskuragarri tutoriala"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Utzi"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Saltatu"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Erabili bi aplikazio aldi berean eta aldatu aplikazioz zereginen barra erabilita"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Agertu egin da zereginen barraren tutoriala"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Itxi egin da zereginen barraren tutoriala"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Hurrengoa"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atzera"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Itxi"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Eginda"</string>
</resources>
diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml
index 0a27952..a2be4fe 100644
--- a/quickstep/res/values-fa/strings.xml
+++ b/quickstep/res/values-fa/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"برنامه یا سازمان شما اجازه نمیدهد این کنش انجام شود."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"رد شدن"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"همزمان از ۲ برنامه استفاده کنید و ازطریق نوار وظیفه بین برنامهها جابهجا شوید"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"پانل آموزشی نوار وظیفه نمایان شد"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"پانل آموزشی نوار وظیفه بسته شد"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"بعدی"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"برگشت"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"بستن"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"تمام"</string>
</resources>
diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml
index fc19646..a158427 100644
--- a/quickstep/res/values-fi/strings.xml
+++ b/quickstep/res/values-fi/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Sovellus tai organisaatio ei salli tätä toimintoa"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Ohitetaanko navigointiohje?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Löydät tämän myöhemmin sovelluksesta: <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Peru"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ohita"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Voit käyttää kahta sovellusta samaan aikaan ja vaihtaa sovelluksesta toiseen tehtäväpalkin kautta"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Tehtäväpalkin ohje näkyvissä"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Tehtäväpalkin ohje suljettu"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Seuraava"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Takaisin"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Sulje"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Valmis"</string>
</resources>
diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml
index cb1eff6..be10674 100644
--- a/quickstep/res/values-fr-rCA/strings.xml
+++ b/quickstep/res/values-fr-rCA/strings.xml
@@ -79,15 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Paramètres de navigation du système"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Partager"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Capture d\'écran"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"L\'application ou votre organisation n\'autorise pas cette action"</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="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Annuler"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ignorer"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"La barre des tâches éducatives s\'est affichée"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"La barre des tâches éducatives est fermée"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"Suivant"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Retour"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"Fermer"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"OK"</string>
</resources>
diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml
index 67106b8..8a2bdcb 100644
--- a/quickstep/res/values-fr/strings.xml
+++ b/quickstep/res/values-fr/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Paramètres de navigation système"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Partager"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Capture d\'écran"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Cette action n\'est pas autorisée par l\'application ou par votre organisation"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Ignorer le tutoriel de navigation ?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Vous le retrouverez 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">"Passer"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Utilisez deux applis à la fois et changez d\'appli avec la barre des tâches"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Infos sur la barre des tâches affichées"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Infos sur la barre des tâches fermées"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Suivant"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Retour"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fermer"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"OK"</string>
</resources>
diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml
index 8600412..87d0967 100644
--- a/quickstep/res/values-gl/strings.xml
+++ b/quickstep/res/values-gl/strings.xml
@@ -79,12 +79,19 @@
<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>
<string name="action_screenshot" msgid="8171125848358142917">"Facer captura"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"A aplicación ou a túa organización non permite realizar esta acción"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Queres omitir o titorial de navegación?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Podes atopar isto máis tarde na aplicación <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancelar"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omitir"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Usa dúas aplicacións á vez e alterna unha coa outra mediante a barra de ferramentas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Panel de información de barra de tarefas aberto"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Panel de información de barra de tarefas pechado"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Seguinte"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atrás"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Pechar"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Feito"</string>
</resources>
diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml
index cf5e464..8e10f84 100644
--- a/quickstep/res/values-gu/strings.xml
+++ b/quickstep/res/values-gu/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ઍપ કે તમારી સંસ્થા દ્વારા આ ક્રિયા કરવાની મંજૂરી નથી"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"છોડો"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ટાસ્કબારનું શિક્ષણ આપતી પૅનલ દેખાય છે"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ટાસ્કબારનું શિક્ષણ આપતી પૅનલ બંધ થઈ છે"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"આગળ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"પાછળ"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"બંધ કરો"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"થઈ ગયું"</string>
</resources>
diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml
index 2c7a5ac..b7c2a13 100644
--- a/quickstep/res/values-hi/strings.xml
+++ b/quickstep/res/values-hi/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ऐप्लिकेशन या आपका संगठन इस कार्रवाई की अनुमति नहीं देता"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"अभी नहीं"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"एक साथ दो ऐप्लिकेशन इस्तेमाल करें और टास्कबार से एक से दूसरे ऐप्लिकेशन पर जाएं"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"टास्कबार ट्यूटोरियल दिखाया गया"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"टास्कबार ट्यूटोरियल बंद किया गया"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"आगे बढ़ें"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"वापस जाएं"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"बंद करें"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"हो गया"</string>
</resources>
diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml
index b8d4e4f..238cb15 100644
--- a/quickstep/res/values-hr/strings.xml
+++ b/quickstep/res/values-hr/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ili vaša organizacija ne dopuštaju ovu radnju"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Želite li preskočiti vodič za kretanje?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Kasnije ga možete pronaći u aplikaciji <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Odustani"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Preskoči"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Upotrebljavajte dvije aplikacije odjednom i prebacujte se između aplikacija i programske trake"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Upute za programsku traku su se pojavile"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Upute za programsku traku su zatvorene"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Dalje"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Natrag"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gotovo"</string>
</resources>
diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml
index 429b364..cebf4bd 100644
--- a/quickstep/res/values-hu/strings.xml
+++ b/quickstep/res/values-hu/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Rendszer-navigációs beállítások"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Megosztás"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Képernyőkép"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Az alkalmazás vagy az Ön szervezete nem engedélyezi ezt a műveletet"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Kihagyja a navigáció bemutatóját?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Ezt később megtalálhatja a(z) <xliff:g id="NAME">%1$s</xliff:g> alkalmazásban"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Mégse"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Kihagyás"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Két alkalmazást használhat egyszerre, és az eszköztárral válthat az alkalmazások között"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Az eszköztár használatát ismertető panel megjelent"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Az eszköztár használatát ismertető panel bezárult"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Tovább"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Vissza"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Bezárás"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Kész"</string>
</resources>
diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml
index 0a18ae9..36ebd65 100644
--- a/quickstep/res/values-hy/strings.xml
+++ b/quickstep/res/values-hy/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Այս գործողությունն արգելված է հավելվածի կամ ձեր կազմակերպության կողմից"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Բաց թողնել"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Միաժամանակ օգտագործեք 2 հավելված և խնդրագոտու միջոցով անցեք մեկից մյուսը։"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Խնդրագոտու «Կրթություն» վահանակը բացվեց"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Խնդրագոտու «Կրթություն» վահանակը փակվեց"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Առաջ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Հետ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Փակել"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Պատրաստ է"</string>
</resources>
diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml
index 8ef7355..463f686 100644
--- a/quickstep/res/values-in/strings.xml
+++ b/quickstep/res/values-in/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Setelan navigasi sistem"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Bagikan"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Tindakan ini tidak diizinkan oleh aplikasi atau organisasi Anda"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Lewati tutorial navigasi?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Anda dapat menemukan tutorial ini di lain waktu di aplikasi <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Batal"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Lewati"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Gunakan 2 aplikasi sekaligus dan beralihlah antar-aplikasi dengan taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Edukasi taskbar ditampilkan"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Edukasi taskbar ditutup"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Berikutnya"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Kembali"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tutup"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Selesai"</string>
</resources>
diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml
index 5bcc545..195fcf0 100644
--- a/quickstep/res/values-is/strings.xml
+++ b/quickstep/res/values-is/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Stillingar kerfisstjórnunar"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Deila"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Skjámynd"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Forritið eða fyrirtækið leyfir ekki þessa aðgerð"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Sleppa flettileiðsögn?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Þú getur fundið þetta síðar í forritinu <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Hætta við"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Sleppa"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Notaðu 2 forrit í einu og skiptu á milli forrita á verkefnastikunni"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Leiðsögn verkefnastiku sýnileg"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Leiðsögn verkefnastiku lokað"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Áfram"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Til baka"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Loka"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Lokið"</string>
</resources>
diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml
index 5633381..233f593 100644
--- a/quickstep/res/values-it/strings.xml
+++ b/quickstep/res/values-it/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Impostazioni Navigazione del sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Condividi"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Questa azione non è consentita dall\'app o dall\'organizzazione"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Saltare il tutorial di navigazione?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Puoi trovarlo in un secondo momento nell\'app <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Annulla"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Salta"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Usa 2 app contemporaneamente e passa dall\'una all\'altra tramite la barra delle applicazioni"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Riquadro Formazione barra delle applicazioni visualizzato"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Riquadro Formazione barra delle applicazioni chiuso"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Avanti"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Indietro"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Chiudi"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Fine"</string>
</resources>
diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml
index e687d88..a29ba7d 100644
--- a/quickstep/res/values-iw/strings.xml
+++ b/quickstep/res/values-iw/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"האפליקציה או הארגון שלך אינם מתירים את הפעולה הזאת"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"דילוג"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"חלונית ההסברים על שורת המשימות מופיעה"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"חלונית ההסברים על שורת המשימות נסגרה"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"הבא"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"חזרה"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"סגירה"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"סיום"</string>
</resources>
diff --git a/quickstep/res/values-ja/strings.xml b/quickstep/res/values-ja/strings.xml
index a0b25a9..e09b729 100644
--- a/quickstep/res/values-ja/strings.xml
+++ b/quickstep/res/values-ja/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"この操作はアプリまたは組織で許可されていません"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"スキップ"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"2 つのアプリを同時に使用し、タスクバーでアプリを切り替えます"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"タスクバーの説明を開きました"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"タスクバーの説明を閉じました"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"次へ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"戻る"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"閉じる"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"完了"</string>
</resources>
diff --git a/quickstep/res/values-ka/strings.xml b/quickstep/res/values-ka/strings.xml
index fec33cf..ac0498c 100644
--- a/quickstep/res/values-ka/strings.xml
+++ b/quickstep/res/values-ka/strings.xml
@@ -58,7 +58,7 @@
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="6993979358080825438">"გადაფურცლეთ ზემოთ."</string>
<string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"თქვენ შეასრულეთ მთავარ ეკრანზე დაბრუნების ჟესტი. ახლა კი შევიტყოთ, თუ როგორ დავბრუნდეთ უკან."</string>
<string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"თქვენ შეასრულეთ მთავარ ეკრანზე დაბრუნების ჟესტი."</string>
- <string name="home_gesture_intro_title" msgid="836590312858441830">"მთავარ გვერდზე გადასასვლელად გადაფურცლეთ"</string>
+ <string name="home_gesture_intro_title" msgid="836590312858441830">"მთავარი გვერდის სანახავად გადაფურცლეთ"</string>
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"გადაფურცლეთ ეკრანის ქვედა კიდიდან ზემოთ. ამ ჟესტს ყოველთვის მთავარი გვერდის ეკრანზე გადაყავხართ."</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"გადაფურცლეთ ეკრანის ქვედა კიდიდან ზემოთ."</string>
<string name="overview_gesture_feedback_home_detected" msgid="1411130969354020489">"უფრო ხანგრძლივად დააჭირეთ თითი ფანჯარას, რომ არ დაიხუროს."</string>
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ეს მოქმედება არ არის დაშვებული აპის ან თქვენი ორგანიზაციის მიერ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"გამოტოვება"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"გამოიყენეთ ერთდროულად 2 აპი და გადართეთ აპები ამოცანების ზოლის მეშვეობით"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ამოცანების ზოლის სასწავლო არე გამოჩნდა"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ამოცანების ზოლის სასწავლო არე დაიხურა"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"შემდეგი"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"უკან"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"დახურვა"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"მზადაა"</string>
</resources>
diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml
index dd337fc..11fad68 100644
--- a/quickstep/res/values-kk/strings.xml
+++ b/quickstep/res/values-kk/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Бұл әрекетке қолданба не ұйым рұқсат етпейді."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Өткізіп жіберу"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"2 қолданбаны қатар қолданыңыз және оларды тапсырмалар тақтасы арқылы ауыстырыңыз."</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Тапсырмалар тақтасы бойынша нұсқаулық ашылды."</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Тапсырмалар тақтасы бойынша нұсқаулық жабылды."</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Келесі"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Артқа"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Жабу"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Дайын"</string>
</resources>
diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml
index 9f90d06..aecce96 100644
--- a/quickstep/res/values-km/strings.xml
+++ b/quickstep/res/values-km/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"សកម្មភាពនេះមិនត្រូវបានអនុញ្ញាតដោយកម្មវិធី ឬស្ថាប័នរបស់អ្នកទេ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"រំលង"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ប្រើកម្មវិធី 2 ក្នុងពេលតែមួយ ហើយប្ដូរកម្មវិធីដោយប្រើរបារកិច្ចការ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ការបង្រៀនអំពីរបារកិច្ចការបានបង្ហាញ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ការបង្រៀនអំពីរបារកិច្ចការត្រូវបានបិទ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"បន្ទាប់"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ថយក្រោយ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"បិទ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"រួចរាល់"</string>
</resources>
diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml
index 1a83864..f5aa9d3 100644
--- a/quickstep/res/values-kn/strings.xml
+++ b/quickstep/res/values-kn/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ಆ್ಯಪ್ ಅಥವಾ ನಿಮ್ಮ ಸಂಸ್ಥೆಯು ಈ ಕ್ರಿಯೆಯನ್ನು ಅನುಮತಿಸುವುದಿಲ್ಲ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ಸ್ಕಿಪ್ ಮಾಡಿ"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ಟಾಸ್ಕ್ಬಾರ್ ಶಿಕ್ಷಣ ಕಾಣಿಸಿಕೊಂಡಿದೆ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ಟಾಸ್ಕ್ಬಾರ್ ಶಿಕ್ಷಣ ಮುಚ್ಚಿದೆ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"ಮುಂದೆ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ಹಿಂದೆ"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"ಮುಚ್ಚಿರಿ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ಮುಗಿದಿದೆ"</string>
</resources>
diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml
index e5341f4..aa76e8a 100644
--- a/quickstep/res/values-ko/strings.xml
+++ b/quickstep/res/values-ko/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"이 작업은 앱 또는 조직에서 허용되지 않습니다."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"건너뛰기"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"작업 표시줄을 통해 앱 2개를 동시에 사용하고 앱 간에 전환"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"작업 표시줄 튜토리얼 패널 표시됨"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"작업 표시줄 튜토리얼 패널 닫힘"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"다음"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"뒤로"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"닫기"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"완료"</string>
</resources>
diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml
index b2e2ec2..540e255 100644
--- a/quickstep/res/values-ky/strings.xml
+++ b/quickstep/res/values-ky/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Бул аракетти аткарууга колдонмо же ишканаңыз тыюу салган"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Өткрп жиберүү"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Бир убакта 2 колдонмону пайдаланып, колдонмолорду тапшырмалар тактасы аркылуу которуштуруу"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Тапшырмалар тактасынын окутуу панели көрсөтүлдү"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Тапшырмалар тактасынын окутуу панели жабылды"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Кийинки"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Артка"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Жабуу"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Бүттү"</string>
</resources>
diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml
index 699cafa..b9d3c42 100644
--- a/quickstep/res/values-lo/strings.xml
+++ b/quickstep/res/values-lo/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ແອັບ ຫຼື ອົງການຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ໃຊ້ຄຳສັ່ງນີ້"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ຂ້າມ"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ໃຊ້ 2 ແອັບພ້ອມກັບ ແລະ ສະຫຼັບແອັບດ້ວຍແຖບໜ້າວຽກ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ສະແດງການສຶກສາແຖບໜ້າວຽກແລ້ວ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ປິດການສຶກສາແຖບໜ້າວຽກແລ້ວ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"ຕໍ່ໄປ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ກັບຄືນ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ປິດ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ແລ້ວໆ"</string>
</resources>
diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml
index f8c7bc7..7a4fddc 100644
--- a/quickstep/res/values-lt/strings.xml
+++ b/quickstep/res/values-lt/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sistemos naršymo nustatymai"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Bendrinti"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Ekrano kopija"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Jūsų organizacijoje arba naudojant šią programą neleidžiama atlikti šio veiksmo"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Praleisti naršymo mokymo programą?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Tai galėsite rasti vėliau programoje „<xliff:g id="NAME">%1$s</xliff:g>“"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Atšaukti"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Praleisti"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Užduočių juostoje vienu metu naudokite dvi programas ir jas perjunkite"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Užduočių juostos patarimai rodomi"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Užduočių juostos patarimai uždaryti"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Kitas"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atgal"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Uždaryti"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Atlikta"</string>
</resources>
diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml
index 0e44d77..ee6009c 100644
--- a/quickstep/res/values-lv/strings.xml
+++ b/quickstep/res/values-lv/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sistēmas navigācijas iestatījumi"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Kopīgot"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Veikt ekrānuzņēmumu"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Lietotne vai jūsu organizācija neatļauj veikt šo darbību."</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Vai izlaist navigācijas mācības?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Varēsiet to vēlāk atrast lietotnē <xliff:g id="NAME">%1$s</xliff:g>."</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Atcelt"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Izlaist"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Varat izmantot divas lietotnes reizē un pāriet no vienas uz otru, izmantojot rīkjoslu"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Tika atvērta uzdevumjoslas apmācība"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Tika aizvērta uzdevumjoslas apmācība"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Tālāk"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Atpakaļ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Aizvērt"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gatavs"</string>
</resources>
diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml
index b3e08f5..ef03fa5 100644
--- a/quickstep/res/values-mk/strings.xml
+++ b/quickstep/res/values-mk/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Апликацијата или вашата организација не го дозволува дејствово"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Прескокни"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Користете 2 апликации одеднаш и префрлувајте се меѓу нив со лентата за задачи"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Се појави лентата за задачи за образование"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Затворена е лентата за задачи за образование"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Следна"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Затвори"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
</resources>
diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml
index 9291259..a0484f4 100644
--- a/quickstep/res/values-ml/strings.xml
+++ b/quickstep/res/values-ml/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ഈ നടപടി എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ഒഴിവാക്കുക"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ടാസ്ക്ബാറിന്റെ സഹായത്തോടെ ഒരേ സമയം 2 ആപ്പുകൾ ഉപയോഗിക്കുകയും ആപ്പുകൾ പരസ്പരം മാറുകയും ചെയ്യൂ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ടാസ്ക്ക്ബാർ വിവര പാനൽ ദൃശ്യമായി"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ടാസ്ക്ക്ബാർ വിവര പാനൽ അടച്ചു"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"അടുത്തത്"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"മടങ്ങുക"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"അടയ്ക്കുക"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"പൂർത്തിയായി"</string>
</resources>
diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml
index 65023d6..3500a98 100644
--- a/quickstep/res/values-mn/strings.xml
+++ b/quickstep/res/values-mn/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Энэ үйлдлийг апп эсвэл танай байгууллага зөвшөөрдөггүй"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Алгасах"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"2 аппыг нэг дор ашиглан талбарын тусламжтайгаар аппуудыг сэлгэнэ үү"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Боловсролын ажлын талбар гарч ирсэн"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Боловсролын ажлын талбарыг хаасан"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Дараах"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Буцах"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Хаах"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Дууссан"</string>
</resources>
diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml
index 40c88a4..81342a1 100644
--- a/quickstep/res/values-mr/strings.xml
+++ b/quickstep/res/values-mr/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"अॅप किंवा तुमच्या संस्थेद्वारे ही क्रिया करण्याची अनुमती नाही"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"वगळा"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"टास्कबारशी संबंधित माहिती देणारे पॅनल उघडले आहे"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"टास्कबारशी संबंधित माहिती देणारे पॅनल बंद केले आहे"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"पुढे"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"मागे जा"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"बंद करा"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"पूर्ण झाले"</string>
</resources>
diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml
index 886f3b6..154b966 100644
--- a/quickstep/res/values-ms/strings.xml
+++ b/quickstep/res/values-ms/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Tetapan navigasi sistem"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Kongsi"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Tangkapan skrin"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Tindakan ini tidak dibenarkan oleh apl atau organisasi anda"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Langkau tutorial navigasi?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Anda boleh mendapatkan tutorial ini kemudian dalam apl <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Batal"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Langkau"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Gunakan 2 apl pada satu masa dan tukar apl dengan bar tugas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Pendidikan bar tugas muncul"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Pendidikan bar tugas ditutup"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Seterusnya"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Kembali"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Tutup"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Selesai"</string>
</resources>
diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml
index 0d38c84..bf9ab62 100644
--- a/quickstep/res/values-my/strings.xml
+++ b/quickstep/res/values-my/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ဤလုပ်ဆောင်ချက်ကို အက်ပ် သို့မဟုတ် သင်၏အဖွဲ့အစည်းက ခွင့်မပြုပါ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ကျော်ရန်"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"အက်ပ် ၂ ခုကို တစ်ပြိုင်ထဲသုံးပြီး လုပ်ဆောင်စရာဘားဖြင့် အက်ပ်များပြောင်းလိုက်ပါ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ပညာရေး လုပ်ဆောင်စရာဘား ပြထားသည်"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ပညာရေး လုပ်ဆောင်စရာဘား ပိတ်ထားသည်"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"ရှေ့သို့"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"နောက်သို့"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ပိတ်ရန်"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ပြီးပြီ"</string>
</resources>
diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml
index 8ad72cd..4b1f8d0 100644
--- a/quickstep/res/values-nb/strings.xml
+++ b/quickstep/res/values-nb/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller organisasjonen din tillater ikke denne handlingen"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Vil du hoppe over navigeringsveiledning?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Du kan finne dette i <xliff:g id="NAME">%1$s</xliff:g>-appen senere"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Avbryt"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Hopp over"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Bruk to apper samtidig og bytt app med oppgavelinjen"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Opplæringen for oppgavelinjen vises"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Opplæringen for oppgavelinjen er lukket"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Neste"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Tilbake"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Lukk"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Ferdig"</string>
</resources>
diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml
index 89ef427..126e074 100644
--- a/quickstep/res/values-ne/strings.xml
+++ b/quickstep/res/values-ne/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"यो एप वा तपाईंको सङ्गठनले यो कारबाही गर्ने अनुमति दिँदैन"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"स्किप गर्नु…"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"टास्कबार एजुकेसन देखिएको छ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"टास्कबार एजुकेसन बन्द गरिएको छ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"अर्को"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"पछाडि"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"बन्द गर्नुहोस्"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"सम्पन्न भयो"</string>
</resources>
diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml
index faed85b..cfc0454 100644
--- a/quickstep/res/values-nl/strings.xml
+++ b/quickstep/res/values-nl/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Navigatie-instellingen van systeem"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Delen"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Deze actie wordt niet toegestaan door de app of je organisatie"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Navigatietutorial overslaan?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Je vindt dit later terug in de app <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Annuleren"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Overslaan"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Gebruik 2 apps tegelijk en schakel tussen apps via de taakbalk"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Uitleg van taakbalk geopend"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Uitleg van taakbalk gesloten"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Volgende"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Terug"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Sluiten"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Klaar"</string>
</resources>
diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml
index b6281c3..bbf610b 100644
--- a/quickstep/res/values-or/strings.xml
+++ b/quickstep/res/values-or/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ଆପ୍ କିମ୍ବା ଆପଣଙ୍କ ସଂସ୍ଥା ଦ୍ୱାରା ଏହି କାର୍ଯ୍ୟକୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ବାଦ୍ ଦିଅନ୍ତୁ"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ଟାସ୍କବାର୍ ଶିକ୍ଷା ଦେଖାଯାଇଛି"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ଟାସ୍କବାର୍ ଶିକ୍ଷା ବନ୍ଦ ହୋଇଯାଇଛି"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"ପରବର୍ତ୍ତୀ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ପଛକୁ ଫେରନ୍ତୁ"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"ବନ୍ଦ କରନ୍ତୁ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ହୋଇଗଲା"</string>
</resources>
diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml
index bdfc867..d7068de 100644
--- a/quickstep/res/values-pa/strings.xml
+++ b/quickstep/res/values-pa/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ਐਪ ਜਾਂ ਤੁਹਾਡੀ ਸੰਸਥਾ ਵੱਲੋਂ ਇਸ ਕਾਰਵਾਈ ਦੀ ਇਜਾਜ਼ਤ ਨਹੀਂ ਹੈ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ਛੱਡੋ"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ਟਾਸਕਵਾਰ ਸਿੱਖਿਆ ਪੈਨਲ ਦਿਖਾਇਆ ਗਿਆ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ਟਾਸਕਵਾਰ ਸਿੱਖਿਆ ਪੈਨਲ ਬੰਦ ਕੀਤਾ ਗਿਆ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"ਅੱਗੇ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ਪਿੱਛੇ"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"ਬੰਦ ਕਰੋ"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ਹੋ ਗਿਆ"</string>
</resources>
diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml
index 57c9e4c..f054a3c 100644
--- a/quickstep/res/values-pl/strings.xml
+++ b/quickstep/res/values-pl/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Nie możesz wykonać tego działania, bo nie zezwala na to aplikacja lub Twoja organizacja"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Pominąć samouczek nawigacji?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Znajdziesz to później w aplikacji <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Anuluj"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Pomiń"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Używaj 2 aplikacji jednocześnie i przełączaj je za pomocą paska zadań"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Wskazówki na temat paska zadań zostały wyświetlone"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Wskazówki na temat paska zadań zostały zamknięte"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Dalej"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Wstecz"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zamknij"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gotowe"</string>
</resources>
diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml
index 40bb8a1..269efcb 100644
--- a/quickstep/res/values-pt-rPT/strings.xml
+++ b/quickstep/res/values-pt-rPT/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Definições de navegação do sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Partilhar"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Fazer captura de ecrã"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Esta ação não é permitida pela app ou a sua entidade."</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Ignorar o tutorial de navegação?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Pode encontrar isto mais tarde na app <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancelar"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ignorar"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Utilize 2 apps em simultâneo e alterne entre as apps com a barra de tarefas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Informação da barra de tarefas apresentada"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Informação da barra de tarefas fechada"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Seguinte"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Anterior"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fechar"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Concluir"</string>
</resources>
diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml
index 144bbf6..704eec4 100644
--- a/quickstep/res/values-pt/strings.xml
+++ b/quickstep/res/values-pt/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Configurações de navegação do sistema"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Compartilhar"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Capturar tela"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Essa ação não é permitida pelo app ou pela organização"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Pular o tutorial de navegação?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Veja o tutorial mais tarde no app <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Cancelar"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Pular"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Use dois apps ao mesmo tempo e alterne entre eles usando a barra de tarefas"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"As dicas sobre a barra de tarefas foram abertas"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"As dicas sobre a barra de tarefas foram fechadas"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Próxima"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Voltar"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fechar"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Concluído"</string>
</resources>
diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml
index 2231522..6dca9e4 100644
--- a/quickstep/res/values-ro/strings.xml
+++ b/quickstep/res/values-ro/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Setările de navigare ale sistemului"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Distribuiți"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Captură de ecran"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Această acțiune nu este permisă de aplicație sau de organizația dvs."</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Omiteți tutorialul de navigare?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Îl puteți găsi mai târziu în aplicația <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Anulați"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omiteți"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Folosiți două aplicații simultan și comutați între aplicații folosind bara de activități"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Panoul cu informații despre bara de activități s-a afișat"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Panoul cu informații despre bara de activități s-a închis"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Înainte"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Înapoi"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Închideți"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Gata"</string>
</resources>
diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml
index 9087da9..8963394 100644
--- a/quickstep/res/values-ru/strings.xml
+++ b/quickstep/res/values-ru/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Это действие заблокировано приложением или организацией."</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Пропустить"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Пользуйтесь двумя приложениями одновременно и переключайтесь между ними с помощью панели задач"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Обучение по работе с панелью задач показано"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Обучение по работе с панелью задач скрыто"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Далее"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрыть"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
</resources>
diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml
index b3d88c0..1182153 100644
--- a/quickstep/res/values-si/strings.xml
+++ b/quickstep/res/values-si/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"මෙම ක්රියාව යෙදුම හෝ ඔබේ සංවිධානය මගින් ඉඩ නොදේ"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"මඟ හරින්න"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"එකවර යෙදුම් 2ක් භාවිත කර කාර්ය තීරුව සමඟින් යෙදුම් මාරු කරන්න"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"කාර්ය තීරු අධ්යාපනය දිස් විය"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"කාර්ය තීරු අධ්යාපනය වසා ඇත"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"ඊළඟ"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"ආපසු"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"වසන්න"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"නිමයි"</string>
</resources>
diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml
index 0b0082c..2cd414b 100644
--- a/quickstep/res/values-sk/strings.xml
+++ b/quickstep/res/values-sk/strings.xml
@@ -79,12 +79,19 @@
<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>
<string name="action_screenshot" msgid="8171125848358142917">"Snímka obrazovky"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikácia alebo vaša organizácia túto akciu nepovoľuje"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Chcete preskočiť návod na navigáciu?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Tento návod nájdete v aplikácii <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Zrušiť"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Preskočiť"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Používajte dve aplikácie naraz a prepínajte ich pomocou panela úloh"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Zobrazila sa výuka k hlavnému panelu"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Výuka k hlavnému panelu bola zatvorená"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Ďalej"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Späť"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zavrieť"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Hotovo"</string>
</resources>
diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml
index a2b1363..5edc2bb 100644
--- a/quickstep/res/values-sl/strings.xml
+++ b/quickstep/res/values-sl/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Nastavitve krmarjenja po sistemu"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Deli"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Posnetek zaslona"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikacija ali vaša organizacija ne dovoljuje tega dejanja"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Želite preskočiti vadnico za krmarjenje?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"To lahko pozneje najdete v aplikaciji <xliff:g id="NAME">%1$s</xliff:g>."</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Prekliči"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Preskoči"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Sočasno uporabite dve aplikaciji in preklopite med njima z orodno vrstico."</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Poučni nasveti o opravilni vrstici so prikazani."</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Poučni nasveti o opravilni vrstici so zaprti."</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Naprej"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Nazaj"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zapri"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Končano"</string>
</resources>
diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml
index f259f3c..2b36b5c 100644
--- a/quickstep/res/values-sq/strings.xml
+++ b/quickstep/res/values-sq/strings.xml
@@ -79,15 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Cilësimet e navigimit të sistemit"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Ndaj"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Pamja e ekranit"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Ky veprim nuk lejohet nga aplikacioni ose organizata jote"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Të kapërcehet udhëzuesi i navigimit?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Këtë mund ta gjesh më vonë tek aplikacioni <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Anulo"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Kapërce"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Edukimi i shiritit të detyrave u shfaq"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Edukimi nga shiriti i detyrave u mbyll"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"Para"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Pas"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"Mbyll"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"U krye"</string>
</resources>
diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml
index 0d6d4d6..3289011 100644
--- a/quickstep/res/values-sr/strings.xml
+++ b/quickstep/res/values-sr/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Апликација или организација не дозвољавају ову радњу"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Прескочи"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Користите 2 апликације одједном и мењајте апликације помоћу траке задатака"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Едукативно окно из траке задатака се појавило"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Едукативно окно из траке задатака је затворено"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Даље"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Затвори"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
</resources>
diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml
index acb8014..4e3e7ac 100644
--- a/quickstep/res/values-sv/strings.xml
+++ b/quickstep/res/values-sv/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Appen eller organisationen tillåter inte den här åtgärden"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Vill du hoppa över självstudierna?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Du hittar det här igen i <xliff:g id="NAME">%1$s</xliff:g>-appen"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Avbryt"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Hoppa över"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Använd två appar samtidigt och byt mellan appar via aktivitetsfältet"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Information om aktivitetsfältet visades"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Information om aktivitetsfältet stängdes"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Nästa"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Tillbaka"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Stäng"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Klar"</string>
</resources>
diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml
index f49ef9b..e933755 100644
--- a/quickstep/res/values-sw/strings.xml
+++ b/quickstep/res/values-sw/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Mipangilio ya usogezaji kwenye mfumo"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Shiriki"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Picha ya skrini"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Kitendo hiki hakiruhusiwi na programu au shirika lako"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Ungependa kuruka mafunzo ya usogezaji?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Utapata mafunzo haya baadaye katika programu ya <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Ghairi"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Ruka"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Tumia programu mbili kwa wakati mmoja na ubadilishe programu ukitumia upau wa shughuli"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Paneli ya elimu kwenye upau wa shughuli inaonyeshwa"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Paneli ya elimu kwenye upau wa shughuli imefungwa"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Endelea"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Nyuma"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Funga"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Imemaliza"</string>
</resources>
diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml
index 321555f..4551e2b 100644
--- a/quickstep/res/values-ta/strings.xml
+++ b/quickstep/res/values-ta/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ஆப்ஸோ உங்கள் நிறுவனமோ இந்த செயலை அனுமதிப்பதில்லை"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"தவிர்"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ஒரே நேரத்தில் 2 ஆப்ஸைப் பயன்படுத்தலாம், பணிப்பட்டி மூலம் ஆப்ஸுக்கிடையே மாறலாம்"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"பணிப்பட்டியை எவ்வாறு பயன்படுத்துவது என்பது பற்றிய பலகம் காட்டப்படுகிறது"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"பணிப்பட்டியை எவ்வாறு பயன்படுத்துவது என்பது பற்றிய பலகம் மூடப்பட்டது"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"அடுத்து"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"பின்செல்"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"மூடுக"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"முடிந்தது"</string>
</resources>
diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml
index b8f3b04..b7cb7af 100644
--- a/quickstep/res/values-te/strings.xml
+++ b/quickstep/res/values-te/strings.xml
@@ -79,15 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ఈ చర్యను యాప్ గానీ, మీ సంస్థ గానీ అనుమతించవు"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"స్కిప్ చేయి"</string>
- <!-- no translation found for taskbar_edu_header_1 (5323217563328273689) -->
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"టాస్క్బార్ శిక్షణకు సంబంధించిన ప్యానెల్ కనిపించింది"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"టాస్క్బార్ శిక్షణకు సంబంధించిన ప్యానెల్ మూసివేయబడింది"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
<skip />
- <!-- no translation found for taskbar_edu_next (4007618274426775841) -->
- <skip />
- <!-- no translation found for taskbar_edu_close (887022990168191073) -->
- <skip />
+ <string name="taskbar_edu_next" msgid="4007618274426775841">"తర్వాత"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"వెనుకకు"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"మూసివేయండి"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"పూర్తయింది"</string>
</resources>
diff --git a/quickstep/res/values-th/strings.xml b/quickstep/res/values-th/strings.xml
index 6839fef..4205a62 100644
--- a/quickstep/res/values-th/strings.xml
+++ b/quickstep/res/values-th/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"แอปหรือองค์กรของคุณไม่อนุญาตการดำเนินการนี้"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ข้าม"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ใช้แอป 2 แอปพร้อมกันและสลับแอปด้วยแถบงาน"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"แถบงาน Education ปรากฎขึ้น"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ปิดแถบงาน Education แล้ว"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"ถัดไป"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"กลับ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ปิด"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"เสร็จ"</string>
</resources>
diff --git a/quickstep/res/values-tl/strings.xml b/quickstep/res/values-tl/strings.xml
index a7a0d81..86787a8 100644
--- a/quickstep/res/values-tl/strings.xml
+++ b/quickstep/res/values-tl/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Mga setting ng navigation ng system"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Ibahagi"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Hindi pinapayagan ng app o ng iyong organisasyon ang pagkilos na ito"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Laktawan ang tutorial sa pag-navigate?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Makikita mo ito sa <xliff:g id="NAME">%1$s</xliff:g> app sa ibang pagkakataon"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Kanselahin"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Laktawan"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Gumamit ng 2 app nang sabay at magpalipat-lipat ng app gamit ang taskbar"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Lumabas ang edukasyon sa taskbar"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Sarado ang edukasyon sa taskbar"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Susunod"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Bumalik"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Isara"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Tapos na"</string>
</resources>
diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml
index 7ea58a0..9f51423 100644
--- a/quickstep/res/values-tr/strings.xml
+++ b/quickstep/res/values-tr/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Sistem gezinme ayarları"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Paylaş"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Ekran görüntüsü"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Uygulamanız veya kuruluşunuz bu işleme izin vermiyor"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Gezinme eğitimi atlansın mı?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Bunu daha sonra <xliff:g id="NAME">%1$s</xliff:g> uygulamasında bulabilirsiniz"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"İptal"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Atla"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"2 uygulamayı aynı anda kullanıp görev çubuğuyla uygulamalar arasında geçiş yapın"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Görev çubuğu eğitimi görüntülendi"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Görev çubuğu eğitimi kapatıldı"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"İleri"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Geri"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Kapat"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Bitti"</string>
</resources>
diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml
index 4127b75..12119de 100644
--- a/quickstep/res/values-uk/strings.xml
+++ b/quickstep/res/values-uk/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Ця дія заборонена додатком або адміністратором організації"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Пропустити"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Користуйтеся двома додатками одночасно й перемикайтеся між ними за допомогою панелі завдань"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Панель завдань Education відкрито"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Панель завдань Education закрито"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Далі"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Назад"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Закрити"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Готово"</string>
</resources>
diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml
index 0af4328..0a62055 100644
--- a/quickstep/res/values-ur/strings.xml
+++ b/quickstep/res/values-ur/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"ایپ یا آپ کی تنظیم کی جانب سے اس کارروائی کی اجازت نہیں ہے"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"نظر انداز کریں"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"ایک وقت میں 2 ایپس استعمال کریں اور ٹاسک بار کے ساتھ ایپس پر سوئچ کریں"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"ٹاکس بار کا تعلیمی پینل ظاہر ہو گیا"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"ٹاسک بار کا تعلیمی پینل بند ہو گیا"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"آگے"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"پیچھے"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"بند کریں"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"ہو گیا"</string>
</resources>
diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml
index c77a6c7..dcd413f 100644
--- a/quickstep/res/values-uz/strings.xml
+++ b/quickstep/res/values-uz/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Tizim navigatsiya sozlamalari"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Ulashish"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Skrinshot"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Bu amal ilova yoki tashkilotingiz tomonidan taqiqlangan"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Navigatsiya darsi yopilsinmi?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Bu darslar <xliff:g id="NAME">%1$s</xliff:g> ilovasida chiqadi"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Bekor qilish"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Tashlab ketish"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Vazifalar panelidan almashtirish uchun birdaniga 2 ta ilovadan foydalanish"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Taʼlim vazifalar paneli chiqdi"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Taʼlim vazifalar paneli yopildi"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Keyingisi"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Orqaga"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Yopish"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Tayyor"</string>
</resources>
diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml
index 0261368..304fe7c 100644
--- a/quickstep/res/values-vi/strings.xml
+++ b/quickstep/res/values-vi/strings.xml
@@ -79,12 +79,19 @@
<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="action_share" msgid="2648470652637092375">"Chia sẻ"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Chụp ảnh màn hình"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<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>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Bỏ qua phần hướng dẫn thao tác?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Bạn có thể tìm lại phần hướng dẫn này trong ứng dụng <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Hủy"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Bỏ qua"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Dùng 2 ứng dụng một lúc và chuyển đổi ứng dụng thông qua thanh tác vụ"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Đã hiện bảng hướng dẫn trên thanh tác vụ"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Đã đóng bảng hướng dẫn trên thanh tác vụ"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Tiếp theo"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Quay lại"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Đóng"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Xong"</string>
</resources>
diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml
index 8d97e7a..eb4ae78 100644
--- a/quickstep/res/values-zh-rCN/strings.xml
+++ b/quickstep/res/values-zh-rCN/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"该应用或您所在的单位不允许执行此操作"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"跳过"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"借助任务栏,您可以同时使用 2 个应用,并可以在应用之间切换"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"任务栏教程已显示"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"任务栏教程已关闭"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"继续"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"返回"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"关闭"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
</resources>
diff --git a/quickstep/res/values-zh-rHK/strings.xml b/quickstep/res/values-zh-rHK/strings.xml
index d3cc14c..4a0d146 100644
--- a/quickstep/res/values-zh-rHK/strings.xml
+++ b/quickstep/res/values-zh-rHK/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"應用程式或您的機構不允許此操作"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"略過"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"同時使用 2 個應用程式,以及使用工作列切換應用程式"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"顯示咗工作列教學"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"閂咗工作列教學"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"繼續"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"返回"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"關閉"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
</resources>
diff --git a/quickstep/res/values-zh-rTW/strings.xml b/quickstep/res/values-zh-rTW/strings.xml
index 382f725..f73d533 100644
--- a/quickstep/res/values-zh-rTW/strings.xml
+++ b/quickstep/res/values-zh-rTW/strings.xml
@@ -79,12 +79,19 @@
<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>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"這個應用程式或貴機構不允許執行這個動作"</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>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"略過"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"你可以同時使用 2 個應用程式,只要透過工作列即可切換"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"工作列教學課程已顯示"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"工作列教學課程已關閉"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"繼續"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"返回"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"關閉"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
</resources>
diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml
index 1232a82..076712a 100644
--- a/quickstep/res/values-zu/strings.xml
+++ b/quickstep/res/values-zu/strings.xml
@@ -79,12 +79,19 @@
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Amasethingi wokuzulazula isistimu"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Yabelana"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Isithombe-skrini"</string>
+ <!-- no translation found for action_split (2098009717623550676) -->
+ <skip />
<string name="blocked_by_policy" msgid="2071401072261365546">"Lesi senzo asivunyelwanga uhlelo lokusebenza noma inhlangano yakho"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Yeqa isifundo sokuzulazula?"</string>
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Lokhu ungakuthola kamuva ku-app ye-<xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Khansela"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Yeqa"</string>
- <string name="taskbar_edu_header_1" msgid="5323217563328273689">"Sebenzisa ama-app ama-2 ngesikhathi esisodwa bese ushintsha ama-app ngebha yomsebenzi"</string>
+ <string name="taskbar_edu_opened" msgid="3950252793551919129">"Imfuno yebha yomsebenzi ivelile"</string>
+ <string name="taskbar_edu_closed" msgid="126643734478892862">"Imfundo yebha yomsebenzi ivaliwe"</string>
+ <!-- no translation found for taskbar_edu_stashing (5212374387411764031) -->
+ <skip />
<string name="taskbar_edu_next" msgid="4007618274426775841">"Okulandelayo"</string>
+ <string name="taskbar_edu_previous" msgid="459202320127201702">"Emuva"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Vala"</string>
+ <string name="taskbar_edu_done" msgid="6880178093977704569">"Kwenziwe"</string>
</resources>
diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml
index d67b23b..31c0f5f 100644
--- a/quickstep/res/values/config.xml
+++ b/quickstep/res/values/config.xml
@@ -30,6 +30,7 @@
determines how many thumbnails will be fetched in the background. -->
<integer name="recentsThumbnailCacheSize">3</integer>
<integer name="recentsIconCacheSize">12</integer>
+ <integer name="recentsScrollHapticMinGapMillis">20</integer>
<!-- Assistant Gesture -->
<integer name="assistant_gesture_min_time_threshold">200</integer>
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 1ec5bb8..c649082 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -157,12 +157,14 @@
<dimen name="accessibility_gesture_min_swipe_distance">80dp</dimen>
<!-- Taskbar -->
- <dimen name="taskbar_size">60dp</dimen>
+ <dimen name="taskbar_size">@*android:dimen/taskbar_frame_height</dimen>
<dimen name="taskbar_icon_touch_size">48dp</dimen>
<dimen name="taskbar_icon_drag_icon_size">54dp</dimen>
<dimen name="taskbar_folder_margin">16dp</dimen>
<dimen name="taskbar_nav_buttons_spacing">16dp</dimen>
<dimen name="taskbar_nav_buttons_size">48dp</dimen>
+ <dimen name="taskbar_contextual_button_margin">16dp</dimen>
+ <dimen name="taskbar_contextual_buttons_size">35dp</dimen>
<dimen name="taskbar_stashed_size">24dp</dimen>
<dimen name="taskbar_stashed_handle_width">220dp</dimen>
<dimen name="taskbar_stashed_handle_height">6dp</dimen>
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index a7ec2ea..7158287 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -211,15 +211,15 @@
<string name="taskbar_edu_opened">Taskbar education appeared</string>
<!-- Accessibility text spoken when the taskbar education panel disappears [CHAR_LIMIT=NONE] -->
<string name="taskbar_edu_closed">Taskbar education closed</string>
- <!-- Text in dialog that lets a user know how they can use the taskbar to use multiple apps on their device.
+ <!-- Text in dialog that lets a user know how they can use the taskbar to switch apps on their device.
[CHAR_LIMIT=60] -->
- <string name="taskbar_edu_splitscreen" translatable="false">Use 2 apps at once and switch apps with the taskbar</string>
- <!-- Text in dialog that lets a user know how they can customize the taskbar on their device.
+ <string name="taskbar_edu_switch_apps" translatable="false">Use the taskbar to switch apps</string>
+ <!-- Text in dialog that lets a user know how they can use the taskbar to use multiple apps at once on their device.
[CHAR_LIMIT=60] -->
- <string name="taskbar_edu_customize" translatable="false">Add your favorite apps and get automatic suggestions</string>
+ <string name="taskbar_edu_splitscreen" translatable="false">Drag to the side to use two apps at once</string>
<!-- Text in dialog that lets a user know how they can hide the taskbar on their device.
[CHAR_LIMIT=60] -->
- <string name="taskbar_edu_dock">Touch & hold to hide the taskbar anytime</string>
+ <string name="taskbar_edu_stashing">Touch & hold to hide the taskbar</string>
<!-- Text on button to go to the next screen of a tutorial [CHAR_LIMIT=16] -->
<string name="taskbar_edu_next">Next</string>
<!-- Text on button to go to the previous screen of a tutorial [CHAR_LIMIT=16] -->
diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml
index ac70279..b5444b5 100644
--- a/quickstep/res/values/styles.xml
+++ b/quickstep/res/values/styles.xml
@@ -135,6 +135,13 @@
<item name="android:textAllCaps">false</item>
</style>
+ <style name="OverviewClearAllButton" parent="@android:style/Widget.DeviceDefault.Button">
+ <item name="android:background">@drawable/bg_overview_clear_all_button</item>
+ <item name="android:minWidth">85dp</item>
+ <item name="android:minHeight">36dp</item>
+ <item name="android:stateListAnimator">@null</item>
+ </style>
+
<!-- Icon displayed on the taskbar -->
<style name="BaseIcon.Workspace.Taskbar" >
<item name="iconDisplay">taskbar</item>
@@ -153,4 +160,14 @@
<item name="android:textSize">16sp</item>
<item name="android:padding">4dp</item>
</style>
+
+ <style name="TextAppearance.TaskbarEdu.Title"
+ parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle" >
+ <item name="android:layout_marginHorizontal">16dp</item>
+ <item name="android:gravity">center_horizontal</item>
+ <item name="android:fontFamily">google-sans</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textSize">24sp</item>
+ <item name="android:lines">2</item>
+ </style>
</resources>
\ No newline at end of file
diff --git a/quickstep/robolectric_tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/robolectric_tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
deleted file mode 100644
index fd93d98..0000000
--- a/quickstep/robolectric_tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 android.view.Display.DEFAULT_DISPLAY;
-
-import static org.mockito.Mockito.mock;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.graphics.RectF;
-import android.hardware.display.DisplayManager;
-import android.view.Surface;
-import android.view.SurfaceControl;
-
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.shadows.LShadowDisplay;
-import com.android.launcher3.util.DisplayController;
-import com.android.quickstep.LauncherActivityInterface;
-import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
-import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;
-
-import org.hamcrest.Description;
-import org.hamcrest.TypeSafeMatcher;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowDisplayManager;
-
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
-public class TaskViewSimulatorTest {
-
- @Test
- public void taskProperlyScaled_portrait_noRotation_sameInsets1() {
- new TaskMatrixVerifier()
- .withLauncherSize(1200, 2450)
- .withInsets(new Rect(0, 80, 0, 120))
- .verifyNoTransforms();
- }
-
- @Test
- public void taskProperlyScaled_portrait_noRotation_sameInsets2() {
- new TaskMatrixVerifier()
- .withLauncherSize(1200, 2450)
- .withInsets(new Rect(55, 80, 55, 120))
- .verifyNoTransforms();
- }
-
- @Test
- public void taskProperlyScaled_landscape_noRotation_sameInsets1() {
- new TaskMatrixVerifier()
- .withLauncherSize(2450, 1250)
- .withInsets(new Rect(0, 80, 0, 40))
- .verifyNoTransforms();
- }
-
- @Test
- public void taskProperlyScaled_landscape_noRotation_sameInsets2() {
- new TaskMatrixVerifier()
- .withLauncherSize(2450, 1250)
- .withInsets(new Rect(0, 80, 120, 0))
- .verifyNoTransforms();
- }
-
- @Test
- public void taskProperlyScaled_landscape_noRotation_sameInsets3() {
- new TaskMatrixVerifier()
- .withLauncherSize(2450, 1250)
- .withInsets(new Rect(55, 80, 55, 120))
- .verifyNoTransforms();
- }
-
- @Test
- public void taskProperlyScaled_landscape_rotated() {
- new TaskMatrixVerifier()
- .withLauncherSize(1200, 2450)
- .withInsets(new Rect(0, 80, 0, 120))
- .withAppBounds(
- new Rect(0, 0, 2450, 1200),
- new Rect(0, 80, 0, 120),
- Surface.ROTATION_90)
- .verifyNoTransforms();
- }
-
- private static class TaskMatrixVerifier extends TransformParams {
-
- private final Context mContext = RuntimeEnvironment.application;
-
- private Rect mAppBounds = new Rect();
- private Rect mLauncherInsets = new Rect();
-
- private Rect mAppInsets;
-
- private int mAppRotation = -1;
- private DeviceProfile mDeviceProfile;
-
- TaskMatrixVerifier withLauncherSize(int width, int height) {
- ShadowDisplayManager.changeDisplay(DEFAULT_DISPLAY,
- String.format("w%sdp-h%sdp-mdpi", width, height));
- if (mAppBounds.isEmpty()) {
- mAppBounds.set(0, 0, width, height);
- }
- return this;
- }
-
- TaskMatrixVerifier withInsets(Rect insets) {
- LShadowDisplay shadowDisplay = Shadow.extract(
- mContext.getSystemService(DisplayManager.class).getDisplay(DEFAULT_DISPLAY));
- shadowDisplay.setInsets(insets);
- mLauncherInsets.set(insets);
- return this;
- }
-
- TaskMatrixVerifier withAppBounds(Rect bounds, Rect insets, int appRotation) {
- mAppBounds.set(bounds);
- mAppInsets = insets;
- mAppRotation = appRotation;
- return this;
- }
-
- void verifyNoTransforms() {
- mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(mContext)
- .getDeviceProfile(mContext);
- mDeviceProfile.updateInsets(mLauncherInsets);
-
- TaskViewSimulator tvs = new TaskViewSimulator(mContext,
- LauncherActivityInterface.INSTANCE);
- tvs.setDp(mDeviceProfile);
-
- int launcherRotation = DisplayController.INSTANCE.get(mContext).getInfo().rotation;
- if (mAppRotation < 0) {
- mAppRotation = launcherRotation;
- }
- tvs.getOrientationState().update(launcherRotation, mAppRotation);
- if (mAppInsets == null) {
- mAppInsets = new Rect(mLauncherInsets);
- }
- tvs.setPreviewBounds(mAppBounds, mAppInsets);
-
- tvs.fullScreenProgress.value = 1;
- tvs.recentsViewScale.value = tvs.getFullScreenScale();
- tvs.apply(this);
- }
-
- @Override
- public SurfaceParams[] createSurfaceParams(BuilderProxy proxy) {
- SurfaceParams.Builder builder = new SurfaceParams.Builder((SurfaceControl) null);
- proxy.onBuildTargetParams(builder, mock(RemoteAnimationTargetCompat.class), this);
- return new SurfaceParams[] {builder.build()};
- }
-
- @Override
- public void applySurfaceParams(SurfaceParams[] params) {
- // Verify that the task position remains the same
- RectF newAppBounds = new RectF(mAppBounds);
- params[0].matrix.mapRect(newAppBounds);
- Assert.assertThat(newAppBounds, new AlmostSame(mAppBounds));
-
- System.err.println("Bounds mapped: " + mAppBounds + " => " + newAppBounds);
- }
- }
-
- private static class AlmostSame extends TypeSafeMatcher<RectF> {
-
- // Allow 1px error margin to account for float to int conversions
- private final float mError = 1f;
- private final Rect mExpected;
-
- AlmostSame(Rect expected) {
- mExpected = expected;
- }
-
- @Override
- protected boolean matchesSafely(RectF item) {
- return Math.abs(item.left - mExpected.left) < mError
- && Math.abs(item.top - mExpected.top) < mError
- && Math.abs(item.right - mExpected.right) < mError
- && Math.abs(item.bottom - mExpected.bottom) < mError;
- }
-
- @Override
- public void describeTo(Description description) {
- description.appendValue(mExpected);
- }
- }
-}
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index b4b29aa..1f4be5b 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -35,6 +35,8 @@
import android.content.Intent;
import android.content.IntentSender;
import android.content.ServiceConnection;
+import android.hardware.SensorManager;
+import android.hardware.devicestate.DeviceStateManager;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Handler;
@@ -73,6 +75,8 @@
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.TouchInteractionService.TISBinder;
+import com.android.quickstep.util.LauncherUnfoldAnimationController;
+import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteFadeOutAnimationListener;
import com.android.quickstep.util.SplitSelectStateController;
@@ -82,7 +86,12 @@
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
+import com.android.systemui.unfold.UnfoldTransitionFactory;
+import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
+import com.android.systemui.unfold.config.UnfoldTransitionConfig;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
import java.util.List;
import java.util.stream.Stream;
@@ -117,6 +126,7 @@
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
mTaskbarManager = ((TISBinder) iBinder).getTaskbarManager();
mTaskbarManager.setLauncher(BaseQuickstepLauncher.this);
+
Log.d(TAG, "TIS service connected");
resetServiceBindRetryState();
@@ -142,16 +152,41 @@
private @Nullable DragOptions mNextWorkspaceDragOptions = null;
private SplitPlaceholderView mSplitPlaceholderView;
+ private @Nullable UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
+ private @Nullable LauncherUnfoldAnimationController mLauncherUnfoldAnimationController;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this);
addMultiWindowModeChangedListener(mDepthController);
+ initUnfoldTransitionProgressProvider();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onResume();
+ }
+ }
+
+ @Override
+ protected void onPause() {
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onPause();
+ }
+
+ super.onPause();
}
@Override
public void onDestroy() {
mAppTransitionManager.onActivityDestroyed();
+ if (mUnfoldTransitionProgressProvider != null) {
+ mUnfoldTransitionProgressProvider.destroy();
+ }
SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this);
@@ -160,6 +195,11 @@
mTaskbarManager.clearLauncher(this);
}
resetServiceBindRetryState();
+
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onDestroy();
+ }
+
super.onDestroy();
}
@@ -297,7 +337,7 @@
mActionsView = findViewById(R.id.overview_actions_view);
RecentsView overviewPanel = (RecentsView) getOverviewPanel();
SplitSelectStateController controller =
- new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this));
+ new SplitSelectStateController(SystemUiProxy.INSTANCE.get(this));
overviewPanel.init(mActionsView, controller);
mActionsView.setDp(getDeviceProfile());
mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this));
@@ -334,6 +374,28 @@
mConnectionAttempts = 0;
}
+ private void initUnfoldTransitionProgressProvider() {
+ final UnfoldTransitionConfig config = UnfoldTransitionFactory.createConfig(this);
+ if (config.isEnabled()) {
+ mUnfoldTransitionProgressProvider =
+ UnfoldTransitionFactory.createUnfoldTransitionProgressProvider(
+ this,
+ config,
+ ProxyScreenStatusProvider.INSTANCE,
+ getSystemService(DeviceStateManager.class),
+ getSystemService(SensorManager.class),
+ getMainThreadHandler(),
+ getMainExecutor()
+ );
+
+ mLauncherUnfoldAnimationController = new LauncherUnfoldAnimationController(
+ this,
+ getWindowManager(),
+ mUnfoldTransitionProgressProvider
+ );
+ }
+ }
+
public void setTaskbarUIController(LauncherTaskbarUIController taskbarUIController) {
mTaskbarUIController = taskbarUIController;
}
@@ -373,6 +435,11 @@
return mTaskbarStateHandler;
}
+ @Nullable
+ public UnfoldTransitionProgressProvider getUnfoldTransitionProgressProvider() {
+ return mUnfoldTransitionProgressProvider;
+ }
+
@Override
public boolean supportsAdaptiveIconAnimation(View clickedView) {
return mAppTransitionManager.hasControlRemoteAppTransitionPermission()
@@ -554,4 +621,12 @@
recentsView.finishRecentsAnimation(/* toRecents= */ true, null);
}
}
+
+ @Override
+ public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
+ super.dump(prefix, fd, writer, args);
+ if (mDepthController != null) {
+ mDepthController.dump(prefix, writer);
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index f06447b..89cc1f6 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -676,7 +676,7 @@
? Math.max(crop.width(), crop.height()) / 2f
: 0f;
final float finalWindowRadius = mDeviceProfile.isMultiWindowMode
- ? 0 : getWindowCornerRadius(mLauncher.getResources());
+ ? 0 : getWindowCornerRadius(mLauncher);
final float finalShadowRadius = appTargetsAreTranslucent ? 0 : mMaxShadowRadius;
MultiValueUpdateListener listener = new MultiValueUpdateListener() {
@@ -867,7 +867,7 @@
}
final float finalWindowRadius = mDeviceProfile.isMultiWindowMode
- ? 0 : getWindowCornerRadius(mLauncher.getResources());
+ ? 0 : getWindowCornerRadius(mLauncher);
final FloatingWidgetView floatingView = FloatingWidgetView.getFloatingWidgetView(mLauncher,
v, widgetBackgroundBounds,
new Size(windowTargetBounds.width(), windowTargetBounds.height()),
@@ -1124,6 +1124,7 @@
if (target.mode == mode && target.taskInfo != null
// Compare component name instead of task-id because transitions will promote
// the target up to the root task while getTaskId returns the leaf.
+ && target.taskInfo.topActivity != null
&& target.taskInfo.topActivity.equals(mLauncher.getComponentName())) {
return true;
}
@@ -1148,7 +1149,7 @@
ValueAnimator unlockAnimator = ValueAnimator.ofFloat(0, 1);
unlockAnimator.setDuration(CLOSING_TRANSITION_DURATION_MS);
float cornerRadius = mDeviceProfile.isMultiWindowMode ? 0 :
- QuickStepContract.getWindowCornerRadius(mLauncher.getResources());
+ QuickStepContract.getWindowCornerRadius(mLauncher);
unlockAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
@@ -1190,7 +1191,7 @@
ValueAnimator closingAnimator = ValueAnimator.ofFloat(0, 1);
int duration = CLOSING_TRANSITION_DURATION_MS;
float windowCornerRadius = mDeviceProfile.isMultiWindowMode
- ? 0 : getWindowCornerRadius(mLauncher.getResources());
+ ? 0 : getWindowCornerRadius(mLauncher);
float startShadowRadius = areAllTargetsTranslucent(appTargets) ? 0 : mMaxShadowRadius;
closingAnimator.setDuration(duration);
closingAnimator.addUpdateListener(new MultiValueUpdateListener() {
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduActivity.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduActivity.java
deleted file mode 100644
index 3a7d821..0000000
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduActivity.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.hybridhotseat;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-
-import com.android.launcher3.BaseActivity;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.uioverrides.QuickstepLauncher;
-import com.android.launcher3.util.ActivityTracker;
-
-/**
- * Proxy activity to return user to home screen and show halfsheet education
- */
-public class HotseatEduActivity extends Activity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- Intent homeIntent = new Intent(Intent.ACTION_MAIN)
- .addCategory(Intent.CATEGORY_HOME)
- .setPackage(getPackageName())
- .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- Launcher.ACTIVITY_TRACKER.registerCallback(new HotseatActivityTracker());
- startActivity(homeIntent);
- finish();
- }
-
- static class HotseatActivityTracker<T extends QuickstepLauncher> implements
- ActivityTracker.SchedulerCallback {
-
- @Override
- public boolean init(BaseActivity activity, boolean alreadyOnHome) {
- QuickstepLauncher launcher = (QuickstepLauncher) activity;
- if (launcher != null) {
- launcher.getHotseatPredictionController().showEdu();
- }
- return false;
- }
-
- }
-}
diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
index a9c2a5e..55a140d 100644
--- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
+++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
@@ -25,7 +25,9 @@
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.Utilities.getDevicePrefs;
import static com.android.launcher3.hybridhotseat.HotseatPredictionModel.convertDataModelToAppTargetBundle;
+import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import android.app.StatsManager;
import android.app.prediction.AppPredictionContext;
import android.app.prediction.AppPredictionManager;
import android.app.prediction.AppPredictor;
@@ -39,13 +41,14 @@
import android.content.pm.ShortcutInfo;
import android.os.UserHandle;
import android.util.Log;
+import android.util.StatsEvent;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.InvariantDeviceProfile.OnIDPChangeListener;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.InstanceIdSequence;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
@@ -54,10 +57,10 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
-import com.android.launcher3.util.Executors;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.PersistedItemArray;
import com.android.quickstep.logging.StatsLogCompatManager;
+import com.android.systemui.shared.system.SysUiStatsLog;
import java.util.Collections;
import java.util.List;
@@ -68,7 +71,7 @@
/**
* Model delegate which loads prediction items
*/
-public class QuickstepModelDelegate extends ModelDelegate implements OnIDPChangeListener {
+public class QuickstepModelDelegate extends ModelDelegate {
public static final String LAST_PREDICTION_ENABLED_STATE = "last_prediction_enabled_state";
private static final String LAST_SNAPSHOT_TIME_MILLIS = "LAST_SNAPSHOT_TIME_MILLIS";
@@ -86,6 +89,7 @@
private final InvariantDeviceProfile mIDP;
private final AppEventProducer mAppEventProducer;
+ private final StatsManager mStatsManager;
protected boolean mActive = false;
@@ -93,8 +97,8 @@
mAppEventProducer = new AppEventProducer(context, this::onAppTargetEvent);
mIDP = InvariantDeviceProfile.INSTANCE.get(context);
- mIDP.addOnChangeListener(this);
StatsLogCompatManager.LOGS_CONSUMER.add(mAppEventProducer);
+ mStatsManager = context.getSystemService(StatsManager.class);
}
@Override
@@ -157,10 +161,60 @@
additionalSnapshotEvents(instanceId);
prefs.edit().putLong(LAST_SNAPSHOT_TIME_MILLIS, now).apply();
}
+
+ // Only register for launcher snapshot logging if this is the primary ModelDelegate
+ // instance, as there will be additional instances that may be destroyed at any time.
+ if (mIsPrimaryInstance) {
+ registerSnapshotLoggingCallback();
+ }
}
protected void additionalSnapshotEvents(InstanceId snapshotInstanceId){}
+ /**
+ * Registers a callback to log launcher workspace layout using Statsd pulled atom.
+ */
+ protected void registerSnapshotLoggingCallback() {
+ if (mStatsManager == null) {
+ Log.d(TAG, "Failed to get StatsManager");
+ }
+
+ try {
+ mStatsManager.setPullAtomCallback(
+ SysUiStatsLog.LAUNCHER_LAYOUT_SNAPSHOT,
+ null /* PullAtomMetadata */,
+ MODEL_EXECUTOR,
+ (i, eventList) -> {
+ InstanceId instanceId = new InstanceIdSequence().newInstanceId();
+ IntSparseArrayMap<ItemInfo> itemsIdMap;
+ synchronized (mDataModel) {
+ itemsIdMap = mDataModel.itemsIdMap.clone();
+ }
+
+ for (ItemInfo info : itemsIdMap) {
+ FolderInfo parent = info.container > 0
+ ? (FolderInfo) itemsIdMap.get(info.container) : null;
+ LauncherAtom.ItemInfo itemInfo = info.buildProto(parent);
+ Log.d(TAG, itemInfo.toString());
+ StatsEvent statsEvent = StatsLogCompatManager.buildStatsEvent(itemInfo,
+ instanceId);
+ eventList.add(statsEvent);
+ }
+ Log.d(TAG,
+ String.format(
+ "Successfully logged %d workspace items with instanceId=%d",
+ itemsIdMap.size(), instanceId.getId()));
+ additionalSnapshotEvents(instanceId);
+ return StatsManager.PULL_SUCCESS;
+ }
+ );
+ Log.d(TAG, "Successfully registered for launcher snapshot logging!");
+ } catch (RuntimeException e) {
+ Log.e(TAG, "Failed to register launcher snapshot logging callback with StatsManager",
+ e);
+ }
+ }
+
@Override
public void validateData() {
super.validateData();
@@ -177,9 +231,10 @@
super.destroy();
mActive = false;
StatsLogCompatManager.LOGS_CONSUMER.remove(mAppEventProducer);
-
+ if (mIsPrimaryInstance) {
+ mStatsManager.clearPullAtomCallback(SysUiStatsLog.LAUNCHER_LAYOUT_SNAPSHOT);
+ }
destroyPredictors();
- mIDP.removeOnChangeListener(this);
}
private void destroyPredictors() {
@@ -224,7 +279,7 @@
private void registerPredictor(PredictorState state, AppPredictor predictor) {
state.predictor = predictor;
state.predictor.registerPredictionUpdates(
- Executors.MODEL_EXECUTOR, t -> handleUpdate(state, t));
+ MODEL_EXECUTOR, t -> handleUpdate(state, t));
state.predictor.requestPredictionUpdate();
}
@@ -239,7 +294,7 @@
private void registerWidgetsPredictor(AppPredictor predictor) {
mWidgetsRecommendationState.predictor = predictor;
mWidgetsRecommendationState.predictor.registerPredictionUpdates(
- Executors.MODEL_EXECUTOR, targets -> {
+ MODEL_EXECUTOR, targets -> {
if (mWidgetsRecommendationState.setTargets(targets)) {
// No diff, skip
return;
@@ -250,12 +305,6 @@
mWidgetsRecommendationState.predictor.requestPredictionUpdate();
}
- @Override
- public void onIdpChanged(InvariantDeviceProfile profile) {
- // Reinitialize everything
- Executors.MODEL_EXECUTOR.execute(this::recreatePredictors);
- }
-
private void onAppTargetEvent(AppTargetEvent event, int client) {
PredictorState state = client == CONTAINER_PREDICTION ? mAllAppsState : mHotseatState;
if (state.predictor != null) {
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
index 68159fa..9d70cfa 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -44,6 +44,8 @@
import com.android.systemui.shared.system.BlurUtils;
import com.android.systemui.shared.system.WallpaperManagerCompat;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
import java.util.function.Consumer;
/**
@@ -96,7 +98,11 @@
public void onDraw() {
View view = mLauncher.getDragLayer();
ViewRootImpl viewRootImpl = view.getViewRootImpl();
- setSurface(viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null);
+ boolean applied = setSurface(
+ viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null);
+ if (!applied) {
+ dispatchTransactionSurface(mDepth);
+ }
view.post(() -> view.getViewTreeObserver().removeOnDrawListener(this));
}
};
@@ -134,6 +140,11 @@
*/
private float mDepth;
/**
+ * Last blur value, in pixels, that was applied.
+ * For debugging purposes.
+ */
+ private int mCurrentBlur;
+ /**
* If we're launching and app and should not be blurring the screen for performance reasons.
*/
private boolean mBlurDisabledForAppLaunch;
@@ -202,20 +213,22 @@
/**
* Sets the specified app target surface to apply the blur to.
+ * @return true when surface was valid and transaction was dispatched.
*/
- public void setSurface(SurfaceControl surface) {
+ public boolean setSurface(SurfaceControl surface) {
// Set launcher as the SurfaceControl when we don't need an external target anymore.
if (surface == null) {
ViewRootImpl viewRootImpl = mLauncher.getDragLayer().getViewRootImpl();
surface = viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null;
}
-
if (mSurface != surface) {
mSurface = surface;
if (surface != null) {
dispatchTransactionSurface(mDepth);
+ return true;
}
}
+ return false;
}
@Override
@@ -229,6 +242,8 @@
setDepth(toDepth);
} else if (toState == LauncherState.OVERVIEW) {
dispatchTransactionSurface(mDepth);
+ } else if (toState == LauncherState.BACKGROUND_APP) {
+ mLauncher.getDragLayer().getViewTreeObserver().addOnDrawListener(mOnDrawListener);
}
}
@@ -296,15 +311,12 @@
}
if (supportsBlur) {
- // We cannot mark the window as opaque in overview because there will be an app window
- // below the launcher layer, and we need to draw it -- without blurs.
- boolean isOverview = mLauncher.isInState(LauncherState.OVERVIEW);
- boolean opaque = mLauncher.getScrimView().isFullyOpaque() && !isOverview;
+ boolean opaque = mLauncher.getScrimView().isFullyOpaque();
- int blur = opaque || isOverview || !mCrossWindowBlursEnabled
- || mBlurDisabledForAppLaunch ? 0 : (int) (depth * mMaxBlurRadius);
+ mCurrentBlur = !mCrossWindowBlursEnabled || mBlurDisabledForAppLaunch
+ ? 0 : (int) (depth * mMaxBlurRadius);
SurfaceControl.Transaction transaction = new SurfaceControl.Transaction()
- .setBackgroundBlurRadius(mSurface, blur)
+ .setBackgroundBlurRadius(mSurface, mCurrentBlur)
.setOpaque(mSurface, opaque);
// Set early wake-up flags when we know we're executing an expensive operation, this way
@@ -343,4 +355,18 @@
mwAnimation.setAutoCancel(true);
mwAnimation.start();
}
+
+ public void dump(String prefix, PrintWriter writer) {
+ writer.println(prefix + this.getClass().getSimpleName());
+ writer.println(prefix + "\tmMaxBlurRadius=" + mMaxBlurRadius);
+ writer.println(prefix + "\tmCrossWindowBlursEnabled=" + mCrossWindowBlursEnabled);
+ writer.println(prefix + "\tmSurface=" + mSurface);
+ writer.println(prefix + "\tmOverlayScrollProgress=" + mOverlayScrollProgress);
+ writer.println(prefix + "\tmDepth=" + mDepth);
+ writer.println(prefix + "\tmCurrentBlur=" + mCurrentBlur);
+ writer.println(prefix + "\tmBlurDisabledForAppLaunch=" + mBlurDisabledForAppLaunch);
+ writer.println(prefix + "\tmInEarlyWakeUp=" + mInEarlyWakeUp);
+ writer.println(prefix + "\tmIgnoreStateChangesDuringMultiWindowAnimation="
+ + mIgnoreStateChangesDuringMultiWindowAnimation);
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index acabb0d..829e072 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -16,6 +16,7 @@
package com.android.launcher3.taskbar;
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
+import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_APP;
import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_HOME;
import android.animation.Animator;
@@ -32,6 +33,7 @@
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.AnimatorListeners;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.ItemInfoWithIcon;
@@ -126,7 +128,7 @@
@Override
protected boolean isTaskbarTouchable() {
- return !isAnimatingToLauncher() && !mControllers.taskbarStashController.isStashed();
+ return !isAnimatingToLauncher();
}
private boolean isAnimatingToLauncher() {
@@ -162,10 +164,9 @@
anim.start();
mIsAnimatingToLauncherViaResume = isResumed;
- if (!isResumed) {
- TaskbarStashController stashController = mControllers.taskbarStashController;
- stashController.animateToIsStashed(stashController.isStashedInApp(), duration);
- }
+ TaskbarStashController stashController = mControllers.taskbarStashController;
+ stashController.updateStateForFlag(FLAG_IN_APP, !isResumed);
+ stashController.applyState(duration);
SystemUiProxy.INSTANCE.get(mContext).notifyTaskbarStatus(!isResumed,
mControllers.taskbarStashController.isStashedInApp());
}
@@ -193,8 +194,11 @@
public void onAnimationStart(Animator animation) {
mTargetStateOverride = toState;
mIsAnimatingToLauncherViaGesture = true;
- // TODO: base this on launcher state
- stashController.animateToIsStashed(false, duration);
+ // TODO: FLAG_IN_APP might be sufficient for now, but in the future we do want to
+ // add another flag for LauncherState as well. We will need to decide whether to
+ // show hotseat or the task bar.
+ stashController.updateStateForFlag(FLAG_IN_APP, false);
+ stashController.applyState(duration);
}
});
@@ -282,6 +286,7 @@
*/
public void showEdu() {
if (!FeatureFlags.ENABLE_TASKBAR_EDU.get()
+ || Utilities.IS_RUNNING_IN_TEST_HARNESS
|| mLauncher.getOnboardingPrefs().getBoolean(OnboardingPrefs.TASKBAR_EDU_SEEN)) {
return;
}
@@ -327,9 +332,8 @@
.start();
TaskbarStashController controller = mControllers.taskbarStashController;
- if (finishedToApp) {
- controller.animateToIsStashed(controller.isStashedInApp());
- }
+ controller.updateStateForFlag(FLAG_IN_APP, finishedToApp);
+ controller.applyState();
}
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index be9368f..79bea03 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -34,10 +34,12 @@
import android.animation.ObjectAnimator;
import android.annotation.DrawableRes;
import android.annotation.IdRes;
+import android.annotation.LayoutRes;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region.Op;
import android.graphics.drawable.AnimatedVectorDrawable;
+import android.provider.Settings;
import android.util.Property;
import android.view.View;
import android.view.View.OnClickListener;
@@ -54,6 +56,7 @@
import com.android.launcher3.taskbar.contextual.RotationButton;
import com.android.launcher3.taskbar.contextual.RotationButtonController;
import com.android.launcher3.util.MultiValueAlpha;
+import com.android.launcher3.util.SettingsCache;
import com.android.quickstep.AnimatedFloat;
import java.util.ArrayList;
@@ -121,21 +124,16 @@
.getProperty(ALPHA_INDEX_IME),
flags -> (flags & FLAG_IME_VISIBLE) == 0, MultiValueAlpha.VALUE, 1, 0));
+ boolean isThreeButtonNav = mContext.isThreeButtonNav();
// IME switcher
View imeSwitcherButton = addButton(R.drawable.ic_ime_switcher, BUTTON_IME_SWITCH,
- mEndContextualContainer, mControllers.navButtonController, R.id.ime_switcher);
+ isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
+ mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) == MASK_IME_SWITCHER_VISIBLE)
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)
&& ((flags & FLAG_A11Y_VISIBLE) == 0)));
- View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
- mStartContextualContainer, mControllers.navButtonController, R.id.back);
- imeDownButton.setRotation(Utilities.isRtl(mContext.getResources()) ? 90 : -90);
- // Rotate when Ime visible
- mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
- flags -> (flags & FLAG_IME_VISIBLE) != 0));
-
mPropertyHolders.add(new StatePropertyHolder(
mControllers.taskbarViewController.getTaskbarIconAlpha()
.getProperty(ALPHA_INDEX_KEYGUARD),
@@ -145,7 +143,10 @@
.getKeyguardBgTaskbar(),
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0));
- if (mContext.isThreeButtonNav()) {
+ // Force nav buttons (specifically back button) to be visible during setup wizard.
+ boolean areButtonsForcedVisible = !SettingsCache.INSTANCE.get(mContext).getValue(
+ Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
+ if (isThreeButtonNav || areButtonsForcedVisible) {
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);
@@ -158,11 +159,18 @@
// Rotation button
RotationButton rotationButton = new RotationButtonImpl(
- addButton(mEndContextualContainer, R.id.rotate_suggestion));
+ addButton(mEndContextualContainer, R.id.rotate_suggestion,
+ R.layout.taskbar_contextual_button));
rotationButton.hide();
mControllers.rotationButtonController.setRotationButton(rotationButton);
} else {
mControllers.rotationButtonController.setRotationButton(new RotationButton() {});
+ View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
+ mStartContextualContainer, mControllers.navButtonController, R.id.back);
+ imeDownButton.setRotation(Utilities.isRtl(mContext.getResources()) ? 90 : -90);
+ // Rotate when Ime visible
+ mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
+ flags -> (flags & FLAG_IME_VISIBLE) != 0));
}
applyState();
@@ -175,8 +183,11 @@
mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
mNavButtonContainer, mControllers.navButtonController, R.id.back);
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
- flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
- (flags & FLAG_DISABLE_BACK) == 0));
+ flags -> (flags & FLAG_DISABLE_BACK) == 0));
+ boolean isRtl = Utilities.isRtl(mContext.getResources());
+ mPropertyHolders.add(new StatePropertyHolder(
+ mBackButton, flags -> (flags & FLAG_IME_VISIBLE) != 0, View.ROTATION,
+ isRtl ? 90 : -90, 0));
// Hide when keyguard is showing, show when bouncer is showing
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 ||
@@ -186,19 +197,18 @@
View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,
navButtonController, R.id.home);
mPropertyHolders.add(new StatePropertyHolder(homeButton,
- flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
- (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
+ flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
(flags & FLAG_DISABLE_HOME) == 0));
View recentsButton = addButton(R.drawable.ic_sysbar_recent, BUTTON_RECENTS,
navContainer, navButtonController, R.id.recent_apps);
mPropertyHolders.add(new StatePropertyHolder(recentsButton,
- flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
- (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
+ flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
(flags & FLAG_DISABLE_RECENTS) == 0));
// A11y button
mA11yButton = addButton(R.drawable.ic_sysbar_accessibility_button, BUTTON_A11Y,
- endContainer, navButtonController, R.id.accessibility_button);
+ endContainer, navButtonController, R.id.accessibility_button,
+ R.layout.taskbar_contextual_button);
mPropertyHolders.add(new StatePropertyHolder(mA11yButton,
flags -> (flags & FLAG_A11Y_VISIBLE) != 0
&& (flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0));
@@ -301,15 +311,22 @@
private ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType,
ViewGroup parent, TaskbarNavButtonController navButtonController, @IdRes int id) {
- ImageView buttonView = addButton(parent, id);
+ return addButton(drawableId, buttonType, parent, navButtonController, id,
+ R.layout.taskbar_nav_button);
+ }
+
+ private ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType,
+ ViewGroup parent, TaskbarNavButtonController navButtonController, @IdRes int id,
+ @LayoutRes int layoutId) {
+ ImageView buttonView = addButton(parent, id, layoutId);
buttonView.setImageResource(drawableId);
buttonView.setOnClickListener(view -> navButtonController.onButtonClick(buttonType));
return buttonView;
}
- private ImageView addButton(ViewGroup parent, int id) {
+ private ImageView addButton(ViewGroup parent, @IdRes int id, @LayoutRes int layoutId) {
ImageView buttonView = (ImageView) mContext.getLayoutInflater()
- .inflate(R.layout.taskbar_nav_button, parent, false);
+ .inflate(layoutId, parent, false);
buttonView.setId(id);
parent.addView(buttonView);
mAllButtons.add(buttonView);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 8c12567..0d684a0 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -27,6 +27,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.LauncherApps;
+import android.graphics.Insets;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Process;
@@ -62,6 +63,7 @@
import com.android.launcher3.views.ActivityContext;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
+import com.android.quickstep.util.ScopedUnfoldTransitionProgressProvider;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.WindowManagerWrapper;
@@ -98,7 +100,8 @@
private boolean mIsDestroyed = false;
public TaskbarActivityContext(Context windowContext, DeviceProfile dp,
- TaskbarNavButtonController buttonController) {
+ TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider
+ unfoldTransitionProgressProvider) {
super(windowContext, Themes.getActivityThemeRes(windowContext));
mDeviceProfile = dp;
@@ -120,6 +123,14 @@
FrameLayout navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
+ Display display = windowContext.getDisplay();
+ Context c = display.getDisplayId() == Display.DEFAULT_DISPLAY
+ ? windowContext.getApplicationContext()
+ : windowContext.getApplicationContext().createDisplayContext(display);
+ mWindowManager = c.getSystemService(WindowManager.class);
+ mLeftCorner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT);
+ mRightCorner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT);
+
// Construct controllers.
mControllers = new TaskbarControllers(this,
new TaskbarDragController(this),
@@ -129,18 +140,12 @@
R.color.popup_color_primary_light),
new TaskbarDragLayerController(this, mDragLayer),
new TaskbarViewController(this, taskbarView),
+ new TaskbarUnfoldAnimationController(unfoldTransitionProgressProvider,
+ mWindowManager),
new TaskbarKeyguardController(this),
new StashedHandleViewController(this, stashedHandleView),
new TaskbarStashController(this),
new TaskbarEduController(this));
-
- Display display = windowContext.getDisplay();
- Context c = display.getDisplayId() == Display.DEFAULT_DISPLAY
- ? windowContext.getApplicationContext()
- : windowContext.getApplicationContext().createDisplayContext(display);
- mWindowManager = c.getSystemService(WindowManager.class);
- mLeftCorner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT);
- mRightCorner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT);
}
public void init() {
@@ -163,6 +168,10 @@
mWindowLayoutParams,
new int[] { ITYPE_EXTRA_NAVIGATION_BAR, ITYPE_BOTTOM_TAPPABLE_ELEMENT }
);
+ // Adjust the frame by the rounded corners (ie. leaving just the bar as the inset) when
+ // the IME is showing
+ mWindowLayoutParams.providedInternalImeInsets = Insets.of(0,
+ getDefaultTaskbarWindowHeight() - mDeviceProfile.taskbarSize, 0, 0);
// Initialize controllers after all are constructed.
mControllers.init();
@@ -212,6 +221,14 @@
return mViewCache;
}
+ @Override
+ public boolean supportsIme() {
+ // Currently we don't support IME because we have FLAG_NOT_FOCUSABLE. We can remove that
+ // flag when opening a floating view that needs IME (such as Folder), but then that means
+ // Taskbar will be below IME and thus users can't click the back button.
+ return false;
+ }
+
/**
* Sets a new data-source for this taskbar instance
*/
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
index 1197543..6144881 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
@@ -31,6 +31,7 @@
public final RotationButtonController rotationButtonController;
public final TaskbarDragLayerController taskbarDragLayerController;
public final TaskbarViewController taskbarViewController;
+ public final TaskbarUnfoldAnimationController taskbarUnfoldAnimationController;
public final TaskbarKeyguardController taskbarKeyguardController;
public final StashedHandleViewController stashedHandleViewController;
public final TaskbarStashController taskbarStashController;
@@ -46,6 +47,7 @@
RotationButtonController rotationButtonController,
TaskbarDragLayerController taskbarDragLayerController,
TaskbarViewController taskbarViewController,
+ TaskbarUnfoldAnimationController taskbarUnfoldAnimationController,
TaskbarKeyguardController taskbarKeyguardController,
StashedHandleViewController stashedHandleViewController,
TaskbarStashController taskbarStashController,
@@ -57,6 +59,7 @@
this.rotationButtonController = rotationButtonController;
this.taskbarDragLayerController = taskbarDragLayerController;
this.taskbarViewController = taskbarViewController;
+ this.taskbarUnfoldAnimationController = taskbarUnfoldAnimationController;
this.taskbarKeyguardController = taskbarKeyguardController;
this.stashedHandleViewController = stashedHandleViewController;
this.taskbarStashController = taskbarStashController;
@@ -75,6 +78,7 @@
}
taskbarDragLayerController.init(this);
taskbarViewController.init(this);
+ taskbarUnfoldAnimationController.init(this);
taskbarKeyguardController.init(navbarButtonsViewController);
stashedHandleViewController.init(this);
taskbarStashController.init(this);
@@ -89,6 +93,7 @@
rotationButtonController.onDestroy();
taskbarDragLayerController.onDestroy();
taskbarKeyguardController.onDestroy();
+ taskbarUnfoldAnimationController.onDestroy();
taskbarViewController.onDestroy();
stashedHandleViewController.onDestroy();
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
index 0afa480..567a0c7 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -123,11 +123,9 @@
*/
public void updateInsetsTouchability(InsetsInfo insetsInfo) {
insetsInfo.touchableRegion.setEmpty();
- if (mActivity.isThreeButtonNav()) {
- // Always have nav buttons be touchable
- mControllers.navbarButtonsViewController.addVisibleButtonsRegion(
- mTaskbarDragLayer, insetsInfo.touchableRegion);
- }
+ // Always have nav buttons be touchable
+ mControllers.navbarButtonsViewController.addVisibleButtonsRegion(
+ mTaskbarDragLayer, insetsInfo.touchableRegion);
if (mTaskbarDragLayer.getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD) {
// Let touches pass through us.
@@ -137,8 +135,9 @@
} else if (!mControllers.uiController.isTaskbarTouchable()) {
// Let touches pass through us.
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
- } else if (mControllers.taskbarViewController.areIconsVisible()) {
- // Buttons are visible, take over the full taskbar area
+ } else if (mControllers.taskbarViewController.areIconsVisible()
+ || AbstractFloatingView.getOpenView(mActivity, TYPE_ALL) != null) {
+ // Taskbar has some touchable elements, take over the full taskbar area
insetsInfo.setTouchableInsets(mActivity.isTaskbarWindowFullscreen()
? TOUCHABLE_INSETS_FRAME : TOUCHABLE_INSETS_CONTENT);
} else {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 45eabed..2e9d8bc 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -22,8 +22,14 @@
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS;
+import android.content.ComponentCallbacks;
import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
+import android.net.Uri;
+import android.provider.Settings;
import android.view.Display;
import androidx.annotation.NonNull;
@@ -35,10 +41,13 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
+import com.android.launcher3.util.SettingsCache;
+import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TouchInteractionService;
+import com.android.quickstep.util.ScopedUnfoldTransitionProgressProvider;
/**
* Class to manage taskbar lifecycle
@@ -46,10 +55,20 @@
public class TaskbarManager implements DisplayController.DisplayInfoChangeListener,
SysUINavigationMode.NavigationModeChangeListener {
+ private static final Uri USER_SETUP_COMPLETE_URI = Settings.Secure.getUriFor(
+ Settings.Secure.USER_SETUP_COMPLETE);
+
private final Context mContext;
private final DisplayController mDisplayController;
private final SysUINavigationMode mSysUINavigationMode;
private final TaskbarNavButtonController mNavButtonController;
+ private final SettingsCache.OnChangeListener mUserSetupCompleteListener;
+ private final ComponentCallbacks mComponentCallbacks;
+ private final SimpleBroadcastReceiver mShutdownReceiver;
+
+ // The source for this provider is set when Launcher is available
+ private final ScopedUnfoldTransitionProgressProvider mUnfoldProgressProvider =
+ new ScopedUnfoldTransitionProgressProvider();
private TaskbarActivityContext mTaskbarActivityContext;
private BaseQuickstepLauncher mLauncher;
@@ -71,9 +90,31 @@
service.getSystemService(DisplayManager.class).getDisplay(DEFAULT_DISPLAY);
mContext = service.createWindowContext(display, TYPE_APPLICATION_OVERLAY, null);
mNavButtonController = new TaskbarNavButtonController(service);
+ mUserSetupCompleteListener = isUserSetupComplete -> recreateTaskbar();
+ mComponentCallbacks = new ComponentCallbacks() {
+ private Configuration mOldConfig = mContext.getResources().getConfiguration();
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ if ((mOldConfig.diff(newConfig) & ActivityInfo.CONFIG_ASSETS_PATHS) != 0) {
+ // Color has changed, recreate taskbar to reload background color & icons.
+ recreateTaskbar();
+ }
+ mOldConfig = newConfig;
+ }
+
+ @Override
+ public void onLowMemory() { }
+ };
+ mShutdownReceiver = new SimpleBroadcastReceiver(i -> destroyExistingTaskbar());
mDisplayController.addChangeListener(this);
mSysUINavigationMode.addModeChangeListener(this);
+ SettingsCache.INSTANCE.get(mContext).register(USER_SETUP_COMPLETE_URI,
+ mUserSetupCompleteListener);
+ mContext.registerComponentCallbacks(mComponentCallbacks);
+ mShutdownReceiver.register(mContext, Intent.ACTION_SHUTDOWN);
+
recreateTaskbar();
}
@@ -109,6 +150,9 @@
*/
public void setLauncher(@NonNull BaseQuickstepLauncher launcher) {
mLauncher = launcher;
+ mUnfoldProgressProvider.setSourceProvider(launcher
+ .getUnfoldTransitionProgressProvider());
+
if (mTaskbarActivityContext != null) {
mTaskbarActivityContext.setUIController(
new LauncherTaskbarUIController(launcher, mTaskbarActivityContext));
@@ -124,6 +168,7 @@
if (mTaskbarActivityContext != null) {
mTaskbarActivityContext.setUIController(TaskbarUIController.DEFAULT);
}
+ mUnfoldProgressProvider.setSourceProvider(null);
}
}
@@ -142,8 +187,8 @@
return;
}
- mTaskbarActivityContext = new TaskbarActivityContext(
- mContext, dp.copy(mContext), mNavButtonController);
+ mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp.copy(mContext),
+ mNavButtonController, mUnfoldProgressProvider);
mTaskbarActivityContext.init();
if (mLauncher != null) {
mTaskbarActivityContext.setUIController(
@@ -188,6 +233,10 @@
destroyExistingTaskbar();
mDisplayController.removeChangeListener(this);
mSysUINavigationMode.removeModeChangeListener(this);
+ SettingsCache.INSTANCE.get(mContext).unregister(USER_SETUP_COMPLETE_URI,
+ mUserSetupCompleteListener);
+ mContext.unregisterComponentCallbacks(mComponentCallbacks);
+ mContext.unregisterReceiver(mShutdownReceiver);
}
public @Nullable TaskbarActivityContext getCurrentActivityContext() {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 1f5ff02..fc277cc 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -31,12 +31,17 @@
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
+import java.util.function.IntPredicate;
+
/**
* Coordinates between controllers such as TaskbarViewController and StashedHandleViewController to
* create a cohesive animation between stashed/unstashed states.
*/
public class TaskbarStashController {
+ public static final int FLAG_IN_APP = 1 << 0;
+ public static final int FLAG_STASHED_IN_APP = 1 << 1;
+
/**
* How long to stash/unstash when manually invoked via long press.
*/
@@ -78,6 +83,9 @@
private final int mStashedHeight;
private final int mUnstashedHeight;
+ private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder(
+ flags -> (((flags & FLAG_IN_APP) != 0) && (flags & FLAG_STASHED_IN_APP) != 0));
+
// Initialized in init.
private TaskbarControllers mControllers;
// Taskbar background properties.
@@ -94,6 +102,7 @@
private boolean mIsStashedInApp;
/** Whether we are currently visually stashed (might change based on launcher state). */
private boolean mIsStashed = false;
+ private int mState;
private @Nullable AnimatorSet mAnimator;
@@ -124,6 +133,7 @@
mIsStashedInApp = supportsStashing()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
+ updateStateForFlag(FLAG_STASHED_IN_APP, mIsStashedInApp);
SystemUiProxy.INSTANCE.get(mActivity)
.notifyTaskbarStatus(/* visible */ true, /* stashed */ mIsStashedInApp);
@@ -190,35 +200,19 @@
return false;
}
if (mIsStashedInApp != isStashedInApp) {
- boolean wasStashed = mIsStashedInApp;
mIsStashedInApp = isStashedInApp;
mPrefs.edit().putBoolean(SHARED_PREFS_STASHED_KEY, mIsStashedInApp).apply();
- boolean isStashed = mIsStashedInApp;
- if (wasStashed != isStashed) {
- SystemUiProxy.INSTANCE.get(mActivity)
- .notifyTaskbarStatus(/* visible */ true, /* stashed */ isStashed);
- mControllers.uiController.onStashedInAppChanged();
- createAnimToIsStashed(isStashed, TASKBAR_STASH_DURATION).start();
- return true;
- }
+ updateStateForFlag(FLAG_STASHED_IN_APP, mIsStashedInApp);
+ applyState();
+
+ SystemUiProxy.INSTANCE.get(mActivity)
+ .notifyTaskbarStatus(/* visible */ true, /* stashed */ mIsStashedInApp);
+ mControllers.uiController.onStashedInAppChanged();
+ return true;
}
return false;
}
- /**
- * Starts an animation to the new stashed state with a default duration.
- */
- public void animateToIsStashed(boolean isStashed) {
- animateToIsStashed(isStashed, TASKBAR_STASH_DURATION);
- }
-
- /**
- * Starts an animation to the new stashed state with the specified duration.
- */
- public void animateToIsStashed(boolean isStashed, long duration) {
- createAnimToIsStashed(isStashed, duration).start();
- }
-
private Animator createAnimToIsStashed(boolean isStashed, long duration) {
AnimatorSet fullLengthAnimatorSet = new AnimatorSet();
// Not exactly half and may overlap. See [first|second]HalfDurationScale below.
@@ -331,4 +325,47 @@
private void onIsStashed(boolean isStashed) {
mControllers.stashedHandleViewController.onIsStashed(isStashed);
}
+
+ public void applyState() {
+ applyState(TASKBAR_STASH_DURATION);
+ }
+
+ public void applyState(long duration) {
+ mStatePropertyHolder.setState(mState, duration);
+ }
+
+ /**
+ * Updates the proper flag to indicate whether the task bar should be stashed.
+ *
+ * Note that this only updates the flag. {@link #applyState()} needs to be called separately.
+ *
+ * @param flag The flag to update.
+ * @param enabled Whether to enable the flag: True will cause the task bar to be stashed /
+ * unstashed.
+ */
+ public void updateStateForFlag(int flag, boolean enabled) {
+ if (enabled) {
+ mState |= flag;
+ } else {
+ mState &= ~flag;
+ }
+ }
+
+ private class StatePropertyHolder {
+ private final IntPredicate mStashCondition;
+
+ private boolean mIsStashed;
+
+ StatePropertyHolder(IntPredicate stashCondition) {
+ mStashCondition = stashCondition;
+ }
+
+ public void setState(int flags, long duration) {
+ boolean isStashed = mStashCondition.test(flags);
+ if (mIsStashed != isStashed) {
+ mIsStashed = isStashed;
+ createAnimToIsStashed(mIsStashed, duration).start();
+ }
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUnfoldAnimationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUnfoldAnimationController.java
new file mode 100644
index 0000000..978bd47
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUnfoldAnimationController.java
@@ -0,0 +1,88 @@
+/*
+ * 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.taskbar;
+
+import android.view.View;
+import android.view.WindowManager;
+
+import com.android.quickstep.util.LauncherViewsMoveFromCenterTranslationApplier;
+import com.android.quickstep.util.ScopedUnfoldTransitionProgressProvider;
+import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator;
+import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
+
+/**
+ * Controls animation of taskbar icons when unfolding foldable devices
+ */
+public class TaskbarUnfoldAnimationController {
+
+ private final ScopedUnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
+ private final UnfoldMoveFromCenterAnimator mMoveFromCenterAnimator;
+ private final TransitionListener mTransitionListener = new TransitionListener();
+ private TaskbarViewController mTaskbarViewController;
+
+ public TaskbarUnfoldAnimationController(ScopedUnfoldTransitionProgressProvider
+ unfoldTransitionProgressProvider, WindowManager windowManager) {
+ mUnfoldTransitionProgressProvider = unfoldTransitionProgressProvider;
+ mMoveFromCenterAnimator = new UnfoldMoveFromCenterAnimator(windowManager,
+ new LauncherViewsMoveFromCenterTranslationApplier());
+ }
+
+ /**
+ * Initializes the controller
+ * @param taskbarControllers references to all other taskbar controllers
+ */
+ public void init(TaskbarControllers taskbarControllers) {
+ mTaskbarViewController = taskbarControllers.taskbarViewController;
+ mTaskbarViewController.addOneTimePreDrawListener(() ->
+ mUnfoldTransitionProgressProvider.setReadyToHandleTransition(true));
+ mUnfoldTransitionProgressProvider.addCallback(mTransitionListener);
+ }
+
+ /**
+ * Destroys the controller
+ */
+ public void onDestroy() {
+ mUnfoldTransitionProgressProvider.setReadyToHandleTransition(false);
+ mUnfoldTransitionProgressProvider.removeCallback(mTransitionListener);
+ }
+
+ private class TransitionListener implements TransitionProgressListener {
+
+ @Override
+ public void onTransitionStarted() {
+ mMoveFromCenterAnimator.updateDisplayProperties();
+ View[] icons = mTaskbarViewController.getIconViews();
+ for (View icon : icons) {
+ // TODO(b/193794563) we should re-register views if they are re-bound/re-inflated
+ // during the animation
+ mMoveFromCenterAnimator.registerViewForAnimation(icon);
+ }
+
+ mMoveFromCenterAnimator.onTransitionStarted();
+ }
+
+ @Override
+ public void onTransitionFinished() {
+ mMoveFromCenterAnimator.onTransitionFinished();
+ mMoveFromCenterAnimator.clearRegisteredViews();
+ }
+
+ @Override
+ public void onTransitionProgress(float progress) {
+ mMoveFromCenterAnimator.onTransitionProgress(progress);
+ }
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 5144d9a..59393d7 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -243,7 +243,19 @@
if (!mTouchEnabled) {
return true;
}
- mControllerCallbacks.onTouchEvent(event);
+ if (mIconLayoutBounds.contains((int) event.getX(), (int) event.getY())) {
+ // Don't allow long pressing between icons.
+ return true;
+ }
+ if (mControllerCallbacks.onTouchEvent(event)) {
+ int oldAction = event.getAction();
+ try {
+ event.setAction(MotionEvent.ACTION_CANCEL);
+ return super.onTouchEvent(event);
+ } finally {
+ event.setAction(oldAction);
+ }
+ }
return super.onTouchEvent(event);
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 40b0e18..f359a3d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -16,20 +16,24 @@
package com.android.launcher3.taskbar;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
-import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.quickstep.AnimatedFloat.VALUE;
import android.graphics.Rect;
+import android.util.FloatProperty;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewTreeObserver;
+import android.view.ViewTreeObserver.OnPreDrawListener;
+import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
+import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
@@ -117,6 +121,25 @@
mTaskbarView.setClickAndLongClickListenersForIcon(icon);
}
+ /**
+ * Adds one time pre draw listener to the taskbar view, it is called before
+ * drawing a frame and invoked only once
+ * @param listener callback that will be invoked before drawing the next frame
+ */
+ public void addOneTimePreDrawListener(Runnable listener) {
+ mTaskbarView.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() {
+ @Override
+ public boolean onPreDraw() {
+ final ViewTreeObserver viewTreeObserver = mTaskbarView.getViewTreeObserver();
+ if (viewTreeObserver.isAlive()) {
+ listener.run();
+ viewTreeObserver.removeOnPreDrawListener(this);
+ }
+ return true;
+ }
+ });
+ }
+
public Rect getIconLayoutBounds() {
return mTaskbarView.getIconLayoutBounds();
}
@@ -194,7 +217,7 @@
float childCenter = (child.getLeft() + child.getRight()) / 2;
float hotseatIconCenter = hotseatPadding.left + hotseatCellSize * info.screenId
+ hotseatCellSize / 2;
- setter.setFloat(child, VIEW_TRANSLATE_X, hotseatIconCenter - childCenter, LINEAR);
+ setter.setFloat(child, ICON_TRANSLATE_X, hotseatIconCenter - childCenter, LINEAR);
}
AnimatorPlaybackController controller = setter.createPlaybackController();
@@ -223,7 +246,11 @@
return view -> mControllers.taskbarStashController.updateAndAnimateIsStashedInApp(true);
}
- public void onTouchEvent(MotionEvent motionEvent) {
+ /**
+ * Get the first chance to handle TaskbarView#onTouchEvent, and return whether we want to
+ * consume the touch so TaskbarView treats it as an ACTION_CANCEL.
+ */
+ public boolean onTouchEvent(MotionEvent motionEvent) {
final float x = motionEvent.getRawX();
final float y = motionEvent.getRawY();
switch (motionEvent.getAction()) {
@@ -239,6 +266,7 @@
mControllers.taskbarStashController.startStashHint(
/* animateForward= */ false);
mCanceledStashHint = true;
+ return true;
}
break;
case MotionEvent.ACTION_UP:
@@ -249,6 +277,33 @@
}
break;
}
+ return false;
}
}
+
+ public static final FloatProperty<View> ICON_TRANSLATE_X =
+ new FloatProperty<View>("taskbarAligmentTranslateX") {
+
+ @Override
+ public void setValue(View view, float v) {
+ if (view instanceof BubbleTextView) {
+ ((BubbleTextView) view).setTranslationXForTaskbarAlignmentAnimation(v);
+ } else if (view instanceof FolderIcon) {
+ ((FolderIcon) view).setTranslationForTaskbarAlignmentAnimation(v);
+ } else {
+ view.setTranslationX(v);
+ }
+ }
+
+ @Override
+ public Float get(View view) {
+ if (view instanceof BubbleTextView) {
+ return ((BubbleTextView) view)
+ .getTranslationXForTaskbarAlignmentAnimation();
+ } else if (view instanceof FolderIcon) {
+ return ((FolderIcon) view).getTranslationXForTaskbarAlignmentAnimation();
+ }
+ return view.getTranslationX();
+ }
+ };
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/contextual/RotationButtonController.java b/quickstep/src/com/android/launcher3/taskbar/contextual/RotationButtonController.java
index 99dc282..c776f16 100644
--- a/quickstep/src/com/android/launcher3/taskbar/contextual/RotationButtonController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/contextual/RotationButtonController.java
@@ -149,7 +149,7 @@
public void init() {
registerListeners();
- if (mDisplayController.getInfo().id != DEFAULT_DISPLAY) {
+ if (mContext.getDisplay().getDisplayId() != DEFAULT_DISPLAY) {
// Currently there is no accelerometer sensor on non-default display, disable fixed
// rotation for non-default display
onDisable2FlagChanged(StatusBarManager.DISABLE2_ROTATE_SUGGESTIONS);
@@ -168,7 +168,7 @@
mListenersRegistered = true;
try {
WindowManagerGlobal.getWindowManagerService()
- .watchRotation(mRotationWatcher, mDisplayController.getInfo().id);
+ .watchRotation(mRotationWatcher, DEFAULT_DISPLAY);
} catch (IllegalArgumentException e) {
mListenersRegistered = false;
Log.w(TAG, "RegisterListeners for the display failed");
@@ -335,7 +335,7 @@
}
public void onBehaviorChanged(int displayId, @WindowInsetsController.Behavior int behavior) {
- if (mDisplayController.getInfo().id != displayId) {
+ if (DEFAULT_DISPLAY != displayId) {
return;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
index 85943b6..c9909cc 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -44,13 +44,26 @@
}
/**
+ * Returns a unique ID representing the display
+ */
+ public static String getUniqueId(Display display) {
+ return display.getUniqueId();
+ }
+
+ /**
* Returns the minimum space that should be left empty at the end of hotseat
*/
public static int getHotseatEndOffset(Context context) {
if (SysUINavigationMode.INSTANCE.get(context).getMode() == Mode.THREE_BUTTONS) {
Resources res = context.getResources();
+ /*
+ * 2 (left + right) x Padding +
+ * 3 nav buttons +
+ * Little space at the end for contextual buttons
+ */
return 2 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_spacing)
- + 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size);
+ + 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
+ + res.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin);
} else {
return 0;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
index c2c721a..1cf50f7 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
@@ -71,7 +71,7 @@
}
}
activityOptions.options.setPendingIntentLaunchFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- activityOptions.options.setSplashscreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
+ activityOptions.options.setSplashscreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_EMPTY);
Object itemInfo = hostView.getTag();
if (itemInfo instanceof ItemInfo) {
mLauncher.addLaunchCookie((ItemInfo) itemInfo, activityOptions.options);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 14bc380..2009cd7 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -36,13 +36,9 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
-import android.hardware.SensorManager;
-import android.hardware.devicestate.DeviceStateManager;
import android.view.HapticFeedbackConstants;
import android.view.View;
-import androidx.annotation.Nullable;
-
import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -79,14 +75,9 @@
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
-import com.android.quickstep.util.LauncherUnfoldAnimationController;
-import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.QuickstepOnboardingPrefs;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
-import com.android.systemui.unfold.UnfoldTransitionFactory;
-import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
-import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -106,51 +97,10 @@
private FixedContainerItems mAllAppsPredictions;
private HotseatPredictionController mHotseatPredictionController;
- @Nullable
- private LauncherUnfoldAnimationController mLauncherUnfoldAnimationController;
-
@Override
protected void setupViews() {
super.setupViews();
mHotseatPredictionController = new HotseatPredictionController(this);
-
- final UnfoldTransitionConfig config = UnfoldTransitionFactory.createConfig(this);
- if (config.isEnabled()) {
- final UnfoldTransitionProgressProvider unfoldTransitionProgressProvider =
- UnfoldTransitionFactory.createUnfoldTransitionProgressProvider(
- this,
- config,
- ProxyScreenStatusProvider.INSTANCE,
- getSystemService(DeviceStateManager.class),
- getSystemService(SensorManager.class),
- getMainThreadHandler(),
- getMainExecutor()
- );
-
- mLauncherUnfoldAnimationController = new LauncherUnfoldAnimationController(
- this,
- getWindowManager(),
- unfoldTransitionProgressProvider
- );
- }
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- if (mLauncherUnfoldAnimationController != null) {
- mLauncherUnfoldAnimationController.onResume();
- }
- }
-
- @Override
- protected void onPause() {
- if (mLauncherUnfoldAnimationController != null) {
- mLauncherUnfoldAnimationController.onPause();
- }
-
- super.onPause();
}
@Override
@@ -281,10 +231,6 @@
public void onDestroy() {
super.onDestroy();
mHotseatPredictionController.destroy();
-
- if (mLauncherUnfoldAnimationController != null) {
- mLauncherUnfoldAnimationController.onDestroy();
- }
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginInitializerImpl.java b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginInitializerImpl.java
deleted file mode 100644
index 0e12e30..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginInitializerImpl.java
+++ /dev/null
@@ -1,35 +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.launcher3.uioverrides.plugins;
-
-import android.content.Context;
-
-import com.android.launcher3.Utilities;
-import com.android.systemui.shared.plugins.PluginInitializer;
-
-public class PluginInitializerImpl implements PluginInitializer {
- @Override
- public String[] getPrivilegedPlugins(Context context) {
- return new String[0];
- }
-
- @Override
- public void handleWtfs() {
- }
-
- public boolean isDebuggable() {
- return Utilities.IS_DEBUG_DEVICE;
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java
index e12f42e..df0ac7c 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java
@@ -24,17 +24,19 @@
import android.content.Intent;
import android.content.pm.ResolveInfo;
+import com.android.launcher3.Utilities;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.PluginListener;
-import com.android.systemui.shared.plugins.PluginInstanceManager;
+import com.android.systemui.shared.plugins.PluginActionManager;
+import com.android.systemui.shared.plugins.PluginInstance;
import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.shared.plugins.PluginManagerImpl;
import com.android.systemui.shared.plugins.PluginPrefs;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@@ -52,29 +54,36 @@
private PluginManagerWrapper(Context c) {
mContext = c;
- PluginInitializerImpl pluginInitializer = new PluginInitializerImpl();
mPluginEnabler = new PluginEnablerImpl(c);
- PluginInstanceManager.Factory instanceManagerFactory = new PluginInstanceManager.Factory(
- c, c.getPackageManager(), c.getMainExecutor(), MODEL_EXECUTOR, pluginInitializer,
+ List<String> privilegedPlugins = Collections.emptyList();
+ PluginInstance.Factory instanceFactory = new PluginInstance.Factory(
+ getClass().getClassLoader(), new PluginInstance.InstanceFactory<>(),
+ new PluginInstance.VersionChecker(), privilegedPlugins,
+ Utilities.IS_DEBUG_DEVICE);
+ PluginActionManager.Factory instanceManagerFactory = new PluginActionManager.Factory(
+ c, c.getPackageManager(), c.getMainExecutor(), MODEL_EXECUTOR,
c.getSystemService(NotificationManager.class), mPluginEnabler,
- Arrays.asList(pluginInitializer.getPrivilegedPlugins(c)));
+ privilegedPlugins, instanceFactory);
mPluginManager = new PluginManagerImpl(c, instanceManagerFactory,
- pluginInitializer.isDebuggable(),
+ Utilities.IS_DEBUG_DEVICE,
Optional.ofNullable(Thread.getDefaultUncaughtExceptionHandler()), mPluginEnabler,
- new PluginPrefs(c), Arrays.asList(pluginInitializer.getPrivilegedPlugins(c)));
+ new PluginPrefs(c), privilegedPlugins);
}
public PluginEnablerImpl getPluginEnabler() {
return mPluginEnabler;
}
- public void addPluginListener(PluginListener<? extends Plugin> listener, Class<?> pluginClass) {
+ /** */
+ public <T extends Plugin> void addPluginListener(
+ PluginListener<T> listener, Class<T> pluginClass) {
addPluginListener(listener, pluginClass, false);
}
- public void addPluginListener(PluginListener<? extends Plugin> listener, Class<?> pluginClass,
- boolean allowMultiple) {
+ /** */
+ public <T extends Plugin> void addPluginListener(
+ PluginListener<T> listener, Class<T> pluginClass, boolean allowMultiple) {
mPluginManager.addPluginListener(listener, pluginClass, allowMultiple);
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
index 9fc0450..d0d7f31 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
@@ -43,12 +43,7 @@
@Override
public float getSplitSelectTranslation(Launcher launcher) {
RecentsView recentsView = launcher.getOverviewPanel();
-//<<<<<<< HEAD
-// int splitPosition = recentsView.getSplitPlaceholder()
-// .getActiveSplitPositionOption().stagePosition;
-//=======
int splitPosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition();
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) {
return 0f;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
index 283743d..ef6f53e 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
@@ -24,7 +24,7 @@
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
-import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
+import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import android.animation.ObjectAnimator;
@@ -38,11 +38,11 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.states.StateAnimationConfig;
-import com.android.launcher3.util.VibratorWrapper;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.OverviewToHomeAnim;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.quickstep.views.RecentsView;
/**
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index 40c3e02..ff3c517 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -41,7 +41,7 @@
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_RIGHT;
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_UP;
import static com.android.launcher3.util.DisplayController.getSingleFrameMs;
-import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
+import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
@@ -67,14 +67,15 @@
import com.android.launcher3.touch.BaseSwipeDetector;
import com.android.launcher3.touch.BothAxesSwipeDetector;
import com.android.launcher3.util.TouchController;
-import com.android.launcher3.util.VibratorWrapper;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.util.MotionPauseDetector;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.quickstep.util.WorkspaceRevealAnim;
import com.android.quickstep.views.LauncherRecentsView;
+import com.android.quickstep.views.RecentsView;
/**
* Handles quick switching to a recent task from the home screen. To give as much flexibility to
@@ -398,6 +399,14 @@
nonOverviewAnim.setFloatValues(startProgress, endProgress);
mNonOverviewAnim.dispatchOnStart();
}
+ if (targetState == QUICK_SWITCH) {
+ // Navigating to quick switch, add scroll feedback since the first time is not
+ // considered a scroll by the RecentsView.
+ VibratorWrapper.INSTANCE.get(mLauncher).vibrate(
+ RecentsView.SCROLL_VIBRATION_PRIMITIVE,
+ RecentsView.SCROLL_VIBRATION_PRIMITIVE_SCALE,
+ RecentsView.SCROLL_VIBRATION_FALLBACK);
+ }
nonOverviewAnim.setDuration(Math.max(xDuration, yDuration));
mNonOverviewAnim.setEndAction(() -> onAnimationToStateCompleted(targetState));
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index 0603ba5..010f463 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -22,6 +22,7 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.os.SystemClock;
+import android.os.VibrationEffect;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Interpolator;
@@ -41,6 +42,7 @@
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.SysUINavigationMode;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
@@ -55,6 +57,12 @@
private static final long MIN_TASK_DISMISS_ANIMATION_DURATION = 300;
private static final long MAX_TASK_DISMISS_ANIMATION_DURATION = 600;
+ public static final int TASK_DISMISS_VIBRATION_PRIMITIVE =
+ Utilities.ATLEAST_R ? VibrationEffect.Composition.PRIMITIVE_TICK : -1;
+ public static final float TASK_DISMISS_VIBRATION_PRIMITIVE_SCALE = 1f;
+ public static final VibrationEffect TASK_DISMISS_VIBRATION_FALLBACK =
+ VibratorWrapper.EFFECT_TEXTURE_TICK;
+
protected final T mActivity;
private final SingleAxisSwipeDetector mDetector;
private final RecentsView mRecentsView;
@@ -334,10 +342,10 @@
fling = false;
}
PagedOrientationHandler orientationHandler = mRecentsView.getPagedOrientationHandler();
+ boolean goingUp = orientationHandler.isGoingUp(velocity, mIsRtl);
float progress = mCurrentAnimation.getProgressFraction();
float interpolatedProgress = mCurrentAnimation.getInterpolatedProgress();
if (fling) {
- boolean goingUp = orientationHandler.isGoingUp(velocity, mIsRtl);
goingToEnd = goingUp == mCurrentAnimationIsGoingUp;
} else {
goingToEnd = interpolatedProgress > SUCCESS_TRANSITION_PROGRESS;
@@ -357,6 +365,10 @@
mCurrentAnimation.startWithVelocity(mActivity, goingToEnd,
velocity * orientationHandler.getSecondaryTranslationDirectionFactor(),
mEndDisplacement, animationDuration);
+ if (goingUp && goingToEnd) {
+ VibratorWrapper.INSTANCE.get(mActivity).vibrate(TASK_DISMISS_VIBRATION_PRIMITIVE,
+ TASK_DISMISS_VIBRATION_PRIMITIVE_SCALE, TASK_DISMISS_VIBRATION_FALLBACK);
+ }
}
private void clearState() {
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 6e90a3a..fff8915 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -36,7 +36,6 @@
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.SystemUiController.UI_STATE_FULLSCREEN_TASK;
-import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.GestureState.GestureEndTarget.HOME;
import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK;
import static com.android.quickstep.GestureState.GestureEndTarget.NEW_TASK;
@@ -46,6 +45,7 @@
import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_CANCELED;
import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
+import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
@@ -92,10 +92,10 @@
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.launcher3.tracing.SwipeHandlerProto;
import com.android.launcher3.util.TraceHelper;
-import com.android.launcher3.util.VibratorWrapper;
import com.android.launcher3.util.WindowBounds;
import com.android.quickstep.BaseActivityInterface.AnimationFactory;
import com.android.quickstep.GestureState.GestureEndTarget;
+import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AnimatorControllerWithResistance;
@@ -111,6 +111,7 @@
import com.android.quickstep.util.SwipePipToHomeAnimator;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -269,7 +270,7 @@
TaskAnimationManager taskAnimationManager, GestureState gestureState,
long touchTimeMs, boolean continuingLastGesture,
InputConsumerController inputConsumer) {
- super(context, deviceState, gestureState, new TransformParams());
+ super(context, deviceState, gestureState);
mActivityInterface = gestureState.getActivityInterface();
mActivityInitListener = mActivityInterface.createActivityInitListener(this::onActivityInit);
mInputConsumerProxy =
@@ -434,7 +435,7 @@
// RecentsView never updates the display rotation until swipe-up, force update
// RecentsOrientedState before passing to TaskViewSimulator.
mRecentsView.updateRecentsRotation();
- runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.setOrientationState(mRecentsView.getPagedViewOrientedState()));
// If we've already ended the gesture and are going home, don't prepare recents UI,
@@ -531,7 +532,7 @@
ActivityManager.RunningTaskInfo[] runningTasks;
if (mIsSwipeForStagedSplit) {
int[] splitTaskIds =
- LauncherSplitScreenListener.INSTANCE.getNoCreate().getSplitTaskIds();
+ LauncherSplitScreenListener.INSTANCE.getNoCreate().getRunningSplitTaskIds();
runningTasks = new ActivityManager.RunningTaskInfo[splitTaskIds.length];
for (int i = 0; i < splitTaskIds.length; i++) {
int taskId = splitTaskIds[i];
@@ -753,6 +754,8 @@
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
super.onRecentsAnimationStart(controller, targets);
+ ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targets.apps.length);
+ mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(targets);
mRecentsAnimationController = controller;
mRecentsAnimationTargets = targets;
@@ -763,7 +766,7 @@
// orientation state is independent of which remote target handle we use since both
// should be pointing to the same one. Just choose index 0 for now since that works for
// both split and non-split
- RecentsOrientedState orientationState = mRemoteTargetHandles[0].mTaskViewSimulator
+ RecentsOrientedState orientationState = mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState();
DeviceProfile dp = orientationState.getLauncherDeviceProfile();
if (targets.minimizedHomeBounds != null && primaryTaskTarget != null) {
@@ -805,7 +808,9 @@
mActivityInitListener.unregister();
mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED);
- TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true);
+ if (mRecentsAnimationTargets != null) {
+ TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true);
+ }
// Defer clearing the controller and the targets until after we've updated the state
mRecentsAnimationController = null;
@@ -940,6 +945,7 @@
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
// Notify swipe-to-home (recents animation) is finished
SystemUiProxy.INSTANCE.get(mContext).notifySwipeToHomeFinished();
+ LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
break;
case RECENTS:
mStateCallback.setState(STATE_SCALED_CONTROLLER_RECENTS | STATE_CAPTURE_SCREENSHOT
@@ -1348,7 +1354,7 @@
RemoteAnimationTargetCompat runningTaskTarget, float startProgress) {
// Directly animate the app to PiP (picture-in-picture) mode
final ActivityManager.RunningTaskInfo taskInfo = mGestureState.getRunningTask();
- final RecentsOrientedState orientationState = mRemoteTargetHandles[0].mTaskViewSimulator
+ final RecentsOrientedState orientationState = mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState();
final int windowRotation = calculateWindowRotation(runningTaskTarget, orientationState);
final int homeRotation = orientationState.getRecentsActivityRotation();
@@ -1384,7 +1390,7 @@
// is not ROTATION_0 (which implies the rotation is turned on in launcher settings).
if (homeRotation == ROTATION_0
&& (windowRotation == ROTATION_90 || windowRotation == ROTATION_270)) {
- builder.setFromRotation(mRemoteTargetHandles[0].mTaskViewSimulator, windowRotation,
+ builder.setFromRotation(mRemoteTargetHandles[0].getTaskViewSimulator(), windowRotation,
taskInfo.displayCutoutInsets);
}
final SwipePipToHomeAnimator swipePipToHomeAnimator = builder.build();
@@ -1754,7 +1760,7 @@
* depend on proper class initialization.
*/
protected void initAfterSubclassConstructor() {
- initTransitionEndpoints(mRemoteTargetHandles[0].mTaskViewSimulator
+ initTransitionEndpoints(mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState().getLauncherDeviceProfile());
}
@@ -1772,7 +1778,7 @@
protected void linkRecentsViewScroll() {
SurfaceTransactionApplier.create(mRecentsView, applier -> {
- runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.mTransformParams
+ runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTransformParams()
.setSyncTransactionApplier(applier));
runOnRecentsAnimationStart(() ->
mRecentsAnimationTargets.addReleaseCheck(applier));
@@ -1800,8 +1806,13 @@
mGestureState.updateLastStartedTaskId(taskId);
boolean hasTaskPreviouslyAppeared = mGestureState.getPreviouslyAppearedTaskIds()
.contains(taskId);
+ boolean isOldTaskSplit = LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getRunningSplitTaskIds().length > 0;
nextTask.launchTask(success -> {
resultCallback.accept(success);
+ if (isOldTaskSplit) {
+ SystemUiProxy.INSTANCE.getNoCreate().exitSplitScreen(taskId);
+ }
if (success) {
if (hasTaskPreviouslyAppeared) {
onRestartPreviouslyAppearedTask();
@@ -1908,18 +1919,19 @@
boolean notSwipingPipToHome = mRecentsAnimationTargets != null && !mIsSwipingPipToHome;
boolean setRecentsScroll = mRecentsViewScrollLinked && mRecentsView != null;
for (RemoteTargetHandle remoteHandle : mRemoteTargetHandles) {
- AnimatorControllerWithResistance playbackController = remoteHandle.mPlaybackController;
+ AnimatorControllerWithResistance playbackController =
+ remoteHandle.getPlaybackController();
if (playbackController != null) {
playbackController.setProgress(Math.max(mCurrentShift.value,
getScaleProgressDueToScroll()), mDragLengthFactor);
}
if (notSwipingPipToHome) {
- TaskViewSimulator taskViewSimulator = remoteHandle.mTaskViewSimulator;
+ TaskViewSimulator taskViewSimulator = remoteHandle.getTaskViewSimulator();
if (setRecentsScroll) {
taskViewSimulator.setScroll(mRecentsView.getScrollOffset());
}
- taskViewSimulator.apply(remoteHandle.mTransformParams);
+ taskViewSimulator.apply(remoteHandle.getTransformParams());
}
}
ProtoTracer.INSTANCE.get(mContext).scheduleFrameUpdate();
diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
index 773817f..80ae65e 100644
--- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
@@ -105,7 +105,7 @@
mRunningOverHome = ActivityManagerWrapper.isHomeTask(mGestureState.getRunningTask());
if (mRunningOverHome) {
runActionOnRemoteHandles(remoteTargetHandle ->
- remoteTargetHandle.mTransformParams.setHomeBuilderProxy(
+ remoteTargetHandle.getTransformParams().setHomeBuilderProxy(
FallbackSwipeHandler.this::updateHomeActivityTransformDuringSwipeUp));
}
}
@@ -115,7 +115,8 @@
super.initTransitionEndpoints(dp);
if (mRunningOverHome) {
// Full screen scale should be independent of remote target handle
- mMaxLauncherScale = 1 / mRemoteTargetHandles[0].mTaskViewSimulator.getFullScreenScale();
+ mMaxLauncherScale = 1 / mRemoteTargetHandles[0].getTaskViewSimulator()
+ .getFullScreenScale();
}
}
@@ -214,21 +215,21 @@
mHomeAlpha.value = Utilities.boundToRange(1 - mCurrentShift.value, 0, 1);
mVerticalShiftForScale.value = mCurrentShift.value;
runActionOnRemoteHandles(remoteTargetHandle ->
- remoteTargetHandle.mTransformParams.setHomeBuilderProxy(
+ remoteTargetHandle.getTransformParams().setHomeBuilderProxy(
FallbackHomeAnimationFactory.this
::updateHomeActivityTransformDuringHomeAnim));
} else {
mHomeAlpha = new AnimatedFloat(this::updateHomeAlpha);
mHomeAlpha.value = 0;
runActionOnRemoteHandles(remoteTargetHandle ->
- remoteTargetHandle.mTransformParams.setHomeBuilderProxy(
+ remoteTargetHandle.getTransformParams().setHomeBuilderProxy(
FallbackHomeAnimationFactory.this
::updateHomeActivityTransformDuringHomeAnim));
}
mRecentsAlpha.value = 1;
runActionOnRemoteHandles(remoteTargetHandle ->
- remoteTargetHandle.mTransformParams.setHomeBuilderProxy(
+ remoteTargetHandle.getTransformParams().setHomeBuilderProxy(
FallbackHomeAnimationFactory.this
::updateRecentsActivityTransformDuringHomeAnim));
}
diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
index ce3406c..dc22a61 100644
--- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
+++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
@@ -183,13 +183,13 @@
Rect crop = new Rect();
// We can assume there is only one remote target here because staged split never animates
// into the app icon, only into the homescreen
- mRemoteTargetHandles[0].mTaskViewSimulator.getCurrentCropRect().roundOut(crop);
+ mRemoteTargetHandles[0].getTaskViewSimulator().getCurrentCropRect().roundOut(crop);
Size windowSize = new Size(crop.width(), crop.height());
int fallbackBackgroundColor =
FloatingWidgetView.getDefaultBackgroundColor(mContext, runningTaskTarget);
FloatingWidgetView floatingWidgetView = FloatingWidgetView.getFloatingWidgetView(mActivity,
hostView, backgroundLocation, windowSize,
- mRemoteTargetHandles[0].mTaskViewSimulator.getCurrentCornerRadius(),
+ mRemoteTargetHandles[0].getTaskViewSimulator().getCurrentCornerRadius(),
isTargetTranslucent, fallbackBackgroundColor);
return new FloatingViewHomeAnimationFactory(floatingWidgetView) {
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index 8fb851c..b232464 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -32,6 +32,7 @@
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.util.RunnableList;
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
+import com.android.quickstep.util.LauncherSplitScreenListener;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -157,6 +158,7 @@
}
if (cmd.type == TYPE_HOME) {
mService.startActivity(mOverviewComponentObserver.getHomeIntent());
+ LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
return true;
}
} else {
@@ -175,6 +177,7 @@
return launchTask(recents, getNextTask(recents), cmd);
case TYPE_HOME:
recents.startHome();
+ LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
return true;
}
}
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
index 780032e..0efe666 100644
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -33,11 +33,8 @@
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.os.SystemClock;
-import android.util.Log;
import android.util.SparseIntArray;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.tracing.OverviewComponentObserverProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
import com.android.launcher3.util.SimpleBroadcastReceiver;
@@ -132,16 +129,6 @@
private void updateOverviewTargets() {
ComponentName defaultHome = PackageManagerWrapper.getInstance()
.getHomeActivities(new ArrayList<>());
- if (TestProtocol.sDebugTracing && defaultHome == null) {
- Log.d(TestProtocol.THIRD_PARTY_LAUNCHER_NOT_SET, "getHomeActivities returned null");
- while ((defaultHome =
- PackageManagerWrapper.getInstance().getHomeActivities(new ArrayList<>()))
- == null) {
- SystemClock.sleep(10);
- }
- Log.d(TestProtocol.THIRD_PARTY_LAUNCHER_NOT_SET,
- "getHomeActivities returned non-null: " + defaultHome);
- }
mIsHomeDisabled = mDeviceState.isHomeDisabled();
mIsDefaultHome = Objects.equals(mMyHomeIntent.getComponent(), defaultHome);
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 03e2395..cc6cfd7 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -122,7 +122,7 @@
SYSUI_PROGRESS.set(getRootView().getSysUiScrim(), 0f);
SplitSelectStateController controller =
- new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this));
+ new SplitSelectStateController(SystemUiProxy.INSTANCE.get(this));
mDragLayer.recreateControllers();
mFallbackRecentsView.init(mActionsView, controller);
}
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index 444d77a..8a9bf7c 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -18,6 +18,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.content.Intent.ACTION_USER_UNLOCKED;
+import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.launcher3.util.DisplayController.CHANGE_ALL;
import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION;
@@ -59,7 +60,6 @@
import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.Surface;
@@ -67,7 +67,6 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
@@ -147,7 +146,7 @@
mContext = context;
mDisplayController = DisplayController.INSTANCE.get(context);
mSysUiNavMode = SysUINavigationMode.INSTANCE.get(context);
- mDisplayId = mDisplayController.getInfo().id;
+ mDisplayId = DEFAULT_DISPLAY;
mIsOneHandedModeSupported = SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false);
runOnDestroy(() -> mDisplayController.removeChangeListener(this));
mRotationTouchHelper = RotationTouchHelper.INSTANCE.get(context);
diff --git a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
new file mode 100644
index 0000000..dc04016
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
@@ -0,0 +1,175 @@
+/*
+ * 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.quickstep;
+
+import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
+
+import android.content.Context;
+
+import androidx.annotation.Nullable;
+
+import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.quickstep.util.AnimatorControllerWithResistance;
+import com.android.quickstep.util.LauncherSplitScreenListener;
+import com.android.quickstep.util.TaskViewSimulator;
+import com.android.quickstep.util.TransformParams;
+import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
+
+/**
+ * Glues together the necessary components to animate a remote target using a
+ * {@link TaskViewSimulator}
+ */
+public class RemoteTargetGluer {
+ private final RemoteTargetHandle[] mRemoteTargetHandles;
+ private SplitConfigurationOptions.StagedSplitBounds mStagedSplitBounds;
+
+ /**
+ * Use this constructor if remote targets are split-screen independent
+ */
+ public RemoteTargetGluer(Context context, BaseActivityInterface sizingStrategy,
+ RemoteAnimationTargets targets) {
+ mRemoteTargetHandles = createHandles(context, sizingStrategy, targets.apps.length);
+ }
+
+ /**
+ * Use this constructor if you want the number of handles created to match the number of active
+ * running tasks
+ */
+ public RemoteTargetGluer(Context context, BaseActivityInterface sizingStrategy) {
+ int[] splitIds = LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getRunningSplitTaskIds();
+ mRemoteTargetHandles = createHandles(context, sizingStrategy, splitIds.length == 2 ? 2 : 1);
+ }
+
+ private RemoteTargetHandle[] createHandles(Context context,
+ BaseActivityInterface sizingStrategy, int numHandles) {
+ RemoteTargetHandle[] handles = new RemoteTargetHandle[numHandles];
+ for (int i = 0; i < numHandles; i++) {
+ TaskViewSimulator tvs = new TaskViewSimulator(context, sizingStrategy);
+ TransformParams transformParams = new TransformParams();
+ handles[i] = new RemoteTargetHandle(tvs, transformParams);
+ }
+ return handles;
+ }
+
+ /**
+ * Pairs together {@link TaskViewSimulator}s and {@link TransformParams} into a
+ * {@link RemoteTargetHandle}
+ * Assigns only the apps associated with {@param targets} into their own TaskViewSimulators.
+ * Length of targets.apps should match that of {@link #mRemoteTargetHandles}.
+ *
+ * If split screen may be active when this is called, you might want to use
+ * {@link #assignTargetsForSplitScreen(RemoteAnimationTargets)}
+ */
+ public RemoteTargetHandle[] assignTargets(RemoteAnimationTargets targets) {
+ for (int i = 0; i < mRemoteTargetHandles.length; i++) {
+ RemoteAnimationTargetCompat primaryTaskTarget = targets.apps[i];
+ mRemoteTargetHandles[i].mTransformParams.setTargetSet(
+ createRemoteAnimationTargetsForTarget(primaryTaskTarget, targets));
+ mRemoteTargetHandles[i].mTaskViewSimulator.setPreview(primaryTaskTarget, null);
+ }
+ return mRemoteTargetHandles;
+ }
+
+ /**
+ * Similar to {@link #assignTargets(RemoteAnimationTargets)}, except this matches the
+ * apps in targets.apps to that of the split screened tasks. If split screen is active, then
+ * {@link #mRemoteTargetHandles} index 0 will be the left/top task, index one right/bottom
+ */
+ public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets) {
+ int[] splitIds = LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getRunningSplitTaskIds();
+ RemoteAnimationTargetCompat primaryTaskTarget;
+ RemoteAnimationTargetCompat secondaryTaskTarget;
+ if (mRemoteTargetHandles.length == 1) {
+ // If we're not in split screen, the splitIds count doesn't really matter since we
+ // should always hit this case. Right now there's no use case for multiple app targets
+ // without being in split screen
+ primaryTaskTarget = targets.apps[0];
+ mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
+ mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget, null);
+ } else {
+ // split screen
+ primaryTaskTarget = targets.findTask(splitIds[0]);
+ secondaryTaskTarget = targets.findTask(splitIds[1]);
+
+ mStagedSplitBounds = new SplitConfigurationOptions.StagedSplitBounds(
+ primaryTaskTarget.screenSpaceBounds,
+ secondaryTaskTarget.screenSpaceBounds);
+ mRemoteTargetHandles[0].mTransformParams.setTargetSet(
+ createRemoteAnimationTargetsForTarget(primaryTaskTarget, targets));
+ mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget,
+ mStagedSplitBounds);
+
+ mRemoteTargetHandles[1].mTransformParams.setTargetSet(
+ createRemoteAnimationTargetsForTarget(secondaryTaskTarget, targets));
+ mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(secondaryTaskTarget,
+ mStagedSplitBounds);
+ }
+ return mRemoteTargetHandles;
+ }
+
+ private RemoteAnimationTargets createRemoteAnimationTargetsForTarget(
+ RemoteAnimationTargetCompat target,
+ RemoteAnimationTargets targets) {
+ return new RemoteAnimationTargets(new RemoteAnimationTargetCompat[]{target},
+ targets.wallpapers, targets.nonApps, targets.targetMode);
+ }
+
+ public RemoteTargetHandle[] getRemoteTargetHandles() {
+ return mRemoteTargetHandles;
+ }
+
+ public SplitConfigurationOptions.StagedSplitBounds getStagedSplitBounds() {
+ return mStagedSplitBounds;
+ }
+
+ /**
+ * Container to keep together all the associated objects whose properties need to be updated to
+ * animate a single remote app target
+ */
+ public static class RemoteTargetHandle {
+ private final TaskViewSimulator mTaskViewSimulator;
+ private final TransformParams mTransformParams;
+ @Nullable
+ private AnimatorControllerWithResistance mPlaybackController;
+
+ public RemoteTargetHandle(TaskViewSimulator taskViewSimulator,
+ TransformParams transformParams) {
+ mTransformParams = transformParams;
+ mTaskViewSimulator = taskViewSimulator;
+ }
+
+ public TaskViewSimulator getTaskViewSimulator() {
+ return mTaskViewSimulator;
+ }
+
+ public TransformParams getTransformParams() {
+ return mTransformParams;
+ }
+
+ @Nullable
+ public AnimatorControllerWithResistance getPlaybackController() {
+ return mPlaybackController;
+ }
+
+ public void setPlaybackController(
+ @Nullable AnimatorControllerWithResistance playbackController) {
+ mPlaybackController = playbackController;
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
index 678b176..35efddf 100644
--- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java
+++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
@@ -15,6 +15,7 @@
*/
package com.android.quickstep;
+import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Surface.ROTATION_0;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
@@ -25,7 +26,6 @@
import android.content.Context;
import android.content.res.Resources;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
@@ -35,7 +35,6 @@
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.quickstep.util.RecentsOrientedState;
-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;
@@ -146,10 +145,10 @@
mDisplayController = DisplayController.INSTANCE.get(mContext);
Resources resources = mContext.getResources();
mSysUiNavMode = SysUINavigationMode.INSTANCE.get(mContext);
- mDisplayId = mDisplayController.getInfo().id;
+ mDisplayId = DEFAULT_DISPLAY;
mOrientationTouchTransformer = new OrientationTouchTransformer(resources, mMode,
- () -> QuickStepContract.getWindowCornerRadius(resources));
+ () -> QuickStepContract.getWindowCornerRadius(mContext));
// Register for navigation mode changes
SysUINavigationMode.Mode newMode = mSysUiNavMode.addModeChangeListener(this);
diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
index 1f57e99..d188018 100644
--- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
+++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
@@ -15,13 +15,10 @@
*/
package com.android.quickstep;
-import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
-
import static com.android.launcher3.anim.Interpolators.ACCEL_1_5;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_SELECT;
import static com.android.launcher3.config.FeatureFlags.PROTOTYPE_APP_CLOSE;
-import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import android.animation.Animator;
import android.content.Context;
@@ -40,8 +37,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.touch.PagedOrientationHandler;
-import com.android.launcher3.util.SplitConfigurationOptions;
-import com.android.quickstep.util.ActiveGestureLog;
+import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.AppCloseConfig;
import com.android.quickstep.util.LauncherSplitScreenListener;
@@ -60,6 +56,7 @@
RecentsAnimationCallbacks.RecentsAnimationListener{
protected static final Rect TEMP_RECT = new Rect();
+ protected final RemoteTargetGluer mTargetGluer;
protected DeviceProfile mDp;
@@ -67,8 +64,7 @@
protected final RecentsAnimationDeviceState mDeviceState;
protected final GestureState mGestureState;
- protected final RemoteTargetHandle[] mRemoteTargetHandles;
- protected SplitConfigurationOptions.StagedSplitBounds mStagedSplitBounds;
+ protected RemoteTargetHandle[] mRemoteTargetHandles;
// Shift in the range of [0, 1].
// 0 => preview snapShot is completely visible, and hotseat is completely translated down
@@ -84,52 +80,44 @@
protected boolean mIsSwipeForStagedSplit;
public SwipeUpAnimationLogic(Context context, RecentsAnimationDeviceState deviceState,
- GestureState gestureState, TransformParams transformParams) {
+ GestureState gestureState) {
mContext = context;
mDeviceState = deviceState;
mGestureState = gestureState;
mIsSwipeForStagedSplit = ENABLE_SPLIT_SELECT.get() &&
- LauncherSplitScreenListener.INSTANCE.getNoCreate().getSplitTaskIds().length > 1;
+ LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getRunningSplitTaskIds().length > 1;
- TaskViewSimulator primaryTVS = new TaskViewSimulator(context,
- gestureState.getActivityInterface());
- primaryTVS.getOrientationState().update(
- mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(),
- mDeviceState.getRotationTouchHelper().getDisplayRotation());
- mRemoteTargetHandles = new RemoteTargetHandle[mIsSwipeForStagedSplit ? 2 : 1];
- mRemoteTargetHandles[0] = new RemoteTargetHandle(primaryTVS, transformParams);
-
- if (mIsSwipeForStagedSplit) {
- TaskViewSimulator secondaryTVS = new TaskViewSimulator(context,
- gestureState.getActivityInterface());
- secondaryTVS.getOrientationState().update(
- mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(),
- mDeviceState.getRotationTouchHelper().getDisplayRotation());
- mRemoteTargetHandles[1] = new RemoteTargetHandle(secondaryTVS, new TransformParams());
- }
+ mTargetGluer = new RemoteTargetGluer(mContext, mGestureState.getActivityInterface());
+ mRemoteTargetHandles = mTargetGluer.getRemoteTargetHandles();
+ runActionOnRemoteHandles(remoteTargetHandle ->
+ remoteTargetHandle.getTaskViewSimulator().getOrientationState().update(
+ mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(),
+ mDeviceState.getRotationTouchHelper().getDisplayRotation()
+ ));
}
protected void initTransitionEndpoints(DeviceProfile dp) {
mDp = dp;
mTransitionDragLength = mGestureState.getActivityInterface().getSwipeUpDestinationAndLength(
- dp, mContext, TEMP_RECT, mRemoteTargetHandles[0].mTaskViewSimulator
+ dp, mContext, TEMP_RECT, mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState().getOrientationHandler());
mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength;
for (RemoteTargetHandle remoteHandle : mRemoteTargetHandles) {
PendingAnimation pendingAnimation = new PendingAnimation(mTransitionDragLength * 2);
- TaskViewSimulator taskViewSimulator = remoteHandle.mTaskViewSimulator;
+ TaskViewSimulator taskViewSimulator = remoteHandle.getTaskViewSimulator();
taskViewSimulator.setDp(dp);
taskViewSimulator.addAppToOverviewAnim(pendingAnimation, LINEAR);
AnimatorPlaybackController playbackController =
pendingAnimation.createPlaybackController();
- remoteHandle.mPlaybackController = AnimatorControllerWithResistance.createForRecents(
+ remoteHandle.setPlaybackController(AnimatorControllerWithResistance.createForRecents(
playbackController, mContext, taskViewSimulator.getOrientationState(),
mDp, taskViewSimulator.recentsViewScale, AnimatedFloat.VALUE,
taskViewSimulator.recentsViewSecondaryTranslation, AnimatedFloat.VALUE
- );
+ ));
}
}
@@ -156,7 +144,7 @@
protected PagedOrientationHandler getOrientationHandler() {
// OrientationHandler should be independent of remote target, can directly take one
- return mRemoteTargetHandles[0].mTaskViewSimulator
+ return mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState().getOrientationHandler();
}
@@ -245,8 +233,8 @@
for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length;
i < mRemoteTargetHandlesLength; i++) {
RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
- TaskViewSimulator tvs = remoteHandle.mTaskViewSimulator;
- tvs.apply(remoteHandle.mTransformParams.setProgress(startProgress));
+ TaskViewSimulator tvs = remoteHandle.getTaskViewSimulator();
+ tvs.apply(remoteHandle.getTransformParams().setProgress(startProgress));
startRects[i] = new RectF(tvs.getCurrentCropRect());
tvs.applyWindowToHomeRotation(outMatrix);
@@ -265,51 +253,10 @@
/** @return only the TaskViewSimulators from {@link #mRemoteTargetHandles} */
protected TaskViewSimulator[] getRemoteTaskViewSimulators() {
return Arrays.stream(mRemoteTargetHandles)
- .map(remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator)
+ .map(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator())
.toArray(TaskViewSimulator[]::new);
}
- @Override
- public void onRecentsAnimationStart(RecentsAnimationController controller,
- RecentsAnimationTargets targets) {
- ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targets.apps.length);
- RemoteAnimationTargetCompat dividerTarget = targets.getNonAppTargetOfType(
- TYPE_DOCK_DIVIDER);
- RemoteAnimationTargetCompat primaryTaskTarget;
- RemoteAnimationTargetCompat secondaryTaskTarget;
-
- // TODO(b/197568823) Determine if we need to exclude assistant as one of the targets we
- // animate
- if (!mIsSwipeForStagedSplit) {
- primaryTaskTarget = targets.findTask(mGestureState.getRunningTaskId());
- mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
-
- if (primaryTaskTarget != null) {
- mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget);
- }
- } else {
- // We're in staged split
- primaryTaskTarget = targets.apps[0];
- secondaryTaskTarget = targets.apps[1];
- mStagedSplitBounds = new SplitConfigurationOptions.StagedSplitBounds(
- primaryTaskTarget.screenSpaceBounds,
- secondaryTaskTarget.screenSpaceBounds, dividerTarget.screenSpaceBounds);
- mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget,
- mStagedSplitBounds);
- mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(secondaryTaskTarget,
- mStagedSplitBounds);
- mRemoteTargetHandles[0].mTransformParams.setTargetSet(
- createRemoteAnimationTargetsForTarget(primaryTaskTarget));
- mRemoteTargetHandles[1].mTransformParams.setTargetSet(
- createRemoteAnimationTargetsForTarget(secondaryTaskTarget));
- }
- }
-
- private RemoteAnimationTargets createRemoteAnimationTargetsForTarget(
- RemoteAnimationTargetCompat target) {
- return new RemoteAnimationTargets(new RemoteAnimationTargetCompat[]{target},
- null, null, MODE_CLOSING);
- }
/**
* Creates an animation that transforms the current app window into the home app.
* @param startProgress The progress of {@link #mCurrentShift} to start the window from.
@@ -326,8 +273,8 @@
i < mRemoteTargetHandlesLength; i++) {
RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
out[i] = getWindowAnimationToHomeInternal(homeAnimationFactory,
- targetRect, remoteHandle.mTransformParams, remoteHandle.mTaskViewSimulator,
- startRects[i], homeToWindowPositionMap);
+ targetRect, remoteHandle.getTransformParams(),
+ remoteHandle.getTaskViewSimulator(), startRects[i], homeToWindowPositionMap);
}
return out;
}
@@ -442,21 +389,6 @@
}
}
- /**
- * Container to keep together all the associated objects whose properties need to be updated to
- * animate a single remote app target
- */
- public static class RemoteTargetHandle {
- public TaskViewSimulator mTaskViewSimulator;
- public TransformParams mTransformParams;
- public AnimatorControllerWithResistance mPlaybackController;
- public RemoteTargetHandle(TaskViewSimulator taskViewSimulator,
- TransformParams transformParams) {
- mTransformParams = transformParams;
- mTaskViewSimulator = taskViewSimulator;
- }
- }
-
public interface RunningWindowAnim {
void end();
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 7d2d413..aea2d4c 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -533,10 +533,17 @@
}
}
- public void exitSplitScreen() {
+ /**
+ * To be called whenever the user exits out of split screen apps (either by launching another
+ * app or by swiping home)
+ * @param topTaskId The taskId of the new app that was launched. System will then move this task
+ * to the front of what the user sees while removing all other split stages.
+ * If swiping to home (or there is no task to put at the top), can pass in -1.
+ */
+ public void exitSplitScreen(int topTaskId) {
if (mSplitScreen != null) {
try {
- mSplitScreen.exitSplitScreen();
+ mSplitScreen.exitSplitScreen(topTaskId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call exitSplitScreen");
}
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index eb5c43f..978fb57 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -107,6 +107,13 @@
public static void addSplitOptions(List<SystemShortcut> outShortcuts,
BaseDraggingActivity activity, TaskView taskView, DeviceProfile deviceProfile) {
+ int[] taskViewTaskIds = taskView.getTaskIds();
+ boolean alreadyHasMultipleTasks = taskViewTaskIds[0] != -1 &&
+ taskViewTaskIds[1] != -1;
+ if (alreadyHasMultipleTasks) {
+ return;
+ }
+
PagedOrientationHandler orientationHandler =
taskView.getRecentsView().getPagedOrientationHandler();
List<SplitPositionOption> positions =
diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index 5b9e214..23dc913 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -55,7 +55,6 @@
import android.window.TransitionInfo;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
@@ -67,6 +66,7 @@
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.util.DisplayController;
+import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.quickstep.util.SurfaceTransactionApplier;
import com.android.quickstep.util.TaskViewSimulator;
@@ -151,28 +151,7 @@
RemoteAnimationTargetCompat[] wallpaperTargets,
RemoteAnimationTargetCompat[] nonAppTargets, DepthController depthController,
PendingAnimation out) {
- boolean isRunningTask = v.isRunningTask();
- TransformParams params = null;
- TaskViewSimulator tsv = null;
- // TODO(b/195675206) handle two TSVs here
- if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask) {
- params = v.getRecentsView().getRemoteTargetHandles()[0].mTransformParams;
- tsv = v.getRecentsView().getRemoteTargetHandles()[0].mTaskViewSimulator;
- }
- createRecentsWindowAnimator(v, skipViewChanges, appTargets, wallpaperTargets, nonAppTargets,
- depthController, out, params, tsv);
- }
-
- /**
- * Creates an animation that controls the window of the opening targets for the recents launch
- * animation.
- */
- public static void createRecentsWindowAnimator(TaskView v, boolean skipViewChanges,
- RemoteAnimationTargetCompat[] appTargets,
- RemoteAnimationTargetCompat[] wallpaperTargets,
- RemoteAnimationTargetCompat[] nonAppTargets, DepthController depthController,
- PendingAnimation out, @Nullable TransformParams params,
- @Nullable TaskViewSimulator tsv) {
+ RecentsView recentsView = v.getRecentsView();
boolean isQuickSwitch = v.isEndQuickswitchCuj();
v.setEndQuickswitchCuj(false);
@@ -183,16 +162,27 @@
inLiveTileMode ? MODE_CLOSING : MODE_OPENING);
final RemoteAnimationTargetCompat navBarTarget = targets.getNavBarRemoteAnimationTarget();
- if (params == null) {
- SurfaceTransactionApplier applier = new SurfaceTransactionApplier(v);
- targets.addReleaseCheck(applier);
+ SurfaceTransactionApplier applier = new SurfaceTransactionApplier(v);
+ targets.addReleaseCheck(applier);
- params = new TransformParams()
- .setSyncTransactionApplier(applier)
- .setTargetSet(targets);
+ RemoteTargetHandle[] remoteTargetHandles;
+ RemoteTargetHandle[] recentsViewHandles = recentsView.getRemoteTargetHandles();
+ if (v.isRunningTask()) {
+ // Re-use existing handles
+ remoteTargetHandles = recentsViewHandles;
+ } else {
+ RemoteTargetGluer gluer = new RemoteTargetGluer(v.getContext(),
+ recentsView.getSizeStrategy(), targets);
+ if (recentsViewHandles != null && recentsViewHandles.length > 1) {
+ remoteTargetHandles = gluer.assignTargetsForSplitScreen(targets);
+ } else {
+ remoteTargetHandles = gluer.assignTargets(targets);
+ }
+ }
+ for (RemoteTargetHandle remoteTargetGluer : remoteTargetHandles) {
+ remoteTargetGluer.getTransformParams().setSyncTransactionApplier(applier);
}
- final RecentsView recentsView = v.getRecentsView();
int taskIndex = recentsView.indexOfChild(v);
Context context = v.getContext();
DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
@@ -202,45 +192,51 @@
float gridTranslationSecondary = recentsView.getGridTranslationSecondary(taskIndex);
int startScroll = recentsView.getScrollOffset(taskIndex);
- TaskViewSimulator topMostSimulator = null;
+ RemoteTargetHandle[] topMostSimulators = null;
- if (tsv == null && targets.apps.length > 0) {
- tsv = new TaskViewSimulator(context, recentsView.getSizeStrategy());
- tsv.setDp(dp);
+ if (!v.isRunningTask()) {
+ // TVSs already initialized from the running task, no need to re-init
+ for (RemoteTargetHandle targetHandle : remoteTargetHandles) {
+ TaskViewSimulator tvsLocal = targetHandle.getTaskViewSimulator();
+ tvsLocal.setDp(dp);
- // RecentsView never updates the display rotation until swipe-up so the value may
- // be stale. Use the display value instead.
- int displayRotation = DisplayController.INSTANCE.get(context).getInfo().rotation;
- tsv.getOrientationState().update(displayRotation, displayRotation);
+ // RecentsView never updates the display rotation until swipe-up so the value may
+ // be stale. Use the display value instead.
+ int displayRotation = DisplayController.INSTANCE.get(context).getInfo().rotation;
+ tvsLocal.getOrientationState().update(displayRotation, displayRotation);
- tsv.setPreview(targets.apps[targets.apps.length - 1]);
- tsv.fullScreenProgress.value = 0;
- tsv.recentsViewScale.value = 1;
- if (showAsGrid) {
- tsv.taskSecondaryTranslation.value = gridTranslationSecondary;
+ tvsLocal.fullScreenProgress.value = 0;
+ tvsLocal.recentsViewScale.value = 1;
+ if (showAsGrid) {
+ tvsLocal.taskSecondaryTranslation.value = gridTranslationSecondary;
+ }
+ tvsLocal.setScroll(startScroll);
+
+ // 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));
}
- tsv.setScroll(startScroll);
-
- // Fade in the task during the initial 20% of the animation
- out.addFloat(params, TransformParams.TARGET_ALPHA, 0, 1,
- clampToProgress(LINEAR, 0, 0.2f));
}
- if (tsv != null) {
- out.setFloat(tsv.fullScreenProgress,
+ for (RemoteTargetHandle targetHandle : remoteTargetHandles) {
+ TaskViewSimulator tvsLocal = targetHandle.getTaskViewSimulator();
+ out.setFloat(tvsLocal.fullScreenProgress,
AnimatedFloat.VALUE, 1, TOUCH_RESPONSE_INTERPOLATOR);
- out.setFloat(tsv.recentsViewScale,
- AnimatedFloat.VALUE, tsv.getFullScreenScale(), TOUCH_RESPONSE_INTERPOLATOR);
+ out.setFloat(tvsLocal.recentsViewScale,
+ AnimatedFloat.VALUE, tvsLocal.getFullScreenScale(),
+ TOUCH_RESPONSE_INTERPOLATOR);
if (showAsGrid) {
- out.setFloat(tsv.taskSecondaryTranslation, AnimatedFloat.VALUE, 0,
+ out.setFloat(tvsLocal.taskSecondaryTranslation, AnimatedFloat.VALUE, 0,
TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL);
}
- out.setFloat(tsv.recentsViewScroll, AnimatedFloat.VALUE, 0,
+ out.setFloat(tvsLocal.recentsViewScroll, AnimatedFloat.VALUE, 0,
TOUCH_RESPONSE_INTERPOLATOR);
- TaskViewSimulator finalTsv = tsv;
- TransformParams finalParams = params;
- out.addOnFrameCallback(() -> finalTsv.apply(finalParams));
+ out.addOnFrameCallback(() -> {
+ for (RemoteTargetHandle handle : remoteTargetHandles) {
+ handle.getTaskViewSimulator().apply(handle.getTransformParams());
+ }
+ });
if (navBarTarget != null) {
final Rect cropRect = new Rect();
out.addOnFrameListener(new MultiValueUpdateListener() {
@@ -253,15 +249,20 @@
public void onUpdate(float percent, boolean initOnly) {
final SurfaceParams.Builder navBuilder =
new SurfaceParams.Builder(navBarTarget.leash);
- if (mNavFadeIn.value > mNavFadeIn.getStartValue()) {
- finalTsv.getCurrentCropRect().round(cropRect);
- navBuilder.withMatrix(finalTsv.getCurrentMatrix())
- .withWindowCrop(cropRect)
- .withAlpha(mNavFadeIn.value);
- } else {
- navBuilder.withAlpha(mNavFadeOut.value);
+
+ // TODO Do we need to operate over multiple TVSs for the navbar leash?
+ for (RemoteTargetHandle handle : remoteTargetHandles) {
+ if (mNavFadeIn.value > mNavFadeIn.getStartValue()) {
+ TaskViewSimulator taskViewSimulator = handle.getTaskViewSimulator();
+ taskViewSimulator.getCurrentCropRect().round(cropRect);
+ navBuilder.withMatrix(taskViewSimulator.getCurrentMatrix())
+ .withWindowCrop(cropRect)
+ .withAlpha(mNavFadeIn.value);
+ } else {
+ navBuilder.withAlpha(mNavFadeOut.value);
+ }
+ handle.getTransformParams().applySurfaceParams(navBuilder.build());
}
- finalParams.applySurfaceParams(navBuilder.build());
}
});
} else if (inLiveTileMode) {
@@ -273,14 +274,16 @@
controller.animateNavigationBarToApp(RECENTS_LAUNCH_DURATION);
}
}
- topMostSimulator = tsv;
+ topMostSimulators = remoteTargetHandles;
}
- if (!skipViewChanges && parallaxCenterAndAdjacentTask && topMostSimulator != null) {
+ if (!skipViewChanges && parallaxCenterAndAdjacentTask && topMostSimulators.length > 0) {
out.addFloat(v, VIEW_ALPHA, 1, 0, clampToProgress(LINEAR, 0.2f, 0.4f));
- TaskViewSimulator simulatorToCopy = topMostSimulator;
- simulatorToCopy.apply(params);
+ RemoteTargetHandle[] simulatorCopies = topMostSimulators;
+ for (RemoteTargetHandle handle : simulatorCopies) {
+ handle.getTaskViewSimulator().apply(handle.getTransformParams());
+ }
// Mt represents the overall transformation on the thumbnailView relative to the
// Launcher's rootView
@@ -294,36 +297,49 @@
// 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`
- TaskThumbnailView ttv = v.getThumbnail();
- RectF tvBounds = new RectF(0, 0, ttv.getWidth(), ttv.getHeight());
- float[] tvBoundsMapped = new float[]{0, 0, ttv.getWidth(), ttv.getHeight()};
- getDescendantCoordRelativeToAncestor(ttv, ttv.getRootView(), tvBoundsMapped, false);
- RectF tvBoundsInRoot = new RectF(
- tvBoundsMapped[0], tvBoundsMapped[1],
- tvBoundsMapped[2], tvBoundsMapped[3]);
+ TaskThumbnailView[] thumbnails = v.getThumbnails();
+ Matrix[] mt = new Matrix[simulatorCopies.length];
+ Matrix[] mti = new Matrix[simulatorCopies.length];
+ for (int i = 0; i < thumbnails.length; i++) {
+ TaskThumbnailView 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);
+ RectF localBoundsInRoot = new RectF(
+ tvBoundsMapped[0], tvBoundsMapped[1],
+ tvBoundsMapped[2], tvBoundsMapped[3]);
+ Matrix localMt = new Matrix();
+ localMt.setRectToRect(localBounds, localBoundsInRoot, ScaleToFit.FILL);
+ mt[i] = localMt;
- Matrix mt = new Matrix();
- mt.setRectToRect(tvBounds, tvBoundsInRoot, ScaleToFit.FILL);
+ Matrix localMti = new Matrix();
+ localMti.invert(localMt);
+ mti[i] = localMti;
+ }
- Matrix mti = new Matrix();
- mt.invert(mti);
-
- Matrix k0i = new Matrix();
- simulatorToCopy.getCurrentMatrix().invert(k0i);
-
+ Matrix[] k0i = new Matrix[simulatorCopies.length];
+ for (int i = 0; i < simulatorCopies.length; i++) {
+ k0i[i] = new Matrix();
+ simulatorCopies[i].getTaskViewSimulator().getCurrentMatrix().invert(k0i[i]);
+ }
Matrix animationMatrix = new Matrix();
out.addOnFrameCallback(() -> {
- animationMatrix.set(mt);
- animationMatrix.postConcat(k0i);
- animationMatrix.postConcat(simulatorToCopy.getCurrentMatrix());
- animationMatrix.postConcat(mti);
- ttv.setAnimationMatrix(animationMatrix);
+ for (int i = 0; i < simulatorCopies.length; i++) {
+ animationMatrix.set(mt[i]);
+ animationMatrix.postConcat(k0i[i]);
+ animationMatrix.postConcat(simulatorCopies[i]
+ .getTaskViewSimulator().getCurrentMatrix());
+ animationMatrix.postConcat(mti[i]);
+ thumbnails[i].setAnimationMatrix(animationMatrix);
+ }
});
out.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- ttv.setAnimationMatrix(null);
+ for (TaskThumbnailView ttv : thumbnails) {
+ ttv.setAnimationMatrix(null);
+ }
}
});
}
@@ -366,8 +382,8 @@
* device is considered in multiWindowMode and things like insets and stuff change
* and calculations have to be adjusted in the animations for that
*/
- public static void composeRecentsSplitLaunchAnimator(@NonNull TaskView initialView,
- @NonNull TaskView v, @NonNull TransitionInfo transitionInfo,
+ public static void composeRecentsSplitLaunchAnimator(@NonNull Task initalTask,
+ @NonNull Task secondTask, @NonNull TransitionInfo transitionInfo,
SurfaceControl.Transaction t, @NonNull Runnable finishCallback) {
final TransitionInfo.Change[] splitRoots = new TransitionInfo.Change[2];
@@ -377,7 +393,7 @@
final int mode = change.getMode();
// Find the target tasks' root tasks since those are the split stages that need to
// be animated (the tasks themselves are children and thus inherit animation).
- if (taskId == initialView.getTask().key.id || taskId == v.getTask().key.id) {
+ if (taskId == initalTask.key.id || taskId == secondTask.key.id) {
if (!(mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT)) {
throw new IllegalStateException(
"Expected task to be showing, but it is " + mode);
@@ -386,7 +402,7 @@
throw new IllegalStateException("Initiating multi-split launch but the split"
+ "root of " + taskId + " is already visible or has broken hierarchy.");
}
- splitRoots[taskId == initialView.getTask().key.id ? 0 : 1] =
+ splitRoots[taskId == initalTask.key.id ? 0 : 1] =
transitionInfo.getChange(change.getParent());
}
}
@@ -406,8 +422,8 @@
}
/** Legacy version (until shell transitions are enabled) */
- public static void composeRecentsSplitLaunchAnimatorLegacy(@NonNull TaskView initialView,
- @NonNull TaskView v, @NonNull RemoteAnimationTargetCompat[] appTargets,
+ public static void composeRecentsSplitLaunchAnimatorLegacy(@NonNull Task initialTask,
+ @NonNull Task secondTask, @NonNull RemoteAnimationTargetCompat[] appTargets,
@NonNull RemoteAnimationTargetCompat[] wallpaperTargets,
@NonNull RemoteAnimationTargetCompat[] nonAppTargets,
@NonNull Runnable finishCallback) {
@@ -416,12 +432,12 @@
for (int i = 0; i < appTargets.length; ++i) {
final int taskId = appTargets[i].taskInfo != null ? appTargets[i].taskInfo.taskId : -1;
final int mode = appTargets[i].mode;
- if (taskId == initialView.getTask().key.id || taskId == v.getTask().key.id) {
+ if (taskId == initialTask.key.id || taskId == secondTask.key.id) {
if (mode != MODE_OPENING) {
throw new IllegalStateException(
"Expected task to be opening, but it is " + mode);
}
- splitRoots[taskId == initialView.getTask().key.id ? 0 : 1] = i;
+ splitRoots[taskId == initialTask.key.id ? 0 : 1] = i;
}
}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 2e42392..3ce12c5 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -146,7 +146,7 @@
private static final int SYSTEM_ACTION_ID_ALL_APPS = 14;
public static final boolean ENABLE_PER_WINDOW_INPUT_ROTATION =
- SystemProperties.getBoolean("persist.debug.per_window_input_rotation", true);
+ SystemProperties.getBoolean("persist.debug.per_window_input_rotation", false);
private int mBackGestureNotificationCounter = -1;
@Nullable
@@ -358,12 +358,14 @@
mDeviceState = new RecentsAnimationDeviceState(this, true);
mDisplayManager = getSystemService(DisplayManager.class);
mTaskbarManager = new TaskbarManager(this);
-
mRotationTouchHelper = mDeviceState.getRotationTouchHelper();
- mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
- mDeviceState.addOneHandedModeChangedCallback(this::onOneHandedModeOverlayChanged);
+
+ // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized.
mDeviceState.runOnUserUnlocked(this::onUserUnlocked);
mDeviceState.runOnUserUnlocked(mTaskbarManager::onUserUnlocked);
+ mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
+ mDeviceState.addOneHandedModeChangedCallback(this::onOneHandedModeOverlayChanged);
+
ProtoTracer.INSTANCE.get(this).add(this);
LauncherSplitScreenListener.INSTANCE.get(this).init();
sConnected = true;
diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
index 7465db3..b2b2f59 100644
--- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
+++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
@@ -43,7 +43,7 @@
import com.android.launcher3.R;
import com.android.launcher3.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.util.VibratorWrapper;
+import com.android.quickstep.util.VibratorWrapper;
/** Forked from platform/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarEdgePanel.java. */
public class EdgeBackGesturePanel extends View {
diff --git a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
index a9a9e2a..851cccf 100644
--- a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
@@ -16,7 +16,6 @@
package com.android.quickstep.interaction;
import static com.android.launcher3.Utilities.squaredHypot;
-import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.ASSISTANT_COMPLETED;
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.ASSISTANT_NOT_STARTED_BAD_ANGLE;
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.ASSISTANT_NOT_STARTED_SWIPE_TOO_SHORT;
@@ -26,6 +25,7 @@
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.HOME_OR_OVERVIEW_NOT_STARTED_WRONG_SWIPE_DIRECTION;
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.OVERVIEW_GESTURE_COMPLETED;
import static com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult.OVERVIEW_NOT_STARTED_TOO_FAR_FROM_EDGE;
+import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC;
import android.animation.ValueAnimator;
import android.content.Context;
@@ -47,11 +47,11 @@
import com.android.launcher3.R;
import com.android.launcher3.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.util.VibratorWrapper;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.NavBarPosition;
import com.android.quickstep.util.TriggerSwipeUpTouchTracker;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.systemui.shared.system.QuickStepContract;
/** Utility class to handle Home and Assistant gestures. */
@@ -120,7 +120,7 @@
mAssistantGestureDetector = new GestureDetector(context, new AssistantGestureListener());
int assistantWidth = resources.getDimensionPixelSize(R.dimen.gestures_assistant_width);
final float assistantHeight = Math.max(mBottomGestureHeight,
- QuickStepContract.getWindowCornerRadius(resources));
+ QuickStepContract.getWindowCornerRadius(context));
mAssistantLeftRegion.bottom = mAssistantRightRegion.bottom = mDisplaySize.y;
mAssistantLeftRegion.top = mAssistantRightRegion.top = mDisplaySize.y - assistantHeight;
mAssistantLeftRegion.left = 0;
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index c2c8f61..ce8047e 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -46,11 +46,11 @@
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
-import com.android.launcher3.statemanager.StatefulActivity;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.GestureState;
import com.android.quickstep.OverviewComponentObserver;
import com.android.quickstep.RecentsAnimationDeviceState;
+import com.android.quickstep.RemoteTargetGluer;
import com.android.quickstep.SwipeUpAnimationLogic;
import com.android.quickstep.SwipeUpAnimationLogic.RunningWindowAnim;
import com.android.quickstep.util.AppCloseConfig;
@@ -255,21 +255,23 @@
ViewSwipeUpAnimation(Context context, RecentsAnimationDeviceState deviceState,
GestureState gestureState) {
- super(context, deviceState, gestureState, new FakeTransformParams());
+ super(context, deviceState, gestureState);
+ mRemoteTargetHandles[0] = new RemoteTargetGluer.RemoteTargetHandle(
+ mRemoteTargetHandles[0].getTaskViewSimulator(), new FakeTransformParams());
}
void initDp(DeviceProfile dp) {
initTransitionEndpoints(dp);
- mRemoteTargetHandles[0].mTaskViewSimulator.setPreviewBounds(
+ mRemoteTargetHandles[0].getTaskViewSimulator().setPreviewBounds(
new Rect(0, 0, dp.widthPx, dp.heightPx), dp.getInsets());
}
@Override
public void updateFinalShift() {
- mRemoteTargetHandles[0].mPlaybackController
+ mRemoteTargetHandles[0].getPlaybackController()
.setProgress(mCurrentShift.value, mDragLengthFactor);
- mRemoteTargetHandles[0].mTaskViewSimulator.apply(
- mRemoteTargetHandles[0].mTransformParams);
+ mRemoteTargetHandles[0].getTaskViewSimulator().apply(
+ mRemoteTargetHandles[0].getTransformParams());
}
AnimatedFloat getCurrentShift() {
diff --git a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
index 6575996..7893f8d 100644
--- a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
+++ b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
@@ -31,9 +31,11 @@
import android.content.Context;
import android.util.Log;
+import android.util.StatsEvent;
import android.view.View;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import androidx.slice.SliceItem;
@@ -135,6 +137,36 @@
}
/**
+ * Builds {@link StatsEvent} from {@link LauncherAtom.ItemInfo}. Used for pulled atom callback
+ * implementation.
+ */
+ public static StatsEvent buildStatsEvent(LauncherAtom.ItemInfo info,
+ @Nullable InstanceId instanceId) {
+ return SysUiStatsLog.buildStatsEvent(
+ SysUiStatsLog.LAUNCHER_LAYOUT_SNAPSHOT, // atom ID,
+ LAUNCHER_WORKSPACE_SNAPSHOT.getId(), // event_id = 1;
+ info.getAttribute().getNumber() * ATTRIBUTE_MULTIPLIER
+ + info.getItemCase().getNumber(), // item_id = 2;
+ instanceId == null ? 0 : instanceId.getId(), //instance_id = 3;
+ 0, //uid = 4 [(is_uid) = true];
+ getPackageName(info), // package_name = 5;
+ getComponentName(info), // component_name = 6;
+ getGridX(info, false), //grid_x = 7 [default = -1];
+ getGridY(info, false), //grid_y = 8 [default = -1];
+ getPageId(info), // page_id = 9 [default = -2];
+ getGridX(info, true), //grid_x_parent = 10 [default = -1];
+ getGridY(info, true), //grid_y_parent = 11 [default = -1];
+ getParentPageId(info), //page_id_parent = 12 [default = -2];
+ getHierarchy(info), // container_id = 13;
+ info.getIsWork(), // is_work_profile = 14;
+ info.getAttribute().getNumber(), // attribute_id = 15;
+ getCardinality(info), // cardinality = 16;
+ info.getWidget().getSpanX(), // span_x = 17 [default = 1];
+ info.getWidget().getSpanY() // span_y = 18 [default = 1];
+ );
+ }
+
+ /**
* Helps to construct and write statsd compatible log message.
*/
private static class StatsCompatLogger implements StatsLogger {
diff --git a/quickstep/src/com/android/quickstep/util/LauncherSplitScreenListener.java b/quickstep/src/com/android/quickstep/util/LauncherSplitScreenListener.java
index da665d4..fa4cddc 100644
--- a/quickstep/src/com/android/quickstep/util/LauncherSplitScreenListener.java
+++ b/quickstep/src/com/android/quickstep/util/LauncherSplitScreenListener.java
@@ -11,20 +11,55 @@
import com.android.launcher3.util.SplitConfigurationOptions.StageType;
import com.android.launcher3.util.SplitConfigurationOptions.StagedSplitTaskPosition;
import com.android.quickstep.SystemUiProxy;
+import com.android.systemui.shared.system.TaskStackChangeListener;
+import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.wm.shell.splitscreen.ISplitScreenListener;
/**
* Listeners for system wide split screen position and stage changes.
- * Use {@link #getSplitTaskIds()} to determine which tasks, if any, are in staged split.
+ *
+ * Use {@link #getRunningSplitTaskIds()} to determine which tasks, if any, are actively in
+ * staged split.
+ *
+ * Use {@link #getPersistentSplitIds()} to know if tasks were in split screen before a quickswitch
+ * gesture happened.
*/
public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
public static final MainThreadInitializedObject<LauncherSplitScreenListener> INSTANCE =
new MainThreadInitializedObject<>(LauncherSplitScreenListener::new);
+ private static final int[] EMPTY_ARRAY = {};
+
private final StagedSplitTaskPosition mMainStagePosition = new StagedSplitTaskPosition();
private final StagedSplitTaskPosition mSideStagePosition = new StagedSplitTaskPosition();
+ private boolean mIsRecentsListFrozen = false;
+ private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() {
+ @Override
+ public void onRecentTaskListFrozenChanged(boolean frozen) {
+ super.onRecentTaskListFrozenChanged(frozen);
+ mIsRecentsListFrozen = frozen;
+
+ if (frozen) {
+ mPersistentGroupedIds = getRunningSplitTaskIds();
+ } else {
+ mPersistentGroupedIds = EMPTY_ARRAY;
+ }
+ }
+ };
+
+ /**
+ * Gets set to current split taskIDs whenever the task list is frozen, and set to empty array
+ * whenever task list unfreezes. This also gets set to empty array whenever the user swipes to
+ * home - in that case the task list does not unfreeze immediately after the gesture, so it's
+ * done via {@link #notifySwipingToHome()}.
+ *
+ * When not empty, this indicates that we need to load a GroupedTaskView as the most recent
+ * page, so user can quickswitch back to a grouped task.
+ */
+ private int[] mPersistentGroupedIds;
+
public LauncherSplitScreenListener(Context context) {
mMainStagePosition.stageType = SplitConfigurationOptions.STAGE_TYPE_MAIN;
mSideStagePosition.stageType = SplitConfigurationOptions.STAGE_TYPE_SIDE;
@@ -33,17 +68,30 @@
/** Also call {@link #destroy()} when done. */
public void init() {
SystemUiProxy.INSTANCE.getNoCreate().registerSplitScreenListener(this);
+ TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener);
}
public void destroy() {
SystemUiProxy.INSTANCE.getNoCreate().unregisterSplitScreenListener(this);
+ TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
}
/**
+ * This method returns the active split taskIDs that were active if a user quickswitched from
+ * split screen to a fullscreen app as long as the recents task list remains frozen.
+ */
+ public int[] getPersistentSplitIds() {
+ if (mIsRecentsListFrozen) {
+ return mPersistentGroupedIds;
+ } else {
+ return getRunningSplitTaskIds();
+ }
+ }
+ /**
* @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
*/
- public int[] getSplitTaskIds() {
+ public int[] getRunningSplitTaskIds() {
if (mMainStagePosition.taskId == -1 || mSideStagePosition.taskId == -1) {
return new int[]{};
}
@@ -93,6 +141,18 @@
}
}
+ /** Notifies SystemUi to remove any split screen state */
+ public void notifySwipingToHome() {
+ boolean hasSplitTasks = LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getPersistentSplitIds().length > 0;
+ if (!hasSplitTasks) {
+ return;
+ }
+
+ SystemUiProxy.INSTANCE.getNoCreate().exitSplitScreen(-1);
+ mPersistentGroupedIds = EMPTY_ARRAY;
+ }
+
private void resetTaskId(StagedSplitTaskPosition taskPosition) {
taskPosition.taskId = -1;
}
diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
index c5ab84d..47d3580 100644
--- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
+++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
@@ -37,26 +37,23 @@
private static final float MAX_WIDTH_INSET_FRACTION = 0.15f;
private final Launcher mLauncher;
- private final UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
- private final UnfoldMoveFromCenterWorkspaceAnimator mMoveFromCenterWorkspaceAnimation;
@Nullable
private HorizontalInsettableView mQsbInsettable;
- private final AnimationListener mAnimationListener = new AnimationListener();
-
- private boolean mIsTransitionRunning = false;
- private boolean mIsReadyToPlayAnimation = false;
+ private final ScopedUnfoldTransitionProgressProvider mProgressProvider;
public LauncherUnfoldAnimationController(
Launcher launcher,
WindowManager windowManager,
UnfoldTransitionProgressProvider unfoldTransitionProgressProvider) {
mLauncher = launcher;
- mUnfoldTransitionProgressProvider = unfoldTransitionProgressProvider;
- mMoveFromCenterWorkspaceAnimation = new UnfoldMoveFromCenterWorkspaceAnimator(launcher,
- windowManager);
- mUnfoldTransitionProgressProvider.addCallback(mAnimationListener);
+ mProgressProvider = new ScopedUnfoldTransitionProgressProvider(
+ unfoldTransitionProgressProvider);
+
+ mProgressProvider.addCallback(new UnfoldMoveFromCenterWorkspaceAnimator(launcher,
+ windowManager));
+ mProgressProvider.addCallback(new QsbAnimationListener());
}
/**
@@ -73,7 +70,7 @@
@Override
public boolean onPreDraw() {
if (obs.isAlive()) {
- onPreDrawAfterResume();
+ mProgressProvider.setReadyToHandleTransition(true);
obs.removeOnPreDrawListener(this);
}
return true;
@@ -85,12 +82,7 @@
* Called when launcher activity is paused
*/
public void onPause() {
- if (mIsTransitionRunning) {
- mIsTransitionRunning = false;
- mAnimationListener.onTransitionFinished();
- }
-
- mIsReadyToPlayAnimation = false;
+ mProgressProvider.setReadyToHandleTransition(false);
mQsbInsettable = null;
}
@@ -98,48 +90,24 @@
* Called when launcher activity is destroyed
*/
public void onDestroy() {
- mUnfoldTransitionProgressProvider.removeCallback(mAnimationListener);
+ mProgressProvider.destroy();
}
- /**
- * Called after performing layouting of the views after configuration change
- */
- private void onPreDrawAfterResume() {
- mIsReadyToPlayAnimation = true;
-
- if (mIsTransitionRunning) {
- mMoveFromCenterWorkspaceAnimation.onTransitionStarted();
- }
- }
-
- private class AnimationListener implements TransitionProgressListener {
+ private class QsbAnimationListener implements TransitionProgressListener {
@Override
public void onTransitionStarted() {
- mIsTransitionRunning = true;
-
- if (mIsReadyToPlayAnimation) {
- mMoveFromCenterWorkspaceAnimation.onTransitionStarted();
- }
}
@Override
public void onTransitionFinished() {
- if (mIsReadyToPlayAnimation) {
- mMoveFromCenterWorkspaceAnimation.onTransitionFinished();
-
- if (mQsbInsettable != null) {
- mQsbInsettable.setHorizontalInsets(0);
- }
+ if (mQsbInsettable != null) {
+ mQsbInsettable.setHorizontalInsets(0);
}
-
- mIsTransitionRunning = false;
}
@Override
public void onTransitionProgress(float progress) {
- mMoveFromCenterWorkspaceAnimation.onTransitionProgress(progress);
-
if (mQsbInsettable != null) {
float insetPercentage = comp(progress) * MAX_WIDTH_INSET_FRACTION;
mQsbInsettable.setHorizontalInsets(insetPercentage);
diff --git a/quickstep/src/com/android/quickstep/util/LauncherViewsMoveFromCenterTranslationApplier.java b/quickstep/src/com/android/quickstep/util/LauncherViewsMoveFromCenterTranslationApplier.java
new file mode 100644
index 0000000..effdfdd
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/LauncherViewsMoveFromCenterTranslationApplier.java
@@ -0,0 +1,45 @@
+/*
+ * 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.quickstep.util;
+
+import android.annotation.NonNull;
+import android.view.View;
+
+import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.widget.NavigableAppWidgetHostView;
+import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator.TranslationApplier;
+
+/**
+ * Class that allows to set translations for move from center animation independently
+ * from other translations for certain launcher views
+ */
+public class LauncherViewsMoveFromCenterTranslationApplier implements TranslationApplier {
+
+ @Override
+ public void apply(@NonNull View view, float x, float y) {
+ if (view instanceof NavigableAppWidgetHostView) {
+ ((NavigableAppWidgetHostView) view).setTranslationForMoveFromCenterAnimation(x, y);
+ } else if (view instanceof BubbleTextView) {
+ ((BubbleTextView) view).setTranslationForMoveFromCenterAnimation(x, y);
+ } else if (view instanceof FolderIcon) {
+ ((FolderIcon) view).setTranslationForMoveFromCenterAnimation(x, y);
+ } else {
+ view.setTranslationX(x);
+ view.setTranslationY(y);
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index 841e578..a4db596 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -600,17 +600,7 @@
width = Math.min(currentSize.x, currentSize.y);
height = Math.max(currentSize.x, currentSize.y);
}
-
- DeviceProfile bestMatch = idp.supportedProfiles.get(0);
- float minDiff = Float.MAX_VALUE;
- for (DeviceProfile profile : idp.supportedProfiles) {
- float diff = Math.abs(profile.widthPx - width) + Math.abs(profile.heightPx - height);
- if (diff < minDiff) {
- minDiff = diff;
- bestMatch = profile;
- }
- }
- return bestMatch;
+ return idp.getBestMatch(width, height);
}
private static String nameAndAddress(Object obj) {
diff --git a/quickstep/src/com/android/quickstep/util/ScopedUnfoldTransitionProgressProvider.java b/quickstep/src/com/android/quickstep/util/ScopedUnfoldTransitionProgressProvider.java
new file mode 100644
index 0000000..2ef311f
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/ScopedUnfoldTransitionProgressProvider.java
@@ -0,0 +1,140 @@
+/*
+ * 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.quickstep.util;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
+import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
+import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Manages progress listeners that can have smaller lifespan than the unfold animation.
+ * Allows to limit getting transition updates to only when
+ * {@link ScopedUnfoldTransitionProgressProvider#setReadyToHandleTransition} is called
+ * with readyToHandleTransition = true
+ *
+ * If the transition has already started by the moment when the clients are ready to play
+ * the transition then it will report transition started callback and current animation progress.
+ */
+public final class ScopedUnfoldTransitionProgressProvider implements
+ UnfoldTransitionProgressProvider, TransitionProgressListener {
+
+ private static final float PROGRESS_UNSET = -1f;
+
+ @Nullable
+ private UnfoldTransitionProgressProvider mSource;
+
+ private final List<TransitionProgressListener> mListeners = new ArrayList<>();
+
+ private boolean mIsReadyToHandleTransition;
+ private boolean mIsTransitionRunning;
+ private float mLastTransitionProgress = PROGRESS_UNSET;
+
+ public ScopedUnfoldTransitionProgressProvider() {
+ this(null);
+ }
+
+ public ScopedUnfoldTransitionProgressProvider(@Nullable UnfoldTransitionProgressProvider
+ source) {
+ setSourceProvider(source);
+ }
+
+ /**
+ * Sets the source for the unfold transition progress updates,
+ * it replaces current provider if it is already set
+ * @param provider transition provider that emits transition progress updates
+ */
+ public void setSourceProvider(@Nullable UnfoldTransitionProgressProvider provider) {
+ if (mSource != null) {
+ mSource.removeCallback(this);
+ }
+
+ if (provider != null) {
+ mSource = provider;
+ mSource.addCallback(this);
+ }
+ }
+
+ /**
+ * Allows to notify this provide whether the listeners can play the transition or not.
+ * Call this method with readyToHandleTransition = true when all listeners
+ * are ready to consume the transition progress events.
+ * Call it with readyToHandleTransition = false when listeners can't process the events.
+ */
+ public void setReadyToHandleTransition(boolean isReadyToHandleTransition) {
+ if (mIsTransitionRunning) {
+ if (mIsReadyToHandleTransition) {
+ mListeners.forEach(TransitionProgressListener::onTransitionStarted);
+
+ if (mLastTransitionProgress != PROGRESS_UNSET) {
+ mListeners.forEach(listener ->
+ listener.onTransitionProgress(mLastTransitionProgress));
+ }
+ } else {
+ mIsTransitionRunning = false;
+ mListeners.forEach(TransitionProgressListener::onTransitionFinished);
+ }
+ }
+
+ mIsReadyToHandleTransition = isReadyToHandleTransition;
+ }
+
+ @Override
+ public void addCallback(@NonNull TransitionProgressListener listener) {
+ mListeners.add(listener);
+ }
+
+ @Override
+ public void removeCallback(@NonNull TransitionProgressListener listener) {
+ mListeners.remove(listener);
+ }
+
+ @Override
+ public void destroy() {
+ mSource.removeCallback(this);
+ }
+
+ @Override
+ public void onTransitionStarted() {
+ this.mIsTransitionRunning = true;
+ if (mIsReadyToHandleTransition) {
+ mListeners.forEach(TransitionProgressListener::onTransitionStarted);
+ }
+ }
+
+ @Override
+ public void onTransitionProgress(float progress) {
+ if (mIsReadyToHandleTransition) {
+ mListeners.forEach(listener -> listener.onTransitionProgress(progress));
+ }
+
+ mLastTransitionProgress = progress;
+ }
+
+ @Override
+ public void onTransitionFinished() {
+ if (mIsReadyToHandleTransition) {
+ mListeners.forEach(TransitionProgressListener::onTransitionFinished);
+ }
+
+ mIsTransitionRunning = false;
+ mLastTransitionProgress = PROGRESS_UNSET;
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index eb77ac0..3069504 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -16,37 +16,31 @@
package com.android.quickstep.util;
-import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
-
import static com.android.launcher3.util.Executors.MAIN_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 android.app.ActivityThread;
-import android.content.res.Resources;
import android.graphics.Rect;
-import android.os.Handler;
import android.os.IBinder;
-import android.view.Gravity;
import android.view.RemoteAnimationAdapter;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.InsettableFrameLayout;
-import com.android.launcher3.R;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskAnimationManager;
import com.android.quickstep.TaskViewUtils;
-import com.android.quickstep.views.TaskView;
+import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
import com.android.systemui.shared.system.RemoteAnimationRunnerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.RemoteTransitionCompat;
import com.android.systemui.shared.system.RemoteTransitionRunner;
+import java.util.function.Consumer;
+
/**
* Represent data needed for the transient state when user has selected one app for split screen
* and is in the process of either a) selecting a second app or b) exiting intention to invoke split
@@ -54,23 +48,21 @@
public class SplitSelectStateController {
private final SystemUiProxy mSystemUiProxy;
- private TaskView mInitialTaskView;
- private TaskView mSecondTaskView;
private @StagePosition int mStagePosition;
+ private Task mInitialTask;
+ private Task mSecondTask;
private Rect mInitialBounds;
- private final Handler mHandler;
- public SplitSelectStateController(Handler handler, SystemUiProxy systemUiProxy) {
+ public SplitSelectStateController(SystemUiProxy systemUiProxy) {
mSystemUiProxy = systemUiProxy;
- mHandler = handler;
}
/**
* To be called after first task selected
*/
- public void setInitialTaskSelect(TaskView taskView, @StagePosition int stagePosition,
+ public void setInitialTaskSelect(Task taskView, @StagePosition int stagePosition,
Rect initialBounds) {
- mInitialTaskView = taskView;
+ mInitialTask = taskView;
mStagePosition = stagePosition;
mInitialBounds = initialBounds;
}
@@ -78,26 +70,29 @@
/**
* To be called after second task selected
*/
- public void setSecondTaskId(TaskView taskView) {
- mSecondTaskView = taskView;
- // Assume initial task is for top/left part of screen
+ public void setSecondTaskId(Task taskView) {
+ mSecondTask = taskView;
+ launchTasks(mInitialTask, mSecondTask, mStagePosition, null /*callback*/);
+ }
-//<<<<<<< HEAD
-// final int[] taskIds = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT
-//=======
- final int[] taskIds = mStagePosition == STAGE_POSITION_TOP_OR_LEFT
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
- ? new int[]{mInitialTaskView.getTask().key.id, taskView.getTask().key.id}
- : new int[]{taskView.getTask().key.id, mInitialTaskView.getTask().key.id};
+ /**
+ * @param stagePosition representing location of task1
+ */
+ public void launchTasks(Task task1, Task task2, @StagePosition int stagePosition,
+ Consumer<Boolean> callback) {
+ // Assume initial task is for top/left part of screen
+ final int[] taskIds = stagePosition == STAGE_POSITION_TOP_OR_LEFT
+ ? new int[]{task1.key.id, task2.key.id}
+ : new int[]{task2.key.id, task1.key.id};
if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
RemoteSplitLaunchTransitionRunner animationRunner =
- new RemoteSplitLaunchTransitionRunner(mInitialTaskView, taskView);
+ new RemoteSplitLaunchTransitionRunner(task1, task2);
mSystemUiProxy.startTasks(taskIds[0], null /* mainOptions */, taskIds[1],
null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT,
new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR));
} else {
RemoteSplitLaunchAnimationRunner animationRunner =
- new RemoteSplitLaunchAnimationRunner(mInitialTaskView, taskView);
+ new RemoteSplitLaunchAnimationRunner(task1, task2, callback);
final RemoteAnimationAdapter adapter = new RemoteAnimationAdapter(
RemoteAnimationAdapterCompat.wrapRemoteAnimationRunner(animationRunner),
300, 150,
@@ -108,30 +103,6 @@
}
}
- /**
- * @return {@link InsettableFrameLayout.LayoutParams} to correctly position the
- * split placeholder view
- */
- public InsettableFrameLayout.LayoutParams getLayoutParamsForActivePosition(Resources resources,
- DeviceProfile deviceProfile) {
- InsettableFrameLayout.LayoutParams params =
- new InsettableFrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
-//<<<<<<< HEAD
-// boolean topLeftPosition = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT;
-//=======
- boolean topLeftPosition = mStagePosition == STAGE_POSITION_TOP_OR_LEFT;
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
- if (deviceProfile.isLandscape) {
- params.width = (int) resources.getDimension(R.dimen.split_placeholder_size);
- params.gravity = topLeftPosition ? Gravity.START : Gravity.END;
- } else {
- params.height = (int) resources.getDimension(R.dimen.split_placeholder_size);
- params.gravity = Gravity.TOP;
- }
-
- return params;
- }
-
public @StagePosition int getActiveSplitStagePosition() {
return mStagePosition;
}
@@ -141,19 +112,19 @@
*/
private class RemoteSplitLaunchTransitionRunner implements RemoteTransitionRunner {
- private final TaskView mInitialTaskView;
- private final TaskView mTaskView;
+ private final Task mInitialTask;
+ private final Task mSecondTask;
- RemoteSplitLaunchTransitionRunner(TaskView initialTaskView, TaskView taskView) {
- mInitialTaskView = initialTaskView;
- mTaskView = taskView;
+ RemoteSplitLaunchTransitionRunner(Task initialTask, Task secondTask) {
+ mInitialTask = initialTask;
+ mSecondTask = secondTask;
}
@Override
public void startAnimation(IBinder transition, TransitionInfo info,
SurfaceControl.Transaction t, Runnable finishCallback) {
- TaskViewUtils.composeRecentsSplitLaunchAnimator(mInitialTaskView, mTaskView,
- info, t, finishCallback);
+ TaskViewUtils.composeRecentsSplitLaunchAnimator(mInitialTask,
+ mSecondTask, info, t, finishCallback);
// After successful launch, call resetState
resetState();
}
@@ -165,26 +136,37 @@
*/
private class RemoteSplitLaunchAnimationRunner implements RemoteAnimationRunnerCompat {
- private final TaskView mInitialTaskView;
- private final TaskView mTaskView;
+ private final Task mInitialTask;
+ private final Task mSecondTask;
+ private final Consumer<Boolean> mSuccessCallback;
- RemoteSplitLaunchAnimationRunner(TaskView initialTaskView, TaskView taskView) {
- mInitialTaskView = initialTaskView;
- mTaskView = taskView;
+ RemoteSplitLaunchAnimationRunner(Task initialTask, Task secondTask,
+ Consumer<Boolean> successCallback) {
+ mInitialTask = initialTask;
+ mSecondTask = secondTask;
+ mSuccessCallback = successCallback;
}
@Override
public void onAnimationStart(int transit, RemoteAnimationTargetCompat[] apps,
RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps,
Runnable finishedCallback) {
- TaskViewUtils.composeRecentsSplitLaunchAnimatorLegacy(mInitialTaskView, mTaskView, apps,
- wallpapers, nonApps, finishedCallback);
+ TaskViewUtils.composeRecentsSplitLaunchAnimatorLegacy(mInitialTask,
+ mSecondTask, apps, wallpapers, nonApps, () -> {
+ finishedCallback.run();
+ if (mSuccessCallback != null) {
+ mSuccessCallback.accept(true);
+ }
+ });
// After successful launch, call resetState
resetState();
}
@Override
public void onAnimationCancelled() {
+ if (mSuccessCallback != null) {
+ mSuccessCallback.accept(false);
+ }
resetState();
}
}
@@ -193,8 +175,8 @@
* To be called if split select was cancelled
*/
public void resetState() {
- mInitialTaskView = null;
- mSecondTaskView = null;
+ mInitialTask = null;
+ mSecondTask = null;
mStagePosition = SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
mInitialBounds = null;
}
@@ -204,7 +186,7 @@
* chosen
*/
public boolean isSplitSelectActive() {
- return mInitialTaskView != null && mSecondTaskView == null;
+ return mInitialTask != null && mSecondTask == null;
}
public Rect getInitialBounds() {
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index 9960fd3..849a7bc 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -51,8 +51,8 @@
*/
public class TaskViewSimulator implements TransformParams.BuilderProxy {
- private final String TAG = "TaskViewSimulator";
- private final boolean DEBUG = false;
+ private static final String TAG = "TaskViewSimulator";
+ private static final boolean DEBUG = false;
private final Rect mTmpCropRect = new Rect();
private final RectF mTempRectF = new RectF();
@@ -296,9 +296,8 @@
}
float fullScreenProgress = Utilities.boundToRange(this.fullScreenProgress.value, 0, 1);
- mCurrentFullscreenParams.setProgress(
- fullScreenProgress, recentsViewScale.value, /*taskViewScale=*/1f, mTaskRect.width(),
- mDp, mPositionHelper);
+ mCurrentFullscreenParams.setProgress(fullScreenProgress, recentsViewScale.value,
+ /* taskViewScale= */1f, mTaskRect.width(), mDp, mPositionHelper);
// Apply thumbnail matrix
RectF insets = mCurrentFullscreenParams.mCurrentDrawnInsets;
diff --git a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
index 482092d..95403b2 100644
--- a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java
@@ -15,20 +15,16 @@
*/
package com.android.quickstep.util;
-import android.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
-import com.android.launcher3.BubbleTextView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.Hotseat;
import com.android.launcher3.Launcher;
import com.android.launcher3.ShortcutAndWidgetContainer;
import com.android.launcher3.Workspace;
-import com.android.launcher3.widget.NavigableAppWidgetHostView;
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator;
-import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator.TranslationApplier;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import java.util.HashMap;
@@ -49,7 +45,7 @@
public UnfoldMoveFromCenterWorkspaceAnimator(Launcher launcher, WindowManager windowManager) {
mLauncher = launcher;
mMoveFromCenterAnimation = new UnfoldMoveFromCenterAnimator(windowManager,
- new WorkspaceViewsTranslationApplier());
+ new LauncherViewsMoveFromCenterTranslationApplier());
}
@Override
@@ -122,19 +118,4 @@
view.setClipChildren(originalClipChildren);
}
}
-
- private static class WorkspaceViewsTranslationApplier implements TranslationApplier {
-
- @Override
- public void apply(@NonNull View view, float x, float y) {
- if (view instanceof NavigableAppWidgetHostView) {
- ((NavigableAppWidgetHostView) view).setTranslationForMoveFromCenterAnimation(x, y);
- } else if (view instanceof BubbleTextView) {
- ((BubbleTextView) view).setTranslationForMoveFromCenterAnimation(x, y);
- } else {
- view.setTranslationX(x);
- view.setTranslationY(y);
- }
- }
- }
}
diff --git a/src/com/android/launcher3/util/VibratorWrapper.java b/quickstep/src/com/android/quickstep/util/VibratorWrapper.java
similarity index 65%
rename from src/com/android/launcher3/util/VibratorWrapper.java
rename to quickstep/src/com/android/quickstep/util/VibratorWrapper.java
index b0defd4..211bd08 100644
--- a/src/com/android/launcher3/util/VibratorWrapper.java
+++ b/quickstep/src/com/android/quickstep/util/VibratorWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * 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.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.util;
+package com.android.quickstep.util;
import static android.os.VibrationEffect.createPredefined;
import static android.provider.Settings.System.HAPTIC_FEEDBACK_ENABLED;
@@ -21,15 +21,20 @@
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
+import android.media.AudioAttributes;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.provider.Settings;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.util.MainThreadInitializedObject;
+
/**
* Wrapper around {@link Vibrator} to easily perform haptic feedback where necessary.
*/
@@ -39,8 +44,15 @@
public static final MainThreadInitializedObject<VibratorWrapper> INSTANCE =
new MainThreadInitializedObject<>(VibratorWrapper::new);
+ public static final AudioAttributes VIBRATION_ATTRS = new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .build();
+
public static final VibrationEffect EFFECT_CLICK =
createPredefined(VibrationEffect.EFFECT_CLICK);
+ public static final VibrationEffect EFFECT_TEXTURE_TICK =
+ VibrationEffect.createPredefined(VibrationEffect.EFFECT_TEXTURE_TICK);
/**
* Haptic when entering overview.
@@ -78,7 +90,27 @@
/** Vibrates with the given effect if haptic feedback is available and enabled. */
public void vibrate(VibrationEffect vibrationEffect) {
if (mHasVibrator && mIsHapticFeedbackEnabled) {
- UI_HELPER_EXECUTOR.execute(() -> mVibrator.vibrate(vibrationEffect));
+ UI_HELPER_EXECUTOR.execute(() -> mVibrator.vibrate(vibrationEffect, VIBRATION_ATTRS));
+ }
+ }
+
+ /**
+ * Vibrates with a single primitive, if supported, or use a fallback effect instead. This only
+ * vibrates if haptic feedback is available and enabled.
+ */
+ @SuppressLint("NewApi")
+ public void vibrate(int primitiveId, float primitiveScale, VibrationEffect fallbackEffect) {
+ if (mHasVibrator && mIsHapticFeedbackEnabled) {
+ UI_HELPER_EXECUTOR.execute(() -> {
+ if (Utilities.ATLEAST_R && primitiveId >= 0
+ && mVibrator.areAllPrimitivesSupported(primitiveId)) {
+ mVibrator.vibrate(VibrationEffect.startComposition()
+ .addPrimitive(primitiveId, primitiveScale)
+ .compose(), VIBRATION_ATTRS);
+ } else {
+ mVibrator.vibrate(fallbackEffect, VIBRATION_ATTRS);
+ }
+ });
}
}
}
diff --git a/quickstep/src/com/android/quickstep/views/ClearAllButton.java b/quickstep/src/com/android/quickstep/views/ClearAllButton.java
index b9a9006..22c87b0 100644
--- a/quickstep/src/com/android/quickstep/views/ClearAllButton.java
+++ b/quickstep/src/com/android/quickstep/views/ClearAllButton.java
@@ -39,10 +39,24 @@
}
};
+ public static final FloatProperty<ClearAllButton> DISMISS_ALPHA =
+ new FloatProperty<ClearAllButton>("dismissAlpha") {
+ @Override
+ public Float get(ClearAllButton view) {
+ return view.mDismissAlpha;
+ }
+
+ @Override
+ public void setValue(ClearAllButton view, float v) {
+ view.setDismissAlpha(v);
+ }
+ };
+
private final StatefulActivity mActivity;
private float mScrollAlpha = 1;
private float mContentAlpha = 1;
private float mVisibilityAlpha = 1;
+ private float mDismissAlpha = 1;
private float mFullscreenProgress = 1;
private float mGridProgress = 1;
@@ -97,6 +111,13 @@
}
}
+ public void setDismissAlpha(float alpha) {
+ if (mDismissAlpha != alpha) {
+ mDismissAlpha = alpha;
+ updateAlpha();
+ }
+ }
+
public void onRecentsViewScroll(int scroll, boolean gridEnabled) {
RecentsView recentsView = getRecentsView();
if (recentsView == null) {
@@ -123,7 +144,7 @@
}
private void updateAlpha() {
- final float alpha = mScrollAlpha * mContentAlpha * mVisibilityAlpha;
+ final float alpha = mScrollAlpha * mContentAlpha * mVisibilityAlpha * mDismissAlpha;
setAlpha(alpha);
setClickable(Math.min(alpha, 1) == 1);
}
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index a1befc5..5a86464 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -97,8 +97,9 @@
floatingView.mOrientationHandler =
originalView.getRecentsView().getPagedOrientationHandler();
- floatingView.mSplitPlaceholderView.setIcon(originalView.getIconView());
- floatingView.mSplitPlaceholderView.getIcon()
+ floatingView.mSplitPlaceholderView.setIconView(originalView.getIconView(),
+ launcher.getDeviceProfile().overviewTaskIconDrawableSizePx);
+ floatingView.mSplitPlaceholderView.getIconView()
.setRotation(floatingView.mOrientationHandler.getDegreesRotated());
parent.addView(floatingView);
return floatingView;
@@ -141,8 +142,8 @@
// TODO(194414938) seems like this scale value could be fine tuned, some stretchiness
mImageView.setScaleX(1f / scaleX + scaleX * progress);
mImageView.setScaleY(1f / scaleY + scaleY * progress);
- mOrientationHandler.setPrimaryScale(mSplitPlaceholderView.getIcon(), childScaleX);
- mOrientationHandler.setSecondaryScale(mSplitPlaceholderView.getIcon(), childScaleY);
+ mOrientationHandler.setPrimaryScale(mSplitPlaceholderView.getIconView(), childScaleX);
+ mOrientationHandler.setSecondaryScale(mSplitPlaceholderView.getIconView(), childScaleY);
}
protected void initPosition(RectF pos, InsettableFrameLayout.LayoutParams lp) {
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
index 1bc7c75..8562719 100644
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
@@ -3,7 +3,10 @@
import android.content.Context;
import android.util.AttributeSet;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.R;
+import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TaskThumbnailCache;
@@ -11,6 +14,8 @@
import com.android.quickstep.util.RecentsOrientedState;
import com.android.systemui.shared.recents.model.Task;
+import java.util.function.Consumer;
+
/**
* TaskView that contains and shows thumbnails for not one, BUT TWO(!!) tasks
*
@@ -95,6 +100,24 @@
}
@Override
+ public RunnableList launchTaskAnimated() {
+ getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask,
+ SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT, null /*callback*/);
+ return null;
+ }
+
+ @Override
+ public void launchTask(@NonNull Consumer<Boolean> callback, boolean freezeTaskList) {
+ getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask,
+ SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT, callback);
+ }
+
+ @Override
+ public TaskThumbnailView[] getThumbnails() {
+ return new TaskThumbnailView[]{mSnapshotView, mSnapshotView2};
+ }
+
+ @Override
public void onRecycle() {
super.onRecycle();
mSnapshotView2.setThumbnail(mSecondaryTask, null);
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 5d1c202..ac779b1 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -53,13 +53,15 @@
@IntDef(flag = true, value = {
HIDDEN_NON_ZERO_ROTATION,
HIDDEN_NO_TASKS,
- HIDDEN_NO_RECENTS})
+ HIDDEN_NO_RECENTS,
+ HIDDEN_FOCUSED_SCROLL})
@Retention(RetentionPolicy.SOURCE)
public @interface ActionsHiddenFlags { }
public static final int HIDDEN_NON_ZERO_ROTATION = 1 << 0;
public static final int HIDDEN_NO_TASKS = 1 << 1;
public static final int HIDDEN_NO_RECENTS = 1 << 2;
+ public static final int HIDDEN_FOCUSED_SCROLL = 1 << 3;
@IntDef(flag = true, value = {
DISABLED_SCROLLING,
@@ -76,7 +78,6 @@
private static final int INDEX_VISIBILITY_ALPHA = 1;
private static final int INDEX_FULLSCREEN_ALPHA = 2;
private static final int INDEX_HIDDEN_FLAGS_ALPHA = 3;
- private static final int INDEX_SCROLL_ALPHA = 4;
private final MultiValueAlpha mMultiValueAlpha;
private View mSplitButton;
@@ -196,10 +197,6 @@
return mMultiValueAlpha.getProperty(INDEX_FULLSCREEN_ALPHA);
}
- public AlphaProperty getScrollAlpha() {
- return mMultiValueAlpha.getProperty(INDEX_SCROLL_ALPHA);
- }
-
private void updateHorizontalPadding() {
setPadding(mInsets.left, 0, mInsets.right, 0);
}
@@ -223,7 +220,6 @@
mDp = dp;
updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
requestLayout();
- setSplitButtonVisible(mDp.isTablet);
}
public void setSplitButtonVisible(boolean visible) {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 646312e..3ed7b06 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -19,7 +19,6 @@
import static android.view.Surface.ROTATION_0;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
-import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType;
@@ -36,6 +35,7 @@
import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
+import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.clampToProgress;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
@@ -49,10 +49,10 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
+import static com.android.quickstep.views.ClearAllButton.DISMISS_ALPHA;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_RECENTS;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_TASKS;
-import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -79,7 +79,9 @@
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
+import android.os.SystemClock;
import android.os.UserHandle;
+import android.os.VibrationEffect;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
@@ -145,7 +147,8 @@
import com.android.quickstep.RecentsModel;
import com.android.quickstep.RecentsModel.TaskVisualsChangeListener;
import com.android.quickstep.RemoteAnimationTargets;
-import com.android.quickstep.SwipeUpAnimationLogic.RemoteTargetHandle;
+import com.android.quickstep.RemoteTargetGluer;
+import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskOverlayFactory;
import com.android.quickstep.TaskThumbnailCache;
@@ -159,6 +162,7 @@
import com.android.quickstep.util.SurfaceTransactionApplier;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
+import com.android.quickstep.util.VibratorWrapper;
import com.android.systemui.plugins.ResourceProvider;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
@@ -243,6 +247,12 @@
}
};
+ 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 =
+ VibratorWrapper.EFFECT_TEXTURE_TICK;
+
/**
* 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.
@@ -324,7 +334,7 @@
view.runActionOnRemoteHandles(new Consumer<RemoteTargetHandle>() {
@Override
public void accept(RemoteTargetHandle remoteTargetHandle) {
- remoteTargetHandle.mTaskViewSimulator.recentsViewScale.value =
+ remoteTargetHandle.getTaskViewSimulator().recentsViewScale.value =
scale;
}
});
@@ -359,6 +369,7 @@
private static final float INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET = 0.55f;
private static final float ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET = 0.05f;
private static final float ANIMATION_DISMISS_PROGRESS_MIDPOINT = 0.5f;
+ private static final float END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET = 0.75f;
private static final float SIGNIFICANT_MOVE_THRESHOLD_TABLET = 0.15f;
@@ -395,6 +406,7 @@
protected final ACTIVITY_TYPE mActivity;
private final float mFastFlingVelocity;
+ private final int mScrollHapticMinGapMillis;
private final RecentsModel mModel;
private final int mGridSideMargin;
private final ClearAllButton mClearAllButton;
@@ -441,6 +453,7 @@
private ObjectAnimator mTintingAnimator;
private int mOverScrollShift = 0;
+ private long mScrollLastHapticTimestamp;
/**
* TODO: Call reloadIdNeeded in onTaskStackChanged.
@@ -627,6 +640,8 @@
final int rotation = mActivity.getDisplay().getRotation();
mOrientationState.setRecentsRotation(rotation);
+ mScrollHapticMinGapMillis = getResources()
+ .getInteger(R.integer.recentsScrollHapticMinGapMillis);
mFastFlingVelocity = getResources()
.getDimensionPixelSize(R.dimen.recents_fast_fling_velocity);
mModel = RecentsModel.INSTANCE.get(context);
@@ -826,7 +841,7 @@
mActivity.addMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener);
mSyncTransactionApplier = new SurfaceTransactionApplier(this);
- runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.mTransformParams
+ runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTransformParams()
.setSyncTransactionApplier(mSyncTransactionApplier));
RecentsModel.INSTANCE.get(getContext()).addThumbnailChangeListener(this);
mIPipAnimationListener.setActivityAndRecentsView(mActivity, this);
@@ -845,7 +860,7 @@
mActivity.removeMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
mSyncTransactionApplier = null;
- runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.mTransformParams
+ runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTransformParams()
.setSyncTransactionApplier(null));
executeSideTaskLaunchCallback();
RecentsModel.INSTANCE.get(getContext()).removeThumbnailChangeListener(this);
@@ -935,7 +950,7 @@
public void launchSideTaskInLiveTileModeForRestartedApp(int taskId) {
int runningTaskViewId = getTaskViewIdFromTaskId(taskId);
if (mRunningTaskViewId != -1 && mRunningTaskViewId == runningTaskViewId) {
- TransformParams params = mRemoteTargetHandles[0].mTransformParams;
+ TransformParams params = mRemoteTargetHandles[0].getTransformParams();
RemoteAnimationTargets targets = params.getTargetSet();
if (targets != null && targets.findTask(taskId) != null) {
launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers,
@@ -1004,6 +1019,43 @@
}
}
+ private boolean isLastGridTaskVisible() {
+ TaskView lastTaskView = getLastGridTaskView();
+ return lastTaskView != null && lastTaskView.isVisibleToUser();
+ }
+
+ private TaskView getLastGridTaskView() {
+ IntArray topRowIdArray = getTopRowIdArray();
+ IntArray bottomRowIdArray = getBottomRowIdArray();
+ if (topRowIdArray.isEmpty() && bottomRowIdArray.isEmpty()) {
+ return null;
+ }
+ int lastTaskViewId = topRowIdArray.size() >= bottomRowIdArray.size() ? topRowIdArray.get(
+ topRowIdArray.size() - 1) : bottomRowIdArray.get(bottomRowIdArray.size() - 1);
+ return getTaskViewFromTaskViewId(lastTaskViewId);
+ }
+
+ private int getSnapToLastTaskScrollDiff() {
+ // Snap to a position where ClearAll is just invisible.
+ int screenStart = mOrientationHandler.getPrimaryScroll(this);
+ int clearAllWidth = mOrientationHandler.getPrimarySize(mClearAllButton);
+ int clearAllScroll = getScrollForPage(indexOfChild(mClearAllButton));
+ int targetScroll = clearAllScroll + (mIsRtl ? clearAllWidth : -clearAllWidth);
+ return screenStart - targetScroll;
+ }
+
+ private int getSnapToFocusedTaskScrollDiff(boolean isClearAllHidden) {
+ int screenStart = mOrientationHandler.getPrimaryScroll(this);
+ int targetScroll = getScrollForPage(indexOfChild(getFocusedTaskView()));
+ if (!isClearAllHidden) {
+ int clearAllWidth = mOrientationHandler.getPrimarySize(mClearAllButton);
+ int taskGridHorizontalDiff = mLastComputedTaskSize.right - mLastComputedGridSize.right;
+ int clearAllFocusScrollDiff = taskGridHorizontalDiff - clearAllWidth;
+ targetScroll += mIsRtl ? clearAllFocusScrollDiff : -clearAllFocusScrollDiff;
+ }
+ return screenStart - targetScroll;
+ }
+
private boolean isTaskViewWithinBounds(TaskView tv, int start, int end) {
int taskStart = mOrientationHandler.getChildStart(tv) + (int) tv.getOffsetAdjustment(
showAsFullscreen(), showAsGrid());
@@ -1083,7 +1135,6 @@
super.onPageEndTransition();
if (isClearAllHidden()) {
mActionsView.updateDisabledFlags(OverviewActionsView.DISABLED_SCROLLING, false);
- } else {
}
if (getNextPage() > 0) {
setSwipeDownShouldLaunchApp(true);
@@ -1191,6 +1242,25 @@
}
@Override
+ protected void onEdgeAbsorbingScroll() {
+ vibrateForScroll();
+ }
+
+ @Override
+ protected void onScrollOverPageChanged() {
+ vibrateForScroll();
+ }
+
+ private void vibrateForScroll() {
+ long now = SystemClock.uptimeMillis();
+ if (now - mScrollLastHapticTimestamp > mScrollHapticMinGapMillis) {
+ mScrollLastHapticTimestamp = now;
+ VibratorWrapper.INSTANCE.get(mContext).vibrate(SCROLL_VIBRATION_PRIMITIVE,
+ SCROLL_VIBRATION_PRIMITIVE_SCALE, SCROLL_VIBRATION_FALLBACK);
+ }
+ }
+
+ @Override
protected void determineScrollingStart(MotionEvent ev, float touchSlopScale) {
// Enables swiping to the left or right only if the task overlay is not modal.
if (!isModal()) {
@@ -1259,7 +1329,7 @@
mIgnoreResetTaskId == -1 ? null : getTaskViewByTaskId(mIgnoreResetTaskId);
int[] splitTaskIds =
- LauncherSplitScreenListener.INSTANCE.getNoCreate().getSplitTaskIds();
+ LauncherSplitScreenListener.INSTANCE.getNoCreate().getPersistentSplitIds();
int requiredGroupTaskViews = splitTaskIds.length / 2;
// Subtract half the number of split tasks and not total number because we've already
@@ -1278,7 +1348,8 @@
while (getTaskViewCount() > requiredTaskViewCount) {
removeView(getChildAt(getChildCount() - 1));
}
- while (requiredGroupTaskViews > 0) {
+ int groupedTaskViewCount = getGroupedTaskViewCount();
+ while (requiredGroupTaskViews > groupedTaskViewCount) {
// Add to front of list
addView(getTaskViewFromPool(true), 0);
requiredGroupTaskViews--;
@@ -1350,23 +1421,29 @@
}
Log.d(TASK_VIEW_ID_CRASH, "taskViewCount: " + getTaskViewCount()
+ " " + sb.toString());
+ mRunningTaskViewId = -1;
+ } else {
+ mRunningTaskViewId = newRunningTaskView.getTaskViewId();
}
- mRunningTaskViewId = newRunningTaskView.getTaskViewId();
}
+ int targetPage = -1;
if (mNextPage == INVALID_PAGE) {
// Set the current page to the running task, but not if settling on new task.
if (runningTaskId != -1) {
- setCurrentPage(indexOfChild(newRunningTaskView));
+ targetPage = indexOfChild(newRunningTaskView);
} else if (getTaskViewCount() > 0) {
- setCurrentPage(indexOfChild(getTaskViewAt(0)));
+ targetPage = indexOfChild(getTaskViewAt(0));
}
} else if (currentTaskId != -1) {
currentTaskView = getTaskViewByTaskId(currentTaskId);
if (currentTaskView != null) {
- setCurrentPage(indexOfChild(currentTaskView));
+ targetPage = indexOfChild(currentTaskView);
}
}
+ if (targetPage != -1 && mCurrentPage != targetPage) {
+ setCurrentPage(targetPage);
+ }
if (mIgnoreResetTaskId != -1 &&
getTaskViewByTaskId(mIgnoreResetTaskId) != ignoreResetTaskView) {
@@ -1405,6 +1482,16 @@
return taskViewCount;
}
+ public int getGroupedTaskViewCount() {
+ int groupViewCount = 0;
+ for (int i = 0; i < getChildCount(); i++) {
+ if (getChildAt(i) instanceof GroupedTaskView) {
+ groupViewCount++;
+ }
+ }
+ return groupViewCount;
+ }
+
protected void onTaskStackUpdated() {
// Lazily update the empty message only when the task stack is reapplied
updateEmptyMessage();
@@ -1426,10 +1513,11 @@
// to reset the params after it settles in Overview from swipe up so that we don't
// render with obsolete param values.
runActionOnRemoteHandles(remoteTargetHandle -> {
- remoteTargetHandle.mTaskViewSimulator.taskPrimaryTranslation.value = 0;
- remoteTargetHandle.mTaskViewSimulator.taskSecondaryTranslation.value = 0;
- remoteTargetHandle.mTaskViewSimulator.fullScreenProgress.value = 0;
- remoteTargetHandle.mTaskViewSimulator.recentsViewScale.value = 1;
+ TaskViewSimulator simulator = remoteTargetHandle.getTaskViewSimulator();
+ simulator.taskPrimaryTranslation.value = 0;
+ simulator.taskSecondaryTranslation.value = 0;
+ simulator.fullScreenProgress.value = 0;
+ simulator.recentsViewScale.value = 1;
});
// Similar to setRunningTaskHidden below, reapply the state before runningTaskView is
@@ -1485,11 +1573,11 @@
// Propagate DeviceProfile change event.
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator.setDp(dp));
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().setDp(dp));
mActionsView.setDp(dp);
mOrientationState.setDeviceProfile(dp);
- // Update RecentsView adn TaskView's DeviceProfile dependent layout.
+ // Update RecentsView and TaskView's DeviceProfile dependent layout.
updateOrientationHandler();
}
@@ -1635,28 +1723,28 @@
// After scrolling, update the visible task's data
loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
-
- // After scrolling, update ActionsView's visibility.
- updateActionsViewScrollAlpha();
}
+ // Update ActionsView's visibility when scroll changes.
+ updateActionsViewFocusedScroll();
+
// Update the high res thumbnail loader state
mModel.getThumbnailCache().getHighResLoadingState().setFlingingFast(isFlingingFast);
return scrolling;
}
- private void updateActionsViewScrollAlpha() {
- float scrollAlpha = 1f;
+ private void updateActionsViewFocusedScroll() {
+ boolean hiddenFocusedScroll;
if (showAsGrid()) {
TaskView focusedTaskView = getFocusedTaskView();
- if (focusedTaskView != null) {
- float scrollDiff = Math.abs(getScrollForPage(indexOfChild(focusedTaskView))
- - mOrientationHandler.getPrimaryScroll(this));
- float delta = (mGridSideMargin - scrollDiff) / (float) mGridSideMargin;
- scrollAlpha = Utilities.boundToRange(delta, 0, 1);
- }
+ hiddenFocusedScroll = focusedTaskView == null
+ || getScrollForPage(indexOfChild(focusedTaskView))
+ != mOrientationHandler.getPrimaryScroll(this);
+ } else {
+ hiddenFocusedScroll = false;
}
- mActionsView.getScrollAlpha().setValue(scrollAlpha);
+ mActionsView.updateHiddenFlags(OverviewActionsView.HIDDEN_FOCUSED_SCROLL,
+ hiddenFocusedScroll);
}
/**
@@ -1811,7 +1899,7 @@
setCurrentTask(-1);
mIgnoreResetTaskId = -1;
mTaskListChangeId = -1;
- mFocusedTaskViewId = getTaskViewCount() > 0 ? getTaskViewAt(0).getTaskViewId() : -1;
+ mFocusedTaskViewId = -1;
if (mRecentsAnimationController != null) {
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile) {
@@ -1822,7 +1910,7 @@
}
}
setEnableDrawingLiveTile(false);
- runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.mTransformParams
+ runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTransformParams()
.setTargetSet(null));
// These are relatively expensive and don't need to be done this frame (RecentsView isn't
@@ -2532,12 +2620,15 @@
// alpha is set to 0 so that it can be recycled in the view pool properly
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && taskView.isRunningTask()) {
runActionOnRemoteHandles(remoteTargetHandle -> {
- TransformParams params = remoteTargetHandle.mTransformParams;
+ TransformParams params = remoteTargetHandle.getTransformParams();
anim.setFloat(params, TransformParams.TARGET_ALPHA, 0,
- clampToProgress(ACCEL, 0, 0.5f));
+ clampToProgress(FINAL_FRAME, 0, 0.5f));
});
}
- anim.setFloat(taskView, VIEW_ALPHA, 0, clampToProgress(ACCEL, 0, 0.5f));
+ boolean isTaskInBottomGridRow = showAsGrid() && !mTopRowIdSet.contains(
+ taskView.getTaskViewId()) && taskView.getTaskViewId() != mFocusedTaskViewId;
+ anim.setFloat(taskView, VIEW_ALPHA, 0,
+ clampToProgress(isTaskInBottomGridRow ? ACCEL : FINAL_FRAME, 0, 0.5f));
FloatProperty<TaskView> secondaryViewTranslate =
taskView.getSecondaryDissmissTranslationProperty();
int secondaryTaskDimension = mOrientationHandler.getSecondaryDimension(taskView);
@@ -2555,7 +2646,7 @@
&& taskView.isRunningTask()) {
anim.addOnFrameCallback(() -> {
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.taskSecondaryTranslation.value = mOrientationHandler
.getSecondaryValue(taskView.getTranslationX(),
taskView.getTranslationY()
@@ -2582,7 +2673,6 @@
mFirstFloatingTaskView.setAlpha(1);
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
- anim.addEndListener(aBoolean -> mActionsView.setSplitButtonVisible(false));
}
/**
@@ -2659,6 +2749,94 @@
}
}
+ float dismissTranslationInterpolationEnd = 1;
+ boolean closeGapBetweenClearAll = false;
+ boolean isClearAllHidden = isClearAllHidden();
+ if (showAsGrid && isLastGridTaskVisible()) {
+ // After dismissal, animate translation of the remaining tasks to fill any gap left
+ // between the end of the grid and the clear all button. Only animate if the clear
+ // all button is visible or would become visible after dismissal.
+ float longGridRowWidthDiff = 0;
+
+ int topGridRowSize = mTopRowIdSet.size();
+ int bottomGridRowSize = taskCount - mTopRowIdSet.size() - 1;
+ boolean topRowLonger = topGridRowSize > bottomGridRowSize;
+ boolean bottomRowLonger = bottomGridRowSize > topGridRowSize;
+ boolean dismissedTaskFromTop = mTopRowIdSet.contains(dismissedTaskViewId);
+ boolean dismissedTaskFromBottom = !dismissedTaskFromTop && !isFocusedTaskDismissed;
+ float gapWidth = 0;
+ if ((topRowLonger && dismissedTaskFromTop)
+ || (bottomRowLonger && dismissedTaskFromBottom)) {
+ gapWidth = dismissedTaskWidth;
+ } else if ((topRowLonger && nextFocusedTaskFromTop)
+ || (bottomRowLonger && !nextFocusedTaskFromTop)) {
+ gapWidth = nextFocusedTaskWidth;
+ }
+ if (gapWidth > 0) {
+ if (taskCount > 2) {
+ // Compensate the removed gap.
+ longGridRowWidthDiff += mIsRtl ? -gapWidth : gapWidth;
+ if (isClearAllHidden) {
+ // If ClearAllButton isn't fully shown, snap to the last task.
+ longGridRowWidthDiff += getSnapToLastTaskScrollDiff();
+ }
+ } else {
+ // If only focused task will be left, snap to focused task instead.
+ longGridRowWidthDiff += getSnapToFocusedTaskScrollDiff(isClearAllHidden);
+ }
+ }
+
+ // If we need to animate the grid to compensate the clear all gap, we split the second
+ // half of the dismiss pending animation (in which the non-dismissed tasks slide into
+ // place) in half again, making the first quarter the existing non-dismissal sliding
+ // and the second quarter this new animation of gap filling. This is due to the fact
+ // that PendingAnimation is a single animation, not a sequence of animations, so we
+ // fake it using interpolation.
+ if (longGridRowWidthDiff != 0) {
+ closeGapBetweenClearAll = true;
+ // Stagger the offsets of each additional task for a delayed animation. We use
+ // half here as this animation is half of half of an animation (1/4th).
+ float halfAdditionalDismissTranslationOffset =
+ (0.5f * ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET);
+ dismissTranslationInterpolationEnd = Utilities.boundToRange(
+ END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ + (taskCount - 1) * halfAdditionalDismissTranslationOffset,
+ END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET, 1);
+ for (int i = 0; i < taskCount; i++) {
+ TaskView taskView = getTaskViewAt(i);
+ anim.setFloat(taskView, TaskView.GRID_END_TRANSLATION_X, longGridRowWidthDiff,
+ clampToProgress(LINEAR, dismissTranslationInterpolationEnd, 1));
+ dismissTranslationInterpolationEnd = Utilities.boundToRange(
+ dismissTranslationInterpolationEnd
+ - halfAdditionalDismissTranslationOffset,
+ END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET, 1);
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile
+ && taskView.isRunningTask()) {
+ anim.addOnFrameCallback(() -> {
+ runActionOnRemoteHandles(
+ remoteTargetHandle ->
+ remoteTargetHandle.getTaskViewSimulator()
+ .taskPrimaryTranslation.value =
+ TaskView.GRID_END_TRANSLATION_X.get(taskView));
+ redrawLiveTile();
+ });
+ }
+ }
+
+ // Change alpha of clear all if translating grid to hide it
+ if (isClearAllHidden) {
+ anim.setFloat(mClearAllButton, DISMISS_ALPHA, 0, LINEAR);
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ super.onAnimationEnd(animation);
+ mClearAllButton.setDismissAlpha(1);
+ }
+ });
+ }
+ }
+ }
+
int distanceFromDismissedTask = 0;
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
@@ -2710,7 +2888,7 @@
anim.addOnFrameCallback(() -> {
runActionOnRemoteHandles(
remoteTargetHandle ->
- remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle.getTaskViewSimulator()
.taskPrimaryTranslation.value =
mOrientationHandler.getPrimaryValue(
child.getTranslationX(),
@@ -2738,22 +2916,25 @@
float animationStartProgress = Utilities.boundToRange(
INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
- * ++distanceFromDismissedTask, 0f, 1f);
+ * ++distanceFromDismissedTask, 0f,
+ dismissTranslationInterpolationEnd);
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,
- clampToProgress(LINEAR, animationStartProgress, 1f));
+ clampToProgress(LINEAR, animationStartProgress,
+ dismissTranslationInterpolationEnd));
anim.setFloat(taskView, taskView.getPrimaryDismissTranslationProperty(),
mIsRtl ? dismissedTaskWidth : -dismissedTaskWidth,
- clampToProgress(LINEAR, animationStartProgress, 1f));
+ clampToProgress(LINEAR, animationStartProgress,
+ dismissTranslationInterpolationEnd));
float secondaryTranslation = -mTaskGridVerticalDiff;
if (!nextFocusedTaskFromTop) {
secondaryTranslation -= mTopBottomRowHeightDiff;
}
anim.setFloat(taskView, taskView.getSecondaryDissmissTranslationProperty(),
- secondaryTranslation,
- clampToProgress(LINEAR, animationStartProgress, 1f));
+ secondaryTranslation, clampToProgress(LINEAR, animationStartProgress,
+ dismissTranslationInterpolationEnd));
anim.setFloat(taskView, TaskView.FOCUS_TRANSITION, 0f,
clampToProgress(LINEAR, 0f, ANIMATION_DISMISS_PROGRESS_MIDPOINT));
} else {
@@ -2761,7 +2942,8 @@
isFocusedTaskDismissed ? nextFocusedTaskWidth : dismissedTaskWidth;
anim.setFloat(taskView, taskView.getPrimaryDismissTranslationProperty(),
mIsRtl ? primaryTranslation : -primaryTranslation,
- clampToProgress(LINEAR, animationStartProgress, 1f));
+ clampToProgress(LINEAR, animationStartProgress,
+ dismissTranslationInterpolationEnd));
}
}
}
@@ -2777,6 +2959,7 @@
mPendingAnimation = anim;
final TaskView finalNextFocusedTaskView = nextFocusedTaskView;
+ final boolean finalCloseGapBetweenClearAll = closeGapBetweenClearAll;
mPendingAnimation.addEndListener(new Consumer<Boolean>() {
@Override
public void accept(Boolean success) {
@@ -2812,49 +2995,72 @@
resetTaskVisuals();
int pageToSnapTo = mCurrentPage;
+ mCurrentPageScrollDiff = 0;
int taskViewIdToSnapTo = -1;
if (showAsGrid) {
- // Get the id of the task view we will snap to based on the current
- // page's relative position as the order of indices change over time due
- // to dismissals.
- TaskView snappedTaskView = getTaskViewAtByAbsoluteIndex(mCurrentPage);
- if (snappedTaskView != null) {
- if (snappedTaskView.getTaskViewId() == mFocusedTaskViewId) {
- if (finalNextFocusedTaskView != null) {
- taskViewIdToSnapTo = finalNextFocusedTaskView.getTaskViewId();
- } else {
- taskViewIdToSnapTo = mFocusedTaskViewId;
+ if (finalCloseGapBetweenClearAll) {
+ if (taskCount > 2) {
+ pageToSnapTo = indexOfChild(mClearAllButton);
+ if (isClearAllHidden) {
+ int clearAllWidth = mOrientationHandler.getPrimarySize(
+ mClearAllButton);
+ mCurrentPageScrollDiff =
+ isRtl() ? clearAllWidth : -clearAllWidth;
}
- } else {
- int snappedTaskViewId = snappedTaskView.getTaskViewId();
- boolean isSnappedTaskInTopRow = mTopRowIdSet.contains(
- snappedTaskViewId);
- IntArray taskViewIdArray =
- isSnappedTaskInTopRow ? getTopRowIdArray()
- : getBottomRowIdArray();
- int snappedIndex = taskViewIdArray.indexOf(snappedTaskViewId);
- taskViewIdArray.removeValue(dismissedTaskViewId);
- if (snappedIndex < taskViewIdArray.size()) {
- taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
- } else if (snappedIndex == taskViewIdArray.size()) {
- // If the snapped task is the last item from the dismissed row,
- // snap to the same column in the other grid row
- IntArray inverseRowTaskViewIdArray =
- isSnappedTaskInTopRow ? getBottomRowIdArray()
- : getTopRowIdArray();
- if (snappedIndex < inverseRowTaskViewIdArray.size()) {
- taskViewIdToSnapTo = inverseRowTaskViewIdArray.get(
- snappedIndex);
+ } else if (isClearAllHidden) {
+ // Snap to focused task if clear all is hidden.
+ pageToSnapTo = 0;
+ }
+ } else {
+ // Get the id of the task view we will snap to based on the current
+ // page's relative position as the order of indices change over time due
+ // to dismissals.
+ TaskView snappedTaskView = getTaskViewAtByAbsoluteIndex(mCurrentPage);
+ if (snappedTaskView != null) {
+ if (snappedTaskView.getTaskViewId() == mFocusedTaskViewId) {
+ if (finalNextFocusedTaskView != null) {
+ taskViewIdToSnapTo =
+ finalNextFocusedTaskView.getTaskViewId();
+ } else {
+ taskViewIdToSnapTo = mFocusedTaskViewId;
+ }
+ } else {
+ int snappedTaskViewId = snappedTaskView.getTaskViewId();
+ boolean isSnappedTaskInTopRow = mTopRowIdSet.contains(
+ snappedTaskViewId);
+ IntArray taskViewIdArray =
+ isSnappedTaskInTopRow ? getTopRowIdArray()
+ : getBottomRowIdArray();
+ int snappedIndex = taskViewIdArray.indexOf(snappedTaskViewId);
+ taskViewIdArray.removeValue(dismissedTaskViewId);
+ if (finalNextFocusedTaskView != null) {
+ taskViewIdArray.removeValue(
+ finalNextFocusedTaskView.getTaskViewId());
+ }
+ if (snappedIndex < taskViewIdArray.size()) {
+ taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
+ } else if (snappedIndex == taskViewIdArray.size()) {
+ // If the snapped task is the last item from the
+ // dismissed row,
+ // snap to the same column in the other grid row
+ IntArray inverseRowTaskViewIdArray =
+ isSnappedTaskInTopRow ? getBottomRowIdArray()
+ : getTopRowIdArray();
+ if (snappedIndex < inverseRowTaskViewIdArray.size()) {
+ taskViewIdToSnapTo = inverseRowTaskViewIdArray.get(
+ snappedIndex);
+ }
}
}
}
- }
- int primaryScroll = mOrientationHandler.getPrimaryScroll(RecentsView.this);
- int currentPageScroll = getScrollForPage(pageToSnapTo);
- mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
+ int primaryScroll = mOrientationHandler.getPrimaryScroll(
+ RecentsView.this);
+ int currentPageScroll = getScrollForPage(pageToSnapTo);
+ mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
+ }
} else if (dismissedIndex < pageToSnapTo || pageToSnapTo == taskCount - 1) {
- pageToSnapTo -= 1;
+ pageToSnapTo--;
}
removeViewInLayout(dismissedTaskView);
mTopRowIdSet.remove(dismissedTaskViewId);
@@ -2919,9 +3125,16 @@
}
}
setCurrentPage(pageToSnapTo);
+ // Update various scroll-dependent UI.
dispatchScrollChanged();
+ updateActionsViewFocusedScroll();
+ if (isClearAllHidden()) {
+ mActionsView.updateDisabledFlags(OverviewActionsView.DISABLED_SCROLLING,
+ false);
+ }
}
}
+ updateFocusedSplitButtonVisibility();
onDismissAnimationEnds();
mPendingAnimation = null;
}
@@ -2930,6 +3143,19 @@
}
/**
+ * Shows split button if
+ * * We're in large screen
+ * * We're not already in split
+ * * There are at least 2 tasks to invoke split
+ */
+ private void updateFocusedSplitButtonVisibility() {
+ mActionsView.setSplitButtonVisible(mActivity.getDeviceProfile().isTablet &&
+ !(getFocusedTaskView() instanceof GroupedTaskView) &&
+ getTaskViewCount() > 1
+ );
+ }
+
+ /**
* Returns all the tasks in the top row, without the focused task
*/
private IntArray getTopRowIdArray() {
@@ -3340,7 +3566,7 @@
mLastComputedTaskEndPushOutDistance = null;
updatePageOffsets();
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.setScroll(getScrollOffset()));
setImportantForAccessibility(isModal() ? IMPORTANT_FOR_ACCESSIBILITY_NO
: IMPORTANT_FOR_ACCESSIBILITY_AUTO);
@@ -3406,7 +3632,7 @@
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile
&& i == getRunningTaskIndex()) {
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.taskPrimaryTranslation.value = totalTranslation);
redrawLiveTile();
}
@@ -3514,7 +3740,7 @@
task.getTaskResistanceTranslationProperty().set(task, translation / getScaleY());
}
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.recentsViewSecondaryTranslation.value = translation);
}
@@ -3557,7 +3783,8 @@
mSplitHiddenTaskView = taskView;
Rect initialBounds = new Rect(taskView.getLeft(), taskView.getTop(), taskView.getRight(),
taskView.getBottom());
- mSplitSelectStateController.setInitialTaskSelect(taskView, stagePosition, initialBounds);
+ mSplitSelectStateController.setInitialTaskSelect(taskView.getTask(),
+ stagePosition, initialBounds);
mSplitHiddenTaskViewIndex = indexOfChild(taskView);
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
finishRecentsAnimation(true, null);
@@ -3598,7 +3825,7 @@
secondTaskEndingBounds, taskView.getThumbnail(),
true /*fadeWithThumbnail*/);
pendingAnimation.addEndListener(aBoolean -> {
- mSplitSelectStateController.setSecondTaskId(taskView);
+ mSplitSelectStateController.setSecondTaskId(taskView.getTask());
resetFromSplitSelectionState();
});
mSecondSplitHiddenTaskView = taskView;
@@ -3733,7 +3960,6 @@
mSecondSplitHiddenTaskView.setVisibility(VISIBLE);
mSecondSplitHiddenTaskView = null;
}
- mActionsView.setSplitButtonVisible(true);
}
private void updateDeadZoneRects() {
@@ -3830,7 +4056,7 @@
&& runningTaskIndex != taskIndex) {
for (RemoteTargetHandle remoteHandle : recentsView.getRemoteTargetHandles()) {
anim.play(ObjectAnimator.ofFloat(
- remoteHandle.mTaskViewSimulator.taskPrimaryTranslation,
+ remoteHandle.getTaskViewSimulator().taskPrimaryTranslation,
AnimatedFloat.VALUE,
primaryTranslation));
}
@@ -3914,7 +4140,7 @@
mPendingAnimation.add(anim);
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
runActionOnRemoteHandles(
- remoteTargetHandle -> remoteTargetHandle.mTaskViewSimulator
+ remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.addOverviewToAppAnim(mPendingAnimation, interpolator));
mPendingAnimation.addOnFrameCallback(this::redrawLiveTile);
}
@@ -3948,6 +4174,7 @@
@Override
protected void notifyPageSwitchListener(int prevPage) {
super.notifyPageSwitchListener(prevPage);
+ updateFocusedSplitButtonVisibility();
loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
updateEnabledOverlays();
}
@@ -4007,9 +4234,9 @@
public void redrawLiveTile() {
runActionOnRemoteHandles(remoteTargetHandle -> {
- TransformParams params = remoteTargetHandle.mTransformParams;
+ TransformParams params = remoteTargetHandle.getTransformParams();
if (params.getTargetSet() != null) {
- remoteTargetHandle.mTaskViewSimulator.apply(params);
+ remoteTargetHandle.getTaskViewSimulator().apply(params);
}
});
}
@@ -4030,44 +4257,14 @@
recentsAnimationTargets.addReleaseCheck(mSyncTransactionApplier);
}
- RemoteAnimationTargetCompat dividerTarget =
- recentsAnimationTargets.getNonAppTargetOfType(TYPE_DOCK_DIVIDER);
- // TODO Consolidate this shared code with SwipeUpAnimationLogic (or maybe just reuse
- // what that class has and pass it into here)
- mRemoteTargetHandles = new RemoteTargetHandle[dividerTarget == null ? 1 : 2];
- TaskViewSimulator primaryTvs = createTaskViewSimulator();
- mRemoteTargetHandles[0] = new RemoteTargetHandle(primaryTvs, new TransformParams());
- if (dividerTarget == null) {
- mRemoteTargetHandles[0].mTaskViewSimulator
- .setPreview(recentsAnimationTargets.apps[0], null);
- mRemoteTargetHandles[0].mTransformParams.setTargetSet(recentsAnimationTargets);
- } else {
- TaskViewSimulator secondaryTvs = createTaskViewSimulator();
- secondaryTvs.setOrientationState(mOrientationState);
- secondaryTvs.recentsViewScale.value = 1;
-
- mRemoteTargetHandles[1] = new RemoteTargetHandle(secondaryTvs, new TransformParams());
- RemoteAnimationTargetCompat primaryTaskTarget = recentsAnimationTargets.apps[0];
- RemoteAnimationTargetCompat secondaryTaskTarget = recentsAnimationTargets.apps[1];
- mSplitBoundsConfig = new SplitConfigurationOptions.StagedSplitBounds(
- primaryTaskTarget.screenSpaceBounds,
- secondaryTaskTarget.screenSpaceBounds, dividerTarget.screenSpaceBounds);
- mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget,
- mSplitBoundsConfig);
- mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(secondaryTaskTarget,
- mSplitBoundsConfig);
- RemoteAnimationTargets rats = new RemoteAnimationTargets(
- new RemoteAnimationTargetCompat[]{primaryTaskTarget},
- recentsAnimationTargets.wallpapers, recentsAnimationTargets.nonApps,
- MODE_CLOSING
- );
- RemoteAnimationTargets splitRats = new RemoteAnimationTargets(
- new RemoteAnimationTargetCompat[]{secondaryTaskTarget},
- recentsAnimationTargets.wallpapers, recentsAnimationTargets.nonApps,
- MODE_CLOSING
- );
- mRemoteTargetHandles[0].mTransformParams.setTargetSet(rats);
- mRemoteTargetHandles[1].mTransformParams.setTargetSet(splitRats);
+ RemoteTargetGluer gluer = new RemoteTargetGluer(getContext(), getSizeStrategy());
+ mRemoteTargetHandles = gluer.assignTargetsForSplitScreen(recentsAnimationTargets);
+ mSplitBoundsConfig = gluer.getStagedSplitBounds();
+ for (RemoteTargetHandle remoteTargetHandle : mRemoteTargetHandles) {
+ TaskViewSimulator tvs = remoteTargetHandle.getTaskViewSimulator();
+ tvs.setOrientationState(mOrientationState);
+ tvs.setDp(mActivity.getDeviceProfile());
+ tvs.recentsViewScale.value = 1;
}
}
@@ -4082,14 +4279,6 @@
}
}
- private TaskViewSimulator createTaskViewSimulator() {
- TaskViewSimulator tvs = new TaskViewSimulator(getContext(), getSizeStrategy());
- tvs.setOrientationState(mOrientationState);
- tvs.setDp(mActivity.getDeviceProfile());
- tvs.recentsViewScale.value = 1;
- return tvs;
- }
-
public void finishRecentsAnimation(boolean toRecents, Runnable onFinishComplete) {
finishRecentsAnimation(toRecents, true /* shouldPip */, onFinishComplete);
}
@@ -4369,7 +4558,7 @@
public void setOverviewGridEnabled(boolean overviewGridEnabled) {
if (mOverviewGridEnabled != overviewGridEnabled) {
mOverviewGridEnabled = overviewGridEnabled;
- updateActionsViewScrollAlpha();
+ updateActionsViewFocusedScroll();
// Request layout to ensure scroll position is recalculated with updated mGridProgress.
requestLayout();
}
@@ -4584,7 +4773,7 @@
private void dispatchScrollChanged() {
runActionOnRemoteHandles(remoteTargetHandle ->
- remoteTargetHandle.mTaskViewSimulator.setScroll(getScrollOffset()));
+ remoteTargetHandle.getTaskViewSimulator().setScroll(getScrollOffset()));
for (int i = mScrollListeners.size() - 1; i >= 0; i--) {
mScrollListeners.get(i).onScrollChanged();
}
diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
index a712d1a..845e13e 100644
--- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
@@ -24,8 +24,6 @@
import androidx.annotation.Nullable;
-import com.android.quickstep.util.SplitSelectStateController;
-
public class SplitPlaceholderView extends FrameLayout {
public static final FloatProperty<SplitPlaceholderView> ALPHA_FLOAT =
@@ -42,34 +40,26 @@
}
};
- private SplitSelectStateController mSplitController;
- private IconView mIcon;
+ private IconView mIconView;
public SplitPlaceholderView(Context context, AttributeSet attrs) {
super(context, attrs);
}
- public void init(SplitSelectStateController controller) {
- this.mSplitController = controller;
- }
-
- public SplitSelectStateController getSplitController() {
- return mSplitController;
- }
-
@Nullable
- public IconView getIcon() {
- return mIcon;
+ public IconView getIconView() {
+ return mIconView;
}
- public void setIcon(IconView icon) {
- if (mIcon == null) {
- mIcon = new IconView(getContext());
- addView(mIcon);
+ public void setIconView(IconView iconView, int iconSize) {
+ if (mIconView == null) {
+ mIconView = new IconView(getContext());
+ addView(mIconView);
}
- mIcon.setDrawable(icon.getDrawable());
- FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(icon.getLayoutParams());
+ mIconView.setDrawable(iconView.getDrawable());
+ mIconView.setDrawableSize(iconSize, iconSize);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(iconView.getLayoutParams());
params.gravity = Gravity.CENTER;
- mIcon.setLayoutParams(params);
+ mIconView.setLayoutParams(params);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index bfe6ca4..7c558c2 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -91,7 +91,7 @@
import com.android.launcher3.util.ViewPool.Reusable;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.RemoteAnimationTargets;
-import com.android.quickstep.SwipeUpAnimationLogic.RemoteTargetHandle;
+import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskIconCache;
import com.android.quickstep.TaskOverlayFactory;
@@ -99,6 +99,7 @@
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TaskViewUtils;
import com.android.quickstep.util.CancellableTask;
+import com.android.quickstep.util.LauncherSplitScreenListener;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.TaskCornerRadius;
import com.android.quickstep.util.TransformParams;
@@ -343,6 +344,19 @@
}
};
+ public static final FloatProperty<TaskView> GRID_END_TRANSLATION_X =
+ new FloatProperty<TaskView>("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<TaskView>("snapshotScale") {
@Override
@@ -381,6 +395,8 @@
// 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;
@@ -577,6 +593,11 @@
return mSnapshotView;
}
+ /** TODO(b/197033698) Remove all usages of above method and migrate to this one */
+ public TaskThumbnailView[] getThumbnails() {
+ return new TaskThumbnailView[]{mSnapshotView};
+ }
+
public IconView getIconView() {
return mIconView;
}
@@ -603,13 +624,12 @@
mIsClickableAsLiveTile = false;
RecentsView recentsView = getRecentsView();
RemoteAnimationTargets targets;
- RemoteTargetHandle[] remoteTargetHandles =
- recentsView.mRemoteTargetHandles;
+ RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
if (remoteTargetHandles.length == 1) {
- targets = remoteTargetHandles[0].mTransformParams.getTargetSet();
+ targets = remoteTargetHandles[0].getTransformParams().getTargetSet();
} else {
- TransformParams topLeftParams = remoteTargetHandles[0].mTransformParams;
- TransformParams rightBottomParams = remoteTargetHandles[1].mTransformParams;
+ TransformParams topLeftParams = remoteTargetHandles[0].getTransformParams();
+ TransformParams rightBottomParams = remoteTargetHandles[1].getTransformParams();
RemoteAnimationTargetCompat[] apps = Stream.concat(
Arrays.stream(topLeftParams.getTargetSet().apps),
Arrays.stream(rightBottomParams.getTargetSet().apps))
@@ -674,8 +694,13 @@
TestLogging.recordEvent(
TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask);
ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null);
+ boolean isOldTaskSplit = LauncherSplitScreenListener.INSTANCE.getNoCreate()
+ .getPersistentSplitIds().length > 0;
if (ActivityManagerWrapper.getInstance()
.startActivityFromRecents(mTask.key, opts.options)) {
+ if (isOldTaskSplit) {
+ SystemUiProxy.INSTANCE.getNoCreate().exitSplitScreen(mTask.key.id);
+ }
RecentsView recentsView = getRecentsView();
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskViewId() != -1) {
recentsView.onTaskLaunchedInLiveTileMode();
@@ -823,6 +848,7 @@
RecentsView recentsView = getRecentsView();
recentsView.switchToScreenshot(
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
+ false /* shouldPip */,
this::showTaskMenu));
} else {
showTaskMenu();
@@ -950,8 +976,8 @@
protected void resetViewTransforms() {
// fullscreenTranslation and accumulatedTranslation should not be reset, as
// resetViewTransforms is called during Quickswitch scrolling.
- mDismissTranslationX = mTaskOffsetTranslationX = mTaskResistanceTranslationX =
- mSplitSelectTranslationX = 0f;
+ mDismissTranslationX = mTaskOffsetTranslationX =
+ mTaskResistanceTranslationX = mSplitSelectTranslationX = mGridEndTranslationX = 0f;
mDismissTranslationY = mTaskOffsetTranslationY = mTaskResistanceTranslationY =
mSplitSelectTranslationY = 0f;
setSnapshotScale(1f);
@@ -1051,7 +1077,6 @@
private void setNonGridScale(float nonGridScale) {
mNonGridScale = nonGridScale;
- updateCornerRadius();
applyScale();
}
@@ -1082,6 +1107,7 @@
scale *= mDismissScale;
setScaleX(scale);
setScaleY(scale);
+ updateSnapshotRadius();
}
/**
@@ -1162,6 +1188,11 @@
return mGridTranslationY;
}
+ private void setGridEndTranslationX(float gridEndTranslationX) {
+ mGridEndTranslationX = gridEndTranslationX;
+ applyTranslationX();
+ }
+
public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
float scrollAdjustment = 0;
if (gridEnabled) {
@@ -1191,7 +1222,7 @@
private void applyTranslationX() {
setTranslationX(mDismissTranslationX + mTaskOffsetTranslationX + mTaskResistanceTranslationX
- + mSplitSelectTranslationX + getPersistentTranslationX());
+ + mSplitSelectTranslationX + mGridEndTranslationX + getPersistentTranslationX());
}
private void applyTranslationY() {
@@ -1392,29 +1423,25 @@
mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
mSnapshotView.getTaskOverlay().setFullscreenProgress(progress);
- updateCornerRadius();
+ updateSnapshotRadius();
- mSnapshotView.setFullscreenParams(mCurrentFullscreenParams);
mOutlineProvider.updateParams(
mCurrentFullscreenParams,
mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx);
invalidateOutline();
}
- private void updateCornerRadius() {
+ private void updateSnapshotRadius() {
updateCurrentFullscreenParams(mSnapshotView.getPreviewPositionHelper());
+ mSnapshotView.setFullscreenParams(mCurrentFullscreenParams);
}
void updateCurrentFullscreenParams(PreviewPositionHelper previewPositionHelper) {
if (getRecentsView() == null) {
return;
}
- mCurrentFullscreenParams.setProgress(
- mFullscreenProgress,
- getRecentsView().getScaleX(),
- mNonGridScale,
- getWidth(), mActivity.getDeviceProfile(),
- previewPositionHelper);
+ mCurrentFullscreenParams.setProgress(mFullscreenProgress, getRecentsView().getScaleX(),
+ getScaleX(), getWidth(), mActivity.getDeviceProfile(), previewPositionHelper);
}
/**
@@ -1541,7 +1568,7 @@
public FullscreenDrawParams(Context context) {
mCornerRadius = TaskCornerRadius.get(context);
- mWindowCornerRadius = QuickStepContract.getWindowCornerRadius(context.getResources());
+ mWindowCornerRadius = QuickStepContract.getWindowCornerRadius(context);
mCurrentDrawnCornerRadius = mCornerRadius;
}
diff --git a/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java b/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
similarity index 65%
rename from quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
rename to quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
index f82fbcc..c1b3beb 100644
--- a/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
+++ b/quickstep/tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
@@ -15,24 +15,31 @@
*/
package com.android.launcher3.model;
+import static android.os.Process.myUserHandle;
+
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_PREDICTION;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import static com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
-import static org.robolectric.Shadows.shadowOf;
+import static org.mockito.Mockito.doReturn;
import android.app.prediction.AppTarget;
import android.app.prediction.AppTargetId;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
-import android.content.Context;
-import android.os.Process;
import android.os.UserHandle;
+import android.text.TextUtils;
+import android.util.Log;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.config.FeatureFlags;
@@ -40,38 +47,34 @@
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.QuickstepModelDelegate.PredictorState;
-import com.android.launcher3.shadows.ShadowDeviceFlag;
import com.android.launcher3.util.LauncherModelHelper;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.PendingAddWidgetInfo;
+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.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowAppWidgetManager;
-import org.robolectric.shadows.ShadowPackageManager;
-import org.robolectric.util.ReflectionHelpers;
+import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
-@RunWith(RobolectricTestRunner.class)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public final class WidgetsPredicationUpdateTaskTest {
- private AppWidgetProviderInfo mApp1Provider1 = new AppWidgetProviderInfo();
- private AppWidgetProviderInfo mApp1Provider2 = new AppWidgetProviderInfo();
- private AppWidgetProviderInfo mApp2Provider1 = new AppWidgetProviderInfo();
- private AppWidgetProviderInfo mApp4Provider1 = new AppWidgetProviderInfo();
- private AppWidgetProviderInfo mApp4Provider2 = new AppWidgetProviderInfo();
- private AppWidgetProviderInfo mApp5Provider1 = new AppWidgetProviderInfo();
+ private AppWidgetProviderInfo mApp1Provider1;
+ private AppWidgetProviderInfo mApp1Provider2;
+ private AppWidgetProviderInfo mApp2Provider1;
+ private AppWidgetProviderInfo mApp4Provider1;
+ private AppWidgetProviderInfo mApp4Provider2;
+ private AppWidgetProviderInfo mApp5Provider1;
+ private List<AppWidgetProviderInfo> allWidgets;
private FakeBgDataModelCallback mCallback = new FakeBgDataModelCallback();
- private Context mContext;
private LauncherModelHelper mModelHelper;
private UserHandle mUserHandle;
@@ -80,54 +83,56 @@
@Before
public void setup() throws Exception {
+ mModelHelper = new LauncherModelHelper();
MockitoAnnotations.initMocks(this);
doAnswer(invocation -> {
ComponentWithLabel componentWithLabel = invocation.getArgument(0);
return componentWithLabel.getComponent().getShortClassName();
}).when(mIconCache).getTitleNoCache(any());
- mContext = RuntimeEnvironment.application;
- mModelHelper = new LauncherModelHelper();
- mUserHandle = Process.myUserHandle();
+ mUserHandle = myUserHandle();
+ mApp1Provider1 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app1", "provider1"));
+ mApp1Provider2 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app1", "provider2"));
+ mApp2Provider1 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app2", "provider1"));
+ mApp4Provider1 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app4", "provider1"));
+ mApp4Provider2 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app4", ".provider2"));
+ mApp5Provider1 = createAppWidgetProviderInfo(
+ ComponentName.createRelative("app5", "provider1"));
+ allWidgets = Arrays.asList(mApp1Provider1, mApp1Provider2, mApp2Provider1,
+ mApp4Provider1, mApp4Provider2, mApp5Provider1);
+
+ AppWidgetManager manager = mModelHelper.sandboxContext.spyService(AppWidgetManager.class);
+ doReturn(allWidgets).when(manager).getInstalledProviders();
+ doReturn(allWidgets).when(manager).getInstalledProvidersForProfile(eq(myUserHandle()));
+ doAnswer(i -> {
+ String pkg = i.getArgument(0);
+ Log.e("Hello", "Getting v " + pkg);
+ return TextUtils.isEmpty(pkg) ? allWidgets : allWidgets.stream()
+ .filter(a -> pkg.equals(a.provider.getPackageName()))
+ .collect(Collectors.toList());
+ }).when(manager).getInstalledProvidersForPackage(any(), eq(myUserHandle()));
+
// 2 widgets, app4/provider1 & app5/provider1, have already been added to the workspace.
- mModelHelper.initializeData("/widgets_predication_update_task_data.txt");
+ mModelHelper.initializeData("widgets_predication_update_task_data");
- ShadowPackageManager packageManager = shadowOf(mContext.getPackageManager());
- mApp1Provider1.provider = ComponentName.createRelative("app1", "provider1");
- ReflectionHelpers.setField(mApp1Provider1, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp1Provider1.provider));
- mApp1Provider2.provider = ComponentName.createRelative("app1", "provider2");
- ReflectionHelpers.setField(mApp1Provider2, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp1Provider2.provider));
- mApp2Provider1.provider = ComponentName.createRelative("app2", "provider1");
- ReflectionHelpers.setField(mApp2Provider1, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp2Provider1.provider));
- mApp4Provider1.provider = ComponentName.createRelative("app4", "provider1");
- ReflectionHelpers.setField(mApp4Provider1, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp4Provider1.provider));
- mApp4Provider2.provider = ComponentName.createRelative("app4", ".provider2");
- ReflectionHelpers.setField(mApp4Provider2, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp4Provider2.provider));
- mApp5Provider1.provider = ComponentName.createRelative("app5", "provider1");
- ReflectionHelpers.setField(mApp5Provider1, "providerInfo",
- packageManager.addReceiverIfNotPresent(mApp5Provider1.provider));
-
- ShadowAppWidgetManager shadowAppWidgetManager =
- shadowOf(mContext.getSystemService(AppWidgetManager.class));
- shadowAppWidgetManager.addInstalledProvider(mApp1Provider1);
- shadowAppWidgetManager.addInstalledProvider(mApp1Provider2);
- shadowAppWidgetManager.addInstalledProvider(mApp2Provider1);
- shadowAppWidgetManager.addInstalledProvider(mApp4Provider1);
- shadowAppWidgetManager.addInstalledProvider(mApp4Provider2);
- shadowAppWidgetManager.addInstalledProvider(mApp5Provider1);
-
- mModelHelper.getModel().addCallbacks(mCallback);
-
+ MAIN_EXECUTOR.submit(() -> mModelHelper.getModel().addCallbacks(mCallback)).get();
MODEL_EXECUTOR.post(() -> mModelHelper.getBgDataModel().widgetsModel.update(
- LauncherAppState.getInstance(mContext), /* packageUser= */ null));
- waitUntilIdle();
+ LauncherAppState.getInstance(mModelHelper.sandboxContext),
+ /* packageUser= */ null));
+
+ MODEL_EXECUTOR.submit(() -> { }).get();
+ MAIN_EXECUTOR.submit(() -> { }).get();
}
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
+ }
@Test
public void widgetsRecommendationRan_shouldOnlyReturnNotAddedWidgetsInAppPredictionOrder()
@@ -165,9 +170,9 @@
@Test
public void widgetsRecommendationRan_localFilterDisabled_shouldReturnWidgetsInPredicationOrder()
throws Exception {
- ShadowDeviceFlag shadowDeviceFlag = Shadow.extract(
- FeatureFlags.ENABLE_LOCAL_RECOMMENDED_WIDGETS_FILTER);
- shadowDeviceFlag.setValue(false);
+ if (FeatureFlags.ENABLE_LOCAL_RECOMMENDED_WIDGETS_FILTER.get()) {
+ return;
+ }
// WHEN newPredicationTask is executed with 5 predicated widgets.
AppTarget widget1 = new AppTarget(new AppTargetId("app1"), "app1", "provider1",
@@ -203,13 +208,8 @@
assertThat(actual.getUser()).isEqualTo(expected.getProfile());
}
- private void waitUntilIdle() {
- shadowOf(MODEL_EXECUTOR.getLooper()).idle();
- shadowOf(MAIN_EXECUTOR.getLooper()).idle();
- }
-
private WidgetsPredictionUpdateTask newWidgetsPredicationTask(List<AppTarget> appTargets) {
- return new WidgetsPredictionUpdateTask(
+ return new WidgetsPredictionUpdateTask(
new PredictorState(CONTAINER_WIDGETS_PREDICTION, "test_widgets_prediction"),
appTargets);
}
diff --git a/quickstep/robolectric_tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java b/quickstep/tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
similarity index 89%
rename from quickstep/robolectric_tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
rename to quickstep/tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
index 656379f..47ef13b 100644
--- a/quickstep/robolectric_tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
+++ b/quickstep/tests/src/com/android/quickstep/util/RecentsOrientedStateTest.java
@@ -19,33 +19,34 @@
import static android.view.Surface.ROTATION_180;
import static android.view.Surface.ROTATION_90;
+import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import android.content.Context;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.quickstep.FallbackActivityInterface;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
/**
* Tests for {@link RecentsOrientedState}
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class RecentsOrientedStateTest {
private RecentsOrientedState mR1, mR2;
@Before
public void setup() {
- Context context = RuntimeEnvironment.application;
+ Context context = getApplicationContext();
mR1 = new RecentsOrientedState(context, FallbackActivityInterface.INSTANCE, i -> { });
mR2 = new RecentsOrientedState(context, FallbackActivityInterface.INSTANCE, i -> { });
assertEquals(mR1.getStateId(), mR2.getStateId());
diff --git a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
new file mode 100644
index 0000000..9c5cfcd
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 android.view.Display.DEFAULT_DISPLAY;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+import android.graphics.Point;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.view.Display;
+import android.view.Surface;
+import android.view.SurfaceControl;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.InvariantDeviceProfile;
+import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.util.DisplayController.Info;
+import com.android.launcher3.util.LauncherModelHelper;
+import com.android.launcher3.util.ReflectionHelpers;
+import com.android.quickstep.FallbackActivityInterface;
+import com.android.quickstep.SysUINavigationMode;
+import com.android.quickstep.SystemUiProxy;
+import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
+import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;
+
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class TaskViewSimulatorTest {
+
+ @Test
+ public void taskProperlyScaled_portrait_noRotation_sameInsets1() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(1200, 2450)
+ .withInsets(new Rect(0, 80, 0, 120))
+ .verifyNoTransforms();
+ }
+
+ @Test
+ public void taskProperlyScaled_portrait_noRotation_sameInsets2() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(1200, 2450)
+ .withInsets(new Rect(55, 80, 55, 120))
+ .verifyNoTransforms();
+ }
+
+ @Test
+ public void taskProperlyScaled_landscape_noRotation_sameInsets1() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(2450, 1250)
+ .withInsets(new Rect(0, 80, 0, 40))
+ .verifyNoTransforms();
+ }
+
+ @Test
+ public void taskProperlyScaled_landscape_noRotation_sameInsets2() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(2450, 1250)
+ .withInsets(new Rect(0, 80, 120, 0))
+ .verifyNoTransforms();
+ }
+
+ @Test
+ public void taskProperlyScaled_landscape_noRotation_sameInsets3() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(2450, 1250)
+ .withInsets(new Rect(55, 80, 55, 120))
+ .verifyNoTransforms();
+ }
+
+ @Test
+ public void taskProperlyScaled_landscape_rotated() {
+ new TaskMatrixVerifier()
+ .withLauncherSize(1200, 2450)
+ .withInsets(new Rect(0, 80, 0, 120))
+ .withAppBounds(
+ new Rect(0, 0, 2450, 1200),
+ new Rect(0, 80, 0, 120),
+ Surface.ROTATION_90)
+ .verifyNoTransforms();
+ }
+
+ private static class TaskMatrixVerifier extends TransformParams {
+
+ private Point mDisplaySize = new Point();
+ private Rect mDisplayInsets = new Rect();
+ private Rect mAppBounds = new Rect();
+ private Rect mLauncherInsets = new Rect();
+
+ private Rect mAppInsets;
+
+ private int mAppRotation = -1;
+ private DeviceProfile mDeviceProfile;
+
+ TaskMatrixVerifier withLauncherSize(int width, int height) {
+ mDisplaySize.set(width, height);
+ if (mAppBounds.isEmpty()) {
+ mAppBounds.set(0, 0, width, height);
+ }
+ return this;
+ }
+
+ TaskMatrixVerifier withInsets(Rect insets) {
+ mDisplayInsets.set(insets);
+ mLauncherInsets.set(insets);
+ return this;
+ }
+
+ TaskMatrixVerifier withAppBounds(Rect bounds, Rect insets, int appRotation) {
+ mAppBounds.set(bounds);
+ mAppInsets = insets;
+ mAppRotation = appRotation;
+ return this;
+ }
+
+ void verifyNoTransforms() {
+ LauncherModelHelper helper = new LauncherModelHelper();
+ try {
+ helper.sandboxContext.allow(SystemUiProxy.INSTANCE);
+ helper.sandboxContext.allow(SysUINavigationMode.INSTANCE);
+
+ Display display = mock(Display.class);
+ doReturn(DEFAULT_DISPLAY).when(display).getDisplayId();
+ doReturn(mDisplaySize.x > mDisplaySize.y ? Surface.ROTATION_90 : Surface.ROTATION_0)
+ .when(display).getRotation();
+ doAnswer(i -> {
+ ((Point) i.getArgument(0)).set(mDisplaySize.x, mDisplaySize.y);
+ return null;
+ }).when(display).getRealSize(any());
+ doAnswer(i -> {
+ Point smallestSize = i.getArgument(0);
+ Point largestSize = i.getArgument(1);
+ smallestSize.x = smallestSize.y = Math.min(mDisplaySize.x, mDisplaySize.y);
+ largestSize.x = largestSize.y = Math.max(mDisplaySize.x, mDisplaySize.y);
+
+ smallestSize.x -= mDisplayInsets.left + mDisplayInsets.right;
+ largestSize.x -= mDisplayInsets.left + mDisplayInsets.right;
+
+ smallestSize.y -= mDisplayInsets.top + mDisplayInsets.bottom;
+ largestSize.y -= mDisplayInsets.top + mDisplayInsets.bottom;
+ return null;
+ }).when(display).getCurrentSizeRange(any(), any());
+ DisplayController.Info mockInfo = new Info(helper.sandboxContext, display);
+
+ DisplayController controller =
+ DisplayController.INSTANCE.get(helper.sandboxContext);
+ controller.close();
+ ReflectionHelpers.setField(controller, "mInfo", mockInfo);
+
+ mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(helper.sandboxContext)
+ .getBestMatch(mAppBounds.width(), mAppBounds.height());
+ mDeviceProfile.updateInsets(mLauncherInsets);
+
+ TaskViewSimulator tvs = new TaskViewSimulator(helper.sandboxContext,
+ FallbackActivityInterface.INSTANCE);
+ tvs.setDp(mDeviceProfile);
+
+ int launcherRotation = mockInfo.rotation;
+ if (mAppRotation < 0) {
+ mAppRotation = launcherRotation;
+ }
+
+ tvs.getOrientationState().update(launcherRotation, mAppRotation);
+ if (mAppInsets == null) {
+ mAppInsets = new Rect(mLauncherInsets);
+ }
+ tvs.setPreviewBounds(mAppBounds, mAppInsets);
+
+ tvs.fullScreenProgress.value = 1;
+ tvs.recentsViewScale.value = tvs.getFullScreenScale();
+ tvs.apply(this);
+ } finally {
+ helper.destroy();
+ }
+ }
+
+ @Override
+ public SurfaceParams[] createSurfaceParams(BuilderProxy proxy) {
+ SurfaceParams.Builder builder = new SurfaceParams.Builder((SurfaceControl) null);
+ proxy.onBuildTargetParams(builder, mock(RemoteAnimationTargetCompat.class), this);
+ return new SurfaceParams[] {builder.build()};
+ }
+
+ @Override
+ public void applySurfaceParams(SurfaceParams[] params) {
+ // Verify that the task position remains the same
+ RectF newAppBounds = new RectF(mAppBounds);
+ params[0].matrix.mapRect(newAppBounds);
+ Assert.assertThat(newAppBounds, new AlmostSame(mAppBounds));
+
+ System.err.println("Bounds mapped: " + mAppBounds + " => " + newAppBounds);
+ }
+ }
+
+ private static class AlmostSame extends TypeSafeMatcher<RectF> {
+
+ // Allow .1% error margin to account for float to int conversions
+ private final float mErrorFactor = .001f;
+ private final Rect mExpected;
+
+ AlmostSame(Rect expected) {
+ mExpected = expected;
+ }
+
+ @Override
+ protected boolean matchesSafely(RectF item) {
+ float errorWidth = mErrorFactor * mExpected.width();
+ float errorHeight = mErrorFactor * mExpected.height();
+ return Math.abs(item.left - mExpected.left) < errorWidth
+ && Math.abs(item.top - mExpected.top) < errorHeight
+ && Math.abs(item.right - mExpected.right) < errorWidth
+ && Math.abs(item.bottom - mExpected.bottom) < errorHeight;
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendValue(mExpected);
+ }
+ }
+}
diff --git a/res/drawable/padded_rounded_action_button.xml b/res/drawable/padded_rounded_action_button.xml
index 6432efd..6863f92 100644
--- a/res/drawable/padded_rounded_action_button.xml
+++ b/res/drawable/padded_rounded_action_button.xml
@@ -14,18 +14,11 @@
~ limitations under the License.
-->
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:drawable="@drawable/rounded_action_button"
android:left="@dimen/padded_rounded_button_padding"
android:top="@dimen/padded_rounded_button_padding"
android:right="@dimen/padded_rounded_button_padding"
- android:bottom="@dimen/padded_rounded_button_padding">
- <shape android:shape="rectangle">
- <corners android:radius="@dimen/rounded_button_radius" />
- <stroke android:width="1dp"
- android:color="?androidprv:attr/colorAccentPrimaryVariant" />
- </shape>
- </item>
+ android:bottom="@dimen/padded_rounded_button_padding" />
</layer-list>
-
diff --git a/res/drawable/rounded_action_button.xml b/res/drawable/rounded_action_button.xml
index f043893..b9942c0 100644
--- a/res/drawable/rounded_action_button.xml
+++ b/res/drawable/rounded_action_button.xml
@@ -19,7 +19,9 @@
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/rounded_button_radius" />
- <stroke android:width="1dp" android:color="@color/all_apps_tab_background_selected" />
+ <stroke
+ android:width="1dp"
+ android:color="?androidprv:attr/colorAccentPrimaryVariant" />
<padding
android:left="@dimen/rounded_button_padding"
android:right="@dimen/rounded_button_padding" />
diff --git a/res/layout/arrow_toast.xml b/res/layout/arrow_toast.xml
index 9a6f8c3..88a92eb 100644
--- a/res/layout/arrow_toast.xml
+++ b/res/layout/arrow_toast.xml
@@ -27,15 +27,13 @@
android:gravity="center"
android:padding="16dp"
android:background="@drawable/arrow_toast_rounded_background"
- android:elevation="2dp"
- android:outlineProvider="none"
+ android:elevation="@dimen/arrow_toast_elevation"
android:textColor="@color/arrow_tip_view_content"
android:textSize="14sp"/>
<View
android:id="@+id/arrow"
- android:elevation="2dp"
- android:outlineProvider="none"
+ android:elevation="@dimen/arrow_toast_elevation"
android:layout_width="@dimen/arrow_toast_arrow_width"
android:layout_height="10dp"/>
</merge>
diff --git a/res/layout/notification_content.xml b/res/layout/notification_content.xml
index 84822a6..91897e9 100644
--- a/res/layout/notification_content.xml
+++ b/res/layout/notification_content.xml
@@ -14,10 +14,11 @@
limitations under the License.
-->
-<merge
+<com.android.launcher3.notification.NotificationMainView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
<!-- header -->
<FrameLayout
@@ -49,7 +50,7 @@
</FrameLayout>
<!-- Main view -->
- <com.android.launcher3.notification.NotificationMainView
+ <FrameLayout
android:id="@+id/main_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -59,7 +60,6 @@
android:id="@+id/text_and_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?attr/popupColorPrimary"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingTop="@dimen/notification_padding"
@@ -95,5 +95,5 @@
android:layout_marginTop="@dimen/notification_padding"
android:layout_marginStart="@dimen/notification_icon_padding" />
- </com.android.launcher3.notification.NotificationMainView>
-</merge>
\ No newline at end of file
+ </FrameLayout>
+</com.android.launcher3.notification.NotificationMainView>
\ No newline at end of file
diff --git a/res/layout/popup_container.xml b/res/layout/popup_container.xml
index 18014bb..9327287 100644
--- a/res/layout/popup_container.xml
+++ b/res/layout/popup_container.xml
@@ -31,12 +31,9 @@
android:elevation="@dimen/deep_shortcuts_elevation"
android:orientation="vertical"/>
- <LinearLayout
+ <com.android.launcher3.notification.NotificationContainer
android:id="@+id/notification_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:visibility="gone"
- android:background="?attr/popupColorPrimary"
- android:elevation="@dimen/deep_shortcuts_elevation"
- android:orientation="vertical"/>
+ android:visibility="gone"/>
</com.android.launcher3.popup.PopupContainerWithArrow>
\ No newline at end of file
diff --git a/res/layout/qsb_preview.xml b/res/layout/qsb_preview.xml
new file mode 100644
index 0000000..801fb04
--- /dev/null
+++ b/res/layout/qsb_preview.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<com.android.launcher3.qsb.QsbContainerView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:id="@id/search_container_workspace"
+ android:padding="0dp" >
+
+ <fragment
+ android:name="com.android.launcher3.qsb.QsbContainerView$QsbFragment"
+ android:layout_width="match_parent"
+ android:tag="qsb_view"
+ android:layout_height="match_parent"/>
+</com.android.launcher3.qsb.QsbContainerView>
\ No newline at end of file
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index 89895e5..21d532e 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -17,7 +17,8 @@
<com.android.launcher3.shortcuts.DeepShortcutView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/bg_popup_item_width"
- android:layout_height="@dimen/bg_popup_item_height"
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/bg_popup_item_height"
android:elevation="@dimen/deep_shortcuts_elevation"
android:background="@drawable/middle_item_primary"
android:theme="@style/PopupItem" >
diff --git a/res/layout/system_shortcut_content.xml b/res/layout/system_shortcut_content.xml
index 8b39202..3ef0b94 100644
--- a/res/layout/system_shortcut_content.xml
+++ b/res/layout/system_shortcut_content.xml
@@ -22,6 +22,9 @@
android:id="@+id/bubble_text"
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
+ android:paddingTop="@dimen/bg_popup_item_vertical_padding"
+ android:paddingBottom="@dimen/bg_popup_item_vertical_padding"
+ android:minHeight="@dimen/bg_popup_item_height"
android:textAlignment="viewStart"
android:paddingStart="@dimen/deep_shortcuts_text_padding_start"
android:paddingEnd="@dimen/popup_padding_end"
diff --git a/res/layout/work_apps_paused.xml b/res/layout/work_apps_paused.xml
index ec34b47..79bce70 100644
--- a/res/layout/work_apps_paused.xml
+++ b/res/layout/work_apps_paused.xml
@@ -28,7 +28,7 @@
android:layout_marginTop="40dp"
android:text="@string/work_apps_paused_title"
android:textAlignment="center"
- android:textSize="22sp" />
+ android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
diff --git a/res/raw/downgrade_schema.json b/res/raw/downgrade_schema.json
index bc25cec..14eac9f 100644
--- a/res/raw/downgrade_schema.json
+++ b/res/raw/downgrade_schema.json
@@ -2,8 +2,9 @@
// Note: Comments are not supported in JSON schema, but android parser is lenient.
// Maximum DB version supported by this schema
- "version" : 29,
+ "version" : 30,
+ "downgrade_to_29" : [],
"downgrade_to_28" : [
"ALTER TABLE favorites RENAME TO temp_favorites;",
"CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0, options INTEGER NOT NULL DEFAULT 0);",
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
index 9bc08e3..a66b9b6 100644
--- a/res/values-as/strings.xml
+++ b/res/values-as/strings.xml
@@ -120,7 +120,7 @@
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"নতুন এপসমূহৰ বাবে"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"অজ্ঞাত"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"আঁতৰাওক"</string>
- <string name="abandoned_search" msgid="891119232568284442">"Search"</string>
+ <string name="abandoned_search" msgid="891119232568284442">"সন্ধান কৰক"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"এই এপটো ইনষ্টল কৰা হোৱা নাই"</string>
<string name="abandoned_promise_explanation" msgid="3990027586878167529">"এই আইকনৰ এপটো ইনষ্টল কৰা হোৱা নাই। আপুনি এইটো আঁতৰাব পাৰে অথবা এপটো বিচাৰি মেনুৱেলভাৱে ইনষ্টল কৰিব পাৰে।"</string>
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ইনষ্টল কৰি থকা হৈছে, <xliff:g id="PROGRESS">%2$s</xliff:g> সম্পূৰ্ণ হৈছে"</string>
diff --git a/res/values-kn/strings.xml b/res/values-kn/strings.xml
index 3fa8ac7..26d1c8c 100644
--- a/res/values-kn/strings.xml
+++ b/res/values-kn/strings.xml
@@ -120,7 +120,7 @@
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"ಹೊಸ ಅಪ್ಲಿಕೇಶನ್ಗಳಿಗೆ"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"ಅಪರಿಚಿತ"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"ತೆಗೆದುಹಾಕಿ"</string>
- <string name="abandoned_search" msgid="891119232568284442">"Search"</string>
+ <string name="abandoned_search" msgid="891119232568284442">"ಹುಡುಕಿ"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"ಈ ಅಪ್ಲಿಕೇಶನ್ ಸ್ಥಾಪನೆಗೊಂಡಿಲ್ಲ"</string>
<string name="abandoned_promise_explanation" msgid="3990027586878167529">"ಈ ಐಕಾನ್ ಅಪ್ಲಿಕೇಶನ್ ಸ್ಥಾಪನೆಗೊಂಡಿಲ್ಲ. ನೀವು ಅದನ್ನು ತೆಗೆದುಹಾಕಬಹುದು ಅಥವಾ ಅಪ್ಲಿಕೇಶನ್ ಹುಡುಕಬಹುದು ಮತ್ತು ಹಸ್ತಚಾಲಿತವಾಗಿ ಅದನ್ನು ಸ್ಥಾಪಿಸಬಹುದು."</string>
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ಇನ್ಸ್ಟಾಲ್ ಮಾಡಲಾಗುತ್ತಿದೆ, <xliff:g id="PROGRESS">%2$s</xliff:g> ಪೂರ್ಣಗೊಂಡಿದೆ"</string>
diff --git a/res/values-ml/strings.xml b/res/values-ml/strings.xml
index f282bd1..67b999d 100644
--- a/res/values-ml/strings.xml
+++ b/res/values-ml/strings.xml
@@ -120,7 +120,7 @@
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"പുതിയ ആപ്പുകൾക്ക്"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"അജ്ഞാതം"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"നീക്കംചെയ്യുക"</string>
- <string name="abandoned_search" msgid="891119232568284442">"Search"</string>
+ <string name="abandoned_search" msgid="891119232568284442">"തിരയുക"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"ഈ അപ്ലിക്കേഷൻ ഇൻസ്റ്റാളുചെയ്തിട്ടില്ല"</string>
<string name="abandoned_promise_explanation" msgid="3990027586878167529">"ഈ ഐക്കണുവേണ്ടി അപ്ലിക്കേഷൻ ഇൻസ്റ്റാളുചെയ്തിട്ടില്ല. നിങ്ങൾക്കത് നീക്കംചെയ്യാനാകും അല്ലെങ്കിൽ അപ്ലിക്കേഷനുവേണ്ടി തിരഞ്ഞുകൊണ്ട് അത് സ്വമേധയാ ഇൻസ്റ്റാളുചെയ്യുക."</string>
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ഇൻസ്റ്റാൾ ചെയ്യുന്നു, <xliff:g id="PROGRESS">%2$s</xliff:g> പൂർത്തിയായി"</string>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index b1d6445..e0f1865 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -120,7 +120,7 @@
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"ନୂଆ ଆପ୍ ପାଇଁ"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"ଅଜଣା"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"କାଢ଼ି ଦିଅନ୍ତୁ"</string>
- <string name="abandoned_search" msgid="891119232568284442">"Search"</string>
+ <string name="abandoned_search" msgid="891119232568284442">"ସନ୍ଧାନ କରନ୍ତୁ"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"ଏହି ଆପ୍ ଇନଷ୍ଟଲ୍ ହୋଇନାହିଁ"</string>
<string name="abandoned_promise_explanation" msgid="3990027586878167529">"ଏହି ଆଇକନ୍ ପାଇଁ ଆପ୍ ଇନଷ୍ଟଲ୍ ହୋଇନାହିଁ। ଏହାକୁ ଆପଣ ଆପ୍ ପାଇଁ ବାହାର କରିପାରିବେ କିମ୍ୱା ସର୍ଚ୍ଚ କରି ପାରିବେ ଏବଂ ଏହାକୁ ମାନୁଆଲ୍ ଭାବରେ ଇନଷ୍ଟଲ୍ କରିପାରିବେ।"</string>
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> ଇନଷ୍ଟଲ୍ କରାଯାଉଛି, <xliff:g id="PROGRESS">%2$s</xliff:g> ସମ୍ପୂର୍ଣ୍ଣ ହୋଇଛି"</string>
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index 25a1739..94f5343 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -138,7 +138,7 @@
<string name="move_to_position" msgid="6750008980455459790">"நிலை <xliff:g id="NUMBER">%1$s</xliff:g>க்கு நகர்த்து"</string>
<string name="move_to_hotseat_position" msgid="6295412897075147808">"விரும்பும் நிலை <xliff:g id="NUMBER">%1$s</xliff:g>க்கு நகர்த்து"</string>
<string name="item_moved" msgid="4606538322571412879">"உருப்படி நகர்த்தப்பட்டது"</string>
- <string name="add_to_folder" msgid="9040534766770853243">"இந்தக் கோப்புறையில் சேர்க்கும்: <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="add_to_folder" msgid="9040534766770853243">"இந்த ஃபோல்டரில் சேர்க்கும்: <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="add_to_folder_with_app" msgid="4534929978967147231">"<xliff:g id="NAME">%1$s</xliff:g> உள்ள கோப்புறையில் சேர்க்கும்"</string>
<string name="added_to_folder" msgid="4793259502305558003">"கோப்புறையில் உருப்படி சேர்க்கப்பட்டது"</string>
<string name="create_folder_with" msgid="4050141361160214248">"இதனுடன் கோப்புறையை உருவாக்கும்: <xliff:g id="NAME">%1$s</xliff:g>"</string>
diff --git a/res/values/config.xml b/res/values/config.xml
index 04c359e..72959b2 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -34,6 +34,9 @@
<!-- View tag key used to determine if we should fade in the child views.. -->
<string name="popup_container_iterate_children" translatable="false">popup_container_iterate_children</string>
+ <!-- config used to determine if header protection is supported in AllApps -->
+ <bool name="config_header_protection_supported">false</bool>
+
<!-- Workspace -->
<!-- The duration (in ms) of the fade animation on the object outlines, used when
we are dragging objects around on the home screen. -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 86b4e71..5fc0480 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -110,6 +110,7 @@
<dimen name="all_apps_tip_bottom_margin">8dp</dimen>
<!-- The size of corner radius of the arrow in the arrow toast. -->
<dimen name="arrow_toast_corner_radius">2dp</dimen>
+ <dimen name="arrow_toast_elevation">2dp</dimen>
<dimen name="arrow_toast_arrow_width">10dp</dimen>
<!-- Search bar in All Apps -->
@@ -240,6 +241,7 @@
<dimen name="bg_popup_padding">2dp</dimen>
<dimen name="bg_popup_item_width">216dp</dimen>
<dimen name="bg_popup_item_height">56dp</dimen>
+ <dimen name="bg_popup_item_vertical_padding">12dp</dimen>
<dimen name="pre_drag_view_scale">6dp</dimen>
<!-- an icon with shortcuts must be dragged this far before the container is removed. -->
<dimen name="deep_shortcuts_start_drag_threshold">16dp</dimen>
@@ -270,6 +272,8 @@
<!-- Notifications -->
<dimen name="bg_round_rect_radius">8dp</dimen>
+ <dimen name="notification_max_trans">8dp</dimen>
+ <dimen name="notification_space">8dp</dimen>
<dimen name="notification_padding">16dp</dimen>
<dimen name="notification_padding_top">18dp</dimen>
<dimen name="notification_header_text_size">14sp</dimen>
@@ -346,4 +350,5 @@
<dimen name="search_row_icon_size">48dp</dimen>
<dimen name="search_row_small_icon_size">32dp</dimen>
<dimen name="padded_rounded_button_padding">8dp</dimen>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d1774e5..a6105eb 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -153,6 +153,7 @@
<!-- All applications label -->
<string name="all_apps_button_label">Apps list</string>
+ <string name="all_apps_search_results">Search results</string>
<string name="all_apps_button_personal_label">Personal apps list</string>
<string name="all_apps_button_work_label">Work apps list</string>
diff --git a/res/xml/default_workspace_splitdisplay_5x5.xml b/res/xml/default_workspace_splitdisplay_5x5.xml
deleted file mode 100644
index 162367b..0000000
--- a/res/xml/default_workspace_splitdisplay_5x5.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
-
- <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
- <!-- Dialer, Messaging, [Maps/Music], Browser, Camera -->
- <resolve
- launcher:container="-101"
- launcher:screen="0"
- launcher:x="0"
- launcher:y="0" >
- <favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
- <favorite launcher:uri="tel:123" />
- <favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
- </resolve>
-
- <resolve
- launcher:container="-101"
- launcher:screen="1"
- launcher:x="1"
- launcher:y="0" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
- <favorite launcher:uri="sms:" />
- <favorite launcher:uri="smsto:" />
- <favorite launcher:uri="mms:" />
- <favorite launcher:uri="mmsto:" />
- </resolve>
-
- <resolve
- launcher:container="-101"
- launcher:screen="2"
- launcher:x="2"
- launcher:y="0" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MAPS;end" />
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MUSIC;end" />
- </resolve>
-
- <resolve
- launcher:container="-101"
- launcher:screen="3"
- launcher:x="3"
- launcher:y="0" >
- <favorite
- launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
- <favorite launcher:uri="http://www.example.com/" />
- </resolve>
-
- <resolve
- launcher:container="-101"
- launcher:screen="4"
- launcher:x="4"
- launcher:y="0" >
- <favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
- <favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
- </resolve>
-
- <!-- Bottom row -->
- <resolve
- launcher:screen="0"
- launcher:x="0"
- launcher:y="-1" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_EMAIL;end" />
- <favorite launcher:uri="mailto:" />
-
- </resolve>
-
- <resolve
- launcher:screen="0"
- launcher:x="1"
- launcher:y="-1" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
- <favorite launcher:uri="#Intent;type=images/*;end" />
-
- </resolve>
-
- <resolve
- launcher:screen="0"
- launcher:x="4"
- launcher:y="-1" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MARKET;end" />
- <favorite launcher:uri="market://details?id=com.android.launcher" />
- </resolve>
-
- <!-- Placeholder before we add page pairing in b/196376162 -->
- <resolve
- launcher:screen="1"
- launcher:x="0"
- launcher:y="-4" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
- <favorite launcher:uri="#Intent;type=images/*;end" />
- </resolve>
-
-</favorites>
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index d8ee6f2..256999c 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -105,8 +105,7 @@
launcher:numFolderColumns="4"
launcher:numHotseatIcons="5"
launcher:dbFile="launcher.db"
- launcher:defaultLayoutId="@xml/default_workspace_5x5"
- launcher:defaultSplitDisplayLayoutId="@xml/default_workspace_splitdisplay_5x5" >
+ launcher:defaultLayoutId="@xml/default_workspace_5x5" >
<display-option
launcher:name="Large Phone"
diff --git a/robolectric_tests/Android.bp b/robolectric_tests/Android.bp
deleted file mode 100644
index 6473d00..0000000
--- a/robolectric_tests/Android.bp
+++ /dev/null
@@ -1,62 +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.
-
-//
-// Launcher Robolectric test target.
-//
-// "robolectric_android-all-stub", not needed, we write our own stubs
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "packages_apps_Launcher3_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["packages_apps_Launcher3_license"],
-}
-
-filegroup {
- name: "launcher3-robolectric-resources",
- path: "resources",
- srcs: ["resources/*"],
-}
-
-filegroup {
- name: "launcher3-robolectric-src",
- srcs: ["src/**/*.java"],
-}
-
-android_robolectric_test {
- name: "LauncherRoboTests",
- srcs: [
- ":launcher3-robolectric-src",
- ],
- java_resources: [":launcher3-robolectric-resources"],
- static_libs: [
- "truth-prebuilt",
- "androidx.test.espresso.contrib",
- "androidx.test.espresso.core",
- "androidx.test.espresso.intents",
- "androidx.test.ext.junit",
- "androidx.test.runner",
- "androidx.test.rules",
- "mockito-robolectric-prebuilt",
- "SystemUISharedLib",
- ],
- robolectric_prebuilt_version: "4.5.1",
- instrumentation_for: "Launcher3",
-
- test_options: {
- timeout: 36000,
- },
-}
diff --git a/robolectric_tests/res/values/overlayable_icons_test.xml b/robolectric_tests/res/values/overlayable_icons_test.xml
deleted file mode 100644
index 5144e52..0000000
--- a/robolectric_tests/res/values/overlayable_icons_test.xml
+++ /dev/null
@@ -1,36 +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.
--->
-<resources>
- <!-- overlayable_icons references all of the drawables in this package
- that are being overlayed by resource overlays. If you remove/rename
- any of these resources, you must also change the resource overlay icons.-->
- <array name="overlayable_icons">
- <item>@drawable/ic_corp</item>
- <item>@drawable/ic_drag_handle</item>
- <item>@drawable/ic_hourglass_top</item>
- <item>@drawable/ic_info_no_shadow</item>
- <item>@drawable/ic_install_no_shadow</item>
- <item>@drawable/ic_palette</item>
- <item>@drawable/ic_pin</item>
- <item>@drawable/ic_remove_no_shadow</item>
- <item>@drawable/ic_setting</item>
- <item>@drawable/ic_smartspace_preferences</item>
- <item>@drawable/ic_split_screen</item>
- <item>@drawable/ic_uninstall_no_shadow</item>
- <item>@drawable/ic_warning</item>
- <item>@drawable/ic_widget</item>
- </array>
-</resources>
diff --git a/robolectric_tests/resources/robolectric.properties b/robolectric_tests/resources/robolectric.properties
deleted file mode 100644
index abb6968..0000000
--- a/robolectric_tests/resources/robolectric.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-sdk=30
-
-shadows= \
- com.android.launcher3.shadows.LShadowAppPredictionManager \
- com.android.launcher3.shadows.LShadowAppWidgetManager \
- com.android.launcher3.shadows.LShadowBackupManager \
- com.android.launcher3.shadows.LShadowDisplay \
- com.android.launcher3.shadows.LShadowLauncherApps \
- com.android.launcher3.shadows.ShadowDeviceFlag \
- com.android.launcher3.shadows.ShadowLooperExecutor \
- com.android.launcher3.shadows.ShadowMainThreadInitializedObject \
- com.android.launcher3.shadows.ShadowOverrides \
- com.android.launcher3.shadows.ShadowSurfaceTransactionApplier \
-
-application=com.android.launcher3.util.LauncherTestApplication
diff --git a/robolectric_tests/src/com/android/launcher3/secondarydisplay/SDWorkModeTest.java b/robolectric_tests/src/com/android/launcher3/secondarydisplay/SDWorkModeTest.java
deleted file mode 100644
index e3694ae..0000000
--- a/robolectric_tests/src/com/android/launcher3/secondarydisplay/SDWorkModeTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.secondarydisplay;
-
-import static com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE;
-import static com.android.launcher3.util.LauncherUIHelper.doLayout;
-import static com.android.launcher3.util.Preconditions.assertNotNull;
-
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-
-import android.content.Context;
-import android.os.UserManager;
-import android.provider.Settings;
-
-import com.android.launcher3.InvariantDeviceProfile;
-import com.android.launcher3.allapps.AllAppsPagedView;
-import com.android.launcher3.allapps.AllAppsRecyclerView;
-import com.android.launcher3.util.LauncherLayoutBuilder;
-import com.android.launcher3.util.LauncherModelHelper;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowUserManager;
-
-/**
- * Tests for {@link SecondaryDisplayLauncher} with work profile
- */
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
-public class SDWorkModeTest {
-
- private static final int SYSTEM_USER = 0;
- private static final int FLAG_SYSTEM = 0x00000800;
- private static final int WORK_PROFILE_ID = 10;
- private static final int FLAG_PROFILE = 0x00001000;
-
- private Context mTargetContext;
- private InvariantDeviceProfile mIdp;
- private LauncherModelHelper mModelHelper;
-
- @Before
- public void setup() throws Exception {
- mModelHelper = new LauncherModelHelper();
- mTargetContext = RuntimeEnvironment.application;
- mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
- Settings.Global.putFloat(mTargetContext.getContentResolver(),
- Settings.Global.WINDOW_ANIMATION_SCALE, 0);
-
- mModelHelper.installApp(TEST_PACKAGE);
- }
-
- @Test
- public void testAllAppsList_noWorkProfile() throws Exception {
- SecondaryDisplayLauncher launcher = loadLauncher();
- launcher.showAppDrawer(true);
- doLayout(launcher);
-
- verifyRecyclerViewCount(launcher.getAppsView().getActiveRecyclerView());
- }
-
- @Test
- public void testAllAppsList_workProfile() throws Exception {
- ShadowUserManager sum = Shadow.extract(mTargetContext.getSystemService(UserManager.class));
- sum.addUser(SYSTEM_USER, "me", FLAG_SYSTEM);
- sum.addProfile(SYSTEM_USER, WORK_PROFILE_ID, "work", FLAG_PROFILE);
-
- SecondaryDisplayLauncher launcher = loadLauncher();
- launcher.showAppDrawer(true);
- doLayout(launcher);
-
- AllAppsRecyclerView rv1 = launcher.getAppsView().getActiveRecyclerView();
- verifyRecyclerViewCount(rv1);
-
- assertNotNull(launcher.getAppsView().getWorkModeSwitch());
- assertTrue(launcher.getAppsView().getRecyclerViewContainer() instanceof AllAppsPagedView);
-
- AllAppsPagedView pagedView =
- (AllAppsPagedView) launcher.getAppsView().getRecyclerViewContainer();
- pagedView.snapToPageImmediately(1);
- doLayout(launcher);
-
- AllAppsRecyclerView rv2 = launcher.getAppsView().getActiveRecyclerView();
- verifyRecyclerViewCount(rv2);
- assertNotSame(rv1, rv2);
- }
-
- private SecondaryDisplayLauncher loadLauncher() throws Exception {
- // Install 100 apps
- for (int i = 0; i < 100; i++) {
- mModelHelper.installApp(TEST_PACKAGE + i);
- }
- mModelHelper.setupDefaultLayoutProvider(new LauncherLayoutBuilder()).loadModelSync();
- SecondaryDisplayLauncher launcher =
- Robolectric.buildActivity(SecondaryDisplayLauncher.class).setup().get();
- doLayout(launcher);
- return launcher;
- }
-
- private void verifyRecyclerViewCount(AllAppsRecyclerView rv) {
- int childCount = rv.getChildCount();
- assertTrue(childCount > 0);
- assertTrue(childCount < 100);
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppPredictionManager.java b/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppPredictionManager.java
deleted file mode 100644
index ae051f7..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppPredictionManager.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.shadows;
-
-import static org.mockito.Mockito.mock;
-
-import android.app.prediction.AppPredictionContext;
-import android.app.prediction.AppPredictionManager;
-import android.app.prediction.AppPredictor;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-
-/**
- * Shadow for {@link AppPredictionManager} which create mock predictors
- */
-@Implements(value = AppPredictionManager.class)
-public class LShadowAppPredictionManager {
-
- @Implementation
- public AppPredictor createAppPredictionSession(AppPredictionContext predictionContext) {
- return mock(AppPredictor.class);
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppWidgetManager.java b/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppWidgetManager.java
deleted file mode 100644
index 696ffd0..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/LShadowAppWidgetManager.java
+++ /dev/null
@@ -1,48 +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.shadows;
-
-import android.appwidget.AppWidgetManager;
-import android.appwidget.AppWidgetProviderInfo;
-import android.os.Process;
-import android.os.UserHandle;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.shadows.ShadowAppWidgetManager;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * Extension of {@link ShadowAppWidgetManager} with missing shadow methods
- */
-@Implements(value = AppWidgetManager.class)
-public class LShadowAppWidgetManager extends ShadowAppWidgetManager {
-
- @Override
- protected List<AppWidgetProviderInfo> getInstalledProviders() {
- return getInstalledProvidersForProfile(null);
- }
-
- @Implementation
- public List<AppWidgetProviderInfo> getInstalledProvidersForProfile(UserHandle profile) {
- UserHandle user = profile == null ? Process.myUserHandle() : profile;
- return super.getInstalledProviders().stream().filter(
- info -> user.equals(info.getProfile())).collect(Collectors.toList());
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/LShadowBackupManager.java b/robolectric_tests/src/com/android/launcher3/shadows/LShadowBackupManager.java
deleted file mode 100644
index eae0101..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/LShadowBackupManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.shadows;
-
-import android.app.backup.BackupManager;
-import android.os.UserHandle;
-import android.util.LongSparseArray;
-
-import androidx.annotation.Nullable;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.shadows.ShadowBackupManager;
-
-/**
- * Extension of {@link ShadowBackupManager} with missing shadow methods
- */
-@Implements(value = BackupManager.class)
-public class LShadowBackupManager extends ShadowBackupManager {
-
- private LongSparseArray<UserHandle> mProfileMapping = new LongSparseArray<>();
-
- public void addProfile(long userSerial, UserHandle userHandle) {
- mProfileMapping.put(userSerial, userHandle);
- }
-
- @Implementation
- @Nullable
- public UserHandle getUserForAncestralSerialNumber(long ancestralSerialNumber) {
- return mProfileMapping.get(ancestralSerialNumber);
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/LShadowDisplay.java b/robolectric_tests/src/com/android/launcher3/shadows/LShadowDisplay.java
deleted file mode 100644
index 3813fa1..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/LShadowDisplay.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.shadows;
-
-import static org.robolectric.shadow.api.Shadow.directlyOn;
-
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.view.Display;
-
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.RealObject;
-import org.robolectric.shadows.ShadowDisplay;
-
-/**
- * Extension of {@link ShadowDisplay} with missing shadow methods
- */
-@Implements(value = Display.class)
-public class LShadowDisplay extends ShadowDisplay {
-
- private final Rect mInsets = new Rect();
-
- @RealObject Display realObject;
-
- /**
- * Sets the insets for the display
- */
- public void setInsets(Rect insets) {
- mInsets.set(insets);
- }
-
- @Override
- protected void getCurrentSizeRange(Point outSmallestSize, Point outLargestSize) {
- directlyOn(realObject, Display.class).getCurrentSizeRange(outSmallestSize, outLargestSize);
- outSmallestSize.x -= mInsets.left + mInsets.right;
- outLargestSize.x -= mInsets.left + mInsets.right;
-
- outSmallestSize.y -= mInsets.top + mInsets.bottom;
- outLargestSize.y -= mInsets.top + mInsets.bottom;
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/LShadowLauncherApps.java b/robolectric_tests/src/com/android/launcher3/shadows/LShadowLauncherApps.java
deleted file mode 100644
index 6a6f0fb..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/LShadowLauncherApps.java
+++ /dev/null
@@ -1,136 +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.shadows;
-
-import static org.robolectric.util.ReflectionHelpers.ClassParameter;
-import static org.robolectric.util.ReflectionHelpers.callConstructor;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.LauncherActivityInfo;
-import android.content.pm.LauncherApps;
-import android.content.pm.PackageInstaller;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ShortcutInfo;
-import android.os.UserHandle;
-import android.util.ArraySet;
-
-import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.PackageUserKey;
-
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.shadows.ShadowLauncherApps;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.stream.Collectors;
-
-/**
- * Extension of {@link ShadowLauncherApps} with missing shadow methods
- */
-@Implements(value = LauncherApps.class)
-public class LShadowLauncherApps extends ShadowLauncherApps {
-
- public final ArraySet<PackageUserKey> disabledApps = new ArraySet<>();
- public final ArraySet<ComponentKey> disabledActivities = new ArraySet<>();
-
- @Implementation
- @Override
- protected List<ShortcutInfo> getShortcuts(LauncherApps.ShortcutQuery query, UserHandle user) {
- try {
- return super.getShortcuts(query, user);
- } catch (UnsupportedOperationException e) {
- return Collections.emptyList();
- }
- }
-
- @Implementation
- protected boolean isPackageEnabled(String packageName, UserHandle user) {
- return !disabledApps.contains(new PackageUserKey(packageName, user));
- }
-
- @Implementation
- protected boolean isActivityEnabled(ComponentName component, UserHandle user) {
- return !disabledActivities.contains(new ComponentKey(component, user));
- }
-
- @Implementation
- protected LauncherActivityInfo resolveActivity(Intent intent, UserHandle user) {
- ResolveInfo ri = RuntimeEnvironment.application.getPackageManager()
- .resolveActivity(intent, 0);
- return ri == null ? null : getLauncherActivityInfo(ri.activityInfo, user);
- }
-
- public LauncherActivityInfo getLauncherActivityInfo(
- ActivityInfo activityInfo, UserHandle user) {
- return callConstructor(LauncherActivityInfo.class,
- ClassParameter.from(Context.class, RuntimeEnvironment.application),
- ClassParameter.from(ActivityInfo.class, activityInfo),
- ClassParameter.from(UserHandle.class, user));
- }
-
- @Implementation
- public ApplicationInfo getApplicationInfo(String packageName, int flags, UserHandle user)
- throws PackageManager.NameNotFoundException {
- return RuntimeEnvironment.application.getPackageManager()
- .getApplicationInfo(packageName, flags);
- }
-
- @Implementation
- public List<LauncherActivityInfo> getActivityList(String packageName, UserHandle user) {
- Intent intent = new Intent(Intent.ACTION_MAIN)
- .addCategory(Intent.CATEGORY_LAUNCHER)
- .setPackage(packageName);
- return RuntimeEnvironment.application.getPackageManager().queryIntentActivities(intent, 0)
- .stream()
- .map(ri -> getLauncherActivityInfo(ri.activityInfo, user))
- .collect(Collectors.toList());
- }
-
- @Implementation
- public boolean hasShortcutHostPermission() {
- return true;
- }
-
- @Implementation
- public List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions() {
- return RuntimeEnvironment.application.getPackageManager().getPackageInstaller()
- .getAllSessions();
- }
-
- @Implementation
- public void registerPackageInstallerSessionCallback(
- Executor executor, PackageInstaller.SessionCallback callback) {
- }
-
- @Override
- protected List<LauncherActivityInfo> getShortcutConfigActivityList(String packageName,
- UserHandle user) {
- Intent intent = new Intent(Intent.ACTION_CREATE_SHORTCUT).setPackage(packageName);
- return RuntimeEnvironment.application.getPackageManager().queryIntentActivities(intent, 0)
- .stream()
- .map(ri -> getLauncherActivityInfo(ri.activityInfo, user))
- .collect(Collectors.toList());
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/ShadowDeviceFlag.java b/robolectric_tests/src/com/android/launcher3/shadows/ShadowDeviceFlag.java
deleted file mode 100644
index b58e4b7..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/ShadowDeviceFlag.java
+++ /dev/null
@@ -1,62 +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.shadows;
-
-import android.content.Context;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.uioverrides.DeviceFlag;
-import com.android.launcher3.util.LooperExecutor;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.RealObject;
-import org.robolectric.shadow.api.Shadow;
-
-/**
- * Shadow for {@link LooperExecutor} to provide reset functionality for static executors.
- */
-@Implements(value = DeviceFlag.class, isInAndroidSdk = false)
-public class ShadowDeviceFlag {
-
- @RealObject private DeviceFlag mRealObject;
- @Nullable private Boolean mValue;
-
- /**
- * Mock change listener as it uses internal system classes not available to robolectric
- */
- @Implementation
- protected void addChangeListener(Context context, Runnable r) { }
-
- @Implementation
- protected static boolean getDeviceValue(String key, boolean defaultValue) {
- return defaultValue;
- }
-
- @Implementation
- public boolean get() {
- if (mValue != null) {
- return mValue;
- }
- return Shadow.directlyOn(mRealObject, DeviceFlag.class, "get");
- }
-
- public void setValue(boolean value) {
- mValue = new Boolean(value);
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/ShadowLooperExecutor.java b/robolectric_tests/src/com/android/launcher3/shadows/ShadowLooperExecutor.java
deleted file mode 100644
index 57eda7e..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/ShadowLooperExecutor.java
+++ /dev/null
@@ -1,63 +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.shadows;
-
-import static com.android.launcher3.util.Executors.createAndStartNewLooper;
-
-import static org.robolectric.shadow.api.Shadow.directlyOn;
-import static org.robolectric.util.ReflectionHelpers.setField;
-
-import android.os.Handler;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.util.LooperExecutor;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.RealObject;
-
-/**
- * Shadow for {@link LooperExecutor} to provide reset functionality for static executors.
- */
-@Implements(value = LooperExecutor.class, isInAndroidSdk = false)
-public class ShadowLooperExecutor {
-
- @RealObject private LooperExecutor mRealExecutor;
-
- private Handler mOverriddenHandler;
-
- @Implementation
- protected Handler getHandler() {
- if (mOverriddenHandler != null) {
- return mOverriddenHandler;
- }
- Handler handler = directlyOn(mRealExecutor, LooperExecutor.class, "getHandler");
- Thread thread = handler.getLooper().getThread();
- if (!thread.isAlive()) {
- // Robolectric destroys all loopers at the end of every test. Since Launcher maintains
- // some static threads, they need to be reinitialized in case they were destroyed.
- setField(mRealExecutor, "mHandler",
- new Handler(createAndStartNewLooper(thread.getName())));
- }
- return directlyOn(mRealExecutor, LooperExecutor.class, "getHandler");
- }
-
- public void setHandler(@Nullable Handler handler) {
- mOverriddenHandler = handler;
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/ShadowMainThreadInitializedObject.java b/robolectric_tests/src/com/android/launcher3/shadows/ShadowMainThreadInitializedObject.java
deleted file mode 100644
index 6e2ccf8..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/ShadowMainThreadInitializedObject.java
+++ /dev/null
@@ -1,61 +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.shadows;
-
-import static org.robolectric.shadow.api.Shadow.invokeConstructor;
-import static org.robolectric.util.ReflectionHelpers.ClassParameter.from;
-
-import com.android.launcher3.util.MainThreadInitializedObject;
-import com.android.launcher3.util.MainThreadInitializedObject.ObjectProvider;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.RealObject;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-/**
- * Shadow for {@link MainThreadInitializedObject} to provide reset functionality for static sObjects
- */
-@Implements(value = MainThreadInitializedObject.class, isInAndroidSdk = false)
-public class ShadowMainThreadInitializedObject {
-
- // Keep reference to all created MainThreadInitializedObject so they can be cleared after test
- private static Set<MainThreadInitializedObject> sObjects =
- Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
-
- @RealObject private MainThreadInitializedObject mRealObject;
-
- @Implementation
- protected void __constructor__(ObjectProvider provider) {
- invokeConstructor(MainThreadInitializedObject.class, mRealObject,
- from(ObjectProvider.class, provider));
- sObjects.add(mRealObject);
- }
-
- /**
- * Resets all the initialized sObjects to be null
- */
- public static void resetInitializedObjects() {
- for (MainThreadInitializedObject object : new ArrayList<>(sObjects)) {
- object.initializeForTesting(null);
- }
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/ShadowOverrides.java b/robolectric_tests/src/com/android/launcher3/shadows/ShadowOverrides.java
deleted file mode 100644
index 131f691..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/ShadowOverrides.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.shadows;
-
-import android.content.Context;
-
-import com.android.launcher3.util.MainThreadInitializedObject.ObjectProvider;
-import com.android.launcher3.util.ResourceBasedOverride;
-import com.android.launcher3.util.ResourceBasedOverride.Overrides;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.util.ReflectionHelpers.ClassParameter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Shadow for {@link Overrides} to provide custom overrides for test
- */
-@Implements(value = Overrides.class, isInAndroidSdk = false)
-public class ShadowOverrides {
-
- private static Map<Class, ObjectProvider> sProviderMap = new HashMap<>();
-
- @Implementation
- public static <T extends ResourceBasedOverride> T getObject(
- Class<T> clazz, Context context, int resId) {
- ObjectProvider<T> provider = sProviderMap.get(clazz);
- if (provider != null) {
- return provider.get(context);
- }
- return Shadow.directlyOn(Overrides.class, "getObject",
- ClassParameter.from(Class.class, clazz),
- ClassParameter.from(Context.class, context),
- ClassParameter.from(int.class, resId));
- }
-
- public static <T> void setProvider(Class<T> clazz, ObjectProvider<T> provider) {
- sProviderMap.put(clazz, provider);
- }
-
- public static void clearProvider() {
- sProviderMap.clear();
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/shadows/ShadowSurfaceTransactionApplier.java b/robolectric_tests/src/com/android/launcher3/shadows/ShadowSurfaceTransactionApplier.java
deleted file mode 100644
index a9f2f27..0000000
--- a/robolectric_tests/src/com/android/launcher3/shadows/ShadowSurfaceTransactionApplier.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.shadows;
-
-import static org.robolectric.shadow.api.Shadow.invokeConstructor;
-import static org.robolectric.util.ReflectionHelpers.ClassParameter.from;
-
-import android.view.View;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.RealObject;
-
-/**
- * Shadow for SurfaceTransactionApplier to override default functionality
- */
-@Implements(className = "com.android.quickstep.util.SurfaceTransactionApplier",
- isInAndroidSdk = false)
-public class ShadowSurfaceTransactionApplier {
-
- @RealObject
- private Object mRealObject;
-
- @Implementation
- protected void __constructor__(View view) {
- invokeConstructor(mRealObject.getClass(), mRealObject, from(View.class, null));
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/testing/TestActivity.java b/robolectric_tests/src/com/android/launcher3/testing/TestActivity.java
deleted file mode 100644
index 17d0ac1..0000000
--- a/robolectric_tests/src/com/android/launcher3/testing/TestActivity.java
+++ /dev/null
@@ -1,46 +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.testing;
-
-import com.android.launcher3.BaseActivity;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.views.ActivityContext;
-import com.android.launcher3.views.BaseDragLayer;
-
-/** An empty activity for {@link android.app.Fragment}s, {@link android.view.View}s testing. */
-public class TestActivity extends BaseActivity implements ActivityContext {
-
- private DeviceProfile mDeviceProfile;
-
- @Override
- public BaseDragLayer getDragLayer() {
- return new BaseDragLayer(this, /* attrs= */ null, /* alphaChannelCount= */ 1) {
- @Override
- public void recreateControllers() {
- // Do nothing.
- }
- };
- }
-
- @Override
- public DeviceProfile getDeviceProfile() {
- return mDeviceProfile;
- }
-
- public void setDeviceProfile(DeviceProfile deviceProfile) {
- mDeviceProfile = deviceProfile;
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/util/LauncherTestApplication.java b/robolectric_tests/src/com/android/launcher3/util/LauncherTestApplication.java
deleted file mode 100644
index efac150..0000000
--- a/robolectric_tests/src/com/android/launcher3/util/LauncherTestApplication.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 static org.mockito.Mockito.mock;
-
-import android.app.Application;
-
-import com.android.launcher3.shadows.ShadowMainThreadInitializedObject;
-import com.android.launcher3.shadows.ShadowOverrides;
-import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
-
-import org.robolectric.TestLifecycleApplication;
-import org.robolectric.shadows.ShadowLog;
-
-import java.lang.reflect.Method;
-
-public class LauncherTestApplication extends Application implements TestLifecycleApplication {
-
- @Override
- public void beforeTest(Method method) {
- ShadowLog.stream = System.out;
-
- // Disable plugins
- PluginManagerWrapper.INSTANCE.initializeForTesting(mock(PluginManagerWrapper.class));
- }
-
- @Override
- public void prepareTest(Object test) { }
-
- @Override
- public void afterTest(Method method) {
- ShadowLog.stream = null;
- ShadowMainThreadInitializedObject.resetInitializedObjects();
- ShadowOverrides.clearProvider();
- }
-}
diff --git a/robolectric_tests/src/com/android/launcher3/util/LauncherUIHelper.java b/robolectric_tests/src/com/android/launcher3/util/LauncherUIHelper.java
deleted file mode 100644
index caad40e..0000000
--- a/robolectric_tests/src/com/android/launcher3/util/LauncherUIHelper.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 static android.view.View.MeasureSpec.EXACTLY;
-import static android.view.View.MeasureSpec.makeMeasureSpec;
-
-import static com.android.launcher3.Utilities.createHomeIntent;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ResolveInfo;
-import android.graphics.Point;
-import android.view.View;
-import android.view.WindowManager;
-
-import com.android.launcher3.Launcher;
-
-import org.robolectric.Robolectric;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.android.controller.ActivityController;
-import org.robolectric.shadows.ShadowLooper;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.List;
-
-/**
- * Utility class to help manage Launcher UI and related objects for test.
- */
-public class LauncherUIHelper {
-
- /**
- * Returns the class name for the Launcher activity as defined in the manifest
- */
- public static String getLauncherClassName() {
- Context context = RuntimeEnvironment.application;
- Intent homeIntent = createHomeIntent().setPackage(context.getPackageName());
-
- List<ResolveInfo> launchers = context.getPackageManager()
- .queryIntentActivities(homeIntent, 0);
- if (launchers.size() != 1) {
- return null;
- }
- return launchers.get(0).activityInfo.name;
- }
-
- /**
- * Returns an activity controller for Launcher activity defined in the manifest
- */
- public static <T extends Launcher> ActivityController<T> buildLauncher() {
- try {
- Class<T> tClass = (Class<T>) Class.forName(getLauncherClassName());
- return Robolectric.buildActivity(tClass);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Creates and binds a Launcher activity defined in the manifest.
- * Note that the model must be bound before calling this
- */
- public static <T extends Launcher> T buildAndBindLauncher() {
- ActivityController<T> controller = buildLauncher();
-
- T launcher = controller.setup().get();
- doLayout(launcher);
- ViewOnDrawExecutor executor = ReflectionHelpers.getField(launcher, "mPendingExecutor");
- if (executor != null) {
- executor.markCompleted();
- }
- return launcher;
- }
-
- /**
- * Performs a measure and layout pass for the given activity
- */
- public static void doLayout(Activity activity) {
- Point size = new Point();
- RuntimeEnvironment.application.getSystemService(WindowManager.class)
- .getDefaultDisplay().getSize(size);
- View view = activity.getWindow().getDecorView();
- view.measure(makeMeasureSpec(size.x, EXACTLY), makeMeasureSpec(size.y, EXACTLY));
- view.layout(0, 0, size.x, size.y);
- ShadowLooper.idleMainLooper();
- }
-}
diff --git a/robolectric_tests/unstaged/SettingsCacheTest.java b/robolectric_tests/unstaged/SettingsCacheTest.java
deleted file mode 100644
index fbf4c63..0000000
--- a/robolectric_tests/unstaged/SettingsCacheTest.java
+++ /dev/null
@@ -1,115 +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.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-import android.content.Context;
-import android.net.Uri;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-
-import java.util.Collections;
-
-@RunWith(RobolectricTestRunner.class)
-public class SettingsCacheTest {
-
- public static final Uri KEY_SYSTEM_URI_TEST1 = Uri.parse("content://settings/system/test1");
- public static final Uri KEY_SYSTEM_URI_TEST2 = Uri.parse("content://settings/system/test2");;
-
- private SettingsCache.OnChangeListener mChangeListener;
- private SettingsCache mSettingsCache;
-
- @Before
- public void setup() {
- mChangeListener = mock(SettingsCache.OnChangeListener.class);
- Context targetContext = RuntimeEnvironment.application;
- mSettingsCache = SettingsCache.INSTANCE.get(targetContext);
- mSettingsCache.register(KEY_SYSTEM_URI_TEST1, mChangeListener);
- }
-
- @Test
- public void listenerCalledOnChange() {
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST1);
- verify(mChangeListener, times(1)).onSettingsChanged(true);
- }
-
- @Test
- public void getValueRespectsDefaultValue() {
- // Case of key not found
- boolean val = mSettingsCache.getValue(KEY_SYSTEM_URI_TEST1, 0);
- assertFalse(val);
- }
-
- @Test
- public void getValueHitsCache() {
- mSettingsCache.setKeyCache(Collections.singletonMap(KEY_SYSTEM_URI_TEST1, true));
- boolean val = mSettingsCache.getValue(KEY_SYSTEM_URI_TEST1, 0);
- assertTrue(val);
- }
-
- @Test
- public void getValueUpdatedCache() {
- // First ensure there's nothing in cache
- boolean val = mSettingsCache.getValue(KEY_SYSTEM_URI_TEST1, 0);
- assertFalse(val);
-
- mSettingsCache.setKeyCache(Collections.singletonMap(KEY_SYSTEM_URI_TEST1, true));
- val = mSettingsCache.getValue(KEY_SYSTEM_URI_TEST1, 0);
- assertTrue(val);
- }
-
- @Test
- public void multipleListenersSingleKey() {
- SettingsCache.OnChangeListener secondListener = mock(SettingsCache.OnChangeListener.class);
- mSettingsCache.register(KEY_SYSTEM_URI_TEST1, secondListener);
-
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST1);
- verify(mChangeListener, times(1)).onSettingsChanged(true);
- verify(secondListener, times(1)).onSettingsChanged(true);
- }
-
- @Test
- public void singleListenerMultipleKeys() {
- SettingsCache.OnChangeListener secondListener = mock(SettingsCache.OnChangeListener.class);
- mSettingsCache.register(KEY_SYSTEM_URI_TEST2, secondListener);
-
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST1);
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST2);
- verify(mChangeListener, times(1)).onSettingsChanged(true);
- verify(secondListener, times(1)).onSettingsChanged(true);
- }
-
- @Test
- public void sameListenerMultipleKeys() {
- SettingsCache.OnChangeListener secondListener = mock(SettingsCache.OnChangeListener.class);
- mSettingsCache.register(KEY_SYSTEM_URI_TEST2, mChangeListener);
-
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST1);
- mSettingsCache.onChange(true, KEY_SYSTEM_URI_TEST2);
- verify(mChangeListener, times(2)).onSettingsChanged(true);
- verify(secondListener, times(0)).onSettingsChanged(true);
- }
-}
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 02ec5e8..54920e1 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -90,6 +90,8 @@
private final PointF mTranslationForReorderBounce = new PointF(0, 0);
private final PointF mTranslationForReorderPreview = new PointF(0, 0);
+ private float mTranslationXForTaskbarAlignmentAnimation = 0f;
+
private final PointF mTranslationForMoveFromCenterAnimation = new PointF(0, 0);
private float mScaleForReorderBounce = 1f;
@@ -409,6 +411,10 @@
* Returns true if the touch down at the provided position be ignored
*/
protected boolean shouldIgnoreTouchDown(float x, float y) {
+ if (mDisplay == DISPLAY_TASKBAR) {
+ // Allow touching within padding on taskbar, given icon sizes are smaller.
+ return false;
+ }
return y < getPaddingTop()
|| x < getPaddingLeft()
|| y > getHeight() - getPaddingBottom()
@@ -821,7 +827,8 @@
private void updateTranslation() {
super.setTranslationX(mTranslationForReorderBounce.x + mTranslationForReorderPreview.x
- + mTranslationForMoveFromCenterAnimation.x);
+ + mTranslationForMoveFromCenterAnimation.x
+ + mTranslationXForTaskbarAlignmentAnimation);
super.setTranslationY(mTranslationForReorderBounce.y + mTranslationForReorderPreview.y
+ mTranslationForMoveFromCenterAnimation.y);
}
@@ -856,11 +863,29 @@
return mScaleForReorderBounce;
}
+ /**
+ * Sets translation values for move from center animation
+ */
public void setTranslationForMoveFromCenterAnimation(float x, float y) {
mTranslationForMoveFromCenterAnimation.set(x, y);
updateTranslation();
}
+ /**
+ * Sets translationX for taskbar to launcher alignment animation
+ */
+ public void setTranslationXForTaskbarAlignmentAnimation(float translationX) {
+ mTranslationXForTaskbarAlignmentAnimation = translationX;
+ updateTranslation();
+ }
+
+ /**
+ * Returns translationX value for taskbar to launcher alignment animation
+ */
+ public float getTranslationXForTaskbarAlignmentAnimation() {
+ return mTranslationXForTaskbarAlignmentAnimation;
+ }
+
public View getView() {
return this;
}
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index 88f6c49..eb42a65 100644
--- a/src/com/android/launcher3/DropTargetBar.java
+++ b/src/com/android/launcher3/DropTargetBar.java
@@ -25,6 +25,7 @@
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
@@ -32,10 +33,13 @@
import android.view.ViewPropertyAnimator;
import android.widget.FrameLayout;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragOptions;
+import com.android.launcher3.testing.TestProtocol;
/*
* The top bar containing various drop targets: Delete/App Info/Uninstall.
@@ -212,6 +216,9 @@
}
public void animateToVisibility(boolean isVisible) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "8");
+ }
if (mVisible != isVisible) {
mVisible = isVisible;
@@ -238,6 +245,9 @@
*/
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "7");
+ }
animateToVisibility(true);
}
@@ -261,4 +271,12 @@
public ButtonDropTarget[] getDropTargets() {
return mDropTargets;
}
+
+ @Override
+ protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
+ super.onVisibilityChanged(changedView, visibility);
+ if (TestProtocol.sDebugTracing && visibility == VISIBLE) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "9");
+ }
+ }
}
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index a4e1af6..21bc479 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -99,8 +99,18 @@
}
}
- // inherited class can override to change the appearance of the edit text.
- public void show() {}
+ /**
+ * Sets whether EditText background should be visible
+ * @param maxAlpha defines the maximum alpha the background should animates to
+ */
+ public void setBackgroundVisibility(boolean visible, float maxAlpha) {}
+
+ /**
+ * Returns whether a visible background is set on EditText
+ */
+ public boolean getBackgroundVisibility() {
+ return getBackground() != null;
+ }
public void showKeyboard() {
mShowImeAfterFirstLayout = !showSoftInput();
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 2e14823..244cb59 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -57,6 +57,7 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -158,38 +159,6 @@
@VisibleForTesting
public InvariantDeviceProfile() {}
- private InvariantDeviceProfile(InvariantDeviceProfile p) {
- numRows = p.numRows;
- numColumns = p.numColumns;
- numFolderRows = p.numFolderRows;
- numFolderColumns = p.numFolderColumns;
- iconSize = p.iconSize;
- landscapeIconSize = p.landscapeIconSize;
- twoPanelPortraitIconSize = p.twoPanelPortraitIconSize;
- twoPanelLandscapeIconSize = p.twoPanelLandscapeIconSize;
- iconBitmapSize = p.iconBitmapSize;
- iconTextSize = p.iconTextSize;
- landscapeIconTextSize = p.landscapeIconTextSize;
- twoPanelPortraitIconTextSize = p.twoPanelPortraitIconTextSize;
- twoPanelLandscapeIconTextSize = p.twoPanelLandscapeIconTextSize;
- numShownHotseatIcons = p.numShownHotseatIcons;
- numDatabaseHotseatIcons = p.numDatabaseHotseatIcons;
- numAllAppsColumns = p.numAllAppsColumns;
- numDatabaseAllAppsColumns = p.numDatabaseAllAppsColumns;
- isScalable = p.isScalable;
- devicePaddingId = p.devicePaddingId;
- minCellHeight = p.minCellHeight;
- minCellWidth = p.minCellWidth;
- borderSpacing = p.borderSpacing;
- dbFile = p.dbFile;
- allAppsIconSize = p.allAppsIconSize;
- allAppsIconTextSize = p.allAppsIconTextSize;
- defaultLayoutId = p.defaultLayoutId;
- demoModeLayoutId = p.demoModeLayoutId;
- mExtraAttrs = p.mExtraAttrs;
- devicePaddings = p.devicePaddings;
- }
-
@TargetApi(23)
private InvariantDeviceProfile(Context context) {
String gridName = getCurrentGridName(context);
@@ -236,13 +205,13 @@
DisplayOption result = new DisplayOption(defaultDisplayOption.grid)
.add(myDisplayOption);
- result.iconSize = defaultDisplayOption.iconSize;
- result.landscapeIconSize = defaultDisplayOption.landscapeIconSize;
- if (defaultDisplayOption.allAppsIconSize < myDisplayOption.allAppsIconSize) {
- result.allAppsIconSize = defaultDisplayOption.allAppsIconSize;
- } else {
- result.allAppsIconSize = myDisplayOption.allAppsIconSize;
+ result.iconSizes[DisplayOption.INDEX_DEFAULT] =
+ defaultDisplayOption.iconSizes[DisplayOption.INDEX_DEFAULT];
+ for (int i = 1; i < DisplayOption.COUNT_TOTAL; i++) {
+ result.iconSizes[i] = Math.min(
+ defaultDisplayOption.iconSizes[i], myDisplayOption.iconSizes[i]);
}
+
result.minCellHeight = defaultDisplayOption.minCellHeight;
result.minCellWidth = defaultDisplayOption.minCellWidth;
result.borderSpacing = defaultDisplayOption.borderSpacing;
@@ -288,17 +257,21 @@
mExtraAttrs = closestProfile.extraAttrs;
- iconSize = displayOption.iconSize;
- landscapeIconSize = displayOption.landscapeIconSize;
- twoPanelPortraitIconSize = displayOption.twoPanelPortraitIconSize;
- twoPanelLandscapeIconSize = displayOption.twoPanelLandscapeIconSize;
+ iconSize = displayOption.iconSizes[DisplayOption.INDEX_DEFAULT];
+ landscapeIconSize = displayOption.iconSizes[DisplayOption.INDEX_LANDSCAPE];
+ twoPanelPortraitIconSize = displayOption.iconSizes[DisplayOption.INDEX_TWO_PANEL_PORTRAIT];
+ twoPanelLandscapeIconSize =
+ displayOption.iconSizes[DisplayOption.INDEX_TWO_PANEL_LANDSCAPE];
iconBitmapSize = ResourceUtils.pxFromDp(iconSize, metrics);
- iconTextSize = displayOption.iconTextSize;
- landscapeIconTextSize = displayOption.landscapeIconTextSize;
- twoPanelPortraitIconTextSize = displayOption.twoPanelPortraitIconTextSize;
- twoPanelLandscapeIconTextSize = displayOption.twoPanelLandscapeIconTextSize;
fillResIconDpi = getLauncherIconDensity(iconBitmapSize);
+ iconTextSize = displayOption.textSizes[DisplayOption.INDEX_DEFAULT];
+ landscapeIconTextSize = displayOption.textSizes[DisplayOption.INDEX_LANDSCAPE];
+ twoPanelPortraitIconTextSize =
+ displayOption.textSizes[DisplayOption.INDEX_TWO_PANEL_PORTRAIT];
+ twoPanelLandscapeIconTextSize =
+ displayOption.textSizes[DisplayOption.INDEX_TWO_PANEL_LANDSCAPE];
+
minCellHeight = displayOption.minCellHeight;
minCellWidth = displayOption.minCellWidth;
borderSpacing = displayOption.borderSpacing;
@@ -312,8 +285,8 @@
? closestProfile.numDatabaseAllAppsColumns : closestProfile.numAllAppsColumns;
if (Utilities.isGridOptionsEnabled(context)) {
- allAppsIconSize = displayOption.allAppsIconSize;
- allAppsIconTextSize = displayOption.allAppsIconTextSize;
+ allAppsIconSize = displayOption.iconSizes[DisplayOption.INDEX_ALL_APPS];
+ allAppsIconTextSize = displayOption.textSizes[DisplayOption.INDEX_ALL_APPS];
} else {
allAppsIconSize = iconSize;
allAppsIconTextSize = iconTextSize;
@@ -374,13 +347,22 @@
MAIN_EXECUTOR.execute(() -> onConfigChanged(appContext));
}
+ private Object[] toModelState() {
+ return new Object[] {
+ numColumns, numRows, numDatabaseHotseatIcons, iconBitmapSize, fillResIconDpi,
+ numDatabaseAllAppsColumns, dbFile};
+ }
+
private void onConfigChanged(Context context) {
+ Object[] oldState = toModelState();
+
// Re-init grid
String gridName = getCurrentGridName(context);
initGrid(context, gridName);
+ boolean modelPropsChanged = !Arrays.equals(oldState, toModelState());
for (OnIDPChangeListener listener : mChangeListeners) {
- listener.onIdpChanged(this);
+ listener.onIdpChanged(modelPropsChanged);
}
}
@@ -533,37 +515,51 @@
Float.compare(dist(width, height, a.minWidthDps, a.minHeightDps),
dist(width, height, b.minWidthDps, b.minHeightDps)));
- GridOption closestOption = points.get(0).grid;
+ DisplayOption closestPoint = points.get(0);
+ GridOption closestOption = closestPoint.grid;
float weights = 0;
- DisplayOption p = points.get(0);
- if (dist(width, height, p.minWidthDps, p.minHeightDps) == 0) {
- return p;
+ if (dist(width, height, closestPoint.minWidthDps, closestPoint.minHeightDps) == 0) {
+ return closestPoint;
}
DisplayOption out = new DisplayOption(closestOption);
for (int i = 0; i < points.size() && i < KNEARESTNEIGHBOR; ++i) {
- p = points.get(i);
+ DisplayOption p = points.get(i);
float w = weight(width, height, p.minWidthDps, p.minHeightDps, WEIGHT_POWER);
weights += w;
out.add(new DisplayOption().add(p).multiply(w));
}
- return out.multiply(1.0f / weights);
+ out.multiply(1.0f / weights);
+
+ // Since the bitmaps are persisted, ensure that the default bitmap size is same as
+ // predefined size to avoid cache invalidation
+ out.iconSizes[DisplayOption.INDEX_DEFAULT] =
+ closestPoint.iconSizes[DisplayOption.INDEX_DEFAULT];
+ for (int i = DisplayOption.INDEX_DEFAULT + 1; i < DisplayOption.COUNT_TOTAL; i++) {
+ out.iconSizes[i] = Math.min(out.iconSizes[i],
+ out.iconSizes[DisplayOption.INDEX_DEFAULT]);
+ }
+
+ return out;
}
public DeviceProfile getDeviceProfile(Context context) {
Resources res = context.getResources();
Configuration config = context.getResources().getConfiguration();
- float availableWidth = config.screenWidthDp * res.getDisplayMetrics().density;
- float availableHeight = config.screenHeightDp * res.getDisplayMetrics().density;
+ float screenWidth = config.screenWidthDp * res.getDisplayMetrics().density;
+ float screenHeight = config.screenHeightDp * res.getDisplayMetrics().density;
+ return getBestMatch(screenWidth, screenHeight);
+ }
+ public DeviceProfile getBestMatch(float screenWidth, float screenHeight) {
DeviceProfile bestMatch = supportedProfiles.get(0);
float minDiff = Float.MAX_VALUE;
for (DeviceProfile profile : supportedProfiles) {
- float diff = Math.abs(profile.availableWidthPx - availableWidth)
- + Math.abs(profile.availableHeightPx - availableHeight);
+ float diff = Math.abs(profile.widthPx - screenWidth)
+ + Math.abs(profile.heightPx - screenHeight);
if (diff < minDiff) {
minDiff = diff;
bestMatch = profile;
@@ -614,7 +610,7 @@
/**
* Called when the device provide changes
*/
- void onIdpChanged(InvariantDeviceProfile profile);
+ void onIdpChanged(boolean modelPropertiesChanged);
}
@@ -695,6 +691,14 @@
@VisibleForTesting
static final class DisplayOption {
+ static final int INDEX_DEFAULT = 0;
+ static final int INDEX_LANDSCAPE = 1;
+ static final int INDEX_ALL_APPS = 2;
+ static final int INDEX_TWO_PANEL_PORTRAIT = 3;
+ static final int INDEX_TWO_PANEL_LANDSCAPE = 4;
+
+ static final int COUNT_TOTAL = 5;
+
public final GridOption grid;
private final float minWidthDps;
@@ -705,16 +709,8 @@
private float minCellWidth;
private float borderSpacing;
- private float iconSize;
- private float iconTextSize;
- private float landscapeIconSize;
- private float twoPanelPortraitIconSize;
- private float twoPanelLandscapeIconSize;
- private float landscapeIconTextSize;
- private float twoPanelPortraitIconTextSize;
- private float twoPanelLandscapeIconTextSize;
- private float allAppsIconSize;
- private float allAppsIconTextSize;
+ private final float[] iconSizes = new float[COUNT_TOTAL];
+ private final float[] textSizes = new float[COUNT_TOTAL];
DisplayOption(GridOption grid, Context context, AttributeSet attrs, int defaultFlagValue) {
this.grid = grid;
@@ -732,27 +728,36 @@
minCellWidth = a.getFloat(R.styleable.ProfileDisplayOption_minCellWidthDps, 0);
borderSpacing = a.getFloat(R.styleable.ProfileDisplayOption_borderSpacingDps, 0);
- iconSize = a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0);
- landscapeIconSize = a.getFloat(R.styleable.ProfileDisplayOption_landscapeIconSize,
- iconSize);
- twoPanelPortraitIconSize = a.getFloat(
- R.styleable.ProfileDisplayOption_twoPanelPortraitIconSize, iconSize);
- twoPanelLandscapeIconSize = a.getFloat(
- R.styleable.ProfileDisplayOption_twoPanelLandscapeIconSize,
- landscapeIconSize);
- iconTextSize = a.getFloat(R.styleable.ProfileDisplayOption_iconTextSize, 0);
- landscapeIconTextSize = a.getFloat(
- R.styleable.ProfileDisplayOption_landscapeIconTextSize, iconTextSize);
- twoPanelPortraitIconTextSize = a.getFloat(
- R.styleable.ProfileDisplayOption_twoPanelPortraitIconTextSize, iconTextSize);
- twoPanelLandscapeIconTextSize = a.getFloat(
- R.styleable.ProfileDisplayOption_twoPanelLandscapeIconTextSize,
- landscapeIconTextSize);
+ iconSizes[INDEX_DEFAULT] =
+ a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0);
+ iconSizes[INDEX_LANDSCAPE] =
+ a.getFloat(R.styleable.ProfileDisplayOption_landscapeIconSize,
+ iconSizes[INDEX_DEFAULT]);
+ iconSizes[INDEX_ALL_APPS] =
+ a.getFloat(R.styleable.ProfileDisplayOption_allAppsIconSize,
+ iconSizes[INDEX_DEFAULT]);
+ iconSizes[INDEX_TWO_PANEL_PORTRAIT] =
+ a.getFloat(R.styleable.ProfileDisplayOption_twoPanelPortraitIconSize,
+ iconSizes[INDEX_DEFAULT]);
+ iconSizes[INDEX_TWO_PANEL_LANDSCAPE] =
+ a.getFloat(R.styleable.ProfileDisplayOption_twoPanelLandscapeIconSize,
+ iconSizes[INDEX_LANDSCAPE]);
- allAppsIconSize = a.getFloat(R.styleable.ProfileDisplayOption_allAppsIconSize,
- iconSize);
- allAppsIconTextSize = a.getFloat(R.styleable.ProfileDisplayOption_allAppsIconTextSize,
- iconTextSize);
+ textSizes[INDEX_DEFAULT] =
+ a.getFloat(R.styleable.ProfileDisplayOption_iconTextSize, 0);
+ textSizes[INDEX_LANDSCAPE] =
+ a.getFloat(R.styleable.ProfileDisplayOption_landscapeIconTextSize,
+ textSizes[INDEX_DEFAULT]);
+ textSizes[INDEX_ALL_APPS] =
+ a.getFloat(R.styleable.ProfileDisplayOption_allAppsIconTextSize,
+ textSizes[INDEX_DEFAULT]);
+ textSizes[INDEX_TWO_PANEL_PORTRAIT] =
+ a.getFloat(R.styleable.ProfileDisplayOption_twoPanelPortraitIconTextSize,
+ textSizes[INDEX_DEFAULT]);
+ textSizes[INDEX_TWO_PANEL_LANDSCAPE] =
+ a.getFloat(R.styleable.ProfileDisplayOption_twoPanelLandscapeIconTextSize,
+ textSizes[INDEX_LANDSCAPE]);
+
a.recycle();
}
@@ -771,16 +776,10 @@
}
private DisplayOption multiply(float w) {
- iconSize *= w;
- landscapeIconSize *= w;
- twoPanelPortraitIconSize *= w;
- twoPanelLandscapeIconSize *= w;
- allAppsIconSize *= w;
- iconTextSize *= w;
- landscapeIconTextSize *= w;
- twoPanelPortraitIconTextSize *= w;
- twoPanelLandscapeIconTextSize *= w;
- allAppsIconTextSize *= w;
+ for (int i = 0; i < COUNT_TOTAL; i++) {
+ iconSizes[i] *= w;
+ textSizes[i] *= w;
+ }
minCellHeight *= w;
minCellWidth *= w;
borderSpacing *= w;
@@ -788,16 +787,10 @@
}
private DisplayOption add(DisplayOption p) {
- iconSize += p.iconSize;
- landscapeIconSize += p.landscapeIconSize;
- twoPanelPortraitIconSize += p.twoPanelPortraitIconSize;
- twoPanelLandscapeIconSize += p.twoPanelLandscapeIconSize;
- allAppsIconSize += p.allAppsIconSize;
- iconTextSize += p.iconTextSize;
- landscapeIconTextSize += p.landscapeIconTextSize;
- twoPanelPortraitIconTextSize += p.twoPanelPortraitIconTextSize;
- twoPanelLandscapeIconTextSize += p.twoPanelLandscapeIconTextSize;
- allAppsIconTextSize += p.allAppsIconTextSize;
+ for (int i = 0; i < COUNT_TOTAL; i++) {
+ iconSizes[i] += p.iconSizes[i];
+ textSizes[i] += p.textSizes[i];
+ }
minCellHeight += p.minCellHeight;
minCellWidth += p.minCellWidth;
borderSpacing += p.borderSpacing;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 6ea7b17..ed9f044 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -555,10 +555,18 @@
}
@Override
+ public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) {
+ super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
+ // Always update device profile when multi window mode changed.
+ initDeviceProfile(mDeviceProfile.inv);
+ dispatchDeviceProfileChanged();
+ }
+
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
int diff = newConfig.diff(mOldConfig);
if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) {
- onIdpChanged(mDeviceProfile.inv);
+ onIdpChanged(false);
}
mOldConfig.setTo(newConfig);
@@ -566,8 +574,8 @@
}
@Override
- public void onIdpChanged(InvariantDeviceProfile idp) {
- initDeviceProfile(idp);
+ public void onIdpChanged(boolean modelPropertiesChanged) {
+ initDeviceProfile(mDeviceProfile.inv);
dispatchDeviceProfileChanged();
reapplyUi();
mDragLayer.recreateControllers();
@@ -871,11 +879,11 @@
if (dropLayout == null) {
// it's possible that the add screen was removed because it was
// empty and a re-bind occurred
- mWorkspace.addExtraEmptyScreen();
- return mWorkspace.commitExtraEmptyScreen();
- } else {
- return screenId;
+ mWorkspace.addExtraEmptyScreens();
+ IntSet emptyPagesAdded = mWorkspace.commitExtraEmptyScreens();
+ return emptyPagesAdded.isEmpty() ? -1 : emptyPagesAdded.getArray().get(0);
}
+ return screenId;
}
@Thunk
@@ -1195,7 +1203,7 @@
// Until the workspace is bound, ensure that we keep the wallpaper offset locked to the
// default state, otherwise we will update to the wrong offsets in RTL
mWorkspace.lockWallpaperToDefaultPage();
- mWorkspace.bindAndInitFirstWorkspaceScreen(null /* recycled qsb */);
+ mWorkspace.bindAndInitFirstWorkspaceScreen();
mDragController.addDragListener(mWorkspace);
// Get the search/delete/uninstall bar
@@ -2106,19 +2114,19 @@
actualIds.add(id);
}
int firstId = visibleIds.getArray().get(0);
+ int pairId = mWorkspace.getPagePair(firstId);
+ // Double check that actual screenIds contains the visibleId, as empty screens are hidden
+ // in single panel.
if (actualIds.contains(firstId)) {
result.add(firstId);
-
- if (mDeviceProfile.isTwoPanels) {
- int index = actualIds.indexOf(firstId);
- int nextIndex = (index / 2) * 2;
- if (nextIndex == index) {
- nextIndex++;
- }
- if (nextIndex < actualIds.size()) {
- result.add(actualIds.get(nextIndex));
- }
+ if (mDeviceProfile.isTwoPanels && actualIds.contains(pairId)) {
+ result.add(pairId);
}
+ } else if (LauncherAppState.getIDP(this).supportedProfiles.stream().anyMatch(
+ deviceProfile -> deviceProfile.isTwoPanels) && actualIds.contains(pairId)) {
+ // Add the right panel if left panel is hidden when switching display, due to empty
+ // pages being hidden in single panel.
+ result.add(pairId);
}
return result;
}
@@ -2175,7 +2183,7 @@
orderedScreenIds.add(firstScreenPosition, Workspace.FIRST_SCREEN_ID);
} else if (!FeatureFlags.QSB_ON_FIRST_SCREEN && orderedScreenIds.isEmpty()) {
// If there are no screens, we need to have an empty screen
- mWorkspace.addExtraEmptyScreen();
+ mWorkspace.addExtraEmptyScreens();
}
bindAddScreens(orderedScreenIds);
@@ -2190,17 +2198,7 @@
// Some empty pages might have been removed while the phone was in a single panel
// mode, so we want to add those empty pages back.
IntSet screenIds = IntSet.wrap(orderedScreenIds);
- for (int i = 0; i < orderedScreenIds.size(); i++) {
- int screenId = orderedScreenIds.get(i);
- // Don't add the page pair if the page is the last one and if the pair is on the
- // right, because that would cause a bug when adding new pages.
- // TODO: (b/196376162) remove this when the new screen id logic is fixed for two
- // panel in Workspace::commitExtraEmptyScreen
- if (i == orderedScreenIds.size() - 1 && screenId % 2 == 0) {
- continue;
- }
- screenIds.add(mWorkspace.getPagePair(screenId));
- }
+ orderedScreenIds.forEach(screenId -> screenIds.add(mWorkspace.getPagePair(screenId)));
orderedScreenIds = screenIds.getArray();
}
@@ -2231,6 +2229,9 @@
ArrayList<ItemInfo> addAnimated) {
// Add the new screens
if (newScreens != null) {
+ // newScreens can contain an empty right panel that is already bound, but not known
+ // by BgDataModel.
+ newScreens.removeAllValues(mWorkspace.mScreenOrder);
bindAddScreens(newScreens);
}
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 702b73a..10023b4 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -50,7 +50,7 @@
import com.android.launcher3.util.Themes;
import com.android.launcher3.widget.custom.CustomWidgetManager;
-public class LauncherAppState {
+public class LauncherAppState implements SafeCloseable {
public static final String ACTION_FORCE_ROLOAD = "force-reload-launcher";
private static final String KEY_ICON_STATE = "pref_icon_shape_path";
@@ -83,7 +83,11 @@
Log.v(Launcher.TAG, "LauncherAppState initiated");
Preconditions.assertUIThread();
- mInvariantDeviceProfile.addOnChangeListener(idp -> refreshAndReloadLauncher());
+ mInvariantDeviceProfile.addOnChangeListener(modelPropertiesChanged -> {
+ if (modelPropertiesChanged) {
+ refreshAndReloadLauncher();
+ }
+ });
mContext.getSystemService(LauncherApps.class).registerCallback(mModel);
@@ -134,10 +138,11 @@
mContext = context;
mInvariantDeviceProfile = InvariantDeviceProfile.INSTANCE.get(context);
- mIconProvider = new IconProvider(context, Themes.isThemedIconEnabled(context));
+ mIconProvider = new IconProvider(context, Themes.isThemedIconEnabled(context));
mIconCache = new IconCache(mContext, mInvariantDeviceProfile,
iconCacheFileName, mIconProvider);
- mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext));
+ mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext),
+ iconCacheFileName != null);
mOnTerminateCallback.add(mIconCache::close);
}
@@ -158,7 +163,8 @@
/**
* Call from Application.onTerminate(), which is not guaranteed to ever be called.
*/
- public void onTerminate() {
+ @Override
+ public void close() {
mModel.destroy();
mContext.getSystemService(LauncherApps.class).unregisterCallback(mModel);
CustomWidgetManager.INSTANCE.get(mContext).setWidgetRefreshCallback(null);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 7b6a5bf..f38f662 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -96,9 +96,10 @@
// our monitoring of the package manager provides all updates and we never
// need to do a requery. This is only ever touched from the loader thread.
private boolean mModelLoaded;
+ private boolean mModelDestroyed = false;
public boolean isModelLoaded() {
synchronized (mLock) {
- return mModelLoaded && mLoaderTask == null;
+ return mModelLoaded && mLoaderTask == null && !mModelDestroyed;
}
}
@@ -125,10 +126,12 @@
}
};
- LauncherModel(Context context, LauncherAppState app, IconCache iconCache, AppFilter appFilter) {
+ LauncherModel(Context context, LauncherAppState app, IconCache iconCache, AppFilter appFilter,
+ boolean isPrimaryInstance) {
mApp = app;
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
- mModelDelegate = ModelDelegate.newInstance(context, app, mBgAllAppsList, mBgDataModel);
+ mModelDelegate = ModelDelegate.newInstance(context, app, mBgAllAppsList, mBgDataModel,
+ isPrimaryInstance);
}
public ModelDelegate getModelDelegate() {
@@ -245,6 +248,7 @@
* Called when the model is destroyed
*/
public void destroy() {
+ mModelDestroyed = true;
MODEL_EXECUTOR.execute(mModelDelegate::destroy);
}
@@ -557,6 +561,9 @@
}
public void enqueueModelUpdateTask(ModelUpdateTask task) {
+ if (mModelDestroyed) {
+ return;
+ }
task.init(mApp, this, mBgDataModel, mBgAllAppsList, MAIN_EXECUTOR);
MODEL_EXECUTOR.execute(task);
}
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 49f20c6..df09f29 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -97,7 +97,7 @@
* Represents the schema of the database. Changes in scheme need not be backwards compatible.
* When increasing the scheme version, ensure that downgrade_schema.json is updated
*/
- public static final int SCHEMA_VERSION = 29;
+ public static final int SCHEMA_VERSION = 30;
public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".settings";
public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY";
@@ -864,6 +864,11 @@
}
}
case 29: {
+ // Remove widget panel related leftover workspace items
+ db.delete(Favorites.TABLE_NAME, Utilities.createDbSelectionQuery(
+ Favorites.SCREEN, IntArray.wrap(-777, -778)), null);
+ }
+ case 30: {
// DB Upgraded successfully
return;
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 696e897..108091c 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -108,6 +108,8 @@
// relative scroll position unchanged in updateCurrentPageScroll. Cleared when snapping to a
// page.
protected int mCurrentPageScrollDiff;
+ // The current page the PagedView is scrolling over on it's way to the destination page.
+ protected int mCurrentScrollOverPage;
@ViewDebug.ExportedProperty(category = "launcher")
protected int mNextPage = INVALID_PAGE;
@@ -180,6 +182,7 @@
mScroller = new OverScroller(context, SCROLL);
mCurrentPage = 0;
+ mCurrentScrollOverPage = 0;
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = configuration.getScaledTouchSlop();
@@ -437,6 +440,7 @@
}
int prevPage = overridePrevPage != INVALID_PAGE ? overridePrevPage : mCurrentPage;
mCurrentPage = validateNewPage(currentPage);
+ mCurrentScrollOverPage = mCurrentPage;
updateCurrentPageScroll();
notifyPageSwitchListener(prevPage);
invalidate();
@@ -557,9 +561,11 @@
if (newPos < mMinScroll && oldPos >= mMinScroll) {
mEdgeGlowLeft.onAbsorb((int) mScroller.getCurrVelocity());
mScroller.abortAnimation();
+ onEdgeAbsorbingScroll();
} else if (newPos > mMaxScroll && oldPos <= mMaxScroll) {
mEdgeGlowRight.onAbsorb((int) mScroller.getCurrVelocity());
mScroller.abortAnimation();
+ onEdgeAbsorbingScroll();
}
}
@@ -577,6 +583,7 @@
sendScrollAccessibilityEvent();
int prevPage = mCurrentPage;
mCurrentPage = validateNewPage(mNextPage);
+ mCurrentScrollOverPage = mCurrentPage;
mNextPage = INVALID_PAGE;
notifyPageSwitchListener(prevPage);
@@ -766,7 +773,8 @@
childStart += primaryDimension + getChildGap();
// This makes sure that the space is added after the page, not after each panel
- if (i % panelCount == panelCount - 1) {
+ int lastPanel = mIsRtl ? 0 : panelCount - 1;
+ if (i % panelCount == lastPanel) {
childStart += mPageSpacing;
}
}
@@ -837,6 +845,7 @@
public void onViewRemoved(View child) {
super.onViewRemoved(child);
mCurrentPage = validateNewPage(mCurrentPage);
+ mCurrentScrollOverPage = mCurrentPage;
dispatchPageCountChanged();
}
@@ -1046,7 +1055,7 @@
/**
* If being flinged and user touches the screen, initiate drag; otherwise don't.
*/
- private void updateIsBeingDraggedOnTouchDown(MotionEvent ev) {
+ protected void updateIsBeingDraggedOnTouchDown(MotionEvent ev) {
// mScroller.isFinished should be false when being flinged.
final int xDist = Math.abs(mScroller.getFinalX() - mScroller.getCurrX());
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mPageSlop / 3);
@@ -1408,6 +1417,20 @@
protected void onNotSnappingToPageInFreeScroll() { }
+ /**
+ * Called when the view edges absorb part of the scroll. Subclasses can override this
+ * to provide custom behavior during animation.
+ */
+ protected void onEdgeAbsorbingScroll() {
+ }
+
+ /**
+ * Called when the current page closest to the center of the screen changes as part of the
+ * scroll. Subclasses can override this to provide custom behavior during scroll.
+ */
+ protected void onScrollOverPageChanged() {
+ }
+
protected boolean shouldFlingForVelocity(int velocity) {
float threshold = mAllowEasyFling ? mEasyFlingThresholdVelocity : mFlingThresholdVelocity;
return Math.abs(velocity) > threshold;
@@ -1553,7 +1576,7 @@
return getDisplacementFromScreenCenter(childIndex, screenCenter);
}
- private int getScreenCenter(int primaryScroll) {
+ protected int getScreenCenter(int primaryScroll) {
float primaryScale = mOrientationHandler.getPrimaryScale(this);
float primaryPivot = mOrientationHandler.getPrimaryValue(getPivotX(), getPivotY());
int pageOrientationSize = mOrientationHandler.getMeasuredSize(this);
@@ -1692,6 +1715,15 @@
}
@Override
+ protected void onScrollChanged(int l, int t, int oldl, int oldt) {
+ int newDestinationPage = getDestinationPage();
+ if (newDestinationPage >= 0 && newDestinationPage != mCurrentScrollOverPage) {
+ mCurrentScrollOverPage = newDestinationPage;
+ onScrollOverPageChanged();
+ }
+ }
+
+ @Override
public CharSequence getAccessibilityClassName() {
// Some accessibility services have special logic for ScrollView. Since we provide same
// accessibility info as ScrollView, inform the service to handle use the same way.
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 94ec903..54b2c96 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -125,6 +125,7 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -223,6 +224,9 @@
// Variables relating to touch disambiguation (scrolling workspace vs. scrolling a widget)
private float mXDown;
private float mYDown;
+ private View mQsb;
+ private boolean mIsEventOverQsb;
+
final static float START_DAMPING_TOUCH_SLOP_ANGLE = (float) Math.PI / 6;
final static float MAX_SWIPE_ANGLE = (float) Math.PI / 3;
final static float TOUCH_SLOP_DAMPING_FACTOR = 4;
@@ -334,15 +338,17 @@
int paddingBottom = grid.cellLayoutBottomPaddingPx;
int panelCount = getPanelCount();
+ int rightPanelModulus = mIsRtl ? 0 : panelCount - 1;
+ int leftPanelModulus = mIsRtl ? panelCount - 1 : 0;
int numberOfScreens = mScreenOrder.size();
for (int i = 0; i < numberOfScreens; i++) {
int paddingLeft = paddingLeftRight;
int paddingRight = paddingLeftRight;
if (panelCount > 1) {
- if (i % panelCount == 0) { // left side panel
+ if (i % panelCount == leftPanelModulus) {
paddingLeft = paddingLeftRight;
paddingRight = 0;
- } else if (i % panelCount == panelCount - 1) { // right side panel
+ } else if (i % panelCount == rightPanelModulus) {
paddingLeft = 0;
paddingRight = paddingLeftRight;
} else { // middle panel
@@ -548,9 +554,8 @@
/**
* Initializes and binds the first page
- * @param qsb an existing qsb to recycle or null.
*/
- public void bindAndInitFirstWorkspaceScreen(View qsb) {
+ public void bindAndInitFirstWorkspaceScreen() {
if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
return;
}
@@ -558,10 +563,10 @@
// Add the first page
CellLayout firstPage = insertNewWorkspaceScreen(Workspace.FIRST_SCREEN_ID, getChildCount());
// Always add a QSB on the first screen.
- if (qsb == null) {
+ if (mQsb == null) {
// In transposed layout, we add the QSB in the Grid. As workspace does not touch the
// edges, we do not need a full width QSB.
- qsb = LayoutInflater.from(getContext())
+ mQsb = LayoutInflater.from(getContext())
.inflate(R.layout.search_container_workspace, firstPage, false);
}
@@ -570,8 +575,9 @@
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, firstPage.getCountX(),
cellVSpan);
lp.canReorder = false;
- if (!firstPage.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true)) {
+ if (!firstPage.addViewToCellLayout(mQsb, 0, R.id.search_container_workspace, lp, true)) {
Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
+ mQsb = null;
}
}
@@ -581,9 +587,8 @@
disableLayoutTransitions();
// Recycle the QSB widget
- View qsb = findViewById(R.id.search_container_workspace);
- if (qsb != null) {
- ((ViewGroup) qsb.getParent()).removeView(qsb);
+ if (mQsb != null) {
+ ((ViewGroup) mQsb.getParent()).removeView(mQsb);
}
// Remove the pages and clear the screen models
@@ -596,7 +601,7 @@
mLauncher.mHandler.removeCallbacksAndMessages(DeferredWidgetRefresh.class);
// Ensure that the first page is always present
- bindAndInitFirstWorkspaceScreen(qsb);
+ bindAndInitFirstWorkspaceScreen();
// Re-enable the layout transitions
enableLayoutTransitions();
@@ -642,18 +647,36 @@
boolean childOnFinalScreen = false;
if (mDragSourceInternal != null) {
+ int dragSourceChildCount = mDragSourceInternal.getChildCount();
+
+ // If the icon was dragged from Hotseat, there is no page pair
+ if (isTwoPanelEnabled() && !(mDragSourceInternal.getParent() instanceof Hotseat)) {
+ int pagePairScreenId = getPagePair(dragObject.dragInfo.screenId);
+ CellLayout pagePair = mWorkspaceScreens.get(pagePairScreenId);
+ if (pagePair == null) {
+ // TODO: after http://b/198820019 is fixed, remove this
+ throw new IllegalStateException("Page pair is null, "
+ + "dragScreenId: " + dragObject.dragInfo.screenId
+ + ", pagePairScreenId: " + pagePairScreenId
+ + ", mScreenOrder: " + mScreenOrder.toConcatString()
+ );
+ }
+ dragSourceChildCount += pagePair.getShortcutsAndWidgets().getChildCount();
+ }
+
// When the drag view content is a LauncherAppWidgetHostView, we should increment the
// drag source child count by 1 because the widget in drag has been detached from its
// original parent, ShortcutAndWidgetContainer, and reattached to the DragView.
- int dragSourceChildCount =
- dragObject.dragView.getContentView() instanceof LauncherAppWidgetHostView
- ? mDragSourceInternal.getChildCount() + 1
- : mDragSourceInternal.getChildCount();
+ if (dragObject.dragView.getContentView() instanceof LauncherAppWidgetHostView) {
+ dragSourceChildCount++;
+ }
+
if (dragSourceChildCount == 1) {
lastChildOnScreen = true;
}
CellLayout cl = (CellLayout) mDragSourceInternal.getParent();
- if (indexOfChild(cl) == getChildCount() - 1) {
+ if (getLeftmostVisiblePageForIndex(indexOfChild(cl))
+ == getLeftmostVisiblePageForIndex(getPageCount() - 1)) {
childOnFinalScreen = true;
}
}
@@ -662,40 +685,83 @@
if (lastChildOnScreen && childOnFinalScreen) {
return;
}
- if (!mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)) {
- insertNewWorkspaceScreen(EXTRA_EMPTY_SCREEN_ID);
+
+ forEachExtraEmptyPageId(extraEmptyPageId -> {
+ if (!mWorkspaceScreens.containsKey(extraEmptyPageId)) {
+ insertNewWorkspaceScreen(extraEmptyPageId);
+ }
+ });
+ }
+
+ /**
+ * Inserts extra empty pages to the end of the existing workspaces.
+ * Usually we add one extra empty screen, but when two panel home is enabled we add
+ * two extra screens.
+ **/
+ public void addExtraEmptyScreens() {
+ forEachExtraEmptyPageId(extraEmptyPageId -> {
+ if (!mWorkspaceScreens.containsKey(extraEmptyPageId)) {
+ insertNewWorkspaceScreen(extraEmptyPageId);
+ }
+ });
+ }
+
+ /**
+ * Calls the consumer with all the necessary extra empty page IDs.
+ * On a normal one panel Workspace that means only EXTRA_EMPTY_SCREEN_ID,
+ * but in a two panel scenario this also includes EXTRA_EMPTY_SCREEN_SECOND_ID.
+ */
+ private void forEachExtraEmptyPageId(Consumer<Integer> callback) {
+ callback.accept(EXTRA_EMPTY_SCREEN_ID);
+ if (isTwoPanelEnabled()) {
+ callback.accept(EXTRA_EMPTY_SCREEN_SECOND_ID);
}
}
- public boolean addExtraEmptyScreen() {
- if (!mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)) {
- insertNewWorkspaceScreen(EXTRA_EMPTY_SCREEN_ID);
- return true;
- }
- return false;
- }
-
+ /**
+ * If two panel home is enabled we convert the last two screens that are visible at the same
+ * time. In other cases we only convert the last page.
+ */
private void convertFinalScreenToEmptyScreenIfNecessary() {
if (mLauncher.isWorkspaceLoading()) {
// Invalid and dangerous operation if workspace is loading
return;
}
- if (hasExtraEmptyScreen() || mScreenOrder.size() == 0) return;
- int finalScreenId = mScreenOrder.get(mScreenOrder.size() - 1);
+ int panelCount = getPanelCount();
+ if (hasExtraEmptyScreens() || mScreenOrder.size() < panelCount) {
+ return;
+ }
- CellLayout finalScreen = mWorkspaceScreens.get(finalScreenId);
+ SparseArray<CellLayout> finalScreens = new SparseArray<>();
- // If the final screen is empty, convert it to the extra empty screen
- if (finalScreen != null
- && finalScreen.getShortcutsAndWidgets().getChildCount() == 0
- && !finalScreen.isDropPending()) {
- mWorkspaceScreens.remove(finalScreenId);
- mScreenOrder.removeValue(finalScreenId);
+ int pageCount = mScreenOrder.size();
+ // First we add the last page(s) to the finalScreens collection. The number of final pages
+ // depends on the panel count.
+ for (int pageIndex = pageCount - panelCount; pageIndex < pageCount; pageIndex++) {
+ int screenId = mScreenOrder.get(pageIndex);
+ CellLayout screen = mWorkspaceScreens.get(screenId);
+ if (screen == null || screen.getShortcutsAndWidgets().getChildCount() != 0
+ || screen.isDropPending()) {
+ // Final screen doesn't exist or it isn't empty or there's a pending drop
+ return;
+ }
+ finalScreens.append(screenId, screen);
+ }
- // if this is the last screen, convert it to the empty screen
- mWorkspaceScreens.put(EXTRA_EMPTY_SCREEN_ID, finalScreen);
- mScreenOrder.add(EXTRA_EMPTY_SCREEN_ID);
+ // Then we remove the final screens from the collections (but not from the view hierarchy)
+ // and we store them as extra empty screens.
+ for (int i = 0; i < finalScreens.size(); i++) {
+ int screenId = finalScreens.keyAt(i);
+ CellLayout screen = finalScreens.get(screenId);
+
+ mWorkspaceScreens.remove(screenId);
+ mScreenOrder.removeValue(screenId);
+
+ int newScreenId = mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)
+ ? EXTRA_EMPTY_SCREEN_SECOND_ID : EXTRA_EMPTY_SCREEN_ID;
+ mWorkspaceScreens.put(newScreenId, screen);
+ mScreenOrder.add(newScreenId);
}
}
@@ -703,6 +769,23 @@
removeExtraEmptyScreenDelayed(0, stripEmptyScreens, null);
}
+ /**
+ * The purpose of this method is to remove empty pages from Workspace.
+ * Empty page(s) from the end of mWorkspaceScreens will always be removed. The pages with
+ * ID = Workspace.EXTRA_EMPTY_SCREEN_IDS will be removed if there are other non-empty pages.
+ * If there are no more non-empty pages left, extra empty page(s) will either stay or get added.
+ *
+ * If stripEmptyScreens is true, all empty pages (not just the ones on the end) will be removed
+ * from the Workspace, and if there are no more pages left then extra empty page(s) will be
+ * added.
+ *
+ * The number of extra empty pages is equal to what getPanelCount() returns.
+ *
+ * After the method returns the possible pages are:
+ * stripEmptyScreens = true : [non-empty pages, extra empty page(s) alone]
+ * stripEmptyScreens = false : [non-empty pages, empty pages (not in the end),
+ * extra empty page(s) alone]
+ */
public void removeExtraEmptyScreenDelayed(
int delay, boolean stripEmptyScreens, Runnable onComplete) {
if (mLauncher.isWorkspaceLoading()) {
@@ -716,18 +799,26 @@
return;
}
+ // First we convert the last page to an extra page if the last page is empty
+ // and we don't already have an extra page.
convertFinalScreenToEmptyScreenIfNecessary();
- if (hasExtraEmptyScreen()) {
- removeView(mWorkspaceScreens.get(EXTRA_EMPTY_SCREEN_ID));
+ // Then we remove the extra page(s) if they are not the only pages left in Workspace.
+ if (hasExtraEmptyScreens()) {
+ forEachExtraEmptyPageId(extraEmptyPageId -> {
+ removeView(mWorkspaceScreens.get(extraEmptyPageId));
+ mWorkspaceScreens.remove(extraEmptyPageId);
+ mScreenOrder.removeValue(extraEmptyPageId);
+ });
+
setCurrentPage(getNextPage());
- mWorkspaceScreens.remove(EXTRA_EMPTY_SCREEN_ID);
- mScreenOrder.removeValue(EXTRA_EMPTY_SCREEN_ID);
// Update the page indicator to reflect the removed page.
showPageIndicatorAtCurrentScroll();
}
if (stripEmptyScreens) {
+ // This will remove all empty pages from the Workspace. If there are no more pages left,
+ // it will add extra page(s) so that users can put items on at least one page.
stripEmptyScreens();
}
@@ -736,27 +827,51 @@
}
}
- public boolean hasExtraEmptyScreen() {
- return mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID) && getChildCount() > 1;
+ public boolean hasExtraEmptyScreens() {
+ return mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)
+ && getChildCount() > getPanelCount()
+ && (!isTwoPanelEnabled()
+ || mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_SECOND_ID));
}
- public int commitExtraEmptyScreen() {
+ /**
+ * Commits the extra empty pages then returns the screen ids of those new screens.
+ * Usually there's only one extra empty screen, but when two panel home is enabled we commit
+ * two extra screens.
+ *
+ * Returns an empty IntSet in case we cannot commit any new screens.
+ */
+ public IntSet commitExtraEmptyScreens() {
if (mLauncher.isWorkspaceLoading()) {
// Invalid and dangerous operation if workspace is loading
- return -1;
+ return new IntSet();
}
- CellLayout cl = mWorkspaceScreens.get(EXTRA_EMPTY_SCREEN_ID);
- mWorkspaceScreens.remove(EXTRA_EMPTY_SCREEN_ID);
- mScreenOrder.removeValue(EXTRA_EMPTY_SCREEN_ID);
+ IntSet extraEmptyPageIds = new IntSet();
+ forEachExtraEmptyPageId(extraEmptyPageId ->
+ extraEmptyPageIds.add(commitExtraEmptyScreen(extraEmptyPageId)));
- int newId = LauncherSettings.Settings.call(getContext().getContentResolver(),
- LauncherSettings.Settings.METHOD_NEW_SCREEN_ID)
- .getInt(LauncherSettings.Settings.EXTRA_VALUE);
- mWorkspaceScreens.put(newId, cl);
- mScreenOrder.add(newId);
+ return extraEmptyPageIds;
+ }
- return newId;
+ private int commitExtraEmptyScreen(int emptyScreenId) {
+ CellLayout cl = mWorkspaceScreens.get(emptyScreenId);
+ mWorkspaceScreens.remove(emptyScreenId);
+ mScreenOrder.removeValue(emptyScreenId);
+
+ int newScreenId = -1;
+ // Launcher database isn't aware of empty pages that are already bound, so we need to
+ // skip those IDs manually.
+ while (newScreenId == -1 || mWorkspaceScreens.containsKey(newScreenId)) {
+ newScreenId = LauncherSettings.Settings.call(getContext().getContentResolver(),
+ LauncherSettings.Settings.METHOD_NEW_SCREEN_ID)
+ .getInt(LauncherSettings.Settings.EXTRA_VALUE);
+ }
+
+ mWorkspaceScreens.put(newScreenId, cl);
+ mScreenOrder.add(newScreenId);
+
+ return newScreenId;
}
@Override
@@ -803,12 +918,8 @@
/**
* Returns the page that is shown together with the given page when two panel is enabled.
- * @throws IllegalStateException if called while two panel home isn't enabled.
*/
public int getPagePair(int page) {
- if (!isTwoPanelEnabled()) {
- throw new IllegalStateException("Two panel home isn't enabled.");
- }
if (page % 2 == 0) {
return page + 1;
} else {
@@ -857,9 +968,10 @@
}
}
- // We enforce at least one page to add new items to. In the case that we remove the last
- // such screen, we convert the last screen to the empty screen
- int minScreens = 1;
+ // We enforce at least one page (two pages on two panel home) to add new items to.
+ // In the case that we remove the last such screen(s), we convert the last screen(s)
+ // to the empty screen(s)
+ int minScreens = getPanelCount();
int pageShift = 0;
for (int i = 0; i < removeScreens.size(); i++) {
@@ -869,14 +981,21 @@
mScreenOrder.removeValue(id);
if (getChildCount() > minScreens) {
+ // If this isn't the last page, just remove it
if (indexOfChild(cl) < currentPage) {
pageShift++;
}
removeView(cl);
} else {
- // if this is the last screen, convert it to the empty screen
- mWorkspaceScreens.put(EXTRA_EMPTY_SCREEN_ID, cl);
- mScreenOrder.add(EXTRA_EMPTY_SCREEN_ID);
+ // The last page(s) should be converted into extra empty page(s)
+ int extraScreenId = isTwoPanelEnabled() && id % 2 == 1
+ // This is the right panel in a two panel scenario
+ ? EXTRA_EMPTY_SCREEN_SECOND_ID
+ // This is either the last screen in a one panel scenario, or the left panel
+ // in a two panel scenario when there are only two empty pages left
+ : EXTRA_EMPTY_SCREEN_ID;
+ mWorkspaceScreens.put(extraScreenId, cl);
+ mScreenOrder.add(extraScreenId);
}
}
@@ -922,17 +1041,25 @@
}
@Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
- mXDown = ev.getX();
- mYDown = ev.getY();
+ protected void updateIsBeingDraggedOnTouchDown(MotionEvent ev) {
+ super.updateIsBeingDraggedOnTouchDown(ev);
+
+ mXDown = ev.getX();
+ mYDown = ev.getY();
+ if (mQsb != null) {
+ mTempFXY[0] = mXDown + getScrollX();
+ mTempFXY[1] = mYDown + getScrollY();
+ Utilities.mapCoordInSelfToDescendant(mQsb, this, mTempFXY);
+ mIsEventOverQsb = mQsb.getLeft() <= mTempFXY[0] && mQsb.getRight() >= mTempFXY[0]
+ && mQsb.getTop() <= mTempFXY[1] && mQsb.getBottom() >= mTempFXY[1];
+ } else {
+ mIsEventOverQsb = false;
}
- return super.onInterceptTouchEvent(ev);
}
@Override
protected void determineScrollingStart(MotionEvent ev) {
- if (!isFinishedSwitchingState()) return;
+ if (!isFinishedSwitchingState() || mIsEventOverQsb) return;
float deltaX = ev.getX() - mXDown;
float absDeltaX = Math.abs(deltaX);
@@ -1646,8 +1773,8 @@
}
int screenId = getIdForScreen(dropTargetLayout);
- if (screenId == EXTRA_EMPTY_SCREEN_ID) {
- commitExtraEmptyScreen();
+ if (Workspace.EXTRA_EMPTY_SCREEN_IDS.contains(screenId)) {
+ commitExtraEmptyScreens();
}
return true;
@@ -2323,21 +2450,32 @@
}
int nextPage = getNextPage();
- if (layout == null && !isPageInTransition()) {
- layout = verifyInsidePage(nextPage + (mIsRtl ? 1 : -1), Math.min(centerX, d.x), d.y);
+ IntSet pageIndexesToVerify = IntSet.wrap(nextPage - 1, nextPage + 1);
+ if (isTwoPanelEnabled()) {
+ // If two panel is enabled, users can also drag items to nextPage + 2
+ pageIndexesToVerify.add(nextPage + 2);
}
- if (layout == null && !isPageInTransition()) {
- layout = verifyInsidePage(nextPage + (mIsRtl ? -1 : 1), Math.max(centerX, d.x), d.y);
+ int touchX = (int) Math.min(centerX, d.x);
+ int touchY = d.y;
+
+ // Go through the pages and check if the dragged item is inside one of them
+ for (int pageIndex : pageIndexesToVerify) {
+ if (layout != null || isPageInTransition()) {
+ break;
+ }
+ layout = verifyInsidePage(pageIndex, touchX, touchY);
}
- // If two panel is enabled, users can also drag items to currentPage + 2
- if (isTwoPanelEnabled() && layout == null && !isPageInTransition()) {
- layout = verifyInsidePage(nextPage + (mIsRtl ? -2 : 2), Math.max(centerX, d.x), d.y);
- }
-
- // Always pick the current page.
+ // If the dragged item isn't located in one of the pages above, the icon will stay on the
+ // current screen. For two panel pick the closest panel on the current screen,
+ // on one panel just choose the current page.
if (layout == null && nextPage >= 0 && nextPage < getPageCount()) {
+ if (isTwoPanelEnabled()) {
+ nextPage = getScreenCenter(getScrollX()) > touchX
+ ? (mIsRtl ? nextPage + 1 : nextPage) // left side
+ : (mIsRtl ? nextPage : nextPage + 1); // right side
+ }
layout = (CellLayout) getChildAt(nextPage);
}
if (layout != mDragTargetLayout) {
diff --git a/src/com/android/launcher3/WorkspaceLayoutManager.java b/src/com/android/launcher3/WorkspaceLayoutManager.java
index 44a5536..7e6e1b6 100644
--- a/src/com/android/launcher3/WorkspaceLayoutManager.java
+++ b/src/com/android/launcher3/WorkspaceLayoutManager.java
@@ -23,6 +23,7 @@
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.touch.ItemLongClickListener;
+import com.android.launcher3.util.IntSet;
public interface WorkspaceLayoutManager {
@@ -30,6 +31,12 @@
// The screen id used for the empty screen always present at the end.
int EXTRA_EMPTY_SCREEN_ID = -201;
+ // The screen id used for the second empty screen always present at the end for two panel home.
+ int EXTRA_EMPTY_SCREEN_SECOND_ID = -200;
+ // The screen ids used for the empty screens at the end of the workspaces.
+ IntSet EXTRA_EMPTY_SCREEN_IDS =
+ IntSet.wrap(EXTRA_EMPTY_SCREEN_ID, EXTRA_EMPTY_SCREEN_SECOND_ID);
+
// The is the first screen. It is always present, even if its empty.
int FIRST_SCREEN_ID = 0;
// This is the second page. On two panel home it is always present, even if its empty.
@@ -81,9 +88,9 @@
return;
}
}
- if (screenId == EXTRA_EMPTY_SCREEN_ID) {
+ if (EXTRA_EMPTY_SCREEN_IDS.contains(screenId)) {
// This should never happen
- throw new RuntimeException("Screen id should not be EXTRA_EMPTY_SCREEN_ID");
+ throw new RuntimeException("Screen id should not be extra empty screen: " + screenId);
}
final CellLayout layout;
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index 9faac5b..2032b26 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -45,6 +45,7 @@
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.util.IntArray;
+import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ShortcutUtil;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.views.OptionsPopupView;
@@ -221,6 +222,9 @@
} else if (action == ADD_TO_WORKSPACE) {
final int[] coordinates = new int[2];
final int screenId = findSpaceOnWorkspace(item, coordinates);
+ if (screenId == -1) {
+ return false;
+ }
mLauncher.getStateManager().goToState(NORMAL, true, forSuccessCallback(() -> {
if (item instanceof AppInfo) {
WorkspaceItemInfo info = ((AppInfo) item).makeWorkspaceItem();
@@ -250,6 +254,9 @@
final int[] coordinates = new int[2];
final int screenId = findSpaceOnWorkspace(item, coordinates);
+ if (screenId == -1) {
+ return false;
+ }
mLauncher.getModelWriter().moveItemInDatabase(info,
Favorites.CONTAINER_DESKTOP,
screenId, coordinates[0], coordinates[1]);
@@ -489,8 +496,14 @@
return screenId;
}
- workspace.addExtraEmptyScreen();
- screenId = workspace.commitExtraEmptyScreen();
+ workspace.addExtraEmptyScreens();
+ IntSet emptyScreenIds = workspace.commitExtraEmptyScreens();
+ if (emptyScreenIds.isEmpty()) {
+ // Couldn't create extra empty screens for some reason (e.g. Workspace is loading)
+ return -1;
+ }
+
+ screenId = emptyScreenIds.getArray().get(0);
layout = workspace.getScreenWithId(screenId);
found = layout.findCellForSpan(outCoordinates, info.spanX, info.spanY);
diff --git a/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java
index f96afa8..bf5a24b 100644
--- a/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java
@@ -68,6 +68,9 @@
final WorkspaceItemInfo info = ((DeepShortcutView) host.getParent()).getFinalInfo();
final int[] coordinates = new int[2];
final int screenId = findSpaceOnWorkspace(item, coordinates);
+ if (screenId == -1) {
+ return false;
+ }
mLauncher.getStateManager().goToState(NORMAL, true, forSuccessCallback(() -> {
mLauncher.getModelWriter().addItemToDatabase(info,
LauncherSettings.Favorites.CONTAINER_DESKTOP,
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index d2c71b2..e779ee8 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -59,6 +59,7 @@
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
+import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Insettable;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.R;
@@ -118,7 +119,8 @@
private SpannableStringBuilder mSearchQueryBuilder = null;
protected boolean mUsingTabs;
- private boolean mSearchModeWhileUsingTabs = false;
+ private boolean mIsSearching;
+ private boolean mHasWorkApps;
protected RecyclerViewFastScroller mTouchHandler;
protected final Point mFastScrollerOffset = new Point();
@@ -132,6 +134,7 @@
private final float mHeaderThreshold;
private ScrimView mScrimView;
private int mHeaderColor;
+ private int mTabsProtectionAlpha;
public AllAppsContainerView(Context context) {
this(context, null);
@@ -189,7 +192,7 @@
int currentPage = state.getInt(BUNDLE_KEY_CURRENT_PAGE, 0);
if (currentPage != 0 && mViewPager != null) {
mViewPager.setCurrentPage(currentPage);
- rebindAdapters(true);
+ rebindAdapters();
} else {
reset(true);
}
@@ -243,9 +246,10 @@
break;
}
}
+ mHasWorkApps = hasWorkApps;
if (!mAH[AdapterHolder.MAIN].appsList.hasFilter()) {
- rebindAdapters(hasWorkApps);
- if (hasWorkApps) {
+ rebindAdapters();
+ if (mHasWorkApps) {
resetWorkProfile();
}
}
@@ -322,6 +326,8 @@
mViewPager.getNextPage() == 0
? R.string.all_apps_button_personal_label
: R.string.all_apps_button_work_label;
+ } else if (mIsSearching) {
+ descriptionRes = R.string.all_apps_search_results;
} else {
descriptionRes = R.string.all_apps_button_label;
}
@@ -370,7 +376,7 @@
});
mHeader = findViewById(R.id.all_apps_header);
- rebindAdapters(mUsingTabs, true /* force */);
+ rebindAdapters(true /* force */);
mSearchContainer = findViewById(R.id.search_container_all_apps);
mSearchUiManager = (SearchUiManager) mSearchContainer;
@@ -439,11 +445,12 @@
}
}
- private void rebindAdapters(boolean showTabs) {
- rebindAdapters(showTabs, false /* force */);
+ private void rebindAdapters() {
+ rebindAdapters(false /* force */);
}
- protected void rebindAdapters(boolean showTabs, boolean force) {
+ protected void rebindAdapters(boolean force) {
+ boolean showTabs = mHasWorkApps && !mIsSearching;
if (showTabs == mUsingTabs && !force) {
return;
}
@@ -454,7 +461,6 @@
mAllAppsStore.unregisterIconContainer(mAH[AdapterHolder.WORK].recyclerView);
if (mUsingTabs) {
- setupWorkToggle();
mAH[AdapterHolder.MAIN].setup(mViewPager.getChildAt(0), mPersonalMatcher);
mAH[AdapterHolder.WORK].setup(mViewPager.getChildAt(1), mWorkMatcher);
mAH[AdapterHolder.WORK].recyclerView.setId(R.id.apps_list_view_work);
@@ -485,6 +491,7 @@
}
private void setupWorkToggle() {
+ removeWorkToggle();
if (Utilities.ATLEAST_P) {
mWorkModeSwitch = (WorkModeSwitch) mLauncher.getLayoutInflater().inflate(
R.layout.work_mode_fab, this, false);
@@ -497,10 +504,20 @@
}
}
+ private void removeWorkToggle() {
+ if (mWorkModeSwitch == null) return;
+ if (mWorkModeSwitch.getParent() == this) {
+ this.removeView(mWorkModeSwitch);
+ }
+ mWorkModeSwitch = null;
+ }
+
private void replaceRVContainer(boolean showTabs) {
for (int i = 0; i < mAH.length; i++) {
- if (mAH[i].recyclerView != null) {
- mAH[i].recyclerView.setLayoutManager(null);
+ AllAppsRecyclerView rv = mAH[i].recyclerView;
+ if (rv != null) {
+ rv.setLayoutManager(null);
+ rv.setAdapter(null);
}
}
View oldView = getRecyclerViewContainer();
@@ -517,8 +534,10 @@
mViewPager = (AllAppsPagedView) newView;
mViewPager.initParentViews(this);
mViewPager.getPageIndicator().setOnActivePageChangedListener(this);
+ setupWorkToggle();
} else {
mViewPager = null;
+ removeWorkToggle();
}
}
@@ -537,14 +556,6 @@
mWorkModeSwitch.setWorkTabVisible(currentActivePage == AdapterHolder.WORK
&& mAllAppsStore.hasModelFlag(
FLAG_HAS_SHORTCUT_PERMISSION | FLAG_QUIET_MODE_CHANGE_PERMISSION));
-
- if (currentActivePage == AdapterHolder.WORK) {
- if (mWorkModeSwitch.getParent() == null) {
- addView(mWorkModeSwitch);
- }
- } else {
- removeView(mWorkModeSwitch);
- }
}
}
@@ -621,18 +632,15 @@
for (int i = 0; i < mAH.length; i++) {
mAH[i].adapter.setLastSearchQuery(query);
}
- if (mUsingTabs) {
- mSearchModeWhileUsingTabs = true;
- rebindAdapters(false); // hide tabs
- }
+ mIsSearching = true;
+ rebindAdapters();
mHeader.setCollapsed(true);
}
public void onClearSearchResult() {
- if (mSearchModeWhileUsingTabs) {
- rebindAdapters(true); // show tabs
- mSearchModeWhileUsingTabs = false;
- }
+ mIsSearching = false;
+ rebindAdapters();
+ getActiveRecyclerView().scrollToTop();
}
public void onSearchResultsChanged() {
@@ -706,13 +714,12 @@
mHeaderPaint.setColor(mHeaderColor);
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
- int bottom = mUsingTabs && mHeader.mHeaderCollapsed ? mHeader.getVisibleBottomBound()
- : mSearchContainer.getBottom();
- canvas.drawRect(0, 0, canvas.getWidth(), bottom + getTranslationY(),
- mHeaderPaint);
-
- if (FeatureFlags.ENABLE_DEVICE_SEARCH.get() && getTranslationY() == 0) {
- mSearchUiManager.getEditText().setBackground(null);
+ int bottom = (int) (mSearchContainer.getBottom() + getTranslationY());
+ canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint);
+ int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
+ if (mTabsProtectionAlpha > 0 && tabsHeight != 0) {
+ mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha));
+ canvas.drawRect(0, bottom, canvas.getWidth(), bottom + tabsHeight, mHeaderPaint);
}
}
}
@@ -792,18 +799,29 @@
protected void updateHeaderScroll(int scrolledOffset) {
- float prog = Math.max(0, Math.min(1, (float) scrolledOffset / mHeaderThreshold));
+
+ float prog = Utilities.boundToRange((float) scrolledOffset / mHeaderThreshold, 0f, 1f);
int viewBG = ColorUtils.blendARGB(mScrimColor, mHeaderProtectionColor, prog);
int headerColor = ColorUtils.setAlphaComponent(viewBG,
(int) (getSearchView().getAlpha() * 255));
- if (headerColor != mHeaderColor) {
+ int tabsAlpha = mHeader.getPeripheralProtectionHeight() == 0 ? 0
+ : (int) (Utilities.boundToRange(
+ (scrolledOffset + mHeader.mSnappedScrolledY) / mHeaderThreshold, 0f, 1f)
+ * 255);
+ if (headerColor != mHeaderColor || mTabsProtectionAlpha != tabsAlpha) {
mHeaderColor = headerColor;
- getSearchView().setBackgroundColor(viewBG);
- getFloatingHeaderView().setHeaderColor(viewBG);
+ mTabsProtectionAlpha = tabsAlpha;
invalidateHeader();
- if (scrolledOffset == 0 && mSearchUiManager.getEditText() != null) {
- mSearchUiManager.getEditText().show();
+ }
+ if (mSearchUiManager.getEditText() != null) {
+ ExtendedEditText editText = mSearchUiManager.getEditText();
+ boolean bgVisible = editText.getBackgroundVisibility();
+ if (scrolledOffset == 0 && !mIsSearching) {
+ bgVisible = true;
+ } else if (scrolledOffset > mHeaderThreshold) {
+ bgVisible = false;
}
+ editText.setBackgroundVisibility(bgVisible, 1 - prog);
}
}
@@ -811,7 +829,7 @@
* redraws header protection
*/
public void invalidateHeader() {
- if (mScrimView != null && FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
+ if (mScrimView != null && mHeader.isHeaderProtectionSupported()) {
mScrimView.invalidate();
}
}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 2c84a3d..bddbbd0 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -63,6 +63,13 @@
private final SparseIntArray mCachedScrollPositions = new SparseIntArray();
private final AllAppsFastScrollHelper mFastScrollHelper;
+
+ private final AdapterDataObserver mObserver = new RecyclerView.AdapterDataObserver() {
+ public void onChanged() {
+ mCachedScrollPositions.clear();
+ }
+ };
+
// The empty-search result background
private AllAppsBackgroundDrawable mEmptySearchBackground;
private int mEmptySearchBackgroundTopOffset;
@@ -247,12 +254,13 @@
@Override
public void setAdapter(Adapter adapter) {
+ if (getAdapter() != null) {
+ getAdapter().unregisterAdapterDataObserver(mObserver);
+ }
super.setAdapter(adapter);
- adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
- public void onChanged() {
- mCachedScrollPositions.clear();
- }
- });
+ if (adapter != null) {
+ adapter.registerAdapterDataObserver(mObserver);
+ }
}
@Override
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index a0551f0..a6d8552 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -17,6 +17,7 @@
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT;
+import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
@@ -28,6 +29,7 @@
import android.animation.Animator.AnimatorListener;
import android.animation.ObjectAnimator;
import android.util.FloatProperty;
+import android.view.HapticFeedbackConstants;
import android.view.View;
import android.view.animation.Interpolator;
@@ -168,6 +170,11 @@
builder.add(anim);
setAlphas(toState, config, builder);
+
+ if (ALL_APPS.equals(toState) && mLauncher.isInState(NORMAL)) {
+ mLauncher.getAppsView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
+ HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+ }
}
public Animator createSpringAnimation(float... progressValues) {
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 8ea83d5..debb5b2 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -17,9 +17,6 @@
import android.animation.ValueAnimator;
import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.ArrayMap;
@@ -50,11 +47,10 @@
ValueAnimator.AnimatorUpdateListener, PluginListener<AllAppsRow>, Insettable,
OnHeightUpdatedListener {
- private final Rect mClip = new Rect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE);
+ private final Rect mRVClip = new Rect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE);
+ private final Rect mHeaderClip = new Rect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE);
private final ValueAnimator mAnimator = ValueAnimator.ofInt(0, 0);
- private final ValueAnimator mHeaderAnimator = ValueAnimator.ofInt(0, 1).setDuration(100);
private final Point mTempOffset = new Point();
- private final Paint mBGPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private final RecyclerView.OnScrollListener mOnScrollListener =
new RecyclerView.OnScrollListener() {
@Override
@@ -82,19 +78,19 @@
}
};
- private final int mHeaderTopPadding;
-
protected final Map<AllAppsRow, PluginHeaderRow> mPluginRows = new ArrayMap<>();
+ private final int mHeaderTopPadding;
+ private final boolean mHeaderProtectionSupported;
+
protected ViewGroup mTabLayout;
private AllAppsRecyclerView mMainRV;
private AllAppsRecyclerView mWorkRV;
private AllAppsRecyclerView mCurrentRV;
private ViewGroup mParent;
public boolean mHeaderCollapsed;
- private int mSnappedScrolledY;
+ protected int mSnappedScrolledY;
private int mTranslationY;
- private int mHeaderColor;
private boolean mForwardToRecyclerView;
@@ -120,6 +116,8 @@
super(context, attrs);
mHeaderTopPadding = context.getResources()
.getDimensionPixelSize(R.dimen.all_apps_header_top_padding);
+ mHeaderProtectionSupported = context.getResources().getBoolean(
+ R.bool.config_header_protection_supported);
}
@Override
@@ -138,7 +136,6 @@
}
mFixedRows = rows.toArray(new FloatingHeaderRow[rows.size()]);
mAllRows = mFixedRows;
- mHeaderAnimator.addUpdateListener(valueAnimator -> invalidate());
}
@Override
@@ -285,7 +282,7 @@
mHeaderCollapsed = false;
}
mTranslationY = currentScrollY;
- } else if (!mHeaderCollapsed) {
+ } else {
mTranslationY = currentScrollY - mSnappedScrolledY - mMaxTranslation;
// update state vars
@@ -295,31 +292,10 @@
} else if (mTranslationY <= -mMaxTranslation) { // hide or stay hidden
mHeaderCollapsed = true;
mSnappedScrolledY = -mMaxTranslation;
- mHeaderAnimator.setCurrentFraction(0);
- mHeaderAnimator.start();
}
}
}
- /**
- * Set current header protection background color
- */
- public void setHeaderColor(int color) {
- mHeaderColor = color;
- invalidate();
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- if (mHeaderCollapsed && !mCollapsed && mTabLayout.getVisibility() == VISIBLE
- && mHeaderColor != Color.TRANSPARENT && FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- mBGPaint.setColor(mHeaderColor);
- mBGPaint.setAlpha((int) (255 * mHeaderAnimator.getAnimatedFraction()));
- canvas.drawRect(0, 0, getWidth(), getHeight() + mTranslationY, mBGPaint);
- }
- super.dispatchDraw(canvas);
- }
-
protected void applyVerticalMove() {
int uncappedTranslationY = mTranslationY;
mTranslationY = Math.max(mTranslationY, -mMaxTranslation);
@@ -336,11 +312,15 @@
}
mTabLayout.setTranslationY(mTranslationY);
- mClip.top = mMaxTranslation + mTranslationY;
+
+ int clipHeight = mHeaderTopPadding - getPaddingBottom();
+ mRVClip.top = mTabsHidden ? clipHeight : 0;
+ mHeaderClip.top = clipHeight;
// clipping on a draw might cause additional redraw
- mMainRV.setClipBounds(mClip);
+ setClipBounds(mHeaderClip);
+ mMainRV.setClipBounds(mRVClip);
if (mWorkRV != null) {
- mWorkRV.setClipBounds(mClip);
+ mWorkRV.setClipBounds(mRVClip);
}
}
@@ -421,6 +401,10 @@
return false;
}
+ public boolean isHeaderProtectionSupported() {
+ return mHeaderProtectionSupported;
+ }
+
@Override
public boolean hasOverlappingRendering() {
return false;
@@ -444,10 +428,19 @@
}
/**
- * Returns visible height of FloatingHeaderView contents
+ * Returns visible height of FloatingHeaderView contents requiring header protection
*/
- public int getVisibleBottomBound() {
- return getBottom() + mTranslationY;
+ public int getPeripheralProtectionHeight() {
+ if (!mHeaderProtectionSupported) {
+ return 0;
+ }
+
+ // we only want to show protection when work tab is available and header is either
+ // collapsed or animating to/from collapsed state
+ if (mTabsHidden || !mHeaderCollapsed) {
+ return 0;
+ }
+ return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0);
}
}
diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
index f64b7cb..b6dcec6 100644
--- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
@@ -22,7 +22,6 @@
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
-import com.android.launcher3.statemanager.StateManager.StateListener;
/**
* AllAppsContainerView with launcher specific callbacks
@@ -31,8 +30,6 @@
private final Launcher mLauncher;
- private StateListener<LauncherState> mWorkTabListener;
-
public LauncherAllAppsContainerView(Context context) {
this(context, null);
}
@@ -75,14 +72,6 @@
}
@Override
- public void setupHeader() {
- super.setupHeader();
- if (mWorkTabListener != null && !mUsingTabs) {
- mLauncher.getStateManager().removeStateListener(mWorkTabListener);
- }
- }
-
- @Override
public void onActivePageChanged(int currentActivePage) {
super.onActivePageChanged(currentActivePage);
}
diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java
index a800d34..5d3af08 100644
--- a/src/com/android/launcher3/allapps/WorkModeSwitch.java
+++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java
@@ -51,6 +51,7 @@
@Nullable
private KeyboardInsetAnimationCallback mKeyboardInsetAnimationCallback;
+ private boolean mWorkTabVisible;
public WorkModeSwitch(Context context) {
this(context, null, 0);
@@ -91,11 +92,10 @@
*/
public void setWorkTabVisible(boolean workTabVisible) {
clearAnimation();
- if (workTabVisible) {
+ mWorkTabVisible = workTabVisible;
+ if (workTabVisible && mWorkEnabled) {
setEnabled(true);
- if (mWorkEnabled) {
- setVisibility(VISIBLE);
- }
+ setVisibility(VISIBLE);
setAlpha(0);
animate().alpha(1).start();
} else {
@@ -105,7 +105,7 @@
@Override
public void onClick(View view) {
- if (Utilities.ATLEAST_P) {
+ if (Utilities.ATLEAST_P && mWorkTabVisible) {
setEnabled(false);
Launcher.fromContext(getContext()).getStatsLogManager().logger().log(
LAUNCHER_TURN_OFF_WORK_APPS_TAP);
@@ -137,7 +137,7 @@
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
- if (Utilities.ATLEAST_R) {
+ if (Utilities.ATLEAST_R && mWorkTabVisible) {
setTranslationY(0);
if (insets.isVisible(WindowInsets.Type.ime())) {
Insets keyboardInsets = insets.getInsets(WindowInsets.Type.ime());
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 74c7310..f091262 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -219,7 +219,7 @@
public static final BooleanFlag ENABLE_TASKBAR = getDebugFlag(
"ENABLE_TASKBAR", true, "Allows a system Taskbar to be shown on larger devices.");
- public static final BooleanFlag ENABLE_TASKBAR_EDU = getDebugFlag("ENABLE_TASKBAR_EDU", false,
+ public static final BooleanFlag ENABLE_TASKBAR_EDU = getDebugFlag("ENABLE_TASKBAR_EDU", true,
"Enables showing taskbar education the first time an app is opened.");
public static final BooleanFlag ENABLE_OVERVIEW_GRID = getDebugFlag(
@@ -239,7 +239,7 @@
"Enables scrim during app launch animation.");
public static final BooleanFlag ENABLE_SPLIT_SELECT = getDebugFlag(
- "ENABLE_SPLIT_SELECT", false, "Uses new split screen selection overview UI");
+ "ENABLE_SPLIT_SELECT", true, "Uses new split screen selection overview UI");
public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = new DeviceFlag(
"ENABLE_ENFORCED_ROUNDED_CORNERS", true, "Enforce rounded corners on all App Widgets");
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 1e0edac..fdb2799 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -22,6 +22,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.util.Log;
import android.view.DragEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -34,6 +35,7 @@
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.ActivityContext;
@@ -146,6 +148,9 @@
float initialDragViewScale,
float dragViewScaleOnDrop,
DragOptions options) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "4");
+ }
return startDrag(drawable, /* view= */ null, originalView, dragLayerX, dragLayerY,
source, dragInfo, dragOffset, dragRegion, initialDragViewScale, dragViewScaleOnDrop,
options);
@@ -203,6 +208,9 @@
DragOptions options);
protected void callOnDragStart() {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "6");
+ }
if (mOptions.preDragCondition != null) {
mOptions.preDragCondition.onPreDragEnd(mDragObject, true /* dragStarted*/);
}
diff --git a/src/com/android/launcher3/dragndrop/LauncherDragController.java b/src/com/android/launcher3/dragndrop/LauncherDragController.java
index 0e8b0a5..dcbfa50 100644
--- a/src/com/android/launcher3/dragndrop/LauncherDragController.java
+++ b/src/com/android/launcher3/dragndrop/LauncherDragController.java
@@ -24,6 +24,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.View;
@@ -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.testing.TestProtocol;
/**
* Drag controller for Launcher activity
@@ -65,6 +67,9 @@
float initialDragViewScale,
float dragViewScaleOnDrop,
DragOptions options) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "5");
+ }
if (PROFILE_DRAWING_DURING_DRAG) {
android.os.Debug.startMethodTracing("Launcher");
}
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 7187188..879739f 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -276,15 +276,19 @@
mPageIndicator = findViewById(R.id.folder_page_indicator);
mFolderName = findViewById(R.id.folder_name);
mFolderName.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp.folderLabelTextSizePx);
- mFolderName.setOnBackKeyListener(this);
- mFolderName.setOnFocusChangeListener(this);
- mFolderName.setOnEditorActionListener(this);
- mFolderName.setSelectAllOnFocus(true);
- mFolderName.setInputType(mFolderName.getInputType()
- & ~InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
- | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
- | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
- mFolderName.forceDisableSuggestions(true);
+ if (mActivityContext.supportsIme()) {
+ mFolderName.setOnBackKeyListener(this);
+ mFolderName.setOnFocusChangeListener(this);
+ mFolderName.setOnEditorActionListener(this);
+ mFolderName.setSelectAllOnFocus(true);
+ mFolderName.setInputType(mFolderName.getInputType()
+ & ~InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
+ | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
+ | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
+ mFolderName.forceDisableSuggestions(true);
+ } else {
+ mFolderName.setEnabled(false);
+ }
mFooter = findViewById(R.id.folder_footer);
mFooterHeight = getResources().getDimensionPixelSize(R.dimen.folder_label_height);
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index 60d8cdb..439df80 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -132,6 +132,9 @@
private Rect mTouchArea = new Rect();
+ private final PointF mTranslationForMoveFromCenterAnimation = new PointF(0, 0);
+ private float mTranslationXForTaskbarAlignmentAnimation = 0f;
+
private final PointF mTranslationForReorderBounce = new PointF(0, 0);
private final PointF mTranslationForReorderPreview = new PointF(0, 0);
private float mScaleForReorderBounce = 1f;
@@ -765,8 +768,11 @@
}
private void updateTranslation() {
- super.setTranslationX(mTranslationForReorderBounce.x + mTranslationForReorderPreview.x);
- super.setTranslationY(mTranslationForReorderBounce.y + mTranslationForReorderPreview.y);
+ super.setTranslationX(mTranslationForReorderBounce.x + mTranslationForReorderPreview.x
+ + mTranslationForMoveFromCenterAnimation.x
+ + mTranslationXForTaskbarAlignmentAnimation);
+ super.setTranslationY(mTranslationForReorderBounce.y + mTranslationForReorderPreview.y
+ + mTranslationForMoveFromCenterAnimation.y);
}
public void setReorderBounceOffset(float x, float y) {
@@ -778,6 +784,29 @@
offset.set(mTranslationForReorderBounce);
}
+ /**
+ * Sets translationX value for taskbar to launcher alignment animation
+ */
+ public void setTranslationForTaskbarAlignmentAnimation(float translationX) {
+ mTranslationXForTaskbarAlignmentAnimation = translationX;
+ updateTranslation();
+ }
+
+ /**
+ * Returns translation values for taskbar to launcher alignment animation
+ */
+ public float getTranslationXForTaskbarAlignmentAnimation() {
+ return mTranslationXForTaskbarAlignmentAnimation;
+ }
+
+ /**
+ * Sets translation values for move from center animation
+ */
+ public void setTranslationForMoveFromCenterAnimation(float x, float y) {
+ mTranslationForMoveFromCenterAnimation.set(x, y);
+ updateTranslation();
+ }
+
@Override
public void setReorderPreviewOffset(float x, float y) {
mTranslationForReorderPreview.set(x, y);
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index 94c578e..94fc708 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -87,7 +87,7 @@
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
-import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.BaseDragLayer;
import com.android.launcher3.widget.BaseLauncherAppWidgetHostView;
@@ -98,13 +98,10 @@
import com.android.launcher3.widget.custom.CustomWidgetManager;
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.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
@@ -123,22 +120,16 @@
* Context used just for preview. It also provides a few objects (e.g. UserCache) just for
* preview purposes.
*/
- public static class PreviewContext extends ContextWrapper {
-
- private final Set<MainThreadInitializedObject> mAllowedObjects = new HashSet<>(
- Arrays.asList(UserCache.INSTANCE, InstallSessionHelper.INSTANCE,
- LauncherAppState.INSTANCE, InvariantDeviceProfile.INSTANCE,
- CustomWidgetManager.INSTANCE, PluginManagerWrapper.INSTANCE));
+ public static class PreviewContext extends SandboxContext {
private final InvariantDeviceProfile mIdp;
- private final Map<MainThreadInitializedObject, Object> mObjectMap = new HashMap<>();
private final ConcurrentLinkedQueue<LauncherIconsForPreview> mIconPool =
new ConcurrentLinkedQueue<>();
- private boolean mDestroyed = false;
-
public PreviewContext(Context base, InvariantDeviceProfile idp) {
- super(base);
+ super(base, UserCache.INSTANCE, InstallSessionHelper.INSTANCE,
+ LauncherAppState.INSTANCE, InvariantDeviceProfile.INSTANCE,
+ CustomWidgetManager.INSTANCE, PluginManagerWrapper.INSTANCE);
mIdp = idp;
mObjectMap.put(InvariantDeviceProfile.INSTANCE, idp);
mObjectMap.put(LauncherAppState.INSTANCE,
@@ -146,37 +137,6 @@
}
- @Override
- public Context getApplicationContext() {
- return this;
- }
-
- public void onDestroy() {
- CustomWidgetManager.INSTANCE.get(this).onDestroy();
- LauncherAppState.INSTANCE.get(this).onTerminate();
- mDestroyed = true;
- }
-
- /**
- * Find a cached object from mObjectMap if we have already created one. If not, generate
- * an object using the provider.
- */
- public <T> T getObject(MainThreadInitializedObject<T> mainThreadInitializedObject,
- MainThreadInitializedObject.ObjectProvider<T> provider) {
- if (FeatureFlags.IS_STUDIO_BUILD && mDestroyed) {
- throw new RuntimeException("Context already destroyed");
- }
- if (!mAllowedObjects.contains(mainThreadInitializedObject)) {
- throw new IllegalStateException("Leaking unknown objects");
- }
- if (mObjectMap.containsKey(mainThreadInitializedObject)) {
- return (T) mObjectMap.get(mainThreadInitializedObject);
- }
- T t = provider.get(this);
- mObjectMap.put(mainThreadInitializedObject, t);
- return t;
- }
-
public LauncherIcons newLauncherIcons(Context context, boolean shapeDetection) {
LauncherIconsForPreview launcherIconsForPreview = mIconPool.poll();
if (launcherIconsForPreview != null) {
@@ -364,7 +324,9 @@
}
private void inflateAndAddFolder(FolderInfo info) {
- CellLayout screen = mWorkspaceScreens.get(info.screenId);
+ CellLayout screen = info.container == Favorites.CONTAINER_DESKTOP
+ ? mWorkspaceScreens.get(info.screenId)
+ : mHotseat;
FolderIcon folderIcon = FolderIcon.inflateIcon(R.layout.folder_icon, this, screen,
info);
addInScreenFromBind(folderIcon, info);
@@ -511,8 +473,8 @@
// Add first page QSB
if (FeatureFlags.QSB_ON_FIRST_SCREEN) {
CellLayout firstScreen = mWorkspaceScreens.get(FIRST_SCREEN_ID);
- View qsb = mHomeElementInflater.inflate(
- R.layout.search_container_workspace, firstScreen, false);
+ View qsb = mHomeElementInflater.inflate(R.layout.qsb_preview, firstScreen,
+ false);
CellLayout.LayoutParams lp =
new CellLayout.LayoutParams(0, 0, firstScreen.getCountX(), 1);
lp.canReorder = false;
diff --git a/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java b/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
index f4d1e61..2f3d5d8 100644
--- a/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
+++ b/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
@@ -41,7 +41,6 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.graphics.LauncherPreviewRenderer.PreviewContext;
@@ -149,7 +148,8 @@
inflationContext = new ContextThemeWrapper(context,
Themes.getActivityThemeRes(context, mWallpaperColors.getColorHints()));
} else {
- inflationContext = new ContextThemeWrapper(mContext, R.style.AppTheme);
+ inflationContext = new ContextThemeWrapper(mContext,
+ Themes.getActivityThemeRes(mContext));
}
if (migrated) {
diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java
index cd13cd0..1a468ae 100644
--- a/src/com/android/launcher3/icons/IconCache.java
+++ b/src/com/android/launcher3/icons/IconCache.java
@@ -134,6 +134,9 @@
* Closes the cache DB. This will clear any in-memory cache.
*/
public void close() {
+ // This will clear all pending updates
+ getUpdateHandler();
+
mIconDb.close();
}
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index d959ee2..5ed651f 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -76,6 +76,22 @@
}
public interface EventEnum {
+
+ /**
+ * Tag used to request new UI Event IDs via presubmit analysis.
+ *
+ * <p>Use RESERVE_NEW_UI_EVENT_ID as the constructor parameter for a new {@link EventEnum}
+ * to signal the presubmit analyzer to reserve a new ID for the event. The new ID will be
+ * returned as a Gerrit presubmit finding. Do not submit {@code RESERVE_NEW_UI_EVENT_ID} as
+ * the constructor parameter for any event.
+ *
+ * <pre>
+ * @UiEvent(doc = "Briefly describe the interaction when this event will be logged")
+ * UNIQUE_EVENT_NAME(RESERVE_NEW_UI_EVENT_ID);
+ * </pre>
+ */
+ int RESERVE_NEW_UI_EVENT_ID = Integer.MIN_VALUE; // Negative IDs are ignored by the logger.
+
int getId();
}
@@ -489,8 +505,7 @@
LAUNCHER_TURN_OFF_WORK_APPS_TAP(839),
@UiEvent(doc = "Launcher item drop failed since there was not enough room on the screen.")
- LAUNCHER_ITEM_DROP_FAILED_INSUFFICIENT_SPACE(872)
- ;
+ LAUNCHER_ITEM_DROP_FAILED_INSUFFICIENT_SPACE(872);
// ADD MORE
diff --git a/src/com/android/launcher3/model/DeviceGridState.java b/src/com/android/launcher3/model/DeviceGridState.java
index 761053d..e2df16d 100644
--- a/src/com/android/launcher3/model/DeviceGridState.java
+++ b/src/com/android/launcher3/model/DeviceGridState.java
@@ -25,10 +25,15 @@
import android.content.SharedPreferences;
import android.text.TextUtils;
+import androidx.annotation.IntDef;
+
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Utilities;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
+import com.android.launcher3.util.IntSet;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.Locale;
import java.util.Objects;
@@ -41,13 +46,23 @@
public static final String KEY_HOTSEAT_COUNT = "migration_src_hotseat_count";
public static final String KEY_DEVICE_TYPE = "migration_src_device_type";
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({TYPE_PHONE, TYPE_MULTI_DISPLAY, TYPE_TABLET})
+ public @interface DeviceType{}
public static final int TYPE_PHONE = 0;
public static final int TYPE_MULTI_DISPLAY = 1;
public static final int TYPE_TABLET = 2;
+ private static final IntSet COMPATIBLE_TYPES = IntSet.wrap(TYPE_PHONE, TYPE_MULTI_DISPLAY);
+
+ public static boolean deviceTypeCompatible(@DeviceType int typeA, @DeviceType int typeB) {
+ return typeA == typeB
+ || (COMPATIBLE_TYPES.contains(typeA) && COMPATIBLE_TYPES.contains(typeB));
+ }
+
private final String mGridSizeString;
private final int mNumHotseat;
- private final int mDeviceType;
+ private final @DeviceType int mDeviceType;
public DeviceGridState(InvariantDeviceProfile idp) {
mGridSizeString = String.format(Locale.ENGLISH, "%d,%d", idp.numColumns, idp.numRows);
@@ -69,7 +84,7 @@
/**
* Returns the device type for the grid
*/
- public int getDeviceType() {
+ public @DeviceType int getDeviceType() {
return mDeviceType;
}
@@ -109,7 +124,7 @@
if (o == null || getClass() != o.getClass()) return false;
DeviceGridState that = (DeviceGridState) o;
return mNumHotseat == that.mNumHotseat
- && mDeviceType == that.mDeviceType
+ && deviceTypeCompatible(mDeviceType, that.mDeviceType)
&& Objects.equals(mGridSizeString, that.mGridSizeString);
}
}
diff --git a/src/com/android/launcher3/model/ModelDelegate.java b/src/com/android/launcher3/model/ModelDelegate.java
index 13ec1ec..765141a 100644
--- a/src/com/android/launcher3/model/ModelDelegate.java
+++ b/src/com/android/launcher3/model/ModelDelegate.java
@@ -40,19 +40,21 @@
* Creates and initializes a new instance of the delegate
*/
public static ModelDelegate newInstance(
- Context context, LauncherAppState app, AllAppsList appsList, BgDataModel dataModel) {
+ Context context, LauncherAppState app, AllAppsList appsList, BgDataModel dataModel,
+ boolean isPrimaryInstance) {
ModelDelegate delegate = Overrides.getObject(
ModelDelegate.class, context, R.string.model_delegate_class);
-
delegate.mApp = app;
delegate.mAppsList = appsList;
delegate.mDataModel = dataModel;
+ delegate.mIsPrimaryInstance = isPrimaryInstance;
return delegate;
}
protected LauncherAppState mApp;
protected AllAppsList mAppsList;
protected BgDataModel mDataModel;
+ protected boolean mIsPrimaryInstance;
public ModelDelegate() { }
diff --git a/src/com/android/launcher3/model/data/ItemInfo.java b/src/com/android/launcher3/model/data/ItemInfo.java
index 7091d2b..4fdc412 100644
--- a/src/com/android/launcher3/model/data/ItemInfo.java
+++ b/src/com/android/launcher3/model/data/ItemInfo.java
@@ -232,9 +232,9 @@
* Write the fields of this item to the DB
*/
public void onAddToDatabase(ContentWriter writer) {
- if (screenId == Workspace.EXTRA_EMPTY_SCREEN_ID) {
+ if (Workspace.EXTRA_EMPTY_SCREEN_IDS.contains(screenId)) {
// We should never persist an item on the extra empty screen.
- throw new RuntimeException("Screen id should not be EXTRA_EMPTY_SCREEN_ID");
+ throw new RuntimeException("Screen id should not be extra empty screen: " + screenId);
}
writeToValues(writer);
diff --git a/src/com/android/launcher3/notification/NotificationContainer.java b/src/com/android/launcher3/notification/NotificationContainer.java
new file mode 100644
index 0000000..9eb05cd
--- /dev/null
+++ b/src/com/android/launcher3/notification/NotificationContainer.java
@@ -0,0 +1,283 @@
+/*
+ * 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.notification;
+
+import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
+import static com.android.launcher3.touch.SingleAxisSwipeDetector.HORIZONTAL;
+
+import android.animation.Animator;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.util.FloatProperty;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import com.android.launcher3.R;
+import com.android.launcher3.anim.AnimationSuccessListener;
+import com.android.launcher3.popup.PopupContainerWithArrow;
+import com.android.launcher3.touch.BaseSwipeDetector;
+import com.android.launcher3.touch.OverScroll;
+import com.android.launcher3.touch.SingleAxisSwipeDetector;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Class to manage the notification UI in a {@link PopupContainerWithArrow}.
+ *
+ * - Has two {@link NotificationMainView} that represent the top two notifications
+ * - Handles dismissing a notification
+ */
+public class NotificationContainer extends FrameLayout implements SingleAxisSwipeDetector.Listener {
+
+ private static final FloatProperty<NotificationContainer> DRAG_TRANSLATION_X =
+ new FloatProperty<NotificationContainer>("notificationProgress") {
+ @Override
+ public void setValue(NotificationContainer view, float transX) {
+ view.setDragTranslationX(transX);
+ }
+
+ @Override
+ public Float get(NotificationContainer view) {
+ return view.mDragTranslationX;
+ }
+ };
+
+ private static final Rect sTempRect = new Rect();
+
+ private final SingleAxisSwipeDetector mSwipeDetector;
+ private final List<NotificationInfo> mNotificationInfos = new ArrayList<>();
+ private boolean mIgnoreTouch = false;
+
+ private final ObjectAnimator mContentTranslateAnimator;
+ private float mDragTranslationX = 0;
+
+ private final NotificationMainView mPrimaryView;
+ private final NotificationMainView mSecondaryView;
+ private PopupContainerWithArrow mPopupContainer;
+
+ public NotificationContainer(Context context) {
+ this(context, null, 0);
+ }
+
+ public NotificationContainer(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public NotificationContainer(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mSwipeDetector = new SingleAxisSwipeDetector(getContext(), this, HORIZONTAL);
+ mSwipeDetector.setDetectableScrollConditions(SingleAxisSwipeDetector.DIRECTION_BOTH, false);
+ mContentTranslateAnimator = ObjectAnimator.ofFloat(this, DRAG_TRANSLATION_X, 0);
+
+ mPrimaryView = (NotificationMainView) View.inflate(getContext(),
+ R.layout.notification_content, null);
+ mSecondaryView = (NotificationMainView) View.inflate(getContext(),
+ R.layout.notification_content, null);
+ mSecondaryView.setAlpha(0);
+
+ addView(mSecondaryView);
+ addView(mPrimaryView);
+
+ }
+
+ public void setPopupView(PopupContainerWithArrow popupView) {
+ mPopupContainer = popupView;
+ }
+
+ /**
+ * Returns true if we should intercept the swipe.
+ */
+ public boolean onInterceptSwipeEvent(MotionEvent ev) {
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+ sTempRect.set(getLeft(), getTop(), getRight(), getBottom());
+ mIgnoreTouch = !sTempRect.contains((int) ev.getX(), (int) ev.getY());
+ if (!mIgnoreTouch) {
+ mPopupContainer.getParent().requestDisallowInterceptTouchEvent(true);
+ }
+ }
+ if (mIgnoreTouch) {
+ return false;
+ }
+ if (mPrimaryView.getNotificationInfo() == null) {
+ // The notification hasn't been populated yet.
+ return false;
+ }
+
+ mSwipeDetector.onTouchEvent(ev);
+ return mSwipeDetector.isDraggingOrSettling();
+ }
+
+ /**
+ * Returns true when we should handle the swipe.
+ */
+ public boolean onSwipeEvent(MotionEvent ev) {
+ if (mIgnoreTouch) {
+ return false;
+ }
+ if (mPrimaryView.getNotificationInfo() == null) {
+ // The notification hasn't been populated yet.
+ return false;
+ }
+ return mSwipeDetector.onTouchEvent(ev);
+ }
+
+ /**
+ * Applies the list of @param notificationInfos to this container.
+ */
+ public void applyNotificationInfos(final List<NotificationInfo> notificationInfos) {
+ mNotificationInfos.clear();
+ if (notificationInfos.isEmpty()) {
+ mPrimaryView.applyNotificationInfo(null);
+ mSecondaryView.applyNotificationInfo(null);
+ return;
+ }
+ mNotificationInfos.addAll(notificationInfos);
+
+ NotificationInfo mainNotification = notificationInfos.get(0);
+ mPrimaryView.applyNotificationInfo(mainNotification);
+ mSecondaryView.applyNotificationInfo(notificationInfos.size() > 1
+ ? notificationInfos.get(1)
+ : null);
+ }
+
+ /**
+ * Trims the notifications.
+ * @param notificationKeys List of all valid notification keys.
+ */
+ public void trimNotifications(final List<String> notificationKeys) {
+ Iterator<NotificationInfo> iterator = mNotificationInfos.iterator();
+ while (iterator.hasNext()) {
+ if (!notificationKeys.contains(iterator.next().notificationKey)) {
+ iterator.remove();
+ }
+ }
+
+ NotificationInfo primaryInfo = mNotificationInfos.size() > 0
+ ? mNotificationInfos.get(0)
+ : null;
+ NotificationInfo secondaryInfo = mNotificationInfos.size() > 1
+ ? mNotificationInfos.get(1)
+ : null;
+
+ mPrimaryView.applyNotificationInfo(primaryInfo);
+ mSecondaryView.applyNotificationInfo(secondaryInfo);
+
+ mPrimaryView.onPrimaryDrag(0);
+ mSecondaryView.onSecondaryDrag(0);
+ }
+
+ private void setDragTranslationX(float translationX) {
+ mDragTranslationX = translationX;
+
+ float progress = translationX / getWidth();
+ mPrimaryView.onPrimaryDrag(progress);
+ if (mSecondaryView.getNotificationInfo() == null) {
+ mSecondaryView.setAlpha(0f);
+ } else {
+ mSecondaryView.onSecondaryDrag(progress);
+ }
+ }
+
+ // SingleAxisSwipeDetector.Listener's
+ @Override
+ public void onDragStart(boolean start, float startDisplacement) {
+ mPopupContainer.showArrow(false);
+ }
+
+ @Override
+ public boolean onDrag(float displacement) {
+ if (!mPrimaryView.canChildBeDismissed()) {
+ displacement = OverScroll.dampedScroll(displacement, getWidth());
+ }
+
+ float progress = displacement / getWidth();
+ mPrimaryView.onPrimaryDrag(progress);
+ if (mSecondaryView.getNotificationInfo() == null) {
+ mSecondaryView.setAlpha(0f);
+ } else {
+ mSecondaryView.onSecondaryDrag(progress);
+ }
+ mContentTranslateAnimator.cancel();
+ return true;
+ }
+
+ @Override
+ public void onDragEnd(float velocity) {
+ final boolean willExit;
+ final float endTranslation;
+ final float startTranslation = mPrimaryView.getTranslationX();
+ final float width = getWidth();
+
+ if (!mPrimaryView.canChildBeDismissed()) {
+ willExit = false;
+ endTranslation = 0;
+ } else if (mSwipeDetector.isFling(velocity)) {
+ willExit = true;
+ endTranslation = velocity < 0 ? -width : width;
+ } else if (Math.abs(startTranslation) > width / 2f) {
+ willExit = true;
+ endTranslation = (startTranslation < 0 ? -width : width);
+ } else {
+ willExit = false;
+ endTranslation = 0;
+ }
+
+ long duration = BaseSwipeDetector.calculateDuration(velocity,
+ (endTranslation - startTranslation) / width);
+
+ mContentTranslateAnimator.removeAllListeners();
+ mContentTranslateAnimator.setDuration(duration)
+ .setInterpolator(scrollInterpolatorForVelocity(velocity));
+ mContentTranslateAnimator.setFloatValues(startTranslation, endTranslation);
+
+ NotificationMainView current = mPrimaryView;
+ mContentTranslateAnimator.addListener(new AnimationSuccessListener() {
+ @Override
+ public void onAnimationSuccess(Animator animator) {
+ mSwipeDetector.finishedScrolling();
+ if (willExit) {
+ current.onChildDismissed();
+ }
+ mPopupContainer.showArrow(true);
+ }
+ });
+ mContentTranslateAnimator.start();
+ }
+
+ /**
+ * Animates the background color to a new color.
+ * @param color The color to change to.
+ * @param animatorSetOut The AnimatorSet where we add the color animator to.
+ */
+ public void updateBackgroundColor(int color, AnimatorSet animatorSetOut) {
+ mPrimaryView.updateBackgroundColor(color, animatorSetOut);
+ mSecondaryView.updateBackgroundColor(color, animatorSetOut);
+ }
+
+ /**
+ * Updates the header with a new @param notificationCount.
+ */
+ public void updateHeader(int notificationCount) {
+ mPrimaryView.updateHeader(notificationCount);
+ mSecondaryView.updateHeader(notificationCount - 1);
+ }
+}
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
deleted file mode 100644
index af943a6..0000000
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ /dev/null
@@ -1,179 +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.launcher3.notification;
-
-import android.animation.AnimatorSet;
-import android.content.Context;
-import android.graphics.Outline;
-import android.graphics.Rect;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.MarginLayoutParams;
-import android.view.ViewOutlineProvider;
-import android.widget.TextView;
-
-import com.android.launcher3.R;
-import com.android.launcher3.popup.PopupContainerWithArrow;
-import com.android.launcher3.util.Themes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Utility class to manage notification UI
- */
-public class NotificationItemView {
-
- private static final Rect sTempRect = new Rect();
-
- private final Context mContext;
- private final PopupContainerWithArrow mPopupContainer;
- private final ViewGroup mRootView;
-
- private final TextView mHeaderCount;
- private final NotificationMainView mMainView;
-
- private final View mHeader;
-
- private View mGutter;
-
- private boolean mIgnoreTouch = false;
- private List<NotificationInfo> mNotificationInfos = new ArrayList<>();
-
- public NotificationItemView(PopupContainerWithArrow container, ViewGroup rootView) {
- mPopupContainer = container;
- mRootView = rootView;
- mContext = container.getContext();
-
- mHeaderCount = container.findViewById(R.id.notification_count);
- mMainView = container.findViewById(R.id.main_view);
-
- mHeader = container.findViewById(R.id.header);
-
- float radius = Themes.getDialogCornerRadius(mContext);
- rootView.setClipToOutline(true);
- rootView.setOutlineProvider(new ViewOutlineProvider() {
- @Override
- public void getOutline(View view, Outline outline) {
- outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), radius);
- }
- });
- }
-
- /**
- * Animates the background color to a new color.
- * @param color The color to change to.
- * @param animatorSetOut The AnimatorSet where we add the color animator to.
- */
- public void updateBackgroundColor(int color, AnimatorSet animatorSetOut) {
- mMainView.updateBackgroundColor(color, animatorSetOut);
- }
-
- public void addGutter() {
- if (mGutter == null) {
- mGutter = mPopupContainer.inflateAndAdd(R.layout.notification_gutter, mRootView);
- }
- }
-
- public void inverseGutterMargin() {
- MarginLayoutParams lp = (MarginLayoutParams) mGutter.getLayoutParams();
- int top = lp.topMargin;
- lp.topMargin = lp.bottomMargin;
- lp.bottomMargin = top;
- }
-
- public void removeAllViews() {
- mRootView.removeView(mMainView);
- mRootView.removeView(mHeader);
- if (mGutter != null) {
- mRootView.removeView(mGutter);
- }
- }
-
- /**
- * Updates the header text.
- * @param notificationCount The number of notifications.
- */
- public void updateHeader(int notificationCount) {
- final String text;
- final int visibility;
- if (notificationCount <= 1) {
- text = "";
- visibility = View.INVISIBLE;
- } else {
- text = String.valueOf(notificationCount);
- visibility = View.VISIBLE;
-
- }
- mHeaderCount.setText(text);
- mHeaderCount.setVisibility(visibility);
- }
-
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (ev.getAction() == MotionEvent.ACTION_DOWN) {
- sTempRect.set(mRootView.getLeft(), mRootView.getTop(),
- mRootView.getRight(), mRootView.getBottom());
- mIgnoreTouch = !sTempRect.contains((int) ev.getX(), (int) ev.getY());
- if (!mIgnoreTouch) {
- mPopupContainer.getParent().requestDisallowInterceptTouchEvent(true);
- }
- }
- if (mIgnoreTouch) {
- return false;
- }
- if (mMainView.getNotificationInfo() == null) {
- // The notification hasn't been populated yet.
- return false;
- }
-
- return false;
- }
-
- public void applyNotificationInfos(final List<NotificationInfo> notificationInfos) {
- mNotificationInfos.clear();
- if (notificationInfos.isEmpty()) {
- return;
- }
- mNotificationInfos.addAll(notificationInfos);
-
- NotificationInfo mainNotification = notificationInfos.get(0);
- mMainView.applyNotificationInfo(mainNotification, false);
- }
-
- public void trimNotifications(final List<String> notificationKeys) {
- NotificationInfo currentMainNotificationInfo = mMainView.getNotificationInfo();
- boolean shouldUpdateMainNotification = !notificationKeys.contains(
- currentMainNotificationInfo.notificationKey);
-
- if (shouldUpdateMainNotification) {
- int size = notificationKeys.size();
- NotificationInfo nextNotification = null;
- // We get the latest notification by finding the notification after the one that was
- // just dismissed.
- for (int i = 0; i < size; ++i) {
- if (currentMainNotificationInfo == mNotificationInfos.get(i) && i + 1 < size) {
- nextNotification = mNotificationInfos.get(i + 1);
- break;
- }
- }
- if (nextNotification != null) {
- mMainView.applyNotificationInfo(nextNotification, true);
- }
- }
- }
-}
diff --git a/src/com/android/launcher3/notification/NotificationMainView.java b/src/com/android/launcher3/notification/NotificationMainView.java
index b8aa824..f9ff8a6 100644
--- a/src/com/android/launcher3/notification/NotificationMainView.java
+++ b/src/com/android/launcher3/notification/NotificationMainView.java
@@ -16,62 +16,70 @@
package com.android.launcher3.notification;
+import static com.android.launcher3.Utilities.mapToRange;
+import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DISMISSED;
import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
-import android.graphics.Color;
-import android.graphics.drawable.ColorDrawable;
+import android.graphics.Outline;
+import android.graphics.Rect;
+import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
-import android.util.FloatProperty;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.FrameLayout;
+import android.view.ViewOutlineProvider;
+import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.touch.SingleAxisSwipeDetector;
+import com.android.launcher3.util.Themes;
/**
* A {@link android.widget.FrameLayout} that contains a single notification,
* e.g. icon + title + text.
*/
@TargetApi(Build.VERSION_CODES.N)
-public class NotificationMainView extends FrameLayout {
-
- private static final FloatProperty<NotificationMainView> CONTENT_TRANSLATION =
- new FloatProperty<NotificationMainView>("contentTranslation") {
- @Override
- public void setValue(NotificationMainView view, float v) {
- view.setContentTranslation(v);
- }
-
- @Override
- public Float get(NotificationMainView view) {
- return view.mTextAndBackground.getTranslationX();
- }
- };
+public class NotificationMainView extends LinearLayout {
// This is used only to track the notification view, so that it can be properly logged.
public static final ItemInfo NOTIFICATION_ITEM_INFO = new ItemInfo();
+ // Value when the primary notification main view will be gone (zero alpha).
+ private static final float PRIMARY_GONE_PROGRESS = 0.7f;
+ private static final float PRIMARY_MIN_PROGRESS = 0.40f;
+ private static final float PRIMARY_MAX_PROGRESS = 0.60f;
+ private static final float SECONDARY_MIN_PROGRESS = 0.30f;
+ private static final float SECONDARY_MAX_PROGRESS = 0.50f;
+ private static final float SECONDARY_CONTENT_MAX_PROGRESS = 0.6f;
+
private NotificationInfo mNotificationInfo;
- private ViewGroup mTextAndBackground;
private int mBackgroundColor;
private TextView mTitleView;
private TextView mTextView;
private View mIconView;
- private SingleAxisSwipeDetector mSwipeDetector;
+ private View mHeader;
+ private View mMainView;
- private final ColorDrawable mColorDrawable;
+ private TextView mHeaderCount;
+ private final Rect mOutline = new Rect();
+
+ // Space between notifications during swipe
+ private final int mNotificationSpace;
+ private final int mMaxTransX;
+ private final int mMaxElevation;
+
+ private final GradientDrawable mBackground;
public NotificationMainView(Context context) {
this(context, null, 0);
@@ -82,28 +90,77 @@
}
public NotificationMainView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
+ this(context, attrs, defStyle, 0);
+ }
- mColorDrawable = new ColorDrawable(Color.TRANSPARENT);
+ public NotificationMainView(Context context, AttributeSet attrs, int defStyle, int defStylRes) {
+ super(context, attrs, defStyle, defStylRes);
+
+ float outlineRadius = Themes.getDialogCornerRadius(context);
+
+ mBackground = new GradientDrawable();
+ mBackground.setColor(Themes.getAttrColor(context, R.attr.popupColorPrimary));
+ mBackground.setCornerRadius(outlineRadius);
+ setBackground(mBackground);
+
+ mMaxElevation = getResources().getDimensionPixelSize(R.dimen.deep_shortcuts_elevation);
+ setElevation(mMaxElevation);
+
+ mMaxTransX = getResources().getDimensionPixelSize(R.dimen.notification_max_trans);
+ mNotificationSpace = getResources().getDimensionPixelSize(R.dimen.notification_space);
+
+ setClipToOutline(true);
+ setOutlineProvider(new ViewOutlineProvider() {
+ @Override
+ public void getOutline(View view, Outline outline) {
+ outline.setRoundRect(mOutline, outlineRadius);
+ }
+ });
+ }
+
+ /**
+ * Updates the header text.
+ * @param notificationCount The number of notifications.
+ */
+ public void updateHeader(int notificationCount) {
+ final String text;
+ final int visibility;
+ if (notificationCount <= 1) {
+ text = "";
+ visibility = View.INVISIBLE;
+ } else {
+ text = String.valueOf(notificationCount);
+ visibility = View.VISIBLE;
+
+ }
+ mHeaderCount.setText(text);
+ mHeaderCount.setVisibility(visibility);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mTextAndBackground = findViewById(R.id.text_and_background);
- mTitleView = mTextAndBackground.findViewById(R.id.title);
- mTextView = mTextAndBackground.findViewById(R.id.text);
+ ViewGroup textAndBackground = findViewById(R.id.text_and_background);
+ mTitleView = textAndBackground.findViewById(R.id.title);
+ mTextView = textAndBackground.findViewById(R.id.text);
mIconView = findViewById(R.id.popup_item_icon);
+ mHeaderCount = findViewById(R.id.notification_count);
- ColorDrawable colorBackground = (ColorDrawable) mTextAndBackground.getBackground();
- updateBackgroundColor(colorBackground.getColor());
+ mHeader = findViewById(R.id.header);
+ mMainView = findViewById(R.id.main_view);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ mOutline.set(0, 0, getWidth(), getHeight());
+ invalidateOutline();
}
private void updateBackgroundColor(int color) {
mBackgroundColor = color;
- mColorDrawable.setColor(color);
- mTextAndBackground.setBackground(mColorDrawable);
+ mBackground.setColor(color);
if (mNotificationInfo != null) {
mIconView.setBackground(mNotificationInfo.getIconForBackground(getContext(),
mBackgroundColor));
@@ -128,8 +185,11 @@
/**
* Sets the content of this view, animating it after a new icon shifts up if necessary.
*/
- public void applyNotificationInfo(NotificationInfo mainNotification, boolean animate) {
- mNotificationInfo = mainNotification;
+ public void applyNotificationInfo(NotificationInfo notificationInfo) {
+ mNotificationInfo = notificationInfo;
+ if (notificationInfo == null) {
+ return;
+ }
NotificationListener listener = NotificationListener.getInstanceIfConnected();
if (listener != null) {
listener.setNotificationsShown(new String[] {mNotificationInfo.notificationKey});
@@ -149,25 +209,112 @@
if (mNotificationInfo.intent != null) {
setOnClickListener(mNotificationInfo);
}
- setContentTranslation(0);
+
// Add a stub ItemInfo so that logging populates the correct container and item types
// instead of DEFAULT_CONTAINERTYPE and DEFAULT_ITEMTYPE, respectively.
setTag(NOTIFICATION_ITEM_INFO);
- if (animate) {
- ObjectAnimator.ofFloat(mTextAndBackground, ALPHA, 0, 1).setDuration(150).start();
+ }
+
+ /**
+ * Sets the alpha of only the child views.
+ */
+ public void setContentAlpha(float alpha) {
+ mHeader.setAlpha(alpha);
+ mMainView.setAlpha(alpha);
+ }
+
+ /**
+ * Sets the translation of only the child views.
+ */
+ public void setContentTranslationX(float transX) {
+ mHeader.setTranslationX(transX);
+ mMainView.setTranslationX(transX);
+ }
+
+ /**
+ * Updates the alpha, content alpha, and elevation of this view.
+ *
+ * @param progress Range from [0, 1] or [-1, 0]
+ * When 0: Full alpha
+ * When 1/-1: zero alpha
+ */
+ public void onPrimaryDrag(float progress) {
+ float absProgress = Math.abs(progress);
+ final int width = getWidth();
+
+ float min = PRIMARY_MIN_PROGRESS;
+ float max = PRIMARY_MAX_PROGRESS;
+
+ if (absProgress < min) {
+ setAlpha(1f);
+ setContentAlpha(1);
+ setElevation(mMaxElevation);
+ } else if (absProgress < max) {
+ setAlpha(1f);
+ setContentAlpha(mapToRange(absProgress, min, max, 1f, 0f, LINEAR));
+ setElevation(Utilities.mapToRange(absProgress, min, max, mMaxElevation, 0, LINEAR));
+ } else {
+ setAlpha(mapToRange(absProgress, max, PRIMARY_GONE_PROGRESS, 1f, 0f, LINEAR));
+ setContentAlpha(0f);
+ setElevation(0f);
}
+
+ setTranslationX(width * progress);
}
- public void setContentTranslation(float translation) {
- mTextAndBackground.setTranslationX(translation);
- mIconView.setTranslationX(translation);
+ /**
+ * Updates the alpha, content alpha, elevation, and clipping of this view.
+ * @param progress Range from [0, 1] or [-1, 0]
+ * When 0: Smallest clipping, zero alpha
+ * When 1/-1: Full clip, full alpha
+ */
+ public void onSecondaryDrag(float progress) {
+ final float absProgress = Math.abs(progress);
+
+ float min = SECONDARY_MIN_PROGRESS;
+ float max = SECONDARY_MAX_PROGRESS;
+ float contentMax = SECONDARY_CONTENT_MAX_PROGRESS;
+
+ if (absProgress < min) {
+ setAlpha(0f);
+ setContentAlpha(0);
+ setElevation(0f);
+ } else if (absProgress < max) {
+ setAlpha(mapToRange(absProgress, min, max, 0, 1f, LINEAR));
+ setContentAlpha(0f);
+ setElevation(0f);
+ } else {
+ setAlpha(1f);
+ setContentAlpha(absProgress > contentMax
+ ? 1f
+ : mapToRange(absProgress, max, contentMax, 0, 1f, LINEAR));
+ setElevation(Utilities.mapToRange(absProgress, max, 1, 0, mMaxElevation, LINEAR));
+ }
+
+ final int width = getWidth();
+ int crop = (int) (width * absProgress);
+ int space = (int) (absProgress > PRIMARY_GONE_PROGRESS
+ ? mapToRange(absProgress, PRIMARY_GONE_PROGRESS, 1f, mNotificationSpace, 0, LINEAR)
+ : mNotificationSpace);
+ if (progress < 0) {
+ mOutline.left = Math.max(0, getWidth() - crop + space);
+ mOutline.right = getWidth();
+ } else {
+ mOutline.right = Math.min(getWidth(), crop - space);
+ mOutline.left = 0;
+ }
+
+ float contentTransX = mMaxTransX * (1f - absProgress);
+ setContentTranslationX(progress < 0
+ ? contentTransX
+ : -contentTransX);
+ invalidateOutline();
}
- public NotificationInfo getNotificationInfo() {
+ public @Nullable NotificationInfo getNotificationInfo() {
return mNotificationInfo;
}
-
public boolean canChildBeDismissed() {
return mNotificationInfo != null && mNotificationInfo.dismissable;
}
diff --git a/src/com/android/launcher3/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java
index ab35bd6..4b86f65 100644
--- a/src/com/android/launcher3/pm/InstallSessionHelper.java
+++ b/src/com/android/launcher3/pm/InstallSessionHelper.java
@@ -17,7 +17,6 @@
package com.android.launcher3.pm;
import static com.android.launcher3.Utilities.getPrefs;
-import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -25,7 +24,6 @@
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageManager;
-import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
import android.text.TextUtils;
@@ -238,24 +236,12 @@
}
public InstallSessionTracker registerInstallTracker(InstallSessionTracker.Callback callback) {
- InstallSessionTracker tracker = new InstallSessionTracker(this, callback);
-
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
- mInstaller.registerSessionCallback(tracker, MODEL_EXECUTOR.getHandler());
- } else {
- mLauncherApps.registerPackageInstallerSessionCallback(MODEL_EXECUTOR, tracker);
- }
+ InstallSessionTracker tracker = new InstallSessionTracker(
+ this, callback, mInstaller, mLauncherApps);
+ tracker.register();
return tracker;
}
- void unregister(InstallSessionTracker tracker) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
- mInstaller.unregisterSessionCallback(tracker);
- } else {
- mLauncherApps.unregisterPackageInstallerSessionCallback(tracker);
- }
- }
-
public static UserHandle getUserHandle(SessionInfo info) {
return Utilities.ATLEAST_Q ? info.getUser() : Process.myUserHandle();
}
diff --git a/src/com/android/launcher3/pm/InstallSessionTracker.java b/src/com/android/launcher3/pm/InstallSessionTracker.java
index b0b907a..e1b3c1a 100644
--- a/src/com/android/launcher3/pm/InstallSessionTracker.java
+++ b/src/com/android/launcher3/pm/InstallSessionTracker.java
@@ -18,9 +18,12 @@
import static com.android.launcher3.pm.InstallSessionHelper.getUserHandle;
import static com.android.launcher3.pm.PackageInstallInfo.STATUS_FAILED;
import static com.android.launcher3.pm.PackageInstallInfo.STATUS_INSTALLED;
+import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import android.content.pm.LauncherApps;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
+import android.os.Build;
import android.os.UserHandle;
import android.util.SparseArray;
@@ -28,35 +31,53 @@
import com.android.launcher3.util.PackageUserKey;
+import java.lang.ref.WeakReference;
+
@WorkerThread
public class InstallSessionTracker extends PackageInstaller.SessionCallback {
// Lazily initialized
private SparseArray<PackageUserKey> mActiveSessions = null;
- private final InstallSessionHelper mInstallerCompat;
- private final Callback mCallback;
+ private final WeakReference<InstallSessionHelper> mWeakHelper;
+ private final WeakReference<Callback> mWeakCallback;
+ private final PackageInstaller mInstaller;
+ private final LauncherApps mLauncherApps;
- InstallSessionTracker(InstallSessionHelper installerCompat, Callback callback) {
- mInstallerCompat = installerCompat;
- mCallback = callback;
+
+ InstallSessionTracker(InstallSessionHelper installerCompat, Callback callback,
+ PackageInstaller installer, LauncherApps launcherApps) {
+ mWeakHelper = new WeakReference<>(installerCompat);
+ mWeakCallback = new WeakReference<>(callback);
+ mInstaller = installer;
+ mLauncherApps = launcherApps;
}
@Override
public void onCreated(int sessionId) {
- SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId);
+ InstallSessionHelper helper = mWeakHelper.get();
+ Callback callback = mWeakCallback.get();
+ if (callback == null || helper == null) {
+ return;
+ }
+ SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback);
if (sessionInfo != null) {
- mCallback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo));
+ callback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo));
}
- mInstallerCompat.tryQueuePromiseAppIcon(sessionInfo);
+ helper.tryQueuePromiseAppIcon(sessionInfo);
}
@Override
public void onFinished(int sessionId, boolean success) {
+ InstallSessionHelper helper = mWeakHelper.get();
+ Callback callback = mWeakCallback.get();
+ if (callback == null || helper == null) {
+ return;
+ }
// For a finished session, we can't get the session info. So use the
// packageName from our local cache.
- SparseArray<PackageUserKey> activeSessions = getActiveSessionMap();
+ SparseArray<PackageUserKey> activeSessions = getActiveSessionMap(helper);
PackageUserKey key = activeSessions.get(sessionId);
activeSessions.remove(sessionId);
@@ -65,21 +86,26 @@
PackageInstallInfo info = PackageInstallInfo.fromState(
success ? STATUS_INSTALLED : STATUS_FAILED,
packageName, key.mUser);
- mCallback.onPackageStateChanged(info);
+ callback.onPackageStateChanged(info);
- if (!success && mInstallerCompat.promiseIconAddedForId(sessionId)) {
- mCallback.onSessionFailure(packageName, key.mUser);
+ if (!success && helper.promiseIconAddedForId(sessionId)) {
+ callback.onSessionFailure(packageName, key.mUser);
// If it is successful, the id is removed in the the package added flow.
- mInstallerCompat.removePromiseIconId(sessionId);
+ helper.removePromiseIconId(sessionId);
}
}
}
@Override
public void onProgressChanged(int sessionId, float progress) {
- SessionInfo session = mInstallerCompat.getVerifiedSessionInfo(sessionId);
+ InstallSessionHelper helper = mWeakHelper.get();
+ Callback callback = mWeakCallback.get();
+ if (callback == null || helper == null) {
+ return;
+ }
+ SessionInfo session = helper.getVerifiedSessionInfo(sessionId);
if (session != null && session.getAppPackageName() != null) {
- mCallback.onPackageStateChanged(PackageInstallInfo.fromInstallingState(session));
+ callback.onPackageStateChanged(PackageInstallInfo.fromInstallingState(session));
}
}
@@ -88,35 +114,53 @@
@Override
public void onBadgingChanged(int sessionId) {
- SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId);
+ InstallSessionHelper helper = mWeakHelper.get();
+ Callback callback = mWeakCallback.get();
+ if (callback == null || helper == null) {
+ return;
+ }
+ SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback);
if (sessionInfo != null) {
- mInstallerCompat.tryQueuePromiseAppIcon(sessionInfo);
+ helper.tryQueuePromiseAppIcon(sessionInfo);
}
}
- private SessionInfo pushSessionDisplayToLauncher(int sessionId) {
- SessionInfo session = mInstallerCompat.getVerifiedSessionInfo(sessionId);
+ private SessionInfo pushSessionDisplayToLauncher(
+ int sessionId, InstallSessionHelper helper, Callback callback) {
+ SessionInfo session = helper.getVerifiedSessionInfo(sessionId);
if (session != null && session.getAppPackageName() != null) {
PackageUserKey key =
new PackageUserKey(session.getAppPackageName(), getUserHandle(session));
- getActiveSessionMap().put(session.getSessionId(), key);
- mCallback.onUpdateSessionDisplay(key, session);
+ getActiveSessionMap(helper).put(session.getSessionId(), key);
+ callback.onUpdateSessionDisplay(key, session);
return session;
}
return null;
}
- private SparseArray<PackageUserKey> getActiveSessionMap() {
+ private SparseArray<PackageUserKey> getActiveSessionMap(InstallSessionHelper helper) {
if (mActiveSessions == null) {
mActiveSessions = new SparseArray<>();
- mInstallerCompat.getActiveSessions().forEach(
+ helper.getActiveSessions().forEach(
(key, si) -> mActiveSessions.put(si.getSessionId(), key));
}
return mActiveSessions;
}
+ void register() {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
+ mInstaller.registerSessionCallback(this, MODEL_EXECUTOR.getHandler());
+ } else {
+ mLauncherApps.registerPackageInstallerSessionCallback(MODEL_EXECUTOR, this);
+ }
+ }
+
public void unregister() {
- mInstallerCompat.unregister(this);
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
+ mInstaller.unregisterSessionCallback(this);
+ } else {
+ mLauncherApps.unregisterPackageInstallerSessionCallback(this);
+ }
}
public interface Callback {
diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java
index 3bb49f5..112a24e 100644
--- a/src/com/android/launcher3/popup/ArrowPopup.java
+++ b/src/com/android/launcher3/popup/ArrowPopup.java
@@ -467,6 +467,13 @@
return getMeasuredWidth() - mArrowOffsetHorizontal - mArrowWidth;
}
+ /**
+ * @param show If true, shows arrow (when applicable), otherwise hides arrow.
+ */
+ public void showArrow(boolean show) {
+ mArrow.setVisibility(show && shouldAddArrow() ? VISIBLE : INVISIBLE);
+ }
+
private void addArrow() {
getPopupContainer().addView(mArrow);
mArrow.setX(getX() + getArrowLeft());
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 18f263a..bc3419a 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -58,8 +58,8 @@
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.notification.NotificationContainer;
import com.android.launcher3.notification.NotificationInfo;
-import com.android.launcher3.notification.NotificationItemView;
import com.android.launcher3.notification.NotificationKeyData;
import com.android.launcher3.popup.PopupDataProvider.PopupDataChangeListener;
import com.android.launcher3.shortcuts.DeepShortcutView;
@@ -92,9 +92,8 @@
private final int mStartDragThreshold;
private BubbleTextView mOriginalIcon;
- private NotificationItemView mNotificationItemView;
private int mNumNotifications;
- private ViewGroup mNotificationContainer;
+ private NotificationContainer mNotificationContainer;
private ViewGroup mWidgetContainer;
@@ -128,8 +127,8 @@
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
mInterceptTouchDown.set(ev.getX(), ev.getY());
}
- if (mNotificationItemView != null
- && mNotificationItemView.onInterceptTouchEvent(ev)) {
+ if (mNotificationContainer != null
+ && mNotificationContainer.onInterceptSwipeEvent(ev)) {
return true;
}
// Stop sending touch events to deep shortcut views if user moved beyond touch slop.
@@ -138,6 +137,14 @@
}
@Override
+ public boolean onTouchEvent(MotionEvent ev) {
+ if (mNotificationContainer != null) {
+ return mNotificationContainer.onSwipeEvent(ev) || super.onTouchEvent(ev);
+ }
+ return super.onTouchEvent(ev);
+ }
+
+ @Override
protected boolean isOfType(int type) {
return (type & TYPE_ACTION_POPUP) != 0;
}
@@ -172,8 +179,8 @@
@Override
protected void setChildColor(View view, int color, AnimatorSet animatorSetOut) {
super.setChildColor(view, color, animatorSetOut);
- if (view.getId() == R.id.notification_container && mNotificationItemView != null) {
- mNotificationItemView.updateBackgroundColor(color, animatorSetOut);
+ if (view.getId() == R.id.notification_container && mNotificationContainer != null) {
+ mNotificationContainer.updateBackgroundColor(color, animatorSetOut);
}
}
@@ -232,13 +239,6 @@
mNotificationContainer);
}
- @Override
- protected void onInflationComplete(boolean isReversed) {
- if (isReversed && mNotificationItemView != null) {
- mNotificationItemView.inverseGutterMargin();
- }
- }
-
@TargetApi(Build.VERSION_CODES.P)
public void populateAndShow(final BubbleTextView originalIcon, int shortcutCount,
final List<NotificationKeyData> notificationKeys, List<SystemShortcut> systemShortcuts) {
@@ -261,9 +261,10 @@
if (mNotificationContainer == null) {
mNotificationContainer = findViewById(R.id.notification_container);
mNotificationContainer.setVisibility(VISIBLE);
+ mNotificationContainer.setPopupView(this);
+ } else {
+ mNotificationContainer.setVisibility(GONE);
}
- View.inflate(getContext(), R.layout.notification_content, mNotificationContainer);
- mNotificationItemView = new NotificationItemView(this, mNotificationContainer);
updateNotificationHeader();
}
int viewsToFlip = getChildCount();
@@ -274,10 +275,6 @@
if (hasDeepShortcuts) {
mDeepShortcutContainer.setVisibility(View.VISIBLE);
- if (mNotificationItemView != null) {
- mNotificationItemView.addGutter();
- }
-
for (int i = shortcutCount; i > 0; i--) {
DeepShortcutView v = inflateAndAdd(R.layout.deep_shortcut, mDeepShortcutContainer);
v.getLayoutParams().width = containerWidth;
@@ -309,10 +306,6 @@
} else {
mDeepShortcutContainer.setVisibility(View.GONE);
if (!systemShortcuts.isEmpty()) {
- if (mNotificationItemView != null) {
- mNotificationItemView.addGutter();
- }
-
for (SystemShortcut shortcut : systemShortcuts) {
initializeSystemShortcut(R.layout.system_shortcut, this, shortcut);
}
@@ -355,13 +348,13 @@
}
public void applyNotificationInfos(List<NotificationInfo> notificationInfos) {
- if (mNotificationItemView != null) {
- mNotificationItemView.applyNotificationInfos(notificationInfos);
+ if (mNotificationContainer != null) {
+ mNotificationContainer.applyNotificationInfos(notificationInfos);
}
}
private void updateHiddenShortcuts() {
- int allowedCount = mNotificationItemView != null
+ int allowedCount = mNotificationContainer != null
? MAX_SHORTCUTS_IF_NOTIFICATIONS : MAX_SHORTCUTS;
int total = mShortcuts.size();
@@ -447,8 +440,8 @@
private void updateNotificationHeader() {
ItemInfoWithIcon itemInfo = (ItemInfoWithIcon) mOriginalIcon.getTag();
DotInfo dotInfo = mLauncher.getDotInfoForItem(itemInfo);
- if (mNotificationItemView != null && dotInfo != null) {
- mNotificationItemView.updateHeader(dotInfo.getNotificationCount());
+ if (mNotificationContainer != null && dotInfo != null) {
+ mNotificationContainer.updateHeader(dotInfo.getNotificationCount());
}
}
@@ -590,20 +583,18 @@
@Override
public void trimNotifications(Map<PackageUserKey, DotInfo> updatedDots) {
- if (mNotificationItemView == null) {
+ if (mNotificationContainer == null) {
return;
}
ItemInfo originalInfo = (ItemInfo) mOriginalIcon.getTag();
DotInfo dotInfo = updatedDots.get(PackageUserKey.fromItemInfo(originalInfo));
if (dotInfo == null || dotInfo.getNotificationKeys().size() == 0) {
// No more notifications, remove the notification views and expand all shortcuts.
- mNotificationItemView.removeAllViews();
- mNotificationItemView = null;
mNotificationContainer.setVisibility(GONE);
updateHiddenShortcuts();
assignMarginsAndBackgrounds(PopupContainerWithArrow.this);
} else {
- mNotificationItemView.trimNotifications(
+ mNotificationContainer.trimNotifications(
NotificationKeyData.extractKeysOnly(dotInfo.getNotificationKeys()));
}
}
diff --git a/src/com/android/launcher3/provider/RestoreDbTask.java b/src/com/android/launcher3/provider/RestoreDbTask.java
index 8d02a4a..d59429d 100644
--- a/src/com/android/launcher3/provider/RestoreDbTask.java
+++ b/src/com/android/launcher3/provider/RestoreDbTask.java
@@ -84,9 +84,10 @@
}
private static boolean performRestore(Context context, DatabaseHelper helper) {
- if (new DeviceGridState(LauncherAppState.getIDP(context)).getDeviceType()
- != Utilities.getPrefs(context).getInt(RESTORED_DEVICE_TYPE, TYPE_PHONE)) {
- // DO not restore if the device types are different
+ if (!DeviceGridState.deviceTypeCompatible(
+ new DeviceGridState(LauncherAppState.getIDP(context)).getDeviceType(),
+ Utilities.getPrefs(context).getInt(RESTORED_DEVICE_TYPE, TYPE_PHONE))) {
+ // DO NOT restore if the device types are incompatible.
return false;
}
SQLiteDatabase db = helper.getWritableDatabase();
diff --git a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
index 4d63218..b06b8a1 100644
--- a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
+++ b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
@@ -20,6 +20,7 @@
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
+import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.PLUGIN_CHANGED;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.pluginEnabledKey;
@@ -29,6 +30,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
@@ -44,6 +46,7 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
+import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -57,12 +60,15 @@
import androidx.preference.SwitchPreference;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.config.FlagTogglerPrefUi;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
+import com.android.launcher3.util.OnboardingPrefs;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@@ -104,6 +110,7 @@
initFlags();
loadPluginPrefs();
maybeAddSandboxCategory();
+ addOnboardingPrefsCatergory();
if (getActivity() != null) {
getActivity().setTitle("Developer Options");
@@ -153,6 +160,15 @@
}
});
+ if (getArguments() != null) {
+ String filter = getArguments().getString(EXTRA_FRAGMENT_ARG_KEY);
+ // Normally EXTRA_FRAGMENT_ARG_KEY is used to highlight the preference with the given
+ // key. This is a slight variation where we instead filter by the human-readable titles.
+ if (filter != null) {
+ filterBox.setText(filter);
+ }
+ }
+
View listView = getListView();
final int bottomPadding = listView.getPaddingBottom();
listView.setOnApplyWindowInsetsListener((v, insets) -> {
@@ -355,6 +371,28 @@
sandboxCategory.addPreference(launchSandboxModeTutorialPreference);
}
+ private void addOnboardingPrefsCatergory() {
+ PreferenceCategory onboardingCategory = newCategory("Onboarding Flows");
+ onboardingCategory.setSummary("Reset these if you want to see the education again.");
+ for (Map.Entry<String, String[]> titleAndKeys : OnboardingPrefs.ALL_PREF_KEYS.entrySet()) {
+ String title = titleAndKeys.getKey();
+ String[] keys = titleAndKeys.getValue();
+ Preference onboardingPref = new Preference(getContext());
+ onboardingPref.setTitle(title);
+ onboardingPref.setSummary("Tap to reset");
+ onboardingPref.setOnPreferenceClickListener(preference -> {
+ SharedPreferences.Editor sharedPrefsEdit = Utilities.getPrefs(getContext()).edit();
+ for (String key : keys) {
+ sharedPrefsEdit.remove(key);
+ }
+ sharedPrefsEdit.apply();
+ Toast.makeText(getContext(), "Reset " + title, Toast.LENGTH_SHORT).show();
+ return true;
+ });
+ onboardingCategory.addPreference(onboardingPref);
+ }
+ }
+
private String toName(String action) {
String str = action.replace("com.android.systemui.action.PLUGIN_", "")
.replace("com.android.launcher3.action.PLUGIN_", "");
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 915e140..f348a33 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -62,8 +62,9 @@
SharedPreferences.OnSharedPreferenceChangeListener{
/** List of fragments that can be hosted by this activity. */
- private static final List<String> VALID_PREFERENCE_FRAGMENTS = Collections.singletonList(
- DeveloperOptionsFragment.class.getName());
+ private static final List<String> VALID_PREFERENCE_FRAGMENTS =
+ !Utilities.IS_DEBUG_DEVICE ? Collections.emptyList()
+ : Collections.singletonList(DeveloperOptionsFragment.class.getName());
private static final String DEVELOPER_OPTIONS_KEY = "pref_developer_options";
private static final String FLAGS_PREFERENCE_KEY = "flag_toggler";
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index c484811..ed52e20 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -117,7 +117,7 @@
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
public static final String WORK_PROFILE_REMOVED = "b/159671700";
public static final String FALLBACK_ACTIVITY_NO_SET = "b/181019015";
- public static final String THIRD_PARTY_LAUNCHER_NOT_SET = "b/187080582";
public static final String TASK_VIEW_ID_CRASH = "b/195430732";
public static final String L3_SWIPE_TO_HOME = "b/192018189";
+ public static final String NO_DROP_TARGET = "b/195031154";
}
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 17a00e2..895ca08 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -170,20 +170,11 @@
DeviceProfile dp) {
// Don't use device profile here because we know we're in fake landscape, only split option
// available is top/left
-//<<<<<<< HEAD
-// if (splitPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
-// // Top (visually left) side
-// return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
-// }
-// throw new IllegalStateException("Invalid split stage position: " +
-// splitPosition.stagePosition);
-//=======
if (stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
// Top (visually left) side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
}
throw new IllegalStateException("Invalid split stage position: " + stagePosition);
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
@@ -394,15 +385,15 @@
}
@Override
-//<<<<<<< HEAD
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
float diff;
+ float horizontalDividerDiff = splitInfo.visualDividerBounds.width() / 2f;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
- diff = outRect.height() * (1f - splitInfo.leftTaskPercent);
+ diff = outRect.height() * (1f - splitInfo.leftTaskPercent) + horizontalDividerDiff;
outRect.bottom -= diff;
} else {
- diff = outRect.height() * splitInfo.leftTaskPercent;
+ diff = outRect.height() * splitInfo.leftTaskPercent + horizontalDividerDiff;
outRect.top += diff;
}
}
@@ -412,7 +403,7 @@
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// The preview set is for the bottom/right, inset by top/left task
- splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.dividerBounds.width() / 2;
+ splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.visualDividerBounds.width();
}
}
@@ -423,7 +414,7 @@
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = taskParent.getHeight() - spaceAboveSnapshot;
int totalThumbnailWidth = taskParent.getWidth();
- int dividerBar = splitBoundsConfig.dividerBounds.width() / 2;
+ int dividerBar = splitBoundsConfig.visualDividerBounds.width();
ViewGroup.LayoutParams primaryLp = mSnapshotView.getLayoutParams();
ViewGroup.LayoutParams secondaryLp = mSnapshotView2.getLayoutParams();
@@ -435,11 +426,9 @@
mSnapshotView2.setTranslationY(primaryLp.height + spaceAboveSnapshot + dividerBar);
}
-//=======
@Override
public int getDefaultSplitPosition(DeviceProfile deviceProfile) {
throw new IllegalStateException("Default position not available in fake landscape");
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 640e6cc..f1fd439 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -168,11 +168,7 @@
@Override
public int getSplitTaskViewDismissDirection(@StagePosition int stagePosition,
DeviceProfile dp) {
-//<<<<<<< HEAD
-// if (splitPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
-//=======
if (stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
if (dp.isLandscape) {
// Left side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
@@ -180,20 +176,11 @@
// Top side
return SPLIT_TRANSLATE_SECONDARY_NEGATIVE;
}
-//<<<<<<< HEAD
-// } else if (splitPosition.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
- // We don't have a bottom option, so should be right
-// return SPLIT_TRANSLATE_PRIMARY_POSITIVE;
-// }
-// throw new IllegalStateException("Invalid split stage position: " +
-// splitPosition.stagePosition);
-//=======
} else if (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// We don't have a bottom option, so should be right
return SPLIT_TRANSLATE_PRIMARY_POSITIVE;
}
throw new IllegalStateException("Invalid split stage position: " + stagePosition);
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
@@ -438,11 +425,7 @@
}
// Now we rotate the portrait rect depending on what side we want pinned
-//<<<<<<< HEAD
-// boolean pinToRight = splitPositionOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
-//=======
boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
int screenHeight = dp.heightPx;
float postRotateScale = (float) screenHeight / width;
@@ -470,11 +453,7 @@
}
// Now we rotate the portrait rect depending on what side we want pinned
-//<<<<<<< HEAD
-// boolean pinToRight = initialSplitOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
-//=======
boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
float postRotateScale = (float) screenHeight / screenWidth;
mTmpMatrix.reset();
@@ -492,25 +471,26 @@
}
@Override
-//<<<<<<< HEAD
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
boolean isLandscape = dp.isLandscape;
+ float verticalDividerDiff = splitInfo.visualDividerBounds.height() / 2f;
+ float horizontalDividerDiff = splitInfo.visualDividerBounds.width() / 2f;
float diff;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
if (isLandscape) {
- diff = outRect.width() * (1f - splitInfo.leftTaskPercent);
+ diff = outRect.width() * (1f - splitInfo.leftTaskPercent) + horizontalDividerDiff;
outRect.right -= diff;
} else {
- diff = outRect.height() * (1f - splitInfo.topTaskPercent);
+ diff = outRect.height() * (1f - splitInfo.topTaskPercent) + verticalDividerDiff;
outRect.bottom -= diff;
}
} else {
if (isLandscape) {
- diff = outRect.width() * splitInfo.leftTaskPercent;
+ diff = outRect.width() * splitInfo.leftTaskPercent + horizontalDividerDiff;
outRect.left += diff;
} else {
- diff = outRect.height() * splitInfo.topTaskPercent;
+ diff = outRect.height() * splitInfo.topTaskPercent + verticalDividerDiff;
outRect.top += diff;
}
}
@@ -522,10 +502,12 @@
if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
if (dp.isLandscape) {
splitOffset.x = splitInfo.leftTopBounds.width() +
- splitInfo.dividerBounds.width() / 2;
+ splitInfo.visualDividerBounds.width();
+ splitOffset.y = 0;
} else {
splitOffset.y = splitInfo.leftTopBounds.height() +
- splitInfo.dividerBounds.height() / 2;
+ splitInfo.visualDividerBounds.height();
+ splitOffset.x = 0;
}
}
}
@@ -538,9 +520,8 @@
int totalThumbnailHeight = taskParent.getHeight() - spaceAboveSnapshot;
int totalThumbnailWidth = taskParent.getWidth();
int dividerBar = (dp.isLandscape ?
- splitBoundsConfig.dividerBounds.width() :
- splitBoundsConfig.dividerBounds.height())
- / 2;
+ splitBoundsConfig.visualDividerBounds.width() :
+ splitBoundsConfig.visualDividerBounds.height());
ViewGroup.LayoutParams primaryLp = mSnapshotView.getLayoutParams();
ViewGroup.LayoutParams secondaryLp = mSnapshotView2.getLayoutParams();
@@ -563,7 +544,6 @@
}
}
-//=======
@Override
public int getDefaultSplitPosition(DeviceProfile deviceProfile) {
if (!deviceProfile.isTablet) {
@@ -573,7 +553,6 @@
return STAGE_POSITION_BOTTOM_OR_RIGHT;
} else {
return STAGE_POSITION_TOP_OR_LEFT;
-//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
}
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index e2c0a32..3a2b961 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -23,6 +23,8 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH;
+import static java.util.Collections.emptyMap;
+
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.ComponentCallbacks;
@@ -34,10 +36,11 @@
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.os.Build;
+import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.view.Display;
-import android.view.WindowMetrics;
import androidx.annotation.AnyThread;
import androidx.annotation.UiThread;
@@ -47,7 +50,7 @@
import com.android.launcher3.uioverrides.ApiWrapper;
import java.util.ArrayList;
-import java.util.Collections;
+import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -55,7 +58,7 @@
* Utility class to cache properties of default display to avoid a system RPC on every call.
*/
@SuppressLint("NewApi")
-public class DisplayController implements DisplayListener, ComponentCallbacks {
+public class DisplayController implements DisplayListener, ComponentCallbacks, SafeCloseable {
private static final String TAG = "DisplayController";
@@ -76,9 +79,10 @@
// Null for SDK < S
private final Context mWindowContext;
-
private final ArrayList<DisplayInfoChangeListener> mListeners = new ArrayList<>();
+
private Info mInfo;
+ private boolean mDestroyed = false;
private DisplayController(Context context) {
mContext = context;
@@ -95,19 +99,35 @@
mContext.registerReceiver(configChangeReceiver,
new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));
}
+ mInfo = new Info(getDisplayInfoContext(display), display,
+ getInternalDisplays(mDM), emptyMap());
+ mDM.registerDisplayListener(this, UI_HELPER_EXECUTOR.getHandler());
+ }
- // Create a single holder for all internal displays. External display holders created
- // lazily.
- Set<PortraitSize> extraInternalDisplays = new ArraySet<>();
- for (Display d : mDM.getDisplays()) {
- if (ApiWrapper.isInternalDisplay(display) && d.getDisplayId() != DEFAULT_DISPLAY) {
+ private static ArrayMap<String, PortraitSize> getInternalDisplays(
+ DisplayManager displayManager) {
+ Display[] displays = displayManager.getDisplays();
+ ArrayMap<String, PortraitSize> internalDisplays = new ArrayMap<>();
+ for (Display display : displays) {
+ if (ApiWrapper.isInternalDisplay(display)) {
Point size = new Point();
- d.getRealSize(size);
- extraInternalDisplays.add(new PortraitSize(size.x, size.y));
+ display.getRealSize(size);
+ internalDisplays.put(ApiWrapper.getUniqueId(display),
+ new PortraitSize(size.x, size.y));
}
}
- mInfo = new Info(getDisplayInfoContext(display), display, extraInternalDisplays);
- mDM.registerDisplayListener(this, UI_HELPER_EXECUTOR.getHandler());
+ return internalDisplays;
+ }
+
+ @Override
+ public void close() {
+ mDestroyed = true;
+ if (mWindowContext != null) {
+ mWindowContext.unregisterComponentCallbacks(this);
+ } else {
+ // TODO: unregister broadcast receiver
+ }
+ mDM.unregisterDisplayListener(this);
}
@Override
@@ -157,6 +177,9 @@
* Only used for pre-S
*/
private void onConfigChanged(Intent intent) {
+ if (mDestroyed) {
+ return;
+ }
Configuration config = mContext.getResources().getConfiguration();
if (mInfo.fontScale != config.fontScale || mInfo.densityDpi != config.densityDpi) {
Log.d(TAG, "Configuration changed, notifying listeners");
@@ -203,11 +226,16 @@
@AnyThread
private void handleInfoChange(Display display) {
Info oldInfo = mInfo;
- Set<PortraitSize> extraDisplaysSizes = oldInfo.mAllSizes.size() > 1
- ? oldInfo.mAllSizes : Collections.emptySet();
Context displayContext = getDisplayInfoContext(display);
- Info newInfo = new Info(displayContext, display, extraDisplaysSizes);
+ Info newInfo = new Info(displayContext, display,
+ oldInfo.mInternalDisplays, oldInfo.mPerDisplayBounds);
+
+ if (newInfo.densityDpi != oldInfo.densityDpi || newInfo.fontScale != oldInfo.fontScale) {
+ // Cache may not be valid anymore, recreate without cache
+ newInfo = new Info(displayContext, display, getInternalDisplays(mDM), emptyMap());
+ }
+
int change = 0;
if (!newInfo.mScreenSizeDp.equals(oldInfo.mScreenSizeDp)) {
change |= CHANGE_ACTIVE_SCREEN;
@@ -240,7 +268,6 @@
public static class Info {
- public final int id;
public final int singleFrameMs;
// Configuration properties
@@ -249,19 +276,21 @@
public final int densityDpi;
private final PortraitSize mScreenSizeDp;
- private final Set<PortraitSize> mAllSizes;
public final Point currentSize;
public final Set<WindowBounds> supportedBounds = new ArraySet<>();
+ private final Map<String, Set<WindowBounds>> mPerDisplayBounds = new ArrayMap<>();
+ private final ArrayMap<String, PortraitSize> mInternalDisplays;
public Info(Context context, Display display) {
- this(context, display, Collections.emptySet());
+ this(context, display, new ArrayMap<>(), emptyMap());
}
- private Info(Context context, Display display, Set<PortraitSize> extraDisplaysSizes) {
- id = display.getDisplayId();
-
+ private Info(Context context, Display display,
+ ArrayMap<String, PortraitSize> internalDisplays,
+ Map<String, Set<WindowBounds>> perDisplayBoundsCache) {
+ mInternalDisplays = internalDisplays;
rotation = display.getRotation();
Configuration config = context.getResources().getConfiguration();
@@ -271,32 +300,51 @@
singleFrameMs = getSingleFrameMs(display);
currentSize = new Point();
-
display.getRealSize(currentSize);
- if (extraDisplaysSizes.isEmpty() || !Utilities.ATLEAST_S) {
- Point smallestSize = new Point();
- Point largestSize = new Point();
- display.getCurrentSizeRange(smallestSize, largestSize);
+ String myDisplayId = ApiWrapper.getUniqueId(display);
+ Set<WindowBounds> currentSupportedBounds =
+ getSupportedBoundsForDisplay(display, currentSize);
+ mPerDisplayBounds.put(myDisplayId, currentSupportedBounds);
+ supportedBounds.addAll(currentSupportedBounds);
- int portraitWidth = Math.min(currentSize.x, currentSize.y);
- int portraitHeight = Math.max(currentSize.x, currentSize.y);
+ if (ApiWrapper.isInternalDisplay(display) && internalDisplays.size() > 1) {
+ int displayCount = internalDisplays.size();
+ for (int i = 0; i < displayCount; i++) {
+ String displayKey = internalDisplays.keyAt(i);
+ if (TextUtils.equals(myDisplayId, displayKey)) {
+ continue;
+ }
- supportedBounds.add(new WindowBounds(portraitWidth, portraitHeight,
- smallestSize.x, largestSize.y));
- supportedBounds.add(new WindowBounds(portraitHeight, portraitWidth,
- largestSize.x, smallestSize.y));
- mAllSizes = Collections.singleton(new PortraitSize(currentSize.x, currentSize.y));
- } else {
- mAllSizes = new ArraySet<>(extraDisplaysSizes);
- mAllSizes.add(new PortraitSize(currentSize.x, currentSize.y));
- Set<WindowMetrics> metrics = WindowManagerCompat.getDisplayProfiles(
- context, mAllSizes, densityDpi,
- ApiWrapper.TASKBAR_DRAWN_IN_PROCESS);
- metrics.forEach(wm -> supportedBounds.add(WindowBounds.fromWindowMetrics(wm)));
+ Set<WindowBounds> displayBounds = perDisplayBoundsCache.get(displayKey);
+ if (displayBounds == null) {
+ // We assume densityDpi is the same across all internal displays
+ displayBounds = WindowManagerCompat.estimateDisplayProfiles(
+ context, internalDisplays.valueAt(i), densityDpi,
+ ApiWrapper.TASKBAR_DRAWN_IN_PROCESS);
+ }
+
+ supportedBounds.addAll(displayBounds);
+ mPerDisplayBounds.put(displayKey, displayBounds);
+ }
}
}
+ private static Set<WindowBounds> getSupportedBoundsForDisplay(Display display, Point size) {
+ Point smallestSize = new Point();
+ Point largestSize = new Point();
+ display.getCurrentSizeRange(smallestSize, largestSize);
+
+ int portraitWidth = Math.min(size.x, size.y);
+ int portraitHeight = Math.max(size.x, size.y);
+ Set<WindowBounds> result = new ArraySet<>();
+ result.add(new WindowBounds(portraitWidth, portraitHeight,
+ smallestSize.x, largestSize.y));
+ result.add(new WindowBounds(portraitHeight, portraitWidth,
+ largestSize.x, smallestSize.y));
+ return result;
+ }
+
/**
* Returns true if the bounds represent a tablet
*/
diff --git a/src/com/android/launcher3/util/ItemInfoMatcher.java b/src/com/android/launcher3/util/ItemInfoMatcher.java
index e8ba28f..ab3083d 100644
--- a/src/com/android/launcher3/util/ItemInfoMatcher.java
+++ b/src/com/android/launcher3/util/ItemInfoMatcher.java
@@ -32,6 +32,11 @@
*/
public interface ItemInfoMatcher {
+ /**
+ * Empty component used for match testing
+ */
+ ComponentName EMPTY_COMPONENT = new ComponentName("", "");
+
boolean matches(ItemInfo info, ComponentName cn);
/**
@@ -40,7 +45,7 @@
default boolean matchesInfo(ItemInfo info) {
if (info != null) {
ComponentName cn = info.getTargetComponent();
- return cn != null && matches(info, cn);
+ return matches(info, cn != null ? cn : EMPTY_COMPONENT);
} else {
return false;
}
diff --git a/src/com/android/launcher3/util/MainThreadInitializedObject.java b/src/com/android/launcher3/util/MainThreadInitializedObject.java
index f6003dd..badcd35 100644
--- a/src/com/android/launcher3/util/MainThreadInitializedObject.java
+++ b/src/com/android/launcher3/util/MainThreadInitializedObject.java
@@ -18,13 +18,21 @@
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.content.Context;
+import android.content.ContextWrapper;
import android.os.Looper;
+import android.util.Log;
+import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
-import com.android.launcher3.graphics.LauncherPreviewRenderer.PreviewContext;
import com.android.launcher3.util.ResourceBasedOverride.Overrides;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ExecutionException;
/**
@@ -40,8 +48,8 @@
}
public T get(Context context) {
- if (context instanceof PreviewContext) {
- return ((PreviewContext) context).getObject(this, mProvider);
+ if (context instanceof SandboxContext) {
+ return ((SandboxContext) context).getObject(this, mProvider);
}
if (mValue == null) {
@@ -80,4 +88,80 @@
T get(Context context);
}
+
+ /**
+ * Abstract Context which allows custom implementations for
+ * {@link MainThreadInitializedObject} providers
+ */
+ public static abstract class SandboxContext extends ContextWrapper {
+
+ private static final String TAG = "SandboxContext";
+
+ protected final Set<MainThreadInitializedObject> mAllowedObjects;
+ protected final Map<MainThreadInitializedObject, Object> mObjectMap = new HashMap<>();
+ protected final ArrayList<Object> mOrderedObjects = new ArrayList<>();
+
+ private final Object mDestroyLock = new Object();
+ private boolean mDestroyed = false;
+
+ public SandboxContext(Context base, MainThreadInitializedObject... allowedObjects) {
+ super(base);
+ mAllowedObjects = new HashSet<>(Arrays.asList(allowedObjects));
+ }
+
+ @Override
+ public Context getApplicationContext() {
+ return this;
+ }
+
+ public void onDestroy() {
+ synchronized (mDestroyLock) {
+ // Destroy in reverse order
+ for (int i = mOrderedObjects.size() - 1; i >= 0; i--) {
+ Object o = mOrderedObjects.get(i);
+ if (o instanceof SafeCloseable) {
+ ((SafeCloseable) o).close();
+ }
+ }
+ mDestroyed = true;
+ }
+ }
+
+ /**
+ * Find a cached object from mObjectMap if we have already created one. If not, generate
+ * an object using the provider.
+ */
+ private <T> T getObject(MainThreadInitializedObject<T> object, ObjectProvider<T> provider) {
+ synchronized (mDestroyLock) {
+ if (mDestroyed) {
+ Log.e(TAG, "Static object access with a destroyed context");
+ }
+ if (!mAllowedObjects.contains(object)) {
+ throw new IllegalStateException(
+ "Leaking unknown objects " + object + " " + provider);
+ }
+ T t = (T) mObjectMap.get(object);
+ if (t != null) {
+ return t;
+ }
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ t = createObject(provider);
+ mObjectMap.put(object, t);
+ mOrderedObjects.add(t);
+ return t;
+ }
+ }
+
+ try {
+ return MAIN_EXECUTOR.submit(() -> getObject(object, provider)).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @UiThread
+ protected <T> T createObject(ObjectProvider<T> provider) {
+ return provider.get(this);
+ }
+ }
}
diff --git a/src/com/android/launcher3/util/OnboardingPrefs.java b/src/com/android/launcher3/util/OnboardingPrefs.java
index cf1467a..5ba0d30 100644
--- a/src/com/android/launcher3/util/OnboardingPrefs.java
+++ b/src/com/android/launcher3/util/OnboardingPrefs.java
@@ -39,6 +39,14 @@
public static final String SEARCH_EDU_SEEN = "launcher.search_edu_seen";
public static final String SEARCH_SNACKBAR_COUNT = "launcher.keyboard_snackbar_count";
public static final String TASKBAR_EDU_SEEN = "launcher.taskbar_edu_seen";
+ // When adding a new key, add it here as well, to be able to reset it from Developer Options.
+ public static final Map<String, String[]> ALL_PREF_KEYS = Map.of(
+ "All Apps Bounce", new String[] { HOME_BOUNCE_SEEN, HOME_BOUNCE_COUNT },
+ "Hybrid Hotseat Education", new String[] { HOTSEAT_DISCOVERY_TIP_COUNT,
+ HOTSEAT_LONGPRESS_TIP_SEEN },
+ "Search Education", new String[] { SEARCH_EDU_SEEN, SEARCH_SNACKBAR_COUNT },
+ "Taskbar Education", new String[] { TASKBAR_EDU_SEEN }
+ );
/**
* Events that either have happened or have not (booleans).
diff --git a/src/com/android/launcher3/util/SettingsCache.java b/src/com/android/launcher3/util/SettingsCache.java
index 10611c7..0c5b722 100644
--- a/src/com/android/launcher3/util/SettingsCache.java
+++ b/src/com/android/launcher3/util/SettingsCache.java
@@ -47,7 +47,7 @@
*
* Cache will also be updated if a key queried is missing (even if it has no listeners registered).
*/
-public class SettingsCache extends ContentObserver {
+public class SettingsCache extends ContentObserver implements SafeCloseable {
/** Hidden field Settings.Secure.NOTIFICATION_BADGING */
public static final Uri NOTIFICATION_BADGING_URI =
@@ -69,7 +69,6 @@
private final Map<Uri, CopyOnWriteArrayList<OnChangeListener>> mListenerMap = new HashMap<>();
protected final ContentResolver mResolver;
-
/**
* Singleton instance
*/
@@ -82,6 +81,11 @@
}
@Override
+ public void close() {
+ mResolver.unregisterContentObserver(this);
+ }
+
+ @Override
public void onChange(boolean selfChange, Uri uri) {
// We use default of 1, but if we're getting an onChange call, can assume a non-default
// value will exist
diff --git a/src/com/android/launcher3/util/SplitConfigurationOptions.java b/src/com/android/launcher3/util/SplitConfigurationOptions.java
index 41693de..5093d85 100644
--- a/src/com/android/launcher3/util/SplitConfigurationOptions.java
+++ b/src/com/android/launcher3/util/SplitConfigurationOptions.java
@@ -88,25 +88,29 @@
public static class StagedSplitBounds {
public final Rect leftTopBounds;
public final Rect rightBottomBounds;
- public final Rect dividerBounds;
+ /** This rect represents the actual gap between the two apps */
+ public final Rect visualDividerBounds;
// This class is orientation-agnostic, so we compute both for later use
public final float topTaskPercent;
public final float leftTaskPercent;
- public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds, Rect dividerBounds) {
+ public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds) {
this.leftTopBounds = leftTopBounds;
this.rightBottomBounds = rightBottomBounds;
- this.dividerBounds = dividerBounds;
- float totalHeight = this.leftTopBounds.height()
- + this.rightBottomBounds.height()
- + this.dividerBounds.height();
- float totalWidth = this.leftTopBounds.width()
- + this.rightBottomBounds.width()
- + this.dividerBounds.width();
- leftTaskPercent = this.leftTopBounds.width() / totalWidth;
- topTaskPercent = this.leftTopBounds.height() / totalHeight;
+ if (rightBottomBounds.top > leftTopBounds.top) {
+ // vertical apps, horizontal divider
+ this.visualDividerBounds = new Rect(leftTopBounds.left, leftTopBounds.bottom,
+ leftTopBounds.right, rightBottomBounds.top);
+ } else {
+ // horizontal apps, vertical divider
+ this.visualDividerBounds = new Rect(leftTopBounds.right, leftTopBounds.top,
+ rightBottomBounds.left, leftTopBounds.bottom);
+ }
+
+ leftTaskPercent = this.leftTopBounds.width() / (float) rightBottomBounds.right;
+ topTaskPercent = this.leftTopBounds.height() / (float) rightBottomBounds.bottom;
}
}
diff --git a/src/com/android/launcher3/util/UiThreadHelper.java b/src/com/android/launcher3/util/UiThreadHelper.java
index 0f40179..ac5368c 100644
--- a/src/com/android/launcher3/util/UiThreadHelper.java
+++ b/src/com/android/launcher3/util/UiThreadHelper.java
@@ -28,7 +28,7 @@
import android.view.View;
import android.view.inputmethod.InputMethodManager;
-import com.android.launcher3.Launcher;
+import com.android.launcher3.BaseActivity;
import com.android.launcher3.views.ActivityContext;
/**
@@ -56,7 +56,7 @@
STATS_LOGGER_KEY,
Message.obtain(
HANDLER.get(root.getContext()),
- () -> Launcher.cast(activityContext)
+ () -> BaseActivity.fromContext(root.getContext())
.getStatsLogManager()
.logger()
.log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED)
diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
index c51f66f..8a7cae9 100644
--- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
+++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
@@ -150,8 +150,8 @@
*/
private int getNumPagesExcludingEmpty() {
int numOfPages = mWorkspace.getChildCount();
- if (numOfPages >= MIN_PARALLAX_PAGE_SPAN && mWorkspace.hasExtraEmptyScreen()) {
- return numOfPages - 1;
+ if (numOfPages >= MIN_PARALLAX_PAGE_SPAN && mWorkspace.hasExtraEmptyScreens()) {
+ return numOfPages - mWorkspace.getPanelCount();
} else {
return numOfPages;
}
diff --git a/src/com/android/launcher3/util/WindowManagerCompat.java b/src/com/android/launcher3/util/WindowManagerCompat.java
index 38a63de..bfdf1e4 100644
--- a/src/com/android/launcher3/util/WindowManagerCompat.java
+++ b/src/com/android/launcher3/util/WindowManagerCompat.java
@@ -24,6 +24,7 @@
import android.graphics.Insets;
import android.graphics.Rect;
import android.os.Build;
+import android.util.ArraySet;
import android.view.WindowInsets;
import android.view.WindowInsets.Type;
import android.view.WindowManager;
@@ -31,14 +32,14 @@
import com.android.launcher3.R;
import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController.PortraitSize;
-import java.util.Collection;
-import java.util.HashSet;
+import java.util.Collections;
import java.util.Set;
/**
- * Utility class to simulate window manager APIs until proper APIs are available
+ * Utility class to estimate window manager values
*/
@TargetApi(Build.VERSION_CODES.S)
public class WindowManagerCompat {
@@ -46,51 +47,51 @@
public static final int MIN_TABLET_WIDTH = 600;
/**
- * Returns a set of supported render sizes for a set of internal displays.
- * This is a temporary workaround which assumes only nav-bar insets change across displays
+ * Returns a set of supported render sizes for a internal display.
+ * This is a temporary workaround which assumes only nav-bar insets change across displays, and
+ * is only used until we eventually get the real values
* @param consumeTaskBar if true, it assumes that task bar is part of the app window
* and ignores any insets because of task bar.
*/
- public static Set<WindowMetrics> getDisplayProfiles(
- Context windowContext, Collection<PortraitSize> allDisplaySizes,
- int densityDpi, boolean consumeTaskBar) {
- WindowInsets metrics = windowContext.getSystemService(WindowManager.class)
+ public static Set<WindowBounds> estimateDisplayProfiles(
+ Context windowContext, PortraitSize size, int densityDpi, boolean consumeTaskBar) {
+ if (!Utilities.ATLEAST_S) {
+ return Collections.emptySet();
+ }
+ WindowInsets defaultInsets = windowContext.getSystemService(WindowManager.class)
.getMaximumWindowMetrics().getWindowInsets();
boolean hasNavbar = ResourceUtils.getIntegerByName(
"config_navBarInteractionMode",
windowContext.getResources(),
INVALID_RESOURCE_HANDLE) != 0;
- WindowInsets.Builder insetsBuilder = new WindowInsets.Builder(metrics);
+ WindowInsets.Builder insetsBuilder = new WindowInsets.Builder(defaultInsets);
+ Set<WindowBounds> result = new ArraySet<>();
+ int swDP = (int) dpiFromPx(size.width, densityDpi);
+ boolean isTablet = swDP >= MIN_TABLET_WIDTH;
- Set<WindowMetrics> result = new HashSet<>();
- for (PortraitSize size : allDisplaySizes) {
- int swDP = (int) dpiFromPx(size.width, densityDpi);
- boolean isTablet = swDP >= MIN_TABLET_WIDTH;
-
- final Insets portraitNav, landscapeNav;
- if (isTablet && !consumeTaskBar) {
- portraitNav = landscapeNav = Insets.of(0, 0, 0, windowContext.getResources()
- .getDimensionPixelSize(R.dimen.taskbar_size));
- } else if (hasNavbar) {
- portraitNav = Insets.of(0, 0, 0,
- getSystemResource(windowContext, "navigation_bar_height", swDP));
- landscapeNav = isTablet
- ? Insets.of(0, 0, 0, getSystemResource(windowContext,
- "navigation_bar_height_landscape", swDP))
- : Insets.of(0, 0, getSystemResource(windowContext,
- "navigation_bar_width", swDP), 0);
- } else {
- portraitNav = landscapeNav = Insets.of(0, 0, 0, 0);
- }
-
- result.add(new WindowMetrics(
- new Rect(0, 0, size.width, size.height),
- insetsBuilder.setInsets(Type.navigationBars(), portraitNav).build()));
- result.add(new WindowMetrics(
- new Rect(0, 0, size.height, size.width),
- insetsBuilder.setInsets(Type.navigationBars(), landscapeNav).build()));
+ final Insets portraitNav, landscapeNav;
+ if (isTablet && !consumeTaskBar) {
+ portraitNav = landscapeNav = Insets.of(0, 0, 0, windowContext.getResources()
+ .getDimensionPixelSize(R.dimen.taskbar_size));
+ } else if (hasNavbar) {
+ portraitNav = Insets.of(0, 0, 0,
+ getSystemResource(windowContext, "navigation_bar_height", swDP));
+ landscapeNav = isTablet
+ ? Insets.of(0, 0, 0, getSystemResource(windowContext,
+ "navigation_bar_height_landscape", swDP))
+ : Insets.of(0, 0, getSystemResource(windowContext,
+ "navigation_bar_width", swDP), 0);
+ } else {
+ portraitNav = landscapeNav = Insets.of(0, 0, 0, 0);
}
+
+ result.add(WindowBounds.fromWindowMetrics(new WindowMetrics(
+ new Rect(0, 0, size.width, size.height),
+ insetsBuilder.setInsets(Type.navigationBars(), portraitNav).build())));
+ result.add(WindowBounds.fromWindowMetrics(new WindowMetrics(
+ new Rect(0, 0, size.height, size.width),
+ insetsBuilder.setInsets(Type.navigationBars(), landscapeNav).build())));
return result;
}
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index c822213..dc5fe06 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -115,6 +115,13 @@
}
/**
+ * Returns whether we can show the IME for elements hosted by this ActivityContext.
+ */
+ default boolean supportsIme() {
+ return true;
+ }
+
+ /**
* Returns the ActivityContext associated with the given Context.
*/
static <T extends Context & ActivityContext> T lookupContext(Context context) {
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index b6cec12..00a0050 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -19,6 +19,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
@@ -108,6 +109,9 @@
@Override
public boolean onLongClick(View v) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "1");
+ }
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
v.cancelLongPress();
if (!ItemLongClickListener.canStartDrag(mActivityContext)) return false;
@@ -178,6 +182,9 @@
}
private boolean beginDraggingWidget(WidgetCell v) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "2");
+ }
// Get the widget preview as the drag representation
WidgetImageView image = v.getWidgetView();
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index 2347d28..463f4ac 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -22,6 +22,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.util.Log;
import android.util.Size;
import android.view.View;
import android.view.View.MeasureSpec;
@@ -41,6 +42,7 @@
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.icons.RoundDrawableWrapper;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
import com.android.launcher3.widget.util.WidgetSizes;
@@ -94,6 +96,9 @@
*/
public void startDrag(Rect previewBounds, int previewBitmapWidth, int previewViewWidth,
Point screenPos, DragSource source, DragOptions options) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.NO_DROP_TARGET, "3");
+ }
final Launcher launcher = Launcher.getLauncher(mView.getContext());
LauncherAppState app = LauncherAppState.getInstance(launcher);
diff --git a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
index 329a444..2e2a968 100644
--- a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
+++ b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
@@ -33,6 +33,7 @@
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.PackageUserKey;
+import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.systemui.plugins.CustomWidgetPlugin;
@@ -46,7 +47,7 @@
/**
* CustomWidgetManager handles custom widgets implemented as a plugin.
*/
-public class CustomWidgetManager implements PluginListener<CustomWidgetPlugin> {
+public class CustomWidgetManager implements PluginListener<CustomWidgetPlugin>, SafeCloseable {
public static final MainThreadInitializedObject<CustomWidgetManager> INSTANCE =
new MainThreadInitializedObject<>(CustomWidgetManager::new);
@@ -71,7 +72,8 @@
.addPluginListener(this, CustomWidgetPlugin.class, true);
}
- public void onDestroy() {
+ @Override
+ public void close() {
PluginManagerWrapper.INSTANCE.get(mContext).removePluginListener(this);
}
diff --git a/src_plugins/com/android/systemui/plugins/OneSearch.java b/src_plugins/com/android/systemui/plugins/OneSearch.java
new file mode 100644
index 0000000..8bd0b75
--- /dev/null
+++ b/src_plugins/com/android/systemui/plugins/OneSearch.java
@@ -0,0 +1,43 @@
+/*
+ * 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.systemui.plugins;
+
+import android.os.Parcelable;
+
+import com.android.systemui.plugins.annotations.ProvidesInterface;
+
+import java.util.ArrayList;
+
+/**
+ * Implement this interface to get suggest for one search.
+ */
+@ProvidesInterface(action = OneSearch.ACTION, version = OneSearch.VERSION)
+public interface OneSearch extends Plugin {
+ String ACTION = "com.android.systemui.action.PLUGIN_ONE_SEARCH";
+ int VERSION = 3;
+
+ /**
+ * Get the content provider warmed up.
+ */
+ void warmUp();
+
+ /**
+ * Get the suggest search target list for the query.
+ * @param query The query to get the search suggests for.
+ */
+ ArrayList<Parcelable> getSuggests(Parcelable query);
+}
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
index cc90e6c..81e3f98 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -39,6 +39,13 @@
}
/**
+ * Returns a unique ID representing the display
+ */
+ public static String getUniqueId(Display display) {
+ return Integer.toString(display.getDisplayId());
+ }
+
+ /**
* Returns the minimum space that should be left empty at the end of hotseat
*/
public static int getHotseatEndOffset(Context context) {
diff --git a/robolectric_tests/resources/cache_data_updated_task_data.txt b/tests/res/raw/cache_data_updated_task_data.txt
similarity index 100%
rename from robolectric_tests/resources/cache_data_updated_task_data.txt
rename to tests/res/raw/cache_data_updated_task_data.txt
diff --git a/robolectric_tests/resources/db_schema_v10.json b/tests/res/raw/db_schema_v10.json
similarity index 100%
rename from robolectric_tests/resources/db_schema_v10.json
rename to tests/res/raw/db_schema_v10.json
diff --git a/robolectric_tests/resources/package_install_state_change_task_data.txt b/tests/res/raw/package_install_state_change_task_data.txt
similarity index 100%
rename from robolectric_tests/resources/package_install_state_change_task_data.txt
rename to tests/res/raw/package_install_state_change_task_data.txt
diff --git a/robolectric_tests/resources/widgets_predication_update_task_data.txt b/tests/res/raw/widgets_predication_update_task_data.txt
similarity index 100%
rename from robolectric_tests/resources/widgets_predication_update_task_data.txt
rename to tests/res/raw/widgets_predication_update_task_data.txt
diff --git a/robolectric_tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java b/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java
similarity index 84%
rename from robolectric_tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java
rename to tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java
index 8aa6f37..16f024e 100644
--- a/robolectric_tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java
+++ b/tests/src/com/android/launcher3/model/AddWorkspaceItemsTaskTest.java
@@ -13,6 +13,9 @@
import android.graphics.Rect;
import android.util.Pair;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
@@ -21,19 +24,17 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.ContentWriter;
+import com.android.launcher3.util.Executors;
import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.LauncherModelHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
import java.util.ArrayList;
import java.util.List;
@@ -41,8 +42,8 @@
/**
* Tests for {@link AddWorkspaceItemsTask}
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class AddWorkspaceItemsTaskTest {
private final ComponentName mComponent1 = new ComponentName("a", "b");
@@ -60,7 +61,7 @@
@Before
public void setup() {
mModelHelper = new LauncherModelHelper();
- mTargetContext = RuntimeEnvironment.application;
+ mTargetContext = mModelHelper.sandboxContext;
mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
mIdp.numColumns = mIdp.numRows = 5;
mAppState = LauncherAppState.getInstance(mTargetContext);
@@ -70,6 +71,11 @@
mNewScreens = new IntArray();
}
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
+ }
+
private AddWorkspaceItemsTask newTask(ItemInfo... items) {
List<Pair<ItemInfo, Object>> list = new ArrayList<>();
for (ItemInfo item : items) {
@@ -80,6 +86,8 @@
@Test
public void testFindSpaceForItem_prefers_second() throws Exception {
+ mIdp.isSplitDisplay = false;
+
// First screen has only one hole of size 1
int nextId = setupWorkspaceWithHoles(1, 1, new Rect(2, 2, 3, 3));
@@ -88,7 +96,7 @@
int[] spaceFound = newTask().findSpaceForItem(
mAppState, mModelHelper.getBgDataModel(), mExistingScreens, mNewScreens, 1, 1);
- assertEquals(2, spaceFound[0]);
+ assertEquals(1, spaceFound[0]);
assertTrue(mScreenOccupancy.get(spaceFound[0])
.isRegionVacant(spaceFound[1], spaceFound[2], 1, 1));
@@ -101,6 +109,24 @@
}
@Test
+ public void testFindSpaceForItem_prefers_third_on_split_display() throws Exception {
+ mIdp.isSplitDisplay = true;
+ // First screen has only one hole of size 1
+ int nextId = setupWorkspaceWithHoles(1, 1, new Rect(2, 2, 3, 3));
+
+ // Second screen has 2 holes of sizes 3x2 and 2x3
+ setupWorkspaceWithHoles(nextId, 2, new Rect(2, 0, 5, 2), new Rect(0, 2, 2, 5));
+
+ int[] spaceFound = newTask().findSpaceForItem(
+ mAppState, mModelHelper.getBgDataModel(), mExistingScreens, mNewScreens, 1, 1);
+ // For split display, it picks the next screen, even if there is enough space
+ // on previous screen
+ assertEquals(2, spaceFound[0]);
+ assertTrue(mScreenOccupancy.get(spaceFound[0])
+ .isRegionVacant(spaceFound[1], spaceFound[2], 1, 1));
+ }
+
+ @Test
public void testFindSpaceForItem_adds_new_screen() throws Exception {
// First screen has 2 holes of sizes 3x2 and 2x3
setupWorkspaceWithHoles(1, 1, new Rect(2, 0, 5, 2), new Rect(0, 2, 2, 5));
@@ -127,7 +153,7 @@
@Test
public void testAddItem_some_items_added() throws Exception {
Callbacks callbacks = mock(Callbacks.class);
- mModelHelper.getModel().addCallbacks(callbacks);
+ Executors.MAIN_EXECUTOR.submit(() -> mModelHelper.getModel().addCallbacks(callbacks)).get();
WorkspaceItemInfo info = new WorkspaceItemInfo();
info.intent = new Intent().setComponent(mComponent1);
diff --git a/robolectric_tests/src/com/android/launcher3/model/BackupRestoreTest.java b/tests/src/com/android/launcher3/model/BackupRestoreTest.java
similarity index 62%
rename from robolectric_tests/src/com/android/launcher3/model/BackupRestoreTest.java
rename to tests/src/com/android/launcher3/model/BackupRestoreTest.java
index a397db5..41914de 100644
--- a/robolectric_tests/src/com/android/launcher3/model/BackupRestoreTest.java
+++ b/tests/src/com/android/launcher3/model/BackupRestoreTest.java
@@ -17,6 +17,7 @@
package com.android.launcher3.model;
import static android.content.pm.PackageManager.INSTALL_REASON_DEVICE_RESTORE;
+import static android.os.Process.myUserHandle;
import static com.android.launcher3.LauncherSettings.Favorites.BACKUP_TABLE_NAME;
import static com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME;
@@ -26,74 +27,110 @@
import static com.android.launcher3.util.LauncherModelHelper.APP_ICON;
import static com.android.launcher3.util.LauncherModelHelper.NO__ICON;
import static com.android.launcher3.util.LauncherModelHelper.SHORTCUT;
+import static com.android.launcher3.util.ReflectionHelpers.getField;
+import static com.android.launcher3.util.ReflectionHelpers.setField;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.robolectric.util.ReflectionHelpers.setField;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
import android.app.backup.BackupManager;
import android.content.pm.PackageInstaller;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
-import android.os.Process;
import android.os.UserHandle;
-import android.os.UserManager;
+import android.util.ArrayMap;
+import android.util.LongSparseArray;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
import com.android.launcher3.InvariantDeviceProfile;
+import com.android.launcher3.pm.UserCache;
import com.android.launcher3.provider.RestoreDbTask;
-import com.android.launcher3.shadows.LShadowBackupManager;
import com.android.launcher3.util.LauncherModelHelper;
+import com.android.launcher3.util.SafeCloseable;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowUserManager;
/**
* Tests to verify backup and restore flow.
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(LooperMode.Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class BackupRestoreTest {
- private static final long MY_OLD_PROFILE_ID = 1;
- private static final long MY_PROFILE_ID = 0;
- private static final long OLD_WORK_PROFILE_ID = 11;
- private static final int WORK_PROFILE_ID = 10;
+ private static final int PER_USER_RANGE = 200000;
- private ShadowUserManager mUserManager;
+
+ private long mCurrentMyProfileId;
+ private long mOldMyProfileId;
+
+ private long mCurrentWorkProfileId;
+ private long mOldWorkProfileId;
+
private BackupManager mBackupManager;
private LauncherModelHelper mModelHelper;
private SQLiteDatabase mDb;
private InvariantDeviceProfile mIdp;
+ private UserHandle mWorkUserHandle;
+
+ private SafeCloseable mUserChangeListener;
+
@Before
public void setUp() {
+ mModelHelper = new LauncherModelHelper();
+
+ mCurrentMyProfileId = mModelHelper.defaultProfileId;
+ mOldMyProfileId = mCurrentMyProfileId + 1;
+ mCurrentWorkProfileId = mOldMyProfileId + 1;
+ mOldWorkProfileId = mCurrentWorkProfileId + 1;
+
+ mWorkUserHandle = UserHandle.getUserHandleForUid(PER_USER_RANGE);
+ mUserChangeListener = UserCache.INSTANCE.get(mModelHelper.sandboxContext)
+ .addUserChangeListener(() -> { });
+
setupUserManager();
setupBackupManager();
- mModelHelper = new LauncherModelHelper();
- RestoreDbTask.setPending(RuntimeEnvironment.application);
+ RestoreDbTask.setPending(mModelHelper.sandboxContext);
mDb = mModelHelper.provider.getDb();
- mIdp = InvariantDeviceProfile.INSTANCE.get(RuntimeEnvironment.application);
+ mIdp = InvariantDeviceProfile.INSTANCE.get(mModelHelper.sandboxContext);
+
+ }
+
+ @After
+ public void tearDown() {
+ mUserChangeListener.close();
+ mModelHelper.destroy();
}
private void setupUserManager() {
- final UserManager userManager = RuntimeEnvironment.application.getSystemService(
- UserManager.class);
- mUserManager = Shadow.extract(userManager);
- // sign in to work profile
- mUserManager.addUser(WORK_PROFILE_ID, "work", ShadowUserManager.FLAG_MANAGED_PROFILE);
+ UserCache cache = UserCache.INSTANCE.get(mModelHelper.sandboxContext);
+ synchronized (cache) {
+ LongSparseArray<UserHandle> users = getField(cache, "mUsers");
+ users.clear();
+ users.put(mCurrentMyProfileId, myUserHandle());
+ users.put(mCurrentWorkProfileId, mWorkUserHandle);
+
+ ArrayMap<UserHandle, Long> userMap = getField(cache, "mUserToSerialMap");
+ userMap.clear();
+ userMap.put(myUserHandle(), mCurrentMyProfileId);
+ userMap.put(mWorkUserHandle, mCurrentWorkProfileId);
+ }
}
private void setupBackupManager() {
- mBackupManager = new BackupManager(RuntimeEnvironment.application);
- final LShadowBackupManager bm = Shadow.extract(mBackupManager);
- bm.addProfile(MY_OLD_PROFILE_ID, Process.myUserHandle());
- bm.addProfile(OLD_WORK_PROFILE_ID, UserHandle.of(WORK_PROFILE_ID));
+ mBackupManager = spy(new BackupManager(mModelHelper.sandboxContext));
+ doReturn(myUserHandle()).when(mBackupManager)
+ .getUserForAncestralSerialNumber(eq(mOldMyProfileId));
+ doReturn(mWorkUserHandle).when(mBackupManager)
+ .getUserForAncestralSerialNumber(eq(mOldWorkProfileId));
}
@Test
@@ -118,18 +155,18 @@
{ SHORTCUT, SHORTCUT, NO__ICON, NO__ICON},
{ NO__ICON, NO__ICON, SHORTCUT, SHORTCUT},
{ APP_ICON, SHORTCUT, SHORTCUT, APP_ICON},
- }}, 1, MY_OLD_PROFILE_ID);
+ }}, 1, mOldMyProfileId);
// setup grid for work profile on second screen
mModelHelper.createGrid(new int[][][]{{
{ NO__ICON, APP_ICON, SHORTCUT, SHORTCUT},
{ SHORTCUT, SHORTCUT, NO__ICON, NO__ICON},
{ NO__ICON, NO__ICON, SHORTCUT, SHORTCUT},
{ APP_ICON, SHORTCUT, SHORTCUT, NO__ICON},
- }}, 2, OLD_WORK_PROFILE_ID);
+ }}, 2, mOldWorkProfileId);
// simulates the creation of backup upon restore
- new GridBackupTable(RuntimeEnvironment.application, mDb, mIdp.numDatabaseHotseatIcons,
+ new GridBackupTable(mModelHelper.sandboxContext, mDb, mIdp.numDatabaseHotseatIcons,
mIdp.numColumns, mIdp.numRows).doBackup(
- MY_OLD_PROFILE_ID, GridBackupTable.OPTION_REQUIRES_SANITIZATION);
+ mOldMyProfileId, GridBackupTable.OPTION_REQUIRES_SANITIZATION);
// reset favorites table
createTableUsingOldProfileId();
}
@@ -141,28 +178,28 @@
private void verifyTableIsFilled(String tableName, boolean sanitized) {
assertEquals(sanitized ? 12 : 13, getCount(mDb,
"SELECT * FROM " + tableName + " WHERE profileId = "
- + (sanitized ? MY_PROFILE_ID : MY_OLD_PROFILE_ID)));
+ + (sanitized ? mCurrentMyProfileId : mOldMyProfileId)));
assertEquals(10, getCount(mDb, "SELECT * FROM " + tableName + " WHERE profileId = "
- + (sanitized ? WORK_PROFILE_ID : OLD_WORK_PROFILE_ID)));
+ + (sanitized ? mCurrentWorkProfileId : mOldWorkProfileId)));
}
private void createTableUsingOldProfileId() {
// simulates the creation of favorites table on old device
dropTable(mDb, TABLE_NAME);
- addTableToDb(mDb, MY_OLD_PROFILE_ID, false);
+ addTableToDb(mDb, mOldMyProfileId, false);
}
private void createRestoreSession() throws Exception {
final PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
PackageInstaller.SessionParams.MODE_FULL_INSTALL);
- final PackageInstaller installer = RuntimeEnvironment.application.getPackageManager()
+ final PackageInstaller installer = mModelHelper.sandboxContext.getPackageManager()
.getPackageInstaller();
final int sessionId = installer.createSession(params);
final PackageInstaller.SessionInfo info = installer.getSessionInfo(sessionId);
setField(info, "installReason", INSTALL_REASON_DEVICE_RESTORE);
// TODO: (b/148410677) we should verify the following call instead
// InstallSessionHelper.INSTANCE.get(getContext()).restoreDbIfApplicable(info);
- RestoreDbTask.restoreIfPossible(RuntimeEnvironment.application,
+ RestoreDbTask.restoreIfPossible(mModelHelper.sandboxContext,
mModelHelper.provider.getHelper(), mBackupManager);
}
diff --git a/robolectric_tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java b/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
similarity index 92%
rename from robolectric_tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
rename to tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
index 9ac3fe7..dba0a40 100644
--- a/robolectric_tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
+++ b/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
@@ -16,6 +16,8 @@
import android.os.UserManager;
import androidx.annotation.NonNull;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.icons.BitmapInfo;
@@ -26,13 +28,10 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.LauncherModelHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
import java.util.Arrays;
import java.util.HashSet;
@@ -40,8 +39,8 @@
/**
* Tests for {@link CacheDataUpdatedTask}
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class CacheDataUpdatedTaskTest {
private static final String NEW_LABEL_PREFIX = "new-label-";
@@ -51,10 +50,10 @@
@Before
public void setup() throws Exception {
mModelHelper = new LauncherModelHelper();
- mModelHelper.initializeData("/cache_data_updated_task_data.txt");
+ mModelHelper.initializeData("cache_data_updated_task_data");
// Add placeholder entries in the cache to simulate update
- Context context = RuntimeEnvironment.application;
+ Context context = mModelHelper.sandboxContext;
IconCache iconCache = LauncherAppState.getInstance(context).getIconCache();
CachingLogic<ItemInfo> placeholderLogic = new CachingLogic<ItemInfo>() {
@Override
@@ -86,6 +85,11 @@
}
}
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
+ }
+
private CacheDataUpdatedTask newTask(int op, String... pkg) {
return new CacheDataUpdatedTask(op, Process.myUserHandle(),
new HashSet<>(Arrays.asList(pkg)));
diff --git a/robolectric_tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java b/tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
similarity index 91%
rename from robolectric_tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
rename to tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
index be03c7d..d849c8f 100644
--- a/robolectric_tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
+++ b/tests/src/com/android/launcher3/model/DbDowngradeHelperTest.java
@@ -15,12 +15,13 @@
*/
package com.android.launcher3.model;
+import static androidx.test.InstrumentationRegistry.getContext;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotSame;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@@ -32,6 +33,10 @@
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
import com.android.launcher3.LauncherProvider;
import com.android.launcher3.LauncherProvider.DatabaseHelper;
import com.android.launcher3.LauncherSettings.Favorites;
@@ -40,15 +45,14 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
import java.io.File;
/**
* Tests for {@link DbDowngradeHelper}
*/
-@RunWith(RobolectricTestRunner.class)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class DbDowngradeHelperTest {
private static final String SCHEMA_FILE = "test_schema.json";
@@ -60,7 +64,7 @@
@Before
public void setup() {
- mContext = RuntimeEnvironment.application;
+ mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
mSchemaFile = mContext.getFileStreamPath(SCHEMA_FILE);
mDbFile = mContext.getDatabasePath(DB_FILE);
}
@@ -77,8 +81,10 @@
public void testUpdateSchemaFile() throws Exception {
// Setup mock resources
Resources res = spy(mContext.getResources());
- doAnswer(i ->this.getClass().getResourceAsStream("/db_schema_v10.json"))
- .when(res).openRawResource(eq(R.raw.downgrade_schema));
+ Resources myRes = getContext().getResources();
+ doAnswer(i -> myRes.openRawResource(
+ myRes.getIdentifier("db_schema_v10", "raw", getContext().getPackageName())))
+ .when(res).openRawResource(R.raw.downgrade_schema);
Context context = spy(mContext);
when(context.getResources()).thenReturn(res);
diff --git a/robolectric_tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java b/tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
similarity index 77%
rename from robolectric_tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
rename to tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
index 655237d..004ed06 100644
--- a/robolectric_tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
+++ b/tests/src/com/android/launcher3/model/DefaultLayoutProviderTest.java
@@ -16,18 +16,18 @@
package com.android.launcher3.model;
+import static com.android.launcher3.util.LauncherModelHelper.TEST_ACTIVITY;
import static com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE;
import static org.junit.Assert.assertEquals;
-import static org.robolectric.Shadows.shadowOf;
-import static org.robolectric.util.ReflectionHelpers.setField;
-import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageInstaller;
-import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageInstaller.SessionParams;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.model.data.FolderInfo;
@@ -35,19 +35,16 @@
import com.android.launcher3.util.LauncherLayoutBuilder;
import com.android.launcher3.util.LauncherModelHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
/**
* Tests for layout parser for remote layout
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class DefaultLayoutProviderTest {
private LauncherModelHelper mModelHelper;
@@ -56,16 +53,18 @@
@Before
public void setUp() {
mModelHelper = new LauncherModelHelper();
- mTargetContext = RuntimeEnvironment.application;
+ mTargetContext = mModelHelper.sandboxContext;
+ }
- shadowOf(mTargetContext.getPackageManager())
- .addActivityIfNotPresent(new ComponentName(TEST_PACKAGE, TEST_PACKAGE));
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
}
@Test
public void testCustomProfileLoaded_with_icon_on_hotseat() throws Exception {
writeLayoutAndLoad(new LauncherLayoutBuilder().atHotseat(0)
- .putApp(TEST_PACKAGE, TEST_PACKAGE));
+ .putApp(TEST_PACKAGE, TEST_ACTIVITY));
// Verify one item in hotseat
assertEquals(1, mModelHelper.getBgDataModel().workspaceItems.size());
@@ -77,9 +76,9 @@
@Test
public void testCustomProfileLoaded_with_folder() throws Exception {
writeLayoutAndLoad(new LauncherLayoutBuilder().atHotseat(0).putFolder(android.R.string.copy)
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
.build());
// Verify folder
@@ -92,9 +91,9 @@
@Test
public void testCustomProfileLoaded_with_folder_custom_title() throws Exception {
writeLayoutAndLoad(new LauncherLayoutBuilder().atHotseat(0).putFolder("CustomFolder")
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
- .addApp(TEST_PACKAGE, TEST_PACKAGE)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
+ .addApp(TEST_PACKAGE, TEST_ACTIVITY)
.build());
// Verify folder
@@ -112,12 +111,10 @@
// Add a placeholder session info so that the widget exists
SessionParams params = new SessionParams(SessionParams.MODE_FULL_INSTALL);
params.setAppPackageName(pendingAppPkg);
+ params.setAppIcon(BitmapInfo.LOW_RES_ICON);
PackageInstaller installer = mTargetContext.getPackageManager().getPackageInstaller();
- int sessionId = installer.createSession(params);
- SessionInfo sessionInfo = installer.getSessionInfo(sessionId);
- setField(sessionInfo, "installerPackageName", "com.test");
- setField(sessionInfo, "appIcon", BitmapInfo.LOW_RES_ICON);
+ installer.createSession(params);
writeLayoutAndLoad(new LauncherLayoutBuilder().atWorkspace(0, 1, 0)
.putWidget(pendingAppPkg, "PlaceholderWidget", 2, 2));
diff --git a/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java
similarity index 88%
rename from robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java
rename to tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java
index 87b0887..005389e 100644
--- a/robolectric_tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java
+++ b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.java
@@ -30,26 +30,31 @@
import static org.junit.Assert.assertTrue;
import android.content.Context;
+import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Point;
import android.os.Process;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.LauncherModelHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
+import java.util.HashMap;
import java.util.HashSet;
/** Unit tests for {@link GridSizeMigrationTaskV2} */
-@RunWith(RobolectricTestRunner.class)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class GridSizeMigrationTaskV2Test {
private LauncherModelHelper mModelHelper;
@@ -73,7 +78,7 @@
@Before
public void setUp() {
mModelHelper = new LauncherModelHelper();
- mContext = RuntimeEnvironment.application;
+ mContext = mModelHelper.sandboxContext;
mDb = mModelHelper.provider.getDb();
mValidPackages = new HashSet<>();
@@ -98,8 +103,13 @@
LauncherSettings.Favorites.TMP_TABLE);
}
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
+ }
+
@Test
- public void testMigration() {
+ public void testMigration() throws Exception {
int[] srcHotseatItems = {
mModelHelper.addItem(APP_ICON, 0, HOTSEAT, 0, 0, testPackage1, 1, TMP_CONTENT_URI),
mModelHelper.addItem(SHORTCUT, 1, HOTSEAT, 0, 0, testPackage2, 2, TMP_CONTENT_URI),
@@ -134,17 +144,17 @@
// Check hotseat items
Cursor c = mContext.getContentResolver().query(LauncherSettings.Favorites.CONTENT_URI,
new String[]{LauncherSettings.Favorites.SCREEN, LauncherSettings.Favorites.INTENT},
- "container=" + CONTAINER_HOTSEAT, null, null, null);
+ "container=" + CONTAINER_HOTSEAT, null, LauncherSettings.Favorites.SCREEN, null);
assertEquals(c.getCount(), mIdp.numDatabaseHotseatIcons);
int screenIndex = c.getColumnIndex(LauncherSettings.Favorites.SCREEN);
int intentIndex = c.getColumnIndex(LauncherSettings.Favorites.INTENT);
c.moveToNext();
- assertEquals(c.getInt(screenIndex), 1);
- assertTrue(c.getString(intentIndex).contains(testPackage2));
- c.moveToNext();
assertEquals(c.getInt(screenIndex), 0);
assertTrue(c.getString(intentIndex).contains(testPackage1));
c.moveToNext();
+ assertEquals(c.getInt(screenIndex), 1);
+ assertTrue(c.getString(intentIndex).contains(testPackage2));
+ c.moveToNext();
assertEquals(c.getInt(screenIndex), 2);
assertTrue(c.getString(intentIndex).contains(testPackage3));
c.moveToNext();
@@ -157,35 +167,24 @@
new String[]{LauncherSettings.Favorites.CELLX, LauncherSettings.Favorites.CELLY,
LauncherSettings.Favorites.INTENT},
"container=" + CONTAINER_DESKTOP, null, null, null);
- assertEquals(c.getCount(), 6);
intentIndex = c.getColumnIndex(LauncherSettings.Favorites.INTENT);
int cellXIndex = c.getColumnIndex(LauncherSettings.Favorites.CELLX);
int cellYIndex = c.getColumnIndex(LauncherSettings.Favorites.CELLY);
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage7));
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage6));
- assertEquals(c.getInt(cellXIndex), 0);
- assertEquals(c.getInt(cellYIndex), 3);
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage10));
- assertEquals(c.getInt(cellXIndex), 1);
- assertEquals(c.getInt(cellYIndex), 3);
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage5));
- assertEquals(c.getInt(cellXIndex), 2);
- assertEquals(c.getInt(cellYIndex), 3);
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage9));
- assertEquals(c.getInt(cellXIndex), 3);
- assertEquals(c.getInt(cellYIndex), 3);
- c.moveToNext();
- assertTrue(c.getString(intentIndex).contains(testPackage8));
- assertEquals(c.getInt(cellXIndex), 0);
- assertEquals(c.getInt(cellYIndex), 2);
-
+ HashMap<String, Point> locMap = new HashMap<>();
+ while (c.moveToNext()) {
+ locMap.put(
+ Intent.parseUri(c.getString(intentIndex), 0).getPackage(),
+ new Point(c.getInt(cellXIndex), c.getInt(cellYIndex)));
+ }
c.close();
+
+ assertEquals(locMap.size(), 6);
+ assertEquals(new Point(0, 2), locMap.get(testPackage8));
+ assertEquals(new Point(0, 3), locMap.get(testPackage6));
+ assertEquals(new Point(1, 3), locMap.get(testPackage10));
+ assertEquals(new Point(2, 3), locMap.get(testPackage5));
+ assertEquals(new Point(3, 3), locMap.get(testPackage9));
}
@Test
@@ -212,7 +211,7 @@
// Check hotseat items
Cursor c = mContext.getContentResolver().query(LauncherSettings.Favorites.CONTENT_URI,
new String[]{LauncherSettings.Favorites.SCREEN, LauncherSettings.Favorites.INTENT},
- "container=" + CONTAINER_HOTSEAT, null, null, null);
+ "container=" + CONTAINER_HOTSEAT, null, LauncherSettings.Favorites.SCREEN, null);
assertEquals(c.getCount(), numSrcDatabaseHotseatIcons);
int screenIndex = c.getColumnIndex(LauncherSettings.Favorites.SCREEN);
int intentIndex = c.getColumnIndex(LauncherSettings.Favorites.INTENT);
@@ -257,7 +256,7 @@
// Check hotseat items
Cursor c = mContext.getContentResolver().query(LauncherSettings.Favorites.CONTENT_URI,
new String[]{LauncherSettings.Favorites.SCREEN, LauncherSettings.Favorites.INTENT},
- "container=" + CONTAINER_HOTSEAT, null, null, null);
+ "container=" + CONTAINER_HOTSEAT, null, LauncherSettings.Favorites.SCREEN, null);
assertEquals(c.getCount(), mIdp.numDatabaseHotseatIcons);
int screenIndex = c.getColumnIndex(LauncherSettings.Favorites.SCREEN);
int intentIndex = c.getColumnIndex(LauncherSettings.Favorites.INTENT);
diff --git a/robolectric_tests/src/com/android/launcher3/model/LoaderCursorTest.java b/tests/src/com/android/launcher3/model/LoaderCursorTest.java
similarity index 93%
rename from robolectric_tests/src/com/android/launcher3/model/LoaderCursorTest.java
rename to tests/src/com/android/launcher3/model/LoaderCursorTest.java
index 800311a..6444ef6 100644
--- a/robolectric_tests/src/com/android/launcher3/model/LoaderCursorTest.java
+++ b/tests/src/com/android/launcher3/model/LoaderCursorTest.java
@@ -16,6 +16,8 @@
package com.android.launcher3.model;
+import static androidx.test.InstrumentationRegistry.getContext;
+
import static com.android.launcher3.LauncherSettings.Favorites.CELLX;
import static com.android.launcher3.LauncherSettings.Favorites.CELLY;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER;
@@ -33,7 +35,7 @@
import static com.android.launcher3.LauncherSettings.Favorites.SCREEN;
import static com.android.launcher3.LauncherSettings.Favorites.TITLE;
import static com.android.launcher3.LauncherSettings.Favorites._ID;
-import static com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE;
+import static com.android.launcher3.util.LauncherModelHelper.TEST_ACTIVITY;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -41,37 +43,37 @@
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import static org.robolectric.Shadows.shadowOf;
-
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.database.MatrixCursor;
import android.os.Process;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.LauncherModelHelper;
import com.android.launcher3.util.PackageManagerHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
/**
* Tests for {@link LoaderCursor}
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class LoaderCursorTest {
+ private LauncherModelHelper mModelHelper;
private LauncherAppState mApp;
private MatrixCursor mCursor;
@@ -82,7 +84,8 @@
@Before
public void setup() {
- mContext = RuntimeEnvironment.application;
+ mModelHelper = new LauncherModelHelper();
+ mContext = mModelHelper.sandboxContext;
mIDP = InvariantDeviceProfile.INSTANCE.get(mContext);
mApp = LauncherAppState.getInstance(mContext);
@@ -97,6 +100,11 @@
ums.allUsers.put(0, Process.myUserHandle());
}
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
+ }
+
private void initCursor(int itemType, String title) {
mCursor.newRow()
.add(_ID, 1)
@@ -117,9 +125,7 @@
@Test
public void getAppShortcutInfo_dontAllowMissing_validComponent() throws Exception {
- ComponentName cn = new ComponentName(TEST_PACKAGE, TEST_PACKAGE);
- shadowOf(mContext.getPackageManager()).addActivityIfNotPresent(cn);
-
+ ComponentName cn = new ComponentName(getContext(), TEST_ACTIVITY);
initCursor(ITEM_TYPE_APPLICATION, "");
assertTrue(mLoaderCursor.moveToNext());
diff --git a/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java b/tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
similarity index 65%
rename from robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
rename to tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
index 4319355..42c9f11 100644
--- a/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
+++ b/tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
@@ -15,69 +15,60 @@
*/
package com.android.launcher3.model;
-import static com.android.launcher3.util.Executors.createAndStartNewLooper;
import static com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.spy;
-import static org.robolectric.Shadows.shadowOf;
import android.os.Process;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.shadows.ShadowLooperExecutor;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.LauncherLayoutBuilder;
import com.android.launcher3.util.LauncherModelHelper;
-import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.RunnableList;
+import com.android.launcher3.util.TestUtil;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowPackageManager;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.stream.Collectors;
/**
* Tests to verify multiple callbacks in Loader
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class ModelMultiCallbacksTest {
private LauncherModelHelper mModelHelper;
- private ShadowPackageManager mSpm;
- private LooperExecutor mTempMainExecutor;
-
@Before
- public void setUp() throws Exception {
+ public void setUp() {
mModelHelper = new LauncherModelHelper();
- mModelHelper.installApp(TEST_PACKAGE);
+ }
- mSpm = shadowOf(RuntimeEnvironment.application.getPackageManager());
-
- // Since robolectric tests run on main thread, we run the loader-UI calls on a temp thread,
- // so that we can wait appropriately for the loader to complete.
- mTempMainExecutor = new LooperExecutor(createAndStartNewLooper("tempMain"));
- ShadowLooperExecutor sle = Shadow.extract(Executors.MAIN_EXECUTOR);
- sle.setHandler(mTempMainExecutor.getHandler());
+ @After
+ public void tearDown() throws Exception {
+ mModelHelper.destroy();
+ TestUtil.uninstallDummyApp();
}
@Test
@@ -85,7 +76,7 @@
setupWorkspacePages(3);
MyCallbacks cb1 = spy(MyCallbacks.class);
- mModelHelper.getModel().addCallbacksAndLoad(cb1);
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().addCallbacksAndLoad(cb1));
waitForLoaderAndTempMainThread();
cb1.verifySynchronouslyBound(3);
@@ -94,10 +85,10 @@
cb1.reset();
MyCallbacks cb2 = spy(MyCallbacks.class);
cb2.mPageToBindSync = IntSet.wrap(2);
- mModelHelper.getModel().addCallbacksAndLoad(cb2);
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().addCallbacksAndLoad(cb2));
waitForLoaderAndTempMainThread();
- cb1.verifySynchronouslyBound(3);
+ assertFalse(cb1.bindStarted);
cb2.verifySynchronouslyBound(3);
// Remove callbacks
@@ -105,7 +96,7 @@
cb2.reset();
// No effect on callbacks when removing an callback
- mModelHelper.getModel().removeCallbacks(cb2);
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().removeCallbacks(cb2));
waitForLoaderAndTempMainThread();
assertNull(cb1.mPendingTasks);
assertNull(cb2.mPendingTasks);
@@ -119,52 +110,48 @@
@Test
public void testTwoCallbacks_receiveUpdates() throws Exception {
+ TestUtil.uninstallDummyApp();
+
setupWorkspacePages(1);
MyCallbacks cb1 = spy(MyCallbacks.class);
MyCallbacks cb2 = spy(MyCallbacks.class);
- mModelHelper.getModel().addCallbacksAndLoad(cb1);
- mModelHelper.getModel().addCallbacksAndLoad(cb2);
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().addCallbacksAndLoad(cb1));
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().addCallbacksAndLoad(cb2));
waitForLoaderAndTempMainThread();
- cb1.verifyApps(TEST_PACKAGE);
- cb2.verifyApps(TEST_PACKAGE);
+ assertTrue(cb1.allApps().contains(TEST_PACKAGE));
+ assertTrue(cb2.allApps().contains(TEST_PACKAGE));
// Install package 1
- String pkg1 = "com.test.pkg1";
- mModelHelper.installApp(pkg1);
- mModelHelper.getModel().onPackageAdded(pkg1, Process.myUserHandle());
+ TestUtil.installDummyApp();
+ mModelHelper.getModel().onPackageAdded(TestUtil.DUMMY_PACKAGE, Process.myUserHandle());
waitForLoaderAndTempMainThread();
- cb1.verifyApps(TEST_PACKAGE, pkg1);
- cb2.verifyApps(TEST_PACKAGE, pkg1);
-
- // Install package 2
- String pkg2 = "com.test.pkg2";
- mModelHelper.installApp(pkg2);
- mModelHelper.getModel().onPackageAdded(pkg2, Process.myUserHandle());
- waitForLoaderAndTempMainThread();
- cb1.verifyApps(TEST_PACKAGE, pkg1, pkg2);
- cb2.verifyApps(TEST_PACKAGE, pkg1, pkg2);
+ assertTrue(cb1.allApps().contains(TestUtil.DUMMY_PACKAGE));
+ assertTrue(cb2.allApps().contains(TestUtil.DUMMY_PACKAGE));
// Uninstall package 2
- mSpm.removePackage(pkg1);
- mModelHelper.getModel().onPackageRemoved(pkg1, Process.myUserHandle());
+ TestUtil.uninstallDummyApp();
+ mModelHelper.getModel().onPackageRemoved(TestUtil.DUMMY_PACKAGE, Process.myUserHandle());
waitForLoaderAndTempMainThread();
- cb1.verifyApps(TEST_PACKAGE, pkg2);
- cb2.verifyApps(TEST_PACKAGE, pkg2);
+ assertFalse(cb1.allApps().contains(TestUtil.DUMMY_PACKAGE));
+ assertFalse(cb2.allApps().contains(TestUtil.DUMMY_PACKAGE));
// Unregister a callback and verify updates no longer received
- mModelHelper.getModel().removeCallbacks(cb2);
- mSpm.removePackage(pkg2);
- mModelHelper.getModel().onPackageRemoved(pkg2, Process.myUserHandle());
+ Executors.MAIN_EXECUTOR.execute(() -> mModelHelper.getModel().removeCallbacks(cb2));
+ TestUtil.installDummyApp();
+ mModelHelper.getModel().onPackageAdded(TestUtil.DUMMY_PACKAGE, Process.myUserHandle());
waitForLoaderAndTempMainThread();
- cb1.verifyApps(TEST_PACKAGE);
- cb2.verifyApps(TEST_PACKAGE, pkg2);
+
+ // cb2 didn't get the update
+ assertTrue(cb1.allApps().contains(TestUtil.DUMMY_PACKAGE));
+ assertFalse(cb2.allApps().contains(TestUtil.DUMMY_PACKAGE));
}
private void waitForLoaderAndTempMainThread() throws Exception {
+ Executors.MAIN_EXECUTOR.submit(() -> { }).get();
Executors.MODEL_EXECUTOR.submit(() -> { }).get();
- mTempMainExecutor.submit(() -> { }).get();
+ Executors.MAIN_EXECUTOR.submit(() -> { }).get();
}
private void setupWorkspacePages(int pageCount) throws Exception {
@@ -183,10 +170,16 @@
IntSet mPageBoundSync = new IntSet();
RunnableList mPendingTasks;
AppInfo[] mAppInfos;
+ boolean bindStarted;
MyCallbacks() { }
@Override
+ public void startBinding() {
+ bindStarted = true;
+ }
+
+ @Override
public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
mPageBoundSync = boundPages;
mPendingTasks = pendingTasks;
@@ -212,10 +205,12 @@
mPageBoundSync = new IntSet();
mPendingTasks = null;
mAppInfos = null;
+ bindStarted = false;
}
public void verifySynchronouslyBound(int totalItems) {
// Verify that the requested page is bound synchronously
+ assertTrue(bindStarted);
assertEquals(mPageToBindSync, mPageBoundSync);
assertEquals(mItems.size(), 1);
assertEquals(IntSet.wrap(mItems.get(0).screenId), mPageBoundSync);
@@ -226,12 +221,14 @@
assertEquals(mItems.size(), totalItems);
}
- public void verifyApps(String... apps) {
- assertEquals(apps.length, mAppInfos.length);
- assertEquals(Arrays.stream(mAppInfos)
+ public Set<String> allApps() {
+ return Arrays.stream(mAppInfos)
.map(ai -> ai.getTargetComponent().getPackageName())
- .collect(Collectors.toSet()),
- new HashSet<>(Arrays.asList(apps)));
+ .collect(Collectors.toSet());
+ }
+
+ public void verifyApps(String... apps) {
+ assertTrue(allApps().containsAll(Arrays.asList(apps)));
}
}
}
diff --git a/robolectric_tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java b/tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
similarity index 87%
rename from robolectric_tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
rename to tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
index 412ace0..519191e 100644
--- a/robolectric_tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
+++ b/tests/src/com/android/launcher3/model/PackageInstallStateChangedTaskTest.java
@@ -2,18 +2,19 @@
import static org.junit.Assert.assertEquals;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
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.PackageInstallInfo;
import com.android.launcher3.util.LauncherModelHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.annotation.LooperMode;
-import org.robolectric.annotation.LooperMode.Mode;
import java.util.Arrays;
import java.util.HashSet;
@@ -21,8 +22,8 @@
/**
* Tests for {@link PackageInstallStateChangedTask}
*/
-@RunWith(RobolectricTestRunner.class)
-@LooperMode(Mode.PAUSED)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class PackageInstallStateChangedTaskTest {
private LauncherModelHelper mModelHelper;
@@ -30,7 +31,12 @@
@Before
public void setup() throws Exception {
mModelHelper = new LauncherModelHelper();
- mModelHelper.initializeData("/package_install_state_change_task_data.txt");
+ mModelHelper.initializeData("package_install_state_change_task_data");
+ }
+
+ @After
+ public void tearDown() {
+ mModelHelper.destroy();
}
private PackageInstallStateChangedTask newTask(String pkg, int progress) {
@@ -66,7 +72,7 @@
HashSet<Integer> updates = new HashSet<>(Arrays.asList(idsUpdated));
for (ItemInfo info : mModelHelper.getBgDataModel().itemsIdMap) {
if (info instanceof WorkspaceItemInfo) {
- assertEquals(updates.contains(info.id) ? progress: 0,
+ assertEquals(updates.contains(info.id) ? progress: 100,
((WorkspaceItemInfo) info).getProgressLevel());
} else {
assertEquals(updates.contains(info.id) ? progress: -1,
diff --git a/robolectric_tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java b/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
similarity index 92%
rename from robolectric_tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
rename to tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
index 4184d33..48305ee 100644
--- a/robolectric_tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
+++ b/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
@@ -21,18 +21,21 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.launcher3.LauncherProvider.DatabaseHelper;
import com.android.launcher3.LauncherSettings.Favorites;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
/**
* Tests for {@link RestoreDbTask}
*/
-@RunWith(RobolectricTestRunner.class)
+@SmallTest
+@RunWith(AndroidJUnit4.class)
public class RestoreDbTaskTest {
@Test
@@ -95,7 +98,7 @@
private final long mProfileId;
MyDatabaseHelper(long profileId) {
- super(RuntimeEnvironment.application, null, false);
+ super(InstrumentationRegistry.getInstrumentation().getTargetContext(), null, false);
mProfileId = profileId;
}
diff --git a/tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java b/tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java
new file mode 100644
index 0000000..fd86cf1
--- /dev/null
+++ b/tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.secondarydisplay;
+
+import static androidx.test.core.app.ActivityScenario.launch;
+
+import androidx.test.core.app.ActivityScenario;
+import androidx.test.espresso.intent.Intents;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Tests for {@link SecondaryDisplayLauncher}
+ */
+@MediumTest
+@RunWith(AndroidJUnit4.class)
+public class SDLauncherTest {
+
+ @Before
+ public void setUp() {
+ Intents.init();
+ }
+
+ @After
+ public void tearDown() {
+ Intents.release();
+ }
+
+ @Test
+ public void testAllAppsListOpens() {
+ ActivityScenario<SecondaryDisplayLauncher> launcher =
+ launch(SecondaryDisplayLauncher.class);
+ launcher.onActivity(l -> l.showAppDrawer(true));
+ }
+}
diff --git a/robolectric_tests/src/com/android/launcher3/settings/SettingsActivityTest.java b/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
similarity index 96%
rename from robolectric_tests/src/com/android/launcher3/settings/SettingsActivityTest.java
rename to tests/src/com/android/launcher3/settings/SettingsActivityTest.java
index 3271812..1c205f0 100644
--- a/robolectric_tests/src/com/android/launcher3/settings/SettingsActivityTest.java
+++ b/tests/src/com/android/launcher3/settings/SettingsActivityTest.java
@@ -55,6 +55,7 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -75,6 +76,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_aboutTap_launchesActivity() {
ActivityScenario.launch(SettingsActivity.class);
onView(withId(R.id.recycler_view)).perform(
@@ -88,6 +90,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_developerOptionsTap_launchesActivityWithFragment() {
PluginPrefs.setHasPlugins(mApplicationContext);
ActivityScenario.launch(SettingsActivity.class);
@@ -100,6 +103,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_aboutScreenIntent() {
Bundle fragmentArgs = new Bundle();
fragmentArgs.putString(ARG_PREFERENCE_ROOT, "about_screen");
@@ -114,6 +118,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_developerOptionsFragmentIntent() {
Intent intent = new Intent(mApplicationContext, SettingsActivity.class)
.putExtra(EXTRA_FRAGMENT, DeveloperOptionsFragment.class.getName());
@@ -125,6 +130,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_intentWithUnknownFragment() {
String fragmentClass = PreferenceFragmentCompat.class.getName();
Intent intent = new Intent(mApplicationContext, SettingsActivity.class)
@@ -139,6 +145,7 @@
}
@Test
+ @Ignore // b/199309785
public void testSettings_backButtonFinishesActivity() {
Bundle fragmentArgs = new Bundle();
fragmentArgs.putString(ARG_PREFERENCE_ROOT, "about_screen");
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index a5694fc..ccbb662 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -42,7 +42,6 @@
import com.android.launcher3.util.LauncherBindableItemsContainer.ItemOperator;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.Wait.Condition;
-import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.ShellCommandRule;
import org.junit.Before;
@@ -78,7 +77,6 @@
public void testEmpty() throws Throwable { /* needed while the broken tests are being fixed */ }
@Test
- @ScreenRecord //b/192010616
public void testPinWidgetNoConfig() throws Throwable {
runTest("pinWidgetNoConfig", true, (info, view) -> info instanceof LauncherAppWidgetInfo &&
((LauncherAppWidgetInfo) info).appWidgetId == mAppWidgetId &&
diff --git a/robolectric_tests/src/com/android/launcher3/util/LauncherLayoutBuilder.java b/tests/src/com/android/launcher3/util/LauncherLayoutBuilder.java
similarity index 100%
rename from robolectric_tests/src/com/android/launcher3/util/LauncherLayoutBuilder.java
rename to tests/src/com/android/launcher3/util/LauncherLayoutBuilder.java
diff --git a/robolectric_tests/src/com/android/launcher3/util/LauncherModelHelper.java b/tests/src/com/android/launcher3/util/LauncherModelHelper.java
similarity index 61%
rename from robolectric_tests/src/com/android/launcher3/util/LauncherModelHelper.java
rename to tests/src/com/android/launcher3/util/LauncherModelHelper.java
index 846e201..59966ee 100644
--- a/robolectric_tests/src/com/android/launcher3/util/LauncherModelHelper.java
+++ b/tests/src/com/android/launcher3/util/LauncherModelHelper.java
@@ -15,26 +15,40 @@
*/
package com.android.launcher3.util;
-import static android.content.Intent.ACTION_CREATE_SHORTCUT;
+import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static com.android.launcher3.LauncherSettings.Favorites.CONTENT_URI;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeast;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
-import static org.robolectric.Shadows.shadowOf;
import android.content.ComponentName;
+import android.content.ContentProvider;
+import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.PackageManager;
+import android.content.pm.ProviderInfo;
+import android.content.res.Resources;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
+import android.os.ParcelFileDescriptor;
+import android.os.ParcelFileDescriptor.AutoCloseOutputStream;
import android.os.Process;
import android.provider.Settings;
+import android.test.mock.MockContentResolver;
+import android.util.ArrayMap;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.uiautomator.UiDevice;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
@@ -45,27 +59,29 @@
import com.android.launcher3.model.AllAppsList;
import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.BgDataModel.Callbacks;
+import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.pm.UserCache;
-import com.android.launcher3.shadows.ShadowLooperExecutor;
+import com.android.launcher3.testing.TestInformationProvider;
+import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
+import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;
+import com.android.launcher3.widget.custom.CustomWidgetManager;
import org.mockito.ArgumentCaptor;
-import org.robolectric.Robolectric;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowContentResolver;
-import org.robolectric.shadows.ShadowPackageManager;
-import org.robolectric.util.ReflectionHelpers;
import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.function.Function;
@@ -81,7 +97,9 @@
public static final int APP_ICON = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
public static final int SHORTCUT = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
public static final int NO__ICON = -1;
- public static final String TEST_PACKAGE = "com.android.launcher3.validpackage";
+
+ public static final String TEST_PACKAGE = testContext().getPackageName();
+ public static final String TEST_ACTIVITY = "com.android.launcher3.tests.Activity2";
// Authority for providing a test default-workspace-layout data.
private static final String TEST_PROVIDER_AUTHORITY =
@@ -90,21 +108,42 @@
private static final int DEFAULT_GRID_SIZE = 4;
private final HashMap<Class, HashMap<String, Field>> mFieldCache = new HashMap<>();
+ private final MockContentResolver mMockResolver = new MockContentResolver();
public final TestLauncherProvider provider;
- private final long mDefaultProfileId;
+ public final SanboxModelContext sandboxContext;
+
+ public final long defaultProfileId;
private BgDataModel mDataModel;
private AllAppsList mAllAppsList;
public LauncherModelHelper() {
- provider = Robolectric.setupContentProvider(TestLauncherProvider.class);
- mDefaultProfileId = UserCache.INSTANCE.get(RuntimeEnvironment.application)
+ Context context = getApplicationContext();
+ // System settings cache content provider. Ensure that they are statically initialized
+ Settings.Secure.getString(context.getContentResolver(), "test");
+ Settings.System.getString(context.getContentResolver(), "test");
+ Settings.Global.getString(context.getContentResolver(), "test");
+
+ provider = new TestLauncherProvider();
+ sandboxContext = new SanboxModelContext();
+ defaultProfileId = UserCache.INSTANCE.get(sandboxContext)
.getSerialNumberForUser(Process.myUserHandle());
- ShadowContentResolver.registerProviderInternal(LauncherProvider.AUTHORITY, provider);
+ setupProvider(LauncherProvider.AUTHORITY, provider);
+ }
+
+ protected void setupProvider(String authority, ContentProvider provider) {
+ ProviderInfo providerInfo = new ProviderInfo();
+ providerInfo.authority = authority;
+ providerInfo.applicationInfo = sandboxContext.getApplicationInfo();
+ provider.attachInfo(sandboxContext, providerInfo);
+ mMockResolver.addProvider(providerInfo.authority, provider);
+ doReturn(providerInfo)
+ .when(sandboxContext.mPm)
+ .resolveContentProvider(eq(authority), anyInt());
}
public LauncherModel getModel() {
- return LauncherAppState.getInstance(RuntimeEnvironment.application).getModel();
+ return LauncherAppState.getInstance(sandboxContext).getModel();
}
public synchronized BgDataModel getBgDataModel() {
@@ -121,6 +160,28 @@
return mAllAppsList;
}
+ public void destroy() {
+ // When destroying the context, make sure that the model thread is blocked, so that no
+ // new jobs get posted while we are cleaning up
+ CountDownLatch l1 = new CountDownLatch(1);
+ CountDownLatch l2 = new CountDownLatch(1);
+ MODEL_EXECUTOR.execute(() -> {
+ l1.countDown();
+ waitOrThrow(l2);
+ });
+ waitOrThrow(l1);
+ sandboxContext.onDestroy();
+ l2.countDown();
+ }
+
+ private void waitOrThrow(CountDownLatch latch) {
+ try {
+ latch.await();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
/**
* Synchronously executes the task and returns all the UI callbacks posted.
*/
@@ -161,13 +222,16 @@
* Initializes mock data for the test.
*/
public void initializeData(String resourceName) throws Exception {
- Context targetContext = RuntimeEnvironment.application;
BgDataModel bgDataModel = getBgDataModel();
AllAppsList allAppsList = getAllAppsList();
MODEL_EXECUTOR.submit(() -> {
+ // Copy apk from resources to a local file and install from there.
+ Resources resources = testContext().getResources();
+ int resId = resources.getIdentifier(
+ resourceName, "raw", testContext().getPackageName());
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
- this.getClass().getResourceAsStream(resourceName)))) {
+ resources.openRawResource(resId)))) {
String line;
HashMap<String, Class> classMap = new HashMap<>();
while ((line = reader.readLine()) != null) {
@@ -181,7 +245,7 @@
classMap.put(commands[1], Class.forName(commands[2]));
break;
case "bgItem":
- bgDataModel.addItem(targetContext,
+ bgDataModel.addItem(sandboxContext,
(ItemInfo) initItem(classMap.get(commands[1]), commands, 2),
false);
break;
@@ -236,7 +300,7 @@
}
public int addItem(int type, int screen, int container, int x, int y) {
- return addItem(type, screen, container, x, y, mDefaultProfileId, TEST_PACKAGE);
+ return addItem(type, screen, container, x, y, defaultProfileId, TEST_PACKAGE);
}
public int addItem(int type, int screen, int container, int x, int y, long profileId) {
@@ -244,12 +308,12 @@
}
public int addItem(int type, int screen, int container, int x, int y, String packageName) {
- return addItem(type, screen, container, x, y, mDefaultProfileId, packageName);
+ return addItem(type, screen, container, x, y, defaultProfileId, packageName);
}
public int addItem(int type, int screen, int container, int x, int y, String packageName,
int id, Uri contentUri) {
- addItem(type, screen, container, x, y, mDefaultProfileId, packageName, id, contentUri);
+ addItem(type, screen, container, x, y, defaultProfileId, packageName, id, contentUri);
return id;
}
@@ -260,8 +324,7 @@
*/
public int addItem(int type, int screen, int container, int x, int y, long profileId,
String packageName) {
- Context context = RuntimeEnvironment.application;
- int id = LauncherSettings.Settings.call(context.getContentResolver(),
+ int id = LauncherSettings.Settings.call(sandboxContext.getContentResolver(),
LauncherSettings.Settings.METHOD_NEW_ITEM_ID)
.getInt(LauncherSettings.Settings.EXTRA_VALUE);
addItem(type, screen, container, x, y, profileId, packageName, id, CONTENT_URI);
@@ -270,8 +333,6 @@
public void addItem(int type, int screen, int container, int x, int y, long profileId,
String packageName, int id, Uri contentUri) {
- Context context = RuntimeEnvironment.application;
-
ContentValues values = new ContentValues();
values.put(LauncherSettings.Favorites._ID, id);
values.put(LauncherSettings.Favorites.CONTAINER, container);
@@ -295,7 +356,7 @@
}
}
- context.getContentResolver().insert(contentUri, values);
+ sandboxContext.getContentResolver().insert(contentUri, values);
}
public int[][][] createGrid(int[][][] typeArray) {
@@ -303,12 +364,11 @@
}
public int[][][] createGrid(int[][][] typeArray, int startScreen) {
- final Context context = RuntimeEnvironment.application;
- LauncherSettings.Settings.call(context.getContentResolver(),
+ LauncherSettings.Settings.call(sandboxContext.getContentResolver(),
LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
- LauncherSettings.Settings.call(context.getContentResolver(),
+ LauncherSettings.Settings.call(sandboxContext.getContentResolver(),
LauncherSettings.Settings.METHOD_CLEAR_EMPTY_DB_FLAG);
- return createGrid(typeArray, startScreen, mDefaultProfileId);
+ return createGrid(typeArray, startScreen, defaultProfileId);
}
/**
@@ -320,14 +380,13 @@
* @return the same grid representation where each entry is the corresponding item id.
*/
public int[][][] createGrid(int[][][] typeArray, int startScreen, long profileId) {
- Context context = RuntimeEnvironment.application;
int[][][] ids = new int[typeArray.length][][];
for (int i = 0; i < typeArray.length; i++) {
// Add screen to DB
int screenId = startScreen + i;
// Keep the screen id counter up to date
- LauncherSettings.Settings.call(context.getContentResolver(),
+ LauncherSettings.Settings.call(sandboxContext.getContentResolver(),
LauncherSettings.Settings.METHOD_NEW_SCREEN_ID);
ids[i] = new int[typeArray[i].length][];
@@ -353,69 +412,45 @@
*/
public LauncherModelHelper setupDefaultLayoutProvider(LauncherLayoutBuilder builder)
throws Exception {
- Context context = RuntimeEnvironment.application;
- InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(context);
+ InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(sandboxContext);
idp.numRows = idp.numColumns = idp.numDatabaseHotseatIcons = DEFAULT_GRID_SIZE;
idp.iconBitmapSize = DEFAULT_BITMAP_SIZE;
- Settings.Secure.putString(context.getContentResolver(),
- "launcher3.layout.provider", TEST_PROVIDER_AUTHORITY);
+ UiDevice.getInstance(getInstrumentation()).executeShellCommand(
+ "settings put secure launcher3.layout.provider " + TEST_PROVIDER_AUTHORITY);
+ ContentProvider cp = new TestInformationProvider() {
- shadowOf(context.getPackageManager())
- .addProviderIfNotPresent(new ComponentName("com.test", "Mock")).authority =
- TEST_PROVIDER_AUTHORITY;
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- builder.build(new OutputStreamWriter(bos));
- Uri layoutUri = LauncherProvider.getLayoutUri(TEST_PROVIDER_AUTHORITY, context);
- shadowOf(context.getContentResolver()).registerInputStream(layoutUri,
- new ByteArrayInputStream(bos.toByteArray()));
+ @Override
+ public ParcelFileDescriptor openFile(Uri uri, String mode)
+ throws FileNotFoundException {
+ 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();
+ return pipe[0];
+ } catch (Exception e) {
+ throw new FileNotFoundException(e.getMessage());
+ }
+ }
+ };
+ setupProvider(TEST_PROVIDER_AUTHORITY, cp);
return this;
}
/**
- * Simulates an apk install with a default main activity with same class and package name
- */
- public void installApp(String component) throws NameNotFoundException {
- IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN);
- filter.addCategory(Intent.CATEGORY_LAUNCHER);
- installApp(component, component, filter);
- }
-
- /**
- * Simulates a custom shortcut install
- */
- public void installCustomShortcut(String pkg, String clazz) throws NameNotFoundException {
- installApp(pkg, clazz, new IntentFilter(ACTION_CREATE_SHORTCUT));
- }
-
- private void installApp(String pkg, String clazz, IntentFilter filter)
- throws NameNotFoundException {
- ShadowPackageManager spm = shadowOf(RuntimeEnvironment.application.getPackageManager());
- ComponentName cn = new ComponentName(pkg, clazz);
- spm.addActivityIfNotPresent(cn);
-
- filter.addCategory(Intent.CATEGORY_DEFAULT);
- spm.addIntentFilterForActivity(cn, filter);
- }
-
- /**
* Loads the model in memory synchronously
*/
public void loadModelSync() throws ExecutionException, InterruptedException {
- // Since robolectric tests run on main thread, we run the loader-UI calls on a temp thread,
- // so that we can wait appropriately for the loader to complete.
- ShadowLooperExecutor sle = Shadow.extract(Executors.MAIN_EXECUTOR);
- sle.setHandler(Executors.UI_HELPER_EXECUTOR.getHandler());
-
- Callbacks mockCb = mock(Callbacks.class);
- getModel().addCallbacksAndLoad(mockCb);
+ Callbacks mockCb = new Callbacks() { };
+ Executors.MAIN_EXECUTOR.submit(() -> getModel().addCallbacksAndLoad(mockCb)).get();
Executors.MODEL_EXECUTOR.submit(() -> { }).get();
- Executors.UI_HELPER_EXECUTOR.submit(() -> { }).get();
-
- sle.setHandler(null);
- getModel().removeCallbacks(mockCb);
+ Executors.MAIN_EXECUTOR.submit(() -> { }).get();
+ Executors.MAIN_EXECUTOR.submit(() -> getModel().removeCallbacks(mockCb)).get();
}
/**
@@ -437,4 +472,91 @@
return mOpenHelper;
}
}
+
+ public static boolean deleteContents(File dir) {
+ File[] files = dir.listFiles();
+ boolean success = true;
+ if (files != null) {
+ for (File file : files) {
+ if (file.isDirectory()) {
+ success &= deleteContents(file);
+ }
+ if (!file.delete()) {
+ success = false;
+ }
+ }
+ }
+ return success;
+ }
+
+ public class SanboxModelContext extends SandboxContext {
+
+ private final ArrayMap<String, Object> mSpiedServices = new ArrayMap<>();
+ private final PackageManager mPm;
+ private final File mDbDir;
+
+ SanboxModelContext() {
+ super(ApplicationProvider.getApplicationContext(),
+ UserCache.INSTANCE, InstallSessionHelper.INSTANCE,
+ LauncherAppState.INSTANCE, InvariantDeviceProfile.INSTANCE,
+ DisplayController.INSTANCE, CustomWidgetManager.INSTANCE,
+ SettingsCache.INSTANCE, PluginManagerWrapper.INSTANCE,
+ ItemInstallQueue.INSTANCE);
+ mPm = spy(getBaseContext().getPackageManager());
+ mDbDir = new File(getCacheDir(), UUID.randomUUID().toString());
+ }
+
+ public SanboxModelContext allow(MainThreadInitializedObject object) {
+ mAllowedObjects.add(object);
+ return this;
+ }
+
+ @Override
+ public File getDatabasePath(String name) {
+ if (!mDbDir.exists()) {
+ mDbDir.mkdirs();
+ }
+ return new File(mDbDir, name);
+ }
+
+ @Override
+ public ContentResolver getContentResolver() {
+ return mMockResolver;
+ }
+
+ @Override
+ public void onDestroy() {
+ if (deleteContents(mDbDir)) {
+ mDbDir.delete();
+ }
+ super.onDestroy();
+ }
+
+ @Override
+ public PackageManager getPackageManager() {
+ return mPm;
+ }
+
+ @Override
+ public Object getSystemService(String name) {
+ Object service = mSpiedServices.get(name);
+ return service != null ? service : super.getSystemService(name);
+ }
+
+ public <T> T spyService(Class<T> tClass) {
+ String name = getSystemServiceName(tClass);
+ Object service = mSpiedServices.get(name);
+ if (service != null) {
+ return (T) service;
+ }
+
+ T result = spy(getSystemService(tClass));
+ mSpiedServices.put(name, result);
+ return result;
+ }
+ }
+
+ private static Context testContext() {
+ return getInstrumentation().getContext();
+ }
}
diff --git a/tests/src/com/android/launcher3/util/ReflectionHelpers.java b/tests/src/com/android/launcher3/util/ReflectionHelpers.java
new file mode 100644
index 0000000..d89975d
--- /dev/null
+++ b/tests/src/com/android/launcher3/util/ReflectionHelpers.java
@@ -0,0 +1,58 @@
+/*
+ * 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.util;
+
+import java.lang.reflect.Field;
+
+public class ReflectionHelpers {
+
+ /**
+ * Reflectively get the value of a field.
+ *
+ * @param object Target object.
+ * @param fieldName The field name.
+ * @param <R> The return type.
+ * @return Value of the field on the object.
+ */
+ public static <R> R getField(Object object, String fieldName) {
+ try {
+ Field field = object.getClass().getDeclaredField(fieldName);
+ field.setAccessible(true);
+ return (R) field.get(object);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Reflectively set the value of a field.
+ *
+ * @param object Target object.
+ * @param fieldName The field name.
+ * @param fieldNewValue New value.
+ */
+ public static void setField(Object object, String fieldName, Object fieldNewValue) {
+ try {
+ Field field = object.getClass().getDeclaredField(fieldName);
+ field.setAccessible(true);
+ field.set(object, fieldNewValue);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index f1fe508..ea8a295 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -1550,7 +1550,7 @@
try {
return object.getVisibleBounds();
} catch (StaleObjectException e) {
- fail("Object " + object + " disappeared from screen");
+ fail("Object disappeared from screen");
return null;
} catch (Throwable t) {
fail(t.toString());
@@ -1559,9 +1559,12 @@
}
float getWindowCornerRadius() {
+ // TODO(b/197326121): Check if the touch is overlapping with the corners by offsetting
+ final float tmpBuffer = 100f;
final Resources resources = getResources();
if (!supportsRoundedCornersOnWindows(resources)) {
- return 0f;
+ Log.d(TAG, "No rounded corners");
+ return tmpBuffer;
}
// Radius that should be used in case top or bottom aren't defined.
@@ -1579,7 +1582,8 @@
// Always use the smallest radius to make sure the rounded corners will
// completely cover the display.
- return Math.min(topRadius, bottomRadius);
+ Log.d(TAG, "Rounded corners top: " + topRadius + " bottom: " + bottomRadius);
+ return Math.max(topRadius, bottomRadius) + tmpBuffer;
}
private static boolean supportsRoundedCornersOnWindows(Resources resources) {
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index db2e250..288c853 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -83,9 +83,9 @@
+ mLauncher.getTouchSlop());
mLauncher.swipeToState(
- 0,
+ windowCornerRadius,
startY,
- 0,
+ windowCornerRadius,
startY - swipeHeight - mLauncher.getTouchSlop(),
12,
ALL_APPS_STATE_ORDINAL, LauncherInstrumentation.GestureScope.INSIDE);