本文整理汇总了Java中ua.org.zasadnyy.zvalidations.Field.getTextView方法的典型用法代码示例。如果您正苦于以下问题:Java Field.getTextView方法的具体用法?Java Field.getTextView怎么用?Java Field.getTextView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ua.org.zasadnyy.zvalidations.Field
的用法示例。
在下文中一共展示了Field.getTextView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import ua.org.zasadnyy.zvalidations.Field; //导入方法依赖的package包/类
@Override
public ValidationResult validate(Field field) {
EditText textView = field.getTextView();
boolean isValid = textView.getText().toString().matches(EMAIL_PATTERN);
return isValid ?
ValidationResult.buildSuccess(textView)
: ValidationResult.buildFailed(textView, mContext.getString(R.string.zvalidations_not_email));
}
示例2: validate
import ua.org.zasadnyy.zvalidations.Field; //导入方法依赖的package包/类
@Override
public ValidationResult validate(Field field) {
EditText textView = field.getTextView();
int textLength = textView.getText().toString().length();
return textLength >= mMin ?
ValidationResult.buildSuccess(textView)
: ValidationResult.buildFailed(textView, mContext.getString(R.string.zvalidations_too_short, mMin));
}
示例3: validate
import ua.org.zasadnyy.zvalidations.Field; //导入方法依赖的package包/类
@Override
public ValidationResult validate(Field field) {
EditText textView = field.getTextView();
boolean isValid = textView.getText().toString().matches(POSITIVE_INT_PATTERN);
return isValid ?
ValidationResult.buildSuccess(textView)
: ValidationResult.buildFailed(textView, mContext.getString(R.string.zvalidations_not_positive_integer));
}
示例4: validate
import ua.org.zasadnyy.zvalidations.Field; //导入方法依赖的package包/类
@Override
public ValidationResult validate(Field field) {
EditText textView = field.getTextView();
boolean isValid = false;
try {
int value = Integer.parseInt(textView.getText().toString());
isValid = (value > mMin) && (value < mMax);
} catch (NumberFormatException ignored) {
}
return isValid ?
ValidationResult.buildSuccess(textView)
: ValidationResult.buildFailed(textView, mContext.getString(R.string.zvalidations_not_in_range, mMin, mMax));
}