[Search] Update all apps header protection
- Introduce spacing between header protection and search box
- introduce vertical padding for "personal | work" tab
- animate tab header protection color change when docking
Test: Manual
preview: https://drive.google.com/file/d/1eS4B7hcLExxCdjSp1IzBcziKm-9w87UR/view?usp=sharing&resourcekey=0--mtY6bCC9GJpFSUC8I5d6w
Bug: 184946772
Change-Id: I840af27c7557f1dffd7a15874aa09833514b4bb1
diff --git a/res/drawable/all_apps_tabs_background.xml b/res/drawable/all_apps_tabs_background.xml
index 377b653..f882522 100644
--- a/res/drawable/all_apps_tabs_background.xml
+++ b/res/drawable/all_apps_tabs_background.xml
@@ -13,9 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<shape android:shape="rectangle"
- xmlns:android="http://schemas.android.com/apk/res/android"
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <solid android:color="?androidprv:attr/colorSurface" />
- <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
-</shape>
\ No newline at end of file
+ <item
+ android:top="6dp"
+ android:bottom="6dp">
+ <shape android:shape="rectangle">
+ <solid android:color="?androidprv:attr/colorSurface" />
+ <corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
+ </shape>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/layout/all_apps_personal_work_tabs.xml b/res/layout/all_apps_personal_work_tabs.xml
index f089f83..686dda8 100644
--- a/res/layout/all_apps_personal_work_tabs.xml
+++ b/res/layout/all_apps_personal_work_tabs.xml
@@ -16,11 +16,10 @@
<com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabs"
- android:layout_width="match_parent"
+ android:layout_width="@dimen/all_apps_header_pills_width"
android:layout_height="@dimen/all_apps_header_pill_height"
+ android:layout_gravity="center_horizontal"
android:background="@drawable/all_apps_tabs_background"
- android:layout_marginLeft="@dimen/all_apps_tabs_side_padding"
- android:layout_marginRight="@dimen/all_apps_tabs_side_padding"
android:orientation="horizontal"
android:elevation="2dp"
style="@style/TextHeadline">
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index 94fcdb9..b15a320 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -71,8 +71,6 @@
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="@dimen/all_apps_header_pill_height"
- android:layout_marginLeft="@dimen/all_apps_tabs_side_padding"
- android:layout_marginRight="@dimen/all_apps_tabs_side_padding"
android:orientation="horizontal"
style="@style/TextHeadline">
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index e605ca8..dc33ab8 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -19,6 +19,7 @@
<!-- Attributes used for launcher theme -->
<attr name="allAppsScrimColor" format="color" />
+ <attr name="allappsHeaderProtectionColor" format="color" />
<attr name="allAppsNavBarScrimColor" format="color" />
<attr name="allAppsTheme" format="reference" />
<attr name="popupColorPrimary" format="color" />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index e6553a2..3d21311 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -17,7 +17,8 @@
** limitations under the License.
*/
-->
-<resources>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<!-- The color tints to apply to the text and drag view when hovering
over the delete target or the info target -->
<color name="delete_target_hover_tint">#FFC1C1C1</color>
@@ -58,5 +59,4 @@
<color name="wallpaper_popup_scrim">?android:attr/colorAccent</color>
<color name="wallpaper_scrim_color">#0D878787</color>
-
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 451f82b..bfa02c0 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -91,7 +91,7 @@
<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">36dp</dimen>
+ <dimen name="all_apps_header_pill_height">48dp</dimen>
<dimen name="all_apps_header_pill_corner_radius">18dp</dimen>
<dimen name="all_apps_header_pills_width">320dp</dimen>
<dimen name="all_apps_header_tab_height">48dp</dimen>
@@ -99,7 +99,7 @@
<dimen name="all_apps_header_top_padding">36dp</dimen>
<dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen>
<dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen>
- <dimen name="all_apps_tabs_side_padding">32dp</dimen>
+ <dimen name="all_apps_tabs_vertical_padding">6dp</dimen>
<dimen name="all_apps_divider_height">1dp</dimen>
<dimen name="all_apps_tip_bottom_margin">8dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 6d22951..14ec573 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -33,6 +33,7 @@
<style name="LauncherTheme" parent="@style/BaseLauncherTheme">
<item name="android:textColorSecondary">#DE000000</item>
<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>