Fix visual issues for ActionBar

This commit is contained in:
RikkaW 2021-10-27 13:18:41 +08:00 committed by John Wu
parent 9126cf0c73
commit 627ec91687
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="PrivateResource">
<!-- Add android:colorControlNormal -->
<style name="Base.ThemeOverlay.AppCompat.ActionBar" tools:override="true">
<item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
<item name="colorControlNormal">?android:attr/textColorPrimary</item>
<item name="searchViewStyle">@style/Widget.AppCompat.SearchView.ActionBar</item>
</style>
<style name="Base.ThemeOverlay.AppCompat.Dark.ActionBar" tools:override="true">
<item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
<item name="colorControlNormal">?android:attr/textColorPrimary</item>
<item name="searchViewStyle">@style/Widget.AppCompat.SearchView.ActionBar</item>
</style>
<!-- Removes minimal size for MaterialComponents CheckBox and RadioButton,
so that they will not have extra space in menus.
-->
<style name="Widget.MaterialComponents.CompoundButton.CheckBox" parent="Widget.AppCompat.CompoundButton.CheckBox" tools:override="true">
<item name="enforceMaterialTheme">true</item>
<item name="useMaterialThemeColors">true</item>
</style>
<style name="Widget.MaterialComponents.CompoundButton.RadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton" tools:override="true">
<item name="enforceMaterialTheme">true</item>
<item name="useMaterialThemeColors">true</item>
</style>
</resources>

View File

@ -11,6 +11,7 @@
<item name="android:background">@android:color/transparent</item>
<item name="contentInsetStartWithNavigation">0dp</item>
<item name="android:layout_height">?actionBarSize</item>
<item name="android:theme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
</style>