类android.view.textservice.TextServicesManager源码实例Demo

下面列出了怎么用android.view.textservice.TextServicesManager的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: delion   文件: SpellCheckerSessionBridge.java
/**
 * Constructs a SpellCheckerSessionBridge object as well as its SpellCheckerSession object.
 * @param nativeSpellCheckerSessionBridge Pointer to the native SpellCheckerSessionBridge.
 */
private SpellCheckerSessionBridge(long nativeSpellCheckerSessionBridge) {
    mNativeSpellCheckerSessionBridge = nativeSpellCheckerSessionBridge;

    Context context = ContextUtils.getApplicationContext();
    final TextServicesManager textServicesManager =
            (TextServicesManager) context.getSystemService(
                    Context.TEXT_SERVICES_MANAGER_SERVICE);

    // This combination of parameters will cause the spellchecker to be based off of
    // the language specified at "Settings > Language & input > Spell checker > Language".
    // If that setting is set to "Use system language" and the system language is not on the
    // list of supported spellcheck languages, this call will return null.  This call will also
    // return null if the user has turned spellchecking off at "Settings > Language & input >
    // Spell checker".
    mSpellCheckerSession = textServicesManager.newSpellCheckerSession(null, null, this, true);
}
 
源代码2 项目: 365browser   文件: SpellCheckerSessionBridge.java
/**
 * Constructs a SpellCheckerSessionBridge object as well as its SpellCheckerSession object.
 * @param nativeSpellCheckerSessionBridge Pointer to the native SpellCheckerSessionBridge.
 */
private SpellCheckerSessionBridge(long nativeSpellCheckerSessionBridge) {
    mNativeSpellCheckerSessionBridge = nativeSpellCheckerSessionBridge;

    Context context = ContextUtils.getApplicationContext();
    final TextServicesManager textServicesManager =
            (TextServicesManager) context.getSystemService(
                    Context.TEXT_SERVICES_MANAGER_SERVICE);

    // This combination of parameters will cause the spellchecker to be based off of
    // the language specified at "Settings > Language & input > Spell checker > Language".
    // If that setting is set to "Use system language" and the system language is not on the
    // list of supported spellcheck languages, this call will return null.  This call will also
    // return null if the user has turned spellchecking off at "Settings > Language & input >
    // Spell checker".
    mSpellCheckerSession = textServicesManager.newSpellCheckerSession(null, null, this, true);
}
 
源代码3 项目: android_9.0.0_r45   文件: SpellChecker.java
private void resetSession() {
    closeSession();

    mTextServicesManager = (TextServicesManager) mTextView.getContext().
            getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
    if (!mTextServicesManager.isSpellCheckerEnabled()
            || mCurrentLocale == null
            || mTextServicesManager.getCurrentSpellCheckerSubtype(true) == null) {
        mSpellCheckerSession = null;
    } else {
        mSpellCheckerSession = mTextServicesManager.newSpellCheckerSession(
                null /* Bundle not currently used by the textServicesManager */,
                mCurrentLocale, this,
                false /* means any available languages from current spell checker */);
        mIsSentenceSpellCheckSupported = true;
    }

    // Restore SpellCheckSpans in pool
    for (int i = 0; i < mLength; i++) {
        mIds[i] = -1;
    }
    mLength = 0;

    // Remove existing misspelled SuggestionSpans
    mTextView.removeMisspelledSpans((Editable) mTextView.getText());
    mSuggestionSpanCache.evictAll();
}
 
源代码4 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码5 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码6 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码7 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码8 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码9 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码10 项目: AndroidComponentPlugin   文件: ContextImpl.java
public Object createService(ContextImpl ctx) {
    return TextServicesManager.getInstance();
}
 
源代码11 项目: android_9.0.0_r45   文件: SystemServiceRegistry.java
@Override
public TextServicesManager createService() {
    return TextServicesManager.getInstance();
}
 
源代码12 项目: PowerFileExplorer   文件: ServiceUtil.java
@TargetApi(14)
public static TextServicesManager getTextServicesManager() {
    return (TextServicesManager) getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
}
 
 类所在包
 类方法
 同包方法