Leverage the panel title font size of non-first row
The title of non-first row in a slice has smaller font size by default.
- Sync the font size with the one of the first row.
- Also rename the related styles in style.xml
- Let homepage slices has smaller font on non-first row based on UX
design.
Bug: 152831413
Test: visual
Change-Id: I87c2008745adb68c031dc2d4e15b93bccfea12b0
diff --git a/res/layout/contextual_slice_full_tile.xml b/res/layout/contextual_slice_full_tile.xml
index b6ab410..01d4bd9 100644
--- a/res/layout/contextual_slice_full_tile.xml
+++ b/res/layout/contextual_slice_full_tile.xml
@@ -27,7 +27,7 @@
<androidx.slice.widget.SliceView
android:id="@+id/slice_view"
android:theme="@style/Theme.Settings.ContextualCard"
- style="@style/ContextualCardSliceViewStyle"
+ style="@style/Widget.SliceView.ContextualCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
diff --git a/res/layout/contextual_slice_sticky_tile.xml b/res/layout/contextual_slice_sticky_tile.xml
index 2e7a2be..e47c98d 100644
--- a/res/layout/contextual_slice_sticky_tile.xml
+++ b/res/layout/contextual_slice_sticky_tile.xml
@@ -25,7 +25,7 @@
<androidx.slice.widget.SliceView
android:id="@+id/slice_view"
android:theme="@style/Theme.Settings.ContextualCard"
- style="@style/ContextualCardSliceViewStyle"
+ style="@style/Widget.SliceView.ContextualCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
diff --git a/res/layout/panel_slice_row.xml b/res/layout/panel_slice_row.xml
index 74dc412..69a36f60 100644
--- a/res/layout/panel_slice_row.xml
+++ b/res/layout/panel_slice_row.xml
@@ -22,7 +22,7 @@
<androidx.slice.widget.SliceView
android:id="@+id/slice_view"
- style="@style/SliceViewStyle"
+ style="@style/Widget.SliceView.Panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
diff --git a/res/layout/panel_slice_slider_row.xml b/res/layout/panel_slice_slider_row.xml
index c1c076c..a7659d3 100644
--- a/res/layout/panel_slice_slider_row.xml
+++ b/res/layout/panel_slice_slider_row.xml
@@ -23,7 +23,7 @@
<androidx.slice.widget.SliceView
android:id="@+id/slice_view"
- style="@style/SliceViewSliderStyle"
+ style="@style/Widget.SliceView.Panel.Slider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="0dp"
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ae49c6e..8393f80 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -498,20 +498,20 @@
<style name="Widget.SliceView.Settings">
<item name="titleSize">@*android:dimen/text_size_subhead_material</item>
- <item name="rowStyle">@style/SliceRowStyle.Settings</item>
+ <item name="rowStyle">@style/SliceRow.Settings</item>
</style>
- <style name="SliceViewStyle">
- <item name="rowStyle">@style/SliceRowStyle</item>
+ <style name="Widget.SliceView.Panel">
+ <item name="titleSize">16sp</item>
+ <item name="rowStyle">@style/SliceRow</item>
<item name="android:background">?android:attr/colorBackgroundFloating</item>
</style>
- <style name="SliceViewSliderStyle">
- <item name="rowStyle">@style/SliceRowSliderStyle</item>
- <item name="android:background">?android:attr/colorBackgroundFloating</item>
+ <style name="Widget.SliceView.Panel.Slider">
+ <item name="rowStyle">@style/SliceRow.Slider</item>
</style>
- <style name="SliceRowSliderStyle">
+ <style name="SliceRow.Slider">
<!-- 2dp start padding for the start icon -->
<item name="titleItemStartPadding">10dp</item>
<item name="titleItemEndPadding">0dp</item>
@@ -535,11 +535,12 @@
<item name="subContentStartPadding">6dp</item>
</style>
- <style name="ContextualCardSliceViewStyle" parent="SliceViewStyle">
+ <style name="Widget.SliceView.ContextualCard">
+ <item name="rowStyle">@style/SliceRow</item>
<item name="android:background">@color/contextual_card_background</item>
</style>
- <style name="SliceRowStyle">
+ <style name="SliceRow">
<!-- 2dp start padding for the start icon -->
<item name="titleItemStartPadding">2dp</item>
<item name="titleItemEndPadding">0dp</item>
@@ -560,7 +561,7 @@
<item name="actionDividerHeight">32dp</item>
</style>
- <style name="SliceRowStyle.Settings">
+ <style name="SliceRow.Settings">
<!-- Padding between content and the start icon is 8dp -->
<item name="contentStartPadding">8dp</item>
</style>