当前位置: 首页>>代码示例>>Java>>正文


Java CompletionInfo.getText方法代码示例

本文整理汇总了Java中android.view.inputmethod.CompletionInfo.getText方法的典型用法代码示例。如果您正苦于以下问题:Java CompletionInfo.getText方法的具体用法?Java CompletionInfo.getText怎么用?Java CompletionInfo.getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.inputmethod.CompletionInfo的用法示例。


在下文中一共展示了CompletionInfo.getText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: commitCompletion

import android.view.inputmethod.CompletionInfo; //导入方法依赖的package包/类
public void commitCompletion(final CompletionInfo completionInfo) {
    if (DEBUG_BATCH_NESTING) checkBatchEdit();
    if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
    CharSequence text = completionInfo.getText();
    // text should never be null, but just in case, it's better to insert nothing than to crash
    if (null == text) text = "";
    mCommittedTextBeforeComposingText.append(text);
    mCurrentCursorPosition += text.length() - mComposingText.length();
    mComposingText.setLength(0);
    if (null != mIC) {
        mIC.commitCompletion(completionInfo);
        if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
            ResearchLogger.richInputConnection_commitCompletion(completionInfo);
        }
    }
    if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
}
 
开发者ID:slightfoot,项目名称:android-kioskime,代码行数:18,代码来源:RichInputConnection.java

示例2: commitCompletion

import android.view.inputmethod.CompletionInfo; //导入方法依赖的package包/类
public void commitCompletion(final CompletionInfo completionInfo) {
    if (DEBUG_BATCH_NESTING) checkBatchEdit();
    if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
    CharSequence text = completionInfo.getText();
    // text should never be null, but just in case, it's better to insert nothing than to crash
    if (null == text) text = "";
    mCommittedTextBeforeComposingText.append(text);
    mExpectedSelStart += text.length() - mComposingText.length();
    mExpectedSelEnd = mExpectedSelStart;
    mComposingText.setLength(0);
    if (isConnected()) {
        mIC.commitCompletion(completionInfo);
    }
    if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:16,代码来源:RichInputConnection.java

示例3: getFromApplicationSpecifiedCompletions

import android.view.inputmethod.CompletionInfo; //导入方法依赖的package包/类
public static ArrayList<SuggestedWordInfo> getFromApplicationSpecifiedCompletions(
        final CompletionInfo[] infos) {
    final ArrayList<SuggestedWordInfo> result = new ArrayList<>();
    for (final CompletionInfo info : infos) {
        if (null == info || null == info.getText()) {
            continue;
        }
        result.add(new SuggestedWordInfo(info));
    }
    return result;
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:12,代码来源:SuggestedWords.java

示例4: getFromApplicationSpecifiedCompletions

import android.view.inputmethod.CompletionInfo; //导入方法依赖的package包/类
public static ArrayList<SuggestedWordInfo> getFromApplicationSpecifiedCompletions(
        final CompletionInfo[] infos) {
    final ArrayList<SuggestedWordInfo> result = CollectionUtils.newArrayList();
    for (final CompletionInfo info : infos) {
        if (info == null) continue;
        final CharSequence text = info.getText();
        if (null == text) continue;
        final SuggestedWordInfo suggestedWordInfo = new SuggestedWordInfo(text.toString(),
                SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_APP_DEFINED,
                Dictionary.TYPE_APPLICATION_DEFINED);
        result.add(suggestedWordInfo);
    }
    return result;
}
 
开发者ID:slightfoot,项目名称:android-kioskime,代码行数:15,代码来源:SuggestedWords.java


注:本文中的android.view.inputmethod.CompletionInfo.getText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。