Skip to content

Commit

Permalink
Feat/text style customization (#29)
Browse files Browse the repository at this point in the history
* feat/ allow client code to customize input field

* doc/ allow client code to customize input field

---------

Co-authored-by: Harold Martin <harold@jump.com>
  • Loading branch information
itstanany and hbmartin authored Oct 4, 2023
1 parent c2514ea commit ace476e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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() }
Expand Down Expand Up @@ -157,6 +159,7 @@ fun TogiCountryCodePicker(
)
.focusRequester(focusRequester = focusRequester),
enabled = enabled,
textStyle = textStyle,
label = label,
placeholder = {
if (showPlaceholder) {
Expand Down

0 comments on commit ace476e

Please sign in to comment.