mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-24 08:36:26 +00:00
make previews work again
This commit is contained in:
parent
245c0f1678
commit
c7a12ad172
2 changed files with 5 additions and 6 deletions
|
@ -136,10 +136,10 @@ fun SwitchPreference(
|
|||
) {
|
||||
val ctx = LocalContext.current
|
||||
val prefs = DeviceProtectedUtils.getSharedPreferences(ctx)
|
||||
val b = (ctx.getActivity() as SettingsActivity2).prefChanged.collectAsState()
|
||||
var value = prefs.getBoolean(pref, default)
|
||||
if (b.value < 0)
|
||||
val b = (ctx.getActivity() as? SettingsActivity2)?.prefChanged?.collectAsState()
|
||||
if (b?.value ?: 0 < 0)
|
||||
Log.v("irrelevant", "stupid way to trigger recomposition on preference change")
|
||||
var value = prefs.getBoolean(pref, default)
|
||||
fun switched(newValue: Boolean) {
|
||||
if (!allowCheckedChange(newValue)) {
|
||||
value = !newValue
|
||||
|
|
|
@ -31,9 +31,8 @@ fun TextCorrectionScreen(
|
|||
onClickBack: () -> Unit,
|
||||
) {
|
||||
val prefs = DeviceProtectedUtils.getSharedPreferences(LocalContext.current)
|
||||
val act = LocalContext.current.getActivity() as? SettingsActivity2
|
||||
val b = act?.prefChanged!!.collectAsState()
|
||||
if (b.value < 0)
|
||||
val b = (LocalContext.current.getActivity() as? SettingsActivity2)?.prefChanged?.collectAsState()
|
||||
if (b?.value ?: 0 < 0)
|
||||
Log.v("irrelevant", "stupid way to trigger recomposition on preference change")
|
||||
val autocorrectEnabled = prefs.getBoolean(Settings.PREF_AUTO_CORRECTION, true)
|
||||
val personalizedSuggestionsEnabled = prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true)
|
||||
|
|
Loading…
Add table
Reference in a new issue