Search in sources :

Example 1 with LocaleString

use of io.github.lonamiwebs.stringlate.classes.locales.LocaleString in project Stringlate by LonamiWebs.

the class TranslateActivity method loadLocalesSpinner.

// endregion
// region Spinner loading
private void loadLocalesSpinner() {
    ArrayList<LocaleString> spinnerArray = new ArrayList<>();
    for (String locale : mRepo.getLocales()) if (!locale.equals(RepoHandler.DEFAULT_LOCALE))
        spinnerArray.add(new LocaleString(locale));
    ArrayAdapter<LocaleString> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, spinnerArray);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    mLocaleSpinner.setAdapter(adapter);
    setCurrentLocale(mRepo.settings.getLastLocale());
}
Also used : LocaleString(io.github.lonamiwebs.stringlate.classes.locales.LocaleString) ArrayList(java.util.ArrayList) LocaleString(io.github.lonamiwebs.stringlate.classes.locales.LocaleString) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

ArrayAdapter (android.widget.ArrayAdapter)1 LocaleString (io.github.lonamiwebs.stringlate.classes.locales.LocaleString)1 ArrayList (java.util.ArrayList)1