Search in sources :

Example 1 with TextServicesManager

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;
}
Also used : SpellCheckerSubtype(android.view.textservice.SpellCheckerSubtype) Locale(java.util.Locale) TextServicesManager(android.view.textservice.TextServicesManager)

Example 2 with TextServicesManager

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();
}
Also used : ListPreference(android.support.v7.preference.ListPreference) Preference(android.support.v7.preference.Preference) SwitchPreference(android.support.v14.preference.SwitchPreference) TextServicesManager(android.view.textservice.TextServicesManager) SpellCheckerInfo(android.view.textservice.SpellCheckerInfo)

Example 3 with TextServicesManager

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;
}
Also used : SpellCheckerSubtype(android.view.textservice.SpellCheckerSubtype) Locale(java.util.Locale) TextServicesManager(android.view.textservice.TextServicesManager)

Example 4 with TextServicesManager

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;
}
Also used : SpellCheckerSubtype(android.view.textservice.SpellCheckerSubtype) Locale(java.util.Locale) TextServicesManager(android.view.textservice.TextServicesManager)

Example 5 with TextServicesManager

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;
}
Also used : SpellCheckerSubtype(android.view.textservice.SpellCheckerSubtype) Locale(java.util.Locale) TextServicesManager(android.view.textservice.TextServicesManager)

Aggregations

TextServicesManager (android.view.textservice.TextServicesManager)7 SpellCheckerSubtype (android.view.textservice.SpellCheckerSubtype)6 Locale (java.util.Locale)6 SwitchPreference (android.support.v14.preference.SwitchPreference)1 ListPreference (android.support.v7.preference.ListPreference)1 Preference (android.support.v7.preference.Preference)1 SpellCheckerInfo (android.view.textservice.SpellCheckerInfo)1