@Test public void shouldSetErrorWhenEditTextIsEmpty() throws Exception { EditText editText = new EditText(LMISApp.getContext()); boolean checkEditTextEmpty = ViewUtil.checkEditTextEmpty(editText); assertFalse(checkEditTextEmpty); assertThat(editText.getError().toString()).isEqualTo(LMISApp.getContext().getString(R.string.hint_error_input)); }
public static boolean checkEditTextEmpty(EditText editText) { if (TextUtils.isEmpty(editText.getText().toString())) { editText.setError(LMISApp.getContext().getString(R.string.hint_error_input)); editText.requestFocus(); return false; } return true; }
ViewUtil { public static boolean checkEditTextEmpty(EditText editText) { if (TextUtils.isEmpty(editText.getText().toString())) { editText.setError(LMISApp.getContext().getString(R.string.hint_error_input)); editText.requestFocus(); return false; } return true; } }
ViewUtil { public static boolean checkEditTextEmpty(EditText editText) { if (TextUtils.isEmpty(editText.getText().toString())) { editText.setError(LMISApp.getContext().getString(R.string.hint_error_input)); editText.requestFocus(); return false; } return true; } private  ViewUtil(); }
ViewUtil { public static boolean checkEditTextEmpty(EditText editText) { if (TextUtils.isEmpty(editText.getText().toString())) { editText.setError(LMISApp.getContext().getString(R.string.hint_error_input)); editText.requestFocus(); return false; } return true; } private  ViewUtil(); static void syncViewHeight(final View leftView, final View rightView); static boolean checkEditTextEmpty(EditText editText); }
ViewUtil { public static boolean checkEditTextEmpty(EditText editText) { if (TextUtils.isEmpty(editText.getText().toString())) { editText.setError(LMISApp.getContext().getString(R.string.hint_error_input)); editText.requestFocus(); return false; } return true; } private  ViewUtil(); static void syncViewHeight(final View leftView, final View rightView); static boolean checkEditTextEmpty(EditText editText);  }