An android library for listing all the countries and user can select the country name, code, dial code and flag. auto select country code
Bugevil.-.Facebook_2.mp4
Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.eslam2010011:FastCountryPicker:1'
}
# Step 3
<com.fastcountrycode.widget.FastCountryCodeM
android:id="@+id/fab"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
/////////////////////
<com.fastcountrycode.widget.FastCountryCodeOnlyM
android:gravity="center"
android:id="@+id/cancel_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
```
# Step 4
```html
FastCountryCodeOnlyM fastcountrycode =findViewById(R.id.fastcountrycode);
fastcountrycode.getCountry_().getDialCode()
//or
fastcountrycode.setCountryPickerListener(new CountryPickerListener() {
@Override
public void onSelectCountry(Country country) {
textView.setText(country.getDialCode());
}
});