Search in sources :

Example 6 with TextServicesManager

use of android.view.textservice.TextServicesManager in project android_frameworks_base by ParanoidAndroid.

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 = SpellCheckerSubtype.constructLocaleFromString(subtype.getLocale());
    } else {
        locale = null;
    }
    mCurrentSpellCheckerLocaleCache = locale;
}
Also used : SpellCheckerSubtype(android.view.textservice.SpellCheckerSubtype) Locale(java.util.Locale) TextServicesManager(android.view.textservice.TextServicesManager)

Example 7 with TextServicesManager

use of android.view.textservice.TextServicesManager in project android_frameworks_base by DirtyUnicorns.

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