本文整理汇总了Java中android.view.inputmethod.EditorInfo.IME_ACTION_DONE属性的典型用法代码示例。如果您正苦于以下问题:Java EditorInfo.IME_ACTION_DONE属性的具体用法?Java EditorInfo.IME_ACTION_DONE怎么用?Java EditorInfo.IME_ACTION_DONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.inputmethod.EditorInfo
的用法示例。
在下文中一共展示了EditorInfo.IME_ACTION_DONE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
logi("onEditorAction() :: currentEditableRow=" + currentEditableRow);
int pos = (int) v.getTag(R.id.positionId);
Project project = mProjects.get(pos);
project.inEditMode = false;
currentEditableRow = -1;
if(actionId == EditorInfo.IME_ACTION_DONE) {
dismissKeyBoard(v, true, true);
} else if(actionId == -1) {
dismissKeyBoard(v, true, false);
}
return true;
}
示例2: imeActionName
public static String imeActionName(final int imeOptions) {
final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION;
switch (actionId) {
case EditorInfo.IME_ACTION_UNSPECIFIED:
return "actionUnspecified";
case EditorInfo.IME_ACTION_NONE:
return "actionNone";
case EditorInfo.IME_ACTION_GO:
return "actionGo";
case EditorInfo.IME_ACTION_SEARCH:
return "actionSearch";
case EditorInfo.IME_ACTION_SEND:
return "actionSend";
case EditorInfo.IME_ACTION_NEXT:
return "actionNext";
case EditorInfo.IME_ACTION_DONE:
return "actionDone";
case EditorInfo.IME_ACTION_PREVIOUS:
return "actionPrevious";
default:
return "actionUnknown(" + actionId + ")";
}
}
示例3: onEditorAction
@Override
public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent keyEvent) {
if ((keyEvent == null && actionId == EditorInfo.IME_ACTION_DONE) ||
(keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN &&
(actionId == EditorInfo.IME_NULL)))
{
handlePassphrase();
return true;
} else if (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_UP &&
actionId == EditorInfo.IME_NULL)
{
return true;
}
return false;
}
示例4: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO
|| actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
|| actionId == EditorInfo.IME_ACTION_SEND
|| actionId == EditorInfo.IME_ACTION_SEARCH
|| actionId == EditorInfo.IME_NULL) {
switch ((int) v.getTag()) {
case 1:
mNoteField.requestFocus();
break;
case 2:
sendIdeaFromDialog();
break;
default:
break;
}
return true;
}
return false;
}
示例5: handleAction
private void handleAction() {
EditorInfo curEditor = getCurrentInputEditorInfo();
switch (curEditor.imeOptions & EditorInfo.IME_MASK_ACTION) {
case EditorInfo.IME_ACTION_DONE:
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_DONE);
break;
case EditorInfo.IME_ACTION_GO:
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_GO);
break;
case EditorInfo.IME_ACTION_NEXT:
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
case EditorInfo.IME_ACTION_SEARCH:
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_SEARCH);
break;
case EditorInfo.IME_ACTION_SEND:
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_SEND);
break;
default:
break;
}
}
示例6: onStrokeWidthEditorAction
@OnEditorAction(R.id.edittext_stroke_width) boolean onStrokeWidthEditorAction(
TextView textView,
int actionId,
KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
mRoundedFrameLayout.setBackgroundDetails(null,
(int)getDimensionFromEditText(textView),
null,
null);
return true;
}
return false;
}
示例7: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
// Return input text to activity
doOK();
this.dismiss();
return true;
}
return false;
}
示例8: onEditorAction
@OnEditorAction(R.id.new_task_input)
boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
LogUtils.d("actionId: " + actionId + ", event Action: " + event);
if (actionId == EditorInfo.IME_ACTION_DONE) {
presenter.addNewTask(newTaskInput.getText().toString());
return true;
}
return false;
}
示例9: onEditorAction
@OnEditorAction(R.id.task_detail_note)
boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
KeyboardUtils.hideKeyboard(view.getContext(), view);
view.clearFocus();
presenter.onNoteEditorActionDone(view.getText().toString());
return true;
}
return false;
}
示例10: onCreateInputConnection
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
outAttrs.initialSelStart = 0;
return editCodeInputConnection;
}
示例11: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO
|| actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
|| actionId == EditorInfo.IME_ACTION_SEND
|| actionId == EditorInfo.IME_ACTION_SEARCH
|| actionId == EditorInfo.IME_NULL) {
sendEditIdea();
}
return true;
}
示例12: onEditorAction
@Override
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
returnData();
return true;
}
return false;
}
示例13: onEditorAction
@Override
public void onEditorAction(int actionId) {
int result = actionId & EditorInfo.IME_MASK_ACTION;
if (result == EditorInfo.IME_ACTION_DONE ||
result == EditorInfo.IME_ACTION_SEARCH) {
hideKeyboard();
}
}
示例14: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
searchAction();
InputMethodManager imm = (InputMethodManager)v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
return true;
}
return false;
}
示例15: onEditorAction
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == getResources().getInteger(R.integer.ime_action_id_signin)
|| actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
onSignInClicked();
// don't consume the event, so the keyboard can also be hidden
// http://stackoverflow.com/questions/2342620/how-to-hide-keyboard-after-typing-in-edittext-in-android#comment20849208_10184099
return false;
}
return false;
}