use of com.eventyay.organizer.utils.CurrencyUtils in project open-event-orga-app by fossasia.
the class CountryPreferenceFragmentCompat method setUpSpinner.
private void setUpSpinner() {
CurrencyUtils currencyUtils = new CurrencyUtils();
Map<String, String> countryCurrencyMap = currencyUtils.getCountryCurrencyMap();
List<String> countryList = new ArrayList<>(countryCurrencyMap.keySet());
ArrayAdapter<CharSequence> paymentCountryAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item);
paymentCountryAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
paymentCountryAdapter.addAll(countryList);
countrySpinner.setAdapter(paymentCountryAdapter);
countrySpinner.setSelection(savedIndex);
countrySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
index = position;
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// empty
}
});
}
Aggregations