Skip to content

[DEPRECATED] This library is not maintained anymore. No more development will be done.

License

Notifications You must be signed in to change notification settings

heetch/Android-country-picker

Repository files navigation

DEPRECATED

This library is not maintained anymore. No more development will be done.

Android country picker

Features

This country picker is a simple dialog window presenting a list of countries translated in the user's phone language. It return an object containing the flag resource, the iso and dialing code of the selected country. See the example to see more detail.

How to install

You can install this dependency by downloading the source code or directly via gradle with the help of jitpack

How to use

To show CountryPicker as a dialog:

CountryPickerDialog countryPicker =
    new CountryPickerDialog(mContext, new CountryPickerCallbacks() {
        @Override
        public void onCountrySelected(Country country, int flagResId) {
            // TODO handle callback
        }
    });
countryPicker.show();

If you want to retrieve a flag res outside of the country picker dialog use Utils.getMipmapResId(Context context, String drawableName) where the drawable have to be formatted as follow: countryIsoCodeInLowerCase_flag. For example: Utils.getMipmapResId(mContext, "fr_flag")

About

[DEPRECATED] This library is not maintained anymore. No more development will be done.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages