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:
OxygenCobalt 2021-10-19 20:36:04 -06:00
parent 0537681a86
commit b2f20bec30
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
15 changed files with 48 additions and 16 deletions

View file

@ -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 {

View file

@ -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

View 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>

View 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>

View 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>

View 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>

View 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>

View file

@ -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"

View file

@ -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>

View file

@ -4,4 +4,4 @@
android:color="@android:color/transparent" />
<size android:width="@dimen/spacing_small" />
</shape>
</shape>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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.

View file

@ -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>
<!--