AMOLED + custom
This commit is contained in:
parent
f01377f0b1
commit
32f918450a
3 changed files with 9 additions and 4 deletions
|
@ -117,7 +117,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||
binding.settingsUseCustomTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putBoolean("use_custom_theme", isChecked).apply()
|
||||
if(isChecked) {
|
||||
binding.settingsUseOLED.isChecked = false
|
||||
binding.settingsUseMaterialYou.isChecked = false
|
||||
}
|
||||
|
||||
|
@ -132,7 +131,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||
binding.settingsUseOLED.isChecked = getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean("use_oled", false)
|
||||
binding.settingsUseOLED.setOnCheckedChangeListener { _, isChecked ->
|
||||
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putBoolean("use_oled", isChecked).apply()
|
||||
if(isChecked) binding.settingsUseCustomTheme.isChecked = false
|
||||
restartApp()
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@ class ThemeManager(private val context: Context) {
|
|||
needMaterial = false
|
||||
}
|
||||
|
||||
// Set the theme overlay based on conditions
|
||||
if (useOLED) {
|
||||
builder.setThemeOverlay(R.style.AppTheme_Amoled)
|
||||
}
|
||||
|
@ -80,6 +79,14 @@ class ThemeManager(private val context: Context) {
|
|||
// Apply the dynamic colors to the activity
|
||||
val activity = context as Activity
|
||||
DynamicColors.applyToActivityIfAvailable(activity, options)
|
||||
|
||||
if (useOLED) {
|
||||
val options2 = DynamicColorsOptions.Builder()
|
||||
.setThemeOverlay(R.style.AppTheme_Amoled)
|
||||
.build()
|
||||
DynamicColors.applyToActivityIfAvailable(activity, options2)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@
|
|||
<string name="user_agent">User Agent</string>
|
||||
<string name="custom_theme">Custom Theme</string>
|
||||
<string name="use_custom_theme">Custom theme</string>
|
||||
<string name="use_unique_theme_for_each_item">Unique theme for each item</string>
|
||||
<string name="use_unique_theme_for_each_item">Use cover as theme for each entry</string>
|
||||
<string name="oled_theme_variant">OLED theme variant</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue