Merge "Showing Toast message when the target package is null for the disabled shortcut" into tm-qpr-dev
diff --git a/Android.bp b/Android.bp
index 4adbf53..330c32e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -35,9 +35,7 @@
],
srcs: [
"tests/tapl/**/*.java",
- "src/com/android/launcher3/ResourceUtils.java",
- "src/com/android/launcher3/testing/TestProtocol.java",
- "src/com/android/launcher3/testing/*Request.java",
+ "src/com/android/launcher3/testing/shared/**/*.java",
],
resource_dirs: [ ],
manifest: "tests/tapl/AndroidManifest.xml",
diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
index d16e12c..a91ff44 100644
--- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
+++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
@@ -33,6 +33,7 @@
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.ShortcutAndWidgetContainer;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/go/quickstep/res/values-am/strings.xml b/go/quickstep/res/values-am/strings.xml
index 1bfaf66..ed34797 100644
--- a/go/quickstep/res/values-am/strings.xml
+++ b/go/quickstep/res/values-am/strings.xml
@@ -9,12 +9,12 @@
<string name="dialog_cancel" msgid="6464336969134856366">"ይቅር"</string>
<string name="dialog_settings" msgid="6564397136021186148">"ቅንብሮች"</string>
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"በማያ ገጹ ላይ ጽሑፍን ይተረጉሙ ወይም ያዳምጡ"</string>
- <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"እንደ በማያ ገጽዎ ላይ ያለ ጽሑፍ፣ የድር አድራሻዎች እና ቅጽበታዊ ገጽ እይታዎች ያሉ መረጃዎች ለGoogle ሊጋሩ ይችላሉ።\n\nምን መረጃ እንደሚያጋሩ ለመቀየር ወደ "<b>"ቅንብሮች > መተግበሪያዎች > ነባሪ መተግበሪያዎች > ዲጂታል ረዳት መተግበሪያ"</b>" ይሂዱ።"</string>
+ <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"እንደ በማያ ገጽዎ ላይ ያለ ጽሁፍ፣ የድር አድራሻዎች እና ቅጽበታዊ ገጽ እይታዎች ያሉ መረጃዎች ለGoogle ሊጋሩ ይችላሉ።\n\nምን መረጃ እንደሚያጋሩ ለመቀየር ወደ "<b>"ቅንብሮች > መተግበሪያዎች > ነባሪ መተግበሪያዎች > ዲጂታል ረዳት መተግበሪያ"</b>" ይሂዱ።"</string>
<string name="assistant_not_selected_title" msgid="5017072974603345228">"ይህንን ባህሪ ለመጠቀም ረዳት ይምረጡ"</string>
<string name="assistant_not_selected_text" msgid="3244613673884359276">"በማያ ገጽዎ ላይ ጽሑፍን ለማዳመጥ ወይም ለመተርጎም በቅንብሮች ውስጥ የዲጂታል ረዳት መተግበሪያን ይምረጡ"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"ይህንን ባህሪ ለመጠቀም ረዳትዎን ይቀይሩ"</string>
<string name="assistant_not_supported_text" msgid="1708031078549268884">"በማያ ገጽዎ ላይ ጽሑፍን ለማዳመጥ ወይም ለመተርጎም በቅንብሮች ውስጥ የዲጂታል ረዳት መተግበሪያዎን ይቀይሩ"</string>
- <string name="tooltip_listen" msgid="7634466447860989102">"በዚህ ማያ ገጽ ላይ ጽሑፍ ለማዳመጥ እዚህ መታ ያድርጉ"</string>
- <string name="tooltip_translate" msgid="4184845868901542567">"በዚህ ማያ ገጽ ላይ ጽሑፍ ለመተርጎም እዚህ መታ ያድርጉ"</string>
+ <string name="tooltip_listen" msgid="7634466447860989102">"በዚህ ማያ ገጽ ላይ ጽሁፍ ለማዳመጥ እዚህ መታ ያድርጉ"</string>
+ <string name="tooltip_translate" msgid="4184845868901542567">"በዚህ ማያ ገጽ ላይ ጽሁፍ ለመተርጎም እዚህ መታ ያድርጉ"</string>
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"ይህ መተግበሪያ ሊጋራ አይችልም"</string>
</resources>
diff --git a/go/quickstep/res/values-or/strings.xml b/go/quickstep/res/values-or/strings.xml
index 36de437..6a3c5dc 100644
--- a/go/quickstep/res/values-or/strings.xml
+++ b/go/quickstep/res/values-or/strings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_share_drop_target_label" msgid="5804774105974539508">"ଆପ୍ ସେୟାର୍ କରନ୍ତୁ"</string>
+ <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>
diff --git a/go/src/com/android/launcher3/model/WidgetsModel.java b/go/src/com/android/launcher3/model/WidgetsModel.java
index 1aa5d03..9a000d6 100644
--- a/go/src/com/android/launcher3/model/WidgetsModel.java
+++ b/go/src/com/android/launcher3/model/WidgetsModel.java
@@ -41,8 +41,10 @@
*/
public class WidgetsModel {
- // True is the widget support is disabled.
+ // True if the widget support is disabled.
public static final boolean GO_DISABLE_WIDGETS = true;
+ // True if the shortcut support is disabled.
+ public static final boolean GO_DISABLE_SHORTCUTS = true;
public static final boolean GO_DISABLE_NOTIFICATION_DOTS = true;
private static final ArrayList<WidgetsListBaseEntry> EMPTY_WIDGET_LIST = new ArrayList<>();
diff --git a/proguard.flags b/proguard.flags
index a450183..53a68de 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -2,10 +2,6 @@
*;
}
--keep class com.android.launcher3.graphics.ShadowDrawable {
- public <init>(...);
-}
-
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
diff --git a/protos/view_capture.proto b/protos/view_capture.proto
index 98574dd..f363f36 100644
--- a/protos/view_capture.proto
+++ b/protos/view_capture.proto
@@ -23,6 +23,7 @@
message ExportedData {
repeated FrameData frameData = 1;
+ repeated string classname = 2;
}
message FrameData {
@@ -31,24 +32,28 @@
}
message ViewNode {
- optional string classname = 1;
- optional string id = 2;
- optional int32 left = 3;
- optional int32 top = 4;
- optional int32 width = 5;
- optional int32 height = 6;
- optional int32 scrollX = 7;
- optional int32 scrollY = 8;
+ optional int32 classname_index = 1;
+ optional int32 hashcode = 2;
- optional float translationX = 9;
- optional float translationY = 10;
- optional float scaleX = 11 [default = 1];
- optional float scaleY = 12 [default = 1];
- optional float alpha = 13 [default = 1];
+ repeated ViewNode children = 3;
- optional bool willNotDraw = 14;
- optional bool clipChildren = 15;
- optional int32 visibility = 16;
+ optional string id = 4;
+ optional int32 left = 5;
+ optional int32 top = 6;
+ optional int32 width = 7;
+ optional int32 height = 8;
+ optional int32 scrollX = 9;
+ optional int32 scrollY = 10;
- repeated ViewNode children = 17;
+ optional float translationX = 11;
+ optional float translationY = 12;
+ optional float scaleX = 13 [default = 1];
+ optional float scaleY = 14 [default = 1];
+ optional float alpha = 15 [default = 1];
+
+ optional bool willNotDraw = 16;
+ optional bool clipChildren = 17;
+ optional int32 visibility = 18;
+
+ optional float elevation = 19;
}
diff --git a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
index e5f0295..0c1f05f 100644
--- a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
+++ b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
@@ -23,14 +23,16 @@
import androidx.annotation.Nullable;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
-import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.testing.DebugTestInformationHandler;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.quickstep.TouchInteractionService.TISBinder;
+import com.android.quickstep.util.TISBindHelper;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
+import java.util.function.Consumer;
/**
* Class to handle requests from tests, including debug ones, to Quickstep Launcher builds.
@@ -49,29 +51,26 @@
Bundle response = new Bundle();
switch (method) {
case TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING:
- runOnUIThread(l -> {
- enableManualTaskbarStashing(l, true);
+ runOnTISBinder(tisBinder -> {
+ enableManualTaskbarStashing(tisBinder, true);
});
return response;
case TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING:
- runOnUIThread(l -> {
- enableManualTaskbarStashing(l, false);
+ runOnTISBinder(tisBinder -> {
+ enableManualTaskbarStashing(tisBinder, false);
});
return response;
case TestProtocol.REQUEST_UNSTASH_TASKBAR_IF_STASHED:
- runOnUIThread(l -> {
- enableManualTaskbarStashing(l, true);
-
- BaseQuickstepLauncher quickstepLauncher = (BaseQuickstepLauncher) l;
- LauncherTaskbarUIController taskbarUIController =
- quickstepLauncher.getTaskbarUIController();
+ runOnTISBinder(tisBinder -> {
+ enableManualTaskbarStashing(tisBinder, true);
// Allow null-pointer to catch illegal states.
- taskbarUIController.unstashTaskbarIfStashed();
+ tisBinder.getTaskbarManager().getCurrentActivityContext()
+ .unstashTaskbarIfStashed();
- enableManualTaskbarStashing(l, false);
+ enableManualTaskbarStashing(tisBinder, false);
});
return response;
@@ -82,6 +81,11 @@
return response;
}
+ case TestProtocol.REQUEST_RECREATE_TASKBAR:
+ // Allow null-pointer to catch illegal states.
+ runOnTISBinder(tisBinder -> tisBinder.getTaskbarManager().recreateTaskbar());
+ return response;
+
default:
response = super.call(method, arg, extras);
if (response != null) return response;
@@ -89,24 +93,26 @@
}
}
- private void enableManualTaskbarStashing(Launcher launcher, boolean enable) {
- BaseQuickstepLauncher quickstepLauncher = (BaseQuickstepLauncher) launcher;
- LauncherTaskbarUIController taskbarUIController =
- quickstepLauncher.getTaskbarUIController();
-
+ private void enableManualTaskbarStashing(TISBinder tisBinder, boolean enable) {
// Allow null-pointer to catch illegal states.
- taskbarUIController.enableManualStashingForTests(enable);
+ tisBinder.getTaskbarManager().getCurrentActivityContext().enableManualStashingForTests(
+ enable);
}
/**
- * Runs the given command on the UI thread.
+ * Runs the given command on the UI thread, after ensuring we are connected to
+ * TouchInteractionService.
*/
- private static void runOnUIThread(UIThreadCommand command) {
+ private void runOnTISBinder(Consumer<TISBinder> connectionCallback) {
try {
- MAIN_EXECUTOR.submit(() -> {
- command.execute(Launcher.ACTIVITY_TRACKER.getCreatedActivity());
- return null;
- }).get();
+ CountDownLatch countDownLatch = new CountDownLatch(1);
+ TISBindHelper helper = MAIN_EXECUTOR.submit(() ->
+ new TISBindHelper(mContext, tisBinder -> {
+ connectionCallback.accept(tisBinder);
+ countDownLatch.countDown();
+ })).get();
+ countDownLatch.await();
+ MAIN_EXECUTOR.submit(helper::onDestroy);
} catch (ExecutionException | InterruptedException e) {
throw new RuntimeException(e);
}
diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml
index e834157..34805ea 100644
--- a/quickstep/res/values-af/strings.xml
+++ b/quickstep/res/values-af/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Kry programvoorstelle op jou tuisskerm se gunstelingery"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Kry maklik toegang tot jou programme wat die meeste gebruik word, direk van die tuisskerm af. Voorstelle sal verander op grond van jou roetines. Programme in die onderste ry sal opskuif na jou tuisskerm."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Kry maklik toegang tot jou programme wat die meeste gebruik word, direk van die tuisskerm af. Voorstelle sal verander op grond van jou roetines. Programme in die gunstelingery sal na jou tuisskerm toe skuif."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Kry maklik toegang tot jou programme wat die meeste gebruik word, direk van die tuisskerm af. Voorstelle sal verander op grond van jou roetines. Programme in die onderste ry sal na \'n nuwe vouer toe skuif."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Kry programvoorstelle"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nee, dankie"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Instellings"</string>
diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml
index 342bbe2..6ea7d8a 100644
--- a/quickstep/res/values-am/strings.xml
+++ b/quickstep/res/values-am/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"በመነሻ ማያ ገጽዎ የተወዳጆች ረድፍ ላይ የመተግበሪያ አስተያየት ጥቆማዎችን ያግኙ"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"በጣም ስራ ላይ የዋሉ መተግበሪያዎችዎን በቀላሉ ከመነሻ ገጹ ሆነው ይድረሱባቸው። የአስተያየት ጥቆማዎች በእርስዎ ዕለት ተዕለት ተግባራት ላይ በመመስረት ይቀየራሉ። በታችኛው ረድፍ ላይ ያሉ መተግበሪያዎች ወደ መነሻ ገጽዎ ይወሰዳሉ።"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"በጣም ሥራ ላይ የዋሉ መተግበሪያዎችዎን በቀላሉ ከመነሻ ገጹ ሆነው ይድረሱባቸው። የአስተያየት ጥቆማዎች በእርስዎ ዕለት ተዕለት ተግባራት ላይ በመመሥረት ይቀየራሉ። በተወዳጆች ረድፍ ውስጥ ያሉ መተግበሪያዎች ወደ የእርስዎ መነሻ ማያ ገጽ ይንቀሳቀሳሉ።"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"በጣም ስራ ላይ የዋሉ መተግበሪያዎችዎን በቀላሉ ከመነሻ ገጹ ሆነው ይድረሱባቸው። የአስተያየት ጥቆማዎች በእርስዎ ዕለት ተዕለት ተግባራት ላይ በመመስረት ይቀየራሉ። በታችኛው ረድፍ ላይ ያሉ መተግበሪያዎች ወደ አዲስ አቃፊ ይወሰዳሉ።"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"የመተግበሪያ አስተያየት ጥቆማዎችን አግኝ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"አይ፣ አመሰግናለሁ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ቅንብሮች"</string>
diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml
index f15fcd4..f9755d2 100644
--- a/quickstep/res/values-ar/strings.xml
+++ b/quickstep/res/values-ar/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"رؤية التطبيقات المقترحة في صف التطبيقات المفضّلة في الشاشة الرئيسية"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"يمكنك الوصول إلى التطبيقات الأكثر استخدامًا بسهولة من الشاشة الرئيسية مباشرةً. سيتم تغيير الاقتراحات استنادًا إلى استخدامك الروتيني. وسيتم نقل التطبيقات من الصف السفلي في الشاشة الرئيسية إلى الصف الأعلى."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"يمكنك الوصول إلى التطبيقات الأكثر استخدامًا بسهولة من الشاشة الرئيسية مباشرةً. سيتم تغيير الاقتراحات استنادًا إلى سلاسل الإجراءات. سيتم نقل التطبيقات من صف التطبيقات المفضّلة إلى الشاشة الرئيسية."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"يمكنك الوصول إلى التطبيقات الأكثر استخدامًا بسهولة من الشاشة الرئيسية مباشرةً. سيتم تغيير الاقتراحات استنادًا إلى سلاسل الإجراءات. سيتم نقل التطبيقات من الصف الأسفل إلى مجلد جديد."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"رؤية تطبيقات مقترحة"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"لا، شكرًا"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"الإعدادات"</string>
diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml
index b33abed..ec47dd4 100644
--- a/quickstep/res/values-as/strings.xml
+++ b/quickstep/res/values-as/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"আপোনাৰ গৃহ স্ক্ৰীনৰ প্ৰিয় সমলৰ শাৰীটোত এপৰ পৰামর্শসমূহ পাওক"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"আপোনাৰ সকলোতকৈ বেছিকৈ ব্যৱহৃত এপ্সমূহ গৃহ স্ক্ৰীনতে সহজে এক্সেছ কৰক। আপোনাৰ ৰুটিনসমূহৰ ভিত্তিত পৰামর্শসমূহ সলনি হ\'ব। একেবাৰে তলৰ শাৰীটোত থকা এপ্সমূহ ওপৰৰ আপোনাৰ গৃহ স্ক্ৰীনলৈ যাব।"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"আপোনাৰ সকলোতকৈ বেছিকৈ ব্যৱহৃত এপ্সমূহ গৃহ স্ক্ৰীনতে সহজে এক্সেছ কৰক। আপোনাৰ ৰুটিনসমূহৰ ভিত্তিত পৰামর্শসমূহ সলনি হ’ব। প্ৰিয় সমলৰ শাৰীত থকা এপ্সমূহ আপোনাৰ গৃহ স্ক্রীনলৈ যাব।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"আপোনাৰ সকলোতকৈ বেছিকৈ ব্যৱহৃত এপ্সমূহ গৃহ স্ক্ৰীনতে সহজে এক্সেছ কৰক। আপোনাৰ ৰুটিনসমূহৰ ভিত্তিত পৰামর্শসমূহ সলনি হ\'ব। একেবাৰে তলৰ শাৰীটোত থকা এপ্সমূহ এটা নতুন ফ\'ল্ডাৰলৈ যাব।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"এপৰ পৰামর্শসমূহ পাওক"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"নালাগে, ধন্যবাদ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ছেটিং"</string>
diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml
index 07e29bb..7d15232 100644
--- a/quickstep/res/values-az/strings.xml
+++ b/quickstep/res/values-az/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Ana ekranın sevimlilər sırasında tətbiq təklifləri alın"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Birbaşa Ana ekrandan ən çox istifadə edilən tətbiqlərə asanlıqla daxil olun. Təkliflər rejimlərinizə uyğun olaraq dəyişəcək. Aşağı sıradakı tətbiqlər Ana ekrana köçürüləcək."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Birbaşa Ana ekrandan ən çox işlədilən tətbiqlərə asanlıqla girin. Təkliflər rejimlərinizə uyğun olaraq dəyişəcək. Sevimlilər sırasındakı tətbiqlər Əsas ekrana köçürüləcək."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Birbaşa Əsas səhifədən ən çox istifadə edilən tətbiqlərə asanlıqla daxil olun. Təkliflər rejimlərinizə uyğun olaraq dəyişəcək. Aşağı sıradakı tətbiqlər yeni qovluğa köçürüləcək."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Tətbiq təklifləri əldə edin"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Yox, çox sağolun"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ayarlar"</string>
diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml
index 42023d3..6387953 100644
--- a/quickstep/res/values-b+sr+Latn/strings.xml
+++ b/quickstep/res/values-b+sr+Latn/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Dobijajte predloge aplikacija u redu sa omiljenim stavkama na početnom ekranu"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Lako pristupajte aplikacijama koje najčešće koristite direktno sa početnog ekrana. Predlozi se menjaju na osnovu upotrebe. Aplikacije iz donjeg reda se premeštaju nagore na početni ekran."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Lako pristupajte aplikacijama koje najčešće koristite direktno sa početnog ekrana. Predlozi se menjaju na osnovu vaših rutina. Aplikacije iz reda sa omiljenim stavkama se premeštaju na početni ekran."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Lako pristupajte aplikacijama koje najčešće koristite direktno sa početnog ekrana. Predlozi se menjaju na osnovu upotrebe. Aplikacije iz donjeg reda se premeštaju u nov folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Prikazuj predloge aplikacija"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, hvala"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Podešavanja"</string>
diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml
index dc4dc65..5e5f147 100644
--- a/quickstep/res/values-be/strings.xml
+++ b/quickstep/res/values-be/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Атрымлівайце прапановы праграм у пераліку абраных на Галоўным экране"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Атрымлiвайце доступ да праграм, якімі вы карыстаецеся найбольш часта, непасрэдна з Галоўнага экрана. Прапановы будуць змяняцца ў залежнасці ад вашых дзеянняў. Праграмы, якія знаходзяцца ў ніжнім радку, будуць перамешчаны на Галоўны экран."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Атрымлівайце доступ да праграм, якімі вы карыстаецеся найбольш часта, непасрэдна з Галоўнага экрана. Прапановы будуць змяняцца ў залежнасці ад вашых дзеянняў. Пералік абраных праграм будзе перамешчаны на Галоўны экран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Атрымлiвайце просты доступ да праграм, якімі вы карыстаецеся найбольш часта, непасрэдна з Галоўнага экрана. Прапановы будуць змяняцца ў залежнасці ад вашых дзеянняў. Праграмы, якія знаходзяцца ў ніжнім радку, будуць перамешчаны ў новую папку."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Атрымліваць прапановы праграм"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не, дзякуй"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Налады"</string>
diff --git a/quickstep/res/values-bg/strings.xml b/quickstep/res/values-bg/strings.xml
index 560a03b..ca61151 100644
--- a/quickstep/res/values-bg/strings.xml
+++ b/quickstep/res/values-bg/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Получаване на предложения за приложения в реда с любими на началния екран"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Осъществявайте лесен достъп до най-използваните от вас приложения директно от началния екран. Предложенията ще се променят въз основа на действията ви. Приложенията на най-долния ред ще се преместят на началния ви екран."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Осъществявайте лесен достъп до най-използваните от вас приложения директно от началния екран. Предложенията ще се променят въз основа на действията ви. Приложенията в реда с любими ще бъдат преместени на началния екран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Осъществявайте лесен достъп до най-използваните от вас приложения директно от началния екран. Предложенията ще се променят въз основа на действията ви. Приложенията на най-долния ред ще се преместят в нова папка."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Предложения"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не, благодаря"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Настройки"</string>
diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml
index d4774a7..268e736 100644
--- a/quickstep/res/values-bn/strings.xml
+++ b/quickstep/res/values-bn/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"হোম স্ক্রিনের \'ফেভারিট রো\' বিকল্পের জন্য অ্যাপ সাজেশন পান"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"হোম স্ক্রিন থেকে সরাসরি সব থেকে বেশি ব্যবহার করা অ্যাপগুলি অ্যাক্সেস করুন। আপনার রুটিনের উপর ভিত্তি করে সাজেশন পরির্তন করা হবে। নিচের সারিতে থাকা অ্যাপ আপনার হোম স্ক্রিনে সরানো হবে।"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"খুব বেশি ব্যবহার করেন এমন অ্যাপগুলি হোম স্ক্রিন থেকে সহজে সরাসরি অ্যাক্সেস করুন। আপনার রুটিন অনুযায়ী সাজেশন পরির্তন করা হবে। \'ফেভারিট রো\' বিকল্পে থাকা অ্যাপগুলি হোম স্ক্রিনে সরিয়ে দেওয়া হবে।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"হোম স্ক্রিনের পাশে সব থেকে ব্যবহার করা অ্যাপ সহজেই অ্যাক্সেস করুন। আপনার রুটিনের উপর ভিত্তি করে সাজেশন পরির্তন করা হবে। নিচের সারিতে থাকা অ্যাপ নতুন ফোল্ডারে সরানো হবে।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"অ্যাপ সাজেশন পান"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"না থাক"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"সেটিংস"</string>
diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml
index 3743e24..1ff0817 100644
--- a/quickstep/res/values-bs/strings.xml
+++ b/quickstep/res/values-bs/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Primajte prijedloge aplikacija u redu omiljenih stavki početnog ekrana"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Jednostavno pristupite najčešće korištenim aplikacijama direktno s početnog ekrana. Prijedlozi će se mijenjati na osnovu vaših rutina. Aplikacije koje se nalaze u donjem redu će se premjestiti na početni ekran."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Jednostavno pristupite najčešće korištenim aplikacijama direktno s početnog ekrana. Prijedlozi će se mijenjati na osnovu vaših rutina. Aplikacije u redu omiljenih stavki će se premjestiti na početni ekran."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Jednostavno pristupite najčešće korištenim aplikacijama, direktno s početnog ekrana. Prijedlozi će se mijenjati na osnovu vaših rutina. Aplikacije koje se nalaze u donjem redu će se premjestiti u novi folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Prikaži prijedloge aplikacija"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, hvala"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Postavke"</string>
diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml
index 9400fba..4957aee 100644
--- a/quickstep/res/values-ca/strings.xml
+++ b/quickstep/res/values-ca/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Obtén suggeriments d\'aplicacions a la fila Preferides de la teva pantalla d\'inici"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accedeix fàcilment a les aplicacions que més utilitzes des de la pantalla d\'inici. Els suggeriments variaran en funció dels teus hàbits. Les aplicacions de la fila inferior pujaran a la pantalla d\'inici."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accedeix fàcilment a les aplicacions que més utilitzes des de la pantalla d\'inici. Els suggeriments variaran en funció dels teus hàbits. Les aplicacions de la fila Preferides es mouran a la teva pantalla d\'inici."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accedeix fàcilment a les aplicacions que més utilitzes des de la pantalla d\'inici. Els suggeriments variaran en funció dels teus hàbits. Les aplicacions de la fila inferior es mouran a una carpeta nova."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Mostra suggeriments d\'aplicacions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, gràcies"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Configuració"</string>
diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml
index cb49a35..fa707ac 100644
--- a/quickstep/res/values-cs/strings.xml
+++ b/quickstep/res/values-cs/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Nechte si na řádku oblíbených na ploše zobrazovat návrhy aplikací"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Mějte nejpoužívanější aplikace k dispozici přímo na ploše. Návrhy se budou měnit podle vašich zvyklostí. Aplikace ve spodním řádku se přesunou nahoru na vaši plochu."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Mějte nejpoužívanější aplikace k dispozici přímo na ploše. Návrhy se budou měnit podle vašich zvyklostí. Aplikace na řádku oblíbených se přesunou na plochu."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Mějte nejpoužívanější aplikace k dispozici přímo na ploše. Návrhy se budou měnit podle vašich zvyklostí. Aplikace ve spodním řádku se přesunou do nové složky."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Zobrazovat návrhy aplikací"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, díky"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Nastavení"</string>
diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml
index 621006b..d88061d 100644
--- a/quickstep/res/values-da/strings.xml
+++ b/quickstep/res/values-da/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Få appforslag i rækken med favoritter på din startskærm"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Få nem adgang til dine mest brugte apps direkte fra startskærmen. Forslagene ændres ud fra dine vaner. Apps i nederste række bliver flyttet op til din startskærm."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Få nem adgang til dine mest brugte apps direkte fra startskærmen. Forslagene ændres ud fra dine vaner. Apps i rækken med favoritter bliver flyttet til din startskærm."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Få nem adgang til dine mest brugte apps direkte fra startskærmen. Forslagene ændres ud fra dine vaner. Apps i nederste række bliver flyttet til en ny mappe."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Få appforslag"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nej tak"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Indstillinger"</string>
diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml
index d19c23b..3728b35 100644
--- a/quickstep/res/values-de/strings.xml
+++ b/quickstep/res/values-de/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Lass dir in der Favoritenleiste auf dem Startbildschirm App-Vorschläge anzeigen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Schneller Zugriff auf deine meistverwendeten Apps direkt über den Startbildschirm. Die Vorschläge werden deiner Nutzung entsprechend laufend angepasst. Apps in der unteren Reihe werden nach oben auf den Startbildschirm verschoben."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Schneller Zugriff auf deine meistverwendeten Apps direkt über den Startbildschirm. Die Vorschläge werden deiner Nutzung entsprechend laufend angepasst. Apps der Favoritenleiste werden auf den Startbildschirm verschoben."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Schneller Zugriff auf deine meistverwendeten Apps direkt über den Startbildschirm. Die Vorschläge werden deiner Nutzung entsprechend laufend angepasst. Apps in der unteren Reihe werden in einen neuen Ordner verschoben."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"App-Vorschläge erhalten"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nein danke"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Einstellungen"</string>
diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml
index 2c6702b..5ff882e 100644
--- a/quickstep/res/values-el/strings.xml
+++ b/quickstep/res/values-el/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Δείτε τις προτεινόμενες εφαρμογές στη σειρά Αγαπημένα της αρχικής οθόνης."</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Αποκτήστε εύκολα πρόσβαση στις εφαρμογές που χρησιμοποιείτε περισσότερο απευθείας από την αρχική οθόνη. Οι προτάσεις θα αλλάζουν με βάση τις ρουτίνες σας. Οι εφαρμογές στην κάτω σειρά θα μετακινηθούν προς τα επάνω στην αρχική οθόνη."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Αποκτήστε εύκολα πρόσβαση στις εφαρμογές που χρησιμοποιείτε περισσότερο απευθείας από την αρχική οθόνη. Οι προτάσεις θα αλλάζουν με βάση τις ρουτίνες σας. Οι εφαρμογές στην σειρά Αγαπημένα θα μετακινηθούν στην αρχική οθόνη σας."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Αποκτήστε εύκολα πρόσβαση στις εφαρμογές που χρησιμοποιείτε περισσότερο, απευθείας από την αρχική οθόνη. Οι προτάσεις θα αλλάζουν με βάση τις ρουτίνες σας. Οι εφαρμογές στην κάτω σειρά θα μεταφερθούν σε νέο φάκελο."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Προβολή προτεινόμενων εφαρμογών"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Όχι, ευχαριστώ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ρυθμίσεις"</string>
diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml
index 7b297af..5b378b4 100644
--- a/quickstep/res/values-en-rAU/strings.xml
+++ b/quickstep/res/values-en-rAU/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Get app suggestions on the favourites row of your home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your home screen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps in the favourites row will move to your home screen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will be moved to a new folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Get app suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, thanks"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Settings"</string>
diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml
index 4013a71..ab0a8e9 100644
--- a/quickstep/res/values-en-rCA/strings.xml
+++ b/quickstep/res/values-en-rCA/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Get app suggestions on the favourites row of your home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your home screen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps in the favourites row will move to your home screen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will be moved to a new folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Get app suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, thanks"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Settings"</string>
diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml
index 7b297af..5b378b4 100644
--- a/quickstep/res/values-en-rGB/strings.xml
+++ b/quickstep/res/values-en-rGB/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Get app suggestions on the favourites row of your home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your home screen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps in the favourites row will move to your home screen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will be moved to a new folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Get app suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, thanks"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Settings"</string>
diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml
index 7b297af..5b378b4 100644
--- a/quickstep/res/values-en-rIN/strings.xml
+++ b/quickstep/res/values-en-rIN/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Get app suggestions on the favourites row of your home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your home screen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps in the favourites row will move to your home screen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will be moved to a new folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Get app suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, thanks"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Settings"</string>
diff --git a/quickstep/res/values-en-rXC/strings.xml b/quickstep/res/values-en-rXC/strings.xml
index bd2a024..f0b2066 100644
--- a/quickstep/res/values-en-rXC/strings.xml
+++ b/quickstep/res/values-en-rXC/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Get app suggestions on favorites row of your Home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your Home screen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps in favorites row will move to your Home screen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Easily access your most-used apps, right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move to a new folder."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Get app suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No thanks"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Settings"</string>
diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml
index 06ee5bb..b9bb70f 100644
--- a/quickstep/res/values-es-rUS/strings.xml
+++ b/quickstep/res/values-es-rUS/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Obtén sugerencias de apps en la fila de favoritos de la pantalla principal"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accede fácilmente en la pantalla principal a las apps que más usas. Las sugerencias cambiarán según tus rutinas. Las apps de la fila inferior se desplazarán hacia arriba en la pantalla principal."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accede fácilmente en la pantalla principal a las apps que más usas. Las sugerencias cambiarán según tus rutinas. Se moverán a la pantalla principal las apps que estén en la fila de favoritos."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accede fácilmente a las apps que más usas en la pantalla principal. Las sugerencias cambiarán según tus rutinas. Las apps de la fila inferior se moverán a una nueva carpeta."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Obtén sugerencias de aplicaciones"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, gracias"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Configuración"</string>
diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml
index 80c8b0b..f3d7a31 100644
--- a/quickstep/res/values-es/strings.xml
+++ b/quickstep/res/values-es/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Recibe sugerencias de aplicaciones en la fila de aplicaciones favoritas de la pantalla de inicio"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accede fácilmente a las aplicaciones que más usas desde la pantalla de inicio. Las sugerencias cambiarán según tus hábitos. Las aplicaciones de la fila inferior que tengas ahora se moverán hacia arriba en la pantalla de inicio."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accede fácilmente a las aplicaciones que más usas desde la pantalla de inicio. Las sugerencias cambiarán según tus hábitos. Las aplicaciones de la fila de aplicaciones favoritas se moverán a la pantalla de inicio."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accede fácilmente a las aplicaciones que más usas desde la pantalla de inicio. Las sugerencias cambiarán según tus hábitos. Las aplicaciones de la fila inferior que tengas ahora se moverán a una carpeta nueva."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Sí, obtener sugerencias"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, gracias"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ajustes"</string>
diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml
index 7f37a4b..73c1c1d 100644
--- a/quickstep/res/values-et/strings.xml
+++ b/quickstep/res/values-et/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Hankige avakuva lemmikute reale rakenduste soovitusi"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Pääsete enim kasutatavatele rakendustele hõlpsasti juurde otse avakuvalt. Soovitused muutuvad olenevalt teie rutiinist. Alumisel real olevad rakendused teisaldatakse teie avakuvale."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Pääsete enim kasutatavatele rakendustele hõlpsasti juurde otse avakuvalt. Soovitused muutuvad olenevalt teie rutiinist. Lemmikute real olevad rakendused teisaldatakse teie avakuvale."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Pääsete enim kasutatavatele rakendustele hõlpsasti juurde otse avakuvalt. Soovitused muutuvad olenevalt teie rutiinist. Alumisel real olevad rakendused teisaldatakse uude kausta."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Hangi rakenduste soovitusi"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Tänan, ei"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Seaded"</string>
diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml
index 4169838..5b83633 100644
--- a/quickstep/res/values-eu/strings.xml
+++ b/quickstep/res/values-eu/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Jaso aplikazioen iradokizunak hasierako pantailako gogokoen errenkadan"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Atzitu erraz aplikazio erabilienak hasierako pantailatik bertatik. Ohituren arabera aldatuko dira iradokizunak. Hasierako pantailara eramango dira beheko errenkadan dauden aplikazioak."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Atzitu erraz aplikazio erabilienak hasierako pantailatik bertatik. Ohituren arabera aldatuko dira iradokizunak. Gogokoen errenkadako aplikazioak hasierako pantailara eramango ditugu."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Atzitu erraz aplikazio erabilienak hasierako pantailatik bertatik. Ohituren arabera aldatuko dira iradokizunak. Karpeta berri batera eramango dira beheko errenkadan dauden aplikazioak."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Jaso aplikazioen iradokizunak"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ez, eskerrik asko"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ezarpenak"</string>
diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml
index de6d7e5..a64a876 100644
--- a/quickstep/res/values-fa/strings.xml
+++ b/quickstep/res/values-fa/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"دریافت «پیشنهاد برنامه» در ردیف موارد دلخواه صفحه اصلی"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"بهراحتی در صفحه اصلی به پرکاربردترین برنامهها دسترسی داشته باشید. پیشنهادها براساس روالهایتان تغییر خواهد کرد. برنامههای ردیف پایین در صفحه اصلی به بالا منتقل خواهند شد."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"بهراحتی در صفحه اصلی به پرکاربردترین برنامهها دسترسی داشته باشید. پیشنهادها براساس روالهایتان تغییر خواهد کرد. برنامههای موجود در ردیف موارد دلخواه به صفحه اصلی منتقل میشوند."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"بهراحتی در صفحه اصلی به پرکاربردترین برنامهها دسترسی داشته باشید. پیشنهادها براساس روالهایتان تغییر خواهد کرد. برنامههای ردیف پایین به پوشه جدیدی منتقل خواهند شد."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"دریافت پیشنهادهای برنامه"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"نه متشکرم"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"تنظیمات"</string>
diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml
index 8c50f70..08a9248 100644
--- a/quickstep/res/values-fi/strings.xml
+++ b/quickstep/res/values-fi/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Näytä sovellusehdotuksia aloitusnäytön Suosikit-rivillä"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Voit avata käytetyimmät sovellukset kätevästi aloitusnäytöltä. Ehdotukset muuttuvat rutiiniesi perusteella. Alimmalla rivillä olevat sovellukset siirretään aloitusnäytön yläosaan."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Voit avata käytetyimmät sovellukset kätevästi aloitusnäytöltä. Ehdotukset muuttuvat rutiiniesi perusteella. Suosikit-rivillä olevat sovellukset siirretään aloitusnäytölle."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Voit avata käytetyimmät sovellukset kätevästi aloitusnäytöltä. Ehdotukset muuttuvat rutiiniesi perusteella. Alimmalla rivillä olevat sovellukset siirretään uuteen kansioon."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Näytä sovellusehdotuksia"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ei kiitos"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Asetukset"</string>
diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml
index f92d55c..6199a14 100644
--- a/quickstep/res/values-fr-rCA/strings.xml
+++ b/quickstep/res/values-fr-rCA/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Retrouvez des suggestions d\'applications dans la rangée des favoris de votre écran d\'accueil"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accédez facilement aux applications que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applications dans la rangée du bas seront déplacées vers votre écran d\'accueil."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accédez facilement aux applications que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applications dans la rangée des favoris seront déplacées vers votre écran d\'accueil."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accédez facilement aux applications que vous utilisez le plus, directement à l\'écran d\'accueil. Les suggestions changeront en fonction de vos habitudes. Les applications dans la rangée du bas seront déplacées vers un nouveau dossier."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Obtenir des suggestions d\'applications"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Non merci"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Paramètres"</string>
diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml
index 9ffa0cc..c66da27 100644
--- a/quickstep/res/values-fr/strings.xml
+++ b/quickstep/res/values-fr/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Retrouvez des suggestions d\'applications dans la zone des favoris de votre écran d\'accueil"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Les suggestions d\'applications permettent d\'afficher vos applications favorites au bas de votre écran d\'accueil. Elles s\'adaptent à vos habitudes d\'utilisation. Les icônes auparavant affichées au bas de l\'écran seront déplacées vers le haut."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accédez facilement aux applications dont vous vous servez le plus, directement depuis l\'écran d\'accueil. Ces suggestions peuvent varier en fonction de vos habitudes d\'utilisation. Les applications de la zone des favoris seront transférées sur votre écran d\'accueil."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Les suggestions d\'applications permettent d\'afficher vos applications favorites au bas de votre écran d\'accueil. Elles s\'adaptent à vos habitudes d\'utilisation. Les icônes auparavant affichées au bas de l\'écran seront placées dans un nouveau dossier."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Activer les suggestions"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Non, merci"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Paramètres"</string>
diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml
index bea23b7..9946f17 100644
--- a/quickstep/res/values-gl/strings.xml
+++ b/quickstep/res/values-gl/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Recibe suxestións de aplicacións na fila de Favoritos da pantalla de inicio"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accede facilmente desde a pantalla de inicio ás aplicacións que máis usas. As suxestións irán cambiando en función das túas rutinas. As aplicacións da fila inferior pasarán á pantalla de inicio."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accede facilmente desde a pantalla de inicio ás aplicacións que máis usas. As suxestións irán cambiando en función das túas rutinas. As aplicacións da fila de Favoritos moveranse á túa pantalla de inicio."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accede facilmente desde a pantalla de inicio ás aplicacións que máis usas. As suxestións irán cambiando en función das túas rutinas. As aplicacións da fila inferior pasarán a un cartafol novo."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Recibir suxestións de aplicacións"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Non, grazas"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Configuración"</string>
diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml
index a146b24..3439410 100644
--- a/quickstep/res/values-gu/strings.xml
+++ b/quickstep/res/values-gu/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"તમારી હોમ સ્ક્રીનની મનપસંદ પંક્તિમાં ઍપના સુઝાવો મેળવો"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"તમારી સૌથી વધુ વપરાતી ઍપને સીધી હોમ સ્ક્રીન પરથી જ સરળતાથી ઍક્સેસ કરો. સૂચનો તમારા રૂટિનના આધારે બદલાશે. નીચેની પંક્તિમાં રહેલી ઍપ તમારી હોમ સ્ક્રીન પર ખસેડાશે."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"તમારી સૌથી વધુ વપરાતી ઍપને સીધી હોમ સ્ક્રીન પરથી જ સરળતાથી ઍક્સેસ કરો. સૂચનો તમારા રૂટિનના આધારે બદલાશે. મનપસંદ પંક્તિમાં રહેલી ઍપ તમારી હોમ સ્ક્રીન પર ખસેડાશે."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"તમારી સૌથી વધુ વપરાતી ઍપને સીધી હોમ સ્ક્રીન પરથી જ સરળતાથી ઍક્સેસ કરો. સૂચનો તમારા રૂટિનના આધારે બદલાશે. નીચેની પંક્તિમાં રહેલી ઍપ નવા ફોલ્ડરમાં ખસેડાશે."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ઍપ અંગેના સુઝાવો મેળવો"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ના, આભાર"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"સેટિંગ"</string>
diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml
index c938e6b..be5a277 100644
--- a/quickstep/res/values-hi/strings.xml
+++ b/quickstep/res/values-hi/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"अपनी होम स्क्रीन की सबसे नीचे वाली पंक्ति में पसंदीदा ऐप्लिकेशन के सुझाव पाएं"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"आपके ज़्यादातर इस्तेमाल किए जाने वाले ऐप्लिकेशन, सीधा अपनी होम स्क्रीन पर पाएं. ऐप्लिकेशन इस्तेमाल करने के आपके रूटीन के हिसाब से सुझाव बदलते रहते हैं. नीचे की पंक्ति के ऐप्लिकेशन होम स्क्रीन पर आ जाएंगे."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"सबसे ज़्यादा इस्तेमाल होने वाले ऐप्लिकेशन सीधे होम स्क्रीन पर देखें. आप ऐप्लिकेशन का कितना इस्तेमाल कर रहे हैं, उसके हिसाब से सुझाव बदलते रहते हैं. आपके पसंदीदा ऐप्लिकेशन, होम स्क्रीन पर नीचे की पंक्ति में दिखाई देंगे."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"सबसे ज़्यादा इस्तेमाल होने वाले ऐप्लिकेशन, सीधे होम स्क्रीन पर पाएं. आपके ऐप्लिकेशन इस्तेमाल करने के रूटीन के हिसाब से सुझाव बदलते रहते हैं. नीचे की पंक्ति के ऐप्लिकेशन एक नए फ़ोल्डर में चले जाएंगे."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ऐप्लिकेशन के बारे में सुझाव पाएं"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"रहने दें"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"सेटिंग"</string>
diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml
index 640d7cc..620ba51 100644
--- a/quickstep/res/values-hr/strings.xml
+++ b/quickstep/res/values-hr/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Primajte prijedloge aplikacija u retku omiljenih na početnom zaslonu"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Lako pristupite najčešće upotrebljavanim aplikacijama s početnog zaslona. Prijedlozi će se mijenjati na temelju vaših rutina. Aplikacije iz donjeg retka pomaknut će se na početni zaslon."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Lako pristupite najčešće upotrebljavanim aplikacijama s početnog zaslona. Prijedlozi će se mijenjati na temelju vaših rutina. Aplikacije koje se nalaze u retku omiljenih pomaknut će se na početni zaslon."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Lako pristupite najčešće upotrebljavanim aplikacijama s početnog zaslona. Prijedlozi će se mijenjati na temelju vaših rutina. Aplikacije iz donjeg retka pomaknut će se u novu mapu."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Predloži mi aplikacije"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, hvala"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Postavke"</string>
diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml
index 6369293..61f0a3b 100644
--- a/quickstep/res/values-hu/strings.xml
+++ b/quickstep/res/values-hu/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Alkalmazásjavaslatokat kaphat a kezdőképernyőn megjelenő kedvencek sorában"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"A kezdőképernyőről könnyedén hozzáférhet a leggyakrabban használt alkalmazásokhoz. A javaslatok a rutinjai alapján változni fognak. Az alsó sorban lévő alkalmazások felkerülnek a kezdőképernyőre."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"A kezdőképernyőről könnyedén hozzáférhet a leggyakrabban használt alkalmazásokhoz. A javaslatok a rutinjai alapján változnak majd. A kedvencek sorában lévő alkalmazások a kezdőképernyőre kerülnek."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"A kezdőképernyőről könnyedén hozzáférhet a leggyakrabban használt alkalmazásokhoz. A javaslatok a rutinjai alapján változni fognak. Az alsó sorban lévő alkalmazások egy új mappába kerülnek."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Kérek javaslatokat"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Köszönöm, nem"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Beállítások"</string>
diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml
index 9eeaa98..0f9356a 100644
--- a/quickstep/res/values-hy/strings.xml
+++ b/quickstep/res/values-hy/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Ստացեք հավելվածների առաջարկներ հիմնական էկրանի «Ընտրանի» տողում"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Անմիջապես հիմնական էկրանից բացեք հաճախ օգտագործվող հավելվածները։ Առաջարկվող հավելվածները կփոփոխվեն՝ կախված ձեր գործողություններից։ Ներքևի տողի հավելվածները կտեղափոխվեն վերև հիմնական էկրանին։"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Արագ բացեք հաճախ օգտագործվող հավելվածներն անմիջապես հիմնական էկրանից։ Առաջարկները կփոփոխվեն՝ կախված ձեր գործողություններից։ «Ընտրանի» տողի հավելվածները կտեղափոխվեն հիմնական էկրան։"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Արագ բացեք հաճախ օգտագործվող հավելվածներն անմիջապես հիմնական էկրանից։ Առաջարկները կփոփոխվեն՝ կախված ձեր գործողություններից։ Ներքևում ցուցադրվող հավելվածները կտեղափոխվեն նոր պանակ։"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Ստանալ առաջարկներ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ոչ, շնորհակալություն"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Կարգավորումներ"</string>
diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml
index 14d8c3e..b95871f 100644
--- a/quickstep/res/values-in/strings.xml
+++ b/quickstep/res/values-in/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Dapatkan saran aplikasi di baris favorit Layar utama"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Akses aplikasi yang paling sering digunakan dengan mudah, langsung di Layar utama. Saran akan berubah berdasarkan rutinitas Anda. Aplikasi di baris paling bawah akan berpindah naik ke Layar utama."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Mudah mengakses aplikasi yang paling sering digunakan, langsung di Layar utama. Saran akan berubah berdasarkan rutinitas Anda. Aplikasi di baris favorit akan berpindah ke Layar utama."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Akses aplikasi yang paling sering digunakan dengan mudah, langsung di Layar utama. Saran akan berubah berdasarkan rutinitas Anda. Aplikasi di baris paling bawah akan berpindah ke folder baru."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Dapatkan saran aplikasi"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Lain kali"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Setelan"</string>
diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml
index 1761203..5730900 100644
--- a/quickstep/res/values-is/strings.xml
+++ b/quickstep/res/values-is/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Fáðu tillögur að forritum á eftirlætissvæði heimaskjásins"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Nálgastu forritin sem þú notar mest auðveldlega á heimaskjánum. Tillögurnar breytast í samræmi við notkun þína. Forrit í neðstu röð færast upp á heimaskjáinn."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Nálgastu forritin sem þú notar mest á einfaldan hátt á heimaskjánum. Tillögurnar breytast í samræmi við notkun þína. Forrit á eftirlætissvæði færast á heimaskjáinn."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Nálgastu forritin sem þú notar mest auðveldlega á heimaskjánum. Tillögurnar breytast í samræmi við notkun þína. Forrit í neðstu röð færast í nýja möppu."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Fá tillögur að forritum"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nei, takk"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Stillingar"</string>
diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml
index 874d072..7e04cf6 100644
--- a/quickstep/res/values-it/strings.xml
+++ b/quickstep/res/values-it/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Visualizza app suggerite nella riga dei Preferiti della schermata Home"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accedi facilmente alle app più utilizzate direttamente dalla schermata Home. I suggerimenti varieranno in base alle tue routine. Le app nella riga inferiore verranno spostate più in alto sulla schermata Home."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accedi facilmente alle app più utilizzate direttamente dalla schermata Home. I suggerimenti varieranno in base alle tue routine. Le app nella riga dei Preferiti verranno spostate nella schermata Home."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accedi facilmente alle app più utilizzate direttamente dalla schermata Home. I suggerimenti varieranno in base alle tue routine. Le app nella riga inferiore verranno spostate in una nuova cartella."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Visualizza app suggerite"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"No, grazie"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Impostazioni"</string>
diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml
index 09d76f8..56148e7 100644
--- a/quickstep/res/values-iw/strings.xml
+++ b/quickstep/res/values-iw/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"קבלת הצעות לאפליקציות בשורת המועדפות של מסך הבית"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"גישה נוחה לאפליקציות שנעשה בהן שימוש תכוף – ישירות ממסך הבית. ההצעות ישתנו בהתאם להרגלי השימוש שלך. אפליקציות שמופיעות בשורה התחתונה יעברו למעלה למסך הבית."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"גישה נוחה לאפליקציות שהשתמשת בהן הכי הרבה, ישירות ממסך הבית. ההצעות ישתנו בהתאם להרגלי השימוש שלך. אפליקציות בשורת המועדפות יועברו למסך הבית."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"גישה נוחה לאפליקציות שנעשה בהן שימוש תכוף – ישירות ממסך הבית. ההצעות ישתנו בהתאם להרגלי השימוש שלך. אפליקציות שמופיעות בשורה התחתונה יעברו לתיקייה חדשה."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"קבלת הצעות לאפליקציות"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"לא, תודה"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"הגדרות"</string>
diff --git a/quickstep/res/values-ja/strings.xml b/quickstep/res/values-ja/strings.xml
index 50c031e..013939f 100644
--- a/quickstep/res/values-ja/strings.xml
+++ b/quickstep/res/values-ja/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ホーム画面のお気に入りの行でアプリの候補を利用できます"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ホーム画面で、使用頻度の高いアプリに簡単にアクセスできるようになります。アプリの候補はルーティンに応じて変わります。ホーム画面で今一番下の行にあるアプリは、一行上に移動します。"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ホーム画面で、使用頻度の高いアプリに簡単にアクセスできるようになります。アプリの候補はルーティンに応じて変わります。お気に入りの行にあるアプリがホーム画面に移動します。"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ホーム画面で、使用頻度の高いアプリに簡単にアクセスできるようになります。アプリの候補はルーティンに応じて変わります。一番下の行にあるアプリが新しいフォルダに移動します。"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"アプリの候補を利用"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"使用しない"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"設定"</string>
diff --git a/quickstep/res/values-ka/strings.xml b/quickstep/res/values-ka/strings.xml
index 2bc0108..d54ac88 100644
--- a/quickstep/res/values-ka/strings.xml
+++ b/quickstep/res/values-ka/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"მიიღეთ აპების შემოთავაზებები მთავარი ეკრანის რჩეულების მწკრივში"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"მარტივად იქონიეთ ყველაზე ხშირად გამოყენებულ აპებზე წვდომა მთავარი ეკრანიდან. შეთავაზებები შეიცვლება თქვენი რუტინების მიხედვით. მოხდება ქვედა რიგში არსებული აპების მთავარ ეკრანზე გადატანა."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"მარტივად იქონიეთ წვდომა ყველაზე ხშირად გამოყენებულ აპებზე მთავარი ეკრანიდან. შეთავაზებები შეიცვლება თქვენი რუტინების მიხედვით. რჩეულების მწკრივში არსებული აპები თქვენს მთავარ ეკრანზე გადავა."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"მარტივად იქონიეთ ყველაზე ხშირად გამოყენებულ აპებზე წვდომა მთავარი ეკრანიდან. შეთავაზებები შეიცვლება თქვენი რუტინების მიხედვით. მოხდება ქვედა რიგში არსებული აპების ახალ საქაღალდეში გადატანა."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"აპის შეთავაზებების მიღება"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"არა, გმადლობთ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"პარამეტრები"</string>
diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml
index 7758125..bfa2a5c 100644
--- a/quickstep/res/values-kk/strings.xml
+++ b/quickstep/res/values-kk/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Қолданба ұсыныстары негізгі экрандағы таңдаулылар жолында көрсетілетін болады"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Жиі пайдаланылатын қолданбаларға негізгі экраннан кіруге болады. Ұсыныстар күнделікті әрекеттеріңізге сәйкес өзгереді. Төменгі қатардағы қолданбалар негізгі экранға қарай жоғары жылжиды."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Жиі пайдаланылатын қолданбаларға негізгі экраннан оңай кіре аласыз. Ұсыныстар күнделікті әрекеттеріңізге сәйкес өзгереді. Таңдаулылар жолындағы қолданбалар негізгі экранға ауысады."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Жиі пайдаланылатын қолданбаларға негізгі экраннан кіруге болады. Ұсыныстар күнделікті әрекеттеріңізге сәйкес өзгереді. Төменгі қатардағы қолданбалар жаңа қалтаға жылжиды."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Қолданба ұсыныстарын алу"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Жоқ, рақмет"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Параметрлер"</string>
diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml
index 93b2361..4a78d9d 100644
--- a/quickstep/res/values-km/strings.xml
+++ b/quickstep/res/values-km/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ទទួលបានការណែនាំកម្មវិធីនៅលើជួរដេកសំណព្វនៃអេក្រង់ដើមរបស់អ្នក"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ចូលប្រើកម្មវិធីដែលអ្នកប្រើញឹកញាប់បំផុតបានយ៉ាងងាយស្រួលនៅលើអេក្រង់ដើមផ្ទាល់។ ការណែនាំនឹងប្រែប្រួលទៅតាមទម្លាប់របស់អ្នក។ កម្មវិធីនៅជួរខាងក្រោមនឹងផ្លាស់ទីឡើងទៅអេក្រង់ដើមរបស់អ្នក។"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ចូលប្រើកម្មវិធីដែលអ្នកប្រើញឹកញាប់បំផុតបានយ៉ាងងាយស្រួលនៅលើអេក្រង់ដើមដោយផ្ទាល់។ ការណែនាំនឹងប្រែប្រួលទៅតាមទម្លាប់របស់អ្នក។ កម្មវិធីនៅក្នុងជួរដេកសំណព្វនឹងផ្លាស់ទីទៅអេក្រង់ដើមរបស់អ្នក។"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ចូលប្រើកម្មវិធីដែលអ្នកប្រើញឹកញាប់បំផុតបានយ៉ាងងាយស្រួលនៅលើអេក្រង់ដើមផ្ទាល់។ ការណែនាំនឹងប្រែប្រួលទៅតាមទម្លាប់របស់អ្នក។ កម្មវិធីនៅជួរខាងក្រោមនឹងផ្លាស់ទីទៅថតថ្មី។"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ទទួលការណែនាំកម្មវិធី"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ទេ អរគុណ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ការកំណត់"</string>
diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml
index 2c1f699..91a12f8 100644
--- a/quickstep/res/values-kn/strings.xml
+++ b/quickstep/res/values-kn/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ನಿಮ್ಮ ಹೋಮ್ ಸ್ಕ್ರೀನ್ನ ಮೆಚ್ಚಿನವುಗಳ ಸಾಲಿನಲ್ಲಿ ಆ್ಯಪ್ ಸಲಹೆಗಳನ್ನು ಪಡೆಯಿರಿ"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ನೀವು ಹೆಚ್ಚು ಬಳಸಿದ ಆ್ಯಪ್ಗಳನ್ನು ಹೋಮ್ ಸ್ಕ್ರೀನ್ನಲ್ಲಿಯೇ ಸುಲಭವಾಗಿ ಪ್ರವೇಶಿಸಿ. ನಿಮ್ಮ ದಿನಚರಿಯನ್ನು ಆಧರಿಸಿ ಸಲಹೆಗಳು ಬದಲಾಗುತ್ತವೆ. ಕೆಳಭಾಗದ ಸಾಲಿನಲ್ಲಿನ ಆ್ಯಪ್ಗಳು ನಿಮ್ಮ ಹೋಮ್ ಸ್ಕ್ರೀನ್ ಕಡೆಗೆ ಚಲಿಸುತ್ತವೆ."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ನೀವು ಹೆಚ್ಚು ಬಳಸಿದ ಆ್ಯಪ್ಗಳನ್ನು ಹೋಮ್ ಸ್ಕ್ರೀನ್ನಲ್ಲಿಯೇ ಸುಲಭವಾಗಿ ಪ್ರವೇಶಿಸಿ. ನಿಮ್ಮ ದಿನಚರಿಯನ್ನು ಆಧರಿಸಿ ಸಲಹೆಗಳು ಬದಲಾಗುತ್ತವೆ. ಮೆಚ್ಚಿನವುಗಳ ಸಾಲಿನಲ್ಲಿನ ಆ್ಯಪ್ಗಳು ನಿಮ್ಮ ಹೋಮ್ ಸ್ಕ್ರೀನ್ಗೆ ಚಲಿಸುತ್ತವೆ."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ನೀವು ಹೆಚ್ಚು ಬಳಸಿದ ಆ್ಯಪ್ಗಳನ್ನು ಹೋಮ್ ಸ್ಕ್ರೀನ್ನಲ್ಲಿಯೇ ಸುಲಭವಾಗಿ ಪ್ರವೇಶಿಸಿ. ನಿಮ್ಮ ದಿನಚರಿಯನ್ನು ಆಧರಿಸಿ ಸಲಹೆಗಳು ಬದಲಾಗುತ್ತವೆ. ಕೆಳಭಾಗದ ಸಾಲಿನಲ್ಲಿನ ಆ್ಯಪ್ಗಳು ಹೊಸ ಫೋಲ್ಡರ್ಗೆ ಚಲಿಸುತ್ತವೆ."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ಆ್ಯಪ್ ಸಲಹೆಗಳನ್ನು ಪಡೆಯಿರಿ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ಬೇಡ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml
index 6626bc1..bfe98f9 100644
--- a/quickstep/res/values-ko/strings.xml
+++ b/quickstep/res/values-ko/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"홈 화면의 즐겨찾기 행에서 앱 제안 보기"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"홈 화면에서 자주 사용하는 앱에 바로 액세스할 수 있습니다. 제안은 사용 습관에 따라 바뀌며, 하단의 앱들은 홈 화면으로 이동합니다."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"홈 화면에서 가장 많이 사용한 앱에 바로 액세스할 수 있습니다. 제안은 루틴에 따라 달라집니다. 즐겨찾기 행의 앱이 홈 화면으로 이동합니다."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"홈 화면에서 자주 사용하는 앱에 바로 액세스할 수 있습니다. 제안은 사용 습관에 따라 바뀌며, 하단의 앱들은 새 폴더로 이동합니다."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"앱 제안받기"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"나중에"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"설정"</string>
diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml
index dac4d1d..5472ead 100644
--- a/quickstep/res/values-ky/strings.xml
+++ b/quickstep/res/values-ky/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Сунушталган колдонмолор башкы экрандагы тандалмалардын катарында көрүнөт."</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Көп колдонулган колдонмолор башкы экранда жайгашып, алардын тизмеси маал-маалы менен өзгөрүп турат. Ылдый жакта жайгашкан тилкедеги колдонмолор башкы экранга жылдырылат."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Көп иштетилген колдонмолорго Башкы экрандан оңой кириңиз. Сунуштар тартиптин негизинде өзгөрөт. Тандалмалардын катарындагы колдонмолор башкы экраныңызга жылдырылат."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Көп колдонулган колдонмолор башкы экранда жайгашып, алардын тизмеси маал-маалы менен өзгөрүп турат. Ылдый жакта жайгашкан тилкедеги колдонмолор жаңы папкага жылдырылат."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Сунушталган колдонолорду алуу"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Жок, рахмат"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Жөндөөлөр"</string>
diff --git a/quickstep/res/values-land/dimens.xml b/quickstep/res/values-land/dimens.xml
index 8368069..905fbda 100644
--- a/quickstep/res/values-land/dimens.xml
+++ b/quickstep/res/values-land/dimens.xml
@@ -77,7 +77,7 @@
<!-- Taskbar 3 button spacing -->
<dimen name="taskbar_button_margin_5_5">94.5dp</dimen>
- <dimen name="taskbar_button_margin_6_5">94.5dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">219.6dp</dimen>
<dimen name="taskbar_button_margin_4_5">84dp</dimen>
<dimen name="taskbar_button_margin_4_4">79dp</dimen>
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml
index f3c3cbd..7d87ec4 100644
--- a/quickstep/res/values-lo/strings.xml
+++ b/quickstep/res/values-lo/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ຮັບການແນະນຳແອັບຢູ່ແຖວລາຍການທີ່ມັກຂອງໜ້າຈໍຫຼັກຂອງທ່ານ"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ເຂົ້າເຖິງແອັບທີ່ທ່ານໃຊ້ຫຼາຍທີ່ສຸດໄດ້ຢ່າງງ່າຍດາຍທັນທີຈາກໜ້າຈໍຫຼັກ. ການແນະນຳຈະປ່ຽນແປງຕາມການນຳໃຊ້ປະຈຳຂອງທ່ານ. ແອັບຢູ່ແຖວລຸ່ມສຸດຈະຍ້າຍຂຶ້ນໄປໃສ່ໜ້າຈໍຫຼັກຂອງທ່ານ."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ເຂົ້າເຖິງແອັບທີ່ທ່ານໃຊ້ຫຼາຍທີ່ສຸດໄດ້ຢ່າງງ່າຍດາຍທັນທີຈາກໜ້າຈໍຫຼັກ. ການແນະນຳຈະປ່ຽນແປງຕາມການນຳໃຊ້ປະຈຳຂອງທ່ານ. ຕອນນີ້ແອັບໃນລາຍການທີ່ມັກຈະຍ້າຍໄປໃສ່ໜ້າຈໍຫຼັກຂອງທ່ານ."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ເຂົ້າເຖິງແອັບທີ່ທ່ານໃຊ້ຫຼາຍທີ່ສຸດໄດ້ຢ່າງງ່າຍດາຍທັນທີຈາກໜ້າຈໍຫຼັກ. ການແນະນຳຈະປ່ຽນແປງຕາມການນຳໃຊ້ປະຈຳຂອງທ່ານ. ແອັບຢູ່ແຖວລຸ່ມສຸດຈະຍ້າຍໄປໂຟນເດີໃໝ່."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ຮັບການແນະນຳແອັບ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ບໍ່, ຂອບໃຈ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ການຕັ້ງຄ່າ"</string>
diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml
index 25a84a7..b60146f 100644
--- a/quickstep/res/values-lt/strings.xml
+++ b/quickstep/res/values-lt/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Gaukite programų pasiūlymų pagrindinio ekrano eilutėje „Mėgstamiausios“"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Lengvai pasiekite dažniausiai naudojamas programas iškart pagrindiniame ekrane. Pasiūlymai keisis atsižvelgiant į tai, kaip jas naudojate. Apatinėje eilutėje esančios programos bus perkeltos į pagrindinį ekraną."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Lengvai pasiekite dažniausiai naudojamas programas iškart pagrindiniame ekrane. Pasiūlymai keisis atsižvelgiant į tai, kaip jas naudojate. Eilutėje „Mėgstamiausios“ rodomos programos bus perkeltos į pagrindinį ekraną."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Lengvai pasiekite dažniausiai naudojamas programas iškart pagrindiniame ekrane. Pasiūlymai keisis atsižvelgiant į tai, kaip jas naudojate. Apatinėje eilutėje esančios programos bus perkeltos į naują aplanką."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Gauti programų pasiūlymų"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, ačiū"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Nustatymai"</string>
diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml
index ee25cb5..d3c3b80 100644
--- a/quickstep/res/values-lv/strings.xml
+++ b/quickstep/res/values-lv/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Saņemiet lietotņu ieteikumus izlases rindā sākuma ekrānā"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Varat sākuma ekrānā ērti piekļūt savām visbiežāk izmantotajām lietotnēm. Ieteikumi mainīsies atkarībā no jūsu paradumiem. Apakšējā rindā esošās lietotnes tiks pārvietotas uz augšu — uz sākuma ekrānu."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Varat sākuma ekrānā ērti piekļūt savām visbiežāk izmantotajām lietotnēm. Ieteikumi mainīsies atkarībā no jūsu paradumiem. Lietotnes no izlases rindas tiks pārvietotas uz sākuma ekrānu."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Varat sākuma ekrānā ērti piekļūt savām visbiežāk izmantotajām lietotnēm. Ieteikumi mainīsies atkarībā no jūsu paradumiem. Apakšējā rindā esošās lietotnes tiks pārvietotas uz jaunu mapi."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Rādīt ieteicamās lietotnes"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nē, paldies"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Iestatījumi"</string>
diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml
index 75f0933..7ac9ad0 100644
--- a/quickstep/res/values-mk/strings.xml
+++ b/quickstep/res/values-mk/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Добивајте предлози за апликации во редот со омилени на почетниот екран"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Лесно пристапувајте до најкористените апликации директно на почетниот екран. Предлозите ќе се менуваат според рутините. Апликациите од последниот ред ќе се поместуваат нагоре до почетниот екран."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Лесно пристапувајте до најкористените апликации на почетниот екран. Предлозите ќе се менуваат според рутините. Апликациите од редот со омилени ќе се преместат на почетниот екран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Лесно пристапувајте до најкористените апликации директно на почетниот екран. Предлозите ќе се менуваат според рутините. Апликациите од последниот ред ќе се преместуваат во нова папка."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Добивајте предлози за апликации"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не, фала"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Поставки"</string>
diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml
index 9f00e91..90fc513 100644
--- a/quickstep/res/values-ml/strings.xml
+++ b/quickstep/res/values-ml/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"നിങ്ങളുടെ ഹോം സ്ക്രീനിന്റെ \'പ്രിയപ്പെട്ടവ\' വരിയിൽ ആപ്പ് നിർദ്ദേശങ്ങൾ നേടുക"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"നിങ്ങൾ ഏറ്റവും കൂടുതൽ ഉപയോഗിച്ച ആപ്പുകൾ ഹോം സ്ക്രീനിൽ നിന്ന് തന്നെ എളുപ്പത്തിൽ ആക്സസ് ചെയ്യൂ. നിങ്ങളുടെ ദിനചര്യകളുടെ അടിസ്ഥാനത്തിൽ നിർദ്ദേശങ്ങൾ മാറും. താഴത്തെ നിരയിലുള്ള ആപ്പുകൾ നിങ്ങളുടെ ഹോം സ്ക്രീനിലേക്ക് നീങ്ങും."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"നിങ്ങൾ ഏറ്റവും കൂടുതൽ ഉപയോഗിച്ച ആപ്പുകൾ ഹോം സ്ക്രീനിൽ നിന്ന് തന്നെ എളുപ്പത്തിൽ ആക്സസ് ചെയ്യൂ. നിങ്ങളുടെ ദിനചര്യകളുടെ അടിസ്ഥാനത്തിൽ നിർദ്ദേശങ്ങൾ മാറും. \'പ്രിയപ്പെട്ടവ\' വരിയിലുള്ള ആപ്പുകൾ നിങ്ങളുടെ ഹോം സ്ക്രീനിലേക്ക് നീങ്ങും."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"നിങ്ങൾ ഏറ്റവും കൂടുതൽ ഉപയോഗിച്ച ആപ്പുകൾ ഹോം സ്ക്രീനിൽ നിന്ന് തന്നെ എളുപ്പത്തിൽ ആക്സസ് ചെയ്യൂ. നിങ്ങളുടെ ദിനചര്യകളുടെ അടിസ്ഥാനത്തിൽ നിർദ്ദേശങ്ങൾ മാറും. താഴത്തെ നിരയിലുള്ള ആപ്പുകൾ പുതിയൊരു ഫോൾഡറിലേക്ക് നീങ്ങും."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ആപ്പ് നിർദ്ദേശങ്ങൾ നേടുക"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"വേണ്ട"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ക്രമീകരണം"</string>
diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml
index 59728a6..c435528 100644
--- a/quickstep/res/values-mn/strings.xml
+++ b/quickstep/res/values-mn/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Үндсэн нүүрний дуртай мөрнөөсөө санал болгож буй аппуудыг аваарай"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Хамгийн их ашигладаг аппууддаа Үндсэн нүүрнээс хялбархан хандаарай. Санал болгож буй аппуудыг таны хэвшлээс хамаарч өөрчилнө. Доод мөрд буй аппуудыг таны Үндсэн нүүр лүү дээш зөөнө."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Хамгийн их ашигладаг аппууддаа Үндсэн нүүрнээсээ хялбархан хандаарай. Санал болголтыг таны хэвшлээс хамааран өөрчилнө. Дуртай мөрөнд буй аппуудыг таны үндсэн нүүр лүү зөөнө."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Хамгийн их ашигладаг аппууддаа Үндсэн нүүрнээс хялбархан хандаарай. Санал болгож буй аппуудыг таны хэвшлээс хамаарч өөрчилнө. Доод мөрөнд буй аппуудыг шинэ фолдер луу зөөнө."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Санал болгож буй аппуудыг авах"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Үгүй, баярлалаа"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Тохиргоо"</string>
diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml
index 5f2fb0c..fc90271 100644
--- a/quickstep/res/values-mr/strings.xml
+++ b/quickstep/res/values-mr/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"तुमच्या होम स्क्रीनच्या पसंतीच्या पंक्तीवर अॅप सूचना मिळवा"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"तुमची सर्वाधिक वापरली जाणारी अॅप्स होम स्क्रीनवरच सहजपणे अॅक्सेस करा. तुमच्या दिनक्रमानुसार तुम्हाला मिळणाऱ्या सूचना बदलतील. तळाशी असणारी अॅप्स तुमच्या होम स्क्रीनवर जातील."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"तुमची सर्वाधिक वापरली जाणारी अॅप्स होम स्क्रीनवर सहजपणे अॅक्सेस करा. सूचना तुमच्या दिनक्रमांनुसार बदलतील. पसंतीच्या पंक्तीमधील अॅप्स तुमच्या होम स्क्रीनवर हलवली जातील."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"तुमची सर्वाधिक वापरली जाणारी अॅप्स होम स्क्रीनवरच सहजपणे अॅक्सेस करा. सूचना तुमच्या दिनक्रमांच्या आधारावर बदलतील. तळाच्या पंक्तीवरील अॅप्स नवीन फोल्डरवर जातील."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"अॅप सूचना मिळवा"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"नाही, नको"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"सेटिंग्ज"</string>
diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml
index 27dcc41..5d3f4a8 100644
--- a/quickstep/res/values-ms/strings.xml
+++ b/quickstep/res/values-ms/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Dapatkan cadangan apl di baris kegemaran Skrin utama anda"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Akses apl yang paling kerap anda gunakan dengan mudah pada Skrin utama. Cadangan akan berubah berdasarkan rutin anda. Apl di baris bawah akan beralih ke atas, ke Skrin utama anda."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Akses apl yang paling kerap anda gunakan dengan mudah pada Skrin utama. Cadangan akan berubah berdasarkan rutin anda. Apl di baris kegemaran akan beralih ke Skrin utama anda."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Akses apl yang paling kerap anda gunakan dengan mudah, terus pada Skrin utama. Cadangan akan berubah berdasarkan rutin anda. Apl di baris bawah akan beralih ke folder baharu."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Dapatkan cadangan apl"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Tidak perlu"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Tetapan"</string>
diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml
index 825b6f2..8f6af71 100644
--- a/quickstep/res/values-my/strings.xml
+++ b/quickstep/res/values-my/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"သင်၏ \'ပင်မစာမျက်နှာ\' ၏ အနှစ်သက်ဆုံးများအတန်းတွင် အက်ပ်အကြံပြုချက်များ ရယူခြင်း"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"အသုံးအများဆုံးအက်ပ်များကို \'ပင်မစာမျက်နှာ\' တွင် အလွယ်တကူ ဖွင့်နိုင်သည်။ သင်၏ ပုံမှန်လုပ်ဆောင်ချက်များပေါ် အခြေခံ၍ အကြံပြုချက်များ ပြောင်းလဲပါမည်။ အောက်ခြေအတန်းရှိ အက်ပ်များကို သင်၏ \'ပင်မစာမျက်နှာ\' သို့ရွှေ့လိုက်မည်။"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"အသုံးအများဆုံးအက်ပ်များကို \'ပင်မစာမျက်နှာ\' တွင် အလွယ်တကူ သုံးနိုင်သည်။ သင်၏ ပုံမှန်အစီအစဉ်များပေါ် အခြေခံ၍ အကြံပြုချက်များ ပြောင်းလဲပါမည်။ အနှစ်သက်ဆုံးများအတန်းရှိ အက်ပ်များကို သင်၏ \'ပင်မစာမျက်နှာ\' သို့ရွှေ့လိုက်မည်။"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"အသုံးအများဆုံးအက်ပ်များကို ပင်မစာမျက်နှာတွင် အလွယ်တကူ သုံးနိုင်သည်။ သင်၏ ပုံမှန်အစီအစဉ်များပေါ် အခြေခံ၍ အကြံပြုချက်များ ပြောင်းလဲပါမည်။ အောက်ခြေအတန်းရှိ အက်ပ်များကို ဖိုင်တွဲအသစ်သို့ ရွှေ့လိုက်မည်။"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"အက်ပ်အကြံပြုချက်များ ရယူရန်"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"မလိုပါ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ဆက်တင်များ"</string>
diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml
index 250724e..eff2e3c 100644
--- a/quickstep/res/values-nb/strings.xml
+++ b/quickstep/res/values-nb/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Få appforslag i favoritter-raden på startskjermen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Få enkel tilgang til appene du bruker oftest, rett fra startskjermen. Forslagene endres basert på rutinene dine. Appene i den nederste raden flyttes opp til startskjermen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Få enkel tilgang til appene du bruker oftest, rett fra startskjermen. Forslagene endres basert på rutinene dine. Apper i favoritter-raden blir flyttet til startskjermen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Få enkel tilgang til appene du bruker oftest, rett fra startskjermen. Forslagene endres basert på rutinene dine. Appene i den nederste raden flyttes til en ny mappe."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Få appforslag"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nei takk"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Innstillinger"</string>
diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml
index f7214b0..3a23567 100644
--- a/quickstep/res/values-ne/strings.xml
+++ b/quickstep/res/values-ne/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"आफ्नो होम स्क्रिनको मन पर्ने नामक पङ्क्तिमा एपसम्बन्धी सिफारिस प्राप्त गर्नुहोस्"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"आफूले सबैभन्दा बढी प्रयोग गर्ने एप होम स्क्रिनबाट सजिलै चलाउनुहोस्। सिफारिस गरिने एपहरूको क्रम तपाईंले एप प्रयोग गर्ने समयतालिकाअनुसार बदलिने छ। फेदको रोमा रहेका एपहरू तपाईंको होम स्क्रिनको सिरानमा सर्ने छन्।"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"आफूले सबैभन्दा बढी प्रयोग गर्ने एपहरू गृह स्क्रिनबाटै सजिलैसँग खोल्नुहोस्। सिफारिस गरिने एपहरूको क्रम तपाईंको दिनचर्याअनुसार बदलिने छ। मन पर्ने नामक पङ्क्तिमा रहेका एपहरू सारेर होम स्क्रिनमा लगिने छन्।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"गृह स्क्रिनबाटै आफूले सबैभन्दा बढी प्रयोग गर्ने एप सजिलै चलाउनुहोस्। सिफारिस गरिने एपहरूको क्रम तपाईंले एप प्रयोग गर्ने समयतालिकाअनुसार बदलिने छ। फेदको पङ्क्तिमा रहेका एपहरू एउटा नयाँ फोल्डरमा सर्ने छन्।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"एपसम्बन्धी सिफारिस प्राप्त गर्नुहोस्"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"पर्दैन, धन्यवाद"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"सेटिङ"</string>
diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml
index ff5e45e..650e340 100644
--- a/quickstep/res/values-nl/strings.xml
+++ b/quickstep/res/values-nl/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"App-suggesties krijgen op de rij met favorieten op het startscherm"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Open je meestgebruikte apps makkelijk vanaf het startscherm. De suggesties veranderen op basis van je routines. Apps in de onderste rij worden naar je startscherm verplaatst."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Open je meestgebruikte apps makkelijk vanaf het startscherm. De suggesties veranderen op basis van je routines. Apps in de rij met favorieten worden naar het startscherm verplaatst."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Open je meestgebruikte apps makkelijk vanaf het startscherm. De suggesties veranderen op basis van je routines. Apps in de onderste rij worden naar een nieuwe map verplaatst."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"App-suggesties krijgen"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nee, bedankt"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Instellingen"</string>
diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml
index 6ab7c5e..5016399 100644
--- a/quickstep/res/values-or/strings.xml
+++ b/quickstep/res/values-or/strings.xml
@@ -31,11 +31,10 @@
<string name="time_left_for_app" msgid="3111996412933644358">"ଆଜି <xliff:g id="TIME">%1$s</xliff:g> ବାକି ଅଛି"</string>
<string name="title_app_suggestions" msgid="4185902664111965088">"ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ"</string>
<string name="all_apps_prediction_tip" msgid="2672336544844936186">"ଆପଣ ପୂର୍ବାନୁମାନ କରିଥିବା ଆପ୍ସ"</string>
- <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନର ତଳ ଧାଡ଼ିରେ ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
- <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନର ପସନ୍ଦର ଧାଡ଼ିରେ ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
- <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ ସିଧା ମୂଳ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନକୁ ମୁଭ୍ କରିଯିବ।"</string>
- <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ମୂଳ ସ୍କ୍ରିନରେ ହିଁ ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ବଦଳିବ। ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନକୁ ପସନ୍ଦର ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ମୁଭ୍ ହେବ।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ, ସିଧା ମୂଳ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ଏକ ନୂଆ ଫୋଲ୍ଡରକୁ ମୁଭ୍ କରିଯିବ।"</string>
+ <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନର ତଳ ଧାଡ଼ିରେ ଆପ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
+ <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନର ପସନ୍ଦର ଧାଡ଼ିରେ ଆପ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
+ <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପ୍ସକୁ ସିଧା ହୋମ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପ୍ସ ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନକୁ ମୁଭ ହୋଇଯିବ।"</string>
+ <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ହୋମ ସ୍କ୍ରିନରେ ହିଁ ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପ୍ସକୁ ସହଜରେ ଆକ୍ସେସ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ବଦଳିବ। ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନକୁ ପସନ୍ଦର ଧାଡ଼ିରେ ଥିବା ଆପ୍ସ ମୁଭ ହୋଇଯିବ।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ନାହିଁ, ଥାଉ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ସେଟିଂସ"</string>
@@ -57,11 +56,11 @@
<string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"ଆପଣ ସ୍କ୍ରିନର ତଳ ଧାରରୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"ଆପଣ ଛାଡ଼ିବା ପୂର୍ବରୁ ବିରତ କରୁନଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<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_subtitle" msgid="2632238748497975326">"ଆପଣଙ୍କ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର୍ ସର୍ବଦା ଆପଣଙ୍କୁ ମୂଳସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
- <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"2ଟି ଆଙ୍ଗୁଠିରେ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ମୂଳସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</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_subtitle" msgid="2632238748497975326">"ଆପଣଙ୍କ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ହୋମ ସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
+ <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"2ଟି ଆଙ୍ଗୁଠିରେ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ହୋମ ସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"ଆପଣ ସ୍କ୍ରିନର ତଳ ଧାରରୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_home_detected" msgid="1411130969354020489">"ୱିଣ୍ଡୋକୁ ରିଲିଜ୍ କରିବା ପୂର୍ବରୁ ଅଧିକ ସମୟ ଧରି ରଖିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="6725820500906747925">"ଆପଣ ସିଧା ଉପରକୁ ସ୍ୱାଇପ୍ କରି ତା\'ପରେ ବିରତ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
@@ -77,7 +76,7 @@
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"ବଢ଼ିଆ!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"ଟ୍ୟୁଟୋରିଆଲ୍ <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"ସମ୍ପୂର୍ଣ୍ଣ ଭାବେ ପ୍ରସ୍ତୁତ!"</string>
- <string name="allset_hint" msgid="2384632994739392447">"ମୂଳପୃଷ୍ଠାକୁ ଯିବା ପାଇଁ ଉପରକୁ ସ୍ୱାଇପ୍ କରନ୍ତୁ"</string>
+ <string name="allset_hint" msgid="2384632994739392447">"ହୋମକୁ ଯିବା ପାଇଁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ"</string>
<string name="allset_description" msgid="6350320429953234580">"ଆପଣ ଆପଣଙ୍କ ଫୋନ୍ ବ୍ୟବହାର କରିବା ପାଇଁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି"</string>
<string name="allset_description_tablet" msgid="7332070270570039247">"ଆପଣ ଆପଣଙ୍କ ଟାବଲେଟ ବ୍ୟବହାର କରିବା ଆରମ୍ଭ କରିବାକୁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"ସିଷ୍ଟମ ନାଭିଗେସନ ସେଟିଂସ"</annotation></string>
@@ -101,7 +100,7 @@
<string name="taskbar_edu_previous" msgid="459202320127201702">"ପଛକୁ ଫେରନ୍ତୁ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ବନ୍ଦ କରନ୍ତୁ"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"ହୋଇଗଲା"</string>
- <string name="taskbar_button_home" msgid="2151398979630664652">"ମୂଳପୃଷ୍ଠା"</string>
+ <string name="taskbar_button_home" msgid="2151398979630664652">"ହୋମ"</string>
<string name="taskbar_button_a11y" msgid="5241161324875094465">"ଆକ୍ସେସିବିଲିଟୀ"</string>
<string name="taskbar_button_back" msgid="8558862226461164514">"ପଛକୁ ଫେରନ୍ତୁ"</string>
<string name="taskbar_button_ime_switcher" msgid="1730244360907588541">"IME ସ୍ୱିଚର"</string>
diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml
index 83def85..7d1d2b5 100644
--- a/quickstep/res/values-pa/strings.xml
+++ b/quickstep/res/values-pa/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ਆਪਣੀ ਹੋਮ ਸਕ੍ਰੀਨ ਦੀ ਮਨਪਸੰਦ ਕਤਾਰ \'ਤੇ ਐਪ ਸੁਝਾਅ ਹਾਸਲ ਕਰੋ"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ਹੋਮ ਸਕ੍ਰੀਨ \'ਤੇ ਆਪਣੀਆਂ ਸਭ ਤੋਂ ਵੱਧ ਵਰਤੀਆਂ ਗਈਆਂ ਐਪਾਂ ਤੱਕ ਆਸਾਨੀ ਨਾਲ ਪਹੁੰਚ ਕਰੋ। ਸੁਝਾਅ ਤੁਹਾਡੇ ਨਿਯਮਬੱਧ ਕੰਮਾਂ ਦੇ ਆਧਾਰ \'ਤੇ ਬਦਲਣਗੇ। ਹੇਠਲੀ ਕਤਾਰ ਵਾਲੀਆਂ ਐਪਾਂ ਤੁਹਾਡੀ ਹੋਮ ਸਕ੍ਰੀਨ ਵੱਲ ਉੱਪਰ ਆ ਜਾਣਗੀਆਂ।"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ਹੋਮ ਸਕ੍ਰੀਨ \'ਤੇ ਆਪਣੀਆਂ ਸਭ ਤੋਂ ਵੱਧ ਵਰਤੀਆਂ ਗਈਆਂ ਐਪਾਂ ਤੱਕ ਆਸਾਨੀ ਨਾਲ ਪਹੁੰਚ ਕਰੋ। ਸੁਝਾਅ ਤੁਹਾਡੇ ਨਿਯਮਬੱਧ ਕੰਮਾਂ ਦੇ ਆਧਾਰ \'ਤੇ ਬਦਲਣਗੇ। ਮਨਪਸੰਦ ਕਤਾਰ ਵਿਚਲੀਆਂ ਐਪਾਂ ਤੁਹਾਡੀ ਹੋਮ ਸਕ੍ਰੀਨ ਉੱਪਰ ਆ ਜਾਣਗੀਆਂ।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ਹੋਮ ਸਕ੍ਰੀਨ \'ਤੇ ਆਪਣੀਆਂ ਸਭ ਤੋਂ ਵੱਧ ਵਰਤੀਆਂ ਗਈਆਂ ਐਪਾਂ ਤੱਕ ਆਸਾਨੀ ਨਾਲ ਪਹੁੰਚ ਕਰੋ। ਸੁਝਾਅ ਤੁਹਾਡੇ ਨਿਯਮਬੱਧ ਕੰਮਾਂ ਦੇ ਆਧਾਰ \'ਤੇ ਬਦਲਣਗੇ। ਹੇਠਲੀ ਕਤਾਰ ਵਾਲੀਆਂ ਐਪਾਂ ਇੱਕ ਨਵੇਂ ਫੋਲਡਰ ਵਿੱਚ ਚਲੀਆਂ ਜਾਣਗੀਆਂ।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ਐਪ ਸੁਝਾਅ ਪ੍ਰਾਪਤ ਕਰੋ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ਨਹੀਂ ਧੰਨਵਾਦ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ਸੈਟਿੰਗਾਂ"</string>
diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml
index 077982a..3c73de4 100644
--- a/quickstep/res/values-pl/strings.xml
+++ b/quickstep/res/values-pl/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Otrzymuj sugestie aplikacji w wierszu ulubionych na ekranie głównym"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Łatwo uruchamiaj najczęściej używane aplikacje z ekranu głównego. Sugestie będą zmieniać się w zależności od Twoich nawyków. Aplikacje z dolnych wierszy będą przesuwane w górę, do ekranu głównego."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Zyskaj łatwy dostęp do najczęściej używanych aplikacji na ekranie głównym. Sugestie będą się zmieniać na podstawie Twojej rutyny. Aplikacje z wiersza ulubionych zostaną przeniesione na ekran główny."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Korzystaj z najczęściej używanych aplikacji na ekranie głównym w łatwy sposób. Sugestie będą się zmieniać na podstawie Twojej rutyny. Aplikacje z dolnych wierszy będą się przenosić do nowego folderu."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Otrzymuj sugestie aplikacji"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nie, dziękuję"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ustawienia"</string>
diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml
index 124b33b..5e01dc1 100644
--- a/quickstep/res/values-pt-rPT/strings.xml
+++ b/quickstep/res/values-pt-rPT/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Receba sugestões de apps na fila dos favoritos do ecrã principal"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Aceda facilmente às suas apps mais utilizadas, diretamente no ecrã principal. As sugestões mudam em função das suas rotinas. As apps na última fila passam para o ecrã principal."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Aceda facilmente às suas apps mais utilizadas no ecrã principal. As sugestões mudam em função das suas rotinas. As apps na fila dos favoritos passam para o ecrã principal."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Aceda facilmente às suas apps mais utilizadas, diretamente no ecrã principal. As sugestões mudam em função das suas rotinas. As apps na última fila passam para uma nova pasta."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Obter sugestões de apps"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Não, obrigado"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Definições"</string>
diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml
index 199c2f4..fad2170 100644
--- a/quickstep/res/values-pt/strings.xml
+++ b/quickstep/res/values-pt/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Receba sugestões de apps na linha \"Favoritos\" da tela inicial"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Acesse diretamente na tela inicial os apps que você mais usa. As sugestões mudam de acordo com sua rotina, e os apps na linha inferior são movidos para a tela inicial."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Acesse os apps mais usados na tela inicial de forma simples. As sugestões mudam de acordo com sua rotina, e os apps na linha \"Favoritos\" são movidos para a tela inicial."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Acesse diretamente na tela inicial os apps que você mais usa. As sugestões mudam de acordo com sua rotina, e os apps na linha inferior são movidos para uma nova pasta."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Receber sugestões de apps"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Não"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Configurações"</string>
diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml
index ba4badf..8b8c187 100644
--- a/quickstep/res/values-ro/strings.xml
+++ b/quickstep/res/values-ro/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Primește sugestii de aplicații în rândul de preferințe al ecranului de pornire"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accesează cu ușurință cele mai folosite aplicații direct din ecranul de pornire. Sugestiile se vor modifica în funcție de rutine. Aplicațiile din rândul de jos se vor muta în sus pe ecranul de pornire."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Accesează cu ușurință cele mai folosite aplicații direct din ecranul de pornire. Sugestiile se vor schimba în funcție de rutina ta. Aplicațiile din rândul de preferințe se vor muta în ecranul de pornire."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Accesează cu ușurință cele mai folosite aplicații, direct din ecranul de pornire. Sugestiile se vor modifica în funcție de rutine. Aplicațiile din rândul de jos se vor muta într-un dosar nou."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Primește sugestii de aplicații"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nu, mulțumesc"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Setări"</string>
diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml
index 44b72cf..e078ba0 100644
--- a/quickstep/res/values-ru/strings.xml
+++ b/quickstep/res/values-ru/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Рекомендуемые приложения будут появляться в разделе избранных на главном экране"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Приложения, которыми вы часто пользуетесь, будут доступны прямо на главном экране. Их список может меняться с учетом ваших предпочтений. Приложения из нижнего ряда будут перемещены выше на главном экране."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Включите функцию для быстрого доступа к часто используемым приложениям на главном экране. Список меняется с учетом ваших действий. Приложения из раздела избранных будут перемещены на главный экран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Приложения, которыми вы часто пользуетесь, будут доступны прямо на главном экране. Их список может меняться с учетом ваших предпочтений. Приложения из нижнего ряда будут перемещены в новую папку."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Показывать рекомендации"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Отмена"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Настройки"</string>
diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml
index 31749cc..f890548 100644
--- a/quickstep/res/values-si/strings.xml
+++ b/quickstep/res/values-si/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ඔබේ මුල් තිරයේ ප්රියතම පේළියේ යෙදුම් යෝජනා ලබා ගන්න"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ඔබගේ වැඩිපුරම භාවිත කරන යෙදුම්වලට මුල් තිරයේ සිටම පහසුවෙන් ප්රවේශ වන්න. ඔබගේ දිනචරියා මත පදනම්ව යෝජනා වෙනස් වනු ඇත. පහළ පේළියේ යෙදුම් ඔබගේ මුල් තිරය දක්වා ගෙන යනු ඇත."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ඔබගේ වැඩිපුරම භාවිත කරන යෙදුම්වලට මුල් තිරයේ සිටම පහසුවෙන් ප්රවේශ වන්න. ඔබගේ දිනචරියා මත පදනම්ව යෝජනා වෙනස් වනු ඇත. ප්රියතම තුළ යෙදුම් ඔබේ මුල් තිරය වෙත ගෙන යනු ඇත."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ඔබගේ වැඩිපුරම භාවිත කරන යෙදුම්වලට මුල් තිරයේ සිටම පහසුවෙන් ප්රවේශ වන්න. ඔබගේ දිනචරියා මත පදනම්ව යෝජනා වෙනස් වනු ඇත. පහළ පේළියේ යෙදුම් නව ෆෝල්ඩරයකට ගෙන යනු ඇත."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"යෙදුම් යෝජනා ලබා ගන්න"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"එපා ස්තුතියි"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"සැකසීම්"</string>
diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml
index 5d51d45..cdf3339 100644
--- a/quickstep/res/values-sk/strings.xml
+++ b/quickstep/res/values-sk/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Nechajte si na ploche na riadku obľúbených zobrazovať návrhy aplikácií"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Získajte jednoduchý prístup k najpoužívanejším aplikáciám priamo na ploche. Návrhy sa budú meniť podľa vašich zvyklostí. Aplikácie v spodnom riadku sa presunú nahor na plochu."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Získajte jednoduchý prístup k najpoužívanejším aplikáciám priamo na ploche. Návrhy sa budú meniť podľa vašich postupov. Aplikácie v riadku s obľúbenými sa presunú na plochu."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Získajte jednoduchý prístup k najpoužívanejším aplikáciám priamo na ploche. Návrhy sa budú meniť podľa vašich zvyklostí. Aplikácie v spodnom riadku sa presunú do nového priečinka."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Zobrazovať návrhy aplikácií"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nie, ďakujem"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Nastavenia"</string>
diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml
index e196e5d..3e7c5ce 100644
--- a/quickstep/res/values-sl/strings.xml
+++ b/quickstep/res/values-sl/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Prejemajte predloge aplikacij v vrstici s priljubljenimi na začetnem zaslonu"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Preprosto dostopajte do najpogosteje uporabljenih aplikacij kar na začetnem zaslonu. Predlogi se spreminjajo na podlagi dejanj, ki jih pogosto izvajate. Aplikacije iz spodnje vrstice se premaknejo na začetni zaslon."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Preprosto dostopajte do najpogosteje uporabljenih aplikacij kar na začetnem zaslonu. Predlogi se spreminjajo na podlagi dejanj, ki jih pogosto izvajate. Aplikacije v vrstici s priljubljenimi bodo premaknjene na začetni zaslon."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Preprosto dostopajte do najpogosteje uporabljenih aplikacij kar na začetnem zaslonu. Predlogi se spreminjajo na podlagi dejanj, ki jih pogosto izvajate. Aplikacije iz spodnje vrstice se premaknejo v novo mapo."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Prikaži predlagane aplikacije"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Ne, hvala"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Nastavitve"</string>
diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml
index 39771cb..04b7bc1 100644
--- a/quickstep/res/values-sq/strings.xml
+++ b/quickstep/res/values-sq/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Merr aplikacione të sugjeruara në rreshtin e të preferuarave të ekranit tënd bazë"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Qasu me lehtësi në aplikacionet më të përdorura direkt në ekranin bazë. Sugjerimet do të ndryshojnë bazuar në rutinat e tua. Aplikacionet në rreshtin e poshtëm do të zhvendosen lart në ekranin tënd bazë."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Qasu me lehtësi në aplikacionet më të përdorura direkt në ekranin bazë. Sugjerimet do të ndryshojnë bazuar në rutinat e tua. Aplikacionet në rreshtin e të preferuarave do të zhvendosen në ekranin tënd bazë."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Qasu me lehtësi në aplikacionet më të përdorura, direkt në ekranin bazë. Sugjerimet do të ndryshojnë bazuar në rutinat e tua. Aplikacionet në rreshtin e poshtëm do të zhvendosen në një dosje tjetër."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Merr aplikacione të sugjeruara"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Jo, faleminderit"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Cilësimet"</string>
diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml
index 067a7fe..215fde9 100644
--- a/quickstep/res/values-sr/strings.xml
+++ b/quickstep/res/values-sr/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Добијајте предлоге апликација у реду са омиљеним ставкама на почетном екрану"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Лако приступајте апликацијама које најчешће користите директно са почетног екрана. Предлози се мењају на основу употребе. Апликације из доњег реда се премештају нагоре на почетни екран."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Лако приступајте апликацијама које најчешће користите директно са почетног екрана. Предлози се мењају на основу ваших рутина. Апликације из реда са омиљеним ставкама се премештају на почетни екран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Лако приступајте апликацијама које најчешће користите директно са почетног екрана. Предлози се мењају на основу употребе. Апликације из доњег реда се премештају у нов фолдер."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Приказуј предлоге апликација"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не, хвала"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Подешавања"</string>
diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml
index 3bb47c3..e7c0226 100644
--- a/quickstep/res/values-sv/strings.xml
+++ b/quickstep/res/values-sv/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Få appförslag på raden Favoriter på startskärmen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Kom enkelt åt de appar du använder mest, direkt från startskärmen. Förslagen ändras efter dina rutiner. Appar på nedersta raden flyttas upp till startskärmen."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Kom enkelt åt de appar du använder mest, direkt från startskärmen. Förslagen ändras efter dina rutiner. Appar på raden Favoriter flyttas till startskärmen."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Kom enkelt åt de appar du använder mest, direkt från startskärmen. Förslagen ändras efter dina rutiner. Appar på nedersta raden flyttas till en ny mapp."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Få appförslag"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Nej tack"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Inställningar"</string>
diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml
index 16891a8..b1a178e 100644
--- a/quickstep/res/values-sw/strings.xml
+++ b/quickstep/res/values-sw/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Pata mapendekezo ya programu katika safu ya vipendwa ya Skrini yako ya kwanza"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Fikia kwa urahisi programu unazotumia sana moja kwa moja kwenye Skrini ya kwanza. Mapendekezo yatabadilika kulingana na ratiba zako. Programu zilizo kwenye sehemu ya chini zitahamishiwa kwenye Skrini yako ya kwanza."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Fikia kwa urahisi programu unazotumia sana moja kwa moja kwenye Skrini ya kwanza. Mapendekezo yatabadilika kulingana na utumiaji wako. Programu zilizo katika safu ya vipendwa zitahamishiwa kwenye Skrini yako ya kwanza."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Fikia kwa urahisi programu unazotumia zaidi, moja kwa moja kwenye Skrini ya kwanza. Mapendekezo yatabadilika kulingana na ratiba zako. Programu zilizo kwenye safu ya chini zitahamishiwa kwenye folda mpya."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Pata mapendekezo ya programu"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Hapana"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Mipangilio"</string>
diff --git a/quickstep/res/values-sw600dp/dimens.xml b/quickstep/res/values-sw600dp/dimens.xml
index 7494683..cfbbf8d 100644
--- a/quickstep/res/values-sw600dp/dimens.xml
+++ b/quickstep/res/values-sw600dp/dimens.xml
@@ -14,16 +14,23 @@
* limitations under the License.
*/
-->
+<!-- Applies to small tablet screens -->
<resources>
<dimen name="navigation_key_padding">25dp</dimen>
- <!-- Task View -->
+ <!-- Overview Task Views -->
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
<dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
<dimen name="overview_task_margin">12dp</dimen>
+ <!-- The icon size of all non-focused task icons, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
- <dimen name="overview_task_margin_grid">12dp</dimen>
+ <!-- The space between grid rows (when there's 2 rows of thumbnails) -->
<dimen name="overview_grid_row_spacing">28dp</dimen>
+ <!-- The horizontal space between tasks -->
<dimen name="overview_page_spacing">36dp</dimen>
+ <!-- The space to the left and to the right of the "Clear all" button -->
<dimen name="overview_grid_side_margin">64dp</dimen>
</resources>
diff --git a/quickstep/res/values-sw720dp/dimens.xml b/quickstep/res/values-sw720dp/dimens.xml
index ceaa8f8..284ce11 100644
--- a/quickstep/res/values-sw720dp/dimens.xml
+++ b/quickstep/res/values-sw720dp/dimens.xml
@@ -14,14 +14,23 @@
* limitations under the License.
*/
-->
+<!-- Applies to large tablet screens -->
<resources>
- <!-- Task View -->
+ <!-- Overview Task Views -->
+ <!-- The primary task thumbnail uses up to this much of the total screen height/width -->
+ <item name="overview_max_scale" format="float" type="dimen">0.7</item>
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
<dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
<dimen name="overview_task_margin">16dp</dimen>
+ <!-- The icon size of all non-focused task icons, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
- <dimen name="overview_task_margin_grid">16dp</dimen>
+ <!-- The space between grid rows (when there's 2 rows of thumbnails) -->
<dimen name="overview_grid_row_spacing">36dp</dimen>
+ <!-- The horizontal space between tasks -->
<dimen name="overview_page_spacing">44dp</dimen>
+ <!-- The space to the left and to the right of the "Clear all" button -->
<dimen name="overview_grid_side_margin">64dp</dimen>
</resources>
diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml
index 5c73734..431ae3c 100644
--- a/quickstep/res/values-ta/strings.xml
+++ b/quickstep/res/values-ta/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"உங்கள் முகப்புத் திரையின் \'பிடித்தவை\' வரிசையில் ஆப்ஸ் பரிந்துரைகளைப் பெறலாம்"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"அதிகமாகப் பயன்படுத்திய ஆப்ஸை முகப்புத் திரையிலேயே அணுகலாம். உங்கள் வழக்கங்களின் அடிப்படையில் பரிந்துரைகள் மாறும். கடைசி வரிசையிலுள்ள ஆப்ஸ் உங்கள் முகப்புத் திரைக்கு நகர்த்தப்படும்."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"அதிகமாகப் பயன்படுத்திய ஆப்ஸை முகப்புத் திரையிலேயே எளிதாக அணுகலாம். உங்கள் வழக்கங்களின் அடிப்படையில் பரிந்துரைகள் மாறும். பிடித்தவை வரிசையில் உள்ள ஆப்ஸ் உங்கள் முகப்புத் திரைக்கு நகர்த்தப்படும்."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"அதிகமாகப் பயன்படுத்திய ஆப்ஸை முகப்புத் திரையிலேயே அணுகலாம். உங்கள் வழக்கங்களின் அடிப்படையில் பரிந்துரைகள் மாறும். கடைசி வரிசையிலுள்ள ஆப்ஸ் புதிய ஃபோல்டருக்கு நகர்த்தப்படும்."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ஆப்ஸ் பரிந்துரைகளைப் பெறுக"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"வேண்டாம்"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"அமைப்புகள்"</string>
diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml
index 332e95d..7b6dedf 100644
--- a/quickstep/res/values-te/strings.xml
+++ b/quickstep/res/values-te/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"మీ హోమ్ స్క్రీన్లోని ఇష్టమైన వాటి వరుసలో యాప్ సూచనలు పొందండి"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"మీరు ఎక్కువగా ఉపయోగించే యాప్లను నేరుగా మొదటి స్క్రీన్లోనే సులభంగా యాక్సెస్ చేయండి. మీ రోజువారీ యాక్టివిటీలను బట్టి సూచనలు మారతాయి. దిగువ వరుసలోని యాప్లు మీ మొదటి స్క్రీన్ పైకి చేరుకుంటాయి."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"మీరు ఎక్కువగా ఉపయోగించే యాప్లను నేరుగా మొదటి స్క్రీన్లోనే సులభంగా యాక్సెస్ చేయండి. మీ రోజువారీ యాక్టివిటీలను బట్టి సూచనలు మారతాయి. ఇష్టమైన వాటి వరుసలోని యాప్లు మీ మొదటి స్క్రీన్కు చేరుకుంటాయి."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"మీరు ఎక్కువగా ఉపయోగించే యాప్లను నేరుగా మొదటి స్క్రీన్లోనే సులభంగా యాక్సెస్ చేయండి. మీ రోజువారీ యాక్టివిటీలను బట్టి సూచనలు మారతాయి. దిగువ వరుసలోని యాప్లు కొత్త ఫోల్డర్కు తరలించబడతాయి."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"యాప్ సూచనలను పొందండి"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"వద్దు"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"సెట్టింగ్లు"</string>
diff --git a/quickstep/res/values-th/strings.xml b/quickstep/res/values-th/strings.xml
index 59a84ff..4d5794b 100644
--- a/quickstep/res/values-th/strings.xml
+++ b/quickstep/res/values-th/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"รับคำแนะนำเกี่ยวกับแอปในแถวรายการโปรดของหน้าจอหลัก"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"เข้าถึงแอปที่คุณใช้มากที่สุดได้อย่างง่ายดายจากหน้าจอหลัก การแนะนำจะเปลี่ยนไปตามแอปที่ใช้งานเป็นประจำ แอปในแถวล่างจะย้ายขึ้นมาอยู่ในหน้าจอหลัก"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"เข้าถึงแอปที่คุณใช้มากที่สุดได้อย่างง่ายดายจากหน้าจอหลัก การแนะนำจะเปลี่ยนไปตามแอปที่ใช้งานเป็นประจำ แอปในแถวรายการโปรดจะย้ายไปอยู่ในหน้าจอหลัก"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"เข้าถึงแอปที่คุณใช้มากที่สุดได้อย่างง่ายดายจากหน้าจอหลัก การแนะนำจะเปลี่ยนไปตามแอปที่ใช้งานเป็นประจำ แอปในแถวล่างจะย้ายไปอยู่ในโฟลเดอร์ใหม่"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ดูแอปแนะนำ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ไม่เป็นไร"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"การตั้งค่า"</string>
diff --git a/quickstep/res/values-tl/strings.xml b/quickstep/res/values-tl/strings.xml
index b22d85d..6699ed8 100644
--- a/quickstep/res/values-tl/strings.xml
+++ b/quickstep/res/values-tl/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Makakuha ng mga iminumungkahing app sa row ng mga paborito ng iyong Home screen"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Madaling ma-access ang mga pinakaginagamit mong app nang direkta sa Home screen. Magbabago ang mga suhestyon batay sa iyong mga routine. Mapupunta sa iyong Home screen ang mga app na nasa ibabang row."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Madaling ma-access ang mga pinakaginagamit mong app nang direkta sa Home screen. Magbabago ang mga suhestyon batay sa iyong mga routine. Mapupunta sa iyong Home screen ang mga app sa row ng mga paborito."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Madaling ma-access ang mga pinakaginagamit mong app, direkta sa Home screen. Magbabago ang mga suhestyon batay sa iyong mga routine. Mapupunta sa isang bagong folder ang mga app na nasa ibabang row."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Kumuha ng mga suhestiyon sa app"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Huwag na lang"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Mga Setting"</string>
diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml
index b3054f7..24e25ff 100644
--- a/quickstep/res/values-tr/strings.xml
+++ b/quickstep/res/values-tr/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Ana ekranınızın favoriler satırında uygulama önerileri alın"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"En çok kullanılan uygulamalarınıza Ana ekranda kolayca erişin. Öneriler, rutinlerinize dayalı olarak değişir. Alt satırdaki uygulamalar, yukarı taşınarak Ana ekranınıza alınır."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"En çok kullanılan uygulamalarınıza Ana ekrandan kolayca erişin. Öneriler rutinlerinize dayalı olarak değişir. Favoriler satırındaki uygulamalar Ana ekranınıza taşınır."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"En çok kullanılan uygulamalarınıza Ana ekranda kolayca erişin. Öneriler, rutinlerinize dayalı olarak değişir. Alt satırdaki uygulamalar yeni bir klasöre taşınır."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Uygulama önerileri al"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Hayır, teşekkürler"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Ayarlar"</string>
diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml
index 490ac2d..8dd65e2 100644
--- a/quickstep/res/values-uk/strings.xml
+++ b/quickstep/res/values-uk/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Рекомендовані додатки з\'являтимуться в рядку \"Вибране\" на головному екрані"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"З легкістю відкривайте на головному екрані ті додатки, які використовуєте найчастіше. Рекомендації змінюватимуться залежно від ваших дій. Додатки в нижньому рядку перемістяться на головний екран."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"З легкістю відкривайте найпотрібніші додатки просто з головного екрана. Рекомендації змінюватимуться залежно від ваших дій. Додатки з рядка \"Вибране\" буде переміщено на головний екран."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"З легкістю відкривайте найвикористовуваніші додатки просто з головного екрана. Рекомендації змінюватимуться залежно від ваших дій. Додатки в нижньому рядку буде переміщено в нову папку."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Показувати рекомендації"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Не потрібно"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Налаштування"</string>
diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml
index 8f2da65..2d9a1e3 100644
--- a/quickstep/res/values-ur/strings.xml
+++ b/quickstep/res/values-ur/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"اپنی ہوم اسکرین کی پسندیدہ قطار پر ایپ کی تجاویز حاصل کریں"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ہوم اسکرین پر آسانی سے اپنی سب سے زیادہ مستعمل ایپس تک رسائی حاصل کریں۔ آپ کی روٹینز کی بنیاد پر تجاویز تبدیل ہوں گی۔ نچلی قطار میں موجود ایپس آپ کی ہوم اسکرین کے اوپر منتقل ہوں گی۔"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ہوم اسکرین پر آسانی سے اپنی سب سے زیادہ مستعمل ایپس تک رسائی حاصل کریں۔ آپ کی روٹینز کی بنیاد پر تجاویز تبدیل ہوں گی۔ پسندیدہ میں موجود ایپس آپ کی ہوم اسکرین کے اوپر منتقل ہوں گی۔"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ہوم اسکرین پر، آسانی سے اپنی سب سے زیادہ مستعمل ایپس تک رسائی حاصل کریں۔ آپ کی روٹینز کی بنیاد پر تجاویز تبدیل ہوں گی۔ نچلی قطار میں موجود ایپس نئے فولڈر میں منتقل ہوں گی۔"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ایپس کی تجاویز حاصل کریں"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"نہیں شکریہ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ترتیبات"</string>
diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml
index 9c47cef..9446325 100644
--- a/quickstep/res/values-uz/strings.xml
+++ b/quickstep/res/values-uz/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Tavsiya etiladigan ilovalar bosh ekranning saralanganlar ruknida chiqadi"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Faol ishlatiladigan ilovalarga bosh ekrandan osongina kira olasiz. Tavsiyalar oxirgi faoliyatingiz asosida almashib boradi. Pastki qatordagi ilovalar bosh ekranga chiqadi."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Faol ishlatiladigan ilovalarga bosh ekrandan osongina kira olasiz. Tavsiyalar oxirgi faoliyatingiz asosida almashib boradi. Saralanganlar qatoridagi ilovalar bosh ekranga chiqadi."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Faol ishlatiladigan ilovalarga bosh ekrandan osongina kira olasiz. Tavsiyalar oxirgi faoliyatingiz asosida almashib boradi. Pastki qatordagi ilovalar yangi jildga chiqadi."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Tavsiyalarni chiqarish"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Kerak emas"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Sozlamalar"</string>
diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml
index 2e5c3e7..55027ae 100644
--- a/quickstep/res/values-vi/strings.xml
+++ b/quickstep/res/values-vi/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Nhận các ứng dụng đề xuất trên hàng mục ưa thích của Màn hình chính"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Bạn có thể dễ dàng truy cập những ứng dụng mà mình dùng thường xuyên nhất ngay trên màn hình chính. Các ứng dụng đề xuất sẽ thay đổi dựa trên thói quen của bạn. Các ứng dụng ở hàng dưới cùng sẽ chuyển lên phía trên của Màn hình chính."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Bạn có thể dễ dàng mở những ứng dụng mà mình dùng thường xuyên nhất ngay trên màn hình chính. Các ứng dụng đề xuất sẽ thay đổi dựa trên thói quen của bạn. Các ứng dụng ở hàng mục ưa thích sẽ chuyển sang Màn hình chính."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Bạn có thể dễ dàng truy cập những ứng dụng mà mình dùng thường xuyên nhất ngay trên màn hình chính. Các ứng dụng đề xuất sẽ thay đổi dựa trên thói quen của bạn. Các ứng dụng ở hàng dưới cùng sẽ chuyển đến một thư mục mới."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Nhận ứng dụng đề xuất"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Không, cảm ơn"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Cài đặt"</string>
diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml
index 0b5193f..debf23a 100644
--- a/quickstep/res/values-zh-rCN/strings.xml
+++ b/quickstep/res/values-zh-rCN/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"在主屏幕的收藏行获取应用建议"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"直接在主屏幕上轻松访问您最常用的应用。系统会根据您的日常安排提供不同的建议。最下面一排中的应用会向上移到主屏幕中。"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"直接在主屏幕上轻松访问您最常用的应用。建议会因您的日常安排而变化,收藏行中的应用将移到主屏幕上。"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"直接在主屏幕上轻松访问您最常用的应用。系统会根据您的日常安排提供不同的建议。最下面一排中的应用会移到新文件夹中。"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"获取应用建议"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"不用了"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"设置"</string>
diff --git a/quickstep/res/values-zh-rHK/strings.xml b/quickstep/res/values-zh-rHK/strings.xml
index b700da0..c7a44e7 100644
--- a/quickstep/res/values-zh-rHK/strings.xml
+++ b/quickstep/res/values-zh-rHK/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"在主畫面「我的最愛」列取得應用程式建議"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"在主畫面輕鬆存取常用的應用程式。系統會根據您的日常安排更改建議,並將底部的應用程式移到主畫面。"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"在主畫面輕鬆存取最常用的應用程式。系統會根據您的日常安排變更建議,「我的最愛」列中的應用程式會移至主畫面。"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"在主畫面輕鬆存取最常用的應用程式。系統會根據您的日常安排變更建議,並將底列的應用程式移至新資料夾。"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"取得應用程式建議"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"不用了,謝謝"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"設定"</string>
diff --git a/quickstep/res/values-zh-rTW/strings.xml b/quickstep/res/values-zh-rTW/strings.xml
index e7b74a4..15d5de5 100644
--- a/quickstep/res/values-zh-rTW/strings.xml
+++ b/quickstep/res/values-zh-rTW/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"在主畫面的收藏列取得應用程式建議"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"你可以輕鬆地在主畫面上找到自己常用的應用程式。應用程式建議會依據你的日常使用習慣而有所不同。系統會將底部列出的應用程式上移到主畫面。"</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"你可以輕鬆地在主畫面上找到自己常用的應用程式。系統會根據你的日常使用習慣提供不同的應用程式建議,並在主畫面顯示收藏列中的應用程式。"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"你可以輕鬆地在主畫面上找到自己常用的應用程式。應用程式建議會根據日常安排有所不同。系統會將底部列出的應用程式移到新的資料夾。"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"取得應用程式建議"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"不用了,謝謝"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"設定"</string>
diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml
index c69f63d..3db5836 100644
--- a/quickstep/res/values-zu/strings.xml
+++ b/quickstep/res/values-zu/strings.xml
@@ -35,7 +35,6 @@
<string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Thola iziphakamiso zohlelo lokusebenza kumugqa wezintandokazi Zesikrini sakho sasekhaya"</string>
<string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Finyelela kalula izinhlelo zakho zokusebenza ezisetshenziswa kakhulu khona kusikrini sasekhaya. Iziphakamiso zizoshintsha ngokususelwe kwimijikelezo yakho. Izinhlelo zokusebenza ezisemgqeni ongezansi zizoya phezulu kusikrini sakho sasekhaya."</string>
<string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"Finyelela kalula izinhlelo zakho zokusebenza ezisetshenziswa kakhulu khona kusikrini sasekhaya. Iziphakamiso zizoshintsha ngokususelwe kwimijikelezo yakho. Izintandokazi zomugqa wezinhlelo zokusebenza zizoya Kusikrini sakho sasekhaya."</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"Finyelela kalula izinhlelo zakho zokusebenza ezisetshenziswa njalo, kusikrini sasekhaya. Iziphakamiso zizoshintsha ngokususelwe kwimijikelezo yakho. Izinhlelo zokusebenza ezisemgqeni ongezansi zizoya phezulu kufolda entsha."</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"Thola iziphakamiso zohlelo lokusebenza"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"Cha ngiyabonga"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"Amasethingi"</string>
diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml
index 3b4a28b..198a676 100644
--- a/quickstep/res/values/config.xml
+++ b/quickstep/res/values/config.xml
@@ -43,4 +43,9 @@
<!-- Accessibility actions -->
<item type="id" name="action_move_to_top_or_left" />
<item type="id" name="action_move_to_bottom_or_right" />
+
+ <!-- The max scale for the wallpaper when it's zoomed in -->
+ <item name="config_wallpaperMaxScale" format="float" type="dimen">
+ @*android:dimen/config_wallpaperMaxScale
+ </item>
</resources>
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 0232f86..c85e71c 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -31,14 +31,19 @@
<dimen name="overview_minimum_next_prev_size">50dp</dimen>
- <!-- Task View -->
- <dimen name="task_thumbnail_icon_size">48dp</dimen>
- <dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
- <dimen name="overview_task_margin">16dp</dimen>
- <dimen name="overview_page_spacing">16dp</dimen>
- <dimen name="task_icon_cache_default_icon_size">72dp</dimen>
-
+ <!-- Overview Task Views -->
+ <!-- The primary task thumbnail uses up to this much of the total screen height/width -->
<item name="overview_max_scale" format="float" type="dimen">0.7</item>
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
+ <dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
+ <dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
+ <dimen name="overview_task_margin">16dp</dimen>
+ <!-- The horizontal space between tasks -->
+ <dimen name="overview_page_spacing">16dp</dimen>
+
+ <dimen name="task_icon_cache_default_icon_size">72dp</dimen>
<item name="overview_modal_max_scale" format="float" type="dimen">1.1</item>
<!-- Overrideable in overlay that provides the Overview Actions. -->
@@ -258,6 +263,7 @@
<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_small_screen">108dp</dimen>
<dimen name="taskbar_unstash_input_area">316dp</dimen>
<dimen name="taskbar_stashed_handle_height">4dp</dimen>
<dimen name="taskbar_edu_wave_anim_trans_y">25dp</dimen>
@@ -271,8 +277,9 @@
<!-- Taskbar 3 button spacing -->
<dimen name="taskbar_button_space_inbetween">24dp</dimen>
+ <dimen name="taskbar_button_space_inbetween_phone">40dp</dimen>
<dimen name="taskbar_button_margin_5_5">26dp</dimen>
- <dimen name="taskbar_button_margin_6_5">26dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">75dp</dimen>
<dimen name="taskbar_button_margin_4_5">47dp</dimen>
<dimen name="taskbar_button_margin_4_4">47dp</dimen>
<dimen name="taskbar_button_margin_default">47dp</dimen>
diff --git a/quickstep/res/values/override.xml b/quickstep/res/values/override.xml
index 705ec9d..4f472f0 100644
--- a/quickstep/res/values/override.xml
+++ b/quickstep/res/values/override.xml
@@ -25,4 +25,6 @@
<string name="model_delegate_class" translatable="false">com.android.launcher3.model.QuickstepModelDelegate</string>
+ <string name="secondary_display_predictions_class" translatable="false">com.android.launcher3.secondarydisplay.SecondaryDisplayPredictionsImpl</string>
+
</resources>
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 81b0dd2..c0d52a4 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -68,7 +68,6 @@
<string name="hotseat_edu_message_migrate">Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your Home screen. </string>
<string name="hotseat_edu_message_migrate_landscape">Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps in favorites row will move to your Home screen. </string>
- <string name="hotseat_edu_message_migrate_alt">Easily access your most-used apps, right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move to a new folder.</string>
<!-- Button text to opt in for fully predicted hotseat -->
<string name="hotseat_edu_accept">Get app suggestions</string>
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
deleted file mode 100644
index e21dcba..0000000
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ /dev/null
@@ -1,708 +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;
-
-import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
-import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
-import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
-import static com.android.launcher3.LauncherState.NORMAL;
-import static com.android.launcher3.LauncherState.NO_OFFSET;
-import static com.android.launcher3.LauncherState.OVERVIEW;
-import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE;
-import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
-import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
-import static com.android.launcher3.taskbar.LauncherTaskbarUIController.ALL_APPS_PAGE_PROGRESS_INDEX;
-import static com.android.launcher3.taskbar.LauncherTaskbarUIController.MINUS_ONE_PAGE_PROGRESS_INDEX;
-import static com.android.launcher3.taskbar.LauncherTaskbarUIController.WIDGETS_PAGE_PROGRESS_INDEX;
-import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
-import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
-import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS;
-import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
-
-import android.animation.AnimatorSet;
-import android.animation.ValueAnimator;
-import android.app.ActivityManager;
-import android.app.ActivityOptions;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentSender;
-import android.hardware.SensorManager;
-import android.hardware.devicestate.DeviceStateManager;
-import android.os.Bundle;
-import android.os.CancellationSignal;
-import android.os.IBinder;
-import android.view.Display;
-import android.view.View;
-import android.window.SplashScreen;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.dragndrop.DragOptions;
-import com.android.launcher3.model.WellbeingModel;
-import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.popup.SystemShortcut;
-import com.android.launcher3.proxy.ProxyActivityStarter;
-import com.android.launcher3.proxy.StartActivityParams;
-import com.android.launcher3.statehandlers.BackButtonAlphaHandler;
-import com.android.launcher3.statehandlers.DepthController;
-import com.android.launcher3.statemanager.StateManager.StateHandler;
-import com.android.launcher3.taskbar.LauncherTaskbarUIController;
-import com.android.launcher3.taskbar.TaskbarManager;
-import com.android.launcher3.uioverrides.RecentsViewStateController;
-import com.android.launcher3.util.ActivityOptionsWrapper;
-import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
-import com.android.launcher3.util.IntSet;
-import com.android.launcher3.util.ObjectWrapper;
-import com.android.launcher3.util.PendingSplitSelectInfo;
-import com.android.launcher3.util.RunnableList;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
-import com.android.launcher3.util.UiThreadHelper;
-import com.android.quickstep.OverviewCommandHelper;
-import com.android.quickstep.RecentsModel;
-import com.android.quickstep.SystemUiProxy;
-import com.android.quickstep.TaskUtils;
-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;
-import com.android.quickstep.util.TISBindHelper;
-import com.android.quickstep.views.OverviewActionsView;
-import com.android.quickstep.views.RecentsView;
-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.ResourceUnfoldTransitionConfig;
-import com.android.systemui.unfold.config.UnfoldTransitionConfig;
-import com.android.systemui.unfold.system.ActivityManagerActivityTypeProvider;
-import com.android.systemui.unfold.system.DeviceStateManagerFoldProvider;
-
-import java.io.FileDescriptor;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Stream;
-
-/**
- * Extension of Launcher activity to provide quickstep specific functionality
- */
-public abstract class BaseQuickstepLauncher extends Launcher {
-
- private DepthController mDepthController = new DepthController(this);
- private QuickstepTransitionManager mAppTransitionManager;
-
- /**
- * Reusable command for applying the back button alpha on the background thread.
- */
- public static final UiThreadHelper.AsyncCommand SET_BACK_BUTTON_ALPHA =
- (context, arg1, arg2) -> SystemUiProxy.INSTANCE.get(context).setNavBarButtonAlpha(
- Float.intBitsToFloat(arg1), arg2 != 0);
-
- private OverviewActionsView mActionsView;
-
- private TISBindHelper mTISBindHelper;
- private @Nullable TaskbarManager mTaskbarManager;
- private @Nullable OverviewCommandHelper mOverviewCommandHelper;
- private @Nullable LauncherTaskbarUIController mTaskbarUIController;
-
- // Will be updated when dragging from taskbar.
- private @Nullable DragOptions mNextWorkspaceDragOptions = null;
-
- private @Nullable UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
- private @Nullable LauncherUnfoldAnimationController mLauncherUnfoldAnimationController;
-
- /**
- * If Launcher restarted while in the middle of an Overview split select, it needs this data to
- * recover. In all other cases this will remain null.
- */
- private PendingSplitSelectInfo mPendingSplitSelectInfo = null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- if (savedInstanceState != null) {
- mPendingSplitSelectInfo = ObjectWrapper.unwrap(
- savedInstanceState.getIBinder(PENDING_SPLIT_SELECT_INFO));
- }
- 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();
- }
-
- mTISBindHelper.onDestroy();
- if (mTaskbarManager != null) {
- mTaskbarManager.clearActivity(this);
- }
-
- if (mLauncherUnfoldAnimationController != null) {
- mLauncherUnfoldAnimationController.onDestroy();
- }
-
- super.onDestroy();
- }
-
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
-
- if (mOverviewCommandHelper != null) {
- mOverviewCommandHelper.clearPendingCommands();
- }
- }
-
- public QuickstepTransitionManager getAppTransitionManager() {
- return mAppTransitionManager;
- }
-
- @Override
- public void onEnterAnimationComplete() {
- super.onEnterAnimationComplete();
- // After the transition to home, enable the high-res thumbnail loader if it wasn't enabled
- // as a part of quickstep, so that high-res thumbnails can load the next time we enter
- // overview
- RecentsModel.INSTANCE.get(this).getThumbnailCache()
- .getHighResLoadingState().setVisible(true);
- }
-
- @Override
- protected void handleGestureContract(Intent intent) {
- if (FeatureFlags.SEPARATE_RECENTS_ACTIVITY.get()) {
- super.handleGestureContract(intent);
- }
- }
-
- @Override
- public void onTrimMemory(int level) {
- super.onTrimMemory(level);
- RecentsModel.INSTANCE.get(this).onTrimMemory(level);
- }
-
- @Override
- public void onUiChangedWhileSleeping() {
- // Remove the snapshot because the content view may have obvious changes.
- UI_HELPER_EXECUTOR.execute(
- () -> ActivityManagerWrapper.getInstance().invalidateHomeTaskSnapshot(this));
- }
-
- @Override
- protected void onScreenOff() {
- super.onScreenOff();
- if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
- RecentsView recentsView = getOverviewPanel();
- recentsView.finishRecentsAnimation(true /* toRecents */, null);
- }
- }
-
- /**
- * {@code LauncherOverlayCallbacks} scroll amount.
- * Indicates transition progress to -1 screen.
- * @param progress From 0 to 1.
- */
- @Override
- public void onScrollChanged(float progress) {
- super.onScrollChanged(progress);
- mDepthController.onOverlayScrollChanged(progress);
- onTaskbarInAppDisplayProgressUpdate(progress, MINUS_ONE_PAGE_PROGRESS_INDEX);
- }
-
- @Override
- public void onAllAppsTransition(float progress) {
- super.onAllAppsTransition(progress);
- onTaskbarInAppDisplayProgressUpdate(progress, ALL_APPS_PAGE_PROGRESS_INDEX);
- }
-
- @Override
- public void onWidgetsTransition(float progress) {
- super.onWidgetsTransition(progress);
- onTaskbarInAppDisplayProgressUpdate(progress, WIDGETS_PAGE_PROGRESS_INDEX);
- }
-
- private void onTaskbarInAppDisplayProgressUpdate(float progress, int flag) {
- if (mTaskbarManager == null
- || mTaskbarManager.getCurrentActivityContext() == null
- || mTaskbarUIController == null) {
- return;
- }
- mTaskbarUIController.onTaskbarInAppDisplayProgressUpdate(progress, flag);
- }
-
- @Override
- public void startIntentSenderForResult(IntentSender intent, int requestCode,
- Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) {
- if (requestCode != -1) {
- mPendingActivityRequestCode = requestCode;
- StartActivityParams params = new StartActivityParams(this, requestCode);
- params.intentSender = intent;
- params.fillInIntent = fillInIntent;
- params.flagsMask = flagsMask;
- params.flagsValues = flagsValues;
- params.extraFlags = extraFlags;
- params.options = options;
- startActivity(ProxyActivityStarter.getLaunchIntent(this, params));
- } else {
- super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask,
- flagsValues, extraFlags, options);
- }
- }
-
- @Override
- public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
- if (requestCode != -1) {
- mPendingActivityRequestCode = requestCode;
- StartActivityParams params = new StartActivityParams(this, requestCode);
- params.intent = intent;
- params.options = options;
- startActivity(ProxyActivityStarter.getLaunchIntent(this, params));
- } else {
- super.startActivityForResult(intent, requestCode, options);
- }
- }
-
- @Override
- protected void onDeferredResumed() {
- super.onDeferredResumed();
- handlePendingActivityRequest();
- }
-
- @Override
- public void onStateSetEnd(LauncherState state) {
- super.onStateSetEnd(state);
- handlePendingActivityRequest();
- }
-
- private void handlePendingActivityRequest() {
- if (mPendingActivityRequestCode != -1 && isInState(NORMAL)
- && ((getActivityFlags() & ACTIVITY_STATE_DEFERRED_RESUMED) != 0)) {
- // Remove any active ProxyActivityStarter task and send RESULT_CANCELED to Launcher.
- onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
- // ProxyActivityStarter is started with clear task to reset the task after which it
- // removes the task itself.
- startActivity(ProxyActivityStarter.getLaunchIntent(this, null));
- }
- }
-
- @Override
- protected void setupViews() {
- super.setupViews();
-
- mActionsView = findViewById(R.id.overview_actions_view);
- RecentsView overviewPanel = (RecentsView) getOverviewPanel();
- SplitSelectStateController controller =
- new SplitSelectStateController(this, mHandler, getStateManager(),
- getDepthController());
- overviewPanel.init(mActionsView, controller);
- mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
- mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));
-
- mAppTransitionManager = new QuickstepTransitionManager(this);
- mAppTransitionManager.registerRemoteAnimations();
- mAppTransitionManager.registerRemoteTransitions();
-
- mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
- }
-
- private void onTISConnected(TISBinder binder) {
- mTaskbarManager = binder.getTaskbarManager();
- mTaskbarManager.setActivity(this);
- mOverviewCommandHelper = binder.getOverviewCommandHelper();
- }
-
- @Override
- public void runOnBindToTouchInteractionService(Runnable r) {
- mTISBindHelper.runOnBindToTouchInteractionService(r);
- }
-
- private void initUnfoldTransitionProgressProvider() {
- final UnfoldTransitionConfig config = new ResourceUnfoldTransitionConfig();
- if (config.isEnabled()) {
- mUnfoldTransitionProgressProvider =
- UnfoldTransitionFactory.createUnfoldTransitionProgressProvider(
- /* context= */ this,
- config,
- ProxyScreenStatusProvider.INSTANCE,
- new DeviceStateManagerFoldProvider(
- getSystemService(DeviceStateManager.class), /* context */this),
- new ActivityManagerActivityTypeProvider(
- getSystemService(ActivityManager.class)),
- getSystemService(SensorManager.class),
- getMainThreadHandler(),
- getMainExecutor(),
- /* backgroundExecutor= */ THREAD_POOL_EXECUTOR,
- /* tracingTagPrefix= */ "launcher"
- );
-
- mLauncherUnfoldAnimationController = new LauncherUnfoldAnimationController(
- this,
- getWindowManager(),
- mUnfoldTransitionProgressProvider
- );
- }
- }
-
- public void setTaskbarUIController(LauncherTaskbarUIController taskbarUIController) {
- mTaskbarUIController = taskbarUIController;
- }
-
- public @Nullable LauncherTaskbarUIController getTaskbarUIController() {
- return mTaskbarUIController;
- }
-
- public <T extends OverviewActionsView> T getActionsView() {
- return (T) mActionsView;
- }
-
- @Override
- protected void closeOpenViews(boolean animate) {
- super.closeOpenViews(animate);
- TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
- }
-
- @Override
- protected void collectStateHandlers(List<StateHandler> out) {
- super.collectStateHandlers(out);
- out.add(getDepthController());
- out.add(new RecentsViewStateController(this));
- out.add(new BackButtonAlphaHandler(this));
- }
-
- public DepthController getDepthController() {
- return mDepthController;
- }
-
- @Nullable
- public UnfoldTransitionProgressProvider getUnfoldTransitionProgressProvider() {
- return mUnfoldTransitionProgressProvider;
- }
-
- @Override
- public boolean supportsAdaptiveIconAnimation(View clickedView) {
- return mAppTransitionManager.hasControlRemoteAppTransitionPermission();
- }
-
- @Override
- public DragOptions getDefaultWorkspaceDragOptions() {
- if (mNextWorkspaceDragOptions != null) {
- DragOptions options = mNextWorkspaceDragOptions;
- mNextWorkspaceDragOptions = null;
- return options;
- }
- return super.getDefaultWorkspaceDragOptions();
- }
-
- public void setNextWorkspaceDragOptions(DragOptions dragOptions) {
- mNextWorkspaceDragOptions = dragOptions;
- }
-
- @Override
- public void useFadeOutAnimationForLauncherStart(CancellationSignal signal) {
- QuickstepTransitionManager appTransitionManager = getAppTransitionManager();
- appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() {
- @Override
- public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets,
- RemoteAnimationTargetCompat[] wallpaperTargets) {
-
- // On the first call clear the reference.
- signal.cancel();
-
- ValueAnimator fadeAnimation = ValueAnimator.ofFloat(1, 0);
- fadeAnimation.addUpdateListener(new RemoteFadeOutAnimationListener(appTargets,
- wallpaperTargets));
- AnimatorSet anim = new AnimatorSet();
- anim.play(fadeAnimation);
- return anim;
- }
- }, signal);
- }
-
- @Override
- public float[] getNormalOverviewScaleAndOffset() {
- return DisplayController.getNavigationMode(this).hasGestures
- ? new float[] {1, 1} : new float[] {1.1f, NO_OFFSET};
- }
-
- @Override
- public void onDragLayerHierarchyChanged() {
- onLauncherStateOrFocusChanged();
- }
-
- @Override
- protected void onActivityFlagsChanged(int changeBits) {
- if ((changeBits
- & (ACTIVITY_STATE_WINDOW_FOCUSED | ACTIVITY_STATE_TRANSITION_ACTIVE)) != 0) {
- onLauncherStateOrFocusChanged();
- }
-
- if ((changeBits & ACTIVITY_STATE_STARTED) != 0) {
- mDepthController.setActivityStarted(isStarted());
- }
-
- if ((changeBits & ACTIVITY_STATE_RESUMED) != 0) {
- if (mTaskbarUIController != null) {
- mTaskbarUIController.onLauncherResumedOrPaused(hasBeenResumed());
- }
- }
-
- super.onActivityFlagsChanged(changeBits);
- }
-
- public boolean shouldBackButtonBeHidden(LauncherState toState) {
- NavigationMode mode = DisplayController.getNavigationMode(this);
- boolean shouldBackButtonBeHidden = mode.hasGestures
- && toState.hasFlag(FLAG_HIDE_BACK_BUTTON)
- && hasWindowFocus()
- && (getActivityFlags() & ACTIVITY_STATE_TRANSITION_ACTIVE) == 0;
- if (shouldBackButtonBeHidden) {
- // Show the back button if there is a floating view visible.
- shouldBackButtonBeHidden = AbstractFloatingView.getTopOpenViewWithType(this,
- TYPE_ALL & ~TYPE_HIDE_BACK_BUTTON) == null;
- }
- return shouldBackButtonBeHidden;
- }
-
- /**
- * Sets the back button visibility based on the current state/window focus.
- */
- private void onLauncherStateOrFocusChanged() {
- boolean shouldBackButtonBeHidden = shouldBackButtonBeHidden(getStateManager().getState());
- if (DisplayController.getNavigationMode(this) == TWO_BUTTONS) {
- UiThreadHelper.setBackButtonAlphaAsync(this, SET_BACK_BUTTON_ALPHA,
- shouldBackButtonBeHidden ? 0f : 1f, true /* animate */);
- }
- if (getDragLayer() != null) {
- getRootView().setDisallowBackGesture(shouldBackButtonBeHidden);
- }
- }
-
- @Override
- public void finishBindingItems(IntSet pagesBoundFirst) {
- super.finishBindingItems(pagesBoundFirst);
- // Instantiate and initialize WellbeingModel now that its loading won't interfere with
- // populating workspace.
- // TODO: Find a better place for this
- WellbeingModel.INSTANCE.get(this);
- }
-
- @Override
- public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
- pendingTasks.add(() -> {
- // This is added in pending task as we need to wait for views to be positioned
- // correctly before registering them for the animation.
- if (mLauncherUnfoldAnimationController != null) {
- // This is needed in case items are rebound while the unfold animation is in
- // progress.
- mLauncherUnfoldAnimationController.updateRegisteredViewsIfNeeded();
- }
- });
- super.onInitialBindComplete(boundPages, pendingTasks);
- }
-
- @Override
- public Stream<SystemShortcut.Factory> getSupportedShortcuts() {
- Stream<SystemShortcut.Factory> base = Stream.of(WellbeingModel.SHORTCUT_FACTORY);
- if (ENABLE_SPLIT_FROM_WORKSPACE.get() && mDeviceProfile.isTablet) {
- RecentsView recentsView = getOverviewPanel();
- // TODO: Pull it out of PagedOrentationHandler for split from workspace.
- List<SplitPositionOption> positions =
- recentsView.getPagedOrientationHandler().getSplitPositionOptions(
- mDeviceProfile);
- List<SystemShortcut.Factory<BaseQuickstepLauncher>> splitShortcuts = new ArrayList<>();
- for (SplitPositionOption position : positions) {
- splitShortcuts.add(getSplitSelectShortcutByPosition(position));
- }
- base = Stream.concat(base, splitShortcuts.stream());
- }
- return Stream.concat(base, super.getSupportedShortcuts());
- }
-
- @Override
- public ActivityOptionsWrapper getActivityLaunchOptions(View v, @Nullable ItemInfo item) {
- ActivityOptionsWrapper activityOptions =
- mAppTransitionManager.hasControlRemoteAppTransitionPermission()
- ? mAppTransitionManager.getActivityLaunchOptions(v)
- : super.getActivityLaunchOptions(v, item);
- if (mLastTouchUpTime > 0) {
- ActivityOptionsCompat.setLauncherSourceInfo(
- activityOptions.options, mLastTouchUpTime);
- }
- activityOptions.options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
- activityOptions.options.setLaunchDisplayId(
- (v != null && v.getDisplay() != null) ? v.getDisplay().getDisplayId()
- : Display.DEFAULT_DISPLAY);
- addLaunchCookie(item, activityOptions.options);
- return activityOptions;
- }
-
- /**
- * Adds a new launch cookie for the activity launch if supported.
- *
- * @param info the item info for the launch
- * @param opts the options to set the launchCookie on.
- */
- public void addLaunchCookie(ItemInfo info, ActivityOptions opts) {
- IBinder launchCookie = getLaunchCookie(info);
- if (launchCookie != null) {
- opts.setLaunchCookie(launchCookie);
- }
- }
-
- /**
- * Return a new launch cookie for the activity launch if supported.
- *
- * @param info the item info for the launch
- */
- public IBinder getLaunchCookie(ItemInfo info) {
- if (info == null) {
- return null;
- }
- switch (info.container) {
- case LauncherSettings.Favorites.CONTAINER_DESKTOP:
- case LauncherSettings.Favorites.CONTAINER_HOTSEAT:
- // Fall through and continue it's on the workspace (we don't support swiping back
- // to other containers like all apps or the hotseat predictions (which can change)
- break;
- default:
- if (info.container >= 0) {
- // Also allow swiping to folders
- break;
- }
- // Reset any existing launch cookies associated with the cookie
- return ObjectWrapper.wrap(NO_MATCHING_ID);
- }
- switch (info.itemType) {
- case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
- case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
- case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
- case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
- // Fall through and continue if it's an app, shortcut, or widget
- break;
- default:
- // Reset any existing launch cookies associated with the cookie
- return ObjectWrapper.wrap(NO_MATCHING_ID);
- }
- return ObjectWrapper.wrap(new Integer(info.id));
- }
-
- public void setHintUserWillBeActive() {
- addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
- }
-
- @Override
- public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
- super.onDisplayInfoChanged(context, info, flags);
- // When changing screens, force moving to rest state similar to StatefulActivity.onStop, as
- // StatefulActivity isn't called consistently.
- if ((flags & CHANGE_ACTIVE_SCREEN) != 0) {
- getStateManager().moveToRestState();
- }
-
- if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
- getDragLayer().recreateControllers();
- if (mActionsView != null) {
- mActionsView.updateVerticalMargin(info.navigationMode);
- }
- }
- }
-
- @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);
- }
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
-
- // If Launcher shuts downs during split select, we save some extra data in the recovery
- // bundle to allow graceful recovery. The normal LauncherState restore mechanism doesn't
- // work in this case because restoring straight to OverviewSplitSelect without staging data,
- // or before the tasks themselves have loaded into Overview, causes a crash. So we tell
- // Launcher to first restore into Overview state, wait for the relevant tasks and icons to
- // load in, and then proceed to OverviewSplitSelect.
- if (isInState(OVERVIEW_SPLIT_SELECT)) {
- SplitSelectStateController splitSelectStateController =
- ((RecentsView) getOverviewPanel()).getSplitPlaceholder();
- // Launcher will restart in Overview and then transition to OverviewSplitSelect.
- outState.putIBinder(PENDING_SPLIT_SELECT_INFO, ObjectWrapper.wrap(
- new PendingSplitSelectInfo(
- splitSelectStateController.getInitialTaskId(),
- splitSelectStateController.getActiveSplitStagePosition()
- )
- ));
- outState.putInt(RUNTIME_STATE, OVERVIEW.ordinal);
- }
- }
-
- /**
- * When Launcher restarts, it sometimes needs to recover to a split selection state.
- * This function checks if such a recovery is needed.
- * @return a boolean representing whether the launcher is waiting to recover to
- * OverviewSplitSelect state.
- */
- public boolean hasPendingSplitSelectInfo() {
- return mPendingSplitSelectInfo != null;
- }
-
- /**
- * See {@link #hasPendingSplitSelectInfo()}
- */
- public @Nullable PendingSplitSelectInfo getPendingSplitSelectInfo() {
- return mPendingSplitSelectInfo;
- }
-
- /**
- * When the launcher has successfully recovered to OverviewSplitSelect state, this function
- * deletes the recovery data, returning it to a null state.
- */
- public void finishSplitSelectRecovery() {
- mPendingSplitSelectInfo = null;
- }
-}
diff --git a/quickstep/src/com/android/launcher3/LauncherInitListener.java b/quickstep/src/com/android/launcher3/LauncherInitListener.java
index 35151f1..c4e85f6 100644
--- a/quickstep/src/com/android/launcher3/LauncherInitListener.java
+++ b/quickstep/src/com/android/launcher3/LauncherInitListener.java
@@ -20,6 +20,7 @@
import android.os.Build;
import android.os.CancellationSignal;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -44,7 +45,7 @@
public boolean handleInit(Launcher launcher, boolean alreadyOnHome) {
if (mRemoteAnimationProvider != null) {
QuickstepTransitionManager appTransitionManager =
- ((BaseQuickstepLauncher) launcher).getAppTransitionManager();
+ ((QuickstepLauncher) launcher).getAppTransitionManager();
// Set a one-time animation provider. After the first call, this will get cleared.
// TODO: Probably also check the intended target id.
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index bb79c1b..9a1ed4d 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -42,8 +42,7 @@
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
-import static com.android.launcher3.statehandlers.DepthController.DEPTH;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.statehandlers.DepthController.STATE_DEPTH;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
@@ -58,6 +57,8 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
+import android.app.ActivityOptions;
+import android.app.WindowConfiguration;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -77,13 +78,14 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
-import android.util.Log;
import android.util.Pair;
import android.util.Size;
+import android.view.CrossWindowBlurListeners;
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
+import android.view.WindowManager;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
@@ -95,12 +97,15 @@
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
import com.android.launcher3.anim.AnimationSuccessListener;
+import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.DynamicResource;
import com.android.launcher3.util.ObjectWrapper;
@@ -121,8 +126,6 @@
import com.android.quickstep.util.WorkspaceRevealAnim;
import com.android.quickstep.views.FloatingWidgetView;
import com.android.quickstep.views.RecentsView;
-import com.android.systemui.shared.system.ActivityCompat;
-import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.BlurUtils;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.QuickStepContract;
@@ -132,11 +135,9 @@
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.RemoteTransitionCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;
-import com.android.systemui.shared.system.WindowManagerWrapper;
import com.android.wm.shell.startingsurface.IStartingWindowListener;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
@@ -145,8 +146,6 @@
*/
public class QuickstepTransitionManager implements OnDeviceProfileChangeListener {
- private static final String TAG = "QuickstepTransition";
-
private static final boolean ENABLE_SHELL_STARTING_SURFACE =
SystemProperties.getBoolean("persist.debug.shell_starting_surface", true);
@@ -195,7 +194,7 @@
// Cross-fade duration between App Widget and App
private static final int WIDGET_CROSSFADE_DURATION_MILLIS = 125;
- protected final BaseQuickstepLauncher mLauncher;
+ protected final QuickstepLauncher mLauncher;
private final DragLayer mDragLayer;
final Handler mHandler;
@@ -294,8 +293,10 @@
RemoteAnimationAdapterCompat adapterCompat =
new RemoteAnimationAdapterCompat(runner, duration, statusBarTransitionDelay,
mLauncher.getIApplicationThread());
- return new ActivityOptionsWrapper(
- ActivityOptionsCompat.makeRemoteAnimation(adapterCompat), onEndCallback);
+ ActivityOptions options = ActivityOptions.makeRemoteAnimation(
+ adapterCompat.getWrapped(),
+ adapterCompat.getRemoteTransition().getTransition());
+ return new ActivityOptionsWrapper(options, onEndCallback);
}
/**
@@ -385,7 +386,7 @@
@Override
public void onAnimationStart(Animator animation) {
mLauncher.addOnResumeCallback(() ->
- ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
+ ObjectAnimator.ofFloat(mLauncher.getDepthController(), STATE_DEPTH,
mLauncher.getStateManager().getState().getDepth(
mLauncher)).start());
}
@@ -409,7 +410,7 @@
@Override
public void onAnimationStart(Animator animation) {
mLauncher.addOnResumeCallback(() ->
- ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
+ ObjectAnimator.ofFloat(mLauncher.getDepthController(), STATE_DEPTH,
mLauncher.getStateManager().getState().getDepth(
mLauncher)).start());
}
@@ -446,7 +447,7 @@
4 - rotationChange);
}
}
- if (mDeviceProfile.isTaskbarPresentInApps) {
+ if (mDeviceProfile.isTaskbarPresentInApps && !target.willShowImeOnTarget) {
// Animate to above the taskbar.
bounds.bottom -= target.contentInsets.bottom;
}
@@ -519,6 +520,7 @@
appsView.setAlpha(startAlpha);
SCALE_PROPERTY.set(appsView, startScale);
appsView.setLayerType(View.LAYER_TYPE_NONE, null);
+ mLauncher.resumeExpensiveViewUpdates();
};
} else if (mLauncher.isInState(OVERVIEW)) {
endListener = composeViewContentAnimator(launcherAnimator, alphas, scales);
@@ -622,28 +624,9 @@
RecentsView overview = mLauncher.getOverviewPanel();
ObjectAnimator alpha = ObjectAnimator.ofFloat(overview,
RecentsView.CONTENT_ALPHA, alphas);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator alphas=" + Arrays.toString(alphas));
- alpha.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = overview == null ? -1 : RecentsView.CONTENT_ALPHA.get(overview);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onCancel, alpha=" + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onEnd");
- }
- });
alpha.setDuration(CONTENT_ALPHA_DURATION);
alpha.setInterpolator(LINEAR);
anim.play(alpha);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator setFreezeVisibility=true");
overview.setFreezeViewVisibility(true);
ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(overview, SCALE_PROPERTY, scales);
@@ -652,10 +635,10 @@
anim.play(scaleAnim);
return () -> {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onEnd setFreezeVisibility=false");
overview.setFreezeViewVisibility(false);
SCALE_PROPERTY.set(overview, 1f);
mLauncher.getStateManager().reapplyState();
+ mLauncher.resumeExpensiveViewUpdates();
};
}
@@ -1066,54 +1049,37 @@
private ObjectAnimator getBackgroundAnimator() {
// When launching an app from overview that doesn't map to a task, we still want to just
// blur the wallpaper instead of the launcher surface as well
- boolean allowBlurringLauncher = mLauncher.getStateManager().getState() != OVERVIEW;
- DepthController depthController = mLauncher.getDepthController();
- ObjectAnimator backgroundRadiusAnim = ObjectAnimator.ofFloat(depthController, DEPTH,
- BACKGROUND_APP.getDepth(mLauncher))
+ boolean allowBlurringLauncher = mLauncher.getStateManager().getState() != OVERVIEW
+ && BlurUtils.supportsBlursOnWindows();
+
+ MyDepthController depthController = new MyDepthController(mLauncher);
+ ObjectAnimator backgroundRadiusAnim = ObjectAnimator.ofFloat(depthController, STATE_DEPTH,
+ BACKGROUND_APP.getDepth(mLauncher))
.setDuration(APP_LAUNCH_DURATION);
+
if (allowBlurringLauncher) {
- final SurfaceControl dimLayer;
- if (BlurUtils.supportsBlursOnWindows()) {
- // Create a temporary effect layer, that lives on top of launcher, so we can apply
- // the blur to it. The EffectLayer will be fullscreen, which will help with caching
- // optimizations on the SurfaceFlinger side:
- // - Results would be able to be cached as a texture
- // - There won't be texture allocation overhead, because EffectLayers don't have
- // buffers
- ViewRootImpl viewRootImpl = mLauncher.getDragLayer().getViewRootImpl();
- SurfaceControl parent = viewRootImpl != null
- ? viewRootImpl.getSurfaceControl()
- : null;
- dimLayer = new SurfaceControl.Builder()
- .setName("Blur layer")
- .setParent(parent)
- .setOpaque(false)
- .setHidden(false)
- .setEffectLayer()
- .build();
- } else {
- dimLayer = null;
- }
+ // Create a temporary effect layer, that lives on top of launcher, so we can apply
+ // the blur to it. The EffectLayer will be fullscreen, which will help with caching
+ // optimizations on the SurfaceFlinger side:
+ // - Results would be able to be cached as a texture
+ // - There won't be texture allocation overhead, because EffectLayers don't have
+ // buffers
+ ViewRootImpl viewRootImpl = mLauncher.getDragLayer().getViewRootImpl();
+ SurfaceControl parent = viewRootImpl != null
+ ? viewRootImpl.getSurfaceControl()
+ : null;
+ SurfaceControl dimLayer = new SurfaceControl.Builder()
+ .setName("Blur layer")
+ .setParent(parent)
+ .setOpaque(false)
+ .setHidden(false)
+ .setEffectLayer()
+ .build();
- depthController.setSurface(dimLayer);
- backgroundRadiusAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- depthController.setIsInLaunchTransition(true);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- depthController.setIsInLaunchTransition(false);
- depthController.setSurface(null);
- if (dimLayer != null) {
- new SurfaceControl.Transaction()
- .remove(dimLayer)
- .apply();
- }
- }
- });
+ backgroundRadiusAnim.addListener(AnimatorListeners.forEndCallback(() ->
+ new SurfaceControl.Transaction().remove(dimLayer).apply()));
}
+
return backgroundRadiusAnim;
}
@@ -1128,8 +1094,8 @@
mWallpaperOpenRunner = createWallpaperOpenRunner(false /* fromUnlock */);
RemoteAnimationDefinitionCompat definition = new RemoteAnimationDefinitionCompat();
- definition.addRemoteAnimation(WindowManagerWrapper.TRANSIT_WALLPAPER_OPEN,
- WindowManagerWrapper.ACTIVITY_TYPE_STANDARD,
+ definition.addRemoteAnimation(WindowManager.TRANSIT_OLD_WALLPAPER_OPEN,
+ WindowConfiguration.ACTIVITY_TYPE_STANDARD,
new RemoteAnimationAdapterCompat(
new LauncherAnimationRunner(mHandler, mWallpaperOpenRunner,
false /* startAtFrontOfQueue */),
@@ -1139,7 +1105,7 @@
if (KEYGUARD_ANIMATION.get()) {
mKeyguardGoingAwayRunner = createWallpaperOpenRunner(true /* fromUnlock */);
definition.addRemoteAnimation(
- WindowManagerWrapper.TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER,
+ WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER,
new RemoteAnimationAdapterCompat(
new LauncherAnimationRunner(
mHandler, mKeyguardGoingAwayRunner,
@@ -1148,7 +1114,7 @@
mLauncher.getIApplicationThread()));
}
- new ActivityCompat(mLauncher).registerRemoteAnimations(definition);
+ mLauncher.registerRemoteAnimations(definition.getWrapped());
}
}
@@ -1184,7 +1150,7 @@
return;
}
if (hasControlRemoteAppTransitionPermission()) {
- new ActivityCompat(mLauncher).unregisterRemoteAnimations();
+ mLauncher.unregisterRemoteAnimations();
// Also clear strong references to the runners registered with the remote animation
// definition so we don't have to wait for the system gc
@@ -1455,7 +1421,7 @@
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- anim.start(mLauncher, velocityPxPerS);
+ anim.start(mLauncher, mDeviceProfile, velocityPxPerS);
}
});
return anim;
@@ -1630,7 +1596,8 @@
true /* animateOverviewScrim */, launcherView).getAnimators());
if (!areAllTargetsTranslucent(appTargets)) {
- anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
+ anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController(),
+ STATE_DEPTH,
BACKGROUND_APP.getDepth(mLauncher), NORMAL.getDepth(mLauncher)));
}
@@ -1958,4 +1925,17 @@
return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5);
}
}
+
+ private static class MyDepthController extends DepthController {
+ MyDepthController(Launcher l) {
+ super(l);
+ setCrossWindowBlursEnabled(
+ CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled());
+ }
+
+ @Override
+ public void setSurface(SurfaceControl surface) {
+ super.setSurface(surface);
+ }
+ }
}
diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
index f42b39f..e8374b8 100644
--- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
@@ -35,6 +35,7 @@
import com.android.launcher3.R;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderView;
+import com.android.launcher3.util.OnboardingPrefs;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
@@ -92,8 +93,10 @@
? R.color.all_apps_label_text_dark
: R.color.all_apps_label_text);
- mShowAllAppsLabel = !ActivityContext.lookupContext(
- getContext()).getOnboardingPrefs().hasReachedMaxCount(ALL_APPS_VISITED_COUNT);
+ OnboardingPrefs<?> onboardingPrefs = ActivityContext.lookupContext(
+ getContext()).getOnboardingPrefs();
+ mShowAllAppsLabel = onboardingPrefs == null || !onboardingPrefs.hasReachedMaxCount(
+ ALL_APPS_VISITED_COUNT);
}
public void setup(FloatingHeaderView parent, FloatingHeaderRow[] rows, boolean tabsHidden) {
@@ -216,8 +219,8 @@
CharSequence allAppsLabelText = getResources().getText(R.string.all_apps_label);
mAllAppsLabelLayout = StaticLayout.Builder.obtain(
- allAppsLabelText, 0, allAppsLabelText.length(), mPaint,
- Math.round(mPaint.measureText(allAppsLabelText.toString())))
+ allAppsLabelText, 0, allAppsLabelText.length(), mPaint,
+ Math.round(mPaint.measureText(allAppsLabelText.toString())))
.setAlignment(Layout.Alignment.ALIGN_CENTER)
.setMaxLines(1)
.setIncludePad(true)
diff --git a/quickstep/src/com/android/launcher3/appprediction/InstantAppItemInfo.java b/quickstep/src/com/android/launcher3/appprediction/InstantAppItemInfo.java
index 9c3b881..8baee00 100644
--- a/quickstep/src/com/android/launcher3/appprediction/InstantAppItemInfo.java
+++ b/quickstep/src/com/android/launcher3/appprediction/InstantAppItemInfo.java
@@ -22,6 +22,8 @@
import android.content.Context;
import android.content.Intent;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -33,11 +35,13 @@
this.componentName = new ComponentName(packageName, COMPONENT_CLASS_MARKER);
}
+ @NonNull
@Override
public ComponentName getTargetComponent() {
return componentName;
}
+ @NonNull
@Override
public WorkspaceItemInfo makeWorkspaceItem(Context context) {
WorkspaceItemInfo workspaceItemInfo = super.makeWorkspaceItem(context);
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
index d63bc18..048243e 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
@@ -26,22 +26,17 @@
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.Hotseat;
-import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.views.ArrowTipView;
import com.android.launcher3.views.Snackbar;
-import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;
@@ -74,102 +69,13 @@
*/
void migrate() {
HotseatRestoreHelper.createBackup(mLauncher);
- if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
- migrateToFolder();
- } else {
- migrateHotseatWhole();
- }
+ migrateHotseatWhole();
Snackbar.show(mLauncher, R.string.hotsaet_tip_prediction_enabled,
R.string.hotseat_prediction_settings, null,
() -> mLauncher.startActivity(getSettingsIntent()));
}
/**
- * This migration places all non folder items in the hotseat into a folder and then moves
- * all folders in the hotseat to a workspace page that has enough empty spots.
- *
- * @return pageId that has accepted the items.
- */
- private int migrateToFolder() {
- ArrayDeque<FolderInfo> folders = new ArrayDeque<>();
- ArrayList<WorkspaceItemInfo> putIntoFolder = new ArrayList<>();
-
- //separate folders and items that can get in folders
- for (int i = 0; i < mLauncher.getDeviceProfile().numShownHotseatIcons; i++) {
- View view = mHotseat.getChildAt(i, 0);
- if (view == null) continue;
- ItemInfo info = (ItemInfo) view.getTag();
- if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
- folders.add((FolderInfo) info);
- } else if (info instanceof WorkspaceItemInfo && info.container == LauncherSettings
- .Favorites.CONTAINER_HOTSEAT) {
- putIntoFolder.add((WorkspaceItemInfo) info);
- }
- }
-
- // create a temp folder and add non folder items to it
- if (!putIntoFolder.isEmpty()) {
- ItemInfo firstItem = putIntoFolder.get(0);
- FolderInfo folderInfo = new FolderInfo();
- mLauncher.getModelWriter().addItemToDatabase(folderInfo, firstItem.container,
- firstItem.screenId, firstItem.cellX, firstItem.cellY);
- folderInfo.setTitle("", mLauncher.getModelWriter());
- folderInfo.contents.addAll(putIntoFolder);
- for (int i = 0; i < folderInfo.contents.size(); i++) {
- ItemInfo item = folderInfo.contents.get(i);
- item.rank = i;
- mLauncher.getModelWriter().moveItemInDatabase(item, folderInfo.id, 0,
- item.cellX, item.cellY);
- }
- folders.add(folderInfo);
- }
- mNewItems.addAll(folders);
-
- return placeFoldersInWorkspace(folders);
- }
-
- private int placeFoldersInWorkspace(ArrayDeque<FolderInfo> folders) {
- if (folders.isEmpty()) return 0;
-
- Workspace<?> workspace = mLauncher.getWorkspace();
- InvariantDeviceProfile idp = mLauncher.getDeviceProfile().inv;
-
- GridOccupancy[] occupancyList = new GridOccupancy[workspace.getChildCount()];
- for (int i = 0; i < occupancyList.length; i++) {
- occupancyList[i] = ((CellLayout) workspace.getChildAt(i)).cloneGridOccupancy();
- }
- //scan every screen to find available spots to place folders
- int occupancyIndex = 0;
- int[] itemXY = new int[2];
- while (occupancyIndex < occupancyList.length && !folders.isEmpty()) {
- GridOccupancy occupancy = occupancyList[occupancyIndex];
- if (occupancy.findVacantCell(itemXY, 1, 1)) {
- FolderInfo info = folders.poll();
- mLauncher.getModelWriter().moveItemInDatabase(info,
- LauncherSettings.Favorites.CONTAINER_DESKTOP,
- workspace.getScreenIdForPageIndex(occupancyIndex), itemXY[0], itemXY[1]);
- occupancy.markCells(info, true);
- } else {
- occupancyIndex++;
- }
- }
- if (folders.isEmpty()) return workspace.getScreenIdForPageIndex(occupancyIndex);
- int screenId = LauncherSettings.Settings.call(mLauncher.getContentResolver(),
- LauncherSettings.Settings.METHOD_NEW_SCREEN_ID)
- .getInt(LauncherSettings.Settings.EXTRA_VALUE);
- // if all screens are full and we still have folders left, put those on a new page
- FolderInfo folderInfo;
- int col = 0;
- while ((folderInfo = folders.poll()) != null) {
- mLauncher.getModelWriter().moveItemInDatabase(folderInfo,
- LauncherSettings.Favorites.CONTAINER_DESKTOP, screenId, col++,
- idp.numRows - 1);
- }
- mNewScreens = IntArray.wrap(screenId);
- return workspace.getPageCount();
- }
-
- /**
* This migration option attempts to move the entire hotseat up to the first workspace that
* has space to host items. If no such page is found, it moves items to a new page.
*
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
index 7b48332..2100834 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
@@ -15,8 +15,7 @@
*/
package com.android.launcher3.hybridhotseat;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent
- .LAUNCHER_HOTSEAT_EDU_ACCEPT;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_ACCEPT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_DENY;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_SEEN;
@@ -39,7 +38,6 @@
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.uioverrides.PredictedAppIcon;
import com.android.launcher3.views.AbstractSlideInView;
@@ -112,12 +110,6 @@
((LinearLayout.LayoutParams) buttonContainer.getLayoutParams()).setMarginEnd(
adjustedMarginEnd);
}
-
- // update ui to reflect which migration method is going to be used
- if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
- ((TextView) findViewById(R.id.hotseat_edu_content)).setText(
- R.string.hotseat_edu_message_migrate_alt);
- }
}
private void onAccept(View v) {
diff --git a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
index 7e3ee7d..bc3253f 100644
--- a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
+++ b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
@@ -27,6 +27,8 @@
import android.content.pm.ShortcutInfo;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
@@ -52,7 +54,8 @@
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
Context context = app.getContext();
// TODO: remove this
diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
index 770dfb2..de0b14d 100644
--- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
+++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
@@ -117,14 +117,15 @@
// TODO: Implement caching and preloading
super.loadItems(ums, pinnedShortcuts);
- WorkspaceItemFactory allAppsFactory = new WorkspaceItemFactory(
- mApp, ums, pinnedShortcuts, mIDP.numDatabaseAllAppsColumns);
- FixedContainerItems allAppsItems = new FixedContainerItems(mAllAppsState.containerId,
- mAllAppsState.storage.read(mApp.getContext(), allAppsFactory, ums.allUsers::get));
- mDataModel.extraItems.put(mAllAppsState.containerId, allAppsItems);
+ WorkspaceItemFactory allAppsFactory = new WorkspaceItemFactory(mApp, ums, pinnedShortcuts,
+ mIDP.numDatabaseAllAppsColumns, mAllAppsState.containerId);
+ FixedContainerItems allAppsPredictionItems = new FixedContainerItems(
+ mAllAppsState.containerId, mAllAppsState.storage.read(mApp.getContext(),
+ allAppsFactory, ums.allUsers::get));
+ mDataModel.extraItems.put(mAllAppsState.containerId, allAppsPredictionItems);
- WorkspaceItemFactory hotseatFactory =
- new WorkspaceItemFactory(mApp, ums, pinnedShortcuts, mIDP.numDatabaseHotseatIcons);
+ WorkspaceItemFactory hotseatFactory = new WorkspaceItemFactory(mApp, ums, pinnedShortcuts,
+ mIDP.numDatabaseHotseatIcons, mHotseatState.containerId);
FixedContainerItems hotseatItems = new FixedContainerItems(mHotseatState.containerId,
mHotseatState.storage.read(mApp.getContext(), hotseatFactory, ums.allUsers::get));
mDataModel.extraItems.put(mHotseatState.containerId, hotseatItems);
@@ -432,15 +433,17 @@
private final UserManagerState mUMS;
private final Map<ShortcutKey, ShortcutInfo> mPinnedShortcuts;
private final int mMaxCount;
+ private final int mContainer;
private int mReadCount = 0;
protected WorkspaceItemFactory(LauncherAppState appState, UserManagerState ums,
- Map<ShortcutKey, ShortcutInfo> pinnedShortcuts, int maxCount) {
+ Map<ShortcutKey, ShortcutInfo> pinnedShortcuts, int maxCount, int container) {
mAppState = appState;
mUMS = ums;
mPinnedShortcuts = pinnedShortcuts;
mMaxCount = maxCount;
+ mContainer = container;
}
@Nullable
@@ -458,6 +461,7 @@
return null;
}
AppInfo info = new AppInfo(lai, user, mUMS.isUserQuiet(user));
+ info.container = mContainer;
mAppState.getIconCache().getTitleAndIcon(info, lai, false);
mReadCount++;
return info.makeWorkspaceItem(mAppState.getContext());
@@ -472,6 +476,7 @@
return null;
}
WorkspaceItemInfo wii = new WorkspaceItemInfo(si, mAppState.getContext());
+ wii.container = mContainer;
mAppState.getIconCache().getShortcutIcon(wii, si);
mReadCount++;
return wii;
diff --git a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
index 9cd9d85..7a483a8 100644
--- a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
+++ b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
@@ -21,6 +21,8 @@
import android.content.ComponentName;
import android.text.TextUtils;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
@@ -52,7 +54,8 @@
* workspace.
*/
@Override
- public void execute(LauncherAppState appState, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState appState,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
Set<ComponentKey> widgetsInWorkspace = dataModel.appWidgets.stream().map(
widget -> new ComponentKey(widget.providerName, widget.user)).collect(
Collectors.toSet());
diff --git a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
index 4e59790..9a682c6 100644
--- a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
+++ b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.popup;
+import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
+
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
@@ -22,9 +24,10 @@
import android.util.Log;
import android.view.View;
-import com.android.launcher3.BaseQuickstepLauncher;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.quickstep.views.RecentsView;
@@ -32,18 +35,18 @@
String TAG = QuickstepSystemShortcut.class.getSimpleName();
- static SystemShortcut.Factory<BaseQuickstepLauncher> getSplitSelectShortcutByPosition(
+ static SystemShortcut.Factory<QuickstepLauncher> getSplitSelectShortcutByPosition(
SplitPositionOption position) {
return (activity, itemInfo, originalView) ->
new QuickstepSystemShortcut.SplitSelectSystemShortcut(activity, itemInfo,
originalView, position);
}
- class SplitSelectSystemShortcut extends SystemShortcut<BaseQuickstepLauncher> {
+ class SplitSelectSystemShortcut extends SystemShortcut<QuickstepLauncher> {
private final SplitPositionOption mPosition;
- public SplitSelectSystemShortcut(BaseQuickstepLauncher launcher, ItemInfo itemInfo,
+ public SplitSelectSystemShortcut(QuickstepLauncher launcher, ItemInfo itemInfo,
View originalView, SplitPositionOption position) {
super(position.iconResId, position.textResId, launcher, itemInfo, originalView);
@@ -69,9 +72,10 @@
}
RecentsView recentsView = mTarget.getOverviewPanel();
+ StatsLogManager.EventEnum splitEvent = getLogEventForPosition(mPosition.stagePosition);
recentsView.initiateSplitSelect(
new SplitSelectSource(mOriginalView, new BitmapDrawable(bitmap), intent,
- mPosition));
+ mPosition, mItemInfo, splitEvent));
}
}
@@ -81,13 +85,18 @@
public final Drawable drawable;
public final Intent intent;
public final SplitPositionOption position;
+ public final ItemInfo mItemInfo;
+ public final StatsLogManager.EventEnum splitEvent;
public SplitSelectSource(View view, Drawable drawable, Intent intent,
- SplitPositionOption position) {
+ SplitPositionOption position, ItemInfo itemInfo,
+ StatsLogManager.EventEnum splitEvent) {
this.view = view;
this.drawable = drawable;
this.intent = intent;
this.position = position;
+ this.mItemInfo = itemInfo;
+ this.splitEvent = splitEvent;
}
}
}
diff --git a/quickstep/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictionsImpl.java b/quickstep/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictionsImpl.java
new file mode 100644
index 0000000..5bf727a
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictionsImpl.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.secondarydisplay;
+
+import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT;
+
+import android.content.Context;
+
+import com.android.launcher3.appprediction.AppsDividerView;
+import com.android.launcher3.appprediction.PredictionRowView;
+import com.android.launcher3.model.BgDataModel;
+import com.android.launcher3.util.OnboardingPrefs;
+import com.android.launcher3.views.ActivityContext;
+
+/**
+ * Implementation of SecondaryDisplayPredictions.
+ */
+@SuppressWarnings("unused")
+public final class SecondaryDisplayPredictionsImpl extends SecondaryDisplayPredictions {
+ private final ActivityContext mActivityContext;
+
+ public SecondaryDisplayPredictionsImpl(Context context) {
+ mActivityContext = ActivityContext.lookupContext(context);
+ }
+
+ @Override
+ void updateAppDivider() {
+ OnboardingPrefs<?> onboardingPrefs = mActivityContext.getOnboardingPrefs();
+ mActivityContext.getAppsView().getFloatingHeaderView()
+ .findFixedRowByType(AppsDividerView.class)
+ .setShowAllAppsLabel(!onboardingPrefs.hasReachedMaxCount(ALL_APPS_VISITED_COUNT));
+ onboardingPrefs.incrementEventCount(ALL_APPS_VISITED_COUNT);
+ }
+
+ @Override
+ public void setPredictedApps(BgDataModel.FixedContainerItems item) {
+ mActivityContext.getAppsView().getFloatingHeaderView()
+ .findFixedRowByType(PredictionRowView.class)
+ .setPredictedApps(item.items);
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java b/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java
deleted file mode 100644
index 07d3a51..0000000
--- a/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java
+++ /dev/null
@@ -1,64 +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.statehandlers;
-
-import static com.android.launcher3.anim.Interpolators.LINEAR;
-import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS;
-import static com.android.quickstep.AnimatedFloat.VALUE;
-
-import com.android.launcher3.BaseQuickstepLauncher;
-import com.android.launcher3.LauncherState;
-import com.android.launcher3.anim.PendingAnimation;
-import com.android.launcher3.statemanager.StateManager.StateHandler;
-import com.android.launcher3.states.StateAnimationConfig;
-import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.UiThreadHelper;
-import com.android.quickstep.AnimatedFloat;
-import com.android.quickstep.SystemUiProxy;
-
-/**
- * State handler for animating back button alpha in two-button nav mode.
- */
-public class BackButtonAlphaHandler implements StateHandler<LauncherState> {
-
- private final BaseQuickstepLauncher mLauncher;
- private final AnimatedFloat mBackAlpha = new AnimatedFloat(this::updateBackAlpha);
-
- public BackButtonAlphaHandler(BaseQuickstepLauncher launcher) {
- mLauncher = launcher;
- }
-
- @Override
- public void setState(LauncherState state) { }
-
- @Override
- public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
- PendingAnimation animation) {
- if (DisplayController.getNavigationMode(mLauncher) != TWO_BUTTONS) {
- return;
- }
-
- mBackAlpha.value = SystemUiProxy.INSTANCE.get(mLauncher).getLastNavButtonAlpha();
- animation.setFloat(mBackAlpha, VALUE,
- mLauncher.shouldBackButtonBeHidden(toState) ? 0 : 1, LINEAR);
- }
-
- private void updateBackAlpha() {
- UiThreadHelper.setBackButtonAlphaAsync(mLauncher,
- BaseQuickstepLauncher.SET_BACK_BUTTON_ALPHA, mBackAlpha.value, false /* animate */);
- }
-}
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
index eda0823..e3fd3f9 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -23,13 +23,8 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
-import android.app.WallpaperManager;
-import android.os.IBinder;
-import android.os.SystemProperties;
import android.util.FloatProperty;
-import android.view.AttachedSurfaceControl;
import android.view.CrossWindowBlurListeners;
-import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
@@ -37,12 +32,11 @@
import com.android.launcher3.BaseActivity;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
-import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
-import com.android.systemui.shared.system.BlurUtils;
+import com.android.quickstep.util.BaseDepthController;
import java.io.PrintWriter;
import java.util.function.Consumer;
@@ -50,23 +44,9 @@
/**
* Controls blur and wallpaper zoom, for the Launcher surface only.
*/
-public class DepthController implements StateHandler<LauncherState>,
+public class DepthController extends BaseDepthController implements StateHandler<LauncherState>,
BaseActivity.MultiWindowModeChangedListener {
- private static final boolean OVERLAY_SCROLL_ENABLED = false;
- public static final FloatProperty<DepthController> DEPTH =
- new FloatProperty<DepthController>("depth") {
- @Override
- public void setValue(DepthController depthController, float depth) {
- depthController.setDepth(depth);
- }
-
- @Override
- public Float get(DepthController depthController) {
- return depthController.mDepth;
- }
- };
-
/**
* A property that updates the background blur within a given range of values (ie. even if the
* animator goes beyond 0..1, the interpolated value will still be bounded).
@@ -92,96 +72,46 @@
}
}
- private final ViewTreeObserver.OnDrawListener mOnDrawListener =
- new ViewTreeObserver.OnDrawListener() {
- @Override
- public void onDraw() {
- View view = mLauncher.getDragLayer();
- ViewRootImpl viewRootImpl = view.getViewRootImpl();
- boolean applied = setSurface(
- viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null);
- if (!applied) {
- dispatchTransactionSurface(mDepth);
- }
- view.post(() -> view.getViewTreeObserver().removeOnDrawListener(this));
- }
- };
+ private final ViewTreeObserver.OnDrawListener mOnDrawListener = this::onLauncherDraw;
- private final Consumer<Boolean> mCrossWindowBlurListener = new Consumer<Boolean>() {
- @Override
- public void accept(Boolean enabled) {
- mCrossWindowBlursEnabled = enabled;
- dispatchTransactionSurface(mDepth);
- }
- };
+ private final Consumer<Boolean> mCrossWindowBlurListener = this::setCrossWindowBlursEnabled;
- private final Runnable mOpaquenessListener = new Runnable() {
- @Override
- public void run() {
- dispatchTransactionSurface(mDepth);
- }
- };
+ private final Runnable mOpaquenessListener = this::applyDepthAndBlur;
- private final Launcher mLauncher;
- /**
- * Blur radius when completely zoomed out, in pixels.
- */
- private int mMaxBlurRadius;
- private boolean mCrossWindowBlursEnabled;
- private WallpaperManager mWallpaperManager;
- private SurfaceControl mSurface;
- /**
- * How visible the -1 overlay is, from 0 to 1.
- */
- private float mOverlayScrollProgress;
- /**
- * Ratio from 0 to 1, where 0 is fully zoomed out, and 1 is zoomed in.
- * @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float)
- */
- 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;
- /**
- * If we requested early wake-up offsets to SurfaceFlinger.
- */
- private boolean mInEarlyWakeUp;
+
// Workaround for animating the depth when multiwindow mode changes.
private boolean mIgnoreStateChangesDuringMultiWindowAnimation = false;
- // Hints that there is potentially content behind Launcher and that we shouldn't optimize by
- // marking the launcher surface as opaque. Only used in certain Launcher states.
- private boolean mHasContentBehindLauncher;
-
private View.OnAttachStateChangeListener mOnAttachListener;
public DepthController(Launcher l) {
- mLauncher = l;
+ super(l);
+ }
+
+ private void onLauncherDraw() {
+ View view = mLauncher.getDragLayer();
+ ViewRootImpl viewRootImpl = view.getViewRootImpl();
+ setSurface(viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null);
+ view.post(() -> view.getViewTreeObserver().removeOnDrawListener(mOnDrawListener));
}
private void ensureDependencies() {
- if (mWallpaperManager == null) {
- mMaxBlurRadius = mLauncher.getResources().getInteger(R.integer.max_depth_blur_radius);
- mWallpaperManager = mLauncher.getSystemService(WallpaperManager.class);
- }
-
if (mLauncher.getRootView() != null && mOnAttachListener == null) {
+ View rootView = mLauncher.getRootView();
mOnAttachListener = new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
+ CrossWindowBlurListeners.getInstance().addListener(mLauncher.getMainExecutor(),
+ mCrossWindowBlurListener);
+ mLauncher.getScrimView().addOpaquenessListener(mOpaquenessListener);
+
// To handle the case where window token is invalid during last setDepth call.
- IBinder windowToken = mLauncher.getRootView().getWindowToken();
- if (windowToken != null) {
- mWallpaperManager.setWallpaperZoomOut(windowToken, mDepth);
- }
- onAttached();
+ applyDepthAndBlur();
}
@Override
@@ -190,23 +120,13 @@
mLauncher.getScrimView().removeOpaquenessListener(mOpaquenessListener);
}
};
- mLauncher.getRootView().addOnAttachStateChangeListener(mOnAttachListener);
- if (mLauncher.getRootView().isAttachedToWindow()) {
- onAttached();
+ rootView.addOnAttachStateChangeListener(mOnAttachListener);
+ if (rootView.isAttachedToWindow()) {
+ mOnAttachListener.onViewAttachedToWindow(rootView);
}
}
}
- private void onAttached() {
- CrossWindowBlurListeners.getInstance().addListener(mLauncher.getMainExecutor(),
- mCrossWindowBlurListener);
- mLauncher.getScrimView().addOpaquenessListener(mOpaquenessListener);
- }
-
- public void setHasContentBehindLauncher(boolean hasContentBehindLauncher) {
- mHasContentBehindLauncher = hasContentBehindLauncher;
- }
-
/**
* Sets if the underlying activity is started or not
*/
@@ -219,29 +139,9 @@
}
}
- /**
- * Sets the specified app target surface to apply the blur to.
- * @return true when surface was valid and transaction was dispatched.
- */
- 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
public void setState(LauncherState toState) {
- if (mSurface == null || mIgnoreStateChangesDuringMultiWindowAnimation) {
+ if (mIgnoreStateChangesDuringMultiWindowAnimation) {
return;
}
@@ -249,7 +149,7 @@
if (Float.compare(mDepth, toDepth) != 0) {
setDepth(toDepth);
} else if (toState == LauncherState.OVERVIEW) {
- dispatchTransactionSurface(mDepth);
+ applyDepthAndBlur();
} else if (toState == LauncherState.BACKGROUND_APP) {
mLauncher.getDragLayer().getViewTreeObserver().addOnDrawListener(mOnDrawListener);
}
@@ -265,101 +165,22 @@
float toDepth = toState.getDepth(mLauncher);
if (Float.compare(mDepth, toDepth) != 0) {
- animation.setFloat(this, DEPTH, toDepth, config.getInterpolator(ANIM_DEPTH, LINEAR));
+ animation.setFloat(this, STATE_DEPTH, toDepth,
+ config.getInterpolator(ANIM_DEPTH, LINEAR));
}
}
- /**
- * If we're launching an app from the home screen.
- */
- public void setIsInLaunchTransition(boolean inLaunchTransition) {
- boolean blurEnabled = SystemProperties.getBoolean("ro.launcher.blur.appLaunch", true);
- mBlurDisabledForAppLaunch = inLaunchTransition && !blurEnabled;
- if (!inLaunchTransition) {
- // Reset depth at the end of the launch animation, so the wallpaper won't be
- // zoomed out if an app crashes.
- setDepth(0f);
- }
- }
-
- private void setDepth(float depth) {
- depth = Utilities.boundToRange(depth, 0, 1);
- // Round out the depth to dedupe frequent, non-perceptable updates
- int depthI = (int) (depth * 256);
- float depthF = depthI / 256f;
- if (Float.compare(mDepth, depthF) == 0) {
- return;
- }
- dispatchTransactionSurface(depthF);
- mDepth = depthF;
- }
-
- public void onOverlayScrollChanged(float progress) {
- if (!OVERLAY_SCROLL_ENABLED) {
- return;
- }
- // Add some padding to the progress, such we don't change the depth on the last frames of
- // the animation. It's possible that a user flinging the feed quickly would scroll
- // horizontally by accident, causing the device to enter client composition unnecessarily.
- progress = Math.min(progress * 1.1f, 1f);
-
- // Round out the progress to dedupe frequent, non-perceptable updates
- int progressI = (int) (progress * 256);
- float progressF = Utilities.boundToRange(progressI / 256f, 0f, 1f);
- if (Float.compare(mOverlayScrollProgress, progressF) == 0) {
- return;
- }
- mOverlayScrollProgress = progressF;
- dispatchTransactionSurface(mDepth);
- }
-
- private boolean dispatchTransactionSurface(float depth) {
- boolean supportsBlur = BlurUtils.supportsBlursOnWindows();
- if (supportsBlur && (mSurface == null || !mSurface.isValid())) {
- return false;
- }
+ @Override
+ protected void applyDepthAndBlur() {
ensureDependencies();
- depth = Math.max(depth, mOverlayScrollProgress);
- IBinder windowToken = mLauncher.getRootView().getWindowToken();
- if (windowToken != null) {
- mWallpaperManager.setWallpaperZoomOut(windowToken, depth);
- }
-
- if (supportsBlur) {
- boolean hasOpaqueBg = mLauncher.getScrimView().isFullyOpaque();
- boolean isSurfaceOpaque = !mHasContentBehindLauncher && hasOpaqueBg;
-
- mCurrentBlur = !mCrossWindowBlursEnabled || mBlurDisabledForAppLaunch || hasOpaqueBg
- ? 0 : (int) (depth * mMaxBlurRadius);
- SurfaceControl.Transaction transaction = new SurfaceControl.Transaction()
- .setBackgroundBlurRadius(mSurface, mCurrentBlur)
- .setOpaque(mSurface, isSurfaceOpaque);
-
- // Set early wake-up flags when we know we're executing an expensive operation, this way
- // SurfaceFlinger will adjust its internal offsets to avoid jank.
- boolean wantsEarlyWakeUp = depth > 0 && depth < 1;
- if (wantsEarlyWakeUp && !mInEarlyWakeUp) {
- transaction.setEarlyWakeupStart();
- mInEarlyWakeUp = true;
- } else if (!wantsEarlyWakeUp && mInEarlyWakeUp) {
- transaction.setEarlyWakeupEnd();
- mInEarlyWakeUp = false;
- }
-
- AttachedSurfaceControl rootSurfaceControl =
- mLauncher.getRootView().getRootSurfaceControl();
- if (rootSurfaceControl != null) {
- rootSurfaceControl.applyTransactionOnDraw(transaction);
- }
- }
- return true;
+ super.applyDepthAndBlur();
}
@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
mIgnoreStateChangesDuringMultiWindowAnimation = true;
- ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, DEPTH,
+ ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, STATE_DEPTH,
mLauncher.getStateManager().getState().getDepth(mLauncher, isInMultiWindowMode))
.setDuration(300);
mwAnimation.addListener(new AnimatorListenerAdapter() {
@@ -377,7 +198,6 @@
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);
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java
new file mode 100644
index 0000000..acfbea3
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar;
+
+import android.app.ActivityManager;
+import android.content.ComponentName;
+import android.util.SparseArray;
+
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.quickstep.RecentsModel;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Provides recent apps functionality specifically in a desktop environment.
+ */
+public class DesktopTaskbarRecentAppsController extends TaskbarRecentAppsController {
+
+ private final TaskbarActivityContext mContext;
+ private ArrayList<ItemInfo> mRunningApps = new ArrayList<>();
+ private AppInfo[] mApps;
+
+ public DesktopTaskbarRecentAppsController(TaskbarActivityContext context) {
+ mContext = context;
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ mApps = null;
+ }
+
+ @Override
+ protected void setApps(AppInfo[] apps) {
+ mApps = apps;
+ }
+
+ @Override
+ protected boolean isEnabled() {
+ return true;
+ }
+
+ /**
+ * Set mRunningApps to hold currently running applications using the list of currently running
+ * tasks. Filtering is also done to ignore applications that are already on the taskbar in the
+ * original hotseat.
+ */
+ @Override
+ protected void updateRunningApps(SparseArray<ItemInfo> hotseatItems) {
+ ArrayList<AppInfo> runningApps = getRunningAppsFromTasks();
+ ArrayList<ItemInfo> filteredRunningApps = new ArrayList<>();
+ for (AppInfo runningApp : runningApps) {
+ boolean shouldAddOnTaskbar = true;
+ for (int i = 0; i < hotseatItems.size(); i++) {
+ if (hotseatItems.keyAt(i) >= mControllers.taskbarActivityContext.getDeviceProfile()
+ .numShownHotseatIcons) {
+ break;
+ }
+ if (hotseatItems.valueAt(i).getTargetPackage()
+ .equals(runningApp.getTargetPackage())) {
+ shouldAddOnTaskbar = false;
+ break;
+ }
+ }
+ if (shouldAddOnTaskbar) {
+ filteredRunningApps.add(new WorkspaceItemInfo(runningApp));
+ }
+ }
+ mRunningApps = filteredRunningApps;
+ mControllers.taskbarViewController.commitRunningAppsToUI();
+ }
+
+ /**
+ * Returns a copy of hotseatItems with the addition of currently running applications.
+ */
+ @Override
+ protected ItemInfo[] updateHotseatItemInfos(ItemInfo[] hotseatItemInfos) {
+ // hotseatItemInfos.length would be 0 if deviceProfile.numShownHotseatIcons is 0, so we
+ // don't want to show anything in the hotseat
+ if (hotseatItemInfos.length == 0) return hotseatItemInfos;
+
+ int runningAppsIndex = 0;
+ ItemInfo[] newHotseatItemsInfo = Arrays.copyOf(
+ hotseatItemInfos, hotseatItemInfos.length + mRunningApps.size());
+ for (int i = hotseatItemInfos.length; i < newHotseatItemsInfo.length; i++) {
+ newHotseatItemsInfo[i] = mRunningApps.get(runningAppsIndex);
+ runningAppsIndex++;
+ }
+ return newHotseatItemsInfo;
+ }
+
+
+ /**
+ * Returns a list of running applications from the list of currently running tasks.
+ */
+ private ArrayList<AppInfo> getRunningAppsFromTasks() {
+ ArrayList<ActivityManager.RunningTaskInfo> tasks =
+ RecentsModel.INSTANCE.get(mContext).getRunningTasks();
+ ArrayList<AppInfo> runningApps = new ArrayList<>();
+ // early return if apps is empty, since we would have no AppInfo to compare
+ if (mApps == null) {
+ return runningApps;
+ }
+
+ Set<String> seenPackages = new HashSet<>();
+ for (ActivityManager.RunningTaskInfo taskInfo : tasks) {
+ if (taskInfo.realActivity == null) continue;
+
+ // If a different task for the same package has already been handled, skip this one
+ String taskPackage = taskInfo.realActivity.getPackageName();
+ if (seenPackages.contains(taskPackage)) continue;
+
+ // Otherwise, get the corresponding AppInfo and add it to the list
+ seenPackages.add(taskPackage);
+ AppInfo app = getAppInfo(taskInfo.realActivity);
+ if (app == null) continue;
+ runningApps.add(app);
+ }
+ return runningApps;
+ }
+
+ /**
+ * Retrieves the corresponding AppInfo for the activity.
+ */
+ private AppInfo getAppInfo(ComponentName activity) {
+ String packageName = activity.getPackageName();
+ for (AppInfo app : mApps) {
+ if (!packageName.equals(app.getTargetPackage())) {
+ continue;
+ }
+ return app;
+ }
+ return null;
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
index e2359c0..9393b0f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
@@ -16,7 +16,7 @@
package com.android.launcher3.taskbar;
-import com.android.launcher3.BaseQuickstepLauncher;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
/**
* A data source which integrates with a Launcher instance, used specifically for a
@@ -24,24 +24,27 @@
*/
public class DesktopTaskbarUIController extends TaskbarUIController {
- private final BaseQuickstepLauncher mLauncher;
+ private final QuickstepLauncher mLauncher;
- public DesktopTaskbarUIController(BaseQuickstepLauncher launcher) {
+ public DesktopTaskbarUIController(QuickstepLauncher launcher) {
mLauncher = launcher;
}
@Override
protected void init(TaskbarControllers taskbarControllers) {
+ super.init(taskbarControllers);
mLauncher.getHotseat().setIconsAlpha(0f);
+ mControllers.taskbarViewController.updateRunningApps();
}
@Override
protected void onDestroy() {
+ super.onDestroy();
mLauncher.getHotseat().setIconsAlpha(1f);
}
- @Override
/** Disable taskbar stashing in desktop environment. */
+ @Override
public boolean supportsVisualStashing() {
return false;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 6df31e5..a219ac6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -15,8 +15,10 @@
*/
package com.android.launcher3.taskbar;
+import static android.view.InsetsState.ITYPE_EXTRA_NAVIGATION_BAR;
+
import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_RESUMED;
-import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;
+import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -30,9 +32,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.annotation.VisibleForTesting;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
@@ -42,6 +42,7 @@
import com.android.launcher3.logging.InstanceIdSequence;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.OnboardingPrefs;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.RecentsAnimationCallbacks;
@@ -65,7 +66,7 @@
private final SparseArray<Float> mTaskbarInAppDisplayProgress = new SparseArray<>(4);
- private final BaseQuickstepLauncher mLauncher;
+ private final QuickstepLauncher mLauncher;
private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener =
dp -> {
@@ -81,7 +82,7 @@
private final TaskbarLauncherStateController
mTaskbarLauncherStateController = new TaskbarLauncherStateController();
- public LauncherTaskbarUIController(BaseQuickstepLauncher launcher) {
+ public LauncherTaskbarUIController(QuickstepLauncher launcher) {
mLauncher = launcher;
}
@@ -124,24 +125,6 @@
}
/**
- * Enables manual taskbar stashing. This method should only be used for tests that need to
- * stash/unstash the taskbar.
- */
- @VisibleForTesting
- public void enableManualStashingForTests(boolean enableManualStashing) {
- mControllers.taskbarStashController.enableManualStashingForTests(enableManualStashing);
- }
-
- /**
- * Unstashes the Taskbar if it is stashed. This method should only be used to unstash the
- * taskbar at the end of a test.
- */
- @VisibleForTesting
- public void unstashTaskbarIfStashed() {
- mControllers.taskbarStashController.onLongPressToUnstashTaskbar();
- }
-
- /**
* Adds the Launcher resume animator to the given animator set.
*
* This should be used to run a Launcher resume animation whose progress matches a
@@ -188,6 +171,13 @@
}
}
+ if (ENABLE_SHELL_TRANSITIONS
+ && !mLauncher.getStateManager().getState().isTaskbarAlignedWithHotseat(mLauncher)) {
+ // Launcher is resumed, but in a state where taskbar is still independent, so
+ // ignore the state change.
+ return null;
+ }
+
mTaskbarLauncherStateController.updateStateForFlag(FLAG_RESUMED, isResumed);
return mTaskbarLauncherStateController.applyState(fromInit ? 0 : duration, startAnimation);
}
@@ -354,6 +344,13 @@
}
@Override
+ public void onExpandPip() {
+ super.onExpandPip();
+ mTaskbarLauncherStateController.updateStateForFlag(FLAG_RESUMED, false);
+ mTaskbarLauncherStateController.applyState();
+ }
+
+ @Override
public void dumpLogs(String prefix, PrintWriter pw) {
super.dumpLogs(prefix, pw);
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index b01168d..a90af04 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -15,15 +15,22 @@
*/
package com.android.launcher3.taskbar;
+import static android.view.View.AccessibilityDelegate;
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
+import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
+
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
import static com.android.launcher3.taskbar.LauncherTaskbarUIController.SYSUI_SURFACE_PROGRESS_INDEX;
+import static com.android.launcher3.taskbar.TaskbarManager.isPhoneButtonNavMode;
+import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_A11Y;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_BACK;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_HOME;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_IME_SWITCH;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_RECENTS;
import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_KEYGUARD;
+import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_SMALL_SCREEN;
import static com.android.launcher3.taskbar.Utilities.appendFlag;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE;
@@ -36,7 +43,6 @@
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
-import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
@@ -63,6 +69,7 @@
import android.view.View.OnClickListener;
import android.view.View.OnHoverListener;
import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -82,7 +89,6 @@
import com.android.systemui.shared.rotation.RotationButton;
import com.android.systemui.shared.rotation.RotationButtonController;
import com.android.systemui.shared.system.QuickStepContract;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -109,6 +115,7 @@
private static final int FLAG_NOTIFICATION_SHADE_EXPANDED = 1 << 10;
private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11;
private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12;
+ private static final int FLAG_SMALL_SCREEN = 1 << 13;
private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons";
@@ -122,7 +129,7 @@
private final TaskbarActivityContext mContext;
private final FrameLayout mNavButtonsView;
- private final ViewGroup mNavButtonContainer;
+ private final LinearLayout mNavButtonContainer;
// Used for IME+A11Y buttons
private final ViewGroup mEndContextualContainer;
private final ViewGroup mStartContextualContainer;
@@ -160,7 +167,7 @@
// Variables for moving nav buttons to a separate window above IME
private boolean mAreNavButtonsInSeparateWindow = false;
private BaseDragLayer<TaskbarActivityContext> mSeparateWindowParent; // Initialized in init.
- private final ViewTreeObserverWrapper.OnComputeInsetsListener mSeparateWindowInsetsComputer =
+ private final ViewTreeObserver.OnComputeInternalInsetsListener mSeparateWindowInsetsComputer =
this::onComputeInsetsForSeparateWindow;
private final RecentsHitboxExtender mHitboxExtender = new RecentsHitboxExtender();
@@ -180,9 +187,13 @@
*/
public void init(TaskbarControllers controllers) {
mControllers = controllers;
- mNavButtonsView.getLayoutParams().height = mContext.getDeviceProfile().taskbarSize;
-
boolean isThreeButtonNav = mContext.isThreeButtonNav();
+ DeviceProfile deviceProfile = mContext.getDeviceProfile();
+ Resources resources = mContext.getResources();
+ mNavButtonsView.getLayoutParams().height = !isPhoneMode(deviceProfile) ?
+ deviceProfile.taskbarSize :
+ resources.getDimensionPixelSize(R.dimen.taskbar_size);
+
mIsImeRenderingNavButtons =
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
if (!mIsImeRenderingNavButtons) {
@@ -201,6 +212,11 @@
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0
&& (flags & FLAG_SCREEN_PINNING_ACTIVE) == 0));
+ mPropertyHolders.add(new StatePropertyHolder(
+ mControllers.taskbarViewController.getTaskbarIconAlpha()
+ .getProperty(ALPHA_INDEX_SMALL_SCREEN),
+ flags -> (flags & FLAG_SMALL_SCREEN) == 0));
+
mPropertyHolders.add(new StatePropertyHolder(mControllers.taskbarDragLayerController
.getKeyguardBgTaskbar(), flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0));
@@ -231,7 +247,7 @@
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);
updateButtonLayoutSpacing();
-
+ updateStateForFlag(FLAG_SMALL_SCREEN, isPhoneButtonNavMode(mContext));
if (isInSetup) {
// Since setup wizard only has back button enabled, it looks strange to be
// end-aligned, so start-align instead.
@@ -244,18 +260,18 @@
// TODO(b/210906568) Dark intensity is currently not propagated during setup, so set
// it based on dark theme for now.
- int mode = mContext.getResources().getConfiguration().uiMode
+ int mode = resources.getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK;
boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES;
mTaskbarNavButtonDarkIntensity.updateValue(isDarkTheme ? 0 : 1);
} else if (isInKidsMode) {
- int iconSize = mContext.getResources().getDimensionPixelSize(
+ int iconSize = resources.getDimensionPixelSize(
R.dimen.taskbar_icon_size_kids);
- int buttonWidth = mContext.getResources().getDimensionPixelSize(
+ int buttonWidth = resources.getDimensionPixelSize(
R.dimen.taskbar_nav_buttons_width_kids);
- int buttonHeight = mContext.getResources().getDimensionPixelSize(
+ int buttonHeight = resources.getDimensionPixelSize(
R.dimen.taskbar_nav_buttons_height_kids);
- int buttonRadius = mContext.getResources().getDimensionPixelSize(
+ int buttonRadius = resources.getDimensionPixelSize(
R.dimen.taskbar_nav_buttons_corner_radius_kids);
int paddingleft = (buttonWidth - iconSize) / 2;
int paddingRight = paddingleft;
@@ -277,7 +293,7 @@
buttonWidth,
buttonHeight
);
- int homeButtonLeftMargin = mContext.getResources().getDimensionPixelSize(
+ int homeButtonLeftMargin = resources.getDimensionPixelSize(
R.dimen.taskbar_home_button_left_margin_kids);
homeLayoutparams.setMargins(homeButtonLeftMargin, 0, 0, 0);
mHomeButton.setLayoutParams(homeLayoutparams);
@@ -287,7 +303,7 @@
buttonWidth,
buttonHeight
);
- int backButtonLeftMargin = mContext.getResources().getDimensionPixelSize(
+ int backButtonLeftMargin = resources.getDimensionPixelSize(
R.dimen.taskbar_back_button_left_margin_kids);
backLayoutParams.setMargins(backButtonLeftMargin, 0, 0, 0);
mBackButton.setLayoutParams(backLayoutParams);
@@ -342,7 +358,7 @@
if (!mIsImeRenderingNavButtons) {
View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
mStartContextualContainer, mControllers.navButtonController, R.id.back);
- imeDownButton.setRotation(Utilities.isRtl(mContext.getResources()) ? 90 : -90);
+ imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90);
// Only show when IME is visible.
mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
flags -> (flags & FLAG_IME_VISIBLE) != 0));
@@ -567,6 +583,26 @@
return mHomeButtonAlpha;
}
+ /**
+ * Sets the AccessibilityDelegate for the home button.
+ */
+ public void setHomeButtonAccessibilityDelegate(AccessibilityDelegate accessibilityDelegate) {
+ if (mHomeButton == null) {
+ return;
+ }
+ mHomeButton.setAccessibilityDelegate(accessibilityDelegate);
+ }
+
+ /**
+ * Sets the AccessibilityDelegate for the back button.
+ */
+ public void setBackButtonAccessibilityDelegate(AccessibilityDelegate accessibilityDelegate) {
+ if (mBackButton == null) {
+ return;
+ }
+ mBackButton.setAccessibilityDelegate(accessibilityDelegate);
+ }
+
/** Use to set the translationY for the all nav+contextual buttons */
public AnimatedFloat getTaskbarNavButtonTranslationY() {
return mTaskbarNavButtonTranslationY;
@@ -614,6 +650,9 @@
}
private void updateNavButtonTranslationY() {
+ if (isPhoneButtonNavMode(mContext)) {
+ return;
+ }
final float normalTranslationY = mTaskbarNavButtonTranslationY.value;
final float imeAdjustmentTranslationY = mTaskbarNavButtonTranslationYForIme.value;
TaskbarUIController uiController = mControllers.uiController;
@@ -676,17 +715,29 @@
updateButtonLayoutSpacing();
}
- /** Adds the correct spacing to 3 button nav container. No-op if using gesture nav */
+ /**
+ * Adds the correct spacing to 3 button nav container. No-op if using gesture nav or kids mode.
+ */
private void updateButtonLayoutSpacing() {
- if (!mContext.isThreeButtonNav()) {
+ if (!mContext.isThreeButtonNav() || mContext.isNavBarKidsModeActive()) {
return;
}
+
+ if (isPhoneButtonNavMode(mContext)) {
+ updatePhoneButtonSpacing();
+ return;
+ }
+
DeviceProfile dp = mContext.getDeviceProfile();
Resources res = mContext.getResources();
// Add spacing after the end of the last nav button
FrameLayout.LayoutParams navButtonParams =
(FrameLayout.LayoutParams) mNavButtonContainer.getLayoutParams();
+ navButtonParams.gravity = Gravity.END;
+ navButtonParams.width = FrameLayout.LayoutParams.WRAP_CONTENT;
+ navButtonParams.height = MATCH_PARENT;
+
int navMarginEnd = (int) res.getDimension(dp.inv.inlineNavButtonsEndSpacing);
int contextualWidth = mEndContextualContainer.getWidth();
// If contextual buttons are showing, we check if the end margin is enough for the
@@ -704,6 +755,39 @@
View navButton = mNavButtonContainer.getChildAt(i);
LinearLayout.LayoutParams buttonLayoutParams =
(LinearLayout.LayoutParams) navButton.getLayoutParams();
+ buttonLayoutParams.weight = 0;
+ if (i == 0) {
+ buttonLayoutParams.setMarginEnd(spaceInBetween / 2);
+ } else if (i == mNavButtonContainer.getChildCount() - 1) {
+ buttonLayoutParams.setMarginStart(spaceInBetween / 2);
+ } else {
+ buttonLayoutParams.setMarginStart(spaceInBetween / 2);
+ buttonLayoutParams.setMarginEnd(spaceInBetween / 2);
+ }
+ }
+ }
+
+ /** Uniformly spaces out the 3 button nav for smaller phone screens */
+ private void updatePhoneButtonSpacing() {
+ DeviceProfile dp = mContext.getDeviceProfile();
+ Resources res = mContext.getResources();
+
+ // TODO: Polish pending, this is just to make it usable
+ FrameLayout.LayoutParams navContainerParams =
+ (FrameLayout.LayoutParams) mNavButtonContainer.getLayoutParams();
+ int endStartMargins = res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size);
+ navContainerParams.gravity = Gravity.CENTER;
+ navContainerParams.setMarginEnd(endStartMargins);
+ navContainerParams.setMarginStart(endStartMargins);
+ mNavButtonContainer.setLayoutParams(navContainerParams);
+
+ // Add the spaces in between the nav buttons
+ int spaceInBetween = res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween_phone);
+ for (int i = 0; i < mNavButtonContainer.getChildCount(); i++) {
+ View navButton = mNavButtonContainer.getChildAt(i);
+ LinearLayout.LayoutParams buttonLayoutParams =
+ (LinearLayout.LayoutParams) navButton.getLayoutParams();
+ buttonLayoutParams.weight = 1;
if (i == 0) {
buttonLayoutParams.setMarginEnd(spaceInBetween / 2);
} else if (i == mNavButtonContainer.getChildCount() - 1) {
@@ -723,6 +807,8 @@
}
moveNavButtonsBackToTaskbarWindow();
+ mNavButtonContainer.removeAllViews();
+ mAllButtons.clear();
}
/**
@@ -741,14 +827,14 @@
mSeparateWindowParent.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
- ViewTreeObserverWrapper.addOnComputeInsetsListener(
- mSeparateWindowParent.getViewTreeObserver(), mSeparateWindowInsetsComputer);
+ mSeparateWindowParent.getViewTreeObserver().addOnComputeInternalInsetsListener(
+ mSeparateWindowInsetsComputer);
}
@Override
public void onViewDetachedFromWindow(View view) {
mSeparateWindowParent.removeOnAttachStateChangeListener(this);
- ViewTreeObserverWrapper.removeOnComputeInsetsListener(
+ mSeparateWindowParent.getViewTreeObserver().removeOnComputeInternalInsetsListener(
mSeparateWindowInsetsComputer);
}
});
@@ -776,7 +862,7 @@
mContext.getDragLayer().addView(mNavButtonsView);
}
- private void onComputeInsetsForSeparateWindow(ViewTreeObserverWrapper.InsetsInfo insetsInfo) {
+ private void onComputeInsetsForSeparateWindow(ViewTreeObserver.InternalInsetsInfo insetsInfo) {
addVisibleButtonsRegion(mSeparateWindowParent, insetsInfo.touchableRegion);
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index 800e162..6b67b50 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -25,6 +25,7 @@
import android.view.View;
import android.view.ViewOutlineProvider;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.RevealOutlineAnimation;
@@ -55,9 +56,9 @@
private final TaskbarActivityContext mActivity;
private final SharedPreferences mPrefs;
private final StashedHandleView mStashedHandleView;
- private final int mStashedHandleWidth;
+ private int mStashedHandleWidth;
private final int mStashedHandleHeight;
- private final RegionSamplingHelper mRegionSamplingHelper;
+ private RegionSamplingHelper mRegionSamplingHelper;
private final MultiValueAlpha mTaskbarStashedHandleAlpha;
private final AnimatedFloat mTaskbarStashedHandleHintScale = new AnimatedFloat(
this::updateStashedHandleHintScale);
@@ -85,30 +86,27 @@
mPrefs.getBoolean(SHARED_PREFS_STASHED_HANDLE_REGION_DARK_KEY, false),
false /* animate */);
final Resources resources = mActivity.getResources();
- mStashedHandleWidth = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_handle_width);
mStashedHandleHeight = resources.getDimensionPixelSize(
R.dimen.taskbar_stashed_handle_height);
- mRegionSamplingHelper = new RegionSamplingHelper(mStashedHandleView,
- new RegionSamplingHelper.SamplingCallback() {
- @Override
- public void onRegionDarknessChanged(boolean isRegionDark) {
- mStashedHandleView.updateHandleColor(isRegionDark, true /* animate */);
- mPrefs.edit().putBoolean(SHARED_PREFS_STASHED_HANDLE_REGION_DARK_KEY,
- isRegionDark).apply();
- }
-
- @Override
- public Rect getSampledRegion(View sampledView) {
- return mStashedHandleView.getSampledRegion();
- }
- }, Executors.UI_HELPER_EXECUTOR);
}
public void init(TaskbarControllers controllers) {
mControllers = controllers;
- mStashedHandleView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarSize;
+ DeviceProfile deviceProfile = mActivity.getDeviceProfile();
+ Resources resources = mActivity.getResources();
+ if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) {
+ mStashedHandleView.getLayoutParams().height =
+ resources.getDimensionPixelSize(R.dimen.taskbar_size);
+ mStashedHandleWidth =
+ resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen);
+ } else {
+ mStashedHandleView.getLayoutParams().height = deviceProfile.taskbarSize;
+ mStashedHandleWidth =
+ resources.getDimensionPixelSize(R.dimen.taskbar_stashed_handle_width);
+ }
- mTaskbarStashedHandleAlpha.getProperty(ALPHA_INDEX_STASHED).setValue(0);
+ mTaskbarStashedHandleAlpha.getProperty(ALPHA_INDEX_STASHED).setValue(
+ isPhoneGestureNavMode(deviceProfile) ? 1 : 0);
mTaskbarStashedHandleHintScale.updateValue(1f);
final int stashedTaskbarHeight = mControllers.taskbarStashController.getStashedHeight();
@@ -135,10 +133,37 @@
view.setPivotX(stashedCenterX);
view.setPivotY(stashedCenterY);
});
+ initRegionSampler();
+ if (isPhoneGestureNavMode(deviceProfile)) {
+ onIsStashedChanged(true);
+ }
}
+ private void initRegionSampler() {
+ mRegionSamplingHelper = new RegionSamplingHelper(mStashedHandleView,
+ new RegionSamplingHelper.SamplingCallback() {
+ @Override
+ public void onRegionDarknessChanged(boolean isRegionDark) {
+ mStashedHandleView.updateHandleColor(isRegionDark, true /* animate */);
+ mPrefs.edit().putBoolean(SHARED_PREFS_STASHED_HANDLE_REGION_DARK_KEY,
+ isRegionDark).apply();
+ }
+
+ @Override
+ public Rect getSampledRegion(View sampledView) {
+ return mStashedHandleView.getSampledRegion();
+ }
+ }, Executors.UI_HELPER_EXECUTOR);
+ }
+
+
public void onDestroy() {
mRegionSamplingHelper.stopAndDestroy();
+ mRegionSamplingHelper = null;
+ }
+
+ private boolean isPhoneGestureNavMode(DeviceProfile deviceProfile) {
+ return TaskbarManager.isPhoneMode(deviceProfile) && !mActivity.isThreeButtonNav();
}
public MultiValueAlpha getStashedHandleAlpha() {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 439490e..8697b69 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -23,8 +23,9 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
-import static com.android.launcher3.ResourceUtils.getBoolByName;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
+import static com.android.launcher3.taskbar.TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW;
+import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
@@ -76,10 +77,10 @@
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SettingsCache;
import com.android.launcher3.util.TraceHelper;
@@ -118,7 +119,7 @@
// The size we should return to when we call setTaskbarWindowFullscreen(false)
private int mLastRequestedNonFullscreenHeight;
- private final NavigationMode mNavMode;
+ private NavigationMode mNavMode;
private final boolean mImeDrawsImeNavBar;
private final ViewCache mViewCache = new ViewCache();
@@ -130,6 +131,8 @@
// The flag to know if the window is excluded from magnification region computation.
private boolean mIsExcludeFromMagnificationRegion = false;
private boolean mBindingItems = false;
+ private boolean mAddedWindow = false;
+
private final TaskbarShortcutMenuAccessibilityDelegate mAccessibilityDelegate;
@@ -173,13 +176,15 @@
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
+ final boolean isDesktopMode = getPackageManager().hasSystemFeature(FEATURE_PC);
+
// Construct controllers.
mControllers = new TaskbarControllers(this,
new TaskbarDragController(this),
buttonController,
- getPackageManager().hasSystemFeature(FEATURE_PC)
- ? new DesktopNavbarButtonsViewController(this, navButtonsView) :
- new NavbarButtonsViewController(this, navButtonsView),
+ isDesktopMode
+ ? new DesktopNavbarButtonsViewController(this, navButtonsView)
+ : new NavbarButtonsViewController(this, navButtonsView),
new RotationButtonController(this,
c.getColor(R.color.taskbar_nav_icon_light_color),
c.getColor(R.color.taskbar_nav_icon_dark_color),
@@ -202,7 +207,10 @@
new TaskbarForceVisibleImmersiveController(this),
new TaskbarAllAppsController(this, dp),
new TaskbarInsetsController(this),
- new VoiceInteractionWindowController(this));
+ new VoiceInteractionWindowController(this),
+ isDesktopMode
+ ? new DesktopTaskbarRecentAppsController(this)
+ : TaskbarRecentAppsController.DEFAULT);
}
public void init(@NonNull TaskbarSharedState sharedState) {
@@ -213,7 +221,12 @@
mControllers.init(sharedState);
updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */);
- mWindowManager.addView(mDragLayer, mWindowLayoutParams);
+ if (!mAddedWindow) {
+ mWindowManager.addView(mDragLayer, mWindowLayoutParams);
+ mAddedWindow = true;
+ } else {
+ mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
+ }
}
@Override
@@ -222,7 +235,8 @@
}
/** Updates {@link DeviceProfile} instances for any Taskbar windows. */
- public void updateDeviceProfile(DeviceProfile dp) {
+ public void updateDeviceProfile(DeviceProfile dp, NavigationMode navMode) {
+ mNavMode = navMode;
mControllers.taskbarAllAppsController.updateDeviceProfile(dp);
mDeviceProfile = dp.copy(this);
updateIconSize(getResources());
@@ -456,7 +470,10 @@
mIsDestroyed = true;
setUIController(TaskbarUIController.DEFAULT);
mControllers.onDestroy();
- mWindowManager.removeViewImmediate(mDragLayer);
+ if (!FLAG_HIDE_NAVBAR_WINDOW) {
+ mWindowManager.removeViewImmediate(mDragLayer);
+ mAddedWindow = false;
+ }
}
public void updateSysuiStateFlags(int systemUiStateFlags, boolean fromInit) {
@@ -591,6 +608,12 @@
* Returns the default height of the window, including the static corner radii above taskbar.
*/
public int getDefaultTaskbarWindowHeight() {
+ if (FLAG_HIDE_NAVBAR_WINDOW && mDeviceProfile.isPhone) {
+ Resources resources = getResources();
+ return isThreeButtonNav() ?
+ resources.getDimensionPixelSize(R.dimen.taskbar_size) :
+ resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
+ }
return mDeviceProfile.taskbarSize + Math.max(getLeftCornerRadius(), getRightCornerRadius());
}
@@ -622,7 +645,9 @@
/** Adds the given view to WindowManager with the provided LayoutParams (creates new window). */
public void addWindowView(View view, WindowManager.LayoutParams windowLayoutParams) {
- mWindowManager.addView(view, windowLayoutParams);
+ if (!view.isAttachedToWindow()) {
+ mWindowManager.addView(view, windowLayoutParams);
+ }
}
/** Removes the given view from WindowManager. See {@link #addWindowView}. */
@@ -748,6 +773,24 @@
mControllers.taskbarStashController.startUnstashHint(animateForward);
}
+ /**
+ * Enables manual taskbar stashing. This method should only be used for tests that need to
+ * stash/unstash the taskbar.
+ */
+ @VisibleForTesting
+ public void enableManualStashingForTests(boolean enableManualStashing) {
+ mControllers.taskbarStashController.enableManualStashingForTests(enableManualStashing);
+ }
+
+ /**
+ * Unstashes the Taskbar if it is stashed. This method should only be used to unstash the
+ * taskbar at the end of a test.
+ */
+ @VisibleForTesting
+ public void unstashTaskbarIfStashed() {
+ mControllers.taskbarStashController.onLongPressToUnstashTaskbar();
+ }
+
protected boolean isUserSetupComplete() {
return mIsUserSetupComplete;
}
@@ -825,6 +868,10 @@
btv.post(() -> mControllers.taskbarPopupController.showForIcon(btv));
}
+ public boolean isInApp() {
+ return mControllers.taskbarStashController.isInApp();
+ }
+
protected void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarActivityContext:");
@@ -839,6 +886,6 @@
pw.println(String.format(
"%s\tmBindInProgress=%b", prefix, mBindingItems));
mControllers.dumpLogs(prefix + "\t", pw);
- mDeviceProfile.dump(prefix, pw);
+ mDeviceProfile.dump(this, prefix, pw);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
index d7b50b0..2b80b75 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
@@ -53,6 +53,7 @@
public final TaskbarAllAppsController taskbarAllAppsController;
public final TaskbarInsetsController taskbarInsetsController;
public final VoiceInteractionWindowController voiceInteractionWindowController;
+ public final TaskbarRecentAppsController taskbarRecentAppsController;
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
@@ -82,7 +83,8 @@
TaskbarForceVisibleImmersiveController taskbarForceVisibleImmersiveController,
TaskbarAllAppsController taskbarAllAppsController,
TaskbarInsetsController taskbarInsetsController,
- VoiceInteractionWindowController voiceInteractionWindowController) {
+ VoiceInteractionWindowController voiceInteractionWindowController,
+ TaskbarRecentAppsController taskbarRecentAppsController) {
this.taskbarActivityContext = taskbarActivityContext;
this.taskbarDragController = taskbarDragController;
this.navButtonController = navButtonController;
@@ -102,6 +104,7 @@
this.taskbarAllAppsController = taskbarAllAppsController;
this.taskbarInsetsController = taskbarInsetsController;
this.voiceInteractionWindowController = voiceInteractionWindowController;
+ this.taskbarRecentAppsController = taskbarRecentAppsController;
}
/**
@@ -130,6 +133,7 @@
navButtonController.init(this);
taskbarInsetsController.init(this);
voiceInteractionWindowController.init(this);
+ taskbarRecentAppsController.init(this);
mControllersToLog = new LoggableTaskbarController[] {
taskbarDragController, navButtonController, navbarButtonsViewController,
@@ -178,6 +182,7 @@
navButtonController.onDestroy();
taskbarInsetsController.onDestroy();
voiceInteractionWindowController.onDestroy();
+ taskbarRecentAppsController.onDestroy();
mControllersToLog = null;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
index 3a0f374..9a1e064 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -32,6 +32,7 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
+import android.util.Pair;
import android.view.DragEvent;
import android.view.MotionEvent;
import android.view.SurfaceControl;
@@ -42,7 +43,6 @@
import androidx.annotation.Nullable;
import com.android.internal.logging.InstanceId;
-import com.android.internal.logging.InstanceIdSequence;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DragSource;
@@ -66,9 +66,10 @@
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
+import com.android.quickstep.util.LogUtils;
import com.android.systemui.shared.recents.model.Task;
import java.io.PrintWriter;
@@ -359,11 +360,11 @@
}
if (clipDescription != null && intent != null) {
+ Pair<InstanceId, com.android.launcher3.logging.InstanceId> instanceIds =
+ LogUtils.getShellShareableInstanceId();
// Need to share the same InstanceId between launcher3 and WM Shell (internal).
- InstanceId internalInstanceId = new InstanceIdSequence(
- com.android.launcher3.logging.InstanceId.INSTANCE_ID_MAX).newInstanceId();
- com.android.launcher3.logging.InstanceId launcherInstanceId =
- new com.android.launcher3.logging.InstanceId(internalInstanceId.getId());
+ InstanceId internalInstanceId = instanceIds.first;
+ com.android.launcher3.logging.InstanceId launcherInstanceId = instanceIds.second;
intent.putExtra(ClipDescription.EXTRA_LOGGING_INSTANCE_ID, internalInstanceId);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
index c1a6185..7e75779 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
@@ -24,17 +24,15 @@
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewTreeObserver;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BaseDragLayer;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.OnComputeInsetsListener;
/**
* Top-level ViewGroup that hosts the TaskbarView as well as Views created by it such as Folder.
@@ -42,7 +40,8 @@
public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> {
private final TaskbarBackgroundRenderer mBackgroundRenderer;
- private final OnComputeInsetsListener mTaskbarInsetsComputer = this::onComputeTaskbarInsets;
+ private final ViewTreeObserver.OnComputeInternalInsetsListener mTaskbarInsetsComputer =
+ this::onComputeTaskbarInsets;
// Initialized in init.
private TaskbarDragLayerController.TaskbarDragLayerCallbacks mControllerCallbacks;
@@ -80,28 +79,33 @@
mControllers = mControllerCallbacks.getTouchControllers();
}
- private void onComputeTaskbarInsets(InsetsInfo insetsInfo) {
+ private void onComputeTaskbarInsets(ViewTreeObserver.InternalInsetsInfo insetsInfo) {
if (mControllerCallbacks != null) {
mControllerCallbacks.updateInsetsTouchability(insetsInfo);
}
}
+ protected void onDestroy(boolean forceDestroy) {
+ if (forceDestroy) {
+ getViewTreeObserver().removeOnComputeInternalInsetsListener(mTaskbarInsetsComputer);
+ }
+ }
+
protected void onDestroy() {
- ViewTreeObserverWrapper.removeOnComputeInsetsListener(mTaskbarInsetsComputer);
+ onDestroy(!TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- ViewTreeObserverWrapper.addOnComputeInsetsListener(getViewTreeObserver(),
- mTaskbarInsetsComputer);
+ getViewTreeObserver().addOnComputeInternalInsetsListener(mTaskbarInsetsComputer);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
- onDestroy();
+ onDestroy(true);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
index 77ef83c..025fe7a 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -17,11 +17,12 @@
import android.content.res.Resources;
import android.graphics.Rect;
+import android.view.ViewTreeObserver;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.AnimatedFloat;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo;
import java.io.PrintWriter;
@@ -156,9 +157,9 @@
/**
* Called to update the touchable insets.
- * @see InsetsInfo#setTouchableInsets(int)
+ * @see ViewTreeObserver.InternalInsetsInfo#setTouchableInsets(int)
*/
- public void updateInsetsTouchability(InsetsInfo insetsInfo) {
+ public void updateInsetsTouchability(ViewTreeObserver.InternalInsetsInfo insetsInfo) {
mControllers.taskbarInsetsController.updateInsetsTouchability(insetsInfo);
}
@@ -173,7 +174,15 @@
* Returns how tall the background should be drawn at the bottom of the screen.
*/
public int getTaskbarBackgroundHeight() {
- return mActivity.getDeviceProfile().taskbarSize;
+ DeviceProfile deviceProfile = mActivity.getDeviceProfile();
+ if (TaskbarManager.isPhoneMode(deviceProfile)) {
+ Resources resources = mActivity.getResources();
+ return mActivity.isThreeButtonNav() ?
+ resources.getDimensionPixelSize(R.dimen.taskbar_size) :
+ resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
+ } else {
+ return deviceProfile.taskbarSize;
+ }
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
index c99cebb..6c793a6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
@@ -18,13 +18,17 @@
import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTROLS;
import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_ICONS;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
import static com.android.launcher3.taskbar.NavbarButtonsViewController.ALPHA_INDEX_IMMERSIVE_MODE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IMMERSIVE_MODE;
+import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.MotionEvent;
+import android.view.View;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.util.MultiValueAlpha;
@@ -52,6 +56,21 @@
this::updateIconDimmingAlpha);
private final Consumer<MultiValueAlpha> mImmersiveModeAlphaUpdater = alpha -> alpha.getProperty(
ALPHA_INDEX_IMMERSIVE_MODE).setValue(mIconAlphaForDimming.value);
+ private final View.AccessibilityDelegate mKidsModeAccessibilityDelegate =
+ new View.AccessibilityDelegate() {
+ @Override
+ public boolean performAccessibilityAction(View host, int action, Bundle args) {
+ if (action == ACTION_ACCESSIBILITY_FOCUS || action == ACTION_CLICK) {
+ // Animate undimming of icons on an a11y event, followed by starting the
+ // dimming animation (after its timeout has expired). Both can be called in
+ // succession, as the playing of the two animations in a row is managed by
+ // mHandler's message queue.
+ startIconUndimming();
+ startIconDimming();
+ }
+ return super.performAccessibilityAction(host, action, args);
+ }
+ };
// Initialized in init.
private TaskbarControllers mControllers;
@@ -77,12 +96,21 @@
} else {
startIconUndimming();
}
+ mControllers.navbarButtonsViewController.setHomeButtonAccessibilityDelegate(
+ mKidsModeAccessibilityDelegate);
+ mControllers.navbarButtonsViewController.setBackButtonAccessibilityDelegate(
+ mKidsModeAccessibilityDelegate);
+ } else {
+ mControllers.navbarButtonsViewController.setHomeButtonAccessibilityDelegate(null);
+ mControllers.navbarButtonsViewController.setBackButtonAccessibilityDelegate(null);
}
}
/** Clean up animations. */
public void onDestroy() {
startIconUndimming();
+ mControllers.navbarButtonsViewController.setHomeButtonAccessibilityDelegate(null);
+ mControllers.navbarButtonsViewController.setBackButtonAccessibilityDelegate(null);
}
private void startIconUndimming() {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
index 48fde8f..7b2b7ec 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
@@ -20,6 +20,11 @@
import android.view.InsetsFrameProvider
import android.view.InsetsState.ITYPE_BOTTOM_MANDATORY_GESTURES
import android.view.InsetsState
+import android.view.InsetsState.ITYPE_BOTTOM_TAPPABLE_ELEMENT
+import android.view.InsetsState.ITYPE_EXTRA_NAVIGATION_BAR
+import android.view.ViewTreeObserver
+import android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME
+import android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD
import android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION
@@ -29,9 +34,6 @@
import com.android.launcher3.anim.AlphaUpdateListener
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
import com.android.quickstep.KtR
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo
-import com.android.systemui.shared.system.WindowManagerWrapper
-import com.android.systemui.shared.system.WindowManagerWrapper.*
import java.io.PrintWriter
/**
@@ -55,8 +57,7 @@
this.controllers = controllers
windowLayoutParams = context.windowLayoutParams
- val wmWrapper: WindowManagerWrapper = getInstance()
- wmWrapper.setProvidesInsetsTypes(
+ setProvidesInsetsTypes(
windowLayoutParams,
intArrayOf(
ITYPE_EXTRA_NAVIGATION_BAR,
@@ -108,10 +109,22 @@
}
/**
- * Called to update the touchable insets.
- * @see InsetsInfo.setTouchableInsets
+ * Sets {@param providesInsetsTypes} as the inset types provided by {@param params}.
+ * @param params The window layout params.
+ * @param providesInsetsTypes The inset types we would like this layout params to provide.
*/
- fun updateInsetsTouchability(insetsInfo: InsetsInfo) {
+ fun setProvidesInsetsTypes(params: WindowManager.LayoutParams, providesInsetsTypes: IntArray) {
+ params.providedInsets = arrayOfNulls<InsetsFrameProvider>(providesInsetsTypes.size);
+ for (i in providesInsetsTypes.indices) {
+ params.providedInsets[i] = InsetsFrameProvider(providesInsetsTypes[i]);
+ }
+ }
+
+ /**
+ * Called to update the touchable insets.
+ * @see InternalInsetsInfo.setTouchableInsets
+ */
+ fun updateInsetsTouchability(insetsInfo: ViewTreeObserver.InternalInsetsInfo) {
insetsInfo.touchableRegion.setEmpty()
// Always have nav buttons be touchable
controllers.navbarButtonsViewController.addVisibleButtonsRegion(
@@ -120,18 +133,18 @@
var insetsIsTouchableRegion = true
if (context.dragLayer.alpha < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD) {
// Let touches pass through us.
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
} else if (controllers.navbarButtonsViewController.isImeVisible) {
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
} else if (!controllers.uiController.isTaskbarTouchable) {
// Let touches pass through us.
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
} else if (controllers.taskbarDragController.isSystemDragInProgress) {
// Let touches pass through us.
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
} else if (AbstractFloatingView.hasOpenView(context, TYPE_TASKBAR_ALL_APPS)) {
// Let touches pass through us.
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
} else if (controllers.taskbarViewController.areIconsVisible()
|| AbstractFloatingView.hasOpenView(context, AbstractFloatingView.TYPE_ALL)
|| context.isNavBarKidsModeActive
@@ -139,15 +152,15 @@
// Taskbar has some touchable elements, take over the full taskbar area
insetsInfo.setTouchableInsets(
if (context.isTaskbarWindowFullscreen) {
- InsetsInfo.TOUCHABLE_INSETS_FRAME
+ TOUCHABLE_INSETS_FRAME
} else {
insetsInfo.touchableRegion.set(contentRegion)
- InsetsInfo.TOUCHABLE_INSETS_REGION
+ TOUCHABLE_INSETS_REGION
}
)
insetsIsTouchableRegion = false
} else {
- insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
+ insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
}
context.excludeFromMagnificationRegion(insetsIsTouchableRegion)
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 85e76b2..58c689b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -31,12 +31,13 @@
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
-import com.android.launcher3.BaseQuickstepLauncher;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.statemanager.StateManager;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.RecentsAnimationCallbacks;
@@ -48,6 +49,7 @@
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.StringJoiner;
+import java.util.function.Consumer;
import java.util.function.Supplier;
/**
@@ -76,7 +78,7 @@
private TaskbarControllers mControllers;
private AnimatedFloat mTaskbarBackgroundAlpha;
private MultiValueAlpha.AlphaProperty mIconAlphaForHome;
- private BaseQuickstepLauncher mLauncher;
+ private QuickstepLauncher mLauncher;
private Integer mPrevState;
private int mState;
@@ -92,6 +94,19 @@
// We skip any view synchronizations during init/destroy.
private boolean mCanSyncViews;
+ private final Consumer<Float> mIconAlphaForHomeConsumer = alpha -> {
+ /*
+ * Hide Launcher Hotseat icons when Taskbar icons have opacity. Both icon sets
+ * should not be visible at the same time.
+ */
+ mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
+ mLauncher.getHotseat().setQsbAlpha(
+ mLauncher.getDeviceProfile().isQsbInline && alpha > 0 ? 0 : 1);
+ };
+
+ private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener =
+ dp -> mIconAlphaForHomeConsumer.accept(mIconAlphaForHome.getValue());
+
private final StateManager.StateListener<LauncherState> mStateListener =
new StateManager.StateListener<LauncherState>() {
@@ -121,7 +136,7 @@
}
};
- public void init(TaskbarControllers controllers, BaseQuickstepLauncher launcher) {
+ public void init(TaskbarControllers controllers, QuickstepLauncher launcher) {
mCanSyncViews = false;
mControllers = controllers;
@@ -131,13 +146,7 @@
.getTaskbarBackgroundAlpha();
MultiValueAlpha taskbarIconAlpha = mControllers.taskbarViewController.getTaskbarIconAlpha();
mIconAlphaForHome = taskbarIconAlpha.getProperty(ALPHA_INDEX_HOME);
- mIconAlphaForHome.setConsumer(
- alpha -> {
- mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
- if (mLauncher.getDeviceProfile().isQsbInline) {
- mLauncher.getHotseat().setQsbAlpha(alpha > 0 ? 0 : 1);
- }
- });
+ mIconAlphaForHome.setConsumer(mIconAlphaForHomeConsumer);
mIconAlignmentForResumedState.finishAnimation();
onIconAlignmentRatioChangedForAppAndHomeTransition();
@@ -150,6 +159,7 @@
applyState(0);
mCanSyncViews = true;
+ mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
}
public void onDestroy() {
@@ -164,6 +174,7 @@
mLauncher.getStateManager().removeStateListener(mStateListener);
mCanSyncViews = true;
+ mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
}
public Animator createAnimToLauncher(@NonNull LauncherState toState,
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 06262c0..bc69088 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -30,19 +30,22 @@
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Handler;
+import android.os.SystemProperties;
import android.provider.Settings;
import android.view.Display;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.taskbar.unfold.NonDestroyableScopedUnfoldTransitionProgressProvider;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SettingsCache;
import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.quickstep.RecentsActivity;
@@ -58,6 +61,9 @@
*/
public class TaskbarManager {
+ public static final boolean FLAG_HIDE_NAVBAR_WINDOW =
+ SystemProperties.getBoolean("persist.wm.debug.hide_navbar_window", false);
+
private static final Uri USER_SETUP_COMPLETE_URI = Settings.Secure.getUriFor(
Settings.Secure.USER_SETUP_COMPLETE);
@@ -78,6 +84,7 @@
// It's destruction/creation will be managed by the activity.
private final ScopedUnfoldTransitionProgressProvider mUnfoldProgressProvider =
new NonDestroyableScopedUnfoldTransitionProgressProvider();
+ private NavigationMode mNavMode;
private TaskbarActivityContext mTaskbarActivityContext;
private StatefulActivity mActivity;
@@ -128,9 +135,11 @@
| ActivityInfo.CONFIG_SCREEN_SIZE;
boolean requiresRecreate = (configDiff & configsRequiringRecreate) != 0;
if ((configDiff & ActivityInfo.CONFIG_SCREEN_SIZE) != 0
- && mTaskbarActivityContext != null && dp != null) {
+ && mTaskbarActivityContext != null && dp != null
+ && !isPhoneMode(dp)) {
// Additional check since this callback gets fired multiple times w/o
// screen size changing, or when simply rotating the device.
+ // In the case of phone device rotation, we do want to call recreateTaskbar()
DeviceProfile oldDp = mTaskbarActivityContext.getDeviceProfile();
boolean isOrientationChange =
(configDiff & ActivityInfo.CONFIG_ORIENTATION) != 0;
@@ -147,8 +156,8 @@
} else {
// Config change might be handled without re-creating the taskbar
if (mTaskbarActivityContext != null) {
- if (dp != null && dp.isTaskbarPresent) {
- mTaskbarActivityContext.updateDeviceProfile(dp);
+ if (dp != null && isTaskbarPresent(dp)) {
+ mTaskbarActivityContext.updateDeviceProfile(dp, mNavMode);
}
mTaskbarActivityContext.onConfigurationChanged(configDiff);
}
@@ -159,12 +168,15 @@
@Override
public void onLowMemory() { }
};
- mShutdownReceiver = new SimpleBroadcastReceiver(i -> destroyExistingTaskbar());
+ mShutdownReceiver = new SimpleBroadcastReceiver(i ->
+ destroyExistingTaskbar());
mDispInfoChangeListener = (context, info, flags) -> {
if ((flags & CHANGE_FLAGS) != 0) {
+ mNavMode = info.navigationMode;
recreateTaskbar();
}
};
+ mNavMode = mDisplayController.getInfo().navigationMode;
mDisplayController.addChangeListener(mDispInfoChangeListener);
SettingsCache.INSTANCE.get(mContext).register(USER_SETUP_COMPLETE_URI,
mUserSetupCompleteListener);
@@ -179,7 +191,9 @@
private void destroyExistingTaskbar() {
if (mTaskbarActivityContext != null) {
mTaskbarActivityContext.onDestroy();
- mTaskbarActivityContext = null;
+ if (!FLAG_HIDE_NAVBAR_WINDOW) {
+ mTaskbarActivityContext = null;
+ }
}
}
@@ -225,8 +239,8 @@
*/
private UnfoldTransitionProgressProvider getUnfoldTransitionProgressProviderForActivity(
StatefulActivity activity) {
- if (activity instanceof BaseQuickstepLauncher) {
- return ((BaseQuickstepLauncher) activity).getUnfoldTransitionProgressProvider();
+ if (activity instanceof QuickstepLauncher) {
+ return ((QuickstepLauncher) activity).getUnfoldTransitionProgressProvider();
}
return null;
}
@@ -235,11 +249,11 @@
* Creates a {@link TaskbarUIController} to use while the given StatefulActivity is active.
*/
private TaskbarUIController createTaskbarUIControllerForActivity(StatefulActivity activity) {
- if (activity instanceof BaseQuickstepLauncher) {
+ if (activity instanceof QuickstepLauncher) {
if (mTaskbarActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) {
- return new DesktopTaskbarUIController((BaseQuickstepLauncher) activity);
+ return new DesktopTaskbarUIController((QuickstepLauncher) activity);
}
- return new LauncherTaskbarUIController((BaseQuickstepLauncher) activity);
+ return new LauncherTaskbarUIController((QuickstepLauncher) activity);
}
if (activity instanceof RecentsActivity) {
return new FallbackTaskbarUIController((RecentsActivity) activity);
@@ -260,24 +274,33 @@
}
}
- private void recreateTaskbar() {
+ /**
+ * This method is called multiple times (ex. initial init, then when user unlocks) in which case
+ * we fully want to destroy an existing taskbar and create a new one.
+ * In other case (folding/unfolding) we don't need to remove and add window.
+ */
+ @VisibleForTesting
+ public void recreateTaskbar() {
+ DeviceProfile dp = mUserUnlocked ?
+ LauncherAppState.getIDP(mContext).getDeviceProfile(mContext) : null;
+
destroyExistingTaskbar();
- DeviceProfile dp =
- mUserUnlocked ? LauncherAppState.getIDP(mContext).getDeviceProfile(mContext) : null;
-
- boolean isTaskBarEnabled = dp != null && dp.isTaskbarPresent;
-
+ boolean isTaskBarEnabled = dp != null && isTaskbarPresent(dp);
if (!isTaskBarEnabled) {
SystemUiProxy.INSTANCE.get(mContext)
.notifyTaskbarStatus(/* visible */ false, /* stashed */ false);
return;
}
- mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp, mNavButtonController,
- mUnfoldProgressProvider);
-
+ if (mTaskbarActivityContext == null) {
+ mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp, mNavButtonController,
+ mUnfoldProgressProvider);
+ } else {
+ mTaskbarActivityContext.updateDeviceProfile(dp, mNavMode);
+ }
mTaskbarActivityContext.init(mSharedState);
+
if (mActivity != null) {
mTaskbarActivityContext.setUIController(
createTaskbarUIControllerForActivity(mActivity));
@@ -301,6 +324,26 @@
}
}
+ /**
+ * @return {@code true} if provided device profile isn't a large screen profile
+ * and we are using a single window for taskbar and navbar.
+ */
+ public static boolean isPhoneMode(DeviceProfile deviceProfile) {
+ return TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW && deviceProfile.isPhone;
+ }
+
+ /**
+ * @return {@code true} if {@link #isPhoneMode(DeviceProfile)} is true and we're using
+ * 3 button-nav
+ */
+ public static boolean isPhoneButtonNavMode(TaskbarActivityContext context) {
+ return isPhoneMode(context.getDeviceProfile()) && context.isThreeButtonNav();
+ }
+
+ private boolean isTaskbarPresent(DeviceProfile deviceProfile) {
+ return FLAG_HIDE_NAVBAR_WINDOW || deviceProfile.isTaskbarPresent;
+ }
+
public void onRotationProposal(int rotation, boolean isValid) {
if (mTaskbarActivityContext != null) {
mTaskbarActivityContext.onRotationProposal(rotation, isValid);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
index 75881a3..5e670d294 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
@@ -29,6 +29,7 @@
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
+import com.android.quickstep.RecentsModel;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -42,7 +43,7 @@
* Launcher model Callbacks for rendering taskbar.
*/
public class TaskbarModelCallbacks implements
- BgDataModel.Callbacks, LauncherBindableItemsContainer {
+ BgDataModel.Callbacks, LauncherBindableItemsContainer, RecentsModel.RunningTasksListener {
private final SparseArray<ItemInfo> mHotseatItems = new SparseArray<>();
private List<ItemInfo> mPredictedItems = Collections.emptyList();
@@ -61,6 +62,16 @@
public void init(TaskbarControllers controllers) {
mControllers = controllers;
+ if (mControllers.taskbarRecentAppsController.isEnabled()) {
+ RecentsModel.INSTANCE.get(mContext).registerRunningTasksListener(this);
+ }
+ }
+
+ /**
+ * Unregisters listeners in this class.
+ */
+ public void unregisterListeners() {
+ RecentsModel.INSTANCE.get(mContext).unregisterRunningTasksListener();
}
@Override
@@ -185,6 +196,8 @@
isHotseatEmpty = false;
}
}
+ hotseatItemInfos = mControllers.taskbarRecentAppsController
+ .updateHotseatItemInfos(hotseatItemInfos);
mContainer.updateHotseatItems(hotseatItemInfos);
final boolean finalIsHotseatEmpty = isHotseatEmpty;
@@ -196,6 +209,21 @@
}
@Override
+ public void onRunningTasksChanged() {
+ updateRunningApps();
+ }
+
+ /** Called when there's a change in running apps to update the UI. */
+ public void commitRunningAppsToUI() {
+ commitItemsToUI();
+ }
+
+ /** Call TaskbarRecentAppsController to update running apps with mHotseatItems. */
+ public void updateRunningApps() {
+ mControllers.taskbarRecentAppsController.updateRunningApps(mHotseatItems);
+ }
+
+ @Override
public void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMapCopy) {
mControllers.taskbarPopupController.setDeepShortcutMap(deepShortcutMapCopy);
}
@@ -203,6 +231,7 @@
@Override
public void bindAllApplications(AppInfo[] apps, int flags) {
mControllers.taskbarAllAppsController.setApps(apps, flags);
+ mControllers.taskbarRecentAppsController.setApps(apps);
}
protected void dumpLogs(String prefix, PrintWriter pw) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
index 60f50a9..a395548 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
@@ -43,7 +43,7 @@
import com.android.launcher3.R;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
index 7b4501a..49d0873 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
@@ -15,14 +15,20 @@
*/
package com.android.launcher3.taskbar;
+import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
+
+import android.content.ClipDescription;
import android.content.Intent;
import android.content.pm.LauncherApps;
import android.graphics.Point;
+import android.os.Bundle;
+import android.util.Pair;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.NonNull;
+import com.android.internal.logging.InstanceId;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.LauncherSettings;
@@ -47,6 +53,7 @@
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.views.ActivityContext;
import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.util.LogUtils;
import java.io.PrintWriter;
import java.util.HashMap;
@@ -263,8 +270,14 @@
@Override
public void onClick(View view) {
- AbstractFloatingView.closeAllOpenViews(mTarget);
+ Pair<InstanceId, com.android.launcher3.logging.InstanceId> instanceIds =
+ LogUtils.getShellShareableInstanceId();
+ mTarget.getStatsLogManager().logger()
+ .withItemInfo(mItemInfo)
+ .withInstanceId(instanceIds.second)
+ .log(getLogEventForPosition(mPosition.stagePosition));
+ AbstractFloatingView.closeAllOpenViews(mTarget);
if (mItemInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
WorkspaceItemInfo workspaceItemInfo = (WorkspaceItemInfo) mItemInfo;
SystemUiProxy.INSTANCE.get(mTarget).startShortcut(
@@ -272,7 +285,8 @@
workspaceItemInfo.getDeepShortcutId(),
mPosition.stagePosition,
null,
- workspaceItemInfo.user);
+ workspaceItemInfo.user,
+ instanceIds.first);
} else {
SystemUiProxy.INSTANCE.get(mTarget).startIntent(
mTarget.getSystemService(LauncherApps.class).getMainActivityLaunchIntent(
@@ -281,7 +295,8 @@
mItemInfo.user),
new Intent(),
mPosition.stagePosition,
- null);
+ null,
+ instanceIds.first);
}
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
new file mode 100644
index 0000000..8445cff
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.taskbar;
+
+import android.util.SparseArray;
+
+import androidx.annotation.CallSuper;
+
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.model.data.ItemInfo;
+
+/**
+ * Base class for providing recent apps functionality
+ */
+public class TaskbarRecentAppsController {
+
+ public static final TaskbarRecentAppsController DEFAULT = new TaskbarRecentAppsController();
+
+ // Initialized in init.
+ protected TaskbarControllers mControllers;
+
+ @CallSuper
+ protected void init(TaskbarControllers taskbarControllers) {
+ mControllers = taskbarControllers;
+ }
+
+ @CallSuper
+ protected void onDestroy() {
+ mControllers = null;
+ }
+
+ /** Stores the current {@link AppInfo} instances, no-op except in desktop environment. */
+ protected void setApps(AppInfo[] apps) { }
+
+ /**
+ * Indicates whether recent apps functionality is enabled, should return false except in
+ * desktop environment.
+ */
+ protected boolean isEnabled() {
+ return false;
+ }
+
+ /** Called to update hotseatItems, no-op except in desktop environment. */
+ protected ItemInfo[] updateHotseatItemInfos(ItemInfo[] hotseatItems) {
+ return hotseatItems;
+ }
+
+ /** Called to update the list of currently running apps, no-op except in desktop environment. */
+ protected void updateRunningApps(SparseArray<ItemInfo> hotseatItems) { }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarShortcutMenuAccessibilityDelegate.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarShortcutMenuAccessibilityDelegate.java
index f131595..c10b57a 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarShortcutMenuAccessibilityDelegate.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarShortcutMenuAccessibilityDelegate.java
@@ -17,24 +17,29 @@
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.DEEP_SHORTCUTS;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.SHORTCUTS_AND_NOTIFICATIONS;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
-import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
+import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
import android.content.Intent;
import android.content.pm.LauncherApps;
+import android.util.Pair;
import android.view.KeyEvent;
import android.view.View;
+import com.android.internal.logging.InstanceId;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.accessibility.BaseAccessibilityDelegate;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.notification.NotificationListener;
import com.android.launcher3.util.ShortcutUtil;
import com.android.quickstep.SystemUiProxy;
+import com.android.quickstep.util.LogUtils;
import java.util.List;
@@ -49,10 +54,12 @@
public static final int MOVE_TO_BOTTOM_OR_RIGHT = R.id.action_move_to_bottom_or_right;
private final LauncherApps mLauncherApps;
+ private final StatsLogManager mStatsLogManager;
public TaskbarShortcutMenuAccessibilityDelegate(TaskbarActivityContext context) {
super(context);
mLauncherApps = context.getSystemService(LauncherApps.class);
+ mStatsLogManager = context.getStatsLogManager();
mActions.put(DEEP_SHORTCUTS, new LauncherAction(DEEP_SHORTCUTS,
R.string.action_deep_shortcut, KeyEvent.KEYCODE_S));
@@ -82,7 +89,14 @@
&& (action == MOVE_TO_TOP_OR_LEFT || action == MOVE_TO_BOTTOM_OR_RIGHT)) {
WorkspaceItemInfo info = (WorkspaceItemInfo) item;
int side = action == MOVE_TO_TOP_OR_LEFT
- ? SPLIT_POSITION_TOP_OR_LEFT : SPLIT_POSITION_BOTTOM_OR_RIGHT;
+ ? STAGE_POSITION_TOP_OR_LEFT : STAGE_POSITION_BOTTOM_OR_RIGHT;
+
+ Pair<InstanceId, com.android.launcher3.logging.InstanceId> instanceIds =
+ LogUtils.getShellShareableInstanceId();
+ mStatsLogManager.logger()
+ .withItemInfo(item)
+ .withInstanceId(instanceIds.second)
+ .log(getLogEventForPosition(side));
if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
SystemUiProxy.INSTANCE.get(mContext).startShortcut(
@@ -90,14 +104,15 @@
info.getDeepShortcutId(),
side,
/* bundleOpts= */ null,
- info.user);
+ info.user,
+ instanceIds.first);
} else {
SystemUiProxy.INSTANCE.get(mContext).startIntent(
mLauncherApps.getMainActivityLaunchIntent(
item.getIntent().getComponent(),
/* startActivityOptions= */null,
item.user),
- new Intent(), side, null);
+ new Intent(), side, null, instanceIds.first);
}
return true;
} else if (action == DEEP_SHORTCUTS || action == SHORTCUTS_AND_NOTIFICATIONS) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 513f1bb..d60bf8c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -30,7 +30,9 @@
import android.animation.AnimatorSet;
import android.annotation.Nullable;
import android.content.SharedPreferences;
+import android.content.res.Resources;
import android.util.Log;
+import android.view.InsetsController;
import android.view.View;
import android.view.ViewConfiguration;
@@ -38,13 +40,13 @@
import com.android.internal.jank.InteractionJankMonitor;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
-import com.android.systemui.shared.system.WindowManagerWrapper;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -69,6 +71,7 @@
public static final int FLAG_IN_STASHED_LAUNCHER_STATE = 1 << 6;
public static final int FLAG_STASHED_IN_APP_ALL_APPS = 1 << 7; // All apps is visible.
public static final int FLAG_IN_SETUP = 1 << 8; // In the Setup Wizard
+ public static final int FLAG_STASHED_SMALL_SCREEN = 1 << 9; // phone screen gesture nav, stashed
// If any of these flags are enabled, isInApp should return true.
private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP;
@@ -76,7 +79,8 @@
// If we're in an app and any of these flags are enabled, taskbar should be stashed.
private static final int FLAGS_STASHED_IN_APP = FLAG_STASHED_IN_APP_MANUAL
| FLAG_STASHED_IN_APP_PINNED | FLAG_STASHED_IN_APP_EMPTY | FLAG_STASHED_IN_APP_SETUP
- | FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_APP_ALL_APPS;
+ | FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_APP_ALL_APPS |
+ FLAG_STASHED_SMALL_SCREEN;
private static final int FLAGS_STASHED_IN_APP_IGNORING_IME =
FLAGS_STASHED_IN_APP & ~FLAG_STASHED_IN_APP_IME;
@@ -92,7 +96,7 @@
* How long to stash/unstash when manually invoked via long press.
*/
public static final long TASKBAR_STASH_DURATION =
- WindowManagerWrapper.ANIMATION_DURATION_RESIZE;
+ InsetsController.ANIMATION_DURATION_RESIZE;
/**
* How long to stash/unstash when keyboard is appearing/disappearing.
@@ -166,15 +170,25 @@
boolean inApp = hasAnyFlag(flags, FLAGS_IN_APP);
boolean stashedInApp = hasAnyFlag(flags, FLAGS_STASHED_IN_APP);
boolean stashedLauncherState = hasAnyFlag(flags, FLAG_IN_STASHED_LAUNCHER_STATE);
- return (inApp && stashedInApp) || (!inApp && stashedLauncherState);
+ boolean stashedForSmallScreen = hasAnyFlag(flags, FLAG_STASHED_SMALL_SCREEN);
+ return (inApp && stashedInApp) || (!inApp && stashedLauncherState)
+ || stashedForSmallScreen;
});
public TaskbarStashController(TaskbarActivityContext activity) {
mActivity = activity;
mPrefs = Utilities.getPrefs(mActivity);
mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity);
- mUnstashedHeight = mActivity.getDeviceProfile().taskbarSize;
- mStashedHeight = mActivity.getDeviceProfile().stashedTaskbarSize;
+ if (isPhoneMode()) {
+ // DeviceProfile's taskbar vars aren't initialized w/ the flag off
+ Resources resources = mActivity.getResources();
+ mUnstashedHeight = resources.getDimensionPixelSize(R.dimen.taskbar_size);
+ mStashedHeight = resources.getDimensionPixelOffset(R.dimen.taskbar_stashed_size);
+ } else {
+ mUnstashedHeight = mActivity.getDeviceProfile().taskbarSize;
+ mStashedHeight = mActivity.getDeviceProfile().stashedTaskbarSize;
+ }
+
}
public void init(TaskbarControllers controllers, boolean setupUIVisible) {
@@ -196,13 +210,21 @@
StashedHandleViewController.ALPHA_INDEX_STASHED);
mTaskbarStashedHandleHintScale = stashedHandleController.getStashedHandleHintScale();
- boolean isManuallyStashedInApp = supportsManualStashing()
+ // We use supportsVisualStashing() here instead of supportsManualStashing() because we want
+ // it to work properly for tests that recreate taskbar. This check is here just to ensure
+ // that taskbar unstashes when going to 3 button mode (supportsVisualStashing() false).
+ boolean isManuallyStashedInApp = supportsVisualStashing()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
boolean isInSetup = !mActivity.isUserSetupComplete() || setupUIVisible;
updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, isInSetup);
updateStateForFlag(FLAG_IN_SETUP, isInSetup);
- applyState();
+ updateStateForFlag(FLAG_STASHED_SMALL_SCREEN, isPhoneMode()
+ && !mActivity.isThreeButtonNav());
+ // For now, assume we're in an app, since LauncherTaskbarUIController won't be able to tell
+ // us that we're paused until a bit later. This avoids flickering upon recreating taskbar.
+ updateStateForFlag(FLAG_IN_APP, true);
+ applyState(/* duration = */ 0);
notifyStashChange(/* visible */ false, /* stashed */ isStashedInApp());
}
@@ -212,7 +234,7 @@
* state.
*/
public boolean supportsVisualStashing() {
- return mControllers.uiController.supportsVisualStashing();
+ return !mActivity.isThreeButtonNav() && mControllers.uiController.supportsVisualStashing();
}
/**
@@ -266,7 +288,14 @@
* Returns whether the taskbar should be stashed in the current LauncherState.
*/
public boolean isInStashedLauncherState() {
- return hasAnyFlag(FLAG_IN_STASHED_LAUNCHER_STATE) && supportsVisualStashing();
+ return (hasAnyFlag(FLAG_IN_STASHED_LAUNCHER_STATE) && supportsVisualStashing());
+ }
+
+ /**
+ * @return {@code true} if we're not on a large screen AND using gesture nav
+ */
+ private boolean isPhoneMode() {
+ return TaskbarManager.isPhoneMode(mActivity.getDeviceProfile());
}
private boolean hasAnyFlag(int flagMask) {
@@ -295,6 +324,10 @@
* @see WindowInsets.Type#systemBars()
*/
public int getContentHeightToReportToApps() {
+ if (isPhoneMode() && !mActivity.isThreeButtonNav()) {
+ return getStashedHeight();
+ }
+
if (supportsVisualStashing() && hasAnyFlag(FLAGS_REPORT_STASHED_INSETS_TO_APP)) {
DeviceProfile dp = mActivity.getDeviceProfile();
if (hasAnyFlag(FLAG_STASHED_IN_APP_SETUP) && dp.isTaskbarPresent && !dp.isLandscape) {
@@ -410,11 +443,18 @@
}
mAnimator = new AnimatorSet();
addJankMonitorListener(mAnimator, /* appearing= */ !mIsStashed);
+ final float stashTranslation = isPhoneMode() ? 0 :
+ (mUnstashedHeight - mStashedHeight) / 2f;
if (!supportsVisualStashing()) {
// Just hide/show the icons and background instead of stashing into a handle.
mAnimator.play(mIconAlphaForStash.animateToValue(isStashed ? 0 : 1)
.setDuration(duration));
+ mAnimator.playTogether(mTaskbarBackgroundOffset.animateToValue(isStashed ? 1 : 0)
+ .setDuration(duration));
+ mAnimator.playTogether(mIconTranslationYForStash.animateToValue(isStashed ?
+ stashTranslation : 0)
+ .setDuration(duration));
mAnimator.play(mTaskbarImeBgAlpha.animateToValue(
hasAnyFlag(FLAG_STASHED_IN_APP_IME) ? 0 : 1).setDuration(duration));
mAnimator.setStartDelay(startDelay);
@@ -438,7 +478,6 @@
if (isStashed) {
firstHalfDurationScale = 0.75f;
secondHalfDurationScale = 0.5f;
- final float stashTranslation = (mUnstashedHeight - mStashedHeight) / 2f;
fullLengthAnimatorSet.play(mIconTranslationYForStash.animateToValue(stashTranslation));
if (animateBg) {
@@ -450,7 +489,8 @@
firstHalfAnimatorSet.playTogether(
mIconAlphaForStash.animateToValue(0),
- mIconScaleForStash.animateToValue(STASHED_TASKBAR_SCALE)
+ mIconScaleForStash.animateToValue(isPhoneMode() ?
+ 0 : STASHED_TASKBAR_SCALE)
);
secondHalfAnimatorSet.playTogether(
mTaskbarStashedHandleAlpha.animateToValue(1)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
index fcc34c6..114bfec 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
@@ -49,9 +49,13 @@
return true;
}
+ /**
+ * This should only be called by TaskbarStashController so that a TaskbarUIController can
+ * disable stashing. All other controllers should use
+ * {@link TaskbarStashController#supportsVisualStashing()} as the source of truth.
+ */
public boolean supportsVisualStashing() {
- if (mControllers == null) return false;
- return !mControllers.taskbarActivityContext.isThreeButtonNav();
+ return true;
}
protected void onStashedInAppChanged() { }
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index ea15acb..dbf9759 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -314,10 +314,10 @@
int qsbEnd;
if (layoutRtl) {
qsbStart = iconEnd + mItemMarginLeftRight;
- qsbEnd = qsbStart + deviceProfile.qsbWidth;
+ qsbEnd = qsbStart + deviceProfile.hotseatQsbWidth;
} else {
qsbEnd = iconEnd - mItemMarginLeftRight;
- qsbStart = qsbEnd - deviceProfile.qsbWidth;
+ qsbStart = qsbEnd - deviceProfile.hotseatQsbWidth;
}
int qsbTop = (bottom - top - deviceProfile.hotseatQsbHeight) / 2;
int qsbBottom = qsbTop + deviceProfile.hotseatQsbHeight;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 6d45fd2..992aa4b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP;
+import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
import static com.android.quickstep.AnimatedFloat.VALUE;
import android.annotation.NonNull;
@@ -35,6 +36,7 @@
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AlphaUpdateListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -69,7 +71,8 @@
public static final int ALPHA_INDEX_NOTIFICATION_EXPANDED = 4;
public static final int ALPHA_INDEX_ASSISTANT_INVOKED = 5;
public static final int ALPHA_INDEX_IME_BUTTON_NAV = 6;
- private static final int NUM_ALPHA_CHANNELS = 7;
+ public static final int ALPHA_INDEX_SMALL_SCREEN = 7;
+ private static final int NUM_ALPHA_CHANNELS = 8;
private final TaskbarActivityContext mActivity;
private final TaskbarView mTaskbarView;
@@ -108,7 +111,9 @@
public void init(TaskbarControllers controllers) {
mControllers = controllers;
mTaskbarView.init(new TaskbarViewCallbacks());
- mTaskbarView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarSize;
+ mTaskbarView.getLayoutParams().height = isPhoneMode(mActivity.getDeviceProfile())
+ ? mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_size)
+ : mActivity.getDeviceProfile().taskbarSize;
mThemeIconsColor = ThemedIconDrawable.getColors(mTaskbarView.getContext())[0];
mTaskbarIconScaleForStash.updateValue(1f);
@@ -126,6 +131,7 @@
public void onDestroy() {
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
+ mModelCallbacks.unregisterListeners();
}
public boolean areIconsVisible() {
@@ -290,10 +296,11 @@
boolean isRtl = Utilities.isRtl(child.getResources());
float hotseatIconCenter = isRtl
? launcherDp.widthPx - hotseatPadding.right + borderSpacing
- + launcherDp.qsbWidth / 2f
- : hotseatPadding.left - borderSpacing - launcherDp.qsbWidth / 2f;
+ + launcherDp.hotseatQsbWidth / 2f
+ : hotseatPadding.left - borderSpacing - launcherDp.hotseatQsbWidth / 2f;
float childCenter = (child.getLeft() + child.getRight()) / 2f;
- float halfQsbIconWidthDiff = (launcherDp.qsbWidth - taskbarDp.iconSizePx) / 2f;
+ float halfQsbIconWidthDiff =
+ (launcherDp.hotseatQsbWidth - taskbarDp.iconSizePx) / 2f;
setter.addFloat(child, ICON_TRANSLATE_X,
isRtl ? -halfQsbIconWidthDiff : halfQsbIconWidthDiff,
hotseatIconCenter - childCenter, LINEAR);
@@ -307,7 +314,7 @@
: Interpolators.clampToProgress(LINEAR, 0.84f, 1f));
setter.addOnFrameListener(animator -> AlphaUpdateListener.updateVisibility(child));
- float qsbInsetFraction = halfQsbIconWidthDiff / launcherDp.qsbWidth;
+ float qsbInsetFraction = halfQsbIconWidthDiff / launcherDp.hotseatQsbWidth;
if (child instanceof HorizontalInsettableView) {
setter.addFloat((HorizontalInsettableView) child,
HorizontalInsettableView.HORIZONTAL_INSETS, qsbInsetFraction, 0,
@@ -384,11 +391,22 @@
"ALPHA_INDEX_RECENTS_DISABLED",
"ALPHA_INDEX_NOTIFICATION_EXPANDED",
"ALPHA_INDEX_ASSISTANT_INVOKED",
- "ALPHA_INDEX_IME_BUTTON_NAV");
+ "ALPHA_INDEX_IME_BUTTON_NAV",
+ "ALPHA_INDEX_SMALL_SCREEN");
mModelCallbacks.dumpLogs(prefix + "\t", pw);
}
+ /** Called when there's a change in running apps to update the UI. */
+ public void commitRunningAppsToUI() {
+ mModelCallbacks.commitRunningAppsToUI();
+ }
+
+ /** Call TaskbarModelCallbacks to update running apps. */
+ public void updateRunningApps() {
+ mModelCallbacks.updateRunningApps();
+ }
+
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
*/
diff --git a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
index 946873e..81acda3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
@@ -36,7 +36,10 @@
override fun draw(canvas: Canvas) {
super.draw(canvas)
- taskbarBackgroundRenderer.draw(canvas)
+ if (this@VoiceInteractionWindowController.context.isGestureNav
+ && controllers.taskbarStashController.isInAppAndNotStashed) {
+ taskbarBackgroundRenderer.draw(canvas)
+ }
}
}
separateWindowForTaskbarBackground.recreateControllers()
@@ -74,18 +77,20 @@
fadeStashedHandle.end()
}
- if (context.isGestureNav && controllers.taskbarStashController.isInAppAndNotStashed) {
- moveTaskbarBackgroundToLowerLayer()
- }
+ moveTaskbarBackgroundToAppropriateLayer()
}
/**
+ * Either:
* Hides the TaskbarDragLayer background and creates a new window to draw just that background.
+ * OR
+ * Removes the temporary window and show the TaskbarDragLayer background again.
*/
- private fun moveTaskbarBackgroundToLowerLayer() {
+ private fun moveTaskbarBackgroundToAppropriateLayer() {
val taskbarBackgroundOverride = controllers.taskbarDragLayerController
.overrideBackgroundAlpha
- if (isVoiceInteractionWindowVisible) {
+ val moveToLowerLayer = isVoiceInteractionWindowVisible
+ if (moveToLowerLayer) {
// First add the temporary window, then hide the overlapping taskbar background.
context.addWindowView(separateWindowForTaskbarBackground, separateWindowLayoutParams)
ViewRootSync.synchronizeNextDraw(separateWindowForTaskbarBackground, context.dragLayer
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
index e2f7522..a1385c4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
@@ -17,15 +17,16 @@
import static android.view.KeyEvent.ACTION_UP;
import static android.view.KeyEvent.KEYCODE_BACK;
+import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
-import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION;
-
import android.content.Context;
import android.graphics.Insets;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewTreeObserver;
+import android.view.ViewTreeObserver.OnComputeInternalInsetsListener;
import android.view.WindowInsets;
import com.android.launcher3.AbstractFloatingView;
@@ -43,13 +44,10 @@
import com.android.launcher3.taskbar.TaskbarDragController;
import com.android.launcher3.taskbar.TaskbarStashController;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.OnboardingPrefs;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo;
-import com.android.systemui.shared.system.ViewTreeObserverWrapper.OnComputeInsetsListener;
/**
* Window context for the taskbar all apps overlay.
@@ -163,7 +161,7 @@
/** Root drag layer for this context. */
private static class TaskbarAllAppsDragLayer extends
- BaseDragLayer<TaskbarAllAppsContext> implements OnComputeInsetsListener {
+ BaseDragLayer<TaskbarAllAppsContext> implements OnComputeInternalInsetsListener {
private TaskbarAllAppsDragLayer(Context context) {
super(context, null, 1);
@@ -174,14 +172,13 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- ViewTreeObserverWrapper.addOnComputeInsetsListener(
- getViewTreeObserver(), this);
+ getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
- ViewTreeObserverWrapper.removeOnComputeInsetsListener(this);
+ getViewTreeObserver().removeOnComputeInternalInsetsListener(this);
}
@Override
@@ -207,7 +204,7 @@
}
@Override
- public void onComputeInsets(InsetsInfo inoutInfo) {
+ public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo inoutInfo) {
if (mActivity.mDragController.isSystemDragInProgress()) {
inoutInfo.touchableRegion.setEmpty();
inoutInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
index c4837a0..0e62da3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
@@ -16,8 +16,7 @@
package com.android.launcher3.taskbar.allapps;
import static com.android.launcher3.LauncherState.ALL_APPS;
-import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE;
-import static com.android.systemui.animation.Interpolators.EMPHASIZED_ACCELERATE;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import android.animation.PropertyValuesHolder;
import android.content.Context;
@@ -60,7 +59,7 @@
if (animate) {
mOpenCloseAnimator.setValues(
PropertyValuesHolder.ofFloat(TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED));
- mOpenCloseAnimator.setInterpolator(AGGRESSIVE_EASE);
+ mOpenCloseAnimator.setInterpolator(EMPHASIZED);
mOpenCloseAnimator.setDuration(
ALL_APPS.getTransitionDuration(mActivityContext, true /* isToState */)).start();
} else {
@@ -87,7 +86,7 @@
@Override
protected Interpolator getIdleInterpolator() {
- return EMPHASIZED_ACCELERATE;
+ return EMPHASIZED;
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index 7166a3e..8fb7030 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -23,26 +23,32 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.quickstep.views.FloatingTaskView.PRIMARY_TRANSLATE_OFFSCREEN;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
-import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
+import static com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA;
+import android.graphics.Rect;
+import android.graphics.RectF;
import android.util.FloatProperty;
-import android.util.Log;
+import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
+import com.android.launcher3.Utilities;
import com.android.launcher3.anim.PendingAnimation;
+import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
+import com.android.quickstep.views.FloatingTaskView;
import com.android.quickstep.views.RecentsView;
/**
@@ -54,9 +60,9 @@
public abstract class BaseRecentsViewStateController<T extends RecentsView>
implements StateHandler<LauncherState> {
protected final T mRecentsView;
- protected final BaseQuickstepLauncher mLauncher;
+ protected final QuickstepLauncher mLauncher;
- public BaseRecentsViewStateController(@NonNull BaseQuickstepLauncher launcher) {
+ public BaseRecentsViewStateController(@NonNull QuickstepLauncher launcher) {
mLauncher = launcher;
mRecentsView = launcher.getOverviewPanel();
}
@@ -68,25 +74,25 @@
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, scaleAndOffset[1]);
TASK_SECONDARY_TRANSLATION.set(mRecentsView, 0f);
- float recentsAlpha = state.overviewUi ? 1f : 0;
- Log.d(BAD_STATE, "BaseRecentsViewStateController setState state=" + state
- + ", alpha=" + recentsAlpha);
- getContentAlphaProperty().set(mRecentsView, recentsAlpha);
+ getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness());
RECENTS_GRID_PROGRESS.set(mRecentsView,
state.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f);
- OVERVIEW_PROGRESS.set(mRecentsView, state == LauncherState.OVERVIEW ? 1f : 0f);
+ TASK_THUMBNAIL_SPLASH_ALPHA.set(mRecentsView, state.showTaskThumbnailSplash() ? 1f : 0f);
}
@Override
public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
PendingAnimation builder) {
- Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimation state=" + toState
- + ", config.skipOverview=" + config.hasAnimationFlag(SKIP_OVERVIEW));
if (config.hasAnimationFlag(SKIP_OVERVIEW)) {
return;
}
setStateWithAnimationInternal(toState, config, builder);
+ builder.addEndListener(success -> {
+ if (!success) {
+ mRecentsView.reset();
+ }
+ });
}
/**
@@ -106,23 +112,70 @@
setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f,
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
- float recentsAlpha = toState.overviewUi ? 1 : 0;
- Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimationInternal toState="
- + toState + ", alpha=" + recentsAlpha);
- setter.setFloat(mRecentsView, getContentAlphaProperty(), recentsAlpha,
+ if (mRecentsView.isSplitSelectionActive()) {
+ // TODO (b/238651489): Refactor state management to avoid need for double check
+ FloatingTaskView floatingTask = mRecentsView.getFirstFloatingTaskView();
+ if (floatingTask != null) {
+ // We are in split selection state currently, transitioning to another state
+ DragLayer dragLayer = mLauncher.getDragLayer();
+ RectF onScreenRectF = new RectF();
+ Utilities.getBoundsForViewInDragLayer(mLauncher.getDragLayer(), floatingTask,
+ new Rect(0, 0, floatingTask.getWidth(), floatingTask.getHeight()),
+ false, null, onScreenRectF);
+ // Get the part of the floatingTask that intersects with the DragLayer (i.e. the
+ // on-screen portion)
+ onScreenRectF.intersect(
+ dragLayer.getLeft(),
+ dragLayer.getTop(),
+ dragLayer.getRight(),
+ dragLayer.getBottom()
+ );
+
+ setter.setFloat(
+ mRecentsView.getFirstFloatingTaskView(),
+ PRIMARY_TRANSLATE_OFFSCREEN,
+ mRecentsView.getPagedOrientationHandler()
+ .getFloatingTaskOffscreenTranslationTarget(
+ floatingTask,
+ onScreenRectF,
+ floatingTask.getStagePosition(),
+ mLauncher.getDeviceProfile()
+ ),
+ config.getInterpolator(
+ ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ LINEAR
+ ));
+ setter.setViewAlpha(
+ mRecentsView.getSplitInstructionsView(),
+ 0,
+ config.getInterpolator(
+ ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
+ LINEAR
+ )
+ );
+ }
+ }
+
+ setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0,
config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
setter.setFloat(
mRecentsView, getTaskModalnessProperty(),
toState.getOverviewModalness(),
config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR));
- boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile());
- setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f,
- showAsGrid ? INSTANT : FINAL_FRAME);
- boolean toOverview = toState == LauncherState.OVERVIEW;
- setter.setFloat(mRecentsView, OVERVIEW_PROGRESS, toOverview ? 1f : 0f,
- toOverview ? INSTANT : FINAL_FRAME);
+ LauncherState fromState = mLauncher.getStateManager().getState();
+ setter.setFloat(mRecentsView, TASK_THUMBNAIL_SPLASH_ALPHA,
+ toState.showTaskThumbnailSplash() ? 1f : 0f,
+ !toState.showTaskThumbnailSplash() && fromState == LauncherState.QUICK_SWITCH
+ ? LINEAR : INSTANT);
+
+ boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile());
+ Interpolator gridProgressInterpolator = showAsGrid
+ ? fromState == LauncherState.QUICK_SWITCH ? LINEAR : INSTANT
+ : FINAL_FRAME;
+ setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f,
+ gridProgressInterpolator);
}
abstract FloatProperty getTaskModalnessProperty();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 4bb4343..1316ddd 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -23,41 +23,83 @@
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
+import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
+import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_WIDGET_APP_START;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_WIDGET_PICKER_DEPTH;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
+import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
+import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
+import static com.android.launcher3.taskbar.LauncherTaskbarUIController.ALL_APPS_PAGE_PROGRESS_INDEX;
+import static com.android.launcher3.taskbar.LauncherTaskbarUIController.MINUS_ONE_PAGE_PROGRESS_INDEX;
+import static com.android.launcher3.taskbar.LauncherTaskbarUIController.WIDGETS_PAGE_PROGRESS_INDEX;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
+import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
+import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
+import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import static com.android.quickstep.util.BaseDepthController.WIDGET_DEPTH;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
+import android.animation.AnimatorSet;
+import android.animation.ValueAnimator;
+import android.app.ActivityManager;
+import android.app.ActivityOptions;
+import android.content.Context;
import android.content.Intent;
+import android.content.IntentSender;
import android.content.SharedPreferences;
import android.content.res.Configuration;
+import android.hardware.SensorManager;
+import android.hardware.devicestate.DeviceStateManager;
+import android.os.Bundle;
+import android.os.CancellationSignal;
+import android.os.IBinder;
+import android.os.SystemProperties;
+import android.view.Display;
import android.view.HapticFeedbackConstants;
import android.view.View;
+import android.window.SplashScreen;
-import com.android.launcher3.BaseQuickstepLauncher;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepAccessibilityDelegate;
+import com.android.launcher3.QuickstepTransitionManager;
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.appprediction.PredictionRowView;
+import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
+import com.android.launcher3.model.WellbeingModel;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.popup.SystemShortcut;
+import com.android.launcher3.proxy.ProxyActivityStarter;
+import com.android.launcher3.proxy.StartActivityParams;
+import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager.AtomicAnimationFactory;
+import com.android.launcher3.statemanager.StateManager.StateHandler;
+import com.android.launcher3.taskbar.LauncherTaskbarUIController;
+import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.uioverrides.states.QuickstepAtomicAnimationFactory;
import com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.NoButtonNavbarToOverviewTouchController;
@@ -68,41 +110,98 @@
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController;
+import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.IntSet;
+import com.android.launcher3.util.NavigationMode;
+import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.util.PendingRequestArgs;
+import com.android.launcher3.util.PendingSplitSelectInfo;
+import com.android.launcher3.util.RunnableList;
+import com.android.launcher3.util.SafeCloseable;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.TouchController;
-import com.android.launcher3.util.UiThreadHelper;
-import com.android.launcher3.util.UiThreadHelper.AsyncCommand;
import com.android.launcher3.widget.LauncherAppWidgetHost;
+import com.android.quickstep.OverviewCommandHelper;
+import com.android.quickstep.RecentsModel;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
+import com.android.quickstep.TouchInteractionService.TISBinder;
+import com.android.quickstep.util.LauncherUnfoldAnimationController;
+import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.QuickstepOnboardingPrefs;
+import com.android.quickstep.util.RemoteAnimationProvider;
+import com.android.quickstep.util.RemoteFadeOutAnimationListener;
+import com.android.quickstep.util.SplitSelectStateController;
+import com.android.quickstep.util.TISBindHelper;
+import com.android.quickstep.util.ViewCapture;
+import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
+import com.android.systemui.shared.system.ActivityManagerWrapper;
+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.ResourceUnfoldTransitionConfig;
+import com.android.systemui.unfold.config.UnfoldTransitionConfig;
+import com.android.systemui.unfold.system.ActivityManagerActivityTypeProvider;
+import com.android.systemui.unfold.system.DeviceStateManagerFoldProvider;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
import java.util.stream.Stream;
-public class QuickstepLauncher extends BaseQuickstepLauncher {
+public class QuickstepLauncher extends Launcher {
+
+ public static final boolean ENABLE_PIP_KEEP_CLEAR_ALGORITHM =
+ SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", false);
public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false;
- /**
- * Reusable command for applying the shelf height on the background thread.
- */
- public static final AsyncCommand SET_SHELF_HEIGHT = (context, arg1, arg2) ->
- SystemUiProxy.INSTANCE.get(context).setShelfHeight(arg1 != 0, arg2);
private FixedContainerItems mAllAppsPredictions;
private HotseatPredictionController mHotseatPredictionController;
+ private DepthController mDepthController;
+ private QuickstepTransitionManager mAppTransitionManager;
+ private OverviewActionsView mActionsView;
+ private TISBindHelper mTISBindHelper;
+ private @Nullable TaskbarManager mTaskbarManager;
+ private @Nullable OverviewCommandHelper mOverviewCommandHelper;
+ private @Nullable LauncherTaskbarUIController mTaskbarUIController;
+ // Will be updated when dragging from taskbar.
+ private @Nullable DragOptions mNextWorkspaceDragOptions = null;
+ private @Nullable UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
+ private @Nullable LauncherUnfoldAnimationController mLauncherUnfoldAnimationController;
+ /**
+ * If Launcher restarted while in the middle of an Overview split select, it needs this data to
+ * recover. In all other cases this will remain null.
+ */
+ private PendingSplitSelectInfo mPendingSplitSelectInfo = null;
+
+ private SafeCloseable mViewCapture;
@Override
protected void setupViews() {
super.setupViews();
+
+ mActionsView = findViewById(R.id.overview_actions_view);
+ RecentsView overviewPanel = (RecentsView) getOverviewPanel();
+ SplitSelectStateController controller =
+ new SplitSelectStateController(this, mHandler, getStateManager(),
+ getDepthController(), getStatsLogManager());
+ overviewPanel.init(mActionsView, controller);
+ mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
+ mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));
+
+ mAppTransitionManager = new QuickstepTransitionManager(this);
+ mAppTransitionManager.registerRemoteAnimations();
+ mAppTransitionManager.registerRemoteTransitions();
+
+ mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
+ mDepthController = new DepthController(this);
mHotseatPredictionController = new HotseatPredictionController(this);
}
@@ -184,6 +283,16 @@
@Override
protected void onActivityFlagsChanged(int changeBits) {
+ if ((changeBits & ACTIVITY_STATE_STARTED) != 0) {
+ mDepthController.setActivityStarted(isStarted());
+ }
+
+ if ((changeBits & ACTIVITY_STATE_RESUMED) != 0) {
+ if (mTaskbarUIController != null) {
+ mTaskbarUIController.onLauncherResumedOrPaused(hasBeenResumed());
+ }
+ }
+
super.onActivityFlagsChanged(changeBits);
if ((changeBits & (ACTIVITY_STATE_DEFERRED_RESUMED | ACTIVITY_STATE_STARTED
| ACTIVITY_STATE_USER_ACTIVE | ACTIVITY_STATE_TRANSITION_ACTIVE)) != 0) {
@@ -204,8 +313,22 @@
@Override
public Stream<SystemShortcut.Factory> getSupportedShortcuts() {
+ Stream<SystemShortcut.Factory> base = Stream.of(WellbeingModel.SHORTCUT_FACTORY);
+ if (ENABLE_SPLIT_FROM_WORKSPACE.get() && mDeviceProfile.isTablet) {
+ RecentsView recentsView = getOverviewPanel();
+ // TODO: Pull it out of PagedOrentationHandler for split from workspace.
+ List<SplitPositionOption> positions =
+ recentsView.getPagedOrientationHandler().getSplitPositionOptions(
+ mDeviceProfile);
+ List<SystemShortcut.Factory<QuickstepLauncher>> splitShortcuts = new ArrayList<>();
+ for (SplitPositionOption position : positions) {
+ splitShortcuts.add(getSplitSelectShortcutByPosition(position));
+ }
+ base = Stream.concat(base, splitShortcuts.stream());
+ }
return Stream.concat(
- Stream.of(mHotseatPredictionController), super.getSupportedShortcuts());
+ Stream.of(mHotseatPredictionController),
+ Stream.concat(base, super.getSupportedShortcuts()));
}
/**
@@ -213,16 +336,17 @@
*/
private void onStateOrResumeChanging(boolean inTransition) {
LauncherState state = getStateManager().getState();
- boolean started = ((getActivityFlags() & ACTIVITY_STATE_STARTED)) != 0;
- if (started) {
- DeviceProfile profile = getDeviceProfile();
- boolean willUserBeActive =
- (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0;
- boolean visible = (state == NORMAL || state == OVERVIEW)
- && (willUserBeActive || isUserActive())
- && !profile.isVerticalBarLayout();
- UiThreadHelper.runAsyncCommand(this, SET_SHELF_HEIGHT, visible ? 1 : 0,
- profile.hotseatBarSizePx);
+ if (!ENABLE_PIP_KEEP_CLEAR_ALGORITHM) {
+ boolean started = ((getActivityFlags() & ACTIVITY_STATE_STARTED)) != 0;
+ if (started) {
+ DeviceProfile profile = getDeviceProfile();
+ boolean willUserBeActive =
+ (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0;
+ boolean visible = (state == NORMAL || state == OVERVIEW)
+ && (willUserBeActive || isUserActive())
+ && !profile.isVerticalBarLayout();
+ SystemUiProxy.INSTANCE.get(this).setShelfHeight(visible, profile.hotseatBarSizePx);
+ }
}
if (state == NORMAL && !inTransition) {
((RecentsView) getOverviewPanel()).setSwipeDownShouldLaunchApp(false);
@@ -252,13 +376,29 @@
@Override
public void onDestroy() {
+ mAppTransitionManager.onActivityDestroyed();
+ if (mUnfoldTransitionProgressProvider != null) {
+ mUnfoldTransitionProgressProvider.destroy();
+ }
+
+ mTISBindHelper.onDestroy();
+ if (mTaskbarManager != null) {
+ mTaskbarManager.clearActivity(this);
+ }
+
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onDestroy();
+ }
+
super.onDestroy();
mHotseatPredictionController.destroy();
+ mViewCapture.close();
}
@Override
public void onStateSetEnd(LauncherState state) {
super.onStateSetEnd(state);
+ handlePendingActivityRequest();
switch (state.ordinal) {
case HINT_STATE_ORDINAL: {
@@ -339,12 +479,459 @@
protected LauncherAppWidgetHost createAppWidgetHost() {
LauncherAppWidgetHost appWidgetHost = super.createAppWidgetHost();
- if (ENABLE_QUICKSTEP_WIDGET_APP_START.get()) {
- appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this));
- }
+ appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this));
return appWidgetHost;
}
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (savedInstanceState != null) {
+ mPendingSplitSelectInfo = ObjectWrapper.unwrap(
+ savedInstanceState.getIBinder(PENDING_SPLIT_SELECT_INFO));
+ }
+ addMultiWindowModeChangedListener(mDepthController);
+ initUnfoldTransitionProgressProvider();
+ mViewCapture = ViewCapture.INSTANCE.get(this).startCapture(getWindow());
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onResume();
+ }
+ }
+
+ @Override
+ protected void onPause() {
+ if (mLauncherUnfoldAnimationController != null) {
+ mLauncherUnfoldAnimationController.onPause();
+ }
+
+ super.onPause();
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+
+ if (mOverviewCommandHelper != null) {
+ mOverviewCommandHelper.clearPendingCommands();
+ }
+ }
+
+ public QuickstepTransitionManager getAppTransitionManager() {
+ return mAppTransitionManager;
+ }
+
+ @Override
+ public void onEnterAnimationComplete() {
+ super.onEnterAnimationComplete();
+ // After the transition to home, enable the high-res thumbnail loader if it wasn't enabled
+ // as a part of quickstep, so that high-res thumbnails can load the next time we enter
+ // overview
+ RecentsModel.INSTANCE.get(this).getThumbnailCache()
+ .getHighResLoadingState().setVisible(true);
+ }
+
+ @Override
+ protected void handleGestureContract(Intent intent) {
+ if (FeatureFlags.SEPARATE_RECENTS_ACTIVITY.get()) {
+ super.handleGestureContract(intent);
+ }
+ }
+
+ @Override
+ public void onTrimMemory(int level) {
+ super.onTrimMemory(level);
+ RecentsModel.INSTANCE.get(this).onTrimMemory(level);
+ }
+
+ @Override
+ public void onUiChangedWhileSleeping() {
+ // Remove the snapshot because the content view may have obvious changes.
+ UI_HELPER_EXECUTOR.execute(
+ () -> ActivityManagerWrapper.getInstance().invalidateHomeTaskSnapshot(this));
+ }
+
+ @Override
+ protected void onScreenOff() {
+ super.onScreenOff();
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ RecentsView recentsView = getOverviewPanel();
+ recentsView.finishRecentsAnimation(true /* toRecents */, null);
+ }
+ }
+
+ /**
+ * {@code LauncherOverlayCallbacks} scroll amount.
+ * Indicates transition progress to -1 screen.
+ * @param progress From 0 to 1.
+ */
+ @Override
+ public void onScrollChanged(float progress) {
+ super.onScrollChanged(progress);
+ onTaskbarInAppDisplayProgressUpdate(progress, MINUS_ONE_PAGE_PROGRESS_INDEX);
+ }
+
+ @Override
+ public void onAllAppsTransition(float progress) {
+ super.onAllAppsTransition(progress);
+ onTaskbarInAppDisplayProgressUpdate(progress, ALL_APPS_PAGE_PROGRESS_INDEX);
+ }
+
+ @Override
+ public void onWidgetsTransition(float progress) {
+ super.onWidgetsTransition(progress);
+ onTaskbarInAppDisplayProgressUpdate(progress, WIDGETS_PAGE_PROGRESS_INDEX);
+ // Change of wallpaper depth in widget picker is disabled for tests as it causes flakiness
+ // on very slow cuttlefish devices.
+ if (ENABLE_WIDGET_PICKER_DEPTH.get() && !Utilities.IS_RUNNING_IN_TEST_HARNESS) {
+ WIDGET_DEPTH.set(getDepthController(),
+ Utilities.mapToRange(progress, 0f, 1f, 0f, getDeviceProfile().bottomSheetDepth,
+ EMPHASIZED));
+ }
+ }
+
+ private void onTaskbarInAppDisplayProgressUpdate(float progress, int flag) {
+ if (mTaskbarManager == null
+ || mTaskbarManager.getCurrentActivityContext() == null
+ || mTaskbarUIController == null) {
+ return;
+ }
+ mTaskbarUIController.onTaskbarInAppDisplayProgressUpdate(progress, flag);
+ }
+
+ @Override
+ public void startIntentSenderForResult(IntentSender intent, int requestCode,
+ Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) {
+ if (requestCode != -1) {
+ mPendingActivityRequestCode = requestCode;
+ StartActivityParams params = new StartActivityParams(this, requestCode);
+ params.intentSender = intent;
+ params.fillInIntent = fillInIntent;
+ params.flagsMask = flagsMask;
+ params.flagsValues = flagsValues;
+ params.extraFlags = extraFlags;
+ params.options = options;
+ startActivity(ProxyActivityStarter.getLaunchIntent(this, params));
+ } else {
+ super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask,
+ flagsValues, extraFlags, options);
+ }
+ }
+
+ @Override
+ public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
+ if (requestCode != -1) {
+ mPendingActivityRequestCode = requestCode;
+ StartActivityParams params = new StartActivityParams(this, requestCode);
+ params.intent = intent;
+ params.options = options;
+ startActivity(ProxyActivityStarter.getLaunchIntent(this, params));
+ } else {
+ super.startActivityForResult(intent, requestCode, options);
+ }
+ }
+
+ @Override
+ protected void onDeferredResumed() {
+ super.onDeferredResumed();
+ handlePendingActivityRequest();
+ }
+
+ private void handlePendingActivityRequest() {
+ if (mPendingActivityRequestCode != -1 && isInState(NORMAL)
+ && ((getActivityFlags() & ACTIVITY_STATE_DEFERRED_RESUMED) != 0)) {
+ // Remove any active ProxyActivityStarter task and send RESULT_CANCELED to Launcher.
+ onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
+ // ProxyActivityStarter is started with clear task to reset the task after which it
+ // removes the task itself.
+ startActivity(ProxyActivityStarter.getLaunchIntent(this, null));
+ }
+ }
+
+ private void onTISConnected(TISBinder binder) {
+ mTaskbarManager = binder.getTaskbarManager();
+ mTaskbarManager.setActivity(this);
+ mOverviewCommandHelper = binder.getOverviewCommandHelper();
+ }
+
+ @Override
+ public void runOnBindToTouchInteractionService(Runnable r) {
+ mTISBindHelper.runOnBindToTouchInteractionService(r);
+ }
+
+ private void initUnfoldTransitionProgressProvider() {
+ final UnfoldTransitionConfig config = new ResourceUnfoldTransitionConfig();
+ if (config.isEnabled()) {
+ mUnfoldTransitionProgressProvider =
+ UnfoldTransitionFactory.createUnfoldTransitionProgressProvider(
+ /* context= */ this,
+ config,
+ ProxyScreenStatusProvider.INSTANCE,
+ new DeviceStateManagerFoldProvider(
+ getSystemService(DeviceStateManager.class), /* context */this),
+ new ActivityManagerActivityTypeProvider(
+ getSystemService(ActivityManager.class)),
+ getSystemService(SensorManager.class),
+ getMainThreadHandler(),
+ getMainExecutor(),
+ /* backgroundExecutor= */ THREAD_POOL_EXECUTOR,
+ /* tracingTagPrefix= */ "launcher"
+ );
+
+ mLauncherUnfoldAnimationController = new LauncherUnfoldAnimationController(
+ this,
+ getWindowManager(),
+ mUnfoldTransitionProgressProvider
+ );
+ }
+ }
+
+ public void setTaskbarUIController(LauncherTaskbarUIController taskbarUIController) {
+ mTaskbarUIController = taskbarUIController;
+ }
+
+ public @Nullable LauncherTaskbarUIController getTaskbarUIController() {
+ return mTaskbarUIController;
+ }
+
+ public <T extends OverviewActionsView> T getActionsView() {
+ return (T) mActionsView;
+ }
+
+ @Override
+ protected void closeOpenViews(boolean animate) {
+ super.closeOpenViews(animate);
+ TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
+ }
+
+ @Override
+ protected void collectStateHandlers(List<StateHandler> out) {
+ super.collectStateHandlers(out);
+ out.add(getDepthController());
+ out.add(new RecentsViewStateController(this));
+ }
+
+ public DepthController getDepthController() {
+ return mDepthController;
+ }
+
+ @Nullable
+ public UnfoldTransitionProgressProvider getUnfoldTransitionProgressProvider() {
+ return mUnfoldTransitionProgressProvider;
+ }
+
+ @Override
+ public boolean supportsAdaptiveIconAnimation(View clickedView) {
+ return mAppTransitionManager.hasControlRemoteAppTransitionPermission();
+ }
+
+ @Override
+ public DragOptions getDefaultWorkspaceDragOptions() {
+ if (mNextWorkspaceDragOptions != null) {
+ DragOptions options = mNextWorkspaceDragOptions;
+ mNextWorkspaceDragOptions = null;
+ return options;
+ }
+ return super.getDefaultWorkspaceDragOptions();
+ }
+
+ public void setNextWorkspaceDragOptions(DragOptions dragOptions) {
+ mNextWorkspaceDragOptions = dragOptions;
+ }
+
+ @Override
+ public void useFadeOutAnimationForLauncherStart(CancellationSignal signal) {
+ QuickstepTransitionManager appTransitionManager = getAppTransitionManager();
+ appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() {
+ @Override
+ public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets,
+ RemoteAnimationTargetCompat[] wallpaperTargets) {
+
+ // On the first call clear the reference.
+ signal.cancel();
+
+ ValueAnimator fadeAnimation = ValueAnimator.ofFloat(1, 0);
+ fadeAnimation.addUpdateListener(new RemoteFadeOutAnimationListener(appTargets,
+ wallpaperTargets));
+ AnimatorSet anim = new AnimatorSet();
+ anim.play(fadeAnimation);
+ return anim;
+ }
+ }, signal);
+ }
+
+ @Override
+ public float[] getNormalOverviewScaleAndOffset() {
+ return DisplayController.getNavigationMode(this).hasGestures
+ ? new float[] {1, 1} : new float[] {1.1f, NO_OFFSET};
+ }
+
+ @Override
+ public void finishBindingItems(IntSet pagesBoundFirst) {
+ super.finishBindingItems(pagesBoundFirst);
+ // Instantiate and initialize WellbeingModel now that its loading won't interfere with
+ // populating workspace.
+ // TODO: Find a better place for this
+ WellbeingModel.INSTANCE.get(this);
+ }
+
+ @Override
+ public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
+ pendingTasks.add(() -> {
+ // This is added in pending task as we need to wait for views to be positioned
+ // correctly before registering them for the animation.
+ if (mLauncherUnfoldAnimationController != null) {
+ // This is needed in case items are rebound while the unfold animation is in
+ // progress.
+ mLauncherUnfoldAnimationController.updateRegisteredViewsIfNeeded();
+ }
+ });
+ super.onInitialBindComplete(boundPages, pendingTasks);
+ }
+
+ @Override
+ public ActivityOptionsWrapper getActivityLaunchOptions(View v, @Nullable ItemInfo item) {
+ ActivityOptionsWrapper activityOptions =
+ mAppTransitionManager.hasControlRemoteAppTransitionPermission()
+ ? mAppTransitionManager.getActivityLaunchOptions(v)
+ : super.getActivityLaunchOptions(v, item);
+ if (mLastTouchUpTime > 0) {
+ activityOptions.options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_LAUNCHER,
+ mLastTouchUpTime);
+ }
+ activityOptions.options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
+ activityOptions.options.setLaunchDisplayId(
+ (v != null && v.getDisplay() != null) ? v.getDisplay().getDisplayId()
+ : Display.DEFAULT_DISPLAY);
+ addLaunchCookie(item, activityOptions.options);
+ return activityOptions;
+ }
+
+ /**
+ * Adds a new launch cookie for the activity launch if supported.
+ *
+ * @param info the item info for the launch
+ * @param opts the options to set the launchCookie on.
+ */
+ public void addLaunchCookie(ItemInfo info, ActivityOptions opts) {
+ IBinder launchCookie = getLaunchCookie(info);
+ if (launchCookie != null) {
+ opts.setLaunchCookie(launchCookie);
+ }
+ }
+
+ /**
+ * Return a new launch cookie for the activity launch if supported.
+ *
+ * @param info the item info for the launch
+ */
+ public IBinder getLaunchCookie(ItemInfo info) {
+ if (info == null) {
+ return null;
+ }
+ switch (info.container) {
+ case Favorites.CONTAINER_DESKTOP:
+ case Favorites.CONTAINER_HOTSEAT:
+ // Fall through and continue it's on the workspace (we don't support swiping back
+ // to other containers like all apps or the hotseat predictions (which can change)
+ break;
+ default:
+ if (info.container >= 0) {
+ // Also allow swiping to folders
+ break;
+ }
+ // Reset any existing launch cookies associated with the cookie
+ return ObjectWrapper.wrap(NO_MATCHING_ID);
+ }
+ switch (info.itemType) {
+ case Favorites.ITEM_TYPE_APPLICATION:
+ case Favorites.ITEM_TYPE_SHORTCUT:
+ case Favorites.ITEM_TYPE_DEEP_SHORTCUT:
+ case Favorites.ITEM_TYPE_APPWIDGET:
+ // Fall through and continue if it's an app, shortcut, or widget
+ break;
+ default:
+ // Reset any existing launch cookies associated with the cookie
+ return ObjectWrapper.wrap(NO_MATCHING_ID);
+ }
+ return ObjectWrapper.wrap(new Integer(info.id));
+ }
+
+ public void setHintUserWillBeActive() {
+ addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
+ }
+
+ @Override
+ public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
+ super.onDisplayInfoChanged(context, info, flags);
+ // When changing screens, force moving to rest state similar to StatefulActivity.onStop, as
+ // StatefulActivity isn't called consistently.
+ if ((flags & CHANGE_ACTIVE_SCREEN) != 0) {
+ getStateManager().moveToRestState();
+ }
+
+ if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
+ getDragLayer().recreateControllers();
+ if (mActionsView != null) {
+ mActionsView.updateVerticalMargin(info.navigationMode);
+ }
+ }
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
+ // If Launcher shuts downs during split select, we save some extra data in the recovery
+ // bundle to allow graceful recovery. The normal LauncherState restore mechanism doesn't
+ // work in this case because restoring straight to OverviewSplitSelect without staging data,
+ // or before the tasks themselves have loaded into Overview, causes a crash. So we tell
+ // Launcher to first restore into Overview state, wait for the relevant tasks and icons to
+ // load in, and then proceed to OverviewSplitSelect.
+ if (isInState(OVERVIEW_SPLIT_SELECT)) {
+ SplitSelectStateController splitSelectStateController =
+ ((RecentsView) getOverviewPanel()).getSplitPlaceholder();
+ // Launcher will restart in Overview and then transition to OverviewSplitSelect.
+ outState.putIBinder(PENDING_SPLIT_SELECT_INFO, ObjectWrapper.wrap(
+ new PendingSplitSelectInfo(
+ splitSelectStateController.getInitialTaskId(),
+ splitSelectStateController.getActiveSplitStagePosition(),
+ splitSelectStateController.getSplitEvent())
+ ));
+ outState.putInt(RUNTIME_STATE, OVERVIEW.ordinal);
+ }
+ }
+
+ /**
+ * When Launcher restarts, it sometimes needs to recover to a split selection state.
+ * This function checks if such a recovery is needed.
+ * @return a boolean representing whether the launcher is waiting to recover to
+ * OverviewSplitSelect state.
+ */
+ public boolean hasPendingSplitSelectInfo() {
+ return mPendingSplitSelectInfo != null;
+ }
+
+ /**
+ * See {@link #hasPendingSplitSelectInfo()}
+ */
+ public @Nullable PendingSplitSelectInfo getPendingSplitSelectInfo() {
+ return mPendingSplitSelectInfo;
+ }
+
+ /**
+ * When the launcher has successfully recovered to OverviewSplitSelect state, this function
+ * deletes the recovery data, returning it to a null state.
+ */
+ public void finishSplitSelectRecovery() {
+ mPendingSplitSelectInfo = null;
+ }
+
private static final class LauncherTaskViewController extends
TaskViewTouchController<Launcher> {
@@ -371,6 +958,9 @@
@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);
+ }
RecentsView recentsView = getOverviewPanel();
writer.println("\nQuickstepLauncher:");
writer.println(prefix + "\tmOrientationState: " + (recentsView == null ? "recentsNull" :
diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index 00a98c0..0723f8a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -27,15 +27,14 @@
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_SPLIT_TRANSLATION;
import static com.android.quickstep.views.TaskView.FLAG_UPDATE_ALL;
+import android.animation.AnimatorSet;
import android.annotation.TargetApi;
import android.os.Build;
import android.util.FloatProperty;
import android.util.Pair;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.PendingAnimation;
@@ -55,7 +54,7 @@
public final class RecentsViewStateController extends
BaseRecentsViewStateController<LauncherRecentsView> {
- public RecentsViewStateController(BaseQuickstepLauncher launcher) {
+ public RecentsViewStateController(QuickstepLauncher launcher) {
super(launcher);
}
@@ -72,7 +71,10 @@
// DepthController to prevent optimizations which might occlude the layers behind
mLauncher.getDepthController().setHasContentBehindLauncher(state.overviewUi);
- handleSplitSelectionState(state, null);
+ PendingAnimation builder =
+ new PendingAnimation(state.getTransitionDuration(mLauncher, true));
+
+ handleSplitSelectionState(state, builder, /* animate */false);
}
@Override
@@ -93,7 +95,7 @@
builder.addListener(AnimatorListeners.forSuccessCallback(() ->
mLauncher.getDepthController().setHasContentBehindLauncher(toState.overviewUi)));
- handleSplitSelectionState(toState, builder);
+ handleSplitSelectionState(toState, builder, /* animate */true);
setAlphas(builder, config, toState);
builder.setFloat(mRecentsView, FULLSCREEN_PROGRESS,
@@ -106,8 +108,14 @@
* will add animations to builder.
*/
private void handleSplitSelectionState(@NonNull LauncherState toState,
- @Nullable PendingAnimation builder) {
- boolean animate = builder != null;
+ @NonNull PendingAnimation builder, boolean animate) {
+ if (toState != OVERVIEW_SPLIT_SELECT) {
+ // Not going to split, nothing to do but ensure taskviews are at correct offset
+ mRecentsView.resetSplitPrimaryScrollOffset();
+ return;
+ }
+
+ // Create transition animations to split select
PagedOrientationHandler orientationHandler =
((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
Pair<FloatProperty, FloatProperty> taskViewsFloat =
@@ -115,25 +123,20 @@
TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION,
mLauncher.getDeviceProfile());
- if (toState == OVERVIEW_SPLIT_SELECT) {
- // Animation to "dismiss" selected taskView
- PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation(
- toState.getTransitionDuration(mLauncher, true /* isToState */));
- // Add properties to shift remaining taskViews to get out of placeholder view
- splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first,
- toState.getSplitSelectTranslation(mLauncher), LINEAR);
- splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR);
+ mRecentsView.createSplitSelectInitAnimation(builder,
+ toState.getTransitionDuration(mLauncher, true /* isToState */));
+ // Add properties to shift remaining taskViews to get out of placeholder view
+ builder.setFloat(mRecentsView, taskViewsFloat.first,
+ toState.getSplitSelectTranslation(mLauncher), LINEAR);
+ builder.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR);
- if (!animate) {
- splitSelectInitAnimation.buildAnim().start();
- } else {
- builder.add(splitSelectInitAnimation.buildAnim());
- }
-
- mRecentsView.applySplitPrimaryScrollOffset();
- } else {
- mRecentsView.resetSplitPrimaryScrollOffset();
+ if (!animate) {
+ AnimatorSet as = builder.buildAnim();
+ as.start();
+ as.end();
}
+
+ mRecentsView.applySplitPrimaryScrollOffset();
}
private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config,
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
index 9f2efc4..fd184c6 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
@@ -20,6 +20,7 @@
import android.content.Context;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -41,9 +42,9 @@
@Override
public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
- return !context.getDeviceProfile().isTablet && isToState
- ? 600
- : isToState ? 500 : 300;
+ return isToState
+ ? context.getDeviceProfile().allAppsOpenDuration
+ : context.getDeviceProfile().allAppsCloseDuration;
}
@Override
@@ -77,10 +78,15 @@
}
@Override
- protected float getDepthUnchecked(Context context) {
- // The scrim fades in at approximately 50% of the swipe gesture.
- // This means that the depth should be greater than 1, in order to fully zoom out.
- return 2f;
+ protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
+ float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) {
+ if (context.getDeviceProfile().isTablet) {
+ return context.getDeviceProfile().bottomSheetDepth;
+ } else {
+ // The scrim fades in at approximately 50% of the swipe gesture.
+ // This means that the depth should be greater than 1, in order to fully zoom out.
+ return 2f;
+ }
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index b733007..4150d40 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -16,6 +16,7 @@
package com.android.launcher3.uioverrides.states;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
+import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import android.content.Context;
import android.graphics.Color;
@@ -83,6 +84,11 @@
}
@Override
+ public boolean showTaskThumbnailSplash() {
+ return true;
+ }
+
+ @Override
protected float getDepthUnchecked(Context context) {
return 1;
}
@@ -96,6 +102,12 @@
return Color.TRANSPARENT;
}
+ @Override
+ public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
+ if (ENABLE_SHELL_TRANSITIONS) return false;
+ return super.isTaskbarAlignedWithHotseat(launcher);
+ }
+
public static float[] getOverviewScaleAndOffsetForBackgroundState(
BaseDraggingActivity activity) {
return new float[] {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index c4c9038..6f07568 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -37,6 +37,10 @@
*/
public class OverviewState extends LauncherState {
+ private static final int OVERVIEW_SLIDE_IN_DURATION = 380;
+ private static final int OVERVIEW_POP_IN_DURATION = 250;
+ private static final int OVERVIEW_EXIT_DURATION = 250;
+
protected static final Rect sTempRect = new Rect();
private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
@@ -57,8 +61,15 @@
@Override
public int getTransitionDuration(Context context, boolean isToState) {
- // In gesture modes, overview comes in all the way from the side, so give it more time.
- return DisplayController.getNavigationMode(context).hasGestures ? 380 : 250;
+ if (isToState) {
+ // In gesture modes, overview comes in all the way from the side, so give it more time.
+ return DisplayController.getNavigationMode(context).hasGestures
+ ? OVERVIEW_SLIDE_IN_DURATION
+ : OVERVIEW_POP_IN_DURATION;
+ } else {
+ // When exiting Overview, exit quickly.
+ return OVERVIEW_EXIT_DURATION;
+ }
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
index 4d2f965..f5161aa 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
@@ -22,13 +22,15 @@
import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
+import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
-import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE;
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
@@ -39,6 +41,8 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
@@ -75,6 +79,14 @@
private static final int PER_PAGE_SCROLL_DURATION = 150;
private static final int MAX_PAGE_SCROLL_DURATION = 750;
+ private static final int OVERVIEW_TO_SPLIT_ACTIONS_FADE_START = 0;
+ private static final int OVERVIEW_TO_SPLIT_ACTIONS_FADE_END = 83;
+
+ private static final float OVERVIEW_TO_SPLIT_ACTIONS_FADE_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_ACTIONS_FADE_START / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_ACTIONS_FADE_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_ACTIONS_FADE_END / SplitScreenSelectState.ENTER_DURATION;
+
// Due to use of physics, duration may differ between devices so we need to calculate and
// cache the value.
private int mHintToNormalDuration = -1;
@@ -87,9 +99,16 @@
public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toState,
StateAnimationConfig config) {
RecentsView overview = mActivity.getOverviewPanel();
- if (toState == NORMAL && fromState == OVERVIEW) {
+ if ((fromState == OVERVIEW || fromState == OVERVIEW_SPLIT_SELECT) && toState == NORMAL) {
+ if (fromState == OVERVIEW_SPLIT_SELECT) {
+ config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ clampToProgress(EMPHASIZED_ACCELERATE, 0, 0.4f));
+ config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
+ clampToProgress(LINEAR, 0, 0.33f));
+ }
+
config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f));
- config.setInterpolator(ANIM_SCRIM_FADE, LINEAR);
+ config.setInterpolator(ANIM_SCRIM_FADE, clampToProgress(LINEAR, 0.33f, 1));
config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL);
config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL);
@@ -98,8 +117,7 @@
// Overview is going offscreen, so keep it at its current scale and opacity.
config.setInterpolator(ANIM_OVERVIEW_SCALE, FINAL_FRAME);
config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME);
- config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X,
- clampToProgress(FAST_OUT_SLOW_IN, 0, 0.75f));
+ config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, EMPHASIZED_DECELERATE);
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, FINAL_FRAME);
} else {
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL);
@@ -178,6 +196,10 @@
AllAppsSwipeController.applyAllAppsToNormalConfig(mActivity, config);
} else if (fromState == NORMAL && toState == ALL_APPS) {
AllAppsSwipeController.applyNormalToAllAppsAnimConfig(mActivity, config);
+ } else if (fromState == OVERVIEW && toState == OVERVIEW_SPLIT_SELECT) {
+ config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_ACTIONS_FADE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_ACTIONS_FADE_END_OFFSET));
}
}
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
index e79d56b..2bc3c3e 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
@@ -16,6 +16,8 @@
package com.android.launcher3.uioverrides.states;
+import android.content.Context;
+
import com.android.launcher3.Launcher;
import com.android.quickstep.views.RecentsView;
@@ -24,6 +26,10 @@
* pinned and user is selecting the second one
*/
public class SplitScreenSelectState extends OverviewState {
+ public static final int ENTER_DURATION = 866;
+ public static final int EXIT_DURATION = 500;
+ // TODO: Add ability to differentiate between Split > Home and Split > Confirmed timings
+
public SplitScreenSelectState(int id) {
super(id);
}
@@ -38,4 +44,9 @@
RecentsView recentsView = launcher.getOverviewPanel();
return recentsView.getSplitSelectTranslation();
}
+
+ @Override
+ public int getTransitionDuration(Context context, boolean isToState) {
+ return isToState ? ENTER_DURATION : EXIT_DURATION;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
index 34a6821..30bb892 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
@@ -25,7 +25,6 @@
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_EDU;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
@@ -106,7 +105,7 @@
if (mStartState.overviewUi || mStartState == ALL_APPS) {
return true;
}
- int typeToClose = ENABLE_ALL_APPS_EDU.get() ? TYPE_ALL & ~TYPE_ALL_APPS_EDU : TYPE_ALL;
+ int typeToClose = TYPE_ALL & ~TYPE_ALL_APPS_EDU;
if (AbstractFloatingView.getTopOpenViewWithType(mLauncher, typeToClose) != null) {
return true;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
index 8faabc9..918b3c1 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java
@@ -34,13 +34,13 @@
import android.view.MotionEvent;
import android.view.ViewConfiguration;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.MotionPauseDetector;
@@ -114,7 +114,7 @@
public void onDragStart(boolean start, float startDisplacement) {
if (mLauncher.isInState(ALL_APPS)) {
LauncherTaskbarUIController controller =
- ((BaseQuickstepLauncher) mLauncher).getTaskbarUIController();
+ ((QuickstepLauncher) mLauncher).getTaskbarUIController();
if (controller != null) {
controller.setShouldDelayLauncherStateAnim(true);
}
@@ -151,7 +151,7 @@
@Override
public void onDragEnd(float velocity) {
LauncherTaskbarUIController controller =
- ((BaseQuickstepLauncher) mLauncher).getTaskbarUIController();
+ ((QuickstepLauncher) mLauncher).getTaskbarUIController();
if (controller != null) {
controller.setShouldDelayLauncherStateAnim(false);
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index f294986..922679b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -39,7 +39,6 @@
import static com.android.launcher3.states.StateAnimationConfig.SKIP_ALL_ANIMATIONS;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_SCRIM;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_RIGHT;
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_UP;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
@@ -49,6 +48,7 @@
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
+import static com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import android.animation.Animator;
@@ -56,11 +56,9 @@
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.graphics.PointF;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.animation.Interpolator;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -69,6 +67,7 @@
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.touch.BaseSwipeDetector;
import com.android.launcher3.touch.BothAxesSwipeDetector;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
@@ -93,7 +92,7 @@
private static final Interpolator SCALE_DOWN_INTERPOLATOR = LINEAR;
private static final long ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW = 300;
- private final BaseQuickstepLauncher mLauncher;
+ private final QuickstepLauncher mLauncher;
private final BothAxesSwipeDetector mSwipeDetector;
private final float mXRange;
private final float mYRange;
@@ -115,7 +114,7 @@
private AnimatorPlaybackController mXOverviewAnim;
private AnimatedFloat mYOverviewAnim;
- public NoButtonQuickSwitchTouchController(BaseQuickstepLauncher launcher) {
+ public NoButtonQuickSwitchTouchController(QuickstepLauncher launcher) {
mLauncher = launcher;
mSwipeDetector = new BothAxesSwipeDetector(mLauncher, this);
mRecentsView = mLauncher.getOverviewPanel();
@@ -227,7 +226,7 @@
// Set RecentView's initial properties.
RECENTS_SCALE_PROPERTY.set(mRecentsView, fromState.getOverviewScaleAndOffset(mLauncher)[0]);
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, 1f);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators setContentAlpha=1");
+ TASK_THUMBNAIL_SPLASH_ALPHA.set(mRecentsView, fromState.showTaskThumbnailSplash() ? 1f : 0);
mRecentsView.setContentAlpha(1);
mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
mLauncher.getActionsView().getVisibilityAlpha().setValue(
@@ -247,24 +246,6 @@
QUICK_SWITCH.getWorkspaceScrimColor(mLauncher), LINEAR);
if (mRecentsView.getTaskViewCount() == 0) {
xAnim.addFloat(mRecentsView, CONTENT_ALPHA, 0f, 1f, LINEAR);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators from: 0 to: 1");
- xAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = mRecentsView == null ? -1 : CONTENT_ALPHA.get(mRecentsView);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onCancel, alpha=" + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onEnd");
- }
- });
}
mXOverviewAnim = xAnim.createPlaybackController();
mXOverviewAnim.dispatchOnStart();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index d1b0a9c..56ac4c5 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
@@ -29,7 +29,6 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
@@ -37,7 +36,6 @@
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
-import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.Launcher;
@@ -47,7 +45,7 @@
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.views.RecentsView;
@@ -114,7 +112,6 @@
RECENTS_SCALE_PROPERTY.set(mOverviewPanel,
QUICK_SWITCH.getOverviewScaleAndOffset(mLauncher)[0] * 0.85f);
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mOverviewPanel, 1f);
- Log.d(BAD_STATE, "QuickSwitchTouchController initCurrentAnimation setContentAlpha=1");
mOverviewPanel.setContentAlpha(1);
mCurrentAnimation = mLauncher.getStateManager()
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index ca7f633..c49848a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -236,7 +236,8 @@
PendingAnimation pa;
if (goingUp) {
currentInterpolator = Interpolators.LINEAR;
- pa = mRecentsView.createTaskDismissAnimation(mTaskBeingDragged,
+ pa = new PendingAnimation(maxDuration);
+ mRecentsView.createTaskDismissAnimation(pa, mTaskBeingDragged,
true /* animateTaskView */, true /* removeTask */, maxDuration,
false /* dismissingForSplitSelection*/);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
index e2747df..9f2c1d4 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
@@ -24,13 +24,11 @@
import android.animation.ValueAnimator;
import android.os.SystemClock;
-import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.quickstep.SystemUiProxy;
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 8f1872b..4e635a7 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -33,6 +33,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_GESTURE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_LEFT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT;
+import static com.android.launcher3.uioverrides.QuickstepLauncher.ENABLE_PIP_KEEP_CLEAR_ALGORITHM;
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;
@@ -46,6 +47,9 @@
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.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FINISH_RECENTS_ANIMATION;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_SETTLED_ON_END_TARGET;
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;
@@ -82,6 +86,7 @@
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
+import com.android.internal.util.LatencyTracker;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
@@ -100,6 +105,7 @@
import com.android.quickstep.BaseActivityInterface.AnimationFactory;
import com.android.quickstep.GestureState.GestureEndTarget;
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AnimatorControllerWithResistance;
@@ -121,7 +127,6 @@
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputConsumerController;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
-import com.android.systemui.shared.system.LatencyTrackerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -320,8 +325,29 @@
initStateCallbacks();
}
+ @Nullable
+ private static ActiveGestureErrorDetector.GestureEvent getTrackedEventForState(int stateFlag) {
+ if (stateFlag == STATE_GESTURE_STARTED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_GESTURE_STARTED;
+ } else if (stateFlag == STATE_GESTURE_COMPLETED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_GESTURE_COMPLETED;
+ } else if (stateFlag == STATE_GESTURE_CANCELLED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_GESTURE_CANCELLED;
+ } else if (stateFlag == STATE_SCREENSHOT_CAPTURED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_SCREENSHOT_CAPTURED;
+ } else if (stateFlag == STATE_CAPTURE_SCREENSHOT) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_CAPTURE_SCREENSHOT;
+ } else if (stateFlag == STATE_HANDLER_INVALIDATED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_HANDLER_INVALIDATED;
+ } else if (stateFlag == STATE_LAUNCHER_DRAWN) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_LAUNCHER_DRAWN;
+ }
+ return null;
+ }
+
private void initStateCallbacks() {
- mStateCallback = new MultiStateCallback(STATE_NAMES.toArray(new String[0]));
+ mStateCallback = new MultiStateCallback(
+ STATE_NAMES.toArray(new String[0]), AbsSwipeUpHandler::getTrackedEventForState);
mStateCallback.runOnceAtState(STATE_LAUNCHER_PRESENT | STATE_GESTURE_STARTED,
this::onLauncherPresentAndGestureStarted);
@@ -595,8 +621,8 @@
Object traceToken = TraceHelper.INSTANCE.beginSection("logToggleRecents",
TraceHelper.FLAG_IGNORE_BINDERS);
- LatencyTrackerCompat.logToggleRecents(
- mContext, (int) (mLauncherFrameDrawnTime - mTouchTimeMs));
+ LatencyTracker.getInstance(mContext).logAction(LatencyTracker.ACTION_TOGGLE_RECENTS,
+ (int) (mLauncherFrameDrawnTime - mTouchTimeMs));
TraceHelper.INSTANCE.endSection(traceToken);
// This method is only called when STATE_GESTURE_STARTED is set, so we can enable the
@@ -800,7 +826,6 @@
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
super.onRecentsAnimationStart(controller, targets);
- ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targets.apps.length);
mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets);
mRecentsAnimationController = controller;
mRecentsAnimationTargets = targets;
@@ -843,17 +868,14 @@
@Override
public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) {
- ActiveGestureLog.INSTANCE.addLog("cancelRecentsAnimation");
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "cancelRecentsAnimation",
+ /* gestureEvent= */ CANCEL_RECENTS_ANIMATION);
mActivityInitListener.unregister();
// Cache the recents animation controller so we can defer its cleanup to after having
// properly cleaned up the screenshot without accidentally using it.
mDeferredCleanupRecentsAnimationController = mRecentsAnimationController;
mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED);
-
- if (mRecentsAnimationTargets != null) {
- setDividerShown(true /* shown */, false /* immediate */);
- }
-
// Defer clearing the controller and the targets until after we've updated the state
mRecentsAnimationController = null;
mRecentsAnimationTargets = null;
@@ -1010,7 +1032,9 @@
}
break;
}
- ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "onSettledOnEndTarget " + endTarget,
+ /* gestureEvent= */ ON_SETTLED_ON_END_TARGET);
}
/** @return Whether this was the task we were waiting to appear, and thus handled it. */
@@ -1027,77 +1051,90 @@
return false;
}
- private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity,
- boolean isFlingY, boolean isCancel) {
+ private GestureEndTarget calculateEndTarget(
+ PointF velocity, float endVelocity, boolean isFlingY, boolean isCancel) {
+
if (mGestureState.isHandlingAtomicEvent()) {
- // Button mode, this is only used to go to recents
+ // Button mode, this is only used to go to recents.
return RECENTS;
}
- final GestureEndTarget endTarget;
- final boolean goingToNewTask;
- if (mRecentsView != null) {
- if (!hasTargets()) {
- // If there are no running tasks, then we can assume that this is a continuation of
- // the last gesture, but after the recents animation has finished
- goingToNewTask = true;
- } else {
- final int runningTaskIndex = mRecentsView.getRunningTaskIndex();
- final int taskToLaunch = mRecentsView.getNextPage();
- goingToNewTask = runningTaskIndex >= 0 && taskToLaunch != runningTaskIndex;
- }
- } else {
- goingToNewTask = false;
- }
- final boolean reachedOverviewThreshold = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW;
- final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources()
- .getDimension(R.dimen.quickstep_fling_threshold_speed);
- if (!isFlingY) {
- if (isCancel) {
- endTarget = LAST_TASK;
- } else if (mDeviceState.isFullyGesturalNavMode()) {
- if (goingToNewTask && isFlingX) {
- // Flinging towards new task takes precedence over mIsMotionPaused (which only
- // checks y-velocity).
- endTarget = NEW_TASK;
- } else if (mIsMotionPaused) {
- endTarget = RECENTS;
- } else if (goingToNewTask) {
- endTarget = NEW_TASK;
- } else {
- endTarget = !reachedOverviewThreshold ? LAST_TASK : HOME;
- }
- } else {
- endTarget = reachedOverviewThreshold && mGestureStarted
- ? RECENTS
- : goingToNewTask
- ? NEW_TASK
- : LAST_TASK;
- }
- } else {
- // If swiping at a diagonal, base end target on the faster velocity.
- boolean isSwipeUp = endVelocity < 0;
- boolean willGoToNewTaskOnSwipeUp =
- goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity);
- if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !willGoToNewTaskOnSwipeUp) {
- endTarget = HOME;
- } else if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp) {
- // If swiping at a diagonal, base end target on the faster velocity.
- endTarget = NEW_TASK;
- } else if (isSwipeUp) {
- endTarget = !reachedOverviewThreshold && willGoToNewTaskOnSwipeUp
- ? NEW_TASK : RECENTS;
- } else {
- endTarget = goingToNewTask ? NEW_TASK : LAST_TASK;
- }
+ GestureEndTarget endTarget;
+ if (isCancel) {
+ endTarget = LAST_TASK;
+ } else if (isFlingY) {
+ endTarget = calculateEndTargetForFlingY(velocity, endVelocity);
+ } else {
+ endTarget = calculateEndTargetForNonFling(velocity);
}
- if (mDeviceState.isOverviewDisabled() && (endTarget == RECENTS || endTarget == LAST_TASK)) {
+ if (mDeviceState.isOverviewDisabled() && endTarget == RECENTS) {
return LAST_TASK;
}
+
return endTarget;
}
+ private GestureEndTarget calculateEndTargetForFlingY(PointF velocity, float endVelocity) {
+ // If swiping at a diagonal, base end target on the faster velocity direction.
+ final boolean willGoToNewTask =
+ isScrollingToNewTask() && Math.abs(velocity.x) > Math.abs(endVelocity);
+ final boolean isSwipeUp = endVelocity < 0;
+ if (!isSwipeUp) {
+ final boolean isCenteredOnNewTask =
+ mRecentsView.getDestinationPage() != mRecentsView.getRunningTaskIndex();
+ return willGoToNewTask || isCenteredOnNewTask ? NEW_TASK : LAST_TASK;
+ }
+
+ if (!mDeviceState.isFullyGesturalNavMode()) {
+ return (!hasReachedOverviewThreshold() && willGoToNewTask) ? NEW_TASK : RECENTS;
+ }
+ return willGoToNewTask ? NEW_TASK : HOME;
+ }
+
+ private GestureEndTarget calculateEndTargetForNonFling(PointF velocity) {
+ final boolean isScrollingToNewTask = isScrollingToNewTask();
+ final boolean reachedOverviewThreshold = hasReachedOverviewThreshold();
+ if (!mDeviceState.isFullyGesturalNavMode()) {
+ return reachedOverviewThreshold && mGestureStarted
+ ? RECENTS
+ : (isScrollingToNewTask ? NEW_TASK : LAST_TASK);
+ }
+
+ // Fully gestural mode.
+ final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources()
+ .getDimension(R.dimen.quickstep_fling_threshold_speed);
+ if (isScrollingToNewTask && isFlingX) {
+ // Flinging towards new task takes precedence over mIsMotionPaused (which only
+ // checks y-velocity).
+ return NEW_TASK;
+ } else if (mIsMotionPaused) {
+ return RECENTS;
+ } else if (isScrollingToNewTask) {
+ return NEW_TASK;
+ } else if (reachedOverviewThreshold) {
+ return HOME;
+ }
+ return LAST_TASK;
+ }
+
+ private boolean isScrollingToNewTask() {
+ if (mRecentsView == null) {
+ return false;
+ }
+ if (!hasTargets()) {
+ // If there are no running tasks, then we can assume that this is a continuation of
+ // the last gesture, but after the recents animation has finished.
+ return true;
+ }
+ int runningTaskIndex = mRecentsView.getRunningTaskIndex();
+ return runningTaskIndex >= 0 && mRecentsView.getNextPage() != runningTaskIndex;
+ }
+
+ private boolean hasReachedOverviewThreshold() {
+ return mCurrentShift.value > MIN_PROGRESS_FOR_OVERVIEW;
+ }
+
@UiThread
private void handleNormalGestureEnd(float endVelocity, boolean isFling, PointF velocity,
boolean isCancel) {
@@ -1175,11 +1212,16 @@
duration = Math.max(duration, mRecentsView.getScroller().getDuration());
}
}
+ } else if (endTarget == LAST_TASK && mRecentsView != null
+ && mRecentsView.getNextPage() != mRecentsView.getRunningTaskIndex()) {
+ mRecentsView.snapToPage(mRecentsView.getRunningTaskIndex(), Math.toIntExact(duration));
}
// Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
// or resumeLastTask().
if (mRecentsView != null) {
+ ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
+ .SET_ON_PAGE_TRANSITION_END_CALLBACK);
mRecentsView.setOnPageTransitionEndCallback(
() -> mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED));
} else {
@@ -1330,7 +1372,8 @@
if (windowAnimation == null) {
continue;
}
- windowAnimation.start(mContext, velocityPxPerMs);
+ DeviceProfile dp = mActivity == null ? null : mActivity.getDeviceProfile();
+ windowAnimation.start(mContext, dp, velocityPxPerMs);
mRunningWindowAnim[i] = RunningWindowAnim.wrap(windowAnimation);
}
homeAnimFactory.setSwipeVelocity(velocityPxPerMs.y);
@@ -1401,6 +1444,7 @@
}
}
+ @Nullable
private SwipePipToHomeAnimator createWindowAnimationToPip(HomeAnimationFactory homeAnimFactory,
RemoteAnimationTargetCompat runningTaskTarget, float startProgress) {
// Directly animate the app to PiP (picture-in-picture) mode
@@ -1419,12 +1463,17 @@
homeToWindowPositionMap.invert(windowToHomePositionMap);
windowToHomePositionMap.mapRect(startRect);
+ final Rect hotseatKeepClearArea = getKeepClearAreaForHotseat();
final Rect destinationBounds = SystemUiProxy.INSTANCE.get(mContext)
.startSwipePipToHome(taskInfo.topActivity,
taskInfo.topActivityInfo,
runningTaskTarget.taskInfo.pictureInPictureParams,
homeRotation,
- mDp.hotseatBarSizePx);
+ hotseatKeepClearArea);
+ if (destinationBounds == null) {
+ // No destination bounds returned from SystemUI, bail early.
+ return null;
+ }
final Rect appBounds = new Rect();
final WindowConfiguration winConfig = taskInfo.configuration.windowConfiguration;
// Adjust the appBounds for TaskBar by using the calculated window crop Rect
@@ -1487,6 +1536,35 @@
return swipePipToHomeAnimator;
}
+ private Rect getKeepClearAreaForHotseat() {
+ Rect keepClearArea;
+ if (!ENABLE_PIP_KEEP_CLEAR_ALGORITHM) {
+ // make the height equal to hotseatBarSizePx only
+ keepClearArea = new Rect(0, 0, 0, mDp.hotseatBarSizePx);
+ return keepClearArea;
+ }
+ // the keep clear area in global screen coordinates, in pixels
+ if (mDp.isPhone) {
+ if (mDp.isSeascape()) {
+ // in seascape the Hotseat is on the left edge of the screen
+ keepClearArea = new Rect(0, 0, mDp.hotseatBarSizePx, mDp.heightPx);
+ } else if (mDp.isLandscape) {
+ // in landscape the Hotseat is on the right edge of the screen
+ keepClearArea = new Rect(mDp.widthPx - mDp.hotseatBarSizePx, 0,
+ mDp.widthPx, mDp.heightPx);
+ } else {
+ // in portrait mode the Hotseat is at the bottom of the screen
+ keepClearArea = new Rect(0, mDp.heightPx - mDp.hotseatBarSizePx,
+ mDp.widthPx, mDp.heightPx);
+ }
+ } else {
+ // large screens have Hotseat always at the bottom of the screen
+ keepClearArea = new Rect(0, mDp.heightPx - mDp.hotseatBarSizePx,
+ mDp.widthPx, mDp.heightPx);
+ }
+ return keepClearArea;
+ }
+
private void startInterceptingTouchesForGesture() {
if (mRecentsAnimationController == null) {
return;
@@ -1574,7 +1652,10 @@
private void resumeLastTask() {
if (mRecentsAnimationController != null) {
mRecentsAnimationController.finish(false /* toRecents */, null);
- ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "finishRecentsAnimation",
+ /* extras= */ false,
+ /* gestureEvent= */ FINISH_RECENTS_ANIMATION);
}
doLogGesture(LAST_TASK, null);
reset();
@@ -1623,6 +1704,9 @@
* handler (in case of quick switch).
*/
private void cancelCurrentAnimation() {
+ ActiveGestureLog.INSTANCE.addLog(
+ "AbsSwipeUpHandler.cancelCurrentAnimation",
+ ActiveGestureErrorDetector.GestureEvent.CANCEL_CURRENT_ANIMATION);
mCanceled = true;
mCurrentShift.cancelAnimation();
@@ -1694,10 +1778,6 @@
boolean wasVisible = mWasLauncherAlreadyVisible || mGestureStarted;
mActivityInterface.onTransitionCancelled(wasVisible, mGestureState.getEndTarget());
- if (mRecentsAnimationTargets != null && wasVisible) {
- setDividerShown(true /* shown */, true /* immediate */);
- }
-
// Leave the pending invisible flag, as it may be used by wallpaper open animation.
if (mActivity != null) {
mActivity.clearForceInvisibleFlag(INVISIBLE_BY_STATE_HANDLER);
@@ -1778,7 +1858,10 @@
mRecentsAnimationController.finish(true /* toRecents */,
() -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
}
- ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", true);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "finishRecentsAnimation",
+ /* extras= */ true,
+ /* gestureEvent= */ FINISH_RECENTS_ANIMATION);
}
private void finishCurrentTransitionToHome() {
@@ -1790,7 +1873,10 @@
finishRecentsControllerToHome(
() -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
}
- ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", true);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "finishRecentsAnimation",
+ /* extras= */ true,
+ /* gestureEvent= */ FINISH_RECENTS_ANIMATION);
doLogGesture(HOME, mRecentsView == null ? null : mRecentsView.getCurrentPageTaskView());
}
@@ -1978,7 +2064,10 @@
mRecentsAnimationController.finish(false /* toRecents */,
null /* onFinishComplete */);
mActivityInterface.onLaunchTaskSuccess();
- ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "finishRecentsAnimation",
+ /* extras= */ false,
+ /* gestureEvent= */ FINISH_RECENTS_ANIMATION);
}
}
}
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index 6354282..315a91e 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -55,7 +55,7 @@
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AnimatorControllerWithResistance;
diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
index ba61574..466abbe 100644
--- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
@@ -16,7 +16,7 @@
package com.android.quickstep;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
-import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON;
+import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import static com.android.quickstep.fallback.RecentsState.BACKGROUND_APP;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.HOME;
diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java
index acdbbbd..bcd9687 100644
--- a/quickstep/src/com/android/quickstep/GestureState.java
+++ b/quickstep/src/com/android/quickstep/GestureState.java
@@ -19,6 +19,10 @@
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_HOME;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_LAST_TASK;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_NEW_TASK;
import android.annotation.Nullable;
import android.annotation.TargetApi;
@@ -30,6 +34,7 @@
import com.android.launcher3.tracing.GestureStateProto;
import com.android.launcher3.tracing.SwipeHandlerProto;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -153,7 +158,8 @@
mHomeIntent = componentObserver.getHomeIntent();
mOverviewIntent = componentObserver.getOverviewIntent();
mActivityInterface = componentObserver.getActivityInterface();
- mStateCallback = new MultiStateCallback(STATE_NAMES.toArray(new String[0]));
+ mStateCallback = new MultiStateCallback(
+ STATE_NAMES.toArray(new String[0]), GestureState::getTrackedEventForState);
mGestureId = gestureId;
}
@@ -175,10 +181,23 @@
mHomeIntent = new Intent();
mOverviewIntent = new Intent();
mActivityInterface = null;
- mStateCallback = new MultiStateCallback(STATE_NAMES.toArray(new String[0]));
+ mStateCallback = new MultiStateCallback(
+ STATE_NAMES.toArray(new String[0]), GestureState::getTrackedEventForState);
mGestureId = -1;
}
+ @Nullable
+ private static ActiveGestureErrorDetector.GestureEvent getTrackedEventForState(int stateFlag) {
+ if (stateFlag == STATE_END_TARGET_ANIMATION_FINISHED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_END_TARGET_ANIMATION_FINISHED;
+ } else if (stateFlag == STATE_RECENTS_SCROLLING_FINISHED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_RECENTS_SCROLLING_FINISHED;
+ } else if (stateFlag == STATE_RECENTS_ANIMATION_CANCELED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_RECENTS_ANIMATION_CANCELED;
+ }
+ return null;
+ }
+
/**
* @return whether the gesture state has the provided {@param stateMask} flags set.
*/
@@ -311,7 +330,23 @@
public void setEndTarget(GestureEndTarget target, boolean isAtomic) {
mEndTarget = target;
mStateCallback.setState(STATE_END_TARGET_SET);
- ActiveGestureLog.INSTANCE.addLog("setEndTarget " + mEndTarget);
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "setEndTarget " + mEndTarget,
+ /* gestureEvent= */ SET_END_TARGET);
+ switch (mEndTarget) {
+ case HOME:
+ ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_HOME);
+ break;
+ case NEW_TASK:
+ ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_NEW_TASK);
+ break;
+ case LAST_TASK:
+ ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_LAST_TASK);
+ break;
+ case RECENTS:
+ default:
+ // No-Op
+ }
if (isAtomic) {
mStateCallback.setState(STATE_END_TARGET_ANIMATION_FINISHED);
}
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index c13b95f..1127e2c 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -33,7 +33,6 @@
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherInitListener;
@@ -44,8 +43,9 @@
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.GestureState.GestureEndTarget;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AnimatorControllerWithResistance;
@@ -61,7 +61,7 @@
* {@link BaseActivityInterface} for the in-launcher recents.
*/
public final class LauncherActivityInterface extends
- BaseActivityInterface<LauncherState, BaseQuickstepLauncher> {
+ BaseActivityInterface<LauncherState, QuickstepLauncher> {
public static final LauncherActivityInterface INSTANCE = new LauncherActivityInterface();
@@ -122,7 +122,7 @@
notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
DefaultAnimationFactory factory = new DefaultAnimationFactory(callback) {
@Override
- protected void createBackgroundToOverviewAnim(BaseQuickstepLauncher activity,
+ protected void createBackgroundToOverviewAnim(QuickstepLauncher activity,
PendingAnimation pa) {
super.createBackgroundToOverviewAnim(activity, pa);
@@ -135,7 +135,7 @@
}
};
- BaseQuickstepLauncher launcher = factory.initBackgroundStateUI();
+ QuickstepLauncher launcher = factory.initBackgroundStateUI();
// Since all apps is not visible, we can safely reset the scroll position.
// This ensures then the next swipe up to all-apps starts from scroll 0.
launcher.getAppsView().reset(false /* animate */);
@@ -159,14 +159,14 @@
@Nullable
@Override
- public BaseQuickstepLauncher getCreatedActivity() {
- return BaseQuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity();
+ public QuickstepLauncher getCreatedActivity() {
+ return QuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity();
}
@Nullable
@Override
public DepthController getDepthController() {
- BaseQuickstepLauncher launcher = getCreatedActivity();
+ QuickstepLauncher launcher = getCreatedActivity();
if (launcher == null) {
return null;
}
@@ -176,7 +176,7 @@
@Nullable
@Override
public LauncherTaskbarUIController getTaskbarController() {
- BaseQuickstepLauncher launcher = getCreatedActivity();
+ QuickstepLauncher launcher = getCreatedActivity();
if (launcher == null) {
return null;
}
@@ -318,7 +318,7 @@
}
@Override
- protected int getOverviewScrimColorForState(BaseQuickstepLauncher launcher,
+ protected int getOverviewScrimColorForState(QuickstepLauncher launcher,
LauncherState state) {
return state.getWorkspaceScrimColor(launcher);
}
diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
index fd9f922..7a281dd 100644
--- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
+++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
@@ -39,10 +39,10 @@
import android.window.IOnBackInvokedCallback;
import com.android.launcher3.AbstractFloatingView;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -75,7 +75,7 @@
private final RectF mCancelRect = new RectF();
/** The current window position. */
private final RectF mCurrentRect = new RectF();
- private final BaseQuickstepLauncher mLauncher;
+ private final QuickstepLauncher mLauncher;
private final int mWindowScaleMarginX;
/** Max window translation in the Y axis. */
private final int mWindowMaxDeltaY;
@@ -93,7 +93,7 @@
private IOnBackInvokedCallback mBackCallback;
public LauncherBackAnimationController(
- BaseQuickstepLauncher launcher,
+ QuickstepLauncher launcher,
QuickstepTransitionManager quickstepTransitionManager) {
mLauncher = launcher;
mQuickstepTransitionManager = quickstepTransitionManager;
diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
index 196a664..36ca993 100644
--- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
+++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java
@@ -35,10 +35,10 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.states.StateAnimationConfig;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.views.FloatingIconView;
import com.android.launcher3.views.FloatingView;
@@ -57,7 +57,7 @@
* Temporary class to allow easier refactoring
*/
public class LauncherSwipeHandlerV2 extends
- AbsSwipeUpHandler<BaseQuickstepLauncher, RecentsView, LauncherState> {
+ AbsSwipeUpHandler<QuickstepLauncher, RecentsView, LauncherState> {
public LauncherSwipeHandlerV2(Context context, RecentsAnimationDeviceState deviceState,
TaskAnimationManager taskAnimationManager, GestureState gestureState, long touchTimeMs,
diff --git a/quickstep/src/com/android/quickstep/MultiStateCallback.java b/quickstep/src/com/android/quickstep/MultiStateCallback.java
index b3875ae..a68bea2 100644
--- a/quickstep/src/com/android/quickstep/MultiStateCallback.java
+++ b/quickstep/src/com/android/quickstep/MultiStateCallback.java
@@ -22,7 +22,12 @@
import android.util.Log;
import android.util.SparseArray;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.config.FeatureFlags;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
+import com.android.quickstep.util.ActiveGestureLog;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -41,17 +46,29 @@
private final SparseArray<ArrayList<Consumer<Boolean>>> mStateChangeListeners =
new SparseArray<>();
+ @NonNull private final TrackedEventsMapper mTrackedEventsMapper;
+
private final String[] mStateNames;
private int mState = 0;
public MultiStateCallback(String[] stateNames) {
+ this(stateNames, stateFlag -> null);
+ }
+
+ public MultiStateCallback(
+ String[] stateNames,
+ @NonNull TrackedEventsMapper trackedEventsMapper) {
mStateNames = DEBUG_STATES ? stateNames : null;
+ mTrackedEventsMapper = trackedEventsMapper;
}
/**
* Adds the provided state flags to the global state on the UI thread and executes any callbacks
* as a result.
+ *
+ * Also tracks the provided gesture events for error detection. Each provided event must be
+ * associated with one provided state flag.
*/
public void setStateOnUiThread(int stateFlag) {
if (Looper.myLooper() == Looper.getMainLooper()) {
@@ -69,7 +86,9 @@
Log.d(TAG, "[" + System.identityHashCode(this) + "] Adding "
+ convertToFlagNames(stateFlag) + " to " + convertToFlagNames(mState));
}
-
+ if (FeatureFlags.ENABLE_GESTURE_ERROR_DETECTION.get()) {
+ trackGestureEvents(stateFlag);
+ }
final int oldState = mState;
mState = mState | stateFlag;
@@ -87,6 +106,26 @@
notifyStateChangeListeners(oldState);
}
+ private void trackGestureEvents(int stateFlags) {
+ for (int index = 0; (stateFlags >> index) != 0; index++) {
+ if ((stateFlags & (1 << index)) == 0) {
+ continue;
+ }
+ ActiveGestureErrorDetector.GestureEvent gestureEvent =
+ mTrackedEventsMapper.getTrackedEventForState(1 << index);
+ if (gestureEvent == null) {
+ continue;
+ }
+ if (gestureEvent.mLogEvent && gestureEvent.mTrackEvent) {
+ ActiveGestureLog.INSTANCE.addLog(gestureEvent.name(), gestureEvent);
+ } else if (gestureEvent.mLogEvent) {
+ ActiveGestureLog.INSTANCE.addLog(gestureEvent.name());
+ } else if (gestureEvent.mTrackEvent) {
+ ActiveGestureLog.INSTANCE.trackEvent(gestureEvent);
+ }
+ }
+ }
+
/**
* Adds the provided state flags to the global state and executes any change handlers
* as a result.
@@ -174,4 +213,7 @@
return joiner.toString();
}
+ public interface TrackedEventsMapper {
+ @Nullable ActiveGestureErrorDetector.GestureEvent getTrackedEventForState(int stateflag);
+ }
}
diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
index 895cf89..1b05fd2 100644
--- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
+++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
@@ -32,9 +32,9 @@
import android.view.Surface;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.window.CachedDisplayInfo;
import java.io.PrintWriter;
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index 1e7e89e..57a26ee 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -144,7 +144,7 @@
RunnableList callbackList = null;
if (taskView != null) {
taskView.setEndQuickswitchCuj(true);
- callbackList = taskView.launchTaskAnimated();
+ callbackList = taskView.launchTasks();
}
if (callbackList != null) {
@@ -193,7 +193,20 @@
}
}
- if (activityInterface.switchToRecentsIfVisible(() -> scheduleNextTask(cmd))) {
+ final Runnable completeCallback = () -> {
+ if (cmd.type == TYPE_SHOW_NEXT_FOCUS) {
+ RecentsView rv = activityInterface.getVisibleRecentsView();
+ // When the overview is launched via alt tab (cmd type is TYPE_SHOW_NEXT_FOCUS),
+ // the touch mode somehow is not change to false by the Android framework.
+ // The subsequent tab to go through tasks in overview can only be dispatched to
+ // focuses views, while focus can only be requested in
+ // {@link View#requestFocusNoSearch(int, Rect)} when touch mode is false. To note,
+ // here we launch overview from home.
+ rv.getViewRootImpl().touchModeChanged(false);
+ }
+ scheduleNextTask(cmd);
+ };
+ if (activityInterface.switchToRecentsIfVisible(completeCallback)) {
// If successfully switched, wait until animation finishes
return false;
}
@@ -268,6 +281,13 @@
RecentsView rv =
mOverviewComponentObserver.getActivityInterface().getVisibleRecentsView();
if (rv != null) {
+ // When the overview is launched via alt tab (cmd type is TYPE_SHOW_NEXT_FOCUS),
+ // the touch mode somehow is not change to false by the Android framework.
+ // The subsequent tab to go through tasks in overview can only be dispatched to
+ // focuses views, while focus can only be requested in
+ // {@link View#requestFocusNoSearch(int, Rect)} when touch mode is false. To note,
+ // here we launch overview with live tile.
+ rv.getViewRootImpl().touchModeChanged(false);
// Ensure that recents view has focus so that it receives the followup key inputs
TaskView taskView = rv.getNextTaskView();
if (taskView == null) {
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index 528fb97..9bd0cb9 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -8,7 +8,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.testing.TestInformationHandler;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.quickstep.util.LayoutUtils;
diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java
index cd93dbe..dea4e48 100644
--- a/quickstep/src/com/android/quickstep/RecentTasksList.java
+++ b/quickstep/src/com/android/quickstep/RecentTasksList.java
@@ -20,6 +20,7 @@
import android.annotation.TargetApi;
import android.app.ActivityManager;
+import android.app.KeyguardManager;
import android.os.Build;
import android.os.Process;
import android.os.RemoteException;
@@ -27,11 +28,10 @@
import androidx.annotation.VisibleForTesting;
-import com.android.quickstep.util.GroupTask;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.quickstep.util.GroupTask;
import com.android.systemui.shared.recents.model.Task;
-import com.android.systemui.shared.system.KeyguardManagerCompat;
import com.android.wm.shell.recents.IRecentTasksListener;
import com.android.wm.shell.util.GroupedRecentTaskInfo;
import com.android.wm.shell.util.SplitBounds;
@@ -49,7 +49,7 @@
private static final TaskLoadResult INVALID_RESULT = new TaskLoadResult(-1, false, 0);
- private final KeyguardManagerCompat mKeyguardManager;
+ private final KeyguardManager mKeyguardManager;
private final LooperExecutor mMainThreadExecutor;
private final SystemUiProxy mSysUiProxy;
@@ -62,8 +62,12 @@
private TaskLoadResult mResultsBg = INVALID_RESULT;
private TaskLoadResult mResultsUi = INVALID_RESULT;
- public RecentTasksList(LooperExecutor mainThreadExecutor,
- KeyguardManagerCompat keyguardManager, SystemUiProxy sysUiProxy) {
+ private RecentsModel.RunningTasksListener mRunningTasksListener;
+ // Tasks are stored in order of least recently launched to most recently launched.
+ private ArrayList<ActivityManager.RunningTaskInfo> mRunningTasks;
+
+ public RecentTasksList(LooperExecutor mainThreadExecutor, KeyguardManager keyguardManager,
+ SystemUiProxy sysUiProxy) {
mMainThreadExecutor = mainThreadExecutor;
mKeyguardManager = keyguardManager;
mChangeId = 1;
@@ -73,7 +77,26 @@
public void onRecentTasksChanged() throws RemoteException {
mMainThreadExecutor.execute(RecentTasksList.this::onRecentTasksChanged);
}
+
+ @Override
+ public void onRunningTaskAppeared(ActivityManager.RunningTaskInfo taskInfo) {
+ mMainThreadExecutor.execute(() -> {
+ RecentTasksList.this.onRunningTaskAppeared(taskInfo);
+ });
+ }
+
+ @Override
+ public void onRunningTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
+ mMainThreadExecutor.execute(() -> {
+ RecentTasksList.this.onRunningTaskVanished(taskInfo);
+ });
+ }
});
+ // We may receive onRunningTaskAppeared events later for tasks which have already been
+ // included in the list returned by mSysUiProxy.getRunningTasks(), or may receive
+ // onRunningTaskVanished for tasks not included in the returned list. These cases will be
+ // addressed when the tasks are added to/removed from mRunningTasks.
+ initRunningTasks(mSysUiProxy.getRunningTasks(Integer.MAX_VALUE));
}
@VisibleForTesting
@@ -154,6 +177,59 @@
mChangeId++;
}
+ /**
+ * Registers a listener for running tasks
+ */
+ public void registerRunningTasksListener(RecentsModel.RunningTasksListener listener) {
+ mRunningTasksListener = listener;
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRunningTasksListener() {
+ mRunningTasksListener = null;
+ }
+
+ private void initRunningTasks(ArrayList<ActivityManager.RunningTaskInfo> runningTasks) {
+ // Tasks are retrieved in order of most recently launched/used to least recently launched.
+ mRunningTasks = new ArrayList<>(runningTasks);
+ Collections.reverse(mRunningTasks);
+ }
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks() {
+ return mRunningTasks;
+ }
+
+ private void onRunningTaskAppeared(ActivityManager.RunningTaskInfo taskInfo) {
+ // Make sure this task is not already in the list
+ for (ActivityManager.RunningTaskInfo existingTask : mRunningTasks) {
+ if (taskInfo.taskId == existingTask.taskId) {
+ return;
+ }
+ }
+ mRunningTasks.add(taskInfo);
+ if (mRunningTasksListener != null) {
+ mRunningTasksListener.onRunningTasksChanged();
+ }
+ }
+
+ private void onRunningTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
+ // Find the task from the list of running tasks, if it exists
+ for (ActivityManager.RunningTaskInfo existingTask : mRunningTasks) {
+ if (existingTask.taskId != taskInfo.taskId) continue;
+
+ mRunningTasks.remove(existingTask);
+ if (mRunningTasksListener != null) {
+ mRunningTasksListener.onRunningTasksChanged();
+ }
+ return;
+ }
+ }
+
/**
* Loads and creates a list of all the recent tasks.
*/
@@ -178,8 +254,12 @@
TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size());
for (GroupedRecentTaskInfo rawTask : rawTasks) {
- ActivityManager.RecentTaskInfo taskInfo1 = rawTask.mTaskInfo1;
- ActivityManager.RecentTaskInfo taskInfo2 = rawTask.mTaskInfo2;
+ if (rawTask.getType() == GroupedRecentTaskInfo.TYPE_FREEFORM) {
+ // TODO: add entry for freeform tasks
+ continue;
+ }
+ ActivityManager.RecentTaskInfo taskInfo1 = rawTask.getTaskInfo1();
+ ActivityManager.RecentTaskInfo taskInfo2 = rawTask.getTaskInfo2();
Task.TaskKey task1Key = new Task.TaskKey(taskInfo1);
Task task1 = loadKeysOnly
? new Task(task1Key)
@@ -196,7 +276,7 @@
task2.setLastSnapshotData(taskInfo2);
}
final SplitConfigurationOptions.SplitBounds launcherSplitBounds =
- convertSplitBounds(rawTask.mSplitBounds);
+ convertSplitBounds(rawTask.getSplitBounds());
allTasks.add(new GroupTask(task1, task2, launcherSplitBounds));
}
@@ -234,8 +314,8 @@
mSysUiProxy.getRecentTasks(Integer.MAX_VALUE, currentUserId);
writer.println(prefix + " rawTasks=[");
for (GroupedRecentTaskInfo task : rawTasks) {
- writer.println(prefix + " t1=" + task.mTaskInfo1.taskId
- + " t2=" + (task.mTaskInfo2 != null ? task.mTaskInfo2.taskId : "-1"));
+ writer.println(prefix + " t1=" + task.getTaskInfo1().taskId
+ + " t2=" + (task.getTaskInfo2() != null ? task.getTaskInfo2().taskId : "-1"));
}
writer.println(prefix + " ]");
}
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 67ce606..c879494 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -15,16 +15,12 @@
*/
package com.android.quickstep;
-import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
-import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
-
import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely;
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
import static com.android.quickstep.TaskViewUtils.createRecentsWindowAnimator;
@@ -34,12 +30,12 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
+import android.app.ActivityOptions;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
-import android.util.Log;
import android.view.Display;
import android.view.SurfaceControl.Transaction;
import android.view.View;
@@ -82,7 +78,6 @@
import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
-import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -112,8 +107,6 @@
private @Nullable TaskbarManager mTaskbarManager;
private @Nullable FallbackTaskbarUIController mTaskbarUIController;
- private Configuration mOldConfig;
-
private StateManager<RecentsState> mStateManager;
// Strong refs to runners which are cleared when the activity is destroyed
@@ -138,7 +131,7 @@
SplitSelectStateController controller =
new SplitSelectStateController(this, mHandler, getStateManager(),
- null /* depthController */);
+ /* depthController */ null, getStatsLogManager());
mDragLayer.recreateControllers();
mFallbackRecentsView.init(mActionsView, controller);
@@ -165,7 +158,7 @@
@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) {
- onHandleConfigChanged();
+ onHandleConfigurationChanged();
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
}
@@ -175,11 +168,8 @@
ACTIVITY_TRACKER.handleNewIntent(this);
}
- /**
- * Logic for when device configuration changes (rotation, screen size change, multi-window,
- * etc.)
- */
- protected void onHandleConfigChanged() {
+ @Override
+ protected void onHandleConfigurationChanged() {
initDeviceProfile();
AbstractFloatingView.closeOpenViews(this, true,
@@ -273,8 +263,10 @@
wrapper, RECENTS_LAUNCH_DURATION,
RECENTS_LAUNCH_DURATION - STATUS_BAR_TRANSITION_DURATION
- STATUS_BAR_TRANSITION_PRE_DELAY, getIApplicationThread());
- final ActivityOptionsWrapper activityOptions = new ActivityOptionsWrapper(
- ActivityOptionsCompat.makeRemoteAnimation(adapterCompat),
+ final ActivityOptions options = ActivityOptions.makeRemoteAnimation(
+ adapterCompat.getWrapped(),
+ adapterCompat.getRemoteTransition().getTransition());
+ final ActivityOptionsWrapper activityOptions = new ActivityOptionsWrapper(options,
onEndCallback);
activityOptions.options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
activityOptions.options.setLaunchDisplayId(
@@ -314,7 +306,6 @@
protected void onStart() {
// Set the alpha to 1 before calling super, as it may get set back to 0 due to
// onActivityStart callback.
- Log.d(BAD_STATE, "RecentsActivity onStart mFallbackRecentsView.setContentAlpha(1)");
mFallbackRecentsView.setContentAlpha(1);
super.onStart();
mFallbackRecentsView.updateLocusId();
@@ -341,7 +332,6 @@
mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER);
- mOldConfig = new Configuration(getResources().getConfiguration());
initDeviceProfile();
setupViews();
@@ -351,16 +341,6 @@
}
@Override
- public void onConfigurationChanged(Configuration newConfig) {
- int diff = newConfig.diff(mOldConfig);
- if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) {
- onHandleConfigChanged();
- }
- mOldConfig.setTo(newConfig);
- super.onConfigurationChanged(newConfig);
- }
-
- @Override
public void onStateSetEnd(RecentsState state) {
super.onStateSetEnd(state);
@@ -428,8 +408,10 @@
RemoteAnimationAdapterCompat adapterCompat =
new RemoteAnimationAdapterCompat(runner, HOME_APPEAR_DURATION, 0,
getIApplicationThread());
- startHomeIntentSafely(this,
- ActivityOptionsCompat.makeRemoteAnimation(adapterCompat).toBundle());
+ ActivityOptions options = ActivityOptions.makeRemoteAnimation(
+ adapterCompat.getWrapped(),
+ adapterCompat.getRemoteTransition().getTransition());
+ startHomeIntentSafely(this, options.toBundle());
}
private final RemoteAnimationFactory mAnimationToHomeFactory =
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
index 51ae56b..b233521 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
@@ -16,7 +16,8 @@
package com.android.quickstep;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
-import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION;
import android.graphics.Rect;
import android.util.ArraySet;
@@ -28,6 +29,8 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Preconditions;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -97,18 +100,6 @@
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets,
Rect homeContentInsets, Rect minimizedHomeBounds) {
- // Convert appTargets to type RemoteAnimationTarget for all apps except Home app
- RemoteAnimationTarget[] nonHomeApps = Arrays.stream(appTargets)
- .filter(remoteAnimationTarget ->
- remoteAnimationTarget.activityType != ACTIVITY_TYPE_HOME)
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
-
- RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(nonHomeApps);
-
- RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets,
- wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets),
- homeContentInsets, minimizedHomeBounds);
mController = new RecentsAnimationController(animationController,
mAllowMinimizeSplitScreen, this::onAnimationFinished);
@@ -116,7 +107,18 @@
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(),
mController::finishAnimationToApp);
} else {
+ final RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(
+ Arrays.stream(appTargets).map(RemoteAnimationTargetCompat::unwrap)
+ .toArray(RemoteAnimationTarget[]::new));
+ final RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets,
+ wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets),
+ homeContentInsets, minimizedHomeBounds);
+
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "RecentsAnimationCallbacks.onAnimationStart",
+ /* extras= */ targets.apps.length,
+ /* gestureEvent= */ START_RECENTS_ANIMATION);
for (RecentsAnimationListener listener : getListeners()) {
listener.onRecentsAnimationStart(mController, targets);
}
@@ -128,6 +130,9 @@
@Override
public final void onAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) {
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "onRecentsAnimationCancelled",
+ /* gestureEvent= */ CANCEL_RECENTS_ANIMATION);
for (RecentsAnimationListener listener : getListeners()) {
listener.onRecentsAnimationCanceled(thumbnailDatas);
}
@@ -138,6 +143,8 @@
@Override
public void onTasksAppeared(RemoteAnimationTargetCompat[] apps) {
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
+ ActiveGestureLog.INSTANCE.addLog("onTasksAppeared",
+ ActiveGestureErrorDetector.GestureEvent.TASK_APPEARED);
for (RecentsAnimationListener listener : getListeners()) {
listener.onTasksAppeared(apps);
}
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java
index fefef2f..542c0d4 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java
@@ -32,6 +32,8 @@
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.RunnableList;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
@@ -172,7 +174,12 @@
*/
@UiThread
public void cleanupScreenshot() {
- UI_HELPER_EXECUTOR.execute(() -> mController.cleanupScreenshot());
+ UI_HELPER_EXECUTOR.execute(() -> {
+ ActiveGestureLog.INSTANCE.addLog(
+ "cleanupScreenshot",
+ ActiveGestureErrorDetector.GestureEvent.CLEANUP_SCREENSHOT);
+ mController.cleanupScreenshot();
+ });
}
/**
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index 4fb7e6b..e87fdad 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -23,9 +23,9 @@
import static com.android.launcher3.util.DisplayController.CHANGE_ALL;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION;
-import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON;
-import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS;
-import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS;
+import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
+import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
+import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS;
import static com.android.launcher3.util.SettingsCache.ONE_HANDED_ENABLED;
import static com.android.launcher3.util.SettingsCache.ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE;
@@ -61,12 +61,13 @@
import android.view.MotionEvent;
import androidx.annotation.BinderThread;
+import androidx.annotation.NonNull;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SettingsCache;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
import com.android.quickstep.util.NavBarPosition;
@@ -124,7 +125,7 @@
};
private int mGestureBlockingTaskId = -1;
- private Region mExclusionRegion;
+ private @NonNull Region mExclusionRegion = new Region();
private SystemGestureExclusionListenerCompat mExclusionListener;
public RecentsAnimationDeviceState(Context context) {
@@ -162,6 +163,10 @@
@Override
@BinderThread
public void onExclusionChanged(Region region) {
+ if (region == null) {
+ // Don't think this is possible but just in case, don't let it be null.
+ region = new Region();
+ }
// Assignments are atomic, it should be safe on binder thread
mExclusionRegion = region;
}
@@ -498,7 +503,7 @@
public boolean isInExclusionRegion(MotionEvent event) {
// mExclusionRegion can change on binder thread, use a local instance here.
Region exclusionRegion = mExclusionRegion;
- return mMode == NO_BUTTON && exclusionRegion != null
+ return mMode == NO_BUTTON
&& exclusionRegion.contains((int) event.getX(), (int) event.getY());
}
@@ -575,19 +580,23 @@
&& ((mSystemUiStateFlags & SYSUI_STATE_IME_SHOWING) != 0);
}
+ public String getSystemUiStateString() {
+ return QuickStepContract.getSystemUiStateString(mSystemUiStateFlags);
+ }
+
public void dump(PrintWriter pw) {
pw.println("DeviceState:");
pw.println(" canStartSystemGesture=" + canStartSystemGesture());
pw.println(" systemUiFlags=" + mSystemUiStateFlags);
- pw.println(" systemUiFlagsDesc="
- + QuickStepContract.getSystemUiStateString(mSystemUiStateFlags));
+ pw.println(" systemUiFlagsDesc=" + getSystemUiStateString());
pw.println(" assistantAvailable=" + mAssistantAvailable);
pw.println(" assistantDisabled="
+ QuickStepContract.isAssistantGestureDisabled(mSystemUiStateFlags));
pw.println(" isUserUnlocked=" + mIsUserUnlocked);
pw.println(" isOneHandedModeEnabled=" + mIsOneHandedModeEnabled);
pw.println(" isSwipeToNotificationEnabled=" + mIsSwipeToNotificationEnabled);
- pw.println(" deferredGestureRegion=" + mDeferredGestureRegion);
+ pw.println(" deferredGestureRegion=" + mDeferredGestureRegion.getBounds());
+ pw.println(" exclusionRegion=" + mExclusionRegion.getBounds());
pw.println(" pipIsActive=" + mPipIsActive);
mRotationTouchHelper.dump(pw);
}
diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java
index 442578e..3053474 100644
--- a/quickstep/src/com/android/quickstep/RecentsModel.java
+++ b/quickstep/src/com/android/quickstep/RecentsModel.java
@@ -22,6 +22,7 @@
import android.annotation.TargetApi;
import android.app.ActivityManager;
+import android.app.KeyguardManager;
import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.Intent;
@@ -40,7 +41,6 @@
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
-import com.android.systemui.shared.system.KeyguardManagerCompat;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -75,7 +75,8 @@
private RecentsModel(Context context) {
mContext = context;
mTaskList = new RecentTasksList(MAIN_EXECUTOR,
- new KeyguardManagerCompat(context), SystemUiProxy.INSTANCE.get(context));
+ context.getSystemService(KeyguardManager.class),
+ SystemUiProxy.INSTANCE.get(context));
IconProvider iconProvider = new IconProvider(context);
mIconCache = new TaskIconCache(context, RECENTS_MODEL_EXECUTOR, iconProvider);
@@ -236,4 +237,35 @@
writer.println(prefix + "RecentsModel:");
mTaskList.dump(" ", writer);
}
+
+ /**
+ * Registers a listener for running tasks
+ */
+ public void registerRunningTasksListener(RunningTasksListener listener) {
+ mTaskList.registerRunningTasksListener(listener);
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRunningTasksListener() {
+ mTaskList.unregisterRunningTasksListener();
+ }
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks() {
+ return mTaskList.getRunningTasks();
+ }
+
+ /**
+ * Listener for receiving running tasks changes
+ */
+ public interface RunningTasksListener {
+ /**
+ * Called when there's a change to running tasks
+ */
+ void onRunningTasksChanged();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
index f1e20db..f8b6966 100644
--- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java
+++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
@@ -23,20 +23,20 @@
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION;
import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS;
-import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import android.content.Context;
import android.content.res.Resources;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.DisplayController.NavigationMode;
import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.TaskStackChangeListener;
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 9a2619b..24d2b9b 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -17,21 +17,25 @@
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
-import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import android.app.ActivityManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.graphics.Bitmap;
+import android.content.pm.PackageManager;
+import android.content.pm.ShortcutInfo;
import android.graphics.Insets;
import android.graphics.Rect;
import android.os.Bundle;
+import android.os.Handler;
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
+import android.os.Message;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Log;
@@ -41,8 +45,10 @@
import android.view.SurfaceControl;
import android.window.IOnBackInvokedCallback;
-import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.Info;
+import androidx.annotation.Nullable;
+import androidx.annotation.WorkerThread;
+
+import com.android.internal.logging.InstanceId;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.systemui.shared.recents.ISystemUiProxy;
@@ -70,12 +76,14 @@
/**
* Holds the reference to SystemUI.
*/
-public class SystemUiProxy implements ISystemUiProxy, DisplayController.DisplayInfoChangeListener {
+public class SystemUiProxy implements ISystemUiProxy {
private static final String TAG = SystemUiProxy.class.getSimpleName();
public static final MainThreadInitializedObject<SystemUiProxy> INSTANCE =
new MainThreadInitializedObject<>(SystemUiProxy::new);
+ private static final int MSG_SET_SHELF_HEIGHT = 1;
+
private ISystemUiProxy mSystemUiProxy;
private IPip mPip;
private ISysuiUnlockAnimationController mSysuiUnlockAnimationController;
@@ -96,7 +104,7 @@
private IPipAnimationListener mPipAnimationListener;
private ISplitScreenListener mSplitScreenListener;
private IStartingWindowListener mStartingWindowListener;
- private ILauncherUnlockAnimationController mPendingLauncherUnlockAnimationController;
+ private ILauncherUnlockAnimationController mLauncherUnlockAnimationController;
private IRecentTasksListener mRecentTasksListener;
private final ArrayList<RemoteTransitionCompat> mRemoteTransitions = new ArrayList<>();
private IOnBackInvokedCallback mBackToLauncherCallback;
@@ -104,24 +112,16 @@
// Used to dedupe calls to SystemUI
private int mLastShelfHeight;
private boolean mLastShelfVisible;
- private float mLastNavButtonAlpha;
- private boolean mLastNavButtonAnimate;
- private boolean mHasNavButtonAlphaBeenSet = false;
- private Runnable mPendingSetNavButtonAlpha = null;
+
+ private final Context mContext;
+ private final Handler mAsyncHandler;
// TODO(141886704): Find a way to remove this
private int mLastSystemUiStateFlags;
public SystemUiProxy(Context context) {
- DisplayController.INSTANCE.get(context).addChangeListener(this);
- }
-
- @Override
- public void onDisplayInfoChanged(Context context, Info info, int flags) {
- if ((flags & CHANGE_NAVIGATION_MODE) != 0) {
- // Whenever the nav mode changes, force reset the nav button alpha
- setNavBarButtonAlpha(1f, false);
- }
+ mContext = context;
+ mAsyncHandler = new Handler(UI_HELPER_EXECUTOR.getLooper(), this::handleMessageAsync);
}
@Override
@@ -189,10 +189,8 @@
if (mStartingWindowListener != null && mStartingWindow != null) {
setStartingWindowListener(mStartingWindowListener);
}
- if (mPendingLauncherUnlockAnimationController != null
- && mSysuiUnlockAnimationController != null) {
- setLauncherUnlockAnimationController(mPendingLauncherUnlockAnimationController);
- mPendingLauncherUnlockAnimationController = null;
+ if (mSysuiUnlockAnimationController != null && mLauncherUnlockAnimationController != null) {
+ setLauncherUnlockAnimationController(mLauncherUnlockAnimationController);
}
for (int i = mRemoteTransitions.size() - 1; i >= 0; --i) {
registerRemoteTransition(mRemoteTransitions.get(i));
@@ -203,11 +201,6 @@
if (mBackAnimation != null && mBackToLauncherCallback != null) {
setBackToLauncherCallback(mBackToLauncherCallback);
}
-
- if (mPendingSetNavButtonAlpha != null) {
- mPendingSetNavButtonAlpha.run();
- mPendingSetNavButtonAlpha = null;
- }
}
public void clearProxy() {
@@ -270,31 +263,6 @@
}
}
- public float getLastNavButtonAlpha() {
- return mLastNavButtonAlpha;
- }
-
- @Override
- public void setNavBarButtonAlpha(float alpha, boolean animate) {
- boolean changed = Float.compare(alpha, mLastNavButtonAlpha) != 0
- || animate != mLastNavButtonAnimate
- || !mHasNavButtonAlphaBeenSet;
- if (changed) {
- if (mSystemUiProxy == null) {
- mPendingSetNavButtonAlpha = () -> setNavBarButtonAlpha(alpha, animate);
- } else {
- mLastNavButtonAlpha = alpha;
- mLastNavButtonAnimate = animate;
- mHasNavButtonAlphaBeenSet = true;
- try {
- mSystemUiProxy.setNavBarButtonAlpha(alpha, animate);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call setNavBarButtonAlpha", e);
- }
- }
- }
- }
-
@Override
public void onStatusBarMotionEvent(MotionEvent event) {
if (mSystemUiProxy != null) {
@@ -479,12 +447,20 @@
* Sets the shelf height.
*/
public void setShelfHeight(boolean visible, int shelfHeight) {
+ Message.obtain(mAsyncHandler, MSG_SET_SHELF_HEIGHT,
+ visible ? 1 : 0 , shelfHeight).sendToTarget();
+ }
+
+ @WorkerThread
+ private void setShelfHeightAsync(int visibleInt, int shelfHeight) {
+ boolean visible = visibleInt != 0;
boolean changed = visible != mLastShelfVisible || shelfHeight != mLastShelfHeight;
- if (mPip != null && changed) {
+ IPip pip = mPip;
+ if (pip != null && changed) {
mLastShelfVisible = visible;
mLastShelfHeight = shelfHeight;
try {
- mPip.setShelfHeight(visible, shelfHeight);
+ pip.setShelfHeight(visible, shelfHeight);
} catch (RemoteException e) {
Log.w(TAG, "Failed call setShelfHeight visible: " + visible
+ " height: " + shelfHeight, e);
@@ -506,12 +482,17 @@
mPipAnimationListener = listener;
}
+ /**
+ * @return Destination bounds of auto-pip animation, {@code null} if the animation is not ready.
+ */
+ @Nullable
public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
- PictureInPictureParams pictureInPictureParams, int launcherRotation, int shelfHeight) {
+ PictureInPictureParams pictureInPictureParams, int launcherRotation,
+ Rect hotseatKeepClearArea) {
if (mPip != null) {
try {
return mPip.startSwipePipToHome(componentName, activityInfo,
- pictureInPictureParams, launcherRotation, shelfHeight);
+ pictureInPictureParams, launcherRotation, hotseatKeepClearArea);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startSwipePipToHome", e);
}
@@ -564,11 +545,11 @@
/** Start multiple tasks in split-screen simultaneously. */
public void startTasks(int mainTaskId, Bundle mainOptions, int sideTaskId, Bundle sideOptions,
@SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio,
- RemoteTransitionCompat remoteTransition) {
+ RemoteTransitionCompat remoteTransition, InstanceId instanceId) {
if (mSystemUiProxy != null) {
try {
mSplitScreen.startTasks(mainTaskId, mainOptions, sideTaskId, sideOptions,
- sidePosition, splitRatio, remoteTransition.getTransition());
+ sidePosition, splitRatio, remoteTransition.getTransition(), instanceId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startTask");
}
@@ -580,11 +561,11 @@
*/
public void startTasksWithLegacyTransition(int mainTaskId, Bundle mainOptions, int sideTaskId,
Bundle sideOptions, @SplitConfigurationOptions.StagePosition int sidePosition,
- float splitRatio, RemoteAnimationAdapter adapter) {
+ float splitRatio, RemoteAnimationAdapter adapter, InstanceId instanceId) {
if (mSystemUiProxy != null) {
try {
mSplitScreen.startTasksWithLegacyTransition(mainTaskId, mainOptions, sideTaskId,
- sideOptions, sidePosition, splitRatio, adapter);
+ sideOptions, sidePosition, splitRatio, adapter, instanceId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startTasksWithLegacyTransition");
}
@@ -594,23 +575,38 @@
public void startIntentAndTaskWithLegacyTransition(PendingIntent pendingIntent,
Intent fillInIntent, int taskId, Bundle mainOptions, Bundle sideOptions,
@SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio,
- RemoteAnimationAdapter adapter) {
+ RemoteAnimationAdapter adapter, InstanceId instanceId) {
if (mSystemUiProxy != null) {
try {
mSplitScreen.startIntentAndTaskWithLegacyTransition(pendingIntent, fillInIntent,
- taskId, mainOptions, sideOptions, sidePosition, splitRatio, adapter);
+ taskId, mainOptions, sideOptions, sidePosition, splitRatio, adapter,
+ instanceId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed call startTasksWithLegacyTransition");
+ Log.w(TAG, "Failed call startIntentAndTaskWithLegacyTransition");
+ }
+ }
+ }
+
+ public void startShortcutAndTaskWithLegacyTransition(ShortcutInfo shortcutInfo, int taskId,
+ Bundle mainOptions, Bundle sideOptions,
+ @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio,
+ RemoteAnimationAdapter adapter, InstanceId instanceId) {
+ if (mSystemUiProxy != null) {
+ try {
+ mSplitScreen.startShortcutAndTaskWithLegacyTransition(shortcutInfo, taskId,
+ mainOptions, sideOptions, sidePosition, splitRatio, adapter, instanceId);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call startShortcutAndTaskWithLegacyTransition");
}
}
}
public void startShortcut(String packageName, String shortcutId, int position,
- Bundle options, UserHandle user) {
+ Bundle options, UserHandle user, InstanceId instanceId) {
if (mSplitScreen != null) {
try {
mSplitScreen.startShortcut(packageName, shortcutId, position, options,
- user);
+ user, instanceId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startShortcut");
}
@@ -618,10 +614,10 @@
}
public void startIntent(PendingIntent intent, Intent fillInIntent, int position,
- Bundle options) {
+ Bundle options, InstanceId instanceId) {
if (mSplitScreen != null) {
try {
- mSplitScreen.startIntent(intent, fillInIntent, position, options);
+ mSplitScreen.startIntent(intent, fillInIntent, position, options, instanceId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startIntent");
}
@@ -757,11 +753,11 @@
controller.dispatchSmartspaceStateToSysui();
}
} catch (RemoteException e) {
- Log.w(TAG, "Failed call setStartingWindowListener", e);
+ Log.w(TAG, "Failed call setLauncherUnlockAnimationController", e);
}
- } else {
- mPendingLauncherUnlockAnimationController = controller;
}
+
+ mLauncherUnlockAnimationController = controller;
}
/**
@@ -870,4 +866,29 @@
}
return new ArrayList<>();
}
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks(int numTasks) {
+ if (mRecentTasks != null
+ && mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC)) {
+ try {
+ return new ArrayList<>(Arrays.asList(mRecentTasks.getRunningTasks(numTasks)));
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call getRunningTasks", e);
+ }
+ }
+ return new ArrayList<>();
+ }
+
+ private boolean handleMessageAsync(Message msg) {
+ switch (msg.what) {
+ case MSG_SET_SHELF_HEIGHT:
+ setShelfHeightAsync(msg.arg1, msg.arg2);
+ return true;
+ }
+
+ return false;
+ }
}
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index fd7e367..b9a1b06 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -39,13 +39,12 @@
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
-import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.RemoteTransitionCompat;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAnimationListener {
@@ -156,30 +155,21 @@
public void onTasksAppeared(RemoteAnimationTargetCompat[] appearedTaskTargets) {
RemoteAnimationTargetCompat appearedTaskTarget = appearedTaskTargets[0];
BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface();
- // Convert appTargets to type RemoteAnimationTarget for all apps except Home app
- final ArrayList<RemoteAnimationTargetCompat> tmpNonHomeApps = new ArrayList<>();
- final ArrayList<RemoteAnimationTargetCompat> tmpHomeApps = new ArrayList<>();
+
for (RemoteAnimationTargetCompat compat : appearedTaskTargets) {
- if (compat.activityType != ACTIVITY_TYPE_HOME) {
- tmpNonHomeApps.add(compat);
- } else {
- tmpHomeApps.add(compat);
+ if (compat.activityType == ACTIVITY_TYPE_HOME
+ && activityInterface.getCreatedActivity() instanceof RecentsActivity) {
+ // When receive opening home activity while recents is running, enter home
+ // and dismiss recents.
+ ((RecentsActivity) activityInterface.getCreatedActivity()).startHome();
+ return;
}
}
- RemoteAnimationTarget[] nonHomeApps = tmpNonHomeApps.stream()
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
- RemoteAnimationTarget[] homeApps = tmpHomeApps.stream()
- .map(RemoteAnimationTargetCompat::unwrap)
- .toArray(RemoteAnimationTarget[]::new);
- if (homeApps.length > 0
- && activityInterface.getCreatedActivity() instanceof RecentsActivity) {
- ((RecentsActivity) activityInterface.getCreatedActivity()).startHome();
- return;
- }
- RemoteAnimationTarget[] nonAppTargets =
- SystemUiProxy.INSTANCE.getNoCreate().onStartingSplitLegacy(nonHomeApps);
+ RemoteAnimationTarget[] nonAppTargets = SystemUiProxy.INSTANCE.getNoCreate()
+ .onStartingSplitLegacy(Arrays.stream(appearedTaskTargets)
+ .map(RemoteAnimationTargetCompat::unwrap)
+ .toArray(RemoteAnimationTarget[]::new));
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode()
&& activityInterface.getCreatedActivity() != null) {
@@ -238,7 +228,8 @@
RemoteTransitionCompat transition = new RemoteTransitionCompat(mCallbacks,
mController != null ? mController.getController() : null,
mCtx.getIApplicationThread());
- final ActivityOptions options = ActivityOptionsCompat.makeRemoteTransition(transition);
+ final ActivityOptions options = ActivityOptions.makeRemoteTransition(
+ transition.getTransition());
// Allowing to pause Home if Home is top activity and Recents is not Home. So when user
// start home when recents animation is playing, the home activity can be resumed again
// to let the transition controller collect Home activity.
diff --git a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
index 69a295b..eae79df 100644
--- a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
@@ -16,6 +16,8 @@
package com.android.quickstep;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
+
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_SELECTIONS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP;
@@ -26,8 +28,12 @@
import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
+import android.os.RemoteException;
+import android.os.SystemProperties;
+import android.util.Log;
import android.view.View;
import android.view.WindowInsets;
+import android.view.WindowManagerGlobal;
import android.window.SplashScreen;
import androidx.annotation.Nullable;
@@ -51,8 +57,6 @@
import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFuture;
import com.android.systemui.shared.recents.view.RecentsTransition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
-import com.android.systemui.shared.system.ActivityOptionsCompat;
-import com.android.systemui.shared.system.WindowManagerWrapper;
import java.util.Collections;
import java.util.List;
@@ -120,6 +124,7 @@
}
class FreeformSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
+ private static final String TAG = "FreeformSystemShortcut";
private Handler mHandler;
@@ -192,7 +197,7 @@
taskId, thumbnail, taskBounds));
}
};
- WindowManagerWrapper.getInstance().overridePendingAppTransitionMultiThumbFuture(
+ overridePendingAppTransitionMultiThumbFuture(
future, animStartedListener, mHandler, true /* scaleUp */,
taskKey.displayId);
mTarget.getStatsLogManager().logger().withItemInfo(mTaskView.getItemInfo())
@@ -200,8 +205,27 @@
}
}
+ /**
+ * Overrides a pending app transition.
+ */
+ private void overridePendingAppTransitionMultiThumbFuture(
+ AppTransitionAnimationSpecsFuture animationSpecFuture, Runnable animStartedCallback,
+ Handler animStartedCallbackHandler, boolean scaleUp, int displayId) {
+ try {
+ WindowManagerGlobal.getWindowManagerService()
+ .overridePendingAppTransitionMultiThumbFuture(
+ animationSpecFuture.getFuture(),
+ RecentsTransition.wrapStartedListener(animStartedCallbackHandler,
+ animStartedCallback), scaleUp, displayId);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed to override pending app transition (multi-thumbnail future): ",
+ e);
+ }
+ }
+
private ActivityOptions makeLaunchOptions(Activity activity) {
- ActivityOptions activityOptions = ActivityOptionsCompat.makeFreeformOptions();
+ ActivityOptions activityOptions = ActivityOptions.makeBasic();
+ activityOptions.setLaunchWindowingMode(WINDOWING_MODE_FREEFORM);
// Arbitrary bounds only because freeform is in dev mode right now
final View decorView = activity.getWindow().getDecorView();
final WindowInsets insets = decorView.getRootWindowInsets();
@@ -278,7 +302,8 @@
}
private boolean isAvailable(BaseDraggingActivity activity, int displayId) {
- return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity);
+ return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity)
+ && !SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false);
}
};
diff --git a/quickstep/src/com/android/quickstep/TaskUtils.java b/quickstep/src/com/android/quickstep/TaskUtils.java
index c9db153..d722778 100644
--- a/quickstep/src/com/android/quickstep/TaskUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskUtils.java
@@ -18,6 +18,8 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import android.annotation.NonNull;
+import android.annotation.UserIdInt;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -25,6 +27,8 @@
import android.os.UserHandle;
import android.util.Log;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.PackageManagerHelper;
@@ -47,16 +51,32 @@
* TODO: remove this once we switch to getting the icon and label from IconCache.
*/
public static CharSequence getTitle(Context context, Task task) {
- UserHandle user = UserHandle.of(task.key.userId);
+ return getTitle(context, task.key.userId, task.getTopComponent().getPackageName());
+ }
+
+ public static CharSequence getTitle(
+ @NonNull Context context,
+ @UserIdInt @Nullable Integer userId,
+ @Nullable String packageName) {
+ if (userId == null || packageName == null) {
+ if (userId == null) {
+ Log.e(TAG, "Failed to get title; missing userId");
+ }
+ if (packageName == null) {
+ Log.e(TAG, "Failed to get title; missing packageName");
+ }
+ return "";
+ }
+ UserHandle user = UserHandle.of(userId);
ApplicationInfo applicationInfo = new PackageManagerHelper(context)
- .getApplicationInfo(task.getTopComponent().getPackageName(), user, 0);
+ .getApplicationInfo(packageName, user, 0);
if (applicationInfo == null) {
- Log.e(TAG, "Failed to get title for task " + task);
+ Log.e(TAG, "Failed to get title for userId=" + userId + ", packageName=" + packageName);
return "";
}
PackageManager packageManager = context.getPackageManager();
return packageManager.getUserBadgedLabel(
- applicationInfo.loadLabel(packageManager), user);
+ applicationInfo.loadLabel(packageManager), user);
}
public static ComponentKey getLaunchComponentKeyForTask(Task.TaskKey taskKey) {
diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index a030568..a96524e 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -36,15 +36,13 @@
import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR;
import static com.android.launcher3.anim.Interpolators.clampToProgress;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
-import static com.android.launcher3.statehandlers.DepthController.DEPTH;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.statehandlers.DepthController.STATE_DEPTH;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.PendingIntent;
@@ -55,7 +53,6 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
-import android.util.Log;
import android.view.SurfaceControl;
import android.view.View;
import android.window.TransitionInfo;
@@ -197,10 +194,10 @@
int taskIndex = recentsView.indexOfChild(v);
Context context = v.getContext();
- DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
+ BaseActivity baseActivity = BaseActivity.fromContext(context);
+ DeviceProfile dp = baseActivity.getDeviceProfile();
boolean showAsGrid = dp.isTablet;
- boolean parallaxCenterAndAdjacentTask =
- taskIndex != recentsView.getCurrentPage() && !showAsGrid;
+ boolean parallaxCenterAndAdjacentTask = taskIndex != recentsView.getCurrentPage();
int taskRectTranslationPrimary = recentsView.getScrollOffset(taskIndex);
int taskRectTranslationSecondary = showAsGrid ? (int) v.getGridTranslationY() : 0;
@@ -370,7 +367,7 @@
});
if (depthController != null) {
- out.setFloat(depthController, DEPTH, BACKGROUND_APP.getDepth(context),
+ out.setFloat(depthController, STATE_DEPTH, BACKGROUND_APP.getDepth(baseActivity),
TOUCH_RESPONSE_INTERPOLATOR);
}
}
@@ -391,10 +388,39 @@
* 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(int initialTaskId,
- @Nullable PendingIntent initialTaskPendingIntent, int secondTaskId,
+ public static void composeRecentsSplitLaunchAnimator(GroupedTaskView launchingTaskView,
+ @NonNull StateManager stateManager, @Nullable DepthController depthController,
+ int initialTaskId, @Nullable PendingIntent initialTaskPendingIntent, int secondTaskId,
@NonNull TransitionInfo transitionInfo, SurfaceControl.Transaction t,
@NonNull Runnable finishCallback) {
+ if (launchingTaskView != null) {
+ AnimatorSet animatorSet = new AnimatorSet();
+ animatorSet.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ finishCallback.run();
+ }
+ });
+
+ final RemoteAnimationTargetCompat[] appTargets =
+ RemoteAnimationTargetCompat.wrapApps(transitionInfo, t, null /* leashMap */);
+ final RemoteAnimationTargetCompat[] wallpaperTargets =
+ RemoteAnimationTargetCompat.wrapNonApps(
+ transitionInfo, true /* wallpapers */, t, null /* leashMap */);
+ final RemoteAnimationTargetCompat[] nonAppTargets =
+ RemoteAnimationTargetCompat.wrapNonApps(
+ transitionInfo, false /* wallpapers */, t, null /* leashMap */);
+ final RecentsView recentsView = launchingTaskView.getRecentsView();
+ composeRecentsLaunchAnimator(animatorSet, launchingTaskView,
+ appTargets, wallpaperTargets, nonAppTargets,
+ true, stateManager,
+ recentsView, depthController);
+
+ t.apply();
+ animatorSet.start();
+ return;
+ }
+
// TODO: consider initialTaskPendingIntent
TransitionInfo.Change splitRoot1 = null;
TransitionInfo.Change splitRoot2 = null;
@@ -566,34 +592,16 @@
Animator launcherAnim;
final AnimatorListenerAdapter windowAnimEndListener;
if (launcherClosing) {
- Context context = v.getContext();
- DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
- launcherAnim = dp.isTablet
- ? ObjectAnimator.ofFloat(recentsView, RecentsView.CONTENT_ALPHA, 0)
- : recentsView.createAdjacentPageAnimForTaskLaunch(taskView);
- if (dp.isTablet) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator alpha=" + 0);
- launcherAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = recentsView == null
- ? -1
- : RecentsView.CONTENT_ALPHA.get(recentsView);
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onCancel, alpha="
- + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onEnd");
- }
- });
+ // Since Overview is in launcher, just opening overview sets willFinishToHome to true.
+ // Now that we are closing the launcher, we need to (re)set willFinishToHome back to
+ // false. Otherwise, RecentsAnimationController can't differentiate between closing
+ // overview to 3p home vs closing overview to app.
+ final RecentsAnimationController raController =
+ recentsView.getRecentsAnimationController();
+ if (raController != null) {
+ raController.setWillFinishToHome(false);
}
+ launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView);
launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
launcherAnim.setDuration(RECENTS_LAUNCH_DURATION);
@@ -660,7 +668,7 @@
for (int i = 0; i < nonApps.length; ++i) {
final RemoteAnimationTargetCompat targ = nonApps[i];
final SurfaceControl leash = targ.leash;
- if (targ.windowType == TYPE_DOCK_DIVIDER && leash != null) {
+ if (targ.windowType == TYPE_DOCK_DIVIDER && leash != null && leash.isValid()) {
auxiliarySurfaces.add(leash);
hasSurfaceToAnimate = true;
}
@@ -673,7 +681,9 @@
dockFadeAnimator.addUpdateListener(valueAnimator -> {
float progress = valueAnimator.getAnimatedFraction();
for (SurfaceControl leash : auxiliarySurfaces) {
- t.setAlpha(leash, shown ? progress : 1 - progress);
+ if (leash != null && leash.isValid()) {
+ t.setAlpha(leash, shown ? progress : 1 - progress);
+ }
}
t.apply();
});
@@ -682,6 +692,7 @@
public void onAnimationStart(Animator animation) {
if (shown) {
for (SurfaceControl leash : auxiliarySurfaces) {
+ t.setLayer(leash, Integer.MAX_VALUE);
t.setAlpha(leash, 0);
t.show(leash);
}
@@ -693,7 +704,9 @@
public void onAnimationEnd(Animator animation) {
if (!shown) {
for (SurfaceControl leash : auxiliarySurfaces) {
- t.hide(leash);
+ if (leash != null && leash.isValid()) {
+ t.hide(leash);
+ }
}
t.apply();
}
diff --git a/quickstep/src/com/android/quickstep/TopTaskTracker.java b/quickstep/src/com/android/quickstep/TopTaskTracker.java
index 42fa86d..d4bf5c7 100644
--- a/quickstep/src/com/android/quickstep/TopTaskTracker.java
+++ b/quickstep/src/com/android/quickstep/TopTaskTracker.java
@@ -20,9 +20,11 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.content.Intent.ACTION_CHOOSER;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
+import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
+import android.annotation.UserIdInt;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
@@ -31,9 +33,9 @@
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitStageInfo;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.launcher3.util.SplitConfigurationOptions.StageType;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitStageInfo;
import com.android.launcher3.util.TraceHelper;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
@@ -85,6 +87,19 @@
public void onTaskMovedToFront(RunningTaskInfo taskInfo) {
mOrderedTaskList.removeIf(rto -> rto.taskId == taskInfo.taskId);
mOrderedTaskList.addFirst(taskInfo);
+
+ // Keep the home display's top running task in the first while adding a non-home
+ // display's task to the list, to avoid showing non-home display's task upon going to
+ // Recents animation.
+ if (taskInfo.displayId != DEFAULT_DISPLAY) {
+ final RunningTaskInfo topTaskOnHomeDisplay = mOrderedTaskList.stream()
+ .filter(rto -> rto.displayId == DEFAULT_DISPLAY).findFirst().orElse(null);
+ if (topTaskOnHomeDisplay != null) {
+ mOrderedTaskList.removeIf(rto -> rto.taskId == topTaskOnHomeDisplay.taskId);
+ mOrderedTaskList.addFirst(topTaskOnHomeDisplay);
+ }
+ }
+
if (mOrderedTaskList.size() >= HISTORY_SIZE) {
// If we grow in size, remove the last taskInfo which is not part of the split task.
Iterator<RunningTaskInfo> itr = mOrderedTaskList.descendingIterator();
@@ -268,5 +283,16 @@
}
return result;
}
+
+ @UserIdInt
+ @Nullable
+ public Integer getUserId() {
+ return mTopTask == null ? null : mTopTask.userId;
+ }
+
+ @Nullable
+ public String getPackageName() {
+ return mTopTask == null ? null : mTopTask.baseActivity.getPackageName();
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index bf1c998..4923948 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -23,6 +23,8 @@
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_RECENT_TASKS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_BACK_ANIMATION;
@@ -65,7 +67,6 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.provider.RestoreDbTask;
@@ -73,7 +74,8 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.ResourceUtils;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.LauncherTraceProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
@@ -94,9 +96,11 @@
import com.android.quickstep.inputconsumers.SysUiOverlayInputConsumer;
import com.android.quickstep.inputconsumers.TaskbarStashInputConsumer;
import com.android.quickstep.util.ActiveGestureLog;
+import com.android.quickstep.util.ActiveGestureLog.CompoundString;
import com.android.quickstep.util.ProtoTracer;
import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.SplitScreenBounds;
+import com.android.quickstep.util.ViewCapture;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -126,6 +130,9 @@
public class TouchInteractionService extends Service
implements ProtoTraceable<LauncherTraceProto.Builder> {
+ private static final String SUBSTRING_PREFIX = "; ";
+ private static final String NEWLINE_PREFIX = "\n\t\t\t-> ";
+
private static final String TAG = "TouchInteractionService";
private static final boolean BUBBLES_HOME_GESTURE_ENABLED =
@@ -270,6 +277,18 @@
MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurnedOn);
}
+ @BinderThread
+ @Override
+ public void onScreenTurningOn() {
+ MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOn);
+ }
+
+ @BinderThread
+ @Override
+ public void onScreenTurningOff() {
+ MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOff);
+ }
+
/**
* Preloads the Overview activity.
*
@@ -443,7 +462,8 @@
mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
mOverviewCommandHelper = new OverviewCommandHelper(this,
mOverviewComponentObserver, mTaskAnimationManager);
- mResetGestureInputConsumer = new ResetGestureInputConsumer(mTaskAnimationManager);
+ mResetGestureInputConsumer = new ResetGestureInputConsumer(
+ mTaskAnimationManager, mTaskbarManager::getCurrentActivityContext);
mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
mInputConsumer.registerInputConsumer();
onSystemUiFlagsChanged(mDeviceState.getSystemUiStateFlags());
@@ -607,8 +627,6 @@
mConsumer.onConsumerAboutToBeSwitched();
mGestureState = newGestureState;
mConsumer = newConsumer(prevGestureState, mGestureState, event);
-
- ActiveGestureLog.INSTANCE.addLog("setInputConsumer: " + mConsumer.getName());
mUncheckedConsumer = mConsumer;
} else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode()
&& mDeviceState.canTriggerAssistantAction(event)) {
@@ -616,8 +634,7 @@
// Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we
// should not interrupt it. QuickSwitch assumes that interruption can only
// happen if the next gesture is also quick switch.
- mUncheckedConsumer = tryCreateAssistantInputConsumer(
- InputConsumer.NO_OP, mGestureState, event);
+ mUncheckedConsumer = tryCreateAssistantInputConsumer(mGestureState, event);
} else if (mDeviceState.canTriggerOneHandedAction(event)) {
// Consume gesture event for triggering one handed feature.
mUncheckedConsumer = new OneHandedModeInputConsumer(this, mDeviceState,
@@ -637,12 +654,17 @@
switch (event.getActionMasked()) {
case ACTION_DOWN:
case ACTION_UP:
- ActiveGestureLog.INSTANCE.addLog("onMotionEvent("
- + (int) event.getRawX() + ", " + (int) event.getRawY() + ")",
- event.getActionMasked());
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "onMotionEvent(" + (int) event.getRawX() + ", "
+ + (int) event.getRawY() + "): "
+ + MotionEvent.actionToString(event.getActionMasked()),
+ /* gestureEvent= */ event.getActionMasked() == ACTION_DOWN
+ ? MOTION_DOWN
+ : MOTION_UP);
break;
default:
- ActiveGestureLog.INSTANCE.addLog("onMotionEvent", event.getActionMasked());
+ ActiveGestureLog.INSTANCE.addLog("onMotionEvent: "
+ + MotionEvent.actionToString(event.getActionMasked()));
break;
}
}
@@ -664,73 +686,135 @@
ProtoTracer.INSTANCE.get(this).scheduleFrameUpdate();
}
- private InputConsumer tryCreateAssistantInputConsumer(InputConsumer base,
+ private InputConsumer tryCreateAssistantInputConsumer(
GestureState gestureState, MotionEvent motionEvent) {
- return mDeviceState.isGestureBlockedTask(gestureState.getRunningTask())
- ? base
- : new AssistantInputConsumer(this, gestureState, base, mInputMonitorCompat,
- mDeviceState, motionEvent);
+ return tryCreateAssistantInputConsumer(
+ InputConsumer.NO_OP, gestureState, motionEvent, CompoundString.NO_OP);
+ }
+
+ private InputConsumer tryCreateAssistantInputConsumer(
+ InputConsumer base,
+ GestureState gestureState,
+ MotionEvent motionEvent,
+ CompoundString reasonString) {
+ if (mDeviceState.isGestureBlockedTask(gestureState.getRunningTask())) {
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("is gesture-blocked task, using base input consumer");
+ return base;
+ } else {
+ reasonString.append(SUBSTRING_PREFIX).append("using AssistantInputConsumer");
+ return new AssistantInputConsumer(
+ this, gestureState, base, mInputMonitorCompat, mDeviceState, motionEvent);
+ }
}
public GestureState createGestureState(GestureState previousGestureState) {
- GestureState gestureState = new GestureState(mOverviewComponentObserver,
- ActiveGestureLog.INSTANCE.generateAndSetLogId());
+ final GestureState gestureState;
+ TopTaskTracker.CachedTaskInfo taskInfo;
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
- gestureState.updateRunningTask(previousGestureState.getRunningTask());
+ gestureState = new GestureState(mOverviewComponentObserver,
+ ActiveGestureLog.INSTANCE.getLogId());
+ taskInfo = previousGestureState.getRunningTask();
+ gestureState.updateRunningTask(taskInfo);
gestureState.updateLastStartedTaskId(previousGestureState.getLastStartedTaskId());
gestureState.updatePreviouslyAppearedTaskIds(
previousGestureState.getPreviouslyAppearedTaskIds());
} else {
- gestureState.updateRunningTask(
- TopTaskTracker.INSTANCE.get(this).getCachedTopTask(false));
+ gestureState = new GestureState(mOverviewComponentObserver,
+ ActiveGestureLog.INSTANCE.incrementLogId());
+ taskInfo = TopTaskTracker.INSTANCE.get(this).getCachedTopTask(false);
+ gestureState.updateRunningTask(taskInfo);
}
+ // Log initial state for the gesture.
+ ActiveGestureLog.INSTANCE.addLog(new CompoundString("Current running task package name=")
+ .append(taskInfo == null ? "no running task" : taskInfo.getPackageName()));
+ ActiveGestureLog.INSTANCE.addLog(new CompoundString("Current SystemUi state flags=")
+ .append(mDeviceState.getSystemUiStateString()));
return gestureState;
}
- private InputConsumer newConsumer(GestureState previousGestureState,
- GestureState newGestureState, MotionEvent event) {
+ private InputConsumer newConsumer(
+ GestureState previousGestureState, GestureState newGestureState, MotionEvent event) {
AnimatedFloat progressProxy = mSwipeUpProxyProvider.apply(mGestureState);
if (progressProxy != null) {
- return new ProgressDelegateInputConsumer(this, mTaskAnimationManager,
- mGestureState, mInputMonitorCompat, progressProxy);
+ InputConsumer consumer = new ProgressDelegateInputConsumer(
+ this, mTaskAnimationManager, mGestureState, mInputMonitorCompat, progressProxy);
+
+ logInputConsumerSelectionReason(consumer, newCompoundString(
+ "mSwipeUpProxyProvider has been set, using ProgressDelegateInputConsumer"));
+
+ return consumer;
}
boolean canStartSystemGesture = mDeviceState.canStartSystemGesture();
if (!mDeviceState.isUserUnlocked()) {
+ CompoundString reasonString = newCompoundString("device locked");
+ InputConsumer consumer;
if (canStartSystemGesture) {
// This handles apps launched in direct boot mode (e.g. dialer) as well as apps
// launched while device is locked even after exiting direct boot mode (e.g. camera).
- return createDeviceLockedInputConsumer(newGestureState);
+ consumer = createDeviceLockedInputConsumer(
+ newGestureState, reasonString.append(SUBSTRING_PREFIX)
+ .append("can start system gesture"));
} else {
- return getDefaultInputConsumer();
+ consumer = getDefaultInputConsumer(
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("cannot start system gesture"));
}
+ logInputConsumerSelectionReason(consumer, reasonString);
+ return consumer;
}
+ CompoundString reasonString;
+ InputConsumer base;
// When there is an existing recents animation running, bypass systemState check as this is
// a followup gesture and the first gesture started in a valid system state.
- InputConsumer base = canStartSystemGesture
- || previousGestureState.isRecentsAnimationRunning()
- ? newBaseConsumer(previousGestureState, newGestureState, event)
- : getDefaultInputConsumer();
+ if (canStartSystemGesture || previousGestureState.isRecentsAnimationRunning()) {
+ reasonString = newCompoundString(canStartSystemGesture
+ ? "can start system gesture" : "recents animation was running")
+ .append(", trying to use base consumer");
+ base = newBaseConsumer(previousGestureState, newGestureState, event, reasonString);
+ } else {
+ reasonString = newCompoundString(
+ "cannot start system gesture and recents animation was not running")
+ .append(", trying to use default input consumer");
+ base = getDefaultInputConsumer(reasonString);
+ }
if (mDeviceState.isGesturalNavMode()) {
handleOrientationSetup(base);
}
if (mDeviceState.isFullyGesturalNavMode()) {
+ String reasonPrefix = "device is in gesture navigation mode";
if (mDeviceState.canTriggerAssistantAction(event)) {
- base = tryCreateAssistantInputConsumer(base, newGestureState, event);
+ reasonString.append(NEWLINE_PREFIX)
+ .append(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("gesture can trigger the assistant")
+ .append(", trying to use assistant input consumer");
+ base = tryCreateAssistantInputConsumer(base, newGestureState, event, reasonString);
}
// If Taskbar is present, we listen for long press to unstash it.
TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
if (tac != null) {
+ reasonString.append(NEWLINE_PREFIX)
+ .append(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("TaskbarActivityContext != null, using TaskbarStashInputConsumer");
base = new TaskbarStashInputConsumer(this, base, mInputMonitorCompat, tac);
}
if (mDeviceState.isBubblesExpanded()) {
+ reasonString = newCompoundString(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("bubbles expanded");
if (BUBBLES_HOME_GESTURE_ENABLED) {
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("bubbles can handle the home gesture")
+ .append(", trying to use default input consumer");
// Bubbles can handle home gesture itself.
- base = getDefaultInputConsumer();
+ base = getDefaultInputConsumer(reasonString);
} else {
// If Bubbles is expanded, use the overlay input consumer, which will close
// Bubbles instead of going all the way home when a swipe up is detected.
@@ -738,6 +822,9 @@
// expanded in the back. Make sure swipe up is not passed to bubbles in this
// case.
if (!mDeviceState.isNotificationPanelExpanded()) {
+ reasonString = newCompoundString(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("using SysUiOverlayInputConsumer");
base = new SysUiOverlayInputConsumer(
getBaseContext(), mDeviceState, mInputMonitorCompat);
}
@@ -745,6 +832,9 @@
}
if (mDeviceState.isSystemUiDialogShowing()) {
+ reasonString = newCompoundString(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("system dialog is showing, using SysUiOverlayInputConsumer");
base = new SysUiOverlayInputConsumer(
getBaseContext(), mDeviceState, mInputMonitorCompat);
}
@@ -752,44 +842,91 @@
if (mDeviceState.isScreenPinningActive()) {
+ reasonString = newCompoundString(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("screen pinning is active, using ScreenPinnedInputConsumer");
// Note: we only allow accessibility to wrap this, and it replaces the previous
// base input consumer (which should be NO_OP anyway since topTaskLocked == true).
base = new ScreenPinnedInputConsumer(this, newGestureState);
}
if (mDeviceState.canTriggerOneHandedAction(event)) {
- base = new OneHandedModeInputConsumer(this, mDeviceState, base,
- mInputMonitorCompat);
+ reasonString.append(NEWLINE_PREFIX)
+ .append(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("gesture can trigger one handed mode")
+ .append(", using OneHandedModeInputConsumer");
+ base = new OneHandedModeInputConsumer(
+ this, mDeviceState, base, mInputMonitorCompat);
}
if (mDeviceState.isAccessibilityMenuAvailable()) {
- base = new AccessibilityInputConsumer(this, mDeviceState, base,
- mInputMonitorCompat);
+ reasonString.append(NEWLINE_PREFIX)
+ .append(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("accessibility menu is available")
+ .append(", using AccessibilityInputConsumer");
+ base = new AccessibilityInputConsumer(
+ this, mDeviceState, base, mInputMonitorCompat);
}
} else {
+ String reasonPrefix = "device is not in gesture navigation mode";
if (mDeviceState.isScreenPinningActive()) {
- base = getDefaultInputConsumer();
+ reasonString = newCompoundString(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("screen pinning is active, trying to use default input consumer");
+ base = getDefaultInputConsumer(reasonString);
}
if (mDeviceState.canTriggerOneHandedAction(event)) {
- base = new OneHandedModeInputConsumer(this, mDeviceState, base,
- mInputMonitorCompat);
+ reasonString.append(NEWLINE_PREFIX)
+ .append(reasonPrefix)
+ .append(SUBSTRING_PREFIX)
+ .append("gesture can trigger one handed mode")
+ .append(", using OneHandedModeInputConsumer");
+ base = new OneHandedModeInputConsumer(
+ this, mDeviceState, base, mInputMonitorCompat);
}
}
+ logInputConsumerSelectionReason(base, reasonString);
return base;
}
+ private CompoundString newCompoundString(String substring) {
+ return new CompoundString(NEWLINE_PREFIX).append(substring);
+ }
+
+ private void logInputConsumerSelectionReason(
+ InputConsumer consumer, CompoundString reasonString) {
+ if (!FeatureFlags.ENABLE_INPUT_CONSUMER_REASON_LOGGING.get()) {
+ ActiveGestureLog.INSTANCE.addLog("setInputConsumer: " + consumer.getName());
+ return;
+ }
+ ActiveGestureLog.INSTANCE.addLog(new CompoundString("setInputConsumer: ")
+ .append(consumer.getName())
+ .append(". reason(s):")
+ .append(reasonString));
+ }
+
private void handleOrientationSetup(InputConsumer baseInputConsumer) {
baseInputConsumer.notifyOrientationSetup();
}
- private InputConsumer newBaseConsumer(GestureState previousGestureState,
- GestureState gestureState, MotionEvent event) {
+ private InputConsumer newBaseConsumer(
+ GestureState previousGestureState,
+ GestureState gestureState,
+ MotionEvent event,
+ CompoundString reasonString) {
if (mDeviceState.isKeyguardShowingOccluded()) {
// This handles apps showing over the lockscreen (e.g. camera)
- return createDeviceLockedInputConsumer(gestureState);
+ return createDeviceLockedInputConsumer(
+ gestureState,
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("keyguard is showing occluded")
+ .append(", trying to use device locked input consumer"));
}
+ reasonString.append(SUBSTRING_PREFIX).append("keyguard is not showing occluded");
// Use overview input consumer for sharesheets on top of home.
boolean forceOverviewInputConsumer = gestureState.getActivityInterface().isStarted()
&& gestureState.getRunningTask() != null
@@ -803,23 +940,46 @@
forceOverviewInputConsumer = gestureState.getRunningTask().isHomeTask();
}
+ boolean previousGestureAnimatedToLauncher =
+ previousGestureState.isRunningAnimationToLauncher();
+ // with shell-transitions, home is resumed during recents animation, so
+ // explicitly check against recents animation too.
+ boolean launcherResumedThroughShellTransition =
+ gestureState.getActivityInterface().isResumed()
+ && !previousGestureState.isRecentsAnimationRunning();
if (ENABLE_QUICKSTEP_LIVE_TILE.get()
&& gestureState.getActivityInterface().isInLiveTileMode()) {
return createOverviewInputConsumer(
- previousGestureState, gestureState, event, forceOverviewInputConsumer);
+ previousGestureState,
+ gestureState,
+ event,
+ forceOverviewInputConsumer,
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("is in live tile mode, trying to use overview input consumer"));
} else if (gestureState.getRunningTask() == null) {
- return getDefaultInputConsumer();
- } else if (previousGestureState.isRunningAnimationToLauncher()
- || (gestureState.getActivityInterface().isResumed()
- // with shell-transitions, home is resumed during recents animation, so
- // explicitly check against recents animation too.
- && !previousGestureState.isRecentsAnimationRunning())
+ return getDefaultInputConsumer(reasonString.append(SUBSTRING_PREFIX)
+ .append("running task == null"));
+ } else if (previousGestureAnimatedToLauncher
+ || launcherResumedThroughShellTransition
|| forceOverviewInputConsumer) {
return createOverviewInputConsumer(
- previousGestureState, gestureState, event, forceOverviewInputConsumer);
+ previousGestureState,
+ gestureState,
+ event,
+ forceOverviewInputConsumer,
+ reasonString.append(SUBSTRING_PREFIX)
+ .append(previousGestureAnimatedToLauncher
+ ? "previous gesture animated to launcher"
+ : (launcherResumedThroughShellTransition
+ ? "launcher resumed through a shell transition"
+ : "forceOverviewInputConsumer == true"))
+ .append(", trying to use overview input consumer"));
} else if (mDeviceState.isGestureBlockedTask(gestureState.getRunningTask())) {
- return getDefaultInputConsumer();
+ return getDefaultInputConsumer(reasonString.append(SUBSTRING_PREFIX)
+ .append("is gesture-blocked task, trying to use default input consumer"));
} else {
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("using OtherActivityInputConsumer");
return createOtherActivityInputConsumer(gestureState, event);
}
}
@@ -841,32 +1001,64 @@
mInputMonitorCompat, mInputEventReceiver, disableHorizontalSwipe, factory);
}
- private InputConsumer createDeviceLockedInputConsumer(GestureState gestureState) {
+ private InputConsumer createDeviceLockedInputConsumer(
+ GestureState gestureState, CompoundString reasonString) {
if (mDeviceState.isFullyGesturalNavMode() && gestureState.getRunningTask() != null) {
- return new DeviceLockedInputConsumer(this, mDeviceState, mTaskAnimationManager,
- gestureState, mInputMonitorCompat);
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("device is in gesture nav mode and running task != null")
+ .append(", using DeviceLockedInputConsumer");
+ return new DeviceLockedInputConsumer(
+ this, mDeviceState, mTaskAnimationManager, gestureState, mInputMonitorCompat);
} else {
- return getDefaultInputConsumer();
+ return getDefaultInputConsumer(reasonString
+ .append(SUBSTRING_PREFIX)
+ .append(mDeviceState.isFullyGesturalNavMode()
+ ? "running task == null" : "device is not in gesture nav mode")
+ .append(", trying to use default input consumer"));
}
}
- public InputConsumer createOverviewInputConsumer(GestureState previousGestureState,
- GestureState gestureState, MotionEvent event,
- boolean forceOverviewInputConsumer) {
+ public InputConsumer createOverviewInputConsumer(
+ GestureState previousGestureState,
+ GestureState gestureState,
+ MotionEvent event,
+ boolean forceOverviewInputConsumer,
+ CompoundString reasonString) {
StatefulActivity activity = gestureState.getActivityInterface().getCreatedActivity();
if (activity == null) {
- return getDefaultInputConsumer();
+ return getDefaultInputConsumer(
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("activity == null, trying to use default input consumer"));
}
- if (activity.getRootView().hasWindowFocus()
- || previousGestureState.isRunningAnimationToLauncher()
- || (ASSISTANT_GIVES_LAUNCHER_FOCUS.get()
- && forceOverviewInputConsumer)
- || (ENABLE_QUICKSTEP_LIVE_TILE.get()
- && gestureState.getActivityInterface().isInLiveTileMode())) {
+ boolean hasWindowFocus = activity.getRootView().hasWindowFocus();
+ boolean isPreviousGestureAnimatingToLauncher =
+ previousGestureState.isRunningAnimationToLauncher();
+ boolean forcingOverviewInputConsumer =
+ ASSISTANT_GIVES_LAUNCHER_FOCUS.get() && forceOverviewInputConsumer;
+ boolean isInLiveTileMode = ENABLE_QUICKSTEP_LIVE_TILE.get()
+ && gestureState.getActivityInterface().isInLiveTileMode();
+ reasonString.append(SUBSTRING_PREFIX)
+ .append(hasWindowFocus
+ ? "activity has window focus"
+ : (isPreviousGestureAnimatingToLauncher
+ ? "previous gesture is still animating to launcher"
+ : (forcingOverviewInputConsumer
+ ? "assistant gives launcher focus and forcing focus"
+ : (isInLiveTileMode
+ ? "device is in live mode"
+ : "all overview focus conditions failed"))));
+ if (hasWindowFocus
+ || isPreviousGestureAnimatingToLauncher
+ || forcingOverviewInputConsumer
+ || isInLiveTileMode) {
+ reasonString.append(SUBSTRING_PREFIX)
+ .append("overview should have focus, using OverviewInputConsumer");
return new OverviewInputConsumer(gestureState, activity, mInputMonitorCompat,
false /* startingInActivityBounds */);
} else {
+ reasonString.append(SUBSTRING_PREFIX).append(
+ "overview shouldn't have focus, using OverviewWithoutFocusInputConsumer");
final boolean disableHorizontalSwipe = mDeviceState.isInExclusionRegion(event);
return new OverviewWithoutFocusInputConsumer(activity, mDeviceState, gestureState,
mInputMonitorCompat, disableHorizontalSwipe);
@@ -894,13 +1086,21 @@
}
}
+ private @NonNull InputConsumer getDefaultInputConsumer() {
+ return getDefaultInputConsumer(CompoundString.NO_OP);
+ }
+
/**
* Returns the {@link ResetGestureInputConsumer} if user is unlocked, else NO_OP.
*/
- private @NonNull InputConsumer getDefaultInputConsumer() {
+ private @NonNull InputConsumer getDefaultInputConsumer(@NonNull CompoundString reasonString) {
if (mResetGestureInputConsumer != null) {
+ reasonString.append(SUBSTRING_PREFIX).append(
+ "mResetGestureInputConsumer initialized, using ResetGestureInputConsumer");
return mResetGestureInputConsumer;
} else {
+ reasonString.append(SUBSTRING_PREFIX).append(
+ "mResetGestureInputConsumer not initialized, using no-op input consumer");
// mResetGestureInputConsumer isn't initialized until onUserUnlocked(), so reset to
// NO_OP until then (we never want these to be null).
return InputConsumer.NO_OP;
@@ -1015,15 +1215,18 @@
pw.println("ProtoTrace:");
pw.println(" file=" + ProtoTracer.INSTANCE.get(this).getTraceFile());
if (createdOverviewActivity != null) {
- createdOverviewActivity.getDeviceProfile().dump("", pw);
+ createdOverviewActivity.getDeviceProfile().dump(this, "", pw);
}
mTaskbarManager.dumpLogs("", pw);
+
+ ViewCapture.INSTANCE.get(this).dump(pw, fd);
}
}
private void printAvailableCommands(PrintWriter pw) {
pw.println("Available commands:");
pw.println(" clear-touch-log: Clears the touch interaction log");
+ pw.println(" print-gesture-log: only prints the ActiveGestureLog dump");
}
private void onCommand(PrintWriter pw, LinkedList<String> args) {
@@ -1031,6 +1234,8 @@
case "clear-touch-log":
ActiveGestureLog.INSTANCE.clear();
break;
+ case "print-gesture-log":
+ ActiveGestureLog.INSTANCE.dump("", pw);
}
}
diff --git a/quickstep/src/com/android/quickstep/ViewUtils.java b/quickstep/src/com/android/quickstep/ViewUtils.java
index 1fef544..b132067 100644
--- a/quickstep/src/com/android/quickstep/ViewUtils.java
+++ b/quickstep/src/com/android/quickstep/ViewUtils.java
@@ -17,6 +17,7 @@
import android.graphics.HardwareRenderer;
import android.os.Handler;
+import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;
@@ -45,12 +46,15 @@
return new FrameHandler(view, onFinishRunnable, canceled).schedule();
}
- private static class FrameHandler implements HardwareRenderer.FrameDrawingCallback {
+ private static class FrameHandler implements HardwareRenderer.FrameDrawingCallback,
+ ViewRootImpl.SurfaceChangedCallback {
final ViewRootImpl mViewRoot;
final Runnable mFinishCallback;
final BooleanSupplier mCancelled;
final Handler mHandler;
+ boolean mSurfaceCallbackRegistered = false;
+ boolean mFinished;
int mDeferFrameCount = 1;
@@ -62,6 +66,23 @@
}
@Override
+ public void surfaceCreated(SurfaceControl.Transaction t) {
+ // Do nothing
+ }
+
+ @Override
+ public void surfaceReplaced(SurfaceControl.Transaction t) {
+ // Do nothing
+ }
+
+ @Override
+ public void surfaceDestroyed() {
+ // If the root view is detached, then the app won't get any scheduled frames so we need
+ // to force-run any pending callbacks
+ finish();
+ }
+
+ @Override
public void onFrameDraw(long frame) {
Utilities.postAsyncCallback(mHandler, this::onFrame);
}
@@ -77,18 +98,35 @@
return;
}
- if (mFinishCallback != null) {
- mFinishCallback.run();
- }
+ finish();
}
private boolean schedule() {
if (mViewRoot != null && mViewRoot.getView() != null) {
+ if (!mSurfaceCallbackRegistered) {
+ mSurfaceCallbackRegistered = true;
+ mViewRoot.addSurfaceChangedCallback(this);
+ }
mViewRoot.registerRtFrameCallback(this);
mViewRoot.getView().invalidate();
return true;
}
return false;
}
+
+ private void finish() {
+ if (mFinished) {
+ return;
+ }
+ mFinished = true;
+ mDeferFrameCount = 0;
+ if (mFinishCallback != null) {
+ mFinishCallback.run();
+ }
+ if (mViewRoot != null) {
+ mViewRoot.removeSurfaceChangedCallback(this);
+ mSurfaceCallbackRegistered = false;
+ }
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java b/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java
index 3e01ed0..8a87f63 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java
@@ -22,7 +22,7 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.RecentsActivity;
import com.android.quickstep.util.NavBarPosition;
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
index c7c3441..19a6c38 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
@@ -27,13 +27,13 @@
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
-import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.TASK_MODALNESS;
import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_SPLIT_TRANSLATION;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
+import static com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA;
import static com.android.quickstep.views.TaskView.FLAG_UPDATE_ALL;
import android.util.FloatProperty;
@@ -78,6 +78,11 @@
}
// While animating into recents, update the visible task data as needed
setter.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
+ setter.addEndListener(success -> {
+ if (!success) {
+ mRecentsView.reset();
+ }
+ });
mRecentsView.updateEmptyMessage();
setProperties(toState, config, setter);
@@ -106,16 +111,19 @@
boolean showAsGrid = state.displayOverviewTasksAsGrid(mActivity.getDeviceProfile());
setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f,
showAsGrid ? INSTANT : FINAL_FRAME);
- setter.setFloat(mRecentsView, OVERVIEW_PROGRESS, state == RecentsState.DEFAULT ? 1f : 0f,
- INSTANT);
+ setter.setFloat(mRecentsView, TASK_THUMBNAIL_SPLASH_ALPHA,
+ state.showTaskThumbnailSplash() ? 1f : 0f, INSTANT);
setter.setViewBackgroundColor(mActivity.getScrimView(), state.getScrimColor(mActivity),
config.getInterpolator(ANIM_SCRIM_FADE, LINEAR));
RecentsState currentState = mActivity.getStateManager().getState();
if (isSplitSelectionState(state) && !isSplitSelectionState(currentState)) {
- setter.add(mRecentsView.createSplitSelectInitAnimation(
- state.getTransitionDuration(mActivity, true /* isToState */)).buildAnim());
+ int duration = state.getTransitionDuration(mActivity, true /* isToState */);
+ // TODO (b/246851887): Pass in setter as a NO_ANIM PendingAnimation instead
+ PendingAnimation pa = new PendingAnimation(duration);
+ mRecentsView.createSplitSelectInitAnimation(pa, duration);
+ setter.add(pa.buildAnim());
}
Pair<FloatProperty, FloatProperty> taskViewsFloat =
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index ab3201a..e32aaee 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -15,7 +15,6 @@
*/
package com.android.quickstep.fallback;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.HOME;
@@ -27,7 +26,6 @@
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.MotionEvent;
import androidx.annotation.Nullable;
@@ -35,6 +33,7 @@
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.popup.QuickstepSystemShortcut;
import com.android.launcher3.statemanager.StateManager.StateListener;
import com.android.launcher3.util.SplitConfigurationOptions;
@@ -56,6 +55,8 @@
public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsState>
implements StateListener<RecentsState> {
+ private static final int TASK_DISMISS_DURATION = 150;
+
@Nullable
private Task mHomeTask;
@@ -107,8 +108,9 @@
if (mHomeTask != null && endTarget == RECENTS && animatorSet != null) {
TaskView tv = getTaskViewByTaskId(mHomeTask.key.id);
if (tv != null) {
- PendingAnimation pa = createTaskDismissAnimation(tv, true, false, 150,
- false /* dismissingForSplitSelection*/);
+ PendingAnimation pa = new PendingAnimation(TASK_DISMISS_DURATION);
+ createTaskDismissAnimation(pa, tv, true, false,
+ TASK_DISMISS_DURATION, false /* dismissingForSplitSelection*/);
pa.addEndListener(e -> setCurrentTask(-1));
AnimatorPlaybackController controller = pa.createPlaybackController();
controller.dispatchOnStart();
@@ -212,8 +214,9 @@
@Override
public void initiateSplitSelect(TaskView taskView,
- @SplitConfigurationOptions.StagePosition int stagePosition) {
- super.initiateSplitSelect(taskView, stagePosition);
+ @SplitConfigurationOptions.StagePosition int stagePosition,
+ StatsLogManager.EventEnum splitEvent) {
+ super.initiateSplitSelect(taskView, stagePosition, splitEvent);
mActivity.getStateManager().goToState(OVERVIEW_SPLIT_SELECT);
}
@@ -225,7 +228,6 @@
if (toState == MODAL_TASK) {
setOverviewSelectEnabled(true);
}
- Log.d(BAD_STATE, "FRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
setFreezeViewVisibility(true);
}
@@ -237,8 +239,6 @@
}
boolean isOverlayEnabled = finalState == DEFAULT || finalState == MODAL_TASK;
setOverlayEnabled(isOverlayEnabled);
- Log.d(BAD_STATE, "FRV onStateTransitionComplete setFreezeVisibility=false, finalState="
- + finalState);
setFreezeViewVisibility(false);
if (finalState != MODAL_TASK) {
setOverviewSelectEnabled(false);
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index af9d0cb..223eba5 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -41,6 +41,7 @@
private static final int FLAG_SCRIM = BaseState.getFlag(5);
private static final int FLAG_LIVE_TILE = BaseState.getFlag(6);
private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7);
+ private static final int FLAG_TASK_THUMBNAIL_SPLASH = BaseState.getFlag(8);
public static final RecentsState DEFAULT = new RecentsState(0,
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID
@@ -49,7 +50,8 @@
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL
| FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
public static final RecentsState BACKGROUND_APP = new BackgroundAppState(2,
- FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI);
+ FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI
+ | FLAG_TASK_THUMBNAIL_SPLASH);
public static final RecentsState HOME = new RecentsState(3, 0);
public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0);
public static final RecentsState OVERVIEW_SPLIT_SELECT = new RecentsState(5,
@@ -139,6 +141,11 @@
return hasFlag(FLAG_SHOW_AS_GRID) && deviceProfile.isTablet;
}
+ @Override
+ public boolean showTaskThumbnailSplash() {
+ return hasFlag(FLAG_TASK_THUMBNAIL_SPLASH);
+ }
+
/**
* True if the state has overview panel visible.
*/
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
index 8da2fd3..03f8eef 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
@@ -3,7 +3,7 @@
import android.view.MotionEvent;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.quickstep.InputConsumer;
import com.android.systemui.shared.system.InputMonitorCompat;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
index c1750b5..6bc24f2 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
@@ -42,7 +42,7 @@
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.GestureState;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
index bc20902..d7ed79b 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
@@ -21,7 +21,7 @@
import static android.view.MotionEvent.ACTION_MOVE;
import static android.view.MotionEvent.ACTION_UP;
-import static com.android.launcher3.ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE;
import static com.android.launcher3.Utilities.squaredHypot;
import android.content.Context;
@@ -30,7 +30,7 @@
import android.view.MotionEvent;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.InputConsumer;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
index 641385d..7ccd8af 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
@@ -30,6 +30,7 @@
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.TraceHelper.FLAG_CHECK_FOR_RACE_CONDITIONS;
import static com.android.launcher3.util.VelocityUtils.PX_PER_MS;
+import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION;
import static com.android.quickstep.util.ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID;
import android.annotation.TargetApi;
@@ -50,7 +51,7 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.TraceHelper;
@@ -359,7 +360,6 @@
}
private void notifyGestureStarted(boolean isLikelyToStartNewTask) {
- ActiveGestureLog.INSTANCE.addLog("startQuickstep");
if (mInteractionHandler == null) {
return;
}
@@ -373,7 +373,9 @@
}
private void startTouchTrackingForWindowAnimation(long touchTimeMs) {
- ActiveGestureLog.INSTANCE.addLog("startRecentsAnimation");
+ ActiveGestureLog.INSTANCE.addLog(
+ /* event= */ "startRecentsAnimation",
+ /* gestureEvent= */ START_RECENTS_ANIMATION);
mInteractionHandler = mHandlerFactory.newHandler(mGestureState, touchTimeMs);
mInteractionHandler.setGestureEndCallback(this::onInteractionGestureFinished);
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
index 02ac48e..6f35928 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
@@ -29,13 +29,12 @@
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.BaseActivityInterface;
import com.android.quickstep.GestureState;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.TaskUtils;
-import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.system.InputMonitorCompat;
/**
@@ -91,7 +90,6 @@
if (!mStartingInActivityBounds) {
mActivityInterface.closeOverlay();
TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
- ActiveGestureLog.INSTANCE.addLog("startQuickstep");
}
if (mInputMonitor != null) {
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
index a730183..b70fe8e 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
@@ -28,11 +28,10 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.GestureState;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.RecentsAnimationDeviceState;
-import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.TriggerSwipeUpTouchTracker;
import com.android.systemui.shared.system.InputMonitorCompat;
@@ -79,7 +78,6 @@
@Override
public void onSwipeUp(boolean wasFling, PointF finalVelocity) {
startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null);
- ActiveGestureLog.INSTANCE.addLog("startQuickstep");
BaseActivity activity = BaseDraggingActivity.fromContext(mContext);
int state = (mGestureState != null && mGestureState.getEndTarget() != null)
? mGestureState.getEndTarget().containerType
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
index 71dca66..b9b5e7c 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -28,9 +28,11 @@
import android.graphics.Point;
import android.view.MotionEvent;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.AnimatedFloat;
@@ -41,6 +43,7 @@
import com.android.quickstep.RecentsAnimationController;
import com.android.quickstep.RecentsAnimationTargets;
import com.android.quickstep.TaskAnimationManager;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InputMonitorCompat;
@@ -99,7 +102,8 @@
mDisplaySize = DisplayController.INSTANCE.get(context).getInfo().currentSize;
// Init states
- mStateCallback = new MultiStateCallback(STATE_NAMES);
+ mStateCallback = new MultiStateCallback(
+ STATE_NAMES, ProgressDelegateInputConsumer::getTrackedEventForState);
mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_HANDLER_INVALIDATED,
this::endRemoteAnimation);
mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_FLING_FINISHED,
@@ -109,6 +113,14 @@
mSwipeDetector.setDetectableScrollConditions(DIRECTION_POSITIVE, false);
}
+ @Nullable
+ private static ActiveGestureErrorDetector.GestureEvent getTrackedEventForState(int stateFlag) {
+ if (stateFlag == STATE_HANDLER_INVALIDATED) {
+ return ActiveGestureErrorDetector.GestureEvent.STATE_HANDLER_INVALIDATED;
+ }
+ return null;
+ }
+
@Override
public int getType() {
return TYPE_PROGRESS_DELEGATE;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java
index d34b40b..349f4d2 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java
@@ -17,18 +17,25 @@
import android.view.MotionEvent;
+import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.TaskAnimationManager;
+import java.util.function.Supplier;
+
/**
* A NO_OP input consumer which also resets any pending gesture
*/
public class ResetGestureInputConsumer implements InputConsumer {
private final TaskAnimationManager mTaskAnimationManager;
+ private final Supplier<TaskbarActivityContext> mActivityContextSupplier;
- public ResetGestureInputConsumer(TaskAnimationManager taskAnimationManager) {
+ public ResetGestureInputConsumer(
+ TaskAnimationManager taskAnimationManager,
+ Supplier<TaskbarActivityContext> activityContextSupplier) {
mTaskAnimationManager = taskAnimationManager;
+ mActivityContextSupplier = activityContextSupplier;
}
@Override
@@ -40,7 +47,9 @@
public void onMotionEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN
&& mTaskAnimationManager.isRecentsAnimationRunning()) {
- mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */);
+ TaskbarActivityContext tac = mActivityContextSupplier.get();
+ mTaskAnimationManager.finishRunningRecentsAnimation(
+ /* toHome= */ tac != null && !tac.isInApp());
}
}
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
index 878f132..4806ac1 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
@@ -23,7 +23,7 @@
import android.view.MotionEvent;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.RecentsAnimationDeviceState;
import com.android.quickstep.util.TriggerSwipeUpTouchTracker;
diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
index d059d82..8660d87 100644
--- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
@@ -29,7 +29,7 @@
import androidx.annotation.Nullable;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
index b2b2f59..437572b 100644
--- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
+++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
@@ -41,7 +41,7 @@
import androidx.dynamicanimation.animation.SpringForce;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
import com.android.quickstep.util.VibratorWrapper;
diff --git a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
index f981860..e7bf7e2 100644
--- a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
@@ -44,10 +44,10 @@
import androidx.annotation.Nullable;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.NavBarPosition;
import com.android.quickstep.util.TriggerSwipeUpTouchTracker;
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index b70c411..fa7bc04 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -358,7 +358,7 @@
};
RectFSpringAnim windowAnim = createWindowAnimationToHome(startShift,
homeAnimFactory)[0];
- windowAnim.start(mContext, velocityPxPerMs);
+ windowAnim.start(mContext, mDp, velocityPxPerMs);
return windowAnim;
}
}
diff --git a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
index bd0250d..2ccdfa3 100644
--- a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
+++ b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
@@ -40,15 +40,14 @@
import com.android.launcher3.AutoInstallsLayout;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.DisplayController.NavigationMode;
import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SettingsCache;
import org.xmlpull.v1.XmlPullParser;
@@ -179,11 +178,9 @@
logger::log);
SharedPreferences prefs = getPrefs(mContext);
- if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
- logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false)
- ? LAUNCHER_THEMED_ICON_ENABLED
- : LAUNCHER_THEMED_ICON_DISABLED);
- }
+ logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false)
+ ? LAUNCHER_THEMED_ICON_ENABLED
+ : LAUNCHER_THEMED_ICON_DISABLED);
mLoggablePrefs.forEach((key, lp) -> logger.log(() ->
prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
diff --git a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
index 45c8036..37a28e5 100644
--- a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
+++ b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
@@ -336,8 +336,9 @@
appState.getModel().enqueueModelUpdateTask(
new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel,
- AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
FolderInfo folderInfo = dataModel.folders.get(mItemInfo.container);
write(event, applyOverwrites(mItemInfo.buildProto(folderInfo)));
}
diff --git a/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java
new file mode 100644
index 0000000..53e0c2b
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util;
+
+import android.util.ArraySet;
+
+import androidx.annotation.NonNull;
+
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Utility class for tracking gesture navigation events as they happen, then detecting and reporting
+ * known issues at log dump time.
+ */
+public class ActiveGestureErrorDetector {
+
+ /**
+ * Enums associated to gesture navigation events.
+ */
+ public enum GestureEvent {
+ MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_LAST_TASK,
+ SET_END_TARGET_NEW_TASK, ON_SETTLED_ON_END_TARGET, START_RECENTS_ANIMATION,
+ FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK,
+ CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, TASK_APPEARED,
+
+ /**
+ * These GestureEvents are specifically associated to state flags that get set in
+ * {@link com.android.quickstep.MultiStateCallback}. If a state flag needs to be tracked
+ * for error detection, an enum should be added here and that state flag-enum pair should
+ * be added to the state flag's container class' {@code getTrackedEventForState} method.
+ */
+ STATE_GESTURE_STARTED, STATE_GESTURE_COMPLETED, STATE_GESTURE_CANCELLED,
+ STATE_END_TARGET_ANIMATION_FINISHED, STATE_RECENTS_SCROLLING_FINISHED,
+ STATE_CAPTURE_SCREENSHOT, STATE_SCREENSHOT_CAPTURED, STATE_HANDLER_INVALIDATED,
+ STATE_RECENTS_ANIMATION_CANCELED, STATE_LAUNCHER_DRAWN(true, false);
+
+ public final boolean mLogEvent;
+ public final boolean mTrackEvent;
+
+ GestureEvent() {
+ this(false, true);
+ }
+
+ GestureEvent(boolean logEvent, boolean trackEvent) {
+ mLogEvent = logEvent;
+ mTrackEvent = trackEvent;
+ }
+ }
+
+ private ActiveGestureErrorDetector() {}
+
+ protected static void analyseAndDump(
+ @NonNull String prefix,
+ @NonNull PrintWriter writer,
+ List<ActiveGestureLog.EventLog> eventLogs) {
+ writer.println(prefix + "ActiveGestureErrorDetector:");
+ for (int i = 0; i < eventLogs.size(); i++) {
+ ActiveGestureLog.EventLog eventLog = eventLogs.get(i);
+ if (eventLog == null) {
+ continue;
+ }
+ int gestureId = eventLog.logId;
+ writer.println(prefix + "\tError messages for gesture ID: " + gestureId);
+
+ boolean errorDetected = false;
+ // Use a Set since the order is inherently checked in the loop.
+ final Set<GestureEvent> encounteredEvents = new ArraySet<>();
+ // Set flags and check order of operations.
+ for (ActiveGestureLog.EventEntry eventEntry : eventLog.eventEntries) {
+ GestureEvent gestureEvent = eventEntry.getGestureEvent();
+ if (gestureEvent == null) {
+ continue;
+ }
+ encounteredEvents.add(gestureEvent);
+ switch (gestureEvent) {
+ case MOTION_UP:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.MOTION_DOWN),
+ /* errorMessage= */ prefix + "\t\tMotion up detected before/without"
+ + " motion down.",
+ writer);
+ break;
+ case ON_SETTLED_ON_END_TARGET:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.SET_END_TARGET),
+ /* errorMessage= */ prefix + "\t\tonSettledOnEndTarget called "
+ + "before/without setEndTarget.",
+ writer);
+ break;
+ case FINISH_RECENTS_ANIMATION:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION),
+ /* errorMessage= */ prefix + "\t\tfinishRecentsAnimation called "
+ + "before/without startRecentsAnimation.",
+ writer);
+ break;
+ case CANCEL_RECENTS_ANIMATION:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION),
+ /* errorMessage= */ prefix + "\t\tcancelRecentsAnimation called "
+ + "before/without startRecentsAnimation.",
+ writer);
+ break;
+ case CLEANUP_SCREENSHOT:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.STATE_SCREENSHOT_CAPTURED),
+ /* errorMessage= */ prefix + "\t\trecents activity screenshot was "
+ + "cleaned up before/without STATE_SCREENSHOT_CAPTURED "
+ + "being set.",
+ writer);
+ break;
+ case SCROLLER_ANIMATION_ABORTED:
+ errorDetected |= printErrorIfTrue(
+ encounteredEvents.contains(GestureEvent.SET_END_TARGET_HOME)
+ && !encounteredEvents.contains(
+ GestureEvent.ON_SETTLED_ON_END_TARGET),
+ /* errorMessage= */ prefix + "\t\trecents view scroller animation "
+ + "aborted after setting end target HOME, but before"
+ + " settling on end target.",
+ writer);
+ break;
+ case TASK_APPEARED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.SET_END_TARGET_LAST_TASK)
+ && !encounteredEvents.contains(
+ GestureEvent.SET_END_TARGET_NEW_TASK),
+ /* errorMessage= */ prefix + "\t\tonTasksAppeared called "
+ + "before/without setting end target to last or new task",
+ writer);
+ break;
+ case STATE_GESTURE_COMPLETED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.MOTION_UP),
+ /* errorMessage= */ prefix + "\t\tSTATE_GESTURE_COMPLETED set "
+ + "before/without motion up.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.STATE_GESTURE_STARTED),
+ /* errorMessage= */ prefix + "\t\tSTATE_GESTURE_COMPLETED set "
+ + "before/without STATE_GESTURE_STARTED.",
+ writer);
+ break;
+ case STATE_GESTURE_CANCELLED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.MOTION_UP),
+ /* errorMessage= */ prefix + "\t\tSTATE_GESTURE_CANCELLED set "
+ + "before/without motion up.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.STATE_GESTURE_STARTED),
+ /* errorMessage= */ prefix + "\t\tSTATE_GESTURE_CANCELLED set "
+ + "before/without STATE_GESTURE_STARTED.",
+ writer);
+ break;
+ case STATE_SCREENSHOT_CAPTURED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.STATE_CAPTURE_SCREENSHOT),
+ /* errorMessage= */ prefix + "\t\tSTATE_SCREENSHOT_CAPTURED set "
+ + "before/without STATE_CAPTURE_SCREENSHOT.",
+ writer);
+ break;
+ case STATE_RECENTS_SCROLLING_FINISHED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(
+ GestureEvent.SET_ON_PAGE_TRANSITION_END_CALLBACK),
+ /* errorMessage= */ prefix + "\t\tSTATE_RECENTS_SCROLLING_FINISHED "
+ + "set before/without calling "
+ + "setOnPageTransitionEndCallback.",
+ writer);
+ break;
+ case STATE_RECENTS_ANIMATION_CANCELED:
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(
+ GestureEvent.START_RECENTS_ANIMATION),
+ /* errorMessage= */ prefix + "\t\tSTATE_RECENTS_ANIMATION_CANCELED "
+ + "set before/without startRecentsAnimation.",
+ writer);
+ break;
+ case MOTION_DOWN:
+ case SET_END_TARGET:
+ case SET_END_TARGET_HOME:
+ case START_RECENTS_ANIMATION:
+ case SET_ON_PAGE_TRANSITION_END_CALLBACK:
+ case CANCEL_CURRENT_ANIMATION:
+ case STATE_GESTURE_STARTED:
+ case STATE_END_TARGET_ANIMATION_FINISHED:
+ case STATE_CAPTURE_SCREENSHOT:
+ case STATE_HANDLER_INVALIDATED:
+ case STATE_LAUNCHER_DRAWN:
+ default:
+ // No-Op
+ }
+ }
+
+ // Check that all required events were found.
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.MOTION_DOWN),
+ /* errorMessage= */ prefix + "\t\tMotion down never detected.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ !encounteredEvents.contains(GestureEvent.MOTION_UP),
+ /* errorMessage= */ prefix + "\t\tMotion up never detected.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(GestureEvent.SET_END_TARGET)
+ && !encounteredEvents.contains(GestureEvent.ON_SETTLED_ON_END_TARGET),
+ /* errorMessage= */ prefix + "\t\tsetEndTarget was called, but "
+ + "onSettledOnEndTarget wasn't.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(GestureEvent.SET_END_TARGET)
+ && !encounteredEvents.contains(
+ GestureEvent.STATE_END_TARGET_ANIMATION_FINISHED),
+ /* errorMessage= */ prefix + "\t\tsetEndTarget was called, but "
+ + "STATE_END_TARGET_ANIMATION_FINISHED was never set.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(GestureEvent.SET_END_TARGET)
+ && !encounteredEvents.contains(
+ GestureEvent.STATE_RECENTS_SCROLLING_FINISHED),
+ /* errorMessage= */ prefix + "\t\tsetEndTarget was called, but "
+ + "STATE_RECENTS_SCROLLING_FINISHED was never set.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.STATE_END_TARGET_ANIMATION_FINISHED)
+ && encounteredEvents.contains(
+ GestureEvent.STATE_RECENTS_SCROLLING_FINISHED)
+ && !encounteredEvents.contains(GestureEvent.ON_SETTLED_ON_END_TARGET),
+ /* errorMessage= */ prefix + "\t\tSTATE_END_TARGET_ANIMATION_FINISHED and "
+ + "STATE_RECENTS_SCROLLING_FINISHED were set, but onSettledOnEndTarget "
+ + "wasn't called.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.START_RECENTS_ANIMATION)
+ && !encounteredEvents.contains(GestureEvent.FINISH_RECENTS_ANIMATION)
+ && !encounteredEvents.contains(GestureEvent.CANCEL_RECENTS_ANIMATION),
+ /* errorMessage= */ prefix + "\t\tstartRecentsAnimation was called, but "
+ + "finishRecentsAnimation and cancelRecentsAnimation weren't.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(GestureEvent.STATE_GESTURE_STARTED)
+ && !encounteredEvents.contains(GestureEvent.STATE_GESTURE_COMPLETED)
+ && !encounteredEvents.contains(GestureEvent.STATE_GESTURE_CANCELLED),
+ /* errorMessage= */ prefix + "\t\tSTATE_GESTURE_STARTED was set, but "
+ + "STATE_GESTURE_COMPLETED and STATE_GESTURE_CANCELLED weren't.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.STATE_CAPTURE_SCREENSHOT)
+ && !encounteredEvents.contains(GestureEvent.STATE_SCREENSHOT_CAPTURED),
+ /* errorMessage= */ prefix + "\t\tSTATE_CAPTURE_SCREENSHOT was set, but "
+ + "STATE_SCREENSHOT_CAPTURED wasn't.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.SET_ON_PAGE_TRANSITION_END_CALLBACK)
+ && !encounteredEvents.contains(
+ GestureEvent.STATE_RECENTS_SCROLLING_FINISHED),
+ /* errorMessage= */ prefix + "\t\tsetOnPageTransitionEndCallback called, but "
+ + "STATE_RECENTS_SCROLLING_FINISHED wasn't set.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ !encounteredEvents.contains(
+ GestureEvent.CANCEL_CURRENT_ANIMATION)
+ && !encounteredEvents.contains(GestureEvent.STATE_HANDLER_INVALIDATED),
+ /* errorMessage= */ prefix + "\t\tAbsSwipeUpHandler.cancelCurrentAnimation "
+ + "wasn't called and STATE_HANDLER_INVALIDATED wasn't set.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.STATE_RECENTS_ANIMATION_CANCELED)
+ && !encounteredEvents.contains(GestureEvent.CLEANUP_SCREENSHOT),
+ /* errorMessage= */ prefix + "\t\tSTATE_RECENTS_ANIMATION_CANCELED was set but "
+ + "the task screenshot wasn't cleaned up.",
+ writer);
+
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.SET_END_TARGET_LAST_TASK)
+ && !encounteredEvents.contains(GestureEvent.TASK_APPEARED),
+ /* errorMessage= */ prefix + "\t\tend target set to last task, but "
+ + "onTaskAppeared wasn't called.",
+ writer);
+ errorDetected |= printErrorIfTrue(
+ /* condition= */ encounteredEvents.contains(
+ GestureEvent.SET_END_TARGET_NEW_TASK)
+ && !encounteredEvents.contains(GestureEvent.TASK_APPEARED),
+ /* errorMessage= */ prefix + "\t\tend target set to new task, but "
+ + "onTaskAppeared wasn't called.",
+ writer);
+
+ if (!errorDetected) {
+ writer.println(prefix + "\t\tNo errors detected.");
+ }
+ }
+ }
+
+ private static boolean printErrorIfTrue(
+ boolean condition, String errorMessage, PrintWriter writer) {
+ if (!condition) {
+ return false;
+ }
+ writer.println(errorMessage);
+ return true;
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java b/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
index fabfc4b..23fdd58 100644
--- a/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
+++ b/quickstep/src/com/android/quickstep/util/ActiveGestureLog.java
@@ -15,15 +15,26 @@
*/
package com.android.quickstep.util;
-import android.content.Context;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
-import com.android.launcher3.logging.EventLogArray;
-import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.config.FeatureFlags;
+
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
/**
* A log to keep track of the active gesture.
*/
-public class ActiveGestureLog extends EventLogArray {
+public class ActiveGestureLog {
+
+ private static final int MAX_GESTURES_TRACKED = 10;
public static final ActiveGestureLog INSTANCE = new ActiveGestureLog();
@@ -33,7 +44,306 @@
*/
public static final String INTENT_EXTRA_LOG_TRACE_ID = "INTENT_EXTRA_LOG_TRACE_ID";
+ private static final int TYPE_ONE_OFF = 0;
+ private static final int TYPE_FLOAT = 1;
+ private static final int TYPE_INTEGER = 2;
+ private static final int TYPE_BOOL_TRUE = 3;
+ private static final int TYPE_BOOL_FALSE = 4;
+ private static final int TYPE_INPUT_CONSUMER = 5;
+ private static final int TYPE_GESTURE_EVENT = 6;
+
+ private final EventLog[] logs;
+ private int nextIndex;
+ private int mCurrentLogId = 100;
+
private ActiveGestureLog() {
- super("touch_interaction_log", 40);
+ this.logs = new EventLog[MAX_GESTURES_TRACKED];
+ this.nextIndex = 0;
+ }
+
+ /**
+ * Track the given event for error detection.
+ *
+ * @param gestureEvent GestureEvent representing an event during the current gesture's
+ * execution.
+ */
+ public void trackEvent(@Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ addLog(TYPE_GESTURE_EVENT, "", 0, CompoundString.NO_OP, gestureEvent);
+ }
+
+ public void addLog(String event) {
+ addLog(event, null);
+ }
+
+ public void addLog(String event, int extras) {
+ addLog(event, extras, null);
+ }
+
+ public void addLog(String event, boolean extras) {
+ addLog(event, extras, null);
+ }
+
+ public void addLog(CompoundString compoundString) {
+ addLog(TYPE_INPUT_CONSUMER, "", 0, compoundString, null);
+ }
+
+ /**
+ * Adds a log and track the associated event for error detection.
+ *
+ * @param gestureEvent GestureEvent representing the event being logged.
+ */
+ public void addLog(
+ String event, @Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ addLog(TYPE_ONE_OFF, event, 0, CompoundString.NO_OP, gestureEvent);
+ }
+
+ public void addLog(
+ String event,
+ int extras,
+ @Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ addLog(TYPE_INTEGER, event, extras, CompoundString.NO_OP, gestureEvent);
+ }
+
+ public void addLog(
+ String event,
+ boolean extras,
+ @Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ addLog(
+ extras ? TYPE_BOOL_TRUE : TYPE_BOOL_FALSE,
+ event,
+ 0,
+ CompoundString.NO_OP,
+ gestureEvent);
+ }
+
+ private void addLog(
+ int type,
+ String event,
+ float extras,
+ CompoundString compoundString,
+ @Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ EventLog lastEventLog = logs[(nextIndex + logs.length - 1) % logs.length];
+ if (lastEventLog == null || mCurrentLogId != lastEventLog.logId) {
+ EventLog eventLog = new EventLog(mCurrentLogId);
+ EventEntry eventEntry = new EventEntry();
+
+ eventEntry.update(type, event, extras, compoundString, gestureEvent);
+ eventLog.eventEntries.add(eventEntry);
+ logs[nextIndex] = eventLog;
+ nextIndex = (nextIndex + 1) % logs.length;
+ return;
+ }
+
+ // Update the last EventLog
+ List<EventEntry> lastEventEntries = lastEventLog.eventEntries;
+ EventEntry lastEntry = lastEventEntries.size() > 0
+ ? lastEventEntries.get(lastEventEntries.size() - 1) : null;
+
+ // Update the last EventEntry if it's a duplicate
+ if (isEntrySame(lastEntry, type, event, extras, compoundString, gestureEvent)) {
+ lastEntry.duplicateCount++;
+ return;
+ }
+ EventEntry eventEntry = new EventEntry();
+
+ eventEntry.update(type, event, extras, compoundString, gestureEvent);
+ lastEventEntries.add(eventEntry);
+ }
+
+ public void clear() {
+ Arrays.fill(logs, null);
+ }
+
+ public void dump(String prefix, PrintWriter writer) {
+ writer.println(prefix + "ActiveGestureLog history:");
+ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSSZ ", Locale.US);
+ Date date = new Date();
+ ArrayList<EventLog> eventLogs = new ArrayList<>();
+
+ for (int i = 0; i < logs.length; i++) {
+ EventLog eventLog = logs[(nextIndex + i) % logs.length];
+ if (eventLog == null) {
+ continue;
+ }
+ eventLogs.add(eventLog);
+ writer.println(prefix + "\tLogs for logId: " + eventLog.logId);
+
+ for (EventEntry eventEntry : eventLog.eventEntries) {
+ date.setTime(eventEntry.time);
+
+ StringBuilder msg = new StringBuilder(prefix + "\t\t").append(sdf.format(date))
+ .append(eventEntry.event);
+ switch (eventEntry.type) {
+ case TYPE_BOOL_FALSE:
+ msg.append(": false");
+ break;
+ case TYPE_BOOL_TRUE:
+ msg.append(": true");
+ break;
+ case TYPE_FLOAT:
+ msg.append(": ").append(eventEntry.extras);
+ break;
+ case TYPE_INTEGER:
+ msg.append(": ").append((int) eventEntry.extras);
+ break;
+ case TYPE_INPUT_CONSUMER:
+ msg.append(eventEntry.mCompoundString);
+ break;
+ case TYPE_GESTURE_EVENT:
+ continue;
+ default: // fall out
+ }
+ if (eventEntry.duplicateCount > 0) {
+ msg.append(" & ").append(eventEntry.duplicateCount).append(" similar events");
+ }
+ writer.println(msg);
+ }
+ }
+
+ if (FeatureFlags.ENABLE_GESTURE_ERROR_DETECTION.get()) {
+ ActiveGestureErrorDetector.analyseAndDump(prefix + '\t', writer, eventLogs);
+ }
+ }
+
+ /**
+ * Increments and returns the current log ID. This should be used every time a new log trace
+ * is started.
+ */
+ public int incrementLogId() {
+ return mCurrentLogId++;
+ }
+
+ /** Returns the current log ID. This should be used when a log trace is being reused. */
+ public int getLogId() {
+ return mCurrentLogId;
+ }
+
+ private boolean isEntrySame(
+ EventEntry entry,
+ int type,
+ String event,
+ float extras,
+ CompoundString compoundString,
+ ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ return entry != null
+ && entry.type == type
+ && entry.event.equals(event)
+ && Float.compare(entry.extras, extras) == 0
+ && entry.mCompoundString.equals(compoundString)
+ && entry.gestureEvent == gestureEvent;
+ }
+
+ /** A single event entry. */
+ protected static class EventEntry {
+
+ private int type;
+ private String event;
+ private float extras;
+ @NonNull private CompoundString mCompoundString;
+ private ActiveGestureErrorDetector.GestureEvent gestureEvent;
+ private long time;
+ private int duplicateCount;
+
+ private EventEntry() {}
+
+ @Nullable
+ protected ActiveGestureErrorDetector.GestureEvent getGestureEvent() {
+ return gestureEvent;
+ }
+
+ private void update(
+ int type,
+ String event,
+ float extras,
+ @NonNull CompoundString compoundString,
+ ActiveGestureErrorDetector.GestureEvent gestureEvent) {
+ this.type = type;
+ this.event = event;
+ this.extras = extras;
+ this.mCompoundString = compoundString;
+ this.gestureEvent = gestureEvent;
+ time = System.currentTimeMillis();
+ duplicateCount = 0;
+ }
+ }
+
+ /** An entire log of entries associated with a single log ID */
+ protected static class EventLog {
+
+ protected final List<EventEntry> eventEntries = new ArrayList<>();
+ protected final int logId;
+
+ private EventLog(int logId) {
+ this.logId = logId;
+ }
+ }
+
+ /** A buildable string stored as an array for memory efficiency. */
+ public static class CompoundString {
+
+ public static final CompoundString NO_OP = new CompoundString();
+
+ private final List<String> mSubstrings;
+
+ private final boolean mIsNoOp;
+
+ private CompoundString() {
+ this(null);
+ }
+
+ public CompoundString(String substring) {
+ mIsNoOp = substring == null;
+ if (mIsNoOp) {
+ mSubstrings = null;
+ return;
+ }
+ mSubstrings = new ArrayList<>();
+ mSubstrings.add(substring);
+ }
+
+ public CompoundString append(CompoundString substring) {
+ if (mIsNoOp) {
+ return this;
+ }
+ mSubstrings.addAll(substring.mSubstrings);
+
+ return this;
+ }
+
+ public CompoundString append(String substring) {
+ if (mIsNoOp) {
+ return this;
+ }
+ mSubstrings.add(substring);
+
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ if (mIsNoOp) {
+ return "ERROR: cannot use No-Op compound string";
+ }
+ StringBuilder sb = new StringBuilder();
+ for (String substring : mSubstrings) {
+ sb.append(substring);
+ }
+
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mIsNoOp, mSubstrings);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof CompoundString)) {
+ return false;
+ }
+ CompoundString other = (CompoundString) obj;
+ return (mIsNoOp == other.mIsNoOp) && Objects.equals(mSubstrings, other.mSubstrings);
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/util/BaseDepthController.java b/quickstep/src/com/android/quickstep/util/BaseDepthController.java
new file mode 100644
index 0000000..29ae9a1
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/BaseDepthController.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util;
+
+import android.app.WallpaperManager;
+import android.os.IBinder;
+import android.util.FloatProperty;
+import android.view.AttachedSurfaceControl;
+import android.view.SurfaceControl;
+
+import com.android.launcher3.Launcher;
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.util.MultiPropertyFactory;
+import com.android.systemui.shared.system.BlurUtils;
+
+/**
+ * Utility class for applying depth effect
+ */
+public class BaseDepthController {
+
+ private static final FloatProperty<BaseDepthController> DEPTH =
+ new FloatProperty<BaseDepthController>("depth") {
+ @Override
+ public void setValue(BaseDepthController depthController, float depth) {
+ depthController.setDepth(depth);
+ }
+
+ @Override
+ public Float get(BaseDepthController depthController) {
+ return depthController.mDepth;
+ }
+ };
+
+ private static final MultiPropertyFactory<BaseDepthController> DEPTH_PROPERTY_FACTORY =
+ new MultiPropertyFactory<>("depthProperty", DEPTH, Float::max);
+
+ private static final int DEPTH_INDEX_STATE_TRANSITION = 1;
+ private static final int DEPTH_INDEX_WIDGET = 2;
+
+ /** Property to set the depth for state transition. */
+ public static final FloatProperty<BaseDepthController> STATE_DEPTH =
+ DEPTH_PROPERTY_FACTORY.get(DEPTH_INDEX_STATE_TRANSITION);
+ /** Property to set the depth for widget picker. */
+ public static final FloatProperty<BaseDepthController> WIDGET_DEPTH =
+ DEPTH_PROPERTY_FACTORY.get(DEPTH_INDEX_WIDGET);
+
+ protected final Launcher mLauncher;
+
+ /**
+ * Blur radius when completely zoomed out, in pixels.
+ */
+ protected final int mMaxBlurRadius;
+ protected final WallpaperManager mWallpaperManager;
+ protected boolean mCrossWindowBlursEnabled;
+
+ /**
+ * Ratio from 0 to 1, where 0 is fully zoomed out, and 1 is zoomed in.
+ * @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float)
+ */
+ protected float mDepth;
+
+ protected SurfaceControl mSurface;
+
+ // Hints that there is potentially content behind Launcher and that we shouldn't optimize by
+ // marking the launcher surface as opaque. Only used in certain Launcher states.
+ private boolean mHasContentBehindLauncher;
+ /**
+ * Last blur value, in pixels, that was applied.
+ * For debugging purposes.
+ */
+ protected int mCurrentBlur;
+ /**
+ * If we requested early wake-up offsets to SurfaceFlinger.
+ */
+ protected boolean mInEarlyWakeUp;
+
+ public BaseDepthController(Launcher activity) {
+ mLauncher = activity;
+ mMaxBlurRadius = activity.getResources().getInteger(R.integer.max_depth_blur_radius);
+ mWallpaperManager = activity.getSystemService(WallpaperManager.class);
+ }
+
+ protected void setCrossWindowBlursEnabled(boolean isEnabled) {
+ mCrossWindowBlursEnabled = isEnabled;
+ applyDepthAndBlur();
+ }
+
+ public void setHasContentBehindLauncher(boolean hasContentBehindLauncher) {
+ mHasContentBehindLauncher = hasContentBehindLauncher;
+ }
+
+ protected void applyDepthAndBlur() {
+ float depth = mDepth;
+ IBinder windowToken = mLauncher.getRootView().getWindowToken();
+ if (windowToken != null) {
+ mWallpaperManager.setWallpaperZoomOut(windowToken, depth);
+ }
+
+ if (!BlurUtils.supportsBlursOnWindows()) {
+ return;
+ }
+ if (mSurface == null || !mSurface.isValid()) {
+ return;
+ }
+ boolean hasOpaqueBg = mLauncher.getScrimView().isFullyOpaque();
+ boolean isSurfaceOpaque = !mHasContentBehindLauncher && hasOpaqueBg;
+
+ mCurrentBlur = !mCrossWindowBlursEnabled || hasOpaqueBg
+ ? 0 : (int) (depth * mMaxBlurRadius);
+ SurfaceControl.Transaction transaction = new SurfaceControl.Transaction()
+ .setBackgroundBlurRadius(mSurface, mCurrentBlur)
+ .setOpaque(mSurface, isSurfaceOpaque);
+
+ // Set early wake-up flags when we know we're executing an expensive operation, this way
+ // SurfaceFlinger will adjust its internal offsets to avoid jank.
+ boolean wantsEarlyWakeUp = depth > 0 && depth < 1;
+ if (wantsEarlyWakeUp && !mInEarlyWakeUp) {
+ transaction.setEarlyWakeupStart();
+ mInEarlyWakeUp = true;
+ } else if (!wantsEarlyWakeUp && mInEarlyWakeUp) {
+ transaction.setEarlyWakeupEnd();
+ mInEarlyWakeUp = false;
+ }
+
+ AttachedSurfaceControl rootSurfaceControl =
+ mLauncher.getRootView().getRootSurfaceControl();
+ if (rootSurfaceControl != null) {
+ rootSurfaceControl.applyTransactionOnDraw(transaction);
+ }
+ }
+
+ protected void setDepth(float depth) {
+ depth = Utilities.boundToRange(depth, 0, 1);
+ // Round out the depth to dedupe frequent, non-perceptable updates
+ int depthI = (int) (depth * 256);
+ float depthF = depthI / 256f;
+ if (Float.compare(mDepth, depthF) == 0) {
+ return;
+ }
+ mDepth = depthF;
+ applyDepthAndBlur();
+ }
+
+ /**
+ * Sets the specified app target surface to apply the blur to.
+ */
+ protected void setSurface(SurfaceControl surface) {
+ if (mSurface != surface) {
+ mSurface = surface;
+ applyDepthAndBlur();
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
index d0856be..f7136a5 100644
--- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java
+++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
@@ -23,7 +23,7 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.LauncherActivityInterface;
public class LayoutUtils {
diff --git a/quickstep/src/com/android/quickstep/util/LogUtils.kt b/quickstep/src/com/android/quickstep/util/LogUtils.kt
new file mode 100644
index 0000000..bad8506
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/LogUtils.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util
+
+import android.util.Pair
+import com.android.internal.logging.InstanceIdSequence
+import com.android.launcher3.logging.InstanceId
+
+object LogUtils {
+ /**
+ * @return a [Pair] of two InstanceIds but with different types, one that can be used by framework
+ * (if needing to pass through an intent or such) and one used in Launcher
+ */
+ @JvmStatic
+ fun getShellShareableInstanceId():
+ Pair<com.android.internal.logging.InstanceId, InstanceId> {
+ val internalInstanceId = InstanceIdSequence(InstanceId.INSTANCE_ID_MAX).newInstanceId()
+ val launcherInstanceId = InstanceId(internalInstanceId.id)
+ return Pair(internalInstanceId, launcherInstanceId)
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
index e758f5b..69ed2f8 100644
--- a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
+++ b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
@@ -194,7 +194,11 @@
}
if (mIsPaused != isPaused) {
mIsPaused = isPaused;
- Log.d(TAG, "onMotionPauseChanged, paused=" + mIsPaused + " reason=" + reason);
+ String logString = "onMotionPauseChanged, paused=" + mIsPaused + " reason=" + reason;
+ if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
+ Log.d(TAG, logString);
+ }
+ ActiveGestureLog.INSTANCE.addLog(logString);
boolean isFirstDetectedPause = !mHasEverBeenPaused && mIsPaused;
if (mIsPaused) {
AccessibilityManagerCompat.sendPauseDetectedEventToTest(mContext);
diff --git a/quickstep/src/com/android/quickstep/util/NavBarPosition.java b/quickstep/src/com/android/quickstep/util/NavBarPosition.java
index 527a6d2..59c8263 100644
--- a/quickstep/src/com/android/quickstep/util/NavBarPosition.java
+++ b/quickstep/src/com/android/quickstep/util/NavBarPosition.java
@@ -15,12 +15,12 @@
*/
package com.android.quickstep.util;
-import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON;
+import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import android.view.Surface;
import com.android.launcher3.util.DisplayController.Info;
-import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.launcher3.util.NavigationMode;
/**
* Utility class to check nav bar position.
diff --git a/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java b/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java
index 3777c65..8f79ccf 100644
--- a/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java
+++ b/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java
@@ -39,6 +39,16 @@
mListeners.forEach(ScreenListener::onScreenTurnedOn);
}
+ /** Called when the screen is starting to turn on. */
+ public void onScreenTurningOn() {
+ mListeners.forEach(ScreenListener::onScreenTurningOn);
+ }
+
+ /** Called when the screen is starting to turn off. */
+ public void onScreenTurningOff() {
+ mListeners.forEach(ScreenListener::onScreenTurningOff);
+ }
+
@Override
public void addCallback(@NonNull ScreenListener listener) {
mListeners.add(listener);
diff --git a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
index fb32581..e928b27 100644
--- a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
+++ b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
@@ -21,7 +21,7 @@
import static com.android.launcher3.LauncherState.HINT_STATE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
-import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON;
+import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import android.content.SharedPreferences;
@@ -29,7 +29,6 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.appprediction.AppsDividerView;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.statemanager.StateManager.StateListener;
@@ -88,8 +87,7 @@
});
}
- if (DisplayController.getNavigationMode(launcher) == NO_BUTTON
- && FeatureFlags.ENABLE_ALL_APPS_EDU.get()) {
+ if (DisplayController.getNavigationMode(launcher) == NO_BUTTON) {
stateManager.addStateListener(new StateListener<LauncherState>() {
private static final int MAX_NUM_SWIPES_TO_TRIGGER_EDU = 3;
diff --git a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
index edaa326..1d008da 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
@@ -15,13 +15,10 @@
*/
package com.android.quickstep.util;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
-import android.util.Log;
import androidx.dynamicanimation.animation.DynamicAnimation;
@@ -30,8 +27,6 @@
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.quickstep.views.RecentsView;
-import java.util.Arrays;
-
public class RecentsAtomicAnimationFactory<ACTIVITY_TYPE extends StatefulActivity, STATE_TYPE>
extends AtomicAnimationFactory<STATE_TYPE> {
@@ -53,27 +48,6 @@
case INDEX_RECENTS_FADE_ANIM:
ObjectAnimator alpha = ObjectAnimator.ofFloat(mActivity.getOverviewPanel(),
RecentsView.CONTENT_ALPHA, values);
- Log.d(BAD_STATE, "RAAF createStateElementAnimation alpha="
- + Arrays.toString(values));
- alpha.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- RecentsView recent = mActivity.getOverviewPanel();
- float alpha = recent == null ? -1 : RecentsView.CONTENT_ALPHA.get(recent);
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onCancel, alpha="
- + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onEnd");
- }
- });
return alpha;
case INDEX_RECENTS_TRANSLATE_X_ANIM: {
RecentsView rv = mActivity.getOverviewPanel();
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index dec934a..c459f30 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -46,7 +46,7 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.SettingsCache;
diff --git a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
index c4909de..68739ba 100644
--- a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
+++ b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java
@@ -214,7 +214,7 @@
* @param context The activity context.
* @param velocityPxPerMs Velocity of swipe in px/ms.
*/
- public void start(Context context, PointF velocityPxPerMs) {
+ public void start(Context context, @Nullable DeviceProfile profile, PointF velocityPxPerMs) {
// Only tell caller that we ended if both x and y animations have ended.
OnAnimationEndListener onXEndListener = ((animation, canceled, centerX, velocityX) -> {
mRectXAnimEnded = true;
@@ -252,7 +252,13 @@
float minVisibleChange = Math.abs(1f / mStartRect.height());
ResourceProvider rp = DynamicResource.provider(context);
float damping = rp.getFloat(R.dimen.swipe_up_rect_scale_damping_ratio);
- float stiffness = rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness);
+
+ // Increase the stiffness for devices where we want the window size to transform quicker.
+ boolean shouldUseHigherStiffness = profile != null
+ && (profile.isLandscape || profile.isTablet);
+ float stiffness = shouldUseHigherStiffness
+ ? rp.getFloat(R.dimen.swipe_up_rect_scale_higher_stiffness)
+ : rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness);
mRectScaleAnim = new SpringAnimation(this, RECT_SCALE_PROGRESS)
.setSpring(new SpringForce(1f)
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index e89c842..efbe783 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -31,19 +31,28 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ShortcutInfo;
import android.os.Handler;
import android.os.IBinder;
+import android.os.UserHandle;
import android.text.TextUtils;
+import android.util.Log;
+import android.util.Pair;
import android.view.RemoteAnimationAdapter;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
import androidx.annotation.Nullable;
+import com.android.internal.logging.InstanceId;
+import com.android.launcher3.logging.StatsLogManager;
+import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.quickstep.SystemUiProxy;
@@ -65,26 +74,34 @@
* and is in the process of either a) selecting a second app or b) exiting intention to invoke split
*/
public class SplitSelectStateController {
+ private static final String TAG = "SplitSelectStateCtor";
private final Context mContext;
private final Handler mHandler;
+ private StatsLogManager mStatsLogManager;
private final SystemUiProxy mSystemUiProxy;
private final StateManager mStateManager;
private final DepthController mDepthController;
private @StagePosition int mStagePosition;
+ private ItemInfo mItemInfo;
private Intent mInitialTaskIntent;
private int mInitialTaskId = INVALID_TASK_ID;
private int mSecondTaskId = INVALID_TASK_ID;
private String mSecondTaskPackageName;
private boolean mRecentsAnimationRunning;
+ @Nullable
+ private UserHandle mUser;
/** If not null, this is the TaskView we want to launch from */
@Nullable
private GroupedTaskView mLaunchingTaskView;
+ /** Represents where split is intended to be invoked from. */
+ private StatsLogManager.EventEnum mSplitEvent;
public SplitSelectStateController(Context context, Handler handler, StateManager stateManager,
- DepthController depthController) {
+ DepthController depthController, StatsLogManager statsLogManager) {
mContext = context;
mHandler = handler;
+ mStatsLogManager = statsLogManager;
mSystemUiProxy = SystemUiProxy.INSTANCE.get(mContext);
mStateManager = stateManager;
mDepthController = depthController;
@@ -93,16 +110,25 @@
/**
* To be called after first task selected
*/
- public void setInitialTaskSelect(int taskId, @StagePosition int stagePosition) {
+ public void setInitialTaskSelect(int taskId, @StagePosition int stagePosition,
+ StatsLogManager.EventEnum splitEvent, ItemInfo itemInfo) {
mInitialTaskId = taskId;
- mStagePosition = stagePosition;
- mInitialTaskIntent = null;
+ setInitialData(stagePosition, splitEvent, itemInfo);
}
- public void setInitialTaskSelect(Intent intent, @StagePosition int stagePosition) {
+ public void setInitialTaskSelect(Intent intent, @StagePosition int stagePosition,
+ @NonNull ItemInfo itemInfo, StatsLogManager.EventEnum splitEvent) {
mInitialTaskIntent = intent;
+ mUser = itemInfo.user;
+ mItemInfo = itemInfo;
+ setInitialData(stagePosition, splitEvent, itemInfo);
+ }
+
+ private void setInitialData(@StagePosition int stagePosition,
+ StatsLogManager.EventEnum splitEvent, ItemInfo itemInfo) {
+ mItemInfo = itemInfo;
mStagePosition = stagePosition;
- mInitialTaskId = INVALID_TASK_ID;
+ mSplitEvent = splitEvent;
}
/**
@@ -120,11 +146,22 @@
} else {
fillInIntent = null;
}
- final PendingIntent pendingIntent =
- mInitialTaskIntent == null ? null : PendingIntent.getActivity(mContext, 0,
- mInitialTaskIntent, FLAG_MUTABLE);
+
+ final PendingIntent pendingIntent = mInitialTaskIntent == null ? null : (mUser != null
+ ? PendingIntent.getActivityAsUser(mContext, 0, mInitialTaskIntent,
+ FLAG_MUTABLE, null /* options */, mUser)
+ : PendingIntent.getActivity(mContext, 0, mInitialTaskIntent, FLAG_MUTABLE));
+
+ Pair<InstanceId, com.android.launcher3.logging.InstanceId> instanceIds =
+ LogUtils.getShellShareableInstanceId();
launchTasks(mInitialTaskId, pendingIntent, fillInIntent, mSecondTaskId, mStagePosition,
- callback, false /* freezeTaskList */, DEFAULT_SPLIT_RATIO);
+ callback, false /* freezeTaskList */, DEFAULT_SPLIT_RATIO,
+ instanceIds.first);
+
+ mStatsLogManager.logger()
+ .withItemInfo(mItemInfo)
+ .withInstanceId(instanceIds.second)
+ .log(mSplitEvent);
}
@@ -160,7 +197,7 @@
public void launchTasks(int taskId1, int taskId2, @StagePosition int stagePosition,
Consumer<Boolean> callback, boolean freezeTaskList, float splitRatio) {
launchTasks(taskId1, null /* taskPendingIntent */, null /* fillInIntent */, taskId2,
- stagePosition, callback, freezeTaskList, splitRatio);
+ stagePosition, callback, freezeTaskList, splitRatio, null);
}
/**
@@ -169,10 +206,14 @@
* fill in intent with a taskId2 are set.
* @param taskPendingIntent is null when split is initiated from Overview
* @param stagePosition representing location of task1
+ * @param shellInstanceId loggingId to be used by shell, will be non-null for actions that create
+ * a split instance, null for cases that bring existing instaces to the
+ * foreground (quickswitch, launching previous pairs from overview)
*/
public void launchTasks(int taskId1, @Nullable PendingIntent taskPendingIntent,
@Nullable Intent fillInIntent, int taskId2, @StagePosition int stagePosition,
- Consumer<Boolean> callback, boolean freezeTaskList, float splitRatio) {
+ Consumer<Boolean> callback, boolean freezeTaskList, float splitRatio,
+ @Nullable InstanceId shellInstanceId) {
TestLogging.recordEvent(
TestProtocol.SEQUENCE_MAIN, "launchSplitTasks");
// Assume initial task is for top/left part of screen
@@ -186,8 +227,9 @@
mSystemUiProxy.startTasks(taskIds[0], null /* mainOptions */, taskIds[1],
null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, splitRatio,
new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR,
- ActivityThread.currentActivityThread().getApplicationThread()));
- // TODO: handle intent + task with shell transition
+ ActivityThread.currentActivityThread().getApplicationThread()),
+ shellInstanceId);
+ // TODO(b/237635859): handle intent/shortcut + task with shell transition
} else {
RemoteSplitLaunchAnimationRunner animationRunner =
new RemoteSplitLaunchAnimationRunner(taskId1, taskPendingIntent, taskId2,
@@ -204,11 +246,19 @@
if (taskPendingIntent == null) {
mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], mainOpts.toBundle(),
taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT,
- splitRatio, adapter);
+ splitRatio, adapter, shellInstanceId);
} else {
- mSystemUiProxy.startIntentAndTaskWithLegacyTransition(taskPendingIntent,
- fillInIntent, taskId2, mainOpts.toBundle(), null /* sideOptions */,
- stagePosition, splitRatio, adapter);
+ final ShortcutInfo shortcutInfo = getShortcutInfo(mInitialTaskIntent,
+ taskPendingIntent.getCreatorUserHandle());
+ if (shortcutInfo != null) {
+ mSystemUiProxy.startShortcutAndTaskWithLegacyTransition(shortcutInfo, taskId2,
+ mainOpts.toBundle(), null /* sideOptions */, stagePosition, splitRatio,
+ adapter, shellInstanceId);
+ } else {
+ mSystemUiProxy.startIntentAndTaskWithLegacyTransition(taskPendingIntent,
+ fillInIntent, taskId2, mainOpts.toBundle(), null /* sideOptions */,
+ stagePosition, splitRatio, adapter, shellInstanceId);
+ }
}
}
}
@@ -217,10 +267,36 @@
return mStagePosition;
}
+ public StatsLogManager.EventEnum getSplitEvent() {
+ return mSplitEvent;
+ }
+
public void setRecentsAnimationRunning(boolean running) {
this.mRecentsAnimationRunning = running;
}
+ @Nullable
+ private ShortcutInfo getShortcutInfo(Intent intent, UserHandle userHandle) {
+ if (intent == null || intent.getPackage() == null) {
+ return null;
+ }
+
+ final String shortcutId = intent.getStringExtra(ShortcutKey.EXTRA_SHORTCUT_ID);
+ if (shortcutId == null) {
+ return null;
+ }
+
+ try {
+ final Context context = mContext.createPackageContextAsUser(
+ intent.getPackage(), 0 /* flags */, userHandle);
+ return new ShortcutInfo.Builder(context, shortcutId).build();
+ } catch (PackageManager.NameNotFoundException e) {
+ Log.w(TAG, "Failed to create a ShortcutInfo for " + intent.getPackage());
+ }
+
+ return null;
+ }
+
/**
* Requires Shell Transitions
*/
@@ -242,8 +318,9 @@
@Override
public void startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info,
@NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) {
- TaskViewUtils.composeRecentsSplitLaunchAnimator(mInitialTaskId,
- mInitialTaskPendingIntent, mSecondTaskId, info, t, () -> {
+ TaskViewUtils.composeRecentsSplitLaunchAnimator(mLaunchingTaskView, mStateManager,
+ mDepthController, mInitialTaskId, mInitialTaskPendingIntent, mSecondTaskId,
+ info, t, () -> {
finishCallback.run();
if (mSuccessCallback != null) {
mSuccessCallback.accept(true);
@@ -313,6 +390,8 @@
mStagePosition = SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
mRecentsAnimationRunning = false;
mLaunchingTaskView = null;
+ mItemInfo = null;
+ mSplitEvent = null;
}
/**
diff --git a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java
index de527a7..eec8582 100644
--- a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java
+++ b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java
@@ -35,7 +35,6 @@
import androidx.annotation.Nullable;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Hotseat;
@@ -49,6 +48,7 @@
import com.android.launcher3.anim.SpringAnimationBuilder;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.states.StateAnimationConfig;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.DynamicResource;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.plugins.ResourceProvider;
@@ -295,11 +295,11 @@
}
private void addDepthAnimationForState(Launcher launcher, LauncherState state, long duration) {
- if (!(launcher instanceof BaseQuickstepLauncher)) {
+ if (!(launcher instanceof QuickstepLauncher)) {
return;
}
PendingAnimation builder = new PendingAnimation(duration);
- DepthController depthController = ((BaseQuickstepLauncher) launcher).getDepthController();
+ DepthController depthController = ((QuickstepLauncher) launcher).getDepthController();
depthController.setStateWithAnimation(state, new StateAnimationConfig(), builder);
mAnimators.play(builder.buildAnim());
}
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index d37300c..1a026fc 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -15,6 +15,8 @@
*/
package com.android.quickstep.util;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.states.RotationHelper.deltaRotation;
import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE;
@@ -25,7 +27,6 @@
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation;
import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation;
-import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
import android.animation.TimeInterpolator;
import android.content.Context;
@@ -102,7 +103,7 @@
private boolean mLayoutValid = false;
private int mOrientationStateId;
private SplitBounds mSplitBounds;
- private boolean mDrawsBelowRecents;
+ private Boolean mDrawsBelowRecents = null;
private boolean mIsGridTask;
private int mTaskRectTranslationX;
private int mTaskRectTranslationY;
@@ -391,7 +392,8 @@
.withWindowCrop(mTmpCropRect)
.withCornerRadius(getCurrentCornerRadius());
- if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ // If mDrawsBelowRecents is unset, no reordering will be enforced.
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mDrawsBelowRecents != null) {
// In legacy transitions, the animation leashes remain in same hierarchy in the
// TaskDisplayArea, so we don't want to bump the layer too high otherwise it will
// conflict with layers that WM core positions (ie. the input consumers). For shell
diff --git a/quickstep/src/com/android/quickstep/util/ViewCapture.java b/quickstep/src/com/android/quickstep/util/ViewCapture.java
new file mode 100644
index 0000000..6071bc8
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/ViewCapture.java
@@ -0,0 +1,451 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.util;
+
+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.Executors.createAndStartNewLooper;
+
+import static java.util.stream.Collectors.toList;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Process;
+import android.os.Trace;
+import android.text.TextUtils;
+import android.util.Base64;
+import android.util.Base64OutputStream;
+import android.util.Log;
+import android.util.Pair;
+import android.util.SparseArray;
+import android.view.View;
+import android.view.View.OnAttachStateChangeListener;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver.OnDrawListener;
+import android.view.Window;
+
+import androidx.annotation.UiThread;
+import androidx.annotation.WorkerThread;
+
+import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.util.LooperExecutor;
+import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.SafeCloseable;
+import com.android.launcher3.view.ViewCaptureData.ExportedData;
+import com.android.launcher3.view.ViewCaptureData.FrameData;
+import com.android.launcher3.view.ViewCaptureData.ViewNode;
+
+import java.io.FileDescriptor;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Future;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Utility class for capturing view data every frame
+ */
+public class ViewCapture {
+
+ private static final String TAG = "ViewCapture";
+
+ // Number of frames to keep in memory
+ private static final int MEMORY_SIZE = 2000;
+ // Initial size of the reference pool. This is at least be 5 * total number of views in
+ // Launcher. This allows the first free frames avoid object allocation during view capture.
+ private static final int INIT_POOL_SIZE = 300;
+
+ public static final MainThreadInitializedObject<ViewCapture> INSTANCE =
+ new MainThreadInitializedObject<>(ViewCapture::new);
+
+ private final List<WindowListener> mListeners = new ArrayList<>();
+
+ private final Context mContext;
+ private final LooperExecutor mExecutor;
+
+ // Pool used for capturing view tree on the UI thread.
+ private ViewRef mPool = new ViewRef();
+
+ private ViewCapture(Context context) {
+ mContext = context;
+ if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
+ Looper looper = createAndStartNewLooper("ViewCapture",
+ Process.THREAD_PRIORITY_FOREGROUND);
+ mExecutor = new LooperExecutor(looper);
+ mExecutor.execute(this::initPool);
+ } else {
+ mExecutor = UI_HELPER_EXECUTOR;
+ }
+ }
+
+ @UiThread
+ private void addToPool(ViewRef start, ViewRef end) {
+ end.next = mPool;
+ mPool = start;
+ }
+
+ @WorkerThread
+ private void initPool() {
+ ViewRef start = new ViewRef();
+ ViewRef current = start;
+
+ for (int i = 0; i < INIT_POOL_SIZE; i++) {
+ current.next = new ViewRef();
+ current = current.next;
+ }
+
+ ViewRef finalCurrent = current;
+ MAIN_EXECUTOR.execute(() -> addToPool(start, finalCurrent));
+ }
+
+ /**
+ * Attaches the ViewCapture to the provided window and returns a handle to detach the listener
+ */
+ public SafeCloseable startCapture(Window window) {
+ String title = window.getAttributes().getTitle().toString();
+ String name = TextUtils.isEmpty(title) ? window.toString() : title;
+ return startCapture(window.getDecorView(), name);
+ }
+
+ /**
+ * Attaches the ViewCapture to the provided window and returns a handle to detach the listener
+ */
+ public SafeCloseable startCapture(View view, String name) {
+ if (!FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
+ return () -> { };
+ }
+
+ WindowListener listener = new WindowListener(view, name);
+ mExecutor.execute(() -> MAIN_EXECUTOR.execute(listener::attachToRoot));
+ mListeners.add(listener);
+ return () -> {
+ mListeners.remove(listener);
+ listener.destroy();
+ };
+ }
+
+ /**
+ * Dumps all the active view captures
+ */
+ public void dump(PrintWriter writer, FileDescriptor out) {
+ if (!FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
+ return;
+ }
+ ViewIdProvider idProvider = new ViewIdProvider(mContext.getResources());
+
+ // Collect all the tasks first so that all the tasks are posted on the executor
+ List<Pair<String, Future<ExportedData>>> tasks = mListeners.stream()
+ .map(l -> Pair.create(l.name, mExecutor.submit(() -> l.dumpToProto(idProvider))))
+ .collect(toList());
+
+ tasks.forEach(pair -> {
+ writer.println();
+ writer.println(" ContinuousViewCapture:");
+ writer.println(" window " + pair.first + ":");
+ writer.println(" pkg:" + mContext.getPackageName());
+ writer.print(" data:");
+ writer.flush();
+ try (OutputStream os = new FileOutputStream(out)) {
+ ExportedData data = pair.second.get();
+ OutputStream encodedOS = new GZIPOutputStream(new Base64OutputStream(os,
+ Base64.NO_CLOSE | Base64.NO_PADDING | Base64.NO_WRAP));
+ data.writeTo(encodedOS);
+ encodedOS.close();
+ os.flush();
+ } catch (Exception e) {
+ Log.e(TAG, "Error capturing proto", e);
+ }
+ writer.println();
+ writer.println("--end--");
+ });
+ }
+
+ private class WindowListener implements OnDrawListener {
+
+ private final View mRoot;
+ public final String name;
+
+ private final Handler mHandler;
+ private final ViewRef mViewRef = new ViewRef();
+
+ private int mFrameIndexBg = -1;
+ private final long[] mFrameTimesBg = new long[MEMORY_SIZE];
+ private final ViewPropertyRef[] mNodesBg = new ViewPropertyRef[MEMORY_SIZE];
+
+ private boolean mDestroyed = false;
+
+ WindowListener(View view, String name) {
+ mRoot = view;
+ this.name = name;
+ mHandler = new Handler(mExecutor.getLooper(), this::captureViewPropertiesBg);
+ }
+
+ @Override
+ public void onDraw() {
+ Trace.beginSection("view_capture");
+ captureViewTree(mRoot, mViewRef);
+ Message m = Message.obtain(mHandler);
+ m.obj = mViewRef.next;
+ mHandler.sendMessage(m);
+ Trace.endSection();
+ }
+
+ /**
+ * Captures the View property on the background thread, and transfer all the ViewRef objects
+ * back to the pool
+ */
+ @WorkerThread
+ private boolean captureViewPropertiesBg(Message msg) {
+ ViewRef start = (ViewRef) msg.obj;
+ long time = msg.getWhen();
+ if (start == null) {
+ return false;
+ }
+ mFrameIndexBg++;
+ if (mFrameIndexBg >= MEMORY_SIZE) {
+ mFrameIndexBg = 0;
+ }
+ mFrameTimesBg[mFrameIndexBg] = time;
+
+ ViewPropertyRef recycle = mNodesBg[mFrameIndexBg];
+
+ ViewPropertyRef result = null;
+ ViewPropertyRef resultEnd = null;
+
+ ViewRef current = start;
+ ViewRef last = start;
+ while (current != null) {
+ ViewPropertyRef propertyRef = recycle;
+ if (propertyRef == null) {
+ propertyRef = new ViewPropertyRef();
+ } else {
+ recycle = recycle.next;
+ propertyRef.next = null;
+ }
+
+ propertyRef.transfer(current);
+ last = current;
+ current = current.next;
+
+ if (result == null) {
+ result = propertyRef;
+ resultEnd = result;
+ } else {
+ resultEnd.next = propertyRef;
+ resultEnd = propertyRef;
+ }
+ }
+ mNodesBg[mFrameIndexBg] = result;
+ ViewRef end = last;
+ MAIN_EXECUTOR.execute(() -> addToPool(start, end));
+ return true;
+ }
+
+ void attachToRoot() {
+ if (mRoot.isAttachedToWindow()) {
+ mRoot.getViewTreeObserver().addOnDrawListener(this);
+ } else {
+ mRoot.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
+ @Override
+ public void onViewAttachedToWindow(View v) {
+ if (!mDestroyed) {
+ mRoot.getViewTreeObserver().addOnDrawListener(WindowListener.this);
+ }
+ mRoot.removeOnAttachStateChangeListener(this);
+ }
+
+ @Override
+ public void onViewDetachedFromWindow(View v) { }
+ });
+ }
+ }
+
+ void destroy() {
+ mRoot.getViewTreeObserver().removeOnDrawListener(this);
+ mDestroyed = true;
+ }
+
+ @WorkerThread
+ private ExportedData dumpToProto(ViewIdProvider idProvider) {
+ ExportedData.Builder dataBuilder = ExportedData.newBuilder();
+ ArrayList<Class> classList = new ArrayList<>();
+
+ int size = (mNodesBg[MEMORY_SIZE - 1] == null) ? mFrameIndexBg + 1 : MEMORY_SIZE;
+ for (int i = size - 1; i >= 0; i--) {
+ int index = (MEMORY_SIZE + mFrameIndexBg - i) % MEMORY_SIZE;
+ ViewNode.Builder nodeBuilder = ViewNode.newBuilder();
+ mNodesBg[index].toProto(idProvider, classList, nodeBuilder);
+ dataBuilder.addFrameData(FrameData.newBuilder()
+ .setNode(nodeBuilder)
+ .setTimestamp(mFrameTimesBg[index]));
+ }
+ return dataBuilder
+ .addAllClassname(classList.stream().map(Class::getName).collect(toList()))
+ .build();
+ }
+
+ private ViewRef captureViewTree(View view, ViewRef start) {
+ ViewRef ref;
+ if (mPool != null) {
+ ref = mPool;
+ mPool = mPool.next;
+ ref.next = null;
+ } else {
+ ref = new ViewRef();
+ }
+ ref.view = view;
+ start.next = ref;
+ if (view instanceof ViewGroup) {
+ ViewRef result = ref;
+ ViewGroup parent = (ViewGroup) view;
+ int childCount = ref.childCount = parent.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ result = captureViewTree(parent.getChildAt(i), result);
+ }
+ return result;
+ } else {
+ ref.childCount = 0;
+ return ref;
+ }
+ }
+ }
+
+ private static class ViewPropertyRef {
+ // We store reference in memory to avoid generating and storing too many strings
+ public Class clazz;
+ public int hashCode;
+ public int childCount = 0;
+
+ public int id;
+ public int left, top, right, bottom;
+ public int scrollX, scrollY;
+
+ public float translateX, translateY;
+ public float scaleX, scaleY;
+ public float alpha;
+ public float elevation;
+
+ public int visibility;
+ public boolean willNotDraw;
+ public boolean clipChildren;
+
+ public ViewPropertyRef next;
+
+ public void transfer(ViewRef viewRef) {
+ childCount = viewRef.childCount;
+
+ View view = viewRef.view;
+ viewRef.view = null;
+
+ clazz = view.getClass();
+ hashCode = view.hashCode();
+ id = view.getId();
+ left = view.getLeft();
+ top = view.getTop();
+ right = view.getRight();
+ bottom = view.getBottom();
+ scrollX = view.getScrollX();
+ scrollY = view.getScrollY();
+
+ translateX = view.getTranslationX();
+ translateY = view.getTranslationY();
+ scaleX = view.getScaleX();
+ scaleY = view.getScaleY();
+ alpha = view.getAlpha();
+
+ visibility = view.getVisibility();
+ willNotDraw = view.willNotDraw();
+ elevation = view.getElevation();
+ }
+
+ /**
+ * Converts the data to the proto representation and returns the next property ref
+ * at the end of the iteration.
+ * @return
+ */
+ public ViewPropertyRef toProto(ViewIdProvider idProvider, ArrayList<Class> classList,
+ ViewNode.Builder outBuilder) {
+ int classnameIndex = classList.indexOf(clazz);
+ if (classnameIndex < 0) {
+ classnameIndex = classList.size();
+ classList.add(clazz);
+ }
+ outBuilder
+ .setClassnameIndex(classnameIndex)
+ .setHashcode(hashCode)
+ .setId(idProvider.getName(id))
+ .setLeft(left)
+ .setTop(top)
+ .setWidth(right - left)
+ .setHeight(bottom - top)
+ .setTranslationX(translateX)
+ .setTranslationY(translateY)
+ .setScaleX(scaleX)
+ .setScaleY(scaleY)
+ .setAlpha(alpha)
+ .setVisibility(visibility)
+ .setWillNotDraw(willNotDraw)
+ .setElevation(elevation)
+ .setClipChildren(clipChildren);
+
+ ViewPropertyRef result = next;
+ for (int i = 0; (i < childCount) && (result != null); i++) {
+ ViewNode.Builder childBuilder = ViewNode.newBuilder();
+ result = result.toProto(idProvider, classList, childBuilder);
+ outBuilder.addChildren(childBuilder);
+ }
+ return result;
+ }
+ }
+
+ private static class ViewRef {
+ public View view;
+ public int childCount = 0;
+ public ViewRef next;
+ }
+
+ private static final class ViewIdProvider {
+
+ private final SparseArray<String> mNames = new SparseArray<>();
+ private final Resources mRes;
+
+ ViewIdProvider(Resources res) {
+ mRes = res;
+ }
+
+ String getName(int id) {
+ String name = mNames.get(id);
+ if (name == null) {
+ if (id >= 0) {
+ try {
+ name = mRes.getResourceTypeName(id) + '/' + mRes.getResourceEntryName(id);
+ } catch (Resources.NotFoundException e) {
+ name = "id/" + "0x" + Integer.toHexString(id).toUpperCase();
+ }
+ } else {
+ name = "NO_ID";
+ }
+ mNames.put(id, name);
+ }
+ return name;
+ }
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java
index 5eb543e..34fa7f1 100644
--- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java
+++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java
@@ -32,7 +32,6 @@
import android.util.FloatProperty;
import android.view.View;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.Hotseat;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
@@ -41,6 +40,7 @@
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.states.StateAnimationConfig;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.DynamicResource;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.plugins.ResourceProvider;
@@ -84,9 +84,9 @@
}
// Add depth controller animation.
- if (launcher instanceof BaseQuickstepLauncher) {
+ if (launcher instanceof QuickstepLauncher) {
PendingAnimation depthBuilder = new PendingAnimation(DURATION_MS);
- DepthController depth = ((BaseQuickstepLauncher) launcher).getDepthController();
+ DepthController depth = ((QuickstepLauncher) launcher).getDepthController();
depth.setStateWithAnimation(NORMAL, new StateAnimationConfig(), depthBuilder);
mAnimators.play(depthBuilder.buildAnim());
}
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 835c9f7..c211d7a 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -2,8 +2,10 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
import static com.android.launcher3.anim.Interpolators.ACCEL;
-import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
+import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
+import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.launcher3.anim.Interpolators.clampToProgress;
import android.animation.ValueAnimator;
import android.content.Context;
@@ -14,6 +16,7 @@
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.util.FloatProperty;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -23,12 +26,12 @@
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.InsettableFrameLayout;
-import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.uioverrides.states.SplitScreenSelectState;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.util.MultiValueUpdateListener;
@@ -48,6 +51,54 @@
* TODO: Figure out how to copy thumbnail data from existing TaskView to this view.
*/
public class FloatingTaskView extends FrameLayout {
+ private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START = 0;
+ private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END = 133;
+ private static final int OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START = 167;
+ private static final int OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END = 250;
+ private static final int OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START = 0;
+ private static final int OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END = 417;
+
+ private static final float OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END
+ / SplitScreenSelectState.ENTER_DURATION;
+
+ public static final FloatProperty<FloatingTaskView> PRIMARY_TRANSLATE_OFFSCREEN =
+ new FloatProperty<FloatingTaskView>("floatingTaskPrimaryTranslateOffscreen") {
+ @Override
+ public void setValue(FloatingTaskView view, float translation) {
+ ((RecentsView) view.mActivity.getOverviewPanel()).getPagedOrientationHandler()
+ .setFloatingTaskPrimaryTranslation(
+ view,
+ translation,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+
+ @Override
+ public Float get(FloatingTaskView view) {
+ return ((RecentsView) view.mActivity.getOverviewPanel())
+ .getPagedOrientationHandler()
+ .getFloatingTaskPrimaryTranslation(
+ view,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+ };
private FloatingTaskThumbnailView mThumbnailView;
private SplitPlaceholderView mSplitPlaceholderView;
@@ -200,26 +251,49 @@
RectF floatingTaskViewBounds = new RectF();
if (fadeWithThumbnail) {
- animation.addFloat(mSplitPlaceholderView, SplitPlaceholderView.ALPHA_FLOAT,
- 0, 1, ACCEL);
- animation.addFloat(mThumbnailView, LauncherAnimUtils.VIEW_ALPHA,
- 1, 0, DEACCEL_3);
+ // This code block runs when animating from Overview > OverviewSplitSelect
+ // And for the second thumbnail on confirm
+
+ // FloatingTaskThumbnailView: thumbnail fades out to transparent
+ animation.setViewAlpha(mThumbnailView, 0, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET,
+ OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET));
+
+ // SplitPlaceholderView: gray background fades in at the same time, then new icon fades
+ // in
+ animation.setViewAlpha(mSplitPlaceholderView, 1, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET,
+ OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET));
+ animation.setViewAlpha(mSplitPlaceholderView.getIconView(), 1, clampToProgress(
+ LINEAR, OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START_OFFSET,
+ OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END_OFFSET));
} else if (isStagedTask) {
+ // This code block runs when animating from Normal > OverviewSplitSelect
+ // and for the first thumbnail on confirm
+
// Fade in the placeholder view when split is initiated from homescreen / all apps
- // icons.
if (mSplitPlaceholderView.getAlpha() == 0) {
- animation.addFloat(mSplitPlaceholderView, SplitPlaceholderView.ALPHA_FLOAT,
- 0.3f, 1, ACCEL);
+ animation.setViewAlpha(mSplitPlaceholderView, 0.3f, INSTANT);
+ animation.setViewAlpha(mSplitPlaceholderView, 1, ACCEL);
}
}
MultiValueUpdateListener listener = new MultiValueUpdateListener() {
- final FloatProp mDx = new FloatProp(0, prop.dX, 0, animDuration, LINEAR);
- final FloatProp mDy = new FloatProp(0, prop.dY, 0, animDuration, LINEAR);
+ // SplitPlaceholderView: rectangle translates and stretches to new position
+ final FloatProp mDx = new FloatProp(0, prop.dX, 0, animDuration,
+ clampToProgress(DEACCEL_2, OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET));
+ final FloatProp mDy = new FloatProp(0, prop.dY, 0, animDuration,
+ clampToProgress(DEACCEL_2, OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET));
final FloatProp mTaskViewScaleX = new FloatProp(1f, prop.finalTaskViewScaleX, 0,
- animDuration, LINEAR);
+ animDuration, clampToProgress(DEACCEL_2,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET));
final FloatProp mTaskViewScaleY = new FloatProp(1f, prop.finalTaskViewScaleY, 0,
- animDuration, LINEAR);
+ animDuration, clampToProgress(DEACCEL_2,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET));
@Override
public void onUpdate(float percent, boolean initOnly) {
// Calculate the icon position.
@@ -260,6 +334,10 @@
mActivity.getDeviceProfile(), mStagePosition);
}
+ public int getStagePosition() {
+ return mStagePosition;
+ }
+
private static class SplitOverlayProperties {
private final float finalTaskViewScaleX;
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
index 2dff18e..44ea0a0 100644
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
@@ -1,6 +1,6 @@
package com.android.quickstep.views;
-import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.launcher3.AbstractFloatingView.getAnyView;
import static com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT_RATIO;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
@@ -14,6 +14,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -163,6 +164,21 @@
}
}
+ @Override
+ protected boolean showTaskMenuWithContainer(IconView iconView) {
+ boolean showedTaskMenu = super.showTaskMenuWithContainer(iconView);
+ if (iconView == mIconView2 && showedTaskMenu && !mActivity.getDeviceProfile().isTablet) {
+ // Adjust the position of the secondary task's menu view (only on phones)
+ TaskMenuView taskMenuView = getAnyView(mActivity, AbstractFloatingView.TYPE_TASK_MENU);
+ DeviceProfile deviceProfile = mActivity.getDeviceProfile();
+ getRecentsView().getPagedOrientationHandler()
+ .setSecondaryTaskMenuPosition(mSplitBoundsConfig, this,
+ deviceProfile, mTaskIdAttributeContainer[0].getThumbnailView(),
+ taskMenuView);
+ }
+ return showedTaskMenu;
+ }
+
@Nullable
@Override
public RunnableList launchTaskAnimated() {
@@ -251,8 +267,7 @@
@Override
public void setOverlayEnabled(boolean overlayEnabled) {
- super.setOverlayEnabled(overlayEnabled);
- mSnapshotView2.setOverlayEnabled(overlayEnabled);
+ // Intentional no-op to prevent setting smart actions overlay on thumbnails
}
@Override
@@ -318,7 +333,12 @@
@Override
protected void applyThumbnailSplashAlpha() {
super.applyThumbnailSplashAlpha();
- mSnapshotView2.setSplashAlpha(
- Utilities.mapToRange(mOverviewProgress, 0f, 1f, 1f, 0f, LINEAR));
+ mSnapshotView2.setSplashAlpha(mTaskThumbnailSplashAlpha);
+ }
+
+ @Override
+ void setThumbnailVisibility(int visibility) {
+ super.setThumbnailVisibility(visibility);
+ mSnapshotView2.setVisibility(visibility);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index a736583..bb8506d 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -21,24 +21,23 @@
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.Surface;
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.popup.QuickstepSystemShortcut;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager.StateListener;
+import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.PendingSplitSelectInfo;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.quickstep.LauncherActivityInterface;
@@ -48,7 +47,7 @@
* {@link RecentsView} used in Launcher activity
*/
@TargetApi(Build.VERSION_CODES.O)
-public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher, LauncherState>
+public class LauncherRecentsView extends RecentsView<QuickstepLauncher, LauncherState>
implements StateListener<LauncherState> {
public LauncherRecentsView(Context context) {
@@ -68,7 +67,6 @@
public void init(OverviewActionsView actionsView,
SplitSelectStateController splitPlaceholderView) {
super.init(actionsView, splitPlaceholderView);
- Log.d(BAD_STATE, "LauncherRecentsView init setContentAlpha=0");
setContentAlpha(0);
}
@@ -97,7 +95,7 @@
if (recoveryData.getStagedTaskId() == taskId) {
initiateSplitSelect(
getTaskViewByTaskId(recoveryData.getStagedTaskId()),
- recoveryData.getStagePosition()
+ recoveryData.getStagePosition(), recoveryData.getSource()
);
mActivity.finishSplitSelectRecovery();
}
@@ -107,7 +105,6 @@
@Override
public void reset() {
super.reset();
-
setLayoutRotation(Surface.ROTATION_0, Surface.ROTATION_0);
}
@@ -119,7 +116,6 @@
if (toState == OVERVIEW_MODAL_TASK) {
setOverviewSelectEnabled(true);
}
- Log.d(BAD_STATE, "LRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
setFreezeViewVisibility(true);
}
@@ -131,8 +127,6 @@
}
boolean isOverlayEnabled = finalState == OVERVIEW || finalState == OVERVIEW_MODAL_TASK;
setOverlayEnabled(isOverlayEnabled);
- Log.d(BAD_STATE, "LRV onStateTransitionComplete setFreezeVisibility=false, finalState="
- + finalState);
setFreezeViewVisibility(false);
if (finalState != OVERVIEW_MODAL_TASK) {
setOverviewSelectEnabled(false);
@@ -193,8 +187,9 @@
@Override
public void initiateSplitSelect(TaskView taskView,
- @SplitConfigurationOptions.StagePosition int stagePosition) {
- super.initiateSplitSelect(taskView, stagePosition);
+ @SplitConfigurationOptions.StagePosition int stagePosition,
+ StatsLogManager.EventEnum splitEvent) {
+ super.initiateSplitSelect(taskView, stagePosition, splitEvent);
mActivity.getStateManager().goToState(LauncherState.OVERVIEW_SPLIT_SELECT);
}
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 62ec0ef..08a17c4 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -32,9 +32,9 @@
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.util.DisplayController;
-import com.android.launcher3.util.DisplayController.NavigationMode;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
+import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.TaskOverlayFactory.OverlayUICallbacks;
import com.android.quickstep.util.LayoutUtils;
@@ -53,7 +53,9 @@
HIDDEN_NON_ZERO_ROTATION,
HIDDEN_NO_TASKS,
HIDDEN_NO_RECENTS,
- HIDDEN_SPLIT_SCREEN})
+ HIDDEN_SPLIT_SCREEN,
+ HIDDEN_SPLIT_SELECT_ACTIVE
+ })
@Retention(RetentionPolicy.SOURCE)
public @interface ActionsHiddenFlags { }
@@ -61,6 +63,7 @@
public static final int HIDDEN_NO_TASKS = 1 << 1;
public static final int HIDDEN_NO_RECENTS = 1 << 2;
public static final int HIDDEN_SPLIT_SCREEN = 1 << 3;
+ public static final int HIDDEN_SPLIT_SELECT_ACTIVE = 1 << 4;
@IntDef(flag = true, value = {
DISABLED_SCROLLING,
@@ -79,6 +82,11 @@
private static final int INDEX_HIDDEN_FLAGS_ALPHA = 3;
private static final int INDEX_SHARE_TARGET_ALPHA = 4;
+ public @interface SplitButtonDisabledFlags { }
+
+ public static final int FLAG_IS_NOT_TABLET = 1 << 0;
+ public static final int FLAG_SINGLE_TASK = 1 << 1;
+
private MultiValueAlpha mMultiValueAlpha;
private Button mSplitButton;
@@ -88,6 +96,9 @@
@ActionsDisabledFlags
protected int mDisabledFlags;
+ @SplitButtonDisabledFlags
+ private int mSplitButtonDisabledFlags;
+
@Nullable
protected T mCallbacks;
@@ -182,6 +193,20 @@
LayoutUtils.setViewEnabled(this, isEnabled);
}
+ /**
+ * Updates the proper flags to indicate whether the "Split screen" button should be enabled.
+ *
+ * @param flag The flag to update.
+ * @param enable Whether to enable the disable flag: True will cause view to be disabled.
+ */
+ public void updateSplitButtonFlags(@SplitButtonDisabledFlags int flag, boolean enable) {
+ if (enable) {
+ mSplitButtonDisabledFlags |= flag;
+ } else {
+ mSplitButtonDisabledFlags &= ~flag;
+ }
+ }
+
public AlphaProperty getContentAlpha() {
return mMultiValueAlpha.getProperty(INDEX_CONTENT_ALPHA);
}
@@ -263,12 +288,17 @@
0, 0, 0);
}
- public void setSplitButtonVisible(boolean visible) {
+ /**
+ * Shows/hides the "Split" button based on the status of mHiddenFlags.
+ */
+ public void updateSplitButtonVisibility() {
if (mSplitButton == null) {
return;
}
-
- mSplitButton.setVisibility(visible ? VISIBLE : GONE);
- findViewById(R.id.action_split_space).setVisibility(visible ? VISIBLE : GONE);
+ boolean shouldBeVisible = mSplitButtonDisabledFlags == 0
+ // and neither of these flags are active
+ && (mHiddenFlags & (HIDDEN_SPLIT_SCREEN | HIDDEN_SPLIT_SELECT_ACTIVE)) == 0;
+ mSplitButton.setVisibility(shouldBeVisible ? VISIBLE : GONE);
+ findViewById(R.id.action_split_space).setVisibility(shouldBeVisible ? VISIBLE : GONE);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index cf93857..6a94094 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -35,15 +35,18 @@
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.DEACCEL_2;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE;
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.OVERSHOOT_0_85;
import static com.android.launcher3.anim.Interpolators.clampToProgress;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_SWIPE_DOWN;
-import static com.android.launcher3.statehandlers.DepthController.DEPTH;
+import static com.android.launcher3.statehandlers.DepthController.STATE_DEPTH;
import static com.android.launcher3.touch.PagedOrientationHandler.CANVAS_TRANSLATE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
@@ -52,10 +55,13 @@
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.FLAG_IS_NOT_TABLET;
+import static com.android.quickstep.views.OverviewActionsView.FLAG_SINGLE_TASK;
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.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SCREEN;
+import static com.android.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SELECT_ACTIVE;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -129,12 +135,14 @@
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.cache.HandlerRunnable;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.popup.QuickstepSystemShortcut;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.touch.OverScroll;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.uioverrides.states.SplitScreenSelectState;
import com.android.launcher3.util.DynamicResource;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
@@ -162,6 +170,8 @@
import com.android.quickstep.TaskViewUtils;
import com.android.quickstep.TopTaskTracker;
import com.android.quickstep.ViewUtils;
+import com.android.quickstep.util.ActiveGestureErrorDetector;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.util.RecentsOrientedState;
@@ -381,19 +391,19 @@
};
/**
- * Progress to and from the OVERVIEW state, where being in OverviewState has a value of 1, and
- * being in any other LauncherState has a value of 0.
+ * Alpha of the task thumbnail splash, where being in BackgroundAppState has a value of 1, and
+ * being in any other state has a value of 0.
*/
- public static final FloatProperty<RecentsView> OVERVIEW_PROGRESS =
- new FloatProperty<RecentsView>("overviewProgress") {
+ public static final FloatProperty<RecentsView> TASK_THUMBNAIL_SPLASH_ALPHA =
+ new FloatProperty<RecentsView>("taskThumbnailSplashAlpha") {
@Override
- public void setValue(RecentsView view, float overviewProgress) {
- view.setOverviewProgress(overviewProgress);
+ public void setValue(RecentsView view, float taskThumbnailSplashAlpha) {
+ view.setTaskThumbnailSplashAlpha(taskThumbnailSplashAlpha);
}
@Override
public Float get(RecentsView view) {
- return view.mOverviewProgress;
+ return view.mTaskThumbnailSplashAlpha;
}
};
@@ -409,6 +419,54 @@
private static final float ANIMATION_DISMISS_PROGRESS_MIDPOINT = 0.5f;
private static final float END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET = 0.75f;
+ private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_SLIDE_START = 67;
+ private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_SLIDE_OFFSET = 16;
+ private static final int SPRING_DISMISS_TRANSLATION_DURATION = 500;
+
+ private static final float INITIAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_THUMBNAIL_SLIDE_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float ADDITIONAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_THUMBNAIL_SLIDE_OFFSET
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float END_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET =
+ (float) SPRING_DISMISS_TRANSLATION_DURATION
+ / SplitScreenSelectState.ENTER_DURATION;
+
+ private static final int OVERVIEW_TO_SPLIT_ICON_FADE_START = 0;
+ private static final int OVERVIEW_TO_SPLIT_ICON_FADE_END = 83;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_START = 167;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_END = 250;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_START = 217;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_END = 300;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_START = 167;
+ private static final int OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_END = 500;
+
+ private static final float OVERVIEW_TO_SPLIT_ICON_FADE_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_ICON_FADE_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_ICON_FADE_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_ICON_FADE_END
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_END
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_END
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_START_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_START
+ / SplitScreenSelectState.ENTER_DURATION;
+ private static final float OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_END_OFFSET =
+ (float) OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_END
+ / SplitScreenSelectState.ENTER_DURATION;
+
private static final float SIGNIFICANT_MOVE_SCREEN_WIDTH_PERCENTAGE = 0.15f;
protected final RecentsOrientedState mOrientationState;
@@ -487,7 +545,7 @@
protected float mTaskViewsSecondarySplitTranslation = 0;
// Progress from 0 to 1 where 0 is a carousel and 1 is a 2 row grid.
private float mGridProgress = 0;
- private float mOverviewProgress = 0;
+ private float mTaskThumbnailSplashAlpha = 0;
private boolean mShowAsGridLastOnLayout = false;
private final IntSet mTopRowIdSet = new IntSet();
@@ -1233,6 +1291,8 @@
@Override
protected void onPageEndTransition() {
super.onPageEndTransition();
+ ActiveGestureLog.INSTANCE.addLog(
+ "onPageEndTransition: current page index updated", mCurrentPage);
if (isClearAllHidden() && !mActivity.getDeviceProfile().isTablet) {
mActionsView.updateDisabledFlags(OverviewActionsView.DISABLED_SCROLLING, false);
}
@@ -1423,6 +1483,12 @@
updateGridProperties();
}
+ @Override
+ protected void onScrollerAnimationAborted() {
+ ActiveGestureLog.INSTANCE.addLog("scroller animation aborted",
+ ActiveGestureErrorDetector.GestureEvent.SCROLLER_ANIMATION_ABORTED);
+ }
+
protected void applyLoadPlan(ArrayList<GroupTask> taskGroups) {
if (mPendingAnimation != null) {
mPendingAnimation.addEndListener(success -> applyLoadPlan(taskGroups));
@@ -1607,6 +1673,7 @@
taskView.setStableAlpha(mContentAlpha);
taskView.setFullscreenProgress(mFullscreenProgress);
taskView.setModalness(mTaskModalness);
+ taskView.setTaskThumbnailSplashAlpha(mTaskThumbnailSplashAlpha);
}
}
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
@@ -2205,12 +2272,13 @@
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
TaskViewSimulator[] taskViewSimulators) {
mCurrentGestureEndTarget = endTarget;
- if (endTarget == GestureState.GestureEndTarget.RECENTS) {
+ boolean isOverviewEndTarget = endTarget == GestureState.GestureEndTarget.RECENTS;
+ if (isOverviewEndTarget) {
updateGridProperties();
}
- if (mSizeStrategy.stateFromGestureEndTarget(endTarget)
- .displayOverviewTasksAsGrid(mActivity.getDeviceProfile())) {
+ BaseState<?> endState = mSizeStrategy.stateFromGestureEndTarget(endTarget);
+ if (endState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile())) {
TaskView runningTaskView = getRunningTaskView();
float runningTaskPrimaryGridTranslation = 0;
if (runningTaskView != null) {
@@ -2234,10 +2302,12 @@
}
}
}
+ int splashAlpha = endState.showTaskThumbnailSplash() ? 1 : 0;
if (animatorSet == null) {
- setOverviewProgress(1);
+ setTaskThumbnailSplashAlpha(splashAlpha);
} else {
- animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, 1));
+ animatorSet.play(
+ ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, splashAlpha));
}
}
@@ -2688,15 +2758,15 @@
mClearAllButton.setGridProgress(gridProgress);
}
- private void setOverviewProgress(float overviewProgress) {
+ private void setTaskThumbnailSplashAlpha(float taskThumbnailSplashAlpha) {
int taskCount = getTaskViewCount();
if (taskCount == 0) {
return;
}
- mOverviewProgress = overviewProgress;
+ mTaskThumbnailSplashAlpha = taskThumbnailSplashAlpha;
for (int i = 0; i < taskCount; i++) {
- requireTaskViewAt(i).setOverviewProgress(overviewProgress);
+ requireTaskViewAt(i).setTaskThumbnailSplashAlpha(taskThumbnailSplashAlpha);
}
}
@@ -2789,8 +2859,13 @@
mSplitSelectStateController.getActiveSplitStagePosition(), mTempRect);
RectF startingTaskRect = new RectF();
+ safeRemoveDragLayerView(mFirstFloatingTaskView);
if (mSplitHiddenTaskView != null) {
- mSplitHiddenTaskView.setVisibility(INVISIBLE);
+ // Split staging is initiated
+ mSplitHiddenTaskView.setThumbnailVisibility(INVISIBLE);
+ anim.setViewAlpha(mSplitHiddenTaskView.getIconView(), 0, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_ICON_FADE_START_OFFSET,
+ OVERVIEW_TO_SPLIT_ICON_FADE_END_OFFSET));
mFirstFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
mSplitHiddenTaskView.getThumbnail(),
mSplitHiddenTaskView.getThumbnail().getThumbnail(),
@@ -2807,9 +2882,20 @@
false /* fadeWithThumbnail */, true /* isStagedTask */);
}
+ // SplitInstructionsView: animate in
+ safeRemoveDragLayerView(mSplitInstructionsView);
mSplitInstructionsView = SplitInstructionsView.getSplitInstructionsView(mActivity);
mSplitInstructionsView.setAlpha(0);
- anim.addFloat(mSplitInstructionsView, SplitInstructionsView.ALPHA_FLOAT, 0, 1, ACCEL);
+ anim.setViewAlpha(mSplitInstructionsView, 1, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_START_OFFSET,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_CONTAINER_FADE_IN_END_OFFSET));
+ anim.setViewAlpha(mSplitInstructionsView.getTextView(), 1, clampToProgress(LINEAR,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_START_OFFSET,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_TEXT_FADE_IN_END_OFFSET));
+ anim.addFloat(mSplitInstructionsView, mSplitInstructionsView.UNFOLD, 0.1f, 1,
+ clampToProgress(EMPHASIZED_DECELERATE,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_START_OFFSET,
+ OVERVIEW_TO_SPLIT_INSTRUCTIONS_UNFOLD_END_OFFSET));
InteractionJankMonitorWrapper.begin(this,
InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "First tile selected");
@@ -2818,6 +2904,8 @@
InteractionJankMonitorWrapper.end(
InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
} else {
+ // If transition to split select was interrupted, clean up to prevent glitches
+ resetFromSplitSelectionState();
InteractionJankMonitorWrapper.cancel(
InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
}
@@ -2834,17 +2922,16 @@
* @param dismissingForSplitSelection task dismiss animation is used for entering split
* selection state from app icon
*/
- public PendingAnimation createTaskDismissAnimation(TaskView dismissedTaskView,
+ public void createTaskDismissAnimation(PendingAnimation anim, TaskView dismissedTaskView,
boolean animateTaskView, boolean shouldRemoveTask, long duration,
boolean dismissingForSplitSelection) {
if (mPendingAnimation != null) {
mPendingAnimation.createPlaybackController().dispatchOnCancel().dispatchOnEnd();
}
- PendingAnimation anim = new PendingAnimation(duration);
int count = getPageCount();
if (count == 0) {
- return anim;
+ return;
}
boolean showAsGrid = showAsGrid();
@@ -3089,11 +3176,33 @@
// Animate task with index >= dismissed index and in the same row as the
// dismissed index or next focused index. Offset successive task dismissal
// durations for a staggered effect.
- float animationStartProgress = Utilities.boundToRange(
- INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
- + ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
- * ++distanceFromDismissedTask, 0f,
- dismissTranslationInterpolationEnd);
+ distanceFromDismissedTask++;
+ boolean isStagingFocusedTask =
+ isFocusedTaskDismissed && nextFocusedTaskView == null;
+ int staggerColumn = isStagingFocusedTask
+ ? (int) Math.ceil(distanceFromDismissedTask / 2f)
+ : distanceFromDismissedTask;
+ // Set timings based on if user is initiating splitscreen on the focused task,
+ // or splitting/dismissing some other task.
+ float animationStartProgress = isStagingFocusedTask
+ ? Utilities.boundToRange(
+ INITIAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ + ADDITIONAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ * staggerColumn, 0f, dismissTranslationInterpolationEnd)
+ : Utilities.boundToRange(
+ INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ + ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ * staggerColumn, 0f, dismissTranslationInterpolationEnd);
+ float animationEndProgress = isStagingFocusedTask
+ ? Utilities.boundToRange(
+ INITIAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ + END_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ + ADDITIONAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET
+ * staggerColumn,
+ 0f, dismissTranslationInterpolationEnd)
+ : dismissTranslationInterpolationEnd;
+ Interpolator dismissInterpolator = isStagingFocusedTask ? OVERSHOOT_0_85 : LINEAR;
+
if (taskView == nextFocusedTaskView) {
// Enlarge the task to be focused next, and translate into focus position.
float scale = mTaskWidth / (float) mLastComputedGridTaskSize.width();
@@ -3116,7 +3225,7 @@
} else {
float primaryTranslation =
nextFocusedTaskView != null ? nextFocusedTaskWidth : dismissedTaskWidth;
- if (isFocusedTaskDismissed && nextFocusedTaskView == null) {
+ if (isStagingFocusedTask) {
// Moves less if focused task is not in scroll position.
int focusedTaskScroll = getScrollForPage(dismissedIndex);
int primaryScroll = mOrientationHandler.getPrimaryScroll(this);
@@ -3132,8 +3241,8 @@
anim.setFloat(taskView, taskView.getPrimaryDismissTranslationProperty(),
mIsRtl ? primaryTranslation : -primaryTranslation,
- clampToProgress(LINEAR, animationStartProgress,
- dismissTranslationInterpolationEnd));
+ clampToProgress(dismissInterpolator, animationStartProgress,
+ animationEndProgress));
}
}
}
@@ -3142,7 +3251,9 @@
anim.addOnFrameCallback(this::updateCurveProperties);
}
- // Add a tiny bit of translation Z, so that it draws on top of other views
+ // Add a tiny bit of translation Z, so that it draws on top of other views. This is relevant
+ // (e.g.) when we dismiss a task by sliding it upward: if there is a row of icons above, we
+ // want the dragged task to stay above all other views.
if (animateTaskView) {
dismissedTaskView.setTranslationZ(0.1f);
}
@@ -3363,7 +3474,6 @@
mPendingAnimation = null;
}
});
- return anim;
}
/**
@@ -3375,11 +3485,11 @@
private void updateCurrentTaskActionsVisibility() {
boolean isCurrentSplit = getCurrentPageTaskView() instanceof GroupedTaskView;
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SCREEN, isCurrentSplit);
- if (isCurrentSplit) {
- return;
- }
- mActionsView.setSplitButtonVisible(
- mActivity.getDeviceProfile().isTablet && getTaskViewCount() > 1);
+ mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SELECT_ACTIVE, isSplitSelectionActive());
+ mActionsView.updateSplitButtonFlags(FLAG_IS_NOT_TABLET,
+ !mActivity.getDeviceProfile().isTablet);
+ mActionsView.updateSplitButtonFlags(FLAG_SINGLE_TASK, getTaskViewCount() <= 1);
+ mActionsView.updateSplitButtonVisibility();
}
/**
@@ -3531,8 +3641,10 @@
}
public void dismissTask(TaskView taskView, boolean animateTaskView, boolean removeTask) {
- runDismissAnimation(createTaskDismissAnimation(taskView, animateTaskView, removeTask,
- DISMISS_TASK_DURATION, false /* dismissingForSplitSelection*/));
+ PendingAnimation pa = new PendingAnimation(DISMISS_TASK_DURATION);
+ createTaskDismissAnimation(pa, taskView, animateTaskView, removeTask, DISMISS_TASK_DURATION,
+ false /* dismissingForSplitSelection*/);
+ runDismissAnimation(pa);
}
@SuppressWarnings("unused")
@@ -4041,16 +4153,21 @@
}
}
+ /**
+ * Primarily used by overview actions to initiate split from focused task, logs the source
+ * of split invocation as such.
+ */
public void initiateSplitSelect(TaskView taskView) {
int defaultSplitPosition = mOrientationHandler
.getDefaultSplitPosition(mActivity.getDeviceProfile());
- initiateSplitSelect(taskView, defaultSplitPosition);
+ initiateSplitSelect(taskView, defaultSplitPosition, LAUNCHER_OVERVIEW_ACTIONS_SPLIT);
}
- public void initiateSplitSelect(TaskView taskView, @StagePosition int stagePosition) {
+ public void initiateSplitSelect(TaskView taskView, @StagePosition int stagePosition,
+ StatsLogManager.EventEnum splitEvent) {
mSplitHiddenTaskView = taskView;
mSplitSelectStateController.setInitialTaskSelect(taskView.getTask().key.id,
- stagePosition);
+ stagePosition, splitEvent, taskView.getItemInfo());
mSplitHiddenTaskViewIndex = indexOfChild(taskView);
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
@@ -4061,17 +4178,21 @@
public void initiateSplitSelect(QuickstepSystemShortcut.SplitSelectSource splitSelectSource) {
mSplitSelectSource = splitSelectSource;
mSplitSelectStateController.setInitialTaskSelect(splitSelectSource.intent,
- splitSelectSource.position.stagePosition);
+ splitSelectSource.position.stagePosition, splitSelectSource.mItemInfo,
+ splitSelectSource.splitEvent);
}
- public PendingAnimation createSplitSelectInitAnimation(int duration) {
+ /**
+ * Modifies a PendingAnimation with the animations for entering split staging
+ */
+ public void createSplitSelectInitAnimation(PendingAnimation builder, int duration) {
if (mSplitHiddenTaskView != null) {
- return createTaskDismissAnimation(mSplitHiddenTaskView, true, false, duration,
+ // Splitting from Overview
+ createTaskDismissAnimation(builder, mSplitHiddenTaskView, true, false, duration,
true /* dismissingForSplitSelection*/);
} else {
- PendingAnimation anim = new PendingAnimation(duration);
- createInitialSplitSelectAnimation(anim);
- return anim;
+ // Splitting from Home
+ createInitialSplitSelectAnimation(builder);
}
}
@@ -4118,6 +4239,7 @@
new RectF(firstTaskStartingBounds), firstTaskEndingBounds,
false /* fadeWithThumbnail */, true /* isStagedTask */);
+ safeRemoveDragLayerView(mSecondFloatingTaskView);
mSecondFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
thumbnailView, thumbnailView.getThumbnail(),
iconView.getDrawable(), secondTaskStartingBounds);
@@ -4150,17 +4272,13 @@
@SuppressLint("WrongCall")
protected void resetFromSplitSelectionState() {
if (mSplitSelectSource != null || mSplitHiddenTaskViewIndex != -1) {
- if (mSplitInstructionsView != null) {
- mActivity.getDragLayer().removeView(mSplitInstructionsView);
- mSplitInstructionsView = null;
- }
- if (mFirstFloatingTaskView != null) {
- mActivity.getDragLayer().removeView(mFirstFloatingTaskView);
- mFirstFloatingTaskView = null;
- }
- if (mSecondFloatingTaskView != null) {
- mActivity.getDragLayer().removeView(mSecondFloatingTaskView);
- mSecondFloatingTaskView = null;
+ safeRemoveDragLayerView(mFirstFloatingTaskView);
+ safeRemoveDragLayerView(mSecondFloatingTaskView);
+ safeRemoveDragLayerView(mSplitInstructionsView);
+ mFirstFloatingTaskView = null;
+ mSecondFloatingTaskView = null;
+ mSplitInstructionsView = null;
+ if (mSecondSplitHiddenView != null) {
mSecondSplitHiddenView.setVisibility(VISIBLE);
mSecondSplitHiddenView = null;
}
@@ -4183,11 +4301,17 @@
resetTaskVisuals();
mSplitHiddenTaskViewIndex = -1;
if (mSplitHiddenTaskView != null) {
- mSplitHiddenTaskView.setVisibility(VISIBLE);
+ mSplitHiddenTaskView.setThumbnailVisibility(VISIBLE);
mSplitHiddenTaskView = null;
}
}
+ private void safeRemoveDragLayerView(@Nullable View viewToRemove) {
+ if (viewToRemove != null) {
+ mActivity.getDragLayer().removeView(viewToRemove);
+ }
+ }
+
/**
* Returns how much additional translation there should be for each of the child TaskViews.
* Note that the translation can be its primary or secondary dimension.
@@ -4297,30 +4421,33 @@
* If launching one of the adjacent tasks, parallax the center task and other adjacent task
* to the right.
*/
+ @SuppressLint("Recycle")
public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) {
AnimatorSet anim = new AnimatorSet();
int taskIndex = indexOfChild(tv);
int centerTaskIndex = getCurrentPage();
- boolean launchingCenterTask = taskIndex == centerTaskIndex;
float toScale = getMaxScaleForFullScreen();
- RecentsView recentsView = tv.getRecentsView();
+ boolean showAsGrid = showAsGrid();
+ boolean launchingCenterTask = showAsGrid
+ ? tv.isFocusedTask() && isTaskViewFullyVisible(tv)
+ : taskIndex == centerTaskIndex;
if (launchingCenterTask) {
- anim.play(ObjectAnimator.ofFloat(recentsView, RECENTS_SCALE_PROPERTY, toScale));
- anim.play(ObjectAnimator.ofFloat(recentsView, FULLSCREEN_PROGRESS, 1));
- } else {
+ anim.play(ObjectAnimator.ofFloat(this, RECENTS_SCALE_PROPERTY, toScale));
+ anim.play(ObjectAnimator.ofFloat(this, FULLSCREEN_PROGRESS, 1));
+ } else if (!showAsGrid) {
// We are launching an adjacent task, so parallax the center and other adjacent task.
float displacementX = tv.getWidth() * (toScale - 1f);
float primaryTranslation = mIsRtl ? -displacementX : displacementX;
anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex),
mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation));
- int runningTaskIndex = recentsView.getRunningTaskIndex();
+ int runningTaskIndex = getRunningTaskIndex();
if (ENABLE_QUICKSTEP_LIVE_TILE.get()
&& runningTaskIndex != -1
&& runningTaskIndex != taskIndex
- && recentsView.getRemoteTargetHandles() != null) {
- for (RemoteTargetHandle remoteHandle : recentsView.getRemoteTargetHandles()) {
+ && getRemoteTargetHandles() != null) {
+ for (RemoteTargetHandle remoteHandle : getRemoteTargetHandles()) {
anim.play(ObjectAnimator.ofFloat(
remoteHandle.getTaskViewSimulator().taskPrimaryTranslation,
AnimatedFloat.VALUE,
@@ -4340,7 +4467,7 @@
properties));
}
}
- anim.play(ObjectAnimator.ofFloat(recentsView, OVERVIEW_PROGRESS, 1, 0));
+ anim.play(ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, 0, 1));
return anim;
}
@@ -4396,11 +4523,11 @@
DepthController depthController = getDepthController();
if (depthController != null) {
- ObjectAnimator depthAnimator = ObjectAnimator.ofFloat(depthController, DEPTH,
+ ObjectAnimator depthAnimator = ObjectAnimator.ofFloat(depthController, STATE_DEPTH,
BACKGROUND_APP.getDepth(mActivity));
anim.play(depthAnimator);
}
- anim.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, 1f, 0f));
+ anim.play(ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, 0f, 1f));
anim.play(progressAnim);
anim.setInterpolator(interpolator);
@@ -5289,6 +5416,16 @@
return mRecentsAnimationController;
}
+ @Nullable
+ public FloatingTaskView getFirstFloatingTaskView() {
+ return mFirstFloatingTaskView;
+ }
+
+ @Nullable
+ public SplitInstructionsView getSplitInstructionsView() {
+ return mSplitInstructionsView;
+ }
+
/** Update the current activity locus id to show the enabled state of Overview */
public void updateLocusId() {
String locusId = "Overview";
diff --git a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
index 7d94505..27ec01a 100644
--- a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
@@ -16,7 +16,7 @@
package com.android.quickstep.views;
-import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS;
+import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import android.content.Context;
import android.util.AttributeSet;
@@ -25,6 +25,7 @@
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
+import androidx.appcompat.widget.AppCompatTextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
@@ -40,18 +41,18 @@
*/
public class SplitInstructionsView extends FrameLayout {
private final StatefulActivity mLauncher;
+ private AppCompatTextView mTextView;
- public static final FloatProperty<SplitInstructionsView> ALPHA_FLOAT =
- new FloatProperty<SplitInstructionsView>("SplitInstructionsAlpha") {
+ public static final FloatProperty<SplitInstructionsView> UNFOLD =
+ new FloatProperty<SplitInstructionsView>("SplitInstructionsUnfold") {
@Override
public void setValue(SplitInstructionsView splitInstructionsView, float v) {
- splitInstructionsView.setVisibility(v != 0 ? VISIBLE : GONE);
- splitInstructionsView.setAlpha(v);
+ splitInstructionsView.setScaleY(v);
}
@Override
public Float get(SplitInstructionsView splitInstructionsView) {
- return splitInstructionsView.getAlpha();
+ return splitInstructionsView.getScaleY();
}
};
@@ -77,6 +78,14 @@
false
);
+ splitInstructionsView.mTextView = splitInstructionsView.findViewById(
+ R.id.split_instructions_text);
+
+ // Since textview overlays base view, and we sometimes manipulate the alpha of each
+ // simultaneously, force overlapping rendering to false prevents redrawing of pixels,
+ // improving performance at the cost of some accuracy.
+ splitInstructionsView.forceHasOverlappingRendering(false);
+
dragLayer.addView(splitInstructionsView);
return splitInstructionsView;
}
@@ -120,4 +129,8 @@
return 0;
}
}
+
+ public AppCompatTextView getTextView() {
+ return mTextView;
+ }
}
diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
index 28080d4..08004dc 100644
--- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
@@ -22,7 +22,6 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.FloatProperty;
import android.util.TypedValue;
import android.widget.FrameLayout;
@@ -33,20 +32,6 @@
private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private final Rect mTempRect = new Rect();
- public static final FloatProperty<SplitPlaceholderView> ALPHA_FLOAT =
- new FloatProperty<SplitPlaceholderView>("SplitViewAlpha") {
- @Override
- public void setValue(SplitPlaceholderView splitPlaceholderView, float v) {
- splitPlaceholderView.setVisibility(v != 0 ? VISIBLE : GONE);
- splitPlaceholderView.setAlpha(v);
- }
-
- @Override
- public Float get(SplitPlaceholderView splitPlaceholderView) {
- return splitPlaceholderView.getAlpha();
- }
- };
-
@Nullable
private IconView mIconView;
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index c1711d1..6815745 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -16,8 +16,6 @@
package com.android.quickstep.views;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
-import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
import android.animation.Animator;
@@ -156,23 +154,6 @@
mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
setY(pagedOrientationHandler.getTaskMenuY(
adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
-
- // TODO(b/193432925) temporary menu placement for split screen task menus
- TaskIdAttributeContainer[] taskIdAttributeContainers =
- mTaskView.getTaskIdAttributeContainers();
- if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
- if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
- return;
- }
- Rect r = new Rect();
- mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
- if (deviceProfile.isLandscape) {
- setX(r.left);
- } else {
- setY(r.top);
-
- }
- }
}
public void onRotationChanged() {
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
index f4b3d98..d7a8599 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -16,11 +16,11 @@
package com.android.quickstep.views;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
-import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
import android.content.Context;
import android.graphics.Bitmap;
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 5602d88..ee8489d 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -32,6 +32,7 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
+import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -48,6 +49,7 @@
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.Handler;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.Log;
@@ -74,7 +76,7 @@
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.ComponentKey;
@@ -99,7 +101,6 @@
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
-import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -330,7 +331,7 @@
protected final DigitalWellBeingToast mDigitalWellBeingToast;
private float mFullscreenProgress;
private float mGridProgress;
- protected float mOverviewProgress;
+ protected float mTaskThumbnailSplashAlpha;
private float mNonGridScale = 1;
private float mDismissScale = 1;
protected final FullscreenDrawParams mCurrentFullscreenParams;
@@ -646,12 +647,12 @@
TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask);
// Indicate success once the system has indicated that the transition has started
- ActivityOptions opts = ActivityOptionsCompat.makeCustomAnimation(
- getContext(), 0, 0, () -> callback.accept(true), MAIN_EXECUTOR.getHandler());
+ ActivityOptions opts = makeCustomAnimation(getContext(), 0, 0,
+ () -> callback.accept(true), MAIN_EXECUTOR.getHandler());
opts.setLaunchDisplayId(
getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId());
if (freezeTaskList) {
- ActivityOptionsCompat.setFreezeRecentTasksList(opts);
+ opts.setFreezeRecentTasksReordering();
}
// TODO(b/202826469): Replace setSplashScreenStyle with setDisableStartingWindow.
opts.setSplashScreenStyle(mSnapshotView.shouldShowSplashView()
@@ -674,14 +675,29 @@
}
/**
+ * Returns ActivityOptions for overriding task transition animation.
+ */
+ private ActivityOptions makeCustomAnimation(Context context, int enterResId,
+ int exitResId, final Runnable callback, final Handler callbackHandler) {
+ return ActivityOptions.makeCustomTaskAnimation(context, enterResId, exitResId,
+ callbackHandler,
+ elapsedRealTime -> {
+ if (callback != null) {
+ callbackHandler.post(callback);
+ }
+ }, null /* finishedListener */);
+ }
+
+ /**
* Launch of the current task (both live and inactive tasks) with an animation.
*/
- public void launchTasks() {
+ public RunnableList launchTasks() {
RecentsView recentsView = getRecentsView();
RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
+ RunnableList runnableList = new RunnableList();
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask() && remoteTargetHandles != null) {
if (!mIsClickableAsLiveTile) {
- return;
+ return runnableList;
}
mIsClickableAsLiveTile = false;
@@ -708,7 +724,7 @@
// here, try to launch the task as a non live tile task.
launchTaskAnimated();
mIsClickableAsLiveTile = true;
- return;
+ return runnableList;
}
AnimatorSet anim = new AnimatorSet();
@@ -733,13 +749,24 @@
launchTaskAnimated();
}
mIsClickableAsLiveTile = true;
+ runEndCallback();
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ runEndCallback();
+ }
+
+ private void runEndCallback() {
+ runnableList.executeAllAndDestroy();
}
});
anim.start();
recentsView.onTaskLaunchedInLiveTileMode();
} else {
- launchTaskAnimated();
+ return launchTaskAnimated();
}
+ return runnableList;
}
/**
@@ -866,10 +893,9 @@
int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
- int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx
- : deviceProfile.overviewTaskMarginPx;
- int taskIconMargin = thumbnailTopMargin - taskIconHeight - taskMargin;
- orientationHandler.setTaskIconParams(iconParams, taskIconMargin, taskIconHeight,
+ int taskMargin = deviceProfile.overviewTaskMarginPx;
+
+ orientationHandler.setTaskIconParams(iconParams, taskMargin, taskIconHeight,
thumbnailTopMargin, isRtl);
iconParams.width = iconParams.height = taskIconHeight;
mIconView.setLayoutParams(iconParams);
@@ -1057,18 +1083,15 @@
}
/**
- * Updates progress of task view for entering/exiting overview on swipe up/down.
- *
- * <p>Updates the alpha of any splash screen over the thumbnail if it exists.
+ * Updates alpha of task thumbnail splash on swipe up/down.
*/
- public void setOverviewProgress(float overviewProgress) {
- mOverviewProgress = overviewProgress;
+ public void setTaskThumbnailSplashAlpha(float taskThumbnailSplashAlpha) {
+ mTaskThumbnailSplashAlpha = taskThumbnailSplashAlpha;
applyThumbnailSplashAlpha();
}
protected void applyThumbnailSplashAlpha() {
- mSnapshotView.setSplashAlpha(
- Utilities.mapToRange(mOverviewProgress, 0f, 1f, 1f, 0f, LINEAR));
+ mSnapshotView.setSplashAlpha(mTaskThumbnailSplashAlpha);
}
private void setSplitSelectTranslationX(float x) {
@@ -1474,7 +1497,8 @@
}
public void initiateSplitSelect(SplitPositionOption splitPositionOption) {
- getRecentsView().initiateSplitSelect(this, splitPositionOption.stagePosition);
+ getRecentsView().initiateSplitSelect(this, splitPositionOption.stagePosition,
+ getLogEventForPosition(splitPositionOption.stagePosition));
}
/**
@@ -1492,6 +1516,10 @@
return display != null ? display.getDisplayId() : DEFAULT_DISPLAY;
}
+ void setThumbnailVisibility(int visibility) {
+ mSnapshotView.setVisibility(visibility);
+ }
+
/**
* We update and subsequently draw these in {@link #setFullscreenProgress(float)}.
*/
diff --git a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
index 09f0858..f190e27 100644
--- a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
+++ b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
@@ -35,7 +35,7 @@
* Base class for all instrumentation tests that deal with Quickstep.
*/
public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest {
- static final boolean ENABLE_SHELL_TRANSITIONS =
+ public static final boolean ENABLE_SHELL_TRANSITIONS =
SystemProperties.getBoolean("persist.wm.debug.shell_transit", false);
@Override
protected TestRule getRulesInsideActivityMonitor() {
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
deleted file mode 100644
index 3daf81d..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for phone with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.getCellSize().x).isEqualTo(265)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.getCellSize().y).isEqualTo(552)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(232)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(669)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomPaddingPx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(135)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1189)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(573)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2447)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1334)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(558)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
deleted file mode 100644
index e588c71..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for phone.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone()
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.getCellSize().x).isEqualTo(265)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.getCellSize().y).isEqualTo(552)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(232)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(669)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomPaddingPx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(135)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1189)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(573)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2447)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1334)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(558)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
deleted file mode 100644
index d0c9346..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in landscape with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(558)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(294)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(199)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(228)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(true)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1237)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(93)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1407)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2522)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(109)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(1305)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(566)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(566)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
deleted file mode 100644
index 456ed2c..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in landscape.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(558)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(294)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(199)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(228)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(503)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(true)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(-503)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(93)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1407)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2522)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(109)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(301)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(301)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
deleted file mode 100644
index eed3598..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in portrait with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(482)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(257)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1216)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(238)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2222)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1542)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(528)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(528)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(502)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
deleted file mode 100644
index 4be3e45..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in portrait.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet()
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(482)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(257)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(256)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1216)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(238)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2222)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1542)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(192)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(192)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
deleted file mode 100644
index 6728540..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in landscape with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isTwoPanel = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(259)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(260)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(175)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1039)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(285)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1215)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1237)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(864)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(864)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(566)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
deleted file mode 100644
index ba3ef55..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in landscape.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isTwoPanel = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(259)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(260)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(175)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(73)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1039)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(285)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1215)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1237)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(761)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(761)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
deleted file mode 100644
index a4b446a..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in portrait with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isTwoPanel = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(153)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(509)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(134)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(685)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(291)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2169)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(767)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(266)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(502)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(502)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
deleted file mode 100644
index 0c5968e..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in portrait.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isTwoPanel = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(153)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(509)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(134)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(2)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(685)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(291)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2169)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(767)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(459)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(459)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
deleted file mode 100644
index 2bad6bb..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for landscape phone with vertical bar and 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isVerticalBar = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isFalse()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(210)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(675)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(321)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(0)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(260)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(304)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(336)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(0)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(2221)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(14)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(266)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(0)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1340)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2840)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(true)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(225)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
deleted file mode 100644
index 6256a43..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for landscape phone with vertical bar.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isVerticalBar = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isFalse()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(210)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(675)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(321)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(0)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(260)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(304)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(336)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(0)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(2221)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(14)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(266)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(0)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1340)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2840)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(true)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(225)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt b/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
new file mode 100644
index 0000000..3967f75
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep
+
+import android.graphics.Rect
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.DeviceProfileBaseTest
+import com.android.launcher3.util.WindowBounds
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class HotseatWidthCalculationTest : DeviceProfileBaseTest() {
+
+ /**
+ * This is a case when after setting the hotseat, the space needs to be recalculated
+ * but it doesn't need to change QSB width or remove icons
+ */
+ @Test
+ fun distribute_border_space_when_space_is_enough_portrait() {
+ initializeVarsForTablet(isGestureMode = false)
+ windowBounds = WindowBounds(Rect(0, 0, 1800, 2560), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(558)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(69)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(176)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(558)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1445)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, and recalculating spaces
+ * it still needs to remove icons for everything to fit
+ */
+ @Test
+ fun decrease_num_of_icons_when_not_enough_space_portrait() {
+ initializeVarsForTablet(isGestureMode = false)
+ windowBounds = WindowBounds(Rect(0, 0, 1300, 2560), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(558)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(4)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(76)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(122)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(558)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1058)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, the space needs to be recalculated
+ * but it doesn't need to change QSB width or remove icons
+ */
+ @Test
+ fun distribute_border_space_when_space_is_enough_landscape() {
+ initializeVarsForTwoPanel(isGestureMode = false, isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(744)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(83)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(106)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(744)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1467)
+ }
+
+ /**
+ * This is a case when the hotseat spans a certain amount of columns
+ * and the nav buttons push the hotseat to the side, but not enough to change the border space.
+ */
+ @Test
+ fun nav_buttons_dont_interfere_with_required_hotseat_width() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ inv?.apply {
+ hotseatColumnSpan = IntArray(4) { 4 }
+ inlineQsb = BooleanArray(4) { false }
+ }
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(705)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(108)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(631)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1227)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, the QSB width needs to be changed to fit
+ */
+ @Test
+ fun decrease_qsb_when_not_enough_space_landscape() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ windowBounds = WindowBounds(Rect(0, 0, 2460, 1600), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(705)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(36)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(884)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
+
+ assertThat(dp.isQsbInline).isTrue()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(559)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, changing QSB width, and recalculating spaces
+ * it still needs to remove icons for everything to fit
+ */
+ @Test
+ fun decrease_num_of_icons_when_not_enough_space_landscape() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ windowBounds = WindowBounds(Rect(0, 0, 2260, 1600), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(705)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(5)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(56)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(801)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
+
+ assertThat(dp.isQsbInline).isTrue()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(480)
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
index 1c15e1e..9c240f0 100644
--- a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
+++ b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
@@ -19,7 +19,7 @@
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
-import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON;
+import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -41,7 +41,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.RotationUtils;
import com.android.launcher3.util.WindowBounds;
diff --git a/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java b/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
index 4e49716..ed5526f 100644
--- a/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
+++ b/quickstep/tests/src/com/android/quickstep/RecentTasksListTest.java
@@ -26,12 +26,12 @@
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
+import android.app.KeyguardManager;
import androidx.test.filters.SmallTest;
import com.android.launcher3.util.LooperExecutor;
import com.android.quickstep.util.GroupTask;
-import com.android.systemui.shared.system.KeyguardManagerCompat;
import com.android.wm.shell.util.GroupedRecentTaskInfo;
import org.junit.Before;
@@ -56,8 +56,8 @@
public void setup() {
MockitoAnnotations.initMocks(this);
LooperExecutor mockMainThreadExecutor = mock(LooperExecutor.class);
- KeyguardManagerCompat mockKeyguardManagerCompat = mock(KeyguardManagerCompat.class);
- mRecentTasksList = new RecentTasksList(mockMainThreadExecutor, mockKeyguardManagerCompat,
+ KeyguardManager mockKeyguardManager = mock(KeyguardManager.class);
+ mRecentTasksList = new RecentTasksList(mockMainThreadExecutor, mockKeyguardManager,
mockSystemUiProxy);
}
@@ -70,7 +70,7 @@
@Test
public void loadTasksInBackground_onlyKeys_noValidTaskDescription() {
- GroupedRecentTaskInfo recentTaskInfos = new GroupedRecentTaskInfo(
+ GroupedRecentTaskInfo recentTaskInfos = GroupedRecentTaskInfo.forSplitTasks(
new ActivityManager.RecentTaskInfo(), new ActivityManager.RecentTaskInfo(), null);
when(mockSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
@@ -90,8 +90,8 @@
task1.taskDescription = new ActivityManager.TaskDescription(taskDescription);
ActivityManager.RecentTaskInfo task2 = new ActivityManager.RecentTaskInfo();
task2.taskDescription = new ActivityManager.TaskDescription();
- GroupedRecentTaskInfo recentTaskInfos = new GroupedRecentTaskInfo(
- task1, task2, null);
+ GroupedRecentTaskInfo recentTaskInfos = GroupedRecentTaskInfo.forSplitTasks(task1, task2,
+ null);
when(mockSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 81df3c0..42e9be3 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -181,6 +181,21 @@
@Test
@PortraitLandscape
+ public void testSplitFromOverview() {
+ assumeTrue(!mLauncher.isTablet());
+
+ startTestActivity(2);
+ startTestActivity(3);
+
+ mLauncher.goHome().switchToOverview().getCurrentTask()
+ .tapMenu()
+ .tapSplitMenuItem()
+ .getTestActivityTask(2)
+ .open();
+ }
+
+ @Test
+ @PortraitLandscape
public void testSplitFromOverviewForTablet() {
assumeTrue(mLauncher.isTablet());
@@ -212,7 +227,9 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
+ @ScreenRecord // b/238461765
public void testSwitchToOverview() throws Exception {
+ startTestAppsWithCheck();
assertNotNull("Workspace.switchToOverview() returned null",
mLauncher.goHome().switchToOverview());
assertTrue("Launcher internal state didn't switch to Overview",
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
index 1df9c02..9337cb5 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java
@@ -68,6 +68,13 @@
}
@Test
+ public void testHideTaskbarPersistsOnRecreate() {
+ getTaskbar().hide();
+ mLauncher.recreateTaskbar();
+ mLauncher.getLaunchedAppState().assertTaskbarHidden();
+ }
+
+ @Test
public void testLaunchApp() throws Exception {
getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
}
diff --git a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
index d43aafa..190b002 100644
--- a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
+++ b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
@@ -34,6 +34,7 @@
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.LauncherModelHelper;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.ReflectionHelpers;
import com.android.launcher3.util.RotationUtils;
import com.android.launcher3.util.WindowBounds;
@@ -164,6 +165,7 @@
WindowManagerProxy wmProxy = mock(WindowManagerProxy.class);
doReturn(cdi).when(wmProxy).getDisplayInfo(any());
doReturn(wm).when(wmProxy).getRealBounds(any(), any());
+ doReturn(NavigationMode.NO_BUTTON).when(wmProxy).getNavigationMode(any());
ArrayMap<CachedDisplayInfo, WindowBounds[]> perDisplayBoundsCache =
new ArrayMap<>();
diff --git a/res/drawable/ic_all_apps_bg_hand.xml b/res/drawable/ic_all_apps_bg_hand.xml
deleted file mode 100644
index 7f3fe14..0000000
--- a/res/drawable/ic_all_apps_bg_hand.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="208dp"
- android:height="212dp"
- android:viewportWidth="208.0"
- android:viewportHeight="212.0">
- <path
- android:fillColor="#1A000000"
- android:pathData="M89.4,61.8H85l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C92.2,16.6,76,0.3,55.9,0.3
- S19.5,16.6,19.5,36.6S35.8,73,55.9,73c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L89.4,61.8z M54,66.6
- c-13.9,0-28.8-16-28.8-30S41.5,8.9,55.4,8.9S81,22.7,81,36.6S67.9,66.6,54,66.6z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M33.4,29.2l-0.3-1.8l-4.2-3.1L18.1,26l-3.1,4.2l0.3,1.8L4.5,33.7L9,62.5
- c0.2,1.5,1.6,2.5,3.1,2.3l34.2-5.3c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.8L33.4,29.2z"/>
- <path
- android:fillColor="#3367D6"
- android:pathData="M30.2,27.9l-0.3-1.8l-4.1-3L15,24.7l-3,4.1l0.3,1.8L1.6,32.3L6,60.9
- c0.2,1.5,1.6,2.5,3.1,2.3L43,57.9c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.6L30.2,27.9z M26.6,28.4l-10.7,1.6l-0.3-1.8l10.7-1.6L26.6,28.4z"/>
- <group>
- <clip-path
- android:pathData="M25.1,37.7a28.9,28.9 0 1,0 57.8,0a28.9,28.9 0 1,0 -57.8,0"/>
- <path
- android:fillColor="#4285F4"
- android:pathData="M41.7,23l-0.3-2.1l-4.9-3.6l-12.6,1.9l-3.6,4.9l0.3,2.1L8.1,28.1l5.2,33.7
- c0.3,1.7,1.9,2.9,3.6,2.7l40-6.1c1.7-0.3,2.9-1.9,2.7-3.6L54.4,21L41.7,23z M37.5,23.6l-12.6,1.9l-0.3-2.1l12.6-1.9L37.5,23.6z"/>
- </group>
- <path
- android:fillColor="?android:attr/colorControlHighlight"
- android:pathData="M87.5,62.9h-4.4l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C90.3,17.7,74,1.4,54,1.4
- S17.6,17.7,17.6,37.7S33.9,74.1,54,74.1c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L87.5,62.9z M54,64.2
- c-14.7,0-26.5-11.8-26.5-26.5S39.3,11.2,54,11.2s26.5,11.8,26.5,26.5S68.6,64.2,54,64.2z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M153.4,112.9c-14.9-17.2-38.6-9.1-38.6-9.1l-10.2-11.3c0,0-4.8-5.9-9-3.7
- c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l17.1,3.7l-0.9-0.7l-1-0.7L153.4,112.9z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M152.1,113.9c-14.9-17.2-37.6-8-37.6-8l-11.1-12.3c0,0-4.8-5.9-9-3.7
- c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l19,4.1"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M148.6,77.9c0.6,0.7,2,2.5,2.1,2.6c1.1,1.7,6.2,13.6,11.8,35.1c0,0.1,1.9,3,1.9,3.1
- c0,0,0.1,0.1,0.1,0.2c0,0,0,0,0-0.1c0.9,1.3,4.4,6.6,8.9,13.7c0.1,0.2,0.3,0.5,0.4,0.7c0,0.1,0.1,0.1,0.1,0.2
- c0.2,0.3,0.4,0.6,0.6,0.9c0.1-0.1,0.2-0.2,0.3-0.3c0.2-0.3,0.6-0.3,0.8,0c2.9,4.8,21.2,35,26.7,49c2.1,5.3,3.2,8.4,3.6,11.6
- c0.3,2.3,0,4.4-1.2,6c1.5-1.9,3.5-6.8-1.5-19c-1.2-2.9-2.8-6.5-4.8-10.5c-7.5-15.2-20-35.6-22.4-39.6c-0.2-0.3-0.6-0.3-0.8,0
- c-0.2,0.2-0.3,0.4-0.5,0.6c-4.5-7.1-8.2-12.6-8.8-13.5c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.6-10.7-33.4-11.8-35.1
- c-0.1-0.1-1.5-1.9-2.1-2.6l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3c-2.5,1.8-1.6,4.5-0.1,7.1l3.3,5.2l7-2
- C147.7,77.4,148.1,77.3,148.6,77.9z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M148.6,77.9l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l3.8,6L148.6,77.9C148.6,77.9,148.6,77.9,148.6,77.9z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M151.1,92.5l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L151.1,92.5z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M149.7,92.9l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L149.7,92.9z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M141.6,94.6l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0l0,0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L141.6,94.6z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M140.1,95l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0h0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L140.1,95z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M140.4,99.1c-0.5-0.6-2.1-7.5-2.8-7.3l-15.9-6.9c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5
- l-0.4-0.6L100,54.5c-1.5-2-3.3-4-5.3-4.3c-0.7-0.1-1.3-0.2-2,0.2v0c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L108.5,87
- l0.2,0.4l6.6,11.7l0,0c2.5,4.5,4.4,10.5,4.4,10.7L140.4,99.1"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M129.7,125.1c3,0.7,8.1,4,11.8,9.1c2.7,3.7,5.5,8.3,8.2,13
- c7.6-2.3,19.9-6.8,24.9-12.9c-0.2-0.3-0.4-0.6-0.6-0.9c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.2-0.3-0.5-0.4-0.7c-4.5-7.1-8-12.4-8.9-13.7
- c0,0,0,0,0,0.1c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.5-10.7-33.4-11.8-35.1c-0.1-0.1-1.5-1.9-2.1-2.6
- c-0.5-0.6-0.9-0.5-1.6-0.3l-26.8,7.7c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5l-0.4-0.6L98.5,54.8c-1.5-2-3.3-4-5.3-4.3
- c-0.7-0.1-1.3-0.2-2,0.2c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L107,87.3l0.2,0.4l6.6,11.7l0,0
- c2.5,4.5,4.4,10.5,4.4,10.7L129.7,125.1"/>
- <path
- android:fillColor="?android:attr/colorForeground"
- android:pathData="M202.3,183.1c-5.4-14.1-23.8-44.3-26.7-49c-0.2-0.3-0.6-0.3-0.8,0
- c-5.1,6.6-19,11.4-26.5,13.6c-0.3,0.1-1,0.1-1.2,0.6c-0.2,0.4,0.1,1,0.2,1.1c7.8,12.9,14.7,27.9,15.3,29.3c0,0.1,0.1,0.1,0.1,0.2
- l9.6,22.9c0,0,0,0,0,0l1.7,4.1c1.4,2.7,3,4.3,5.3,5.1c1.5,0.5,2.1,0.6,3.2,0.6c4.8,0.1,15.2-6.1,20.5-9.4c2.7-1.7,3.3-4.4,2.9-7.6
- C205.5,191.5,204.4,188.4,202.3,183.1z"/>
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_1.xml b/res/drawable/ic_all_apps_bg_icon_1.xml
deleted file mode 100644
index d226ac6..0000000
--- a/res/drawable/ic_all_apps_bg_icon_1.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M44.28,30.96c4.84-10.68,0.09-23.27-10.59-28.11S10.42,2.74,5.58,13.42
- C1,23.54,6.5,35.92,16.62,40.51l0,0l-3.23,7.12C27.84,47,39.79,40.86,44.28,30.96z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M41.75,30.05c4.84-10.68,0.09-23.27-10.59-28.11S7.9,1.83,3.06,12.51
- c-4.59,10.12,0.92,22.5,11.03,27.09l0,0l-3.23,7.12C25.31,46.09,37.26,39.94,41.75,30.05z" />
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_2.xml b/res/drawable/ic_all_apps_bg_icon_2.xml
deleted file mode 100644
index 5966d99..0000000
--- a/res/drawable/ic_all_apps_bg_icon_2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M20.54,44.59c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
- c-0.25-0.58-0.9-0.99-1.89-1.1L6.2,5.99C5.39,5.91,4.74,6.08,4.32,6.44l0,0C3.7,6.97,3.55,7.88,4.01,8.96l14.54,34.09
- C19,44.13,19.75,44.65,20.54,44.59L20.54,44.59z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M18.49,43.22c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
- c-0.25-0.58-0.9-0.99-1.89-1.1L4.15,4.62C3.34,4.54,2.69,4.71,2.27,5.08l0,0C1.65,5.6,1.5,6.52,1.96,7.6L16.5,41.69
- C16.96,42.76,17.7,43.28,18.49,43.22L18.49,43.22z" />
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_3.xml b/res/drawable/ic_all_apps_bg_icon_3.xml
deleted file mode 100644
index b18f8bc..0000000
--- a/res/drawable/ic_all_apps_bg_icon_3.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M25.18,1.27c-12.32,0-23.41,9.99-23.41,22.31s11.09,22.31,23.41,22.31
- s22.31-9.99,22.31-22.31S37.5,1.27,25.18,1.27z M25.18,33.55c-5.5,0-14.35-5.1-14.35-10.6s8.32-12.19,13.82-12.19
- c5.5,0,10.49,7.33,10.49,12.83S30.68,33.55,25.18,33.55z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M22.93,0.22c-12.32,0-22.31,9.99-22.31,22.31s9.99,22.31,22.31,22.31
- s22.31-9.99,22.31-22.31S35.25,0.22,22.93,0.22z M22.93,32.5c-5.5,0-9.97-4.46-9.97-9.97s4.46-9.97,9.97-9.97
- c5.5,0,9.97,4.46,9.97,9.97S28.43,32.5,22.93,32.5z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M14.81,22.53a8.12,8.12 0 1,0 16.24,0a8.12,8.12 0 1,0 -16.24,0z" />
-</vector>
diff --git a/res/drawable/ic_all_apps_bg_icon_4.xml b/res/drawable/ic_all_apps_bg_icon_4.xml
deleted file mode 100644
index 8eb4d90..0000000
--- a/res/drawable/ic_all_apps_bg_icon_4.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M11.53,8.02l23.39-5.73c1.61-0.39,3.25,0.6,3.64,2.21l7.64,31.19
- c0.39,1.61-0.6,3.25-2.21,3.64L12.8,46.97c-1.61,0.39-3.25-0.6-3.64-2.21L3.43,21.37L11.53,8.02z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M9.2,6.53L32.59,0.8C34.2,0.4,35.84,1.4,36.23,3l7.64,31.19c0.39,1.61-0.6,3.25-2.21,3.64
- l-31.19,7.64c-1.61,0.39-3.25-0.6-3.64-2.21L1.11,19.87L9.2,6.53z" />
- <path
- android:fillColor="#1A000000"
- android:pathData="M9.27,6.47l1.91,7.8c0.4,1.62-0.59,3.24-2.21,3.64l-7.8,1.91L9.27,6.47z" />
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_block_shadow.xml b/res/drawable/ic_block_shadow.xml
deleted file mode 100644
index 045fe8d..0000000
--- a/res/drawable/ic_block_shadow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<com.android.launcher3.graphics.ShadowDrawable
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_block_no_shadow"
- android:elevation="@dimen/drop_target_shadow_elevation" />
diff --git a/res/drawable/ic_remove_shadow.xml b/res/drawable/ic_remove_shadow.xml
deleted file mode 100644
index 48abc10..0000000
--- a/res/drawable/ic_remove_shadow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<com.android.launcher3.graphics.ShadowDrawable
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_remove_no_shadow"
- android:elevation="@dimen/drop_target_shadow_elevation" />
diff --git a/res/drawable/ic_setup_shadow.xml b/res/drawable/ic_setup_shadow.xml
deleted file mode 100644
index 10aeee6..0000000
--- a/res/drawable/ic_setup_shadow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<com.android.launcher3.graphics.ShadowDrawable
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_setting"
- android:elevation="@dimen/drop_target_shadow_elevation" />
diff --git a/res/drawable/ic_uninstall_shadow.xml b/res/drawable/ic_uninstall_shadow.xml
deleted file mode 100644
index b441b0e..0000000
--- a/res/drawable/ic_uninstall_shadow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<com.android.launcher3.graphics.ShadowDrawable
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_uninstall_no_shadow"
- android:elevation="@dimen/drop_target_shadow_elevation" />
diff --git a/res/layout/all_apps_personal_work_tabs.xml b/res/layout/all_apps_personal_work_tabs.xml
index 11143fb..d15b906 100644
--- a/res/layout/all_apps_personal_work_tabs.xml
+++ b/res/layout/all_apps_personal_work_tabs.xml
@@ -20,6 +20,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/all_apps_header_pill_height"
android:layout_gravity="center_horizontal"
+ android:paddingTop="@dimen/all_apps_tabs_vertical_padding"
+ android:paddingBottom="@dimen/all_apps_tabs_vertical_padding"
android:orientation="horizontal"
style="@style/TextHeadline">
@@ -28,7 +30,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_apps_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/all_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/all_apps_tabs_background"
android:text="@string/all_apps_personal_tab"
@@ -41,7 +42,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_apps_tabs_button_horizontal_padding"
- android:layout_marginVertical="@dimen/all_apps_tabs_vertical_padding"
android:layout_weight="1"
android:background="@drawable/all_apps_tabs_background"
android:text="@string/all_apps_work_tab"
diff --git a/res/layout/all_apps_search_market.xml b/res/layout/all_apps_search_market.xml
deleted file mode 100644
index 6f2dd3d..0000000
--- a/res/layout/all_apps_search_market.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/search_market_text"
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:gravity="center"
- android:paddingLeft="@dimen/dynamic_grid_edge_margin"
- android:paddingRight="@dimen/dynamic_grid_edge_margin"
- android:fontFamily="sans-serif-medium"
- android:textSize="14sp"
- android:textColor="?android:attr/colorAccent"
- android:text="@string/all_apps_search_market_message"
- android:textAllCaps="true"
- android:focusable="true"
- android:background="?android:selectableItemBackground" />
diff --git a/res/layout/hotseat.xml b/res/layout/hotseat.xml
index 82b0b8d..95ebd94 100644
--- a/res/layout/hotseat.xml
+++ b/res/layout/hotseat.xml
@@ -21,4 +21,5 @@
android:layout_height="match_parent"
android:theme="@style/HomeScreenElementTheme"
android:importantForAccessibility="no"
+ android:preferKeepClear="true"
launcher:containerType="hotseat" />
\ No newline at end of file
diff --git a/res/layout/search_container_all_apps.xml b/res/layout/search_container_all_apps.xml
index e1646ba..b46298c 100644
--- a/res/layout/search_container_all_apps.xml
+++ b/res/layout/search_container_all_apps.xml
@@ -26,6 +26,7 @@
android:gravity="center"
android:hint="@string/all_apps_search_bar_hint"
android:imeOptions="actionSearch|flagNoExtractUi"
+ android:importantForAutofill="no"
android:inputType="text|textNoSuggestions|textCapWords"
android:maxLines="1"
android:padding="8dp"
diff --git a/res/layout/search_results_rv_layout.xml b/res/layout/search_results_rv_layout.xml
index 567cb5f..9127521 100644
--- a/res/layout/search_results_rv_layout.xml
+++ b/res/layout/search_results_rv_layout.xml
@@ -18,7 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search_results_list_view"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
android:focusable="true" />
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index 635db14..4be2e45 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -18,6 +18,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drag_layer"
+ android:clipChildren="false"
android:padding="@dimen/dynamic_grid_edge_margin">
<GridView
@@ -52,7 +53,6 @@
android:saveEnabled="false"
android:layout_gravity="bottom|end"
android:background="@drawable/round_rect_primary"
- android:elevation="2dp"
android:visibility="invisible" >
<include
@@ -76,35 +76,8 @@
android:paddingTop="@dimen/all_apps_header_top_padding"
android:orientation="vertical" >
- <com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip
- android:id="@+id/tabs"
- android:layout_width="match_parent"
- android:layout_height="@dimen/all_apps_header_pill_height"
- android:orientation="horizontal"
- style="@style/TextHeadline">
-
- <Button
- android:id="@+id/tab_personal"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="?android:attr/selectableItemBackground"
- android:text="@string/all_apps_personal_tab"
- android:textAllCaps="true"
- android:textColor="@color/all_apps_tab_text"
- android:textSize="14sp" />
-
- <Button
- android:id="@+id/tab_work"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="?android:attr/selectableItemBackground"
- android:text="@string/all_apps_work_tab"
- android:textAllCaps="true"
- android:textColor="@color/all_apps_tab_text"
- android:textSize="14sp" />
- </com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip>
+ <include layout="@layout/floating_header_content" />
+ <include layout="@layout/all_apps_personal_work_tabs" />
</com.android.launcher3.allapps.FloatingHeaderView>
<com.android.launcher3.allapps.search.AppsSearchContainerLayout
@@ -113,12 +86,14 @@
android:layout_height="@dimen/all_apps_search_bar_field_height"
android:layout_centerHorizontal="true"
android:layout_gravity="top|center_horizontal"
+ android:layout_marginTop="24dp"
android:background="@drawable/bg_all_apps_searchbox"
android:elevation="1dp"
android:focusableInTouchMode="true"
android:gravity="center"
android:hint="@string/all_apps_search_bar_hint"
android:imeOptions="actionSearch|flagNoExtractUi"
+ android:importantForAutofill="no"
android:inputType="text|textNoSuggestions|textCapWords"
android:maxLines="1"
android:padding="8dp"
diff --git a/res/layout/user_folder_icon_normalized.xml b/res/layout/user_folder_icon_normalized.xml
index 11eea60..4dee6e7 100644
--- a/res/layout/user_folder_icon_normalized.xml
+++ b/res/layout/user_folder_icon_normalized.xml
@@ -30,11 +30,12 @@
<LinearLayout
android:id="@+id/folder_footer"
android:layout_width="match_parent"
- android:layout_height="48dp"
+ android:layout_height="@dimen/folder_label_height"
android:clipChildren="false"
android:orientation="horizontal"
android:paddingLeft="12dp"
- android:paddingRight="12dp" >
+ android:paddingRight="12dp"
+ android:alpha="0">
<com.android.launcher3.folder.FolderNameEditText
android:id="@+id/folder_name"
@@ -47,6 +48,7 @@
android:gravity="center_horizontal"
android:hint="@string/folder_hint_text"
android:imeOptions="flagNoExtractUi"
+ android:importantForAutofill="no"
android:singleLine="true"
android:textColor="?attr/folderTextColor"
android:textColorHighlight="?android:attr/colorControlHighlight"
diff --git a/res/layout/widgets_search_bar.xml b/res/layout/widgets_search_bar.xml
index 9178a75..6d44865 100644
--- a/res/layout/widgets_search_bar.xml
+++ b/res/layout/widgets_search_bar.xml
@@ -23,6 +23,7 @@
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionSearch"
+ android:importantForAutofill="no"
android:textColor="?android:attr/textColorPrimary"
android:textColorHint="?android:attr/textColorSecondary"/>
diff --git a/res/layout/work_mode_fab.xml b/res/layout/work_mode_fab.xml
index d2fa5fa..81b28ba 100644
--- a/res/layout/work_mode_fab.xml
+++ b/res/layout/work_mode_fab.xml
@@ -26,6 +26,7 @@
android:textColor="@color/all_apps_tab_text"
android:textSize="14sp"
android:background="@drawable/work_apps_toggle_background"
+ android:forceHasOverlappingRendering="false"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_corp_off"
android:layout_marginBottom="@dimen/work_fab_margin_bottom"
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index 445bfda..500fce2 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Deursoek programme"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Laai tans programme …"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Kon geen programme kry wat by \"<xliff:g id="QUERY">%1$s</xliff:g>\" pas nie"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Soek meer programme"</string>
<string name="label_application" msgid="8531721983832654978">"Program"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle programme"</string>
<string name="notifications_header" msgid="1404149926117359025">"Kennisgewings"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deïnstalleer"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Programinligting"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Installeer"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Moenie program voorstel nie"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Moenie voorstel nie"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Vasspeldvoorspelling"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"installeer kortpaaie"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Laat \'n program toe om kortpaaie by te voeg sonder gebruikerinmenging."</string>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 474cd9f..b7d4a7d 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"መተግበሪያዎችን ፈልግ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"መተግበሪያዎችን በመጫን ላይ…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"ከ«<xliff:g id="QUERY">%1$s</xliff:g>» ጋር የሚዛመዱ ምንም መተግበሪያዎች አልተገኙም"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ተጨማሪ መተግበሪያዎች ይፈልጉ"</string>
<string name="label_application" msgid="8531721983832654978">"መተግበሪያ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ሁሉም መተግበሪያዎች"</string>
<string name="notifications_header" msgid="1404149926117359025">"ማሳወቂያዎች"</string>
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index a4f7c03..c234900 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"بحث في التطبيقات"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"جارٍ تحميل التطبيقات…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"لم يتم العثور على أي تطبيقات تتطابق مع \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"البحث عن مزيد من التطبيقات"</string>
<string name="label_application" msgid="8531721983832654978">"تطبيق"</string>
<string name="all_apps_label" msgid="5015784846527570951">"جميع التطبيقات"</string>
<string name="notifications_header" msgid="1404149926117359025">"الإشعارات"</string>
@@ -102,7 +101,7 @@
<string name="folder_name_format_exact" msgid="8626242716117004803">"المجلد: <xliff:g id="NAME">%1$s</xliff:g>، <xliff:g id="SIZE">%2$d</xliff:g> عنصر"</string>
<string name="folder_name_format_overflow" msgid="4270108890534995199">"المجلد: <xliff:g id="NAME">%1$s</xliff:g>، <xliff:g id="SIZE">%2$d</xliff:g> عنصر أو أكثر"</string>
<string name="wallpaper_button_text" msgid="8404103075899945851">"الخلفيات"</string>
- <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"الخلفية والنمط"</string>
+ <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"الخلفية والأسلوب"</string>
<string name="settings_button_text" msgid="8873672322605444408">"إعدادات الشاشة الرئيسية"</string>
<string name="msg_disabled_by_admin" msgid="6898038085516271325">"أوقف المشرف هذه الميزة"</string>
<string name="allow_rotation_title" msgid="7222049633713050106">"السماح بتدوير الشاشة الرئيسية"</string>
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
index beb9619..eee5ae2 100644
--- a/res/values-as/strings.xml
+++ b/res/values-as/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"এপসমূহ সন্ধান কৰক"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"এপসমূহ ল’ড কৰি থকা হৈছে…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\"ৰ সৈতে মিলা কোনো এপ্ বিচাৰি পোৱা নগ\'ল"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"আৰু অধিক এপবোৰ সন্ধান কৰক"</string>
<string name="label_application" msgid="8531721983832654978">"এপ্"</string>
<string name="all_apps_label" msgid="5015784846527570951">"আটাইবোৰ এপ্"</string>
<string name="notifications_header" msgid="1404149926117359025">"জাননীসমূহ"</string>
@@ -73,9 +72,9 @@
<string name="all_apps_button_work_label" msgid="7270707118948892488">"কৰ্মস্থানৰ এপৰ তালিকা"</string>
<string name="remove_drop_target_label" msgid="7812859488053230776">"আঁতৰাওক"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"আনইনষ্টল কৰক"</string>
- <string name="app_info_drop_target_label" msgid="692894985365717661">"এপ সম্পৰ্কীয় তথ্য"</string>
+ <string name="app_info_drop_target_label" msgid="692894985365717661">"এপ্ সম্পৰ্কীয় তথ্য"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ইনষ্টল কৰক"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"এপৰ পৰামৰ্শ নিদিব"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"পৰামৰ্শ নিদিব"</string>
<string name="pin_prediction" msgid="4196423321649756498">"পূৰ্বানুমান কৰা এপ্টো পিন কৰক"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"শ্বৰ্টকাট ইনষ্টল কৰিব পাৰে"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ব্য়ৱহাৰকাৰীৰ হস্তক্ষেপ অবিহনেই কোনো এপক শ্বৰ্টকাটবোৰ যোগ কৰাৰ অনুমতি দিয়ে।"</string>
diff --git a/res/values-az/strings.xml b/res/values-az/strings.xml
index 93e6f08..2e07405 100644
--- a/res/values-az/strings.xml
+++ b/res/values-az/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Tətbiqləri axtarın"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Tətbiqlər yüklənir…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"<xliff:g id="QUERY">%1$s</xliff:g> sorğusuna uyğun tətbiq tapılmadı"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Daha çox tətbiq üçün axtarış edin"</string>
<string name="label_application" msgid="8531721983832654978">"Tətbiq"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Bütün tətbiqlər"</string>
<string name="notifications_header" msgid="1404149926117359025">"Bildirişlər"</string>
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index ded4dc9..cc6e908 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Pretražite aplikacije"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Aplikacije se učitavaju…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nije pronađena nijedna aplikacija za „<xliff:g id="QUERY">%1$s</xliff:g>“"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Pretraži još aplikacija"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacija"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Sve aplikacije"</string>
<string name="notifications_header" msgid="1404149926117359025">"Obaveštenja"</string>
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
index 7fa8341..69a16ba 100644
--- a/res/values-be/strings.xml
+++ b/res/values-be/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Пошук праграм"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Праграмы загружаюцца…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Праграм, якія адпавядаюць запыту \"<xliff:g id="QUERY">%1$s</xliff:g>\", не знойдзена"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Шукаць іншыя праграмы"</string>
<string name="label_application" msgid="8531721983832654978">"Праграма"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Усе праграмы"</string>
<string name="notifications_header" msgid="1404149926117359025">"Апавяшчэнні"</string>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index 62b7796..549c8ea 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Търсене в приложенията"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Приложенията се зареждат…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Няма намерени приложения, съответстващи на „<xliff:g id="QUERY">%1$s</xliff:g>“"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Търсене на още приложения"</string>
<string name="label_application" msgid="8531721983832654978">"Приложение"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Всички приложения"</string>
<string name="notifications_header" msgid="1404149926117359025">"Известия"</string>
diff --git a/res/values-bn/strings.xml b/res/values-bn/strings.xml
index 1be272b..9683182 100644
--- a/res/values-bn/strings.xml
+++ b/res/values-bn/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"অ্যাপ খুঁজুন"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"অ্যাপ লোড হচ্ছে…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" এর সাথে মেলে এমন কোনো অ্যাপ পাওয়া যায়নি"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"আরও অ্যাপ্লিকেশানের জন্য খুঁজুন"</string>
<string name="label_application" msgid="8531721983832654978">"অ্যাপ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"সব অ্যাপ"</string>
<string name="notifications_header" msgid="1404149926117359025">"বিজ্ঞপ্তি"</string>
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
index 639b6b3..f99525f 100644
--- a/res/values-bs/strings.xml
+++ b/res/values-bs/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Pretražite aplikacije"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Aplikacije se učitavaju…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nije pronađena nijedna aplikacija za upit \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Pretraži više aplikacija"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacija"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Sve aplikacije"</string>
<string name="notifications_header" msgid="1404149926117359025">"Obavještenja"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index ee35fd3..d8ede15 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Cerca aplicacions"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"S\'estan carregant les aplicacions…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No s\'ha trobat cap aplicació que coincideixi amb \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Cerca més aplicacions"</string>
<string name="label_application" msgid="8531721983832654978">"Aplicació"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Totes les aplicacions"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificacions"</string>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 1b418c6..600d66f 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Hledat v aplikacích"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Načítání aplikací…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Dotazu „<xliff:g id="QUERY">%1$s</xliff:g>“ neodpovídají žádné aplikace"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Vyhledat další aplikace"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikace"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Všechny aplikace"</string>
<string name="notifications_header" msgid="1404149926117359025">"Oznámení"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Odinstalovat"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"O aplikaci"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Nainstalovat"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Aplikaci nenavrhovat"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Nenavrhovat aplikaci"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Připnout předpověď"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalace zástupce"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Umožňuje aplikaci přidat zástupce bez zásahu uživatele."</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 5cdadcd..4da7b84 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Søg efter apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Indlæser apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Der blev ikke fundet nogen apps, som matcher \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Søg efter flere apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifikationer"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index b75ef9d..3c2514f 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Apps finden"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Apps werden geladen…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Keine Apps für \"<xliff:g id="QUERY">%1$s</xliff:g>\" gefunden"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Weitere Apps suchen"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle Apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Benachrichtigungen"</string>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 99c9e23..ae9a8fd 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Αναζήτηση εφαρμογών"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Φόρτωση εφαρμογών…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Δεν βρέθηκαν εφαρμογές αντιστοίχισης για \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Αναζήτηση περισσότερων εφαρμογών"</string>
<string name="label_application" msgid="8531721983832654978">"Εφαρμογή"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Όλες οι εφαρμογές"</string>
<string name="notifications_header" msgid="1404149926117359025">"Ειδοποιήσεις"</string>
diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
index 97f0528..4f15eb5 100644
--- a/res/values-en-rAU/strings.xml
+++ b/res/values-en-rAU/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Search apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Loading apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No apps found matching \'<xliff:g id="QUERY">%1$s</xliff:g>\'"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Search for more apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"All apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index 97f0528..4f15eb5 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Search apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Loading apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No apps found matching \'<xliff:g id="QUERY">%1$s</xliff:g>\'"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Search for more apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"All apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 97f0528..4f15eb5 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Search apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Loading apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No apps found matching \'<xliff:g id="QUERY">%1$s</xliff:g>\'"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Search for more apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"All apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index 97f0528..4f15eb5 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Search apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Loading apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No apps found matching \'<xliff:g id="QUERY">%1$s</xliff:g>\'"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Search for more apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"All apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
index 4977beb..e644c23 100644
--- a/res/values-en-rXC/strings.xml
+++ b/res/values-en-rXC/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Search apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Loading apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No apps found matching \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Search for more apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"All apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 3ed312b..0bc8f4f 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Buscar apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Cargando apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No hay apps que coincidan con \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Buscar más apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Todas las apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificaciones"</string>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 567ff0d..4045ad3 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Buscar aplicaciones"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Cargando aplicaciones…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"No se han encontrado aplicaciones que contengan \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Buscar más aplicaciones"</string>
<string name="label_application" msgid="8531721983832654978">"Aplicación"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Todas las aplicaciones"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificaciones"</string>
diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml
index c34a003..effd140 100644
--- a/res/values-et/strings.xml
+++ b/res/values-et/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Otsige rakendusi"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Rakenduste laadimine …"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Päringule „<xliff:g id="QUERY">%1$s</xliff:g>” ei vastanud ükski rakendus"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Otsi rohkem rakendusi"</string>
<string name="label_application" msgid="8531721983832654978">"Rakendus"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Kõik rakendused"</string>
<string name="notifications_header" msgid="1404149926117359025">"Märguanded"</string>
diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml
index 55e0c3c..9e2d9a4 100644
--- a/res/values-eu/strings.xml
+++ b/res/values-eu/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Bilatu aplikazioetan"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Aplikazioak kargatzen…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Ez da aurkitu \"<xliff:g id="QUERY">%1$s</xliff:g>\" bilaketaren emaitzarik"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Bilatu aplikazio gehiago"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikazioa"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Aplikazio guztiak"</string>
<string name="notifications_header" msgid="1404149926117359025">"Jakinarazpenak"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 12db5bd..a1acda0 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"جستجوی برنامهها"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"درحال بارگیری برنامهها…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"هیچ برنامهای در مطابقت با «<xliff:g id="QUERY">%1$s</xliff:g>» پیدا نشد"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"جستجوی برنامههای بیشتر"</string>
<string name="label_application" msgid="8531721983832654978">"برنامه"</string>
<string name="all_apps_label" msgid="5015784846527570951">"همه برنامهها"</string>
<string name="notifications_header" msgid="1404149926117359025">"اعلانها"</string>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index 135c452..89e4106 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Hae sovelluksia"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Ladataan sovelluksia…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"<xliff:g id="QUERY">%1$s</xliff:g> ei palauttanut sovelluksia."</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Hae lisää sovelluksia"</string>
<string name="label_application" msgid="8531721983832654978">"Sovellus"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Kaikki sovellukset"</string>
<string name="notifications_header" msgid="1404149926117359025">"Ilmoitukset"</string>
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml
index 446a507..448569d 100644
--- a/res/values-fr-rCA/strings.xml
+++ b/res/values-fr-rCA/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Rechercher dans les applications"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Chargement des applications en cours…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Aucune application trouvée correspondant à « <xliff:g id="QUERY">%1$s</xliff:g> »"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Rechercher plus d\'applications"</string>
<string name="label_application" msgid="8531721983832654978">"Application"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Toutes les applications"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 1d623b1..b371067 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Rechercher dans les applications"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Chargement des applications…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Aucune application ne correspond à la requête \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Rechercher plus d\'applications"</string>
<string name="label_application" msgid="8531721983832654978">"Application"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Toutes les applis"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifications"</string>
@@ -158,8 +157,8 @@
<string name="action_dismiss_notification" msgid="5909461085055959187">"Ignorer"</string>
<string name="accessibility_close" msgid="2277148124685870734">"Fermer"</string>
<string name="notification_dismissed" msgid="6002233469409822874">"Notification ignorée"</string>
- <string name="all_apps_personal_tab" msgid="4190252696685155002">"Personnelles"</string>
- <string name="all_apps_work_tab" msgid="4884822796154055118">"Professionnelles"</string>
+ <string name="all_apps_personal_tab" msgid="4190252696685155002">"Personnel"</string>
+ <string name="all_apps_work_tab" msgid="4884822796154055118">"Professionnel"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"Profil professionnel"</string>
<string name="work_profile_edu_work_apps" msgid="7895468576497746520">"Les applis professionnelles sont identifiées par un badge et votre administrateur informatique peut les voir"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"OK"</string>
diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml
index 256c4d3..045d8d7 100644
--- a/res/values-gl/strings.xml
+++ b/res/values-gl/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Buscar aplicacións"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Cargando aplicacións…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Non se atoparon aplicacións que coincidan con \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Buscar máis aplicacións"</string>
<string name="label_application" msgid="8531721983832654978">"Aplicación"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Todas as aplicacións"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificacións"</string>
diff --git a/res/values-gu/strings.xml b/res/values-gu/strings.xml
index f1e1996..7288570 100644
--- a/res/values-gu/strings.xml
+++ b/res/values-gu/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"શોધ ઍપ્લિકેશનો"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ઍપ્લિકેશનો લોડ કરી રહ્યું છે…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\"થી મેળ ખાતી કોઈ ઍપ્લિકેશનો મળી નથી"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"વધુ ઍપ્લિકેશનો શોધો"</string>
<string name="label_application" msgid="8531721983832654978">"ઍપ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"બધી ઍપ"</string>
<string name="notifications_header" msgid="1404149926117359025">"નોટિફિકેશન"</string>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index 1b05040..e90e63a 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ऐप सर्च करें"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ऐप्लिकेशन लोड हो रहे हैं…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" से मिलता-जुलता कोई ऐप्लिकेशन नहीं मिला"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"और ऐप सर्च करें"</string>
<string name="label_application" msgid="8531721983832654978">"ऐप्लिकेशन"</string>
<string name="all_apps_label" msgid="5015784846527570951">"सभी ऐप्लिकेशन"</string>
<string name="notifications_header" msgid="1404149926117359025">"सूचनाएं"</string>
@@ -159,16 +158,16 @@
<string name="accessibility_close" msgid="2277148124685870734">"बंद करें"</string>
<string name="notification_dismissed" msgid="6002233469409822874">"सूचना को खारिज किया गया"</string>
<string name="all_apps_personal_tab" msgid="4190252696685155002">"निजी ऐप"</string>
- <string name="all_apps_work_tab" msgid="4884822796154055118">"काम से जुड़े ऐप"</string>
+ <string name="all_apps_work_tab" msgid="4884822796154055118">"वर्क ऐप्लिकेशन"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"वर्क प्रोफ़ाइल"</string>
- <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन बैज किए गए हैं और आईटी एडमिन को दिख रहे हैं"</string>
+ <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"वर्क ऐप्लिकेशन बैज किए गए हैं और आईटी एडमिन को दिख रहे हैं"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"ठीक है"</string>
- <string name="work_apps_paused_title" msgid="3040901117349444598">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन रोके गए"</string>
- <string name="work_apps_paused_body" msgid="261634750995824906">"ऑफ़िस के काम से जुड़े आपके ऐप्लिकेशन, आपको सूचनाएं नहीं भेज सकते. साथ ही, आपकी बैटरी का इस्तेमाल या आपकी जगह की जानकारी को ऐक्सेस भी नहीं कर सकते"</string>
+ <string name="work_apps_paused_title" msgid="3040901117349444598">"वर्क ऐप्लिकेशन रोके गए"</string>
+ <string name="work_apps_paused_body" msgid="261634750995824906">"आपके वर्क ऐप्लिकेशन, आपको सूचनाएं नहीं भेज सकते. साथ ही, आपकी बैटरी का इस्तेमाल या आपकी जगह की जानकारी को ऐक्सेस भी नहीं कर सकते"</string>
<string name="work_apps_paused_content_description" msgid="5149623040804051095">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन बंद हैं. ये ऐप्लिकेशन, आपको सूचनाएं नहीं भेज सकते. साथ ही, आपकी बैटरी का इस्तेमाल या आपकी जगह की जानकारी को ऐक्सेस भी नहीं कर सकते"</string>
<string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन बैज किए गए हैं और आईटी एडमिन को दिख रहे हैं"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"ठीक है"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन रोकें"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"वर्क ऐप्लिकेशन रोकें"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन चालू करें"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"फ़िल्टर"</string>
<string name="search_pref_screen_title" msgid="3258959643336315962">"अपने फ़ोन में खोजें"</string>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index 4a0fbe8..a1369e8 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Pretraži aplikacije"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Učitavanje aplikacija…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nema aplikacija podudarnih s upitom \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Traži više aplikacija"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacija"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Sve aplikacije"</string>
<string name="notifications_header" msgid="1404149926117359025">"Obavijesti"</string>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index c1e527d..a5d4835 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Alkalmazások keresése"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Alkalmazások betöltése…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nem található alkalmazás a(z) „<xliff:g id="QUERY">%1$s</xliff:g>” lekérdezésre"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"További alkalmazások keresése"</string>
<string name="label_application" msgid="8531721983832654978">"Alkalmazás"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Összes alkalmazás"</string>
<string name="notifications_header" msgid="1404149926117359025">"Értesítések"</string>
diff --git a/res/values-hy/strings.xml b/res/values-hy/strings.xml
index f0d01f1..b8f1643 100644
--- a/res/values-hy/strings.xml
+++ b/res/values-hy/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Որոնել հավելվածներ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Հավելվածների բեռնում…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"«<xliff:g id="QUERY">%1$s</xliff:g>» հարցմանը համապատասխանող հավելվածներ չեն գտնվել"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Որոնել այլ հավելվածներ"</string>
<string name="label_application" msgid="8531721983832654978">"Հավելված"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Բոլոր հավելվածները"</string>
<string name="notifications_header" msgid="1404149926117359025">"Ծանուցումներ"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Ապատեղադրել"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Հավելվածի մասին"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Տեղադրել"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Թաքցնել առաջարկը"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Չառաջարկել"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Ամրացնել առաջարկվող հավելվածը"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"Դյուրանցումների տեղադրում"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Հավելվածին թույլ է տալիս ավելացնել դյուրանցումներ՝ առանց օգտագործողի միջամտության:"</string>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 1a97a45..e46026e 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Telusuri aplikasi"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Memuat aplikasi…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Tidak ditemukan aplikasi yang cocok dengan \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Telusuri aplikasi lainnya"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikasi"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Semua aplikasi"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifikasi"</string>
diff --git a/res/values-is/strings.xml b/res/values-is/strings.xml
index a1959f8..92be25b 100644
--- a/res/values-is/strings.xml
+++ b/res/values-is/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Leita í forritum"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Hleður forrit…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Ekki fundust forrit sem samsvara „<xliff:g id="QUERY">%1$s</xliff:g>“"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Leita að fleiri forritum"</string>
<string name="label_application" msgid="8531721983832654978">"Forrit"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Öll forrit"</string>
<string name="notifications_header" msgid="1404149926117359025">"Tilkynningar"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 302efcb..b5b7add 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Cerca nelle app"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Caricamento delle app…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nessuna app trovata corrispondente a \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Cerca altre app"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Tutte le app"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notifiche"</string>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index 15e200f..6b4d129 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"חיפוש אפליקציות"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"טעינת אפליקציות מתבצעת…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"לא נמצאו אפליקציות התואמות ל-\"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"חיפוש אפליקציות נוספות"</string>
<string name="label_application" msgid="8531721983832654978">"אפליקציה"</string>
<string name="all_apps_label" msgid="5015784846527570951">"כל האפליקציות"</string>
<string name="notifications_header" msgid="1404149926117359025">"התראות"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 2fd3ab5..1a442a8 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"アプリを検索"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"アプリを読み込んでいます…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"「<xliff:g id="QUERY">%1$s</xliff:g>」に一致するアプリは見つかりませんでした"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"他のアプリを検索"</string>
<string name="label_application" msgid="8531721983832654978">"アプリ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"すべてのアプリ"</string>
<string name="notifications_header" msgid="1404149926117359025">"通知"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"アンインストール"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"アプリ情報"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"インストール"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"アプリの候補を表示しない"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"アプリを表示しない"</string>
<string name="pin_prediction" msgid="4196423321649756498">"アプリの候補を固定"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ショートカットのインストール"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ユーザー操作なしでショートカットを追加することをアプリに許可します。"</string>
@@ -171,7 +170,7 @@
<string name="work_apps_pause_btn_text" msgid="4669288269140620646">"仕事用アプリを一時停止"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"仕事用アプリを ON にする"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"フィルタ"</string>
- <string name="search_pref_screen_title" msgid="3258959643336315962">"スマートフォンの検索"</string>
+ <string name="search_pref_screen_title" msgid="3258959643336315962">"スマートフォンを検索"</string>
<string name="search_pref_screen_title_tablet" msgid="5220319680451343959">"タブレットを探す"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"失敗: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
</resources>
diff --git a/res/values-ka/strings.xml b/res/values-ka/strings.xml
index 24f95dd..8437dd8 100644
--- a/res/values-ka/strings.xml
+++ b/res/values-ka/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"აპების ძიება"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"აპები იტვირთება…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"„<xliff:g id="QUERY">%1$s</xliff:g>“-ის თანხვედრი აპები არ მოიძებნა"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"მეტი აპის პოვნა"</string>
<string name="label_application" msgid="8531721983832654978">"აპი"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ყველა აპი"</string>
<string name="notifications_header" msgid="1404149926117359025">"შეტყობინებები"</string>
diff --git a/res/values-kk/strings.xml b/res/values-kk/strings.xml
index 8ed7ec5..ec3ee18 100644
--- a/res/values-kk/strings.xml
+++ b/res/values-kk/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Қолданбаларды іздеу"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Қолданбалар жүктелуде…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" сұрауына сәйкес келетін қолданбалар жоқ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Қосымша қолданбалар іздеу"</string>
<string name="label_application" msgid="8531721983832654978">"Қолданба"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Барлық қолданба"</string>
<string name="notifications_header" msgid="1404149926117359025">"Хабарландырулар"</string>
diff --git a/res/values-km/strings.xml b/res/values-km/strings.xml
index 306449c..f1c1d08 100644
--- a/res/values-km/strings.xml
+++ b/res/values-km/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ស្វែងរកកម្មវិធី"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"កំពុងផ្ទុកកម្មវិធី…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"រកមិនឃើញកម្មវិធីដែលត្រូវគ្នាជាមួយ \"<xliff:g id="QUERY">%1$s</xliff:g>\" ទេ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ស្វែងរកកម្មវិធីច្រើនទៀត"</string>
<string name="label_application" msgid="8531721983832654978">"កម្មវិធី"</string>
<string name="all_apps_label" msgid="5015784846527570951">"កម្មវិធីទាំងអស់"</string>
<string name="notifications_header" msgid="1404149926117359025">"ការជូនដំណឹង"</string>
diff --git a/res/values-kn/strings.xml b/res/values-kn/strings.xml
index a9b89b5..72eaeac 100644
--- a/res/values-kn/strings.xml
+++ b/res/values-kn/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ಅಪ್ಲಿಕೇಶನ್ಗಳನ್ನು ಹುಡುಕಿ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ಅಪ್ಲಿಕೇಶನ್ಗಳನ್ನು ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" ಹೊಂದಿಕೆಯ ಯಾವುದೇ ಅಪ್ಲಿಕೇಶನ್ಗಳು ಕಂಡುಬಂದಿಲ್ಲ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ಮತ್ತಷ್ಟು ಅಪ್ಲಿಕೇಶನ್ಗಳನ್ನು ಹುಡುಕಿ"</string>
<string name="label_application" msgid="8531721983832654978">"ಆ್ಯಪ್"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ಎಲ್ಲಾ ಆ್ಯಪ್ಗಳು"</string>
<string name="notifications_header" msgid="1404149926117359025">"ಅಧಿಸೂಚನೆಗಳು"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 0935aa1..f6b8ff7 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"앱 검색"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"앱 로드 중…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\'<xliff:g id="QUERY">%1$s</xliff:g>\'과(와) 일치하는 앱이 없습니다."</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"더 많은 앱 검색"</string>
<string name="label_application" msgid="8531721983832654978">"앱"</string>
<string name="all_apps_label" msgid="5015784846527570951">"모든 앱"</string>
<string name="notifications_header" msgid="1404149926117359025">"알림"</string>
diff --git a/res/values-ky/strings.xml b/res/values-ky/strings.xml
index 755e274..709160d 100644
--- a/res/values-ky/strings.xml
+++ b/res/values-ky/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Колдонмолорду издөө"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Колдонмолор жүктөлүүдө…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" сурамына дал келген колдонмолор табылган жок"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Көбүрөөк колдонмолорду издөө"</string>
<string name="label_application" msgid="8531721983832654978">"Колдонмо"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Бардык колдонмолор"</string>
<string name="notifications_header" msgid="1404149926117359025">"Билдирмелер"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Чыгарып салуу"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Колдонмо тууралуу"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Орнотуу"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"Колдонмо сунушталбасын"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"Cунушталбасын"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Божомолдонгон колдонмону кадап коюу"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"тез чакырмаларды орнотуу"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Колдонмого колдонуучуга кайрылбастан тез чакырма кошууга уруксат берет."</string>
diff --git a/res/values-lo/strings.xml b/res/values-lo/strings.xml
index 9e75492..d8b55f8 100644
--- a/res/values-lo/strings.xml
+++ b/res/values-lo/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ຊອກຫາແອັບ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ກໍາລັງໂຫຼດແອັບ…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"ບໍ່ພົບແອັບທີ່ກົງກັບ \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ຊອກຫາແອັບເພີ່ມເຕີມ"</string>
<string name="label_application" msgid="8531721983832654978">"ແອັບ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ແອັບທັງໝົດ"</string>
<string name="notifications_header" msgid="1404149926117359025">"ການແຈ້ງເຕືອນ"</string>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index bbe0cfa..e68362d 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Paieškos programos"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Įkeliamos programos…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nerasta jokių užklausą „<xliff:g id="QUERY">%1$s</xliff:g>“ atitinkančių programų"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Ieškoti daugiau programų"</string>
<string name="label_application" msgid="8531721983832654978">"Programa"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Visos programos"</string>
<string name="notifications_header" msgid="1404149926117359025">"Pranešimai"</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index b5836ef..75f6d1a 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Meklēt lietotnes"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Notiek lietotņu ielāde…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Vaicājumam “<xliff:g id="QUERY">%1$s</xliff:g>” neatbilda neviena lietotne"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Meklēt citas lietotnes"</string>
<string name="label_application" msgid="8531721983832654978">"Lietotne"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Visas lietotnes"</string>
<string name="notifications_header" msgid="1404149926117359025">"Paziņojumi"</string>
diff --git a/res/values-mk/strings.xml b/res/values-mk/strings.xml
index d452eba..fef9bbe 100644
--- a/res/values-mk/strings.xml
+++ b/res/values-mk/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Пребарувајте апликации"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Се вчитуваат апликации…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Не се најдени апликации што одговараат на „<xliff:g id="QUERY">%1$s</xliff:g>“"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Пребарај други апликации"</string>
<string name="label_application" msgid="8531721983832654978">"Апликација"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Сите апликации"</string>
<string name="notifications_header" msgid="1404149926117359025">"Известувања"</string>
diff --git a/res/values-ml/strings.xml b/res/values-ml/strings.xml
index df532c0..802ea81 100644
--- a/res/values-ml/strings.xml
+++ b/res/values-ml/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ആപ്പുകൾ തിരയുക"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ആപ്പുകൾ ലോഡുചെയ്യുന്നു..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" എന്നതുമായി പൊരുത്തപ്പെടുന്ന ആപ്പുകളൊന്നും കണ്ടെത്തിയില്ല"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"കൂടുതൽ ആപ്പുകൾക്ക് തിരയുക"</string>
<string name="label_application" msgid="8531721983832654978">"ആപ്പ്"</string>
<string name="all_apps_label" msgid="5015784846527570951">"എല്ലാ ആപ്പുകളും"</string>
<string name="notifications_header" msgid="1404149926117359025">"അറിയിപ്പുകൾ"</string>
diff --git a/res/values-mn/strings.xml b/res/values-mn/strings.xml
index c71aaff..f091cb8 100644
--- a/res/values-mn/strings.xml
+++ b/res/values-mn/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Апп хайх"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Аппыг ачаалж байна..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\"-д тохирох апп олдсонгүй"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Бусад апп-г хайх"</string>
<string name="label_application" msgid="8531721983832654978">"Апп"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Бүх апп"</string>
<string name="notifications_header" msgid="1404149926117359025">"Мэдэгдэл"</string>
diff --git a/res/values-mr/strings.xml b/res/values-mr/strings.xml
index e871073..48f7355 100644
--- a/res/values-mr/strings.xml
+++ b/res/values-mr/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"अॅप्स शोधा"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"अॅप्स लोड करत आहे…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" शी जुळणारे कोणतेही अॅप्स आढळले नाहीत"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"अधिक अॅप्स शोधा"</string>
<string name="label_application" msgid="8531721983832654978">"ॲप"</string>
<string name="all_apps_label" msgid="5015784846527570951">"सर्व अॅप्स"</string>
<string name="notifications_header" msgid="1404149926117359025">"सूचना"</string>
@@ -161,14 +160,14 @@
<string name="all_apps_personal_tab" msgid="4190252696685155002">"वैयक्तिक"</string>
<string name="all_apps_work_tab" msgid="4884822796154055118">"कार्य"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"कार्य प्रोफाइल"</string>
- <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"कामाशी संबंधित ॲप्स ही बॅज केलेली असून तुमच्या आयटी ॲडमिनला दृश्यमान आहेत"</string>
+ <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"कार्य ॲप्स ही बॅज केलेली असून तुमच्या आयटी ॲडमिनला दृश्यमान आहेत"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"समजले"</string>
<string name="work_apps_paused_title" msgid="3040901117349444598">"कार्य ॲप्स थांबवली आहेत"</string>
<string name="work_apps_paused_body" msgid="261634750995824906">"तुमची कार्य ॲप्स तुम्हाला सूचना पाठवू शकत नाहीत, तुमची बॅटरी वापरू शकत नाहीत किंवा तुमचे स्थान अॅक्सेस करू शकत नाहीत"</string>
<string name="work_apps_paused_content_description" msgid="5149623040804051095">"कामाशी संबंधित ॲप्स बंद आहेत. तुमचे कामाशी संबंधित ॲप्स तुम्हाला सूचना पाठवू शकत नाहीत, तुमची बॅटरी वापरू शकत नाहीत किंवा तुमचे स्थान अॅक्सेस करू शकत नाहीत"</string>
- <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"Work apps ही बॅज केलेली असून तुमच्या IT ॲडमिनला दृश्यमान आहेत"</string>
+ <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"कार्य ॲप्स ही बॅज केलेली असून तुमच्या आयटी ॲडमिनला दृश्यमान आहेत"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"समजले"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Work apps थांबवा"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"कार्य ॲप्स थांबवा"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"कार्य ॲप्स सुरू करा"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"फिल्टर"</string>
<string name="search_pref_screen_title" msgid="3258959643336315962">"तुमच्या फोनमध्ये शोधा"</string>
diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml
index cbfb551..edd0530 100644
--- a/res/values-ms/strings.xml
+++ b/res/values-ms/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Cari apl"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Memuatkan apl…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Tiada apl yang ditemui sepadan dengan \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Cari lagi apl"</string>
<string name="label_application" msgid="8531721983832654978">"Apl"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Semua apl"</string>
<string name="notifications_header" msgid="1404149926117359025">"Pemberitahuan"</string>
diff --git a/res/values-my/strings.xml b/res/values-my/strings.xml
index 984ec4c..3cec97d 100644
--- a/res/values-my/strings.xml
+++ b/res/values-my/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ရှာဖွေမှု အက်ပ်များ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"အက်ပ်များကို ဖွင့်နေသည်…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" နှင့်ကိုက်ညီသည့် အပ်ပ်များကို မတွေ့ပါ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"နောက်ထပ် အက်ပ်များကို ရှာပါ"</string>
<string name="label_application" msgid="8531721983832654978">"အက်ပ်"</string>
<string name="all_apps_label" msgid="5015784846527570951">"အက်ပ်အားလုံး"</string>
<string name="notifications_header" msgid="1404149926117359025">"အကြောင်းကြားချက်များ"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"ဖယ်ရှားရန်"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"အက်ပ်အချက်အလက်"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ထည့်သွင်းရန်"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"အက်ပ်ကို အကြံမပြုပါနှင့်"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"အက်ပ်အကြံမပြုပါနှင့်"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ခန့်မှန်းချက်ကို ပင်ထိုးရန်"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ဖြတ်လမ်းလင့်ခ်များ ထည့်သွင်းခြင်း"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"အသုံးပြုသူ လုပ်ဆောင်မှုမရှိပဲ အပ်ပလီကေးရှင်းကို အတိုကောက်မှတ်သားမှုများ ပြုလုပ်ခွင့် ပေးခြင်း"</string>
@@ -115,7 +114,7 @@
<string name="title_change_settings" msgid="1376365968844349552">"ဆက်တင်များ ပြောင်းရန်"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"အကြောင်းကြားချက် အစက်များ ပြရန်"</string>
<string name="developer_options_title" msgid="700788437593726194">"တီထွင်သူ ရွေးစရာများ"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"ပင်မစာမျက်နှာတွင် အက်ပ်သင်္ကေတထည့်ရန်"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"ပင်မစာမျက်နှာတွင် အက်ပ်သင်္ကေတထည့်ခြင်း"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"အက်ပ်အသစ်များအတွက်"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"မသိ"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"ဖယ်ရှားရန်"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index b29ee77..3e08d10 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Søk etter apper"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Laster inn appene …"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Fant ingen apper som samsvarer med «<xliff:g id="QUERY">%1$s</xliff:g>»"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Søk etter flere apper"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle apper"</string>
<string name="notifications_header" msgid="1404149926117359025">"Varsler"</string>
diff --git a/res/values-ne/strings.xml b/res/values-ne/strings.xml
index fcc1ece..6d48969 100644
--- a/res/values-ne/strings.xml
+++ b/res/values-ne/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"खोजसम्बन्धी एपहरू"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"एपहरू लोड गर्दै…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" सँग मिल्दो कुनै एप भेटिएन"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"थप एपहरू खोज्नुहोस्"</string>
<string name="label_application" msgid="8531721983832654978">"एप"</string>
<string name="all_apps_label" msgid="5015784846527570951">"सबै एप"</string>
<string name="notifications_header" msgid="1404149926117359025">"सूचनाहरू"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"अनइन्स्टल गर्नुहोस्"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"एपसम्बन्धी जानकारी"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"स्थापना गर्नुहोस्"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"यो एप सिफारिस नगरियोस्"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"एप सिफारिस नगरियोस्"</string>
<string name="pin_prediction" msgid="4196423321649756498">"सिफारिस गरिएको एप पिन गर्नुहोस्"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"सर्टकट स्थापना गर्नेहोस्"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"प्रयोगकर्ताको हस्तक्षेप बिना एउटा एपलाई सर्टकटमा थप्नको लागि अनुमति दिनुहोस्।"</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index bd41952..4b203b7 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Apps zoeken"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Apps laden…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Er zijn geen apps gevonden die overeenkomen met \'<xliff:g id="QUERY">%1$s</xliff:g>\'"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Zoeken naar meer apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alle apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Meldingen"</string>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index 95fa000..c64e9b2 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -26,7 +26,7 @@
<string name="safemode_shortcut_error" msgid="9160126848219158407">"ନିରାପଦ ମୋଡରେ ଡାଉନଲୋଡ୍ ହେଇଥିବା ଆପ୍ ଅକ୍ଷମ କରାଗଲା"</string>
<string name="safemode_widget_error" msgid="4863470563535682004">"ନିରାପଦ ମୋଡରେ ୱିଜେଟ୍ ଅକ୍ଷମ କରାଗଲା"</string>
<string name="shortcut_not_available" msgid="2536503539825726397">"ଶର୍ଟକଟ୍ ଉପଲବ୍ଧ ନାହିଁ"</string>
- <string name="home_screen" msgid="5629429142036709174">"ମୂଳପୃଷ୍ଠା"</string>
+ <string name="home_screen" msgid="5629429142036709174">"ହୋମ"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"ସ୍କ୍ରିନକୁ ସ୍ପ୍ଲିଟ୍ କରନ୍ତୁ"</string>
<string name="split_screen_position_top" msgid="1504965011158689649">"ଶୀର୍ଷକୁ ସ୍ପ୍ଲିଟ କରନ୍ତୁ"</string>
<string name="split_screen_position_left" msgid="7537793098851830883">"ବାମପତକୁ ସ୍ପ୍ଲିଟ କରନ୍ତୁ"</string>
@@ -37,9 +37,9 @@
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d ଓସାର ଓ %2$d ଉଚ୍ଚ"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g> ୱିଜେଟ୍"</string>
- <string name="add_item_request_drag_hint" msgid="8730547755622776606">"ମୂଳସ୍କ୍ରିନର ଆଖପାଖରେ ୱିଜେଟକୁ ମୁଭ କରିବା ପାଇଁ ଏହାକୁ ସ୍ପର୍ଶ କରି ଧରି ରଖନ୍ତୁ"</string>
- <string name="add_to_home_screen" msgid="9168649446635919791">"ମୂଳସ୍କ୍ରିନରେ ଯୋଗ କରନ୍ତୁ"</string>
- <string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>ର ୱିଜେଟ୍ ମୂଳସ୍କ୍ରିନରେ ଯୋଡ଼ାଗଲା"</string>
+ <string name="add_item_request_drag_hint" msgid="8730547755622776606">"ହୋମ ସ୍କ୍ରିନର ଆଖପାଖରେ ୱିଜେଟକୁ ମୁଭ କରିବା ପାଇଁ ଏହାକୁ ସ୍ପର୍ଶ କରି ଧରି ରଖନ୍ତୁ"</string>
+ <string name="add_to_home_screen" msgid="9168649446635919791">"ହୋମ ସ୍କ୍ରିନରେ ଯୋଗ କରନ୍ତୁ"</string>
+ <string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"<xliff:g id="WIDGET_NAME">%1$s</xliff:g>ର ୱିଜେଟ ହୋମ ସ୍କ୍ରିନରେ ଯୋଡ଼ାଗଲା"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{#ଟି ୱିଜେଟ୍}other{#ଟି ୱିଜେଟ୍}}"</string>
<string name="shortcuts_count" msgid="8471715556199592381">"{count,plural, =1{#ଟି ସର୍ଟକଟ୍}other{#ଟି ସର୍ଟକଟ୍}}"</string>
<string name="widgets_and_shortcuts_count" msgid="7209136747878365116">"<xliff:g id="WIDGETS_COUNT">%1$s</xliff:g>, <xliff:g id="SHORTCUTS_COUNT">%2$s</xliff:g>"</string>
@@ -52,37 +52,36 @@
<string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"ୱାର୍କ"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"ବାର୍ତ୍ତାଳାପଗୁଡ଼ିକ"</string>
<string name="widget_education_header" msgid="4874760613775913787">"ଉପଯୋଗୀ ସୂଚନା ଆପଣଙ୍କ ପାଖରେ ସହଜରେ ଉପଲବ୍ଧ"</string>
- <string name="widget_education_content" msgid="1731667670753497052">"ଆପ୍ସକୁ ନଖୋଲି ସୂଚନା ପାଇବା ପାଇଁ, ଆପଣ ଆପଣଙ୍କ ମୂଳସ୍କ୍ରିନରେ ୱିଜେଟଗୁଡ଼ିକୁ ଯୋଗ କରିପାରିବେ"</string>
+ <string name="widget_education_content" msgid="1731667670753497052">"ଆପ୍ସକୁ ନଖୋଲି ସୂଚନା ପାଇବା ପାଇଁ, ଆପଣ ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନରେ ୱିଜେଟଗୁଡ଼ିକୁ ଯୋଗ କରିପାରିବେ"</string>
<string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"ୱିଜେଟ ସେଟିଂସ ପରିବର୍ତ୍ତନ କରିବାକୁ ଟାପ କରନ୍ତୁ"</string>
<string name="widget_education_close_button" msgid="8676165703104836580">"ବୁଝିଗଲି"</string>
<string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"ୱିଜେଟ ସେଟିଂସ ପରିବର୍ତ୍ତନ କରନ୍ତୁ"</string>
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ଆପ୍ ଖୋଜନ୍ତୁ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ଆପ୍ ଲୋଡ୍ ହେଉଛି..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" ସହିତ ମେଳ ହେଉଥିବା କୌଣସି ଆପ୍ ମିଳିଲା ନାହିଁ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ଅଧିକ ଆପ୍ ଖୋଜନ୍ତୁ"</string>
<string name="label_application" msgid="8531721983832654978">"ଆପ୍"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ସବୁ ଆପ"</string>
<string name="notifications_header" msgid="1404149926117359025">"ବିଜ୍ଞପ୍ତି"</string>
<string name="long_press_shortcut_to_add" msgid="5405328730817637737">"ଏକ ସର୍ଟକଟକୁ ମୁଭ୍ କରିବା ପାଇଁ ସ୍ପର୍ଶ କରି ଧରି ରଖନ୍ତୁ।"</string>
<string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"ଏକ ସର୍ଟକଟକୁ ମୁଭ୍ କରିବା ପାଇଁ ଦୁଇଥର-ଟାପ୍ କରି ଧରି ରଖନ୍ତୁ କିମ୍ବା କଷ୍ଟମ୍ କାର୍ଯ୍ୟଗୁଡ଼ିକୁ ବ୍ୟବହାର କରନ୍ତୁ।"</string>
- <string name="out_of_space" msgid="6455557115204099579">"ଏହି ମୂଳସ୍କ୍ରିନରେ ଆଉ ଜାଗା ନାହିଁ"</string>
+ <string name="out_of_space" msgid="6455557115204099579">"ଏହି ହୋମ ସ୍କ୍ରିନରେ ଆଉ ଜାଗା ନାହିଁ"</string>
<string name="hotseat_out_of_space" msgid="7448809638125333693">"ମନପସନ୍ଦ ଟ୍ରେରେ ଆଉ କୋଠରୀ ନାହିଁ"</string>
<string name="all_apps_button_label" msgid="8130441508702294465">"ଆପ୍ ତାଲିକା"</string>
<string name="all_apps_search_results" msgid="5889367432531296759">"ସନ୍ଧାନ ଫଳାଫଳ"</string>
<string name="all_apps_button_personal_label" msgid="1315764287305224468">"ବ୍ୟକ୍ତିଗତ ଆପ୍ ତାଲିକା"</string>
<string name="all_apps_button_work_label" msgid="7270707118948892488">"କାର୍ଯ୍ୟକାରୀ ଆପ୍ ତାଲିକା"</string>
<string name="remove_drop_target_label" msgid="7812859488053230776">"ବାହାର କରନ୍ତୁ"</string>
- <string name="uninstall_drop_target_label" msgid="4722034217958379417">"ଅନଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
+ <string name="uninstall_drop_target_label" msgid="4722034217958379417">"ଅନଇନଷ୍ଟଲ କରନ୍ତୁ"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"ଆପ୍ ସୂଚନା"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"ଆପ୍ ପରାମର୍ଶ ଦିଅନ୍ତୁ ନାହିଁ"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"ଆପ ପରାମର୍ଶ ଦିଅନ୍ତୁ ନାହିଁ"</string>
<string name="pin_prediction" msgid="4196423321649756498">"ପୂର୍ବାନୁମାନକୁ ପିନ୍ କରନ୍ତୁ"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"ସର୍ଟକଟ୍ ଇନଷ୍ଟଲ୍ କରନ୍ତୁ"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"ୟୁଜରଙ୍କ ବିନା ହସ୍ତକ୍ଷେପରେ ଶର୍ଟକଟ୍ ଯୋଡ଼ିବାକୁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
- <string name="permlab_read_settings" msgid="5136500343007704955">"ମୂଳପୃଷ୍ଠା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପଢ଼ନ୍ତୁ"</string>
- <string name="permdesc_read_settings" msgid="4208061150510996676">"ମୂଳପୃଷ୍ଠାରେ ଥିବା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପଢ଼ିବା ପାଇଁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
- <string name="permlab_write_settings" msgid="4820028712156303762">"ମୂଳପୃଷ୍ଠା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ଲେଖନ୍ତୁ"</string>
- <string name="permdesc_write_settings" msgid="726859348127868466">"ମୂଳପୃଷ୍ଠାରେ ଥିବା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରିବା ପାଇଁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
+ <string name="permlab_read_settings" msgid="5136500343007704955">"ହୋମ ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପଢ଼ନ୍ତୁ"</string>
+ <string name="permdesc_read_settings" msgid="4208061150510996676">"ହୋମରେ ଥିବା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପଢ଼ିବା ପାଇଁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
+ <string name="permlab_write_settings" msgid="4820028712156303762">"ହୋମ ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ଲେଖନ୍ତୁ"</string>
+ <string name="permdesc_write_settings" msgid="726859348127868466">"ହୋମରେ ଥିବା ସେଟିଂସ ଏବଂ ସର୍ଟକଟଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରିବା ପାଇଁ ଆପକୁ ଅନୁମତି ଦିଏ।"</string>
<string name="msg_no_phone_permission" msgid="9208659281529857371">"ଫୋନ୍ କଲ୍ କରିବାକୁ <xliff:g id="APP_NAME">%1$s</xliff:g>କୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ"</string>
<string name="gadget_error_text" msgid="740356548025791839">"ୱିଜେଟ୍ ଲୋଡ୍ କରାଯାଇପାରିବ ନାହିଁ"</string>
<string name="gadget_setup_text" msgid="8348374825537681407">"ୱିଜେଟ ସେଟିଂସ"</string>
@@ -92,8 +91,8 @@
<string name="disabled_app_label" msgid="6673129024321402780">"<xliff:g id="APP_NAME">%1$s</xliff:g> ଅକ୍ଷମ କରାଗଲା"</string>
<string name="dotted_app_label" msgid="1865617679843363410">"{count,plural, =1{{app_name}ର #ଟି ବିଜ୍ଞପ୍ତି ଅଛି}other{{app_name}ର #ଟି ବିଜ୍ଞପ୍ତି ଅଛି}}"</string>
<string name="default_scroll_format" msgid="7475544710230993317">"ମୋଟ %2$dରୁ %1$d ନମ୍ବର ପୃଷ୍ଠା"</string>
- <string name="workspace_scroll_format" msgid="8458889198184077399">"%2$dରୁ %1$d ହୋମ୍ ସ୍କ୍ରୀନ୍"</string>
- <string name="workspace_new_page" msgid="257366611030256142">"ନୂଆ ହୋମ୍ ସ୍କ୍ରୀନ୍ ପୃଷ୍ଠା"</string>
+ <string name="workspace_scroll_format" msgid="8458889198184077399">"%2$dରୁ %1$d ହୋମ ସ୍କ୍ରିନ"</string>
+ <string name="workspace_new_page" msgid="257366611030256142">"ନୂଆ ହୋମ ସ୍କ୍ରିନ ପେଜ"</string>
<string name="folder_opened" msgid="94695026776264709">"<xliff:g id="HEIGHT">%2$d</xliff:g> / <xliff:g id="WIDTH">%1$d</xliff:g>ର ଫୋଲ୍ଡର ଖୋଲାଗଲା"</string>
<string name="folder_tap_to_close" msgid="4625795376335528256">"ଫୋଲ୍ଡର୍ ବନ୍ଦ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ"</string>
<string name="folder_tap_to_rename" msgid="4017685068016979677">"ନାମ ବଦଳାଇବା ସେଭ୍ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ"</string>
@@ -105,7 +104,7 @@
<string name="styles_wallpaper_button_text" msgid="8216961355289236794">"ୱାଲପେପର ଏବଂ ଷ୍ଟାଇଲ"</string>
<string name="settings_button_text" msgid="8873672322605444408">"ହୋମ ସେଟିଂସ"</string>
<string name="msg_disabled_by_admin" msgid="6898038085516271325">"ଆପଣଙ୍କ ଆଡମିନଙ୍କ ଦ୍ୱାରା ଅକ୍ଷମ କରାଯାଇଛି"</string>
- <string name="allow_rotation_title" msgid="7222049633713050106">"ମୂଳସ୍କ୍ରିନ ରୋଟେସନକୁ ଅନୁମତି ଦିଅନ୍ତୁ"</string>
+ <string name="allow_rotation_title" msgid="7222049633713050106">"ହୋମ ସ୍କ୍ରିନ ରୋଟେସନକୁ ଅନୁମତି ଦିଅନ୍ତୁ"</string>
<string name="allow_rotation_desc" msgid="8662546029078692509">"ଯେତେବେଳେ ଫୋନକୁ ବୁଲାଯାଇଥାଏ"</string>
<string name="notification_dots_title" msgid="9062440428204120317">"ବିଜ୍ଞପ୍ତି ଡଟ୍ସ"</string>
<string name="notification_dots_desc_on" msgid="1679848116452218908">"ଚାଲୁ"</string>
@@ -115,7 +114,7 @@
<string name="title_change_settings" msgid="1376365968844349552">"ସେଟିଂସ ପରିବର୍ତ୍ତନ କରନ୍ତୁ"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"ବିଜ୍ଞପ୍ତି ଡଟ୍ଗୁଡ଼ିକୁ ଦେଖାନ୍ତୁ"</string>
<string name="developer_options_title" msgid="700788437593726194">"ଡେଭେଲପର ବିକଳ୍ପଗୁଡ଼ିକ"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"ମୂଳସ୍କ୍ରିନରେ ଆପ ଆଇକନଗୁଡ଼ିକୁ ଯୋଗ କରନ୍ତୁ"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"ହୋମ ସ୍କ୍ରିନରେ ଆପ ଆଇକନଗୁଡ଼ିକୁ ଯୋଗ କରନ୍ତୁ"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"ନୂଆ ଆପ୍ ପାଇଁ"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"ଅଜଣା"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"କାଢ଼ି ଦିଅନ୍ତୁ"</string>
@@ -131,9 +130,9 @@
<string name="dialog_remove" msgid="6510806469849709407">"କାଢ଼ି ଦିଅନ୍ତୁ"</string>
<string name="widgets_list" msgid="796804551140113767">"ୱିଜେଟ୍ ତାଲିକା"</string>
<string name="widgets_list_closed" msgid="6141506579418771922">"ୱିଜେଟ୍ ତାଲିକା ବନ୍ଦ ହୋଇଛି"</string>
- <string name="action_add_to_workspace" msgid="215894119683164916">"ମୂଳସ୍କ୍ରିନରେ ଯୋଗ କରନ୍ତୁ"</string>
+ <string name="action_add_to_workspace" msgid="215894119683164916">"ହୋମ ସ୍କ୍ରିନରେ ଯୋଗ କରନ୍ତୁ"</string>
<string name="action_move_here" msgid="2170188780612570250">"ଆଇଟମ୍କୁ ଏଠାକୁ ଘୁଞ୍ଚାନ୍ତୁ"</string>
- <string name="item_added_to_workspace" msgid="4211073925752213539">"ହୋମ୍ ସ୍କ୍ରୀନରେ ଆଇଟମ୍ ଯୋଡ଼ାଗଲା"</string>
+ <string name="item_added_to_workspace" msgid="4211073925752213539">"ହୋମ ସ୍କ୍ରିନରେ ଆଇଟମ ଯୋଗ କରାଗଲା"</string>
<string name="item_removed" msgid="851119963877842327">"ଆଇଟମକୁ କାଢ଼ି ଦିଆଯାଇଛି"</string>
<string name="undo" msgid="4151576204245173321">"ପୂର୍ବବତ୍"</string>
<string name="action_move" msgid="4339390619886385032">"ଆଇଟମ୍ ଘୁଞ୍ଚାନ୍ତୁ"</string>
@@ -146,7 +145,7 @@
<string name="added_to_folder" msgid="4793259502305558003">"ଫୋଲ୍ଡରରେ ଆଇଟମ୍ ଯୋଡ଼ାଗଲା"</string>
<string name="create_folder_with" msgid="4050141361160214248">"ଏହି ନାମରେ ଫୋଲ୍ଡର ତିଆରି କରନ୍ତୁ: <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="folder_created" msgid="6409794597405184510">"ଫୋଲ୍ଡର ତିଆରି କରାଗଲା"</string>
- <string name="action_move_to_workspace" msgid="39528912300293768">"ମୂଳସ୍କ୍ରିନକୁ ମୁଭ କରନ୍ତୁ"</string>
+ <string name="action_move_to_workspace" msgid="39528912300293768">"ହୋମ ସ୍କ୍ରିନକୁ ମୁଭ କରନ୍ତୁ"</string>
<string name="action_resize" msgid="1802976324781771067">"ଆକାର ବଦଳାନ୍ତୁ"</string>
<string name="action_increase_width" msgid="8773715375078513326">"ଚଉଡ଼ା ବଢ଼ାନ୍ତୁ"</string>
<string name="action_increase_height" msgid="459390020612501122">"ଉଚ୍ଚତା ବଢ଼ାନ୍ତୁ"</string>
@@ -161,14 +160,14 @@
<string name="all_apps_personal_tab" msgid="4190252696685155002">"ବ୍ୟକ୍ତିଗତ"</string>
<string name="all_apps_work_tab" msgid="4884822796154055118">"ୱାର୍କ"</string>
<string name="work_profile_toggle_label" msgid="3081029915775481146">"ୱର୍କ ପ୍ରୋଫାଇଲ୍"</string>
- <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"ୱାର୍କ ଆପଗୁଡ଼ିକୁ ବ୍ୟାଜ୍ କରାଯାଇଛି ଏବଂ ସେଗୁଡ଼ିକ ଆପଣଙ୍କ IT ଆଡମିନଙ୍କୁ ଦୃଶ୍ୟମାନ ହେଉଛି"</string>
+ <string name="work_profile_edu_work_apps" msgid="7895468576497746520">"ୱାର୍କ ଆପ୍ସ ବ୍ୟାଜ୍ କରାଯାଇଛି ଏବଂ ସେଗୁଡ଼ିକ ଆପଣଙ୍କ IT ଆଡମିନଙ୍କୁ ଦୃଶ୍ୟମାନ ହେଉଛି"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"ବୁଝିଗଲି"</string>
<string name="work_apps_paused_title" msgid="3040901117349444598">"ୱାର୍କ ଆପ୍ସ ବିରତ କରାଯାଇଛି"</string>
- <string name="work_apps_paused_body" msgid="261634750995824906">"ଆପଣଙ୍କ ୱାର୍କ ଆପଗୁଡ଼ିକ ଆପଣଙ୍କୁ ବିଜ୍ଞପ୍ତି ପଠାଇପାରିବ ନାହିଁ, ଆପଣଙ୍କ ବ୍ୟାଟେରୀକୁ ବ୍ୟବହାର କରିପାରିବ ନାହିଁ କିମ୍ବା ଆପଣଙ୍କର ଲୋକେସନକୁ ଆକ୍ସେସ୍ କରିପାରିବ ନାହିଁ"</string>
+ <string name="work_apps_paused_body" msgid="261634750995824906">"ଆପଣଙ୍କ ୱାର୍କ ଆପ୍ସ ଆପଣଙ୍କୁ ବିଜ୍ଞପ୍ତି ପଠାଇପାରିବ ନାହିଁ, ଆପଣଙ୍କ ବ୍ୟାଟେରୀକୁ ବ୍ୟବହାର କରିପାରିବ ନାହିଁ କିମ୍ବା ଆପଣଙ୍କର ଲୋକେସନକୁ ଆକ୍ସେସ କରିପାରିବ ନାହିଁ"</string>
<string name="work_apps_paused_content_description" msgid="5149623040804051095">"ୱାର୍କ ଆପଗୁଡ଼ିକ ବନ୍ଦ ଅଛି। ଆପଣଙ୍କ ୱାର୍କ ଆପଗୁଡ଼ିକ ଆପଣଙ୍କୁ ବିଜ୍ଞପ୍ତି ପଠାଇପାରିବ ନାହିଁ, ଆପଣଙ୍କ ବ୍ୟାଟେରୀକୁ ବ୍ୟବହାର କରିପାରିବ ନାହିଁ କିମ୍ବା ଆପଣଙ୍କର ଲୋକେସନକୁ ଆକ୍ସେସ୍ କରିପାରିବ ନାହିଁ"</string>
- <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"ୱାର୍କ ଆପଗୁଡ଼ିକୁ ବ୍ୟାଜ୍ କରାଯାଇଛି ଏବଂ ଆପଣଙ୍କ IT ଆଡମିନଙ୍କୁ ଦେଖାଯାଉଛି"</string>
+ <string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"ୱାର୍କ ଆପ୍ସ ବ୍ୟାଜ୍ କରାଯାଇଛି ଏବଂ ଆପଣଙ୍କ IT ଆଡମିନଙ୍କୁ ଦେଖାଯାଉଛି"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"ବୁଝିଗଲି"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"ୱାର୍କ ଆପଗୁଡ଼ିକୁ ବିରତ କରନ୍ତୁ"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"ୱାର୍କ ଆପ୍ସ ବିରତ କରନ୍ତୁ"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"ୱାର୍କ ଆପଗୁଡ଼ିକୁ ଚାଲୁ କରନ୍ତୁ"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"ଫିଲ୍ଟର୍"</string>
<string name="search_pref_screen_title" msgid="3258959643336315962">"ଆପଣଙ୍କ ଫୋନରେ ସନ୍ଧାନ କରନ୍ତୁ"</string>
diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml
index 01fbee0..8e55b87 100644
--- a/res/values-pa/strings.xml
+++ b/res/values-pa/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ਐਪਾਂ ਖੋਜੋ"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ਐਪਾਂ ਨੂੰ ਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" ਨਾਲ ਮੇਲ ਖਾਂਦੀਆਂ ਕੋਈ ਐਪਾਂ ਨਹੀਂ ਮਿਲੀਆਂ"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ਹੋਰ ਐਪਾਂ ਖੋਜੋ"</string>
<string name="label_application" msgid="8531721983832654978">"ਐਪ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"ਸਾਰੀਆਂ ਐਪਾਂ"</string>
<string name="notifications_header" msgid="1404149926117359025">"ਸੂਚਨਾਵਾਂ"</string>
@@ -168,7 +167,7 @@
<string name="work_apps_paused_content_description" msgid="5149623040804051095">"ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ ਬੰਦ ਹਨ। ਤੁਹਾਡੀਆਂ ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ ਤੁਹਾਨੂੰ ਸੂਚਨਾਵਾਂ ਨਹੀਂ ਭੇਜ ਸਕਦੀਆਂ, ਤੁਹਾਡੀ ਬੈਟਰੀ ਨਹੀਂ ਵਰਤ ਸਕਦੀਆਂ ਜਾਂ ਤੁਹਾਡੇ ਟਿਕਾਣੇ ਤੱਕ ਪਹੁੰਚ ਨਹੀਂ ਕਰ ਸਕਦੀਆਂ"</string>
<string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ ਨੂੰ ਬੈਜ ਕੀਤਾ ਜਾਂਦਾ ਹੈ ਅਤੇ ਇਹ ਤੁਹਾਡੇ ਆਈ.ਟੀ. ਪ੍ਰਸ਼ਾਸਕ ਨੂੰ ਦਿਸਣਗੀਆਂ"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"ਸਮਝ ਲਿਆ"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"ਕੰਮ ਸੰਬੰਧੀ ਐਪ ਰੋਕੋ"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ ਰੋਕੋ"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ ਚਾਲੂ ਕਰੋ"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"ਫਿਲਟਰ"</string>
<string name="search_pref_screen_title" msgid="3258959643336315962">"ਆਪਣਾ ਫ਼ੋਨ ਖੋਜੋ"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 4b46f0b..8669949 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Wyszukaj aplikacje"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Ładuję aplikacje…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nie znaleziono aplikacji pasujących do zapytania „<xliff:g id="QUERY">%1$s</xliff:g>”"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Wyszukaj więcej aplikacji"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacja"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Wszystkie aplikacje"</string>
<string name="notifications_header" msgid="1404149926117359025">"Powiadomienia"</string>
@@ -107,13 +106,13 @@
<string name="msg_disabled_by_admin" msgid="6898038085516271325">"Funkcja wyłączona przez administratora"</string>
<string name="allow_rotation_title" msgid="7222049633713050106">"Zezwalaj na obrót ekranu głównego"</string>
<string name="allow_rotation_desc" msgid="8662546029078692509">"Po obróceniu telefonu"</string>
- <string name="notification_dots_title" msgid="9062440428204120317">"Plakietki z powiadomieniami"</string>
+ <string name="notification_dots_title" msgid="9062440428204120317">"Kropki powiadomień"</string>
<string name="notification_dots_desc_on" msgid="1679848116452218908">"Włączono"</string>
<string name="notification_dots_desc_off" msgid="1760796511504341095">"Wyłączono"</string>
<string name="title_missing_notification_access" msgid="7503287056163941064">"Wymagany jest dostęp do powiadomień"</string>
- <string name="msg_missing_notification_access" msgid="281113995110910548">"Aby pokazać plakietki z powiadomieniami, włącz powiadomienia aplikacji <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="msg_missing_notification_access" msgid="281113995110910548">"Aby pokazywać kropki powiadomień, włącz powiadomienia aplikacji <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="title_change_settings" msgid="1376365968844349552">"Zmień ustawienia"</string>
- <string name="notification_dots_service_title" msgid="4284221181793592871">"Pokaż plakietki z powiadomieniami"</string>
+ <string name="notification_dots_service_title" msgid="4284221181793592871">"Pokaż kropki powiadomień"</string>
<string name="developer_options_title" msgid="700788437593726194">"Opcje programisty"</string>
<string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Dodawaj ikony aplikacji do ekranu głównego"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"W przypadku nowych aplikacji"</string>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index dbfa0cb..bb1fb36 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Pesquisar aplicações"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"A carregar aplicações…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nenhuma app correspondente a \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Pesquisar mais aplicações"</string>
<string name="label_application" msgid="8531721983832654978">"Aplicação"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Todas as apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificações"</string>
@@ -168,7 +167,7 @@
<string name="work_apps_paused_content_description" msgid="5149623040804051095">"As apps de trabalho estão desativadas. As apps de trabalho não podem enviar-lhe notificações, utilizar a bateria ou aceder à sua localização"</string>
<string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"As apps de trabalho têm um emblema e estão visíveis para o seu administrador de TI"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"OK"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Colocar apps de trabalho em pausa"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Pausar apps de trabalho"</string>
<string name="work_apps_enable_btn_text" msgid="1156432622148413741">"Ativar apps de trabalho"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtrar"</string>
<string name="search_pref_screen_title" msgid="3258959643336315962">"Pesquise no telemóvel"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 3a5ed5b..98e8607 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Pesquisar apps"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Carregando apps…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nenhum app encontrado que corresponda a \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Pesquisar mais apps"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Todos os apps"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificações"</string>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 6061ea5..794609e 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Caută aplicații"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Se încarcă aplicații…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nu s-a găsit nicio aplicație pentru „<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Caută mai multe aplicații"</string>
<string name="label_application" msgid="8531721983832654978">"Aplicație"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Toate aplicațiile"</string>
<string name="notifications_header" msgid="1404149926117359025">"Notificări"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 0ad12bd..5987321 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Поиск приложений"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Загрузка приложений…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"По запросу \"<xliff:g id="QUERY">%1$s</xliff:g>\" ничего не найдено"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Искать другие приложения"</string>
<string name="label_application" msgid="8531721983832654978">"Приложение"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Все приложения"</string>
<string name="notifications_header" msgid="1404149926117359025">"Уведомления"</string>
diff --git a/res/values-si/strings.xml b/res/values-si/strings.xml
index cf3dc64..e030432 100644
--- a/res/values-si/strings.xml
+++ b/res/values-si/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"යෙදුම් සොයන්න"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"යෙදුම් පූරණය වෙමින්…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" සමග ගැළපෙන යෙදුම් හමු නොවිණි"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"තව යෙදුම් සඳහා සොයන්න"</string>
<string name="label_application" msgid="8531721983832654978">"යෙදුම"</string>
<string name="all_apps_label" msgid="5015784846527570951">"සියලු යෙදුම්"</string>
<string name="notifications_header" msgid="1404149926117359025">"දැනුම්දීම්"</string>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index e3bcc52..69fa362 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Hľadať aplikácie"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Načítavajú sa aplikácie…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nenašli sa žiadne aplikácie zodpovedajúce dopytu <xliff:g id="QUERY">%1$s</xliff:g>"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Hľadať ďalšie aplikácie"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikácia"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Všetky aplikácie"</string>
<string name="notifications_header" msgid="1404149926117359025">"Upozornenia"</string>
@@ -115,7 +114,7 @@
<string name="title_change_settings" msgid="1376365968844349552">"Zmeniť nastavenia"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"Zobrazovať bodky upozornení"</string>
<string name="developer_options_title" msgid="700788437593726194">"Pre vývojárov"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Pridať ikony aplikácií na plochu"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Pridávať ikony aplikácií na plochu"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Pri inštalácii novej aplikácie"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"Neznáme"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"Odstrániť"</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 5f952cf..b1f93e8 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Iskanje programov"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Nalaganje aplikacij …"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Ni aplikacij, ki bi ustrezale poizvedbi »<xliff:g id="QUERY">%1$s</xliff:g>«"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Iskanje več aplikacij"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacija"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Vse aplikacije"</string>
<string name="notifications_header" msgid="1404149926117359025">"Obvestila"</string>
diff --git a/res/values-sq/strings.xml b/res/values-sq/strings.xml
index 9f29a87..99bcbaa 100644
--- a/res/values-sq/strings.xml
+++ b/res/values-sq/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Kërko për aplikacione"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Po ngarkon aplikacionet..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Nuk u gjet asnjë aplikacion që përputhet me \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Kërko për më shumë aplikacione"</string>
<string name="label_application" msgid="8531721983832654978">"Aplikacioni"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Të gjitha aplikacionet"</string>
<string name="notifications_header" msgid="1404149926117359025">"Njoftimet"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 948d9b6..460a73e 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Претражите апликације"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Апликације се учитавају…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Није пронађена ниједна апликација за „<xliff:g id="QUERY">%1$s</xliff:g>“"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Претражи још апликација"</string>
<string name="label_application" msgid="8531721983832654978">"Апликација"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Све апликације"</string>
<string name="notifications_header" msgid="1404149926117359025">"Обавештења"</string>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index c35adb0..6ec274b 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Sök efter appar"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Läser in appar …"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Inga appar som matchar <xliff:g id="QUERY">%1$s</xliff:g> hittades"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Sök efter fler appar"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Alla appar"</string>
<string name="notifications_header" msgid="1404149926117359025">"Aviseringar"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index c233cc4..147c6e1 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Tafuta programu"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Inapakia programu..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Haikupata programu zozote zinazolingana na \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Tafuta programu zaidi"</string>
<string name="label_application" msgid="8531721983832654978">"Programu"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Programu zote"</string>
<string name="notifications_header" msgid="1404149926117359025">"Arifa"</string>
diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml
index 072b92d..e718d9c 100644
--- a/res/values-sw600dp/config.xml
+++ b/res/values-sw600dp/config.xml
@@ -18,4 +18,11 @@
<!-- The duration of the PagedView page snap animation -->
<integer name="config_pageSnapAnimationDuration">550</integer>
+ <!-- The duration of the Widget picker opening and closing animation -->
+ <integer name="config_bottomSheetOpenDuration">500</integer>
+ <integer name="config_bottomSheetCloseDuration">500</integer>
+
+ <!-- The duration of the AllApps opening and closing animation -->
+ <integer name="config_allAppsOpenDuration">@integer/config_bottomSheetOpenDuration</integer>
+ <integer name="config_allAppsCloseDuration">@integer/config_bottomSheetCloseDuration</integer>
</resources>
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index bfec460..d8eacf5 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ஆப்ஸில் தேடுக"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ஆப்ஸை ஏற்றுகிறது…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" உடன் பொருந்தும் ஆப்ஸ் இல்லை"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"கூடுதல் பயன்பாடுகளைத் தேடு"</string>
<string name="label_application" msgid="8531721983832654978">"ஆப்ஸ்"</string>
<string name="all_apps_label" msgid="5015784846527570951">"அனைத்து ஆப்ஸும்"</string>
<string name="notifications_header" msgid="1404149926117359025">"அறிவிப்புகள்"</string>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 1d25371..e70466f 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"యాప్ల కోసం సెర్చ్ చేయండి"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"అప్లికేషన్లను లోడ్ చేస్తోంది…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\"కి సరిపోలే అప్లికేషన్లేవీ కనుగొనబడలేదు"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"మరిన్ని యాప్ల కోసం సెర్చ్ చేయండి"</string>
<string name="label_application" msgid="8531721983832654978">"యాప్"</string>
<string name="all_apps_label" msgid="5015784846527570951">"అన్ని యాప్లు"</string>
<string name="notifications_header" msgid="1404149926117359025">"నోటిఫికేషన్లు"</string>
@@ -75,7 +74,7 @@
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"అన్ఇన్స్టాల్ చేయండి"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"యాప్ సమాచారం"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ఇన్స్టాల్ చేయండి"</string>
- <string name="dismiss_prediction_label" msgid="3357562989568808658">"యాప్ను సూచించవద్దు"</string>
+ <string name="dismiss_prediction_label" msgid="3357562989568808658">"యాప్ సూచించకు"</string>
<string name="pin_prediction" msgid="4196423321649756498">"సూచనను పిన్ చేయండి"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"షార్ట్కట్లను ఇన్స్టాల్ చేయడం"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"వినియోగదారు ప్రమేయం లేకుండా షార్ట్కట్లను జోడించడానికి యాప్ను అనుమతిస్తుంది."</string>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index f633b5f..ffeb20c 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ค้นหาแอป"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"กำลังโหลดแอป…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"ไม่พบแอปที่ตรงกับ \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"ค้นหาแอปเพิ่มเติม"</string>
<string name="label_application" msgid="8531721983832654978">"แอป"</string>
<string name="all_apps_label" msgid="5015784846527570951">"แอปทั้งหมด"</string>
<string name="notifications_header" msgid="1404149926117359025">"การแจ้งเตือน"</string>
@@ -103,7 +102,7 @@
<string name="folder_name_format_overflow" msgid="4270108890534995199">"โฟลเดอร์: <xliff:g id="NAME">%1$s</xliff:g>, อย่างน้อย <xliff:g id="SIZE">%2$d</xliff:g> รายการ"</string>
<string name="wallpaper_button_text" msgid="8404103075899945851">"วอลเปเปอร์"</string>
<string name="styles_wallpaper_button_text" msgid="8216961355289236794">"วอลเปเปอร์และรูปแบบ"</string>
- <string name="settings_button_text" msgid="8873672322605444408">"การตั้งค่าหน้าแรก"</string>
+ <string name="settings_button_text" msgid="8873672322605444408">"การตั้งค่าหน้าจอหลัก"</string>
<string name="msg_disabled_by_admin" msgid="6898038085516271325">"ปิดใช้โดยผู้ดูแลระบบ"</string>
<string name="allow_rotation_title" msgid="7222049633713050106">"อนุญาตให้หมุนหน้าจอหลัก"</string>
<string name="allow_rotation_desc" msgid="8662546029078692509">"เมื่อหมุนโทรศัพท์"</string>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index de4f952..a4cd808 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Maghanap ng mga app"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Naglo-load ng mga app…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Walang nahanap na app na tumutugma sa \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Maghanap ng higit pang mga app"</string>
<string name="label_application" msgid="8531721983832654978">"App"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Lahat ng app"</string>
<string name="notifications_header" msgid="1404149926117359025">"Mga Notification"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index f41284b..c30c2e5 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Uygulamalarda ara"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Uygulamalar yükleniyor…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" ile eşleşen uygulama bulunamadı"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Başka uygulamalar ara"</string>
<string name="label_application" msgid="8531721983832654978">"Uygulama"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Tüm uygulamalar"</string>
<string name="notifications_header" msgid="1404149926117359025">"Bildirimler"</string>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 360950e..2f79f23 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Пошук додатків"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Завантаження додатків…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Немає додатків для запиту \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Шукати ще додатки"</string>
<string name="label_application" msgid="8531721983832654978">"Додаток"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Усі додатки"</string>
<string name="notifications_header" msgid="1404149926117359025">"Сповіщення"</string>
@@ -115,7 +114,7 @@
<string name="title_change_settings" msgid="1376365968844349552">"Змінити налаштування"</string>
<string name="notification_dots_service_title" msgid="4284221181793592871">"Показувати значки сповіщень"</string>
<string name="developer_options_title" msgid="700788437593726194">"Параметри розробника"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Розміщати значки додатків на головний екран"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Розміщати значки додатків на головному екрані"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Для нових додатків"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"Невідомо"</string>
<string name="abandoned_clean_this" msgid="7610119707847920412">"Прибрати"</string>
diff --git a/res/values-ur/strings.xml b/res/values-ur/strings.xml
index e68e43e..3d90187 100644
--- a/res/values-ur/strings.xml
+++ b/res/values-ur/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"ایپس تلاش کریں"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"ایپس لوڈ کی جا رہی ہیں…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\" سے مماثل کوئی ایپس نہیں ملیں"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"مزید ایپس تلاش کریں"</string>
<string name="label_application" msgid="8531721983832654978">"ایپ"</string>
<string name="all_apps_label" msgid="5015784846527570951">"سبھی ایپس"</string>
<string name="notifications_header" msgid="1404149926117359025">"اطلاعات"</string>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 9c7ed56..04d07ec 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Ilovalarni qidirish"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Ilovalar yuklanmoqda…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"“<xliff:g id="QUERY">%1$s</xliff:g>” bilan mos hech qanday ilova topilmadi"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Boshqa ilovalarni qidirish"</string>
<string name="label_application" msgid="8531721983832654978">"Ilova"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Barcha ilovalar"</string>
<string name="notifications_header" msgid="1404149926117359025">"Bildirishnomalar"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 30167fa..2329992 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Tìm kiếm ứng dụng"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Đang tải ứng dụng…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Không tìm thấy ứng dụng nào phù hợp với \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Tìm kiếm thêm ứng dụng"</string>
<string name="label_application" msgid="8531721983832654978">"Ứng dụng"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Tất cả ứng dụng"</string>
<string name="notifications_header" msgid="1404149926117359025">"Thông báo"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 141d165..929cffa 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"搜索应用"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"正在加载应用…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"未找到与“<xliff:g id="QUERY">%1$s</xliff:g>”相符的应用"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"搜索更多应用"</string>
<string name="label_application" msgid="8531721983832654978">"应用"</string>
<string name="all_apps_label" msgid="5015784846527570951">"所有应用"</string>
<string name="notifications_header" msgid="1404149926117359025">"通知"</string>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index 2ff233b..1aea757 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"搜尋應用程式"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"正在載入應用程式…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"找不到與「<xliff:g id="QUERY">%1$s</xliff:g>」相符的應用程式"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"搜尋更多應用程式"</string>
<string name="label_application" msgid="8531721983832654978">"應用程式"</string>
<string name="all_apps_label" msgid="5015784846527570951">"所有應用程式"</string>
<string name="notifications_header" msgid="1404149926117359025">"通知"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 91cfd82..25a7d21 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"搜尋應用程式"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"正在載入應用程式…"</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"找不到與「<xliff:g id="QUERY">%1$s</xliff:g>」相符的應用程式"</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"搜尋更多應用程式"</string>
<string name="label_application" msgid="8531721983832654978">"應用程式"</string>
<string name="all_apps_label" msgid="5015784846527570951">"所有應用程式"</string>
<string name="notifications_header" msgid="1404149926117359025">"通知"</string>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index 12e8568..151ce27 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -59,7 +59,6 @@
<string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Sesha izinhlelo zokusebenza"</string>
<string name="all_apps_loading_message" msgid="5813968043155271636">"Ilayisha izinhlelo zokusebenza..."</string>
<string name="all_apps_no_search_results" msgid="3200346862396363786">"Azikho izinhlelo zokusebenza ezitholiwe ezifana ne-\"<xliff:g id="QUERY">%1$s</xliff:g>\""</string>
- <string name="all_apps_search_market_message" msgid="1366263386197059176">"Sesha izinhlelo zokusebenza eziningi"</string>
<string name="label_application" msgid="8531721983832654978">"Uhlelo lokusebenza"</string>
<string name="all_apps_label" msgid="5015784846527570951">"Zonke izinhlelo zokusebenza"</string>
<string name="notifications_header" msgid="1404149926117359025">"Izaziso"</string>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 3b71585..8623414 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -158,9 +158,6 @@
<!-- numHotseatIcons defaults to numColumns, if not specified -->
<attr name="numHotseatIcons" format="integer" />
- <!-- Number of icons to use when shrinking the hotseat size,
- defaults to numHotseatIcons / 2 -->
- <attr name="numShrunkenHotseatIcons" format="integer" />
<!-- Number of icons to use when extending the hotseat size,
defaults to 2 * numHotseatIcons -->
<attr name="numExtendedHotseatIcons" format="integer" />
@@ -187,7 +184,7 @@
<attr name="isScalable" format="boolean" />
<attr name="devicePaddingId" format="reference" />
<!-- By default all categories are enabled -->
- <attr name="deviceCategory" format="integer" >
+ <attr name="deviceCategory" format="integer">
<!-- Enable on phone only -->
<flag name="phone" value="1" />
<!-- Enable on tablets only -->
@@ -196,6 +193,18 @@
<flag name="multi_display" value="4" />
</attr>
+ <!-- By default all are false -->
+ <attr name="inlineQsb" format="integer">
+ <!-- Enable on landscape only -->
+ <flag name="portrait" value="1" />
+ <!-- Enable on portrait only -->
+ <flag name="landscape" value="2" />
+ <!-- Enable on two panel portrait only -->
+ <flag name="twoPanelPortrait" value="4" />
+ <!-- Enable on two panel landscape only -->
+ <flag name="twoPanelLandscape" value="8" />
+ </attr>
+
</declare-styleable>
<declare-styleable name="DevicePadding">
@@ -284,6 +293,8 @@
<!-- defaults to iconImageSize, if not specified -->
<attr name="allAppsIconSize" format="float" />
<!-- defaults to allAppsIconSize, if not specified -->
+ <attr name="allAppsIconSizeLandscape" format="float" />
+ <!-- defaults to allAppsIconSize, if not specified -->
<attr name="allAppsIconSizeTwoPanelPortrait" format="float" />
<!-- defaults to allAppsIconSize, if not specified -->
<attr name="allAppsIconSizeTwoPanelLandscape" format="float" />
@@ -328,14 +339,18 @@
if not specified -->
<attr name="allAppsBorderSpaceTwoPanelLandscapeVertical" format="float" />
- <!-- defaults to borderSpaceDps, if not specified -->
- <attr name="hotseatBorderSpace" format="float" />
- <!-- defaults to hotseatBorderSpace, if not specified -->
- <attr name="hotseatBorderSpaceLandscape" format="float" />
- <!-- defaults to hotseatBorderSpace, if not specified -->
- <attr name="hotseatBorderSpaceTwoPanelLandscape" format="float" />
- <!-- defaults to hotseatBorderSpace, if not specified -->
- <attr name="hotseatBorderSpaceTwoPanelPortrait" format="float" />
+ <!-- defaults to minCellHeight if not specified
+ when GridDisplayOption#isScalable is true. -->
+ <attr name="folderCellHeight" format="float" />
+ <!-- defaults to minCellWidth, if not specified -->
+ <attr name="folderCellWidth" format="float" />
+
+ <!-- defaults to borderSpace, if not specified -->
+ <!-- space to be used horizontally and vertically -->
+ <attr name="folderBorderSpace" format="float" />
+
+ <!-- defaults to folderBorderSpace vertical, if not specified -->
+ <attr name="folderTopPadding" format="float" />
<!-- defaults to res.hotseat_bar_bottom_space_default, if not specified -->
<attr name="hotseatBarBottomSpace" format="float" />
@@ -383,17 +398,6 @@
<!-- defaults to horizontalMargin if not specified -->
<attr name="horizontalMarginTwoPanelPortrait" format="float"/>
- <!-- By default all are false -->
- <attr name="inlineQsb" format="integer" >
- <!-- Enable on landscape only -->
- <flag name="portrait" value="1" />
- <!-- Enable on portrait only -->
- <flag name="landscape" value="2" />
- <!-- Enable on two panel portrait only -->
- <flag name="twoPanelPortrait" value="4" />
- <!-- Enable on two panel landscape only -->
- <flag name="twoPanelLandscape" value="8" />
- </attr>
</declare-styleable>
<declare-styleable name="CellLayout">
diff --git a/res/values/config.xml b/res/values/config.xml
index 3f94c34..d3f5033 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -85,6 +85,7 @@
<string name="launcher_activity_logic_class" translatable="false"></string>
<string name="model_delegate_class" translatable="false"></string>
<string name="window_manager_proxy_class" translatable="false"></string>
+ <string name="secondary_display_predictions_class" translatable="false"></string>
<!-- View ID to use for QSB widget -->
<item type="id" name="qsb_widget" />
@@ -156,6 +157,7 @@
<item name="swipe_up_rect_scale_damping_ratio" type="dimen" format="float">0.75</item>
<item name="swipe_up_rect_scale_stiffness" type="dimen" format="float">200</item>
+ <item name="swipe_up_rect_scale_higher_stiffness" type="dimen" format="float">400</item>
<item name="swipe_up_rect_xy_fling_friction" type="dimen" format="float">1.5</item>
@@ -191,4 +193,15 @@
<dimen name="swipe_back_window_scale_x_margin">10dp</dimen>
<dimen name="swipe_back_window_max_delta_y">160dp</dimen>
<dimen name="swipe_back_window_corner_radius">40dp</dimen>
+
+ <!-- The duration of the bottom sheet opening and closing animation -->
+ <integer name="config_bottomSheetOpenDuration">267</integer>
+ <integer name="config_bottomSheetCloseDuration">267</integer>
+
+ <!-- The duration of the AllApps opening and closing animation -->
+ <integer name="config_allAppsOpenDuration">600</integer>
+ <integer name="config_allAppsCloseDuration">300</integer>
+
+ <!-- The max scale for the wallpaper when it's zoomed in -->
+ <item name="config_wallpaperMaxScale" format="float" type="dimen">0</item>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b19e739..2e886db 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -108,9 +108,6 @@
<dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
<dimen name="all_apps_search_bar_bottom_padding">30dp</dimen>
<dimen name="all_apps_empty_search_message_top_offset">40dp</dimen>
- <dimen name="all_apps_empty_search_bg_top_offset">144dp</dimen>
- <dimen name="all_apps_background_canvas_width">700dp</dimen>
- <dimen name="all_apps_background_canvas_height">475dp</dimen>
<dimen name="all_apps_header_pill_height">48dp</dimen>
<dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
<dimen name="all_apps_header_tab_height">48dp</dimen>
@@ -229,6 +226,7 @@
<dimen name="drop_target_text_size">16sp</dimen>
<dimen name="drop_target_shadow_elevation">2dp</dimen>
<dimen name="drop_target_bar_margin_horizontal">4dp</dimen>
+ <dimen name="drop_target_button_drawable_size">20dp</dimen>
<dimen name="drop_target_button_drawable_padding">8dp</dimen>
<dimen name="drop_target_button_drawable_horizontal_padding">16dp</dimen>
<dimen name="drop_target_button_drawable_vertical_padding">8dp</dimen>
@@ -254,7 +252,7 @@
<dimen name="folder_cell_y_padding">6dp</dimen>
<!-- label text size = workspace text size multiplied by this scale -->
<dimen name="folder_label_text_scale">1.14</dimen>
- <dimen name="folder_label_height">48dp</dimen>
+ <dimen name="folder_label_height">56dp</dimen>
<dimen name="folder_content_padding_left_right">8dp</dimen>
<dimen name="folder_content_padding_top">16dp</dimen>
@@ -357,6 +355,8 @@
<dimen name="taskbar_stashed_size">0dp</dimen>
<dimen name="qsb_widget_height">0dp</dimen>
<dimen name="qsb_shadow_height">0dp</dimen>
+ <dimen name="min_hotseat_icon_space">18dp</dimen>
+ <dimen name="min_hotseat_qsb_width">0dp</dimen>
<dimen name="taskbar_icon_size">44dp</dimen>
<!-- Note that this applies to both sides of all icons, so visible space is double this. -->
<dimen name="taskbar_icon_spacing">8dp</dimen>
@@ -381,7 +381,6 @@
<dimen name="task_thumbnail_icon_drawable_size">0dp</dimen>
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
<dimen name="overview_task_margin">0dp</dimen>
- <dimen name="overview_task_margin_grid">0dp</dimen>
<dimen name="overview_actions_height">0dp</dimen>
<dimen name="overview_actions_button_spacing">0dp</dimen>
<dimen name="overview_actions_margin_gesture">0dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2addf50..3eb08ba 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -128,8 +128,6 @@
<string name="all_apps_loading_message">Loading apps…</string>
<!-- No-search-results text. [CHAR_LIMIT=50] -->
<string name="all_apps_no_search_results">No apps found matching \"<xliff:g id="query" example="Android">%1$s</xliff:g>\"</string>
- <!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] -->
- <string name="all_apps_search_market_message">Search for more apps</string>
<!-- Label for an icon representing any generic app. [CHAR_LIMIT=50] -->
<string name="label_application">App</string>
<!-- Label for the header text of the All Apps section in All Apps view, used to separate Predicted Apps and Actions section from All Apps section. [CHAR_LIMIT=50] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index a8cbf08..90553a1 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -292,17 +292,6 @@
<style name="TextTitle" parent="@android:style/TextAppearance.DeviceDefault" />
- <style name="AllAppsEmptySearchBackground">
- <item name="android:colorPrimary">#E0E0E0</item>
- <item name="android:colorControlHighlight">#19BDBDBD</item>
- <item name="android:colorForeground">@color/all_apps_bg_hand_fill</item>
- </style>
- <style name="AllAppsEmptySearchBackground.Dark">
- <item name="android:colorPrimary">#9AA0A6</item>
- <item name="android:colorControlHighlight">#19DFE1E5</item>
- <item name="android:colorForeground">@color/all_apps_bg_hand_fill_dark</item>
- </style>
-
<style name="Button.TopRounded.Bordered" parent="@android:style/Widget.Material.Button">
<item name="android:background">@drawable/button_top_rounded_bordered_ripple</item>
<item name="android:stateListAnimator">@null</item>
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index 0238e7d..407f217 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -200,8 +200,6 @@
launcher:allAppsBorderSpaceHorizontal="8"
launcher:allAppsBorderSpaceVertical="16"
launcher:allAppsBorderSpaceLandscape="16"
- launcher:hotseatBorderSpace="58"
- launcher:hotseatBorderSpaceLandscape="50.4"
launcher:hotseatBarBottomSpace="76"
launcher:hotseatBarBottomSpaceLandscape="40"
launcher:canBeDefault="true" />
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 21dbc5f..5ee6fce 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -109,10 +109,6 @@
| TYPE_ALL_APPS_EDU | TYPE_ICON_SURFACE | TYPE_WIDGETS_EDUCATION_DIALOG
| TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS | TYPE_OPTIONS_POPUP_DIALOG;
- // Usually we show the back button when a floating view is open. Instead, hide for these types.
- public static final int TYPE_HIDE_BACK_BUTTON = TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE
- | TYPE_SNACKBAR | TYPE_WIDGET_RESIZE_FRAME | TYPE_LISTENER;
-
public static final int TYPE_ACCESSIBLE = TYPE_ALL & ~TYPE_DISCOVERY_BOUNCE & ~TYPE_LISTENER
& ~TYPE_ALL_APPS_EDU;
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index 3b24df2..5abe3d3 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -91,7 +91,7 @@
Resources resources = getResources();
mDragDistanceThreshold = resources.getDimensionPixelSize(R.dimen.drag_distanceThreshold);
- mDrawableSize = resources.getDimensionPixelSize(R.dimen.drop_target_text_size);
+ mDrawableSize = resources.getDimensionPixelSize(R.dimen.drop_target_button_drawable_size);
mDrawablePadding = resources.getDimensionPixelSize(
R.dimen.drop_target_button_drawable_padding);
}
@@ -374,11 +374,63 @@
hideTooltip();
}
+ /**
+ * Returns if the text will be truncated within the provided availableWidth.
+ */
public boolean isTextTruncated(int availableWidth) {
- availableWidth -= (getPaddingLeft() + getPaddingRight() + mDrawable.getIntrinsicWidth()
- + getCompoundDrawablePadding());
- CharSequence displayedText = TextUtils.ellipsize(mText, getPaint(), availableWidth,
+ availableWidth -= getPaddingLeft() + getPaddingRight();
+ if (mIconVisible) {
+ availableWidth -= mDrawable.getIntrinsicWidth() + getCompoundDrawablePadding();
+ }
+ if (availableWidth <= 0) {
+ return true;
+ }
+ CharSequence firstLine = TextUtils.ellipsize(mText, getPaint(), availableWidth,
TextUtils.TruncateAt.END);
- return !mText.equals(displayedText);
+ if (!mTextMultiLine) {
+ return !TextUtils.equals(mText, firstLine);
+ }
+ if (TextUtils.equals(mText, firstLine)) {
+ // When multi-line is active, if it can display as one line, then text is not truncated.
+ return false;
+ }
+ CharSequence secondLine =
+ TextUtils.ellipsize(mText.subSequence(firstLine.length(), mText.length()),
+ getPaint(), availableWidth, TextUtils.TruncateAt.END);
+ return !(TextUtils.equals(mText.subSequence(0, firstLine.length()), firstLine)
+ && TextUtils.equals(mText.subSequence(firstLine.length(), secondLine.length()),
+ secondLine));
+ }
+
+ /**
+ * Reduce the size of the text until it fits the measured width or reaches a minimum.
+ *
+ * The minimum size is defined by {@code R.dimen.button_drop_target_min_text_size} and
+ * it diminishes by intervals defined by
+ * {@code R.dimen.button_drop_target_resize_text_increment}
+ * This functionality is very similar to the option
+ * {@link TextView#setAutoSizeTextTypeWithDefaults(int)} but can't be used in this view because
+ * the layout width is {@code WRAP_CONTENT}.
+ *
+ * @return The biggest text size in SP that makes the text fit or if the text can't fit returns
+ * the min available value
+ */
+ public float resizeTextToFit() {
+ float minSize = Utilities.pxToSp(getResources()
+ .getDimensionPixelSize(R.dimen.button_drop_target_min_text_size));
+ float step = Utilities.pxToSp(getResources()
+ .getDimensionPixelSize(R.dimen.button_drop_target_resize_text_increment));
+ float textSize = Utilities.pxToSp(getTextSize());
+
+ int availableWidth = getMeasuredWidth();
+ while (textSize > minSize) {
+ if (isTextTruncated(availableWidth)) {
+ textSize -= step;
+ setTextSize(textSize);
+ } else {
+ return textSize;
+ }
+ }
+ return minSize;
}
}
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 52960a9..9f3e1fa 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -496,8 +496,8 @@
// Draw reorder drag target.
debugPaint.setColor(Color.RED);
- canvas.drawCircle(cellCenter[0], cellCenter[1], getReorderRadius(targetCell),
- debugPaint);
+ canvas.drawCircle(cellCenter[0], cellCenter[1],
+ getReorderRadius(targetCell, 1, 1), debugPaint);
// Draw folder creation drag target.
if (canCreateFolder) {
@@ -912,18 +912,18 @@
DeviceProfile grid = mActivity.getDeviceProfile();
float iconVisibleRadius = ICON_VISIBLE_AREA_FACTOR * grid.iconSizePx / 2;
// Halfway between reorder radius and icon.
- return (getReorderRadius(targetCell) + iconVisibleRadius) / 2;
+ return (getReorderRadius(targetCell, 1, 1) + iconVisibleRadius) / 2;
}
/**
* Returns the max distance from the center of a cell that will start to reorder on drag over.
*/
- public float getReorderRadius(int[] targetCell) {
+ public float getReorderRadius(int[] targetCell, int spanX, int spanY) {
int[] centerPoint = mTmpPoint;
getWorkspaceCellVisualCenter(targetCell[0], targetCell[1], centerPoint);
Rect cellBoundsWithSpacing = mTempRect;
- cellToRect(targetCell[0], targetCell[1], 1, 1, cellBoundsWithSpacing);
+ cellToRect(targetCell[0], targetCell[1], spanX, spanY, cellBoundsWithSpacing);
cellBoundsWithSpacing.inset(-mBorderSpace.x / 2, -mBorderSpace.y / 2);
if (canCreateFolder(getChildAt(targetCell[0], targetCell[1]))) {
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 3a2227a..4cad919 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -20,27 +20,32 @@
import static com.android.launcher3.InvariantDeviceProfile.INDEX_LANDSCAPE;
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_LANDSCAPE;
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_PORTRAIT;
-import static com.android.launcher3.ResourceUtils.pxFromDp;
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.Utilities.pxFromSp;
+import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
+import static com.android.launcher3.icons.GraphicsUtils.getShapePath;
+import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Path;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.util.DisplayMetrics;
+import android.util.SparseArray;
import android.view.Surface;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.DevicePaddings.DevicePadding;
import com.android.launcher3.icons.DotRenderer;
-import com.android.launcher3.icons.GraphicsUtils;
import com.android.launcher3.icons.IconNormalizer;
+import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.uioverrides.ApiWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
@@ -48,11 +53,17 @@
import java.io.PrintWriter;
import java.util.List;
+import java.util.Locale;
@SuppressLint("NewApi")
public class DeviceProfile {
private static final int DEFAULT_DOT_SIZE = 100;
+ private static final float ALL_APPS_TABLET_MAX_ROWS = 5.5f;
+
+ public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f);
+ public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE;
+
// Ratio of empty space, qsb should take up to appear visually centered.
private final float mQsbCenterFactor;
@@ -108,8 +119,6 @@
public final int edgeMarginPx;
public final float workspaceContentScale;
- private float mWorkspaceSpringLoadShrunkTop;
- private float mWorkspaceSpringLoadShrunkBottom;
public final int workspaceSpringLoadedMinNextPageVisiblePx;
private final int extraSpace;
@@ -142,7 +151,6 @@
// Folder content
public Point folderCellLayoutBorderSpacePx;
- public int folderCellLayoutBorderSpaceOriginalPx;
public int folderContentPaddingLeftRight;
public int folderContentPaddingTop;
@@ -156,7 +164,7 @@
public int folderChildDrawablePaddingPx;
// Hotseat
- public final int numShownHotseatIcons;
+ public int numShownHotseatIcons;
public int hotseatCellHeightPx;
public final boolean areNavButtonsInline;
// In portrait: size = height, in landscape: size = width
@@ -168,18 +176,25 @@
// Start is the side next to the nav bar, end is the side next to the workspace
public final int hotseatBarSidePaddingStartPx;
public final int hotseatBarSidePaddingEndPx;
+ public int hotseatQsbWidth; // only used when isQsbInline
public final int hotseatQsbHeight;
public final int hotseatQsbVisualHeight;
private final int hotseatQsbShadowHeight;
public int hotseatBorderSpace;
- public int qsbWidth; // only used when isQsbInline
+ // Bottom sheets
+ public int bottomSheetTopPadding;
+ public int bottomSheetOpenDuration;
+ public int bottomSheetCloseDuration;
+ public float bottomSheetWorkspaceScale;
+ public float bottomSheetDepth;
// All apps
public Point allAppsBorderSpacePx;
public int allAppsShiftRange;
public int allAppsTopPadding;
- public int bottomSheetTopPadding;
+ public int allAppsOpenDuration;
+ public int allAppsCloseDuration;
public int allAppsCellHeightPx;
public int allAppsCellWidthPx;
public int allAppsIconSizePx;
@@ -191,7 +206,6 @@
// Overview
public int overviewTaskMarginPx;
- public int overviewTaskMarginGridPx;
public int overviewTaskIconSizePx;
public int overviewTaskIconDrawableSizePx;
public int overviewTaskIconDrawableSizeGridPx;
@@ -204,7 +218,7 @@
public int overviewGridSideMargin;
// Widgets
- public final PointF appWidgetScale = new PointF(1.0f, 1.0f);
+ private final ViewScaleProvider mViewScaleProvider;
// Drop Target
public int dropTargetBarSizePx;
@@ -220,13 +234,12 @@
// Insets
private final Rect mInsets = new Rect();
public final Rect workspacePadding = new Rect();
- private final Rect mHotseatBarPadding = new Rect();
// When true, nav bar is on the left side of the screen.
private boolean mIsSeascape;
// Notification dots
- public DotRenderer mDotRendererWorkSpace;
- public DotRenderer mDotRendererAllApps;
+ public final DotRenderer mDotRendererWorkSpace;
+ public final DotRenderer mDotRendererAllApps;
// Taskbar
public boolean isTaskbarPresent;
@@ -240,8 +253,9 @@
/** TODO: Once we fully migrate to staged split, remove "isMultiWindowMode" */
DeviceProfile(Context context, InvariantDeviceProfile inv, Info info, WindowBounds windowBounds,
- boolean isMultiWindowMode, boolean transposeLayoutWithOrientation,
- boolean useTwoPanels, boolean isGestureMode) {
+ SparseArray<DotRenderer> dotRendererCache, boolean isMultiWindowMode,
+ boolean transposeLayoutWithOrientation, boolean useTwoPanels, boolean isGestureMode,
+ @NonNull final ViewScaleProvider viewScaleProvider) {
this.inv = inv;
this.isLandscape = windowBounds.isLandscape();
@@ -311,11 +325,22 @@
bottomSheetTopPadding = mInsets.top // statusbar height
+ res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
+ (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding
+ bottomSheetOpenDuration = res.getInteger(R.integer.config_bottomSheetOpenDuration);
+ bottomSheetCloseDuration = res.getInteger(R.integer.config_bottomSheetCloseDuration);
+ if (isTablet) {
+ bottomSheetWorkspaceScale = workspaceContentScale;
+ // The goal is to set wallpaper to zoom at workspaceContentScale when in AllApps.
+ // When depth is 0, wallpaper zoom is set to maxWallpaperScale.
+ // When depth is 1, wallpaper zoom is set to 1.
+ // For depth to achieve zoom set to maxWallpaperScale * workspaceContentScale:
+ float maxWallpaperScale = res.getFloat(R.dimen.config_wallpaperMaxScale);
+ bottomSheetDepth = Utilities.mapToRange(maxWallpaperScale * workspaceContentScale,
+ maxWallpaperScale, 1f, 0f, 1f, LINEAR);
+ } else {
+ bottomSheetWorkspaceScale = 1f;
+ bottomSheetDepth = 0f;
+ }
- allAppsTopPadding = isTablet ? bottomSheetTopPadding : 0;
- allAppsShiftRange = isTablet
- ? heightPx - allAppsTopPadding
- : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale);
folderContentPaddingLeftRight =
res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right);
@@ -326,9 +351,8 @@
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics),
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics));
cellLayoutBorderSpaceOriginalPx = new Point(cellLayoutBorderSpacePx);
- folderCellLayoutBorderSpaceOriginalPx = pxFromDp(inv.folderBorderSpace, mMetrics);
- folderCellLayoutBorderSpacePx = new Point(folderCellLayoutBorderSpaceOriginalPx,
- folderCellLayoutBorderSpaceOriginalPx);
+ folderCellLayoutBorderSpacePx = new Point(pxFromDp(inv.folderBorderSpaces.x, mMetrics),
+ pxFromDp(inv.folderBorderSpaces.y, mMetrics));
workspacePageIndicatorHeight = res.getDimensionPixelSize(
R.dimen.workspace_page_indicator_height);
@@ -367,15 +391,9 @@
&& hotseatQsbHeight > 0;
isQsbInline = inv.inlineQsb[mTypeIndex] && canQsbInline;
- // We shrink hotseat sizes regardless of orientation, if nav buttons are inline and QSB
- // might be inline in either orientations, to keep hotseat size consistent across rotation.
areNavButtonsInline = isTaskbarPresent && !isGestureMode;
- if (areNavButtonsInline && canQsbInline) {
- numShownHotseatIcons = inv.numShrunkenHotseatIcons;
- } else {
- numShownHotseatIcons =
- isTwoPanels ? inv.numDatabaseHotseatIcons : inv.numShownHotseatIcons;
- }
+ numShownHotseatIcons =
+ isTwoPanels ? inv.numDatabaseHotseatIcons : inv.numShownHotseatIcons;
numShownAllAppsColumns =
isTwoPanels ? inv.numDatabaseAllAppsColumns : inv.numAllAppsColumns;
@@ -410,7 +428,7 @@
// Add a bit of space between nav bar and hotseat in vertical bar layout.
hotseatBarSidePaddingStartPx = isVerticalBarLayout() ? workspacePageIndicatorHeight : 0;
updateHotseatSizes(pxFromDp(inv.iconSize[INDEX_DEFAULT], mMetrics));
- if (areNavButtonsInline) {
+ if (areNavButtonsInline && !isPhone) {
/*
* 3 nav buttons +
* Spacing between nav buttons +
@@ -426,25 +444,18 @@
}
overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin);
- overviewTaskMarginGridPx = res.getDimensionPixelSize(R.dimen.overview_task_margin_grid);
overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size);
overviewTaskIconDrawableSizePx =
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size);
overviewTaskIconDrawableSizeGridPx =
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size_grid);
- overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
+ overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx;
overviewActionsTopMarginPx = res.getDimensionPixelSize(R.dimen.overview_actions_top_margin);
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
overviewActionsButtonSpacing = res.getDimensionPixelSize(
R.dimen.overview_actions_button_spacing);
overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
- // Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
- // overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the
- // extra margin when calculating row spacing.
- int extraTopMargin = overviewTaskThumbnailTopMarginPx - overviewTaskIconSizePx
- - overviewTaskMarginGridPx;
- overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing)
- - extraTopMargin;
+ overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
overviewGridSideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin);
// Calculate all of the remaining variables.
@@ -472,24 +483,49 @@
updateWorkspacePadding();
// Hotseat and QSB width depends on updated cellSize and workspace padding
- hotseatBorderSpace = calculateHotseatBorderSpace();
- qsbWidth = calculateQsbWidth();
+ recalculateHotseatWidthAndBorderSpace(res);
+
+ // AllApps height calculation depends on updated cellSize
+ if (isTablet) {
+ int collapseHandleHeight =
+ res.getDimensionPixelOffset(R.dimen.bottom_sheet_handle_area_height);
+ int contentHeight = heightPx - collapseHandleHeight - hotseatQsbHeight;
+ int targetContentHeight = (int) (allAppsCellHeightPx * ALL_APPS_TABLET_MAX_ROWS);
+ allAppsTopPadding = Math.max(mInsets.top, contentHeight - targetContentHeight);
+ allAppsShiftRange = heightPx - allAppsTopPadding;
+ } else {
+ allAppsTopPadding = 0;
+ allAppsShiftRange =
+ res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
+ }
+ allAppsOpenDuration = res.getInteger(R.integer.config_allAppsOpenDuration);
+ allAppsCloseDuration = res.getInteger(R.integer.config_allAppsCloseDuration);
flingToDeleteThresholdVelocity = res.getDimensionPixelSize(
R.dimen.drag_flingToDeleteMinVelocity);
+ mViewScaleProvider = viewScaleProvider;
+
// This is done last, after iconSizePx is calculated above.
- Path dotPath = GraphicsUtils.getShapePath(DEFAULT_DOT_SIZE);
- mDotRendererWorkSpace = new DotRenderer(iconSizePx, dotPath, DEFAULT_DOT_SIZE);
- mDotRendererAllApps = iconSizePx == allAppsIconSizePx ? mDotRendererWorkSpace :
- new DotRenderer(allAppsIconSizePx, dotPath, DEFAULT_DOT_SIZE);
+ mDotRendererWorkSpace = createDotRenderer(iconSizePx, dotRendererCache);
+ mDotRendererAllApps = createDotRenderer(allAppsIconSizePx, dotRendererCache);
+ }
+
+ private static DotRenderer createDotRenderer(
+ int size, @NonNull SparseArray<DotRenderer> cache) {
+ DotRenderer renderer = cache.get(size);
+ if (renderer == null) {
+ renderer = new DotRenderer(size, getShapePath(DEFAULT_DOT_SIZE), DEFAULT_DOT_SIZE);
+ cache.put(size, renderer);
+ }
+ return renderer;
}
/**
* QSB width is always calculated because when in 3 button nav the width doesn't follow the
* width of the hotseat.
*/
- private int calculateQsbWidth() {
+ private int calculateQsbWidth(int hotseatBorderSpace) {
if (isQsbInline) {
int columns = getPanelCount() * inv.numColumns;
return getIconToIconWidthForColumns(columns)
@@ -504,7 +540,7 @@
private int getIconToIconWidthForColumns(int columns) {
return columns * getCellSize().x
+ (columns - 1) * cellLayoutBorderSpacePx.x
- - (getCellSize().x - iconSizePx); // left and right cell space
+ - getCellHorizontalSpace();
}
private int getHorizontalMarginPx(InvariantDeviceProfile idp, Resources res) {
@@ -536,6 +572,70 @@
}
}
+ private void recalculateHotseatWidthAndBorderSpace(Resources res) {
+ hotseatBorderSpace = calculateHotseatBorderSpace();
+ hotseatQsbWidth = calculateQsbWidth(hotseatBorderSpace);
+ // Spaces should be correct when there nav buttons are not inline
+ if (!areNavButtonsInline) {
+ return;
+ }
+
+ // Get the maximum width that the hotseat can be
+ int columns = getPanelCount() * inv.numColumns;
+ int maxHotseatWidth = getIconToIconWidthForColumns(columns);
+ int sideSpace = (availableWidthPx - maxHotseatWidth) / 2;
+ int inlineButtonsOverlap = Math.max(0, hotseatBarEndOffset - sideSpace);
+ // decrease how much the nav buttons go "inside" the hotseat
+ maxHotseatWidth -= inlineButtonsOverlap;
+
+ // Get how much space is required to show the hotseat with QSB
+ int requiredWidth = getHotseatRequiredWidth();
+
+ // If spaces are fine, use them
+ if (requiredWidth <= maxHotseatWidth) {
+ return;
+ }
+
+ // Calculate the difference of widths and remove a little from each space between icons
+ // and QSB if it's inline
+ int spaceDiff = requiredWidth - maxHotseatWidth;
+ int numOfSpaces = numShownHotseatIcons - (isQsbInline ? 0 : 1);
+ hotseatBorderSpace -= (spaceDiff / numOfSpaces);
+
+ int minHotseatIconSpaceDp = res.getDimensionPixelSize(R.dimen.min_hotseat_icon_space);
+ int minHotseatQsbWidthDp = res.getDimensionPixelSize(R.dimen.min_hotseat_qsb_width);
+
+ if (hotseatBorderSpace >= minHotseatIconSpaceDp) {
+ return;
+ }
+
+ // Border space can't be less than the minimum
+ hotseatBorderSpace = minHotseatIconSpaceDp;
+ requiredWidth = getHotseatRequiredWidth();
+
+ // If there is an inline qsb, change its size
+ if (isQsbInline) {
+ hotseatQsbWidth -= requiredWidth - maxHotseatWidth;
+ if (hotseatQsbWidth >= minHotseatQsbWidthDp) {
+ return;
+ }
+
+ // QSB can't be less than the minimum
+ hotseatQsbWidth = minHotseatQsbWidthDp;
+ }
+
+ // If it still doesn't fit, start removing icons
+ do {
+ numShownHotseatIcons--;
+ requiredWidth = getHotseatRequiredWidth();
+ } while (requiredWidth > maxHotseatWidth && numShownHotseatIcons > 1);
+
+ // Add back some space between the icons
+ spaceDiff = maxHotseatWidth - requiredWidth;
+ numOfSpaces = numShownHotseatIcons - (isQsbInline ? 0 : 1);
+ hotseatBorderSpace += (spaceDiff / numOfSpaces);
+ }
+
private Point getCellLayoutBorderSpace(InvariantDeviceProfile idp) {
return getCellLayoutBorderSpace(idp, 1f);
}
@@ -576,10 +676,16 @@
widthPx, heightPx, availableWidthPx, availableHeightPx, rotationHint);
bounds.bounds.offsetTo(windowX, windowY);
bounds.insets.set(mInsets);
+
+ SparseArray<DotRenderer> dotRendererCache = new SparseArray<>();
+ dotRendererCache.put(iconSizePx, mDotRendererWorkSpace);
+ dotRendererCache.put(allAppsIconSizePx, mDotRendererAllApps);
+
return new Builder(context, inv, mInfo)
.setWindowBounds(bounds)
.setUseTwoPanels(isTwoPanels)
.setMultiWindowMode(isMultiWindowMode)
+ .setDotRendererCache(dotRendererCache)
.setGestureMode(isGestureMode);
}
@@ -596,13 +702,18 @@
.setMultiWindowMode(true)
.build();
- profile.hideWorkspaceLabelsIfNotEnoughSpace();
-
// We use these scales to measure and layout the widgets using their full invariant profile
// sizes and then draw them scaled and centered to fit in their multi-window mode cellspans.
float appWidgetScaleX = (float) profile.getCellSize().x / getCellSize().x;
float appWidgetScaleY = (float) profile.getCellSize().y / getCellSize().y;
- profile.appWidgetScale.set(appWidgetScaleX, appWidgetScaleY);
+ if (appWidgetScaleX != 1 || appWidgetScaleY != 1) {
+ final PointF p = new PointF(appWidgetScaleX, appWidgetScaleY);
+ profile = profile.toBuilder(context)
+ .setViewScaleProvider(i -> p)
+ .build();
+ }
+
+ profile.hideWorkspaceLabelsIfNotEnoughSpace();
return profile;
}
@@ -762,15 +873,10 @@
*/
private int calculateHotseatBorderSpace() {
if (!isScalableGrid) return 0;
- //TODO(http://b/228998082) remove this when 3 button spaces are fixed
- if (areNavButtonsInline) {
- return pxFromDp(inv.hotseatBorderSpaces[mTypeIndex], mMetrics);
- } else {
- int columns = inv.hotseatColumnSpan[mTypeIndex];
- float hotseatWidthPx = getIconToIconWidthForColumns(columns);
- float hotseatIconsTotalPx = iconSizePx * numShownHotseatIcons;
- return (int) (hotseatWidthPx - hotseatIconsTotalPx) / (numShownHotseatIcons - 1);
- }
+ int columns = inv.hotseatColumnSpan[mTypeIndex];
+ float hotseatWidthPx = getIconToIconWidthForColumns(columns);
+ float hotseatIconsTotalPx = iconSizePx * numShownHotseatIcons;
+ return (int) (hotseatWidthPx - hotseatIconsTotalPx) / (numShownHotseatIcons - 1);
}
@@ -851,16 +957,14 @@
int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx);
if (isScalableGrid) {
- int minWidth = folderChildIconSizePx + iconDrawablePaddingPx * 2;
- int minHeight = folderChildIconSizePx + iconDrawablePaddingPx * 2 + textHeight;
+ folderCellWidthPx = pxFromDp(inv.folderCellSize.x, mMetrics, scale);
+ folderCellHeightPx = pxFromDp(inv.folderCellSize.y, mMetrics, scale);
- folderCellWidthPx = (int) Math.max(minWidth, cellWidthPx * scale);
- folderCellHeightPx = (int) Math.max(minHeight, cellHeightPx * scale);
-
- int scaledSpace = (int) (folderCellLayoutBorderSpaceOriginalPx * scale);
- folderCellLayoutBorderSpacePx = new Point(scaledSpace, scaledSpace);
- folderContentPaddingLeftRight = scaledSpace;
- folderContentPaddingTop = scaledSpace;
+ folderCellLayoutBorderSpacePx = new Point(
+ pxFromDp(inv.folderBorderSpaces.x, mMetrics, scale),
+ pxFromDp(inv.folderBorderSpaces.y, mMetrics, scale));
+ folderContentPaddingLeftRight = folderCellLayoutBorderSpacePx.x;
+ folderContentPaddingTop = pxFromDp(inv.folderTopPadding, mMetrics, scale);
} else {
int cellPaddingX = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_x_padding)
* scale);
@@ -908,6 +1012,13 @@
}
/**
+ * Returns the left and right space on the cell, which is the cell width - icon size
+ */
+ public int getCellHorizontalSpace() {
+ return getCellSize().x - iconSizePx;
+ }
+
+ /**
* Gets the number of panels within the workspace.
*/
public int getPanelCount() {
@@ -918,43 +1029,42 @@
* Gets the space in px from the bottom of last item in the vertical-bar hotseat to the
* bottom of the screen.
*/
- private int getVerticalHotseatLastItemBottomOffset() {
+ private int getVerticalHotseatLastItemBottomOffset(Context context) {
+ Rect hotseatBarPadding = getHotseatLayoutPadding(context);
int cellHeight = calculateCellHeight(
- heightPx - mHotseatBarPadding.top - mHotseatBarPadding.bottom, hotseatBorderSpace,
+ heightPx - hotseatBarPadding.top - hotseatBarPadding.bottom, hotseatBorderSpace,
numShownHotseatIcons);
int extraIconEndSpacing = (cellHeight - iconSizePx) / 2;
- return extraIconEndSpacing + mHotseatBarPadding.bottom;
+ return extraIconEndSpacing + hotseatBarPadding.bottom;
}
/**
* Gets the scaled top of the workspace in px for the spring-loaded edit state.
*/
public float getCellLayoutSpringLoadShrunkTop() {
- mWorkspaceSpringLoadShrunkTop = mInsets.top + dropTargetBarTopMarginPx + dropTargetBarSizePx
+ return mInsets.top + dropTargetBarTopMarginPx + dropTargetBarSizePx
+ dropTargetBarBottomMarginPx;
- return mWorkspaceSpringLoadShrunkTop;
}
/**
* Gets the scaled bottom of the workspace in px for the spring-loaded edit state.
*/
- public float getCellLayoutSpringLoadShrunkBottom() {
+ public float getCellLayoutSpringLoadShrunkBottom(Context context) {
int topOfHotseat = hotseatBarSizePx + springLoadedHotseatBarTopMarginPx;
- mWorkspaceSpringLoadShrunkBottom =
- heightPx - (isVerticalBarLayout() ? getVerticalHotseatLastItemBottomOffset()
- : topOfHotseat);
- return mWorkspaceSpringLoadShrunkBottom;
+ return heightPx - (isVerticalBarLayout()
+ ? getVerticalHotseatLastItemBottomOffset(context) : topOfHotseat);
}
/**
* Gets the scale of the workspace for the spring-loaded edit state.
*/
- public float getWorkspaceSpringLoadScale() {
- float scale = (getCellLayoutSpringLoadShrunkBottom() - getCellLayoutSpringLoadShrunkTop())
- / getCellLayoutHeight();
+ public float getWorkspaceSpringLoadScale(Context context) {
+ float scale =
+ (getCellLayoutSpringLoadShrunkBottom(context) - getCellLayoutSpringLoadShrunkTop())
+ / getCellLayoutHeight();
scale = Math.min(scale, 1f);
- // Reduce scale if next pages would not be visible after scaling the workspace
+ // Reduce scale if next pages would not be visible after scaling the workspace.
int workspaceWidth = availableWidthPx;
float scaledWorkspaceWidth = workspaceWidth * scale;
float maxAvailableWidth = workspaceWidth - (2 * workspaceSpringLoadedMinNextPageVisiblePx);
@@ -1036,6 +1146,7 @@
* Returns the padding for hotseat view
*/
public Rect getHotseatLayoutPadding(Context context) {
+ Rect hotseatBarPadding = new Rect();
if (isVerticalBarLayout()) {
// The hotseat icons will be placed in the middle of the hotseat cells.
// Changing the hotseatCellHeightPx is not affecting hotseat icon positions
@@ -1049,10 +1160,10 @@
+ diffOverlapFactor), 0);
if (isSeascape()) {
- mHotseatBarPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
+ hotseatBarPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
hotseatBarSidePaddingEndPx, paddingBottom);
} else {
- mHotseatBarPadding.set(hotseatBarSidePaddingEndPx, paddingTop,
+ hotseatBarPadding.set(hotseatBarSidePaddingEndPx, paddingTop,
mInsets.right + hotseatBarSidePaddingStartPx, paddingBottom);
}
} else if (isTaskbarPresent) {
@@ -1062,33 +1173,30 @@
hotseatBarSizePx - hotseatBarBottomPadding - hotseatCellHeightPx;
// Push icons to the side
- int additionalQsbSpace = isQsbInline ? qsbWidth + hotseatBorderSpace : 0;
- int requiredWidth = iconSizePx * numShownHotseatIcons
- + hotseatBorderSpace * (numShownHotseatIcons - 1)
- + additionalQsbSpace;
+ int requiredWidth = getHotseatRequiredWidth();
int hotseatWidth = Math.min(requiredWidth, availableWidthPx - hotseatBarEndOffset);
int sideSpacing = (availableWidthPx - hotseatWidth) / 2;
- mHotseatBarPadding.set(sideSpacing, hotseatBarTopPadding, sideSpacing,
+ hotseatBarPadding.set(sideSpacing, hotseatBarTopPadding, sideSpacing,
hotseatBarBottomPadding);
boolean isRtl = Utilities.isRtl(context.getResources());
if (isRtl) {
- mHotseatBarPadding.right += additionalQsbSpace;
+ hotseatBarPadding.right += getAdditionalQsbSpace();
} else {
- mHotseatBarPadding.left += additionalQsbSpace;
+ hotseatBarPadding.left += getAdditionalQsbSpace();
}
if (hotseatBarEndOffset > sideSpacing) {
int diff = isRtl
? sideSpacing - hotseatBarEndOffset
: hotseatBarEndOffset - sideSpacing;
- mHotseatBarPadding.left -= diff;
- mHotseatBarPadding.right += diff;
+ hotseatBarPadding.left -= diff;
+ hotseatBarPadding.right += diff;
}
} else if (isScalableGrid) {
- int sideSpacing = (availableWidthPx - qsbWidth) / 2;
- mHotseatBarPadding.set(sideSpacing,
+ int sideSpacing = (availableWidthPx - hotseatQsbWidth) / 2;
+ hotseatBarPadding.set(sideSpacing,
0,
sideSpacing,
getHotseatBarBottomPadding());
@@ -1100,7 +1208,7 @@
float workspaceCellWidth = (float) widthPx / inv.numColumns;
float hotseatCellWidth = (float) widthPx / numShownHotseatIcons;
int hotseatAdjustment = Math.round((workspaceCellWidth - hotseatCellWidth) / 2);
- mHotseatBarPadding.set(
+ hotseatBarPadding.set(
hotseatAdjustment + workspacePadding.left + cellLayoutPaddingPx.left
+ mInsets.left,
0,
@@ -1108,7 +1216,21 @@
+ mInsets.right,
getHotseatBarBottomPadding());
}
- return mHotseatBarPadding;
+ return hotseatBarPadding;
+ }
+
+ private int getAdditionalQsbSpace() {
+ return isQsbInline ? hotseatQsbWidth + hotseatBorderSpace : 0;
+ }
+
+ /**
+ * Calculate how much space the hotseat needs to be shown completely
+ */
+ private int getHotseatRequiredWidth() {
+ int additionalQsbSpace = getAdditionalQsbSpace();
+ return iconSizePx * numShownHotseatIcons
+ + hotseatBorderSpace * (numShownHotseatIcons - 1)
+ + additionalQsbSpace;
}
/**
@@ -1164,6 +1286,19 @@
}
/**
+ * Takes the View and return the scales of width and height depending on the DeviceProfile
+ * specifications
+ *
+ * @param itemInfo The tag of the widget view
+ * @return A PointF instance with the x set to be the scale of width, and y being the scale of
+ * height
+ */
+ @NonNull
+ public PointF getAppWidgetScale(@Nullable final ItemInfo itemInfo) {
+ return mViewScaleProvider.getScaleFromItemInfo(itemInfo);
+ }
+
+ /**
* @return the bounds for which the open folders should be contained within
*/
public Rect getAbsoluteOpenFolderBounds() {
@@ -1246,8 +1381,12 @@
return "\t" + name + ": " + value + "px (" + dpiFromPx(value, mMetrics.densityDpi) + "dp)";
}
- // LINT.IfChange
- public void dump(String prefix, PrintWriter writer) {
+ private String dpPointFToString(String name, PointF value) {
+ return String.format(Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", name, value.x, value.y);
+ }
+
+ /** Dumps various DeviceProfile variables to the specified writer. */
+ public void dump(Context context, String prefix, PrintWriter writer) {
writer.println(prefix + "DeviceProfile:");
writer.println(prefix + "\t1 dp = " + mMetrics.density + " px");
@@ -1281,7 +1420,7 @@
writer.println(prefix + "\tinv.numSearchContainerColumns: "
+ inv.numSearchContainerColumns);
- writer.println(prefix + "\tminCellSize: " + inv.minCellSize[mTypeIndex] + "dp");
+ writer.println(prefix + dpPointFToString("minCellSize", inv.minCellSize[mTypeIndex]));
writer.println(prefix + pxToDpStr("cellWidthPx", cellWidthPx));
writer.println(prefix + pxToDpStr("cellHeightPx", cellHeightPx));
@@ -1293,9 +1432,12 @@
cellLayoutBorderSpacePx.x));
writer.println(prefix + pxToDpStr("cellLayoutBorderSpacePx Vertical",
cellLayoutBorderSpacePx.y));
- writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left));
- writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top));
- writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right));
+ writer.println(
+ prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left));
+ writer.println(
+ prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top));
+ writer.println(
+ prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right));
writer.println(
prefix + pxToDpStr("cellLayoutPaddingPx.bottom", cellLayoutPaddingPx.bottom));
@@ -1309,17 +1451,24 @@
writer.println(prefix + pxToDpStr("folderChildTextSizePx", folderChildTextSizePx));
writer.println(prefix + pxToDpStr("folderChildDrawablePaddingPx",
folderChildDrawablePaddingPx));
- writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpaceOriginalPx",
- folderCellLayoutBorderSpaceOriginalPx));
writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpacePx Horizontal",
folderCellLayoutBorderSpacePx.x));
writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpacePx Vertical",
folderCellLayoutBorderSpacePx.y));
+ writer.println(prefix + pxToDpStr("folderContentPaddingLeftRight",
+ folderContentPaddingLeftRight));
+ writer.println(prefix + pxToDpStr("folderTopPadding", folderContentPaddingTop));
writer.println(prefix + pxToDpStr("bottomSheetTopPadding", bottomSheetTopPadding));
+ writer.println(prefix + "\tbottomSheetOpenDuration: " + bottomSheetOpenDuration);
+ writer.println(prefix + "\tbottomSheetCloseDuration: " + bottomSheetCloseDuration);
+ writer.println(prefix + "\tbottomSheetWorkspaceScale: " + bottomSheetWorkspaceScale);
+ writer.println(prefix + "\tbottomSheetDepth: " + bottomSheetDepth);
writer.println(prefix + pxToDpStr("allAppsShiftRange", allAppsShiftRange));
writer.println(prefix + pxToDpStr("allAppsTopPadding", allAppsTopPadding));
+ writer.println(prefix + "\tallAppsOpenDuration: " + allAppsOpenDuration);
+ writer.println(prefix + "\tallAppsCloseDuration: " + allAppsCloseDuration);
writer.println(prefix + pxToDpStr("allAppsIconSizePx", allAppsIconSizePx));
writer.println(prefix + pxToDpStr("allAppsIconTextSizePx", allAppsIconTextSizePx));
writer.println(prefix + pxToDpStr("allAppsIconDrawablePaddingPx",
@@ -1345,14 +1494,19 @@
writer.println(prefix + pxToDpStr("hotseatQsbHeight", hotseatQsbHeight));
writer.println(prefix + pxToDpStr("springLoadedHotseatBarTopMarginPx",
springLoadedHotseatBarTopMarginPx));
- writer.println(prefix + pxToDpStr("mHotseatBarPadding.top", mHotseatBarPadding.top));
- writer.println(prefix + pxToDpStr("mHotseatBarPadding.bottom", mHotseatBarPadding.bottom));
- writer.println(prefix + pxToDpStr("mHotseatBarPadding.left", mHotseatBarPadding.left));
- writer.println(prefix + pxToDpStr("mHotseatBarPadding.right", mHotseatBarPadding.right));
+ Rect hotseatLayoutPadding = getHotseatLayoutPadding(context);
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).top",
+ hotseatLayoutPadding.top));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).bottom",
+ hotseatLayoutPadding.bottom));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).left",
+ hotseatLayoutPadding.left));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).right",
+ hotseatLayoutPadding.right));
writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace));
writer.println(prefix + "\tisQsbInline: " + isQsbInline);
- writer.println(prefix + pxToDpStr("qsbWidth", qsbWidth));
+ writer.println(prefix + pxToDpStr("hotseatQsbWidth", hotseatQsbWidth));
writer.println(prefix + "\tisTaskbarPresent:" + isTaskbarPresent);
writer.println(prefix + "\tisTaskbarPresentInApps:" + isTaskbarPresentInApps);
@@ -1379,7 +1533,6 @@
writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding));
writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx));
- writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx));
writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx));
writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx",
overviewTaskIconDrawableSizePx));
@@ -1402,30 +1555,17 @@
writer.println(
prefix + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
- writer.println(
- prefix + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop));
- writer.println(prefix + pxToDpStr("workspaceSpringLoadShrunkBottom",
- mWorkspaceSpringLoadShrunkBottom));
+ writer.println(prefix + pxToDpStr("getCellLayoutSpringLoadShrunkTop()",
+ getCellLayoutSpringLoadShrunkTop()));
+ writer.println(prefix + pxToDpStr("getCellLayoutSpringLoadShrunkBottom()",
+ getCellLayoutSpringLoadShrunkBottom(context)));
writer.println(prefix + pxToDpStr("workspaceSpringLoadedMinNextPageVisiblePx",
workspaceSpringLoadedMinNextPageVisiblePx));
- writer.println(
- prefix + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale()));
+ writer.println(prefix + pxToDpStr("getWorkspaceSpringLoadScale()",
+ getWorkspaceSpringLoadScale(context)));
writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight()));
writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth()));
}
- // LINT.ThenChange(
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt)
private static Context getContext(Context c, Info info, int orientation, WindowBounds bounds) {
Configuration config = new Configuration(c.getResources().getConfiguration());
@@ -1478,6 +1618,22 @@
}
}
+ /**
+ * Handler that deals with ItemInfo of the views for the DeviceProfile
+ */
+ @FunctionalInterface
+ public interface ViewScaleProvider {
+ /**
+ * Get the scales from the view
+ *
+ * @param itemInfo The tag of the widget view
+ * @return PointF instance containing the scale information, or null if using the default
+ * app widget scale of this device profile.
+ */
+ @NonNull
+ PointF getScaleFromItemInfo(@Nullable ItemInfo itemInfo);
+ }
+
public static class Builder {
private Context mContext;
private InvariantDeviceProfile mInv;
@@ -1489,6 +1645,9 @@
private boolean mIsMultiWindowMode = false;
private Boolean mTransposeLayoutWithOrientation;
private Boolean mIsGestureMode;
+ private ViewScaleProvider mViewScaleProvider = null;
+
+ private SparseArray<DotRenderer> mDotRendererCache;
public Builder(Context context, InvariantDeviceProfile inv, Info info) {
mContext = context;
@@ -1506,6 +1665,10 @@
return this;
}
+ public Builder setDotRendererCache(SparseArray<DotRenderer> dotRendererCache) {
+ mDotRendererCache = dotRendererCache;
+ return this;
+ }
public Builder setWindowBounds(WindowBounds bounds) {
mWindowBounds = bounds;
@@ -1522,6 +1685,19 @@
return this;
}
+ /**
+ * Set the viewScaleProvider for the builder
+ *
+ * @param viewScaleProvider The viewScaleProvider to be set for the
+ * DeviceProfile
+ * @return This builder
+ */
+ @NonNull
+ public Builder setViewScaleProvider(@Nullable ViewScaleProvider viewScaleProvider) {
+ mViewScaleProvider = viewScaleProvider;
+ return this;
+ }
+
public DeviceProfile build() {
if (mWindowBounds == null) {
throw new IllegalArgumentException("Window bounds not set");
@@ -1530,10 +1706,17 @@
mTransposeLayoutWithOrientation = !mInfo.isTablet(mWindowBounds);
}
if (mIsGestureMode == null) {
- mIsGestureMode = DisplayController.getNavigationMode(mContext).hasGestures;
+ mIsGestureMode = mInfo.navigationMode.hasGestures;
}
- return new DeviceProfile(mContext, mInv, mInfo, mWindowBounds, mIsMultiWindowMode,
- mTransposeLayoutWithOrientation, mUseTwoPanels, mIsGestureMode);
+ if (mDotRendererCache == null) {
+ mDotRendererCache = new SparseArray<>();
+ }
+ if (mViewScaleProvider == null) {
+ mViewScaleProvider = DEFAULT_PROVIDER;
+ }
+ return new DeviceProfile(mContext, mInv, mInfo, mWindowBounds, mDotRendererCache,
+ mIsMultiWindowMode, mTransposeLayoutWithOrientation, mUseTwoPanels,
+ mIsGestureMode, mViewScaleProvider);
}
}
diff --git a/src/com/android/launcher3/DropTarget.java b/src/com/android/launcher3/DropTarget.java
index 70d8476..2d99510 100644
--- a/src/com/android/launcher3/DropTarget.java
+++ b/src/com/android/launcher3/DropTarget.java
@@ -20,7 +20,6 @@
import android.graphics.Rect;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.DraggableView;
@@ -82,11 +81,8 @@
public final InstanceId logInstanceId = new InstanceIdSequence().newInstanceId();
public DragObject(Context context) {
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- Executors.MODEL_EXECUTOR.post(() -> {
- folderNameProvider = FolderNameProvider.newInstance(context);
- });
- }
+ Executors.MODEL_EXECUTOR.post(() ->
+ folderNameProvider = FolderNameProvider.newInstance(context));
}
/**
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index c1304d4..98ecf3a 100644
--- a/src/com/android/launcher3/DropTargetBar.java
+++ b/src/com/android/launcher3/DropTargetBar.java
@@ -37,7 +37,7 @@
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;
+import com.android.launcher3.testing.shared.TestProtocol;
/*
* The top bar containing various drop targets: Delete/App Info/Uninstall.
@@ -151,6 +151,8 @@
int widthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST);
ButtonDropTarget firstButton = mTempTargets[0];
+ firstButton.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ mLauncher.getDeviceProfile().dropTargetTextSizePx);
firstButton.setTextVisible(true);
firstButton.setIconVisible(true);
firstButton.measure(widthSpec, heightSpec);
@@ -160,14 +162,16 @@
int horizontalPadding = dp.dropTargetHorizontalPaddingPx;
ButtonDropTarget firstButton = mTempTargets[0];
+ firstButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp.dropTargetTextSizePx);
firstButton.setTextVisible(true);
firstButton.setIconVisible(true);
firstButton.setTextMultiLine(false);
- // Reset second button padding in case it was previously changed to multi-line text.
+ // Reset first button padding in case it was previously changed to multi-line text.
firstButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
verticalPadding);
ButtonDropTarget secondButton = mTempTargets[1];
+ secondButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp.dropTargetTextSizePx);
secondButton.setTextVisible(true);
secondButton.setIconVisible(true);
secondButton.setTextMultiLine(false);
@@ -175,20 +179,14 @@
secondButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
verticalPadding);
- float scale = dp.getWorkspaceSpringLoadScale();
- int scaledPanelWidth = (int) (dp.getCellLayoutWidth() * scale);
-
int availableWidth;
if (dp.isTwoPanels) {
- // Both buttons for two panel fit to the width of one Cell Layout (less
- // half of the center gap between the buttons).
- int halfButtonGap = dp.dropTargetGapPx / 2;
- availableWidth = scaledPanelWidth - halfButtonGap / 2;
+ // Each button for two panel fits to half the width of the screen excluding the
+ // center gap between the buttons.
+ availableWidth = (dp.availableWidthPx - dp.dropTargetGapPx) / 2;
} else {
- // Both buttons plus the button gap do not display past the edge of the scaled
- // workspace, less a pre-defined gap from the edge of the workspace.
- availableWidth = scaledPanelWidth - dp.dropTargetGapPx
- - 2 * dp.dropTargetButtonWorkspaceEdgeGapPx;
+ // Both buttons plus the button gap do not display past the edge of the screen.
+ availableWidth = dp.availableWidthPx - dp.dropTargetGapPx;
}
int widthSpec = MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST);
@@ -219,6 +217,15 @@
horizontalPadding, verticalPadding / 2);
}
}
+
+ // If text is still truncated, shrink to fit in measured width and resize both targets.
+ float minTextSize =
+ Math.min(firstButton.resizeTextToFit(), secondButton.resizeTextToFit());
+ if (firstButton.getTextSize() != minTextSize
+ || secondButton.getTextSize() != minTextSize) {
+ firstButton.setTextSize(minTextSize);
+ secondButton.setTextSize(minTextSize);
+ }
}
setMeasuredDimension(width, height);
}
@@ -232,7 +239,7 @@
DeviceProfile dp = mLauncher.getDeviceProfile();
// Center vertical bar over scaled workspace, accounting for hotseat offset.
- float scale = dp.getWorkspaceSpringLoadScale();
+ float scale = dp.getWorkspaceSpringLoadScale(mLauncher);
Workspace<?> ws = mLauncher.getWorkspace();
int barCenter;
if (dp.isTwoPanels) {
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index 4629ca7..11f2020 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -15,7 +15,7 @@
*/
package com.android.launcher3;
-import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
+import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.SHOW;
import android.content.Context;
import android.text.TextUtils;
@@ -33,8 +33,6 @@
* Note: AppCompatEditText doesn't fully support #displayCompletions and #onCommitCompletion
*/
public class ExtendedEditText extends EditText {
-
- private boolean mShowImeAfterFirstLayout;
private boolean mForceDisableSuggestions = false;
/**
@@ -85,28 +83,21 @@
return false;
}
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- super.onLayout(changed, left, top, right, bottom);
- if (mShowImeAfterFirstLayout) {
- // soft input only shows one frame after the layout of the EditText happens,
- post(() -> {
- showSoftInput();
- mShowImeAfterFirstLayout = false;
- });
- }
- }
-
-
public void showKeyboard() {
- mShowImeAfterFirstLayout = !showSoftInput();
+ onKeyboardShown();
+ showSoftInput();
}
public void hideKeyboard() {
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getWindowToken());
+ ActivityContext.lookupContext(getContext()).hideKeyboard();
clearFocus();
}
+ protected void onKeyboardShown() {
+ ActivityContext.lookupContext(getContext()).getStatsLogManager()
+ .keyboardStateManager().setKeyboardState(SHOW);
+ }
+
private boolean showSoftInput() {
return requestFocus() &&
getContext().getSystemService(InputMethodManager.class)
diff --git a/src/com/android/launcher3/FastScrollRecyclerView.java b/src/com/android/launcher3/FastScrollRecyclerView.java
index 94903f2..2f927d3 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/FastScrollRecyclerView.java
@@ -24,7 +24,6 @@
import android.view.accessibility.AccessibilityNodeInfo;
import androidx.annotation.Nullable;
-import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.compat.AccessibilityManagerCompat;
@@ -57,7 +56,9 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- bindFastScrollbar();
+ if (mScrollbar == null || !mScrollbar.hasRecyclerView()) {
+ bindFastScrollbar();
+ }
}
public void bindFastScrollbar() {
@@ -90,8 +91,7 @@
protected int getAvailableScrollHeight() {
// AvailableScrollHeight = Total height of the all items - first page height
int firstPageHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
- int totalHeightOfAllItems = getItemsHeight(/* untilIndex= */ getAdapter().getItemCount());
- int availableScrollHeight = totalHeightOfAllItems - firstPageHeight;
+ int availableScrollHeight = computeVerticalScrollRange() - firstPageHeight;
return Math.max(0, availableScrollHeight);
}
@@ -144,10 +144,7 @@
// IF scroller is at the very top OR there is no scroll bar because there is probably not
// enough items to scroll, THEN it's okay for the container to be pulled down.
- if (getCurrentScrollY() == 0) {
- return true;
- }
- return getAdapter() == null || getAdapter().getItemCount() == 0;
+ return computeVerticalScrollOffset() == 0;
}
/**
@@ -158,53 +155,6 @@
}
/**
- * @return the scroll top of this recycler view.
- */
- public int getCurrentScrollY() {
- Adapter adapter = getAdapter();
- if (adapter == null) {
- return -1;
- }
- if (adapter.getItemCount() == 0 || getChildCount() == 0) {
- return -1;
- }
-
- int itemPosition = NO_POSITION;
- View child = null;
-
- LayoutManager layoutManager = getLayoutManager();
- if (layoutManager instanceof LinearLayoutManager) {
- // Use the LayoutManager as the source of truth for visible positions. During
- // animations, the view group child may not correspond to the visible views that appear
- // at the top.
- itemPosition = ((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition();
- child = layoutManager.findViewByPosition(itemPosition);
- }
-
- if (child == null) {
- // If the layout manager returns null for any reason, which can happen before layout
- // has occurred for the position, then look at the child of this view as a ViewGroup.
- child = getChildAt(0);
- itemPosition = getChildAdapterPosition(child);
- }
- if (itemPosition == NO_POSITION) {
- return -1;
- }
- return getPaddingTop() + getItemsHeight(itemPosition)
- - layoutManager.getDecoratedTop(child);
- }
-
- /**
- * Returns the sum of the height, in pixels, of this list adapter's items from index
- * 0 (inclusive) until {@code untilIndex} (exclusive). If untilIndex is same as the itemCount,
- * it returns the full height of all the items.
- *
- * <p>If the untilIndex is larger than the total number of items in this adapter, returns the
- * sum of all items' height.
- */
- protected abstract int getItemsHeight(int untilIndex);
-
- /**
* Maps the touch (from 0..1) to the adapter position that should be visible.
* <p>Override in each subclass of this base class.
*/
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 05ed319..bf492a9 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -47,7 +47,6 @@
private Consumer<Boolean> mOnVisibilityAggregatedCallback;
private final View mQsb;
- private final int mQsbHeight;
public Hotseat(Context context) {
this(context, null);
@@ -62,8 +61,6 @@
mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
addView(mQsb);
-
- mQsbHeight = getResources().getDimensionPixelSize(R.dimen.qsb_widget_height);
}
/**
@@ -171,29 +168,29 @@
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int qsbWidth = mActivity.getDeviceProfile().qsbWidth;
-
- mQsb.measure(MeasureSpec.makeMeasureSpec(qsbWidth, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(mQsbHeight, MeasureSpec.EXACTLY));
+ DeviceProfile dp = mActivity.getDeviceProfile();
+ mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY));
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
- int qsbWidth = mQsb.getMeasuredWidth();
+ int qsbMeasuredWidth = mQsb.getMeasuredWidth();
int left;
- if (mActivity.getDeviceProfile().isQsbInline) {
- int qsbSpace = mActivity.getDeviceProfile().hotseatBorderSpace;
+ DeviceProfile dp = mActivity.getDeviceProfile();
+ if (dp.isQsbInline) {
+ int qsbSpace = dp.hotseatBorderSpace;
left = Utilities.isRtl(getResources()) ? r - getPaddingRight() + qsbSpace
- : l + getPaddingLeft() - qsbWidth - qsbSpace;
+ : l + getPaddingLeft() - qsbMeasuredWidth - qsbSpace;
} else {
- left = (r - l - qsbWidth) / 2;
+ left = (r - l - qsbMeasuredWidth) / 2;
}
- int right = left + qsbWidth;
+ int right = left + qsbMeasuredWidth;
- int bottom = b - t - mActivity.getDeviceProfile().getQsbOffsetY();
- int top = bottom - mQsbHeight;
+ int bottom = b - t - dp.getQsbOffsetY();
+ int top = bottom - dp.hotseatQsbHeight;
mQsb.layout(left, top, right, bottom);
}
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index c051292..6a262c3 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -48,8 +48,10 @@
import androidx.annotation.VisibleForTesting;
import androidx.core.content.res.ResourcesCompat;
+import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.provider.RestoreDbTask;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.IntArray;
@@ -125,10 +127,12 @@
public PointF[] minCellSize;
public PointF[] borderSpaces;
- public float folderBorderSpace;
- public float[] hotseatBorderSpaces;
public int inlineNavButtonsEndSpacing;
+ public PointF folderBorderSpaces;
+ public PointF folderCellSize;
+ public float folderTopPadding;
+
public float[] horizontalMargin;
public PointF[] allAppsCellSize;
@@ -144,11 +148,6 @@
public int numShownHotseatIcons;
/**
- * Number of icons inside the hotseat area when using 3 buttons navigation.
- */
- public int numShrunkenHotseatIcons;
-
- /**
* Number of icons inside the hotseat area that is stored in the database. This is greater than
* or equal to numnShownHotseatIcons, allowing for a seamless transition between two hotseat
* sizes that share the same DB.
@@ -174,7 +173,7 @@
public String dbFile;
public int defaultLayoutId;
int demoModeLayoutId;
- boolean[] inlineQsb = new boolean[COUNT_SIZES];
+ public boolean[] inlineQsb = new boolean[COUNT_SIZES];
/**
* An immutable list of supported profiles.
@@ -259,8 +258,6 @@
COUNT_SIZES);
System.arraycopy(defaultDisplayOption.borderSpaces, 0, result.borderSpaces, 0,
COUNT_SIZES);
- System.arraycopy(defaultDisplayOption.inlineQsb, 0, result.inlineQsb, 0,
- COUNT_SIZES);
initGrid(context, myInfo, result, deviceType);
}
@@ -357,16 +354,17 @@
minCellSize = displayOption.minCellSize;
borderSpaces = displayOption.borderSpaces;
- folderBorderSpace = displayOption.folderBorderSpace;
+
+ folderBorderSpaces = displayOption.folderBorderSpaces;
+ folderCellSize = displayOption.folderCellSize;
+ folderTopPadding = displayOption.folderTopPadding;
horizontalMargin = displayOption.horizontalMargin;
numShownHotseatIcons = closestProfile.numHotseatIcons;
- numShrunkenHotseatIcons = closestProfile.numShrunkenHotseatIcons;
numDatabaseHotseatIcons = deviceType == TYPE_MULTI_DISPLAY
? closestProfile.numDatabaseHotseatIcons : closestProfile.numHotseatIcons;
hotseatColumnSpan = closestProfile.hotseatColumnSpan;
- hotseatBorderSpaces = displayOption.hotseatBorderSpaces;
hotseatBarBottomSpace = displayOption.hotseatBarBottomSpace;
hotseatQsbSpace = displayOption.hotseatQsbSpace;
@@ -387,7 +385,7 @@
devicePaddings = new DevicePaddings(context, devicePaddingId);
}
- inlineQsb = displayOption.inlineQsb;
+ inlineQsb = closestProfile.inlineQsb;
// If the partner customization apk contains any grid overrides, apply them
// Supported overrides: numRows, numColumns, iconSize
@@ -395,10 +393,12 @@
final List<DeviceProfile> localSupportedProfiles = new ArrayList<>();
defaultWallpaperSize = new Point(displayInfo.currentSize);
+ SparseArray<DotRenderer> dotRendererCache = new SparseArray<>();
for (WindowBounds bounds : displayInfo.supportedBounds) {
localSupportedProfiles.add(new DeviceProfile.Builder(context, this, displayInfo)
.setUseTwoPanels(deviceType == TYPE_MULTI_DISPLAY)
.setWindowBounds(bounds)
+ .setDotRendererCache(dotRendererCache)
.build());
// Wallpaper size should be the maximum of the all possible sizes Launcher expects
@@ -721,6 +721,12 @@
private static final int DEVICE_CATEGORY_ALL =
DEVICE_CATEGORY_PHONE | DEVICE_CATEGORY_TABLET | DEVICE_CATEGORY_MULTI_DISPLAY;
+ private static final int INLINE_QSB_FOR_PORTRAIT = 1 << 0;
+ private static final int INLINE_QSB_FOR_LANDSCAPE = 1 << 1;
+ private static final int INLINE_QSB_FOR_TWO_PANEL_PORTRAIT = 1 << 2;
+ private static final int INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE = 1 << 3;
+ private static final int DONT_INLINE_QSB = 0;
+
public final String name;
public final int numRows;
public final int numColumns;
@@ -733,11 +739,12 @@
private final int numAllAppsColumns;
private final int numDatabaseAllAppsColumns;
private final int numHotseatIcons;
- private final int numShrunkenHotseatIcons;
private final int numDatabaseHotseatIcons;
private final int[] hotseatColumnSpan = new int[COUNT_SIZES];
+ private final boolean[] inlineQsb = new boolean[COUNT_SIZES];
+
private int inlineNavButtonsEndSpacing;
private final String dbFile;
@@ -773,8 +780,6 @@
numHotseatIcons = a.getInt(
R.styleable.GridDisplayOption_numHotseatIcons, numColumns);
- numShrunkenHotseatIcons = a.getInt(
- R.styleable.GridDisplayOption_numShrunkenHotseatIcons, numHotseatIcons / 2);
numDatabaseHotseatIcons = a.getInt(
R.styleable.GridDisplayOption_numExtendedHotseatIcons, 2 * numHotseatIcons);
@@ -812,6 +817,19 @@
&& ((deviceCategory & DEVICE_CATEGORY_MULTI_DISPLAY)
== DEVICE_CATEGORY_MULTI_DISPLAY));
+ int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb,
+ DONT_INLINE_QSB);
+ inlineQsb[INDEX_DEFAULT] =
+ (inlineForRotation & INLINE_QSB_FOR_PORTRAIT) == INLINE_QSB_FOR_PORTRAIT;
+ inlineQsb[INDEX_LANDSCAPE] =
+ (inlineForRotation & INLINE_QSB_FOR_LANDSCAPE) == INLINE_QSB_FOR_LANDSCAPE;
+ inlineQsb[INDEX_TWO_PANEL_PORTRAIT] =
+ (inlineForRotation & INLINE_QSB_FOR_TWO_PANEL_PORTRAIT)
+ == INLINE_QSB_FOR_TWO_PANEL_PORTRAIT;
+ inlineQsb[INDEX_TWO_PANEL_LANDSCAPE] =
+ (inlineForRotation & INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE)
+ == INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE;
+
a.recycle();
extraAttrs = Themes.createValueMap(context, attrs,
IntArray.wrap(R.styleable.GridDisplayOption));
@@ -820,26 +838,20 @@
@VisibleForTesting
static final class DisplayOption {
- private static final int INLINE_QSB_FOR_PORTRAIT = 1 << 0;
- private static final int INLINE_QSB_FOR_LANDSCAPE = 1 << 1;
- private static final int INLINE_QSB_FOR_TWO_PANEL_PORTRAIT = 1 << 2;
- private static final int INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE = 1 << 3;
- private static final int DONT_INLINE_QSB = 0;
-
public final GridOption grid;
private final float minWidthDps;
private final float minHeightDps;
private final boolean canBeDefault;
- private final boolean[] inlineQsb = new boolean[COUNT_SIZES];
private final PointF[] minCellSize = new PointF[COUNT_SIZES];
- private float folderBorderSpace;
+ private final PointF folderCellSize;
+ private final PointF folderBorderSpaces;
+ private float folderTopPadding;
+
private final PointF[] borderSpaces = new PointF[COUNT_SIZES];
private final float[] horizontalMargin = new float[COUNT_SIZES];
- //TODO(http://b/228998082) remove this when 3 button spaces are fixed
- private final float[] hotseatBorderSpaces = new float[COUNT_SIZES];
private final float[] hotseatBarBottomSpace = new float[COUNT_SIZES];
private final float[] hotseatQsbSpace = new float[COUNT_SIZES];
@@ -861,19 +873,6 @@
canBeDefault = a.getBoolean(R.styleable.ProfileDisplayOption_canBeDefault, false);
- int inlineForRotation = a.getInt(R.styleable.ProfileDisplayOption_inlineQsb,
- DONT_INLINE_QSB);
- inlineQsb[INDEX_DEFAULT] =
- (inlineForRotation & INLINE_QSB_FOR_PORTRAIT) == INLINE_QSB_FOR_PORTRAIT;
- inlineQsb[INDEX_LANDSCAPE] =
- (inlineForRotation & INLINE_QSB_FOR_LANDSCAPE) == INLINE_QSB_FOR_LANDSCAPE;
- inlineQsb[INDEX_TWO_PANEL_PORTRAIT] =
- (inlineForRotation & INLINE_QSB_FOR_TWO_PANEL_PORTRAIT)
- == INLINE_QSB_FOR_TWO_PANEL_PORTRAIT;
- inlineQsb[INDEX_TWO_PANEL_LANDSCAPE] =
- (inlineForRotation & INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE)
- == INLINE_QSB_FOR_TWO_PANEL_LANDSCAPE;
-
float x;
float y;
@@ -933,7 +932,20 @@
borderSpaceTwoPanelLandscape);
borderSpaces[INDEX_TWO_PANEL_LANDSCAPE] = new PointF(x, y);
- folderBorderSpace = borderSpace;
+ x = a.getFloat(R.styleable.ProfileDisplayOption_folderCellWidth,
+ minCellSize[INDEX_DEFAULT].x);
+ y = a.getFloat(R.styleable.ProfileDisplayOption_folderCellHeight,
+ minCellSize[INDEX_DEFAULT].y);
+ folderCellSize = new PointF(x, y);
+
+ float folderBorderSpace = a.getFloat(R.styleable.ProfileDisplayOption_folderBorderSpace,
+ borderSpace);
+
+ x = y = folderBorderSpace;
+ folderBorderSpaces = new PointF(x, y);
+
+ folderTopPadding = a.getFloat(R.styleable.ProfileDisplayOption_folderTopPadding,
+ folderBorderSpaces.y);
x = a.getFloat(R.styleable.ProfileDisplayOption_allAppsCellWidth,
minCellSize[INDEX_DEFAULT].x);
@@ -1013,7 +1025,9 @@
allAppsIconSizes[INDEX_DEFAULT] = a.getFloat(
R.styleable.ProfileDisplayOption_allAppsIconSize, iconSizes[INDEX_DEFAULT]);
- allAppsIconSizes[INDEX_LANDSCAPE] = allAppsIconSizes[INDEX_DEFAULT];
+ allAppsIconSizes[INDEX_LANDSCAPE] = a.getFloat(
+ R.styleable.ProfileDisplayOption_allAppsIconSizeLandscape,
+ iconSizes[INDEX_DEFAULT]);
allAppsIconSizes[INDEX_TWO_PANEL_PORTRAIT] = a.getFloat(
R.styleable.ProfileDisplayOption_allAppsIconSizeTwoPanelPortrait,
allAppsIconSizes[INDEX_DEFAULT]);
@@ -1055,18 +1069,6 @@
R.styleable.ProfileDisplayOption_horizontalMarginTwoPanelPortrait,
horizontalMargin[INDEX_DEFAULT]);
- hotseatBorderSpaces[INDEX_DEFAULT] = a.getFloat(
- R.styleable.ProfileDisplayOption_hotseatBorderSpace, borderSpace);
- hotseatBorderSpaces[INDEX_LANDSCAPE] = a.getFloat(
- R.styleable.ProfileDisplayOption_hotseatBorderSpaceLandscape,
- hotseatBorderSpaces[INDEX_DEFAULT]);
- hotseatBorderSpaces[INDEX_TWO_PANEL_LANDSCAPE] = a.getFloat(
- R.styleable.ProfileDisplayOption_hotseatBorderSpaceTwoPanelLandscape,
- hotseatBorderSpaces[INDEX_DEFAULT]);
- hotseatBorderSpaces[INDEX_TWO_PANEL_PORTRAIT] = a.getFloat(
- R.styleable.ProfileDisplayOption_hotseatBorderSpaceTwoPanelPortrait,
- hotseatBorderSpaces[INDEX_DEFAULT]);
-
hotseatBarBottomSpace[INDEX_DEFAULT] = a.getFloat(
R.styleable.ProfileDisplayOption_hotseatBarBottomSpace,
ResourcesCompat.getFloat(context.getResources(),
@@ -1116,8 +1118,10 @@
allAppsIconSizes[i] = 0;
allAppsIconTextSizes[i] = 0;
allAppsBorderSpaces[i] = new PointF();
- inlineQsb[i] = false;
}
+ folderBorderSpaces = new PointF();
+ folderCellSize = new PointF();
+ folderTopPadding = 0f;
}
private DisplayOption multiply(float w) {
@@ -1129,7 +1133,6 @@
minCellSize[i].x *= w;
minCellSize[i].y *= w;
horizontalMargin[i] *= w;
- hotseatBorderSpaces[i] *= w;
hotseatBarBottomSpace[i] *= w;
hotseatQsbSpace[i] *= w;
allAppsCellSize[i].x *= w;
@@ -1139,8 +1142,11 @@
allAppsBorderSpaces[i].x *= w;
allAppsBorderSpaces[i].y *= w;
}
-
- folderBorderSpace *= w;
+ folderBorderSpaces.x *= w;
+ folderBorderSpaces.y *= w;
+ folderCellSize.x *= w;
+ folderCellSize.y *= w;
+ folderTopPadding *= w;
return this;
}
@@ -1154,7 +1160,6 @@
minCellSize[i].x += p.minCellSize[i].x;
minCellSize[i].y += p.minCellSize[i].y;
horizontalMargin[i] += p.horizontalMargin[i];
- hotseatBorderSpaces[i] += p.hotseatBorderSpaces[i];
hotseatBarBottomSpace[i] += p.hotseatBarBottomSpace[i];
hotseatQsbSpace[i] += p.hotseatQsbSpace[i];
allAppsCellSize[i].x += p.allAppsCellSize[i].x;
@@ -1163,10 +1168,12 @@
allAppsIconTextSizes[i] += p.allAppsIconTextSizes[i];
allAppsBorderSpaces[i].x += p.allAppsBorderSpaces[i].x;
allAppsBorderSpaces[i].y += p.allAppsBorderSpaces[i].y;
- inlineQsb[i] |= p.inlineQsb[i];
}
-
- folderBorderSpace += p.folderBorderSpace;
+ folderBorderSpaces.x += p.folderBorderSpaces.x;
+ folderBorderSpaces.y += p.folderBorderSpaces.y;
+ folderCellSize.x += p.folderCellSize.x;
+ folderCellSize.y += p.folderCellSize.y;
+ folderTopPadding += p.folderTopPadding;
return this;
}
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 9c62251..17fb7eb 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -18,8 +18,6 @@
import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
-import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
-import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
import static android.content.pm.ActivityInfo.CONFIG_UI_MODE;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
@@ -44,6 +42,7 @@
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import static com.android.launcher3.logging.StatsLogManager.EventEnum;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
@@ -60,7 +59,6 @@
import static com.android.launcher3.popup.SystemShortcut.WIDGETS;
import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.ItemInfoMatcher.forFolderMatch;
import android.animation.Animator;
@@ -116,6 +114,7 @@
import android.view.animation.OvershootInterpolator;
import android.widget.ImageView;
import android.widget.Toast;
+import android.window.OnBackInvokedDispatcher;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
@@ -177,7 +176,7 @@
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.AllAppsSwipeController;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
@@ -197,8 +196,6 @@
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.util.TraceHelper;
-import com.android.launcher3.util.UiThreadHelper;
-import com.android.launcher3.util.ViewCapture;
import com.android.launcher3.util.ViewOnDrawExecutor;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.FloatingIconView;
@@ -311,8 +308,6 @@
private static final FloatProperty<Hotseat> HOTSEAT_WIDGET_SCALE =
HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION);
- private Configuration mOldConfig;
-
@Thunk
Workspace<?> mWorkspace;
@Thunk
@@ -398,7 +393,6 @@
private LauncherState mPrevLauncherState;
private StringCache mStringCache;
- private ViewCapture mViewCapture;
@Override
@TargetApi(Build.VERSION_CODES.S)
@@ -467,7 +461,6 @@
super.onCreate(savedInstanceState);
LauncherAppState app = LauncherAppState.getInstance(this);
- mOldConfig = new Configuration(getResources().getConfiguration());
mModel = app.getModel();
mRotationHelper = new RotationHelper(this);
@@ -513,7 +506,6 @@
if (!mModel.addCallbacksAndLoad(this)) {
if (!internalStateHandled) {
- Log.d(BAD_STATE, "Launcher onCreate not binding sync, prevent drawing");
// If we are not binding synchronously, pause drawing until initial bind complete,
// so that the system could continue to show the device loading prompt
mOnInitialBindListener = Boolean.FALSE::booleanValue;
@@ -552,6 +544,8 @@
getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
}
setTitle(R.string.home_screen);
+
+ registerOnBackInvokedCallback();
}
protected LauncherOverlayManager getDefaultOverlay() {
@@ -616,17 +610,6 @@
dispatchDeviceProfileChanged();
}
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- int diff = newConfig.diff(mOldConfig);
- if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) {
- onIdpChanged(false);
- }
-
- mOldConfig.setTo(newConfig);
- super.onConfigurationChanged(newConfig);
- }
-
/**
* Initializes the drag controller.
*/
@@ -636,7 +619,15 @@
@Override
public void onIdpChanged(boolean modelPropertiesChanged) {
- initDeviceProfile(mDeviceProfile.inv);
+ onHandleConfigurationChanged();
+ }
+
+ @Override
+ protected void onHandleConfigurationChanged() {
+ if (!initDeviceProfile(mDeviceProfile.inv)) {
+ return;
+ }
+
dispatchDeviceProfileChanged();
reapplyUi();
mDragLayer.recreateControllers();
@@ -659,9 +650,17 @@
mDragLayer.onOneHandedModeStateChanged(activated);
}
- protected void initDeviceProfile(InvariantDeviceProfile idp) {
+ /**
+ * Returns {@code true} if a new DeviceProfile is initialized, and {@code false} otherwise.
+ */
+ protected boolean initDeviceProfile(InvariantDeviceProfile idp) {
// Load configuration-specific DeviceProfile
- mDeviceProfile = idp.getDeviceProfile(this);
+ DeviceProfile deviceProfile = idp.getDeviceProfile(this);
+ if (mDeviceProfile == deviceProfile) {
+ return false;
+ }
+
+ mDeviceProfile = deviceProfile;
if (isInMultiWindowMode()) {
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(
this, getMultiWindowDisplaySize());
@@ -669,6 +668,7 @@
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);
+ return true;
}
public RotationHelper getRotationHelper() {
@@ -1126,6 +1126,7 @@
.log(getAllAppsEntryEvent().get());
}
}
+ updateDisallowBack();
}
/**
@@ -1489,14 +1490,6 @@
public void onAttachedToWindow() {
super.onAttachedToWindow();
mOverlayManager.onAttachedToWindow();
- if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
- View root = getDragLayer().getRootView();
- if (mViewCapture != null) {
- root.getViewTreeObserver().removeOnDrawListener(mViewCapture);
- }
- mViewCapture = new ViewCapture(root);
- root.getViewTreeObserver().addOnDrawListener(mViewCapture);
- }
}
@Override
@@ -1664,16 +1657,6 @@
}
}
- /**
- * Hides the keyboard if visible
- */
- public void hideKeyboard() {
- final View v = getWindow().peekDecorView();
- if (v != null && v.getWindowToken() != null) {
- UiThreadHelper.hideKeyboardAsync(this, v.getWindowToken());
- }
- }
-
@Override
public void onRestoreInstanceState(Bundle state) {
super.onRestoreInstanceState(state);
@@ -2082,6 +2065,17 @@
mStateManager.getState().onBackPressed(this);
}
+ private void registerOnBackInvokedCallback() {
+ if (Utilities.ATLEAST_T) {
+ getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
+ OnBackInvokedDispatcher.PRIORITY_DEFAULT,
+ () -> {
+ onBackPressed();
+ TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onBackInvoked");
+ });
+ }
+ }
+
protected void onScreenOff() {
// Reset AllApps to its initial state only if we are not in the middle of
// processing a multi-step drop
@@ -2800,7 +2794,7 @@
View v = getFirstMatch(Collections.singletonList(activeRecyclerView),
preferredItem, packageAndUserAndApp);
- if (v != null && activeRecyclerView.getCurrentScrollY() > 0) {
+ if (v != null && activeRecyclerView.computeVerticalScrollOffset() > 0) {
RectF locationBounds = new RectF();
FloatingIconView.getLocationBoundsForView(this, v, false, locationBounds,
new Rect());
@@ -3016,15 +3010,11 @@
writer.println(prefix + "\tmRotationHelper: " + mRotationHelper);
writer.println(prefix + "\tmAppWidgetHost.isListening: " + mAppWidgetHost.isListening());
- if (mViewCapture != null) {
- writer.println(prefix + "\tmViewCapture: " + mViewCapture.dumpToString());
- }
-
// Extra logging for general debugging
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
- mDeviceProfile.dump(prefix, writer);
+ mDeviceProfile.dump(this, prefix, writer);
try {
FileLog.flushAll(writer);
@@ -3148,7 +3138,18 @@
public void useFadeOutAnimationForLauncherStart(CancellationSignal signal) { }
- public void onDragLayerHierarchyChanged() { }
+ public void onDragLayerHierarchyChanged() {
+ updateDisallowBack();
+ }
+
+ private void updateDisallowBack() {
+ LauncherRootView rv = getRootView();
+ if (rv != null) {
+ boolean disableBack = getStateManager().getState() == NORMAL
+ && AbstractFloatingView.getTopOpenView(this) == null;
+ rv.setDisallowBackGesture(disableBack);
+ }
+ }
@Override
public void returnToHomescreen() {
@@ -3248,12 +3249,10 @@
* @param progress Transition progress from 0 to 1; where 0 => home and 1 => widgets.
*/
public void onWidgetsTransition(float progress) {
- if (mDeviceProfile.isTablet) {
- float scale =
- Utilities.comp(Utilities.comp(mDeviceProfile.workspaceContentScale) * progress);
- WORKSPACE_WIDGET_SCALE.set(getWorkspace(), scale);
- HOTSEAT_WIDGET_SCALE.set(getHotseat(), scale);
- }
+ float scale = Utilities.mapToRange(progress, 0f, 1f, 1f,
+ mDeviceProfile.bottomSheetWorkspaceScale, EMPHASIZED);
+ WORKSPACE_WIDGET_SCALE.set(getWorkspace(), scale);
+ HOTSEAT_WIDGET_SCALE.set(getHotseat(), scale);
}
private static class NonConfigInstance {
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 597bc8d..ea3f723 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -19,7 +19,6 @@
import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURCE_UPDATED;
import static com.android.launcher3.Utilities.getDevicePrefs;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_THEMED_ICONS;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI;
@@ -118,12 +117,10 @@
observer, MODEL_EXECUTOR.getHandler());
mOnTerminateCallback.add(iconChangeTracker::close);
MODEL_EXECUTOR.execute(observer::verifyIconChanged);
- if (ENABLE_THEMED_ICONS.get()) {
- SharedPreferences prefs = Utilities.getPrefs(mContext);
- prefs.registerOnSharedPreferenceChangeListener(observer);
- mOnTerminateCallback.add(
- () -> prefs.unregisterOnSharedPreferenceChangeListener(observer));
- }
+ SharedPreferences prefs = Utilities.getPrefs(mContext);
+ prefs.registerOnSharedPreferenceChangeListener(observer);
+ mOnTerminateCallback.add(
+ () -> prefs.unregisterOnSharedPreferenceChangeListener(observer));
InstallSessionTracker installSessionTracker =
InstallSessionHelper.INSTANCE.get(context).registerInstallTracker(mModel);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index de0d300..20df897 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -33,6 +33,7 @@
import android.util.Log;
import android.util.Pair;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
@@ -63,7 +64,7 @@
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageUserKey;
@@ -89,9 +90,11 @@
static final String TAG = "Launcher.Model";
+ @NonNull
private final LauncherAppState mApp;
+ @NonNull
private final Object mLock = new Object();
-
+ @Nullable
private LoaderTask mLoaderTask;
private boolean mIsLoaderTaskRunning;
@@ -107,20 +110,25 @@
}
}
+ @NonNull
private final ArrayList<Callbacks> mCallbacksList = new ArrayList<>(1);
// < only access in worker thread >
+ @NonNull
private final AllAppsList mBgAllAppsList;
/**
* All the static data should be accessed on the background thread, A lock should be acquired
* on this object when accessing any data from this model.
*/
+ @NonNull
private final BgDataModel mBgDataModel = new BgDataModel();
+ @NonNull
private final ModelDelegate mModelDelegate;
// Runnable to check if the shortcuts permission has changed.
+ @NonNull
private final Runnable mDataValidationCheck = new Runnable() {
@Override
public void run() {
@@ -130,14 +138,16 @@
}
};
- LauncherModel(Context context, LauncherAppState app, IconCache iconCache, AppFilter appFilter,
- boolean isPrimaryInstance) {
+ LauncherModel(@NonNull final Context context, @NonNull final LauncherAppState app,
+ @NonNull final IconCache iconCache, @NonNull final AppFilter appFilter,
+ final boolean isPrimaryInstance) {
mApp = app;
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
mModelDelegate = ModelDelegate.newInstance(context, app, mBgAllAppsList, mBgDataModel,
isPrimaryInstance);
}
+ @NonNull
public ModelDelegate getModelDelegate() {
return mModelDelegate;
}
@@ -145,52 +155,57 @@
/**
* Adds the provided items to the workspace.
*/
- public void addAndBindAddedWorkspaceItems(List<Pair<ItemInfo, Object>> itemList) {
+ public void addAndBindAddedWorkspaceItems(
+ @NonNull final List<Pair<ItemInfo, Object>> itemList) {
for (Callbacks cb : getCallbacks()) {
cb.preAddApps();
}
enqueueModelUpdateTask(new AddWorkspaceItemsTask(itemList));
}
- public ModelWriter getWriter(boolean hasVerticalHotseat, boolean verifyChanges,
- @Nullable Callbacks owner) {
+ @NonNull
+ public ModelWriter getWriter(final boolean hasVerticalHotseat, final boolean verifyChanges,
+ @Nullable final Callbacks owner) {
return new ModelWriter(mApp.getContext(), this, mBgDataModel,
hasVerticalHotseat, verifyChanges, owner);
}
@Override
- public void onPackageChanged(String packageName, UserHandle user) {
+ public void onPackageChanged(
+ @NonNull final String packageName, @NonNull final UserHandle user) {
int op = PackageUpdatedTask.OP_UPDATE;
enqueueModelUpdateTask(new PackageUpdatedTask(op, user, packageName));
}
@Override
- public void onPackageRemoved(String packageName, UserHandle user) {
+ public void onPackageRemoved(
+ @NonNull final String packageName, @NonNull final UserHandle user) {
onPackagesRemoved(user, packageName);
}
- public void onPackagesRemoved(UserHandle user, String... packages) {
+ public void onPackagesRemoved(
+ @NonNull final UserHandle user, @NonNull final String... packages) {
int op = PackageUpdatedTask.OP_REMOVE;
FileLog.d(TAG, "package removed received " + TextUtils.join(",", packages));
enqueueModelUpdateTask(new PackageUpdatedTask(op, user, packages));
}
@Override
- public void onPackageAdded(String packageName, UserHandle user) {
+ public void onPackageAdded(@NonNull final String packageName, @NonNull final UserHandle user) {
int op = PackageUpdatedTask.OP_ADD;
enqueueModelUpdateTask(new PackageUpdatedTask(op, user, packageName));
}
@Override
- public void onPackagesAvailable(String[] packageNames, UserHandle user,
- boolean replacing) {
+ public void onPackagesAvailable(@NonNull final String[] packageNames,
+ @NonNull final UserHandle user, final boolean replacing) {
enqueueModelUpdateTask(
new PackageUpdatedTask(PackageUpdatedTask.OP_UPDATE, user, packageNames));
}
@Override
- public void onPackagesUnavailable(String[] packageNames, UserHandle user,
- boolean replacing) {
+ public void onPackagesUnavailable(@NonNull final String[] packageNames,
+ @NonNull final UserHandle user, final boolean replacing) {
if (!replacing) {
enqueueModelUpdateTask(new PackageUpdatedTask(
PackageUpdatedTask.OP_UNAVAILABLE, user, packageNames));
@@ -198,20 +213,22 @@
}
@Override
- public void onPackagesSuspended(String[] packageNames, UserHandle user) {
+ public void onPackagesSuspended(
+ @NonNull final String[] packageNames, @NonNull final UserHandle user) {
enqueueModelUpdateTask(new PackageUpdatedTask(
PackageUpdatedTask.OP_SUSPEND, user, packageNames));
}
@Override
- public void onPackagesUnsuspended(String[] packageNames, UserHandle user) {
+ public void onPackagesUnsuspended(
+ @NonNull final String[] packageNames, @NonNull final UserHandle user) {
enqueueModelUpdateTask(new PackageUpdatedTask(
PackageUpdatedTask.OP_UNSUSPEND, user, packageNames));
}
@Override
- public void onPackageLoadingProgressChanged(
- String packageName, UserHandle user, float progress) {
+ public void onPackageLoadingProgressChanged(@NonNull final String packageName,
+ @NonNull final UserHandle user, final float progress) {
if (Utilities.ATLEAST_S) {
enqueueModelUpdateTask(new PackageIncrementalDownloadUpdatedTask(
packageName, user, progress));
@@ -219,8 +236,8 @@
}
@Override
- public void onShortcutsChanged(String packageName, List<ShortcutInfo> shortcuts,
- UserHandle user) {
+ public void onShortcutsChanged(@NonNull final String packageName,
+ @NonNull final List<ShortcutInfo> shortcuts, @NonNull final UserHandle user) {
enqueueModelUpdateTask(new ShortcutsChangedTask(packageName, shortcuts, user, true));
}
@@ -228,7 +245,8 @@
* Called when the icon for an app changes, outside of package event
*/
@WorkerThread
- public void onAppIconChanged(String packageName, UserHandle user) {
+ public void onAppIconChanged(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
// Update the icon for the calendar package
Context context = mApp.getContext();
onPackageChanged(packageName, user);
@@ -256,7 +274,7 @@
MODEL_EXECUTOR.execute(mModelDelegate::destroy);
}
- public void onBroadcastIntent(Intent intent) {
+ public void onBroadcastIntent(@NonNull final Intent intent) {
if (DEBUG_RECEIVER) Log.d(TAG, "onReceive intent=" + intent);
final String action = intent.getAction();
if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
@@ -322,7 +340,7 @@
/**
* Removes an existing callback
*/
- public void removeCallbacks(Callbacks callbacks) {
+ public void removeCallbacks(@NonNull final Callbacks callbacks) {
synchronized (mCallbacksList) {
Preconditions.assertUIThread();
if (mCallbacksList.remove(callbacks)) {
@@ -338,7 +356,7 @@
* Adds a callbacks to receive model updates
* @return true if workspace load was performed synchronously
*/
- public boolean addCallbacksAndLoad(Callbacks callbacks) {
+ public boolean addCallbacksAndLoad(@NonNull final Callbacks callbacks) {
synchronized (mLock) {
addCallbacks(callbacks);
return startLoader(new Callbacks[] { callbacks });
@@ -349,7 +367,7 @@
/**
* Adds a callbacks to receive model updates
*/
- public void addCallbacks(Callbacks callbacks) {
+ public void addCallbacks(@NonNull final Callbacks callbacks) {
Preconditions.assertUIThread();
synchronized (mCallbacksList) {
if (TestProtocol.sDebugTracing) {
@@ -370,7 +388,7 @@
return startLoader(new Callbacks[0]);
}
- private boolean startLoader(Callbacks[] newCallbacks) {
+ private boolean startLoader(@NonNull final Callbacks[] newCallbacks) {
// Enable queue before starting loader. It will get disabled in Launcher#finishBindingItems
ItemInstallQueue.INSTANCE.get(mApp.getContext())
.pauseModelPush(ItemInstallQueue.FLAG_LOADER_RUNNING);
@@ -433,7 +451,7 @@
* Loads the model if not loaded
* @param callback called with the data model upon successful load or null on model thread.
*/
- public void loadAsync(Consumer<BgDataModel> callback) {
+ public void loadAsync(@NonNull final Consumer<BgDataModel> callback) {
synchronized (mLock) {
if (!mModelLoaded && !mIsLoaderTaskRunning) {
startLoader();
@@ -443,11 +461,12 @@
}
@Override
- public void onInstallSessionCreated(final PackageInstallInfo sessionInfo) {
+ public void onInstallSessionCreated(@NonNull final PackageInstallInfo sessionInfo) {
if (FeatureFlags.PROMISE_APPS_IN_ALL_APPS.get()) {
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
apps.addPromiseApp(app.getContext(), sessionInfo);
bindApplicationsIfNeeded();
}
@@ -456,13 +475,12 @@
}
@Override
- public void onSessionFailure(String packageName, UserHandle user) {
- if (!FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()) {
- return;
- }
+ public void onSessionFailure(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
final IntSet removedIds = new IntSet();
synchronized (dataModel) {
for (ItemInfo info : dataModel.itemsIdMap) {
@@ -486,7 +504,7 @@
}
@Override
- public void onPackageStateChanged(PackageInstallInfo installInfo) {
+ public void onPackageStateChanged(@NonNull final PackageInstallInfo installInfo) {
enqueueModelUpdateTask(new PackageInstallStateChangedTask(installInfo));
}
@@ -494,7 +512,8 @@
* Updates the icons and label of all pending icons for the provided package name.
*/
@Override
- public void onUpdateSessionDisplay(PackageUserKey key, PackageInstaller.SessionInfo info) {
+ public void onUpdateSessionDisplay(@NonNull final PackageUserKey key,
+ @NonNull final PackageInstaller.SessionInfo info) {
mApp.getIconCache().updateSessionCache(key, info);
HashSet<String> packages = new HashSet<>();
@@ -505,9 +524,10 @@
public class LoaderTransaction implements AutoCloseable {
+ @NonNull
private final LoaderTask mTask;
- private LoaderTransaction(LoaderTask task) throws CancellationException {
+ private LoaderTransaction(@NonNull final LoaderTask task) throws CancellationException {
synchronized (mLock) {
if (mLoaderTask != task) {
throw new CancellationException("Loader already stopped");
@@ -537,7 +557,8 @@
}
}
- public LoaderTransaction beginLoader(LoaderTask task) throws CancellationException {
+ public LoaderTransaction beginLoader(@NonNull final LoaderTask task)
+ throws CancellationException {
return new LoaderTransaction(task);
}
@@ -554,7 +575,8 @@
/**
* Called when the icons for packages have been updated in the icon cache.
*/
- public void onPackageIconsUpdated(HashSet<String> updatedPackages, UserHandle user) {
+ public void onPackageIconsUpdated(@NonNull final HashSet<String> updatedPackages,
+ @NonNull final UserHandle user) {
// If any package icon has changed (app was updated while launcher was dead),
// update the corresponding shortcuts.
enqueueModelUpdateTask(new CacheDataUpdatedTask(
@@ -564,17 +586,19 @@
/**
* Called when the labels for the widgets has updated in the icon cache.
*/
- public void onWidgetLabelsUpdated(HashSet<String> updatedPackages, UserHandle user) {
+ public void onWidgetLabelsUpdated(@NonNull final HashSet<String> updatedPackages,
+ @NonNull final UserHandle user) {
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
dataModel.widgetsModel.onPackageIconsUpdated(updatedPackages, user, app);
bindUpdatedWidgets(dataModel);
}
});
}
- public void enqueueModelUpdateTask(ModelUpdateTask task) {
+ public void enqueueModelUpdateTask(@NonNull final ModelUpdateTask task) {
if (mModelDestroyed) {
return;
}
@@ -588,7 +612,7 @@
*/
public interface CallbackTask {
- void execute(Callbacks callbacks);
+ void execute(@NonNull Callbacks callbacks);
}
/**
@@ -599,12 +623,14 @@
/**
* Called before the task is posted to initialize the internal state.
*/
- void init(LauncherAppState app, LauncherModel model,
- BgDataModel dataModel, AllAppsList allAppsList, Executor uiExecutor);
+ void init(@NonNull LauncherAppState app, @NonNull LauncherModel model,
+ @NonNull BgDataModel dataModel, @NonNull AllAppsList allAppsList,
+ @NonNull Executor uiExecutor);
}
- public void updateAndBindWorkspaceItem(WorkspaceItemInfo si, ShortcutInfo info) {
+ public void updateAndBindWorkspaceItem(@NonNull final WorkspaceItemInfo si,
+ @NonNull final ShortcutInfo info) {
updateAndBindWorkspaceItem(() -> {
si.updateFromDeepShortcutInfo(info, mApp.getContext());
mApp.getIconCache().getShortcutIcon(si, info);
@@ -615,10 +641,12 @@
/**
* Utility method to update a shortcut on the background thread.
*/
- public void updateAndBindWorkspaceItem(final Supplier<WorkspaceItemInfo> itemProvider) {
+ public void updateAndBindWorkspaceItem(
+ @NonNull final Supplier<WorkspaceItemInfo> itemProvider) {
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
WorkspaceItemInfo info = itemProvider.get();
getModelWriter().updateItemInDatabase(info);
ArrayList<WorkspaceItemInfo> update = new ArrayList<>();
@@ -631,14 +659,16 @@
public void refreshAndBindWidgetsAndShortcuts(@Nullable final PackageUserKey packageUser) {
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
dataModel.widgetsModel.update(app, packageUser);
bindUpdatedWidgets(dataModel);
}
});
}
- public void dumpState(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
+ public void dumpState(@Nullable final String prefix, @Nullable final FileDescriptor fd,
+ @NonNull final PrintWriter writer, @NonNull final String[] args) {
if (args.length > 0 && TextUtils.equals(args[0], "--all")) {
writer.println(prefix + "All apps list: size=" + mBgAllAppsList.data.size());
for (AppInfo info : mBgAllAppsList.data) {
@@ -664,6 +694,7 @@
/**
* Returns an array of currently attached callbacks
*/
+ @NonNull
public Callbacks[] getCallbacks() {
synchronized (mCallbacksList) {
return mCallbacksList.toArray(new Callbacks[mCallbacksList.size()]);
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index a5c5c02..1592154 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -55,6 +55,8 @@
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
+ mActivity.handleConfigurationChanged(mActivity.getResources().getConfiguration());
+
insets = WindowManagerProxy.INSTANCE.get(getContext())
.normalizeWindowInsets(getContext(), insets, mTempRect);
handleSystemWindowInsets(mTempRect);
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 8b5cdbd..31a7d18 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -19,16 +19,16 @@
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
-import static com.android.launcher3.testing.TestProtocol.ALL_APPS_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_MODAL_TASK_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_SPLIT_SELECT_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_MODAL_TASK_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_SPLIT_SELECT_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import android.content.Context;
import android.graphics.Color;
@@ -38,7 +38,7 @@
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.states.HintState;
import com.android.launcher3.states.SpringLoadedState;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.uioverrides.states.AllAppsState;
import com.android.launcher3.uioverrides.states.OverviewState;
@@ -71,17 +71,14 @@
public static final int FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED = BaseState.getFlag(2);
// Flag to indicate that workspace should draw page background
public static final int FLAG_WORKSPACE_HAS_BACKGROUNDS = BaseState.getFlag(3);
- // True if the back button should be hidden when in this state (assuming no floating views are
- // open, launcher has window focus, etc).
- public static final int FLAG_HIDE_BACK_BUTTON = BaseState.getFlag(4);
// Flag to indicate if the state would have scrim over sysui region: statu sbar and nav bar
- public static final int FLAG_HAS_SYS_UI_SCRIM = BaseState.getFlag(5);
+ public static final int FLAG_HAS_SYS_UI_SCRIM = BaseState.getFlag(4);
// Flag to inticate that all popups should be closed when this state is enabled.
- public static final int FLAG_CLOSE_POPUPS = BaseState.getFlag(6);
- public static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7);
+ public static final int FLAG_CLOSE_POPUPS = BaseState.getFlag(5);
+ public static final int FLAG_OVERVIEW_UI = BaseState.getFlag(6);
// Flag indicating that hotseat and its contents are not accessible.
- public static final int FLAG_HOTSEAT_INACCESSIBLE = BaseState.getFlag(8);
+ public static final int FLAG_HOTSEAT_INACCESSIBLE = BaseState.getFlag(7);
public static final float NO_OFFSET = 0;
@@ -110,8 +107,7 @@
*/
public static final LauncherState NORMAL = new LauncherState(NORMAL_STATE_ORDINAL,
LAUNCHER_STATE_HOME,
- FLAG_DISABLE_RESTORE | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_HIDE_BACK_BUTTON |
- FLAG_HAS_SYS_UI_SCRIM) {
+ FLAG_DISABLE_RESTORE | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_HAS_SYS_UI_SCRIM) {
@Override
public int getTransitionDuration(Context context, boolean isToState) {
// Arbitrary duration, when going to NORMAL we use the state we're coming from instead.
@@ -265,7 +261,8 @@
*
* 0 means completely zoomed in, without blurs. 1 is zoomed out, with blurs.
*/
- public final float getDepth(Context context) {
+ public final <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
+ float getDepth(DEVICE_PROFILE_CONTEXT context) {
return getDepth(context,
BaseDraggingActivity.fromContext(context).getDeviceProfile().isMultiWindowMode);
}
@@ -275,14 +272,16 @@
*
* @see #getDepth(Context).
*/
- public final float getDepth(Context context, boolean isMultiWindowMode) {
+ public final <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
+ float getDepth(DEVICE_PROFILE_CONTEXT context, boolean isMultiWindowMode) {
if (isMultiWindowMode) {
return 0;
}
return getDepthUnchecked(context);
}
- protected float getDepthUnchecked(Context context) {
+ protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
+ float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) {
return 0f;
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 73be5be..68c54c7 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -259,8 +259,13 @@
abortScrollerAnimation(true);
}
+ protected void onScrollerAnimationAborted() {
+ // No-Op
+ }
+
private void abortScrollerAnimation(boolean resetNextPage) {
mScroller.abortAnimation();
+ onScrollerAnimationAborted();
// We need to clean up the next page here to avoid computeScrollHelper from
// updating current page on the pass.
if (resetNextPage) {
@@ -555,11 +560,11 @@
if (mAllowOverScroll) {
if (newPos < mMinScroll && oldPos >= mMinScroll) {
mEdgeGlowLeft.onAbsorb((int) mScroller.getCurrVelocity());
- mScroller.abortAnimation();
+ abortScrollerAnimation(false);
onEdgeAbsorbingScroll();
} else if (newPos > mMaxScroll && oldPos <= mMaxScroll) {
mEdgeGlowRight.onAbsorb((int) mScroller.getCurrVelocity());
- mScroller.abortAnimation();
+ abortScrollerAnimation(false);
onEdgeAbsorbingScroll();
}
}
@@ -569,7 +574,7 @@
int finalPos = mOrientationHandler.getPrimaryValue(mScroller.getFinalX(),
mScroller.getFinalY());
if (newPos == finalPos && mEdgeGlowLeft.isFinished() && mEdgeGlowRight.isFinished()) {
- mScroller.abortAnimation();
+ abortScrollerAnimation(false);
}
invalidate();
diff --git a/src/com/android/launcher3/PendingAddItemInfo.java b/src/com/android/launcher3/PendingAddItemInfo.java
index be994ee..b7a22fc 100644
--- a/src/com/android/launcher3/PendingAddItemInfo.java
+++ b/src/com/android/launcher3/PendingAddItemInfo.java
@@ -18,6 +18,7 @@
import android.content.ComponentName;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.model.data.ItemInfo;
@@ -43,6 +44,7 @@
/**
* Returns shallow copy of the object.
*/
+ @NonNull
@Override
public ItemInfo makeShallowCopy() {
PendingAddItemInfo itemInfo = new PendingAddItemInfo();
diff --git a/src/com/android/launcher3/SecondaryDropTarget.java b/src/com/android/launcher3/SecondaryDropTarget.java
index f8bc1f4..0ee7aae 100644
--- a/src/com/android/launcher3/SecondaryDropTarget.java
+++ b/src/com/android/launcher3/SecondaryDropTarget.java
@@ -159,7 +159,7 @@
return RECONFIGURE;
}
return INVALID;
- } else if (FeatureFlags.ENABLE_PREDICTION_DISMISS.get() && info.isPredictedItem()) {
+ } else if (info.isPredictedItem()) {
return DISMISS_PREDICTION;
}
diff --git a/src/com/android/launcher3/SessionCommitReceiver.java b/src/com/android/launcher3/SessionCommitReceiver.java
index b81637f..bcd4c3f 100644
--- a/src/com/android/launcher3/SessionCommitReceiver.java
+++ b/src/com/android/launcher3/SessionCommitReceiver.java
@@ -31,7 +31,7 @@
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.pm.InstallSessionHelper;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.Executors;
/**
diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
index 5583eae..486a68f 100644
--- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java
+++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
@@ -25,6 +25,7 @@
import android.app.WallpaperManager;
import android.content.Context;
import android.graphics.Point;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
@@ -32,6 +33,7 @@
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.NavigableAppWidgetHostView;
@@ -109,8 +111,9 @@
if (child instanceof NavigableAppWidgetHostView) {
DeviceProfile profile = mActivity.getDeviceProfile();
((NavigableAppWidgetHostView) child).getWidgetInset(profile, mTempRect);
+ final PointF appWidgetScale = profile.getAppWidgetScale((ItemInfo) child.getTag());
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
- profile.appWidgetScale.x, profile.appWidgetScale.y, mBorderSpace, mTempRect);
+ appWidgetScale.x, appWidgetScale.y, mBorderSpace, mTempRect);
} else {
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
mBorderSpace, null);
@@ -133,8 +136,9 @@
if (child instanceof NavigableAppWidgetHostView) {
((NavigableAppWidgetHostView) child).getWidgetInset(dp, mTempRect);
+ final PointF appWidgetScale = dp.getAppWidgetScale((ItemInfo) child.getTag());
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
- dp.appWidgetScale.x, dp.appWidgetScale.y, mBorderSpace, mTempRect);
+ appWidgetScale.x, appWidgetScale.y, mBorderSpace, mTempRect);
} else {
lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
mBorderSpace, null);
@@ -187,8 +191,9 @@
// Scale and center the widget to fit within its cells.
DeviceProfile profile = mActivity.getDeviceProfile();
- float scaleX = profile.appWidgetScale.x;
- float scaleY = profile.appWidgetScale.y;
+ final PointF appWidgetScale = profile.getAppWidgetScale((ItemInfo) child.getTag());
+ float scaleX = appWidgetScale.x;
+ float scaleY = appWidgetScale.y;
nahv.setScaleToFit(Math.min(scaleX, scaleY));
nahv.setTranslationForCentering(-(lp.width - (lp.width * scaleX)) / 2.0f,
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index dc8c739..616b08a 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -75,6 +75,7 @@
import androidx.annotation.ChecksSdkIntAtLeast;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.core.graphics.ColorUtils;
import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
@@ -88,6 +89,7 @@
import com.android.launcher3.pm.ShortcutConfigActivityInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
@@ -525,10 +527,11 @@
}
public static int pxFromSp(float size, DisplayMetrics metrics, float scale) {
- return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
- size, metrics) * scale);
+ float value = scale * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, size, metrics);
+ return ResourceUtils.roundPxValueFromFloat(value);
}
+
public static String createDbSelectionQuery(String columnName, IntArray values) {
return String.format(Locale.ENGLISH, "%s IN (%s)", columnName, values.toConcatString());
}
@@ -923,4 +926,12 @@
}
return options;
}
+
+ public static boolean bothNull(@Nullable Object a, @Nullable Object b) {
+ return a == null && b == null;
+ }
+
+ public static boolean bothNonNull(@Nullable Object a, @Nullable Object b) {
+ return a != null && b != null;
+ }
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e6dea8f..b49d646 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -30,7 +30,6 @@
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPELEFT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPERIGHT;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -45,6 +44,7 @@
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Point;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Handler;
@@ -152,10 +152,6 @@
public static final int DEFAULT_PAGE = 0;
- private static final int DEFAULT_SMARTSPACE_HEIGHT = 1;
-
- private static final int EXPANDED_SMARTSPACE_HEIGHT = 2;
-
private LayoutTransition mLayoutTransition;
@Thunk final WallpaperManager mWallpaperManager;
@@ -169,7 +165,7 @@
/**
* CellInfo for the cell that is currently being dragged
*/
- private CellLayout.CellInfo mDragInfo;
+ protected CellLayout.CellInfo mDragInfo;
/**
* Target drop area calculated during last acceptDrop call.
@@ -214,7 +210,7 @@
private boolean mUnlockWallpaperFromDefaultPageOnLayout;
public static final int REORDER_TIMEOUT = 650;
- private final Alarm mReorderAlarm = new Alarm();
+ protected final Alarm mReorderAlarm = new Alarm();
private PreviewBackground mFolderCreateBg;
private FolderIcon mDragOverFolderIcon = null;
private boolean mCreateUserFolderOnDrop = false;
@@ -242,7 +238,7 @@
private static final int DRAG_MODE_CREATE_FOLDER = 1;
private static final int DRAG_MODE_ADD_TO_FOLDER = 2;
private static final int DRAG_MODE_REORDER = 3;
- private int mDragMode = DRAG_MODE_NONE;
+ protected int mDragMode = DRAG_MODE_NONE;
@Thunk int mLastReorderX = -1;
@Thunk int mLastReorderY = -1;
@@ -370,7 +366,8 @@
float scale = 1;
if (isWidget) {
DeviceProfile profile = mLauncher.getDeviceProfile();
- scale = Utilities.shrinkRect(r, profile.appWidgetScale.x, profile.appWidgetScale.y);
+ final PointF appWidgetScale = profile.getAppWidgetScale(null);
+ scale = Utilities.shrinkRect(r, appWidgetScale.x, appWidgetScale.y);
}
size[0] = r.width();
size[1] = r.height();
@@ -561,10 +558,8 @@
.inflate(R.layout.search_container_workspace, firstPage, false);
}
- int cellVSpan = FeatureFlags.EXPANDED_SMARTSPACE.get()
- ? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;
int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
- CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, cellVSpan);
+ CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, 1);
lp.canReorder = false;
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");
@@ -1248,7 +1243,6 @@
// different effects based on device performance. On at least one relatively high-end
// device I've tried, translating the launcher causes things to get quite laggy.
mLauncher.getDragLayer().setTranslationX(transX);
- Log.d(BAD_STATE, "Workspace onOverlayScrollChanged DragLayer ALPHA_INDEX_OVERLAY=" + alpha);
mLauncher.getDragLayer().getAlphaProperty(ALPHA_INDEX_OVERLAY).setValue(alpha);
}
@@ -1980,10 +1974,10 @@
// If the item being dropped is a shortcut and the nearest drop
// cell also contains a shortcut, then create a folder with the two shortcuts.
- if (createUserFolderIfNecessary(cell, container,
- dropTargetLayout, mTargetCell, distance, false, d)
+ if (createUserFolderIfNecessary(cell, container, dropTargetLayout, mTargetCell,
+ distance, false, d)
|| addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell,
- distance, d, false)) {
+ distance, d, false)) {
mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY);
return;
}
@@ -2012,8 +2006,8 @@
mTargetCell[0] = mTargetCell[1] = -1;
} else {
mTargetCell = dropTargetLayout.performReorder((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY, cell,
- mTargetCell, resultSpan, CellLayout.MODE_ON_DROP);
+ (int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY,
+ cell, mTargetCell, resultSpan, CellLayout.MODE_ON_DROP);
}
boolean foundCell = mTargetCell[0] >= 0 && mTargetCell[1] >= 0;
@@ -2063,20 +2057,11 @@
if (container != LauncherSettings.Favorites.CONTAINER_HOTSEAT &&
cell instanceof LauncherAppWidgetHostView) {
- final CellLayout cellLayout = dropTargetLayout;
+
// We post this call so that the widget has a chance to be placed
// in its final location
-
- final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell;
- AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !options.isAccessibleDrag) {
- onCompleteRunnable = () -> {
- if (!isPageInTransition()) {
- AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
- }
- };
- }
+ onCompleteRunnable = getWidgetResizeFrameRunnable(options,
+ (LauncherAppWidgetHostView) cell, dropTargetLayout);
}
mLauncher.getModelWriter().modifyItemInDatabase(info, container, screenId,
lp.cellX, lp.cellY, item.spanX, item.spanY);
@@ -2097,8 +2082,16 @@
}
} else {
// When drag is cancelled, reattach content view back to its original parent.
- if (mDragInfo.cell instanceof LauncherAppWidgetHostView) {
+ if (cell instanceof LauncherAppWidgetHostView) {
d.dragView.detachContentView(/* reattachToPreviousParent= */ true);
+
+ final CellLayout cellLayout = getParentCellLayoutForView(cell);
+ boolean pageIsVisible = isVisible(cellLayout);
+
+ if (pageIsVisible) {
+ onCompleteRunnable = getWidgetResizeFrameRunnable(options,
+ (LauncherAppWidgetHostView) cell, cellLayout);
+ }
}
}
@@ -2124,7 +2117,8 @@
final ItemInfo info = (ItemInfo) cell.getTag();
boolean isWidget = info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET
|| info.itemType == LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET;
- if (isWidget) {
+ if (isWidget && dropTargetLayout != null) {
+ // animate widget to a valid place
int animationType = resizeOnDrop ? ANIMATE_INTO_POSITION_AND_RESIZE :
ANIMATE_INTO_POSITION_AND_DISAPPEAR;
animateWidgetDrop(info, parent, d.dragView, null, animationType, cell, false);
@@ -2150,6 +2144,21 @@
}
}
+ @Nullable
+ private Runnable getWidgetResizeFrameRunnable(DragOptions options,
+ LauncherAppWidgetHostView hostView, CellLayout cellLayout) {
+ AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
+ if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
+ && !options.isAccessibleDrag) {
+ return () -> {
+ if (!isPageInTransition()) {
+ AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
+ }
+ };
+ }
+ return null;
+ }
+
public void onNoCellFound(
View dropTargetLayout, ItemInfo itemInfo, @Nullable InstanceId logInstanceId) {
int strId = mLauncher.isHotseatLayout(dropTargetLayout)
@@ -2297,7 +2306,7 @@
}
}
- private void cleanupFolderCreation() {
+ protected void cleanupFolderCreation() {
if (mFolderCreateBg != null) {
mFolderCreateBg.animateToRest();
}
@@ -2310,7 +2319,7 @@
}
}
- private void cleanupReorder(boolean cancelAlarm) {
+ protected void cleanupReorder(boolean cancelAlarm) {
// Any pending reorders are canceled
if (cancelAlarm) {
mReorderAlarm.cancelAlarm();
@@ -2402,26 +2411,7 @@
mDragViewVisualCenter[0], (int) mDragViewVisualCenter[1], item.spanX,
item.spanY, child, mTargetCell);
- if (!nearestDropOccupied) {
- mDragTargetLayout.visualizeDropLocation(mTargetCell[0], mTargetCell[1],
- item.spanX, item.spanY, d);
- } else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
- && !mReorderAlarm.alarmPending()
- && (mLastReorderX != reorderX || mLastReorderY != reorderY)
- && targetCellDistance < mDragTargetLayout.getReorderRadius(mTargetCell)) {
-
- int[] resultSpan = new int[2];
- mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
- child, mTargetCell, resultSpan, CellLayout.MODE_SHOW_REORDER_HINT);
-
- // Otherwise, if we aren't adding to or creating a folder and there's no pending
- // reorder, then we schedule a reorder
- ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,
- minSpanX, minSpanY, item.spanX, item.spanY, d, child);
- mReorderAlarm.setOnAlarmListener(listener);
- mReorderAlarm.setAlarm(REORDER_TIMEOUT);
- }
+ manageReorderOnDragOver(d, targetCellDistance, nearestDropOccupied, minSpanX, minSpanY);
if (mDragMode == DRAG_MODE_CREATE_FOLDER || mDragMode == DRAG_MODE_ADD_TO_FOLDER ||
!nearestDropOccupied) {
@@ -2432,6 +2422,35 @@
}
}
+ protected void manageReorderOnDragOver(DragObject d, float targetCellDistance,
+ boolean nearestDropOccupied, int minSpanX, int minSpanY) {
+
+ ItemInfo item = d.dragInfo;
+ final View child = (mDragInfo == null) ? null : mDragInfo.cell;
+ int reorderX = mTargetCell[0];
+ int reorderY = mTargetCell[1];
+ if (!nearestDropOccupied) {
+ mDragTargetLayout.visualizeDropLocation(mTargetCell[0], mTargetCell[1],
+ item.spanX, item.spanY, d);
+ } else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
+ && !mReorderAlarm.alarmPending()
+ && (mLastReorderX != reorderX || mLastReorderY != reorderY)
+ && targetCellDistance < mDragTargetLayout.getReorderRadius(mTargetCell, item.spanX,
+ item.spanY)) {
+
+ int[] resultSpan = new int[2];
+ mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
+ (int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
+ child, mTargetCell, resultSpan, CellLayout.MODE_SHOW_REORDER_HINT);
+
+ // Otherwise, if we aren't adding to or creating a folder and there's no pending
+ // reorder, then we schedule a reorder
+ ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,
+ minSpanX, minSpanY, item.spanX, item.spanY, d, child);
+ mReorderAlarm.setOnAlarmListener(listener);
+ mReorderAlarm.setAlarm(REORDER_TIMEOUT);
+ }
+ }
/**
* Updates {@link #mDragTargetLayout} and {@link #mDragOverlappingLayout}
* based on the DragObject's position.
@@ -2875,7 +2894,8 @@
r.top -= widgetPadding.top;
r.bottom += widgetPadding.bottom;
}
- Utilities.shrinkRect(r, profile.appWidgetScale.x, profile.appWidgetScale.y);
+ PointF appWidgetScale = profile.getAppWidgetScale(null);
+ Utilities.shrinkRect(r, appWidgetScale.x, appWidgetScale.y);
}
mTempFXY[0] = r.left;
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 53a6fd7..c1eaa16 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -15,8 +15,9 @@
*/
package com.android.launcher3.allapps;
+import static com.android.launcher3.allapps.BaseAllAppsContainerView.AdapterHolder.SEARCH;
+
import android.content.Context;
-import android.content.Intent;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -32,11 +33,9 @@
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.AppLauncher;
import java.util.ArrayList;
-import java.util.Objects;
/**
* All apps container view with search support for use in a dragging activity.
@@ -46,6 +45,11 @@
public class ActivityAllAppsContainerView<T extends Context & AppLauncher
& DeviceProfileListenable> extends BaseAllAppsContainerView<T> {
+ private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300;
+
+ // Used to animate Search results out and A-Z apps in, or vice-versa.
+ private final SearchTransitionController mSearchTransitionController;
+
protected SearchUiManager mSearchUiManager;
/**
* View that defines the search box. Result is rendered inside the recycler view defined in the
@@ -54,6 +58,7 @@
private View mSearchContainer;
/** {@code true} when rendered view is in search state instead of the scroll state. */
private boolean mIsSearching;
+ private boolean mRebindAdaptersAfterSearchAnimation;
public ActivityAllAppsContainerView(Context context) {
this(context, null);
@@ -65,6 +70,8 @@
public ActivityAllAppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
+
+ mSearchTransitionController = new SearchTransitionController(this);
}
public SearchUiManager getSearchUiManager() {
@@ -75,39 +82,55 @@
return mSearchContainer;
}
- /** Updates all apps container with the latest search query. */
- public void setLastSearchQuery(String query) {
- Intent marketSearchIntent = PackageManagerHelper.getMarketSearchIntent(
- mActivityContext, query);
- OnClickListener marketSearchClickListener = (v) -> mActivityContext.startActivitySafely(v,
- marketSearchIntent, null);
- for (int i = 0; i < mAH.size(); i++) {
- mAH.get(i).mAdapter.setLastSearchQuery(query, marketSearchClickListener);
- }
- mIsSearching = true;
- rebindAdapters();
- mHeader.setCollapsed(true);
- }
-
/** Invoke when the current search session is finished. */
public void onClearSearchResult() {
- mIsSearching = false;
- mHeader.setCollapsed(false);
+ getMainAdapterProvider().clearHighlightedItem();
+ animateToSearchState(false);
rebindAdapters();
- mHeader.reset(false);
}
/**
* Sets results list for search
*/
public void setSearchResults(ArrayList<AdapterItem> results) {
+ getMainAdapterProvider().clearHighlightedItem();
if (getSearchResultList().setSearchResults(results)) {
- for (int i = 0; i < mAH.size(); i++) {
- if (mAH.get(i).mRecyclerView != null) {
- mAH.get(i).mRecyclerView.onSearchResultsChanged();
- }
- }
+ getSearchRecyclerView().onSearchResultsChanged();
}
+ if (results != null) {
+ animateToSearchState(true);
+ }
+ }
+
+ private void animateToSearchState(boolean goingToSearch) {
+ animateToSearchState(goingToSearch, DEFAULT_SEARCH_TRANSITION_DURATION_MS);
+ }
+
+ private void animateToSearchState(boolean goingToSearch, long durationMs) {
+ if (!mSearchTransitionController.isRunning() && goingToSearch == isSearching()) {
+ return;
+ }
+ if (goingToSearch) {
+ // Fade out the button to pause work apps.
+ mWorkManager.onActivePageChanged(SEARCH);
+ }
+ mSearchTransitionController.animateToSearchState(goingToSearch, durationMs,
+ /* onEndRunnable = */ () -> {
+ mIsSearching = goingToSearch;
+ updateSearchResultsVisibility();
+ int previousPage = getCurrentPage();
+ if (mRebindAdaptersAfterSearchAnimation) {
+ rebindAdapters(false);
+ mRebindAdaptersAfterSearchAnimation = false;
+ }
+ if (!goingToSearch) {
+ setSearchResults(null);
+ if (mViewPager != null) {
+ mViewPager.setCurrentPage(previousPage);
+ }
+ onActivePageChanged(previousPage);
+ }
+ });
}
@Override
@@ -130,6 +153,8 @@
super.reset(animate);
// Reset the search bar after transitioning home.
mSearchUiManager.resetSearch();
+ // Animate to A-Z with 0 time to reset the animation with proper state management.
+ animateToSearchState(false, 0);
}
@Override
@@ -166,21 +191,30 @@
}
@Override
+ public void onActivePageChanged(int currentActivePage) {
+ if (mSearchTransitionController.isRunning()) {
+ // Will be called at the end of the animation.
+ return;
+ }
+ super.onActivePageChanged(currentActivePage);
+ }
+
+ @Override
protected void rebindAdapters(boolean force) {
+ if (mSearchTransitionController.isRunning()) {
+ mRebindAdaptersAfterSearchAnimation = true;
+ return;
+ }
super.rebindAdapters(force);
if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()
- || getMainAdapterProvider().getDecorator() == null) {
+ || getMainAdapterProvider().getDecorator() == null
+ || getSearchRecyclerView() == null) {
return;
}
RecyclerView.ItemDecoration decoration = getMainAdapterProvider().getDecorator();
- mAH.stream()
- .map(adapterHolder -> adapterHolder.mRecyclerView)
- .filter(Objects::nonNull)
- .forEach(v -> {
- v.removeItemDecoration(decoration); // Remove in case it is already added.
- v.addItemDecoration(decoration);
- });
+ getSearchRecyclerView().removeItemDecoration(decoration); // In case it is already added.
+ getSearchRecyclerView().addItemDecoration(decoration);
}
@Override
diff --git a/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java b/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java
deleted file mode 100644
index 3830a93..0000000
--- a/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.allapps;
-
-import android.animation.ObjectAnimator;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.PixelFormat;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.view.ContextThemeWrapper;
-import android.view.Gravity;
-
-import com.android.launcher3.LauncherAnimUtils;
-import com.android.launcher3.R;
-import com.android.launcher3.util.Themes;
-
-/**
- * This is a custom composite drawable that has a fixed virtual size and dynamically lays out its
- * children images relatively within its bounds. This way, we can reduce the memory usage of a
- * single, large sparsely populated image.
- */
-public class AllAppsBackgroundDrawable extends Drawable {
-
- /**
- * A helper class to position and orient a drawable to be drawn.
- */
- protected static class TransformedImageDrawable {
- private Drawable mImage;
- private float mXPercent;
- private float mYPercent;
- private int mGravity;
- private int mAlpha;
-
- /**
- * @param gravity If one of the Gravity center values, the x and y offset will take the width
- * and height of the image into account to center the image to the offset.
- */
- public TransformedImageDrawable(Context context, int resourceId, float xPct, float yPct,
- int gravity) {
- mImage = context.getDrawable(resourceId);
- mXPercent = xPct;
- mYPercent = yPct;
- mGravity = gravity;
- }
-
- public void setAlpha(int alpha) {
- mImage.setAlpha(alpha);
- mAlpha = alpha;
- }
-
- public int getAlpha() {
- return mAlpha;
- }
-
- public void updateBounds(Rect bounds) {
- int width = mImage.getIntrinsicWidth();
- int height = mImage.getIntrinsicHeight();
- int left = bounds.left + (int) (mXPercent * bounds.width());
- int top = bounds.top + (int) (mYPercent * bounds.height());
- if ((mGravity & Gravity.CENTER_HORIZONTAL) == Gravity.CENTER_HORIZONTAL) {
- left -= (width / 2);
- }
- if ((mGravity & Gravity.CENTER_VERTICAL) == Gravity.CENTER_VERTICAL) {
- top -= (height / 2);
- }
- mImage.setBounds(left, top, left + width, top + height);
- }
-
- public void draw(Canvas canvas) {
- mImage.draw(canvas);
- }
-
- public Rect getBounds() {
- return mImage.getBounds();
- }
- }
-
- protected final TransformedImageDrawable mHand;
- protected final TransformedImageDrawable[] mIcons;
- private final int mWidth;
- private final int mHeight;
-
- private ObjectAnimator mBackgroundAnim;
-
- public AllAppsBackgroundDrawable(Context context) {
- Resources res = context.getResources();
- mWidth = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_width);
- mHeight = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_height);
-
- context = new ContextThemeWrapper(context,
- Themes.getAttrBoolean(context, R.attr.isMainColorDark)
- ? R.style.AllAppsEmptySearchBackground_Dark
- : R.style.AllAppsEmptySearchBackground);
- mHand = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_hand,
- 0.575f, 0.f, Gravity.CENTER_HORIZONTAL);
- mIcons = new TransformedImageDrawable[4];
- mIcons[0] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_1,
- 0.375f, 0, Gravity.CENTER_HORIZONTAL);
- mIcons[1] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_2,
- 0.3125f, 0.2f, Gravity.CENTER_HORIZONTAL);
- mIcons[2] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_3,
- 0.475f, 0.26f, Gravity.CENTER_HORIZONTAL);
- mIcons[3] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_4,
- 0.7f, 0.125f, Gravity.CENTER_HORIZONTAL);
- }
-
- /**
- * Animates the background alpha.
- */
- public void animateBgAlpha(float finalAlpha, int duration) {
- int finalAlphaI = (int) (finalAlpha * 255f);
- if (getAlpha() != finalAlphaI) {
- mBackgroundAnim = cancelAnimator(mBackgroundAnim);
- mBackgroundAnim = ObjectAnimator.ofInt(this, LauncherAnimUtils.DRAWABLE_ALPHA,
- finalAlphaI);
- mBackgroundAnim.setDuration(duration);
- mBackgroundAnim.start();
- }
- }
-
- /**
- * Sets the background alpha immediately.
- */
- public void setBgAlpha(float finalAlpha) {
- int finalAlphaI = (int) (finalAlpha * 255f);
- if (getAlpha() != finalAlphaI) {
- mBackgroundAnim = cancelAnimator(mBackgroundAnim);
- setAlpha(finalAlphaI);
- }
- }
-
- @Override
- public int getIntrinsicWidth() {
- return mWidth;
- }
-
- @Override
- public int getIntrinsicHeight() {
- return mHeight;
- }
-
- @Override
- public void draw(Canvas canvas) {
- mHand.draw(canvas);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].draw(canvas);
- }
- }
-
- @Override
- protected void onBoundsChange(Rect bounds) {
- super.onBoundsChange(bounds);
- mHand.updateBounds(bounds);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].updateBounds(bounds);
- }
- invalidateSelf();
- }
-
- @Override
- public void setAlpha(int alpha) {
- mHand.setAlpha(alpha);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].setAlpha(alpha);
- }
- invalidateSelf();
- }
-
- @Override
- public int getAlpha() {
- return mHand.getAlpha();
- }
-
- @Override
- public void setColorFilter(ColorFilter colorFilter) {
- // Do nothing
- }
-
- @Override
- public int getOpacity() {
- return PixelFormat.TRANSLUCENT;
- }
-
- private ObjectAnimator cancelAnimator(ObjectAnimator animator) {
- if (animator != null) {
- animator.cancel();
- }
- return null;
- }
-}
diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
index 33d2f2b..e0b4951 100644
--- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
+++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
@@ -26,7 +26,9 @@
import androidx.core.view.accessibility.AccessibilityRecordCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView.Adapter;
+import com.android.launcher3.util.ScrollableLayoutManager;
import com.android.launcher3.views.ActivityContext;
import java.util.List;
@@ -62,10 +64,10 @@
/**
* A subclass of GridLayoutManager that overrides accessibility values during app search.
*/
- public class AppsGridLayoutManager extends GridLayoutManager {
+ public class AppsGridLayoutManager extends ScrollableLayoutManager {
public AppsGridLayoutManager(Context context) {
- super(context, 1, GridLayoutManager.VERTICAL, false);
+ super(context);
}
@Override
@@ -125,6 +127,15 @@
}
return extraRows;
}
+
+ @Override
+ protected int incrementTotalHeight(Adapter adapter, int position, int heightUntilLastPos) {
+ AllAppsGridAdapter.AdapterItem item = mApps.getAdapterItems().get(position);
+ // only account for the first icon in the row since they are the same size within a row
+ return (isIconViewType(item.viewType) && item.rowAppIndex != 0)
+ ? heightUntilLastPos
+ : (heightUntilLastPos + mCachedSizes.get(item.viewType));
+ }
}
@Override
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index de34416..3d06fb5 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -15,22 +15,15 @@
*/
package com.android.launcher3.allapps;
-import static android.view.View.MeasureSpec.UNSPECIFIED;
-
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_SCROLLED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_BEGIN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_VERTICAL_SWIPE_END;
import static com.android.launcher3.util.LogConfig.SEARCH_LOGGING;
-import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.Canvas;
-import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.SparseIntArray;
-import android.view.MotionEvent;
import androidx.recyclerview.widget.RecyclerView;
@@ -39,7 +32,6 @@
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.RecyclerViewFastScroller;
@@ -54,44 +46,10 @@
private static final boolean DEBUG = false;
private static final boolean DEBUG_LATENCY = Utilities.isPropertyEnabled(SEARCH_LOGGING);
- protected AlphabeticalAppsList<?> mApps;
protected final int mNumAppsPerRow;
-
- // The specific view heights that we use to calculate scroll
- private final SparseIntArray mViewHeights = new SparseIntArray();
- private final SparseIntArray mCachedScrollPositions = new SparseIntArray();
private final AllAppsFastScrollHelper mFastScrollHelper;
-
- private final AdapterDataObserver mObserver = new RecyclerView.AdapterDataObserver() {
- public void onChanged() {
- mCachedScrollPositions.clear();
- }
-
- @Override
- public void onItemRangeChanged(int positionStart, int itemCount) {
- onChanged();
- }
-
- @Override
- public void onItemRangeInserted(int positionStart, int itemCount) {
- onChanged();
- }
-
- @Override
- public void onItemRangeRemoved(int positionStart, int itemCount) {
- onChanged();
- }
-
- @Override
- public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {
- onChanged();
- }
- };
-
- // The empty-search result background
- protected AllAppsBackgroundDrawable mEmptySearchBackground;
- protected int mEmptySearchBackgroundTopOffset;
+ protected AlphabeticalAppsList<?> mApps;
public AllAppsRecyclerView(Context context) {
this(context, null);
@@ -108,9 +66,6 @@
public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr);
- Resources res = getResources();
- mEmptySearchBackgroundTopOffset = res.getDimensionPixelSize(
- R.dimen.all_apps_empty_search_bg_top_offset);
mNumAppsPerRow = LauncherAppState.getIDP(context).numColumns;
mFastScrollHelper = new AllAppsFastScrollHelper(this);
}
@@ -132,21 +87,12 @@
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1);
- pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows
* (mNumAppsPerRow + 1));
-
- mViewHeights.clear();
- mViewHeights.put(AllAppsGridAdapter.VIEW_TYPE_ICON, grid.allAppsCellHeightPx);
}
-
@Override
public void onDraw(Canvas c) {
- // Draw the background
- if (mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
- mEmptySearchBackground.draw(c);
- }
if (DEBUG) {
Log.d(TAG, "onDraw at = " + System.currentTimeMillis());
}
@@ -158,33 +104,13 @@
}
@Override
- protected boolean verifyDrawable(Drawable who) {
- return who == mEmptySearchBackground || super.verifyDrawable(who);
- }
-
- @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- updateEmptySearchBackgroundBounds();
updatePoolSize();
}
public void onSearchResultsChanged() {
// Always scroll the view to the top so the user can see the changed results
scrollToTop();
-
- if (mApps.hasNoFilteredResults() && !FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- if (mEmptySearchBackground == null) {
- mEmptySearchBackground = new AllAppsBackgroundDrawable(getContext());
- mEmptySearchBackground.setAlpha(0);
- mEmptySearchBackground.setCallback(this);
- updateEmptySearchBackgroundBounds();
- }
- mEmptySearchBackground.animateBgAlpha(1f, 150);
- } else if (mEmptySearchBackground != null) {
- // For the time being, we just immediately hide the background to ensure that it does
- // not overlap with the results
- mEmptySearchBackground.setBgAlpha(0f);
- }
}
@Override
@@ -198,8 +124,7 @@
requestFocus();
mgr.logger().sendToInteractionJankMonitor(
LAUNCHER_ALLAPPS_VERTICAL_SWIPE_BEGIN, this);
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()),
- getApplicationWindowToken());
+ ActivityContext.lookupContext(getContext()).hideKeyboard();
break;
case SCROLL_STATE_IDLE:
mgr.logger().sendToInteractionJankMonitor(
@@ -208,16 +133,6 @@
}
}
- @Override
- public boolean onInterceptTouchEvent(MotionEvent e) {
- boolean result = super.onInterceptTouchEvent(e);
- if (!result && e.getAction() == MotionEvent.ACTION_DOWN
- && mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
- mEmptySearchBackground.setHotspot(e.getX(), e.getY());
- }
- return result;
- }
-
/**
* Maps the touch (from 0..1) to the adapter position that should be visible.
*/
@@ -248,17 +163,6 @@
}
@Override
- public void setAdapter(Adapter adapter) {
- if (getAdapter() != null) {
- getAdapter().unregisterAdapterDataObserver(mObserver);
- }
- super.setAdapter(adapter);
- if (adapter != null) {
- adapter.registerAdapterDataObserver(mObserver);
- }
- }
-
- @Override
protected boolean isPaddingOffsetRequired() {
return true;
}
@@ -279,13 +183,13 @@
List<AllAppsGridAdapter.AdapterItem> items = mApps.getAdapterItems();
// Skip early if there are no items or we haven't been measured
- if (items.isEmpty() || mNumAppsPerRow == 0) {
+ if (items.isEmpty() || mNumAppsPerRow == 0 || getChildCount() == 0) {
mScrollbar.setThumbOffsetY(-1);
return;
}
// Skip early if, there no child laid out in the container.
- int scrollY = getCurrentScrollY();
+ int scrollY = computeVerticalScrollOffset();
if (scrollY < 0) {
mScrollbar.setThumbOffsetY(-1);
return;
@@ -340,51 +244,6 @@
}
}
- @Override
- protected int getItemsHeight(int position) {
- List<AllAppsGridAdapter.AdapterItem> items = mApps.getAdapterItems();
- AllAppsGridAdapter.AdapterItem posItem = position < items.size()
- ? items.get(position) : null;
- int y = mCachedScrollPositions.get(position, -1);
- if (y < 0) {
- y = 0;
- for (int i = 0; i < position; i++) {
- AllAppsGridAdapter.AdapterItem item = items.get(i);
- if (AllAppsGridAdapter.isIconViewType(item.viewType)) {
- // Break once we reach the desired row
- if (posItem != null && posItem.viewType == item.viewType &&
- posItem.rowIndex == item.rowIndex) {
- break;
- }
- // Otherwise, only account for the first icon in the row since they are the same
- // size within a row
- if (item.rowAppIndex == 0) {
- y += mViewHeights.get(item.viewType, 0);
- }
- } else {
- // Rest of the views span the full width
- int elHeight = mViewHeights.get(item.viewType);
- if (elHeight == 0) {
- ViewHolder holder = findViewHolderForAdapterPosition(i);
- if (holder == null) {
- holder = getAdapter().createViewHolder(this, item.viewType);
- getAdapter().onBindViewHolder(holder, i);
- holder.itemView.measure(UNSPECIFIED, UNSPECIFIED);
- elHeight = holder.itemView.getMeasuredHeight();
-
- getRecycledViewPool().putRecycledView(holder);
- } else {
- elHeight = holder.itemView.getMeasuredHeight();
- }
- }
- y += elHeight;
- }
- }
- mCachedScrollPositions.put(position, y);
- }
- return y;
- }
-
public int getScrollBarTop() {
return getResources().getDimensionPixelOffset(R.dimen.all_apps_header_top_padding);
}
@@ -393,22 +252,6 @@
return mScrollbar;
}
- /**
- * Updates the bounds of the empty search background.
- */
- private void updateEmptySearchBackgroundBounds() {
- if (mEmptySearchBackground == null) {
- return;
- }
-
- // Center the empty search background on this new view bounds
- int x = (getMeasuredWidth() - mEmptySearchBackground.getIntrinsicWidth()) / 2;
- int y = mEmptySearchBackgroundTopOffset;
- mEmptySearchBackground.setBounds(x, y,
- x + mEmptySearchBackground.getIntrinsicWidth(),
- y + mEmptySearchBackground.getIntrinsicHeight());
- }
-
@Override
public boolean hasOverlappingRendering() {
return false;
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index bdab03f..391de8d 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -42,7 +42,7 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
-import com.android.launcher3.util.MultiAdditivePropertyFactory;
+import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.views.ScrimView;
@@ -141,9 +141,9 @@
private ScrimView mScrimView;
- private final MultiAdditivePropertyFactory<View>
- mAppsViewTranslationYPropertyFactory = new MultiAdditivePropertyFactory<>(
- "appsViewTranslationY", View.TRANSLATION_Y);
+ private final MultiPropertyFactory<View>
+ mAppsViewTranslationYPropertyFactory = new MultiPropertyFactory<>(
+ "appsViewTranslationY", View.TRANSLATION_Y, Float::sum);
private MultiValueAlpha mAppsViewAlpha;
private boolean mIsTablet;
@@ -227,12 +227,25 @@
@Override
public void setStateWithAnimation(LauncherState toState,
StateAnimationConfig config, PendingAnimation builder) {
- if (NORMAL.equals(toState) && mLauncher.isInState(ALL_APPS)) {
+ if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) {
+ // For atomic animations, we close the keyboard immediately.
+ if (!config.userControlled && !FeatureFlags.ENABLE_KEYBOARD_TRANSITION_SYNC.get()) {
+ mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
+ }
+
builder.addEndListener(success -> {
// Reset pull back progress and alpha after switching states.
ALL_APPS_PULL_BACK_TRANSLATION.set(this, 0f);
ALL_APPS_PULL_BACK_ALPHA.set(this, 1f);
- mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
+
+ // We only want to close the keyboard if the animation has completed successfully.
+ // The reason is that with keyboard sync, if the user swipes down from All Apps with
+ // the keyboard open and then changes their mind and swipes back up, we want the
+ // keyboard to remain open. However an onCancel signal is sent to the listeners
+ // (success = false), so we need to check for that.
+ if (config.userControlled && success) {
+ mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
+ }
});
}
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 8bbe216..fc1b830 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -15,17 +15,12 @@
*/
package com.android.launcher3.allapps;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_ALL_APPS_DIVIDER;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_SEARCH_MARKET;
-
import android.content.Context;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DiffUtil;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.LabelComparator;
@@ -173,13 +168,6 @@
}
/**
- * Returns whether there are no filtered results.
- */
- public boolean hasNoFilteredResults() {
- return hasSearchResults() && mAccessibilityResultsCount == 0;
- }
-
- /**
* Sets results list for search
*/
public boolean setSearchResults(ArrayList<AdapterItem> results) {
@@ -249,15 +237,6 @@
// ordered set of sections
if (hasSearchResults()) {
mAdapterItems.addAll(mSearchResults);
- if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- // Append the search market item
- if (hasNoFilteredResults()) {
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_EMPTY_SEARCH));
- } else {
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_ALL_APPS_DIVIDER));
- }
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_SEARCH_MARKET));
- }
} else {
int position = 0;
if (mWorkProviderManager != null) {
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
index 459fa88..42f8b0c 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.content.res.Resources;
-import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -54,19 +53,13 @@
public static final int VIEW_TYPE_ICON = 1 << 1;
// The message shown when there are no filtered results
public static final int VIEW_TYPE_EMPTY_SEARCH = 1 << 2;
- // The message to continue to a market search when there are no filtered results
- public static final int VIEW_TYPE_SEARCH_MARKET = 1 << 3;
-
- // We use various dividers for various purposes. They share enough attributes to reuse layouts,
- // but differ in enough attributes to require different view types
-
// A divider that separates the apps list and the search market button
- public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 4;
+ public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 3;
- public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 5;
- public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 6;
+ public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 4;
+ public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 5;
- public static final int NEXT_ID = 7;
+ public static final int NEXT_ID = 6;
// Common view type masks
public static final int VIEW_TYPE_MASK_DIVIDER = VIEW_TYPE_ALL_APPS_DIVIDER;
@@ -117,7 +110,7 @@
}
protected boolean isCountedForAccessibility() {
- return viewType == VIEW_TYPE_ICON || viewType == VIEW_TYPE_SEARCH_MARKET;
+ return viewType == VIEW_TYPE_ICON;
}
/**
@@ -134,20 +127,22 @@
public boolean isContentSame(AdapterItem other) {
return itemInfo == null && other.itemInfo == null;
}
+
+ /** Sets the alpha of the decorator for this item. Returns true if successful. */
+ public boolean setDecorationFillAlpha(int alpha) {
+ return false;
+ }
}
protected final T mActivityContext;
protected final AlphabeticalAppsList<T> mApps;
// The text to show when there are no search results and no market search handler.
- protected String mEmptySearchMessage;
protected int mAppsPerRow;
protected final LayoutInflater mLayoutInflater;
protected final OnClickListener mOnIconClickListener;
protected OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
protected OnFocusChangeListener mIconFocusListener;
- // The click listener to send off to the market app, updated each time the search query changes.
- private OnClickListener mMarketSearchClickListener;
private final int mExtraHeight;
public BaseAllAppsAdapter(T activityContext, LayoutInflater inflater,
@@ -155,7 +150,6 @@
Resources res = activityContext.getResources();
mActivityContext = activityContext;
mApps = apps;
- mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
mLayoutInflater = inflater;
mOnIconClickListener = mActivityContext.getItemOnClickListener();
@@ -186,16 +180,6 @@
}
/**
- * Sets the last search query that was made, used to show when there are no results and to also
- * seed the intent for searching the market.
- */
- public void setLastSearchQuery(String query, OnClickListener marketSearchClickListener) {
- Resources res = mActivityContext.getResources();
- mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query);
- mMarketSearchClickListener = marketSearchClickListener;
- }
-
- /**
* Returns the layout manager.
*/
public abstract RecyclerView.LayoutManager getLayoutManager();
@@ -222,11 +206,6 @@
case VIEW_TYPE_EMPTY_SEARCH:
return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search,
parent, false));
- case VIEW_TYPE_SEARCH_MARKET:
- View searchMarketView = mLayoutInflater.inflate(R.layout.all_apps_search_market,
- parent, false);
- searchMarketView.setOnClickListener(mMarketSearchClickListener);
- return new ViewHolder(searchMarketView);
case VIEW_TYPE_ALL_APPS_DIVIDER:
return new ViewHolder(mLayoutInflater.inflate(
R.layout.all_apps_divider, parent, false));
@@ -248,26 +227,21 @@
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
switch (holder.getItemViewType()) {
- case VIEW_TYPE_ICON:
+ case VIEW_TYPE_ICON: {
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
BubbleTextView icon = (BubbleTextView) holder.itemView;
icon.reset();
icon.applyFromApplicationInfo(adapterItem.itemInfo);
break;
- case VIEW_TYPE_EMPTY_SEARCH:
- TextView emptyViewText = (TextView) holder.itemView;
- emptyViewText.setText(mEmptySearchMessage);
- emptyViewText.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER :
- Gravity.START | Gravity.CENTER_VERTICAL);
- break;
- case VIEW_TYPE_SEARCH_MARKET:
- TextView searchView = (TextView) holder.itemView;
- if (mMarketSearchClickListener != null) {
- searchView.setVisibility(View.VISIBLE);
- } else {
- searchView.setVisibility(View.GONE);
+ }
+ case VIEW_TYPE_EMPTY_SEARCH: {
+ AppInfo info = mApps.getAdapterItems().get(position).itemInfo;
+ if (info != null) {
+ ((TextView) holder.itemView).setText(mActivityContext.getString(
+ R.string.all_apps_no_search_results, info.title));
}
break;
+ }
case VIEW_TYPE_ALL_APPS_DIVIDER:
case VIEW_TYPE_WORK_DISABLED_CARD:
// nothing to do
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
index f3c5dd6..3983f40 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
@@ -17,7 +17,6 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_PERSONAL_TAB;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB;
-import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -104,15 +103,17 @@
new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
- updateHeaderScroll(((AllAppsRecyclerView) recyclerView).getCurrentScrollY());
+ updateHeaderScroll(
+ ((AllAppsRecyclerView) recyclerView).computeVerticalScrollOffset());
}
};
- private final WorkProfileManager mWorkManager;
+
+ protected final WorkProfileManager mWorkManager;
private final Paint mNavBarScrimPaint;
private int mNavBarScrimHeight = 0;
- private AllAppsPagedView mViewPager;
+ protected AllAppsPagedView mViewPager;
private SearchRecyclerView mSearchRecyclerView;
protected FloatingHeaderView mHeader;
@@ -349,7 +350,7 @@
* The container for A-Z apps (the ViewPager for main+work tabs, or main RV). This is currently
* hidden while searching.
**/
- private View getAppsRecyclerViewContainer() {
+ protected View getAppsRecyclerViewContainer() {
return mViewPager != null ? mViewPager : findViewById(R.id.apps_list_view);
}
@@ -491,6 +492,7 @@
mAllAppsStore.unregisterIconContainer(mAH.get(AdapterHolder.MAIN).mRecyclerView);
mAllAppsStore.unregisterIconContainer(mAH.get(AdapterHolder.WORK).mRecyclerView);
+ mAllAppsStore.unregisterIconContainer(mAH.get(AdapterHolder.SEARCH).mRecyclerView);
if (mUsingTabs) {
mAH.get(AdapterHolder.MAIN).setup(mViewPager.getChildAt(0), mPersonalMatcher);
@@ -503,8 +505,7 @@
mActivityContext.getStatsLogManager().logger()
.log(LAUNCHER_ALLAPPS_TAP_ON_PERSONAL_TAB);
}
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()),
- getApplicationWindowToken());
+ mActivityContext.hideKeyboard();
});
findViewById(R.id.tab_work)
.setOnClickListener((View view) -> {
@@ -512,8 +513,7 @@
mActivityContext.getStatsLogManager().logger()
.log(LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB);
}
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()),
- getApplicationWindowToken());
+ mActivityContext.hideKeyboard();
});
setDeviceManagementResources();
onActivePageChanged(mViewPager.getNextPage());
@@ -525,9 +525,10 @@
mAllAppsStore.registerIconContainer(mAH.get(AdapterHolder.MAIN).mRecyclerView);
mAllAppsStore.registerIconContainer(mAH.get(AdapterHolder.WORK).mRecyclerView);
+ mAllAppsStore.registerIconContainer(mAH.get(AdapterHolder.SEARCH).mRecyclerView);
}
- private void updateSearchResultsVisibility() {
+ protected void updateSearchResultsVisibility() {
if (isSearching()) {
getSearchRecyclerView().setVisibility(VISIBLE);
getAppsRecyclerViewContainer().setVisibility(GONE);
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index c5bdb69..73efd3f 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -42,6 +42,7 @@
import com.android.systemui.plugins.PluginListener;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Map;
public class FloatingHeaderView extends LinearLayout implements
@@ -67,7 +68,7 @@
mAnimator.cancel();
}
- int current = -mCurrentRV.getCurrentScrollY();
+ int current = -mCurrentRV.computeVerticalScrollOffset();
boolean headerCollapsed = mHeaderCollapsed;
moved(current);
applyVerticalMove();
@@ -82,8 +83,8 @@
protected final Map<AllAppsRow, PluginHeaderRow> mPluginRows = new ArrayMap<>();
// These two values are necessary to ensure that the header protection is drawn correctly.
- private final int mHeaderTopAdjustment;
- private final int mHeaderBottomAdjustment;
+ private final int mTabsAdditionalPaddingTop;
+ private final int mTabsAdditionalPaddingBottom;
private boolean mHeaderProtectionSupported;
protected ViewGroup mTabLayout;
@@ -91,7 +92,6 @@
private AllAppsRecyclerView mWorkRV;
private SearchRecyclerView mSearchRV;
private AllAppsRecyclerView mCurrentRV;
- public boolean mHeaderCollapsed;
protected int mSnappedScrolledY;
private int mTranslationY;
@@ -100,7 +100,12 @@
protected boolean mTabsHidden;
protected int mMaxTranslation;
- private boolean mCollapsed = false;
+ // Whether the header has been scrolled off-screen.
+ private boolean mHeaderCollapsed;
+ // Whether floating rows like predicted apps are hidden.
+ private boolean mFloatingRowsCollapsed;
+ // Total height of all current floating rows. Collapsed rows == 0 height.
+ private int mFloatingRowsHeight;
// This is initialized once during inflation and stays constant after that. Fixed views
// cannot be added or removed dynamically.
@@ -117,9 +122,9 @@
public FloatingHeaderView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
- mHeaderTopAdjustment = context.getResources()
+ mTabsAdditionalPaddingTop = context.getResources()
.getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment);
- mHeaderBottomAdjustment = context.getResources()
+ mTabsAdditionalPaddingBottom = context.getResources()
.getDimensionPixelSize(R.dimen.all_apps_header_bottom_adjustment);
mHeaderProtectionSupported = context.getResources().getBoolean(
R.bool.config_header_protection_supported);
@@ -148,6 +153,7 @@
}
mFixedRows = rows.toArray(new FloatingHeaderRow[rows.size()]);
mAllRows = mFixedRows;
+ updateFloatingRowsHeight();
}
@Override
@@ -179,6 +185,7 @@
count++;
}
}
+ updateFloatingRowsHeight();
}
@Override
@@ -195,7 +202,7 @@
int oldMaxHeight = mMaxTranslation;
updateExpectedHeight();
- if (mMaxTranslation != oldMaxHeight || mCollapsed) {
+ if (mMaxTranslation != oldMaxHeight || mFloatingRowsCollapsed) {
BaseAllAppsContainerView<?> parent = (BaseAllAppsContainerView<?>) getParent();
if (parent != null) {
parent.setupHeader();
@@ -258,20 +265,19 @@
}
private void updateExpectedHeight() {
+ updateFloatingRowsHeight();
mMaxTranslation = 0;
- if (mCollapsed) {
+ if (mFloatingRowsCollapsed) {
return;
}
- for (FloatingHeaderRow row : mAllRows) {
- mMaxTranslation += row.getExpectedHeight();
- }
+ mMaxTranslation += mFloatingRowsHeight;
if (!mTabsHidden) {
- mMaxTranslation += mHeaderBottomAdjustment;
+ mMaxTranslation += mTabsAdditionalPaddingBottom;
}
}
public int getMaxTranslation() {
- if (mMaxTranslation == 0 && mTabsHidden) {
+ if (mMaxTranslation == 0 && (mTabsHidden || mFloatingRowsCollapsed)) {
return getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_bottom_padding);
} else if (mMaxTranslation > 0 && mTabsHidden) {
return mMaxTranslation + getPaddingTop();
@@ -312,7 +318,7 @@
int uncappedTranslationY = mTranslationY;
mTranslationY = Math.max(mTranslationY, -mMaxTranslation);
- if (mCollapsed || uncappedTranslationY < mTranslationY - getPaddingTop()) {
+ if (mFloatingRowsCollapsed || uncappedTranslationY < mTranslationY - getPaddingTop()) {
// we hide it completely if already capped (for opening search anim)
for (FloatingHeaderRow row : mAllRows) {
row.setVerticalScroll(0, true /* isScrolledOut */);
@@ -325,11 +331,11 @@
mTabLayout.setTranslationY(mTranslationY);
- int clipTop = getPaddingTop() - mHeaderTopAdjustment;
+ int clipTop = getPaddingTop() - mTabsAdditionalPaddingTop;
if (mTabsHidden) {
- clipTop += getPaddingBottom() - mHeaderBottomAdjustment;
+ clipTop += getPaddingBottom() - mTabsAdditionalPaddingBottom;
}
- mRVClip.top = mTabsHidden ? clipTop : 0;
+ mRVClip.top = mTabsHidden || mFloatingRowsCollapsed ? clipTop : 0;
mHeaderClip.top = clipTop;
// clipping on a draw might cause additional redraw
setClipBounds(mHeaderClip);
@@ -347,10 +353,12 @@
/**
* Hides all the floating rows
*/
- public void setCollapsed(boolean collapse) {
- if (mCollapsed == collapse) return;
+ public void setFloatingRowsCollapsed(boolean collapsed) {
+ if (mFloatingRowsCollapsed == collapsed) {
+ return;
+ }
- mCollapsed = collapse;
+ mFloatingRowsCollapsed = collapsed;
onHeightUpdated();
}
@@ -376,6 +384,30 @@
return !mHeaderCollapsed;
}
+ /** Returns true if personal/work tabs are currently in use. */
+ public boolean usingTabs() {
+ return !mTabsHidden;
+ }
+
+ ViewGroup getTabLayout() {
+ return mTabLayout;
+ }
+
+ /** Calculates the combined height of any floating rows (e.g. predicted apps, app divider). */
+ private void updateFloatingRowsHeight() {
+ mFloatingRowsHeight =
+ Arrays.stream(mAllRows).mapToInt(FloatingHeaderRow::getExpectedHeight).sum();
+ }
+
+ /** Gets the combined height of any floating rows (e.g. predicted apps, app divider). */
+ int getFloatingRowsHeight() {
+ return mFloatingRowsHeight;
+ }
+
+ int getTabsAdditionalPaddingBottom() {
+ return mTabsAdditionalPaddingBottom;
+ }
+
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mTranslationY = (Integer) animation.getAnimatedValue();
@@ -447,9 +479,10 @@
// 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) {
+ if (mTabsHidden || mFloatingRowsCollapsed || !mHeaderCollapsed) {
return 0;
}
- return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0);
+ return Math.max(0,
+ getTabLayout().getBottom() - getPaddingTop() + getPaddingBottom() + mTranslationY);
}
}
diff --git a/src/com/android/launcher3/allapps/SearchRecyclerView.java b/src/com/android/launcher3/allapps/SearchRecyclerView.java
index 482bd29..9d1dfc0 100644
--- a/src/com/android/launcher3/allapps/SearchRecyclerView.java
+++ b/src/com/android/launcher3/allapps/SearchRecyclerView.java
@@ -17,12 +17,17 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.core.util.Consumer;
import com.android.launcher3.views.RecyclerViewFastScroller;
/** A RecyclerView for AllApps Search results. */
public class SearchRecyclerView extends AllAppsRecyclerView {
- private static final String TAG = "SearchRecyclerView";
+
+ private Consumer<View> mChildAttachedConsumer;
public SearchRecyclerView(Context context) {
this(context, null);
@@ -41,6 +46,11 @@
super(context, attrs, defStyleAttr, defStyleRes);
}
+ /** This will be called just before a new child is attached to the window. */
+ public void setChildAttachedConsumer(Consumer<View> childAttachedConsumer) {
+ mChildAttachedConsumer = childAttachedConsumer;
+ }
+
@Override
protected void updatePoolSize() {
RecycledViewPool pool = getRecycledViewPool();
@@ -57,4 +67,12 @@
public RecyclerViewFastScroller getScrollbar() {
return null;
}
+
+ @Override
+ public void onChildAttachedToWindow(@NonNull View child) {
+ if (mChildAttachedConsumer != null) {
+ mChildAttachedConsumer.accept(child);
+ }
+ super.onChildAttachedToWindow(child);
+ }
}
diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java
new file mode 100644
index 0000000..4be715b
--- /dev/null
+++ b/src/com/android/launcher3/allapps/SearchTransitionController.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.allapps;
+
+import static android.view.View.VISIBLE;
+
+import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
+
+import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
+import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
+import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
+import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.launcher3.anim.Interpolators.clampToProgress;
+
+import android.animation.ObjectAnimator;
+import android.graphics.drawable.Drawable;
+import android.util.FloatProperty;
+import android.view.View;
+import android.view.animation.Interpolator;
+
+import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherState;
+
+/** Coordinates the transition between Search and A-Z in All Apps. */
+public class SearchTransitionController {
+
+ // Interpolator when the user taps the QSB while already in All Apps.
+ private static final Interpolator DEFAULT_INTERPOLATOR_WITHIN_ALL_APPS = DEACCEL_1_7;
+ // Interpolator when the user taps the QSB from home screen, so transition to all apps is
+ // happening simultaneously.
+ private static final Interpolator DEFAULT_INTERPOLATOR_TRANSITIONING_TO_ALL_APPS = LINEAR;
+
+ /**
+ * These values represent points on the [0, 1] animation progress spectrum. They are used to
+ * animate items in the {@link SearchRecyclerView}.
+ */
+ private static final float TOP_CONTENT_FADE_PROGRESS_START = 0.133f;
+ private static final float CONTENT_FADE_PROGRESS_DURATION = 0.083f;
+ private static final float TOP_BACKGROUND_FADE_PROGRESS_START = 0.633f;
+ private static final float BACKGROUND_FADE_PROGRESS_DURATION = 0.15f;
+ private static final float CONTENT_STAGGER = 0.01f; // Progress before next item starts fading.
+
+ private static final FloatProperty<SearchTransitionController> SEARCH_TO_AZ_PROGRESS =
+ new FloatProperty<SearchTransitionController>("searchToAzProgress") {
+ @Override
+ public Float get(SearchTransitionController controller) {
+ return controller.getSearchToAzProgress();
+ }
+
+ @Override
+ public void setValue(SearchTransitionController controller, float progress) {
+ controller.setSearchToAzProgress(progress);
+ }
+ };
+
+ private final ActivityAllAppsContainerView<?> mAllAppsContainerView;
+
+ private ObjectAnimator mSearchToAzAnimator = null;
+ private float mSearchToAzProgress = 1f;
+
+ public SearchTransitionController(ActivityAllAppsContainerView<?> allAppsContainerView) {
+ mAllAppsContainerView = allAppsContainerView;
+ }
+
+ /** Returns true if a transition animation is currently in progress. */
+ public boolean isRunning() {
+ return mSearchToAzAnimator != null;
+ }
+
+ /**
+ * Starts the transition to or from search state. If a transition is already in progress, the
+ * animation will start from that point with the new duration, and the previous onEndRunnable
+ * will not be called.
+ *
+ * @param goingToSearch true if will be showing search results, otherwise will be showing a-z
+ * @param duration time in ms for the animation to run
+ * @param onEndRunnable will be called when the animation finishes, unless another animation is
+ * scheduled in the meantime
+ */
+ public void animateToSearchState(boolean goingToSearch, long duration, Runnable onEndRunnable) {
+ float targetProgress = goingToSearch ? 0 : 1;
+
+ if (mSearchToAzAnimator != null) {
+ mSearchToAzAnimator.cancel();
+ }
+
+ mSearchToAzAnimator = ObjectAnimator.ofFloat(this, SEARCH_TO_AZ_PROGRESS, targetProgress);
+ boolean inAllApps = Launcher.getLauncher(
+ mAllAppsContainerView.getContext()).getStateManager().isInStableState(
+ LauncherState.ALL_APPS);
+ mSearchToAzAnimator.setDuration(duration).setInterpolator(
+ inAllApps ? DEFAULT_INTERPOLATOR_WITHIN_ALL_APPS
+ : DEFAULT_INTERPOLATOR_TRANSITIONING_TO_ALL_APPS);
+ mSearchToAzAnimator.addListener(forEndCallback(() -> mSearchToAzAnimator = null));
+ if (!goingToSearch) {
+ mSearchToAzAnimator.addListener(forSuccessCallback(() -> {
+ mAllAppsContainerView.getFloatingHeaderView().setFloatingRowsCollapsed(false);
+ mAllAppsContainerView.getFloatingHeaderView().reset(false /* animate */);
+ mAllAppsContainerView.getAppsRecyclerViewContainer().setTranslationY(0);
+ }));
+ }
+ mSearchToAzAnimator.addListener(forSuccessCallback(onEndRunnable));
+
+ mAllAppsContainerView.getFloatingHeaderView().setFloatingRowsCollapsed(true);
+ mAllAppsContainerView.getAppsRecyclerViewContainer().setVisibility(VISIBLE);
+ getSearchRecyclerView().setVisibility(VISIBLE);
+ getSearchRecyclerView().setChildAttachedConsumer(this::onSearchChildAttached);
+ mSearchToAzAnimator.start();
+ }
+
+ private SearchRecyclerView getSearchRecyclerView() {
+ return mAllAppsContainerView.getSearchRecyclerView();
+ }
+
+ private void setSearchToAzProgress(float searchToAzProgress) {
+ mSearchToAzProgress = searchToAzProgress;
+ int searchHeight = updateSearchRecyclerViewProgress();
+
+ FloatingHeaderView headerView = mAllAppsContainerView.getFloatingHeaderView();
+
+ // Add predictions + app divider height to account for predicted apps which will now be in
+ // the Search RV instead of the floating header view. Note `getFloatingRowsHeight` returns 0
+ // when predictions are not shown.
+ int appsTranslationY = searchHeight + headerView.getFloatingRowsHeight();
+
+ if (headerView.usingTabs()) {
+ // Move tabs below the search results, and fade them out in 20% of the animation.
+ headerView.setTranslationY(searchHeight);
+ headerView.setAlpha(clampToProgress(searchToAzProgress, 0.8f, 1f));
+
+ // Account for the additional padding added for the tabs.
+ appsTranslationY -=
+ headerView.getPaddingTop() - headerView.getTabsAdditionalPaddingBottom();
+ }
+
+ View appsContainer = mAllAppsContainerView.getAppsRecyclerViewContainer();
+ appsContainer.setTranslationY(appsTranslationY);
+ // Fade apps out with tabs (in 20% of the total animation).
+ appsContainer.setAlpha(clampToProgress(searchToAzProgress, 0.8f, 1f));
+ }
+
+ /**
+ * Updates the children views of SearchRecyclerView based on the current animation progress.
+ *
+ * @return the total height of animating views (excluding any app icons).
+ */
+ private int updateSearchRecyclerViewProgress() {
+ int numSearchResultsAnimated = 0;
+ int totalHeight = 0;
+ int appRowHeight = 0;
+ Integer top = null;
+ SearchRecyclerView searchRecyclerView = getSearchRecyclerView();
+ for (int i = 0; i < searchRecyclerView.getChildCount(); i++) {
+ View searchResultView = searchRecyclerView.getChildAt(i);
+ if (searchResultView == null) {
+ continue;
+ }
+
+ if (top == null) {
+ top = searchResultView.getTop();
+ }
+
+ if (searchResultView instanceof BubbleTextView) {
+ // The first app icon will set appRowHeight, which will also contribute to
+ // totalHeight. Additional app icons should remove the appRowHeight to remain in
+ // the same row as the first app.
+ searchResultView.setY(top + totalHeight - appRowHeight);
+ if (appRowHeight == 0) {
+ appRowHeight = searchResultView.getHeight();
+ totalHeight += appRowHeight;
+ }
+ // Don't scale/fade app row.
+ continue;
+ }
+
+ // Adjust content alpha based on start progress and stagger.
+ float startContentFadeProgress = Math.max(0,
+ TOP_CONTENT_FADE_PROGRESS_START - CONTENT_STAGGER * numSearchResultsAnimated);
+ float endContentFadeProgress = Math.min(1,
+ startContentFadeProgress + CONTENT_FADE_PROGRESS_DURATION);
+ searchResultView.setAlpha(1 - clampToProgress(mSearchToAzProgress,
+ startContentFadeProgress, endContentFadeProgress));
+
+ // Adjust background (or decorator) alpha based on start progress and stagger.
+ float startBackgroundFadeProgress = Math.max(0,
+ TOP_BACKGROUND_FADE_PROGRESS_START
+ - CONTENT_STAGGER * numSearchResultsAnimated);
+ float endBackgroundFadeProgress = Math.min(1,
+ startBackgroundFadeProgress + BACKGROUND_FADE_PROGRESS_DURATION);
+ float backgroundAlpha = 1 - clampToProgress(mSearchToAzProgress,
+ startBackgroundFadeProgress, endBackgroundFadeProgress);
+ int adapterPosition = searchRecyclerView.getChildAdapterPosition(searchResultView);
+ boolean decoratorFilled =
+ adapterPosition != NO_POSITION
+ && searchRecyclerView.getApps().getAdapterItems().get(adapterPosition)
+ .setDecorationFillAlpha((int) (255 * backgroundAlpha));
+ if (!decoratorFilled) {
+ // Try to adjust background alpha instead (e.g. for Search Edu card).
+ Drawable background = searchResultView.getBackground();
+ if (background != null) {
+ background.setAlpha((int) (255 * backgroundAlpha));
+ }
+ }
+
+ float scaleY = 1 - mSearchToAzProgress;
+ int scaledHeight = (int) (searchResultView.getHeight() * scaleY);
+ searchResultView.setScaleY(scaleY);
+ searchResultView.setY(top + totalHeight);
+
+ numSearchResultsAnimated++;
+ totalHeight += scaledHeight;
+ }
+
+ return totalHeight - appRowHeight;
+ }
+
+ /** Called just before a child is attached to the SearchRecyclerView. */
+ private void onSearchChildAttached(View child) {
+ // Avoid allocating hardware layers for alpha changes.
+ child.forceHasOverlappingRendering(false);
+ child.setPivotY(0);
+ if (mSearchToAzProgress > 0) {
+ // Before the child is rendered, apply the animation including it to avoid flicker.
+ updateSearchRecyclerViewProgress();
+ } else {
+ // Apply default states without processing the full layout.
+ child.setAlpha(1);
+ child.setScaleY(1);
+ child.setTranslationY(0);
+ int adapterPosition = getSearchRecyclerView().getChildAdapterPosition(child);
+ if (adapterPosition != NO_POSITION) {
+ getSearchRecyclerView().getApps().getAdapterItems().get(adapterPosition)
+ .setDecorationFillAlpha(255);
+ }
+ if (child.getBackground() != null) {
+ child.getBackground().setAlpha(255);
+ }
+ }
+ }
+
+ private float getSearchToAzProgress() {
+ return mSearchToAzProgress;
+ }
+}
diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java
index aee7c4c..a589448 100644
--- a/src/com/android/launcher3/allapps/WorkModeSwitch.java
+++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java
@@ -91,12 +91,12 @@
MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
if (lp != null) {
int bottomMargin = getResources().getDimensionPixelSize(R.dimen.work_fab_margin_bottom);
+ DeviceProfile dp = ActivityContext.lookupContext(getContext()).getDeviceProfile();
if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
bottomMargin <<= 1; // Double margin to add space above search bar.
- bottomMargin += getResources().getDimensionPixelSize(R.dimen.qsb_widget_height);
+ bottomMargin += dp.hotseatQsbHeight;
}
- DeviceProfile dp = ActivityContext.lookupContext(getContext()).getDeviceProfile();
if (!dp.isGestureMode) {
if (dp.isTaskbarPresent) {
bottomMargin += dp.taskbarSize;
@@ -170,12 +170,14 @@
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
- if (Utilities.ATLEAST_R && isEnabled()) {
+ if (!Utilities.ATLEAST_R) {
+ return insets;
+ }
+ if (insets.isVisible(WindowInsets.Type.ime())) {
+ Insets keyboardInsets = insets.getInsets(WindowInsets.Type.ime());
+ setTranslationY(mInsets.bottom - keyboardInsets.bottom);
+ } else {
setTranslationY(0);
- if (insets.isVisible(WindowInsets.Type.ime())) {
- Insets keyboardInsets = insets.getInsets(WindowInsets.Type.ime());
- setTranslationY(mInsets.bottom - keyboardInsets.bottom);
- }
}
return insets;
}
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 6539c05..78c305b 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -131,7 +131,7 @@
public void initializeSearch(ActivityAllAppsContainerView<?> appsView) {
mAppsView = appsView;
mSearchBarController.initialize(
- new DefaultAppSearchAlgorithm(getContext()),
+ new DefaultAppSearchAlgorithm(getContext(), true),
this, mLauncher, this);
}
@@ -168,14 +168,11 @@
public void onSearchResult(String query, ArrayList<AdapterItem> items) {
if (items != null) {
mAppsView.setSearchResults(items);
- mAppsView.setLastSearchQuery(query);
}
}
@Override
public void clearSearchResult() {
- mAppsView.setSearchResults(null);
-
// Clear the search query
mSearchQueryBuilder.clear();
mSearchQueryBuilder.clearSpans();
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index 4eceb71..ab47097 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -15,12 +15,14 @@
*/
package com.android.launcher3.allapps.search;
+import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.content.Context;
import android.os.Handler;
import androidx.annotation.AnyThread;
+import androidx.annotation.NonNull;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
@@ -44,10 +46,16 @@
private final LauncherAppState mAppState;
private final Handler mResultHandler;
+ private final boolean mAddNoResultsMessage;
public DefaultAppSearchAlgorithm(Context context) {
+ this(context, false);
+ }
+
+ public DefaultAppSearchAlgorithm(Context context, boolean addNoResultsMessage) {
mAppState = LauncherAppState.getInstance(context);
mResultHandler = new Handler(MAIN_EXECUTOR.getLooper());
+ mAddNoResultsMessage = addNoResultsMessage;
}
@Override
@@ -61,13 +69,26 @@
public void doSearch(String query, SearchCallback<AdapterItem> callback) {
mAppState.getModel().enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
ArrayList<AdapterItem> result = getTitleMatchResult(apps.data, query);
+ if (mAddNoResultsMessage && result.isEmpty()) {
+ result.add(getEmptyMessageAdapterItem(query));
+ }
mResultHandler.post(() -> callback.onSearchResult(query, result));
}
});
}
+ private static AdapterItem getEmptyMessageAdapterItem(String query) {
+ AdapterItem item = new AdapterItem(VIEW_TYPE_EMPTY_SEARCH);
+ // Add a place holder info to propagate the query
+ AppInfo placeHolder = new AppInfo();
+ placeHolder.title = query;
+ item.itemInfo = placeHolder;
+ return item;
+ }
+
/**
* Filters {@link AppInfo}s matching specified query
*/
diff --git a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
index a95bd51..4fb732d 100644
--- a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
+++ b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
@@ -84,4 +84,9 @@
public RecyclerView.ItemDecoration getDecorator() {
return mDecoration;
}
+
+ @Override
+ public void clearHighlightedItem() {
+ mHighlightedView = null;
+ }
}
diff --git a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
index bc52784..3890741 100644
--- a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
+++ b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
@@ -58,4 +58,9 @@
* Returns the item decorator.
*/
public abstract RecyclerView.ItemDecoration getDecorator();
+
+ /**
+ * Clear the highlighted view.
+ */
+ public abstract void clearHighlightedItem();
}
diff --git a/src/com/android/launcher3/anim/AnimationSuccessListener.java b/src/com/android/launcher3/anim/AnimationSuccessListener.java
index a312070..6196df2 100644
--- a/src/com/android/launcher3/anim/AnimationSuccessListener.java
+++ b/src/com/android/launcher3/anim/AnimationSuccessListener.java
@@ -19,6 +19,8 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
+import androidx.annotation.CallSuper;
+
/**
* Extension of {@link AnimatorListenerAdapter} for listening for non-cancelled animations
*/
@@ -27,6 +29,7 @@
protected boolean mCancelled = false;
@Override
+ @CallSuper
public void onAnimationCancel(Animator animation) {
mCancelled = true;
}
diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java
index 0a77aa7..d900c90 100644
--- a/src/com/android/launcher3/anim/Interpolators.java
+++ b/src/com/android/launcher3/anim/Interpolators.java
@@ -57,6 +57,10 @@
public static final Interpolator DECELERATED_EASE = new PathInterpolator(0, 0, .2f, 1f);
public static final Interpolator ACCELERATED_EASE = new PathInterpolator(0.4f, 0, 1f, 1f);
+ /**
+ * The default emphasized interpolator. Used for hero / emphasized movement of content.
+ */
+ public static final Interpolator EMPHASIZED = createEmphasizedInterpolator();
public static final Interpolator EMPHASIZED_ACCELERATE = new PathInterpolator(
0.3f, 0f, 0.8f, 0.15f);
public static final Interpolator EMPHASIZED_DECELERATE = new PathInterpolator(
@@ -79,6 +83,7 @@
EXAGGERATED_EASE = new PathInterpolator(exaggeratedEase);
}
+ public static final Interpolator OVERSHOOT_0_85 = new OvershootInterpolator(0.85f);
public static final Interpolator OVERSHOOT_1_2 = new OvershootInterpolator(1.2f);
public static final Interpolator OVERSHOOT_1_7 = new OvershootInterpolator(1.7f);
@@ -87,7 +92,6 @@
public static final Interpolator TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL =
v -> ACCEL_DEACCEL.getInterpolation(TOUCH_RESPONSE_INTERPOLATOR.getInterpolation(v));
-
/**
* Inversion of ZOOM_OUT, compounded with an ease-out.
*/
@@ -218,4 +222,14 @@
public static Interpolator reverse(Interpolator interpolator) {
return t -> 1 - interpolator.getInterpolation(1 - t);
}
+
+ // Create the default emphasized interpolator
+ private static PathInterpolator createEmphasizedInterpolator() {
+ Path path = new Path();
+ // Doing the same as fast_out_extra_slow_in
+ path.moveTo(0f, 0f);
+ path.cubicTo(0.05f, 0f, 0.133333f, 0.06f, 0.166666f, 0.4f);
+ path.cubicTo(0.208333f, 0.82f, 0.25f, 1f, 1f, 1f);
+ return new PathInterpolator(path);
+ }
}
diff --git a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
index dd58123..770e931 100644
--- a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
+++ b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
@@ -27,7 +27,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
public class AccessibilityManagerCompat {
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 4fd13b2..ef6350e 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -63,15 +63,20 @@
* Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"),
* and set a default value for the flag. This will be the default value on Debug builds.
*/
+ public static final BooleanFlag ENABLE_INPUT_CONSUMER_REASON_LOGGING = getDebugFlag(
+ "ENABLE_INPUT_CONSUMER_REASON_LOGGING",
+ true,
+ "Log the reason why an Input Consumer was selected for a gesture.");
+
+ public static final BooleanFlag ENABLE_GESTURE_ERROR_DETECTION = getDebugFlag(
+ "ENABLE_GESTURE_ERROR_DETECTION",
+ true,
+ "Analyze gesture events and log detected errors");
+
// When enabled the promise icon is visible in all apps while installation an app.
public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(
"PROMISE_APPS_IN_ALL_APPS", false, "Add promise icon in all-apps");
- // When enabled a promise icon is added to the home screen when install session is active.
- public static final BooleanFlag PROMISE_APPS_NEW_INSTALLS = getDebugFlag(
- "PROMISE_APPS_NEW_INSTALLS", true,
- "Adds a promise icon to the home screen for new install sessions.");
-
// TODO: b/206508141: Long pressing on some icons on home screen cause launcher to crash.
public static final BooleanFlag ENABLE_LOCAL_COLOR_POPUPS = getDebugFlag(
"ENABLE_LOCAL_COLOR_POPUPS", false, "Enable local color extraction for popups.");
@@ -82,10 +87,6 @@
public static final BooleanFlag ENABLE_QUICKSTEP_LIVE_TILE = getDebugFlag(
"ENABLE_QUICKSTEP_LIVE_TILE", true, "Enable live tile in Quickstep overview");
- public static final BooleanFlag ENABLE_QUICKSTEP_WIDGET_APP_START = getDebugFlag(
- "ENABLE_QUICKSTEP_WIDGET_APP_START", true,
- "Enable Quickstep animation when launching activities from an app widget");
-
public static final BooleanFlag ENABLE_DEVICE_SEARCH = new DeviceFlag(
"ENABLE_DEVICE_SEARCH", true, "Allows on device search in all apps");
@@ -116,30 +117,14 @@
"ENABLE_PEOPLE_TILE_PREVIEW", false,
"Experimental: Shows conversation shortcuts on home screen as search results");
- public static final BooleanFlag FOLDER_NAME_SUGGEST = new DeviceFlag(
- "FOLDER_NAME_SUGGEST", true,
- "Suggests folder names instead of blank text.");
-
public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(
"FOLDER_NAME_MAJORITY_RANKING", true,
"Suggests folder names based on majority based ranking.");
- public static final BooleanFlag ENABLE_PREDICTION_DISMISS = getDebugFlag(
- "ENABLE_PREDICTION_DISMISS", true, "Allow option to dimiss apps from predicted list");
-
public static final BooleanFlag ASSISTANT_GIVES_LAUNCHER_FOCUS = getDebugFlag(
"ASSISTANT_GIVES_LAUNCHER_FOCUS", false,
"Allow Launcher to handle nav bar gestures while Assistant is running over it");
- public static final BooleanFlag HOTSEAT_MIGRATE_TO_FOLDER = getDebugFlag(
- "HOTSEAT_MIGRATE_TO_FOLDER", false, "Should move hotseat items into a folder");
-
- public static final BooleanFlag ENABLE_DEEP_SHORTCUT_ICON_CACHE = getDebugFlag(
- "ENABLE_DEEP_SHORTCUT_ICON_CACHE", true, "R/W deep shortcut in IconCache");
-
- public static final BooleanFlag ENABLE_THEMED_ICONS = getDebugFlag(
- "ENABLE_THEMED_ICONS", true, "Enable themed icons on workspace");
-
public static final BooleanFlag ENABLE_BULK_WORKSPACE_ICON_LOADING = getDebugFlag(
"ENABLE_BULK_WORKSPACE_ICON_LOADING",
true,
@@ -169,15 +154,18 @@
"ENABLE_SMARTSPACE_DISMISS", true,
"Adds a menu option to dismiss the current Enhanced Smartspace card.");
+ /**
+ * Enables region sampling for text color: Needs system health assessment before turning on
+ */
+ public static final BooleanFlag ENABLE_REGION_SAMPLING = getDebugFlag(
+ "ENABLE_REGION_SAMPLING", false,
+ "Enable region sampling to determine color of text on screen.");
+
public static final BooleanFlag ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS =
getDebugFlag(
"ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", false,
"Always use hardware optimization for folder animations.");
- public static final BooleanFlag ENABLE_ALL_APPS_EDU = getDebugFlag(
- "ENABLE_ALL_APPS_EDU", true,
- "Shows user a tutorial on how to get to All Apps after X amount of attempts.");
-
public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(
"SEPARATE_RECENTS_ACTIVITY", false,
"Uses a separate recents activity instead of using the integrated recents+Launcher UI");
@@ -186,10 +174,6 @@
"ENABLE_MINIMAL_DEVICE", false,
"Allow user to toggle minimal device mode in launcher.");
- public static final BooleanFlag EXPANDED_SMARTSPACE = new DeviceFlag(
- "EXPANDED_SMARTSPACE", false, "Expands smartspace height to two rows. "
- + "Any apps occupying the first row will be removed from workspace.");
-
// TODO: b/172467144 Remove ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE feature flag.
public static final BooleanFlag ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE = new DeviceFlag(
"ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE", false, "Enables a "
@@ -265,6 +249,11 @@
public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = new DeviceFlag(
"ENABLE_ONE_SEARCH_MOTION", true, "Enables animations in OneSearch.");
+ public static final BooleanFlag ENABLE_KEYBOARD_TRANSITION_SYNC = new DeviceFlag(
+ "ENABLE_KEYBOARD_TRANSITION_SYNC", IS_STUDIO_BUILD,
+ "Enable option to synchronize the keyboard open and close animations when transitioning"
+ + " between home and all apps");
+
public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = new DeviceFlag(
"ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", true,
"Enable option to show keyboard when going to all-apps");
@@ -288,6 +277,21 @@
public static final BooleanFlag CONTINUOUS_VIEW_TREE_CAPTURE = getDebugFlag(
"CONTINUOUS_VIEW_TREE_CAPTURE", false, "Capture View tree every frame");
+ public static final BooleanFlag FOLDABLE_WORKSPACE_REORDER = getDebugFlag(
+ "FOLDABLE_WORKSPACE_REORDER", true,
+ "In foldables, when reordering the icons and widgets, is now going to use both sides");
+
+ public static final BooleanFlag SHOW_SEARCH_EDUCARD_QSB = new DeviceFlag(
+ "SHOW_SEARCH_EDUCARD_QSB", false, "Shows Search Educard for QSB entry in OneSearch.");
+
+ public static final BooleanFlag ENABLE_IME_LATENCY_LOGGER = getDebugFlag(
+ "ENABLE_IME_LATENCY_LOGGER", false,
+ "Enable option to log the keyboard latency for both atomic and controlled keyboard "
+ + "animations on an EditText");
+
+ public static final BooleanFlag ENABLE_WIDGET_PICKER_DEPTH = new DeviceFlag(
+ "ENABLE_WIDGET_PICKER_DEPTH", false, "Enable changing depth in widget picker.");
+
public static void initialize(Context context) {
synchronized (sDebugFlags) {
for (DebugFlag flag : sDebugFlags) {
diff --git a/src/com/android/launcher3/dragndrop/AddItemActivity.java b/src/com/android/launcher3/dragndrop/AddItemActivity.java
index 466b268..05b1984 100644
--- a/src/com/android/launcher3/dragndrop/AddItemActivity.java
+++ b/src/com/android/launcher3/dragndrop/AddItemActivity.java
@@ -31,6 +31,7 @@
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.Intent;
+import android.content.pm.ApplicationInfo;
import android.content.pm.LauncherApps.PinItemRequest;
import android.content.pm.ShortcutInfo;
import android.content.res.Configuration;
@@ -62,6 +63,8 @@
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.pm.PinRequestHelper;
+import com.android.launcher3.util.PackageManagerHelper;
+import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.views.AbstractSlideInView;
import com.android.launcher3.views.BaseDragLayer;
@@ -136,13 +139,25 @@
mAccessibilityManager =
getApplicationContext().getSystemService(AccessibilityManager.class);
- if (mRequest.getRequestType() == PinItemRequest.REQUEST_TYPE_SHORTCUT) {
- setupShortcut();
- } else {
- if (!setupWidget()) {
- // TODO: show error toast?
- finish();
- }
+ PackageUserKey targetApp = null;
+ switch (mRequest.getRequestType()) {
+ case PinItemRequest.REQUEST_TYPE_SHORTCUT:
+ targetApp = setupShortcut();
+ break;
+ case PinItemRequest.REQUEST_TYPE_APPWIDGET:
+ targetApp = setupWidget();
+ break;
+ }
+ if (targetApp == null) {
+ // TODO: show error toast?
+ finish();
+ return;
+ }
+ ApplicationInfo info = new PackageManagerHelper(this)
+ .getApplicationInfo(targetApp.mPackageName, targetApp.mUser, 0);
+ if (info == null) {
+ finish();
+ return;
}
WidgetCellPreview previewContainer = mWidgetCell.findViewById(
@@ -156,8 +171,10 @@
logCommand(LAUNCHER_ADD_EXTERNAL_ITEM_START);
}
+ // Set the label synchronously instead of via IconCache as this is the first thing
+ // user sees
TextView widgetAppName = findViewById(R.id.widget_appName);
- widgetAppName.setText(getApplicationInfo().labelRes);
+ widgetAppName.setText(info.loadLabel(getPackageManager()));
mSlideInView = findViewById(R.id.add_item_bottom_sheet);
mSlideInView.addOnCloseListener(this);
@@ -246,20 +263,23 @@
}
}
- private void setupShortcut() {
+ private PackageUserKey setupShortcut() {
PinShortcutRequestActivityInfo shortcutInfo =
new PinShortcutRequestActivityInfo(mRequest, this);
mWidgetCell.getWidgetView().setTag(new PendingAddShortcutInfo(shortcutInfo));
applyWidgetItemAsync(
() -> new WidgetItem(shortcutInfo, mApp.getIconCache(), getPackageManager()));
+ return new PackageUserKey(
+ mRequest.getShortcutInfo().getPackage(),
+ mRequest.getShortcutInfo().getUserHandle());
}
- private boolean setupWidget() {
+ private PackageUserKey setupWidget() {
LauncherAppWidgetProviderInfo widgetInfo = LauncherAppWidgetProviderInfo
.fromProviderInfo(this, mRequest.getAppWidgetProviderInfo(this));
if (widgetInfo.minSpanX > mIdp.numColumns || widgetInfo.minSpanY > mIdp.numRows) {
// Cannot add widget
- return false;
+ return null;
}
mWidgetCell.setRemoteViewsPreview(PinItemDragListener.getPreview(mRequest));
@@ -274,7 +294,7 @@
mWidgetCell.getWidgetView().setTag(pendingInfo);
applyWidgetItemAsync(() -> new WidgetItem(widgetInfo, mIdp, mApp.getIconCache()));
- return true;
+ return new PackageUserKey(widgetInfo.provider.getPackageName(), widgetInfo.getUser());
}
private void applyWidgetItemAsync(final Supplier<WidgetItem> itemProvider) {
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 35cdfef..8616f35 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -34,7 +34,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.testing.shared.TestProtocol;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.ActivityContext;
diff --git a/src/com/android/launcher3/dragndrop/LauncherDragController.java b/src/com/android/launcher3/dragndrop/LauncherDragController.java
index dcbfa50..75f4ad6 100644
--- a/src/com/android/launcher3/dragndrop/LauncherDragController.java
+++ b/src/com/android/launcher3/dragndrop/LauncherDragController.java
@@ -37,7 +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;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Drag controller for Launcher activity
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index e68ebdb..7e14912 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -368,9 +368,7 @@
public void startEditingFolderName() {
post(() -> {
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- showLabelSuggestions();
- }
+ showLabelSuggestions();
mFolderName.setHint("");
mIsEditingName = true;
});
@@ -1080,8 +1078,7 @@
if (!items.isEmpty()) {
mLauncherDelegate.getModelWriter().moveItemsInDatabase(items, mInfo.id, 0);
}
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get() && !isBind
- && total > 1 /* no need to update if there's one icon */) {
+ if (!isBind && total > 1 /* no need to update if there's one icon */) {
Executors.MODEL_EXECUTOR.post(() -> {
FolderNameInfos nameInfos = new FolderNameInfos();
FolderNameProvider fnp = FolderNameProvider.newInstance(getContext());
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index b1e2701..33e0902 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -57,7 +57,6 @@
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dot.FolderDotInfo;
import com.android.launcher3.dragndrop.BaseItemDragListener;
import com.android.launcher3.dragndrop.DragLayer;
@@ -418,35 +417,23 @@
if (!itemAdded) mPreviewItemManager.hidePreviewItem(index, true);
FolderNameInfos nameInfos = new FolderNameInfos();
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- Executors.MODEL_EXECUTOR.post(() -> {
- d.folderNameProvider.getSuggestedFolderName(
- getContext(), mInfo.contents, nameInfos);
- showFinalView(finalIndex, item, nameInfos, d.logInstanceId);
- });
- } else {
- showFinalView(finalIndex, item, nameInfos, d.logInstanceId);
- }
+ Executors.MODEL_EXECUTOR.post(() -> {
+ d.folderNameProvider.getSuggestedFolderName(
+ getContext(), mInfo.contents, nameInfos);
+ postDelayed(() -> {
+ setLabelSuggestion(nameInfos, d.logInstanceId);
+ invalidate();
+ }, DROP_IN_ANIMATION_DURATION);
+ });
} else {
addItem(item);
}
}
- private void showFinalView(int finalIndex, final WorkspaceItemInfo item,
- FolderNameInfos nameInfos, InstanceId instanceId) {
- postDelayed(() -> {
- setLabelSuggestion(nameInfos, instanceId);
- invalidate();
- }, DROP_IN_ANIMATION_DURATION);
- }
-
/**
* Set the suggested folder name.
*/
public void setLabelSuggestion(FolderNameInfos nameInfos, InstanceId instanceId) {
- if (!FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- return;
- }
if (!mInfo.getLabelState().equals(LabelState.UNLABELED)) {
return;
}
diff --git a/src/com/android/launcher3/folder/FolderNameProvider.java b/src/com/android/launcher3/folder/FolderNameProvider.java
index 5021644..bf59594 100644
--- a/src/com/android/launcher3/folder/FolderNameProvider.java
+++ b/src/com/android/launcher3/folder/FolderNameProvider.java
@@ -24,6 +24,7 @@
import android.text.TextUtils;
import android.util.Log;
+import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;
import com.android.launcher3.LauncherAppState;
@@ -192,7 +193,8 @@
private class FolderNameWorker extends BaseModelUpdateTask {
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList apps) {
mFolderInfos = dataModel.folders.clone();
mAppInfos = Arrays.asList(apps.copyData());
}
diff --git a/src/com/android/launcher3/graphics/DragPreviewProvider.java b/src/com/android/launcher3/graphics/DragPreviewProvider.java
index f027b33..7457f30 100644
--- a/src/com/android/launcher3/graphics/DragPreviewProvider.java
+++ b/src/com/android/launcher3/graphics/DragPreviewProvider.java
@@ -16,24 +16,16 @@
package com.android.launcher3.graphics;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-
import android.content.Context;
import android.graphics.Bitmap;
-import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.View;
import androidx.annotation.Nullable;
-import com.android.launcher3.BubbleTextView;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DraggableView;
import com.android.launcher3.icons.BitmapRenderer;
import com.android.launcher3.icons.FastBitmapDrawable;
@@ -41,8 +33,6 @@
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
-import java.nio.ByteBuffer;
-
/**
* A utility class to generate preview bitmap for dragging.
*/
@@ -57,9 +47,6 @@
public final int blurSizeOutline;
- private OutlineGeneratorCallback mOutlineGeneratorCallback;
- public Bitmap generatedDragOutline;
-
public DragPreviewProvider(View view) {
this(view, view.getContext());
}
@@ -129,15 +116,6 @@
return null;
}
- public final void generateDragOutline(Bitmap preview) {
- if (FeatureFlags.IS_STUDIO_BUILD && mOutlineGeneratorCallback != null) {
- throw new RuntimeException("Drag outline generated twice");
- }
-
- mOutlineGeneratorCallback = new OutlineGeneratorCallback(preview);
- UI_HELPER_EXECUTOR.post(mOutlineGeneratorCallback);
- }
-
protected static Rect getDrawableBounds(Drawable d) {
Rect bounds = new Rect();
d.copyBounds(bounds);
@@ -184,92 +162,4 @@
protected Bitmap convertPreviewToAlphaBitmap(Bitmap preview) {
return preview.copy(Bitmap.Config.ALPHA_8, true);
}
-
- private class OutlineGeneratorCallback implements Runnable {
-
- private final Bitmap mPreviewSnapshot;
- private final Context mContext;
- private final boolean mIsIcon;
-
- OutlineGeneratorCallback(Bitmap preview) {
- mPreviewSnapshot = preview;
- mContext = mView.getContext();
- mIsIcon = mView instanceof BubbleTextView;
- }
-
- @Override
- public void run() {
- Bitmap preview = convertPreviewToAlphaBitmap(mPreviewSnapshot);
- if (mIsIcon) {
- int size = ActivityContext.lookupContext(mContext).getDeviceProfile().iconSizePx;
- preview = Bitmap.createScaledBitmap(preview, size, size, false);
- }
- //else case covers AppWidgetHost (doesn't drag/drop across different device profiles)
-
- // We start by removing most of the alpha channel so as to ignore shadows, and
- // other types of partial transparency when defining the shape of the object
- byte[] pixels = new byte[preview.getWidth() * preview.getHeight()];
- ByteBuffer buffer = ByteBuffer.wrap(pixels);
- buffer.rewind();
- preview.copyPixelsToBuffer(buffer);
-
- for (int i = 0; i < pixels.length; i++) {
- if ((pixels[i] & 0xFF) < 188) {
- pixels[i] = 0;
- }
- }
-
- buffer.rewind();
- preview.copyPixelsFromBuffer(buffer);
-
- final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
- Canvas canvas = new Canvas();
-
- // calculate the outer blur first
- paint.setMaskFilter(new BlurMaskFilter(blurSizeOutline, BlurMaskFilter.Blur.OUTER));
- int[] outerBlurOffset = new int[2];
- Bitmap thickOuterBlur = preview.extractAlpha(paint, outerBlurOffset);
-
- paint.setMaskFilter(new BlurMaskFilter(
- mContext.getResources().getDimension(R.dimen.blur_size_thin_outline),
- BlurMaskFilter.Blur.OUTER));
- int[] brightOutlineOffset = new int[2];
- Bitmap brightOutline = preview.extractAlpha(paint, brightOutlineOffset);
-
- // calculate the inner blur
- canvas.setBitmap(preview);
- canvas.drawColor(0xFF000000, PorterDuff.Mode.SRC_OUT);
- paint.setMaskFilter(new BlurMaskFilter(blurSizeOutline, BlurMaskFilter.Blur.NORMAL));
- int[] thickInnerBlurOffset = new int[2];
- Bitmap thickInnerBlur = preview.extractAlpha(paint, thickInnerBlurOffset);
-
- // mask out the inner blur
- paint.setMaskFilter(null);
- paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
- canvas.setBitmap(thickInnerBlur);
- canvas.drawBitmap(preview, -thickInnerBlurOffset[0],
- -thickInnerBlurOffset[1], paint);
- canvas.drawRect(0, 0, -thickInnerBlurOffset[0], thickInnerBlur.getHeight(), paint);
- canvas.drawRect(0, 0, thickInnerBlur.getWidth(), -thickInnerBlurOffset[1], paint);
-
- // draw the inner and outer blur
- paint.setXfermode(null);
- canvas.setBitmap(preview);
- canvas.drawColor(0, PorterDuff.Mode.CLEAR);
- canvas.drawBitmap(thickInnerBlur, thickInnerBlurOffset[0], thickInnerBlurOffset[1],
- paint);
- canvas.drawBitmap(thickOuterBlur, outerBlurOffset[0], outerBlurOffset[1], paint);
-
- // draw the bright outline
- canvas.drawBitmap(brightOutline, brightOutlineOffset[0], brightOutlineOffset[1], paint);
-
- // cleanup
- canvas.setBitmap(null);
- brightOutline.recycle();
- thickOuterBlur.recycle();
- thickInnerBlur.recycle();
-
- generatedDragOutline = preview;
- }
- }
}
diff --git a/src/com/android/launcher3/graphics/GridCustomizationsProvider.java b/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
index fc8d855..c28bab5 100644
--- a/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
+++ b/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
@@ -26,7 +26,6 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.InvariantDeviceProfile.GridOption;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Executors;
/**
@@ -143,11 +142,9 @@
}
case ICON_THEMED:
case SET_ICON_THEMED: {
- if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
- getPrefs(getContext()).edit()
- .putBoolean(KEY_THEMED_ICONS, values.getAsBoolean(BOOLEAN_VALUE))
- .apply();
- }
+ getPrefs(getContext()).edit()
+ .putBoolean(KEY_THEMED_ICONS, values.getAsBoolean(BOOLEAN_VALUE))
+ .apply();
return 1;
}
default:
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index a8546e8..c1bab54 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -20,6 +20,7 @@
import static android.view.View.MeasureSpec.makeMeasureSpec;
import static android.view.View.VISIBLE;
+import static com.android.launcher3.DeviceProfile.DEFAULT_SCALE;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION;
import static com.android.launcher3.model.ModelUtils.filterCurrentWorkspaceItems;
import static com.android.launcher3.model.ModelUtils.getMissingHotseatRanks;
@@ -36,6 +37,7 @@
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Color;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.ColorDrawable;
@@ -55,6 +57,7 @@
import android.view.WindowManager;
import android.widget.TextClock;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.BubbleTextView;
@@ -100,6 +103,7 @@
import com.android.launcher3.widget.LocalColorExtractor;
import com.android.launcher3.widget.NavigableAppWidgetHostView;
import com.android.launcher3.widget.custom.CustomWidgetManager;
+import com.android.launcher3.widget.util.WidgetSizes;
import java.util.ArrayList;
import java.util.Collections;
@@ -173,6 +177,7 @@
private final Context mContext;
private final InvariantDeviceProfile mIdp;
private final DeviceProfile mDp;
+ private final DeviceProfile mDpOrig;
private final Rect mInsets;
private final WorkspaceItemInfo mWorkspaceItemInfo;
private final LayoutInflater mHomeElementInflater;
@@ -192,7 +197,16 @@
mUiHandler = new Handler(Looper.getMainLooper());
mContext = context;
mIdp = idp;
- mDp = idp.getDeviceProfile(context).copy(context);
+ mDp = idp.getDeviceProfile(context).toBuilder(context).setViewScaleProvider(
+ this::getAppWidgetScale).build();
+ if (context instanceof PreviewContext) {
+ Context tempContext = ((PreviewContext) context).getBaseContext();
+ mDpOrig = new InvariantDeviceProfile(tempContext, InvariantDeviceProfile
+ .getCurrentGridName(tempContext)).getDeviceProfile(tempContext)
+ .copy(tempContext);
+ } else {
+ mDpOrig = mDp;
+ }
WindowInsets currentWindowInsets = context.getSystemService(WindowManager.class)
.getCurrentWindowMetrics().getWindowInsets();
@@ -390,6 +404,41 @@
addInScreenFromBind(view, info);
}
+ @NonNull
+ private PointF getAppWidgetScale(@Nullable ItemInfo itemInfo) {
+ if (!(itemInfo instanceof LauncherAppWidgetInfo)) {
+ return DEFAULT_SCALE;
+ }
+ LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) itemInfo;
+ final Size launcherWidgetSize = mLauncherWidgetSpanInfo.get(info.appWidgetId);
+ if (launcherWidgetSize == null) {
+ return DEFAULT_SCALE;
+ }
+ final Size origSize = WidgetSizes.getWidgetSizePx(mDpOrig,
+ launcherWidgetSize.getWidth(), launcherWidgetSize.getHeight());
+ final Size newSize = WidgetSizes.getWidgetSizePx(mDp, info.spanX, info.spanY);
+ final Rect previewInset = new Rect();
+ final Rect origInset = new Rect();
+ // When the setup() is called for the LayoutParams, insets are added to the width
+ // and height of the view. This is not accounted for in WidgetSizes and is handled
+ // here.
+ if (mDp.shouldInsetWidgets()) {
+ previewInset.set(mDp.inv.defaultWidgetPadding);
+ } else {
+ previewInset.setEmpty();
+ }
+ if (mDpOrig.shouldInsetWidgets()) {
+ origInset.set(mDpOrig.inv.defaultWidgetPadding);
+ } else {
+ origInset.setEmpty();
+ }
+
+ return new PointF((float) newSize.getWidth() / (origSize.getWidth()
+ + origInset.left + origInset.right),
+ (float) newSize.getHeight() / (origSize.getHeight()
+ + origInset.top + origInset.bottom));
+ }
+
private void inflateAndAddPredictedIcon(WorkspaceItemInfo info) {
CellLayout screen = mWorkspaceScreens.get(info.screenId);
View view = PredictedAppIconInflater.inflate(mHomeElementInflater, screen, info);
diff --git a/src/com/android/launcher3/graphics/ShadowDrawable.java b/src/com/android/launcher3/graphics/ShadowDrawable.java
deleted file mode 100644
index d8a7070..0000000
--- a/src/com/android/launcher3/graphics/ShadowDrawable.java
+++ /dev/null
@@ -1,213 +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.graphics;
-
-import android.annotation.TargetApi;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Bitmap;
-import android.graphics.BlurMaskFilter;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.ColorFilter;
-import android.graphics.Paint;
-import android.graphics.PixelFormat;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-import android.util.AttributeSet;
-
-import com.android.launcher3.R;
-import com.android.launcher3.icons.BitmapRenderer;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-/**
- * A drawable which adds shadow around a child drawable.
- */
-@TargetApi(Build.VERSION_CODES.O)
-public class ShadowDrawable extends Drawable {
-
- private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
-
- private final ShadowDrawableState mState;
-
- @SuppressWarnings("unused")
- public ShadowDrawable() {
- this(new ShadowDrawableState());
- }
-
- private ShadowDrawable(ShadowDrawableState state) {
- mState = state;
- }
-
- @Override
- public void draw(Canvas canvas) {
- Rect bounds = getBounds();
- if (bounds.isEmpty()) {
- return;
- }
- if (mState.mLastDrawnBitmap == null) {
- regenerateBitmapCache();
- }
- canvas.drawBitmap(mState.mLastDrawnBitmap, null, bounds, mPaint);
- }
-
- @Override
- public void setAlpha(int alpha) {
- mPaint.setAlpha(alpha);
- invalidateSelf();
- }
-
- @Override
- public void setColorFilter(ColorFilter colorFilter) {
- mPaint.setColorFilter(colorFilter);
- invalidateSelf();
- }
-
- @Override
- public ConstantState getConstantState() {
- return mState;
- }
-
- @Override
- public int getOpacity() {
- return PixelFormat.TRANSLUCENT;
- }
-
- @Override
- public int getIntrinsicHeight() {
- return mState.mIntrinsicHeight;
- }
-
- @Override
- public int getIntrinsicWidth() {
- return mState.mIntrinsicWidth;
- }
-
- @Override
- public boolean canApplyTheme() {
- return mState.canApplyTheme();
- }
-
- @Override
- public void applyTheme(Resources.Theme t) {
- TypedArray ta = t.obtainStyledAttributes(new int[] {R.attr.isWorkspaceDarkText});
- boolean isDark = ta.getBoolean(0, false);
- ta.recycle();
- if (mState.mIsDark != isDark) {
- mState.mIsDark = isDark;
- mState.mLastDrawnBitmap = null;
- invalidateSelf();
- }
- }
-
- private void regenerateBitmapCache() {
- // Call mutate, so that the pixel allocation by the underlying vector drawable is cleared.
- Drawable d = mState.mChildState.newDrawable().mutate();
- d.setBounds(mState.mShadowSize, mState.mShadowSize,
- mState.mIntrinsicWidth - mState.mShadowSize,
- mState.mIntrinsicHeight - mState.mShadowSize);
- d.setTint(mState.mIsDark ? mState.mDarkTintColor : Color.WHITE);
-
- if (mState.mIsDark) {
- // Dark text do not have any shadow, but just the bitmap
- mState.mLastDrawnBitmap = BitmapRenderer.createHardwareBitmap(
- mState.mIntrinsicWidth, mState.mIntrinsicHeight, d::draw);
- } else {
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
- paint.setMaskFilter(new BlurMaskFilter(mState.mShadowSize, BlurMaskFilter.Blur.NORMAL));
-
- // Generate the shadow bitmap
- int[] offset = new int[2];
- Bitmap shadow = BitmapRenderer.createSoftwareBitmap(
- mState.mIntrinsicWidth, mState.mIntrinsicHeight, d::draw)
- .extractAlpha(paint, offset);
-
- paint.setMaskFilter(null);
- paint.setColor(mState.mShadowColor);
- mState.mLastDrawnBitmap = BitmapRenderer.createHardwareBitmap(
- mState.mIntrinsicWidth, mState.mIntrinsicHeight, c -> {
- c.drawBitmap(shadow, offset[0], offset[1], paint);
- d.draw(c);
- });
- }
- }
-
- @Override
- public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs,
- Resources.Theme theme) throws XmlPullParserException, IOException {
- super.inflate(r, parser, attrs, theme);
-
- final TypedArray a = theme == null
- ? r.obtainAttributes(attrs, R.styleable.ShadowDrawable)
- : theme.obtainStyledAttributes(attrs, R.styleable.ShadowDrawable, 0, 0);
- try {
- Drawable d = a.getDrawable(R.styleable.ShadowDrawable_android_src);
- if (d == null) {
- throw new XmlPullParserException("missing src attribute");
- }
- mState.mShadowColor = a.getColor(
- R.styleable.ShadowDrawable_android_shadowColor, Color.BLACK);
- mState.mShadowSize = a.getDimensionPixelSize(
- R.styleable.ShadowDrawable_android_elevation, 0);
- mState.mDarkTintColor = a.getColor(
- R.styleable.ShadowDrawable_darkTintColor, Color.BLACK);
-
- mState.mIntrinsicHeight = d.getIntrinsicHeight() + 2 * mState.mShadowSize;
- mState.mIntrinsicWidth = d.getIntrinsicWidth() + 2 * mState.mShadowSize;
- mState.mChangingConfigurations = d.getChangingConfigurations();
-
- mState.mChildState = d.getConstantState();
- } finally {
- a.recycle();
- }
- }
-
- private static class ShadowDrawableState extends ConstantState {
-
- int mChangingConfigurations;
- int mIntrinsicWidth;
- int mIntrinsicHeight;
-
- int mShadowColor;
- int mShadowSize;
- int mDarkTintColor;
-
- boolean mIsDark;
- Bitmap mLastDrawnBitmap;
- ConstantState mChildState;
-
- @Override
- public Drawable newDrawable() {
- return new ShadowDrawable(this);
- }
-
- @Override
- public int getChangingConfigurations() {
- return mChangingConfigurations;
- }
-
- @Override
- public boolean canApplyTheme() {
- return true;
- }
- }
-}
diff --git a/src/com/android/launcher3/graphics/SysUiScrim.java b/src/com/android/launcher3/graphics/SysUiScrim.java
index f0766c5..185b8d3 100644
--- a/src/com/android/launcher3/graphics/SysUiScrim.java
+++ b/src/com/android/launcher3/graphics/SysUiScrim.java
@@ -43,7 +43,7 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.DynamicResource;
diff --git a/src/com/android/launcher3/icons/ComponentWithLabel.java b/src/com/android/launcher3/icons/ComponentWithLabel.java
index 372c591..30575fc 100644
--- a/src/com/android/launcher3/icons/ComponentWithLabel.java
+++ b/src/com/android/launcher3/icons/ComponentWithLabel.java
@@ -20,6 +20,8 @@
import android.content.pm.PackageManager;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.icons.cache.CachingLogic;
public interface ComponentWithLabel {
@@ -42,22 +44,26 @@
}
@Override
- public ComponentName getComponent(T object) {
+ @NonNull
+ public ComponentName getComponent(@NonNull T object) {
return object.getComponent();
}
+ @NonNull
@Override
- public UserHandle getUser(T object) {
+ public UserHandle getUser(@NonNull T object) {
return object.getUser();
}
+ @NonNull
@Override
- public CharSequence getLabel(T object) {
+ public CharSequence getLabel(@NonNull T object) {
return object.getLabel(mPackageManager);
}
+ @NonNull
@Override
- public BitmapInfo loadIcon(Context context, T object) {
+ public BitmapInfo loadIcon(@NonNull Context context, @NonNull T object) {
return BitmapInfo.LOW_RES_INFO;
}
diff --git a/src/com/android/launcher3/icons/ComponentWithLabelAndIcon.java b/src/com/android/launcher3/icons/ComponentWithLabelAndIcon.java
index c8606b1..0a52dd7 100644
--- a/src/com/android/launcher3/icons/ComponentWithLabelAndIcon.java
+++ b/src/com/android/launcher3/icons/ComponentWithLabelAndIcon.java
@@ -41,7 +41,8 @@
@NonNull
@Override
- public BitmapInfo loadIcon(Context context, ComponentWithLabelAndIcon object) {
+ public BitmapInfo loadIcon(@NonNull Context context,
+ @NonNull ComponentWithLabelAndIcon object) {
Drawable d = object.getFullResIcon(LauncherAppState.getInstance(context)
.getIconCache());
if (d == null) {
diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java
index fe9b633..0b4a4a5 100644
--- a/src/com/android/launcher3/icons/IconCache.java
+++ b/src/com/android/launcher3/icons/IconCache.java
@@ -51,7 +51,6 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherFiles;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic;
import com.android.launcher3.icons.cache.BaseIconCache;
import com.android.launcher3.icons.cache.CachingLogic;
@@ -119,15 +118,16 @@
}
@Override
- protected long getSerialNumberForUser(UserHandle user) {
+ protected long getSerialNumberForUser(@NonNull UserHandle user) {
return mUserManager.getSerialNumberForUser(user);
}
@Override
- protected boolean isInstantApp(ApplicationInfo info) {
+ protected boolean isInstantApp(@NonNull ApplicationInfo info) {
return mInstantAppResolver.isInstantApp(info);
}
+ @NonNull
@Override
public BaseIconFactory getIconFactory() {
return LauncherIcons.obtain(mContext);
@@ -136,7 +136,8 @@
/**
* Updates the entries related to the given package in memory and persistent DB.
*/
- public synchronized void updateIconsForPkg(String packageName, UserHandle user) {
+ public synchronized void updateIconsForPkg(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
removeIconsForPkg(packageName, user);
try {
PackageInfo info = mPackageManager.getPackageInfo(packageName,
@@ -231,14 +232,8 @@
*/
public <T extends ItemInfoWithIcon> void getShortcutIcon(T info, ShortcutInfo si,
@NonNull Predicate<T> fallbackIconCheck) {
- BitmapInfo bitmapInfo;
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- bitmapInfo = cacheLocked(ShortcutKey.fromInfo(si).componentName, si.getUserHandle(),
- () -> si, mShortcutCachingLogic, false, false).bitmap;
- } else {
- // If caching is disabled, load the full icon
- bitmapInfo = mShortcutCachingLogic.loadIcon(mContext, si);
- }
+ BitmapInfo bitmapInfo = cacheLocked(ShortcutKey.fromInfo(si).componentName,
+ si.getUserHandle(), () -> si, mShortcutCachingLogic, false, false).bitmap;
if (bitmapInfo.isNullOrLowRes()) {
bitmapInfo = getDefaultIcon(si.getUserHandle());
}
@@ -478,7 +473,7 @@
* Fill in {@param infoInOut} with the corresponding icon and label.
*/
public synchronized void getTitleAndIconForApp(
- PackageItemInfo infoInOut, boolean useLowResIcon) {
+ @NonNull final PackageItemInfo infoInOut, final boolean useLowResIcon) {
CacheEntry entry = getEntryForPackageLocked(
infoInOut.packageName, infoInOut.user, useLowResIcon);
applyCacheEntry(entry, infoInOut);
@@ -517,10 +512,16 @@
return bitmap.withFlags(getUserFlagOpLocked(user));
}
- protected void applyCacheEntry(CacheEntry entry, ItemInfoWithIcon info) {
+ protected void applyCacheEntry(@NonNull final CacheEntry entry,
+ @NonNull final ItemInfoWithIcon info) {
info.title = Utilities.trim(entry.title);
info.contentDescription = entry.contentDescription;
- info.bitmap = (entry.bitmap == null) ? getDefaultIcon(info.user) : entry.bitmap;
+ info.bitmap = entry.bitmap;
+ if (entry.bitmap == null) {
+ // TODO: entry.bitmap can never be null, so this should not happen at all.
+ Log.wtf(TAG, "Cannot find bitmap from the cache, default icon was loaded.");
+ info.bitmap = getDefaultIcon(info.user);
+ }
}
public Drawable getFullResIcon(LauncherActivityInfo info) {
@@ -533,6 +534,7 @@
}
@Override
+ @NonNull
protected String getIconSystemState(String packageName) {
return mIconProvider.getSystemStateForPackage(mSystemState, packageName);
}
diff --git a/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java b/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
index 4b8c1ad..406f697 100644
--- a/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
+++ b/src/com/android/launcher3/icons/LauncherActivityCachingLogic.java
@@ -20,6 +20,8 @@
import android.content.pm.LauncherActivityInfo;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.icons.BaseIconFactory.IconOptions;
@@ -40,23 +42,27 @@
R.string.launcher_activity_logic_class);
}
+ @NonNull
@Override
- public ComponentName getComponent(LauncherActivityInfo object) {
+ public ComponentName getComponent(@NonNull LauncherActivityInfo object) {
return object.getComponentName();
}
+ @NonNull
@Override
- public UserHandle getUser(LauncherActivityInfo object) {
+ public UserHandle getUser(@NonNull LauncherActivityInfo object) {
return object.getUser();
}
+ @NonNull
@Override
- public CharSequence getLabel(LauncherActivityInfo object) {
+ public CharSequence getLabel(@NonNull LauncherActivityInfo object) {
return object.getLabel();
}
+ @NonNull
@Override
- public BitmapInfo loadIcon(Context context, LauncherActivityInfo object) {
+ public BitmapInfo loadIcon(@NonNull Context context, @NonNull LauncherActivityInfo object) {
try (LauncherIcons li = LauncherIcons.obtain(context)) {
return li.createBadgedIconBitmap(LauncherAppState.getInstance(context)
.getIconProvider().getIcon(object, li.mFillResIconDpi),
diff --git a/src/com/android/launcher3/icons/ShortcutCachingLogic.java b/src/com/android/launcher3/icons/ShortcutCachingLogic.java
index 6a8f34a..d5a79dd 100644
--- a/src/com/android/launcher3/icons/ShortcutCachingLogic.java
+++ b/src/com/android/launcher3/icons/ShortcutCachingLogic.java
@@ -16,7 +16,7 @@
package com.android.launcher3.icons;
-import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
+import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS;
import android.content.ComponentName;
import android.content.Context;
@@ -29,9 +29,9 @@
import android.util.Log;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.cache.CachingLogic;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.util.Themes;
@@ -44,29 +44,34 @@
private static final String TAG = "ShortcutCachingLogic";
@Override
- public ComponentName getComponent(ShortcutInfo info) {
+ @NonNull
+ public ComponentName getComponent(@NonNull ShortcutInfo info) {
return ShortcutKey.fromInfo(info).componentName;
}
+ @NonNull
@Override
- public UserHandle getUser(ShortcutInfo info) {
+ public UserHandle getUser(@NonNull ShortcutInfo info) {
return info.getUserHandle();
}
+ @NonNull
@Override
- public CharSequence getLabel(ShortcutInfo info) {
+ public CharSequence getLabel(@NonNull ShortcutInfo info) {
return info.getShortLabel();
}
@Override
- public CharSequence getDescription(ShortcutInfo object, CharSequence fallback) {
+ @NonNull
+ public CharSequence getDescription(@NonNull ShortcutInfo object,
+ @NonNull CharSequence fallback) {
CharSequence label = object.getLongLabel();
return TextUtils.isEmpty(label) ? fallback : label;
}
@NonNull
@Override
- public BitmapInfo loadIcon(Context context, ShortcutInfo info) {
+ public BitmapInfo loadIcon(@NonNull Context context, @NonNull ShortcutInfo info) {
try (LauncherIcons li = LauncherIcons.obtain(context)) {
Drawable unbadgedDrawable = ShortcutCachingLogic.getIcon(
context, info, LauncherAppState.getIDP(context).fillResIconDpi);
@@ -77,8 +82,9 @@
}
@Override
- public long getLastUpdatedTime(ShortcutInfo shortcutInfo, PackageInfo info) {
- if (shortcutInfo == null || !FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
+ public long getLastUpdatedTime(@Nullable ShortcutInfo shortcutInfo,
+ @NonNull PackageInfo info) {
+ if (shortcutInfo == null) {
return info.lastUpdateTime;
}
return Math.max(shortcutInfo.getLastChangedTimestamp(), info.lastUpdateTime);
@@ -94,7 +100,7 @@
* Launcher specific checks
*/
public static Drawable getIcon(Context context, ShortcutInfo shortcutInfo, int density) {
- if (GO_DISABLE_WIDGETS) {
+ if (GO_DISABLE_SHORTCUTS) {
return null;
}
try {
diff --git a/src/com/android/launcher3/logging/EventLogArray.java b/src/com/android/launcher3/logging/EventLogArray.java
deleted file mode 100644
index 3ecfb23..0000000
--- a/src/com/android/launcher3/logging/EventLogArray.java
+++ /dev/null
@@ -1,150 +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.logging;
-
-
-import android.util.Log;
-import java.io.PrintWriter;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Random;
-
-/**
- * A utility class to record and log events. Events are stored in a fixed size array and old logs
- * are purged as new events come.
- */
-public class EventLogArray {
-
- private static final int TYPE_ONE_OFF = 0;
- private static final int TYPE_FLOAT = 1;
- private static final int TYPE_INTEGER = 2;
- private static final int TYPE_BOOL_TRUE = 3;
- private static final int TYPE_BOOL_FALSE = 4;
-
- private final String name;
- private final EventEntry[] logs;
- private int nextIndex;
- private int mLogId;
-
- public EventLogArray(String name, int size) {
- this.name = name;
- logs = new EventEntry[size];
- nextIndex = 0;
- }
-
- public void addLog(String event) {
- addLog(TYPE_ONE_OFF, event, 0);
- }
-
- public void addLog(String event, int extras) {
- addLog(TYPE_INTEGER, event, extras);
- }
-
- public void addLog(String event, boolean extras) {
- addLog(extras ? TYPE_BOOL_TRUE : TYPE_BOOL_FALSE, event, 0);
- }
-
- private void addLog(int type, String event, float extras) {
- // Merge the logs if its a duplicate
- int last = (nextIndex + logs.length - 1) % logs.length;
- int secondLast = (nextIndex + logs.length - 2) % logs.length;
- if (isEntrySame(logs[last], type, event) && isEntrySame(logs[secondLast], type, event)) {
- logs[last].update(type, event, extras, mLogId);
- logs[secondLast].duplicateCount++;
- return;
- }
-
- if (logs[nextIndex] == null) {
- logs[nextIndex] = new EventEntry();
- }
- logs[nextIndex].update(type, event, extras, mLogId);
- nextIndex = (nextIndex + 1) % logs.length;
- }
-
- public void clear() {
- Arrays.setAll(logs, (i) -> null);
- }
-
- public void dump(String prefix, PrintWriter writer) {
- writer.println(prefix + "EventLog (" + name + ") history:");
- SimpleDateFormat sdf = new SimpleDateFormat(" HH:mm:ss.SSSZ ", Locale.US);
- Date date = new Date();
-
- for (int i = 0; i < logs.length; i++) {
- EventEntry log = logs[(nextIndex + logs.length - i - 1) % logs.length];
- if (log == null) {
- continue;
- }
- date.setTime(log.time);
-
- StringBuilder msg = new StringBuilder(prefix).append(sdf.format(date))
- .append(log.event);
- switch (log.type) {
- case TYPE_BOOL_FALSE:
- msg.append(": false");
- break;
- case TYPE_BOOL_TRUE:
- msg.append(": true");
- break;
- case TYPE_FLOAT:
- msg.append(": ").append(log.extras);
- break;
- case TYPE_INTEGER:
- msg.append(": ").append((int) log.extras);
- break;
- default: // fall out
- }
- if (log.duplicateCount > 0) {
- msg.append(" & ").append(log.duplicateCount).append(" similar events");
- }
- msg.append(" traceId: ").append(log.traceId);
- writer.println(msg);
- }
- }
-
- /** Returns a 3 digit random number between 100-999 */
- public int generateAndSetLogId() {
- Random r = new Random();
- mLogId = r.nextInt(900) + 100;
- return mLogId;
- }
-
- private boolean isEntrySame(EventEntry entry, int type, String event) {
- return entry != null && entry.type == type && entry.event.equals(event);
- }
-
- /** A single event entry. */
- private static class EventEntry {
-
- private int type;
- private String event;
- private float extras;
- private long time;
- private int duplicateCount;
- private int traceId;
-
- public void update(int type, String event, float extras, int traceId) {
- this.type = type;
- this.event = event;
- this.extras = extras;
- this.traceId = traceId;
- time = System.currentTimeMillis();
- duplicateCount = 0;
- }
- }
-}
diff --git a/src/com/android/launcher3/logging/KeyboardStateManager.java b/src/com/android/launcher3/logging/KeyboardStateManager.java
new file mode 100644
index 0000000..3103af1
--- /dev/null
+++ b/src/com/android/launcher3/logging/KeyboardStateManager.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.logging;
+
+import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.NO_IME_ACTION;
+
+import android.os.SystemClock;
+
+/**
+ * Class to maintain keyboard states.
+ */
+public class KeyboardStateManager {
+ private long mUpdatedTime;
+
+ public enum KeyboardState {
+ NO_IME_ACTION,
+ SHOW,
+ HIDE,
+ }
+
+ private KeyboardState mKeyboardState;
+
+ public KeyboardStateManager() {
+ mKeyboardState = NO_IME_ACTION;
+ }
+
+ /**
+ * Returns time when keyboard state was updated.
+ */
+ public long getLastUpdatedTime() {
+ return mUpdatedTime;
+ }
+
+ /**
+ * Returns current keyboard state.
+ */
+ public KeyboardState getKeyboardState() {
+ return mKeyboardState;
+ }
+
+ /**
+ * Setter method to set keyboard state.
+ */
+ public void setKeyboardState(KeyboardState keyboardState) {
+ mUpdatedTime = SystemClock.elapsedRealtime();
+ mKeyboardState = keyboardState;
+ }
+}
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index c4ec4e3..32237e2 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -56,6 +56,7 @@
private InstanceId mInstanceId;
protected @Nullable ActivityContext mActivityContext = null;
+ private KeyboardStateManager mKeyboardStateManager;
/**
* Returns event enum based on the two state transition information when swipe
@@ -592,6 +593,12 @@
@UiEvent(doc = "User tapped on Share app system shortcut.")
LAUNCHER_SYSTEM_SHORTCUT_APP_SHARE_TAP(1075),
+
+ @UiEvent(doc = "User has invoked split to right half from an app icon menu")
+ LAUNCHER_APP_ICON_MENU_SPLIT_RIGHT_BOTTOM(1199),
+
+ @UiEvent(doc = "User has invoked split to left half from an app icon menu")
+ LAUNCHER_APP_ICON_MENU_SPLIT_LEFT_TOP(1200)
;
// ADD MORE
@@ -816,6 +823,16 @@
return logger;
}
+ /**
+ * Returns a singleton KeyboardStateManager.
+ */
+ public KeyboardStateManager keyboardStateManager() {
+ if (mKeyboardStateManager == null) {
+ mKeyboardStateManager = new KeyboardStateManager();
+ }
+ return mKeyboardStateManager;
+ }
+
protected StatsLogger createLogger() {
return new StatsLogger() {
};
diff --git a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
index 31ef2e5..0d978e1 100644
--- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
+++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
@@ -23,6 +23,9 @@
import android.util.Log;
import android.util.Pair;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel.CallbackTask;
import com.android.launcher3.LauncherSettings;
@@ -36,12 +39,13 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.pm.PackageInstallInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.PackageManagerHelper;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
/**
* Task to add auto-created workspace items.
@@ -50,14 +54,16 @@
private static final String LOG = "AddWorkspaceItemsTask";
+ @NonNull
private final List<Pair<ItemInfo, Object>> mItemList;
+ @NonNull
private final WorkspaceItemSpaceFinder mItemSpaceFinder;
/**
* @param itemList items to add on the workspace
*/
- public AddWorkspaceItemsTask(List<Pair<ItemInfo, Object>> itemList) {
+ public AddWorkspaceItemsTask(@NonNull final List<Pair<ItemInfo, Object>> itemList) {
this(itemList, new WorkspaceItemSpaceFinder());
}
@@ -65,14 +71,15 @@
* @param itemList items to add on the workspace
* @param itemSpaceFinder inject WorkspaceItemSpaceFinder dependency for testing
*/
- public AddWorkspaceItemsTask(List<Pair<ItemInfo, Object>> itemList,
- WorkspaceItemSpaceFinder itemSpaceFinder) {
+ public AddWorkspaceItemsTask(@NonNull final List<Pair<ItemInfo, Object>> itemList,
+ @NonNull final WorkspaceItemSpaceFinder itemSpaceFinder) {
mItemList = itemList;
mItemSpaceFinder = itemSpaceFinder;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
if (mItemList.isEmpty()) {
return;
}
@@ -98,7 +105,8 @@
}
// b/139663018 Short-circuit this logic if the icon is a system app
- if (PackageManagerHelper.isSystemApp(app.getContext(), item.getIntent())) {
+ if (PackageManagerHelper.isSystemApp(app.getContext(),
+ Objects.requireNonNull(item.getIntent()))) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " Item is a system app.");
@@ -159,7 +167,7 @@
continue;
}
- List<LauncherActivityInfo> activities = launcherApps
+ List<LauncherActivityInfo> activities = Objects.requireNonNull(launcherApps)
.getActivityList(packageName, item.user);
boolean hasActivity = activities != null && !activities.isEmpty();
@@ -218,7 +226,7 @@
if (!addedItemsFinal.isEmpty()) {
scheduleCallbackTask(new CallbackTask() {
@Override
- public void execute(Callbacks callbacks) {
+ public void execute(@NonNull Callbacks callbacks) {
final ArrayList<ItemInfo> addAnimated = new ArrayList<>();
final ArrayList<ItemInfo> addNotAnimated = new ArrayList<>();
if (!addedItemsFinal.isEmpty()) {
@@ -243,7 +251,8 @@
* Returns true if the shortcuts already exists on the workspace. This must be called after
* the workspace has been loaded. We identify a shortcut by its intent.
*/
- protected boolean shortcutExists(BgDataModel dataModel, Intent intent, UserHandle user) {
+ protected boolean shortcutExists(@NonNull final BgDataModel dataModel,
+ @Nullable final Intent intent, @NonNull final UserHandle user) {
final String compPkgName, intentWithPkg, intentWithoutPkg;
if (intent == null) {
// Skip items with null intents
diff --git a/src/com/android/launcher3/model/AllAppsList.java b/src/com/android/launcher3/model/AllAppsList.java
index 4875d83..6da948c 100644
--- a/src/com/android/launcher3/model/AllAppsList.java
+++ b/src/com/android/launcher3/model/AllAppsList.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.model.data.AppInfo.COMPONENT_KEY_COMPARATOR;
import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY;
+import static com.android.launcher3.testing.shared.TestProtocol.INCORRECT_INFO_UPDATED;
import android.content.ComponentName;
import android.content.Context;
@@ -38,6 +39,7 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.pm.PackageInstallInfo;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.FlagOp;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SafeCloseable;
@@ -64,7 +66,10 @@
/** The list off all apps. */
public final ArrayList<AppInfo> data = new ArrayList<>(DEFAULT_APPLICATIONS_NUMBER);
+ @NonNull
private IconCache mIconCache;
+
+ @NonNull
private AppFilter mAppFilter;
private boolean mDataChanged = false;
@@ -270,8 +275,14 @@
}
public void updateIconsAndLabels(HashSet<String> packages, UserHandle user) {
+ if (TestProtocol.sDebugTracing) {
+ Log.i(INCORRECT_INFO_UPDATED, "updateIconsAndLabels: packages=" + packages);
+ }
for (AppInfo info : data) {
if (info.user.equals(user) && packages.contains(info.componentName.getPackageName())) {
+ if (TestProtocol.sDebugTracing) {
+ Log.i(INCORRECT_INFO_UPDATED, "updateIconsAndLabels: updating info=" + info);
+ }
mIconCache.updateTitleAndIcon(info);
info.sectionName = mIndex.computeSectionName(info.title);
mDataChanged = true;
diff --git a/src/com/android/launcher3/model/BaseLoaderResults.java b/src/com/android/launcher3/model/BaseLoaderResults.java
index b50ab58..8c6428b 100644
--- a/src/com/android/launcher3/model/BaseLoaderResults.java
+++ b/src/com/android/launcher3/model/BaseLoaderResults.java
@@ -33,7 +33,7 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.LooperExecutor;
diff --git a/src/com/android/launcher3/model/BaseModelUpdateTask.java b/src/com/android/launcher3/model/BaseModelUpdateTask.java
index 2a6a691..5b6f9f6 100644
--- a/src/com/android/launcher3/model/BaseModelUpdateTask.java
+++ b/src/com/android/launcher3/model/BaseModelUpdateTask.java
@@ -17,6 +17,7 @@
import android.util.Log;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.LauncherAppState;
@@ -47,14 +48,17 @@
private static final boolean DEBUG_TASKS = false;
private static final String TAG = "BaseModelUpdateTask";
+ // Nullabilities are explicitly omitted here because these are late-init fields,
+ // They will be non-null after init(), which is always the case in enqueueModelUpdateTask().
private LauncherAppState mApp;
private LauncherModel mModel;
private BgDataModel mDataModel;
private AllAppsList mAllAppsList;
private Executor mUiExecutor;
- public void init(LauncherAppState app, LauncherModel model,
- BgDataModel dataModel, AllAppsList allAppsList, Executor uiExecutor) {
+ public void init(@NonNull final LauncherAppState app, @NonNull final LauncherModel model,
+ @NonNull final BgDataModel dataModel, @NonNull final AllAppsList allAppsList,
+ @NonNull final Executor uiExecutor) {
mApp = app;
mModel = model;
mDataModel = dataModel;
@@ -64,7 +68,7 @@
@Override
public final void run() {
- if (!mModel.isModelLoaded()) {
+ if (!Objects.requireNonNull(mModel).isModelLoaded()) {
if (DEBUG_TASKS) {
Log.d(TAG, "Ignoring model task since loader is pending=" + this);
}
@@ -77,13 +81,13 @@
/**
* Execute the actual task. Called on the worker thread.
*/
- public abstract void execute(
- LauncherAppState app, BgDataModel dataModel, AllAppsList apps);
+ public abstract void execute(@NonNull LauncherAppState app,
+ @NonNull BgDataModel dataModel, @NonNull AllAppsList apps);
/**
* Schedules a {@param task} to be executed on the current callbacks.
*/
- public final void scheduleCallbackTask(final CallbackTask task) {
+ public final void scheduleCallbackTask(@NonNull final CallbackTask task) {
for (final Callbacks cb : mModel.getCallbacks()) {
mUiExecutor.execute(() -> task.execute(cb));
}
@@ -95,7 +99,7 @@
return mModel.getWriter(false /* hasVerticalHotseat */, false /* verifyChanges */, null);
}
- public void bindUpdatedWorkspaceItems(List<WorkspaceItemInfo> allUpdates) {
+ public void bindUpdatedWorkspaceItems(@NonNull final List<WorkspaceItemInfo> allUpdates) {
// Bind workspace items
List<WorkspaceItemInfo> workspaceUpdates = allUpdates.stream()
.filter(info -> info.id != ItemInfo.NO_ID)
@@ -113,18 +117,18 @@
.forEach(this::bindExtraContainerItems);
}
- public void bindExtraContainerItems(FixedContainerItems item) {
+ public void bindExtraContainerItems(@NonNull final FixedContainerItems item) {
FixedContainerItems copy = item.clone();
scheduleCallbackTask(c -> c.bindExtraContainerItems(copy));
}
- public void bindDeepShortcuts(BgDataModel dataModel) {
+ public void bindDeepShortcuts(@NonNull final BgDataModel dataModel) {
final HashMap<ComponentKey, Integer> shortcutMapCopy =
new HashMap<>(dataModel.deepShortcutMap);
scheduleCallbackTask(callbacks -> callbacks.bindDeepShortcutMap(shortcutMapCopy));
}
- public void bindUpdatedWidgets(BgDataModel dataModel) {
+ public void bindUpdatedWidgets(@NonNull final BgDataModel dataModel) {
final ArrayList<WidgetsListBaseEntry> widgets =
dataModel.widgetsModel.getWidgetsListForPicker(mApp.getContext());
scheduleCallbackTask(c -> c.bindAllWidgets(widgets));
diff --git a/src/com/android/launcher3/model/BgDataModel.java b/src/com/android/launcher3/model/BgDataModel.java
index de23c4b..ffb0f2f 100644
--- a/src/com/android/launcher3/model/BgDataModel.java
+++ b/src/com/android/launcher3/model/BgDataModel.java
@@ -17,7 +17,7 @@
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY;
-import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
+import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS;
import static com.android.launcher3.shortcuts.ShortcutRequest.PINNED;
import static java.util.stream.Collectors.groupingBy;
@@ -286,7 +286,7 @@
* shortcuts and unpinning any extra shortcuts.
*/
public synchronized void updateShortcutPinnedState(Context context, UserHandle user) {
- if (GO_DISABLE_WIDGETS) {
+ if (GO_DISABLE_SHORTCUTS) {
return;
}
diff --git a/src/com/android/launcher3/model/CacheDataUpdatedTask.java b/src/com/android/launcher3/model/CacheDataUpdatedTask.java
index f644d49..57fefaa 100644
--- a/src/com/android/launcher3/model/CacheDataUpdatedTask.java
+++ b/src/com/android/launcher3/model/CacheDataUpdatedTask.java
@@ -18,6 +18,8 @@
import android.content.ComponentName;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.icons.IconCache;
@@ -35,17 +37,23 @@
public static final int OP_SESSION_UPDATE = 2;
private final int mOp;
+
+ @NonNull
private final UserHandle mUser;
+
+ @NonNull
private final HashSet<String> mPackages;
- public CacheDataUpdatedTask(int op, UserHandle user, HashSet<String> packages) {
+ public CacheDataUpdatedTask(final int op, @NonNull final UserHandle user,
+ @NonNull final HashSet<String> packages) {
mOp = op;
mUser = user;
mPackages = packages;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
IconCache iconCache = app.getIconCache();
ArrayList<WorkspaceItemInfo> updatedShortcuts = new ArrayList<>();
@@ -65,7 +73,7 @@
bindApplicationsIfNeeded();
}
- public boolean isValidShortcut(WorkspaceItemInfo si) {
+ public boolean isValidShortcut(@NonNull final WorkspaceItemInfo si) {
switch (mOp) {
case OP_CACHE_UPDATE:
return true;
diff --git a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
index c25929a..341372e 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
@@ -31,6 +31,7 @@
import android.util.ArrayMap;
import android.util.Log;
+import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.InvariantDeviceProfile;
@@ -47,6 +48,7 @@
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.WidgetManagerHelper;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -776,17 +778,6 @@
values.put(LauncherSettings.Favorites.SPANY, spanY);
}
- /**
- * This method should return an id that should be the same for two folders containing the
- * same elements.
- */
- private String getFolderMigrationId() {
- return mFolderItems.keySet().stream()
- .map(intentString -> mFolderItems.get(intentString).size() + intentString)
- .sorted()
- .collect(Collectors.joining(","));
- }
-
/** This id is not used in the DB is only used while doing the migration and it identifies
* an entry on each workspace. For example two calculator icons would have the same
* migration id even thought they have different database ids.
@@ -797,9 +788,47 @@
return getFolderMigrationId();
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
return mProvider;
+ case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
+ final String intentStr = cleanIntentString(mIntent);
+ try {
+ Intent i = Intent.parseUri(intentStr, 0);
+ return Objects.requireNonNull(i.getComponent()).toString();
+ } catch (Exception e) {
+ return intentStr;
+ }
default:
- return mIntent;
+ return cleanIntentString(mIntent);
}
}
+
+ /**
+ * This method should return an id that should be the same for two folders containing the
+ * same elements.
+ */
+ @NonNull
+ private String getFolderMigrationId() {
+ return mFolderItems.keySet().stream()
+ .map(intentString -> mFolderItems.get(intentString).size()
+ + cleanIntentString(intentString))
+ .sorted()
+ .collect(Collectors.joining(","));
+ }
+
+ /**
+ * This is needed because sourceBounds can change and make the id of two equal items
+ * different.
+ */
+ @NonNull
+ private String cleanIntentString(@NonNull String intentStr) {
+ try {
+ Intent i = Intent.parseUri(intentStr, 0);
+ i.setSourceBounds(null);
+ return i.toURI();
+ } catch (URISyntaxException e) {
+ Log.e(TAG, "Unable to parse Intent string", e);
+ return intentStr;
+ }
+
+ }
}
}
diff --git a/src/com/android/launcher3/model/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java
index 5a220f7..69f9b53 100644
--- a/src/com/android/launcher3/model/ItemInstallQueue.java
+++ b/src/com/android/launcher3/model/ItemInstallQueue.java
@@ -49,7 +49,7 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.PersistedItemArray;
import com.android.launcher3.util.Preconditions;
@@ -288,6 +288,7 @@
}
@Override
+ @Nullable
public Intent getIntent() {
return intent;
}
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 87e8ebf..6c62b31 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -465,7 +465,7 @@
// occupied (if the feature is enabled) in order to account for the search
// container.
int spanX = mIDP.numSearchContainerColumns;
- int spanY = FeatureFlags.EXPANDED_SMARTSPACE.get() ? 2 : 1;
+ int spanY = 1;
screen.markCells(0, 0, spanX, spanY, true);
}
occupied.put(item.screenId, screen);
diff --git a/src/com/android/launcher3/model/LoaderTask.java b/src/com/android/launcher3/model/LoaderTask.java
index f1c5d59..b644b6b 100644
--- a/src/com/android/launcher3/model/LoaderTask.java
+++ b/src/com/android/launcher3/model/LoaderTask.java
@@ -256,12 +256,10 @@
mApp.getModel()::onPackageIconsUpdated);
logASplit(logger, "update icon cache");
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- verifyNotStopped();
- logASplit(logger, "save shortcuts in icon cache");
- updateHandler.updateIcons(allShortcuts, new ShortcutCachingLogic(),
- mApp.getModel()::onPackageIconsUpdated);
- }
+ verifyNotStopped();
+ logASplit(logger, "save shortcuts in icon cache");
+ updateHandler.updateIcons(allShortcuts, new ShortcutCachingLogic(),
+ mApp.getModel()::onPackageIconsUpdated);
// Take a break
waitForIdle();
@@ -276,12 +274,10 @@
mResults.bindDeepShortcuts();
logASplit(logger, "bindDeepShortcuts");
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- verifyNotStopped();
- logASplit(logger, "save deep shortcuts in icon cache");
- updateHandler.updateIcons(allDeepShortcuts,
- new ShortcutCachingLogic(), (pkgs, user) -> { });
- }
+ verifyNotStopped();
+ logASplit(logger, "save deep shortcuts in icon cache");
+ updateHandler.updateIcons(allDeepShortcuts,
+ new ShortcutCachingLogic(), (pkgs, user) -> { });
// Take a break
waitForIdle();
@@ -304,9 +300,7 @@
logASplit(logger, "save widgets in icon cache");
// fifth step
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- loadFolderNames();
- }
+ loadFolderNames();
verifyNotStopped();
updateHandler.finish();
diff --git a/src/com/android/launcher3/model/ModelUtils.java b/src/com/android/launcher3/model/ModelUtils.java
index 422af43..1ced0b1 100644
--- a/src/com/android/launcher3/model/ModelUtils.java
+++ b/src/com/android/launcher3/model/ModelUtils.java
@@ -29,7 +29,7 @@
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
diff --git a/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java b/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
index c0dc34a..b9fba9d 100644
--- a/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageIncrementalDownloadUpdatedTask.java
@@ -17,6 +17,8 @@
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
@@ -31,19 +33,24 @@
*/
public class PackageIncrementalDownloadUpdatedTask extends BaseModelUpdateTask {
+ @NonNull
private final UserHandle mUser;
+
private final int mProgress;
+
+ @NonNull
private final String mPackageName;
- public PackageIncrementalDownloadUpdatedTask(
- String packageName, UserHandle user, float progress) {
+ public PackageIncrementalDownloadUpdatedTask(@NonNull final String packageName,
+ @NonNull final UserHandle user, final float progress) {
mUser = user;
mProgress = 1 - progress > 0.001 ? (int) (100 * progress) : 100;
mPackageName = packageName;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList appsList) {
+ public void execute(@NonNull LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList appsList) {
PackageInstallInfo downloadInfo = new PackageInstallInfo(
mPackageName,
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING,
diff --git a/src/com/android/launcher3/model/PackageInstallStateChangedTask.java b/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
index b74d0fc..76a87ed 100644
--- a/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
+++ b/src/com/android/launcher3/model/PackageInstallStateChangedTask.java
@@ -18,6 +18,8 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
@@ -33,14 +35,16 @@
*/
public class PackageInstallStateChangedTask extends BaseModelUpdateTask {
+ @NonNull
private final PackageInstallInfo mInstallInfo;
- public PackageInstallStateChangedTask(PackageInstallInfo installInfo) {
+ public PackageInstallStateChangedTask(@NonNull final PackageInstallInfo installInfo) {
mInstallInfo = installInfo;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
if (mInstallInfo.state == PackageInstallInfo.STATUS_INSTALLED) {
try {
// For instant apps we do not get package-add. Use setting events to update
diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java
index a9d272e..3d9d81f 100644
--- a/src/com/android/launcher3/model/PackageUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageUpdatedTask.java
@@ -29,6 +29,8 @@
import android.os.UserManager;
import android.util.Log;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
@@ -80,17 +82,23 @@
public static final int OP_USER_AVAILABILITY_CHANGE = 7; // user available/unavailable
private final int mOp;
+
+ @NonNull
private final UserHandle mUser;
+
+ @NonNull
private final String[] mPackages;
- public PackageUpdatedTask(int op, UserHandle user, String... packages) {
+ public PackageUpdatedTask(final int op, @NonNull final UserHandle user,
+ @NonNull final String... packages) {
mOp = op;
mUser = user;
mPackages = packages;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList appsList) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList appsList) {
final Context context = app.getContext();
final IconCache iconCache = app.getIconCache();
diff --git a/src/com/android/launcher3/model/ReloadStringCacheTask.java b/src/com/android/launcher3/model/ReloadStringCacheTask.java
index f4d4298..34f7057 100644
--- a/src/com/android/launcher3/model/ReloadStringCacheTask.java
+++ b/src/com/android/launcher3/model/ReloadStringCacheTask.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.model;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
/**
@@ -22,14 +24,17 @@
* {@link android.app.admin.DevicePolicyManager#ACTION_DEVICE_POLICY_RESOURCE_UPDATED}.
*/
public class ReloadStringCacheTask extends BaseModelUpdateTask {
+
+ @NonNull
private ModelDelegate mModelDelegate;
- public ReloadStringCacheTask(ModelDelegate modelDelegate) {
+ public ReloadStringCacheTask(@NonNull final ModelDelegate modelDelegate) {
mModelDelegate = modelDelegate;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList appsList) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList appsList) {
synchronized (dataModel) {
mModelDelegate.loadStringCache(dataModel.stringCache);
StringCache cloneSC = dataModel.stringCache.clone();
diff --git a/src/com/android/launcher3/model/ShortcutsChangedTask.java b/src/com/android/launcher3/model/ShortcutsChangedTask.java
index 1026e0b..a6a04a7 100644
--- a/src/com/android/launcher3/model/ShortcutsChangedTask.java
+++ b/src/com/android/launcher3/model/ShortcutsChangedTask.java
@@ -19,6 +19,8 @@
import android.content.pm.ShortcutInfo;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -38,13 +40,20 @@
*/
public class ShortcutsChangedTask extends BaseModelUpdateTask {
+ @NonNull
private final String mPackageName;
+
+ @NonNull
private final List<ShortcutInfo> mShortcuts;
+
+ @NonNull
private final UserHandle mUser;
+
private final boolean mUpdateIdMap;
- public ShortcutsChangedTask(String packageName, List<ShortcutInfo> shortcuts,
- UserHandle user, boolean updateIdMap) {
+ public ShortcutsChangedTask(@NonNull final String packageName,
+ @NonNull final List<ShortcutInfo> shortcuts, @NonNull final UserHandle user,
+ final boolean updateIdMap) {
mPackageName = packageName;
mShortcuts = shortcuts;
mUser = user;
@@ -52,7 +61,8 @@
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
final Context context = app.getContext();
// Find WorkspaceItemInfo's that have changed on the workspace.
ArrayList<WorkspaceItemInfo> matchingWorkspaceItems = new ArrayList<>();
diff --git a/src/com/android/launcher3/model/UserLockStateChangedTask.java b/src/com/android/launcher3/model/UserLockStateChangedTask.java
index 1565b19..63ca35b 100644
--- a/src/com/android/launcher3/model/UserLockStateChangedTask.java
+++ b/src/com/android/launcher3/model/UserLockStateChangedTask.java
@@ -21,6 +21,8 @@
import android.content.pm.ShortcutInfo;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
+
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -40,16 +42,18 @@
*/
public class UserLockStateChangedTask extends BaseModelUpdateTask {
+ @NonNull
private final UserHandle mUser;
private boolean mIsUserUnlocked;
- public UserLockStateChangedTask(UserHandle user, boolean isUserUnlocked) {
+ public UserLockStateChangedTask(@NonNull final UserHandle user, final boolean isUserUnlocked) {
mUser = user;
mIsUserUnlocked = isUserUnlocked;
}
@Override
- public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
+ public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList apps) {
Context context = app.getContext();
HashMap<ShortcutKey, ShortcutInfo> pinnedShortcuts = new HashMap<>();
diff --git a/src/com/android/launcher3/model/data/AppInfo.java b/src/com/android/launcher3/model/data/AppInfo.java
index 5b2bcf5..34972e7 100644
--- a/src/com/android/launcher3/model/data/AppInfo.java
+++ b/src/com/android/launcher3/model/data/AppInfo.java
@@ -55,6 +55,7 @@
*/
public Intent intent;
+ @NonNull
public ComponentName componentName;
// Section name used for indexing.
@@ -65,6 +66,7 @@
}
@Override
+ @Nullable
public Intent getIntent() {
return intent;
}
@@ -151,7 +153,7 @@
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
}
- @Nullable
+ @NonNull
@Override
public ComponentName getTargetComponent() {
return componentName;
diff --git a/src/com/android/launcher3/model/data/FolderInfo.java b/src/com/android/launcher3/model/data/FolderInfo.java
index efebce3..524b769 100644
--- a/src/com/android/launcher3/model/data/FolderInfo.java
+++ b/src/com/android/launcher3/model/data/FolderInfo.java
@@ -26,11 +26,11 @@
import android.os.Process;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderNameInfos;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logger.LauncherAtom.Attribute;
@@ -155,7 +155,7 @@
}
@Override
- public void onAddToDatabase(ContentWriter writer) {
+ public void onAddToDatabase(@NonNull ContentWriter writer) {
super.onAddToDatabase(writer);
writer.put(LauncherSettings.Favorites.TITLE, title)
.put(LauncherSettings.Favorites.OPTIONS, options);
@@ -207,8 +207,9 @@
return String.format("%s; labelState=%s", super.dumpProperties(), getLabelState());
}
+ @NonNull
@Override
- public LauncherAtom.ItemInfo buildProto(FolderInfo fInfo) {
+ public LauncherAtom.ItemInfo buildProto(@Nullable FolderInfo fInfo) {
FolderIcon.Builder folderIcon = FolderIcon.newBuilder()
.setCardinality(contents.size());
if (LabelState.SUGGESTED.equals(getLabelState())) {
@@ -262,6 +263,7 @@
: LabelState.SUGGESTED;
}
+ @NonNull
@Override
public ItemInfo makeShallowCopy() {
FolderInfo folderInfo = new FolderInfo();
@@ -273,6 +275,7 @@
/**
* Returns {@link LauncherAtom.FolderIcon} wrapped as {@link LauncherAtom.ItemInfo} for logging.
*/
+ @NonNull
@Override
public LauncherAtom.ItemInfo buildProto() {
return buildProto(null);
@@ -321,12 +324,6 @@
return LauncherAtom.ToState.TO_STATE_UNSPECIFIED;
}
- if (!FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- return title.length() > 0
- ? LauncherAtom.ToState.TO_CUSTOM_WITH_SUGGESTIONS_DISABLED
- : LauncherAtom.ToState.TO_EMPTY_WITH_SUGGESTIONS_DISABLED;
- }
-
// TODO: if suggestedFolderNames is null then it infrastructure issue, not
// ranking issue. We should log these appropriately.
if (suggestedFolderNames == null || !suggestedFolderNames.hasSuggestions()) {
diff --git a/src/com/android/launcher3/model/data/ItemInfo.java b/src/com/android/launcher3/model/data/ItemInfo.java
index 1e8e3ca..466f63f 100644
--- a/src/com/android/launcher3/model/data/ItemInfo.java
+++ b/src/com/android/launcher3/model/data/ItemInfo.java
@@ -42,6 +42,7 @@
import android.os.Process;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.LauncherSettings;
@@ -141,30 +142,34 @@
/**
* Title of the item
*/
+ @Nullable
public CharSequence title;
/**
* Content description of the item.
*/
+ @Nullable
public CharSequence contentDescription;
/**
* When the instance is created using {@link #copyFrom}, this field is used to keep track of
* original {@link ComponentName}.
*/
+ @Nullable
private ComponentName mComponentName;
+ @NonNull
public UserHandle user;
public ItemInfo() {
user = Process.myUserHandle();
}
- protected ItemInfo(ItemInfo info) {
+ protected ItemInfo(@NonNull final ItemInfo info) {
copyFrom(info);
}
- public void copyFrom(ItemInfo info) {
+ public void copyFrom(@NonNull final ItemInfo info) {
id = info.id;
title = info.title;
cellX = info.cellX;
@@ -182,6 +187,7 @@
mComponentName = info.getTargetComponent();
}
+ @Nullable
public Intent getIntent() {
return null;
}
@@ -209,7 +215,7 @@
: null;
}
- public void writeToValues(ContentWriter writer) {
+ public void writeToValues(@NonNull final ContentWriter writer) {
writer.put(LauncherSettings.Favorites.ITEM_TYPE, itemType)
.put(LauncherSettings.Favorites.CONTAINER, container)
.put(LauncherSettings.Favorites.SCREEN, screenId)
@@ -220,7 +226,7 @@
.put(LauncherSettings.Favorites.RANK, rank);
}
- public void readFromValues(ContentValues values) {
+ public void readFromValues(@NonNull final ContentValues values) {
itemType = values.getAsInteger(LauncherSettings.Favorites.ITEM_TYPE);
container = values.getAsInteger(LauncherSettings.Favorites.CONTAINER);
screenId = values.getAsInteger(LauncherSettings.Favorites.SCREEN);
@@ -234,7 +240,7 @@
/**
* Write the fields of this item to the DB
*/
- public void onAddToDatabase(ContentWriter writer) {
+ public void onAddToDatabase(@NonNull final ContentWriter writer) {
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: " + screenId);
@@ -245,10 +251,12 @@
}
@Override
+ @NonNull
public final String toString() {
return getClass().getSimpleName() + "(" + dumpProperties() + ")";
}
+ @NonNull
protected String dumpProperties() {
return "id=" + id
+ " type=" + LauncherSettings.Favorites.itemTypeToString(itemType)
@@ -288,14 +296,17 @@
/**
* Creates {@link LauncherAtom.ItemInfo} with important fields and parent container info.
*/
+ @NonNull
public LauncherAtom.ItemInfo buildProto() {
return buildProto(null);
}
/**
* Creates {@link LauncherAtom.ItemInfo} with important fields and parent container info.
+ * @param fInfo
*/
- public LauncherAtom.ItemInfo buildProto(FolderInfo fInfo) {
+ @NonNull
+ public LauncherAtom.ItemInfo buildProto(@Nullable final FolderInfo fInfo) {
LauncherAtom.ItemInfo.Builder itemBuilder = getDefaultItemInfoBuilder();
Optional<ComponentName> nullableComponent = Optional.ofNullable(getTargetComponent());
switch (itemType) {
@@ -373,6 +384,7 @@
return itemBuilder.build();
}
+ @NonNull
protected LauncherAtom.ItemInfo.Builder getDefaultItemInfoBuilder() {
LauncherAtom.ItemInfo.Builder itemBuilder = LauncherAtom.ItemInfo.newBuilder();
itemBuilder.setIsWork(!Process.myUserHandle().equals(user));
@@ -383,6 +395,7 @@
/**
* Returns {@link ContainerInfo} used when logging this item.
*/
+ @NonNull
public ContainerInfo getContainerInfo() {
switch (container) {
case CONTAINER_HOTSEAT:
@@ -447,6 +460,7 @@
* Returns non-AOSP container wrapped by {@link ExtendedContainers} object. Should be overridden
* by build variants.
*/
+ @NonNull
protected ExtendedContainers getExtendedContainer() {
return ExtendedContainers.getDefaultInstance();
}
@@ -454,6 +468,7 @@
/**
* Returns shallow copy of the object.
*/
+ @NonNull
public ItemInfo makeShallowCopy() {
ItemInfo itemInfo = new ItemInfo();
itemInfo.copyFrom(this);
@@ -463,7 +478,8 @@
/**
* Sets the title of the item and writes to DB model if needed.
*/
- public void setTitle(CharSequence title, ModelWriter modelWriter) {
+ public void setTitle(@Nullable final CharSequence title,
+ @Nullable final ModelWriter modelWriter) {
this.title = title;
}
}
diff --git a/src/com/android/launcher3/model/data/LauncherAppWidgetInfo.java b/src/com/android/launcher3/model/data/LauncherAppWidgetInfo.java
index e57a895..1fbe04f 100644
--- a/src/com/android/launcher3/model/data/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher3/model/data/LauncherAppWidgetInfo.java
@@ -29,6 +29,7 @@
import android.content.res.Resources;
import android.os.Process;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.Launcher;
@@ -191,7 +192,7 @@
}
@Override
- public void onAddToDatabase(ContentWriter writer) {
+ public void onAddToDatabase(@NonNull ContentWriter writer) {
super.onAddToDatabase(writer);
writer.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId)
.put(LauncherSettings.Favorites.APPWIDGET_PROVIDER, providerName.flattenToString())
@@ -283,8 +284,9 @@
}
}
+ @NonNull
@Override
- public LauncherAtom.ItemInfo buildProto(FolderInfo folderInfo) {
+ public LauncherAtom.ItemInfo buildProto(@Nullable FolderInfo folderInfo) {
LauncherAtom.ItemInfo info = super.buildProto(folderInfo);
return info.toBuilder()
.setWidget(info.getWidget().toBuilder().setWidgetFeatures(widgetFeatures))
diff --git a/src/com/android/launcher3/model/data/SearchActionItemInfo.java b/src/com/android/launcher3/model/data/SearchActionItemInfo.java
index e879313..04042ea 100644
--- a/src/com/android/launcher3/model/data/SearchActionItemInfo.java
+++ b/src/com/android/launcher3/model/data/SearchActionItemInfo.java
@@ -24,6 +24,7 @@
import android.os.Process;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.LauncherAppState;
@@ -70,7 +71,7 @@
}
@Override
- public void copyFrom(com.android.launcher3.model.data.ItemInfo info) {
+ public void copyFrom(@NonNull com.android.launcher3.model.data.ItemInfo info) {
super.copyFrom(info);
SearchActionItemInfo itemInfo = (SearchActionItemInfo) info;
this.mFallbackPackageName = itemInfo.mFallbackPackageName;
@@ -91,6 +92,7 @@
}
@Override
+ @Nullable
public Intent getIntent() {
return mIntent;
}
@@ -131,8 +133,9 @@
return new SearchActionItemInfo(this);
}
+ @NonNull
@Override
- public ItemInfo buildProto(FolderInfo fInfo) {
+ public ItemInfo buildProto(@Nullable FolderInfo fInfo) {
SearchActionItem.Builder itemBuilder = SearchActionItem.newBuilder()
.setPackageName(mFallbackPackageName);
diff --git a/src/com/android/launcher3/model/data/WorkspaceItemInfo.java b/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
index 2b3da33..59ef320 100644
--- a/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
+++ b/src/com/android/launcher3/model/data/WorkspaceItemInfo.java
@@ -75,6 +75,7 @@
/**
* The intent used to start the application.
*/
+ @NonNull
public Intent intent;
/**
@@ -130,7 +131,7 @@
}
@Override
- public void onAddToDatabase(ContentWriter writer) {
+ public void onAddToDatabase(@NonNull ContentWriter writer) {
super.onAddToDatabase(writer);
writer.put(Favorites.TITLE, title)
.put(Favorites.INTENT, getIntent())
@@ -147,6 +148,7 @@
}
@Override
+ @NonNull
public Intent getIntent() {
return intent;
}
@@ -164,7 +166,8 @@
return isPromise() && !hasStatusFlag(FLAG_SUPPORTS_WEB_UI);
}
- public void updateFromDeepShortcutInfo(ShortcutInfo shortcutInfo, Context context) {
+ public void updateFromDeepShortcutInfo(@NonNull final ShortcutInfo shortcutInfo,
+ @NonNull final Context context) {
// {@link ShortcutInfo#getActivity} can change during an update. Recreate the intent
intent = ShortcutKey.makeIntent(shortcutInfo);
title = shortcutInfo.getShortLabel();
diff --git a/src/com/android/launcher3/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java
index 618f926..16bb868 100644
--- a/src/com/android/launcher3/pm/InstallSessionHelper.java
+++ b/src/com/android/launcher3/pm/InstallSessionHelper.java
@@ -30,6 +30,7 @@
import android.util.Log;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.WorkerThread;
@@ -39,7 +40,7 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.MainThreadInitializedObject;
@@ -51,38 +52,50 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Objects;
/**
* Utility class to tracking install sessions
*/
public class InstallSessionHelper {
+ @NonNull
private static final String LOG = "InstallSessionHelper";
// Set<String> of session ids of promise icons that have been added to the home screen
// as FLAG_PROMISE_NEW_INSTALLS.
+ @NonNull
protected static final String PROMISE_ICON_IDS = "promise_icon_ids";
private static final boolean DEBUG = false;
+ @NonNull
public static final MainThreadInitializedObject<InstallSessionHelper> INSTANCE =
new MainThreadInitializedObject<>(InstallSessionHelper::new);
+ @Nullable
private final LauncherApps mLauncherApps;
+
+ @NonNull
private final Context mAppContext;
+ @NonNull
private final PackageInstaller mInstaller;
+
+ @NonNull
private final HashMap<String, Boolean> mSessionVerifiedMap = new HashMap<>();
+ @Nullable
private IntSet mPromiseIconIds;
- public InstallSessionHelper(Context context) {
+ public InstallSessionHelper(@NonNull final Context context) {
mInstaller = context.getPackageManager().getPackageInstaller();
mAppContext = context.getApplicationContext();
mLauncherApps = context.getSystemService(LauncherApps.class);
}
@WorkerThread
+ @NonNull
private IntSet getPromiseIconIds() {
Preconditions.assertWorkerThread();
if (mPromiseIconIds != null) {
@@ -108,6 +121,7 @@
return mPromiseIconIds;
}
+ @NonNull
public HashMap<PackageUserKey, SessionInfo> getActiveSessions() {
HashMap<PackageUserKey, SessionInfo> activePackages = new HashMap<>();
for (SessionInfo info : getAllVerifiedSessions()) {
@@ -117,6 +131,7 @@
return activePackages;
}
+ @Nullable
public SessionInfo getActiveSessionInfo(UserHandle user, String pkg) {
for (SessionInfo info : getAllVerifiedSessions()) {
boolean match = pkg.equals(info.getAppPackageName());
@@ -136,11 +151,13 @@
.apply();
}
- SessionInfo getVerifiedSessionInfo(int sessionId) {
+ @Nullable
+ SessionInfo getVerifiedSessionInfo(final int sessionId) {
return verify(mInstaller.getSessionInfo(sessionId));
}
- private SessionInfo verify(SessionInfo sessionInfo) {
+ @Nullable
+ private SessionInfo verify(@Nullable final SessionInfo sessionInfo) {
if (sessionInfo == null
|| sessionInfo.getInstallerPackageName() == null
|| TextUtils.isEmpty(sessionInfo.getAppPackageName())) {
@@ -167,9 +184,10 @@
return mSessionVerifiedMap.get(pkg) ? sessionInfo : null;
}
+ @NonNull
public List<SessionInfo> getAllVerifiedSessions() {
List<SessionInfo> list = new ArrayList<>(Utilities.ATLEAST_Q
- ? mLauncherApps.getAllPackageInstallerSessions()
+ ? Objects.requireNonNull(mLauncherApps).getAllPackageInstallerSessions()
: mInstaller.getAllSessions());
Iterator<SessionInfo> it = list.iterator();
while (it.hasNext()) {
@@ -201,12 +219,12 @@
}
@WorkerThread
- public boolean promiseIconAddedForId(int sessionId) {
+ public boolean promiseIconAddedForId(final int sessionId) {
return getPromiseIconIds().contains(sessionId);
}
@WorkerThread
- public void removePromiseIconId(int sessionId) {
+ public void removePromiseIconId(final int sessionId) {
if (promiseIconAddedForId(sessionId)) {
getPromiseIconIds().getArray().removeValue(sessionId);
updatePromiseIconPrefs();
@@ -222,17 +240,15 @@
* - A promise icon for the session has not already been created
*/
@WorkerThread
- void tryQueuePromiseAppIcon(PackageInstaller.SessionInfo sessionInfo) {
+ void tryQueuePromiseAppIcon(@Nullable final PackageInstaller.SessionInfo sessionInfo) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " tryQueuePromiseAppIcon"
- + ", FeatureFlags=" + FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()
+ ", SessionCommitReceiveEnabled" + SessionCommitReceiver.isEnabled(mAppContext)
+ ", verifySessionInfo(sessionInfo)=" + verifySessionInfo(sessionInfo)
+ ", !promiseIconAdded=" + (sessionInfo != null
&& !promiseIconAddedForId(sessionInfo.getSessionId())));
}
- if (FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()
- && SessionCommitReceiver.isEnabled(mAppContext)
+ if (SessionCommitReceiver.isEnabled(mAppContext)
&& verifySessionInfo(sessionInfo)
&& !promiseIconAddedForId(sessionInfo.getSessionId())) {
FileLog.d(LOG, "Adding package name to install queue: "
@@ -246,7 +262,7 @@
}
}
- public boolean verifySessionInfo(PackageInstaller.SessionInfo sessionInfo) {
+ public boolean verifySessionInfo(@Nullable final PackageInstaller.SessionInfo sessionInfo) {
if (TestProtocol.sDebugTracing) {
boolean appNotInstalled = sessionInfo == null
|| !new PackageManagerHelper(mAppContext)
@@ -269,14 +285,15 @@
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo));
}
- public InstallSessionTracker registerInstallTracker(InstallSessionTracker.Callback callback) {
+ public InstallSessionTracker registerInstallTracker(
+ @Nullable final InstallSessionTracker.Callback callback) {
InstallSessionTracker tracker = new InstallSessionTracker(
this, callback, mInstaller, mLauncherApps);
tracker.register();
return tracker;
}
- public static UserHandle getUserHandle(SessionInfo info) {
+ public static UserHandle getUserHandle(@NonNull final 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 75cf7a8..aeaa320 100644
--- a/src/com/android/launcher3/pm/InstallSessionTracker.java
+++ b/src/com/android/launcher3/pm/InstallSessionTracker.java
@@ -28,12 +28,15 @@
import android.util.Log;
import android.util.SparseArray;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.PackageUserKey;
import java.lang.ref.WeakReference;
+import java.util.Objects;
@WorkerThread
public class InstallSessionTracker extends PackageInstaller.SessionCallback {
@@ -41,14 +44,22 @@
// Lazily initialized
private SparseArray<PackageUserKey> mActiveSessions = null;
+ @NonNull
private final WeakReference<InstallSessionHelper> mWeakHelper;
+
+ @NonNull
private final WeakReference<Callback> mWeakCallback;
+
+ @NonNull
private final PackageInstaller mInstaller;
+
+ @Nullable
private final LauncherApps mLauncherApps;
- InstallSessionTracker(InstallSessionHelper installerCompat, Callback callback,
- PackageInstaller installer, LauncherApps launcherApps) {
+ InstallSessionTracker(@Nullable final InstallSessionHelper installerCompat,
+ @Nullable final Callback callback, @NonNull final PackageInstaller installer,
+ @Nullable LauncherApps launcherApps) {
mWeakHelper = new WeakReference<>(installerCompat);
mWeakCallback = new WeakReference<>(callback);
mInstaller = installer;
@@ -56,7 +67,7 @@
}
@Override
- public void onCreated(int sessionId) {
+ public void onCreated(final int sessionId) {
InstallSessionHelper helper = mWeakHelper.get();
Callback callback = mWeakCallback.get();
if (TestProtocol.sDebugTracing) {
@@ -80,7 +91,7 @@
}
@Override
- public void onFinished(int sessionId, boolean success) {
+ public void onFinished(final int sessionId, final boolean success) {
InstallSessionHelper helper = mWeakHelper.get();
Callback callback = mWeakCallback.get();
if (callback == null || helper == null) {
@@ -108,7 +119,7 @@
}
@Override
- public void onProgressChanged(int sessionId, float progress) {
+ public void onProgressChanged(final int sessionId, final float progress) {
InstallSessionHelper helper = mWeakHelper.get();
Callback callback = mWeakCallback.get();
if (callback == null || helper == null) {
@@ -121,10 +132,10 @@
}
@Override
- public void onActiveChanged(int sessionId, boolean active) { }
+ public void onActiveChanged(final int sessionId, final boolean active) { }
@Override
- public void onBadgingChanged(int sessionId) {
+ public void onBadgingChanged(final int sessionId) {
InstallSessionHelper helper = mWeakHelper.get();
Callback callback = mWeakCallback.get();
if (callback == null || helper == null) {
@@ -136,8 +147,9 @@
}
}
- private SessionInfo pushSessionDisplayToLauncher(
- int sessionId, InstallSessionHelper helper, Callback callback) {
+ @Nullable
+ private SessionInfo pushSessionDisplayToLauncher(final int sessionId,
+ @NonNull final InstallSessionHelper helper, @NonNull final Callback callback) {
SessionInfo session = helper.getVerifiedSessionInfo(sessionId);
if (session != null && session.getAppPackageName() != null) {
PackageUserKey key =
@@ -149,7 +161,9 @@
return null;
}
- private SparseArray<PackageUserKey> getActiveSessionMap(InstallSessionHelper helper) {
+ @NonNull
+ private SparseArray<PackageUserKey> getActiveSessionMap(
+ @NonNull final InstallSessionHelper helper) {
if (mActiveSessions == null) {
mActiveSessions = new SparseArray<>();
helper.getActiveSessions().forEach(
@@ -162,7 +176,8 @@
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
mInstaller.registerSessionCallback(this, MODEL_EXECUTOR.getHandler());
} else {
- mLauncherApps.registerPackageInstallerSessionCallback(MODEL_EXECUTOR, this);
+ Objects.requireNonNull(mLauncherApps).registerPackageInstallerSessionCallback(
+ MODEL_EXECUTOR, this);
}
}
@@ -170,18 +185,18 @@
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
mInstaller.unregisterSessionCallback(this);
} else {
- mLauncherApps.unregisterPackageInstallerSessionCallback(this);
+ Objects.requireNonNull(mLauncherApps).unregisterPackageInstallerSessionCallback(this);
}
}
public interface Callback {
- void onSessionFailure(String packageName, UserHandle user);
+ void onSessionFailure(@NonNull String packageName, @NonNull UserHandle user);
- void onUpdateSessionDisplay(PackageUserKey key, SessionInfo info);
+ void onUpdateSessionDisplay(@NonNull PackageUserKey key, @NonNull SessionInfo info);
- void onPackageStateChanged(PackageInstallInfo info);
+ void onPackageStateChanged(@NonNull PackageInstallInfo info);
- void onInstallSessionCreated(PackageInstallInfo info);
+ void onInstallSessionCreated(@NonNull PackageInstallInfo info);
}
}
diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
index a2ab7f9..a55f7e3 100644
--- a/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
+++ b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncher.java
@@ -29,7 +29,9 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
+import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
import com.android.launcher3.model.BgDataModel;
import com.android.launcher3.model.StringCache;
@@ -39,6 +41,8 @@
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.util.ComponentKey;
+import com.android.launcher3.util.IntSet;
+import com.android.launcher3.util.OnboardingPrefs;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.BaseDragLayer;
@@ -61,11 +65,16 @@
private boolean mAppDrawerShown = false;
private StringCache mStringCache;
+ private OnboardingPrefs<?> mOnboardingPrefs;
+ private boolean mBindingItems = false;
+ private SecondaryDisplayPredictions mSecondaryDisplayPredictions;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mModel = LauncherAppState.getInstance(this).getModel();
+ mOnboardingPrefs = new OnboardingPrefs<>(this, Utilities.getPrefs(this));
+ mSecondaryDisplayPredictions = SecondaryDisplayPredictions.newInstance(this);
if (getWindow().getDecorView().isAttachedToWindow()) {
initUi();
}
@@ -204,6 +213,7 @@
mAppDrawerShown = true;
mAppsView.setVisibility(View.VISIBLE);
mAppsButton.setVisibility(View.INVISIBLE);
+ mSecondaryDisplayPredictions.updateAppDivider();
} else {
mAppDrawerShown = false;
animator.addListener(new AnimatorListenerAdapter() {
@@ -219,6 +229,26 @@
}
@Override
+ public OnboardingPrefs<?> getOnboardingPrefs() {
+ return mOnboardingPrefs;
+ }
+
+ @Override
+ public void startBinding() {
+ mBindingItems = true;
+ }
+
+ @Override
+ public boolean isBindingItems() {
+ return mBindingItems;
+ }
+
+ @Override
+ public void finishBindingItems(IntSet pagesBoundFirst) {
+ mBindingItems = false;
+ }
+
+ @Override
public void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMap) {
mPopupDataProvider.setDeepShortcutMap(deepShortcutMap);
}
@@ -230,6 +260,13 @@
}
@Override
+ public void bindExtraContainerItems(BgDataModel.FixedContainerItems item) {
+ if (item.containerId == LauncherSettings.Favorites.CONTAINER_PREDICTION) {
+ mSecondaryDisplayPredictions.setPredictedApps(item);
+ }
+ }
+
+ @Override
public StringCache getStringCache() {
return mStringCache;
}
@@ -259,7 +296,7 @@
Intent intent;
if (item instanceof ItemInfoWithIcon
&& (((ItemInfoWithIcon) item).runtimeStatusFlags
- & ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE) != 0) {
+ & ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE) != 0) {
ItemInfoWithIcon appInfo = (ItemInfoWithIcon) item;
intent = appInfo.getMarketIntent(this);
} else {
diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictions.java b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictions.java
new file mode 100644
index 0000000..a58916a
--- /dev/null
+++ b/src/com/android/launcher3/secondarydisplay/SecondaryDisplayPredictions.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.secondarydisplay;
+
+import android.content.Context;
+
+import com.android.launcher3.R;
+import com.android.launcher3.model.BgDataModel;
+import com.android.launcher3.util.ResourceBasedOverride;
+
+/**
+ * Exposes Quickstep app prediction row APIs to {@link SecondaryDisplayLauncher}.
+ */
+public class SecondaryDisplayPredictions implements ResourceBasedOverride {
+ /**
+ * Creates a {@link SecondaryDisplayPredictions} instance.
+ */
+ static SecondaryDisplayPredictions newInstance(Context context) {
+ return Overrides.getObject(
+ SecondaryDisplayPredictions.class, context,
+ R.string.secondary_display_predictions_class);
+ }
+
+ /**
+ * Setup/update app divider separating app predictions from All Apps.
+ */
+ void updateAppDivider() {
+ }
+
+ /**
+ * Set predicted apps in top of app drawer.
+ */
+ public void setPredictedApps(BgDataModel.FixedContainerItems item) {
+ }
+}
diff --git a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
index b06b8a1..6057586 100644
--- a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
+++ b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
@@ -63,6 +63,7 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.config.FlagTogglerPrefUi;
+import com.android.launcher3.secondarydisplay.SecondaryDisplayLauncher;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.OnboardingPrefs;
@@ -369,6 +370,16 @@
return true;
});
sandboxCategory.addPreference(launchSandboxModeTutorialPreference);
+
+ Preference launchSecondaryDisplayPreference = new Preference(context);
+ launchSecondaryDisplayPreference.setKey("launchSecondaryDisplay");
+ launchSecondaryDisplayPreference.setTitle("Launch Secondary Display");
+ launchSecondaryDisplayPreference.setSummary("Launch secondary display activity");
+ launchSecondaryDisplayPreference.setOnPreferenceClickListener(preference -> {
+ startActivity(new Intent(context, SecondaryDisplayLauncher.class));
+ return true;
+ });
+ sandboxCategory.addPreference(launchSecondaryDisplayPreference);
}
private void addOnboardingPrefsCatergory() {
diff --git a/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java b/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
index c166bfc..0306730 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
@@ -16,7 +16,6 @@
package com.android.launcher3.shortcuts;
-import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
@@ -24,7 +23,6 @@
import android.view.View;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.icons.BitmapRenderer;
import com.android.launcher3.icons.FastBitmapDrawable;
@@ -44,33 +42,13 @@
@Override
public Drawable createDrawable() {
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- int size = ActivityContext.lookupContext(mView.getContext())
- .getDeviceProfile().iconSizePx;
- return new FastBitmapDrawable(
- BitmapRenderer.createHardwareBitmap(
- size + blurSizeOutline,
- size + blurSizeOutline,
- (c) -> drawDragViewOnBackground(c, size)));
- } else {
- return new FastBitmapDrawable(createDragBitmapLegacy());
- }
- }
-
- private Bitmap createDragBitmapLegacy() {
- Drawable d = mView.getBackground();
- Rect bounds = getDrawableBounds(d);
- int size = ActivityContext.lookupContext(mView.getContext()).getDeviceProfile().iconSizePx;
- final Bitmap b = Bitmap.createBitmap(
- size + blurSizeOutline,
- size + blurSizeOutline,
- Bitmap.Config.ARGB_8888);
- Canvas canvas = new Canvas(b);
- canvas.translate(blurSizeOutline / 2, blurSizeOutline / 2);
- canvas.scale(((float) size) / bounds.width(), ((float) size) / bounds.height(), 0, 0);
- canvas.translate(bounds.left, bounds.top);
- d.draw(canvas);
- return b;
+ int size = ActivityContext.lookupContext(mView.getContext())
+ .getDeviceProfile().iconSizePx;
+ return new FastBitmapDrawable(
+ BitmapRenderer.createHardwareBitmap(
+ size + blurSizeOutline,
+ size + blurSizeOutline,
+ (c) -> drawDragViewOnBackground(c, size)));
}
private void drawDragViewOnBackground(Canvas canvas, float size) {
diff --git a/src/com/android/launcher3/shortcuts/ShortcutRequest.java b/src/com/android/launcher3/shortcuts/ShortcutRequest.java
index 5291ce4..07d3292 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutRequest.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutRequest.java
@@ -16,7 +16,7 @@
package com.android.launcher3.shortcuts;
-import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
+import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS;
import android.content.ComponentName;
import android.content.Context;
@@ -46,7 +46,7 @@
| ShortcutQuery.FLAG_MATCH_MANIFEST;
public static final int PINNED = ShortcutQuery.FLAG_MATCH_PINNED;
- private final ShortcutQuery mQuery = GO_DISABLE_WIDGETS ? null : new ShortcutQuery();
+ private final ShortcutQuery mQuery = GO_DISABLE_SHORTCUTS ? null : new ShortcutQuery();
private final Context mContext;
private final UserHandle mUserHandle;
@@ -73,7 +73,7 @@
* @return A list of ShortcutInfo's associated with the given package.
*/
public ShortcutRequest forPackage(String packageName, @Nullable List<String> shortcutIds) {
- if (!GO_DISABLE_WIDGETS && packageName != null) {
+ if (!GO_DISABLE_SHORTCUTS && packageName != null) {
mQuery.setPackage(packageName);
mQuery.setShortcutIds(shortcutIds);
}
@@ -81,7 +81,7 @@
}
public ShortcutRequest withContainer(@Nullable ComponentName activity) {
- if (!GO_DISABLE_WIDGETS) {
+ if (!GO_DISABLE_SHORTCUTS) {
if (activity == null) {
mFailed = true;
} else {
@@ -92,7 +92,7 @@
}
public QueryResult query(int flags) {
- if (GO_DISABLE_WIDGETS || mFailed) {
+ if (GO_DISABLE_SHORTCUTS || mFailed) {
return QueryResult.DEFAULT;
}
mQuery.setQueryFlags(flags);
@@ -108,7 +108,7 @@
public static class QueryResult extends ArrayList<ShortcutInfo> {
- static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_WIDGETS);
+ static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_SHORTCUTS);
private final boolean mWasSuccess;
diff --git a/src/com/android/launcher3/statemanager/BaseState.java b/src/com/android/launcher3/statemanager/BaseState.java
index f9a36ad..32378b8 100644
--- a/src/com/android/launcher3/statemanager/BaseState.java
+++ b/src/com/android/launcher3/statemanager/BaseState.java
@@ -63,4 +63,11 @@
default boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) {
return false;
}
+
+ /**
+ * For this state, whether tasks should show the thumbnail splash.
+ */
+ default boolean showTaskThumbnailSplash() {
+ return false;
+ }
}
diff --git a/src/com/android/launcher3/statemanager/StateManager.java b/src/com/android/launcher3/statemanager/StateManager.java
index 2aa9dde..86277a7 100644
--- a/src/com/android/launcher3/statemanager/StateManager.java
+++ b/src/com/android/launcher3/statemanager/StateManager.java
@@ -342,6 +342,7 @@
public void onAnimationSuccess(Animator animator) {
onStateTransitionEnd(state);
}
+
};
}
diff --git a/src/com/android/launcher3/statemanager/StatefulActivity.java b/src/com/android/launcher3/statemanager/StatefulActivity.java
index 2158dea..2a890c3 100644
--- a/src/com/android/launcher3/statemanager/StatefulActivity.java
+++ b/src/com/android/launcher3/statemanager/StatefulActivity.java
@@ -15,9 +15,14 @@
*/
package com.android.launcher3.statemanager;
+import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
+import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
+
import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS;
import static com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE;
+import android.content.res.Configuration;
+import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
@@ -30,6 +35,7 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.statemanager.StateManager.AtomicAnimationFactory;
import com.android.launcher3.statemanager.StateManager.StateHandler;
+import com.android.launcher3.util.window.WindowManagerProxy;
import com.android.launcher3.views.BaseDragLayer;
import java.util.List;
@@ -47,6 +53,17 @@
private LauncherRootView mRootView;
+ protected Configuration mOldConfig;
+ private int mOldRotation;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ mOldConfig = new Configuration(getResources().getConfiguration());
+ mOldRotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this);
+ }
+
/**
* Create handlers to control the property changes for this activity
*/
@@ -186,4 +203,32 @@
public void runOnBindToTouchInteractionService(Runnable r) {
r.run();
}
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ handleConfigurationChanged(newConfig);
+ super.onConfigurationChanged(newConfig);
+ }
+
+ /**
+ * Handles configuration change when system calls {@link #onConfigurationChanged}, or on other
+ * situations that configuration might change.
+ */
+ public void handleConfigurationChanged(Configuration newConfig) {
+ int diff = newConfig.diff(mOldConfig);
+ int rotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this);
+ if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0
+ || rotation != mOldRotation) {
+ onHandleConfigurationChanged();
+ }
+
+ mOldConfig.setTo(newConfig);
+ mOldRotation = rotation;
+ }
+
+ /**
+ * Logic for when device configuration changes (rotation, screen size change, multi-window,
+ * etc.)
+ */
+ protected abstract void onHandleConfigurationChanged();
}
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 38b62d4..b94ea07 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -21,23 +21,29 @@
import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE;
import static com.android.launcher3.Utilities.dpiFromPx;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
+import android.app.Activity;
+import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+import android.os.Handler;
+import android.os.Message;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.WorkerThread;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
-import com.android.launcher3.util.UiThreadHelper;
+import com.android.launcher3.util.DisplayController;
/**
* Utility class to manage launcher rotation
*/
public class RotationHelper implements OnSharedPreferenceChangeListener,
- DeviceProfile.OnDeviceProfileChangeListener {
-
- private static final String TAG = "RotationHelper";
+ DisplayController.DisplayInfoChangeListener {
public static final String ALLOW_ROTATION_PREFERENCE_KEY = "pref_allowRotation";
@@ -56,8 +62,10 @@
public static final int REQUEST_ROTATE = 1;
public static final int REQUEST_LOCK = 2;
+ @Nullable
private BaseActivity mActivity;
private SharedPreferences mSharedPrefs = null;
+ private final Handler mRequestOrientationHandler;
private boolean mIgnoreAutoRotateSettings;
private boolean mForceAllowRotationForTesting;
@@ -87,6 +95,8 @@
public RotationHelper(BaseActivity activity) {
mActivity = activity;
+ mRequestOrientationHandler =
+ new Handler(UI_HELPER_EXECUTOR.getLooper(), this::setOrientationAsync);
}
private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings) {
@@ -119,8 +129,8 @@
}
@Override
- public void onDeviceProfileChanged(DeviceProfile dp) {
- boolean ignoreAutoRotateSettings = dp.isTablet;
+ public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
+ boolean ignoreAutoRotateSettings = info.isTablet(info.realBounds);
if (mIgnoreAutoRotateSettings != ignoreAutoRotateSettings) {
setIgnoreAutoRotateSettings(ignoreAutoRotateSettings);
notifyChange();
@@ -157,8 +167,10 @@
public void initialize() {
if (!mInitialized) {
mInitialized = true;
- setIgnoreAutoRotateSettings(mActivity.getDeviceProfile().isTablet);
- mActivity.addOnDeviceProfileChangeListener(this);
+ DisplayController displayController = DisplayController.INSTANCE.get(mActivity);
+ DisplayController.Info info = displayController.getInfo();
+ setIgnoreAutoRotateSettings(info.isTablet(info.realBounds));
+ displayController.addChangeListener(this);
notifyChange();
}
}
@@ -166,7 +178,7 @@
public void destroy() {
if (!mDestroyed) {
mDestroyed = true;
- mActivity.removeOnDeviceProfileChangeListener(this);
+ DisplayController.INSTANCE.get(mActivity).removeChangeListener(this);
mActivity = null;
if (mSharedPrefs != null) {
mSharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
@@ -198,10 +210,19 @@
}
if (activityFlags != mLastActivityFlags) {
mLastActivityFlags = activityFlags;
- UiThreadHelper.setOrientationAsync(mActivity, activityFlags);
+ mRequestOrientationHandler.sendEmptyMessage(activityFlags);
}
}
+ @WorkerThread
+ private boolean setOrientationAsync(Message msg) {
+ Activity activity = mActivity;
+ if (activity != null) {
+ activity.setRequestedOrientation(msg.what);
+ }
+ return true;
+ }
+
/**
* @return how many factors {@param newRotation} is rotated 90 degrees clockwise.
* E.g. 1->Rotated by 90 degrees clockwise, 2->Rotated 180 clockwise...
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index a205ab5..3286afb 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -31,8 +31,7 @@
private static final int STATE_FLAGS = FLAG_MULTI_PAGE
| FLAG_WORKSPACE_INACCESSIBLE | FLAG_DISABLE_RESTORE
- | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_WORKSPACE_HAS_BACKGROUNDS
- | FLAG_HIDE_BACK_BUTTON;
+ | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_WORKSPACE_HAS_BACKGROUNDS;
public SpringLoadedState(int id) {
super(id, LAUNCHER_STATE_HOME, STATE_FLAGS);
@@ -52,13 +51,13 @@
}
float shrunkTop = grid.getCellLayoutSpringLoadShrunkTop();
- float scale = grid.getWorkspaceSpringLoadScale();
+ float scale = grid.getWorkspaceSpringLoadScale(launcher);
float halfHeight = ws.getHeight() / 2;
float myCenter = ws.getTop() + halfHeight;
float cellTopFromCenter = halfHeight - ws.getChildAt(0).getTop();
float actualCellTop = myCenter - cellTopFromCenter * scale;
- return new ScaleAndTranslation(scale, 0, (shrunkTop - actualCellTop) / scale);
+ return new ScaleAndTranslation(scale, 0, shrunkTop - actualCellTop);
}
@Override
diff --git a/src/com/android/launcher3/states/StateAnimationConfig.java b/src/com/android/launcher3/states/StateAnimationConfig.java
index f99519d..54735f0 100644
--- a/src/com/android/launcher3/states/StateAnimationConfig.java
+++ b/src/com/android/launcher3/states/StateAnimationConfig.java
@@ -64,6 +64,8 @@
ANIM_DEPTH,
ANIM_OVERVIEW_ACTIONS_FADE,
ANIM_WORKSPACE_PAGE_TRANSLATE_X,
+ ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE
})
@Retention(RetentionPolicy.SOURCE)
public @interface AnimType {}
@@ -84,8 +86,10 @@
public static final int ANIM_DEPTH = 13;
public static final int ANIM_OVERVIEW_ACTIONS_FADE = 14;
public static final int ANIM_WORKSPACE_PAGE_TRANSLATE_X = 15;
+ public static final int ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN = 17;
+ public static final int ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE = 18;
- private static final int ANIM_TYPES_COUNT = 17;
+ private static final int ANIM_TYPES_COUNT = 19;
protected final Interpolator[] mInterpolators = new Interpolator[ANIM_TYPES_COUNT];
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index 0334b96..269baf0 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -41,6 +41,9 @@
import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragLayer;
+import com.android.launcher3.testing.shared.HotseatCellCenterRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.launcher3.testing.shared.WorkspaceCellCenterRequest;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
@@ -109,12 +112,12 @@
case TestProtocol.REQUEST_APPS_LIST_SCROLL_Y: {
return getLauncherUIProperty(Bundle::putInt,
- l -> l.getAppsView().getActiveRecyclerView().getCurrentScrollY());
+ l -> l.getAppsView().getActiveRecyclerView().computeVerticalScrollOffset());
}
case TestProtocol.REQUEST_WIDGETS_SCROLL_Y: {
return getLauncherUIProperty(Bundle::putInt,
- l -> WidgetsFullSheet.getWidgetsView(l).getCurrentScrollY());
+ l -> WidgetsFullSheet.getWidgetsView(l).computeVerticalScrollOffset());
}
case TestProtocol.REQUEST_TARGET_INSETS: {
diff --git a/src/com/android/launcher3/testing/TestLogging.java b/src/com/android/launcher3/testing/TestLogging.java
index 103b565..c151606 100644
--- a/src/com/android/launcher3/testing/TestLogging.java
+++ b/src/com/android/launcher3/testing/TestLogging.java
@@ -22,6 +22,7 @@
import android.view.MotionEvent;
import com.android.launcher3.Utilities;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.function.BiConsumer;
diff --git a/src/com/android/launcher3/testing/HotseatCellCenterRequest.java b/src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
similarity index 98%
rename from src/com/android/launcher3/testing/HotseatCellCenterRequest.java
rename to src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
index cbb847e..7eb035a 100644
--- a/src/com/android/launcher3/testing/HotseatCellCenterRequest.java
+++ b/src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/ResourceUtils.java b/src/com/android/launcher3/testing/shared/ResourceUtils.java
similarity index 69%
rename from src/com/android/launcher3/ResourceUtils.java
rename to src/com/android/launcher3/testing/shared/ResourceUtils.java
index f709aca..d0ae258 100644
--- a/src/com/android/launcher3/ResourceUtils.java
+++ b/src/com/android/launcher3/testing/shared/ResourceUtils.java
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-package com.android.launcher3;
+package com.android.launcher3.testing.shared;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.util.TypedValue;
public class ResourceUtils {
+ private static final float EPSILON = 0.0001f;
public static final int DEFAULT_NAVBAR_VALUE = 48;
public static final int INVALID_RESOURCE_HANDLE = -1;
public static final String NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE = "navigation_bar_width";
@@ -35,6 +36,8 @@
public static final String STATUS_BAR_HEIGHT_LANDSCAPE = "status_bar_height_landscape";
public static final String STATUS_BAR_HEIGHT_PORTRAIT = "status_bar_height_portrait";
+ public static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode";
+
public static int getNavbarSize(String resName, Resources res) {
return getDimenByName(resName, res, DEFAULT_NAVBAR_VALUE);
}
@@ -71,7 +74,25 @@
}
public static int pxFromDp(float size, DisplayMetrics metrics, float scale) {
- return size < 0 ? INVALID_RESOURCE_HANDLE : Math.round(scale
- * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, metrics));
+ float value = scale * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, metrics);
+ return size < 0 ? INVALID_RESOURCE_HANDLE : roundPxValueFromFloat(value);
+ }
+
+ /**
+ * Rounds a pixel value, taking into account floating point errors.
+ *
+ * <p>If a dp (or sp) value typically returns a half pixel, such as 20dp at a 2.625 density
+ * returning 52.5px, there is a small chance that due to floating-point errors, the value will
+ * be stored as 52.499999. As we round to the nearest pixel, this could cause a 1px difference
+ * in final values, which we correct for in this method.
+ */
+ public static int roundPxValueFromFloat(float value) {
+ float fraction = (float) (value - Math.floor(value));
+ if (Math.abs(0.5f - fraction) < EPSILON) {
+ // Note: we add for negative values as well, as Math.round brings -.5 to the next
+ // "highest" value, e.g. Math.round(-2.5) == -2 [i.e. (int)Math.floor(a + 0.5d)]
+ value += EPSILON;
+ }
+ return Math.round(value);
}
}
diff --git a/src/com/android/launcher3/testing/TestInformationRequest.java b/src/com/android/launcher3/testing/shared/TestInformationRequest.java
similarity index 94%
rename from src/com/android/launcher3/testing/TestInformationRequest.java
rename to src/com/android/launcher3/testing/shared/TestInformationRequest.java
index 272ae56..38282032 100644
--- a/src/com/android/launcher3/testing/TestInformationRequest.java
+++ b/src/com/android/launcher3/testing/shared/TestInformationRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java
similarity index 97%
rename from src/com/android/launcher3/testing/TestProtocol.java
rename to src/com/android/launcher3/testing/shared/TestProtocol.java
index 9bc9067..5116b01 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/shared/TestProtocol.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
/**
* Protocol for custom accessibility events for communication with UI Automation tests.
@@ -86,6 +86,7 @@
public static final String REQUEST_DISABLE_MANUAL_TASKBAR_STASHING = "disable-taskbar-stashing";
public static final String REQUEST_UNSTASH_TASKBAR_IF_STASHED = "unstash-taskbar-if-stashed";
public static final String REQUEST_STASHED_TASKBAR_HEIGHT = "stashed-taskbar-height";
+ public static final String REQUEST_RECREATE_TASKBAR = "recreate-taskbar";
public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y";
public static final String REQUEST_WIDGETS_SCROLL_Y = "widgets-scroll-y";
@@ -136,8 +137,8 @@
public static final String NO_DROP_TARGET = "b/195031154";
public static final String NULL_INT_SET = "b/200572078";
public static final String MISSING_PROMISE_ICON = "b/202985412";
- public static final String BAD_STATE = "b/223498680";
public static final String TASKBAR_IN_APP_STATE = "b/227657604";
+ public static final String INCORRECT_INFO_UPDATED = "b/239465630";
public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
diff --git a/src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java b/src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
similarity index 98%
rename from src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java
rename to src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
index 71ab09f..80dbef8 100644
--- a/src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java
+++ b/src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 09b8228..8f7a4ec 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -32,6 +32,7 @@
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
+import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.Launcher;
@@ -211,6 +212,10 @@
mFlingBlockCheck.blockFling();
}
}
+ if (mFromState == LauncherState.ALL_APPS) {
+ mAllAppsOvershootStarted = true;
+ mLauncher.getAppsView().onPull(-progress , -progress);
+ }
} else if (progress >= 1) {
if (reinitCurrentAnimation(true, isDragTowardPositive)) {
mDisplacementShift = displacement;
diff --git a/src/com/android/launcher3/touch/AllAppsSwipeController.java b/src/com/android/launcher3/touch/AllAppsSwipeController.java
index 37b76fb..5279dec 100644
--- a/src/com/android/launcher3/touch/AllAppsSwipeController.java
+++ b/src/com/android/launcher3/touch/AllAppsSwipeController.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.anim.Interpolators.DECELERATED_EASE;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE;
import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE;
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
@@ -199,8 +200,10 @@
Interpolators.reverse(ALL_APPS_SCRIM_RESPONDER));
config.setInterpolator(ANIM_ALL_APPS_FADE, FINAL_FRAME);
if (!config.userControlled) {
- config.setInterpolator(ANIM_VERTICAL_PROGRESS, EMPHASIZED_ACCELERATE);
+ config.setInterpolator(ANIM_VERTICAL_PROGRESS, EMPHASIZED);
}
+ config.setInterpolator(ANIM_WORKSPACE_SCALE, EMPHASIZED);
+ config.setInterpolator(ANIM_DEPTH, EMPHASIZED);
} else {
if (config.userControlled) {
config.setInterpolator(ANIM_DEPTH, Interpolators.reverse(BLUR_MANUAL));
@@ -238,8 +241,10 @@
config.setInterpolator(ANIM_ALL_APPS_FADE, INSTANT);
config.setInterpolator(ANIM_SCRIM_FADE, ALL_APPS_SCRIM_RESPONDER);
if (!config.userControlled) {
- config.setInterpolator(ANIM_VERTICAL_PROGRESS, EMPHASIZED_DECELERATE);
+ config.setInterpolator(ANIM_VERTICAL_PROGRESS, EMPHASIZED);
}
+ config.setInterpolator(ANIM_WORKSPACE_SCALE, EMPHASIZED);
+ config.setInterpolator(ANIM_DEPTH, EMPHASIZED);
} else {
config.setInterpolator(ANIM_DEPTH, config.userControlled ? BLUR_MANUAL : BLUR_ATOMIC);
config.setInterpolator(ANIM_WORKSPACE_FADE,
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index 32c5aa5..b4be061 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -61,7 +61,7 @@
import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.FloatingIconView;
diff --git a/src/com/android/launcher3/touch/ItemLongClickListener.java b/src/com/android/launcher3/touch/ItemLongClickListener.java
index 53cd416..1421ece 100644
--- a/src/com/android/launcher3/touch/ItemLongClickListener.java
+++ b/src/com/android/launcher3/touch/ItemLongClickListener.java
@@ -27,7 +27,6 @@
import android.view.View.OnLongClickListener;
import com.android.launcher3.CellLayout;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DropTarget;
import com.android.launcher3.Launcher;
import com.android.launcher3.dragndrop.DragController;
@@ -36,7 +35,7 @@
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BubbleTextHolder;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
@@ -118,10 +117,7 @@
}
});
- DeviceProfile grid = launcher.getDeviceProfile();
- DragOptions options = new DragOptions();
- options.intrinsicIconScaleFactor = (float) grid.allAppsIconSizePx / grid.iconSizePx;
- launcher.getWorkspace().beginDragShared(v, launcher.getAppsView(), options);
+ launcher.getWorkspace().beginDragShared(v, launcher.getAppsView(), new DragOptions());
return false;
}
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index fa4eb70..9afca4f 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -376,6 +376,19 @@
return isRtl ? 1 : -1;
}
+ @Override
+ public void setSecondaryTaskMenuPosition(SplitBounds splitBounds, View taskView,
+ DeviceProfile deviceProfile, View primarySnaphotView, View taskMenuView) {
+ float topLeftTaskPlusDividerPercent = splitBounds.appsStackedVertically
+ ? (splitBounds.topTaskPercent + splitBounds.dividerHeightPercent)
+ : (splitBounds.leftTaskPercent + splitBounds.dividerWidthPercent);
+ FrameLayout.LayoutParams snapshotParams =
+ (FrameLayout.LayoutParams) primarySnaphotView.getLayoutParams();
+ float additionalOffset = (taskView.getHeight() - snapshotParams.topMargin)
+ * topLeftTaskPlusDividerPercent;
+ taskMenuView.setY(taskMenuView.getY() + additionalOffset);
+ }
+
/* -------------------- */
@Override
@@ -440,7 +453,7 @@
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
int splitInstructionsWidth, int threeButtonNavShift) {
out.setPivotX(0);
- out.setPivotY(0);
+ out.setPivotY(splitInstructionsHeight);
out.setRotation(getDegreesRotated());
int distanceToEdge = out.getResources().getDimensionPixelSize(
R.dimen.split_instructions_bottom_margin_phone_landscape);
@@ -448,8 +461,8 @@
int insetCorrectionX = dp.getInsets().left;
// Center the view in case of unbalanced insets on top or bottom of screen
int insetCorrectionY = (dp.getInsets().bottom - dp.getInsets().top) / 2;
- out.setTranslationX(splitInstructionsHeight + distanceToEdge - insetCorrectionX);
- out.setTranslationY(((splitInstructionsHeight - splitInstructionsWidth) / 2f)
+ out.setTranslationX(distanceToEdge - insetCorrectionX);
+ out.setTranslationY(((-splitInstructionsHeight - splitInstructionsWidth) / 2f)
+ insetCorrectionY);
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams();
// Setting gravity to LEFT instead of the lint-recommended START because we always want this
@@ -492,8 +505,8 @@
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = parentHeight - spaceAboveSnapshot;
int dividerBar = splitBoundsConfig.appsStackedVertically
- ? splitBoundsConfig.visualDividerBounds.height()
- : splitBoundsConfig.visualDividerBounds.width();
+ ? (int) (splitBoundsConfig.dividerHeightPercent * parentHeight)
+ : (int) (splitBoundsConfig.dividerWidthPercent * parentWidth);
int primarySnapshotHeight;
int primarySnapshotWidth;
int secondarySnapshotHeight;
@@ -523,6 +536,7 @@
iconParams.rightMargin = -taskIconHeight - taskIconMargin / 2;
iconParams.leftMargin = 0;
iconParams.topMargin = thumbnailTopMargin / 2;
+ iconParams.bottomMargin = 0;
}
@Override
@@ -580,4 +594,22 @@
FloatProperty secondary, DeviceProfile deviceProfile) {
return new Pair<>(primary, secondary);
}
+
+ @Override
+ public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp) {
+ float currentTranslationY = floatingTask.getTranslationY();
+ return currentTranslationY - onScreenRect.height();
+ }
+
+ @Override
+ public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
+ DeviceProfile dp) {
+ floatingTask.setTranslationY(translation);
+ }
+
+ @Override
+ public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
+ return floatingTask.getTranslationY();
+ }
}
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index 6bc021b..cbcb700 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -34,9 +34,9 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import java.util.List;
@@ -231,6 +231,14 @@
int getTaskDragDisplacementFactor(boolean isRtl);
/**
+ * Calls the corresponding {@link View#setX(float)} or {@link View#setY(float)}
+ * on {@param taskMenuView} by taking the space needed by {@param primarySnapshotView} into
+ * account.
+ * This is expected to only be called for secondary (bottom/right) tasks.
+ */
+ void setSecondaryTaskMenuPosition(SplitBounds splitBounds, View taskView,
+ DeviceProfile deviceProfile, View primarySnaphotView, View taskMenuView);
+ /**
* Maps the velocity from the coordinate plane of the foreground app to that
* of Launcher's (which now will always be portrait)
*/
@@ -242,6 +250,41 @@
*/
void fixBoundsForHomeAnimStartRect(RectF outStartRect, DeviceProfile deviceProfile);
+ /**
+ * Determine the target translation for animating the FloatingTaskView out. This value could
+ * either be an x-coordinate or a y-coordinate, depending on which way the FloatingTaskView was
+ * docked.
+ *
+ * @param floatingTask The FloatingTaskView.
+ * @param onScreenRect The current on-screen dimensions of the FloatingTaskView.
+ * @param stagePosition STAGE_POSITION_TOP_OR_LEFT or STAGE_POSITION_BOTTOM_OR_RIGHT.
+ * @param dp The device profile.
+ * @return A float. When an animation translates the FloatingTaskView to this position, it will
+ * appear to tuck away off the edge of the screen.
+ */
+ float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp);
+
+ /**
+ * Sets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
+ * either x or y), depending on how the view is oriented.
+ *
+ * @param floatingTask The FloatingTaskView to be translated.
+ * @param translation The target translation value.
+ * @param dp The current device profile.
+ */
+ void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, DeviceProfile dp);
+
+ /**
+ * Gets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
+ * either x or y), depending on how the view is oriented.
+ *
+ * @param floatingTask The FloatingTaskView in question.
+ * @param dp The current device profile.
+ * @return The current translation value.
+ */
+ Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp);
+
class ChildBounds {
public final int primaryDimension;
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 181dca5..bc1b634 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -27,7 +27,7 @@
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
-import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS;
+import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
@@ -52,9 +52,9 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.views.BaseDragLayer;
import java.util.List;
@@ -316,6 +316,26 @@
}
@Override
+ public void setSecondaryTaskMenuPosition(SplitBounds splitBounds, View taskView,
+ DeviceProfile deviceProfile, View primarySnaphotView, View taskMenuView) {
+ float topLeftTaskPlusDividerPercent = splitBounds.appsStackedVertically
+ ? (splitBounds.topTaskPercent + splitBounds.dividerHeightPercent)
+ : (splitBounds.leftTaskPercent + splitBounds.dividerWidthPercent);
+ FrameLayout.LayoutParams snapshotParams =
+ (FrameLayout.LayoutParams) primarySnaphotView.getLayoutParams();
+ float additionalOffset;
+ if (deviceProfile.isLandscape) {
+ additionalOffset = (taskView.getWidth() - snapshotParams.leftMargin)
+ * topLeftTaskPlusDividerPercent;
+ taskMenuView.setX(taskMenuView.getX() + additionalOffset);
+ } else {
+ additionalOffset = (taskView.getHeight() - snapshotParams.topMargin)
+ * topLeftTaskPlusDividerPercent;
+ taskMenuView.setY(taskMenuView.getY() + additionalOffset);
+ }
+ }
+
+ @Override
public Pair<Float, Float> getDwbLayoutTranslations(int taskViewWidth,
int taskViewHeight, SplitBounds splitBounds, DeviceProfile deviceProfile,
View[] thumbnailViews, int desiredTaskId, View banner) {
@@ -500,7 +520,7 @@
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
int splitInstructionsWidth, int threeButtonNavShift) {
out.setPivotX(0);
- out.setPivotY(0);
+ out.setPivotY(splitInstructionsHeight);
out.setRotation(getDegreesRotated());
int distanceToEdge;
if ((DisplayController.getNavigationMode(out.getContext()) == THREE_BUTTONS)
@@ -658,8 +678,9 @@
public void setTaskIconParams(FrameLayout.LayoutParams iconParams, int taskIconMargin,
int taskIconHeight, int thumbnailTopMargin, boolean isRtl) {
iconParams.gravity = TOP | CENTER_HORIZONTAL;
+ // Reset margins, since they may have been set on rotation
iconParams.leftMargin = iconParams.rightMargin = 0;
- iconParams.topMargin = taskIconMargin;
+ iconParams.topMargin = iconParams.bottomMargin = 0;
}
@Override
@@ -756,4 +777,36 @@
return new Pair<>(secondary, primary);
}
}
+
+ @Override
+ public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp) {
+ if (dp.isLandscape) {
+ float currentTranslationX = floatingTask.getTranslationX();
+ return stagePosition == STAGE_POSITION_TOP_OR_LEFT
+ ? currentTranslationX - onScreenRect.width()
+ : currentTranslationX + onScreenRect.width();
+ } else {
+ float currentTranslationY = floatingTask.getTranslationY();
+ return currentTranslationY - onScreenRect.height();
+ }
+ }
+
+ @Override
+ public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
+ DeviceProfile dp) {
+ if (dp.isLandscape) {
+ floatingTask.setTranslationX(translation);
+ } else {
+ floatingTask.setTranslationY(translation);
+ }
+
+ }
+
+ @Override
+ public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
+ return dp.isLandscape
+ ? floatingTask.getTranslationX()
+ : floatingTask.getTranslationY();
+ }
}
diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
index 339f910..55bb5e8 100644
--- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
@@ -190,7 +190,7 @@
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
int splitInstructionsWidth, int threeButtonNavShift) {
out.setPivotX(0);
- out.setPivotY(0);
+ out.setPivotY(splitInstructionsHeight);
out.setRotation(getDegreesRotated());
int distanceToEdge = out.getResources().getDimensionPixelSize(
R.dimen.split_instructions_bottom_margin_phone_landscape);
@@ -198,9 +198,8 @@
int insetCorrectionX = dp.getInsets().right;
// Center the view in case of unbalanced insets on top or bottom of screen
int insetCorrectionY = (dp.getInsets().bottom - dp.getInsets().top) / 2;
- out.setTranslationX(splitInstructionsWidth - splitInstructionsHeight - distanceToEdge
- + insetCorrectionX);
- out.setTranslationY(((splitInstructionsHeight + splitInstructionsWidth) / 2f)
+ out.setTranslationX(splitInstructionsWidth - distanceToEdge + insetCorrectionX);
+ out.setTranslationY(((-splitInstructionsHeight + splitInstructionsWidth) / 2f)
+ insetCorrectionY);
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams();
// Setting gravity to RIGHT instead of the lint-recommended END because we always want this
@@ -216,6 +215,7 @@
iconParams.leftMargin = -taskIconHeight - taskIconMargin / 2;
iconParams.rightMargin = 0;
iconParams.topMargin = thumbnailTopMargin / 2;
+ iconParams.bottomMargin = 0;
}
@Override
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 17bbdf1..6cb021b 100644
--- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java
+++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
@@ -43,7 +43,7 @@
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Helper class to handle touch on empty space in workspace and show options popup on long press
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 15fe1d9..e57c88d 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -19,11 +19,7 @@
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
-import static com.android.launcher3.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.Utilities.dpiFromPx;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_2_BUTTON;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_3_BUTTON;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
@@ -46,9 +42,7 @@
import androidx.annotation.AnyThread;
import androidx.annotation.UiThread;
-import com.android.launcher3.ResourceUtils;
import com.android.launcher3.Utilities;
-import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.util.window.CachedDisplayInfo;
import com.android.launcher3.util.window.WindowManagerProxy;
@@ -56,6 +50,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -81,7 +76,6 @@
| CHANGE_DENSITY | CHANGE_SUPPORTED_BOUNDS | CHANGE_NAVIGATION_MODE;
private static final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED";
- private static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode";
private static final String TARGET_OVERLAY_PACKAGE = "android";
private final Context mContext;
@@ -278,11 +272,11 @@
public final float fontScale;
private final int densityDpi;
public final NavigationMode navigationMode;
-
private final PortraitSize mScreenSizeDp;
+ // WindowBounds
+ public final WindowBounds realBounds;
public final Set<WindowBounds> supportedBounds = new ArraySet<>();
-
private final ArrayMap<CachedDisplayInfo, WindowBounds[]> mPerDisplayBounds =
new ArrayMap<>();
@@ -294,7 +288,7 @@
// Used for testing
public Info(Context displayInfoContext,
WindowManagerProxy wmProxy,
- ArrayMap<CachedDisplayInfo, WindowBounds[]> perDisplayBoundsCache) {
+ Map<CachedDisplayInfo, WindowBounds[]> perDisplayBoundsCache) {
CachedDisplayInfo displayInfo = wmProxy.getDisplayInfo(displayInfoContext);
normalizedDisplayInfo = displayInfo.normalize();
rotation = displayInfo.rotation;
@@ -305,12 +299,12 @@
fontScale = config.fontScale;
densityDpi = config.densityDpi;
mScreenSizeDp = new PortraitSize(config.screenHeightDp, config.screenWidthDp);
- navigationMode = parseNavigationMode(displayInfoContext);
+ navigationMode = wmProxy.getNavigationMode(displayInfoContext);
mPerDisplayBounds.putAll(perDisplayBoundsCache);
WindowBounds[] cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
- WindowBounds realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
+ realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
if (cachedValue == null) {
// Unexpected normalizedDisplayInfo is found, recreate the cache
Log.e(TAG, "Unexpected normalizedDisplayInfo found, invalidating cache");
@@ -405,35 +399,4 @@
}
}
- public enum NavigationMode {
- THREE_BUTTONS(false, 0, LAUNCHER_NAVIGATION_MODE_3_BUTTON),
- TWO_BUTTONS(true, 1, LAUNCHER_NAVIGATION_MODE_2_BUTTON),
- NO_BUTTON(true, 2, LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON);
-
- public final boolean hasGestures;
- public final int resValue;
- public final LauncherEvent launcherEvent;
-
- NavigationMode(boolean hasGestures, int resValue, LauncherEvent launcherEvent) {
- this.hasGestures = hasGestures;
- this.resValue = resValue;
- this.launcherEvent = launcherEvent;
- }
- }
-
- private static NavigationMode parseNavigationMode(Context context) {
- int modeInt = ResourceUtils.getIntegerByName(NAV_BAR_INTERACTION_MODE_RES_NAME,
- context.getResources(), INVALID_RESOURCE_HANDLE);
-
- if (modeInt == INVALID_RESOURCE_HANDLE) {
- Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?");
- } else {
- for (NavigationMode m : NavigationMode.values()) {
- if (m.resValue == modeInt) {
- return m;
- }
- }
- }
- return Utilities.ATLEAST_S ? NavigationMode.NO_BUTTON : NavigationMode.THREE_BUTTONS;
- }
}
diff --git a/src/com/android/launcher3/util/LogConfig.java b/src/com/android/launcher3/util/LogConfig.java
index 6bc26e7..ee1d1ff 100644
--- a/src/com/android/launcher3/util/LogConfig.java
+++ b/src/com/android/launcher3/util/LogConfig.java
@@ -40,4 +40,14 @@
* When turned on, we enable suggest related logging.
*/
public static final String SEARCH_LOGGING = "SearchLogging";
+
+ /**
+ * When turned on, we enable IME related latency related logging.
+ */
+ public static final String IME_LATENCY_LOGGING = "ImeLatencyLogging";
+
+ /**
+ * When turned on, we enable web suggest appSearch related logging.
+ */
+ public static final String WEB_APP_SEARCH_LOGGING = "WebAppSearchLogging";
}
diff --git a/src/com/android/launcher3/util/MultiAdditivePropertyFactory.java b/src/com/android/launcher3/util/MultiPropertyFactory.java
similarity index 70%
rename from src/com/android/launcher3/util/MultiAdditivePropertyFactory.java
rename to src/com/android/launcher3/util/MultiPropertyFactory.java
index 50f7027..e7a7785 100644
--- a/src/com/android/launcher3/util/MultiAdditivePropertyFactory.java
+++ b/src/com/android/launcher3/util/MultiPropertyFactory.java
@@ -20,7 +20,6 @@
import android.util.FloatProperty;
import android.util.Log;
import android.util.Property;
-import android.view.View;
/**
* Allows to combine multiple values set by several sources.
@@ -30,43 +29,55 @@
* time.
*
* This class behaves similarly to [MultiValueAlpha], but is meant to be more abstract and reusable.
- * It sets the addition of all values.
+ * It aggregate all values using the provided [aggregator].
*
* @param <T> Type where to apply the property.
*/
-public class MultiAdditivePropertyFactory<T extends View> {
+public class MultiPropertyFactory<T> {
private static final boolean DEBUG = false;
- private static final String TAG = "MultiAdditivePropertyFactory";
+ private static final String TAG = "MultiPropertyFactory";
private final String mName;
- private final ArrayMap<Integer, MultiAdditiveProperty> mProperties =
- new ArrayMap<>();
+ private final ArrayMap<Integer, MultiProperty> mProperties = new ArrayMap<>();
// This is an optimization for cases when set is called repeatedly with the same setterIndex.
private float mAggregationOfOthers = 0f;
private Integer mLastIndexSet = -1;
- private final Property<View, Float> mProperty;
+ private final Property<T, Float> mProperty;
+ private final FloatBiFunction mAggregator;
- public MultiAdditivePropertyFactory(String name, Property<View, Float> property) {
+ /**
+ * Represents a function that accepts two float and produces a float.
+ */
+ public interface FloatBiFunction {
+ /**
+ * Applies this function to the given arguments.
+ */
+ float apply(float a, float b);
+ }
+
+ public MultiPropertyFactory(String name, Property<T, Float> property,
+ FloatBiFunction aggregator) {
mName = name;
mProperty = property;
+ mAggregator = aggregator;
}
/** Returns the [MultiFloatProperty] associated with [inx], creating it if not present. */
- public MultiAdditiveProperty get(Integer index) {
+ public MultiProperty get(Integer index) {
return mProperties.computeIfAbsent(index,
- (k) -> new MultiAdditiveProperty(index, mName + "_" + index));
+ (k) -> new MultiProperty(index, mName + "_" + index));
}
/**
* Each [setValue] will be aggregated with the other properties values created by the
* corresponding factory.
*/
- class MultiAdditiveProperty extends FloatProperty<T> {
+ class MultiProperty extends FloatProperty<T> {
private final int mInx;
private float mValue = 0f;
- MultiAdditiveProperty(int inx, String name) {
+ MultiProperty(int inx, String name) {
super(name);
mInx = inx;
}
@@ -77,12 +88,13 @@
mAggregationOfOthers = 0f;
mProperties.forEach((key, property) -> {
if (key != mInx) {
- mAggregationOfOthers += property.mValue;
+ mAggregationOfOthers =
+ mAggregator.apply(mAggregationOfOthers, property.mValue);
}
});
mLastIndexSet = mInx;
}
- float lastAggregatedValue = mAggregationOfOthers + newValue;
+ float lastAggregatedValue = mAggregator.apply(mAggregationOfOthers, newValue);
mValue = newValue;
apply(obj, lastAggregatedValue);
@@ -94,13 +106,13 @@
}
@Override
- public Float get(T view) {
+ public Float get(T object) {
// The scale of the view should match mLastAggregatedValue. Still, if it has been
// changed without using this property, it can differ. As this get method is usually
// used to set the starting point on an animation, this would result in some jumps
// when the view scale is different than the last aggregated value. To stay on the
// safe side, let's return the real view scale.
- return mProperty.get(view);
+ return mProperty.get(object);
}
@Override
@@ -109,7 +121,7 @@
}
}
- protected void apply(View view, float value) {
- mProperty.set(view, value);
+ protected void apply(T object, float value) {
+ mProperty.set(object, value);
}
}
diff --git a/src/com/android/launcher3/util/NavigationMode.java b/src/com/android/launcher3/util/NavigationMode.java
new file mode 100644
index 0000000..37dd41c
--- /dev/null
+++ b/src/com/android/launcher3/util/NavigationMode.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util;
+
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_2_BUTTON;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_3_BUTTON;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON;
+
+import com.android.launcher3.logging.StatsLogManager;
+
+/**
+ * Navigation mode used in the device.
+ */
+public enum NavigationMode {
+ THREE_BUTTONS(false, 0, LAUNCHER_NAVIGATION_MODE_3_BUTTON),
+ TWO_BUTTONS(true, 1, LAUNCHER_NAVIGATION_MODE_2_BUTTON),
+ NO_BUTTON(true, 2, LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON);
+
+ public final boolean hasGestures;
+ public final int resValue;
+ public final StatsLogManager.LauncherEvent launcherEvent;
+
+ NavigationMode(boolean hasGestures, int resValue, StatsLogManager.LauncherEvent launcherEvent) {
+ this.hasGestures = hasGestures;
+ this.resValue = resValue;
+ this.launcherEvent = launcherEvent;
+ }
+}
diff --git a/src/com/android/launcher3/util/OnboardingPrefs.java b/src/com/android/launcher3/util/OnboardingPrefs.java
index f4cf21e..d942b7a 100644
--- a/src/com/android/launcher3/util/OnboardingPrefs.java
+++ b/src/com/android/launcher3/util/OnboardingPrefs.java
@@ -43,13 +43,14 @@
public static final String SEARCH_ONBOARDING_COUNT = "launcher.search_onboarding_count";
public static final String TASKBAR_EDU_SEEN = "launcher.taskbar_edu_seen";
public static final String ALL_APPS_VISITED_COUNT = "launcher.all_apps_visited_count";
+ public static final String QSB_SEARCH_ONBOARDING_CARD_DISMISSED = "launcher.qsb_edu_dismiss";
// 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_KEYBOARD_EDU_SEEN, SEARCH_SNACKBAR_COUNT,
- SEARCH_ONBOARDING_COUNT},
+ SEARCH_ONBOARDING_COUNT, QSB_SEARCH_ONBOARDING_CARD_DISMISSED},
"Taskbar Education", new String[] { TASKBAR_EDU_SEEN },
"All Apps Visited Count", new String[] {ALL_APPS_VISITED_COUNT}
);
@@ -61,7 +62,8 @@
HOME_BOUNCE_SEEN,
HOTSEAT_LONGPRESS_TIP_SEEN,
SEARCH_KEYBOARD_EDU_SEEN,
- TASKBAR_EDU_SEEN
+ TASKBAR_EDU_SEEN,
+ QSB_SEARCH_ONBOARDING_CARD_DISMISSED
})
@Retention(RetentionPolicy.SOURCE)
public @interface EventBoolKey {}
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index f42d304..12e8b54 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -43,6 +43,9 @@
import android.util.Pair;
import android.widget.Toast;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.PendingAddItemInfo;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -54,6 +57,7 @@
import java.net.URISyntaxException;
import java.util.List;
+import java.util.Objects;
/**
* Utility methods using package manager
@@ -62,22 +66,28 @@
private static final String TAG = "PackageManagerHelper";
+ @NonNull
private final Context mContext;
+
+ @NonNull
private final PackageManager mPm;
+
+ @NonNull
private final LauncherApps mLauncherApps;
- public PackageManagerHelper(Context context) {
+ public PackageManagerHelper(@NonNull final Context context) {
mContext = context;
mPm = context.getPackageManager();
- mLauncherApps = context.getSystemService(LauncherApps.class);
+ mLauncherApps = Objects.requireNonNull(context.getSystemService(LauncherApps.class));
}
/**
* Returns true if the app can possibly be on the SDCard. This is just a workaround and doesn't
* guarantee that the app is on SD card.
*/
- public boolean isAppOnSdcard(String packageName, UserHandle user) {
- ApplicationInfo info = getApplicationInfo(
+ public boolean isAppOnSdcard(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
+ final ApplicationInfo info = getApplicationInfo(
packageName, user, PackageManager.MATCH_UNINSTALLED_PACKAGES);
return info != null && (info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0;
}
@@ -86,23 +96,27 @@
* Returns whether the target app is suspended for a given user as per
* {@link android.app.admin.DevicePolicyManager#isPackageSuspended}.
*/
- public boolean isAppSuspended(String packageName, UserHandle user) {
- ApplicationInfo info = getApplicationInfo(packageName, user, 0);
+ public boolean isAppSuspended(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
+ final ApplicationInfo info = getApplicationInfo(packageName, user, 0);
return info != null && isAppSuspended(info);
}
/**
* Returns whether the target app is installed for a given user
*/
- public boolean isAppInstalled(String packageName, UserHandle user) {
- ApplicationInfo info = getApplicationInfo(packageName, user, 0);
+ public boolean isAppInstalled(@NonNull final String packageName,
+ @NonNull final UserHandle user) {
+ final ApplicationInfo info = getApplicationInfo(packageName, user, 0);
return info != null;
}
/**
* Returns the application info for the provided package or null
*/
- public ApplicationInfo getApplicationInfo(String packageName, UserHandle user, int flags) {
+ @Nullable
+ public ApplicationInfo getApplicationInfo(@NonNull final String packageName,
+ @NonNull final UserHandle user, final int flags) {
try {
ApplicationInfo info = mLauncherApps.getApplicationInfo(packageName, flags, user);
return (info.flags & ApplicationInfo.FLAG_INSTALLED) == 0 || !info.enabled
@@ -116,7 +130,8 @@
return mPm.isSafeMode();
}
- public Intent getAppLaunchIntent(String pkg, UserHandle user) {
+ @Nullable
+ public Intent getAppLaunchIntent(@Nullable final String pkg, @NonNull final UserHandle user) {
List<LauncherActivityInfo> activities = mLauncherApps.getActivityList(pkg, user);
return activities.isEmpty() ? null :
AppInfo.makeLaunchIntent(activities.get(0));
@@ -251,7 +266,8 @@
return packageFilter;
}
- public static boolean isSystemApp(Context context, Intent intent) {
+ public static boolean isSystemApp(@NonNull final Context context,
+ @NonNull final Intent intent) {
PackageManager pm = context.getPackageManager();
ComponentName cn = intent.getComponent();
String packageName = null;
diff --git a/src/com/android/launcher3/util/PendingSplitSelectInfo.java b/src/com/android/launcher3/util/PendingSplitSelectInfo.java
index ed02465..58c3be5 100644
--- a/src/com/android/launcher3/util/PendingSplitSelectInfo.java
+++ b/src/com/android/launcher3/util/PendingSplitSelectInfo.java
@@ -16,6 +16,7 @@
package com.android.launcher3.util;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
/**
@@ -28,10 +29,13 @@
private final int mStagedTaskId;
private final int mStagePosition;
+ private final StatsLogManager.EventEnum mSource;
- public PendingSplitSelectInfo(int stagedTaskId, int stagePosition) {
+ public PendingSplitSelectInfo(int stagedTaskId, int stagePosition,
+ StatsLogManager.EventEnum source) {
this.mStagedTaskId = stagedTaskId;
this.mStagePosition = stagePosition;
+ this.mSource = source;
}
public int getStagedTaskId() {
@@ -41,4 +45,8 @@
public @StagePosition int getStagePosition() {
return mStagePosition;
}
+
+ public StatsLogManager.EventEnum getSource() {
+ return mSource;
+ }
}
diff --git a/src/com/android/launcher3/util/ScrollableLayoutManager.java b/src/com/android/launcher3/util/ScrollableLayoutManager.java
new file mode 100644
index 0000000..17eaefd
--- /dev/null
+++ b/src/com/android/launcher3/util/ScrollableLayoutManager.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.util;
+
+import android.content.Context;
+import android.util.SparseIntArray;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView.Adapter;
+import androidx.recyclerview.widget.RecyclerView.State;
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
+
+/**
+ * Extension of {@link GridLayoutManager} with support for smooth scrolling
+ */
+public class ScrollableLayoutManager extends GridLayoutManager {
+
+ // keyed on item type
+ protected final SparseIntArray mCachedSizes = new SparseIntArray();
+
+ private RecyclerView mRv;
+
+ /**
+ * Precalculated total height keyed on the item position. This is always incremental.
+ * Subclass can override {@link #incrementTotalHeight} to incorporate the layout logic.
+ * For example all-apps should have same values for items in same row,
+ * sample values: 0, 10, 10, 10, 10, 20, 20, 20, 20
+ * whereas widgets will have strictly increasing values
+ * sample values: 0, 10, 50, 60, 110
+ */
+
+ //
+ private int[] mTotalHeightCache = new int[1];
+ private int mLastValidHeightIndex = 0;
+
+ public ScrollableLayoutManager(Context context) {
+ super(context, 1, GridLayoutManager.VERTICAL, false);
+ }
+
+ @Override
+ public void onAttachedToWindow(RecyclerView view) {
+ super.onAttachedToWindow(view);
+ mRv = view;
+ }
+
+ @Override
+ public void layoutDecorated(@NonNull View child, int left, int top, int right, int bottom) {
+ super.layoutDecorated(child, left, top, right, bottom);
+ mCachedSizes.put(
+ mRv.getChildViewHolder(child).getItemViewType(), child.getMeasuredHeight());
+ }
+
+ @Override
+ public void layoutDecoratedWithMargins(@NonNull View child, int left, int top, int right,
+ int bottom) {
+ super.layoutDecoratedWithMargins(child, left, top, right, bottom);
+ mCachedSizes.put(
+ mRv.getChildViewHolder(child).getItemViewType(), child.getMeasuredHeight());
+ }
+
+ @Override
+ public int computeVerticalScrollExtent(State state) {
+ return mRv == null ? 0 : mRv.getHeight();
+ }
+
+ @Override
+ public int computeVerticalScrollOffset(State state) {
+ Adapter adapter = mRv == null ? null : mRv.getAdapter();
+ if (adapter == null) {
+ return 0;
+ }
+ if (adapter.getItemCount() == 0 || getChildCount() == 0) {
+ return 0;
+ }
+ View child = getChildAt(0);
+ ViewHolder holder = mRv.findContainingViewHolder(child);
+ if (holder == null) {
+ return 0;
+ }
+ int itemPosition = holder.getLayoutPosition();
+ if (itemPosition < 0) {
+ return 0;
+ }
+ return getPaddingTop() + getItemsHeight(adapter, itemPosition) - getDecoratedTop(child);
+ }
+
+ @Override
+ public int computeVerticalScrollRange(State state) {
+ Adapter adapter = mRv == null ? null : mRv.getAdapter();
+ return adapter == null ? 0 : getItemsHeight(adapter, adapter.getItemCount());
+ }
+
+ /**
+ * Returns the sum of the height, in pixels, of this list adapter's items from index
+ * 0 (inclusive) until {@code untilIndex} (exclusive). If untilIndex is same as the itemCount,
+ * it returns the full height of all the items.
+ *
+ * <p>If the untilIndex is larger than the total number of items in this adapter, returns the
+ * sum of all items' height.
+ */
+ private int getItemsHeight(Adapter adapter, int untilIndex) {
+ final int totalItems = adapter.getItemCount();
+ if (mTotalHeightCache.length < (totalItems + 1)) {
+ mTotalHeightCache = new int[totalItems + 1];
+ mLastValidHeightIndex = 0;
+ }
+ if (untilIndex > totalItems) {
+ untilIndex = totalItems;
+ } else if (untilIndex < 0) {
+ untilIndex = 0;
+ }
+ if (untilIndex <= mLastValidHeightIndex) {
+ return mTotalHeightCache[untilIndex];
+ }
+
+ int totalItemsHeight = mTotalHeightCache[mLastValidHeightIndex];
+ for (int i = mLastValidHeightIndex; i < untilIndex; i++) {
+ totalItemsHeight = incrementTotalHeight(adapter, i, totalItemsHeight);
+ mTotalHeightCache[i + 1] = totalItemsHeight;
+ }
+ mLastValidHeightIndex = untilIndex;
+ return totalItemsHeight;
+ }
+
+ /**
+ * The current implementation assumes a linear list with every item taking up the whole row.
+ * Subclasses should override this method to account for any spanning logic
+ */
+ protected int incrementTotalHeight(Adapter adapter, int position, int heightUntilLastPos) {
+ return heightUntilLastPos + mCachedSizes.get(adapter.getItemViewType(position));
+ }
+
+ private void invalidateScrollCache() {
+ mLastValidHeightIndex = 0;
+ }
+
+ @Override
+ public void onItemsAdded(RecyclerView recyclerView, int positionStart, int itemCount) {
+ super.onItemsAdded(recyclerView, positionStart, itemCount);
+ invalidateScrollCache();
+ }
+
+ @Override
+ public void onItemsChanged(RecyclerView recyclerView) {
+ super.onItemsChanged(recyclerView);
+ invalidateScrollCache();
+ }
+
+ @Override
+ public void onItemsRemoved(RecyclerView recyclerView, int positionStart, int itemCount) {
+ super.onItemsRemoved(recyclerView, positionStart, itemCount);
+ invalidateScrollCache();
+ }
+
+ @Override
+ public void onItemsMoved(RecyclerView recyclerView, int from, int to, int itemCount) {
+ super.onItemsMoved(recyclerView, from, to, itemCount);
+ invalidateScrollCache();
+ }
+
+ @Override
+ public void onItemsUpdated(RecyclerView recyclerView, int positionStart, int itemCount,
+ Object payload) {
+ super.onItemsUpdated(recyclerView, positionStart, itemCount, payload);
+ invalidateScrollCache();
+ }
+}
diff --git a/src/com/android/launcher3/util/ShortcutUtil.java b/src/com/android/launcher3/util/ShortcutUtil.java
index 91cf835..79cafa0 100644
--- a/src/com/android/launcher3/util/ShortcutUtil.java
+++ b/src/com/android/launcher3/util/ShortcutUtil.java
@@ -34,7 +34,7 @@
* Returns true when we should show depp shortcuts in shortcut menu for the item.
*/
public static boolean supportsDeepShortcuts(ItemInfo info) {
- return isActive(info) && isApp(info) && !WidgetsModel.GO_DISABLE_WIDGETS;
+ return isActive(info) && isApp(info) && !WidgetsModel.GO_DISABLE_SHORTCUTS;
}
/**
diff --git a/src/com/android/launcher3/util/SplitConfigurationOptions.java b/src/com/android/launcher3/util/SplitConfigurationOptions.java
index f14d985..88e1b22 100644
--- a/src/com/android/launcher3/util/SplitConfigurationOptions.java
+++ b/src/com/android/launcher3/util/SplitConfigurationOptions.java
@@ -16,12 +16,17 @@
package com.android.launcher3.util;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_ICON_MENU_SPLIT_LEFT_TOP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_ICON_MENU_SPLIT_RIGHT_BOTTOM;
+
import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.graphics.Rect;
import androidx.annotation.IntDef;
+import com.android.launcher3.logging.StatsLogManager;
+
import java.lang.annotation.Retention;
public final class SplitConfigurationOptions {
@@ -170,4 +175,10 @@
@StageType
public int stageType = STAGE_TYPE_UNDEFINED;
}
+
+ public static StatsLogManager.EventEnum getLogEventForPosition(@StagePosition int position) {
+ return position == STAGE_POSITION_TOP_OR_LEFT
+ ? LAUNCHER_APP_ICON_MENU_SPLIT_LEFT_TOP
+ : LAUNCHER_APP_ICON_MENU_SPLIT_RIGHT_BOTTOM;
+ }
}
diff --git a/src/com/android/launcher3/util/Themes.java b/src/com/android/launcher3/util/Themes.java
index 53a584d..1728f4d 100644
--- a/src/com/android/launcher3/util/Themes.java
+++ b/src/com/android/launcher3/util/Themes.java
@@ -32,7 +32,6 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.GraphicsUtils;
/**
@@ -74,8 +73,7 @@
* Returns true if workspace icon theming is enabled
*/
public static boolean isThemedIconEnabled(Context context) {
- return FeatureFlags.ENABLE_THEMED_ICONS.get()
- && Utilities.getPrefs(context).getBoolean(KEY_THEMED_ICONS, false);
+ return Utilities.getPrefs(context).getBoolean(KEY_THEMED_ICONS, false);
}
public static String getDefaultBodyFont(Context context) {
diff --git a/src/com/android/launcher3/util/UiThreadHelper.java b/src/com/android/launcher3/util/UiThreadHelper.java
deleted file mode 100644
index 7e6711f..0000000
--- a/src/com/android/launcher3/util/UiThreadHelper.java
+++ /dev/null
@@ -1,142 +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.util;
-
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.util.Log;
-import android.view.View;
-import android.view.WindowInsets;
-import android.view.WindowInsetsController;
-import android.view.inputmethod.InputMethodManager;
-
-import com.android.launcher3.Utilities;
-import com.android.launcher3.views.ActivityContext;
-
-/**
- * Utility class for offloading some class from UI thread
- */
-public class UiThreadHelper {
-
- private static final MainThreadInitializedObject<Handler> HANDLER =
- new MainThreadInitializedObject<>(
- c -> new Handler(UI_HELPER_EXECUTOR.getLooper(), new UiCallbacks(c)));
-
- private static final int MSG_HIDE_KEYBOARD = 1;
- private static final int MSG_SET_ORIENTATION = 2;
- private static final int MSG_RUN_COMMAND = 3;
- private static final String STATS_LOGGER_KEY = "STATS_LOGGER_KEY";
-
- @SuppressLint("NewApi")
- public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) {
- View root = activityContext.getDragLayer();
-
- if (Utilities.ATLEAST_R) {
- Preconditions.assertUIThread();
- // Hide keyboard with WindowInsetsController if could. In case
- // hideSoftInputFromWindow may get ignored by input connection being finished
- // when the screen is off.
- //
- // In addition, inside IMF, the keyboards are closed asynchronously that launcher no
- // longer need to post to the message queue.
- final WindowInsetsController wic = root.getWindowInsetsController();
- WindowInsets insets = root.getRootWindowInsets();
- boolean isImeShown = insets != null && insets.isVisible(WindowInsets.Type.ime());
- if (wic != null && isImeShown) {
- // this method cannot be called cross threads
- wic.hide(WindowInsets.Type.ime());
- activityContext.getStatsLogManager().logger()
- .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
- return;
- }
- }
- // Since the launcher context cannot be accessed directly from callback, adding secondary
- // message to log keyboard close event asynchronously.
- Bundle mHideKeyboardLoggerMsg = new Bundle();
- mHideKeyboardLoggerMsg.putParcelable(
- STATS_LOGGER_KEY,
- Message.obtain(
- HANDLER.get(root.getContext()),
- () -> activityContext
- .getStatsLogManager()
- .logger()
- .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED)
- )
- );
-
- Message mHideKeyboardMsg = Message.obtain(HANDLER.get(root.getContext()), MSG_HIDE_KEYBOARD,
- token);
- mHideKeyboardMsg.setData(mHideKeyboardLoggerMsg);
- mHideKeyboardMsg.sendToTarget();
- }
-
- public static void setOrientationAsync(Activity activity, int orientation) {
- Message.obtain(HANDLER.get(activity), MSG_SET_ORIENTATION, orientation, 0, activity)
- .sendToTarget();
- }
-
- public static void setBackButtonAlphaAsync(Context context, AsyncCommand command, float alpha,
- boolean animate) {
- runAsyncCommand(context, command, Float.floatToIntBits(alpha), animate ? 1 : 0);
- }
-
- public static void runAsyncCommand(Context context, AsyncCommand command, int arg1, int arg2) {
- Message.obtain(HANDLER.get(context), MSG_RUN_COMMAND, arg1, arg2, command).sendToTarget();
- }
-
- private static class UiCallbacks implements Handler.Callback {
-
- private final Context mContext;
- private final InputMethodManager mIMM;
-
- UiCallbacks(Context context) {
- mContext = context;
- mIMM = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
- }
-
- @Override
- public boolean handleMessage(Message message) {
- switch (message.what) {
- case MSG_HIDE_KEYBOARD:
- if (mIMM.hideSoftInputFromWindow((IBinder) message.obj, 0)) {
- // log keyboard close event only when keyboard is actually closed
- ((Message) message.getData().getParcelable(STATS_LOGGER_KEY))
- .sendToTarget();
- }
- return true;
- case MSG_SET_ORIENTATION:
- ((Activity) message.obj).setRequestedOrientation(message.arg1);
- return true;
- case MSG_RUN_COMMAND:
- ((AsyncCommand) message.obj).execute(mContext, message.arg1, message.arg2);
- return true;
- }
- return false;
- }
- }
-
- public interface AsyncCommand {
- void execute(Context proxy, int arg1, int arg2);
- }
-}
diff --git a/src/com/android/launcher3/util/ViewCapture.java b/src/com/android/launcher3/util/ViewCapture.java
deleted file mode 100644
index 140971b..0000000
--- a/src/com/android/launcher3/util/ViewCapture.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.util;
-
-import android.content.res.Resources;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.SystemClock;
-import android.os.Trace;
-import android.util.Base64;
-import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewTreeObserver.OnDrawListener;
-
-import androidx.annotation.UiThread;
-
-import com.android.launcher3.view.ViewCaptureData.ExportedData;
-import com.android.launcher3.view.ViewCaptureData.FrameData;
-import com.android.launcher3.view.ViewCaptureData.ViewNode;
-
-import java.util.concurrent.FutureTask;
-
-/**
- * Utility class for capturing view data every frame
- */
-public class ViewCapture implements OnDrawListener {
-
- private static final String TAG = "ViewCapture";
-
- private static final int MEMORY_SIZE = 2000;
-
- private final View mRoot;
- private final long[] mFrameTimes = new long[MEMORY_SIZE];
- private final Node[] mNodes = new Node[MEMORY_SIZE];
-
- private int mFrameIndex = -1;
-
- /**
- * @param root the root view for the capture data
- */
- public ViewCapture(View root) {
- mRoot = root;
- }
-
- @Override
- public void onDraw() {
- Trace.beginSection("view_capture");
- long now = SystemClock.elapsedRealtimeNanos();
-
- mFrameIndex++;
- if (mFrameIndex >= MEMORY_SIZE) {
- mFrameIndex = 0;
- }
- mFrameTimes[mFrameIndex] = now;
- mNodes[mFrameIndex] = captureView(mRoot, mNodes[mFrameIndex]);
- Trace.endSection();
- }
-
- /**
- * Creates a proto of all the data captured so far.
- */
- public String dumpToString() {
- Handler handler = mRoot.getHandler();
- if (handler == null) {
- handler = Executors.MAIN_EXECUTOR.getHandler();
- }
- FutureTask<ExportedData> task = new FutureTask<>(this::dumpToProtoUI);
- if (Looper.myLooper() == handler.getLooper()) {
- task.run();
- } else {
- handler.post(task);
- }
- try {
- return Base64.encodeToString(task.get().toByteArray(),
- Base64.NO_CLOSE | Base64.NO_PADDING | Base64.NO_WRAP);
- } catch (Exception e) {
- Log.e(TAG, "Error capturing proto", e);
- return "--error--";
- }
- }
-
- @UiThread
- private ExportedData dumpToProtoUI() {
- ExportedData.Builder dataBuilder = ExportedData.newBuilder();
- Resources res = mRoot.getResources();
-
- int size = (mNodes[MEMORY_SIZE - 1] == null) ? mFrameIndex + 1 : MEMORY_SIZE;
- for (int i = size - 1; i >= 0; i--) {
- int index = (MEMORY_SIZE + mFrameIndex - i) % MEMORY_SIZE;
- dataBuilder.addFrameData(FrameData.newBuilder()
- .setNode(mNodes[index].toProto(res))
- .setTimestamp(mFrameTimes[index]));
- }
- return dataBuilder.build();
- }
-
- private Node captureView(View view, Node recycle) {
- Node result = recycle == null ? new Node() : recycle;
-
- result.clazz = view.getClass();
- result.hashCode = view.hashCode();
- result.id = view.getId();
- result.left = view.getLeft();
- result.top = view.getTop();
- result.right = view.getRight();
- result.bottom = view.getBottom();
- result.scrollX = view.getScrollX();
- result.scrollY = view.getScrollY();
-
- result.translateX = view.getTranslationX();
- result.translateY = view.getTranslationY();
- result.scaleX = view.getScaleX();
- result.scaleY = view.getScaleY();
- result.alpha = view.getAlpha();
-
- result.visibility = view.getVisibility();
- result.willNotDraw = view.willNotDraw();
-
- if (view instanceof ViewGroup) {
- ViewGroup parent = (ViewGroup) view;
- result.clipChildren = parent.getClipChildren();
- int childCount = parent.getChildCount();
- if (childCount == 0) {
- result.children = null;
- } else {
- result.children = captureView(parent.getChildAt(0), result.children);
- Node lastChild = result.children;
- for (int i = 1; i < childCount; i++) {
- lastChild.sibling = captureView(parent.getChildAt(i), lastChild.sibling);
- lastChild = lastChild.sibling;
- }
- lastChild.sibling = null;
- }
- } else {
- result.clipChildren = false;
- result.children = null;
- }
- return result;
- }
-
- private static class Node {
-
- // We store reference in memory to avoid generating and storing too many strings
- public Class clazz;
- public int hashCode;
-
- public int id;
- public int left, top, right, bottom;
- public int scrollX, scrollY;
-
- public float translateX, translateY;
- public float scaleX, scaleY;
- public float alpha;
-
- public int visibility;
- public boolean willNotDraw;
- public boolean clipChildren;
-
- public Node sibling;
- public Node children;
-
- public ViewNode toProto(Resources res) {
- String resolvedId;
- if (id >= 0) {
- try {
- resolvedId = res.getResourceTypeName(id) + '/' + res.getResourceEntryName(id);
- } catch (Resources.NotFoundException e) {
- resolvedId = "id/" + "0x" + Integer.toHexString(id).toUpperCase();
- }
- } else {
- resolvedId = "NO_ID";
- }
-
- ViewNode.Builder result = ViewNode.newBuilder()
- .setClassname(clazz.getName() + "@" + hashCode)
- .setId(resolvedId)
- .setLeft(left)
- .setTop(top)
- .setWidth(right - left)
- .setHeight(bottom - top)
- .setTranslationX(translateX)
- .setTranslationY(translateY)
- .setScaleX(scaleX)
- .setScaleY(scaleY)
- .setAlpha(alpha)
- .setVisibility(visibility)
- .setWillNotDraw(willNotDraw)
- .setClipChildren(clipChildren);
- Node child = children;
- while (child != null) {
- result.addChildren(child.toProto(res));
- child = child.sibling;
- }
- return result.build();
- }
-
- }
-}
diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java
index d5a065a..fb2ae73 100644
--- a/src/com/android/launcher3/util/window/WindowManagerProxy.java
+++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java
@@ -17,14 +17,15 @@
import static android.view.Display.DEFAULT_DISPLAY;
-import static com.android.launcher3.ResourceUtils.INVALID_RESOURCE_HANDLE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT_PORTRAIT;
import static com.android.launcher3.Utilities.dpiFromPx;
+import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAV_BAR_INTERACTION_MODE_RES_NAME;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_PORTRAIT;
import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
import static com.android.launcher3.util.RotationUtils.deltaRotation;
import static com.android.launcher3.util.RotationUtils.rotateRect;
@@ -40,6 +41,7 @@
import android.hardware.display.DisplayManager;
import android.os.Build;
import android.util.ArrayMap;
+import android.util.Log;
import android.view.Display;
import android.view.DisplayCutout;
import android.view.Surface;
@@ -48,9 +50,10 @@
import android.view.WindowMetrics;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
import com.android.launcher3.Utilities;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.util.WindowBounds;
@@ -59,6 +62,7 @@
*/
public class WindowManagerProxy implements ResourceBasedOverride {
+ private static final String TAG = "WindowManagerProxy";
public static final int MIN_TABLET_WIDTH = 600;
public static final MainThreadInitializedObject<WindowManagerProxy> INSTANCE =
@@ -343,4 +347,24 @@
return displayInfoContext.getSystemService(DisplayManager.class).getDisplay(
DEFAULT_DISPLAY);
}
+
+ /**
+ * Returns the current navigation mode from resource.
+ */
+ public NavigationMode getNavigationMode(Context context) {
+ int modeInt = ResourceUtils.getIntegerByName(NAV_BAR_INTERACTION_MODE_RES_NAME,
+ context.getResources(), INVALID_RESOURCE_HANDLE);
+
+ if (modeInt == INVALID_RESOURCE_HANDLE) {
+ Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?");
+ } else {
+ for (NavigationMode m : NavigationMode.values()) {
+ if (m.resValue == modeInt) {
+ return m;
+ }
+ }
+ }
+ return Utilities.ATLEAST_S ? NavigationMode.NO_BUTTON :
+ NavigationMode.THREE_BUTTONS;
+ }
}
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index 93078e4..dd5b22e 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -15,16 +15,26 @@
*/
package com.android.launcher3.views;
+import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED;
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+
import android.content.Context;
import android.content.ContextWrapper;
import android.graphics.Rect;
+import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.AccessibilityDelegate;
+import android.view.WindowInsets;
+import android.view.WindowInsetsController;
+import android.view.inputmethod.InputMethodManager;
import androidx.annotation.Nullable;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.dot.DotInfo;
@@ -36,6 +46,7 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.util.OnboardingPrefs;
+import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.ViewCache;
/**
@@ -141,6 +152,7 @@
default void applyOverwritesToLogItem(LauncherAtom.ItemInfo.Builder itemInfoBuilder) { }
/** Onboarding preferences for any onboarding data within this context. */
+ @Nullable
default OnboardingPrefs<?> getOnboardingPrefs() {
return null;
}
@@ -201,4 +213,47 @@
ActivityAllAppsContainerView<?> appsView) {
return null;
}
+
+ /**
+ * Hides the keyboard if it is visible
+ */
+ default void hideKeyboard() {
+ View root = getDragLayer();
+ if (root == null) {
+ return;
+ }
+ if (Utilities.ATLEAST_R) {
+ Preconditions.assertUIThread();
+ // Hide keyboard with WindowInsetsController if could. In case
+ // hideSoftInputFromWindow may get ignored by input connection being finished
+ // when the screen is off.
+ //
+ // In addition, inside IMF, the keyboards are closed asynchronously that launcher no
+ // longer need to post to the message queue.
+ final WindowInsetsController wic = root.getWindowInsetsController();
+ WindowInsets insets = root.getRootWindowInsets();
+ boolean isImeShown = insets != null && insets.isVisible(WindowInsets.Type.ime());
+ if (wic != null && isImeShown) {
+ StatsLogManager slm = getStatsLogManager();
+ slm.keyboardStateManager().setKeyboardState(HIDE);
+
+ // this method cannot be called cross threads
+ wic.hide(WindowInsets.Type.ime());
+ slm.logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
+ return;
+ }
+ }
+
+ InputMethodManager imm = root.getContext().getSystemService(InputMethodManager.class);
+ IBinder token = root.getWindowToken();
+ if (imm != null && token != null) {
+ UI_HELPER_EXECUTOR.execute(() -> {
+ if (imm.hideSoftInputFromWindow(token, 0)) {
+ // log keyboard close event only when keyboard is actually closed
+ MAIN_EXECUTOR.execute(() ->
+ getStatsLogManager().logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED));
+ }
+ });
+ }
+ }
}
diff --git a/src/com/android/launcher3/views/AppLauncher.java b/src/com/android/launcher3/views/AppLauncher.java
index 19e66ab..dc07e45 100644
--- a/src/com/android/launcher3/views/AppLauncher.java
+++ b/src/com/android/launcher3/views/AppLauncher.java
@@ -16,7 +16,7 @@
package com.android.launcher3.views;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
-import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
+import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS;
import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
@@ -190,7 +190,7 @@
*/
default void startShortcut(String packageName, String id, Rect sourceBounds,
Bundle startActivityOptions, UserHandle user) {
- if (GO_DISABLE_WIDGETS) {
+ if (GO_DISABLE_SHORTCUTS) {
return;
}
try {
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index 2a9a8a5..d301925 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -50,7 +50,7 @@
import com.android.launcher3.popup.ArrowPopup;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
import java.util.ArrayList;
diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
index 11ca130..3af2e3c 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -20,8 +20,6 @@
import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
-import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
-
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
@@ -121,7 +119,6 @@
// prevent jumping, this offset is applied as the user scrolls.
protected int mTouchOffsetY;
protected int mThumbOffsetY;
- protected int mRvOffsetY;
// Fast scroller popup
private TextView mPopupView;
@@ -174,6 +171,11 @@
ta.recycle();
}
+ /** @return whether there is a RecyclerView bound to this scroller. */
+ public boolean hasRecyclerView() {
+ return mRv != null;
+ }
+
public void setRecyclerView(FastScrollRecyclerView rv, TextView popupView) {
if (mRv != null && mOnScrollListener != null) {
mRv.removeOnScrollListener(mOnScrollListener);
@@ -204,16 +206,11 @@
public void setThumbOffsetY(int y) {
if (mThumbOffsetY == y) {
- int rvCurrentOffsetY = mRv.getCurrentScrollY();
- if (mRvOffsetY != rvCurrentOffsetY) {
- mRvOffsetY = mRv.getCurrentScrollY();
- }
return;
}
updatePopupY(y);
mThumbOffsetY = y;
invalidate();
- mRvOffsetY = mRv.getCurrentScrollY();
}
public int getThumbOffsetY() {
@@ -308,7 +305,7 @@
}
private void calcTouchOffsetAndPrepToFastScroll(int downY, int lastY) {
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getWindowToken());
+ ActivityContext.lookupContext(getContext()).hideKeyboard();
mIsDragging = true;
if (mCanThumbDetach) {
mIsThumbDetached = true;
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 8962c4f..2ac1e94 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.widget;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
+
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -26,6 +28,7 @@
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.WindowInsets;
+import android.view.animation.Interpolator;
import android.widget.Toast;
import androidx.annotation.GuardedBy;
@@ -42,7 +45,7 @@
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.Themes;
@@ -246,6 +249,12 @@
return true;
}
+ @Override
+ protected Interpolator getIdleInterpolator() {
+ return mActivityContext.getDeviceProfile().isTablet
+ ? EMPHASIZED : super.getIdleInterpolator();
+ }
+
//
// Drag related handling methods that implement {@link DragSource} interface.
//
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
index 98a960c..3e80699 100644
--- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
@@ -42,7 +42,7 @@
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.custom.CustomWidgetManager;
import java.util.ArrayList;
@@ -323,6 +323,7 @@
if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) {
// First, we clear any previously cached content from existing widgets
mCachedRemoteViews.clear();
+ mDeferredViews.clear();
// Then we proceed to cache the content from the widgets
for (int i = 0; i < mViews.size(); i++) {
final int appWidgetId = mViews.keyAt(i);
diff --git a/src/com/android/launcher3/widget/PendingAddWidgetInfo.java b/src/com/android/launcher3/widget/PendingAddWidgetInfo.java
index 470a800..ccf4b2e 100644
--- a/src/com/android/launcher3/widget/PendingAddWidgetInfo.java
+++ b/src/com/android/launcher3/widget/PendingAddWidgetInfo.java
@@ -19,6 +19,9 @@
import android.content.Context;
import android.os.Bundle;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.PendingAddItemInfo;
import com.android.launcher3.logger.LauncherAtom;
@@ -66,8 +69,9 @@
return WidgetSizes.getWidgetSizeOptions(context, componentName, spanX, spanY);
}
+ @NonNull
@Override
- public LauncherAtom.ItemInfo buildProto(FolderInfo folderInfo) {
+ public LauncherAtom.ItemInfo buildProto(@Nullable FolderInfo folderInfo) {
LauncherAtom.ItemInfo info = super.buildProto(folderInfo);
return info.toBuilder()
.addItemAttributes(LauncherAppWidgetInfo.getAttribute(sourceContainer))
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index 46c0b99..c8d528b 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -42,7 +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.testing.shared.TestProtocol;
import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
import com.android.launcher3.widget.util.WidgetSizes;
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 88d9723..da8e25c 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -19,7 +19,7 @@
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_SEARCHED;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -85,7 +85,6 @@
implements ProviderChangedListener, OnActivePageChangedListener,
WidgetsRecyclerView.HeaderViewDimensionsProvider, SearchModeListener {
- private static final long DEFAULT_OPEN_DURATION = 267;
private static final long FADE_IN_DURATION = 150;
private static final long EDUCATION_TIP_DELAY_MS = 200;
private static final long EDUCATION_DIALOG_DELAY_MS = 500;
@@ -582,7 +581,7 @@
mOpenCloseAnimator.setValues(
PropertyValuesHolder.ofFloat(TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED));
mOpenCloseAnimator
- .setDuration(DEFAULT_OPEN_DURATION)
+ .setDuration(mActivityContext.getDeviceProfile().bottomSheetOpenDuration)
.setInterpolator(AnimationUtils.loadInterpolator(
getContext(), android.R.interpolator.linear_out_slow_in));
mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
@@ -603,7 +602,7 @@
@Override
protected void handleClose(boolean animate) {
- handleClose(animate, DEFAULT_OPEN_DURATION);
+ handleClose(animate, mActivityContext.getDeviceProfile().bottomSheetCloseDuration);
}
@Override
diff --git a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
index 35fa7a4..5969e3e 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.graphics.Point;
import android.util.AttributeSet;
-import android.util.SparseIntArray;
import android.view.MotionEvent;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -28,6 +27,7 @@
import com.android.launcher3.FastScrollRecyclerView;
import com.android.launcher3.R;
+import com.android.launcher3.util.ScrollableLayoutManager;
/**
* The widgets recycler view.
@@ -42,14 +42,6 @@
private boolean mTouchDownOnScroller;
private HeaderViewDimensionsProvider mHeaderViewDimensionsProvider;
- /**
- * There is always 1 or 0 item of VIEW_TYPE_WIDGETS_LIST. Other types have fixes sizes, so the
- * the size can be used for all other items of same type. Caching the last know size for
- * VIEW_TYPE_WIDGETS_LIST allows us to use it to estimate full size even when
- * VIEW_TYPE_WIDGETS_LIST is not visible on the screen.
- */
- private final SparseIntArray mCachedSizes = new SparseIntArray();
-
public WidgetsRecyclerView(Context context) {
this(context, null);
}
@@ -68,9 +60,7 @@
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- // create a layout manager with Launcher's context so that scroll position
- // can be preserved during screen rotation.
- setLayoutManager(new LinearLayoutManager(getContext()));
+ setLayoutManager(new ScrollableLayoutManager(getContext()));
}
@Override
@@ -114,7 +104,7 @@
}
// Skip early if, there no child laid out in the container.
- int scrollY = getCurrentScrollY();
+ int scrollY = computeVerticalScrollOffset();
if (scrollY < 0) {
mScrollbar.setThumbOffsetY(-1);
return;
@@ -164,39 +154,6 @@
}
/**
- * Returns the sum of the height, in pixels, of this list adapter's items from index 0 until
- * {@code untilIndex}.
- *
- * <p>If the untilIndex is larger than the total number of items in this adapter, returns the
- * sum of all items' height.
- */
- @Override
- protected int getItemsHeight(int untilIndex) {
- // Initialize cache
- int childCount = getChildCount();
- int startPosition;
- if (childCount > 0
- && ((startPosition = getChildAdapterPosition(getChildAt(0))) != NO_POSITION)) {
- int loopCount = Math.min(getChildCount(), getAdapter().getItemCount() - startPosition);
- for (int i = 0; i < loopCount; i++) {
- mCachedSizes.put(
- mAdapter.getItemViewType(startPosition + i),
- getChildAt(i).getMeasuredHeight());
- }
- }
-
- if (untilIndex > mAdapter.getItems().size()) {
- untilIndex = mAdapter.getItems().size();
- }
- int totalItemsHeight = 0;
- for (int i = 0; i < untilIndex; i++) {
- int type = mAdapter.getItemViewType(i);
- totalItemsHeight += mCachedSizes.get(type);
- }
- return totalItemsHeight;
- }
-
- /**
* Provides dimensions of the header view that is shown at the top of a
* {@link WidgetsRecyclerView}.
*/
diff --git a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
index 702f343..13ad7a4 100644
--- a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
+++ b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
@@ -62,6 +62,8 @@
// True is the widget support is disabled.
public static final boolean GO_DISABLE_WIDGETS = false;
+ // True is the shortcut support is disabled.
+ public static final boolean GO_DISABLE_SHORTCUTS = false;
public static final boolean GO_DISABLE_NOTIFICATION_DOTS = false;
private static final String TAG = "WidgetsModel";
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java
index bf35dd8..a581f91 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java
@@ -32,7 +32,6 @@
public class AllAppsState extends LauncherState {
private static final float PARALLAX_COEFFICIENT = .125f;
- private static final float WORKSPACE_SCALE_FACTOR = 0.97f;
private static final int STATE_FLAGS = FLAG_WORKSPACE_INACCESSIBLE;
@@ -43,9 +42,9 @@
@Override
public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
- return !context.getDeviceProfile().isTablet && isToState
- ? 600
- : isToState ? 500 : 300;
+ return isToState
+ ? context.getDeviceProfile().allAppsOpenDuration
+ : context.getDeviceProfile().allAppsCloseDuration;
}
@Override
@@ -60,7 +59,8 @@
@Override
public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
- return new ScaleAndTranslation(WORKSPACE_SCALE_FACTOR, NO_OFFSET, NO_OFFSET);
+ return new ScaleAndTranslation(launcher.getDeviceProfile().workspaceContentScale, NO_OFFSET,
+ NO_OFFSET);
}
@Override
@@ -71,7 +71,7 @@
ScaleAndTranslation overviewScaleAndTranslation = LauncherState.OVERVIEW
.getWorkspaceScaleAndTranslation(launcher);
return new ScaleAndTranslation(
- WORKSPACE_SCALE_FACTOR,
+ launcher.getDeviceProfile().workspaceContentScale,
overviewScaleAndTranslation.translationX,
overviewScaleAndTranslation.translationY);
}
diff --git a/tests/Android.bp b/tests/Android.bp
index 54cded0..1584308 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -24,6 +24,18 @@
"src/**/*.java",
"src/**/*.kt"
],
+ exclude_srcs: [
+ ":launcher-non-quickstep-tests-src"
+ ],
+}
+
+// Source code used for non-quickstep tests
+filegroup {
+ name: "launcher-non-quickstep-tests-src",
+ srcs: [
+ "src/com/android/launcher3/nonquickstep/**/*.java",
+ "src/com/android/launcher3/nonquickstep/**/*.kt",
+ ],
}
// Source code used for oop test helpers
@@ -84,6 +96,7 @@
name: "Launcher3Tests",
srcs: [
":launcher-tests-src",
+ ":launcher-non-quickstep-tests-src",
],
static_libs: ["Launcher3TestLib"],
libs: [
diff --git a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
index 7465db5..2c1cbdf 100644
--- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
+++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
@@ -17,11 +17,15 @@
import android.content.Context
import android.graphics.PointF
+import android.graphics.Rect
+import android.util.SparseArray
import androidx.test.core.app.ApplicationProvider
+import com.android.launcher3.DeviceProfile.DEFAULT_PROVIDER;
import com.android.launcher3.util.DisplayController.Info
import com.android.launcher3.util.WindowBounds
import org.junit.Before
import org.mockito.ArgumentMatchers.any
+import org.mockito.ArgumentMatchers.anyInt
import org.mockito.Mockito.mock
import java.io.PrintWriter
import java.io.StringWriter
@@ -37,6 +41,9 @@
protected var transposeLayoutWithOrientation: Boolean = false
protected var useTwoPanels: Boolean = false
protected var isGestureMode: Boolean = true
+ protected var devicePaddingsMock: DevicePaddings = mock(DevicePaddings::class.java)
+ protected var staticdevicePaddingsMock: DevicePaddings.DevicePadding =
+ mock(DevicePaddings.DevicePadding::class.java)
@Before
fun setUp() {
@@ -51,121 +58,305 @@
inv,
info,
windowBounds,
+ SparseArray(),
isMultiWindowMode,
transposeLayoutWithOrientation,
useTwoPanels,
- isGestureMode
+ isGestureMode,
+ DEFAULT_PROVIDER
)
protected fun initializeVarsForPhone(isGestureMode: Boolean = true,
isVerticalBar: Boolean = false) {
val (x, y) = if (isVerticalBar)
- Pair(3120, 1440)
+ Pair(2400, 1080)
else
- Pair(1440, 3120)
+ Pair(1080, 2400)
- windowBounds = WindowBounds(x, y, x, y - 100, 0)
+ windowBounds = WindowBounds(Rect(0, 0, x, y), Rect(
+ if (isVerticalBar) 118 else 0,
+ if (isVerticalBar) 74 else 118,
+ if (!isGestureMode && isVerticalBar) 126 else 0,
+ if (isGestureMode) 63 else if (isVerticalBar) 0 else 126))
whenever(info.isTablet(any())).thenReturn(false)
- whenever(info.getDensityDpi()).thenReturn(560)
+ whenever(info.getDensityDpi()).thenReturn(420)
whenever(info.smallestSizeDp(any())).thenReturn(411f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt())).thenReturn(95)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt())).thenReturn(116)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx)
+ .thenReturn(if (isVerticalBar) if (isGestureMode) 131 else 184 else 315)
this.isGestureMode = isGestureMode
+ transposeLayoutWithOrientation = true
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = InvariantDeviceProfile().apply {
+ numRows = 5
+ numColumns = 4
+ numSearchContainerColumns = 4
+
+ iconSize = floatArrayOf(60f, 54f, 60f, 60f)
+ iconTextSize = FloatArray(4) { 14f }
deviceType = InvariantDeviceProfile.TYPE_PHONE
- transposeLayoutWithOrientation = isVerticalBar
+
+ minCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f)
+ ).toTypedArray()
+
+ numFolderRows = 3
+ numFolderColumns = 3
+ folderBorderSpaces = PointF(16f, 16f)
+ folderTopPadding = 24f
+ folderCellSize = PointF(80f, 94f)
+
+
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_5
+
+ horizontalMargin = FloatArray(4) { 22f }
+
+ allAppsCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+ allAppsIconSize = floatArrayOf(60f, 60f, 60f, 60f)
+ allAppsIconTextSize = FloatArray(4) { 14f }
+ allAppsBorderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 4
+
+ numDatabaseHotseatIcons = 4
+
+ hotseatColumnSpan = IntArray(4) { 4 }
+ hotseatBarBottomSpace = FloatArray(4) { 48f }
+ hotseatQsbSpace = FloatArray(4) { 36f }
+
+ numAllAppsColumns = 4
+
+ isScalable = true
+
+ inlineQsb = BooleanArray(4) { false }
+
+ devicePaddings = devicePaddingsMock
}
}
protected fun initializeVarsForTablet(isLandscape: Boolean = false,
- isTwoPanel: Boolean = false,
isGestureMode: Boolean = true) {
val (x, y) = if (isLandscape)
Pair(2560, 1600)
else
Pair(1600, 2560)
- windowBounds = WindowBounds(x, y, x, y - 100, 0)
+ windowBounds =
+ WindowBounds(Rect(0, 0, x, y), Rect(0, 104, 0, 0))
whenever(info.isTablet(any())).thenReturn(true)
whenever(info.getDensityDpi()).thenReturn(320)
whenever(info.smallestSizeDp(any())).thenReturn(800f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt()))
+ .thenReturn(if (isLandscape) 32 else 159)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt()))
+ .thenReturn(if (isLandscape) 72 else 203)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx).thenReturn(if (isLandscape) 200 else 19998)
+
this.isGestureMode = isGestureMode
- useTwoPanels = isTwoPanel
+ useTwoPanels = false
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = if (isTwoPanel)
- InvariantDeviceProfile.TYPE_MULTI_DISPLAY else InvariantDeviceProfile.TYPE_TABLET
+ inv = InvariantDeviceProfile().apply {
+ numRows = 5
+ numColumns = 6
+ numSearchContainerColumns = 3
+
+ iconSize = FloatArray(4) { 60f }
+ iconTextSize = FloatArray(4) { 14f }
+ deviceType = InvariantDeviceProfile.TYPE_TABLET
+
+ minCellSize = listOf(
+ PointF(102f, 120f),
+ PointF(120f, 104f),
+ PointF(102f, 120f),
+ PointF(102f, 120f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 64f),
+ PointF(64f, 16f),
+ PointF(16f, 64f),
+ PointF(16f, 64f)
+ ).toTypedArray()
+
+ numFolderRows = 3
+ numFolderColumns = 3
+ folderBorderSpaces = PointF(16f, 16f)
+ folderTopPadding = 24f
+ folderCellSize = PointF(120f, 104f)
+
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_6_5
+
+ horizontalMargin = floatArrayOf(54f, 120f, 54f, 54f)
+
+ allAppsCellSize = listOf(
+ PointF(96f, 142f),
+ PointF(126f, 126f),
+ PointF(96f, 142f),
+ PointF(96f, 142f)
+ ).toTypedArray()
+ allAppsIconSize = FloatArray(4) { 60f }
+ allAppsIconTextSize = FloatArray(4) { 14f }
+ allAppsBorderSpaces = listOf(
+ PointF(8f, 16f),
+ PointF(16f, 16f),
+ PointF(8f, 16f),
+ PointF(8f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 6
+
+ numDatabaseHotseatIcons = 6
+
+ hotseatColumnSpan = intArrayOf(6, 4, 6, 6)
+ hotseatBarBottomSpace = floatArrayOf(36f, 40f, 36f, 36f)
+ hotseatQsbSpace = FloatArray(4) { 32f }
+
+ numAllAppsColumns = 6
+
+ isScalable = true
+ devicePaddingId = 2132148242 // "@xml/paddings_6x5"
+
inlineQsb = booleanArrayOf(
false,
- isLandscape,
+ true,
false,
false
)
+
+ devicePaddings = devicePaddingsMock
}
}
- /**
- * A very generic grid, just to make qsb tests work. For real calculations, make sure to use
- * values that better represent a real grid.
- */
- protected fun newScalableInvariantDeviceProfile(): InvariantDeviceProfile =
- InvariantDeviceProfile().apply {
- isScalable = true
- numColumns = 4
- numRows = 4
- numShownHotseatIcons = 4
- numDatabaseHotseatIcons = 6
- numShrunkenHotseatIcons = 5
- horizontalMargin = FloatArray(4) { 22f }
- borderSpaces = listOf(
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f)
- ).toTypedArray()
- allAppsBorderSpaces = listOf(
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f)
- ).toTypedArray()
- hotseatBorderSpaces = FloatArray(4) { 16f }
- hotseatColumnSpan = IntArray(4) { 4 }
- hotseatBarBottomSpace = FloatArray(4) { 48f }
- inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_4
- hotseatQsbSpace = FloatArray(4) { 36f }
- iconSize = FloatArray(4) { 56f }
- allAppsIconSize = FloatArray(4) { 56f }
- iconTextSize = FloatArray(4) { 14f }
- allAppsIconTextSize = FloatArray(4) { 14f }
- minCellSize = listOf(
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f)
- ).toTypedArray()
- allAppsCellSize = listOf(
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f)
- ).toTypedArray()
- inlineQsb = booleanArrayOf(
- false,
- false,
- false,
- false
- )
- }
+ protected fun initializeVarsForTwoPanel(isLandscape: Boolean = false,
+ isGestureMode: Boolean = true) {
+ val (x, y) = if (isLandscape)
+ Pair(2208, 1840)
+ else
+ Pair(1840, 2208)
- fun dump(dp: DeviceProfile): StringWriter {
+ windowBounds = WindowBounds(Rect(0, 0, x, y),
+ Rect(0, 110, 0, 0))
+
+ whenever(info.isTablet(any())).thenReturn(true)
+ whenever(info.getDensityDpi()).thenReturn(420)
+ whenever(info.smallestSizeDp(any())).thenReturn(700f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+
+ val topPadding = if (isLandscape) 18 else 89
+ val bottomPadding = if (isLandscape) 39 else 146
+ val maxEmptySpace = if (isLandscape) 131 else 236
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt())).thenReturn(topPadding)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt()))
+ .thenReturn(bottomPadding)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx).thenReturn(maxEmptySpace)
+
+ this.isGestureMode = isGestureMode
+ useTwoPanels = true
+
+ inv = InvariantDeviceProfile().apply {
+ numRows = 4
+ numColumns = 4
+ numSearchContainerColumns = 4
+
+ iconSize = floatArrayOf(60f, 52f, 52f, 60f)
+ iconTextSize = floatArrayOf(14f, 14f, 12f, 14f)
+ deviceType = InvariantDeviceProfile.TYPE_MULTI_DISPLAY
+
+ minCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(68f, 116f),
+ PointF(80f, 102f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 20f),
+ PointF(20f, 20f)
+ ).toTypedArray()
+
+ numFolderRows = 3
+ numFolderColumns = 3
+ folderBorderSpaces = PointF(16f, 16f)
+ folderTopPadding = 24f
+ folderCellSize = PointF(80f, 94f)
+
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_4
+
+ horizontalMargin = floatArrayOf(21.5f, 21.5f, 22.5f, 30.5f)
+
+ allAppsCellSize = listOf(
+ PointF(0f, 0f),
+ PointF(0f, 0f),
+ PointF(68f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+ allAppsIconSize = floatArrayOf(60f, 60f, 52f, 60f)
+ allAppsIconTextSize = floatArrayOf(14f, 14f, 12f, 14f)
+ allAppsBorderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 28f),
+ PointF(20f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 6
+
+ numDatabaseHotseatIcons = 6
+
+ hotseatColumnSpan = IntArray(4) { 6 }
+ hotseatBarBottomSpace = floatArrayOf(48f, 48f, 36f, 20f)
+ hotseatQsbSpace = floatArrayOf(36f, 36f, 36f, 28f)
+
+ numAllAppsColumns = 6
+ numDatabaseAllAppsColumns = 6
+
+ isScalable = true
+
+ inlineQsb = booleanArrayOf(
+ false,
+ false,
+ false,
+ false
+ )
+
+ devicePaddings = devicePaddingsMock
+ }
+ }
+
+ fun dump(dp: DeviceProfile): String {
val stringWriter = StringWriter()
val printWriter = PrintWriter(stringWriter)
- dp.dump("", printWriter)
+ dp.dump(context, "", printWriter)
printWriter.flush()
- return stringWriter
+ return stringWriter.toString()
}
}
\ No newline at end of file
diff --git a/tests/src/com/android/launcher3/HotseatShownIconsTest.kt b/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
deleted file mode 100644
index 5dabb33..0000000
--- a/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.InvariantDeviceProfile.TYPE_MULTI_DISPLAY
-import com.android.launcher3.InvariantDeviceProfile.TYPE_PHONE
-import com.android.launcher3.InvariantDeviceProfile.TYPE_TABLET
-import com.google.common.truth.Truth.assertThat
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Test for [DeviceProfile]
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class HotseatShownIconsTest : DeviceProfileBaseTest() {
-
- @Test
- fun hotseat_size_is_shrunk_if_needed_when_large_screen() {
- initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_MULTI_DISPLAY
- inlineQsb = booleanArrayOf(
- false,
- false,
- false,
- true // two panels landscape
- )
- }
- useTwoPanels = true
-
- isGestureMode = false
- val dp = newDP()
-
- if (dp.hotseatQsbHeight > 0) {
- assertThat(dp.isQsbInline).isTrue()
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- } else { // Launcher3 doesn't have QSB height
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
- }
-
- /**
- * For consistency, the hotseat should shrink if any orientation on the device type has an
- * inline qsb
- */
- @Test
- fun hotseat_size_is_shrunk_even_in_portrait_when_large_screen() {
- initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_MULTI_DISPLAY
- inlineQsb = booleanArrayOf(
- false,
- false,
- false,
- true // two panels landscape
- )
- }
- useTwoPanels = true
-
- isGestureMode = false
- val dp = newDP()
-
- if (dp.hotseatQsbHeight > 0) {
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- } else { // Launcher3 doesn't have QSB height
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
- }
-
- @Test
- fun hotseat_size_is_default_when_small_screen() {
- initializeVarsForPhone()
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_MULTI_DISPLAY
- }
- useTwoPanels = true
-
- val dp = newDP()
-
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseat_size_is_not_shrunk_on_gesture_tablet() {
- initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_TABLET
- inlineQsb = booleanArrayOf(
- false,
- true, // landscape
- false,
- false
- )
- numShownHotseatIcons = 6
- }
-
- isGestureMode = true
- val dp = newDP()
-
- if (dp.hotseatQsbHeight > 0) {
- assertThat(dp.isQsbInline).isTrue()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- } else { // Launcher3 doesn't have QSB height
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
- }
-
- @Test
- fun hotseat_size_is_shrunk_if_needed_on_tablet() {
- initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_TABLET
- inlineQsb = booleanArrayOf(
- false,
- true, // landscape
- false,
- false
- )
- numShownHotseatIcons = 6
- }
-
- isGestureMode = false
- val dp = newDP()
-
- if (dp.hotseatQsbHeight > 0) {
- assertThat(dp.isQsbInline).isTrue()
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- } else { // Launcher3 doesn't have QSB height
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
- }
-
- /**
- * For consistency, the hotseat should shrink if any orientation on the device type has an
- * inline qsb
- */
- @Test
- fun hotseat_size_is_shrunk_even_in_portrait_on_tablet() {
- initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = TYPE_TABLET
- inlineQsb = booleanArrayOf(
- false,
- true, // landscape
- false,
- false
- )
- numShownHotseatIcons = 6
- }
-
- isGestureMode = false
- val dp = newDP()
-
- if (dp.hotseatQsbHeight > 0) {
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- } else { // Launcher3 doesn't have QSB height
- assertThat(dp.isQsbInline).isFalse()
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
- }
-
-}
\ No newline at end of file
diff --git a/tests/src/com/android/launcher3/celllayout/CellLayoutBoard.java b/tests/src/com/android/launcher3/celllayout/CellLayoutBoard.java
index 3ca05bc..a32ce3c 100644
--- a/tests/src/com/android/launcher3/celllayout/CellLayoutBoard.java
+++ b/tests/src/com/android/launcher3/celllayout/CellLayoutBoard.java
@@ -30,39 +30,117 @@
public class CellLayoutBoard {
+ public static class CellType {
+ // The cells marked by this will be filled by 1x1 widgets and will be ignored when
+ // validating
+ public static final char IGNORE = 'x';
+ // The cells marked by this will be filled by app icons
+ public static final char ICON = 'i';
+ // Empty space
+ public static final char EMPTY = '-';
+ // Widget that will be saved as "main widget" for easier retrieval
+ public static final char MAIN_WIDGET = 'm';
+ // Everything else will be consider a widget
+ }
+
+ public static class WidgetRect {
+ public char mType;
+ public Rect mBounds;
+
+ WidgetRect(char type, Rect bounds) {
+ this.mType = type;
+ this.mBounds = bounds;
+ }
+
+ int getSpanX() {
+ return mBounds.right - mBounds.left + 1;
+ }
+
+ int getSpanY() {
+ return mBounds.top - mBounds.bottom + 1;
+ }
+
+ int getCellX() {
+ return mBounds.left;
+ }
+
+ int getCellY() {
+ return mBounds.bottom;
+ }
+
+ boolean shouldIgnore() {
+ return this.mType == CellType.IGNORE;
+ }
+
+ @Override
+ public String toString() {
+ return "WidgetRect type = " + mType + " bounds = " + mBounds.toString();
+ }
+ }
+
+ public static class IconPoint {
+ public Point coord;
+ public char mType;
+
+ public IconPoint(Point coord, char type) {
+ this.coord = coord;
+ mType = type;
+ }
+
+ public char getType() {
+ return mType;
+ }
+
+ public void setType(char type) {
+ mType = type;
+ }
+
+ public Point getCoord() {
+ return coord;
+ }
+
+ public void setCoord(Point coord) {
+ this.coord = coord;
+ }
+ }
+
static final int INFINITE = 99999;
- char[][] mBoard = new char[30][30];
+ char[][] mWidget = new char[30][30];
- List<TestBoardWidget> mWidgetsRects = new ArrayList<>();
- Map<Character, TestBoardWidget> mWidgetsMap = new HashMap<>();
+ List<WidgetRect> mWidgetsRects = new ArrayList<>();
+ Map<Character, WidgetRect> mWidgetsMap = new HashMap<>();
- List<TestBoardAppIcon> mIconPoints = new ArrayList<>();
- Map<Character, TestBoardAppIcon> mIconsMap = new HashMap<>();
+ List<IconPoint> mIconPoints = new ArrayList<>();
+ Map<Character, IconPoint> mIconsMap = new HashMap<>();
Point mMain = new Point();
CellLayoutBoard() {
- for (int x = 0; x < mBoard.length; x++) {
- for (int y = 0; y < mBoard[0].length; y++) {
- mBoard[x][y] = '-';
+ for (int x = 0; x < mWidget.length; x++) {
+ for (int y = 0; y < mWidget[0].length; y++) {
+ mWidget[x][y] = CellType.EMPTY;
}
}
}
- public List<TestBoardWidget> getWidgets() {
+ public List<WidgetRect> getWidgets() {
return mWidgetsRects;
}
+ public List<IconPoint> getIcons() {
+ return mIconPoints;
+ }
+
public Point getMain() {
return mMain;
}
- public TestBoardWidget getWidgetRect(char c) {
+ public WidgetRect getWidgetRect(char c) {
return mWidgetsMap.get(c);
}
- public static TestBoardWidget getWidgetRect(int x, int y, Set<Point> used, char[][] board) {
+ public static WidgetRect getWidgetRect(int x, int y, Set<Point> used, char[][] board) {
char type = board[x][y];
Queue<Point> search = new ArrayDeque<Point>();
Point current = new Point(x, y);
@@ -91,20 +169,20 @@
}
}
}
- return new TestBoardWidget(type, widgetRect);
+ return new WidgetRect(type, widgetRect);
}
public static boolean isWidget(char type) {
- return type != 'i' && type != '-';
+ return type != CellType.ICON && type != CellType.EMPTY;
}
public static boolean isIcon(char type) {
- return type == 'i';
+ return type == CellType.ICON;
}
- private static List<TestBoardWidget> getRects(char[][] board) {
+ private static List<WidgetRect> getRects(char[][] board) {
Set<Point> used = new HashSet<>();
- List<TestBoardWidget> widgetsRects = new ArrayList<>();
+ List<WidgetRect> widgetsRects = new ArrayList<>();
for (int x = 0; x < board.length; x++) {
for (int y = 0; y < board[0].length; y++) {
if (!used.contains(new Point(x, y)) && isWidget(board[x][y])) {
@@ -115,12 +193,12 @@
return widgetsRects;
}
- private static List<TestBoardAppIcon> getIconPoints(char[][] board) {
- List<TestBoardAppIcon> iconPoints = new ArrayList<>();
+ private static List<IconPoint> getIconPoints(char[][] board) {
+ List<IconPoint> iconPoints = new ArrayList<>();
for (int x = 0; x < board.length; x++) {
for (int y = 0; y < board[0].length; y++) {
if (isIcon(board[x][y])) {
- iconPoints.add(new TestBoardAppIcon(new Point(x, y), board[x][y]));
+ iconPoints.add(new IconPoint(new Point(x, y), board[x][y]));
}
}
}
@@ -135,18 +213,18 @@
String line = lines[y];
for (int x = 0; x < line.length(); x++) {
char c = line.charAt(x);
- if (c == 'm') {
+ if (c == CellType.MAIN_WIDGET) {
board.mMain = new Point(x, y);
}
- if (c != '-') {
- board.mBoard[x][y] = line.charAt(x);
+ if (c != CellType.EMPTY) {
+ board.mWidget[x][y] = line.charAt(x);
}
}
}
- board.mWidgetsRects = getRects(board.mBoard);
+ board.mWidgetsRects = getRects(board.mWidget);
board.mWidgetsRects.forEach(
widgetRect -> board.mWidgetsMap.put(widgetRect.mType, widgetRect));
- board.mIconPoints = getIconPoints(board.mBoard);
+ board.mIconPoints = getIconPoints(board.mWidget);
return board;
}
}
diff --git a/tests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java b/tests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java
new file mode 100644
index 0000000..8ce932d
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.celllayout;
+
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Context;
+
+import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ContentWriter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+public class FavoriteItemsTransaction {
+ private ArrayList<ItemInfo> mItemsToSubmit;
+ private Context mContext;
+ private ContentResolver mResolver;
+ public AbstractLauncherUiTest mTest;
+
+ public FavoriteItemsTransaction(Context context, AbstractLauncherUiTest test) {
+ mItemsToSubmit = new ArrayList<>();
+ mContext = context;
+ mResolver = mContext.getContentResolver();
+ mTest = test;
+ }
+
+ public FavoriteItemsTransaction addItem(ItemInfo itemInfo) {
+ this.mItemsToSubmit.add(itemInfo);
+ return this;
+ }
+
+ public FavoriteItemsTransaction removeLast() {
+ this.mItemsToSubmit.remove(this.mItemsToSubmit.size() - 1);
+ return this;
+ }
+
+ /**
+ * Commits all the ItemInfo into the database of Favorites
+ **/
+ public void commit() throws ExecutionException, InterruptedException {
+ List<ContentValues> values = new ArrayList<>();
+ for (ItemInfo item : this.mItemsToSubmit) {
+ ContentWriter writer = new ContentWriter(mContext);
+ item.onAddToDatabase(writer);
+ writer.put(LauncherSettings.Favorites._ID, item.id);
+ values.add(writer.getValues(mContext));
+ }
+ // Submit the icons to the database in the model thread to prevent race conditions
+ MODEL_EXECUTOR.submit(() -> mResolver.bulkInsert(LauncherSettings.Favorites.CONTENT_URI,
+ values.toArray(new ContentValues[0]))).get();
+ // Reload the state of the Launcher
+ MAIN_EXECUTOR.submit(() -> LauncherAppState.getInstance(
+ mContext).getModel().forceReload()).get();
+ }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
index ed0b71d..2846cae 100644
--- a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
+++ b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
@@ -15,16 +15,13 @@
*/
package com.android.launcher3.celllayout;
-import static com.android.launcher3.util.WidgetUtils.createWidgetInfo;
-
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import android.graphics.Point;
-import android.graphics.Rect;
import android.util.Log;
import android.view.View;
-import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -34,12 +31,14 @@
import com.android.launcher3.celllayout.testcases.PushReorderCase;
import com.android.launcher3.celllayout.testcases.ReorderTestCase;
import com.android.launcher3.celllayout.testcases.SimpleReorderCase;
-import com.android.launcher3.model.data.LauncherAppWidgetInfo;
+import com.android.launcher3.tapl.Widget;
+import com.android.launcher3.tapl.WidgetResizeFrame;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TaplTestsLauncher3;
-import com.android.launcher3.ui.TestViewHelpers;
+import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.ShellCommandRule;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
+import com.android.launcher3.views.DoubleShadowBubbleTextView;
+import com.android.launcher3.widget.LauncherAppWidgetHostView;
import org.junit.Assume;
import org.junit.Before;
@@ -48,6 +47,7 @@
import org.junit.runner.RunWith;
import java.util.Map;
+import java.util.concurrent.ExecutionException;
@SmallTest
@@ -59,6 +59,8 @@
private static final String TAG = ReorderWidgets.class.getSimpleName();
+ TestWorkspaceBuilder mWorkspaceBuilder;
+
private View getViewAt(int cellX, int cellY) {
return getFromLauncher(l -> l.getWorkspace().getScreenWithId(
l.getWorkspace().getScreenIdForPageIndex(0)).getChildAt(cellX, cellY));
@@ -75,6 +77,7 @@
@Before
public void setup() throws Throwable {
+ mWorkspaceBuilder = new TestWorkspaceBuilder(this, mTargetContext);
TaplTestsLauncher3.initialize(this);
clearHomescreen();
}
@@ -85,78 +88,47 @@
private boolean validateBoard(CellLayoutBoard board) {
boolean match = true;
Point cellDimensions = getCellDimensions();
- for (TestBoardWidget widgetRect: board.getWidgets()) {
+ for (CellLayoutBoard.WidgetRect widgetRect : board.getWidgets()) {
if (widgetRect.shouldIgnore()) {
continue;
}
View widget = getViewAt(widgetRect.getCellX(), widgetRect.getCellY());
+ assertTrue("The view selected at " + board + " is not a widget",
+ widget instanceof LauncherAppWidgetHostView);
match &= widgetRect.getSpanX()
== Math.round(widget.getWidth() / (float) cellDimensions.x);
match &= widgetRect.getSpanY()
== Math.round(widget.getHeight() / (float) cellDimensions.y);
if (!match) return match;
}
+ for (CellLayoutBoard.IconPoint iconPoint : board.getIcons()) {
+ View icon = getViewAt(iconPoint.getCoord().x, iconPoint.getCoord().y);
+ assertTrue("The view selected at " + iconPoint.coord + " is not an Icon",
+ icon instanceof DoubleShadowBubbleTextView);
+ }
return match;
}
- /**
- * Fills the given rect in WidgetRect with 1x1 widgets. This is useful to equalize cases.
- */
- private void fillWithWidgets(TestBoardWidget widgetRect) {
- int initX = widgetRect.getCellX();
- int initY = widgetRect.getCellY();
- for (int x = 0; x < widgetRect.getSpanX(); x++) {
- for (int y = 0; y < widgetRect.getSpanY(); y++) {
- int auxX = initX + x;
- int auxY = initY + y;
- try {
- // this widgets are filling, we don't care if we can't place them
- addWidgetInCell(
- new TestBoardWidget('x',
- new Rect(auxX, auxY, auxX, auxY))
- );
- } catch (Exception e) {
- Log.d(TAG, "Unable to place filling widget at " + auxX + "," + auxY);
- }
- }
- }
- }
-
- private void addWidgetInCell(TestBoardWidget widgetRect) {
- LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(this, false);
- LauncherAppWidgetInfo item = createWidgetInfo(info,
- ApplicationProvider.getApplicationContext(), true);
- item.cellX = widgetRect.getCellX();
- item.cellY = widgetRect.getCellY();
-
- item.spanX = widgetRect.getSpanX();
- item.spanY = widgetRect.getSpanY();
- addItemToScreen(item);
- }
-
- private void addCorrespondingWidgetRect(TestBoardWidget widgetRect) {
- if (widgetRect.mType == 'x') {
- fillWithWidgets(widgetRect);
- } else {
- addWidgetInCell(widgetRect);
- }
- }
-
- private void runTestCase(ReorderTestCase testCase) {
+ private void runTestCase(ReorderTestCase testCase)
+ throws ExecutionException, InterruptedException {
Point mainWidgetCellPos = testCase.mStart.getMain();
- testCase.mStart.getWidgets().forEach(this::addCorrespondingWidgetRect);
+ FavoriteItemsTransaction transaction =
+ new FavoriteItemsTransaction(mTargetContext, this);
+ mWorkspaceBuilder.buildFromBoard(testCase.mStart, transaction).commit();
- mLauncher.getWorkspace()
- .getWidgetAtCell(mainWidgetCellPos.x, mainWidgetCellPos.y)
- .dragWidgetToWorkspace(testCase.moveMainTo.x, testCase.moveMainTo.y)
- .dismiss(); // dismiss resize frame
+ Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.x,
+ mainWidgetCellPos.y);
+ assertNotNull(widget);
+ WidgetResizeFrame resizeFrame = widget.dragWidgetToWorkspace(testCase.moveMainTo.x,
+ testCase.moveMainTo.y);
+ resizeFrame.dismiss();
boolean isValid = false;
for (CellLayoutBoard board : testCase.mEnd) {
isValid |= validateBoard(board);
}
- assertTrue("None of the valid boards match with the current state", isValid);
+ assertTrue("Non of the valid boards match with the current state", isValid);
}
/**
@@ -164,7 +136,8 @@
*
* @param testCaseMap map containing all the tests per grid size (Point)
*/
- private void runTestCaseMap(Map<Point, ReorderTestCase> testCaseMap, String testName) {
+ private void runTestCaseMap(Map<Point, ReorderTestCase> testCaseMap, String testName)
+ throws ExecutionException, InterruptedException {
Point iconGridDimensions = mLauncher.getWorkspace().getIconGridDimensions();
Log.d(TAG, "Running test " + testName + " for grid " + iconGridDimensions);
Assume.assumeTrue(
@@ -173,24 +146,28 @@
runTestCase(testCaseMap.get(iconGridDimensions));
}
+ @ScreenRecord // b/242323136
@Test
- public void simpleReorder() {
+ public void simpleReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(SimpleReorderCase.TEST_BY_GRID_SIZE,
SimpleReorderCase.class.getSimpleName());
}
+ @ScreenRecord // b/242323136
@Test
- public void pushTest() {
+ public void pushTest() throws ExecutionException, InterruptedException {
runTestCaseMap(PushReorderCase.TEST_BY_GRID_SIZE, PushReorderCase.class.getSimpleName());
}
+ @ScreenRecord // b/242323136
@Test
- public void fullReorder() {
+ public void fullReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(FullReorderCase.TEST_BY_GRID_SIZE, FullReorderCase.class.getSimpleName());
}
+ @ScreenRecord // b/242323136
@Test
- public void moveOutReorder() {
+ public void moveOutReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(MoveOutReorderCase.TEST_BY_GRID_SIZE,
MoveOutReorderCase.class.getSimpleName());
}
diff --git a/tests/src/com/android/launcher3/celllayout/TestWorkspaceBuilder.java b/tests/src/com/android/launcher3/celllayout/TestWorkspaceBuilder.java
new file mode 100644
index 0000000..16448af
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/TestWorkspaceBuilder.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.celllayout;
+
+import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID;
+import static com.android.launcher3.util.WidgetUtils.createWidgetInfo;
+
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.graphics.Rect;
+import android.os.Process;
+import android.os.UserHandle;
+import android.util.Log;
+
+import androidx.test.core.app.ApplicationProvider;
+
+import com.android.launcher3.InvariantDeviceProfile;
+import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.model.data.AppInfo;
+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.ui.AbstractLauncherUiTest;
+import com.android.launcher3.ui.TestViewHelpers;
+import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
+
+public class TestWorkspaceBuilder {
+
+ private static final String TAG = "CellLayoutBoardBuilder";
+ private static final ComponentName APP_COMPONENT_NAME = new ComponentName(
+ "com.google.android.calculator", "com.android.calculator2.Calculator");
+
+ public AbstractLauncherUiTest mTest;
+
+ private UserHandle mMyUser;
+
+ private Context mContext;
+ private ContentResolver mResolver;
+
+ public TestWorkspaceBuilder(AbstractLauncherUiTest test, Context context) {
+ mTest = test;
+ mMyUser = Process.myUserHandle();
+ mContext = context;
+ mResolver = mContext.getContentResolver();
+ }
+
+ /**
+ * Fills the given rect in WidgetRect with 1x1 widgets. This is useful to equalize cases.
+ */
+ private FavoriteItemsTransaction fillWithWidgets(CellLayoutBoard.WidgetRect widgetRect,
+ FavoriteItemsTransaction transaction) {
+ int initX = widgetRect.getCellX();
+ int initY = widgetRect.getCellY();
+ for (int x = initX; x < initX + widgetRect.getSpanX(); x++) {
+ for (int y = initY; y < initY + widgetRect.getSpanY(); y++) {
+ try {
+ // this widgets are filling, we don't care if we can't place them
+ ItemInfo item = createWidgetInCell(
+ new CellLayoutBoard.WidgetRect(CellLayoutBoard.CellType.IGNORE,
+ new Rect(x, y, x, y))
+ );
+ transaction.addItem(item);
+ } catch (Exception e) {
+ Log.d(TAG, "Unable to place filling widget at " + x + "," + y);
+ }
+ }
+ }
+ return transaction;
+ }
+
+ private int getID() {
+ return LauncherSettings.Settings.call(
+ mResolver, LauncherSettings.Settings.METHOD_NEW_ITEM_ID)
+ .getInt(LauncherSettings.Settings.EXTRA_VALUE);
+ }
+
+ private AppInfo getApp() {
+ return new AppInfo(APP_COMPONENT_NAME, "test icon", mMyUser,
+ AppInfo.makeLaunchIntent(APP_COMPONENT_NAME));
+ }
+
+ private void addCorrespondingWidgetRect(CellLayoutBoard.WidgetRect widgetRect,
+ FavoriteItemsTransaction transaction) {
+ if (widgetRect.mType == 'x') {
+ fillWithWidgets(widgetRect, transaction);
+ } else {
+ transaction.addItem(createWidgetInCell(widgetRect));
+ }
+ }
+
+ /**
+ * Builds the given board into the transaction
+ */
+ public FavoriteItemsTransaction buildFromBoard(CellLayoutBoard board,
+ FavoriteItemsTransaction transaction) {
+ board.getWidgets().forEach(
+ (widgetRect) -> addCorrespondingWidgetRect(widgetRect, transaction));
+ board.getIcons().forEach((iconPoint) ->
+ transaction.addItem(createIconInCell(iconPoint))
+ );
+ return transaction;
+ }
+
+ /**
+ * Fills the hotseat row with apps instead of suggestions, for this to work the workspace should
+ * be clean otherwise this doesn't overrides the existing icons.
+ */
+ public FavoriteItemsTransaction fillHotseatIcons(FavoriteItemsTransaction transaction) {
+ int hotseatCount = InvariantDeviceProfile.INSTANCE.get(mContext).numShownHotseatIcons;
+ for (int i = 0; i < hotseatCount; i++) {
+ transaction.addItem(getHotseatValues(i));
+ }
+ return transaction;
+ }
+
+ private ItemInfo createWidgetInCell(CellLayoutBoard.WidgetRect widgetRect) {
+ LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(mTest, false);
+ LauncherAppWidgetInfo item = createWidgetInfo(info,
+ ApplicationProvider.getApplicationContext(), true);
+ item.id = getID();
+ item.cellX = widgetRect.getCellX();
+ item.cellY = widgetRect.getCellY();
+ item.spanX = widgetRect.getSpanX();
+ item.spanY = widgetRect.getSpanY();
+ item.screenId = FIRST_SCREEN_ID;
+ return item;
+ }
+
+ private ItemInfo createIconInCell(CellLayoutBoard.IconPoint iconPoint) {
+ WorkspaceItemInfo item = new WorkspaceItemInfo(getApp());
+ item.id = getID();
+ item.screenId = FIRST_SCREEN_ID;
+ item.cellX = iconPoint.getCoord().x;
+ item.cellY = iconPoint.getCoord().y;
+ item.minSpanY = item.minSpanX = item.spanX = item.spanY = 1;
+ item.container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
+ return item;
+ }
+
+ private ItemInfo getHotseatValues(int x) {
+ WorkspaceItemInfo item = new WorkspaceItemInfo(getApp());
+ item.id = getID();
+ item.cellX = x;
+ item.cellY = 0;
+ item.minSpanY = item.minSpanX = item.spanX = item.spanY = 1;
+ item.rank = x;
+ item.screenId = x;
+ item.container = LauncherSettings.Favorites.CONTAINER_HOTSEAT;
+ return item;
+ }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/testcases/FullReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/FullReorderCase.java
index ff03a50..a98882c 100644
--- a/tests/src/com/android/launcher3/celllayout/testcases/FullReorderCase.java
+++ b/tests/src/com/android/launcher3/celllayout/testcases/FullReorderCase.java
@@ -19,47 +19,70 @@
import java.util.Map;
+/**
+ * The grids represent the workspace to be build by TestWorkspaceBuilder, to see what each character
+ * in the board mean refer to {@code CellType}
+ */
public class FullReorderCase {
+
+ /** 5x5 Test
+ **/
private static final String START_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "222mm\n"
+ "222mm\n"
- + "ad111\n"
- + "bc111";
-
+ + "ii111\n"
+ + "ii111";
private static final Point MOVE_TO_5x5 = new Point(0, 4);
-
private static final String END_BOARD_STR_5x5 = ""
+ "xxxxx\n"
- + "222ad\n"
- + "222bc\n"
+ + "222ii\n"
+ + "222ii\n"
+ "mm111\n"
+ "mm111";
-
private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_STR_5x5,
MOVE_TO_5x5,
END_BOARD_STR_5x5);
+ /** 6x5 Test
+ **/
private static final String START_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
+ "2222mm\n"
+ "2222mm\n"
- + "ad1111\n"
- + "bc1111";
-
+ + "ii1111\n"
+ + "ii1111";
private static final Point MOVE_TO_6x5 = new Point(0, 4);
-
private static final String END_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
- + "2222ad\n"
- + "2222bc\n"
+ + "2222ii\n"
+ + "2222ii\n"
+ "mm1111\n"
+ "mm1111";
-
private static final ReorderTestCase TEST_CASE_6x5 = new ReorderTestCase(START_BOARD_STR_6x5,
MOVE_TO_6x5,
END_BOARD_STR_6x5);
+ /** 4x4 Test
+ **/
+ private static final String START_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "22mm\n"
+ + "iimm\n"
+ + "ii11";
+ private static final Point MOVE_TO_4x4 = new Point(0, 3);
+ private static final String END_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "22ii\n"
+ + "mmii\n"
+ + "mm11";
+
+ private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4,
+ MOVE_TO_4x4,
+ END_BOARD_STR_4x4);
+
public static final Map<Point, ReorderTestCase> TEST_BY_GRID_SIZE =
- Map.of(new Point(5, 5), TEST_CASE_5x5, new Point(6, 5), TEST_CASE_6x5);
+ Map.of(new Point(5, 5), TEST_CASE_5x5,
+ new Point(6, 5), TEST_CASE_6x5,
+ new Point(4, 4), TEST_CASE_4x4);
}
diff --git a/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java
index 32bf05a..a222d3d 100644
--- a/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java
+++ b/tests/src/com/android/launcher3/celllayout/testcases/MoveOutReorderCase.java
@@ -19,48 +19,69 @@
import java.util.Map;
+/**
+ * The grids represent the workspace to be build by TestWorkspaceBuilder, to see what each character
+ * in the board mean refer to {@code CellType}
+ */
public class MoveOutReorderCase {
+
+ /** 5x5 Test
+ **/
private static final String START_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "34-m-\n"
+ "35111\n"
+ "32111\n"
+ "32111";
-
private static final Point MOVE_TO_5x5 = new Point(1, 2);
-
private static final String END_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "345--\n"
+ "3m111\n"
+ "32111\n"
+ "32111";
-
private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_STR_5x5,
MOVE_TO_5x5,
END_BOARD_STR_5x5);
-
+ /** 6x5 Test
+ **/
private static final String START_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
+ "34-m--\n"
+ "351111\n"
+ "321111\n"
+ "321111";
-
private static final Point MOVE_TO_6x5 = new Point(1, 2);
-
private static final String END_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
+ "345---\n"
+ "3m1111\n"
+ "321111\n"
+ "321111";
-
private static final ReorderTestCase TEST_CASE_6x5 = new ReorderTestCase(START_BOARD_STR_6x5,
MOVE_TO_6x5,
END_BOARD_STR_6x5);
+ /** 4x4 Test
+ **/
+ private static final String START_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "34-m\n"
+ + "3511\n"
+ + "3211";
+ private static final Point MOVE_TO_4x4 = new Point(1, 2);
+ private static final String END_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "345-\n"
+ + "3m11\n"
+ + "3211";
+ private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4,
+ MOVE_TO_4x4,
+ END_BOARD_STR_4x4);
+
public static final Map<Point, ReorderTestCase> TEST_BY_GRID_SIZE =
- Map.of(new Point(5, 5), TEST_CASE_5x5, new Point(6, 5), TEST_CASE_6x5);
+ Map.of(new Point(5, 5), TEST_CASE_5x5,
+ new Point(6, 5), TEST_CASE_6x5,
+ new Point(4, 4), TEST_CASE_4x4);
}
diff --git a/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java
index b386946..e16ff42 100644
--- a/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java
+++ b/tests/src/com/android/launcher3/celllayout/testcases/PushReorderCase.java
@@ -17,60 +17,72 @@
import android.graphics.Point;
-import com.android.launcher3.celllayout.CellLayoutBoard;
-
import java.util.Map;
+/**
+ * The grids represent the workspace to be build by TestWorkspaceBuilder, to see what each character
+ * in the board mean refer to {@code CellType}
+ */
public class PushReorderCase {
+
+ /** 5x5 Test
+ **/
private static final String START_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "222m-\n"
+ "--111\n"
+ "--333\n"
+ "-----";
- private static final CellLayoutBoard START_BOARD_5x5 = CellLayoutBoard.boardFromString(
- START_BOARD_STR_5x5);
-
private static final Point MOVE_TO_5x5 = new Point(2, 1);
-
private static final String END_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "--m--\n"
+ "222--\n"
+ "--111\n"
+ "--333";
- private static final CellLayoutBoard END_BOARD_5x5 = CellLayoutBoard.boardFromString(
+ private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_STR_5x5,
+ MOVE_TO_5x5,
END_BOARD_STR_5x5);
- private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_5x5,
- MOVE_TO_5x5,
- END_BOARD_5x5);
-
+ /** 6x5 Test
+ **/
private static final String START_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
+ "2222m-\n"
+ "--111-\n"
+ "--333-\n"
+ "------";
- private static final CellLayoutBoard START_BOARD_6x5 = CellLayoutBoard.boardFromString(
- START_BOARD_STR_6x5);
-
private static final Point MOVE_TO_6x5 = new Point(2, 1);
-
private static final String END_BOARD_STR_6x5 = ""
+ "xxxxxx\n"
+ "--m---\n"
+ "2222--\n"
+ "--111-\n"
+ "--333-";
- private static final CellLayoutBoard END_BOARD_6x5 = CellLayoutBoard.boardFromString(
+ private static final ReorderTestCase TEST_CASE_6x5 = new ReorderTestCase(START_BOARD_STR_6x5,
+ MOVE_TO_6x5,
END_BOARD_STR_6x5);
- private static final ReorderTestCase TEST_CASE_6x5 = new ReorderTestCase(START_BOARD_6x5,
- MOVE_TO_6x5,
- END_BOARD_6x5);
+ /** 4x4 Test
+ **/
+ private static final String START_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "222m\n"
+ + "-111\n"
+ + "----";
+ private static final Point MOVE_TO_4x4 = new Point(2, 1);
+ private static final String END_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "--m-\n"
+ + "222-\n"
+ + "-111";
+ private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4,
+ MOVE_TO_4x4,
+ END_BOARD_STR_4x4);
public static final Map<Point, ReorderTestCase> TEST_BY_GRID_SIZE =
- Map.of(new Point(5, 5), TEST_CASE_5x5, new Point(6, 5), TEST_CASE_6x5);
+ Map.of(new Point(5, 5), TEST_CASE_5x5,
+ new Point(6, 5), TEST_CASE_6x5,
+ new Point(4, 4), TEST_CASE_4x4);
}
diff --git a/tests/src/com/android/launcher3/celllayout/testcases/SimpleReorderCase.java b/tests/src/com/android/launcher3/celllayout/testcases/SimpleReorderCase.java
index 57e1398..546c48b 100644
--- a/tests/src/com/android/launcher3/celllayout/testcases/SimpleReorderCase.java
+++ b/tests/src/com/android/launcher3/celllayout/testcases/SimpleReorderCase.java
@@ -17,35 +17,51 @@
import android.graphics.Point;
-import com.android.launcher3.celllayout.CellLayoutBoard;
-
import java.util.Map;
+/**
+ * The grids represent the workspace to be build by TestWorkspaceBuilder, to see what each character
+ * in the board mean refer to {@code CellType}
+ */
public class SimpleReorderCase {
- private static final String START_BOARD_STR = ""
+
+ /** 5x5 Test
+ **/
+ private static final String START_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "--mm-\n"
+ "--mm-\n"
+ "-----\n"
+ "-----";
- private static final CellLayoutBoard START_BOARD_5x5 = CellLayoutBoard.boardFromString(
- START_BOARD_STR);
-
private static final Point MOVE_TO_5x5 = new Point(4, 4);
-
private static final String END_BOARD_STR_5x5 = ""
+ "xxxxx\n"
+ "-----\n"
+ "-----\n"
+ "---mm\n"
+ "---mm";
- private static final CellLayoutBoard END_BOARD_5x5 = CellLayoutBoard.boardFromString(
+ private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_STR_5x5,
+ MOVE_TO_5x5,
END_BOARD_STR_5x5);
- private static final ReorderTestCase TEST_CASE_5x5 = new ReorderTestCase(START_BOARD_5x5,
- MOVE_TO_5x5,
- END_BOARD_5x5);
+ /** 4x4 Test
+ **/
+ private static final String START_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "--mm\n"
+ + "--mm\n"
+ + "----";
+ private static final Point MOVE_TO_4x4 = new Point(3, 3);
+ private static final String END_BOARD_STR_4x4 = ""
+ + "xxxx\n"
+ + "----\n"
+ + "--mm\n"
+ + "--mm";
+ private static final ReorderTestCase TEST_CASE_4x4 = new ReorderTestCase(START_BOARD_STR_4x4,
+ MOVE_TO_4x4,
+ END_BOARD_STR_4x4);
public static final Map<Point, ReorderTestCase> TEST_BY_GRID_SIZE =
- Map.of(new Point(5, 5), TEST_CASE_5x5);
+ Map.of(new Point(5, 5), TEST_CASE_5x5,
+ new Point(4, 4), TEST_CASE_4x4);
}
diff --git a/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java b/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
index 8d275cc..55b7bf1 100644
--- a/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
+++ b/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
@@ -17,10 +17,10 @@
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
-import static com.android.launcher3.ResourceUtils.getDimenByName;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.getDimenByName;
import android.content.Context;
import android.content.res.Resources;
diff --git a/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java b/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
index dba0a40..7d36740 100644
--- a/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
+++ b/tests/src/com/android/launcher3/model/CacheDataUpdatedTaskTest.java
@@ -1,5 +1,7 @@
package com.android.launcher3.model;
+import static com.android.launcher3.testing.shared.TestProtocol.INCORRECT_INFO_UPDATED;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
@@ -14,6 +16,7 @@
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
+import android.util.Log;
import androidx.annotation.NonNull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -26,6 +29,7 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.LauncherModelHelper;
import org.junit.After;
@@ -43,12 +47,15 @@
@RunWith(AndroidJUnit4.class)
public class CacheDataUpdatedTaskTest {
+ private static final String TAG = "CacheDataUpdatedTaskTest";
+
private static final String NEW_LABEL_PREFIX = "new-label-";
private LauncherModelHelper mModelHelper;
@Before
public void setup() throws Exception {
+ TestProtocol.sDebugTracing = true;
mModelHelper = new LauncherModelHelper();
mModelHelper.initializeData("cache_data_updated_task_data");
@@ -57,23 +64,26 @@
IconCache iconCache = LauncherAppState.getInstance(context).getIconCache();
CachingLogic<ItemInfo> placeholderLogic = new CachingLogic<ItemInfo>() {
@Override
- public ComponentName getComponent(ItemInfo info) {
+ @NonNull
+ public ComponentName getComponent(@NonNull ItemInfo info) {
return info.getTargetComponent();
}
+ @NonNull
@Override
- public UserHandle getUser(ItemInfo info) {
+ public UserHandle getUser(@NonNull ItemInfo info) {
return info.user;
}
+ @NonNull
@Override
- public CharSequence getLabel(ItemInfo info) {
+ public CharSequence getLabel(@NonNull ItemInfo info) {
return NEW_LABEL_PREFIX + info.id;
}
@NonNull
@Override
- public BitmapInfo loadIcon(Context context, ItemInfo info) {
+ public BitmapInfo loadIcon(@NonNull Context context, @NonNull ItemInfo info) {
return BitmapInfo.of(Bitmap.createBitmap(1, 1, Config.ARGB_8888), Color.RED);
}
};
@@ -88,6 +98,7 @@
@After
public void tearDown() {
mModelHelper.destroy();
+ TestProtocol.sDebugTracing = false;
}
private CacheDataUpdatedTask newTask(int op, String... pkg) {
@@ -111,6 +122,7 @@
// Verify that only app1 var updated in allAppsList
assertFalse(mModelHelper.getAllAppsList().data.isEmpty());
for (AppInfo info : mModelHelper.getAllAppsList().data) {
+ Log.i(INCORRECT_INFO_UPDATED, "testCacheUpdate_update_apps: checking info=" + info);
if (info.componentName.getPackageName().equals("app1")) {
assertFalse(info.bitmap.isNullOrLowRes());
} else {
diff --git a/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt b/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt
new file mode 100644
index 0000000..55520e8
--- /dev/null
+++ b/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.nonquickstep
+
+import android.graphics.Rect
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.DeviceProfileBaseTest
+import com.android.launcher3.util.WindowBounds
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class HotseatWidthCalculationTest : DeviceProfileBaseTest() {
+
+ /**
+ * This is a case when after setting the hotseat, the space needs to be recalculated
+ * but it doesn't need to change QSB width or remove icons
+ */
+ @Test
+ fun distribute_border_space_when_space_is_enough_portrait() {
+ initializeVarsForTablet(isGestureMode = false)
+ windowBounds = WindowBounds(Rect(0, 0, 1800, 2560), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(145)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(177)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(177)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1445)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, and recalculating spaces
+ * it still needs to remove icons for everything to fit
+ */
+ @Test
+ fun decrease_num_of_icons_when_not_enough_space_portrait() {
+ initializeVarsForTablet(isGestureMode = false)
+ windowBounds = WindowBounds(Rect(0, 0, 1300, 2560), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(94)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(121)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(121)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1058)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, the space needs to be recalculated
+ * but it doesn't need to change QSB width or remove icons
+ */
+ @Test
+ fun distribute_border_space_when_space_is_enough_landscape() {
+ initializeVarsForTwoPanel(isGestureMode = false, isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(105)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(370)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(370)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1467)
+ }
+
+ /**
+ * This is a case when the hotseat spans a certain amount of columns
+ * and the nav buttons push the hotseat to the side, but not enough to change the border space.
+ */
+ @Test
+ fun nav_buttons_dont_interfere_with_required_hotseat_width() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ inv?.apply {
+ hotseatColumnSpan = IntArray(4) { 4 }
+ inlineQsb = BooleanArray(4) { false }
+ }
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(100)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(668)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(668)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1224)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, the QSB width needs to be changed to fit
+ */
+ @Test
+ fun decrease_qsb_when_not_enough_space_landscape() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ windowBounds = WindowBounds(Rect(0, 0, 2460, 1600), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(96)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(643)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(643)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1174)
+ }
+
+ /**
+ * This is a case when after setting the hotseat, changing QSB width, and recalculating spaces
+ * it still needs to remove icons for everything to fit
+ */
+ @Test
+ fun decrease_num_of_icons_when_not_enough_space_landscape() {
+ initializeVarsForTablet(isGestureMode = false, isLandscape = true)
+ windowBounds = WindowBounds(Rect(0, 0, 2260, 1600), Rect(0, 104, 0, 0))
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
+ assertThat(dp.numShownHotseatIcons).isEqualTo(6)
+ assertThat(dp.hotseatBorderSpace).isEqualTo(89)
+
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(589)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(589)
+
+ assertThat(dp.isQsbInline).isFalse()
+ assertThat(dp.hotseatQsbWidth).isEqualTo(1081)
+ }
+}
diff --git a/tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java b/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
similarity index 96%
rename from tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java
rename to tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
index fd86cf1..93fa705 100644
--- a/tests/src/com/android/launcher3/secondarydisplay/SDLauncherTest.java
+++ b/tests/src/com/android/launcher3/secondarydisplay/SecondaryDisplayLauncherTest.java
@@ -32,7 +32,7 @@
*/
@MediumTest
@RunWith(AndroidJUnit4.class)
-public class SDLauncherTest {
+public class SecondaryDisplayLauncherTest {
@Before
public void setUp() {
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 1f6e1ec..df3cbff 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -61,7 +61,7 @@
import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType;
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.testcomponent.TestCommandReceiver;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Wait;
@@ -319,7 +319,7 @@
/**
* Adds {@param item} on the homescreen on the 0th screen
*/
- protected void addItemToScreen(ItemInfo item) {
+ public void addItemToScreen(ItemInfo item) {
WidgetUtils.addItemToScreen(item, mTargetContext);
resetLoaderState();
@@ -525,7 +525,7 @@
}
protected int getAllAppsScroll(Launcher launcher) {
- return launcher.getAppsView().getActiveRecyclerView().getCurrentScrollY();
+ return launcher.getAppsView().getActiveRecyclerView().computeVerticalScrollOffset();
}
private void checkLauncherIntegrity(
diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
index 8f2d528..266f0ae 100644
--- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
+++ b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
@@ -4,7 +4,6 @@
import android.view.Surface;
import com.android.launcher3.tapl.TestHelpers;
-import com.android.launcher3.testing.TestProtocol;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
index 03bf4af..07bfe4c 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
@@ -18,6 +18,8 @@
import static androidx.test.InstrumentationRegistry.getInstrumentation;
+import android.platform.test.annotations.IwTest;
+
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
@@ -203,6 +205,7 @@
false /* tapRight */);
}
+ @IwTest(focusArea="launcher")
@Test
@ScreenRecord // b/202433017
public void testWorkspace() throws Exception {
@@ -211,9 +214,9 @@
// Test that ensureWorkspaceIsScrollable adds a page by dragging an icon there.
executeOnLauncher(launcher -> assertFalse("Initial workspace state is scrollable",
isWorkspaceScrollable(launcher)));
- workspace.verifyWorkspaceAppIconIsGone(
- "Chrome app was found on empty workspace", "Chrome");
-
+ assertEquals("Initial workspace doesn't have the correct page", workspace.pagesPerScreen(),
+ workspace.getPageCount());
+ workspace.verifyWorkspaceAppIconIsGone("Chrome app was found on empty workspace", "Chrome");
workspace.ensureWorkspaceIsScrollable();
executeOnLauncher(
@@ -300,7 +303,7 @@
}
private int getWidgetsScroll(Launcher launcher) {
- return getWidgetsView(launcher).getCurrentScrollY();
+ return getWidgetsView(launcher).computeVerticalScrollOffset();
}
private boolean isOptionsPopupVisible(Launcher launcher) {
@@ -330,6 +333,7 @@
}
}
+ @IwTest(focusArea="launcher")
@Test
@PortraitLandscape
public void testDragAppIcon() throws Throwable {
@@ -584,4 +588,16 @@
public static String getAppPackageName() {
return getInstrumentation().getContext().getPackageName();
}
+
+ @Test
+ public void testGetAppIconName() {
+ HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
+ allApps.freeze();
+ try {
+ HomeAppIcon icon = allApps.getAppIcon(APP_NAME);
+ assertEquals("Wrong app icon name.", icon.getIconName(), APP_NAME);
+ } finally {
+ allApps.unfreeze();
+ }
+ }
}
diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
index a7a17b1..302bd2f 100644
--- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java
+++ b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
@@ -21,6 +21,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
import android.util.Log;
import android.view.View;
@@ -47,6 +48,8 @@
private static final int WORK_PAGE = ActivityAllAppsContainerView.AdapterHolder.WORK;
private int mProfileUserId;
+ private boolean mWorkProfileSetupSuccessful;
+ private final String TAG = "WorkProfileTest";
@Before
@Override
@@ -55,12 +58,17 @@
String output =
mDevice.executeShellCommand(
"pm create-user --profileOf 0 --managed TestProfile");
- Log.d("b/203817455", "pm create-user; output: " + output);
- assertTrue("Failed to create work profile", output.startsWith("Success"));
+ // b/203817455
+ updateWorkProfileSetupSuccessful("pm create-user", output);
String[] tokens = output.split("\\s+");
mProfileUserId = Integer.parseInt(tokens[tokens.length - 1]);
- mDevice.executeShellCommand("am start-user " + mProfileUserId);
+ output = mDevice.executeShellCommand("am start-user " + mProfileUserId);
+ updateWorkProfileSetupSuccessful("am start-user", output);
+
+ if (!mWorkProfileSetupSuccessful) {
+ return; // no need to setup launcher since all tests will skip.
+ }
mDevice.pressHome();
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
@@ -99,6 +107,8 @@
@Test
public void workTabExists() {
+ assumeTrue(mWorkProfileSetupSuccessful);
+ waitForWorkTabSetup();
waitForLauncherCondition("Personal tab is missing",
launcher -> launcher.getAppsView().isPersonalTabVisible(),
LauncherInstrumentation.WAIT_TIME_MS);
@@ -109,8 +119,8 @@
@Test
public void toggleWorks() {
+ assumeTrue(mWorkProfileSetupSuccessful);
waitForWorkTabSetup();
-
executeOnLauncher(launcher -> {
AllAppsPagedView pagedView = (AllAppsPagedView) launcher.getAppsView().getContentView();
pagedView.setCurrentPage(WORK_PAGE);
@@ -126,7 +136,11 @@
LauncherInstrumentation.WAIT_TIME_MS);
//start work profile toggle OFF test
- executeOnLauncher(l -> l.getAppsView().getWorkManager().getWorkModeSwitch().performClick());
+ executeOnLauncher(l -> {
+ // Ensure updates are not deferred so notification happens when apps pause.
+ l.getAppsView().getAppsStore().disableDeferUpdates(DEFER_UPDATES_TEST);
+ l.getAppsView().getWorkManager().getWorkModeSwitch().performClick();
+ });
waitForLauncherCondition("Work profile toggle OFF failed", launcher -> {
manager.reset(); // pulls current state from system
@@ -152,6 +166,7 @@
@Test
public void testEdu() {
+ assumeTrue(mWorkProfileSetupSuccessful);
waitForWorkTabSetup();
executeOnLauncher(l -> {
l.getSharedPrefs().edit().putInt(WorkProfileManager.KEY_WORK_EDU_STEP, 0).commit();
@@ -174,4 +189,14 @@
}
}, LauncherInstrumentation.WAIT_TIME_MS);
}
+
+ private void updateWorkProfileSetupSuccessful(String cli, String output) {
+ Log.d(TAG, "updateWorkProfileSetupSuccessful, cli=" + cli + " " + "output=" + output);
+ if (output.startsWith("Success")) {
+ assertTrue(output, output.startsWith("Success"));
+ mWorkProfileSetupSuccessful = true;
+ } else {
+ mWorkProfileSetupSuccessful = false;
+ }
+ }
}
diff --git a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
index 194ee4f..561f3cc 100644
--- a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java
@@ -20,6 +20,8 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import android.platform.test.annotations.IwTest;
+
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -45,6 +47,7 @@
@Rule
public ShellCommandRule mGrantWidgetRule = ShellCommandRule.grantWidgetBind();
+ @IwTest(focusArea="launcher")
@Test
@PortraitLandscape
public void testDragIcon() throws Throwable {
diff --git a/tests/src/com/android/launcher3/util/LauncherModelHelper.java b/tests/src/com/android/launcher3/util/LauncherModelHelper.java
index 3324959..e7e551f 100644
--- a/tests/src/com/android/launcher3/util/LauncherModelHelper.java
+++ b/tests/src/com/android/launcher3/util/LauncherModelHelper.java
@@ -47,6 +47,7 @@
import android.test.mock.MockContentResolver;
import android.util.ArrayMap;
+import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.uiautomator.UiDevice;
@@ -194,8 +195,9 @@
Executor mockExecutor = mock(Executor.class);
model.enqueueModelUpdateTask(new ModelUpdateTask() {
@Override
- public void init(LauncherAppState app, LauncherModel model, BgDataModel dataModel,
- AllAppsList allAppsList, Executor uiExecutor) {
+ public void init(@NonNull final LauncherAppState app,
+ @NonNull final LauncherModel model, @NonNull final BgDataModel dataModel,
+ @NonNull final AllAppsList allAppsList, @NonNull final Executor uiExecutor) {
task.init(app, model, dataModel, allAppsList, mockExecutor);
}
diff --git a/tests/src/com/android/launcher3/util/MultiAdditivePropertyTest.kt b/tests/src/com/android/launcher3/util/MultiPropertyFactoryTest.kt
similarity index 75%
rename from tests/src/com/android/launcher3/util/MultiAdditivePropertyTest.kt
rename to tests/src/com/android/launcher3/util/MultiPropertyFactoryTest.kt
index 309d055..a4f189c 100644
--- a/tests/src/com/android/launcher3/util/MultiAdditivePropertyTest.kt
+++ b/tests/src/com/android/launcher3/util/MultiPropertyFactoryTest.kt
@@ -16,26 +16,32 @@
package com.android.launcher3.util
-import android.view.View
+import android.util.FloatProperty
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
-/** Unit tests for [MultiAdditivePropertyFactory] */
+/** Unit tests for [MultiPropertyFactory] */
@SmallTest
@RunWith(AndroidJUnit4::class)
-class MultiAdditivePropertyTest {
+class MultiPropertyFactoryTest {
private val received = mutableListOf<Float>()
- private val factory =
- object : MultiAdditivePropertyFactory<View?>("Test", View.TRANSLATION_X) {
- override fun apply(obj: View?, value: Float) {
- received.add(value)
- }
+ private val receiveProperty: FloatProperty<Any> = object : FloatProperty<Any>("receive") {
+ override fun setValue(obj: Any?, value: Float) {
+ received.add(value)
}
+ override fun get(o: Any): Float {
+ return 0f
+ }
+ }
+
+ private val factory = MultiPropertyFactory("depth_property", receiveProperty) {
+ x: Float, y: Float -> x + y
+ }
private val p1 = factory.get(1)
private val p2 = factory.get(2)
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index bfb115d..4791846 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -29,7 +29,7 @@
import androidx.test.uiautomator.StaleObjectException;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.stream.Collectors;
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIcon.java b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
index e28f0af..2687b28 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
@@ -18,11 +18,12 @@
import android.widget.TextView;
+import androidx.annotation.NonNull;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
@@ -86,4 +87,10 @@
protected String launchableType() {
return "app icon";
}
+
+ /** Return the app name of a icon */
+ @NonNull
+ public String getIconName() {
+ return getObject().getText();
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java b/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
index 5cf5aba..284168b 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
@@ -18,7 +18,7 @@
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Menu item in an app icon menu.
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index 589e13c..eb8d055 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -19,7 +19,7 @@
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
import static com.android.launcher3.tapl.OverviewTask.TASK_START_EVENT;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import android.graphics.Point;
import android.os.SystemClock;
@@ -28,7 +28,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.List;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 6a11336..f47f710 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -247,8 +247,16 @@
return mLauncher.hasLauncherObject(mLauncher.getOverviewObjectSelector("clear_all"));
}
+ protected boolean isActionsViewVisible() {
+ OverviewTask task = mLauncher.isTablet() ? getFocusedTaskForTablet() : getCurrentTask();
+ if (task == null) {
+ return false;
+ }
+ return !task.isTaskSplit();
+ }
+
private void verifyActionsViewVisibility() {
- if (!hasTasks()) {
+ if (!hasTasks() || !isActionsViewVisible()) {
return;
}
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
@@ -265,13 +273,11 @@
* Returns if focused task is currently snapped task in tablet grid overview.
*/
private boolean isOverviewSnappedToFocusedTaskForTablet() {
- UiObject2 focusedTask = getFocusedTaskForTablet();
+ OverviewTask focusedTask = getFocusedTaskForTablet();
if (focusedTask == null) {
return false;
}
- return Math.abs(
- focusedTask.getVisibleBounds().exactCenterX() - mLauncher.getExactScreenCenterX())
- < 1;
+ return Math.abs(focusedTask.getExactCenterX() - mLauncher.getExactScreenCenterX()) < 1;
}
/**
@@ -279,7 +285,7 @@
*
* @throws IllegalStateException if not run on a tablet device.
*/
- UiObject2 getFocusedTaskForTablet() {
+ OverviewTask getFocusedTaskForTablet() {
if (!mLauncher.isTablet()) {
throw new IllegalStateException("Must be run on tablet device.");
}
@@ -290,9 +296,9 @@
int focusedTaskHeight = mLauncher.getFocusedTaskHeightForTablet();
for (UiObject2 task : taskViews) {
if (task.getVisibleBounds().height() == focusedTaskHeight) {
- return task;
+ return new OverviewTask(mLauncher, task, this);
}
}
return null;
}
-}
\ No newline at end of file
+}
diff --git a/tests/tapl/com/android/launcher3/tapl/FolderIcon.java b/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
index 9b4717f..0c453bd 100644
--- a/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
@@ -21,7 +21,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Folder Icon, an app folder in workspace.
diff --git a/tests/tapl/com/android/launcher3/tapl/HomeQsb.java b/tests/tapl/com/android/launcher3/tapl/HomeQsb.java
index 5f92199..c365708 100644
--- a/tests/tapl/com/android/launcher3/tapl/HomeQsb.java
+++ b/tests/tapl/com/android/launcher3/tapl/HomeQsb.java
@@ -15,12 +15,21 @@
*/
package com.android.launcher3.tapl;
+import androidx.annotation.NonNull;
+import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.BySelector;
+import androidx.test.uiautomator.UiObject2;
+import androidx.test.uiautomator.Until;
+
/**
* Operations on home screen qsb.
*/
public class HomeQsb {
private final LauncherInstrumentation mLauncher;
+ private static final String ASSISTANT_APP_PACKAGE = "com.google.android.googlequicksearchbox";
+ private static final String ASSISTANT_ICON_RES_ID = "mic_icon";
+
HomeQsb(LauncherInstrumentation launcher) {
mLauncher = launcher;
@@ -28,6 +37,35 @@
}
/**
+ * Launch assistant app by tapping mic icon on qsb.
+ */
+ @NonNull
+ public LaunchedAppState launchAssistant() {
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "want to click assistant mic icon button");
+ LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
+ UiObject2 assistantIcon = mLauncher.waitForLauncherObject(ASSISTANT_ICON_RES_ID);
+
+ LauncherInstrumentation.log("HomeQsb.launchAssistant before click "
+ + assistantIcon.getVisibleCenter() + " in "
+ + mLauncher.getVisibleBounds(assistantIcon));
+
+ mLauncher.clickLauncherObject(assistantIcon);
+
+ try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("clicked")) {
+ // assert Assistant App Launched
+ BySelector selector = By.pkg(ASSISTANT_APP_PACKAGE);
+ mLauncher.assertTrue(
+ "assistant app didn't start: (" + selector + ")",
+ mLauncher.getDevice().wait(Until.hasObject(selector),
+ LauncherInstrumentation.WAIT_TIME_MS)
+ );
+ return new LaunchedAppState(mLauncher);
+ }
+ }
+ }
+
+ /**
* Show search result page from tapping qsb.
*/
public SearchResultFromQsb showSearchResult() {
diff --git a/tests/tapl/com/android/launcher3/tapl/Launchable.java b/tests/tapl/com/android/launcher3/tapl/Launchable.java
index 33fea2d..3dcb437 100644
--- a/tests/tapl/com/android/launcher3/tapl/Launchable.java
+++ b/tests/tapl/com/android/launcher3/tapl/Launchable.java
@@ -16,7 +16,7 @@
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import android.graphics.Point;
import android.view.MotionEvent;
@@ -26,7 +26,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Ancestor for AppIcon and AppMenuItem.
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index 046d36b..a17651b 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -16,9 +16,10 @@
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
+import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
import android.graphics.Point;
import android.graphics.Rect;
@@ -27,7 +28,7 @@
import androidx.test.uiautomator.By;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Background state operations specific to when an app has been launched.
@@ -54,13 +55,23 @@
public Taskbar getTaskbar() {
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to get the taskbar")) {
- mLauncher.waitForLauncherObject("taskbar_view");
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID);
return new Taskbar(mLauncher);
}
}
/**
+ * Waits for the taskbar to be hidden, or fails.
+ */
+ public void assertTaskbarHidden() {
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "waiting for taskbar to be hidden")) {
+ mLauncher.waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ }
+ }
+
+ /**
* Returns the Taskbar in a visible state.
*
* The taskbar must already be hidden when calling this method.
@@ -71,7 +82,7 @@
try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
"want to show the taskbar")) {
- mLauncher.waitUntilLauncherObjectGone("taskbar_view");
+ mLauncher.waitUntilLauncherObjectGone(TASKBAR_RES_ID);
final long downTime = SystemClock.uptimeMillis();
final int unstashTargetY = mLauncher.getRealDisplaySize().y
@@ -85,7 +96,7 @@
LauncherInstrumentation.log("showTaskbar: sent down");
try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("pressed down")) {
- mLauncher.waitForLauncherObject("taskbar_view");
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID);
mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_UP, unstashTarget,
LauncherInstrumentation.GestureScope.OUTSIDE_WITH_PILFER);
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 5f92097..43766bf 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -23,7 +23,7 @@
import static com.android.launcher3.tapl.Folder.FOLDER_CONTENT_RES_ID;
import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import android.app.ActivityManager;
import android.app.Instrumentation;
@@ -65,10 +65,9 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.ResourceUtils;
-import com.android.launcher3.testing.TestInformationRequest;
-import com.android.launcher3.testing.TestProtocol;
-import com.android.systemui.shared.system.ContextUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
+import com.android.launcher3.testing.shared.TestInformationRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.systemui.shared.system.QuickStepContract;
import org.junit.Assert;
@@ -111,8 +110,11 @@
static final Pattern EVENT_TOUCH_UP_TIS = getTouchEventPatternTIS("ACTION_UP");
static final Pattern EVENT_TOUCH_CANCEL_TIS = getTouchEventPatternTIS("ACTION_CANCEL");
- static final Pattern EVENT_KEY_BACK_DOWN = getKeyEventPattern("ACTION_DOWN", "KEYCODE_BACK");
- static final Pattern EVENT_KEY_BACK_UP = getKeyEventPattern("ACTION_UP", "KEYCODE_BACK");
+ private static final Pattern EVENT_KEY_BACK_DOWN =
+ getKeyEventPattern("ACTION_DOWN", "KEYCODE_BACK");
+ private static final Pattern EVENT_KEY_BACK_UP =
+ getKeyEventPattern("ACTION_UP", "KEYCODE_BACK");
+ private static final Pattern EVENT_ON_BACK_INVOKED = Pattern.compile("onBackInvoked");
private final String mLauncherPackage;
private Boolean mIsLauncher3;
@@ -168,7 +170,8 @@
private static final String OVERVIEW_RES_ID = "overview_panel";
private static final String WIDGETS_RES_ID = "primary_widgets_list_view";
private static final String CONTEXT_MENU_RES_ID = "popup_container";
- private static final String TASKBAR_RES_ID = "taskbar_view";
+ static final String TASKBAR_RES_ID = "taskbar_view";
+ private static final String SPLIT_PLACEHOLDER_RES_ID = "split_placeholder";
public static final int WAIT_TIME_MS = 30000;
private static final String SYSTEMUI_PACKAGE = "com.android.systemui";
private static final String ANDROID_PACKAGE = "android";
@@ -262,7 +265,7 @@
SystemClock.sleep(5000);
} else {
try {
- final int userId = ContextUtils.getUserId(getContext());
+ final int userId = getContext().getUserId();
final String launcherPidCommand = "pidof " + pi.packageName;
final String initialPid = mDevice.executeShellCommand(launcherPidCommand)
.replaceAll("\\s", "");
@@ -724,6 +727,7 @@
waitUntilLauncherObjectGone(OVERVIEW_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
return waitForLauncherObject(WORKSPACE_RES_ID);
}
@@ -732,6 +736,7 @@
waitUntilLauncherObjectGone(APPS_RES_ID);
waitUntilLauncherObjectGone(OVERVIEW_RES_ID);
waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
return waitForLauncherObject(WIDGETS_RES_ID);
}
@@ -741,16 +746,26 @@
waitUntilLauncherObjectGone(OVERVIEW_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
return waitForLauncherObject(APPS_RES_ID);
}
- case OVERVIEW:
+ case OVERVIEW: {
+ waitUntilLauncherObjectGone(APPS_RES_ID);
+ waitUntilLauncherObjectGone(WORKSPACE_RES_ID);
+ waitUntilLauncherObjectGone(WIDGETS_RES_ID);
+ waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
+
+ return waitForLauncherObject(OVERVIEW_RES_ID);
+ }
case SPLIT_SCREEN_SELECT: {
waitUntilLauncherObjectGone(APPS_RES_ID);
waitUntilLauncherObjectGone(WORKSPACE_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitForLauncherObject(SPLIT_PLACEHOLDER_RES_ID);
return waitForLauncherObject(OVERVIEW_RES_ID);
}
case FALLBACK_OVERVIEW: {
@@ -758,6 +773,7 @@
waitUntilLauncherObjectGone(WORKSPACE_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
waitUntilLauncherObjectGone(TASKBAR_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
return waitForFallbackLauncherObject(OVERVIEW_RES_ID);
}
@@ -766,6 +782,7 @@
waitUntilLauncherObjectGone(APPS_RES_ID);
waitUntilLauncherObjectGone(OVERVIEW_RES_ID);
waitUntilLauncherObjectGone(WIDGETS_RES_ID);
+ waitUntilLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
if (isTablet() && !isFallbackOverview()) {
waitForLauncherObject(TASKBAR_RES_ID);
@@ -969,8 +986,12 @@
}
}
if (launcherVisible) {
- expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_KEY_BACK_DOWN);
- expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_KEY_BACK_UP);
+ if (getContext().getApplicationInfo().isOnBackInvokedCallbackEnabled()) {
+ expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_ON_BACK_INVOKED);
+ } else {
+ expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_KEY_BACK_DOWN);
+ expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_KEY_BACK_UP);
+ }
}
}
}
@@ -1109,6 +1130,16 @@
}
@Nullable
+ UiObject2 findObjectInContainer(UiObject2 container, String resName) {
+ try {
+ return container.findObject(getLauncherObjectSelector(resName));
+ } catch (StaleObjectException e) {
+ fail("The container disappeared from screen");
+ return null;
+ }
+ }
+
+ @Nullable
UiObject2 findObjectInContainer(UiObject2 container, BySelector selector) {
try {
return container.findObject(selector);
@@ -1730,6 +1761,15 @@
getTestInfo(TestProtocol.REQUEST_UNSTASH_TASKBAR_IF_STASHED);
}
+ /**
+ * Recreates the taskbar (outside of tests this is done for certain configuration changes).
+ * The expected behavior is that the taskbar retains its current state after being recreated.
+ * For example, if taskbar is currently stashed, it should still be stashed after recreating.
+ */
+ public void recreateTaskbar() {
+ getTestInfo(TestProtocol.REQUEST_RECREATE_TASKBAR);
+ }
+
public List<String> getHotseatIconNames() {
return getTestInfo(TestProtocol.REQUEST_HOTSEAT_ICON_NAMES)
.getStringArrayList(TestProtocol.TEST_INFO_RESPONSE_FIELD);
diff --git a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
index 710e3cd..672c6e0 100644
--- a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
+++ b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
@@ -15,13 +15,13 @@
*/
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_MAIN;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_PILFER;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_TIS;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_MAIN;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_PILFER;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_TIS;
import android.os.SystemClock;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
index 5710713..386deac 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
@@ -19,7 +19,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* View containing overview actions
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
index ac7424e..adc993d 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -20,11 +20,12 @@
import android.graphics.Rect;
+import androidx.annotation.NonNull;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.List;
import java.util.regex.Pattern;
@@ -67,6 +68,10 @@
return mTask.getVisibleCenter().x;
}
+ float getExactCenterX() {
+ return mTask.getVisibleBounds().exactCenterX();
+ }
+
/**
* Dismisses the task by swiping up.
*/
@@ -159,4 +164,24 @@
}
}
}
+
+ /** Taps the task menu. */
+ @NonNull
+ public OverviewTaskMenu tapMenu() {
+ try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
+ LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "want to tap the task menu")) {
+ mLauncher.clickLauncherObject(
+ mLauncher.waitForObjectInContainer(mTask.getParent(), "icon"));
+
+ try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
+ "tapped the task menu")) {
+ return new OverviewTaskMenu(mLauncher);
+ }
+ }
+ }
+
+ boolean isTaskSplit() {
+ return mLauncher.findObjectInContainer(mTask.getParent(), "bottomright_snapshot") != null;
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
new file mode 100644
index 0000000..8cdc8a0
--- /dev/null
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.tapl;
+
+import androidx.annotation.NonNull;
+import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.UiObject2;
+
+/** Represents the menu of an overview task. */
+public class OverviewTaskMenu {
+
+ private final LauncherInstrumentation mLauncher;
+ private final UiObject2 mMenu;
+
+ OverviewTaskMenu(LauncherInstrumentation launcher) {
+ mLauncher = launcher;
+
+ mMenu = mLauncher.waitForLauncherObject("menu_option_layout");
+ mLauncher.assertTrue("The overview task menus is not visible",
+ !mMenu.getVisibleBounds().isEmpty());
+ }
+
+ /** Taps the split menu item from the overview task menu. */
+ @NonNull
+ public SplitScreenSelect tapSplitMenuItem() {
+ try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
+ LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "tap split menu item")) {
+ mLauncher.clickLauncherObject(
+ mLauncher.findObjectInContainer(mMenu, By.textStartsWith("Split")));
+
+ try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
+ "tapped split menu item")) {
+ return new SplitScreenSelect(mLauncher);
+ }
+ }
+ }
+}
diff --git a/tests/tapl/com/android/launcher3/tapl/SplitScreenSelect.java b/tests/tapl/com/android/launcher3/tapl/SplitScreenSelect.java
index 3cf3ed6..9fa74e4 100644
--- a/tests/tapl/com/android/launcher3/tapl/SplitScreenSelect.java
+++ b/tests/tapl/com/android/launcher3/tapl/SplitScreenSelect.java
@@ -32,4 +32,10 @@
protected ContainerType getContainerType() {
return ContainerType.SPLIT_SCREEN_SELECT;
}
+
+ @Override
+ protected boolean isActionsViewVisible() {
+ // We don't show overview actions in split select state.
+ return false;
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Taskbar.java b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
index b5a08c3..0f9d5f5 100644
--- a/tests/tapl/com/android/launcher3/tapl/Taskbar.java
+++ b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
@@ -15,8 +15,9 @@
*/
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
import android.graphics.Point;
import android.os.SystemClock;
@@ -51,7 +52,7 @@
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to get a taskbar icon")) {
return new TaskbarAppIcon(mLauncher, mLauncher.waitForObjectInContainer(
- mLauncher.waitForLauncherObject("taskbar_view"),
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID),
AppIcon.getAppIconSelector(appName, mLauncher)));
}
}
@@ -67,7 +68,7 @@
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to hide the taskbar");
LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
- mLauncher.waitForLauncherObject("taskbar_view");
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID);
final long downTime = SystemClock.uptimeMillis();
Point stashTarget = new Point(
@@ -96,7 +97,7 @@
LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
mLauncher.clickLauncherObject(mLauncher.waitForObjectInContainer(
- mLauncher.waitForLauncherObject("taskbar_view"), getAllAppsButtonSelector()));
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID), getAllAppsButtonSelector()));
return new AllAppsFromTaskbar(mLauncher);
}
@@ -107,7 +108,7 @@
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to get all taskbar icons")) {
return mLauncher.waitForObjectsInContainer(
- mLauncher.waitForLauncherObject("taskbar_view"),
+ mLauncher.waitForLauncherObject(TASKBAR_RES_ID),
AppIcon.getAnyAppIconSelector())
.stream()
.map(UiObject2::getText)
diff --git a/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java b/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
index 69a8a08..424c58e 100644
--- a/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
+++ b/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
@@ -17,7 +17,7 @@
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/Widget.java b/tests/tapl/com/android/launcher3/tapl/Widget.java
index e1a09af..29eb46c 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widget.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widget.java
@@ -23,7 +23,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java
index 7fd68c0..96e2e3f 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widgets.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java
@@ -27,7 +27,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.Collection;
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 6044b06..2c9fdb3 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -18,8 +18,8 @@
import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SCROLLED;
-import static com.android.launcher3.testing.TestProtocol.ALL_APPS_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertTrue;
@@ -39,9 +39,9 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.HotseatCellCenterRequest;
-import com.android.launcher3.testing.TestProtocol;
-import com.android.launcher3.testing.WorkspaceCellCenterRequest;
+import com.android.launcher3.testing.shared.HotseatCellCenterRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.launcher3.testing.shared.WorkspaceCellCenterRequest;
import java.util.List;
import java.util.Map;
@@ -192,6 +192,12 @@
}
}
+ /** Returns the number of pages. */
+ public int getPageCount() {
+ final UiObject2 workspace = verifyActiveContainer();
+ return workspace.getChildCount();
+ }
+
/**
* Returns the number of pages that are visible on the screen simultaneously.
*/
@@ -469,7 +475,9 @@
// Since the destination can be on another page, we need to drag to the edge first
// until we reach the target page
while (targetDest.x > displayX || targetDest.x < 0) {
- int edgeX = targetDest.x > 0 ? displayX : 0;
+ // Don't drag all the way to the edge to prevent touch events from getting out of
+ //screen bounds.
+ int edgeX = targetDest.x > 0 ? displayX - 1 : 1;
Point screenEdge = new Point(edgeX, targetDest.y);
Point finalDragStart = dragStart;
executeAndWaitForPageScroll(launcher,