Java Code Examples for android.widget.EditText#getId()

The following examples show how to use android.widget.EditText#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: X8FcExpSettingController.java    From FimiX8-RE with MIT License 5 votes vote down vote up
public void onError(EditText v, int errorCode, String errorMsg) {
    X8ToastUtil.showToast(this.mContext, this.contentView.getContext().getString(R.string.x8_fc_exp_error_tip), 0);
    double curValue = 0.0d;
    int i = v.getId();
    if (i == R.id.edt_to_up_down) {
        curValue = this.cvToUpDown.getCurValue();
    } else if (i == R.id.edt_to_left_right) {
        curValue = this.cvToLeftRight.getCurValue();
    } else if (i == R.id.edt_to_go_back) {
        curValue = this.cvToGoBack.getCurValue();
    }
    v.setText(String.valueOf(curValue));
    v.clearFocus();
}
 
Example 2
Source File: BaseActivity.java    From MvpRoute with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏键盘
 *
 * @param v   焦点所在View
 * @param ids 输入框
 * @return true代表焦点在edit上
 */
public boolean isFocusEditText(View v, int... ids) {
	if (v instanceof EditText) {
		EditText tmp_et = (EditText) v;
		for (int id : ids) {
			if (tmp_et.getId() == id) {
				return true;
			}
		}
	}
	return false;
}
 
Example 3
Source File: BaseFragment.java    From MvpRoute with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏键盘
 *
 * @param v   焦点所在View
 * @param ids 输入框
 * @return true代表焦点在edit上
 */
private boolean isFocusEditText(View v, int... ids) {
	if (v instanceof EditText) {
		EditText tmp_et = (EditText) v;
		for (int id : ids) {
			if (tmp_et.getId() == id) {
				return true;
			}
		}
	}
	return false;
}
 
Example 4
Source File: FragmentCharacteristicDetail.java    From EFRConnect-android with Apache License 2.0 5 votes vote down vote up
private boolean isAnyWriteFieldEmpty() {
    for (EditText e : editTexts) {
        if (e.getId() == EDIT_NOT_CLEAR_ID) continue;
        if (e.getText().toString().isEmpty()) return true;
    }
    return false;
}
 
Example 5
Source File: EditBindingAdapter.java    From Fairy with Apache License 2.0 5 votes vote down vote up
@BindingAdapter("judgehint")
public static void setHint(EditText view, CharSequence hint) {
    switch (view.getId()) {
        case R.id.edit_options_logcat:
            String options = "[options]";
            if (!hint.equals("")) {
                options = hint.toString();
            }
            view.setHint(options);
            break;
        case R.id.edit_filter_logcat:
            String filter = "[filterspecs]";
            if (!hint.equals("")) {
                filter = hint.toString();
            }
            view.setHint(filter);
            break;
        case R.id.edit_grep_logcat:
            String grep = "[grep]";
            if (!hint.equals("")) {
                grep = hint.toString();
            }
            view.setHint(grep);
            break;
        default:
            ZLog.e("no match");
            break;
    }
}
 
Example 6
Source File: ActivityKeyBoardProxy.java    From SoftKeyboardUtil with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏键盘
 *
 * @param v   焦点所在View
 * @param ids 输入框
 * @return true代表焦点在edit上
 */
private boolean isFocusEditText(View v, int... ids) {
    if (v instanceof EditText) {
        EditText tmp_et = (EditText) v;
        for (int id : ids) {
            if (tmp_et.getId() == id) {
                return true;
            }
        }
    }
    return false;
}
 
Example 7
Source File: BaseActivity.java    From SoftKeyboardUtil with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏键盘
 *
 * @param v   焦点所在View
 * @param ids 输入框
 * @return true代表焦点在edit上
 */
public boolean isFocusEditText(View v, int... ids) {
    if (v instanceof EditText) {
        EditText tmp_et = (EditText) v;
        for (int id : ids) {
            if (tmp_et.getId() == id) {
                return true;
            }
        }
    }
    return false;
}