fun KomposeCountryCodePicker(state: CountryCodePicker, text: String, modifier: Modifier = Modifier, onValueChange: (String) -> Unit = {}, error: Boolean = false, showOnlyCountryCodePicker: Boolean = false, shape: Shape = MaterialTheme.shapes.medium, placeholder: @Composable (defaultLang: String) -> Unit = { defaultLang ->
DefaultPlaceholder(defaultLang)
}, colors: TextFieldColors = TextFieldDefaults.colors(), trailingIcon: @Composable () -> Unit? = null, countrySelectionDialogContainerColor: Color = MaterialTheme.colorScheme.background, countrySelectionDialogContentColor: Color = MaterialTheme.colorScheme.onBackground, interactionSource: MutableInteractionSource = MutableInteractionSource(), selectedCountryFlagSize: FlagSize = FlagSize(28.dp, 18.dp), textStyle: TextStyle = LocalTextStyle.current, enabled: Boolean = true, keyboardOptions: KeyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Phone,
imeAction = ImeAction.Next,
), keyboardActions: KeyboardActions = KeyboardActions.Default, dropdownIconTint: Color = MaterialTheme.colorScheme.onSurface) KomposeCountryCodePicker is a composable that displays a text field with a country code picker dialog.
The state of the country code picker.
The text to be displayed in the text field.
Modifier to be applied to the layout.
Called when the value is changed.
If true, the text field will be displayed in the error state.
showOnlyCountryCodePicker
If true, only the country code picker will be displayed.
The shape of the text field's outline.
The placeholder to be displayed in the text field.
The colors to be used to display the text field.
The trailing icon to be displayed in the text field.
countrySelectionDialogContainerColor
The color to be used to display the country selection dialog container.
countrySelectionDialogContentColor
The color to be used to display the country selection dialog content. text.
The MutableInteractionSource representing the stream of Interactions for this text field.
The size of the selected country flag (width and height in .dp).
The style to be used for displaying text on the TextField and the selected country.
Controls the enabled state of the text field.
The keyboard options to be used to display the keyboard.
The keyboard actions to be used to display the keyboard.
The tint to be applied to the dropdown icon.
fun KomposeCountryCodePicker(state: CountryCodePicker, text: String, modifier: Modifier = Modifier, onValueChange: (String) -> Unit = {}, error: Boolean = false, showOnlyCountryCodePicker: Boolean = false, shape: Shape = MaterialTheme.shapes.medium, placeholder: @Composable (defaultLang: String) -> Unit = { defaultLang ->
DefaultPlaceholder(defaultLang)
}, colors: TextFieldColors = TextFieldDefaults.colors(), trailingIcon: @Composable () -> Unit? = null, countrySelectionDialogContainerColor: Color = MaterialTheme.colorScheme.background, countrySelectionDialogContentColor: Color = MaterialTheme.colorScheme.onBackground, countrySelectionDialogTitle: @Composable () -> Unit = {
Text(
modifier = Modifier
.offset(y = (-2).dp)
.qaAutomationTestTag("countryDialogTitle"),
text = stringResource(id = R.string.select_country),
style = MaterialTheme.typography.titleMedium,
color = countrySelectionDialogContentColor,
)
}, countrySelectionDialogBackIcon: @Composable () -> Unit = {
Icon(
painter = painterResource(id = R.drawable.ic_arrow_back),
contentDescription = null,
tint = countrySelectionDialogContentColor,
)
}, countrySelectionDialogSearchIcon: @Composable () -> Unit = {
Icon(
painter = painterResource(id = R.drawable.ic_search),
contentDescription = null,
tint = countrySelectionDialogContentColor,
)
}, interactionSource: MutableInteractionSource = MutableInteractionSource(), selectedCountryFlagSize: FlagSize = FlagSize(28.dp, 18.dp), textStyle: TextStyle = LocalTextStyle.current, enabled: Boolean = true, keyboardOptions: KeyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Phone,
imeAction = ImeAction.Next,
), keyboardActions: KeyboardActions = KeyboardActions.Default, dropdownIconTint: Color = MaterialTheme.colorScheme.onSurface) KomposeCountryCodePicker is a composable that displays a text field with a country code picker dialog.
The state of the country code picker.
The text to be displayed in the text field.
Modifier to be applied to the layout.
Called when the value is changed.
If true, the text field will be displayed in the error state.
showOnlyCountryCodePicker
If true, only the country code picker will be displayed.
The shape of the text field's outline.
The placeholder to be displayed in the text field.
The colors to be used to display the text field.
The trailing icon to be displayed in the text field.
countrySelectionDialogContainerColor
The color to be used to display the country selection dialog container.
countrySelectionDialogContentColor
The color to be used to display the country selection dialog content. text.
countrySelectionDialogTitle
The title to be displayed in the country selection dialog.
countrySelectionDialogBackIcon
The back icon to be displayed in country selection dialog.
countrySelectionDialogSearchIcon
The search icon to be displayed in country selection dialog.
The MutableInteractionSource representing the stream of Interactions for this text field.
The size of the selected country flag (width and height in .dp).
The style to be used for displaying text on the TextField and the selected country.
Controls the enabled state of the text field.
The keyboard options to be used to display the keyboard.
The keyboard actions to be used to display the keyboard.
The tint to be applied to the dropdown icon.