diff --git a/README.md b/README.md index e1c2094..60d872b 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,9 @@ Also check out the [ComposeCountryCodePicker documentation](https://jump-sdk.git | clearIcon | The icon to be used for the clear button. Set to null to disable the clear button. | | initialPhoneNumber | An optional phone number to be initial value of the input field. | | initialCountryCode | An optional ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the initially selected country. | -| initialCountryPhoneCode | An optional Phone calling code of initially selected country. -| label | An optional composable to be used as a label for input field. | +| initialCountryPhoneCode | An optional Phone calling code of initially selected country. | +| label | An optional composable to be used as a label for input field. | +| textStyle | An optional [TextStyle] for customizing text style of phone number input field. | diff --git a/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt b/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt index 95b2e8b..ee351e1 100644 --- a/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt +++ b/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt @@ -39,6 +39,7 @@ import androidx.compose.ui.platform.LocalAutofillTree import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.tooling.preview.Preview @@ -77,7 +78,7 @@ private const val TAG = "TogiCountryCodePicker" * of the initially selected country. Note that if a valid initialCountryPhoneCode is provided, this will be ignored. * @param initialCountryPhoneCode an optional Phone calling code of initially selected country * @param label An optional composable to be used as a label for input field - + * @param textStyle An optional [TextStyle] for customizing text style of phone number input field */ @OptIn(ExperimentalComposeUiApi::class) @Suppress("LongMethod") @@ -98,6 +99,7 @@ fun TogiCountryCodePicker( initialCountryIsoCode: Iso31661alpha2? = null, initialCountryPhoneCode: PhoneCode? = null, label: @Composable (() -> Unit)? = null, + textStyle: TextStyle = TextStyle(), ) { val context = LocalContext.current val focusRequester = remember { FocusRequester() } @@ -157,6 +159,7 @@ fun TogiCountryCodePicker( ) .focusRequester(focusRequester = focusRequester), enabled = enabled, + textStyle = textStyle, label = label, placeholder = { if (showPlaceholder) {