From fb54cf54e3232cbfe5c74e712c17f30c988257f6 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 8 Feb 2022 17:08:38 +0000 Subject: [PATCH] Avoid AllApps bottom sheet from being and add collapse handle - Instead of using top margin, use top padding instead - Add a separate LinearView for the bottom sheet background - Added a handle to bottom sheet background that handle touches Bug: 208599118 Test: phone, tablet and taskbar Change-Id: Id8d3cb5ee6c58193926e2cf5ea7b0cb2280098be --- quickstep/res/layout/taskbar_all_apps.xml | 4 ++ res/layout/all_apps.xml | 4 ++ .../all_apps_bottom_sheet_background.xml | 35 +++++++++++++++ res/layout/secondary_launcher.xml | 6 ++- .../allapps/BaseAllAppsContainerView.java | 22 +++++---- ...SecondaryLauncherAllAppsContainerView.java | 45 +++++++++++++++++++ 6 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 res/layout/all_apps_bottom_sheet_background.xml create mode 100644 src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java diff --git a/quickstep/res/layout/taskbar_all_apps.xml b/quickstep/res/layout/taskbar_all_apps.xml index 2848b0f324..1ad20cc79f 100644 --- a/quickstep/res/layout/taskbar_all_apps.xml +++ b/quickstep/res/layout/taskbar_all_apps.xml @@ -29,6 +29,10 @@ android:saveEnabled="false" android:theme="?attr/allAppsTheme"> + + diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml index 6df62124b4..2ac7e63a15 100644 --- a/res/layout/all_apps.xml +++ b/res/layout/all_apps.xml @@ -25,6 +25,10 @@ android:focusable="false" android:saveEnabled="false"> + + diff --git a/res/layout/all_apps_bottom_sheet_background.xml b/res/layout/all_apps_bottom_sheet_background.xml new file mode 100644 index 0000000000..ad10d6801b --- /dev/null +++ b/res/layout/all_apps_bottom_sheet_background.xml @@ -0,0 +1,35 @@ + + + + + + + + diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml index 3ccd4f25e2..0fe05ee721 100644 --- a/res/layout/secondary_launcher.xml +++ b/res/layout/secondary_launcher.xml @@ -42,7 +42,7 @@ android:onClick="onAppsButtonClicked" /> + + diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index 2b2c7c55c5..a66ae78c12 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -110,6 +110,8 @@ public abstract class BaseAllAppsContainerView { + + public SecondaryLauncherAllAppsContainerView(Context context) { + this(context, null); + } + + public SecondaryLauncherAllAppsContainerView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public SecondaryLauncherAllAppsContainerView(Context context, AttributeSet attrs, + int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + protected void updateBackground(DeviceProfile deviceProfile) {} +}