From 2b48b71e6340ac69f95f13f08feefa964d7f3b70 Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Thu, 21 Oct 2021 16:35:33 +0200 Subject: [PATCH] Enable background image and adaptive theming by default --- app/src/main/java/com/cyb3rko/cavedroid/Utils.kt | 2 +- .../com/cyb3rko/cavedroid/fragments/PreferenceFragment.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/cyb3rko/cavedroid/Utils.kt b/app/src/main/java/com/cyb3rko/cavedroid/Utils.kt index a3a8b68..c489889 100644 --- a/app/src/main/java/com/cyb3rko/cavedroid/Utils.kt +++ b/app/src/main/java/com/cyb3rko/cavedroid/Utils.kt @@ -225,7 +225,7 @@ object Utils { } internal fun getBackgroundDrawableId(resources: Resources, mySPR: SharedPreferences): Int { - return when (mySPR.getString(BACKGROUND_IMAGE, "-1")!!.toInt()) { + return when (mySPR.getString(BACKGROUND_IMAGE, "0")!!.toInt()) { 0 -> { if (isNightModeActive(resources)) { R.drawable.background_forest2 diff --git a/app/src/main/java/com/cyb3rko/cavedroid/fragments/PreferenceFragment.kt b/app/src/main/java/com/cyb3rko/cavedroid/fragments/PreferenceFragment.kt index c3af5a8..3ac861b 100644 --- a/app/src/main/java/com/cyb3rko/cavedroid/fragments/PreferenceFragment.kt +++ b/app/src/main/java/com/cyb3rko/cavedroid/fragments/PreferenceFragment.kt @@ -50,9 +50,9 @@ class PreferenceFragment : PreferenceFragmentCompat() { crashlyticsCollectionSwitch = findPreference(CRASHLYTICS_COLLECTION)!! nightModeList.value = mySPR.getString(NIGHTMODE, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM.toString()) - backgroundImageList.value = mySPR.getString(BACKGROUND_IMAGE, "-1") - adaptiveThemingSwitch.isChecked = mySPR.getBoolean(ADAPTIVE_THEMING, false) - adaptiveThemingSwitch.isEnabled = mySPR.getBoolean(BACKGROUND_SET, false) + backgroundImageList.value = mySPR.getString(BACKGROUND_IMAGE, "0") + adaptiveThemingSwitch.isChecked = mySPR.getBoolean(ADAPTIVE_THEMING, true) + adaptiveThemingSwitch.isEnabled = mySPR.getBoolean(BACKGROUND_SET, true) avatarTypeList.value = mySPR.getString(AVATAR_TYPE, "avatar") showAnnouncementSwitch.isChecked = mySPR.getBoolean(SHOW_ANNOUNCEMENTS, true) announcementImageSwitch.isChecked = mySPR.getBoolean(ANNOUNCEMENT_IMAGE, true)