mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-08 00:39:54 +00:00
Update: Use Preferences.Key explicitly for (on)PrefDialog
This commit is contained in:
parent
4452cb9235
commit
4c12ca9ee1
@ -8,7 +8,7 @@ import com.machiav3lli.fdroid.content.PrefsDependencies
|
|||||||
@Composable
|
@Composable
|
||||||
fun PrefsBuilder(
|
fun PrefsBuilder(
|
||||||
prefKey: Preferences.Key<*>,
|
prefKey: Preferences.Key<*>,
|
||||||
onDialogPref: (Any) -> Unit,
|
onDialogPref: (Preferences.Key<*>) -> Unit,
|
||||||
enabledSetState: SnapshotStateList<Preferences.Key<*>>,
|
enabledSetState: SnapshotStateList<Preferences.Key<*>>,
|
||||||
index: Int,
|
index: Int,
|
||||||
size: Int
|
size: Int
|
||||||
|
@ -46,7 +46,7 @@ fun PreferenceGroup(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
heading: String? = null,
|
heading: String? = null,
|
||||||
keys: List<Preferences.Key<*>>,
|
keys: List<Preferences.Key<*>>,
|
||||||
onPrefDialog: (Any) -> Unit,
|
onPrefDialog: (Preferences.Key<*>) -> Unit,
|
||||||
) {
|
) {
|
||||||
val size = keys.size
|
val size = keys.size
|
||||||
val enabledList = remember() {
|
val enabledList = remember() {
|
||||||
|
@ -25,8 +25,8 @@ import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
|||||||
fun PrefsOtherPage() {
|
fun PrefsOtherPage() {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val openDialog = remember { mutableStateOf(false) }
|
val openDialog = remember { mutableStateOf(false) }
|
||||||
var dialogPref by remember { mutableStateOf<Any?>(null) }
|
var dialogPref by remember { mutableStateOf<Preferences.Key<*>?>(null) }
|
||||||
val onPrefDialog = { pref: Any ->
|
val onPrefDialog = { pref: Preferences.Key<*> ->
|
||||||
dialogPref = pref
|
dialogPref = pref
|
||||||
openDialog.value = true
|
openDialog.value = true
|
||||||
}
|
}
|
||||||
@ -67,6 +67,7 @@ fun PrefsOtherPage() {
|
|||||||
BaseDialog(openDialogCustom = openDialog) {
|
BaseDialog(openDialogCustom = openDialog) {
|
||||||
when (dialogPref) {
|
when (dialogPref) {
|
||||||
// TODO
|
// TODO
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
|||||||
fun PrefsPersonalPage() {
|
fun PrefsPersonalPage() {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val openDialog = remember { mutableStateOf(false) }
|
val openDialog = remember { mutableStateOf(false) }
|
||||||
var dialogPref by remember { mutableStateOf<Any?>(null) }
|
var dialogPref by remember { mutableStateOf<Preferences.Key<*>?>(null) }
|
||||||
val onPrefDialog = { pref: Any ->
|
val onPrefDialog = { pref: Preferences.Key<*> ->
|
||||||
dialogPref = pref
|
dialogPref = pref
|
||||||
openDialog.value = true
|
openDialog.value = true
|
||||||
}
|
}
|
||||||
@ -73,6 +73,7 @@ fun PrefsPersonalPage() {
|
|||||||
BaseDialog(openDialogCustom = openDialog) {
|
BaseDialog(openDialogCustom = openDialog) {
|
||||||
when (dialogPref) {
|
when (dialogPref) {
|
||||||
// TODO
|
// TODO
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
|||||||
fun PrefsUpdatesPage() {
|
fun PrefsUpdatesPage() {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val openDialog = remember { mutableStateOf(false) }
|
val openDialog = remember { mutableStateOf(false) }
|
||||||
var dialogPref by remember { mutableStateOf<Any?>(null) }
|
var dialogPref by remember { mutableStateOf<Preferences.Key<*>?>(null) }
|
||||||
val onPrefDialog = { pref: Any ->
|
val onPrefDialog = { pref: Preferences.Key<*> ->
|
||||||
dialogPref = pref
|
dialogPref = pref
|
||||||
openDialog.value = true
|
openDialog.value = true
|
||||||
}
|
}
|
||||||
@ -82,6 +82,7 @@ fun PrefsUpdatesPage() {
|
|||||||
BaseDialog(openDialogCustom = openDialog) {
|
BaseDialog(openDialogCustom = openDialog) {
|
||||||
when (dialogPref) {
|
when (dialogPref) {
|
||||||
// TODO
|
// TODO
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user