本文整理汇总了Java中fr.ganfra.materialspinner.MaterialSpinner.getSelectedItemPosition方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialSpinner.getSelectedItemPosition方法的具体用法?Java MaterialSpinner.getSelectedItemPosition怎么用?Java MaterialSpinner.getSelectedItemPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fr.ganfra.materialspinner.MaterialSpinner
的用法示例。
在下文中一共展示了MaterialSpinner.getSelectedItemPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: curpValido
import fr.ganfra.materialspinner.MaterialSpinner; //导入方法依赖的package包/类
public static boolean curpValido(EditText editTextCurp, EditText editTextNombre, EditText editTextApellidoPaterno,
EditText editTextApellidoMaterno, EditText editTextFechaNacimiento,
MaterialSpinner spinnerGenero, MaterialSpinner spinnerEstadoNacimiento) {
if (editTextCurp.getText().length() == 18) {
if (editTextNombre.getText().toString().length() != 0 &&
editTextApellidoPaterno.getText().toString().length() != 0 &&
editTextApellidoMaterno.getText().toString().length() != 0 &&
editTextFechaNacimiento.getText().toString().length() != 0 &&
spinnerGenero.getSelectedItemPosition() != 0 &&
spinnerEstadoNacimiento.getSelectedItemPosition() != 0) {
return true;
} else {
return false;
}
} else {
((TextInputLayout)editTextCurp.getParent().getParent()).setErrorEnabled(true);
((TextInputLayout)editTextCurp.getParent().getParent()).setError("CURP debe tener 18 caracteres");
return false;
}
}
示例2: spinnerDatosCurpInvalido
import fr.ganfra.materialspinner.MaterialSpinner; //导入方法依赖的package包/类
public static boolean spinnerDatosCurpInvalido(MaterialSpinner spinner){
if(spinner.getSelectedItemPosition() == 0){
return true;
}
else{
return false;
}
}
示例3: spinnerSinSeleccion
import fr.ganfra.materialspinner.MaterialSpinner; //导入方法依赖的package包/类
/**
* Función para mostrar un error en el spinner cuando la selección es nula.
* @param spinner: Objeto tipo MaterialSpinner.
* @return boolean.
*/
public static boolean spinnerSinSeleccion(MaterialSpinner spinner){
if(spinner.getSelectedItemPosition() == 0){
spinner.setError("Este campo es obligatorio");
return true;
}
else{
return false;
}
}
示例4: validate
import fr.ganfra.materialspinner.MaterialSpinner; //导入方法依赖的package包/类
public static ValidationStatus validate(MaterialSpinner spinner) {
if (!(spinner.getTag(R.id.v_required) instanceof String) || !(spinner.getTag(R.id.error) instanceof String)) {
return new ValidationStatus(true, null);
}
Boolean isRequired = Boolean.valueOf((String) spinner.getTag(R.id.v_required));
if (!isRequired) {
return new ValidationStatus(true, null);
}
int selectedItemPosition = spinner.getSelectedItemPosition();
if(selectedItemPosition > 0) {
return new ValidationStatus(true, null);
}
return new ValidationStatus(false, (String) spinner.getTag(R.id.error));
}