Skip to content

Commit de3019f

Browse files
authored
Update README.md
* Rounded phone field added * Codes optimized * Added Italian language
1 parent 472b12c commit de3019f

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

README.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ If you are looking for Country Phone Code Picker for Jetpack Compose you can use
1212
* Can Customize
1313
* Adding language translations
1414

15+
Languages:
1516

16-
<h3> <-******* Usage *******-> </h3>
17-
18-
17+
* Turkish
18+
* English
19+
* Italian
20+
21+
New features will be added every day. This project is open source without any profit motive.
22+
23+
For language support, you can translate the file below and send it to me.
24+
https://github.com/togisoft/jetpack_compose_country_code_picker/blob/master/ccp/src/main/res/values/strings.xml
25+
26+
<h3> Usage Example </h3>
27+
1928
```kotlin
2029
// With Country Phone Code
2130
@Composable
@@ -80,8 +89,30 @@ If you are looking for Country Phone Code Picker for Jetpack Compose you can use
8089

8190
}
8291
```
92+
93+
<h3> Rounded Field Usage </h3>
94+
95+
```kotlin
96+
val getDefaultLangCode = getDefaultLangCode()
97+
val getDefaultPhoneCode = getDefaultPhoneCode()
98+
var phoneCode by rememberSaveable { mutableStateOf(getDefaultPhoneCode) }
99+
val phoneNumber = rememberSaveable { mutableStateOf("") }
100+
var defaultLang by rememberSaveable { mutableStateOf(getDefaultLangCode) }
101+
var isValidPhone by remember { mutableStateOf(true) }
102+
103+
TogiRoundedPicker(
104+
value = phoneNumber.value,
105+
onValueChange = { phoneNumber.value = it },
106+
defaultCountry = getLibCountries().single { it.countryCode == defaultLang },
107+
pickedCountry = {
108+
phoneCode = it.countryPhoneCode
109+
defaultLang = it.countryCode
110+
},
111+
error = isValidPhone
112+
)
113+
83114

84-
115+
```
85116

86117
<h3><- ********* Extras ********* -></h3>
87118

@@ -119,8 +150,9 @@ Step 2. Add the dependency
119150

120151
<br>
121152
<div class="row">
122-
<img src="screenshots/error.gif" width="300">
123-
<img src="screenshots/shot_screen.gif" width="300">
153+
<img src="screenshots/outlined.gif" width="300">
154+
<img src="screenshots/error.gif" width="300">
155+
<img src="screenshots/shot_screen.gif" width="300">
124156
<img src="screenshots/1.jpg" width="300">
125157
<img src="screenshots/2.jpg" width="300">
126158
<img src="screenshots/3.jpg" width="300">

0 commit comments

Comments
 (0)