Change setting ripple color

Change the ripple on the settings to a generally neutral color instead of the gaudy colorPrimary.
This commit is contained in:
OxygenCobalt 2020-11-29 14:41:58 -07:00
parent e15df4ce73
commit 59036a2747
23 changed files with 169 additions and 77 deletions

View file

@ -89,13 +89,17 @@ dependencies {
implementation 'io.coil-kt:coil:0.13.0' implementation 'io.coil-kt:coil:0.13.0'
// Material // Material
implementation 'com.google.android.material:material:1.3.0-alpha03' implementation 'com.google.android.material:material:1.3.0-alpha04'
// Fast-Scroll // Fast-Scroll
implementation 'com.reddit:indicator-fast-scroll:1.3.0' implementation 'com.reddit:indicator-fast-scroll:1.3.0'
// Dialogs
implementation 'com.afollestad.material-dialogs:core:3.3.0' implementation 'com.afollestad.material-dialogs:core:3.3.0'
// Edge-To-Edge
implementation 'de.halfbit:edge-to-edge:0.10'
// --- DEV --- // --- DEV ---
// Lint // Lint

View file

@ -22,4 +22,4 @@
-dontobfuscate -dontobfuscate
-keep class org.oxycblt.auxio.settings.SettingListFragment -keep class org.oxycblt.auxio.settings.SettingsListFragment

View file

@ -26,8 +26,8 @@ import org.oxycblt.auxio.ui.accent
import org.oxycblt.auxio.ui.toColor import org.oxycblt.auxio.ui.toColor
/** /**
* A source code copy of [com.reddit.indicatorfastscroll.FastScrollerThumbView] that fixes a * A semi-copy, semi-custom implementation of [com.reddit.indicatorfastscroll.FastScrollerThumbView]
* memory leak that occurs from having nested fragments. All credit goes to the authors of * that fixes a memory leak that occurs from a bug fix they added. All credit goes to the authors of
* the fast scroll library. * the fast scroll library.
* <a href="https://github.com/reddit/IndicatorFastScroll"> Link to repo </a> * <a href="https://github.com/reddit/IndicatorFastScroll"> Link to repo </a>
* @author Reddit, OxygenCobalt * @author Reddit, OxygenCobalt
@ -81,7 +81,11 @@ class NoLeakThumbView @JvmOverloads constructor(
fastScrollerView.onTouchEvent(event) fastScrollerView.onTouchEvent(event)
fastScrollerView.performClick() fastScrollerView.performClick()
if (event.actionMasked in intArrayOf(MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL)) { if (event.actionMasked in intArrayOf(
MotionEvent.ACTION_UP,
MotionEvent.ACTION_CANCEL
)
) {
isActivated = false isActivated = false
return@setOnTouchListener true return@setOnTouchListener true
} }
@ -104,15 +108,9 @@ class NoLeakThumbView @JvmOverloads constructor(
fastScrollerView.apply { fastScrollerView.apply {
children.forEach { view -> children.forEach { view ->
if (view.containsY(touchY)) { if (view.containsY(touchY) && (view is ImageView || view is TextView)) {
when (view) { consumed = true
is ImageView -> { return@forEach
consumed = true
}
is TextView -> {
consumed = true
}
}
} }
} }
} }

View file

@ -1,12 +1,17 @@
package org.oxycblt.auxio.settings package org.oxycblt.auxio.settings
import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceGroupAdapter
import androidx.preference.PreferenceScreen
import androidx.preference.PreferenceViewHolder
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
@ -18,12 +23,15 @@ import org.oxycblt.auxio.ui.ACCENTS
import org.oxycblt.auxio.ui.accent import org.oxycblt.auxio.ui.accent
import org.oxycblt.auxio.ui.getDetailedAccentSummary import org.oxycblt.auxio.ui.getDetailedAccentSummary
class SettingListFragment : PreferenceFragmentCompat() { class SettingsListFragment : PreferenceFragmentCompat() {
private val settingsModel: SettingsViewModel by activityViewModels() private val settingsModel: SettingsViewModel by activityViewModels()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
view.apply {
}
val themePref = findPreference<Preference>(SettingsManager.Keys.KEY_THEME)?.apply { val themePref = findPreference<Preference>(SettingsManager.Keys.KEY_THEME)?.apply {
setIcon( setIcon(
when (AppCompatDelegate.getDefaultNightMode()) { when (AppCompatDelegate.getDefaultNightMode()) {
@ -80,9 +88,33 @@ class SettingListFragment : PreferenceFragmentCompat() {
setPreferencesFromResource(R.xml.prefs_main, rootKey) setPreferencesFromResource(R.xml.prefs_main, rootKey)
} }
// Forcefully override the adapter creation process so I can get rid of the ugly
// colorPrimary ripples.
@SuppressLint("RestrictedApi")
override fun onCreateAdapter(preferenceScreen: PreferenceScreen?): RecyclerView.Adapter<*> {
return object : PreferenceGroupAdapter(preferenceScreen) {
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): PreferenceViewHolder {
val holder = super.onCreateViewHolder(parent, viewType)
if (holder.itemView.id != android.R.id.title) {
holder.itemView.setBackgroundResource(R.drawable.ui_ripple)
}
return holder
}
}
}
private fun offLoad(something: String) {
Log.d(this::class.simpleName, something)
}
private fun showAccentDialog() { private fun showAccentDialog() {
MaterialDialog(requireActivity()).show { MaterialDialog(requireActivity()).show {
title(R.string.label_settings_accent) title(R.string.setting_accent)
// Roll my own RecyclerView since [To no surprise whatsoever] Material Dialogs // Roll my own RecyclerView since [To no surprise whatsoever] Material Dialogs
// has a bug where ugly dividers will show with the RecyclerView even if you disable them. // has a bug where ugly dividers will show with the RecyclerView even if you disable them.

View file

@ -14,7 +14,8 @@ import org.oxycblt.auxio.ui.ACCENTS
* the first time it occurs. * the first time it occurs.
* @author OxygenCobalt * @author OxygenCobalt
*/ */
class SettingsManager private constructor(context: Context) : SharedPreferences.OnSharedPreferenceChangeListener { class SettingsManager private constructor(context: Context) :
SharedPreferences.OnSharedPreferenceChangeListener {
private val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context) private val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context)
init { init {
@ -79,6 +80,10 @@ class SettingsManager private constructor(context: Context) : SharedPreferences.
) ?: SortMode.ALPHA_DOWN ) ?: SortMode.ALPHA_DOWN
} }
fun getEdgeToEdge(): Boolean {
return sharedPrefs.getBoolean(Keys.KEY_EDGE_TO_EDGE, false)
}
// --- OVERRIDES --- // --- OVERRIDES ---
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
@ -124,6 +129,7 @@ class SettingsManager private constructor(context: Context) : SharedPreferences.
const val KEY_LIBRARY_SORT_MODE = "KEY_LIBRARY_SORT_MODE" const val KEY_LIBRARY_SORT_MODE = "KEY_LIBRARY_SORT_MODE"
const val KEY_THEME = "KEY_THEME" const val KEY_THEME = "KEY_THEME"
const val KEY_ACCENT = "KEY_ACCENT" const val KEY_ACCENT = "KEY_ACCENT"
const val KEY_EDGE_TO_EDGE = "KEY_EDGE"
} }
private object Theme { private object Theme {
@ -133,11 +139,12 @@ class SettingsManager private constructor(context: Context) : SharedPreferences.
} }
/** /**
* A safe interface for receiving preference updates, use this instead of * An interface for receiving some settings updates.
* [SharedPreferences.OnSharedPreferenceChangeListener]. * [SharedPreferences.OnSharedPreferenceChangeListener].
*/ */
interface Callback { interface Callback {
fun onThemeUpdate(newTheme: Int) {} fun onThemeUpdate(newTheme: Int) {}
fun onAccentUpdate(newAccent: Pair<Int, Int>) {} fun onAccentUpdate(newAccent: Pair<Int, Int>) {}
fun onEdgeToEdgeUpdate(isEdgeToEdge: Boolean) {}
} }
} }

View file

@ -1,7 +1,6 @@
package org.oxycblt.auxio.settings.adapters package org.oxycblt.auxio.settings.adapters
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@ -9,6 +8,7 @@ import org.oxycblt.auxio.R
import org.oxycblt.auxio.databinding.ItemAccentBinding import org.oxycblt.auxio.databinding.ItemAccentBinding
import org.oxycblt.auxio.ui.ACCENTS import org.oxycblt.auxio.ui.ACCENTS
import org.oxycblt.auxio.ui.accent import org.oxycblt.auxio.ui.accent
import org.oxycblt.auxio.ui.getAccentItemSummary
import org.oxycblt.auxio.ui.toColor import org.oxycblt.auxio.ui.toColor
class AccentAdapter( class AccentAdapter(
@ -29,20 +29,25 @@ class AccentAdapter(
) : RecyclerView.ViewHolder(binding.root) { ) : RecyclerView.ViewHolder(binding.root) {
fun bind(accentData: Pair<Int, Int>) { fun bind(accentData: Pair<Int, Int>) {
binding.accent.setOnClickListener {
Log.d(this::class.simpleName, accentData.toString())
doOnAccentConfirm(accentData)
}
binding.accent.apply { binding.accent.apply {
imageTintList = if (accentData.first != accent.first) { contentDescription = getAccentItemSummary(context, accentData)
ColorStateList.valueOf(
android.R.color.transparent.toColor(context) setOnClickListener {
) doOnAccentConfirm(accentData)
} else { }
imageTintList = if (accentData.first == accent.first) {
isEnabled = false
ColorStateList.valueOf( ColorStateList.valueOf(
R.color.background.toColor(context) R.color.background.toColor(context)
) )
} else {
isEnabled = true
ColorStateList.valueOf(
android.R.color.transparent.toColor(context)
)
} }
backgroundTintList = ColorStateList.valueOf( backgroundTintList = ColorStateList.valueOf(

View file

@ -129,18 +129,19 @@ class SongsFragment : Fragment(), SearchView.OnQueryTextListener {
useDefaultScroller = false useDefaultScroller = false
itemIndicatorSelectedCallbacks.add(object : FastScrollerView.ItemIndicatorSelectedCallback { itemIndicatorSelectedCallbacks.add(object :
override fun onItemIndicatorSelected( FastScrollerView.ItemIndicatorSelectedCallback {
indicator: FastScrollItemIndicator, override fun onItemIndicatorSelected(
indicatorCenterY: Int, indicator: FastScrollItemIndicator,
itemPosition: Int indicatorCenterY: Int,
) { itemPosition: Int
val layoutManager = binding.songRecycler.layoutManager ) {
as LinearLayoutManager val layoutManager = binding.songRecycler.layoutManager
as LinearLayoutManager
layoutManager.scrollToPositionWithOffset(itemPosition, 0) layoutManager.scrollToPositionWithOffset(itemPosition, 0)
}
} }
}
) )
} }

View file

@ -93,6 +93,7 @@ fun PopupMenu.setupSongActions(song: Song, context: Context, playbackModel: Play
} }
inflateAndShow(R.menu.menu_song_actions) inflateAndShow(R.menu.menu_song_actions)
} }
/** /**
* Show actions for a song item, such as the ones found in [org.oxycblt.auxio.songs.SongsFragment] * Show actions for a song item, such as the ones found in [org.oxycblt.auxio.songs.SongsFragment]
*/ */

View file

@ -5,7 +5,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorPrimary"> android:tint="?attr/colorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M10.85,12.65h2.3L12,9l-1.15,3.65zM20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69L23.31,12 20,8.69zM14.3,16l-0.7,-2h-3.2l-0.7,2H7.8L11,7h2l3.2,9h-1.9z"/> android:pathData="M10.85,12.65h2.3L12,9l-1.15,3.65zM20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69L23.31,12 20,8.69zM14.3,16l-0.7,-2h-3.2l-0.7,2H7.8L11,7h2l3.2,9h-1.9z" />
</vector> </vector>

View file

@ -5,7 +5,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24" android:viewportHeight="24"
android:tint="@color/background"> android:tint="@color/background">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/> android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
</vector> </vector>

View file

@ -5,7 +5,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorPrimary"> android:tint="?attr/colorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M20,8.69L20,4h-4.69L12,0.69 8.69,4L4,4v4.69L0.69,12 4,15.31L4,20h4.69L12,23.31 15.31,20L20,20v-4.69L23.31,12 20,8.69zM12,18c-3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6 6,2.69 6,6 -2.69,6 -6,6zM12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4z"/> android:pathData="M20,8.69L20,4h-4.69L12,0.69 8.69,4L4,4v4.69L0.69,12 4,15.31L4,20h4.69L12,23.31 15.31,20L20,20v-4.69L23.31,12 20,8.69zM12,18c-3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6 6,2.69 6,6 -2.69,6 -6,6zM12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4z" />
</vector> </vector>

View file

@ -5,7 +5,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorPrimary"> android:tint="?attr/colorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18c-3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6 6,2.69 6,6 -2.69,6 -6,6z"/> android:pathData="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18c-3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6 6,2.69 6,6 -2.69,6 -6,6z" />
</vector> </vector>

View file

@ -5,7 +5,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorPrimary"> android:tint="?attr/colorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/> android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
</vector> </vector>

View file

@ -4,6 +4,5 @@
<size <size
android:width="48dp" android:width="48dp"
android:height="48dp" /> android:height="48dp" />
<solid <solid android:color="@android:color/white" />
android:color="@android:color/white" />
</shape> </shape>

View file

@ -16,12 +16,12 @@
android:elevation="@dimen/elevation_normal" android:elevation="@dimen/elevation_normal"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:title="@string/label_settings" app:title="@string/setting_title"
app:titleTextAppearance="@style/TextAppearance.Toolbar.Header" /> app:titleTextAppearance="@style/TextAppearance.Toolbar.Header" />
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/settings_list_fragment" android:id="@+id/settings_list_fragment"
android:name="org.oxycblt.auxio.settings.SettingListFragment" android:name="org.oxycblt.auxio.settings.SettingsListFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
</data> </data>
@ -9,6 +10,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/margin_mid_small"> android:padding="@dimen/margin_mid_small">
<ImageButton <ImageButton
android:id="@+id/accent" android:id="@+id/accent"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView <TextView android:id="@android:id/title"
android:id="@android:id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"

View file

@ -10,6 +10,6 @@
android:icon="@drawable/ic_song" /> android:icon="@drawable/ic_song" />
<item <item
android:id="@+id/settings_fragment" android:id="@+id/settings_fragment"
android:title="@string/label_settings" android:title="@string/setting_title"
android:icon="@drawable/ic_settings" /> android:icon="@drawable/ic_settings" />
</menu> </menu>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<array name="theme_entries"> <array name="theme_entries">
<item>@string/label_settings_theme_auto</item> <item>@string/setting_theme_auto</item>
<item>@string/label_settings_theme_light</item> <item>@string/setting_theme_day</item>
<item>@string/label_settings_theme_dark</item> <item>@string/setting_theme_night</item>
</array> </array>
<array name="theme_values"> <array name="theme_values">

View file

@ -27,14 +27,18 @@
<string name="label_next_user_queue">Next in Queue</string> <string name="label_next_user_queue">Next in Queue</string>
<string name="label_channel">Music Playback</string> <string name="label_channel">Music Playback</string>
<string name="label_service_playback">The music playback service for Auxio.</string> <string name="label_service_playback">The music playback service for Auxio.</string>
<string name="label_settings">Settings</string>
<string name="label_settings_ui">Appearance</string> <!-- Settings namespace | Settings-related labels -->
<string name="label_settings_theme">Theme</string> <string name="setting_title">Settings</string>
<string name="label_settings_theme_auto">Automatic</string> <string name="setting_ui">Appearance</string>
<string name="label_settings_theme_light">Light</string> <string name="setting_theme">Theme</string>
<string name="label_settings_theme_dark">Dark</string> <string name="setting_theme_auto">Automatic</string>
<string name="label_settings_theme_choose">Choose theme</string> <string name="setting_theme_day">Light</string>
<string name="label_settings_accent">Accent</string> <string name="setting_theme_night">Dark</string>
<string name="setting_accent">Accent</string>
<string name="setting_edge">Edge-To-Edge</string>
<string name="setting_edge_desc_on">Disable edge-to-edge</string>
<string name="setting_edge_desc_off">Enable edge-to-edge</string>
<!-- Debug Namespace | Debug labels --> <!-- Debug Namespace | Debug labels -->
<string name="debug_state_saved">State saved</string> <string name="debug_state_saved">State saved</string>

View file

@ -13,12 +13,17 @@
<item name="colorControlNormal">@color/control_color</item> <item name="colorControlNormal">@color/control_color</item>
<item name="alertDialogTheme">@style/Theme.CustomDialog</item> <item name="alertDialogTheme">@style/Theme.CustomDialog</item>
<item name="indicatorFastScrollerStyle">@style/FastScrollTheme</item> <item name="indicatorFastScrollerStyle">@style/FastScrollTheme</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
<item name="colorControlHighlight">?attr/colorPrimary</item>
<item name="preferenceTheme">@style/Theme.Preference</item>
<item name="md_divider_color">@android:color/transparent</item> <item name="md_divider_color">@android:color/transparent</item>
<item name="md_background_color">@color/background</item> <item name="md_background_color">@color/background</item>
<item name="md_corner_radius">0dp</item> <item name="md_corner_radius">0dp</item>
<item name="md_color_button_text">@color/control_color</item> <item name="md_color_button_text">@color/control_color</item>
<item name="md_font_title">@font/inter_black</item> <item name="md_font_title">@font/inter_black</item>
<item name="android:activatedBackgroundIndicator">@drawable/ui_ripple</item>
</style> </style>
<!-- Hack to fix the weird icon/underline with LibraryFragment's SearchView --> <!-- Hack to fix the weird icon/underline with LibraryFragment's SearchView -->
@ -83,6 +88,12 @@
<item name="android:textSize">18sp</item> <item name="android:textSize">18sp</item>
</style> </style>
<style name="Theme.Preference" parent="PreferenceThemeOverlay">
<item name="rippleColor">@color/selection_color</item>
<item name="itemRippleColor">@color/selection_color</item>
<item name="tabRippleColor">@color/selection_color</item>
</style>
<!-- <!--
Fix to get QueueFragment to not overlap the Status Bar or Navigation Bar [Currently unused but still here] Fix to get QueueFragment to not overlap the Status Bar or Navigation Bar [Currently unused but still here]
https://stackoverflow.com/a/57790787/14143986 https://stackoverflow.com/a/57790787/14143986

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:title="@string/setting_ui"
android:layout="@layout/item_prefs_header">
<ListPreference
app:key="KEY_THEME"
android:title="@string/setting_theme"
android:icon="@drawable/ic_day"
android:entries="@array/theme_entries"
android:entryValues="@array/theme_values"
app:defaultValue="AUTO"
app:useSimpleSummaryProvider="true" />
<Preference
app:key="KEY_ACCENT"
android:title="@string/setting_accent"
android:icon="@drawable/ic_accent"
app:summary="@string/setting_accent" />
<SwitchPreferenceCompat
app:key="KEY_EDGE"
android:title="@string/setting_edge"
app:summaryOn="@string/setting_edge_desc_on"
app:summaryOff="@string/setting_edge_desc_off"
app:iconSpaceReserved="false"
android:defaultValue="false" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -2,11 +2,11 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
android:title="@string/label_settings_ui" android:title="@string/setting_ui"
android:layout="@layout/item_prefs_header"> android:layout="@layout/item_prefs_header">
<ListPreference <ListPreference
app:key="KEY_THEME" app:key="KEY_THEME"
android:title="@string/label_settings_theme" android:title="@string/setting_theme"
android:icon="@drawable/ic_day" android:icon="@drawable/ic_day"
android:entries="@array/theme_entries" android:entries="@array/theme_entries"
android:entryValues="@array/theme_values" android:entryValues="@array/theme_values"
@ -15,9 +15,8 @@
<Preference <Preference
app:key="KEY_ACCENT" app:key="KEY_ACCENT"
android:title="@string/label_settings_accent" android:title="@string/setting_accent"
android:icon="@drawable/ic_accent" android:icon="@drawable/ic_accent"
app:summary="@string/label_settings_accent" app:summary="@string/setting_accent" />
app:enableCopying="true" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>