style: improve material you usage
My phone has just updated to Android 12, and Auxio looks very out of place compared to the other themed APIs. Improve the usage of Material You on the app icon and the widgets so that they line up a bit more. Can't fully commit though since sometimes the colors can't be replicated or because they don't look very good.
This commit is contained in:
parent
0537681a86
commit
b2f20bec30
15 changed files with 48 additions and 16 deletions
|
@ -32,7 +32,7 @@ import org.oxycblt.auxio.ui.SortMode
|
|||
* Wrapper around the [SharedPreferences] class that writes & reads values without a context.
|
||||
* @author OxygenCobalt
|
||||
* TODO: Consider re-adding the colorize notif setting but only on <Android 10 since it really
|
||||
* doesn't work on Android 11+
|
||||
* doesn't work on Android 11+
|
||||
*/
|
||||
class SettingsManager private constructor(context: Context) :
|
||||
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.oxycblt.auxio.settings.tabs
|
||||
|
||||
import org.oxycblt.auxio.ui.DisplayMode
|
||||
import org.oxycblt.auxio.util.logD
|
||||
import org.oxycblt.auxio.util.logE
|
||||
|
||||
/**
|
||||
|
@ -89,8 +88,6 @@ sealed class Tab(open val mode: DisplayMode) {
|
|||
for (shift in (0..4 * SEQUENCE_LEN).reversed() step 4) {
|
||||
val chunk = sequence.shr(shift) and 0b1111
|
||||
|
||||
logD(sequence.shr(shift).toString(2))
|
||||
|
||||
val mode = when (chunk and 7) {
|
||||
0 -> DisplayMode.SHOW_SONGS
|
||||
1 -> DisplayMode.SHOW_ALBUMS
|
||||
|
|
7
app/src/main/res/color-night-v31/fill_icon_bg.xml
Normal file
7
app/src/main/res/color-night-v31/fill_icon_bg.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Use pure black on dark mode. This is because other neutral colors on dark mode
|
||||
will result in the auxio icon blending in with the background of either the launcher
|
||||
drawer or the recent apps menu. -->
|
||||
<item android:color="@android:color/system_neutral1_1000" />
|
||||
</selector>
|
4
app/src/main/res/color-night-v31/fill_icon_fg.xml
Normal file
4
app/src/main/res/color-night-v31/fill_icon_fg.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@android:color/system_accent1_100" />
|
||||
</selector>
|
4
app/src/main/res/color-v31/fill_icon_bg.xml
Normal file
4
app/src/main/res/color-v31/fill_icon_bg.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@android:color/system_accent1_100" />
|
||||
</selector>
|
4
app/src/main/res/color-v31/fill_icon_fg.xml
Normal file
4
app/src/main/res/color-v31/fill_icon_fg.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@android:color/system_neutral2_700" />
|
||||
</selector>
|
4
app/src/main/res/color/fill_icon_bg.xml
Normal file
4
app/src/main/res/color/fill_icon_bg.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="#111111" />
|
||||
</selector>
|
|
@ -1,7 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- TODO: Apply dynamic colors to our icon once we can make it line up
|
||||
with the pixel ones. Currently it's too risky as all we have are the
|
||||
promo stuff. -->
|
||||
<gradient android:endX="64.75"
|
||||
android:endY="28.5"
|
||||
android:startX="60"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#111111"
|
||||
android:fillColor="@color/fill_icon_bg"
|
||||
android:strokeColor="#00000000"
|
||||
android:pathData="M0 0h108v108H0z" />
|
||||
</vector>
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
android:color="@android:color/transparent" />
|
||||
|
||||
<size android:width="@dimen/spacing_small" />
|
||||
</shape>
|
||||
</shape>
|
|
@ -55,4 +55,12 @@
|
|||
<item name="android:textColorHintInverse">@color/m3_dynamic_hint_foreground</item>
|
||||
<item name="android:textColorAlertDialogListItem">@color/m3_dynamic_dark_default_color_primary_text</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Widget" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="colorSurface">@android:color/system_accent2_800</item>
|
||||
<item name="colorPrimary">?android:attr/colorAccent</item>
|
||||
<item name="colorSecondary">?android:attr/colorAccent</item>
|
||||
<item name="colorControlNormal">@color/m3_sys_color_dynamic_dark_inverse_surface</item>
|
||||
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="surface">#1f1f1f</color>
|
||||
<color name="surface">@color/surface_night</color>
|
||||
<color name="surface_inverse">@color/surface_day</color>
|
||||
<color name="control">#ffffff</color>
|
||||
<color name="nav_bar">#01151515</color>
|
||||
|
||||
|
|
|
@ -57,10 +57,10 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.Widget" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="colorSurface">@android:color/system_accent1_50</item>
|
||||
<item name="colorPrimary">?android:attr/colorAccent</item>
|
||||
<item name="colorSecondary">?android:attr/colorAccent</item>
|
||||
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
|
||||
<item name="colorControlNormal">@color/m3_sys_color_dynamic_light_inverse_surface</item>
|
||||
<item name="colorControlHighlight">?android:attr/colorControlHighlight</item>
|
||||
<item name="colorSurface">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -2,9 +2,14 @@
|
|||
<resources>
|
||||
<!-- Base app colors -->
|
||||
<color name="surface">#fafafa</color>
|
||||
<color name="surface_inverse">@color/surface_night</color>
|
||||
<color name="control">#202020</color>
|
||||
<color name="nav_bar">#01fafafa</color>
|
||||
|
||||
<color name="surface_day">#fafafa</color>
|
||||
<color name="surface_night">#1f1f1f</color>
|
||||
<color name="surface_black">@android:color/black</color>
|
||||
|
||||
<!--
|
||||
Each accent's color roles.
|
||||
Note that some accents might have different tones used for legibility. Those are not errors.
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
<!-- Android 12 configuration -->
|
||||
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V27">
|
||||
<!-- Make sure to apply more accent-friendly values on older versions -->
|
||||
<item name="colorSurface">@color/surface</item>
|
||||
<item name="colorSurfaceInverse">@color/surface_inverse</item>
|
||||
|
||||
<item name="colorSecondary">?attr/colorPrimary</item>
|
||||
<item name="colorOnSecondary">?attr/colorOnPrimary</item>
|
||||
<item name="colorSecondaryContainer">?attr/colorPrimaryContainer</item>
|
||||
|
@ -16,9 +19,6 @@
|
|||
<item name="colorOnTertiary">?attr/colorOnPrimary</item>
|
||||
<item name="colorTertiaryContainer">?attr/colorPrimaryContainer</item>
|
||||
<item name="colorOnTertiaryContainer">?attr/colorOnPrimaryContainer</item>
|
||||
|
||||
<item name="colorSurface">@color/surface</item>
|
||||
<item name="colorControlNormal">@color/control</item>
|
||||
</style>
|
||||
|
||||
<!-- Base theme -->
|
||||
|
@ -26,6 +26,7 @@
|
|||
<!-- Values -->
|
||||
<item name="colorOutline">@color/overlay_stroke</item>
|
||||
<item name="colorAccent">?attr/colorSecondary</item>
|
||||
<item name="colorControlNormal">?attr/colorSurfaceInverse</item>
|
||||
<item name="colorControlHighlight">@color/overlay_selection</item>
|
||||
<item name="colorControlActivated">?attr/colorSecondary</item>
|
||||
|
||||
|
@ -48,7 +49,7 @@
|
|||
Assume that Android's night mode will do the rest of the work
|
||||
for us and set the background to pitch-black
|
||||
-->
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
<item name="colorSurface">@color/surface_black</item>
|
||||
</style>
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Reference in a new issue