Skip to the content.

Currency Picker for Android



CurrencyPicker is a simple library that can be show a currency picker. See the example to see more detail.

How to use

Integrating the project is simple a refined all you need to do is follow the below steps

Step 1. 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" }
  }
}

Step 2. Add the dependency

dependencies {
        compile 'com.github.midorikocak:currency-picker-android:1.1.6'
}

Once the project has been added to gradle the user can implement this with easy.

CurrencyPicker picker = CurrencyPicker.newInstance("Select Currency");
picker.show(getSupportFragmentManager(), "CURRENCY_PICKER");
picker.setListener(new CurrencyPickerListener() {
    @Override
    public void onSelectCurrency(String name, String code, String dialCode, int flagDrawableResID) {
        // Implement your code here
    }
});

That’s it your all done.

Get user currency based on code

The following code will get the current users currency details based on code.

CurrencyPicker picker = CurrencyPicker.newInstance("Select Currency");
ExtendedCurrency currency = picker.getUserCurrencyInfo(code);
//TODO use the currency object