mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +00:00
Add: Dialog handler to all Prefs Pages
This commit is contained in:
parent
c100784063
commit
dc9298e51f
@ -19,6 +19,7 @@ import com.machiav3lli.fdroid.R
|
||||
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
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@ -65,8 +66,12 @@ fun PrefsOtherPage() {
|
||||
|
||||
if (openDialog.value) {
|
||||
BaseDialog(openDialogCustom = openDialog) {
|
||||
when (dialogPref) {
|
||||
// TODO
|
||||
when (dialogPref?.default?.value) {
|
||||
is String -> {} //TODO
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import com.machiav3lli.fdroid.R
|
||||
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.LanguagePrefDialogUI
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@ -72,8 +73,12 @@ fun PrefsPersonalPage() {
|
||||
|
||||
if (openDialog.value) {
|
||||
BaseDialog(openDialogCustom = openDialog) {
|
||||
when (dialogPref) {
|
||||
Preferences.Key.Language -> LanguagePrefDialogUI(
|
||||
when (dialogPref?.default?.value) {
|
||||
is String -> LanguagePrefDialogUI(
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
else -> {}
|
||||
|
@ -19,6 +19,8 @@ import com.machiav3lli.fdroid.R
|
||||
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.LanguagePrefDialogUI
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@ -80,8 +82,14 @@ fun PrefsUpdatesPage() {
|
||||
|
||||
if (openDialog.value) {
|
||||
BaseDialog(openDialogCustom = openDialog) {
|
||||
when (dialogPref) {
|
||||
// TODO
|
||||
when (dialogPref?.default?.value) {
|
||||
is String -> LanguagePrefDialogUI(
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
is Preferences.Enumeration<*> -> EnumSelectionPrefDialogUI(
|
||||
prefKey = dialogPref as Preferences.Key<Preferences.Enumeration<*>>,
|
||||
openDialogCustom = openDialog
|
||||
)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user