Last active
October 16, 2020 08:48
-
-
Save rooparsh/f9e41366e5c6bb0b3c1fdba774d44077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For handling the state of dialog | |
private val dialogState by lazy { mutableStateOf(false) } | |
@Composable | |
fun CountriesDialog() { | |
if (dialogState.value) { | |
SingleSelectDialog(title = getString(R.string.title_select_country), | |
optionsList = countriesMap.values.toList(), | |
defaultSelected = countriesMap.keys.toList().indexOf(selectedOption), | |
submitButtonText = getString(R.string.text_apply), | |
onSubmitButtonClick = { | |
/** | |
* Do whatever you need on button click | |
*/ | |
}, | |
onDismissRequest = { dialogState.value = false }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment