Show settings icon at start of settings results
Bug: 170792963
Test: Manual
Screenshot: https://screenshot.googleplex.com/MVBtDZGtQ3aChwU
Change-Id: I16a28a7bd9e3129b40102e020cd7c0111e6fe29b
diff --git a/res/layout/search_result_icon_row.xml b/res/layout/search_result_icon_row.xml
index b51896e..280bbc9 100644
--- a/res/layout/search_result_icon_row.xml
+++ b/res/layout/search_result_icon_row.xml
@@ -40,13 +40,13 @@
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorPrimary"
- android:textSize="@dimen/settings_hero_title_size" />
+ android:textSize="@dimen/search_hero_title_size" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/desc"
android:textColor="?android:attr/textColorTertiary"
- android:textSize="@dimen/settings_hero_subtitle_size"
+ android:textSize="@dimen/search_hero_subtitle_size"
android:layout_height="wrap_content" />
</LinearLayout>
@@ -57,7 +57,7 @@
android:layout_height="match_parent"
android:gravity="start|center_vertical"
launcher:iconDisplay="shortcut_popup"
- android:textSize="@dimen/settings_hero_subtitle_size"
+ android:textSize="@dimen/search_hero_subtitle_size"
launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size"
launcher:layoutHorizontal="false" />
@@ -67,7 +67,7 @@
android:layout_width="@dimen/deep_shortcut_icon_size"
android:layout_height="match_parent"
launcher:iconDisplay="shortcut_popup"
- android:textSize="@dimen/settings_hero_inline_button_size"
+ android:textSize="@dimen/search_hero_inline_button_size"
launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size"
launcher:layoutHorizontal="false" />
diff --git a/res/layout/search_result_settings_row.xml b/res/layout/search_result_settings_row.xml
index 19daf34..05f7561 100644
--- a/res/layout/search_result_settings_row.xml
+++ b/res/layout/search_result_settings_row.xml
@@ -18,40 +18,42 @@
android:background="?android:attr/selectableItemBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
+ android:orientation="horizontal"
android:gravity="center_vertical"
- android:padding="4dp"
- android:minHeight="48dp"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp">
+ android:padding="@dimen/dynamic_grid_cell_padding_x"
+ android:textColor="?android:attr/textColorPrimary">
- <TextView
- android:id="@+id/title"
- style="@style/TextTitle"
- android:layout_width="wrap_content"
+ <View
+ android:layout_width="@dimen/search_settings_icon_size"
+ android:src="@drawable/ic_setting"
+ android:id="@+id/icon"
+ android:layout_height="@dimen/search_settings_icon_size" />
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:orientation="vertical"
+ android:paddingRight="@dimen/dynamic_grid_cell_padding_x"
+ android:paddingLeft="@dimen/dynamic_grid_cell_padding_x"
android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="16sp" />
-
- <TextView
- android:id="@+id/description"
- style="@style/TextTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp" />
-
- <TextView
- android:id="@+id/breadcrumbs"
- style="@style/TextTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone"
- android:alpha=".7"
- android:textColor="?android:attr/textColorSecondary"
- android:textSize="14sp" />
+ android:layout_weight="1">
+ <TextView
+ android:id="@+id/title"
+ style="@style/TextTitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/search_line_spacing"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="@dimen/search_hero_title_size" />
+
+ <TextView
+ android:id="@+id/breadcrumbs"
+ style="@style/TextTitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textSize="@dimen/search_hero_subtitle_size" />
+ </LinearLayout>
</com.android.launcher3.views.SearchSettingsRowView>
\ No newline at end of file
diff --git a/res/layout/search_result_slice.xml b/res/layout/search_result_slice.xml
index ea1d49a..24d75e9 100644
--- a/res/layout/search_result_slice.xml
+++ b/res/layout/search_result_slice.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2020 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.
@@ -13,7 +12,29 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<androidx.slice.widget.SliceView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.launcher3.views.SearchResultSettingsSlice xmlns:android="http://schemas.android.com/apk/res/android"
+ android:paddingHorizontal="@dimen/dynamic_grid_cell_padding_x"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingHorizontal="4dp" />
\ No newline at end of file
+ android:layout_height="wrap_content">
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:paddingTop="@dimen/search_settings_icon_vertical_offset"
+ android:layout_height="wrap_content">
+
+ <View
+ android:layout_width="@dimen/search_settings_icon_size"
+ android:src="@drawable/ic_setting"
+ android:id="@+id/icon"
+ android:layout_height="@dimen/search_settings_icon_size" />
+ </FrameLayout>
+
+ <androidx.slice.widget.SliceView
+ android:id="@+id/slice"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginStart="@dimen/dynamic_grid_cell_padding_x"
+ android:layout_width="0dp" />
+
+</com.android.launcher3.views.SearchResultSettingsSlice>
+
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 5387e1b..7df3f77 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -249,8 +249,11 @@
<dimen name="bottom_sheet_edu_padding">24dp</dimen>
<!-- Search related -->
- <dimen name="settings_hero_title_size">16sp</dimen>
- <dimen name="settings_hero_subtitle_size">15sp</dimen>
- <dimen name="settings_hero_inline_button_size">12sp</dimen>
+ <dimen name="search_hero_title_size">16sp</dimen>
+ <dimen name="search_hero_subtitle_size">15sp</dimen>
+ <dimen name="search_hero_inline_button_size">12sp</dimen>
+ <dimen name="search_settings_icon_size">36dp</dimen>
+ <dimen name="search_settings_icon_vertical_offset">16dp</dimen>
+ <dimen name="search_line_spacing">4dp</dimen>
</resources>