mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-19 04:03:57 +00:00
AMOLED + custom
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user