getId ( )源码实例Demo

android.widget.EditText#getId ( )源码实例Demo

下面列出了android.widget.EditText#getId ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: FimiX8-RE   文件: X8FcExpSettingController.java
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();
}
 
源代码2 项目: MvpRoute   文件: BaseActivity.java
/**
 * 隐藏键盘
 *
 * @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;
}
 
源代码3 项目: MvpRoute   文件: BaseFragment.java
/**
 * 隐藏键盘
 *
 * @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;
}
 
private boolean isAnyWriteFieldEmpty() {
    for (EditText e : editTexts) {
        if (e.getId() == EDIT_NOT_CLEAR_ID) continue;
        if (e.getText().toString().isEmpty()) return true;
    }
    return false;
}
 
源代码5 项目: Fairy   文件: EditBindingAdapter.java
@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;
    }
}
 
源代码6 项目: SoftKeyboardUtil   文件: ActivityKeyBoardProxy.java
/**
 * 隐藏键盘
 *
 * @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;
}
 
源代码7 项目: SoftKeyboardUtil   文件: BaseActivity.java
/**
 * 隐藏键盘
 *
 * @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;
}