类android.view.inputmethod.InputConnectionWrapper源码实例Demo

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

源代码1 项目: ViewPrinter   文件: AutoSplitTextHelper.java
public InputConnection createInputConnection(InputConnection base) {
    return base == null ? null : new InputConnectionWrapper(base, true) {

        @Override
        public boolean sendKeyEvent(KeyEvent event) {
            // TODO: this could be improved by working even when we are not empty.
            // The behavior should be 'delete isLast character from mPre'.
            // In that case, we should check also that getSelectionStart() == 0.
            if (!isFirst() && mView.getText().length() == 0 &&
                    event.getAction() == KeyEvent.ACTION_DOWN &&
                    event.getKeyCode() == KeyEvent.KEYCODE_DEL) {
                removeFromChain(mView);
                return false;
            }
            return super.sendKeyEvent(event);
        }
    };
}
 
源代码2 项目: 365browser   文件: AutocompleteEditText.java
@VisibleForTesting
public InputConnectionWrapper getInputConnection() {
    return mInputConnection;
}
 
 类所在包
 同包方法