use of com.android.inputmethod.latin.userdictionary.UserDictionaryAddWordContents.LocaleRenderer in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class UserDictionaryAddWordFragment method updateSpinner.
private void updateSpinner() {
final ArrayList<LocaleRenderer> localesList = mContents.getLocalesList(getActivity());
final Spinner localeSpinner = (Spinner) mRootView.findViewById(R.id.user_dictionary_add_locale);
final ArrayAdapter<LocaleRenderer> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, localesList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
localeSpinner.setAdapter(adapter);
localeSpinner.setOnItemSelectedListener(this);
}
use of com.android.inputmethod.latin.userdictionary.UserDictionaryAddWordContents.LocaleRenderer in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class UserDictionaryAddWordFragment method onItemSelected.
@Override
public void onItemSelected(final AdapterView<?> parent, final View view, final int pos, final long id) {
final LocaleRenderer locale = (LocaleRenderer) parent.getItemAtPosition(pos);
if (locale.isMoreLanguages()) {
PreferenceActivity preferenceActivity = (PreferenceActivity) getActivity();
preferenceActivity.startPreferenceFragment(new UserDictionaryLocalePicker(), true);
} else {
mContents.updateLocale(locale.getLocaleString());
}
}
Aggregations