本文整理汇总了Java中android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED属性的典型用法代码示例。如果您正苦于以下问题:Java EditorInfo.IME_ACTION_UNSPECIFIED属性的具体用法?Java EditorInfo.IME_ACTION_UNSPECIFIED怎么用?Java EditorInfo.IME_ACTION_UNSPECIFIED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.inputmethod.EditorInfo
的用法示例。
在下文中一共展示了EditorInfo.IME_ACTION_UNSPECIFIED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 + ")";
}
}
示例2: setReturnKeyType
@WXComponentProp(name = Constants.Name.RETURN_KEY_TYPE)
public void setReturnKeyType(String type) {
if (getHostView() == null) {
return;
}
mReturnKeyType = type;
switch (type) {
case ReturnTypes.DEFAULT:
mEditorAction = EditorInfo.IME_ACTION_UNSPECIFIED;
break;
case ReturnTypes.GO:
mEditorAction = EditorInfo.IME_ACTION_GO;
break;
case ReturnTypes.NEXT:
mEditorAction = EditorInfo.IME_ACTION_NEXT;
break;
case ReturnTypes.SEARCH:
mEditorAction = EditorInfo.IME_ACTION_SEARCH;
break;
case ReturnTypes.SEND:
mEditorAction = EditorInfo.IME_ACTION_SEND;
break;
case ReturnTypes.DONE:
mEditorAction = EditorInfo.IME_ACTION_DONE;
break;
default:
break;
}
//remove focus and hide keyboard first, the ImeOptions will take effect when show keyboard next time
blur();
getHostView().setImeOptions(mEditorAction);
}