From a25a0344455953036b781550a1a35ebaea668afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lenclud?= Date: Sun, 7 Apr 2024 13:53:34 +0200 Subject: [PATCH] Preference library update Use base preference fragment class. Thus we don't need to specify the preference theme in our themes styles. --- app/build.gradle | 2 +- .../fulguris/settings/fragment/AbstractSettingsFragment.kt | 7 +++---- .../fulguris/settings/fragment/RootSettingsFragment.kt | 4 ++-- app/src/main/res/values/styles.xml | 6 ------ 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e9a3873fe..e5df4db8a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -296,7 +296,7 @@ dependencies { //implementation group: 'com.google.android.material', name: 'material', version: '1.6.0-alpha01' // - implementation "net.slions.android:preference:0.0.5" + implementation "net.slions.android:preference:0.1.0" // Play Store billing playstoreImplementation 'com.android.billingclient:billing:6.2.0' diff --git a/app/src/main/java/fulguris/settings/fragment/AbstractSettingsFragment.kt b/app/src/main/java/fulguris/settings/fragment/AbstractSettingsFragment.kt index 188c7c377..e8321f17e 100644 --- a/app/src/main/java/fulguris/settings/fragment/AbstractSettingsFragment.kt +++ b/app/src/main/java/fulguris/settings/fragment/AbstractSettingsFragment.kt @@ -34,20 +34,19 @@ import androidx.core.content.res.ResourcesCompat import androidx.preference.CheckBoxPreference import androidx.preference.ListPreference import androidx.preference.Preference -import androidx.preference.PreferenceFragment -import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceGroup import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference import androidx.preference.SwitchPreferenceCompat import androidx.recyclerview.widget.RecyclerView import fulguris.utils.shareUrl +import slions.pref.PreferenceFragmentBase import timber.log.Timber /** - * An abstract settings fragment which performs wiring for an instance of [PreferenceFragment]. + * An abstract settings fragment which performs wiring for an instance of [PreferenceFragmentBase]. */ -abstract class AbstractSettingsFragment : PreferenceFragmentCompat() { +abstract class AbstractSettingsFragment : PreferenceFragmentBase() { lateinit var prefGroup: PreferenceGroup diff --git a/app/src/main/java/fulguris/settings/fragment/RootSettingsFragment.kt b/app/src/main/java/fulguris/settings/fragment/RootSettingsFragment.kt index bf697895e..6aa99decb 100644 --- a/app/src/main/java/fulguris/settings/fragment/RootSettingsFragment.kt +++ b/app/src/main/java/fulguris/settings/fragment/RootSettingsFragment.kt @@ -3,12 +3,12 @@ package fulguris.settings.fragment import fulguris.BuildConfig import fulguris.R import android.os.Bundle -import androidx.preference.PreferenceFragmentCompat +import slions.pref.PreferenceFragmentBase /** * TODO: Derive from [AbstractSettingsFragment] */ -class RootSettingsFragment : PreferenceFragmentCompat() { +class RootSettingsFragment : PreferenceFragmentBase() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.preferences_root, rootKey) diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4df3bab96..ae0b97aad 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -240,8 +240,6 @@ colorControlNormal: @color/transparent true - @style/PreferenceThemeOverlay.Slions - @@ -418,8 +416,6 @@ colorControlNormal: @color/transparent true - @style/PreferenceThemeOverlay.Slions - @@ -591,8 +587,6 @@ colorControlNormal: @color/transparent true - @style/PreferenceThemeOverlay.Slions -