diff --git a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt index 7ef73dfa1..657e33c06 100644 --- a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt +++ b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt @@ -90,12 +90,16 @@ class MainActivity : AppCompatActivity() { } private fun setupTheme() { - // We only use Material You theming on Android 12 and above. - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { - // Update the current accent and theme - val settingsManager = SettingsManager.getInstance() - AppCompatDelegate.setDefaultNightMode(settingsManager.theme) + val settingsManager = SettingsManager.getInstance() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + // Android 12, let dynamic colors be our accent and only enable the black theme option + if (isNight && settingsManager.useBlackTheme) { + setTheme(R.style.Theme_Auxio_Black) + } + } else { + // Below android 12, load the accent and enable theme customization + AppCompatDelegate.setDefaultNightMode(settingsManager.theme) val newAccent = Accent.set(settingsManager.accent) // The black theme has a completely separate set of styles since style attributes cannot diff --git a/app/src/main/java/org/oxycblt/auxio/settings/SettingsListFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/SettingsListFragment.kt index 552fe348e..be90d8cf2 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/SettingsListFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/SettingsListFragment.kt @@ -145,8 +145,7 @@ class SettingsListFragment : PreferenceFragmentCompat() { } } - SettingsManager.KEY_SHOW_COVERS, SettingsManager.KEY_QUALITY_COVERS, - SettingsManager.KEY_ROUND_COVERS -> { + SettingsManager.KEY_SHOW_COVERS, SettingsManager.KEY_QUALITY_COVERS, -> { onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, _ -> Coil.imageLoader(requireContext()).apply { this.memoryCache?.clear() diff --git a/app/src/main/java/org/oxycblt/auxio/util/LogUtil.kt b/app/src/main/java/org/oxycblt/auxio/util/LogUtil.kt index a9b75b8f3..ab3ffda01 100644 --- a/app/src/main/java/org/oxycblt/auxio/util/LogUtil.kt +++ b/app/src/main/java/org/oxycblt/auxio/util/LogUtil.kt @@ -32,7 +32,7 @@ fun Any.logD(obj: Any) { } /** - * Shortcut method for logging [msg] to the debug console., handles debug builds and anonymous objects + * Shortcut method for logging [msg] to the debug console. Handles debug builds and anonymous objects */ fun Any.logD(msg: String) { if (BuildConfig.DEBUG) { @@ -56,7 +56,11 @@ fun Any.logE(msg: String) { private fun Any.getName(): String = "Auxio.${this::class.simpleName ?: "Anonymous Object"}" /** - * Nothing to see here. + * I know that this will not stop you, but consider what you are doing with your life, copycats. + * Do you want to live a fulfilling existence on this planet? Or do you want to spend your life + * taking work others did and making it objectively worse so you could arbitrage a fraction of a + * penny on every AdMob impression you get. You could do so many great things if you simply had + * the courage to come up with an idea of your own. Be better. */ private fun basedCopyleftNotice() { if (BuildConfig.APPLICATION_ID != "org.oxycblt.auxio" && diff --git a/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt b/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt index f85bc1225..6ab92d1b2 100644 --- a/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt +++ b/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt @@ -142,3 +142,4 @@ val WindowInsets.systemBarsCompat: Rect get() { else -> Rect(0, 0, 0, 0) } } + diff --git a/app/src/main/res/values/themes_black.xml b/app/src/main/res/values/themes_black.xml index 1e79b6614..3258172e6 100644 --- a/app/src/main/res/values/themes_black.xml +++ b/app/src/main/res/values/themes_black.xml @@ -1,5 +1,9 @@ + + diff --git a/app/src/main/res/xml/prefs_main.xml b/app/src/main/res/xml/prefs_main.xml index f7f66db90..0b2ee933c 100644 --- a/app/src/main/res/xml/prefs_main.xml +++ b/app/src/main/res/xml/prefs_main.xml @@ -1,12 +1,12 @@