This sample app with showing the way how to implement country list dailog
## Getting Started This sample app with showing the way how to implement with country list dailogWe can install this library by using gradle
Step 1
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Step 2
dependencies {
implementation 'com.github.SunryTeang:country:1.0'
}
class MainActivity : AppCompatActivity(), OnCountryPickerListener {
private var countryPicker: CountryPicker? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
countryPicker = CountryPicker.Builder().with(this)
.listener(this)
.build()
select_country_pick.setOnClickListener {
countryPicker?.showDialog(supportFragmentManager)
}
onSelectCountry(countryPicker?.getDefualtCountry(this))
}
override fun onSelectCountry(country: Country?) {
flag_icon_imageview?.setBackgroundResource(country!!.flag)
country_code_textview.text = "" + country?.dialCode
}
}
Support Min Sdk version >= 19
- Teang sunry - SunryTeang
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details