Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.31 KB

Readme.md

File metadata and controls

41 lines (30 loc) · 1.31 KB

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")