Simplify theme color application logic
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/LauncherTheme.DefaultColors"
|
||||
android:theme="@style/LauncherTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
android:parentActivityName=".ui.legacy.activity.LauncherActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:taskAffinity="de.mm20.launcher2.settings"
|
||||
android:theme="@style/SettingsTheme.DefaultColors">
|
||||
android:theme="@style/SettingsTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
@@ -3,26 +3,22 @@ package de.mm20.launcher2.activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.Fragment
|
||||
import de.mm20.launcher2.R
|
||||
import de.mm20.launcher2.fragment.PreferencesCalendarFragment
|
||||
import de.mm20.launcher2.fragment.PreferencesMainFragment
|
||||
import de.mm20.launcher2.fragment.PreferencesServicesFragment
|
||||
import de.mm20.launcher2.fragment.PreferencesWeatherFragment
|
||||
import de.mm20.launcher2.preferences.ColorSchemes
|
||||
import de.mm20.launcher2.preferences.LauncherPreferences
|
||||
import de.mm20.launcher2.ui.legacy.activity.LauncherActivity
|
||||
import de.mm20.launcher2.ui.legacy.helper.ThemeHelper
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
when(LauncherPreferences.instance.colorScheme) {
|
||||
ColorSchemes.BLACK -> setTheme(R.style.SettingsTheme_BlackWhiteColors)
|
||||
else -> setTheme(R.style.SettingsTheme_DefaultColors)
|
||||
}
|
||||
|
||||
ThemeHelper.applyTheme(theme)
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
val fragment = getStartFragment()
|
||||
setupActionBar()
|
||||
|
||||
Reference in New Issue
Block a user