use of android.view.textservice.TextServicesManager in project android_frameworks_base by ResurrectionRemix.
the class TextView method updateTextServicesLocaleLocked.
private void updateTextServicesLocaleLocked() {
final TextServicesManager textServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
final SpellCheckerSubtype subtype = textServicesManager.getCurrentSpellCheckerSubtype(true);
final Locale locale;
if (subtype != null) {
locale = subtype.getLocaleObject();
} else {
locale = null;
}
mCurrentSpellCheckerLocaleCache = locale;
}
use of android.view.textservice.TextServicesManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class InputMethodAndLanguageSettings method onResume.
@Override
public void onResume() {
super.onResume();
mSettingsObserver.resume();
mIm.registerInputDeviceListener(this, null);
final Preference spellChecker = findPreference(KEY_SPELL_CHECKERS);
if (spellChecker != null) {
final TextServicesManager tsm = (TextServicesManager) getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
if (!tsm.isSpellCheckerEnabled()) {
spellChecker.setSummary(R.string.switch_off_text);
} else {
final SpellCheckerInfo sci = tsm.getCurrentSpellChecker();
if (sci != null) {
spellChecker.setSummary(sci.loadLabel(getPackageManager()));
} else {
spellChecker.setSummary(R.string.spell_checker_not_selected);
}
}
}
if (!mShowsOnlyFullImeAndKeyboardList) {
if (mLanguagePref != null) {
String localeNames = getLocaleNames(getActivity());
mLanguagePref.setSummary(localeNames);
}
updateUserDictionaryPreference(findPreference(KEY_USER_DICTIONARY_SETTINGS));
if (SHOW_INPUT_METHOD_SWITCHER_SETTINGS) {
mShowInputMethodSelectorPref.setOnPreferenceChangeListener(this);
}
}
updateInputDevices();
// Refresh internal states in mInputMethodSettingValues to keep the latest
// "InputMethodInfo"s and "InputMethodSubtype"s
mInputMethodSettingValues.refreshAllInputMethodAndSubtypes();
updateInputMethodPreferenceViews();
}
use of android.view.textservice.TextServicesManager in project android_frameworks_base by AOSPA.
the class TextView method updateTextServicesLocaleLocked.
private void updateTextServicesLocaleLocked() {
final TextServicesManager textServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
final SpellCheckerSubtype subtype = textServicesManager.getCurrentSpellCheckerSubtype(true);
final Locale locale;
if (subtype != null) {
locale = subtype.getLocaleObject();
} else {
locale = null;
}
mCurrentSpellCheckerLocaleCache = locale;
}
use of android.view.textservice.TextServicesManager in project android_frameworks_base by crdroidandroid.
the class TextView method updateTextServicesLocaleLocked.
private void updateTextServicesLocaleLocked() {
final TextServicesManager textServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
final SpellCheckerSubtype subtype = textServicesManager.getCurrentSpellCheckerSubtype(true);
final Locale locale;
if (subtype != null) {
locale = subtype.getLocaleObject();
} else {
locale = null;
}
mCurrentSpellCheckerLocaleCache = locale;
}
use of android.view.textservice.TextServicesManager in project platform_frameworks_base by android.
the class TextView method updateTextServicesLocaleLocked.
private void updateTextServicesLocaleLocked() {
final TextServicesManager textServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
final SpellCheckerSubtype subtype = textServicesManager.getCurrentSpellCheckerSubtype(true);
final Locale locale;
if (subtype != null) {
locale = subtype.getLocaleObject();
} else {
locale = null;
}
mCurrentSpellCheckerLocaleCache = locale;
}
Aggregations