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:
parent
f1f2fcf41d
commit
fef5e4d9f9
7 changed files with 4 additions and 23 deletions
|
@ -1,7 +1,6 @@
|
||||||
package org.oxycblt.auxio.settings.ui
|
package org.oxycblt.auxio.settings.ui
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import org.oxycblt.auxio.R
|
|
||||||
|
|
||||||
class IntListPrefDialog(private val pref: IntListPreference) : LifecycleDialog() {
|
class IntListPrefDialog(private val pref: IntListPreference) : LifecycleDialog() {
|
||||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||||
|
|
|
@ -10,7 +10,6 @@ import androidx.fragment.app.DialogFragment
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import org.oxycblt.auxio.R
|
import org.oxycblt.auxio.R
|
||||||
import org.oxycblt.auxio.ui.resolveAttr
|
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
|
* A wrapper around [DialogFragment] that allows the usage of the standard Auxio lifecycle
|
||||||
|
|
|
@ -129,6 +129,7 @@ fun @receiver:DrawableRes Int.toAnimDrawable(context: Context) =
|
||||||
/**
|
/**
|
||||||
* Resolve this int into a color as if it was an attribute
|
* Resolve this int into a color as if it was an attribute
|
||||||
*/
|
*/
|
||||||
|
@ColorInt
|
||||||
fun @receiver:AttrRes Int.resolveAttr(context: Context): Int {
|
fun @receiver:AttrRes Int.resolveAttr(context: Context): Int {
|
||||||
// Convert the attribute into its color
|
// Convert the attribute into its color
|
||||||
val resolvedAttr = TypedValue()
|
val resolvedAttr = TypedValue()
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<color name="nav_color">#01fafafa</color>
|
<color name="nav_color">#01fafafa</color>
|
||||||
|
|
||||||
<color name="surface_color_black">#000000</color>
|
<color name="surface_color_black">#000000</color>
|
||||||
<color name="selection_color_black">#363636</color>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Base color set derived from Music Player GO.
|
Base color set derived from Music Player GO.
|
||||||
|
|
|
@ -9,21 +9,12 @@
|
||||||
<item name="cornerRadius">0dp</item>
|
<item name="cornerRadius">0dp</item>
|
||||||
</style>
|
</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 -->
|
<!-- 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>
|
<item name="colorControlHighlight">@color/selection_color</item>
|
||||||
</style>
|
</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. -->
|
<!-- Base custom dialog theme. Don't try to understand this. -->
|
||||||
<style name="Theme.CustomDialog.Base" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
<style name="Theme.CustomDialog.Base" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
||||||
<item name="android:colorControlHighlight">?attr/colorControlHighlight</item>
|
<item name="android:colorControlHighlight">?attr/colorControlHighlight</item>
|
||||||
|
@ -46,7 +37,6 @@
|
||||||
<!-- Black theme dialog theme -->
|
<!-- Black theme dialog theme -->
|
||||||
<style name="Theme.CustomDialog.Black" parent="Theme.CustomDialog.Base">
|
<style name="Theme.CustomDialog.Black" parent="Theme.CustomDialog.Base">
|
||||||
<item name="colorSurface">@color/surface_color_black</item>
|
<item name="colorSurface">@color/surface_color_black</item>
|
||||||
<item name="colorControlHighlight">@color/selection_color_black</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Material-specific dialog style -->
|
<!-- Material-specific dialog style -->
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
||||||
<style name="Theme.Template" parent="Theme.Master" />
|
<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 -->
|
<!-- Base theme -->
|
||||||
<style name="Theme.Base" parent="Theme.Template">
|
<style name="Theme.Base" parent="Theme.Template">
|
||||||
<item name="android:windowBackground">?attr/colorSurface</item>
|
<item name="android:windowBackground">?attr/colorSurface</item>
|
||||||
|
@ -29,7 +25,6 @@
|
||||||
<item name="cornerRadius">0dp</item>
|
<item name="cornerRadius">0dp</item>
|
||||||
|
|
||||||
<item name="colorSurface">@color/surface_color</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
|
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. -->
|
<!-- The basic black theme derived in all black accents. -->
|
||||||
<style name="Theme.Base.Black" parent="Theme.Base">
|
<style name="Theme.Base.Black" parent="Theme.Base">
|
||||||
<item name="colorSurface">@color/surface_color_black</item>
|
<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>
|
<item name="materialAlertDialogTheme">@style/Theme.CustomDialog.Black</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
|
@ -8,7 +8,7 @@
|
||||||
<item name="android:layout_height">?android:attr/actionBarSize</item>
|
<item name="android:layout_height">?android:attr/actionBarSize</item>
|
||||||
<item name="android:background">?attr/colorSurface</item>
|
<item name="android:background">?attr/colorSurface</item>
|
||||||
<item name="android:elevation">@dimen/elevation_normal</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="titleTextAppearance">@style/TextAppearance.Toolbar.Header</item>
|
||||||
<item name="titleTextColor">?attr/colorPrimary</item>
|
<item name="titleTextColor">?attr/colorPrimary</item>
|
||||||
|
|
Loading…
Reference in a new issue