Compare commits

...

2 commits

Author SHA1 Message Date
fa2f1c4127
fix #106 (ugly workaround)
Some checks are pending
Android CI / build (push) Waiting to run
2025-02-05 23:47:37 +01:00
8699b92246
update the bug report url 2025-02-05 22:07:23 +01:00
3 changed files with 24 additions and 3 deletions

View file

@ -16,6 +16,8 @@ import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.REQUEST_CHOOSE_APP
import de.jrpie.android.launcher.databinding.SettingsBinding
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.ui.UIObject
import de.jrpie.android.launcher.ui.settings.actions.SettingsFragmentActions
@ -33,8 +35,24 @@ import de.jrpie.android.launcher.ui.settings.meta.SettingsFragmentMeta
*/
class SettingsActivity : AppCompatActivity(), UIObject {
private var sharedPreferencesListener =
private val solidBackground = LauncherPreferences.theme().background() == Background.SOLID
|| LauncherPreferences.theme().colorTheme() == ColorTheme.LIGHT
private val sharedPreferencesListener =
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 ||
prefKey?.startsWith("display.") == true
) {
@ -59,6 +77,9 @@ class SettingsActivity : AppCompatActivity(), UIObject {
val tabs: TabLayout = findViewById(R.id.settings_tabs)
tabs.setupWithViewPager(viewPager)
if (intent.hasExtra("tab")) {
tabs.getTabAt(intent.getIntExtra("tab", 0))?.select()
}
}
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_report_bug_link" translatable="false">https://github.com/jrpie/Launcher/issues/new?template=bug_report.md</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_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_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:windowShowWallpaper">true</item>
<item name="android:colorBackgroundCacheHint">@null</item>
</style>
<style name="backgroundSolid">
</style>