Skip to content

Commit

Permalink
Preference library update
Browse files Browse the repository at this point in the history
Use base preference fragment class.
Thus we don't need to specify the preference theme in our themes styles.
  • Loading branch information
Slion committed Apr 7, 2024
1 parent 8993547 commit a25a034
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ colorControlNormal:
<item name="android:navigationBarColor">@color/transparent</item>
<item name="enableEdgeToEdge">true</item>

<item name="preferenceTheme">@style/PreferenceThemeOverlay.Slions</item>

<!-- <item name="android:windowFullscreen">true</item>-->

</style>
Expand Down Expand Up @@ -418,8 +416,6 @@ colorControlNormal:
<item name="android:navigationBarColor">@color/transparent</item>
<item name="enableEdgeToEdge">true</item>

<item name="preferenceTheme">@style/PreferenceThemeOverlay.Slions</item>

<!-- <item name="android:windowFullscreen">true</item>-->
</style>

Expand Down Expand Up @@ -591,8 +587,6 @@ colorControlNormal:
<item name="android:navigationBarColor">@color/transparent</item>
<item name="enableEdgeToEdge">true</item>

<item name="preferenceTheme">@style/PreferenceThemeOverlay.Slions</item>

<!-- <item name="android:windowFullscreen">true</item>-->
</style>

Expand Down

0 comments on commit a25a034

Please sign in to comment.