Allow the material library to handle dynamic colors. Turns out I was mis-understanding how DynamicColor themes were meant to be used by the material library. Turns out you can just inherit from it and it will work perfectly fine. Refactor the V31 styles to remove our insane shims and finally fix the slapdash dynamic color usage across the main theme and widgets.
77 lines
4.1 KiB
XML
77 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<resources>
|
|
<!-- ANDROID COMPONENT-SPECIFIC STYLES.-->
|
|
|
|
<!--
|
|
A dialog theme that doesn't suck. This is the only non-Material3 usage in the entire
|
|
project since the Material3 dialogs [and especially the button panel] are unusable.
|
|
-->
|
|
<style name="Theme.Auxio.Dialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
|
<item name="android:checkedTextViewStyle">@style/Widget.Auxio.Dialog.CheckedTextView</item>
|
|
<item name="materialAlertDialogTitleTextStyle">@style/Widget.Auxio.Dialog.TextView</item>
|
|
<item name="buttonBarPositiveButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog</item>
|
|
<item name="buttonBarNegativeButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog</item>
|
|
<item name="buttonBarNeutralButtonStyle">@style/Widget.Auxio.Dialog.Button.Flush</item>
|
|
</style>
|
|
|
|
<!-- Custom dialog title theme -->
|
|
<style name="Widget.Auxio.Dialog.TextView" parent="MaterialAlertDialog.Material3.Title.Text">
|
|
<item name="android:textAppearance">@style/TextAppearance.Auxio.TitleLarge</item>
|
|
</style>
|
|
|
|
<!-- The style for the checked text view in the custom dialog -->
|
|
<style name="Widget.Auxio.Dialog.CheckedTextView" parent="Widget.Material3.CheckedTextView">
|
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
|
<item name="android:textAppearance">@style/TextAppearance.Auxio.BodyLarge</item>
|
|
<item name="android:background">@null</item>
|
|
</style>
|
|
|
|
<!-- Custom button style that eliminates the weird margin that the neutral button has -->
|
|
<style name="Widget.Auxio.Dialog.Button.Flush" parent="Widget.Material3.Button.TextButton.Dialog">
|
|
<item name="android:layout_marginStart">0dp</item>
|
|
</style>
|
|
|
|
<!-- Widget TextView that mimics the main Auxio Primary/Secondary TextViews. -->
|
|
<style name="Widget.Auxio.TextView.AppWidget" parent="Widget.Auxio.TextView.Base">
|
|
<item name="android:singleLine">true</item>
|
|
<item name="android:ellipsize">end</item>
|
|
</style>
|
|
|
|
<!-- Widget TextView that mimics the main Auxio Primary TextView -->
|
|
<style name="Widget.Auxio.TextView.Primary.AppWidget" parent="Widget.Auxio.TextView.AppWidget">
|
|
<item name="android:textStyle">normal</item>
|
|
<item name="android:textSize">@dimen/text_size_ext_title_mid_large</item>
|
|
<item name="android:textAppearance">@style/TextAppearance.Material3.TitleMedium</item>
|
|
</style>
|
|
|
|
<!-- Widget TextView that mimics the main Auxio Secondary TextView -->
|
|
<style name="Widget.Auxio.TextView.Secondary.AppWidget" parent="Widget.Auxio.TextView.AppWidget">
|
|
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
|
<item name="android:textAppearance">@style/TextAppearance.Material3.BodyLarge</item>
|
|
</style>
|
|
|
|
<!-- Hack to make sure that ripples work the best that they can on all Android Versions -->
|
|
<style name="Widget.Auxio.Button.AppWidget.V31" parent="Widget.AppCompat.Button.Borderless">
|
|
<!--
|
|
Can't use a normal unbounded ripple here since it causes a weird bug
|
|
where the ripples will have a fixed starting size. Default to the
|
|
uglier system ripple instead.
|
|
-->
|
|
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
|
</style>
|
|
|
|
<!-- A variant of PlaybackButton that plays along with AppWidget restrictions. -->
|
|
<style name="Widget.Auxio.PlaybackButton.AppWidget" parent="Widget.Auxio.Button.AppWidget.V31">
|
|
<item name="android:minHeight">@dimen/size_btn_small</item>
|
|
<item name="android:scaleType">fitCenter</item>
|
|
<item name="android:padding">@dimen/spacing_small</item>
|
|
</style>
|
|
|
|
<!-- Widget panel -->
|
|
<style name="Widget.Auxio.AppWidget.Panel" parent="">
|
|
<item name="android:layout_height">wrap_content</item>
|
|
<item name="android:layout_width">match_parent</item>
|
|
<item name="android:padding">@dimen/spacing_medium</item>
|
|
<item name="android:orientation">vertical</item>
|
|
</style>
|
|
</resources> |