break; default: mInputView = new InternalEditText(context, attrs, defStyleAttr); break;
/** * Called when an attached input method calls * {@link InputConnection#performEditorAction(int) * InputConnection.performEditorAction()} * for this text view. The default implementation will call your action * listener supplied to {@link #setOnEditorActionListener}, or perform * a standard operation for {@link EditorInfo#IME_ACTION_NEXT * EditorInfo.IME_ACTION_NEXT}, {@link EditorInfo#IME_ACTION_PREVIOUS * EditorInfo.IME_ACTION_PREVIOUS}, or {@link EditorInfo#IME_ACTION_DONE * EditorInfo.IME_ACTION_DONE}. * * <p>For backwards compatibility, if no IME options have been set and the * text view would not normally advance focus on enter, then * the NEXT and DONE actions received here will be turned into an enter * key down/up pair to go through the normal key handling. * * @param actionCode The code of the action being performed. * * @see #setOnEditorActionListener */ public void onEditorAction (int actionCode){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) ((InternalEditText)mInputView).superOnEditorAction(actionCode); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) ((InternalAutoCompleteTextView)mInputView).superOnEditorAction(actionCode); else ((InternalMultiAutoCompleteTextView)mInputView).superOnEditorAction(actionCode); }
/** * Called by the framework in response to a text completion from * the current input method, provided by it calling * {@link InputConnection#commitCompletion * InputConnection.commitCompletion()}. The default implementation does * nothing; text views that are supporting auto-completion should override * this to do their desired behavior. * * @param text The auto complete text the user has selected. */ public void onCommitCompletion (CompletionInfo text){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) ((InternalEditText)mInputView).superOnCommitCompletion(text); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) ((InternalAutoCompleteTextView)mInputView).superOnCommitCompletion(text); else ((InternalMultiAutoCompleteTextView)mInputView).superOnCommitCompletion(text); }
/** * Called by the framework in response to a text auto-correction (such as fixing a typo using a * a dictionnary) from the current input method, provided by it calling * {@link InputConnection#commitCorrection} InputConnection.commitCorrection()}. The default * implementation flashes the background of the corrected word to provide feedback to the user. * * @param info The auto correct info about the text that was corrected. */ public void onCommitCorrection (CorrectionInfo info){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) ((InternalEditText)mInputView).superOnCommitCorrection(info); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) ((InternalAutoCompleteTextView)mInputView).superOnCommitCorrection(info); else ((InternalMultiAutoCompleteTextView)mInputView).superOnCommitCorrection(info); }
@Override public boolean onKeyShortcut (int keyCode, KeyEvent event){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnKeyShortcut(keyCode, event); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnKeyShortcut(keyCode, event); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnKeyShortcut(keyCode, event); }
@Override public boolean onKeyPreIme (int keyCode, KeyEvent event){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnKeyPreIme(keyCode, event); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnKeyPreIme(keyCode, event); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnKeyPreIme(keyCode, event); }
@Override public boolean onKeyDown (int keyCode, KeyEvent event){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnKeyDown(keyCode, event); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnKeyDown(keyCode, event); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnKeyDown(keyCode, event); }
@Override public boolean onKeyUp (int keyCode, KeyEvent event){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnKeyUp(keyCode, event); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnKeyUp(keyCode, event); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnKeyUp(keyCode, event); }
@Override public boolean onKeyMultiple (int keyCode, int repeatCount, KeyEvent event){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnKeyMultiple(keyCode, repeatCount, event); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnKeyMultiple(keyCode, repeatCount, event); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnKeyMultiple(keyCode, repeatCount, event); }
@Override public InputConnection onCreateInputConnection (EditorInfo outAttrs){ if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return ((InternalEditText)mInputView).superOnCreateInputConnection(outAttrs); else if(mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE) return ((InternalAutoCompleteTextView)mInputView).superOnCreateInputConnection(outAttrs); else return ((InternalMultiAutoCompleteTextView)mInputView).superOnCreateInputConnection(outAttrs); }