Refined the Search Bar layout

Removed the background color of the search bar.
Set the background of the AppBarLayout as transparent.
Set the app bar height.

Bug: 118886724
Test: manual review
Change-Id: I7faedc693ce61d5a5237e8a72909b77b56268a4c
This commit is contained in:
Sunny Shao
2018-11-27 16:29:38 +08:00
committed by Fan Zhang
parent 154f34a35e
commit 86b1c7d0b1
6 changed files with 61 additions and 52 deletions

View File

@@ -95,11 +95,7 @@
<dimen name="switchbar_subsettings_margin_start">72dp</dimen>
<dimen name="switchbar_subsettings_margin_end">16dp</dimen>
<!-- The following two margins need to match, with the caveat that
the second should be negative. The second one ensures that the icons and text
align despite the additional padding caused by the search bar's card background. -->
<dimen name="search_bar_margin">16dp</dimen>
<dimen name="search_bar_negative_margin">-16dp</dimen>
<dimen name="search_bar_height">48dp</dimen>
<dimen name="search_bar_corner_radius">2dp</dimen>

View File

@@ -17,7 +17,7 @@
<resources>
<style name="Widget.ActionBar.Base"
parent="@android:style/Widget.DeviceDefault.Light.ActionBar.Solid"/>
parent="@android:style/Widget.DeviceDefault.Light.ActionBar.Solid"/>
<style name="Widget.ActionBar"
parent="Widget.ActionBar.Base">
@@ -259,7 +259,8 @@
<style name="TextAppearance.Medium" parent="@android:style/TextAppearance.Material.Medium"/>
<style name="TextAppearance.Small" parent="@android:style/TextAppearance.Material.Small"/>
<style name="TextAppearance.Switch" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
<style name="TextAppearance.Switch"
parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
<item name="android:textSize">16sp</item>
</style>
@@ -400,9 +401,11 @@
<style name="ActionSecondaryButton" parent="android:Widget.DeviceDefault.Button"/>
<style name="SettingsActionButton" parent="android:Widget.DeviceDefault.Button.Borderless.Colored">
<style name="SettingsActionButton"
parent="android:Widget.DeviceDefault.Button.Borderless.Colored">
<item name="android:drawablePadding">4dp</item>
<item name="android:drawableTint">@*android:color/btn_colored_borderless_text_material</item>
<item name="android:drawableTint">@*android:color/btn_colored_borderless_text_material
</item>
<item name="android:layout_marginEnd">8dp</item>
<item name="android:paddingTop">20dp</item>
<item name="android:paddingBottom">20dp</item>
@@ -465,6 +468,13 @@
<item name="strokeWidth">1dp</item>
</style>
<style name="SearchBarStyle">
<item name="android:layout_margin">@dimen/search_bar_margin</item>
<item name="cardCornerRadius">8dp</item>
<item name="strokeColor">@color/homepage_card_stroke_color</item>
<item name="strokeWidth">1dp</item>
</style>
<style name="ConditionCardBorderlessButton"
parent="android:Widget.DeviceDefault.Button.Borderless">
<item name="android:textColor">?android:attr/colorAccent</item>

View File

@@ -195,11 +195,6 @@
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="ThemeOverlay.Settings.SearchBar" parent="Theme.Settings">
<item name="android:colorBackground">?android:attr/colorPrimary</item>
<item name="cardBackgroundColor">?android:attr/colorBackground</item>
</style>
<style name="Theme.BottomDialog" parent="@*android:style/Theme.DeviceDefault.Settings.Dialog">
<item name="android:windowBackground">@drawable/settings_panel_background</item>
</style>