當前位置: 首頁>>代碼示例>>Java>>正文


Java EditorInfo.IME_ACTION_GO屬性代碼示例

本文整理匯總了Java中android.view.inputmethod.EditorInfo.IME_ACTION_GO屬性的典型用法代碼示例。如果您正苦於以下問題:Java EditorInfo.IME_ACTION_GO屬性的具體用法?Java EditorInfo.IME_ACTION_GO怎麽用?Java EditorInfo.IME_ACTION_GO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.inputmethod.EditorInfo的用法示例。


在下文中一共展示了EditorInfo.IME_ACTION_GO屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 + ")";
    }
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:23,代碼來源:EditorInfoCompatUtils.java

示例2: onEditorAction

@Override
public boolean onEditorAction(TextView arg0, int actionId, KeyEvent arg2) {
	// hide the keyboard and search the web when the enter key
	// button is pressed
	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
			|| (arg2.getAction() == KeyEvent.KEYCODE_ENTER)) {
		InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(mSearch.getWindowToken(), 0);
		searchTheWeb(mSearch.getText().toString());
		LightningView v=getCurrentWebView();
		if (v != null) {
			v.requestFocus();
		}
		return true;
	}
	return false;
}
 
開發者ID:NewCasino,項目名稱:browser,代碼行數:20,代碼來源:BrowserActivity.java

示例3: 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;
}
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:26,代碼來源:MainActivity.java

示例4: onEditorAction

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO) {
        register();
        return true;
    }
    return false;
}
 
開發者ID:Vicent9920,項目名稱:FanChat,代碼行數:8,代碼來源:RegisterActivity.java

示例5: onEditorAction

/**
 * Called when an action is being performed.
 *
 * @param v        The view that was clicked.
 * @param actionId Identifier of the action.  This will be either the
 *                 identifier you supplied, or {@link EditorInfo#IME_NULL
 *                 EditorInfo.IME_NULL} if being called due to the enter key
 *                 being pressed.
 * @param event    If triggered by an enter key, this is the event;
 *                 otherwise, this is null.
 * @return Return true if you have consumed the action, else false.
 */
@Override
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "onEditorAction: " + actionId);
    }

    switch (actionId) {

        case EditorInfo.IME_ACTION_GO:
            if (DEBUG) {
                MyLog.i(CLS_NAME, "onEditorAction: IME_ACTION_GO");
            }
            testCommand();
            return true;
        case IME_GO:
            if (DEBUG) {
                MyLog.i(CLS_NAME, "onEditorAction: IME_GO");
            }
            testCommand();
            return true;
        default:
            break;

    }

    return false;
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:39,代碼來源:FragmentBugs.java

示例6: onEditorAction

@Override
public boolean onEditorAction(TextView tv, int action, KeyEvent arg2) {
    if (action == EditorInfo.IME_ACTION_GO) {
        placeCall();
        return true;
    }
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:DialerFragment.java

示例7: onEditorAction

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
	if (actionId == EditorInfo.IME_ACTION_GO) {
		verifyPassword();
		return true;
	}
	return false;
}
 
開發者ID:thiscitizenis,項目名稱:citizen-sdk-android,代碼行數:8,代碼來源:FingerprintAuthenticationDialogFragment.java

示例8: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "ENT";
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "N";
            break;
        case EditorInfo.IME_ACTION_SEARCH:
          //  mEnterKey.icon = "K";
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "HH";
            break;
        default:
         //   mEnterKey.icon = "U";
            mEnterKey.label = null;
            break;
    }
}
 
開發者ID:VladThodo,項目名稱:behe-keyboard,代碼行數:35,代碼來源:LatinKeyboard.java

示例9: setImeOptions

void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search);
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            break;
    }
}
 
開發者ID:YehtutHl,項目名稱:myan,代碼行數:31,代碼來源:smKeyboard.java

示例10: updateImeOptions

private void updateImeOptions() {
  // Default to IME_ACTION_DONE
  int returnKeyFlag = EditorInfo.IME_ACTION_DONE;
  if (mReturnKeyType != null) {
    switch (mReturnKeyType) {
      case "go":
        returnKeyFlag = EditorInfo.IME_ACTION_GO;
        break;
      case "next":
        returnKeyFlag = EditorInfo.IME_ACTION_NEXT;
        break;
      case "none":
        returnKeyFlag = EditorInfo.IME_ACTION_NONE;
        break;
      case "previous":
        returnKeyFlag = EditorInfo.IME_ACTION_PREVIOUS;
        break;
      case "search":
        returnKeyFlag = EditorInfo.IME_ACTION_SEARCH;
        break;
      case "send":
        returnKeyFlag = EditorInfo.IME_ACTION_SEND;
        break;
      case "done":
        returnKeyFlag = EditorInfo.IME_ACTION_DONE;
        break;
    }
  }

  if (mDisableFullscreen) {
    setImeOptions(returnKeyFlag | EditorInfo.IME_FLAG_NO_FULLSCREEN);
  } else {
    setImeOptions(returnKeyFlag);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:35,代碼來源:ReactEditText.java

示例11: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    int valnorm = KeyEvent.KEYCODE_ENTER;

    switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search);
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            mEnterKey.codes = TERMINAL_ENTER;
            break;
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:42,代碼來源:LatinKeyboard.java

示例12: 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;
}
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:12,代碼來源:RecyclerOnClickListener.java

示例13: submitLocation

/**
 * Handler for tapping the "go" button on the keyboard when focused on the location input
 *
 * @param actionId ID of action performed on the location input
 * @return true iff {@code actionId} is something we trigger a submission on
 */
@OnEditorAction(R.id.locationInput)
public boolean submitLocation(int actionId) {
    if (actionId == EditorInfo.IME_ACTION_GO) {
        submitLocation();
        return true;
    }
    return false;
}
 
開發者ID:tobyhs,項目名稱:WeatherWeight,代碼行數:14,代碼來源:ForecastActivity.java

示例14: onEditorAction

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO) {
        startLogin();
        return true;
    }
    return false;
}
 
開發者ID:Vicent9920,項目名稱:FanChat,代碼行數:8,代碼來源:LoginActivity.java

示例15: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Context context, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = ContextCompat.getDrawable(context, R.drawable.sym_keyboard_search);
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = ContextCompat.getDrawable(context, R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            break;
    }
}
 
開發者ID:cdjalel,項目名稱:QuranKeyboard,代碼行數:35,代碼來源:ArabicKeyboard.java


注:本文中的android.view.inputmethod.EditorInfo.IME_ACTION_GO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。