Merge "Use overridden default xml for TwoPanelWorkspaceTest" into tm-qpr-dev
diff --git a/quickstep/res/layout/taskbar_all_apps.xml b/quickstep/res/layout/taskbar_all_apps.xml
index c7679be..976cd9e 100644
--- a/quickstep/res/layout/taskbar_all_apps.xml
+++ b/quickstep/res/layout/taskbar_all_apps.xml
@@ -27,40 +27,5 @@
android:clipChildren="true"
android:clipToPadding="false"
android:focusable="false"
- android:saveEnabled="false"
- android:theme="?attr/allAppsTheme">
-
- <include
- layout="@layout/all_apps_bottom_sheet_background"
- android:visibility="gone" />
-
- <include
- layout="@layout/search_results_rv_layout"
- android:visibility="gone" />
-
- <include
- layout="@layout/all_apps_rv_layout"
- android:visibility="gone" />
-
- <com.android.launcher3.allapps.FloatingHeaderView
- android:id="@+id/all_apps_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/search_container_all_apps"
- android:clipToPadding="false"
- android:orientation="vertical">
-
- <include layout="@layout/floating_header_content" />
-
- <include layout="@layout/all_apps_personal_work_tabs" />
- </com.android.launcher3.allapps.FloatingHeaderView>
-
- <com.android.launcher3.taskbar.allapps.TaskbarAllAppsFallbackSearchContainer
- android:id="@+id/search_container_all_apps"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:visibility="gone" />
-
- <include layout="@layout/all_apps_fast_scroller" />
- </com.android.launcher3.taskbar.allapps.TaskbarAllAppsContainerView>
+ android:saveEnabled="false" />
</com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView>
diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml
index 1a63592..e844ec1 100644
--- a/quickstep/res/values-az/strings.xml
+++ b/quickstep/res/values-az/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Tapşırıq panelində təhsil"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Tapşırıq panelindəki təlim bölməsi görünür"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Tapşırıq panelindəki təlim bölməsi bağlanıb"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Eyni anda 2 tətbiqi istifadə etmək üçün yan tərəfə çəkin"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Tapşırıq panelini göstərmək üçün azca yuxarı sürüşdürün"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"Tapşırıq paneli rejiminizə əsasən tətbiqlər təklif edir"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Sonra"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Geri"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Bağlayın"</string>
diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml
index 32b98c9..8b1640d 100644
--- a/quickstep/res/values-bs/strings.xml
+++ b/quickstep/res/values-bs/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Edukacija o traci zadataka"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Edukacija o programskoj traci je prikazana"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Edukacija o programskoj traci je zatvorena"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Povucite u stranu za istovremeno korištenje 2 aplikacije"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Kratki pokret prema gore za prikaz trake sa zadacima"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"Traka sa zadacima predlaže aplikacije na temelju vaše rutine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Naprijed"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Nazad"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml
index fc8e7b0..807ce43 100644
--- a/quickstep/res/values-el/strings.xml
+++ b/quickstep/res/values-el/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Πληροφορίες χρήσης της Γραμμής εργαλείων"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Η εκπαίδευση για τη γραμμή εργασιών εμφανίστηκε"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Η εκπαίδευση για τη γραμμή εργασιών έκλεισε"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Σύρετε στο πλάι για ταυτόχρονη χρήση δύο εφαρμογών"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Σύρετε σύντομα προς τα πάνω για εμφάνιση γραμμής εργαλείων"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"Η γραμμή εργαλείων συνιστά εφαρμογές βάσει της ρουτίνας σας"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Επόμενο"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Πίσω"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Κλείσιμο"</string>
diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml
index c5daa61..414593a 100644
--- a/quickstep/res/values-en-rAU/strings.xml
+++ b/quickstep/res/values-en-rAU/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Taskbar education"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Drag to the side to use two apps at once"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Short swipe up to show the taskbar"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"The taskbar suggests apps based on your routine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml
index 4ab5fa3..41fb803 100644
--- a/quickstep/res/values-en-rCA/strings.xml
+++ b/quickstep/res/values-en-rCA/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Taskbar education"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Drag to the side to use 2 apps at once"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Short swipe up to show the taskbar"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"The taskbar suggests apps based on your routine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml
index c5daa61..414593a 100644
--- a/quickstep/res/values-en-rGB/strings.xml
+++ b/quickstep/res/values-en-rGB/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Taskbar education"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Drag to the side to use two apps at once"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Short swipe up to show the taskbar"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"The taskbar suggests apps based on your routine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml
index c5daa61..414593a 100644
--- a/quickstep/res/values-en-rIN/strings.xml
+++ b/quickstep/res/values-en-rIN/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Taskbar education"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Drag to the side to use two apps at once"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Short swipe up to show the taskbar"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"The taskbar suggests apps based on your routine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
diff --git a/quickstep/res/values-en-rXC/strings.xml b/quickstep/res/values-en-rXC/strings.xml
index 5d169df..45ce0c1 100644
--- a/quickstep/res/values-en-rXC/strings.xml
+++ b/quickstep/res/values-en-rXC/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Taskbar education"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Taskbar education appeared"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Taskbar education closed"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Drag to the side to use 2 apps at once"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Short swipe up to show the taskbar"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"The taskbar suggests apps based on your routine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Next"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Back"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Close"</string>
diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml
index 326e499..dd7de8c 100644
--- a/quickstep/res/values-hr/strings.xml
+++ b/quickstep/res/values-hr/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Upute za traku sa zadacima"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"Upute za programsku traku su se pojavile"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"Upute za programsku traku su zatvorene"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Povucite u stranu za istovremeno korištenje 2 aplikacije"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Kratki pokret prema gore za prikaz trake sa zadacima"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"Traka sa zadacima predlaže aplikacije na temelju vaše rutine"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Dalje"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Natrag"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Zatvori"</string>
diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml
index 9ba1bd0..5c34ef4 100644
--- a/quickstep/res/values-ne/strings.xml
+++ b/quickstep/res/values-ne/strings.xml
@@ -78,10 +78,8 @@
<string name="allset_title" msgid="5021126669778966707">"सबै तयार भयो!"</string>
<string name="allset_hint" msgid="2384632994739392447">"होममा जान माथितिर स्वाइप गर्नुहोस्"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"आफ्नो होम स्क्रिनमा जान होम बटनमा ट्याप गर्नुहोस्"</string>
- <!-- no translation found for allset_description_generic (5385500062202019855) -->
- <skip />
- <!-- no translation found for default_device_name (6660656727127422487) -->
- <skip />
+ <string name="allset_description_generic" msgid="5385500062202019855">"तपाईं अब आफ्नो <xliff:g id="DEVICE">%1$s</xliff:g> चलाउन थाल्न सक्नुहुन्छ"</string>
+ <string name="default_device_name" msgid="6660656727127422487">"डिभाइस"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"सिस्टम नेभिगेसनसम्बन्धी सेटिङ"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"सेयर गर्नुहोस्"</string>
<string name="action_screenshot" msgid="8171125848358142917">"स्क्रिनसट"</string>
@@ -94,8 +92,7 @@
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"रद्द गर्नुहोस्"</string>
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"स्किप गर्नु…"</string>
<string name="accessibility_rotate_button" msgid="4771825231336502943">"स्क्रिन घुमाउनुहोस्"</string>
- <!-- no translation found for taskbar_edu_a11y_title (5417986057866415355) -->
- <skip />
+ <string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"टास्कबार एजुकेसन"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"टास्कबार एजुकेसन देखिएको छ"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"टास्कबार एजुकेसन बन्द गरिएको छ"</string>
<!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
@@ -115,10 +112,8 @@
<string name="taskbar_button_recents" msgid="7273376136216613134">"हालसालैका बटनहरू"</string>
<string name="taskbar_button_notifications" msgid="7471740351507357318">"सूचनाहरू"</string>
<string name="taskbar_button_quick_settings" msgid="227662894293189391">"द्रुत सेटिङ"</string>
- <!-- no translation found for taskbar_a11y_title (6432169809852243110) -->
- <skip />
- <!-- no translation found for taskbar_phone_a11y_title (4933360237131229395) -->
- <skip />
+ <string name="taskbar_a11y_title" msgid="6432169809852243110">"टास्कबार"</string>
+ <string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"नेभिगेसन बार"</string>
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"सिरान/बायाँतिर सार्नुहोस्"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"फेद/दायाँतिर सार्नुहोस्"</string>
</resources>
diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml
index b0d6499..fbd5b78 100644
--- a/quickstep/res/values-pt/strings.xml
+++ b/quickstep/res/values-pt/strings.xml
@@ -95,12 +95,9 @@
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"Informações sobre a barra de tarefas"</string>
<string name="taskbar_edu_opened" msgid="3950252793551919129">"As dicas sobre a barra de tarefas foram abertas"</string>
<string name="taskbar_edu_closed" msgid="126643734478892862">"As dicas sobre a barra de tarefas foram fechadas"</string>
- <!-- no translation found for taskbar_edu_splitscreen (5563823414110661454) -->
- <skip />
- <!-- no translation found for taskbar_edu_stashing (2805035263048176462) -->
- <skip />
- <!-- no translation found for taskbar_edu_suggestions (1416699696825090402) -->
- <skip />
+ <string name="taskbar_edu_splitscreen" msgid="5563823414110661454">"Arraste para o lado para usar dois apps ao mesmo tempo"</string>
+ <string name="taskbar_edu_stashing" msgid="2805035263048176462">"Deslize para cima para mostrar a barra de tarefas"</string>
+ <string name="taskbar_edu_suggestions" msgid="1416699696825090402">"A barra de tarefas sugere apps com base na sua rotina"</string>
<string name="taskbar_edu_next" msgid="4007618274426775841">"Próxima"</string>
<string name="taskbar_edu_previous" msgid="459202320127201702">"Voltar"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"Fechar"</string>
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
index 70405d9..eeca329 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
@@ -17,6 +17,7 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
import android.view.WindowInsets;
import com.android.launcher3.DeviceProfile;
@@ -43,6 +44,19 @@
}
@Override
+ protected View inflateSearchBox() {
+ // Remove top padding of header, since we do not have any search
+ mHeader.setPadding(mHeader.getPaddingLeft(), 0,
+ mHeader.getPaddingRight(), mHeader.getPaddingBottom());
+
+ TaskbarAllAppsFallbackSearchContainer searchView =
+ new TaskbarAllAppsFallbackSearchContainer(getContext(), null);
+ searchView.setId(R.id.search_container_all_apps);
+ searchView.setVisibility(GONE);
+ return searchView;
+ }
+
+ @Override
protected boolean isSearchSupported() {
return false;
}
@@ -53,4 +67,10 @@
// TODO(b/240670050): Remove this and add header protection for the taskbar entrypoint.
mBottomSheetBackground.setBackgroundResource(R.drawable.bg_rounded_corner_bottom_sheet);
}
+
+ @Override
+ public boolean isInAllApps() {
+ // All apps is always open
+ return true;
+ }
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
index ebaf60a..38b6dfd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
@@ -21,9 +21,6 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
-import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.dot.DotInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.popup.PopupDataProvider;
@@ -137,10 +134,4 @@
@Override
public void onPopupVisibilityChanged(boolean isVisible) {}
-
- @Override
- public SearchAdapterProvider<?> createSearchAdapterProvider(
- ActivityAllAppsContainerView<?> appsView) {
- return new DefaultSearchAdapterProvider(this);
- }
}
diff --git a/res/drawable/bg_all_apps_searchbox.xml b/res/drawable/bg_all_apps_searchbox.xml
index c324927..3c321e4 100644
--- a/res/drawable/bg_all_apps_searchbox.xml
+++ b/res/drawable/bg_all_apps_searchbox.xml
@@ -15,5 +15,6 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="?attr/popupColorPrimary" />
- <corners android:radius="2dp" />
+ <corners android:radius="@dimen/rounded_button_radius" />
+ <stroke android:color="?attr/allappsHeaderProtectionColor" android:width=".5dp" />
</shape>
\ No newline at end of file
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index f8a871a..655c75d 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -17,13 +17,9 @@
will bake the left/right padding into that view's background itself. -->
<com.android.launcher3.allapps.LauncherAllAppsContainerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/apps_view"
- android:theme="?attr/allAppsTheme"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="true"
android:clipToPadding="false"
android:focusable="false"
- android:saveEnabled="false">
-
- <include layout="@layout/all_apps_content" />
-</com.android.launcher3.allapps.LauncherAllAppsContainerView>
\ No newline at end of file
+ android:saveEnabled="false" />
\ No newline at end of file
diff --git a/res/layout/all_apps_content.xml b/res/layout/all_apps_content.xml
index 773ab8d..925f4d9 100644
--- a/res/layout/all_apps_content.xml
+++ b/res/layout/all_apps_content.xml
@@ -34,6 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
+ android:layout_below="@id/search_container_all_apps"
android:paddingTop="@dimen/all_apps_header_top_padding"
android:paddingBottom="@dimen/all_apps_header_bottom_padding"
android:orientation="vertical" >
@@ -44,15 +45,5 @@
</com.android.launcher3.allapps.FloatingHeaderView>
- <View
- android:id="@+id/search_protection"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"
- android:forceHasOverlappingRendering="false" />
-
- <include layout="@layout/search_container_all_apps" />
-
<include layout="@layout/all_apps_fast_scroller" />
-
</merge>
\ No newline at end of file
diff --git a/res/layout/search_container_all_apps.xml b/res/layout/search_container_all_apps.xml
index b46298c..db218c3 100644
--- a/res/layout/search_container_all_apps.xml
+++ b/res/layout/search_container_all_apps.xml
@@ -21,7 +21,6 @@
android:layout_centerHorizontal="true"
android:layout_gravity="top|center_horizontal"
android:background="@drawable/bg_all_apps_searchbox"
- android:elevation="1dp"
android:focusableInTouchMode="true"
android:gravity="center"
android:hint="@string/all_apps_search_bar_hint"
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index 4be2e45..f48f3c0 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -42,8 +42,7 @@
android:contentDescription="@string/all_apps_button_label"
android:onClick="onAppsButtonClicked" />
- <view
- class="com.android.launcher3.allapps.SecondaryLauncherAllAppsContainerView"
+ <com.android.launcher3.allapps.SecondaryLauncherAllAppsContainerView
android:id="@+id/apps_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -53,57 +52,5 @@
android:saveEnabled="false"
android:layout_gravity="bottom|end"
android:background="@drawable/round_rect_primary"
- android:visibility="invisible" >
-
- <include
- layout="@layout/all_apps_bottom_sheet_background"
- android:visibility="gone" />
-
- <include
- layout="@layout/search_results_rv_layout"
- android:visibility="gone" />
-
- <include
- layout="@layout/all_apps_rv_layout"
- android:visibility="gone" />
-
- <com.android.launcher3.allapps.FloatingHeaderView
- android:id="@+id/all_apps_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/search_container_all_apps"
- android:clipToPadding="false"
- android:paddingTop="@dimen/all_apps_header_top_padding"
- android:orientation="vertical" >
-
- <include layout="@layout/floating_header_content" />
- <include layout="@layout/all_apps_personal_work_tabs" />
- </com.android.launcher3.allapps.FloatingHeaderView>
-
- <com.android.launcher3.allapps.search.AppsSearchContainerLayout
- android:id="@id/search_container_all_apps"
- android:layout_width="match_parent"
- android:layout_height="@dimen/all_apps_search_bar_field_height"
- android:layout_centerHorizontal="true"
- android:layout_gravity="top|center_horizontal"
- android:layout_marginTop="24dp"
- android:background="@drawable/bg_all_apps_searchbox"
- android:elevation="1dp"
- android:focusableInTouchMode="true"
- android:gravity="center"
- android:hint="@string/all_apps_search_bar_hint"
- android:imeOptions="actionSearch|flagNoExtractUi"
- android:importantForAutofill="no"
- android:inputType="text|textNoSuggestions|textCapWords"
- android:maxLines="1"
- android:padding="8dp"
- android:saveEnabled="false"
- android:scrollHorizontally="true"
- android:singleLine="true"
- android:textColor="?android:attr/textColorSecondary"
- android:textColorHint="@drawable/all_apps_search_hint"
- android:textSize="16sp" />
-
- <include layout="@layout/all_apps_fast_scroller" />
- </view>
+ android:visibility="invisible" />
</com.android.launcher3.secondarydisplay.SecondaryDragLayer>
\ No newline at end of file
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
index 69a16ba..6886b70 100644
--- a/res/values-be/strings.xml
+++ b/res/values-be/strings.xml
@@ -72,7 +72,7 @@
<string name="all_apps_button_work_label" msgid="7270707118948892488">"Спіс працоўных праграм"</string>
<string name="remove_drop_target_label" msgid="7812859488053230776">"Выдаліць"</string>
<string name="uninstall_drop_target_label" msgid="4722034217958379417">"Дэінсталяваць"</string>
- <string name="app_info_drop_target_label" msgid="692894985365717661">"Пра праграму"</string>
+ <string name="app_info_drop_target_label" msgid="692894985365717661">"Звесткі аб праграме"</string>
<string name="install_drop_target_label" msgid="2539096853673231757">"Усталяваць"</string>
<string name="dismiss_prediction_label" msgid="3357562989568808658">"Не прапаноўваць праграму"</string>
<string name="pin_prediction" msgid="4196423321649756498">"Замацаваць прапанаваную праграму"</string>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 605278f..7fddcf4 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -141,7 +141,7 @@
<string name="move_to_hotseat_position" msgid="6295412897075147808">"ఇష్టమైనవిలో <xliff:g id="NUMBER">%1$s</xliff:g>వ స్థానానికి తరలించు"</string>
<string name="item_moved" msgid="4606538322571412879">"అంశం తరలించబడింది"</string>
<string name="add_to_folder" msgid="9040534766770853243">"ఈ ఫోల్డర్కి జోడించండి: <xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="add_to_folder_with_app" msgid="4534929978967147231">"<xliff:g id="NAME">%1$s</xliff:g> గల ఫోల్డర్కు జోడించు"</string>
+ <string name="add_to_folder_with_app" msgid="4534929978967147231">"<xliff:g id="NAME">%1$s</xliff:g> గల ఫోల్డర్కు జోడించండి"</string>
<string name="added_to_folder" msgid="4793259502305558003">"అంశం ఫోల్డర్కు జోడించబడింది"</string>
<string name="create_folder_with" msgid="4050141361160214248">"ఈ పేరుతో ఫోల్డర్ను క్రియేట్ చేయండి: <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="folder_created" msgid="6409794597405184510">"ఫోల్డర్ క్రియేట్ చేయబడింది"</string>
diff --git a/res/values/config.xml b/res/values/config.xml
index d9b3da5..4cab2de 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -49,9 +49,6 @@
<!-- View tag key used to determine if we should fade in the child views.. -->
<string name="popup_container_iterate_children" translatable="false">popup_container_iterate_children</string>
- <!-- config used to determine if header protection is supported in AllApps -->
- <bool name="config_header_protection_supported">false</bool>
-
<!-- Workspace -->
<!-- The duration (in ms) of the fade animation on the object outlines, used when
we are dragging objects around on the home screen. -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 9e75a31..7582a30 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -20,6 +20,7 @@
<resources>
<!-- Launcher theme -->
<style name="BaseLauncherTheme" parent="@android:style/Theme.DeviceDefault.Light">
+ <item name="disabledIconAlpha">.54</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:colorEdgeEffect">#FF757575</item>
<item name="android:windowActionBar">false</item>
@@ -33,7 +34,6 @@
<item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
<item name="allappsHeaderProtectionColor">@color/popup_color_tertiary_light</item>
<item name="allAppsNavBarScrimColor">#66FFFFFF</item>
- <item name="allAppsTheme">@style/AllAppsTheme</item>
<item name="popupColorPrimary">@color/popup_color_primary_light</item>
<item name="popupColorSecondary">@color/popup_color_secondary_light</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_light</item>
@@ -61,7 +61,6 @@
<item name="iconOnlyShortcutColor">?android:attr/textColorSecondary</item>
<item name="workProfileOverlayTextColor">#FF212121</item>
<item name="eduHalfSheetBGColor">?android:attr/colorAccent</item>
- <item name="disabledIconAlpha">.54</item>
<item name="workspaceAccentColor">@color/workspace_accent_color_light</item>
<item name="dropTargetHoverTextColor">@color/workspace_text_color_dark</item>
<item name="overviewScrimColor">@color/overview_scrim</item>
@@ -73,14 +72,9 @@
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#00000000</item>
<item name="android:navigationBarColor">#00000000</item>
-
-
</style>
- <style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme">
- <item name="disabledIconAlpha">.54</item>
-
- </style>
+ <style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme" />
<style name="LauncherTheme.DarkText" parent="@style/LauncherTheme">
<item name="workspaceTextColor">@color/workspace_text_color_dark</item>
@@ -102,7 +96,6 @@
<item name="android:colorPrimary">#FF212121</item>
<item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
<item name="allAppsNavBarScrimColor">#80000000</item>
- <item name="allAppsTheme">@style/AllAppsTheme.Dark</item>
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
<item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_dark</item>
@@ -129,9 +122,7 @@
<item name="preloadIconBackgroundColor">@color/preload_icon_background_color_dark</item>
</style>
- <style name="LauncherTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark">
- <item name="disabledIconAlpha">.54</item>
- </style>
+ <style name="LauncherTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark"/>
<style name="LauncherTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark">
<item name="android:colorControlHighlight">#19212121</item>
@@ -207,14 +198,6 @@
<item name="android:importantForAccessibility">no</item>
</style>
- <style name="AllAppsTheme">
- <item name="disabledIconAlpha">.54</item>
- </style>
-
- <style name="AllAppsTheme.Dark">
- <item name="disabledIconAlpha">.54</item>
- </style>
-
<style name="BaseIconRoot" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle"/>
<style name="BaseIconUnBounded" parent="BaseIconRoot">
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index 6de3884..ca1fe40 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -34,9 +34,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.util.ActivityOptionsWrapper;
@@ -212,16 +209,6 @@
return new WindowBounds(new Rect(0, 0, mwSize.x, mwSize.y), new Rect());
}
- /**
- * Creates and returns {@link SearchAdapterProvider} for build variant specific search result
- * views
- */
- @Override
- public SearchAdapterProvider<?> createSearchAdapterProvider(
- ActivityAllAppsContainerView<?> allApps) {
- return new DefaultSearchAdapterProvider(this);
- }
-
@Override
public boolean isAppBlockedForSafeMode() {
return mIsSafeModeEnabled;
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index eb016b2..bfde8da 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -23,6 +23,7 @@
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.Utilities.pxFromSp;
import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
import static com.android.launcher3.icons.GraphicsUtils.getShapePath;
import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
@@ -78,6 +79,7 @@
public final boolean isTablet;
public final boolean isPhone;
public final boolean transposeLayoutWithOrientation;
+ public final boolean isMultiDisplay;
public final boolean isTwoPanels;
public final boolean isQsbInline;
@@ -263,13 +265,14 @@
/** TODO: Once we fully migrate to staged split, remove "isMultiWindowMode" */
DeviceProfile(Context context, InvariantDeviceProfile inv, Info info, WindowBounds windowBounds,
SparseArray<DotRenderer> dotRendererCache, boolean isMultiWindowMode,
- boolean transposeLayoutWithOrientation, boolean useTwoPanels, boolean isGestureMode,
+ boolean transposeLayoutWithOrientation, boolean isMultiDisplay, boolean isGestureMode,
@NonNull final ViewScaleProvider viewScaleProvider) {
this.inv = inv;
this.isLandscape = windowBounds.isLandscape();
this.isMultiWindowMode = isMultiWindowMode;
this.transposeLayoutWithOrientation = transposeLayoutWithOrientation;
+ this.isMultiDisplay = isMultiDisplay;
this.isGestureMode = isGestureMode;
windowX = windowBounds.bounds.left;
windowY = windowBounds.bounds.top;
@@ -281,7 +284,7 @@
mInfo = info;
isTablet = info.isTablet(windowBounds);
isPhone = !isTablet;
- isTwoPanels = isTablet && useTwoPanels;
+ isTwoPanels = isTablet && isMultiDisplay;
isTaskbarPresent = isTablet && ApiWrapper.TASKBAR_DRAWN_IN_PROCESS;
// Some more constants.
@@ -348,13 +351,19 @@
bottomSheetCloseDuration = res.getInteger(R.integer.config_bottomSheetCloseDuration);
if (isTablet) {
bottomSheetWorkspaceScale = workspaceContentScale;
- // The goal is to set wallpaper to zoom at workspaceContentScale when in AllApps.
- // When depth is 0, wallpaper zoom is set to maxWallpaperScale.
- // When depth is 1, wallpaper zoom is set to 1.
- // For depth to achieve zoom set to maxWallpaperScale * workspaceContentScale:
- float maxWallpaperScale = res.getFloat(R.dimen.config_wallpaperMaxScale);
- bottomSheetDepth = Utilities.mapToRange(maxWallpaperScale * workspaceContentScale,
- maxWallpaperScale, 1f, 0f, 1f, LINEAR);
+ if (isMultiDisplay && !ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH.get()) {
+ // TODO(b/259893832): Revert to use maxWallpaperScale to calculate bottomSheetDepth
+ // when screen recorder bug is fixed.
+ bottomSheetDepth = 1f;
+ } else {
+ // The goal is to set wallpaper to zoom at workspaceContentScale when in AllApps.
+ // When depth is 0, wallpaper zoom is set to maxWallpaperScale.
+ // When depth is 1, wallpaper zoom is set to 1.
+ // For depth to achieve zoom set to maxWallpaperScale * workspaceContentScale:
+ float maxWallpaperScale = res.getFloat(R.dimen.config_wallpaperMaxScale);
+ bottomSheetDepth = Utilities.mapToRange(maxWallpaperScale * workspaceContentScale,
+ maxWallpaperScale, 1f, 0f, 1f, LINEAR);
+ }
} else {
bottomSheetWorkspaceScale = 1f;
bottomSheetDepth = 0f;
@@ -723,7 +732,7 @@
return new Builder(context, inv, mInfo)
.setWindowBounds(bounds)
- .setUseTwoPanels(isTwoPanels)
+ .setIsMultiDisplay(isMultiDisplay)
.setMultiWindowMode(isMultiWindowMode)
.setDotRendererCache(dotRendererCache)
.setGestureMode(isGestureMode);
@@ -1714,7 +1723,7 @@
private Info mInfo;
private WindowBounds mWindowBounds;
- private boolean mUseTwoPanels;
+ private boolean mIsMultiDisplay;
private boolean mIsMultiWindowMode = false;
private Boolean mTransposeLayoutWithOrientation;
@@ -1734,8 +1743,8 @@
return this;
}
- public Builder setUseTwoPanels(boolean useTwoPanels) {
- mUseTwoPanels = useTwoPanels;
+ public Builder setIsMultiDisplay(boolean isMultiDisplay) {
+ mIsMultiDisplay = isMultiDisplay;
return this;
}
@@ -1789,7 +1798,7 @@
mViewScaleProvider = DEFAULT_PROVIDER;
}
return new DeviceProfile(mContext, mInv, mInfo, mWindowBounds, mDotRendererCache,
- mIsMultiWindowMode, mTransposeLayoutWithOrientation, mUseTwoPanels,
+ mIsMultiWindowMode, mTransposeLayoutWithOrientation, mIsMultiDisplay,
mIsGestureMode, mViewScaleProvider);
}
}
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index fb041cb..6f44375 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -400,7 +400,7 @@
SparseArray<DotRenderer> dotRendererCache = new SparseArray<>();
for (WindowBounds bounds : displayInfo.supportedBounds) {
localSupportedProfiles.add(new DeviceProfile.Builder(context, this, displayInfo)
- .setUseTwoPanels(deviceType == TYPE_MULTI_DISPLAY)
+ .setIsMultiDisplay(deviceType == TYPE_MULTI_DISPLAY)
.setWindowBounds(bounds)
.setDotRendererCache(dotRendererCache)
.build());
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index e21b4db..2511cada 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -30,7 +30,6 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.views.ActivityContext;
@@ -49,12 +48,6 @@
// Used to animate Search results out and A-Z apps in, or vice-versa.
private final SearchTransitionController mSearchTransitionController;
- protected SearchUiManager mSearchUiManager;
- /**
- * View that defines the search box. Result is rendered inside the recycler view defined in the
- * base class.
- */
- private View mSearchContainer;
/** {@code true} when rendered view is in search state instead of the scroll state. */
private boolean mIsSearching;
private boolean mRebindAdaptersAfterSearchAnimation;
@@ -73,6 +66,12 @@
mSearchTransitionController = new SearchTransitionController(this);
}
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ mSearchUiManager.initializeSearch(this);
+ }
+
public SearchUiManager getSearchUiManager() {
return mSearchUiManager;
}
@@ -143,11 +142,6 @@
}
@Override
- protected final SearchAdapterProvider<?> createMainAdapterProvider() {
- return mActivityContext.createSearchAdapterProvider(this);
- }
-
- @Override
public boolean shouldContainerScroll(MotionEvent ev) {
// IF the MotionEvent is inside the search box, and the container keeps on receiving
// touch input, container should move down.
@@ -167,14 +161,6 @@
}
@Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mSearchContainer = findViewById(R.id.search_container_all_apps);
- mSearchUiManager = (SearchUiManager) mSearchContainer;
- mSearchUiManager.initializeSearch(this);
- }
-
- @Override
public boolean dispatchKeyEvent(KeyEvent event) {
mSearchUiManager.preDispatchKeyEvent(event);
return super.dispatchKeyEvent(event);
@@ -278,18 +264,6 @@
(int) (mSearchContainer.getAlpha() * 255));
}
- @Override
- public int getHeaderBottom() {
- if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
- if (mActivityContext.getDeviceProfile().isTablet) {
- return super.getHeaderBottom() + mHeader.getClipTop()
- + mBottomSheetBackground.getTop();
- }
- return super.getHeaderBottom() + mHeader.getClipTop();
- }
- return super.getHeaderBottom() + mSearchContainer.getBottom();
- }
-
private void layoutBelowSearchContainer(View v, boolean includeTabsMargin) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
return;
@@ -364,4 +338,10 @@
? R.dimen.all_apps_header_pill_height
: R.dimen.all_apps_header_top_margin);
}
+
+ @Override
+ public boolean isInAllApps() {
+ // TODO: Make this abstract
+ return true;
+ }
}
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
index aea98ae..d1ada7a 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
@@ -60,6 +60,7 @@
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
+import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.keyboard.FocusedItemDecorator;
@@ -105,7 +106,6 @@
protected final List<AdapterHolder> mAH;
protected final Predicate<ItemInfo> mPersonalMatcher = ItemInfoMatcher.ofUser(
Process.myUserHandle());
- private final SearchAdapterProvider<?> mMainAdapterProvider;
private final AllAppsStore mAllAppsStore = new AllAppsStore();
private final RecyclerView.OnScrollListener mScrollListener =
@@ -123,11 +123,17 @@
protected AllAppsPagedView mViewPager;
private SearchRecyclerView mSearchRecyclerView;
+ private SearchAdapterProvider<?> mMainAdapterProvider;
protected FloatingHeaderView mHeader;
protected View mBottomSheetBackground;
private View mBottomSheetHandleArea;
- @Nullable private View mSearchBarProtection;
+
+ /**
+ * View that defines the search box. Result is rendered inside {@link #mSearchRecyclerView}.
+ */
+ protected View mSearchContainer;
+ protected SearchUiManager mSearchUiManager;
protected boolean mUsingTabs;
private boolean mHasWorkApps;
@@ -135,7 +141,7 @@
protected RecyclerViewFastScroller mTouchHandler;
protected final Point mFastScrollerOffset = new Point();
- private final int mScrimColor;
+ protected final int mScrimColor;
private final int mHeaderProtectionColor;
protected final float mHeaderThreshold;
private final Path mTmpPath = new Path();
@@ -149,7 +155,6 @@
protected BaseAllAppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mActivityContext = ActivityContext.lookupContext(context);
- mMainAdapterProvider = createMainAdapterProvider();
mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
mHeaderThreshold = getResources().getDimensionPixelSize(
@@ -160,19 +165,84 @@
mActivityContext.getSystemService(UserManager.class),
this, LauncherPrefs.getPrefs(mActivityContext));
mAH = Arrays.asList(null, null, null);
- mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN));
- mAH.set(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
- mAH.set(AdapterHolder.SEARCH, new AdapterHolder(AdapterHolder.SEARCH));
-
mNavBarScrimPaint = new Paint();
mNavBarScrimPaint.setColor(Themes.getAttrColor(context, R.attr.allAppsNavBarScrimColor));
mAllAppsStore.addUpdateListener(this::onAppsUpdated);
mActivityContext.addOnDeviceProfileChangeListener(this);
+
+ // This is a focus listener that proxies focus from a view into the list view. This is to
+ // work around the search box from getting first focus and showing the cursor.
+ setOnFocusChangeListener((v, hasFocus) -> {
+ if (hasFocus && getActiveRecyclerView() != null) {
+ getActiveRecyclerView().requestFocus();
+ }
+ });
+ initContent();
+ }
+
+ /**
+ * Initializes the view hierarchy and internal variables. Any initialization which actually uses
+ * these members should be done in {@link #onFinishInflate()}.
+ * In terms of subclass initialization, the following would be parallel order for activity:
+ * initContent -> onPreCreate
+ * constructor/init -> onCreate
+ * onFinishInflate -> onPostCreate
+ */
+ protected void initContent() {
+ mMainAdapterProvider = createMainAdapterProvider();
+
+ mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN));
+ mAH.set(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
+ mAH.set(AdapterHolder.SEARCH, new AdapterHolder(AdapterHolder.SEARCH));
+
+ getLayoutInflater().inflate(R.layout.all_apps_content, this);
+ mHeader = findViewById(R.id.all_apps_header);
+ mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
+ mBottomSheetHandleArea = findViewById(R.id.bottom_sheet_handle_area);
+ mSearchRecyclerView = findViewById(R.id.search_results_list_view);
+
+ // Add the search box next to the header
+ mSearchContainer = inflateSearchBox();
+ addView(mSearchContainer, indexOfChild(mHeader) + 1);
+ mSearchUiManager = (SearchUiManager) mSearchContainer;
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ mAH.get(AdapterHolder.SEARCH).setup(mSearchRecyclerView,
+ /* Filter out A-Z apps */ itemInfo -> false);
+ rebindAdapters(true /* force */);
+ float cornerRadius = Themes.getDialogCornerRadius(getContext());
+ mBottomSheetCornerRadii = new float[]{
+ cornerRadius,
+ cornerRadius, // Top left radius in px
+ cornerRadius,
+ cornerRadius, // Top right radius in px
+ 0,
+ 0, // Bottom right
+ 0,
+ 0 // Bottom left
+ };
+ final TypedValue value = new TypedValue();
+ getContext().getTheme().resolveAttribute(android.R.attr.colorBackground, value, true);
+ mBottomSheetBackgroundColor = value.data;
+ updateBackground(mActivityContext.getDeviceProfile());
+ }
+
+ /**
+ * Inflates the search box
+ */
+ protected View inflateSearchBox() {
+ return getLayoutInflater().inflate(R.layout.search_container_all_apps, this, false);
}
/** Creates the adapter provider for the main section. */
- protected abstract SearchAdapterProvider<?> createMainAdapterProvider();
+ protected SearchAdapterProvider<?> createMainAdapterProvider() {
+ return new DefaultSearchAdapterProvider(mActivityContext);
+ }
/** The adapter provider for the main section. */
public final SearchAdapterProvider<?> getMainAdapterProvider() {
@@ -289,6 +359,13 @@
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
+ // The AllAppsContainerView houses the QSB and is hence visible from the Workspace
+ // Overview states. We shouldn't intercept for the scrubber in these cases.
+ if (!isInAllApps()) {
+ mTouchHandler = null;
+ return false;
+ }
+
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
AllAppsRecyclerView rv = getActiveRecyclerView();
if (rv != null && rv.getScrollbar() != null
@@ -306,6 +383,10 @@
@Override
public boolean onTouchEvent(MotionEvent ev) {
+ if (!isInAllApps()) {
+ return false;
+ }
+
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
AllAppsRecyclerView rv = getActiveRecyclerView();
if (rv != null && rv.getScrollbar() != null
@@ -375,11 +456,6 @@
return mSearchRecyclerView;
}
- @Nullable
- public View getSearchBarProtection() {
- return mSearchBarProtection;
- }
-
protected boolean isPersonalTab() {
return mViewPager == null || mViewPager.getNextPage() == 0;
}
@@ -415,49 +491,6 @@
}
@Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- // This is a focus listener that proxies focus from a view into the list view. This is to
- // work around the search box from getting first focus and showing the cursor.
- setOnFocusChangeListener((v, hasFocus) -> {
- if (hasFocus && getActiveRecyclerView() != null) {
- getActiveRecyclerView().requestFocus();
- }
- });
-
- mHeader = findViewById(R.id.all_apps_header);
- mSearchBarProtection = findViewById(R.id.search_protection);
- if (mSearchBarProtection != null) {
- mSearchBarProtection.setBackgroundColor(mScrimColor);
- mSearchBarProtection.setVisibility(
- FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get() ? VISIBLE : GONE);
- }
- mSearchRecyclerView = findViewById(R.id.search_results_list_view);
- mAH.get(AdapterHolder.SEARCH).setup(mSearchRecyclerView,
- /* Filter out A-Z apps */ itemInfo -> false);
- rebindAdapters(true /* force */);
-
- mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
- mBottomSheetHandleArea = findViewById(R.id.bottom_sheet_handle_area);
- float cornerRadius = Themes.getDialogCornerRadius(getContext());
- mBottomSheetCornerRadii = new float[]{
- cornerRadius,
- cornerRadius, // Top left radius in px
- cornerRadius,
- cornerRadius, // Top right radius in px
- 0,
- 0, // Bottom right
- 0,
- 0 // Bottom left
- };
- final TypedValue value = new TypedValue();
- getContext().getTheme().resolveAttribute(android.R.attr.colorBackground, value, true);
- mBottomSheetBackgroundColor = value.data;
- updateBackground(mActivityContext.getDeviceProfile());
- }
-
- @Override
public void onDropCompleted(View target, DragObject d, boolean success) {}
@Override
@@ -781,9 +814,6 @@
canvas.drawPath(mTmpPath, mHeaderPaint);
}
- if (!mHeader.isHeaderProtectionSupported()) {
- return;
- }
if (DEBUG_HEADER_PROTECTION) {
mHeaderPaint.setColor(Color.MAGENTA);
mHeaderPaint.setAlpha(255);
@@ -796,10 +826,6 @@
}
int bottom = getHeaderBottom();
FloatingHeaderView headerView = getFloatingHeaderView();
- if (!mUsingTabs && !FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
- // Add protection which is otherwise added when tabs scroll up.
- bottom += headerView.getTabsAdditionalPaddingTop();
- }
if (isTablet) {
// Start adding header protection if search bar or tabs will attach to the top.
if (!FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get() || mUsingTabs) {
@@ -836,7 +862,7 @@
* redraws header protection
*/
public void invalidateHeader() {
- if (mScrimView != null && mHeader.isHeaderProtectionSupported()) {
+ if (mScrimView != null) {
mScrimView.invalidate();
}
}
@@ -863,7 +889,14 @@
BaseAdapterProvider[] adapterProviders);
public int getHeaderBottom() {
- return (int) getTranslationY();
+ int bottom = (int) getTranslationY() + mHeader.getClipTop();
+ if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
+ if (mActivityContext.getDeviceProfile().isTablet) {
+ return bottom + mBottomSheetBackground.getTop();
+ }
+ return bottom;
+ }
+ return bottom + mHeader.getTop();
}
/**
@@ -877,6 +910,12 @@
rv.addOnScrollListener(mScrollListener);
}
+ /**
+ * Returns {@code true} the All Apps UI is currently being displayed on the target surface and
+ * is interactive.
+ */
+ public abstract boolean isInAllApps();
+
/** Holds a {@link BaseAllAppsAdapter} and related fields. */
public class AdapterHolder {
public static final int MAIN = 0;
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 7fd3752..c18f9e1 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -17,7 +17,6 @@
import android.animation.ValueAnimator;
import android.content.Context;
-import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.ArrayMap;
@@ -85,7 +84,6 @@
// These two values are necessary to ensure that the header protection is drawn correctly.
private final int mTabsAdditionalPaddingTop;
private final int mTabsAdditionalPaddingBottom;
- private boolean mHeaderProtectionSupported;
protected ViewGroup mTabLayout;
private AllAppsRecyclerView mMainRV;
@@ -115,7 +113,6 @@
// enabled or disabled, and represent the current set of all rows.
private FloatingHeaderRow[] mAllRows = FloatingHeaderRow.NO_ROWS;
-
public FloatingHeaderView(@NonNull Context context) {
this(context, null);
}
@@ -126,15 +123,6 @@
.getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment);
mTabsAdditionalPaddingBottom = context.getResources()
.getDimensionPixelSize(R.dimen.all_apps_header_bottom_adjustment);
- mHeaderProtectionSupported = context.getResources().getBoolean(
- R.bool.config_header_protection_supported);
- }
-
- @Override
- protected void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- mHeaderProtectionSupported = getContext().getResources().getBoolean(
- R.bool.config_header_protection_supported);
}
@Override
@@ -410,10 +398,6 @@
return mFloatingRowsHeight;
}
- int getTabsAdditionalPaddingTop() {
- return mTabsAdditionalPaddingTop;
- }
-
int getTabsAdditionalPaddingBottom() {
return mTabsAdditionalPaddingBottom;
}
@@ -454,10 +438,6 @@
p.y = getTop() - mCurrentRV.getTop() - ((ViewGroup) mCurrentRV.getParent()).getTop();
}
- public boolean isHeaderProtectionSupported() {
- return mHeaderProtectionSupported;
- }
-
@Override
public boolean hasOverlappingRendering() {
return false;
@@ -483,10 +463,6 @@
* Returns visible height of FloatingHeaderView contents requiring header protection
*/
int getPeripheralProtectionHeight() {
- if (!mHeaderProtectionSupported) {
- return 0;
- }
-
// we only want to show protection when work tab is available and header is either
// collapsed or animating to/from collapsed state
if (mTabsHidden || mFloatingRowsCollapsed || !mHeaderCollapsed) {
diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
index 229d8f8..5a5ba2b 100644
--- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
@@ -16,61 +16,18 @@
package com.android.launcher3.allapps;
import android.content.Context;
-import android.text.TextUtils;
import android.util.AttributeSet;
-import android.view.MotionEvent;
import android.view.WindowInsets;
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
/**
* AllAppsContainerView with launcher specific callbacks
*/
public class LauncherAllAppsContainerView extends ActivityAllAppsContainerView<Launcher> {
- private final RecyclerView.OnScrollListener mActivityScrollListener =
- new RecyclerView.OnScrollListener() {
- @Override
- public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
- int scrolledOffset = recyclerView.computeVerticalScrollOffset();
- ExtendedEditText input = mSearchUiManager.getEditText();
- if (input != null) {
- // Save the input box state on scroll down
- if (dy > 0) {
- input.saveFocusedStateAndUpdateToUnfocusedState();
- }
-
- // Scroll up and scroll to top
- if (dy < 0 && scrolledOffset == 0) {
- // Show keyboard
- boolean isImeEnabledOnSwipeUp = Launcher.getLauncher(mActivityContext)
- .getSearchConfig().isImeEnabledOnSwipeUp();
- if (isImeEnabledOnSwipeUp || !TextUtils.isEmpty(input.getText())) {
- input.showKeyboard();
- }
-
- // Restore state in input box
- input.restoreToFocusedState();
- }
- }
- }
- };
-
- @Override
- protected void onInitializeRecyclerView(RecyclerView rv) {
- super.onInitializeRecyclerView(rv);
- if (FeatureFlags.SCROLL_TOP_TO_RESET.get()) {
- rv.addOnScrollListener(mActivityScrollListener);
- }
- }
-
public LauncherAllAppsContainerView(Context context) {
this(context, null);
}
@@ -84,26 +41,6 @@
}
@Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- // The AllAppsContainerView houses the QSB and is hence visible from the Workspace
- // Overview states. We shouldn't intercept for the scrubber in these cases.
- if (!mActivityContext.isInState(LauncherState.ALL_APPS)) {
- mTouchHandler = null;
- return false;
- }
-
- return super.onInterceptTouchEvent(ev);
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent ev) {
- if (!mActivityContext.isInState(LauncherState.ALL_APPS)) {
- return false;
- }
- return super.onTouchEvent(ev);
- }
-
- @Override
protected int getNavBarScrimHeight(WindowInsets insets) {
if (Utilities.ATLEAST_Q) {
return insets.getTappableElementInsets().bottom;
@@ -111,4 +48,9 @@
return insets.getStableInsetBottom();
}
}
+
+ @Override
+ public boolean isInAllApps() {
+ return mActivityContext.getStateManager().isInStableState(LauncherState.ALL_APPS);
+ }
}
diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java
index 495f5c3..5056782 100644
--- a/src/com/android/launcher3/allapps/SearchTransitionController.java
+++ b/src/com/android/launcher3/allapps/SearchTransitionController.java
@@ -36,8 +36,6 @@
import android.view.animation.Interpolator;
import com.android.launcher3.BubbleTextView;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
@@ -109,9 +107,7 @@
}
mSearchToAzAnimator = ObjectAnimator.ofFloat(this, SEARCH_TO_AZ_PROGRESS, targetProgress);
- boolean inAllApps = Launcher.getLauncher(
- mAllAppsContainerView.getContext()).getStateManager().isInStableState(
- LauncherState.ALL_APPS);
+ boolean inAllApps = mAllAppsContainerView.isInAllApps();
if (!inAllApps) {
duration = 0; // Don't want to animate when coming from QSB.
}
diff --git a/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
index 0719c43..684e98e 100644
--- a/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
@@ -42,4 +42,9 @@
@Override
protected void updateBackground(DeviceProfile deviceProfile) {}
+
+ @Override
+ public boolean isInAllApps() {
+ return mActivityContext.isAppDrawerShown();
+ }
}
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index c56186a..0e546ed 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -303,6 +303,10 @@
public static final BooleanFlag ENABLE_WIDGET_PICKER_DEPTH = new DeviceFlag(
"ENABLE_WIDGET_PICKER_DEPTH", true, "Enable changing depth in widget picker.");
+ public static final BooleanFlag ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH = getDebugFlag(
+ "ENABLE_MULTI_DISPLAY_PARTIAL_DEPTH", false,
+ "Allow bottom sheet depth to be smaller than 1 for multi-display devices.");
+
public static final BooleanFlag SCROLL_TOP_TO_RESET = new DeviceFlag(
"SCROLL_TOP_TO_RESET", true, "Bring up IME and focus on "
+ "input when scroll to top if 'Always show keyboard' is enabled or in prefix state");
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 4cb4348..3e2d051 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -53,6 +53,7 @@
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
+import com.android.launcher3.util.DisplayController;
import java.util.Collections;
import java.util.List;
@@ -267,15 +268,14 @@
return !WidgetsModel.GO_DISABLE_NOTIFICATION_DOTS;
case ALLOW_ROTATION_PREFERENCE_KEY:
- DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE.get(
- getContext()).getDeviceProfile(getContext());
- if (deviceProfile.isTablet) {
+ DisplayController.Info info = InvariantDeviceProfile.INSTANCE.get(
+ getContext()).getDeviceProfile(getContext()).getDisplayInfo();
+ if (info.isTablet(info.realBounds)) {
// Launcher supports rotation by default. No need to show this setting.
return false;
}
// Initialize the UI once
- preference.setDefaultValue(
- RotationHelper.getAllowRotationDefaultValue(deviceProfile));
+ preference.setDefaultValue(RotationHelper.getAllowRotationDefaultValue(info));
return true;
case FLAGS_PREFERENCE_KEY:
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 642bdcd..e5b4eba 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -35,7 +35,6 @@
import androidx.annotation.WorkerThread;
import com.android.launcher3.BaseActivity;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.util.DisplayController;
@@ -50,11 +49,11 @@
/**
* Returns the default value of {@link #ALLOW_ROTATION_PREFERENCE_KEY} preference.
*/
- public static boolean getAllowRotationDefaultValue(DeviceProfile deviceProfile) {
+ public static boolean getAllowRotationDefaultValue(DisplayController.Info info) {
// If the device's pixel density was scaled (usually via settings for A11y), use the
// original dimensions to determine if rotation is allowed of not.
- float originalSmallestWidth = dpiFromPx(
- Math.min(deviceProfile.widthPx, deviceProfile.heightPx), DENSITY_DEVICE_STABLE);
+ float originalSmallestWidth = dpiFromPx(Math.min(info.currentSize.x, info.currentSize.y),
+ DENSITY_DEVICE_STABLE);
return originalSmallestWidth >= MIN_TABLET_WIDTH;
}
@@ -99,7 +98,8 @@
new Handler(UI_HELPER_EXECUTOR.getLooper(), this::setOrientationAsync);
}
- private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings) {
+ private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings,
+ DisplayController.Info info) {
// On large devices we do not handle auto-rotate differently.
mIgnoreAutoRotateSettings = ignoreAutoRotateSettings;
if (!mIgnoreAutoRotateSettings) {
@@ -108,7 +108,7 @@
mSharedPrefs.registerOnSharedPreferenceChangeListener(this);
}
mHomeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY,
- getAllowRotationDefaultValue(mActivity.getDeviceProfile()));
+ getAllowRotationDefaultValue(info));
} else {
if (mSharedPrefs != null) {
mSharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
@@ -122,7 +122,7 @@
if (mDestroyed || mIgnoreAutoRotateSettings) return;
boolean wasRotationEnabled = mHomeRotationEnabled;
mHomeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY,
- getAllowRotationDefaultValue(mActivity.getDeviceProfile()));
+ getAllowRotationDefaultValue(mActivity.getDeviceProfile().getDisplayInfo()));
if (mHomeRotationEnabled != wasRotationEnabled) {
notifyChange();
}
@@ -132,7 +132,7 @@
public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
boolean ignoreAutoRotateSettings = info.isTablet(info.realBounds);
if (mIgnoreAutoRotateSettings != ignoreAutoRotateSettings) {
- setIgnoreAutoRotateSettings(ignoreAutoRotateSettings);
+ setIgnoreAutoRotateSettings(ignoreAutoRotateSettings, info);
notifyChange();
}
}
@@ -169,7 +169,7 @@
mInitialized = true;
DisplayController displayController = DisplayController.INSTANCE.get(mActivity);
DisplayController.Info info = displayController.getInfo();
- setIgnoreAutoRotateSettings(info.isTablet(info.realBounds));
+ setIgnoreAutoRotateSettings(info.isTablet(info.realBounds), info);
displayController.addChangeListener(this);
notifyChange();
}
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 820162c..097823b 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -432,10 +432,10 @@
int drawableWidth, int drawableHeight, DeviceProfile dp,
@StagePosition int stagePosition) {
float insetAdjustment = getPlaceholderSizeAdjustment(dp) / 2f;
- out.setX(Math.round(onScreenRectCenterX / fullscreenScaleX
- - 1.0f * drawableWidth / 2));
- out.setY(Math.round((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
- - 1.0f * drawableHeight / 2));
+ out.setX(onScreenRectCenterX / fullscreenScaleX
+ - 1.0f * drawableWidth / 2);
+ out.setY((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
+ - 1.0f * drawableHeight / 2);
}
/**
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 78e17d8..316cf0e 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -463,20 +463,20 @@
boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
float insetAdjustment = getPlaceholderSizeAdjustment(dp, pinToRight) / 2f;
if (!dp.isLandscape) {
- out.setX(Math.round(onScreenRectCenterX / fullscreenScaleX
- - 1.0f * drawableWidth / 2));
- out.setY(Math.round((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
- - 1.0f * drawableHeight / 2));
+ out.setX(onScreenRectCenterX / fullscreenScaleX
+ - 1.0f * drawableWidth / 2);
+ out.setY((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
+ - 1.0f * drawableHeight / 2);
} else {
if (pinToRight) {
- out.setX(Math.round((onScreenRectCenterX - insetAdjustment) / fullscreenScaleX
- - 1.0f * drawableWidth / 2));
+ out.setX((onScreenRectCenterX - insetAdjustment) / fullscreenScaleX
+ - 1.0f * drawableWidth / 2);
} else {
- out.setX(Math.round((onScreenRectCenterX + insetAdjustment) / fullscreenScaleX
- - 1.0f * drawableWidth / 2));
+ out.setX((onScreenRectCenterX + insetAdjustment) / fullscreenScaleX
+ - 1.0f * drawableWidth / 2);
}
- out.setY(Math.round(onScreenRectCenterY / fullscreenScaleY
- - 1.0f * drawableHeight / 2));
+ out.setY(onScreenRectCenterY / fullscreenScaleY
+ - 1.0f * drawableHeight / 2);
}
}
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index 28085e1..79b4cb4 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -54,7 +54,6 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.dot.DotInfo;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.folder.FolderIcon;
@@ -229,16 +228,6 @@
}
/**
- * Creates and returns {@link SearchAdapterProvider} for build variant specific search result
- * views.
- */
- @Nullable
- default SearchAdapterProvider<?> createSearchAdapterProvider(
- ActivityAllAppsContainerView<?> appsView) {
- return null;
- }
-
- /**
* Hides the keyboard if it is visible
*/
default void hideKeyboard() {
diff --git a/src/com/android/launcher3/views/Snackbar.java b/src/com/android/launcher3/views/Snackbar.java
index e582114..86b3419 100644
--- a/src/com/android/launcher3/views/Snackbar.java
+++ b/src/com/android/launcher3/views/Snackbar.java
@@ -31,6 +31,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
@@ -97,7 +98,11 @@
dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right,
absoluteMaxWidth);
params.width = minWidth;
- params.setMargins(0, 0, 0, marginBottom + insets.bottom);
+ DeviceProfile deviceProfile = activity.getDeviceProfile();
+ params.setMargins(0, 0, 0, marginBottom
+ + (deviceProfile.isTaskbarPresent
+ ? deviceProfile.taskbarSize + deviceProfile.getTaskbarOffsetY()
+ : insets.bottom));
TextView labelView = snackbar.findViewById(R.id.label);
String labelText = res.getString(labelStringResId);