Default Country Picker View
i. add following to your XML layout
```xml
```
ii. modify view / dialog / list config in activity or fragment
```kotlin
private fun setupCountryPickerView() {
val countryPicker = findViewById(R.id.countryPicker)
// Modify CPViewConfig if you need. Access cpViewConfig through `cpViewHelper`
countryPicker.cpViewHelper.cpViewConfig.viewTextGenerator = { cpCountry: CPCountry ->
"${cpCountry.name} (${cpCountry.alpha2})"
}
// make sure to refresh view once view configuration is changed
countryPicker.cpViewHelper.refreshView()
// Modify CPDialogConfig if you need. Access cpDialogConfig through `countryPicker.cpViewHelper`
// countryPicker.cpViewHelper.cpDialogConfig.
// Modify CPListConfig if you need. Access cpListConfig through `countryPicker.cpViewHelper`
// countryPicker.cpViewHelper.cpListConfig.
// Modify CPRowConfig if you need. Access cpRowConfig through `countryPicker.cpViewHelper`
// countryPicker.cpViewHelper.cpRowConfig.
}
```
ii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-Picker-View) about Country Picker View and available configuration
Custom Country Picker View
i. Read how to create your [Custom Country Picker View](https://github.com/hbb20/AndroidCountryPicker/wiki/Custom-Country-Picker-View)
Launch Country Picker Dialog
i. add following to your Activity/Fragment
```kotlin
context.launchCountryPickerDialog { selectedCountry: CPCountry? ->
// your code to handle selected country
}
```
ii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-Picker-Dialog) about CountryPicker Dialog and available configuration
Load countries in RecyclerView
i. add following to your Activity/Fragment
```kotlin
recyclerView.loadCountries { selectedCountry: CPCountry ->
// your code to handle selected country
}
```
ii. [Read More](https://github.com/hbb20/AndroidCountryPicker/wiki/Country-List-(RecyclerView)) about Country List and available configuration