fix: Use correct colours for preference switches (#56)
The previous code used SwitchPreference to generate the switches, which didn't apply the Material colours. This made it difficult to distinguish between the on/off states, as the non-Material colours for those states are very similar. Fix by using SwitchPreferenceCompat which uses the correct Material colours.
This commit is contained in:
parent
b787f76cf6
commit
b739dc0a94
|
@ -12,7 +12,7 @@ import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceCategory
|
import androidx.preference.PreferenceCategory
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import androidx.preference.PreferenceScreen
|
import androidx.preference.PreferenceScreen
|
||||||
import androidx.preference.SwitchPreference
|
import androidx.preference.SwitchPreferenceCompat
|
||||||
import app.pachli.view.SliderPreference
|
import app.pachli.view.SliderPreference
|
||||||
import de.c1710.filemojicompat_ui.views.picker.preference.EmojiPickerPreference
|
import de.c1710.filemojicompat_ui.views.picker.preference.EmojiPickerPreference
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@ inline fun PreferenceParent.sliderPreference(
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceParent.switchPreference(
|
inline fun PreferenceParent.switchPreference(
|
||||||
builder: SwitchPreference.() -> Unit,
|
builder: SwitchPreferenceCompat.() -> Unit,
|
||||||
): SwitchPreference {
|
): SwitchPreferenceCompat {
|
||||||
val pref = SwitchPreference(context)
|
val pref = SwitchPreferenceCompat(context)
|
||||||
builder(pref)
|
builder(pref)
|
||||||
addPref(pref)
|
addPref(pref)
|
||||||
return pref
|
return pref
|
||||||
|
|
Loading…
Reference in New Issue