From 9053b9075150301c272d4950667c02877802ea2b Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 19 Mar 2021 15:13:24 -0700 Subject: [PATCH 1/9] Fix spring loaded scale when taskbar is present Test: scaled workspace doesn't overlap QSB during drag and drop Bug: 171917176 Change-Id: I56c7ee834e2c3ee2c796e88e83f75dbd24d28bd5 --- src/com/android/launcher3/states/SpringLoadedState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java index fce8fffdc7..d593013a36 100644 --- a/src/com/android/launcher3/states/SpringLoadedState.java +++ b/src/com/android/launcher3/states/SpringLoadedState.java @@ -59,10 +59,11 @@ public class SpringLoadedState extends LauncherState { float scale = grid.workspaceSpringLoadShrinkFactor; Rect insets = launcher.getDragLayer().getInsets(); + int insetsBottom = grid.isTaskbarPresent ? grid.taskbarSize : insets.bottom; float scaledHeight = scale * ws.getNormalChildHeight(); float shrunkTop = insets.top + grid.dropTargetBarSizePx; - float shrunkBottom = ws.getMeasuredHeight() - insets.bottom + float shrunkBottom = ws.getMeasuredHeight() - insetsBottom - grid.workspacePadding.bottom - grid.workspaceSpringLoadedBottomSpace; float totalShrunkSpace = shrunkBottom - shrunkTop; From 76060eb11b336aa0f1ef54055d561307190b34f4 Mon Sep 17 00:00:00 2001 From: Alina Zaidi Date: Mon, 22 Mar 2021 12:25:37 +0000 Subject: [PATCH 2/9] Bug fixes for widget picker search (2/n) - Dismiss keyboard when user starts to drag widget picker - Add content description for cancel button Test: Tested manually. Bug: 183211445 Bug: 183106676 Change-Id: Ie620c3d50a49d8380f316d48e4ee8ebced6de5eb --- res/layout/widgets_search_bar.xml | 1 + res/values/strings.xml | 3 +++ .../android/launcher3/widget/picker/WidgetsFullSheet.java | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/res/layout/widgets_search_bar.xml b/res/layout/widgets_search_bar.xml index 1db7462a0f..e3836df108 100644 --- a/res/layout/widgets_search_bar.xml +++ b/res/layout/widgets_search_bar.xml @@ -32,5 +32,6 @@ android:src="@drawable/ic_gm_close_24" android:background="?android:selectableItemBackground" android:layout_gravity="center" + android:contentDescription="@string/widgets_full_sheet_cancel_button_description" android:visibility="gone"/> \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 1eb123bb92..6af3dae8a7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -81,6 +81,9 @@ Search + + Clear text from search box No widgets available diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java index f43f712a52..dc7d341546 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java @@ -34,6 +34,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.WindowInsets; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.widget.TextView; @@ -554,6 +555,12 @@ public class WidgetsFullSheet extends BaseWidgetSheet return super.onBackPressed(); } + @Override + public void onDragStart(boolean start, float startDisplacement) { + super.onDragStart(start, startDisplacement); + getWindowInsetsController().hide(WindowInsets.Type.ime()); + } + /** A holder class for holding adapters & their corresponding recycler view. */ private final class AdapterHolder { static final int PRIMARY = 0; From 6d97d893e0dcb512a717ff1b001e16243d5b6212 Mon Sep 17 00:00:00 2001 From: Alina Zaidi Date: Mon, 22 Mar 2021 10:06:25 +0000 Subject: [PATCH 3/9] Update Pin widget dialog UI according to mocks. Test: Tested manually and RequestPinItemTest passed Bug: 182982143 Bug: 182994819 Bug: 182929673 Change-Id: I905ea0c1860d28ee9fbb456ddf6abd728b65bac4 --- AndroidManifest-common.xml | 3 +- res/drawable/add_item_dialog_background.xml | 8 ++ .../add_item_dialog_button_background.xml | 22 ++++++ res/layout/add_item_confirmation_activity.xml | 75 +++++++------------ res/layout/widget_cell_content.xml | 16 ++-- res/layout/widgets_list_row_header.xml | 3 +- res/values-night/styles.xml | 2 + res/values/dimens.xml | 6 ++ res/values/styles.xml | 6 ++ .../launcher3/dragndrop/AddItemActivity.java | 17 +++++ 10 files changed, 100 insertions(+), 58 deletions(-) create mode 100644 res/drawable/add_item_dialog_background.xml create mode 100644 res/drawable/add_item_dialog_button_background.xml diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml index 4fd2e4075c..4e72260e9c 100644 --- a/AndroidManifest-common.xml +++ b/AndroidManifest-common.xml @@ -116,8 +116,7 @@ android:theme="@style/AppItemActivityTheme" android:excludeFromRecents="true" android:autoRemoveFromRecents="true" - android:exported="true" - android:label="@string/action_add_to_workspace" > + android:exported="true"> diff --git a/res/drawable/add_item_dialog_background.xml b/res/drawable/add_item_dialog_background.xml new file mode 100644 index 0000000000..04bde8f5a7 --- /dev/null +++ b/res/drawable/add_item_dialog_background.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/res/drawable/add_item_dialog_button_background.xml b/res/drawable/add_item_dialog_button_background.xml new file mode 100644 index 0000000000..1b4591f8c1 --- /dev/null +++ b/res/drawable/add_item_dialog_button_background.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/add_item_confirmation_activity.xml b/res/layout/add_item_confirmation_activity.xml index b1a1efe0ac..d5e7333614 100644 --- a/res/layout/add_item_confirmation_activity.xml +++ b/res/layout/add_item_confirmation_activity.xml @@ -17,70 +17,51 @@ */ --> - + + - - - - - - - - - - - - - - - + android:layout_marginVertical="16dp" /> + android:padding="8dp" + android:orientation="horizontal">