Tune AllApps bottom sheet VisD and motion
- Make AllApps bottom sheet solid and appears from bottom
- Teleport AllApps bottom sheet as user drag to reduce drag range
- Consider teleport interpolation for state transition sdetection
- Tuned workspace motions for AllApps bottom sheet (no translate, shrink)
- Add portrait vertical translate for tablet portrait including taskbar AllApps
- Updated bottom sheet handle and created common variables for other bottom sheets
Bug: 208599118
Test: manual on tablet AllApps, taskbar Allapps and handheld AllApps
Change-Id: I69dba5f155914cd012cc8ef3be1ef71fb2be5a40
diff --git a/res/drawable/bg_all_apps_bottom_sheet.xml b/res/drawable/bg_all_apps_bottom_sheet.xml
deleted file mode 100644
index dba2fee..0000000
--- a/res/drawable/bg_all_apps_bottom_sheet.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-<ripple android:color="?android:attr/colorControlHighlight"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item>
- <shape android:shape="rectangle"
- android:tint="?colorButtonNormal">
- <corners
- android:topLeftRadius="@dimen/dialogCornerRadius"
- android:topRightRadius="@dimen/dialogCornerRadius"/>
- <solid android:color="?attr/allAppsScrimColor" />
- </shape>
- </item>
-</ripple>
\ No newline at end of file
diff --git a/res/drawable/bg_rounded_corner_bottom_sheet.xml b/res/drawable/bg_rounded_corner_bottom_sheet.xml
index aa49bce..dfcd354 100644
--- a/res/drawable/bg_rounded_corner_bottom_sheet.xml
+++ b/res/drawable/bg_rounded_corner_bottom_sheet.xml
@@ -16,7 +16,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
- <solid android:color="@color/surface" />
+ <solid android:color="?android:attr/colorBackground" />
<corners
android:topLeftRadius="@dimen/dialogCornerRadius"
android:topRightRadius="@dimen/dialogCornerRadius" />
diff --git a/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml b/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml
new file mode 100644
index 0000000..c502178
--- /dev/null
+++ b/res/drawable/bg_rounded_corner_bottom_sheet_handle.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:shape="rectangle" >
+ <solid android:color="?androidprv:attr/colorSurfaceVariant"/>
+ <corners android:radius="@dimen/bottom_sheet_handle_corner_radius" />
+</shape>
diff --git a/res/layout/all_apps_bottom_sheet_background.xml b/res/layout/all_apps_bottom_sheet_background.xml
index ad10d68..12b6b7b 100644
--- a/res/layout/all_apps_bottom_sheet_background.xml
+++ b/res/layout/all_apps_bottom_sheet_background.xml
@@ -17,19 +17,19 @@
android:id="@+id/bottom_sheet_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/bg_all_apps_bottom_sheet">
+ android:background="@drawable/bg_rounded_corner_bottom_sheet">
<View
android:id="@+id/bottom_sheet_handle_area"
android:layout_width="match_parent"
- android:layout_height="34dp" />
+ android:layout_height="36dp" />
<View
android:id="@+id/bottom_sheet_handle"
- android:layout_width="48dp"
- android:layout_height="2dp"
+ android:layout_width="@dimen/bottom_sheet_handle_width"
+ android:layout_height="@dimen/bottom_sheet_handle_height"
android:layout_gravity="center_horizontal"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:background="?android:attr/textColorSecondary" />
+ android:layout_marginTop="@dimen/bottom_sheet_handle_margin"
+ android:layout_marginBottom="@dimen/bottom_sheet_handle_margin"
+ android:background="@drawable/bg_rounded_corner_bottom_sheet_handle" />
</FrameLayout>
diff --git a/res/layout/widgets_bottom_sheet_content.xml b/res/layout/widgets_bottom_sheet_content.xml
index 1a2cfc6..a5f72ef 100644
--- a/res/layout/widgets_bottom_sheet_content.xml
+++ b/res/layout/widgets_bottom_sheet_content.xml
@@ -19,16 +19,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_rounded_corner_bottom_sheet"
- android:paddingTop="16dp"
+ android:paddingTop="@dimen/bottom_sheet_handle_margin"
android:orientation="vertical">
<View
android:id="@+id/collapse_handle"
- android:layout_width="48dp"
- android:layout_height="2dp"
+ android:layout_width="@dimen/bottom_sheet_handle_width"
+ android:layout_height="@dimen/bottom_sheet_handle_height"
android:layout_gravity="center_horizontal"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="@dimen/bottom_sheet_handle_margin"
android:visibility="gone"
- android:background="?android:attr/textColorSecondary"/>
+ android:background="@drawable/bg_rounded_corner_bottom_sheet_handle"/>
<TextView
style="@style/TextHeadline"
android:id="@+id/title"
diff --git a/res/layout/widgets_full_sheet.xml b/res/layout/widgets_full_sheet.xml
index 309dc42..505ecb1 100644
--- a/res/layout/widgets_full_sheet.xml
+++ b/res/layout/widgets_full_sheet.xml
@@ -31,11 +31,11 @@
<View
android:id="@+id/collapse_handle"
- android:layout_width="48dp"
- android:layout_height="2dp"
- android:layout_marginTop="16dp"
+ android:layout_width="@dimen/bottom_sheet_handle_width"
+ android:layout_height="@dimen/bottom_sheet_handle_height"
+ android:layout_marginTop="@dimen/bottom_sheet_handle_margin"
android:layout_centerHorizontal="true"
- android:background="?android:attr/textColorSecondary"/>
+ android:background="@drawable/bg_rounded_corner_bottom_sheet_handle"/>
<TextView
android:id="@+id/no_widgets_text"
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 3dde3f6..92f806e 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -22,7 +22,8 @@
<dimen name="widget_list_horizontal_margin">32dp</dimen>
<!-- AllApps -->
- <dimen name="all_apps_bottom_sheet_horizontal_padding">32dp</dimen>
+ <dimen name="all_apps_search_bar_content_overlap">0dp</dimen>
+ <dimen name="all_apps_bottom_sheet_horizontal_padding">46dp</dimen>
<!-- Fast scroll -->
<dimen name="fastscroll_popup_width">75dp</dimen>
diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 0000000..a9e0fb8
--- /dev/null
+++ b/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<resources>
+<!-- AllApps -->
+ <dimen name="all_apps_top_padding">0dp</dimen>
+</resources>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 9d7941f..5c314d5 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -16,5 +16,6 @@
<resources>
<!-- AllApps -->
- <dimen name="all_apps_bottom_sheet_horizontal_padding">41dp</dimen>
+ <dimen name="all_apps_top_padding">300dp</dimen>
+ <dimen name="all_apps_bottom_sheet_horizontal_padding">65dp</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index ddc7d10..3e666fc 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -93,8 +93,11 @@
<dimen name="fastscroll_end_margin">-26dp</dimen>
<!-- All Apps -->
- <dimen name="all_apps_open_vertical_translate">320dp</dimen>
+ <dimen name="all_apps_starting_vertical_translate">320dp</dimen>
+ <dimen name="all_apps_top_padding">0dp</dimen>
<dimen name="all_apps_search_bar_field_height">48dp</dimen>
+ <!-- all_apps_search_bar_field_height / 2 -->
+ <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>
@@ -363,4 +366,9 @@
<dimen name="search_row_small_icon_size">32dp</dimen>
<dimen name="padded_rounded_button_padding">8dp</dimen>
+<!-- Bottom sheet related parameters -->
+ <dimen name="bottom_sheet_handle_width">32dp</dimen>
+ <dimen name="bottom_sheet_handle_height">4dp</dimen>
+ <dimen name="bottom_sheet_handle_margin">16dp</dimen>
+ <dimen name="bottom_sheet_handle_corner_radius">2dp</dimen>
</resources>