style: improve black theme colors

Improve the black theme selection color by merging it with the dark
theme selection coler. This makes the selection color both more
noticable and reduces the style complexity that came from having to
manage two different selection colors.
This commit is contained in:
OxygenCobalt 2021-07-02 08:56:03 -06:00
parent f1f2fcf41d
commit fef5e4d9f9
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
7 changed files with 4 additions and 23 deletions

View file

@ -1,7 +1,6 @@
package org.oxycblt.auxio.settings.ui
import androidx.appcompat.app.AlertDialog
import org.oxycblt.auxio.R
class IntListPrefDialog(private val pref: IntListPreference) : LifecycleDialog() {
override fun onConfigDialog(builder: AlertDialog.Builder) {

View file

@ -10,7 +10,6 @@ import androidx.fragment.app.DialogFragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.oxycblt.auxio.R
import org.oxycblt.auxio.ui.resolveAttr
import org.oxycblt.auxio.ui.toDrawable
/**
* A wrapper around [DialogFragment] that allows the usage of the standard Auxio lifecycle

View file

@ -129,6 +129,7 @@ fun @receiver:DrawableRes Int.toAnimDrawable(context: Context) =
/**
* Resolve this int into a color as if it was an attribute
*/
@ColorInt
fun @receiver:AttrRes Int.resolveAttr(context: Context): Int {
// Convert the attribute into its color
val resolvedAttr = TypedValue()

View file

@ -8,7 +8,6 @@
<color name="nav_color">#01fafafa</color>
<color name="surface_color_black">#000000</color>
<color name="selection_color_black">#363636</color>
<!--
Base color set derived from Music Player GO.

View file

@ -9,21 +9,12 @@
<item name="cornerRadius">0dp</item>
</style>
<!-- Base style for the toolbar popup menu -->
<style name="ThemeOverlay.ToolbarPopup.Base" parent="ThemeOverlay.AppCompat.DayNight">
<item name="android:colorBackground">?attr/colorSurface</item>
</style>
<!-- Toolbar popup menu -->
<style name="ThemeOverlay.ToolbarPopup" parent="ThemeOverlay.ToolbarPopup.Base">
<style name="ThemeOverlay.ToolbarPopup" parent="ThemeOverlay.AppCompat.DayNight">
<item name="android:colorBackground">?attr/colorSurface</item>
<item name="colorControlHighlight">@color/selection_color</item>
</style>
<!-- Toolbar popup menu [Black] -->
<style name="ThemeOverlay.ToolbarPopup.Black" parent="ThemeOverlay.ToolbarPopup.Base">
<item name="colorControlHighlight">@color/selection_color_black</item>
</style>
<!-- Base custom dialog theme. Don't try to understand this. -->
<style name="Theme.CustomDialog.Base" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:colorControlHighlight">?attr/colorControlHighlight</item>
@ -46,7 +37,6 @@
<!-- Black theme dialog theme -->
<style name="Theme.CustomDialog.Black" parent="Theme.CustomDialog.Base">
<item name="colorSurface">@color/surface_color_black</item>
<item name="colorControlHighlight">@color/selection_color_black</item>
</style>
<!-- Material-specific dialog style -->

View file

@ -5,10 +5,6 @@
<!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Template" parent="Theme.Master" />
<!-- Redirects to the correct toolbar popup theme so that it can work on black mode
TODO: I wonder if theres a way to collapse this with the other Toolbar theme. -->
<attr name="toolbarPopupTheme" format="reference" />
<!-- Base theme -->
<style name="Theme.Base" parent="Theme.Template">
<item name="android:windowBackground">?attr/colorSurface</item>
@ -29,7 +25,6 @@
<item name="cornerRadius">0dp</item>
<item name="colorSurface">@color/surface_color</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.ToolbarPopup</item>
<!--
These exact flags, in this exact order, in this exact formatting somehow make
@ -45,8 +40,6 @@
<!-- The basic black theme derived in all black accents. -->
<style name="Theme.Base.Black" parent="Theme.Base">
<item name="colorSurface">@color/surface_color_black</item>
<item name="colorControlHighlight">@color/selection_color_black</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.ToolbarPopup.Black</item>
<item name="materialAlertDialogTheme">@style/Theme.CustomDialog.Black</item>
</style>
</resources>

View file

@ -8,7 +8,7 @@
<item name="android:layout_height">?android:attr/actionBarSize</item>
<item name="android:background">?attr/colorSurface</item>
<item name="android:elevation">@dimen/elevation_normal</item>
<item name="popupTheme">?attr/toolbarPopupTheme</item>
<item name="popupTheme">@style/ThemeOverlay.ToolbarPopup</item>
<item name="titleTextAppearance">@style/TextAppearance.Toolbar.Header</item>
<item name="titleTextColor">?attr/colorPrimary</item>