mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +00:00
Update: IntPref dialog handler
This commit is contained in:
parent
372a3285d9
commit
528bed9dec
@ -20,6 +20,7 @@ import com.machiav3lli.fdroid.content.Preferences
|
||||
import com.machiav3lli.fdroid.ui.compose.components.prefs.PreferenceGroup
|
||||
import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
||||
import com.machiav3lli.fdroid.ui.dialog.EnumSelectionPrefDialogUI
|
||||
import com.machiav3lli.fdroid.ui.dialog.IntInputPrefDialogUI
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@ -68,6 +69,10 @@ fun PrefsOtherPage() {
|
||||
BaseDialog(openDialogCustom = openDialog) {
|
||||
when (dialogPref?.default?.value) {
|
||||
is String -> {} //TODO
|
||||
is Int -> IntInputPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Int>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
|
@ -20,6 +20,7 @@ import com.machiav3lli.fdroid.content.Preferences
|
||||
import com.machiav3lli.fdroid.ui.compose.components.prefs.PreferenceGroup
|
||||
import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
||||
import com.machiav3lli.fdroid.ui.dialog.EnumSelectionPrefDialogUI
|
||||
import com.machiav3lli.fdroid.ui.dialog.IntInputPrefDialogUI
|
||||
import com.machiav3lli.fdroid.ui.dialog.LanguagePrefDialogUI
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@ -77,6 +78,10 @@ fun PrefsPersonalPage() {
|
||||
is String -> LanguagePrefDialogUI(
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Int -> IntInputPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Int>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
|
@ -20,6 +20,7 @@ import com.machiav3lli.fdroid.content.Preferences
|
||||
import com.machiav3lli.fdroid.ui.compose.components.prefs.PreferenceGroup
|
||||
import com.machiav3lli.fdroid.ui.dialog.BaseDialog
|
||||
import com.machiav3lli.fdroid.ui.dialog.EnumSelectionPrefDialogUI
|
||||
import com.machiav3lli.fdroid.ui.dialog.IntInputPrefDialogUI
|
||||
import com.machiav3lli.fdroid.ui.dialog.LanguagePrefDialogUI
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@ -86,6 +87,10 @@ fun PrefsUpdatesPage() {
|
||||
is String -> LanguagePrefDialogUI(
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Int -> IntInputPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Int>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
|
Loading…
x
Reference in New Issue
Block a user