Merge "Don't crop task with RemoteAnimaionTarget#contentInsets" 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-ro/strings.xml b/go/quickstep/res/values-ro/strings.xml
index 0be8cce..3d6f0d8 100644
--- a/go/quickstep/res/values-ro/strings.xml
+++ b/go/quickstep/res/values-ro/strings.xml
@@ -1,20 +1,20 @@
<?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">"Trimiteți aplicația"</string>
- <string name="action_listen" msgid="2370304050784689486">"Ascultați"</string>
- <string name="action_translate" msgid="8028378961867277746">"Traduceți"</string>
+ <string name="app_share_drop_target_label" msgid="5804774105974539508">"Trimite aplicația"</string>
+ <string name="action_listen" msgid="2370304050784689486">"Ascultă"</string>
+ <string name="action_translate" msgid="8028378961867277746">"Tradu"</string>
<string name="action_search" msgid="6269564710943755464">"Lens"</string>
<string name="dialog_acknowledge" msgid="2804025517675853172">"OK"</string>
- <string name="dialog_cancel" msgid="6464336969134856366">"ANULAȚI"</string>
+ <string name="dialog_cancel" msgid="6464336969134856366">"ANULEAZĂ"</string>
<string name="dialog_settings" msgid="6564397136021186148">"SETĂRI"</string>
- <string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Traduceți sau ascultați textul de pe ecran"</string>
- <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informații precum textul de pe ecran, adresele web și capturile de ecran pot fi trimise la Google.\n\nCa să schimbați informațiile trimise, accesați "<b>"Setări > Aplicații > Aplicații prestabilite > Aplicația asistent digital"</b>"."</string>
- <string name="assistant_not_selected_title" msgid="5017072974603345228">"Alegeți un asistent pentru a folosi această funcție"</string>
- <string name="assistant_not_selected_text" msgid="3244613673884359276">"Pentru a asculta sau a traduce text de pe ecran, alegeți o aplicație asistent digital în Setări"</string>
- <string name="assistant_not_supported_title" msgid="1675788067597484142">"Schimbați asistentul pentru a folosi această funcție"</string>
- <string name="assistant_not_supported_text" msgid="1708031078549268884">"Pentru a asculta sau a traduce text de pe ecran, schimbați aplicația asistent digital în Setări"</string>
- <string name="tooltip_listen" msgid="7634466447860989102">"Atingeți aici pentru a asculta text de pe ecran"</string>
- <string name="tooltip_translate" msgid="4184845868901542567">"Atingeți aici pentru a traduce text de pe ecran"</string>
+ <string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Tradu sau ascultă textul de pe ecran"</string>
+ <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informații precum textul de pe ecran, adresele web și capturile de ecran pot fi trimise la Google.\n\nCa să schimbi informațiile trimise, accesează "<b>"Setări > Aplicații > Aplicații prestabilite > Aplicația asistent digital"</b>"."</string>
+ <string name="assistant_not_selected_title" msgid="5017072974603345228">"Alege un asistent pentru a folosi această funcție"</string>
+ <string name="assistant_not_selected_text" msgid="3244613673884359276">"Pentru a asculta sau a traduce text de pe ecran, alege o aplicație asistent digital în Setări"</string>
+ <string name="assistant_not_supported_title" msgid="1675788067597484142">"Schimbă asistentul pentru a folosi această funcție"</string>
+ <string name="assistant_not_supported_text" msgid="1708031078549268884">"Pentru a asculta sau a traduce text de pe ecran, schimbă aplicația asistent digital în Setări"</string>
+ <string name="tooltip_listen" msgid="7634466447860989102">"Atinge aici pentru a asculta text de pe ecran"</string>
+ <string name="tooltip_translate" msgid="4184845868901542567">"Atinge aici pentru a traduce text de pe ecran"</string>
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Aplicația nu poate fi distribuită"</string>
</resources>
diff --git a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
index e5f0295..84b907f 100644
--- a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
+++ b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
@@ -28,7 +28,7 @@
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 java.util.concurrent.ExecutionException;
diff --git a/quickstep/res/layout/activity_allset.xml b/quickstep/res/layout/activity_allset.xml
index 0cae733..56e1d16 100644
--- a/quickstep/res/layout/activity_allset.xml
+++ b/quickstep/res/layout/activity_allset.xml
@@ -26,7 +26,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content_view"
- android:fitsSystemWindows="true">
+ android:fitsSystemWindows="false">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animated_background"
diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index 3b1d217..94388b4 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -45,8 +45,8 @@
android:id="@+id/start_contextual_buttons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+ android:paddingStart="@dimen/taskbar_contextual_button_padding"
+ android:paddingEnd="@dimen/taskbar_contextual_button_padding"
android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="start"/>
@@ -56,9 +56,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
- android:layout_marginEnd="@dimen/taskbar_contextual_button_margin"
android:gravity="center_vertical"
android:layout_gravity="end"/>
@@ -66,8 +63,6 @@
android:id="@+id/end_contextual_buttons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="end"/>
diff --git a/quickstep/res/values-land/dimens.xml b/quickstep/res/values-land/dimens.xml
index 732f511..8368069 100644
--- a/quickstep/res/values-land/dimens.xml
+++ b/quickstep/res/values-land/dimens.xml
@@ -74,4 +74,10 @@
<!-- Gesture Tutorial mock taskbar -->
<dimen name="gesture_tutorial_taskbar_padding_start_end">218dp</dimen>
+
+ <!-- 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_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-ro/strings.xml b/quickstep/res/values-ro/strings.xml
index fb661f2..ba4badf 100644
--- a/quickstep/res/values-ro/strings.xml
+++ b/quickstep/res/values-ro/strings.xml
@@ -19,11 +19,11 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="recent_task_option_pin" msgid="7929860679018978258">"Fixați"</string>
+ <string name="recent_task_option_pin" msgid="7929860679018978258">"Fixează"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"Formă liberă"</string>
<string name="recents_empty_message" msgid="7040467240571714191">"Niciun element recent"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"Setări de utilizare a aplicației"</string>
- <string name="recents_clear_all" msgid="5328176793634888831">"Ștergeți tot"</string>
+ <string name="recents_clear_all" msgid="5328176793634888831">"Șterge tot"</string>
<string name="accessibility_recent_apps" msgid="4058661986695117371">"Aplicații recente"</string>
<string name="task_view_closed" msgid="9170038230110856166">"Activitatea s-a încheiat"</string>
<string name="task_contents_description_with_remaining_time" msgid="4479688746574672685">"<xliff:g id="TASK_DESCRIPTION">%1$s</xliff:g>, <xliff:g id="REMAINING_TIME">%2$s</xliff:g>"</string>
@@ -31,75 +31,75 @@
<string name="time_left_for_app" msgid="3111996412933644358">"Au mai rămas <xliff:g id="TIME">%1$s</xliff:g> astăzi"</string>
<string name="title_app_suggestions" msgid="4185902664111965088">"Sugestii de aplicații"</string>
<string name="all_apps_prediction_tip" msgid="2672336544844936186">"Aplicațiile estimate"</string>
- <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"Primiți sugestii de aplicații în rândul de jos al ecranului de pornire"</string>
- <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"Primiți sugestii de aplicații în rândul de preferințe al ecranului de pornire"</string>
- <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"Accesați 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">"Accesați cu ușurință cele mai folosite aplicații direct din ecranul de pornire. Sugestiile se vor schimba în funcție de rutina dvs. 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">"Accesați 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">"Primiți sugestii de aplicații"</string>
+ <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"Primește sugestii de aplicații în rândul de jos al ecranului de pornire"</string>
+ <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>
<string name="hotseat_auto_enrolled" msgid="522100018967146807">"Cele mai folosite aplicații apar aici și se modifică în funcție de rutine"</string>
- <string name="hotseat_tip_no_empty_slots" msgid="1325212677738179185">"Trageți aplicații din rândul de jos pentru a primi sugestii de aplicații"</string>
+ <string name="hotseat_tip_no_empty_slots" msgid="1325212677738179185">"Trage aplicații din rândul de jos pentru a primi sugestii de aplicații"</string>
<string name="hotseat_tip_gaps_filled" msgid="3035673010274223538">"Sugestiile de aplicații sunt adăugate în spațiile goale"</string>
<string name="hotsaet_tip_prediction_enabled" msgid="2233554377501347650">"Sugestiile de aplicații au fost activate"</string>
<string name="hotsaet_tip_prediction_disabled" msgid="1506426298884658491">"Sugestiile de aplicații au fost dezactivate"</string>
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Aplicația estimată: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
- <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"Glisați dinspre marginea dreaptă îndepărtată sau dinspre marginea stângă îndepărtată."</string>
- <string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"Glisați dinspre marginea dreaptă sau stângă spre mijlocul ecranului și eliberați."</string>
- <string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Ați învățat cum să glisați dinspre dreapta pentru a reveni. În continuare, aflați cum să comutați aplicațiile."</string>
- <string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"Ați finalizat gestul „înapoi”."</string>
- <string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"Nu glisați prea aproape de partea de jos a ecranului."</string>
- <string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"Schimbați sensibilitatea gestului „Înapoi” accesând Setările"</string>
- <string name="back_gesture_intro_title" msgid="19551256430224428">"Glisați pentru a reveni"</string>
- <string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"Pentru a reveni la ultimul ecran, glisați de la marginea stângă sau dreaptă spre mijlocul ecranului."</string>
- <string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Pentru a reveni la ultimul ecran, glisați cu două degete dinspre marginea stângă sau dreaptă spre mijlocul ecranului."</string>
- <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"Glisați în sus dinspre marginea de jos a ecranului."</string>
- <string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"Nu întrerupeți gestul înainte de a elibera."</string>
- <string name="home_gesture_feedback_wrong_swipe_direction" msgid="6993979358080825438">"Glisați direct în sus."</string>
- <string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"Ați finalizat gestul „accesați ecranul de pornire”. În continuare, aflați cum să reveniți."</string>
- <string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"Ați finalizat gestul „accesați ecranul de pornire”."</string>
- <string name="home_gesture_intro_title" msgid="836590312858441830">"Glisați pentru a accesa ecranul de pornire"</string>
- <string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Glisați în sus din partea de jos a ecranului. Cu acest gest accesați întotdeauna ecranul de pornire."</string>
- <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Glisați în sus cu 2 degete din partea de jos. Cu acest gest accesați întotdeauna ecranul de pornire."</string>
- <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"Glisați în sus dinspre marginea de jos a ecranului."</string>
- <string name="overview_gesture_feedback_home_detected" msgid="1411130969354020489">"Încercați să țineți fereastra mai mult înainte s-o eliberați."</string>
- <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="6725820500906747925">"Glisați direct în sus, apoi întrerupeți."</string>
- <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Ați învățat cum să folosiți gesturi. Pentru a dezactiva gesturile, accesați Setările."</string>
- <string name="overview_gesture_feedback_complete_without_follow_up" msgid="3199486203448379152">"Ați finalizat gestul „comutați între aplicații”."</string>
- <string name="overview_gesture_intro_title" msgid="2902054412868489378">"Glisați pentru a comuta între aplicații"</string>
- <string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Ca să comutați între aplicații, glisați în sus din partea de jos a ecranului, așteptați și eliberați."</string>
- <string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Ca să comutați între aplicații, glisați în sus cu 2 degete din partea de jos, așteptați și eliberați"</string>
+ <string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"Glisează dinspre marginea dreaptă îndepărtată sau dinspre marginea stângă îndepărtată."</string>
+ <string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"Glisează dinspre marginea dreaptă sau stângă spre mijlocul ecranului și eliberează."</string>
+ <string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Ai învățat cum să glisezi din dreapta pentru a reveni. Acum află cum să comuți aplicațiile."</string>
+ <string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"Ai finalizat gestul „înapoi”."</string>
+ <string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"Nu glisa prea aproape de partea de jos a ecranului."</string>
+ <string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"Schimbă sensibilitatea gestului „Înapoi” accesând Setările"</string>
+ <string name="back_gesture_intro_title" msgid="19551256430224428">"Glisează pentru a reveni"</string>
+ <string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"Pentru a reveni la ultimul ecran, glisează de la marginea stângă sau dreaptă spre mijlocul ecranului."</string>
+ <string name="back_gesture_spoken_intro_subtitle" msgid="2162043199263088592">"Pentru a reveni la ultimul ecran, glisează cu două degete dinspre marginea stângă sau dreaptă spre mijlocul ecranului."</string>
+ <string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"Glisează în sus dinspre marginea de jos a ecranului."</string>
+ <string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"Nu întrerupe gestul înainte de a elibera."</string>
+ <string name="home_gesture_feedback_wrong_swipe_direction" msgid="6993979358080825438">"Glisează direct în sus."</string>
+ <string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"Ai finalizat gestul „accesează ecranul de pornire”. Acum află cum să revii."</string>
+ <string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"Ai finalizat gestul „accesează ecranul de pornire”."</string>
+ <string name="home_gesture_intro_title" msgid="836590312858441830">"Glisează pentru a accesa ecranul de pornire"</string>
+ <string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"Glisează în sus din partea de jos a ecranului. Cu acest gest accesezi mereu ecranul de pornire."</string>
+ <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"Glisează în sus cu două degete din partea de jos. Cu acest gest accesezi mereu ecranul de pornire."</string>
+ <string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"Glisează în sus dinspre marginea de jos a ecranului."</string>
+ <string name="overview_gesture_feedback_home_detected" msgid="1411130969354020489">"Încearcă să ții fereastra mai mult înainte s-o eliberezi."</string>
+ <string name="overview_gesture_feedback_wrong_swipe_direction" msgid="6725820500906747925">"Glisează direct în sus, apoi întrerupe."</string>
+ <string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"Ai învățat să folosești gesturi. Pentru a dezactiva gesturile, accesează Setările."</string>
+ <string name="overview_gesture_feedback_complete_without_follow_up" msgid="3199486203448379152">"Ai finalizat gestul „comută între aplicații”."</string>
+ <string name="overview_gesture_intro_title" msgid="2902054412868489378">"Glisează pentru a comuta între aplicații"</string>
+ <string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"Ca să comuți între aplicații, glisează în sus din partea de jos a ecranului, așteaptă și eliberează."</string>
+ <string name="overview_gesture_spoken_intro_subtitle" msgid="3853371838260201751">"Ca să comuți între aplicații, glisează cu două degete de jos în sus, așteaptă și eliberează"</string>
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"Gata"</string>
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"Gata"</string>
<string name="gesture_tutorial_action_button_label_settings" msgid="2923621047916486604">"Setări"</string>
- <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Reîncercați"</string>
+ <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Reîncearcă"</string>
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"Bravo!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorialul <xliff:g id="CURRENT">%1$d</xliff:g> / <xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"Gata!"</string>
- <string name="allset_hint" msgid="2384632994739392447">"Glisați în sus pentru a accesa ecranul de pornire"</string>
- <string name="allset_description" msgid="6350320429953234580">"Sunteți gata să folosiți telefonul"</string>
- <string name="allset_description_tablet" msgid="7332070270570039247">"Sunteți gata să folosiți tableta"</string>
+ <string name="allset_hint" msgid="2384632994739392447">"Glisează în sus pentru a accesa ecranul de pornire"</string>
+ <string name="allset_description" msgid="6350320429953234580">"Ești gata să folosești telefonul"</string>
+ <string name="allset_description_tablet" msgid="7332070270570039247">"Ești gata să folosești tableta"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Setările de navigare ale sistemului"</annotation></string>
- <string name="action_share" msgid="2648470652637092375">"Distribuiți"</string>
+ <string name="action_share" msgid="2648470652637092375">"Distribuie"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Captură de ecran"</string>
<string name="action_split" msgid="2098009717623550676">"Împărțit"</string>
- <string name="toast_split_select_app" msgid="5453865907322018352">"Atingeți altă aplicație pentru a folosi ecranul împărțit"</string>
+ <string name="toast_split_select_app" msgid="5453865907322018352">"Atinge altă aplicație pentru ecranul împărțit"</string>
<string name="toast_split_app_unsupported" msgid="3271526028981899666">"Aplicația nu acceptă ecranul împărțit."</string>
- <string name="blocked_by_policy" msgid="2071401072261365546">"Această acțiune nu este permisă de aplicație sau de organizația dvs."</string>
- <string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Omiteți tutorialul de navigare?"</string>
- <string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Îl puteți găsi mai târziu în aplicația <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Anulați"</string>
- <string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omiteți"</string>
- <string name="accessibility_rotate_button" msgid="4771825231336502943">"Rotiți ecranul"</string>
+ <string name="blocked_by_policy" msgid="2071401072261365546">"Această acțiune nu este permisă de aplicație sau de organizația ta"</string>
+ <string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Omiți tutorialul de navigare?"</string>
+ <string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"Îl poți găsi mai târziu în aplicația <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"Anulează"</string>
+ <string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"Omite"</string>
+ <string name="accessibility_rotate_button" msgid="4771825231336502943">"Rotește ecranul"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Panoul cu informații despre bara de activități s-a afișat"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Panoul cu informații despre bara de activități s-a închis"</string>
- <string name="taskbar_edu_switch_apps" msgid="6942863327845784813">"Folosiți bara de activități ca să comutați între aplicații"</string>
- <string name="taskbar_edu_splitscreen" msgid="2663361731630346489">"Trageți în lateral ca să folosiți două aplicații deodată"</string>
- <string name="taskbar_edu_stashing" msgid="5212374387411764031">"Atingeți lung oricând pentru a ascunde bara de activități"</string>
+ <string name="taskbar_edu_switch_apps" msgid="6942863327845784813">"Folosește bara de activități ca să comuți între aplicații"</string>
+ <string name="taskbar_edu_splitscreen" msgid="2663361731630346489">"Trage în lateral ca să folosești două aplicații deodată"</string>
+ <string name="taskbar_edu_stashing" msgid="5212374387411764031">"Atinge lung oricând pentru a ascunde bara de activități"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Înainte"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Înapoi"</string>
- <string name="taskbar_edu_close" msgid="887022990168191073">"Închideți"</string>
+ <string name="taskbar_edu_close" msgid="887022990168191073">"Închide"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"Gata"</string>
<string name="taskbar_button_home" msgid="2151398979630664652">"Ecran de pornire"</string>
<string name="taskbar_button_a11y" msgid="5241161324875094465">"Accesibilitate"</string>
@@ -108,6 +108,6 @@
<string name="taskbar_button_recents" msgid="7273376136216613134">"Recente"</string>
<string name="taskbar_button_notifications" msgid="7471740351507357318">"Notificări"</string>
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"Setări rapide"</string>
- <string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mutați în stânga sus"</string>
- <string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mutați în dreapta jos"</string>
+ <string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Mută în stânga sus"</string>
+ <string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Mută în dreapta jos"</string>
</resources>
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/dimens.xml b/quickstep/res/values/dimens.xml
index fa4eaed..cfe602e 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. -->
@@ -250,14 +255,15 @@
<dimen name="taskbar_icon_touch_size">48dp</dimen>
<dimen name="taskbar_icon_drag_icon_size">54dp</dimen>
<dimen name="taskbar_folder_margin">16dp</dimen>
- <dimen name="taskbar_nav_buttons_spacing">16dp</dimen>
+ <dimen name="taskbar_contextual_button_padding">16dp</dimen>
<dimen name="taskbar_contextual_padding_top">8dp</dimen>
<dimen name="taskbar_nav_buttons_size">44dp</dimen>
- <dimen name="taskbar_contextual_button_margin">40dp</dimen>
- <dimen name="taskbar_hotseat_nav_spacing">42dp</dimen>
+ <dimen name="taskbar_contextual_button_margin">47dp</dimen>
+ <dimen name="taskbar_hotseat_nav_spacing">24dp</dimen>
<dimen name="taskbar_contextual_buttons_size">35dp</dimen>
<dimen name="taskbar_stashed_size">24dp</dimen>
<dimen name="taskbar_stashed_handle_width">220dp</dimen>
+ <dimen name="taskbar_stashed_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>
@@ -268,4 +274,12 @@
<dimen name="taskbar_back_button_left_margin_kids">48dp</dimen>
<dimen name="taskbar_home_button_left_margin_kids">48dp</dimen>
<dimen name="taskbar_icon_size_kids">32dp</dimen>
+
+ <!-- Taskbar 3 button spacing -->
+ <dimen name="taskbar_button_space_inbetween">24dp</dimen>
+ <dimen name="taskbar_button_margin_5_5">26dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">26dp</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>
</resources>
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index ec497ef..e21dcba 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -337,7 +337,7 @@
new SplitSelectStateController(this, mHandler, getStateManager(),
getDepthController());
overviewPanel.init(mActionsView, controller);
- mActionsView.updateDimension(getDeviceProfile());
+ mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));
mAppTransitionManager = new QuickstepTransitionManager(this);
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index c08eae3..c089d1b 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -43,7 +43,6 @@
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.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
@@ -77,7 +76,6 @@
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.SurfaceControl;
@@ -100,6 +98,7 @@
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.util.ActivityOptionsWrapper;
import com.android.launcher3.util.DynamicResource;
@@ -136,7 +135,6 @@
import com.android.wm.shell.startingsurface.IStartingWindowListener;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
@@ -622,28 +620,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,7 +631,6 @@
anim.play(scaleAnim);
return () -> {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onEnd setFreezeVisibility=false");
overview.setFreezeViewVisibility(false);
SCALE_PROPERTY.set(overview, 1f);
mLauncher.getStateManager().reapplyState();
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..3c76e8e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
@@ -32,11 +32,14 @@
@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);
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 6df31e5..62a11d4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -354,6 +354,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 17da0d9..b01168d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -46,6 +46,7 @@
import android.content.pm.ActivityInfo.Config;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Region;
@@ -67,6 +68,7 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -94,7 +96,7 @@
private final Rect mTempRect = new Rect();
- private static final int FLAG_SWITCHER_SUPPORTED = 1 << 0;
+ private static final int FLAG_SWITCHER_SHOWING = 1 << 0;
private static final int FLAG_IME_VISIBLE = 1 << 1;
private static final int FLAG_ROTATION_BUTTON_VISIBLE = 1 << 2;
private static final int FLAG_A11Y_VISIBLE = 1 << 3;
@@ -189,7 +191,7 @@
isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
- flags -> ((flags & FLAG_SWITCHER_SUPPORTED) != 0)
+ flags -> ((flags & FLAG_SWITCHER_SHOWING) != 0)
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)));
}
@@ -228,6 +230,7 @@
if (alwaysShowButtons) {
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);
+ updateButtonLayoutSpacing();
if (isInSetup) {
// Since setup wizard only has back button enabled, it looks strange to be
@@ -451,7 +454,7 @@
// TODO(b/202218289) we're getting IME as not visible on lockscreen from system
updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
- updateStateForFlag(FLAG_SWITCHER_SUPPORTED, isImeSwitcherShowing);
+ updateStateForFlag(FLAG_SWITCHER_SHOWING, isImeSwitcherShowing);
updateStateForFlag(FLAG_A11Y_VISIBLE, a11yVisible);
updateStateForFlag(FLAG_DISABLE_HOME, isHomeDisabled);
updateStateForFlag(FLAG_DISABLE_RECENTS, isRecentsDisabled);
@@ -465,6 +468,7 @@
boolean a11yLongClickable =
(sysUiStateFlags & SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE) != 0;
mA11yButton.setLongClickable(a11yLongClickable);
+ updateButtonLayoutSpacing();
}
}
@@ -480,6 +484,13 @@
}
/**
+ * @return {@code true} if A11y is showing in 3 button nav taskbar
+ */
+ private boolean isContextualButtonShowing() {
+ return mContext.isThreeButtonNav() && (mState & FLAG_A11Y_VISIBLE) != 0;
+ }
+
+ /**
* Should be called when we need to show back button for bouncer
*/
public void setBackForBouncer(boolean isBouncerVisible) {
@@ -508,7 +519,7 @@
* Returns true if IME switcher is visible
*/
public boolean isImeSwitcherVisible() {
- return (mState & FLAG_SWITCHER_SUPPORTED) != 0;
+ return (mState & FLAG_SWITCHER_SHOWING) != 0;
}
/**
@@ -662,6 +673,46 @@
if (mFloatingRotationButton != null) {
mFloatingRotationButton.onConfigurationChanged(configChanges);
}
+ updateButtonLayoutSpacing();
+ }
+
+ /** Adds the correct spacing to 3 button nav container. No-op if using gesture nav */
+ private void updateButtonLayoutSpacing() {
+ if (!mContext.isThreeButtonNav()) {
+ 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();
+ 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
+ // contextual button to be showing - if not, move the nav buttons over a smidge
+ if (isContextualButtonShowing() && navMarginEnd < contextualWidth) {
+ // Additional spacing, eat up half of space between last icon and nav button
+ navMarginEnd += res.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing) / 2;
+ }
+ navButtonParams.setMarginEnd(navMarginEnd);
+ mNavButtonContainer.setLayoutParams(navButtonParams);
+
+ // Add the spaces in between the nav buttons
+ int spaceInBetween = res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween);
+ for (int i = 0; i < mNavButtonContainer.getChildCount(); i++) {
+ View navButton = mNavButtonContainer.getChildAt(i);
+ LinearLayout.LayoutParams buttonLayoutParams =
+ (LinearLayout.LayoutParams) navButton.getLayoutParams();
+ 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);
+ }
+ }
}
public void onDestroy() {
@@ -734,22 +785,17 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "NavbarButtonsViewController:");
- pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
- pw.println(String.format(
- "%s\tmLightIconColor=0x%s", prefix, Integer.toHexString(mLightIconColor)));
- pw.println(String.format(
- "%s\tmDarkIconColor=0x%s", prefix, Integer.toHexString(mDarkIconColor)));
- pw.println(String.format(
- "%s\tmFloatingRotationButtonBounds=%s", prefix, mFloatingRotationButtonBounds));
- pw.println(String.format(
- "%s\tmSysuiStateFlags=%s",
- prefix,
- QuickStepContract.getSystemUiStateString(mSysuiStateFlags)));
+ pw.println(prefix + "\tmState=" + getStateString(mState));
+ pw.println(prefix + "\tmLightIconColor=" + Integer.toHexString(mLightIconColor));
+ pw.println(prefix + "\tmDarkIconColor=" + Integer.toHexString(mDarkIconColor));
+ pw.println(prefix + "\tmFloatingRotationButtonBounds=" + mFloatingRotationButtonBounds);
+ pw.println(prefix + "\tmSysuiStateFlags=" + QuickStepContract.getSystemUiStateString(
+ mSysuiStateFlags));
}
private static String getStateString(int flags) {
StringJoiner str = new StringJoiner("|");
- appendFlag(str, flags, FLAG_SWITCHER_SUPPORTED, "FLAG_SWITCHER_SUPPORTED");
+ appendFlag(str, flags, FLAG_SWITCHER_SHOWING, "FLAG_SWITCHER_SHOWING");
appendFlag(str, flags, FLAG_IME_VISIBLE, "FLAG_IME_VISIBLE");
appendFlag(str, flags, FLAG_ROTATION_BUTTON_VISIBLE, "FLAG_ROTATION_BUTTON_VISIBLE");
appendFlag(str, flags, FLAG_A11Y_VISIBLE, "FLAG_A11Y_VISIBLE");
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index f472427..0652463 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.taskbar;
+import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -25,6 +27,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 +58,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 +88,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 (isPhoneMode(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(
+ isPhoneMode(deviceProfile) ? 1 : 0);
mTaskbarStashedHandleHintScale.updateValue(1f);
final int stashedTaskbarHeight = mControllers.taskbarStashController.getStashedHeight();
@@ -135,10 +135,33 @@
view.setPivotX(stashedCenterX);
view.setPivotY(stashedCenterY);
});
+ initRegionSampler();
+ if (isPhoneMode(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;
}
public MultiValueAlpha getStashedHandleAlpha() {
@@ -209,10 +232,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "StashedHandleViewController:");
- pw.println(String.format(
- "%s\tisStashedHandleVisible=%b", prefix, isStashedHandleVisible()));
- pw.println(String.format("%s\tmStashedHandleWidth=%dpx", prefix, mStashedHandleWidth));
- pw.println(String.format("%s\tmStashedHandleHeight=%dpx", prefix, mStashedHandleHeight));
+ pw.println(prefix + "\tisStashedHandleVisible=" + isStashedHandleVisible());
+ pw.println(prefix + "\tmStashedHandleWidth=" + mStashedHandleWidth);
+ pw.println(prefix + "\tmStashedHandleHeight=" + mStashedHandleHeight);
mRegionSamplingHelper.dump(prefix, pw);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 6b12e9c..f5fe77a 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,7 +77,7 @@
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;
@@ -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
@@ -456,7 +469,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 +607,9 @@
* Returns the default height of the window, including the static corner radii above taskbar.
*/
public int getDefaultTaskbarWindowHeight() {
+ if (FLAG_HIDE_NAVBAR_WINDOW && mDeviceProfile.isPhone) {
+ return getResources().getDimensionPixelSize(R.dimen.taskbar_stashed_size);
+ }
return mDeviceProfile.taskbarSize + Math.max(getLeftCornerRadius(), getRightCornerRadius());
}
@@ -622,7 +641,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}. */
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
index c5615c7..3cf9c99 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
@@ -71,8 +71,7 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarAutohideSuspendController:");
- pw.println(String.format(
- "%s\tmAutohideSuspendFlags=%s", prefix, getStateString(mAutohideSuspendFlags)));
+ pw.println(prefix + "\tmAutohideSuspendFlags=" + getStateString(mAutohideSuspendFlags));
}
private static String getStateString(int flags) {
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 04fcc44..97029fe 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -66,7 +66,7 @@
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.systemui.shared.recents.model.Task;
@@ -559,13 +559,11 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarDragController:");
- pw.println(String.format("%s\tmDragIconSize=%dpx", prefix, mDragIconSize));
- pw.println(String.format("%s\tmTempXY=%s", prefix, Arrays.toString(mTempXY)));
- pw.println(String.format("%s\tmRegistrationX=%d", prefix, mRegistrationX));
- pw.println(String.format("%s\tmRegistrationY=%d", prefix, mRegistrationY));
- pw.println(String.format(
- "%s\tmIsSystemDragInProgress=%b", prefix, mIsSystemDragInProgress));
- pw.println(String.format(
- "%s\tisInternalDragInProgess=%b", prefix, super.isDragging()));
+ pw.println(prefix + "\tmDragIconSize=" + mDragIconSize);
+ pw.println(prefix + "\tmTempXY=" + Arrays.toString(mTempXY));
+ pw.println(prefix + "\tmRegistrationX=" + mRegistrationX);
+ pw.println(prefix + "\tmRegistrationY=" + mRegistrationY);
+ pw.println(prefix + "\tmIsSystemDragInProgress=" + mIsSystemDragInProgress);
+ pw.println(prefix + "\tisInternalDragInProgess=" + super.isDragging());
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
index c1a6185..ee17ad0 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
@@ -30,7 +30,7 @@
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;
@@ -86,8 +86,14 @@
}
}
+ protected void onDestroy(boolean forceDestroy) {
+ if (forceDestroy) {
+ ViewTreeObserverWrapper.removeOnComputeInsetsListener(mTaskbarInsetsComputer);
+ }
+ }
+
protected void onDestroy() {
- ViewTreeObserverWrapper.removeOnComputeInsetsListener(mTaskbarInsetsComputer);
+ onDestroy(!TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW);
}
@Override
@@ -101,7 +107,7 @@
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 99c59a8..77ef83c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -144,10 +144,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarDragLayerController:");
- pw.println(String.format("%s\tmBgOffset=%.2f", prefix, mBgOffset.value));
- pw.println(String.format("%s\tmFolderMargin=%dpx", prefix, mFolderMargin));
- pw.println(String.format(
- "%s\tmLastSetBackgroundAlpha=%.2f", prefix, mLastSetBackgroundAlpha));
+ pw.println(prefix + "\tmBgOffset=" + mBgOffset.value);
+ pw.println(prefix + "\tmFolderMargin=" + mFolderMargin);
+ pw.println(prefix + "\tmLastSetBackgroundAlpha=" + mLastSetBackgroundAlpha);
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
index e29b14b..32a3c10 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
@@ -191,12 +191,10 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarEduController:");
- pw.println(String.format("%s\tisShowingEdu=%b", prefix, mTaskbarEduView != null));
- pw.println(String.format("%s\tmWaveAnimTranslationY=%.2f", prefix, mWaveAnimTranslationY));
- pw.println(String.format(
- "%s\tmWaveAnimTranslationYReturnOvershoot=%.2f",
- prefix,
- mWaveAnimTranslationYReturnOvershoot));
+ pw.println(prefix + "\tisShowingEdu=" + (mTaskbarEduView != null));
+ pw.println(prefix + "\tmWaveAnimTranslationY=" + mWaveAnimTranslationY);
+ pw.println(prefix + "\tmWaveAnimTranslationYReturnOvershoot="
+ + mWaveAnimTranslationYReturnOvershoot);
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
index 56648ea..0808fab 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
@@ -111,11 +111,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarKeyguardController:");
- pw.println(String.format(
- "%s\tmKeyguardSysuiFlags=%s",
- prefix,
- QuickStepContract.getSystemUiStateString(mKeyguardSysuiFlags)));
- pw.println(String.format("%s\tmBouncerShowing=%b", prefix, mBouncerShowing));
- pw.println(String.format("%s\tmIsScreenOff=%b", prefix, mIsScreenOff));
+ pw.println(prefix + "\tmKeyguardSysuiFlags=" + QuickStepContract.getSystemUiStateString(
+ mKeyguardSysuiFlags));
+ pw.println(prefix + "\tmBouncerShowing=" + mBouncerShowing);
+ pw.println(prefix + "\tmIsScreenOff=" + mIsScreenOff);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index ff11f67..85e76b2 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -35,6 +35,7 @@
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.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
@@ -367,11 +368,14 @@
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
boolean committed) {
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
- float toAlignment = mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) ? 1 : 0;
+ boolean willStashVisually =
+ isInStashedState && mControllers.taskbarStashController.supportsVisualStashing();
+ float toAlignment =
+ mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) && !willStashVisually ? 1 : 0;
- TaskbarStashController controller = mControllers.taskbarStashController;
- controller.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
- Animator stashAnimator = controller.applyStateWithoutStart(duration);
+ TaskbarStashController stashController = mControllers.taskbarStashController;
+ stashController.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
+ Animator stashAnimator = stashController.applyStateWithoutStart(duration);
if (stashAnimator != null) {
stashAnimator.addListener(new AnimatorListenerAdapter() {
@Override
@@ -391,9 +395,13 @@
});
animatorSet.play(stashAnimator);
}
-
- // If we're already animating to the value, just leave it be instead of restarting it.
+ if (mIconAlignmentForLauncherState.value == toAlignment) {
+ // Already at expected value, but make sure we run the callback at the end.
+ animatorSet.addListener(AnimatorListeners.forEndCallback(
+ this::onIconAlignmentRatioChangedForStateTransition));
+ }
if (!mIconAlignmentForLauncherState.isAnimatingToValue(toAlignment)) {
+ // If we're already animating to the value, just leave it be instead of restarting it.
mIconAlignmentForLauncherState.finishAnimation();
animatorSet.play(mIconAlignmentForLauncherState.animateToValue(toAlignment)
.setDuration(duration));
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 06262c0..353bf89 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -30,6 +30,7 @@
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;
@@ -58,6 +59,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);
@@ -147,7 +151,7 @@
} else {
// Config change might be handled without re-creating the taskbar
if (mTaskbarActivityContext != null) {
- if (dp != null && dp.isTaskbarPresent) {
+ if (dp != null && isTaskbarPresent(dp)) {
mTaskbarActivityContext.updateDeviceProfile(dp);
}
mTaskbarActivityContext.onConfigurationChanged(configDiff);
@@ -159,7 +163,8 @@
@Override
public void onLowMemory() { }
};
- mShutdownReceiver = new SimpleBroadcastReceiver(i -> destroyExistingTaskbar());
+ mShutdownReceiver = new SimpleBroadcastReceiver(i ->
+ destroyExistingTaskbar());
mDispInfoChangeListener = (context, info, flags) -> {
if ((flags & CHANGE_FLAGS) != 0) {
recreateTaskbar();
@@ -179,7 +184,9 @@
private void destroyExistingTaskbar() {
if (mTaskbarActivityContext != null) {
mTaskbarActivityContext.onDestroy();
- mTaskbarActivityContext = null;
+ if (!FLAG_HIDE_NAVBAR_WINDOW) {
+ mTaskbarActivityContext = null;
+ }
}
}
@@ -260,24 +267,32 @@
}
}
+ /**
+ * 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.
+ */
private 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);
+ }
mTaskbarActivityContext.init(mSharedState);
+
if (mActivity != null) {
mTaskbarActivityContext.setUIController(
createTaskbarUIControllerForActivity(mActivity));
@@ -301,6 +316,18 @@
}
}
+ /**
+ * @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;
+ }
+
+ 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 3392b6b..a395548 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
@@ -18,7 +18,6 @@
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS;
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_KEY;
-import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_LONGPRESS;
@@ -28,6 +27,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
+import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
import android.os.Bundle;
@@ -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;
@@ -72,9 +72,8 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarNavButtonController:");
- pw.println(String.format(
- "%s\tmLastScreenPinLongPress=%dms", prefix, mLastScreenPinLongPress));
- pw.println(String.format("%s\tmScreenPinned=%b", prefix, mScreenPinned));
+ pw.println(prefix + "\tmLastScreenPinLongPress=" + mLastScreenPinLongPress);
+ pw.println(prefix + "\tmScreenPinned=" + mScreenPinned);
}
@Retention(RetentionPolicy.SOURCE)
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/TaskbarScrimViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
index 58ace17..c3b0f57 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
@@ -98,6 +98,6 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarScrimViewController:");
- pw.println(String.format("%s\tmScrimAlpha.value=%.2f", prefix, mScrimAlpha.value));
+ pw.println(prefix + "\tmScrimAlpha.value=" + mScrimAlpha.value);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 2b8fdd1..114ab4e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW;
+import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
import static com.android.launcher3.taskbar.Utilities.appendFlag;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
@@ -30,6 +31,7 @@
import android.animation.AnimatorSet;
import android.annotation.Nullable;
import android.content.SharedPreferences;
+import android.content.res.Resources;
import android.util.Log;
import android.view.View;
import android.view.ViewConfiguration;
@@ -38,9 +40,10 @@
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;
@@ -69,6 +72,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 +80,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;
@@ -166,15 +171,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(mActivity.getDeviceProfile())) {
+ // 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) {
@@ -202,6 +217,7 @@
updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, isInSetup);
updateStateForFlag(FLAG_IN_SETUP, isInSetup);
+ updateStateForFlag(FLAG_STASHED_SMALL_SCREEN, isPhoneMode(mActivity.getDeviceProfile()));
applyState();
notifyStashChange(/* visible */ false, /* stashed */ isStashedInApp());
@@ -212,7 +228,8 @@
* state.
*/
public boolean supportsVisualStashing() {
- return mControllers.uiController.supportsVisualStashing();
+ return mControllers.uiController.supportsVisualStashing() ||
+ isPhoneMode(mActivity.getDeviceProfile());
}
/**
@@ -266,7 +283,7 @@
* 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());
}
private boolean hasAnyFlag(int flagMask) {
@@ -295,6 +312,10 @@
* @see WindowInsets.Type#systemBars()
*/
public int getContentHeightToReportToApps() {
+ if (isPhoneMode(mActivity.getDeviceProfile())) {
+ 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 +431,18 @@
}
mAnimator = new AnimatorSet();
addJankMonitorListener(mAnimator, /* appearing= */ !mIsStashed);
+ final float stashTranslation = isPhoneMode(mActivity.getDeviceProfile()) ? 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 +466,6 @@
if (isStashed) {
firstHalfDurationScale = 0.75f;
secondHalfDurationScale = 0.5f;
- final float stashTranslation = (mUnstashedHeight - mStashedHeight) / 2f;
fullLengthAnimatorSet.play(mIconTranslationYForStash.animateToValue(stashTranslation));
if (animateBg) {
@@ -450,7 +477,8 @@
firstHalfAnimatorSet.playTogether(
mIconAlphaForStash.animateToValue(0),
- mIconScaleForStash.animateToValue(STASHED_TASKBAR_SCALE)
+ mIconScaleForStash.animateToValue(isPhoneMode(mActivity.getDeviceProfile()) ?
+ 0 : STASHED_TASKBAR_SCALE)
);
secondHalfAnimatorSet.playTogether(
mTaskbarStashedHandleAlpha.animateToValue(1)
@@ -728,16 +756,14 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarStashController:");
- pw.println(String.format("%s\tmStashedHeight=%dpx", prefix, mStashedHeight));
- pw.println(String.format("%s\tmUnstashedHeight=%dpx", prefix, mUnstashedHeight));
- pw.println(String.format("%s\tmIsStashed=%b", prefix, mIsStashed));
- pw.println(String.format(
- "%s\tappliedState=%s", prefix, getStateString(mStatePropertyHolder.mPrevFlags)));
- pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
- pw.println(String.format(
- "%s\tmIsSystemGestureInProgress=%b", prefix, mIsSystemGestureInProgress));
- pw.println(String.format("%s\tmIsImeShowing=%b", prefix, mIsImeShowing));
- pw.println(String.format("%s\tmIsImeSwitcherShowing=%b", prefix, mIsImeSwitcherShowing));
+ pw.println(prefix + "\tmStashedHeight=" + mStashedHeight);
+ pw.println(prefix + "\tmUnstashedHeight=" + mUnstashedHeight);
+ pw.println(prefix + "\tmIsStashed=" + mIsStashed);
+ pw.println(prefix + "\tappliedState=" + getStateString(mStatePropertyHolder.mPrevFlags));
+ pw.println(prefix + "\tmState=" + getStateString(mState));
+ pw.println(prefix + "\tmIsSystemGestureInProgress=" + mIsSystemGestureInProgress);
+ pw.println(prefix + "\tmIsImeShowing=" + mIsImeShowing);
+ pw.println(prefix + "\tmIsImeSwitcherShowing=" + mIsImeSwitcherShowing);
}
private static String getStateString(int flags) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index db7dc78..0f6de73 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;
@@ -108,7 +110,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 +130,7 @@
public void onDestroy() {
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
+ mModelCallbacks.unregisterListeners();
}
public boolean areIconsVisible() {
@@ -373,9 +378,32 @@
@Override
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarViewController:");
+
+ mTaskbarIconAlpha.dump(
+ prefix + "\t",
+ pw,
+ "mTaskbarIconAlpha",
+ "ALPHA_INDEX_HOME",
+ "ALPHA_INDEX_KEYGUARD",
+ "ALPHA_INDEX_STASH",
+ "ALPHA_INDEX_RECENTS_DISABLED",
+ "ALPHA_INDEX_NOTIFICATION_EXPANDED",
+ "ALPHA_INDEX_ASSISTANT_INVOKED",
+ "ALPHA_INDEX_IME_BUTTON_NAV");
+
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..c76180e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
@@ -43,7 +43,7 @@
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;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index 7166a3e..ea0972f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -23,26 +23,33 @@
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.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
+import static com.android.quickstep.views.RecentsView.FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN;
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.SPLIT_INSTRUCTIONS_FADE;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
+import android.graphics.Rect;
+import android.graphics.RectF;
import android.util.FloatProperty;
-import android.util.Log;
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;
/**
@@ -68,10 +75,7 @@
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);
@@ -81,8 +85,6 @@
@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;
}
@@ -106,10 +108,50 @@
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) {
+ 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,
+ FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ mRecentsView.getPagedOrientationHandler()
+ .getFloatingTaskOffscreenTranslationTarget(
+ floatingTask,
+ onScreenRectF,
+ floatingTask.getStagePosition(),
+ mLauncher.getDeviceProfile()
+ ),
+ config.getInterpolator(
+ ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ LINEAR
+ ));
+ setter.setFloat(
+ mRecentsView,
+ SPLIT_INSTRUCTIONS_FADE,
+ 1,
+ 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(
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 4bb4343..21f03be 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -28,10 +28,10 @@
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.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.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.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import android.content.Intent;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index 297a61a..b733007 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -50,7 +50,8 @@
return super.getVerticalProgress(launcher);
}
RecentsView recentsView = launcher.getOverviewPanel();
- int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile(),
+ int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher,
+ launcher.getDeviceProfile(),
recentsView.getPagedOrientationHandler());
AllAppsTransitionController controller = launcher.getAllAppsController();
float scrollRange = Math.max(controller.getShiftRange(), 1);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
index 0f02e26..0c49e5f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
@@ -18,6 +18,8 @@
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
import android.content.Context;
+import android.graphics.Point;
+import android.graphics.Rect;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Launcher;
@@ -69,6 +71,13 @@
}
public static float[] getOverviewScaleAndOffsetForModalState(BaseDraggingActivity activity) {
- return new float[] {activity.getDeviceProfile().overviewModalTaskScale, NO_OFFSET};
+ Point taskSize = activity.<RecentsView>getOverviewPanel().getSelectedTaskSize();
+ Rect modalTaskSize = new Rect();
+ activity.<RecentsView>getOverviewPanel().getModalTaskSize(modalTaskSize);
+
+ float scale = Math.min((float) modalTaskSize.height() / taskSize.y,
+ (float) modalTaskSize.width() / taskSize.x);
+
+ return new float[] {scale, NO_OFFSET};
}
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index c0810b9..6f07568 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -22,12 +22,10 @@
import android.graphics.Rect;
import android.os.SystemProperties;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
-import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.Themes;
import com.android.quickstep.util.LayoutUtils;
@@ -39,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
@@ -59,15 +61,25 @@
@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
public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
+ RecentsView recentsView = launcher.getOverviewPanel();
+ float workspacePageHeight = launcher.getDeviceProfile().getCellLayoutHeight();
+ recentsView.getTaskSize(sTempRect);
+ float scale = (float) sTempRect.height() / workspacePageHeight;
float parallaxFactor = 0.5f;
- return new ScaleAndTranslation(launcher.getDeviceProfile().overviewTaskWorkspaceScale, 0,
- -getDefaultSwipeHeight(launcher) * parallaxFactor);
+ return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
}
@Override
@@ -92,13 +104,7 @@
@Override
public boolean isTaskbarStashed(Launcher launcher) {
- if (launcher instanceof BaseQuickstepLauncher) {
- LauncherTaskbarUIController uiController =
- ((BaseQuickstepLauncher) launcher).getTaskbarUIController();
-
- return uiController != null && uiController.supportsVisualStashing();
- }
- return super.isTaskbarStashed(launcher);
+ return true;
}
@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..872e64a 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;
@@ -87,9 +91,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 +109,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);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index d06f64a..bc76487 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;
@@ -56,7 +55,6 @@
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;
@@ -120,8 +118,8 @@
mSwipeDetector = new BothAxesSwipeDetector(mLauncher, this);
mRecentsView = mLauncher.getOverviewPanel();
mXRange = mLauncher.getDeviceProfile().widthPx / 2f;
- mYRange = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(),
- mRecentsView.getPagedOrientationHandler());
+ mYRange = LayoutUtils.getShelfTrackingDistance(
+ mLauncher, mLauncher.getDeviceProfile(), mRecentsView.getPagedOrientationHandler());
mMaxYProgress = mLauncher.getDeviceProfile().heightPx / mYRange;
mMotionPauseDetector = new MotionPauseDetector(mLauncher);
mMotionPauseMinDisplacement = mLauncher.getResources().getDimension(
@@ -227,11 +225,11 @@
// 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");
mRecentsView.setContentAlpha(1);
mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
mLauncher.getActionsView().getVisibilityAlpha().setValue(
(fromState.getVisibleElements(mLauncher) & OVERVIEW_ACTIONS) != 0 ? 1f : 0f);
+ mRecentsView.setTaskIconScaledDown(true);
float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
// As we drag right, animate the following properties:
@@ -246,24 +244,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();
@@ -321,6 +301,7 @@
boolean verticalFling = mSwipeDetector.isFling(velocity.y);
boolean noFling = !horizontalFling && !verticalFling;
if (mMotionPauseDetector.isPaused() && noFling) {
+ // Going to Overview.
cancelAnimations();
StateAnimationConfig config = new StateAnimationConfig();
@@ -331,6 +312,8 @@
@Override
public void onAnimationEnd(Animator animation) {
onAnimationToStateCompleted(OVERVIEW);
+ // Animate the icon after onAnimationToStateCompleted() so it doesn't clobber.
+ mRecentsView.animateUpTaskIconScale();
}
});
overviewAnim.start();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
index 7394945..9efbc34 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
@@ -144,8 +144,8 @@
.createPlaybackController();
mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
RecentsView recentsView = mLauncher.getOverviewPanel();
- totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(),
- recentsView.getPagedOrientationHandler());
+ totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher,
+ mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
} else {
mCurrentAnimation = mLauncher.getStateManager()
.createAnimationToNewWorkspace(mToState, config);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index d1b0a9c..e5cd53a 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;
@@ -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/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 045530c..8f1872b 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -2049,8 +2049,8 @@
float scrollOffset = Math.abs(mRecentsView.getScrollOffset(mRecentsView.getCurrentPage()));
int maxScrollOffset = mRecentsView.getPagedOrientationHandler().getPrimaryValue(
- mActivity.getDeviceProfile().overviewTaskRect.width(),
- mActivity.getDeviceProfile().overviewTaskRect.height());
+ mRecentsView.getLastComputedTaskSize().width(),
+ mRecentsView.getLastComputedTaskSize().height());
maxScrollOffset += mRecentsView.getPageSpacing();
float maxScaleProgress =
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index a922f58..6354282 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -33,9 +33,12 @@
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Color;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Build;
+import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
@@ -43,6 +46,7 @@
import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statehandlers.DepthController;
@@ -105,8 +109,8 @@
activity.getStateManager().goToState(startState, activityVisible);
}
- /** Gets swipe-up destination and length. */
- public abstract int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public abstract int getSwipeUpDestinationAndLength(
+ DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler);
/** Called when the animation to home has fully settled. */
@@ -211,6 +215,129 @@
}
/**
+ * Calculates the taskView size for the provided device configuration.
+ */
+ public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect) {
+ Resources res = context.getResources();
+ float maxScale = res.getFloat(R.dimen.overview_max_scale);
+ if (dp.isTablet) {
+ Rect gridRect = new Rect();
+ calculateGridSize(dp, gridRect);
+
+ calculateTaskSizeInternal(context, dp, gridRect, maxScale, Gravity.CENTER, outRect);
+ } else {
+ int taskMargin = dp.overviewTaskMarginPx;
+ calculateTaskSizeInternal(context, dp,
+ dp.overviewTaskThumbnailTopMarginPx,
+ dp.getOverviewActionsClaimedSpace(),
+ res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
+ maxScale,
+ Gravity.CENTER,
+ outRect);
+ }
+ }
+
+ private void calculateTaskSizeInternal(Context context, DeviceProfile dp, int claimedSpaceAbove,
+ int claimedSpaceBelow, int minimumHorizontalPadding, float maxScale, int gravity,
+ Rect outRect) {
+ Rect insets = dp.getInsets();
+
+ Rect potentialTaskRect = new Rect(0, 0, dp.widthPx, dp.heightPx);
+ potentialTaskRect.inset(insets.left, insets.top, insets.right, insets.bottom);
+ potentialTaskRect.inset(
+ minimumHorizontalPadding,
+ claimedSpaceAbove,
+ minimumHorizontalPadding,
+ claimedSpaceBelow);
+
+ calculateTaskSizeInternal(context, dp, potentialTaskRect, maxScale, gravity, outRect);
+ }
+
+ private void calculateTaskSizeInternal(Context context, DeviceProfile dp,
+ Rect potentialTaskRect, float maxScale, int gravity, Rect outRect) {
+ PointF taskDimension = getTaskDimension(dp);
+
+ float scale = Math.min(
+ potentialTaskRect.width() / taskDimension.x,
+ potentialTaskRect.height() / taskDimension.y);
+ scale = Math.min(scale, maxScale);
+ int outWidth = Math.round(scale * taskDimension.x);
+ int outHeight = Math.round(scale * taskDimension.y);
+
+ Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
+ }
+
+ private static PointF getTaskDimension(DeviceProfile dp) {
+ PointF dimension = new PointF();
+ getTaskDimension(dp, dimension);
+ return dimension;
+ }
+
+ /**
+ * Gets the dimension of the task in the current system state.
+ */
+ public static void getTaskDimension(DeviceProfile dp, PointF out) {
+ out.x = dp.widthPx;
+ out.y = dp.heightPx;
+ if (dp.isTablet) {
+ out.y -= dp.taskbarSize;
+ }
+ }
+
+ /**
+ * Calculates the overview grid size for the provided device configuration.
+ */
+ public final void calculateGridSize(DeviceProfile dp, Rect outRect) {
+ Rect insets = dp.getInsets();
+ int topMargin = dp.overviewTaskThumbnailTopMarginPx;
+ int bottomMargin = dp.getOverviewActionsClaimedSpace();
+ int sideMargin = dp.overviewGridSideMargin;
+
+ outRect.set(0, 0, dp.widthPx, dp.heightPx);
+ outRect.inset(Math.max(insets.left, sideMargin), insets.top + topMargin,
+ Math.max(insets.right, sideMargin), Math.max(insets.bottom, bottomMargin));
+ }
+
+ /**
+ * Calculates the overview grid non-focused task size for the provided device configuration.
+ */
+ public final void calculateGridTaskSize(Context context, DeviceProfile dp, Rect outRect,
+ PagedOrientationHandler orientedState) {
+ Resources res = context.getResources();
+ Rect taskRect = new Rect();
+ calculateTaskSize(context, dp, taskRect);
+
+ float rowHeight =
+ (taskRect.height() + dp.overviewTaskThumbnailTopMarginPx - dp.overviewRowSpacing)
+ / 2f;
+
+ PointF taskDimension = getTaskDimension(dp);
+ float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y;
+ int outWidth = Math.round(scale * taskDimension.x);
+ int outHeight = Math.round(scale * taskDimension.y);
+
+ int gravity = Gravity.TOP;
+ gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
+ Gravity.apply(gravity, outWidth, outHeight, taskRect, outRect);
+ }
+
+ /**
+ * Calculates the modal taskView size for the provided device configuration
+ */
+ public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect) {
+ calculateTaskSize(context, dp, outRect);
+ float maxScale = context.getResources().getFloat(R.dimen.overview_modal_max_scale);
+ calculateTaskSizeInternal(
+ context, dp,
+ dp.overviewTaskMarginPx,
+ dp.heightPx - outRect.bottom - dp.getInsets().bottom,
+ Math.round((dp.availableWidthPx - outRect.width() * maxScale) / 2),
+ 1f /*maxScale*/,
+ Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM,
+ outRect);
+ }
+
+ /**
* Called when the gesture ends and the animation starts towards the given target. Used to add
* an optional additional animation with the same duration.
*/
diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
index 2ca5a2e..ba61574 100644
--- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
@@ -60,13 +60,13 @@
/** 2 */
@Override
- public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) {
+ calculateTaskSize(context, dp, outRect);
if (dp.isVerticalBarLayout() && DisplayController.getNavigationMode(context) != NO_BUTTON) {
- return dp.isSeascape()
- ? dp.overviewTaskRect.left : (dp.widthPx - dp.overviewTaskRect.right);
+ return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
} else {
- return dp.heightPx - dp.overviewTaskRect.bottom;
+ return dp.heightPx - outRect.bottom;
}
}
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index d3065bd..c13b95f 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -70,14 +70,14 @@
}
@Override
- public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) {
+ calculateTaskSize(context, dp, outRect);
if (dp.isVerticalBarLayout()
&& DisplayController.getNavigationMode(context) != NavigationMode.NO_BUTTON) {
- return dp.isSeascape()
- ? dp.overviewTaskRect.left : (dp.widthPx - dp.overviewTaskRect.right);
+ return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
} else {
- return LayoutUtils.getShelfTrackingDistance(dp, orientationHandler);
+ return LayoutUtils.getShelfTrackingDistance(context, dp, orientationHandler);
}
}
diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
index 895cf89..47c5dd0 100644
--- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
+++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
@@ -32,7 +32,7 @@
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.window.CachedDisplayInfo;
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index d216a6a..9bd0cb9 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -2,12 +2,13 @@
import android.app.Activity;
import android.content.Context;
+import android.graphics.Rect;
import android.os.Bundle;
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;
@@ -31,7 +32,8 @@
}
case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
- final float swipeHeight = LayoutUtils.getShelfTrackingDistance(mDeviceProfile,
+ final float swipeHeight =
+ LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile,
PagedOrientationHandler.PORTRAIT);
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
return response;
@@ -41,8 +43,10 @@
if (!mDeviceProfile.isTablet) {
return null;
}
- response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- mDeviceProfile.overviewTaskRect.height());
+ Rect focusedTaskRect = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
+ focusedTaskRect);
+ response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height());
return response;
}
@@ -50,10 +54,10 @@
if (!mDeviceProfile.isTablet) {
return null;
}
- boolean isRecentsRtl = PagedOrientationHandler.PORTRAIT.getRecentsRtlSetting(
- mContext.getResources());
- response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- mDeviceProfile.getOverviewGridTaskRect(isRecentsRtl));
+ Rect gridTaskRect = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateGridTaskSize(mContext, mDeviceProfile,
+ gridTaskRect, PagedOrientationHandler.PORTRAIT);
+ response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, gridTaskRect);
return response;
}
diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java
index cd93dbe..813e687 100644
--- a/quickstep/src/com/android/quickstep/RecentTasksList.java
+++ b/quickstep/src/com/android/quickstep/RecentTasksList.java
@@ -62,6 +62,10 @@
private TaskLoadResult mResultsBg = INVALID_RESULT;
private TaskLoadResult mResultsUi = INVALID_RESULT;
+ 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,
KeyguardManagerCompat keyguardManager, SystemUiProxy sysUiProxy) {
mMainThreadExecutor = mainThreadExecutor;
@@ -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.
*/
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 67ce606..4435eda 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -23,8 +23,7 @@
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;
@@ -39,7 +38,6 @@
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;
@@ -314,7 +312,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();
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index 4fb7e6b..48f0557 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -61,6 +61,7 @@
import android.view.MotionEvent;
import androidx.annotation.BinderThread;
+import androidx.annotation.NonNull;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
@@ -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());
}
@@ -587,7 +592,8 @@
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..3074dbb 100644
--- a/quickstep/src/com/android/quickstep/RecentsModel.java
+++ b/quickstep/src/com/android/quickstep/RecentsModel.java
@@ -236,4 +236,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..2186a3b 100644
--- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java
+++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
@@ -31,7 +31,7 @@
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;
diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
index 3c15d0f..baeb514 100644
--- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
+++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
@@ -49,6 +49,7 @@
public abstract class SwipeUpAnimationLogic implements
RecentsAnimationCallbacks.RecentsAnimationListener{
+ protected static final Rect TEMP_RECT = new Rect();
protected final RemoteTargetGluer mTargetGluer;
protected DeviceProfile mDp;
@@ -91,7 +92,7 @@
protected void initTransitionEndpoints(DeviceProfile dp) {
mDp = dp;
mTransitionDragLength = mGestureState.getActivityInterface().getSwipeUpDestinationAndLength(
- dp, mContext, mRemoteTargetHandles[0].getTaskViewSimulator()
+ dp, mContext, TEMP_RECT, mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState().getOrientationHandler());
mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength;
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 9a2619b..0ec7e62 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -20,12 +20,14 @@
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.MAIN_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.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Insets;
import android.graphics.Rect;
@@ -96,7 +98,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;
@@ -108,12 +110,14 @@
private boolean mLastNavButtonAnimate;
private boolean mHasNavButtonAlphaBeenSet = false;
private Runnable mPendingSetNavButtonAlpha = null;
+ private Context mContext;
// TODO(141886704): Find a way to remove this
private int mLastSystemUiStateFlags;
public SystemUiProxy(Context context) {
DisplayController.INSTANCE.get(context).addChangeListener(this);
+ mContext = context;
}
@Override
@@ -189,10 +193,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));
@@ -757,11 +759,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 +872,20 @@
}
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<ActivityManager.RunningTaskInfo>(
+ Arrays.asList(mRecentTasks.getRunningTasks(numTasks)));
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call getRunningTasks", e);
+ }
+ }
+ return new ArrayList<>();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
index 092854f..69a295b 100644
--- a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
@@ -27,6 +27,7 @@
import android.os.Handler;
import android.os.Looper;
import android.view.View;
+import android.view.WindowInsets;
import android.window.SplashScreen;
import androidx.annotation.Nullable;
@@ -101,40 +102,10 @@
}
};
- abstract class MultiWindowFactory implements TaskShortcutFactory {
-
- private final int mIconRes;
- private final int mTextRes;
- private final LauncherEvent mLauncherEvent;
-
- MultiWindowFactory(int iconRes, int textRes, LauncherEvent launcherEvent) {
- mIconRes = iconRes;
- mTextRes = textRes;
- mLauncherEvent = launcherEvent;
- }
-
- protected abstract boolean isAvailable(BaseDraggingActivity activity, int displayId);
- protected abstract ActivityOptions makeLaunchOptions(Activity activity);
- protected abstract boolean onActivityStarted(BaseDraggingActivity activity);
-
- @Override
- public List<SystemShortcut> getShortcuts(BaseDraggingActivity activity,
- TaskIdAttributeContainer taskContainer) {
- final Task task = taskContainer.getTask();
- if (!task.isDockable) {
- return null;
- }
- if (!isAvailable(activity, task.key.displayId)) {
- return null;
- }
- return Collections.singletonList(new MultiWindowSystemShortcut(mIconRes,
- mTextRes, activity, taskContainer, this, mLauncherEvent));
- }
- }
-
class SplitSelectSystemShortcut extends SystemShortcut {
private final TaskView mTaskView;
private final SplitPositionOption mSplitPositionOption;
+
public SplitSelectSystemShortcut(BaseDraggingActivity target, TaskView taskView,
SplitPositionOption option) {
super(option.iconResId, option.textResId, target, taskView.getItemInfo(), taskView);
@@ -148,19 +119,17 @@
}
}
- class MultiWindowSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
+ class FreeformSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
private Handler mHandler;
private final RecentsView mRecentsView;
private final TaskThumbnailView mThumbnailView;
private final TaskView mTaskView;
- private final MultiWindowFactory mFactory;
private final LauncherEvent mLauncherEvent;
- public MultiWindowSystemShortcut(int iconRes, int textRes, BaseDraggingActivity activity,
- TaskIdAttributeContainer taskContainer, MultiWindowFactory factory,
- LauncherEvent launcherEvent) {
+ public FreeformSystemShortcut(int iconRes, int textRes, BaseDraggingActivity activity,
+ TaskIdAttributeContainer taskContainer, LauncherEvent launcherEvent) {
super(iconRes, textRes, activity, taskContainer.getItemInfo(),
taskContainer.getTaskView());
mLauncherEvent = launcherEvent;
@@ -168,55 +137,30 @@
mTaskView = taskContainer.getTaskView();
mRecentsView = activity.getOverviewPanel();
mThumbnailView = taskContainer.getThumbnailView();
- mFactory = factory;
}
@Override
public void onClick(View view) {
- Task.TaskKey taskKey = mTaskView.getTask().key;
- final int taskId = taskKey.id;
-
- final View.OnLayoutChangeListener onLayoutChangeListener =
- new View.OnLayoutChangeListener() {
- @Override
- public void onLayoutChange(View v, int l, int t, int r, int b,
- int oldL, int oldT, int oldR, int oldB) {
- mTaskView.getRootView().removeOnLayoutChangeListener(this);
- mRecentsView.clearIgnoreResetTask(taskId);
-
- // Start animating in the side pages once launcher has been resized
- mRecentsView.dismissTask(mTaskView, false, false);
- }
- };
-
- final DeviceProfile.OnDeviceProfileChangeListener onDeviceProfileChangeListener =
- new DeviceProfile.OnDeviceProfileChangeListener() {
- @Override
- public void onDeviceProfileChanged(DeviceProfile dp) {
- mTarget.removeOnDeviceProfileChangeListener(this);
- if (dp.isMultiWindowMode) {
- mTaskView.getRootView().addOnLayoutChangeListener(
- onLayoutChangeListener);
- }
- }
- };
-
dismissTaskMenuView(mTarget);
+ RecentsView rv = mTarget.getOverviewPanel();
+ rv.switchToScreenshot(() -> {
+ rv.finishRecentsAnimation(true /* toHome */, () -> {
+ mTarget.returnToHomescreen();
+ rv.getHandler().post(this::startActivity);
+ });
+ });
+ }
- ActivityOptions options = mFactory.makeLaunchOptions(mTarget);
+ private void startActivity() {
+ final Task.TaskKey taskKey = mTaskView.getTask().key;
+ final int taskId = taskKey.id;
+ final ActivityOptions options = makeLaunchOptions(mTarget);
if (options != null) {
options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
}
if (options != null
&& ActivityManagerWrapper.getInstance().startActivityFromRecents(taskId,
options)) {
- if (!mFactory.onActivityStarted(mTarget)) {
- return;
- }
- // Add a device profile change listener to kick off animating the side tasks
- // once we enter multiwindow mode and relayout
- mTarget.addOnDeviceProfileChangeListener(onDeviceProfileChangeListener);
-
final Runnable animStartedListener = () -> {
// Hide the task view and wait for the window to be resized
// TODO: Consider animating in launcher and do an in-place start activity
@@ -255,6 +199,18 @@
.log(mLauncherEvent);
}
}
+
+ private ActivityOptions makeLaunchOptions(Activity activity) {
+ ActivityOptions activityOptions = ActivityOptionsCompat.makeFreeformOptions();
+ // Arbitrary bounds only because freeform is in dev mode right now
+ final View decorView = activity.getWindow().getDecorView();
+ final WindowInsets insets = decorView.getRootWindowInsets();
+ final Rect r = new Rect(0, 0, decorView.getWidth() / 2, decorView.getHeight() / 2);
+ r.offsetTo(insets.getSystemWindowInsetLeft() + 50,
+ insets.getSystemWindowInsetTop() + 50);
+ activityOptions.setLaunchBounds(r);
+ return activityOptions;
+ }
}
/**
@@ -304,28 +260,26 @@
}
};
- TaskShortcutFactory FREE_FORM = new MultiWindowFactory(R.drawable.ic_split_screen,
- R.string.recent_task_option_freeform, LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP) {
-
+ TaskShortcutFactory FREE_FORM = new TaskShortcutFactory() {
@Override
- protected boolean isAvailable(BaseDraggingActivity activity, int displayId) {
+ public List<SystemShortcut> getShortcuts(BaseDraggingActivity activity,
+ TaskIdAttributeContainer taskContainer) {
+ final Task task = taskContainer.getTask();
+ if (!task.isDockable) {
+ return null;
+ }
+ if (!isAvailable(activity, task.key.displayId)) {
+ return null;
+ }
+
+ return Collections.singletonList(new FreeformSystemShortcut(R.drawable.ic_split_screen,
+ R.string.recent_task_option_freeform, activity, taskContainer,
+ LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP));
+ }
+
+ private boolean isAvailable(BaseDraggingActivity activity, int displayId) {
return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity);
}
-
- @Override
- protected ActivityOptions makeLaunchOptions(Activity activity) {
- ActivityOptions activityOptions = ActivityOptionsCompat.makeFreeformOptions();
- // Arbitrary bounds only because freeform is in dev mode right now
- Rect r = new Rect(50, 50, 200, 200);
- activityOptions.setLaunchBounds(r);
- return activityOptions;
- }
-
- @Override
- protected boolean onActivityStarted(BaseDraggingActivity activity) {
- activity.returnToHomescreen();
- return true;
- }
};
TaskShortcutFactory PIN = new TaskShortcutFactory() {
diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index a030568..fa30b8f 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -37,7 +37,6 @@
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.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
@@ -55,7 +54,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;
@@ -571,29 +569,6 @@
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");
- }
- });
- }
launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
launcherAnim.setDuration(RECENTS_LAUNCH_DURATION);
diff --git a/quickstep/src/com/android/quickstep/TopTaskTracker.java b/quickstep/src/com/android/quickstep/TopTaskTracker.java
index 42fa86d..cfcba4c 100644
--- a/quickstep/src/com/android/quickstep/TopTaskTracker.java
+++ b/quickstep/src/com/android/quickstep/TopTaskTracker.java
@@ -20,6 +20,7 @@
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;
@@ -31,9 +32,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 +86,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();
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 149af98..52a37c5 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -65,7 +65,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 +72,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;
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index ab3201a..eb739a6 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;
@@ -225,7 +223,6 @@
if (toState == MODAL_TASK) {
setOverviewSelectEnabled(true);
}
- Log.d(BAD_STATE, "FRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
setFreezeViewVisibility(true);
}
@@ -237,8 +234,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/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..92d3d23 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
@@ -50,7 +50,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;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
index 02ac48e..7899c55 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
@@ -29,7 +29,7 @@
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;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
index a730183..bde4240 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
@@ -28,7 +28,7 @@
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;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
index 71dca66..2462394 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -30,7 +30,7 @@
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;
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..4badf30 100644
--- a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
@@ -44,7 +44,7 @@
import androidx.annotation.Nullable;
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.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
diff --git a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
index ded4fb0..7c83833 100644
--- a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
+++ b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
@@ -36,6 +36,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.views.RecentsView;
/**
@@ -154,9 +155,10 @@
*/
public static <SCALE, TRANSLATION> PendingAnimation createRecentsResistanceAnim(
RecentsParams<SCALE, TRANSLATION> params) {
- Rect startRect = new Rect(params.dp.overviewTaskRect);
+ Rect startRect = new Rect();
PagedOrientationHandler orientationHandler = params.recentsOrientedState
.getOrientationHandler();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(params.context, params.dp, startRect);
long distanceToCover = startRect.bottom;
PendingAnimation resistAnim = params.resistAnim != null
? params.resistAnim
diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
index d4eb880..d0856be 100644
--- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java
+++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
@@ -16,6 +16,7 @@
package com.android.quickstep.util;
import android.content.Context;
+import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
@@ -23,6 +24,7 @@
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.quickstep.LauncherActivityInterface;
public class LayoutUtils {
@@ -37,12 +39,12 @@
return swipeHeight;
}
- /**
- * Returns the shelf tracking distance.
- */
- public static int getShelfTrackingDistance(DeviceProfile dp,
+ public static int getShelfTrackingDistance(Context context, DeviceProfile dp,
PagedOrientationHandler orientationHandler) {
- return orientationHandler.getDistanceToBottomOfRect(dp, dp.overviewTaskRect);
+ // Track the bottom of the window.
+ Rect taskSize = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize);
+ return orientationHandler.getDistanceToBottomOfRect(dp, taskSize);
}
/**
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 39e3797..c459f30 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -25,6 +25,7 @@
import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.ROTATION_SETTING_URI;
+import static com.android.quickstep.BaseActivityInterface.getTaskDimension;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -45,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;
@@ -397,8 +398,8 @@
* Returns the scale and pivot so that the provided taskRect can fit the provided full size
*/
public float getFullScreenScaleAndPivot(Rect taskView, DeviceProfile dp, PointF outPivot) {
- float scale = Math.min(dp.taskDimension.x / taskView.width(),
- dp.taskDimension.y / taskView.height());
+ getTaskDimension(dp, outPivot);
+ float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height());
if (scale == 1) {
outPivot.set(taskView.centerX(), taskView.centerY());
} else {
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index e89c842..d2a2f36 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -43,7 +43,7 @@
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;
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index c626b0a..d37300c 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -22,6 +22,7 @@
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
+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;
@@ -144,8 +145,12 @@
if (mDp == null) {
return 1;
}
- mTaskRect.set(
- mIsGridTask ? mDp.getOverviewGridTaskRect(mIsRecentsRtl) : mDp.overviewTaskRect);
+ if (mIsGridTask) {
+ mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect,
+ mOrientationState.getOrientationHandler());
+ } else {
+ mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect);
+ }
Rect fullTaskSize;
if (mSplitBounds != null) {
@@ -387,7 +392,14 @@
.withCornerRadius(getCurrentCornerRadius());
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
- builder.withLayer(mDrawsBelowRecents ? Integer.MIN_VALUE + 1 : Integer.MAX_VALUE);
+ // 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
+ // transitions, the animation leashes are reparented to an animation container so we
+ // can bump layers as needed.
+ builder.withLayer(mDrawsBelowRecents
+ ? Integer.MIN_VALUE + 1
+ : ENABLE_SHELL_TRANSITIONS ? Integer.MAX_VALUE : 0);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 835c9f7..7a66ea0 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -260,6 +260,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/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index a736583..3c5a626 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -21,13 +21,11 @@
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;
@@ -68,7 +66,6 @@
public void init(OverviewActionsView actionsView,
SplitSelectStateController splitPlaceholderView) {
super.init(actionsView, splitPlaceholderView);
- Log.d(BAD_STATE, "LauncherRecentsView init setContentAlpha=0");
setContentAlpha(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);
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index c178175..62ec0ef 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -93,6 +93,7 @@
@Nullable
protected DeviceProfile mDp;
+ private final Rect mTaskSize = new Rect();
public OverviewActionsView(Context context) {
this(context, null);
@@ -243,15 +244,16 @@
}
// Align to bottom of task Rect.
- return mDp.heightPx - mDp.overviewTaskRect.bottom - mDp.overviewActionsTopMarginPx
+ return mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsTopMarginPx
- mDp.overviewActionsHeight;
}
/**
- * Updates device profile for this view to draw with.
+ * Updates device profile and task size for this view to draw with.
*/
- public void updateDimension(DeviceProfile dp) {
+ public void updateDimension(DeviceProfile dp, Rect taskSize) {
mDp = dp;
+ mTaskSize.set(taskSize);
updateVerticalMargin(DisplayController.getNavigationMode(getContext()));
requestLayout();
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index dc886f6..64068ad 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -397,6 +397,39 @@
}
};
+ public static final FloatProperty<RecentsView> FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN =
+ new FloatProperty<RecentsView>("firstFloatingTaskTranslateOffscreen") {
+ @Override
+ public void setValue(RecentsView view, float translation) {
+ view.getPagedOrientationHandler().setFloatingTaskPrimaryTranslation(
+ view.mFirstFloatingTaskView,
+ translation,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+
+ @Override
+ public Float get(RecentsView view) {
+ return view.getPagedOrientationHandler().getFloatingTaskPrimaryTranslation(
+ view.mFirstFloatingTaskView,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+ };
+
+ public static final FloatProperty<RecentsView> SPLIT_INSTRUCTIONS_FADE =
+ new FloatProperty<RecentsView>("splitInstructionsFade") {
+ @Override
+ public void setValue(RecentsView view, float fade) {
+ view.mSplitInstructionsView.setAlpha(1 - fade);
+ }
+
+ @Override
+ public Float get(RecentsView view) {
+ return 1 - view.mSplitInstructionsView.getAlpha();
+ }
+ };
+
// OverScroll constants
private static final int OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION = 270;
@@ -428,6 +461,9 @@
@Nullable
protected RemoteTargetHandle[] mRemoteTargetHandles;
+ protected final Rect mLastComputedTaskSize = new Rect();
+ protected final Rect mLastComputedGridSize = new Rect();
+ protected final Rect mLastComputedGridTaskSize = new Rect();
// How much a task that is directly offscreen will be pushed out due to RecentsView scale/pivot.
@Nullable
protected Float mLastComputedTaskStartPushOutDistance = null;
@@ -1136,8 +1172,7 @@
int targetScroll = getScrollForPage(indexOfChild(getFocusedTaskView()));
if (!isClearAllHidden) {
int clearAllWidth = mOrientationHandler.getPrimarySize(mClearAllButton);
- int taskGridHorizontalDiff = mActivity.getDeviceProfile().overviewTaskRect.right
- - mActivity.getDeviceProfile().overviewGridRect.right;
+ int taskGridHorizontalDiff = mLastComputedTaskSize.right - mLastComputedGridSize.right;
int clearAllFocusScrollDiff = taskGridHorizontalDiff - clearAllWidth;
targetScroll += mIsRtl ? clearAllFocusScrollDiff : -clearAllFocusScrollDiff;
}
@@ -1676,7 +1711,7 @@
// Update RecentsView and TaskView's DeviceProfile dependent layout.
updateOrientationHandler();
- mActionsView.updateDimension(dp);
+ mActionsView.updateDimension(dp, mLastComputedTaskSize);
}
private void updateOrientationHandler() {
@@ -1732,7 +1767,7 @@
// Update task size and padding that are dependent on DeviceProfile and insets.
private void updateSizeAndPadding() {
DeviceProfile dp = mActivity.getDeviceProfile();
- mTempRect.set(dp.overviewTaskRect);
+ getTaskSize(mTempRect);
mTaskWidth = mTempRect.width();
mTaskHeight = mTempRect.height();
@@ -1741,9 +1776,14 @@
dp.widthPx - mInsets.right - mTempRect.right,
dp.heightPx - mInsets.bottom - mTempRect.bottom);
- mTaskGridVerticalDiff = dp.getOverviewGridTaskRect(mIsRtl).top - dp.overviewTaskRect.top;
+ mSizeStrategy.calculateGridSize(mActivity.getDeviceProfile(),
+ mLastComputedGridSize);
+ mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(),
+ mLastComputedGridTaskSize, mOrientationHandler);
+
+ mTaskGridVerticalDiff = mLastComputedGridTaskSize.top - mLastComputedTaskSize.top;
mTopBottomRowHeightDiff =
- dp.overviewGridTaskDimension.y + dp.overviewTaskThumbnailTopMarginPx
+ mLastComputedGridTaskSize.height() + dp.overviewTaskThumbnailTopMarginPx
+ dp.overviewRowSpacing;
// Force TaskView to update size from thumbnail
@@ -1785,6 +1825,34 @@
updateGridProperties(isTaskDismissal);
}
+ public void getTaskSize(Rect outRect) {
+ mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect);
+ mLastComputedTaskSize.set(outRect);
+ }
+
+ /**
+ * Returns the size of task selected to enter modal state.
+ */
+ public Point getSelectedTaskSize() {
+ mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(),
+ mTempRect);
+ return new Point(mTempRect.width(), mTempRect.height());
+ }
+
+ /** Gets the last computed task size */
+ public Rect getLastComputedTaskSize() {
+ return mLastComputedTaskSize;
+ }
+
+ public Rect getLastComputedGridTaskSize() {
+ return mLastComputedGridTaskSize;
+ }
+
+ /** Gets the task size for modal state. */
+ public void getModalTaskSize(Rect outRect) {
+ mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect);
+ }
+
@Override
protected boolean computeScrollHelper() {
boolean scrolling = super.computeScrollHelper();
@@ -2170,7 +2238,8 @@
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
TaskViewSimulator[] taskViewSimulators) {
mCurrentGestureEndTarget = endTarget;
- if (endTarget == GestureState.GestureEndTarget.RECENTS) {
+ boolean isOverviewEndTarget = endTarget == GestureState.GestureEndTarget.RECENTS;
+ if (isOverviewEndTarget) {
updateGridProperties();
}
@@ -2199,10 +2268,11 @@
}
}
}
+ int overviewProgress = isOverviewEndTarget ? 1 : 0;
if (animatorSet == null) {
- setOverviewProgress(1);
+ setOverviewProgress(overviewProgress);
} else {
- animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, 1));
+ animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, overviewProgress));
}
}
@@ -2417,8 +2487,7 @@
return;
}
- DeviceProfile dp = mActivity.getDeviceProfile();
- int taskTopMargin = dp.overviewTaskThumbnailTopMarginPx;
+ int taskTopMargin = mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
int topRowWidth = 0;
int bottomRowWidth = 0;
@@ -2461,7 +2530,7 @@
gridTranslations[i] += mIsRtl ? taskWidthAndSpacing : -taskWidthAndSpacing;
// Center view vertically in case it's from different orientation.
- taskView.setGridTranslationY((dp.overviewTaskRect.height() + taskTopMargin
+ taskView.setGridTranslationY((mLastComputedTaskSize.height() + taskTopMargin
- taskView.getLayoutParams().height) / 2f);
if (taskView == snappedTaskView) {
@@ -2577,11 +2646,11 @@
// accordingly. Update longRowWidth if ClearAllButton has been moved.
float clearAllShortTotalCompensation = 0;
int longRowWidth = Math.max(topRowWidth, bottomRowWidth);
- if (longRowWidth < dp.overviewGridRect.width()) {
- float shortTotalCompensation = dp.overviewGridRect.width() - longRowWidth;
+ if (longRowWidth < mLastComputedGridSize.width()) {
+ float shortTotalCompensation = mLastComputedGridSize.width() - longRowWidth;
clearAllShortTotalCompensation =
mIsRtl ? -shortTotalCompensation : shortTotalCompensation;
- longRowWidth = dp.overviewGridRect.width();
+ longRowWidth = mLastComputedGridSize.width();
}
float clearAllTotalTranslationX =
@@ -2598,8 +2667,9 @@
if (snappedTaskView != null) {
int distanceFromClearAll = longRowWidth - snappedTaskRowWidth + mPageSpacing;
// ClearAllButton should be off screen when snapped task is in its snapped position.
- int minimumDistance = mTaskWidth - snappedTaskView.getLayoutParams().width
- + (dp.overviewGridRect.width() - mTaskWidth) / 2;
+ int minimumDistance =
+ mTaskWidth - snappedTaskView.getLayoutParams().width
+ + (mLastComputedGridSize.width() - mTaskWidth) / 2;
if (distanceFromClearAll < minimumDistance) {
int distanceDifference = minimumDistance - distanceFromClearAll;
snappedTaskGridTranslationX += mIsRtl ? distanceDifference : -distanceDifference;
@@ -2614,9 +2684,9 @@
mClearAllButton.setGridTranslationPrimary(
clearAllTotalTranslationX - snappedTaskGridTranslationX);
- mClearAllButton.setGridScrollOffset(mIsRtl
- ? dp.overviewTaskRect.left - dp.overviewGridRect.left
- : dp.overviewTaskRect.right - dp.overviewGridRect.right);
+ mClearAllButton.setGridScrollOffset(
+ mIsRtl ? mLastComputedTaskSize.left - mLastComputedGridSize.left
+ : mLastComputedTaskSize.right - mLastComputedGridSize.right);
setGridProgress(mGridProgress);
}
@@ -2869,8 +2939,8 @@
boolean closeGapBetweenClearAll = false;
boolean isClearAllHidden = isClearAllHidden();
boolean snapToLastTask = false;
- DeviceProfile dp = mActivity.getDeviceProfile();
- boolean isLandscapeSplit = dp.isLandscape && isSplitSelectionActive();
+ boolean isLandscapeSplit =
+ mActivity.getDeviceProfile().isLandscape && isSplitSelectionActive();
boolean isSplitPlaceholderFirstInGrid = isSplitPlaceholderFirstInGrid();
boolean isSplitPlaceholderLastInGrid = isSplitPlaceholderLastInGrid();
TaskView lastGridTaskView = showAsGrid ? getLastGridTaskView() : null;
@@ -3061,7 +3131,7 @@
dismissTranslationInterpolationEnd);
if (taskView == nextFocusedTaskView) {
// Enlarge the task to be focused next, and translate into focus position.
- float scale = mTaskWidth / (float) dp.overviewGridTaskDimension.x;
+ float scale = mTaskWidth / (float) mLastComputedGridTaskSize.width();
anim.setFloat(taskView, TaskView.SNAPSHOT_SCALE, scale,
clampToProgress(LINEAR, animationStartProgress,
dismissTranslationInterpolationEnd));
@@ -3107,7 +3177,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);
}
@@ -3317,7 +3389,7 @@
// Update various scroll-dependent UI.
dispatchScrollChanged();
updateActionsViewFocusedScroll();
- if (isClearAllHidden() && !dp.isTablet) {
+ if (isClearAllHidden() && !mActivity.getDeviceProfile().isTablet) {
mActionsView.updateDisabledFlags(OverviewActionsView.DISABLED_SCROLLING,
false);
}
@@ -3715,6 +3787,7 @@
updateEmptyStateUi(changed);
// Update the pivots such that when the task is scaled, it fills the full page
+ getTaskSize(mTempRect);
updatePivots();
setTaskModalness(mTaskModalness);
mLastComputedTaskStartPushOutDistance = null;
@@ -3728,13 +3801,12 @@
}
private void updatePivots() {
- DeviceProfile dp = mActivity.getDeviceProfile();
if (mOverviewSelectEnabled) {
- setPivotX(dp.overviewTaskRect.centerX());
- setPivotY(dp.overviewTaskRect.bottom);
+ setPivotX(mLastComputedTaskSize.centerX());
+ setPivotY(mLastComputedTaskSize.bottom);
} else {
- getPagedViewOrientedState().getFullScreenScaleAndPivot(dp.overviewTaskRect, dp,
- mTempPointF);
+ getPagedViewOrientedState().getFullScreenScaleAndPivot(mTempRect,
+ mActivity.getDeviceProfile(), mTempPointF);
setPivotX(mTempPointF.x);
setPivotY(mTempPointF.y);
}
@@ -4007,8 +4079,8 @@
}
public void initiateSplitSelect(TaskView taskView) {
- int defaultSplitPosition =
- mOrientationHandler.getDefaultSplitPosition(mActivity.getDeviceProfile());
+ int defaultSplitPosition = mOrientationHandler
+ .getDefaultSplitPosition(mActivity.getDeviceProfile());
initiateSplitSelect(taskView, defaultSplitPosition);
}
@@ -4313,9 +4385,9 @@
* Returns the scale up required on the view, so that it coves the screen completely
*/
public float getMaxScaleForFullScreen() {
- DeviceProfile dp = mActivity.getDeviceProfile();
- return getPagedViewOrientedState().getFullScreenScaleAndPivot(dp.overviewTaskRect,
- dp, mTempPointF);
+ getTaskSize(mTempRect);
+ return getPagedViewOrientedState().getFullScreenScaleAndPivot(
+ mTempRect, mActivity.getDeviceProfile(), mTempPointF);
}
public PendingAnimation createTaskLaunchAnimation(
@@ -4822,15 +4894,17 @@
int lastGridTaskViewPosition =
getPositionInRow(lastGridTaskView, topRowIdArray, bottomRowIdArray);
int taskViewPosition = getPositionInRow(taskView, topRowIdArray, bottomRowIdArray);
- DeviceProfile dp = mActivity.getDeviceProfile();
- Rect gridTaskRect = dp.getOverviewGridTaskRect(mIsRtl);
- int gridTaskSizeAndSpacing = gridTaskRect.width() + mPageSpacing;
+ int gridTaskSizeAndSpacing = mLastComputedGridTaskSize.width() + mPageSpacing;
int positionDiff = gridTaskSizeAndSpacing * (lastGridTaskViewPosition - taskViewPosition);
- int lastTaskEnd = (mIsRtl ? dp.overviewGridRect.left : dp.overviewGridRect.right)
+ int lastTaskEnd = (mIsRtl
+ ? mLastComputedGridSize.left
+ : mLastComputedGridSize.right)
+ (mIsRtl ? mPageSpacing : -mPageSpacing);
int taskEnd = lastTaskEnd + (mIsRtl ? positionDiff : -positionDiff);
- int normalTaskEnd = mIsRtl ? gridTaskRect.left : gridTaskRect.right;
+ int normalTaskEnd = mIsRtl
+ ? mLastComputedGridTaskSize.left
+ : mLastComputedGridTaskSize.right;
return taskEnd - normalTaskEnd;
}
@@ -5136,12 +5210,14 @@
while ((taskView == null || isTaskViewFullyVisible(taskView)) && targetPage - 1 >= 0) {
taskView = getTaskViewAt(--targetPage);
}
- DeviceProfile dp = mActivity.getDeviceProfile();
- Rect gridTaskRect = dp.getOverviewGridTaskRect(mIsRtl);
// Target a scroll where targetPage is on left of screen but still fully visible.
- int lastTaskEnd = (mIsRtl ? dp.overviewGridRect.left : dp.overviewGridRect.right)
+ int lastTaskEnd = (mIsRtl
+ ? mLastComputedGridSize.left
+ : mLastComputedGridSize.right)
+ (mIsRtl ? mPageSpacing : -mPageSpacing);
- int normalTaskEnd = mIsRtl ? gridTaskRect.left : gridTaskRect.right;
+ int normalTaskEnd = mIsRtl
+ ? mLastComputedGridTaskSize.left
+ : mLastComputedGridTaskSize.right;
int targetScroll = getScrollForPage(targetPage) + normalTaskEnd - lastTaskEnd;
// Find a page that is close to targetScroll while not over it.
while (targetPage - 1 >= 0
@@ -5250,6 +5326,11 @@
return mRecentsAnimationController;
}
+ @Nullable
+ public FloatingTaskView getFirstFloatingTaskView() {
+ return mFirstFloatingTaskView;
+ }
+
/** 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/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index d2b85f6..b089155 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -43,7 +43,6 @@
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
-import android.graphics.Outline;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -57,7 +56,6 @@
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewGroup;
-import android.view.ViewOutlineProvider;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
@@ -76,7 +74,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;
@@ -325,8 +323,6 @@
}
};
- private final TaskOutlineProvider mOutlineProvider;
-
@Nullable
protected Task mTask;
protected TaskThumbnailView mSnapshotView;
@@ -409,10 +405,6 @@
mCurrentFullscreenParams = new FullscreenDrawParams(context);
mDigitalWellBeingToast = new DigitalWellBeingToast(mActivity, this);
-
- mOutlineProvider = new TaskOutlineProvider(getContext(), mCurrentFullscreenParams,
- mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx);
- setOutlineProvider(mOutlineProvider);
}
public void setTaskViewId(int id) {
@@ -874,10 +866,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);
@@ -1266,33 +1257,6 @@
mEndQuickswitchCuj = endQuickswitchCuj;
}
- private static final class TaskOutlineProvider extends ViewOutlineProvider {
-
- private int mMarginTop;
- private FullscreenDrawParams mFullscreenParams;
-
- TaskOutlineProvider(Context context, FullscreenDrawParams fullscreenParams, int topMargin) {
- mMarginTop = topMargin;
- mFullscreenParams = fullscreenParams;
- }
-
- public void updateParams(FullscreenDrawParams params, int topMargin) {
- mFullscreenParams = params;
- mMarginTop = topMargin;
- }
-
- @Override
- public void getOutline(View view, Outline outline) {
- RectF insets = mFullscreenParams.mCurrentDrawnInsets;
- float scale = mFullscreenParams.mScale;
- outline.setRoundRect(0,
- (int) (mMarginTop * scale),
- (int) ((insets.left + view.getWidth() + insets.right) * scale),
- (int) ((insets.top + view.getHeight() + insets.bottom) * scale),
- mFullscreenParams.mCurrentDrawnCornerRadius);
- }
- }
-
private int getExpectedViewHeight(View view) {
int expectedHeight;
int h = view.getLayoutParams().height;
@@ -1398,11 +1362,6 @@
mSnapshotView.getTaskOverlay().setFullscreenProgress(progress);
updateSnapshotRadius();
-
- mOutlineProvider.updateParams(
- mCurrentFullscreenParams,
- mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx);
- invalidateOutline();
}
protected void updateSnapshotRadius() {
@@ -1431,8 +1390,9 @@
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
if (deviceProfile.isTablet) {
final int thumbnailPadding = deviceProfile.overviewTaskThumbnailTopMarginPx;
- final int taskWidth = deviceProfile.overviewTaskRect.width();
- final int taskHeight = deviceProfile.overviewTaskRect.height();
+ final Rect lastComputedTaskSize = getRecentsView().getLastComputedTaskSize();
+ final int taskWidth = lastComputedTaskSize.width();
+ final int taskHeight = lastComputedTaskSize.height();
int boxWidth;
int boxHeight;
@@ -1443,9 +1403,10 @@
boxWidth = taskWidth;
boxHeight = taskHeight;
} else {
- // Otherwise task is in grid.
- boxWidth = deviceProfile.overviewGridTaskDimension.x;
- boxHeight = deviceProfile.overviewGridTaskDimension.y;
+ // Otherwise task is in grid, and should use lastComputedGridTaskSize.
+ Rect lastComputedGridTaskSize = getRecentsView().getLastComputedGridTaskSize();
+ boxWidth = lastComputedGridTaskSize.width();
+ boxHeight = lastComputedGridTaskSize.height();
}
// Bound width/height to the box size.
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 588e346..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1440)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2768)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1440)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(3120)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(231)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(414)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1209)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(182)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(202)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f)
- }
-}
\ 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 f91d03d..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1440)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2768)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1440)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(3120)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(231)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(414)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1209)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(182)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(202)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f)
- }
-}
\ 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 2d9e263..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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(1443)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1340)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(232)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(128)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
-}
\ 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 3add2c7..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1416)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(270)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(166)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
-}
\ 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 7f0d6ca..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2292)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(372)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(201)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ 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 1a709e6..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2368)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(410)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(239)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt
new file mode 100644
index 0000000..1208a2a
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt
@@ -0,0 +1,1467 @@
+/*
+ * 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.DeviceProfileBaseTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Tests for DeviceProfile.
+ */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class DeviceProfileTest : DeviceProfileBaseTest() {
+
+ @Test
+ fun phonePortrait3Button() {
+ initializeVarsForPhone(isGestureMode = false)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1080.0px (411.42856dp)\n" +
+ "\theightPx: 2400.0px (914.2857dp)\n" +
+ "\tavailableWidthPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableHeightPx: 2156.0px (821.3333dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 118.0px (44.95238dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 126.0px (48.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 272.0px (103.61905dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 511.0px (194.66667dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 147.0px (56.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 913.0px (347.8095dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" +
+ "\tworkspacePadding.left: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.top: 67.0px (25.52381dp)\n" +
+ "\tworkspacePadding.right: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.bottom: 504.0px (192.0dp)\n" +
+ "\ticonScale: 0.9981516px (0.38024822dp)\n" +
+ "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" +
+ "\textraSpace: 211.0px (80.38095dp)\n" +
+ "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" +
+ "\tmaxEmptySpace: 315.0px (120.0dp)\n" +
+ "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" +
+ "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" +
+ "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" +
+ "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n")
+ }
+
+ @Test
+ fun phonePortrait() {
+ initializeVarsForPhone()
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1080.0px (411.42856dp)\n" +
+ "\theightPx: 2400.0px (914.2857dp)\n" +
+ "\tavailableWidthPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableHeightPx: 2219.0px (845.3333dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 118.0px (44.95238dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 63.0px (24.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 272.0px (103.61905dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 511.0px (194.66667dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 913.0px (347.8095dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" +
+ "\tworkspacePadding.left: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.top: 67.0px (25.52381dp)\n" +
+ "\tworkspacePadding.right: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.bottom: 567.0px (216.0dp)\n" +
+ "\ticonScale: 0.9981516px (0.38024822dp)\n" +
+ "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" +
+ "\textraSpace: 211.0px (80.38095dp)\n" +
+ "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" +
+ "\tmaxEmptySpace: 315.0px (120.0dp)\n" +
+ "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" +
+ "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" +
+ "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" +
+ "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n")
+ }
+
+ @Test
+ fun tabletLandscape3Button() {
+ initializeVarsForTablet(isLandscape = true, isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2560.0px (1280.0dp)\n" +
+ "\theightPx: 1600.0px (800.0dp)\n" +
+ "\tavailableWidthPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableHeightPx: 1496.0px (748.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(120.0, 104.0)dp\n" +
+ "\tcellWidthPx: 240.0px (120.0dp)\n" +
+ "\tcellHeightPx: 208.0px (104.0dp)\n" +
+ "\tgetCellSize().x: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().y: 208.0px (104.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
+ "\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
+ "\tallAppsTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" +
+ "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" +
+ "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" +
+ "\thotseatBarSizePx: 200.0px (100.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 597.0px (298.5dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 959.0px (479.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 597.0px (298.5dp)\n" +
+ "\tnumShownHotseatIcons: 5\n" +
+ "\thotseatBorderSpace: 101.0px (50.5dp)\n" +
+ "\tisQsbInline: true\n" +
+ "\tqsbWidth: 855.0px (427.5dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" +
+ "\tworkspacePadding.left: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 104.0px (52.0dp)\n" +
+ "\tunscaled extraSpace: 104.0px (52.0dp)\n" +
+ "\tmaxEmptySpace: 200.0px (100.0dp)\n" +
+ "\tworkspaceTopPadding: 32.0px (16.0dp)\n" +
+ "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" +
+ "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" +
+ "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n")
+ }
+
+ @Test
+ fun tabletLandscape() {
+ initializeVarsForTablet(isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2560.0px (1280.0dp)\n" +
+ "\theightPx: 1600.0px (800.0dp)\n" +
+ "\tavailableWidthPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableHeightPx: 1496.0px (748.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(120.0, 104.0)dp\n" +
+ "\tcellWidthPx: 240.0px (120.0dp)\n" +
+ "\tcellHeightPx: 208.0px (104.0dp)\n" +
+ "\tgetCellSize().x: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().y: 208.0px (104.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
+ "\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
+ "\tallAppsTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" +
+ "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" +
+ "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" +
+ "\thotseatBarSizePx: 200.0px (100.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 1040.0px (520.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 300.0px (150.0dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 100.0px (50.0dp)\n" +
+ "\tisQsbInline: true\n" +
+ "\tqsbWidth: 640.0px (320.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" +
+ "\tworkspacePadding.left: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 104.0px (52.0dp)\n" +
+ "\tunscaled extraSpace: 104.0px (52.0dp)\n" +
+ "\tmaxEmptySpace: 200.0px (100.0dp)\n" +
+ "\tworkspaceTopPadding: 32.0px (16.0dp)\n" +
+ "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" +
+ "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" +
+ "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n")
+ }
+
+ @Test
+ fun tabletPortrait3Button() {
+ initializeVarsForTablet(isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1600.0px (800.0dp)\n" +
+ "\theightPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableWidthPx: 1600.0px (800.0dp)\n" +
+ "\tavailableHeightPx: 2456.0px (1228.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(102.0, 120.0)dp\n" +
+ "\tcellWidthPx: 204.0px (102.0dp)\n" +
+ "\tcellHeightPx: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().x: 204.0px (102.0dp)\n" +
+ "\tgetCellSize().y: 240.0px (120.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
+ "\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
+ "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" +
+ "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" +
+ "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" +
+ "\thotseatBarSizePx: 358.0px (179.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 460.0px (230.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 76.0px (38.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 460.0px (230.0dp)\n" +
+ "\tnumShownHotseatIcons: 5\n" +
+ "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1300.0px (650.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" +
+ "\tworkspacePadding.left: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.top: 87.0px (43.5dp)\n" +
+ "\tworkspacePadding.right: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 362.0px (181.0dp)\n" +
+ "\tunscaled extraSpace: 362.0px (181.0dp)\n" +
+ "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" +
+ "\tworkspaceTopPadding: 159.0px (79.5dp)\n" +
+ "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" +
+ "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" +
+ "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n")
+ }
+
+ @Test
+ fun tabletPortrait() {
+ initializeVarsForTablet()
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1600.0px (800.0dp)\n" +
+ "\theightPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableWidthPx: 1600.0px (800.0dp)\n" +
+ "\tavailableHeightPx: 2456.0px (1228.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(102.0, 120.0)dp\n" +
+ "\tcellWidthPx: 204.0px (102.0dp)\n" +
+ "\tcellHeightPx: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().x: 204.0px (102.0dp)\n" +
+ "\tgetCellSize().y: 240.0px (120.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
+ "\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
+ "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" +
+ "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" +
+ "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" +
+ "\thotseatBarSizePx: 358.0px (179.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 150.0px (75.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 150.0px (75.0dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1300.0px (650.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" +
+ "\tworkspacePadding.left: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.top: 87.0px (43.5dp)\n" +
+ "\tworkspacePadding.right: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 362.0px (181.0dp)\n" +
+ "\tunscaled extraSpace: 362.0px (181.0dp)\n" +
+ "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" +
+ "\tworkspaceTopPadding: 159.0px (79.5dp)\n" +
+ "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" +
+ "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" +
+ "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n")
+ }
+
+ @Test
+ fun twoPanelLandscape3Button() {
+ initializeVarsForTwoPanel(isLandscape = true, isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2208.0px (841.1429dp)\n" +
+ "\theightPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableWidthPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableHeightPx: 1730.0px (659.0476dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 102.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 267.0px (101.71429dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" +
+ "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" +
+ "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" +
+ "\thotseatBarSizePx: 417.0px (158.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 744.0px (283.42856dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 216.0px (82.28571dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 744.0px (283.42856dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 61.0px (23.238094dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1467.0px (558.8571dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" +
+ "\tworkspacePadding.left: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" +
+ "\ticonScale: 0.99864316px (0.3804355dp)\n" +
+ "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" +
+ "\textraSpace: 57.0px (21.714285dp)\n" +
+ "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" +
+ "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" +
+ "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" +
+ "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelLandscape() {
+ initializeVarsForTwoPanel(isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2208.0px (841.1429dp)\n" +
+ "\theightPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableWidthPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableHeightPx: 1730.0px (659.0476dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 102.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 267.0px (101.71429dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" +
+ "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" +
+ "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" +
+ "\thotseatBarSizePx: 417.0px (158.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 370.0px (140.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 370.0px (140.95238dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 105.0px (40.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1467.0px (558.8571dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" +
+ "\tworkspacePadding.left: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" +
+ "\ticonScale: 0.99864316px (0.3804355dp)\n" +
+ "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" +
+ "\textraSpace: 57.0px (21.714285dp)\n" +
+ "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" +
+ "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" +
+ "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" +
+ "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelPortrait3Button() {
+ initializeVarsForTwoPanel(isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1840.0px (700.9524dp)\n" +
+ "\theightPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableWidthPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableHeightPx: 2098.0px (799.2381dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(68.0, 116.0)dp\n" +
+ "\tcellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tcellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tgetCellSize().x: 178.0px (67.809525dp)\n" +
+ "\tgetCellSize().y: 304.0px (115.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" +
+ "\ticonSizePx: 136.0px (51.809525dp)\n" +
+ "\ticonTextSizePx: 31.0px (11.809524dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
+ "\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" +
+ "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" +
+ "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" +
+ "\thotseatBarSizePx: 459.0px (174.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" +
+ "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 660.0px (251.42857dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 128.0px (48.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 660.0px (251.42857dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 47.0px (17.904762dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1236.0px (470.85715dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" +
+ "\tworkspacePadding.left: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.top: 68.0px (25.904762dp)\n" +
+ "\tworkspacePadding.right: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" +
+ "\ticonScale: 0.9978308px (0.38012603dp)\n" +
+ "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" +
+ "\textraSpace: 235.0px (89.52381dp)\n" +
+ "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" +
+ "\tmaxEmptySpace: 236.0px (89.90476dp)\n" +
+ "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" +
+ "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" +
+ "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" +
+ "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelPortrait() {
+ initializeVarsForTwoPanel()
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1840.0px (700.9524dp)\n" +
+ "\theightPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableWidthPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableHeightPx: 2098.0px (799.2381dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(68.0, 116.0)dp\n" +
+ "\tcellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tcellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tgetCellSize().x: 178.0px (67.809525dp)\n" +
+ "\tgetCellSize().y: 304.0px (115.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" +
+ "\ticonSizePx: 136.0px (51.809525dp)\n" +
+ "\ticonTextSizePx: 31.0px (11.809524dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
+ "\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" +
+ "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" +
+ "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" +
+ "\thotseatBarSizePx: 459.0px (174.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" +
+ "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 302.0px (115.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 302.0px (115.04762dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 84.0px (32.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1236.0px (470.85715dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" +
+ "\tworkspacePadding.left: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.top: 68.0px (25.904762dp)\n" +
+ "\tworkspacePadding.right: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" +
+ "\ticonScale: 0.9978308px (0.38012603dp)\n" +
+ "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" +
+ "\textraSpace: 235.0px (89.52381dp)\n" +
+ "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" +
+ "\tmaxEmptySpace: 236.0px (89.90476dp)\n" +
+ "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" +
+ "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" +
+ "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" +
+ "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n")
+ }
+
+ @Test
+ fun phoneVerticalBar3Button() {
+ initializeVarsForPhone(isVerticalBar = true, isGestureMode = false)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2400.0px (914.2857dp)\n" +
+ "\theightPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableWidthPx: 2156.0px (821.3333dp)\n" +
+ "\tavailableHeightPx: 1006.0px (383.2381dp)\n" +
+ "\tmInsets.left: 118.0px (44.95238dp)\n" +
+ "\tmInsets.top: 74.0px (28.190475dp)\n" +
+ "\tmInsets.right: 126.0px (48.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:false\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 153.0px (58.285713dp)\n" +
+ "\tcellHeightPx: 160.0px (60.95238dp)\n" +
+ "\tgetCellSize().x: 461.0px (175.61905dp)\n" +
+ "\tgetCellSize().y: 193.0px (73.52381dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" +
+ "\ticonSizePx: 142.0px (54.095238dp)\n" +
+ "\ticonTextSizePx: 0.0px (0.0dp)\n" +
+ "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellWidthPx: 179.0px (68.190475dp)\n" +
+ "\tfolderCellHeightPx: 212.0px (80.7619dp)\n" +
+ "\tfolderChildIconSizePx: 135.0px (51.42857dp)\n" +
+ "\tfolderChildTextSizePx: 35.0px (13.333333dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 10.0px (3.8095238dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" +
+ "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 247.0px (94.09524dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 48.0px (18.285715dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 189.0px (72.0dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1525.0px (580.9524dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 194.0px (73.90476dp)\n" +
+ "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" +
+ "\ticonScale: 1.0px (0.3809524dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.3809524dp)\n" +
+ "\textraSpace: 166.0px (63.238094dp)\n" +
+ "\tunscaled extraSpace: 166.0px (63.238094dp)\n" +
+ "\tmaxEmptySpace: 184.0px (70.09524dp)\n" +
+ "\tworkspaceTopPadding: 0.0px (0.0dp)\n" +
+ "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" +
+ "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 983.0px (374.4762dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.777336px (0.296128dp)\n" +
+ "\tgetCellLayoutHeight(): 1006.0px (383.2381dp)\n" +
+ "\tgetCellLayoutWidth(): 1952.0px (743.619dp)\n")
+ }
+
+ @Test
+ fun phoneVerticalBar() {
+ initializeVarsForPhone(isVerticalBar = true)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2400.0px (914.2857dp)\n" +
+ "\theightPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableWidthPx: 2282.0px (869.3333dp)\n" +
+ "\tavailableHeightPx: 943.0px (359.2381dp)\n" +
+ "\tmInsets.left: 118.0px (44.95238dp)\n" +
+ "\tmInsets.top: 74.0px (28.190475dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 63.0px (24.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:false\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 153.0px (58.285713dp)\n" +
+ "\tcellHeightPx: 160.0px (60.95238dp)\n" +
+ "\tgetCellSize().x: 493.0px (187.80952dp)\n" +
+ "\tgetCellSize().y: 180.0px (68.57143dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" +
+ "\ticonSizePx: 142.0px (54.095238dp)\n" +
+ "\ticonTextSizePx: 0.0px (0.0dp)\n" +
+ "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellWidthPx: 163.0px (62.095238dp)\n" +
+ "\tfolderCellHeightPx: 192.0px (73.14286dp)\n" +
+ "\tfolderChildIconSizePx: 123.0px (46.857143dp)\n" +
+ "\tfolderChildTextSizePx: 32.0px (12.190476dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 8.0px (3.047619dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" +
+ "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 247.0px (94.09524dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 111.0px (42.285713dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 63.0px (24.0dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1621.0px (617.5238dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 194.0px (73.90476dp)\n" +
+ "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" +
+ "\ticonScale: 1.0px (0.3809524dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.3809524dp)\n" +
+ "\textraSpace: 103.0px (39.238094dp)\n" +
+ "\tunscaled extraSpace: 103.0px (39.238094dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 0.0px (0.0dp)\n" +
+ "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" +
+ "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 927.0px (353.14285dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76988333px (0.2932889dp)\n" +
+ "\tgetCellLayoutHeight(): 943.0px (359.2381dp)\n" +
+ "\tgetCellLayoutWidth(): 2078.0px (791.619dp)\n")
+ }
+}
\ 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 0eeb23d..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1340)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(232)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(128)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
-}
\ 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 7bf53d7..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1416)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(270)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(166)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
-}
\ 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 9b6d7d5..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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(340)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2292)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(372)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(201)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ 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 6702eb5..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2368)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(410)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(239)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ 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 7e0c5f3..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(3120)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1130)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(3120)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(747)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2372)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(666)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(205)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ 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 9580458..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
+++ /dev/null
@@ -1,596 +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)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(3120)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1130)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(3120)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(747)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2372)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(666)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(205)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
index 1c15e1e..c822578 100644
--- a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
+++ b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
@@ -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/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 81df3c0..4bd627a 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -212,6 +212,7 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
+ @ScreenRecord // b/238461765
public void testSwitchToOverview() throws Exception {
assertNotNull("Workspace.switchToOverview() returned null",
mLauncher.goHome().switchToOverview());
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/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/values-it/strings.xml b/res/values-it/strings.xml
index ff4fe4f..302efcb 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -137,8 +137,7 @@
<string name="item_removed" msgid="851119963877842327">"Elemento rimosso"</string>
<string name="undo" msgid="4151576204245173321">"Annulla"</string>
<string name="action_move" msgid="4339390619886385032">"Sposta elemento"</string>
- <!-- no translation found for move_to_empty_cell_description (5254852678218206889) -->
- <skip />
+ <string name="move_to_empty_cell_description" msgid="5254852678218206889">"Spostati alla riga <xliff:g id="NUMBER_0">%1$s</xliff:g> colonna <xliff:g id="NUMBER_1">%2$s</xliff:g> in <xliff:g id="STRING">%3$s</xliff:g>"</string>
<string name="move_to_position" msgid="6750008980455459790">"Sposta nella posizione <xliff:g id="NUMBER">%1$s</xliff:g>"</string>
<string name="move_to_hotseat_position" msgid="6295412897075147808">"Sposta nella posizione <xliff:g id="NUMBER">%1$s</xliff:g> dei preferiti"</string>
<string name="item_moved" msgid="4606538322571412879">"Elemento spostato"</string>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 1b3d2b1..6061ea5 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -28,75 +28,75 @@
<string name="shortcut_not_available" msgid="2536503539825726397">"Comanda rapidă nu este disponibilă"</string>
<string name="home_screen" msgid="5629429142036709174">"Pagina de pornire"</string>
<string name="recent_task_option_split_screen" msgid="6690461455618725183">"Ecran împărțit"</string>
- <string name="split_screen_position_top" msgid="1504965011158689649">"Împărțiți în sus"</string>
- <string name="split_screen_position_left" msgid="7537793098851830883">"Împărțiți în stânga"</string>
- <string name="split_screen_position_right" msgid="1569377524925193369">"Împărțiți în dreapta"</string>
+ <string name="split_screen_position_top" msgid="1504965011158689649">"Împarte în sus"</string>
+ <string name="split_screen_position_left" msgid="7537793098851830883">"Împarte în stânga"</string>
+ <string name="split_screen_position_right" msgid="1569377524925193369">"Împarte în dreapta"</string>
<string name="split_app_info_accessibility" msgid="5475288491241414932">"Informații despre aplicație pentru %1$s"</string>
- <string name="long_press_widget_to_add" msgid="3587712543577675817">"Atingeți și țineți apăsat pentru a muta un widget."</string>
- <string name="long_accessible_way_to_add" msgid="2733588281439571974">"Atingeți de două ori și țineți apăsat pentru a muta un widget sau folosiți acțiuni personalizate."</string>
+ <string name="long_press_widget_to_add" msgid="3587712543577675817">"Atinge și ține apăsat pentru a muta un widget."</string>
+ <string name="long_accessible_way_to_add" msgid="2733588281439571974">"Atinge de două ori și ține apăsat pentru a muta un widget sau folosește acțiuni personalizate."</string>
<string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string>
<string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d lățime și %2$d înălțime"</string>
<string name="widget_preview_context_description" msgid="9045841361655787574">"Widgetul <xliff:g id="WIDGET_NAME">%1$s</xliff:g>"</string>
- <string name="add_item_request_drag_hint" msgid="8730547755622776606">"Atingeți lung widgetul pentru a-l muta pe ecranul de pornire"</string>
- <string name="add_to_home_screen" msgid="9168649446635919791">"Adăugați pe ecranul de pornire"</string>
+ <string name="add_item_request_drag_hint" msgid="8730547755622776606">"Atinge lung widgetul pentru a-l muta pe ecranul de pornire"</string>
+ <string name="add_to_home_screen" msgid="9168649446635919791">"Adaugă pe ecranul de pornire"</string>
<string name="added_to_home_screen_accessibility_text" msgid="4451545765448884415">"Widgetul <xliff:g id="WIDGET_NAME">%1$s</xliff:g> a fost adăugat pe ecranul de pornire"</string>
<string name="widgets_count" msgid="6467746476364652096">"{count,plural, =1{# widget}few{# widgeturi}other{# de widgeturi}}"</string>
<string name="shortcuts_count" msgid="8471715556199592381">"{count,plural, =1{# comandă rapidă}few{# comenzi rapide}other{# de comenzi rapide}}"</string>
<string name="widgets_and_shortcuts_count" msgid="7209136747878365116">"<xliff:g id="WIDGETS_COUNT">%1$s</xliff:g> <xliff:g id="SHORTCUTS_COUNT">%2$s</xliff:g>"</string>
<string name="widget_button_text" msgid="2880537293434387943">"Widgeturi"</string>
<string name="widgets_full_sheet_search_bar_hint" msgid="8484659090860596457">"Căutare"</string>
- <string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"Ștergeți textul din caseta de căutare"</string>
+ <string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"Șterge textul din caseta de căutare"</string>
<string name="no_widgets_available" msgid="4337693382501046170">"Widgeturile și comenzile rapide nu sunt disponibile"</string>
<string name="no_search_results" msgid="3787956167293097509">"Nu au fost găsite widgeturi sau comenzi rapide"</string>
<string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"Personale"</string>
<string name="widgets_full_sheet_work_tab" msgid="3767150027110633765">"Serviciu"</string>
<string name="widget_category_conversations" msgid="8894438636213590446">"Conversații"</string>
- <string name="widget_education_header" msgid="4874760613775913787">"Informații utile la îndemâna dvs."</string>
- <string name="widget_education_content" msgid="1731667670753497052">"Pentru a primi informații fără să deschideți aplicațiile, puteți adăuga widgeturi pe ecranul de pornire"</string>
- <string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"Atingeți ca să schimbați setările pentru widgeturi"</string>
+ <string name="widget_education_header" msgid="4874760613775913787">"Informații utile la îndemâna ta"</string>
+ <string name="widget_education_content" msgid="1731667670753497052">"Pentru a primi informații fără să deschizi aplicațiile, poți adăuga widgeturi pe ecranul de pornire"</string>
+ <string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"Atinge ca să schimbi setările pentru widgeturi"</string>
<string name="widget_education_close_button" msgid="8676165703104836580">"OK"</string>
- <string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"Modificați setările pentru widgeturi"</string>
- <string name="all_apps_search_bar_hint" msgid="1390553134053255246">"Căutați aplicații"</string>
+ <string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"Modifică setările pentru widgeturi"</string>
+ <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">"Căutați mai multe aplicații"</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>
- <string name="long_press_shortcut_to_add" msgid="5405328730817637737">"Atingeți și țineți apăsat pentru a muta comanda rapidă."</string>
- <string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"Atingeți de două ori și țineți apăsat pentru a muta o comandă rapidă sau folosiți acțiuni personalizate."</string>
+ <string name="long_press_shortcut_to_add" msgid="5405328730817637737">"Atinge și ține apăsat ca să muți comanda rapidă."</string>
+ <string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"Atinge de două ori și ține apăsat pentru a muta o comandă rapidă sau folosește acțiuni personalizate."</string>
<string name="out_of_space" msgid="6455557115204099579">"Nu există spațiu liber pe acest ecran de pornire"</string>
<string name="hotseat_out_of_space" msgid="7448809638125333693">"Spațiu epuizat în bara Preferate"</string>
<string name="all_apps_button_label" msgid="8130441508702294465">"Lista de aplicații"</string>
<string name="all_apps_search_results" msgid="5889367432531296759">"Rezultatele căutării"</string>
<string name="all_apps_button_personal_label" msgid="1315764287305224468">"Lista de aplicații personale"</string>
<string name="all_apps_button_work_label" msgid="7270707118948892488">"Lista de aplicații de serviciu"</string>
- <string name="remove_drop_target_label" msgid="7812859488053230776">"Eliminați"</string>
- <string name="uninstall_drop_target_label" msgid="4722034217958379417">"Dezinstalați"</string>
+ <string name="remove_drop_target_label" msgid="7812859488053230776">"Elimină"</string>
+ <string name="uninstall_drop_target_label" msgid="4722034217958379417">"Dezinstalează"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"Informații despre aplicații"</string>
- <string name="install_drop_target_label" msgid="2539096853673231757">"Instalați"</string>
+ <string name="install_drop_target_label" msgid="2539096853673231757">"Instalează"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Nu sugera aplicația"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Fixează predicția"</string>
<string name="permlab_install_shortcut" msgid="5632423390354674437">"instalează comenzi rapide"</string>
<string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite unei aplicații să adauge comenzi rapide fără intervenția utilizatorului."</string>
- <string name="permlab_read_settings" msgid="5136500343007704955">"citiți setările și comenzile rapide de pe ecranul de pornire"</string>
+ <string name="permlab_read_settings" msgid="5136500343007704955">"citește setările și comenzile rapide de pe ecranul de pornire"</string>
<string name="permdesc_read_settings" msgid="4208061150510996676">"Permite aplicației să citească setările și comenzile rapide de pe ecranul de pornire."</string>
- <string name="permlab_write_settings" msgid="4820028712156303762">"scrieți setările și comenzile rapide de pe ecranul de pornire"</string>
+ <string name="permlab_write_settings" msgid="4820028712156303762">"scrie setările și comenzile rapide de pe ecranul de pornire"</string>
<string name="permdesc_write_settings" msgid="726859348127868466">"Permite aplicației să modifice setările și comenzile rapide de pe ecranul de pornire."</string>
<string name="msg_no_phone_permission" msgid="9208659281529857371">"<xliff:g id="APP_NAME">%1$s</xliff:g> nu are permisiunea de a apela"</string>
<string name="gadget_error_text" msgid="740356548025791839">"Widgetul nu poate fi încărcat"</string>
<string name="gadget_setup_text" msgid="8348374825537681407">"Setări pentru widget"</string>
- <string name="gadget_complete_setup_text" msgid="309040266978007925">"Atingeți pentru a finaliza configurarea"</string>
+ <string name="gadget_complete_setup_text" msgid="309040266978007925">"Atinge pentru a finaliza configurarea"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Aceasta este o aplicație de sistem și nu poate fi dezinstalată."</string>
- <string name="folder_hint_text" msgid="5174843001373488816">"Modificați numele"</string>
+ <string name="folder_hint_text" msgid="5174843001373488816">"Modifică numele"</string>
<string name="disabled_app_label" msgid="6673129024321402780">"S-a dezactivat <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="dotted_app_label" msgid="1865617679843363410">"{count,plural, =1{{app_name} are # notificare}few{{app_name} are # notificări}other{{app_name} are # de notificări}}"</string>
<string name="default_scroll_format" msgid="7475544710230993317">"Pagina %1$d din %2$d"</string>
<string name="workspace_scroll_format" msgid="8458889198184077399">"Ecranul de pornire %1$d din %2$d"</string>
<string name="workspace_new_page" msgid="257366611030256142">"Pagină nouă pe ecranul de pornire"</string>
<string name="folder_opened" msgid="94695026776264709">"Dosar deschis, <xliff:g id="WIDTH">%1$d</xliff:g> pe <xliff:g id="HEIGHT">%2$d</xliff:g>"</string>
- <string name="folder_tap_to_close" msgid="4625795376335528256">"Atingeți pentru a închide dosarul"</string>
- <string name="folder_tap_to_rename" msgid="4017685068016979677">"Atingeți pentru a salva noul nume"</string>
+ <string name="folder_tap_to_close" msgid="4625795376335528256">"Atinge pentru a închide dosarul"</string>
+ <string name="folder_tap_to_rename" msgid="4017685068016979677">"Atinge pentru a salva noul nume"</string>
<string name="folder_closed" msgid="4100806530910930934">"Dosar închis"</string>
<string name="folder_renamed" msgid="1794088362165669656">"Dosar redenumit <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="folder_name_format_exact" msgid="8626242716117004803">"Dosar: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> elemente"</string>
@@ -105,58 +105,58 @@
<string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Imagine de fundal și stil"</string>
<string name="settings_button_text" msgid="8873672322605444408">"Setări ecran de pornire"</string>
<string name="msg_disabled_by_admin" msgid="6898038085516271325">"Dezactivată de administrator"</string>
- <string name="allow_rotation_title" msgid="7222049633713050106">"Permiteți rotirea ecranului de pornire"</string>
+ <string name="allow_rotation_title" msgid="7222049633713050106">"Permite rotirea ecranului de pornire"</string>
<string name="allow_rotation_desc" msgid="8662546029078692509">"Când telefonul este rotit"</string>
<string name="notification_dots_title" msgid="9062440428204120317">"Puncte de notificare"</string>
<string name="notification_dots_desc_on" msgid="1679848116452218908">"Activate"</string>
<string name="notification_dots_desc_off" msgid="1760796511504341095">"Dezactivate"</string>
<string name="title_missing_notification_access" msgid="7503287056163941064">"Este necesar accesul la notificări"</string>
- <string name="msg_missing_notification_access" msgid="281113995110910548">"Pentru a afișa punctele de notificare, activați notificările din aplicație pentru <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="title_change_settings" msgid="1376365968844349552">"Modificați setările"</string>
- <string name="notification_dots_service_title" msgid="4284221181793592871">"Afișați punctele de notificare"</string>
+ <string name="msg_missing_notification_access" msgid="281113995110910548">"Pentru a afișa punctele de notificare, activează notificările din aplicație pentru <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="title_change_settings" msgid="1376365968844349552">"Modifică setările"</string>
+ <string name="notification_dots_service_title" msgid="4284221181793592871">"Afișează punctele de notificare"</string>
<string name="developer_options_title" msgid="700788437593726194">"Opțiuni dezvoltator"</string>
- <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Adăugați pictograme de aplicații pe ecranul de pornire"</string>
+ <string name="auto_add_shortcuts_label" msgid="4926805029653694105">"Adaugă pictograme de aplicații pe ecranul de pornire"</string>
<string name="auto_add_shortcuts_description" msgid="7117251166066978730">"Pentru aplicații noi"</string>
<string name="package_state_unknown" msgid="7592128424511031410">"Necunoscut"</string>
- <string name="abandoned_clean_this" msgid="7610119707847920412">"Eliminați"</string>
- <string name="abandoned_search" msgid="891119232568284442">"Căutați"</string>
+ <string name="abandoned_clean_this" msgid="7610119707847920412">"Elimină"</string>
+ <string name="abandoned_search" msgid="891119232568284442">"Caută"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"Aplicația nu este instalată"</string>
- <string name="abandoned_promise_explanation" msgid="3990027586878167529">"Aplicația pentru această pictogramă nu este instalată. Puteți să ștergeți pictograma sau să căutați aplicația și s-o instalați manual."</string>
+ <string name="abandoned_promise_explanation" msgid="3990027586878167529">"Aplicația pentru această pictogramă nu este instalată. Poți să ștergi pictograma sau să cauți aplicația și s-o instalezi manual."</string>
<string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g> se instalează, <xliff:g id="PROGRESS">%2$s</xliff:g> finalizat"</string>
<string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> se descarcă (finalizat <xliff:g id="PROGRESS">%2$s</xliff:g>)"</string>
<string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> așteaptă instalarea"</string>
<string name="dialog_update_title" msgid="114234265740994042">"Este necesară actualizarea aplicației"</string>
- <string name="dialog_update_message" msgid="4176784553982226114">"Aplicația pentru această pictogramă nu este actualizată. Puteți să actualizați manual ca să reactivați comanda rapidă sau să eliminați pictograma."</string>
- <string name="dialog_update" msgid="2178028071796141234">"Actualizați"</string>
- <string name="dialog_remove" msgid="6510806469849709407">"Eliminați"</string>
+ <string name="dialog_update_message" msgid="4176784553982226114">"Aplicația pentru această pictogramă nu este actualizată. Poți să actualizezi manual ca să reactivezi comanda rapidă sau să elimini pictograma."</string>
+ <string name="dialog_update" msgid="2178028071796141234">"Actualizează"</string>
+ <string name="dialog_remove" msgid="6510806469849709407">"Elimină"</string>
<string name="widgets_list" msgid="796804551140113767">"Listă de widgeturi"</string>
<string name="widgets_list_closed" msgid="6141506579418771922">"Lista de widgeturi este închisă"</string>
- <string name="action_add_to_workspace" msgid="215894119683164916">"Adăugați pe ecranul de pornire"</string>
- <string name="action_move_here" msgid="2170188780612570250">"Mutați elementul aici"</string>
+ <string name="action_add_to_workspace" msgid="215894119683164916">"Adaugă pe ecranul de pornire"</string>
+ <string name="action_move_here" msgid="2170188780612570250">"Mută elementul aici"</string>
<string name="item_added_to_workspace" msgid="4211073925752213539">"Element adăugat pe ecranul de pornire"</string>
<string name="item_removed" msgid="851119963877842327">"Element eliminat"</string>
- <string name="undo" msgid="4151576204245173321">"Anulați"</string>
- <string name="action_move" msgid="4339390619886385032">"Mutați elementul"</string>
- <string name="move_to_empty_cell_description" msgid="5254852678218206889">"Mutați în rândul <xliff:g id="NUMBER_0">%1$s</xliff:g> coloana <xliff:g id="NUMBER_1">%2$s</xliff:g> din <xliff:g id="STRING">%3$s</xliff:g>"</string>
- <string name="move_to_position" msgid="6750008980455459790">"Mutați pe poziția <xliff:g id="NUMBER">%1$s</xliff:g>"</string>
- <string name="move_to_hotseat_position" msgid="6295412897075147808">"Mutați în preferate, pe poziția <xliff:g id="NUMBER">%1$s</xliff:g>"</string>
+ <string name="undo" msgid="4151576204245173321">"Anulează"</string>
+ <string name="action_move" msgid="4339390619886385032">"Mută elementul"</string>
+ <string name="move_to_empty_cell_description" msgid="5254852678218206889">"Mută în rândul <xliff:g id="NUMBER_0">%1$s</xliff:g> coloana <xliff:g id="NUMBER_1">%2$s</xliff:g> din <xliff:g id="STRING">%3$s</xliff:g>"</string>
+ <string name="move_to_position" msgid="6750008980455459790">"Mută pe poziția <xliff:g id="NUMBER">%1$s</xliff:g>"</string>
+ <string name="move_to_hotseat_position" msgid="6295412897075147808">"Mută în preferate, pe poziția <xliff:g id="NUMBER">%1$s</xliff:g>"</string>
<string name="item_moved" msgid="4606538322571412879">"Element mutat"</string>
- <string name="add_to_folder" msgid="9040534766770853243">"Adăugați în dosar: <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="add_to_folder_with_app" msgid="4534929978967147231">"Adăugați în dosarul cu <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="add_to_folder" msgid="9040534766770853243">"Adaugă în dosar: <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="add_to_folder_with_app" msgid="4534929978967147231">"Adaugă în dosarul cu <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="added_to_folder" msgid="4793259502305558003">"Element adăugat în dosar"</string>
- <string name="create_folder_with" msgid="4050141361160214248">"Creați dosar cu: <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="create_folder_with" msgid="4050141361160214248">"Creează dosar cu: <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="folder_created" msgid="6409794597405184510">"Dosar creat"</string>
- <string name="action_move_to_workspace" msgid="39528912300293768">"Mutați pe ecranul de pornire"</string>
- <string name="action_resize" msgid="1802976324781771067">"Redimensionați"</string>
- <string name="action_increase_width" msgid="8773715375078513326">"Creșteți lățimea"</string>
- <string name="action_increase_height" msgid="459390020612501122">"Creșteți înălțimea"</string>
- <string name="action_decrease_width" msgid="1374549771083094654">"Reduceți lățimea"</string>
- <string name="action_decrease_height" msgid="282377193880900022">"Reduceți înălțimea"</string>
+ <string name="action_move_to_workspace" msgid="39528912300293768">"Mută pe ecranul de pornire"</string>
+ <string name="action_resize" msgid="1802976324781771067">"Redimensionează"</string>
+ <string name="action_increase_width" msgid="8773715375078513326">"Crește lățimea"</string>
+ <string name="action_increase_height" msgid="459390020612501122">"Crește înălțimea"</string>
+ <string name="action_decrease_width" msgid="1374549771083094654">"Redu lățimea"</string>
+ <string name="action_decrease_height" msgid="282377193880900022">"Redu înălțimea"</string>
<string name="widget_resized" msgid="9130327887929620">"Widgetul a fost redimensionat la lățimea <xliff:g id="NUMBER_0">%1$s</xliff:g> și înălțimea <xliff:g id="NUMBER_1">%2$s</xliff:g>"</string>
<string name="action_deep_shortcut" msgid="2864038805849372848">"Comenzi rapide"</string>
<string name="shortcuts_menu_with_notifications_description" msgid="2676582286544232849">"Comenzi rapide și notificări"</string>
- <string name="action_dismiss_notification" msgid="5909461085055959187">"Închideți"</string>
- <string name="accessibility_close" msgid="2277148124685870734">"Închideți"</string>
+ <string name="action_dismiss_notification" msgid="5909461085055959187">"Închide"</string>
+ <string name="accessibility_close" msgid="2277148124685870734">"Închide"</string>
<string name="notification_dismissed" msgid="6002233469409822874">"Notificare închisă"</string>
<string name="all_apps_personal_tab" msgid="4190252696685155002">"Personale"</string>
<string name="all_apps_work_tab" msgid="4884822796154055118">"Profesionale"</string>
@@ -164,14 +164,14 @@
<string name="work_profile_edu_work_apps" msgid="7895468576497746520">"Aplicațiile pentru lucru sunt marcate și vizibile pentru administratorul IT"</string>
<string name="work_profile_edu_accept" msgid="6069788082535149071">"OK"</string>
<string name="work_apps_paused_title" msgid="3040901117349444598">"Aplicațiile pentru lucru sunt întrerupte"</string>
- <string name="work_apps_paused_body" msgid="261634750995824906">"Aplicațiile pentru lucru nu pot să vă trimită notificări, să folosească bateria sau să vă acceseze locația"</string>
- <string name="work_apps_paused_content_description" msgid="5149623040804051095">"Aplicațiile pentru lucru sunt dezactivate. Acestea nu pot să vă trimită notificări, să folosească bateria sau să vă acceseze locația."</string>
+ <string name="work_apps_paused_body" msgid="261634750995824906">"Aplicațiile pentru lucru nu pot să-ți trimită notificări, să folosească bateria sau să-ți acceseze locația"</string>
+ <string name="work_apps_paused_content_description" msgid="5149623040804051095">"Aplicațiile pentru lucru sunt dezactivate. Acestea nu pot să-ți trimită notificări, să folosească bateria sau să-ți acceseze locația."</string>
<string name="work_apps_paused_edu_banner" msgid="8872412121608402058">"Aplicațiile pentru lucru sunt marcate și vizibile pentru administratorul IT"</string>
<string name="work_apps_paused_edu_accept" msgid="6377476824357318532">"OK"</string>
- <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Întrerupeți aplicațiile pentru lucru"</string>
- <string name="work_apps_enable_btn_text" msgid="1156432622148413741">"Activați aplicațiile pentru lucru"</string>
+ <string name="work_apps_pause_btn_text" msgid="4669288269140620646">"Întrerupe aplicațiile pentru lucru"</string>
+ <string name="work_apps_enable_btn_text" msgid="1156432622148413741">"Activează aplicațiile pentru lucru"</string>
<string name="developer_options_filter_hint" msgid="5896817443635989056">"Filtru"</string>
- <string name="search_pref_screen_title" msgid="3258959643336315962">"Căutați pe telefon"</string>
- <string name="search_pref_screen_title_tablet" msgid="5220319680451343959">"Căutați pe tabletă"</string>
+ <string name="search_pref_screen_title" msgid="3258959643336315962">"Caută pe telefon"</string>
+ <string name="search_pref_screen_title_tablet" msgid="5220319680451343959">"Caută pe tabletă"</string>
<string name="remote_action_failed" msgid="1383965239183576790">"Eșuare: <xliff:g id="WHAT">%1$s</xliff:g>"</string>
</resources>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 8b42a8f..1d25371 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -71,7 +71,7 @@
<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="remove_drop_target_label" msgid="7812859488053230776">"తీసివేయండి"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"అన్ఇన్స్టాల్ చేయండి"</string>
<string name="app_info_drop_target_label" msgid="692894985365717661">"యాప్ సమాచారం"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"ఇన్స్టాల్ చేయండి"</string>
@@ -118,7 +118,7 @@
<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>
+ <string name="abandoned_clean_this" msgid="7610119707847920412">"తీసివేయండి"</string>
<string name="abandoned_search" msgid="891119232568284442">"సెర్చ్"</string>
<string name="abandoned_promises_title" msgid="7096178467971716750">"ఈ యాప్ ఇన్స్టాల్ చేయబడలేదు"</string>
<string name="abandoned_promise_explanation" msgid="3990027586878167529">"ఈ ఐకాన్కు చెందిన యాప్ ఇన్స్టాల్ చేయలేదు. మీరు దీన్ని తీసివేయవచ్చు లేదా ఆ యాప్ కోసం సెర్చ్ చేసి, దాన్ని మాన్యువల్గా ఇన్స్టాల్ చేయవచ్చు."</string>
@@ -155,7 +155,7 @@
<string name="widget_resized" msgid="9130327887929620">"విడ్జెట్ పరిమాణం వెడల్పు <xliff:g id="NUMBER_0">%1$s</xliff:g>కి, ఎత్తు <xliff:g id="NUMBER_1">%2$s</xliff:g>కి మార్చబడింది"</string>
<string name="action_deep_shortcut" msgid="2864038805849372848">"షార్ట్కట్స్"</string>
<string name="shortcuts_menu_with_notifications_description" msgid="2676582286544232849">"షార్ట్కట్లు మరియు నోటిఫికేషన్లు"</string>
- <string name="action_dismiss_notification" msgid="5909461085055959187">"తీసివేయి"</string>
+ <string name="action_dismiss_notification" msgid="5909461085055959187">"తీసివేయండి"</string>
<string name="accessibility_close" msgid="2277148124685870734">"మూసివేస్తుంది"</string>
<string name="notification_dismissed" msgid="6002233469409822874">"నోటిఫికేషన్ తీసివేయబడింది"</string>
<string name="all_apps_personal_tab" msgid="4190252696685155002">"వ్యక్తిగతం"</string>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index e5b588c..3b71585 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -176,6 +176,10 @@
<!-- defaults to numColumns, if not specified -->
<attr name="hotseatColumnSpanTwoPanelPortrait" format="integer" />
+ <!-- Spacing to have at the end of the nav buttons in large screen 3 button nav,
+ defaults to @dimen/taskbar_button_margin_default -->
+ <attr name="inlineNavButtonsEndSpacing" format="reference" />
+
<attr name="dbFile" format="string" />
<attr name="defaultLayoutId" format="reference" />
<attr name="defaultSplitDisplayLayoutId" format="reference" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index dc80bc3..c8554ec 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>
@@ -363,6 +360,12 @@
<dimen name="taskbar_nav_buttons_size">0dp</dimen>
<dimen name="taskbar_contextual_button_margin">0dp</dimen>
<dimen name="taskbar_hotseat_nav_spacing">0dp</dimen>
+ <dimen name="taskbar_button_margin_default">0dp</dimen>
+ <dimen name="taskbar_button_space_inbetween">0dp</dimen>
+ <dimen name="taskbar_button_margin_5_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_4_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_4_4">0dp</dimen>
<!-- Size of the maximum radius for the enforced rounded rectangles. -->
<dimen name="enforced_rounded_corner_max_radius">16dp</dimen>
@@ -375,7 +378,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>
@@ -383,9 +385,6 @@
<dimen name="overview_grid_side_margin">0dp</dimen>
<dimen name="overview_grid_row_spacing">0dp</dimen>
<dimen name="overview_page_spacing">0dp</dimen>
- <dimen name="overview_minimum_next_prev_size">0dp</dimen>
- <item name="overview_max_scale" format="float" type="dimen">0.0</item>
- <item name="overview_modal_max_scale" format="float" type="dimen">0.0</item>
<dimen name="split_placeholder_size">72dp</dimen>
<dimen name="split_placeholder_inset">16dp</dimen>
<dimen name="split_placeholder_icon_size">44dp</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 5ee291b..0238e7d 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -26,7 +26,7 @@
launcher:numHotseatIcons="3"
launcher:dbFile="launcher_3_by_3.db"
launcher:defaultLayoutId="@xml/default_workspace_3x3"
- launcher:deviceCategory="phone|multi_display" >
+ launcher:deviceCategory="phone" >
<display-option
launcher:name="Super Short Stubby"
@@ -58,6 +58,7 @@
launcher:numFolderColumns="4"
launcher:numHotseatIcons="4"
launcher:dbFile="launcher_4_by_4.db"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_4_4"
launcher:defaultLayoutId="@xml/default_workspace_4x4"
launcher:deviceCategory="phone|multi_display" >
@@ -121,6 +122,7 @@
launcher:numFolderColumns="4"
launcher:numHotseatIcons="5"
launcher:dbFile="launcher.db"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_5_5"
launcher:defaultLayoutId="@xml/default_workspace_5x5"
launcher:deviceCategory="phone|multi_display" >
@@ -167,6 +169,7 @@
launcher:hotseatColumnSpanLandscape="4"
launcher:numAllAppsColumns="6"
launcher:isScalable="true"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_6_5"
launcher:devicePaddingId="@xml/paddings_6x5"
launcher:dbFile="launcher_6_by_5.db"
launcher:defaultLayoutId="@xml/default_workspace_6x5"
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index d09642a..366d372 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -20,10 +20,10 @@
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.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
+import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -34,15 +34,14 @@
import android.graphics.PointF;
import android.graphics.Rect;
import android.util.DisplayMetrics;
-import android.view.Gravity;
import android.view.Surface;
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.DevicePaddings.DevicePadding;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.GraphicsUtils;
import com.android.launcher3.icons.IconNormalizer;
-import com.android.launcher3.touch.PortraitPagedViewHandler;
import com.android.launcher3.uioverrides.ApiWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
@@ -110,8 +109,6 @@
public final int edgeMarginPx;
public final float workspaceContentScale;
- private float mWorkspaceSpringLoadShrunkTop;
- private float mWorkspaceSpringLoadShrunkBottom;
public final int workspaceSpringLoadedMinNextPageVisiblePx;
private final int extraSpace;
@@ -193,7 +190,6 @@
// Overview
public int overviewTaskMarginPx;
- public int overviewTaskMarginGridPx;
public int overviewTaskIconSizePx;
public int overviewTaskIconDrawableSizePx;
public int overviewTaskIconDrawableSizeGridPx;
@@ -204,12 +200,6 @@
public int overviewPageSpacing;
public int overviewRowSpacing;
public int overviewGridSideMargin;
- public final Rect overviewGridRect = new Rect();
- public final Rect overviewTaskRect = new Rect();
- public final float overviewTaskWorkspaceScale;
- public final Point overviewGridTaskDimension = new Point();
- public final Rect overviewModalTaskRect = new Rect();
- public final float overviewModalTaskScale;
// Widgets
public final PointF appWidgetScale = new PointF(1.0f, 1.0f);
@@ -228,7 +218,6 @@
// 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;
@@ -236,9 +225,6 @@
public DotRenderer mDotRendererWorkSpace;
public DotRenderer mDotRendererAllApps;
- // Tasks
- public final PointF taskDimension = new PointF();
-
// Taskbar
public boolean isTaskbarPresent;
// Whether Taskbar will inset the bottom of apps by taskbarSize.
@@ -424,36 +410,31 @@
if (areNavButtonsInline) {
/*
* 3 nav buttons +
+ * Spacing between nav buttons +
* Little space at the end for contextual buttons +
* Little space between icons and nav buttons
*/
hotseatBarEndOffset = 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
- + res.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin)
+ + 2 * res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween)
+ + res.getDimensionPixelSize(inv.inlineNavButtonsEndSpacing)
+ res.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing);
} else {
hotseatBarEndOffset = 0;
}
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.
@@ -492,104 +473,6 @@
mDotRendererWorkSpace = new DotRenderer(iconSizePx, dotPath, DEFAULT_DOT_SIZE);
mDotRendererAllApps = iconSizePx == allAppsIconSizePx ? mDotRendererWorkSpace :
new DotRenderer(allAppsIconSizePx, dotPath, DEFAULT_DOT_SIZE);
-
- // Grid and Task size calculations
- calculateGridSize();
- getTaskDimension();
- calculateTaskSize(res);
- calculateGridTaskSize();
- calculateModalTaskSize(res);
- overviewModalTaskScale =
- Math.min(overviewModalTaskRect.height() / (float) overviewTaskRect.height(),
- overviewModalTaskRect.width() / (float) overviewTaskRect.width());
- overviewTaskWorkspaceScale = (float) overviewTaskRect.height() / getCellLayoutHeight();
- }
-
- private void calculateGridSize() {
- int topMargin = overviewTaskThumbnailTopMarginPx;
- int bottomMargin = getOverviewActionsClaimedSpace();
- int sideMargin = overviewGridSideMargin;
-
- overviewGridRect.set(0, 0, widthPx, heightPx);
- overviewGridRect.inset(Math.max(mInsets.left, sideMargin), mInsets.top + topMargin,
- Math.max(mInsets.right, sideMargin), Math.max(mInsets.bottom, bottomMargin));
- }
-
- private void calculateTaskSize(Resources res) {
- int overviewMinNextPrevSize =
- res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size);
- float overviewMaxScale = res.getFloat(R.dimen.overview_max_scale);
- Rect containerRect = new Rect();
- if (isTablet) {
- containerRect.set(overviewGridRect);
- } else {
- int taskMargin = overviewTaskMarginPx;
- containerRect.set(0, 0, widthPx, heightPx);
- containerRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom);
- int minimumHorizontalPadding = overviewMinNextPrevSize + taskMargin;
- containerRect.inset(minimumHorizontalPadding, overviewTaskThumbnailTopMarginPx,
- minimumHorizontalPadding, getOverviewActionsClaimedSpace());
- }
- float scale = Math.min(
- containerRect.width() / taskDimension.x,
- containerRect.height() / taskDimension.y);
- scale = Math.min(scale, overviewMaxScale);
- int outWidth = Math.round(scale * taskDimension.x);
- int outHeight = Math.round(scale * taskDimension.y);
- Gravity.apply(Gravity.CENTER, outWidth, outHeight, containerRect, overviewTaskRect);
- }
-
- private void calculateGridTaskSize() {
- float rowHeight =
- (overviewTaskRect.height() + overviewTaskThumbnailTopMarginPx - overviewRowSpacing)
- / 2f;
-
- float scale = (rowHeight - overviewTaskThumbnailTopMarginPx) / taskDimension.y;
- overviewGridTaskDimension.set(
- Math.round(scale * taskDimension.x), Math.round(scale * taskDimension.y));
- }
-
- /**
- * Returns a Rect the size of a grid task with the correct positioning within the screen.
- *
- * @param isRecentsRtl is true when device is in LTR, false when in RTL, as grid tasks are only
- * supported on tablets, which use PortraitPagedViewHandler.
- */
- public Rect getOverviewGridTaskRect(boolean isRecentsRtl) {
- Rect outRect = new Rect();
- int gravity = Gravity.TOP;
- gravity |= isRecentsRtl ? Gravity.RIGHT : Gravity.LEFT;
- Gravity.apply(gravity, overviewGridTaskDimension.x, overviewGridTaskDimension.y,
- overviewTaskRect, outRect);
- return outRect;
- }
-
- private void calculateModalTaskSize(Resources res) {
- float overviewModalMaxScale = res.getFloat(R.dimen.overview_modal_max_scale);
- Rect potentialTaskRect = new Rect(0, 0, widthPx, heightPx);
- potentialTaskRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom);
- int minimumHorizontalPadding = Math.round(
- (availableWidthPx - overviewTaskRect.width() * overviewModalMaxScale) / 2);
- potentialTaskRect.inset(
- minimumHorizontalPadding,
- overviewTaskMarginPx,
- minimumHorizontalPadding,
- heightPx - overviewTaskRect.bottom - mInsets.bottom);
- float scale = Math.min(
- potentialTaskRect.width() / taskDimension.x,
- potentialTaskRect.height() / taskDimension.y);
- int outWidth = Math.round(scale * taskDimension.x);
- int outHeight = Math.round(scale * taskDimension.y);
- Gravity.apply(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, outWidth, outHeight,
- potentialTaskRect, overviewModalTaskRect);
- }
-
- private void getTaskDimension() {
- float taskHeight = heightPx;
- if (isTablet) {
- taskHeight -= taskbarSize;
- }
- taskDimension.set(widthPx, taskHeight);
}
/**
@@ -1025,40 +908,39 @@
* 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
@@ -1143,6 +1025,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
@@ -1156,10 +1039,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) {
@@ -1176,26 +1059,26 @@
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 += additionalQsbSpace;
} else {
- mHotseatBarPadding.left += additionalQsbSpace;
+ hotseatBarPadding.left += additionalQsbSpace;
}
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,
+ hotseatBarPadding.set(sideSpacing,
0,
sideSpacing,
getHotseatBarBottomPadding());
@@ -1207,7 +1090,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,
@@ -1215,7 +1098,7 @@
+ mInsets.right,
getHotseatBarBottomPadding());
}
- return mHotseatBarPadding;
+ return hotseatBarPadding;
}
/**
@@ -1353,7 +1236,6 @@
return "\t" + name + ": " + value + "px (" + dpiFromPx(value, mMetrics.densityDpi) + "dp)";
}
- // LINT.IfChange
/** Dumps various DeviceProfile variables to the specified writer. */
public void dump(Context context, String prefix, PrintWriter writer) {
writer.println(prefix + "DeviceProfile:");
@@ -1440,15 +1322,13 @@
writer.println(prefix + pxToDpStr("allAppsBorderSpacePxX", allAppsBorderSpacePx.x));
writer.println(prefix + pxToDpStr("allAppsBorderSpacePxY", allAppsBorderSpacePx.y));
writer.println(prefix + "\tnumShownAllAppsColumns: " + numShownAllAppsColumns);
- writer.println(
- prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding));
+ writer.println(prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding));
writer.println(prefix + pxToDpStr("allAppsLeftRightMargin", allAppsLeftRightMargin));
writer.println(prefix + pxToDpStr("hotseatBarSizePx", hotseatBarSizePx));
writer.println(prefix + "\tinv.hotseatColumnSpan: " + inv.hotseatColumnSpan[mTypeIndex]);
writer.println(prefix + pxToDpStr("hotseatCellHeightPx", hotseatCellHeightPx));
- writer.println(
- prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx));
+ writer.println(prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx));
writer.println(prefix + pxToDpStr("hotseatBarSidePaddingStartPx",
hotseatBarSidePaddingStartPx));
writer.println(prefix + pxToDpStr("hotseatBarSidePaddingEndPx",
@@ -1458,13 +1338,15 @@
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);
@@ -1479,14 +1361,12 @@
writer.println(prefix + pxToDpStr("workspacePadding.left", workspacePadding.left));
writer.println(prefix + pxToDpStr("workspacePadding.top", workspacePadding.top));
writer.println(prefix + pxToDpStr("workspacePadding.right", workspacePadding.right));
- writer.println(
- prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom));
+ writer.println(prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom));
writer.println(prefix + pxToDpStr("iconScale", iconScale));
writer.println(prefix + pxToDpStr("cellScaleToFit ", cellScaleToFit));
writer.println(prefix + pxToDpStr("extraSpace", extraSpace));
- writer.println(
- prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale));
+ writer.println(prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale));
if (inv.devicePaddings != null) {
int unscaledExtraSpace = (int) (extraSpace / iconScale);
@@ -1497,8 +1377,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));
@@ -1516,78 +1394,22 @@
writer.println(prefix + pxToDpStr("overviewRowSpacing", overviewRowSpacing));
writer.println(prefix + pxToDpStr("overviewGridSideMargin", overviewGridSideMargin));
- writer.println(
- prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx));
+ writer.println(prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx));
writer.println(prefix + pxToDpStr("dropTargetBarSizePx", dropTargetBarSizePx));
- writer.println(prefix
- + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
+ 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()));
-
- writer.println(prefix + pxToDpStr("overviewGridRect.left", overviewGridRect.left));
- writer.println(prefix + pxToDpStr("overviewGridRect.top", overviewGridRect.top));
- writer.println(prefix + pxToDpStr("overviewGridRect.right", overviewGridRect.right));
- writer.println(prefix
- + pxToDpStr("overviewGridRect.bottom", overviewGridRect.bottom));
- writer.println(prefix + pxToDpStr("taskDimension.x", taskDimension.x));
- writer.println(prefix + pxToDpStr("taskDimension.y", taskDimension.y));
- writer.println(prefix + pxToDpStr("overviewTaskRect.left", overviewTaskRect.left));
- writer.println(prefix + pxToDpStr("overviewTaskRect.top", overviewTaskRect.top));
- writer.println(prefix + pxToDpStr("overviewTaskRect.right", overviewTaskRect.right));
- writer.println(prefix
- + pxToDpStr("overviewTaskRect.bottom", overviewTaskRect.bottom));
- writer.println(prefix
- + pxToDpStr("overviewGridTaskDimension.x", overviewGridTaskDimension.x));
- writer.println(prefix
- + pxToDpStr("overviewGridTaskDimension.y", overviewGridTaskDimension.y));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.left", overviewModalTaskRect.left));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.top", overviewModalTaskRect.top));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.right", overviewModalTaskRect.right));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.bottom", overviewModalTaskRect.bottom));
- boolean isRecentsRtl =
- PortraitPagedViewHandler.PORTRAIT.getRecentsRtlSetting(context.getResources());
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").left",
- getOverviewGridTaskRect(isRecentsRtl).left));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").top",
- getOverviewGridTaskRect(isRecentsRtl).top));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").right",
- getOverviewGridTaskRect(isRecentsRtl).right));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").bottom",
- getOverviewGridTaskRect(isRecentsRtl).bottom));
- writer.println(
- prefix + pxToDpStr("overviewTaskWorkspaceScale", overviewTaskWorkspaceScale));
- writer.println(prefix + pxToDpStr("overviewModalTaskScale", overviewModalTaskScale));
}
- // 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());
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index c1304d4..d64cb26 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.
@@ -175,7 +175,7 @@
secondButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
verticalPadding);
- float scale = dp.getWorkspaceSpringLoadScale();
+ float scale = dp.getWorkspaceSpringLoadScale(mLauncher);
int scaledPanelWidth = (int) (dp.getCellLayoutWidth() * scale);
int availableWidth;
@@ -232,7 +232,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/FastScrollRecyclerView.java b/src/com/android/launcher3/FastScrollRecyclerView.java
index 94903f2..747b755 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/FastScrollRecyclerView.java
@@ -57,7 +57,9 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- bindFastScrollbar();
+ if (mScrollbar == null || !mScrollbar.hasRecyclerView()) {
+ bindFastScrollbar();
+ }
}
public void bindFastScrollbar() {
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 2085b84..9b01734 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -50,6 +50,7 @@
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;
@@ -127,6 +128,7 @@
public PointF[] borderSpaces;
public float folderBorderSpace;
public float[] hotseatBorderSpaces;
+ public int inlineNavButtonsEndSpacing;
public float[] horizontalMargin;
@@ -339,6 +341,8 @@
devicePaddingId = closestProfile.devicePaddingId;
this.deviceType = deviceType;
+ inlineNavButtonsEndSpacing = closestProfile.inlineNavButtonsEndSpacing;
+
mExtraAttrs = closestProfile.extraAttrs;
iconSize = displayOption.iconSizes;
@@ -735,6 +739,7 @@
private final int[] hotseatColumnSpan = new int[COUNT_SIZES];
+ private int inlineNavButtonsEndSpacing;
private final String dbFile;
private final int defaultLayoutId;
@@ -785,6 +790,9 @@
R.styleable.GridDisplayOption_hotseatColumnSpanTwoPanelPortrait,
numColumns);
+ inlineNavButtonsEndSpacing =
+ a.getResourceId(R.styleable.GridDisplayOption_inlineNavButtonsEndSpacing,
+ R.dimen.taskbar_button_margin_default);
numFolderRows = a.getInt(
R.styleable.GridDisplayOption_numFolderRows, numRows);
numFolderColumns = a.getInt(
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 528613c..38b46b0 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -60,7 +60,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;
@@ -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;
@@ -513,7 +512,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;
@@ -636,7 +634,10 @@
@Override
public void onIdpChanged(boolean modelPropertiesChanged) {
- initDeviceProfile(mDeviceProfile.inv);
+ if (!initDeviceProfile(mDeviceProfile.inv)) {
+ return;
+ }
+
dispatchDeviceProfileChanged();
reapplyUi();
mDragLayer.recreateControllers();
@@ -659,9 +660,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 +678,7 @@
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);
+ return true;
}
public RotationHelper getRotationHelper() {
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index de0d300..f790789 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -63,7 +63,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;
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index ea6a919..4532ed4 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;
@@ -208,14 +208,18 @@
return (getVisibleElements(launcher) & elements) == elements;
}
- /** Returns whether taskbar is stashed and thus should replace hotseat with a handle */
+ /**
+ * Returns whether taskbar is stashed and thus should either:
+ * 1) replace hotseat or taskbar icons with a handle in gesture navigation mode or
+ * 2) fade out the hotseat or taskbar icons in 3-button navigation mode.
+ */
public boolean isTaskbarStashed(Launcher launcher) {
return false;
}
/** Returns whether taskbar is aligned with the hotseat vs position inside apps */
public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
- return !isTaskbarStashed(launcher);
+ return true;
}
/**
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/Utilities.java b/src/com/android/launcher3/Utilities.java
index dc8c739..d0dbaf4 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -88,6 +88,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 +526,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());
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e6dea8f..83d0752 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;
@@ -169,7 +168,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 +213,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 +241,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;
@@ -1248,7 +1247,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 +1978,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 +2010,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;
@@ -2297,7 +2295,7 @@
}
}
- private void cleanupFolderCreation() {
+ protected void cleanupFolderCreation() {
if (mFolderCreateBg != null) {
mFolderCreateBg.animateToRest();
}
@@ -2310,7 +2308,7 @@
}
}
- private void cleanupReorder(boolean cancelAlarm) {
+ protected void cleanupReorder(boolean cancelAlarm) {
// Any pending reorders are canceled
if (cancelAlarm) {
mReorderAlarm.cancelAlarm();
@@ -2402,26 +2400,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 +2411,34 @@
}
}
+ 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)) {
+
+ 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.
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 53a6fd7..e33e44e 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -16,7 +16,6 @@
package com.android.launcher3.allapps;
import android.content.Context;
-import android.content.Intent;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -32,7 +31,6 @@
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;
@@ -77,13 +75,6 @@
/** 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);
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/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index de34416..31e3890 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -24,13 +24,10 @@
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 +36,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;
@@ -89,10 +85,6 @@
}
};
- // The empty-search result background
- protected AllAppsBackgroundDrawable mEmptySearchBackground;
- protected int mEmptySearchBackgroundTopOffset;
-
public AllAppsRecyclerView(Context context) {
this(context, null);
}
@@ -108,9 +100,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,7 +121,6 @@
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));
@@ -143,10 +131,6 @@
@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 +142,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
@@ -208,16 +172,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.
*/
@@ -393,22 +347,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 a86faab..bdab03f 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -232,6 +232,7 @@
// 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();
});
}
@@ -239,7 +240,6 @@
if (Float.compare(mProgress, targetProgress) == 0) {
setAlphas(toState, config, builder);
// Fail fast
- onProgressAnimationEnd();
return;
}
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..6990e57 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;
}
/**
@@ -139,15 +132,12 @@
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 +145,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 +175,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 +201,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 +222,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/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 6539c05..52d8f63 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);
}
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index 4eceb71..d2d7a6c 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -15,6 +15,7 @@
*/
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;
@@ -44,10 +45,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
@@ -63,11 +70,23 @@
@Override
public void execute(LauncherAppState app, BgDataModel dataModel, 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/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/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/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/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
index 31ef2e5..4c0f1ae 100644
--- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
+++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
@@ -36,7 +36,7 @@
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;
diff --git a/src/com/android/launcher3/model/AllAppsList.java b/src/com/android/launcher3/model/AllAppsList.java
index 4875d83..95150dc 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;
@@ -270,8 +272,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/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java
index 5a220f7..229bb2d 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;
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index ae5b66a..87e8ebf 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -291,12 +291,16 @@
// from the db
if (TextUtils.isEmpty(info.title)) {
- info.title = getTitle();
- }
+ if (loadIcon) {
+ info.title = getTitle();
- // fall back to the class name of the activity
- if (info.title == null) {
- info.title = componentName.getClassName();
+ // fall back to the class name of the activity
+ if (info.title == null) {
+ info.title = componentName.getClassName();
+ }
+ } else {
+ info.title = "";
+ }
}
info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user);
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/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java
index 618f926..9da6670 100644
--- a/src/com/android/launcher3/pm/InstallSessionHelper.java
+++ b/src/com/android/launcher3/pm/InstallSessionHelper.java
@@ -39,7 +39,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;
diff --git a/src/com/android/launcher3/pm/InstallSessionTracker.java b/src/com/android/launcher3/pm/InstallSessionTracker.java
index 75cf7a8..b16aaa2 100644
--- a/src/com/android/launcher3/pm/InstallSessionTracker.java
+++ b/src/com/android/launcher3/pm/InstallSessionTracker.java
@@ -30,7 +30,7 @@
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;
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 38b62d4..fd8b2e5 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -23,19 +23,21 @@
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
+import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
+import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.UiThreadHelper;
/**
* Utility class to manage launcher rotation
*/
public class RotationHelper implements OnSharedPreferenceChangeListener,
- DeviceProfile.OnDeviceProfileChangeListener {
+ DisplayController.DisplayInfoChangeListener {
private static final String TAG = "RotationHelper";
@@ -119,8 +121,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 +159,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 +170,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);
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index a205ab5..3ca8ba2 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -52,7 +52,7 @@
}
float shrunkTop = grid.getCellLayoutSpringLoadShrunkTop();
- float scale = grid.getWorkspaceSpringLoadScale();
+ float scale = grid.getWorkspaceSpringLoadScale(launcher);
float halfHeight = ws.getHeight() / 2;
float myCenter = ws.getTop() + halfHeight;
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..d3c9bc9 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;
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 71%
rename from src/com/android/launcher3/ResourceUtils.java
rename to src/com/android/launcher3/testing/shared/ResourceUtils.java
index f709aca..551aeaf 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";
@@ -71,7 +72,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 98%
rename from src/com/android/launcher3/testing/TestProtocol.java
rename to src/com/android/launcher3/testing/shared/TestProtocol.java
index 9bc9067..67efb58 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.
@@ -136,8 +136,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/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index e95a787..5fa30bc 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..73f994f 100644
--- a/src/com/android/launcher3/touch/ItemLongClickListener.java
+++ b/src/com/android/launcher3/touch/ItemLongClickListener.java
@@ -36,7 +36,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;
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index fa4eb70..9ac1c0e 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -523,6 +523,7 @@
iconParams.rightMargin = -taskIconHeight - taskIconMargin / 2;
iconParams.leftMargin = 0;
iconParams.topMargin = thumbnailTopMargin / 2;
+ iconParams.bottomMargin = 0;
}
@Override
@@ -580,4 +581,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..1a8d355 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;
@@ -242,6 +242,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..dd9f642 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -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;
@@ -658,8 +658,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 +757,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..387e980 100644
--- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
@@ -216,6 +216,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..94f9f25 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -19,7 +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.testing.shared.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;
@@ -46,7 +46,7 @@
import androidx.annotation.AnyThread;
import androidx.annotation.UiThread;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.util.window.CachedDisplayInfo;
@@ -278,11 +278,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<>();
@@ -310,7 +310,7 @@
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");
diff --git a/src/com/android/launcher3/util/MultiValueAlpha.java b/src/com/android/launcher3/util/MultiValueAlpha.java
index 11cd07c..4b46a0a 100644
--- a/src/com/android/launcher3/util/MultiValueAlpha.java
+++ b/src/com/android/launcher3/util/MultiValueAlpha.java
@@ -23,6 +23,7 @@
import com.android.launcher3.anim.AlphaUpdateListener;
+import java.io.PrintWriter;
import java.util.Arrays;
import java.util.function.Consumer;
@@ -78,6 +79,29 @@
mUpdateVisibility = updateVisibility;
}
+ /**
+ * Dumps the alpha channel values to the given PrintWriter
+ *
+ * @param prefix String to be used before every line
+ * @param pw PrintWriter where the logs should be dumped
+ * @param label String used to help identify this object
+ * @param alphaIndexLabels Strings that represent each alpha channel, these should be entered
+ * in the order of the indexes they represent, starting from 0.
+ */
+ public void dump(String prefix, PrintWriter pw, String label, String... alphaIndexLabels) {
+ pw.println(prefix + label);
+
+ String innerPrefix = prefix + '\t';
+ for (int i = 0; i < alphaIndexLabels.length; i++) {
+ if (i >= mMyProperties.length) {
+ pw.println(innerPrefix + alphaIndexLabels[i] + " given for alpha index " + i
+ + " however there are only " + mMyProperties.length + " alpha channels.");
+ continue;
+ }
+ pw.println(innerPrefix + alphaIndexLabels[i] + "=" + getProperty(i).getValue());
+ }
+ }
+
public class AlphaProperty {
private final int mMyMask;
diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java
index d5a065a..582ff8d 100644
--- a/src/com/android/launcher3/util/window/WindowManagerProxy.java
+++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java
@@ -17,13 +17,13 @@
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.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.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.Utilities.dpiFromPx;
import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
import static com.android.launcher3.util.RotationUtils.deltaRotation;
@@ -48,7 +48,7 @@
import android.view.WindowMetrics;
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.MainThreadInitializedObject;
import com.android.launcher3.util.ResourceBasedOverride;
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..6e6512d 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -174,6 +174,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);
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 8962c4f..5cffd48 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -42,7 +42,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;
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
index 98a960c..5ce8fcf 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;
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..0d9198f 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;
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
index 6715749..c8b5e2f 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -17,7 +17,6 @@
package com.android.launcher3.uioverrides;
import android.app.Person;
-import android.content.Context;
import android.content.pm.ShortcutInfo;
import com.android.launcher3.Utilities;
@@ -29,11 +28,4 @@
public static Person[] getPersons(ShortcutInfo si) {
return Utilities.EMPTY_PERSON_ARRAY;
}
-
- /**
- * Returns the minimum space that should be left empty at the end of hotseat
- */
- public static int getHotseatEndOffset(Context context) {
- return 0;
- }
}
diff --git a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
index ba813c0..4732fc1 100644
--- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
+++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
@@ -17,11 +17,13 @@
import android.content.Context
import android.graphics.PointF
+import android.graphics.Rect
import androidx.test.core.app.ApplicationProvider
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,7 +39,9 @@
protected var transposeLayoutWithOrientation: Boolean = false
protected var useTwoPanels: Boolean = false
protected var isGestureMode: Boolean = true
- protected var isRecentsRtl: Boolean = true
+ protected var devicePaddingsMock: DevicePaddings = mock(DevicePaddings::class.java)
+ protected var staticdevicePaddingsMock: DevicePaddings.DevicePadding =
+ mock(DevicePaddings.DevicePadding::class.java)
@Before
fun setUp() {
@@ -61,111 +65,287 @@
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
+
+ numFolderRows = 3
+ numFolderColumns = 3
+ 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()
+ folderBorderSpace = 16f
+ hotseatBorderSpaces = FloatArray(4) { 16f }
+ 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
+
+ numShrunkenHotseatIcons = 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()
+ hotseatBorderSpaces = floatArrayOf(58f, 50.4f, 58f, 58f)
+ 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
+
+ numShrunkenHotseatIcons = 5
+
+ 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 }
- 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
+
+ numFolderRows = 3
+ numFolderColumns = 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()
+ folderBorderSpace = 16f
+ hotseatBorderSpaces = floatArrayOf(36f, 36f, 18f, 23.3f)
+ 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
+
+ numShrunkenHotseatIcons = 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(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
index 5dabb33..95651ca 100644
--- a/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
+++ b/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
@@ -34,7 +34,7 @@
@Test
fun hotseat_size_is_shrunk_if_needed_when_large_screen() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
inlineQsb = booleanArrayOf(
false,
@@ -64,7 +64,7 @@
@Test
fun hotseat_size_is_shrunk_even_in_portrait_when_large_screen() {
initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
inlineQsb = booleanArrayOf(
false,
@@ -90,7 +90,7 @@
@Test
fun hotseat_size_is_default_when_small_screen() {
initializeVarsForPhone()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
}
useTwoPanels = true
@@ -103,7 +103,7 @@
@Test
fun hotseat_size_is_not_shrunk_on_gesture_tablet() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
@@ -129,7 +129,7 @@
@Test
fun hotseat_size_is_shrunk_if_needed_on_tablet() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
@@ -159,7 +159,7 @@
@Test
fun hotseat_size_is_shrunk_even_in_portrait_on_tablet() {
initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
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..960d27d 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");
@@ -88,6 +95,7 @@
@After
public void tearDown() {
mModelHelper.destroy();
+ TestProtocol.sDebugTracing = false;
}
private CacheDataUpdatedTask newTask(int op, String... pkg) {
@@ -111,6 +119,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/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 1f6e1ec..304153f 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;
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/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..d221259 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
@@ -22,7 +22,7 @@
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;
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/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/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..04167839 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -16,9 +16,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.testing.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
+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 +27,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.
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 5f92097..caaeef8 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,9 +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.launcher3.testing.shared.ResourceUtils;
+import com.android.launcher3.testing.shared.TestInformationRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.systemui.shared.system.ContextUtils;
import com.android.systemui.shared.system.QuickStepContract;
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..72a39df 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -24,7 +24,7 @@
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;
diff --git a/tests/tapl/com/android/launcher3/tapl/Taskbar.java b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
index b5a08c3..5d9be36 100644
--- a/tests/tapl/com/android/launcher3/tapl/Taskbar.java
+++ b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
@@ -15,8 +15,8 @@
*/
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.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;
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..efbdb23 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;