Compare commits

..

No commits in common. "fa2f1c4127a892a2956b8b54e8ea697f097cfd38" and "d6355afc547e6fdd71254c423e8740346c5ed961" have entirely different histories.

3 changed files with 3 additions and 24 deletions

View file

@ -16,8 +16,6 @@ import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.REQUEST_CHOOSE_APP import de.jrpie.android.launcher.REQUEST_CHOOSE_APP
import de.jrpie.android.launcher.databinding.SettingsBinding import de.jrpie.android.launcher.databinding.SettingsBinding
import de.jrpie.android.launcher.preferences.LauncherPreferences import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.preferences.theme.Background
import de.jrpie.android.launcher.preferences.theme.ColorTheme
import de.jrpie.android.launcher.saveListActivityChoice import de.jrpie.android.launcher.saveListActivityChoice
import de.jrpie.android.launcher.ui.UIObject import de.jrpie.android.launcher.ui.UIObject
import de.jrpie.android.launcher.ui.settings.actions.SettingsFragmentActions import de.jrpie.android.launcher.ui.settings.actions.SettingsFragmentActions
@ -35,24 +33,8 @@ import de.jrpie.android.launcher.ui.settings.meta.SettingsFragmentMeta
*/ */
class SettingsActivity : AppCompatActivity(), UIObject { class SettingsActivity : AppCompatActivity(), UIObject {
private val solidBackground = LauncherPreferences.theme().background() == Background.SOLID private var sharedPreferencesListener =
|| LauncherPreferences.theme().colorTheme() == ColorTheme.LIGHT
private val sharedPreferencesListener =
SharedPreferences.OnSharedPreferenceChangeListener { _, prefKey -> SharedPreferences.OnSharedPreferenceChangeListener { _, prefKey ->
if (solidBackground &&
(prefKey == LauncherPreferences.theme().keys().background() ||
prefKey == LauncherPreferences.theme().keys().colorTheme())
) {
// Switching from solid background to a transparent background using `recreate()`
// causes a very ugly glitch, making the settings unreadable.
// This ugly workaround causes a jump to the top of the list, but at least
// the text stays readable.
val i = Intent(this, SettingsActivity::class.java)
.also { it.putExtra("tab", 1) }
finish()
startActivity(i)
} else
if (prefKey?.startsWith("theme.") == true || if (prefKey?.startsWith("theme.") == true ||
prefKey?.startsWith("display.") == true prefKey?.startsWith("display.") == true
) { ) {
@ -77,9 +59,6 @@ class SettingsActivity : AppCompatActivity(), UIObject {
val tabs: TabLayout = findViewById(R.id.settings_tabs) val tabs: TabLayout = findViewById(R.id.settings_tabs)
tabs.setupWithViewPager(viewPager) tabs.setupWithViewPager(viewPager)
if (intent.hasExtra("tab")) {
tabs.getTabAt(intent.getIntExtra("tab", 0))?.select()
}
} }
override fun onStart() { override fun onStart() {

View file

@ -154,7 +154,7 @@
- -
--> -->
<string name="settings_meta_link_github" translatable="false">https://github.com/jrpie/Launcher</string> <string name="settings_meta_link_github" translatable="false">https://github.com/jrpie/Launcher</string>
<string name="settings_meta_report_bug_link" translatable="false">https://github.com/jrpie/Launcher/issues/new?template=bug_report.yaml</string> <string name="settings_meta_report_bug_link" translatable="false">https://github.com/jrpie/Launcher/issues/new?template=bug_report.md</string>
<string name="settings_meta_report_vulnerability_link" translatable="false">https://github.com/jrpie/Launcher/security/policy</string> <string name="settings_meta_report_vulnerability_link" translatable="false">https://github.com/jrpie/Launcher/security/policy</string>
<string name="settings_meta_fork_contact_url" translatable="false">https://s.jrpie.de/contact</string> <string name="settings_meta_fork_contact_url" translatable="false">https://s.jrpie.de/contact</string>
<string name="settings_meta_privacy_url" translatable="false">https://s.jrpie.de/android-legal</string> <string name="settings_meta_privacy_url" translatable="false">https://s.jrpie.de/android-legal</string>

View file

@ -78,10 +78,10 @@
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowShowWallpaper">true</item> <item name="android:windowShowWallpaper">true</item>
<item name="android:colorBackgroundCacheHint">@null</item>
</style> </style>
<style name="backgroundSolid"> <style name="backgroundSolid">
</style> </style>