- Notifications
You must be signed in to change notification settings - Fork3
Android - Country code bottomsheet picker in Jetpack Compose
License
NotificationsYou must be signed in to change notification settings
canopas/compose-country-picker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Country code bottom sheet picker in Jetpack Compose with Search functionality.
Available onMaven Central.
Add the dependency
implementation'com.canopas.jetcountrypicker:jetcountrypicker:1.0.9'var openBottomSheet by rememberSaveable { mutableStateOf(false) }var selectedCountry by remember { mutableStateOf<Country?>(null) }Box {CountryTextField( label= stringResource(R.string.select_country_text), modifier=Modifier .fillMaxWidth() .padding(top=50.dp, start=40.dp, end=40.dp), selectedCountry= selectedCountry, defaultCountry= countryList(LocalContext.current).firstOrNull { it.code=="IN" }, onShowCountryPicker= { openBottomSheet=true }, isPickerVisible= openBottomSheet ) }if (openBottomSheet) {CountryPickerBottomSheet( bottomSheetTitle= {Text( modifier=Modifier .fillMaxWidth() .padding(16.dp), text= stringResource(R.string.select_country_text), textAlign=TextAlign.Center, fontWeight=FontWeight.Bold, fontSize=20.sp ) }, containerColor=Color.White, onItemSelected= { selectedCountry= it openBottomSheet=false }, onDismissRequest= { openBottomSheet=false } ) }
Sample app demonstrates how simple the usage of the library actually is.
For bugs, questions and discussions please use theGithub Issues.
JetCountryPicker is owned and maintained by theCanopas team. You can follow them on X at@canopassoftware for project updates and releases.
Copyright 2022 Canopas Software LLPLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.About
Android - Country code bottomsheet picker in Jetpack Compose
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.
