当前位置: 首页>>代码示例>>Java>>正文


Java ValidationError类代码示例

本文整理汇总了Java中com.mobsandgeeks.saripaar.ValidationError的典型用法代码示例。如果您正苦于以下问题:Java ValidationError类的具体用法?Java ValidationError怎么用?Java ValidationError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValidationError类属于com.mobsandgeeks.saripaar包,在下文中一共展示了ValidationError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    final SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(this);

        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            errorDialog.setTitleText("Oops...");
            errorDialog.setContentText(message);
            errorDialog.show();
            return;
        }
    }
}
 
开发者ID:CycloneAxe,项目名称:phphub-android,代码行数:18,代码来源:TopicPublishActivity.java

示例2: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(this);

        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(this, message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:hernandazevedo,项目名称:starwarsshop,代码行数:14,代码来源:BaseActivity.java

示例3: initValidator

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
private Validator initValidator() {
    Validator validator = new Validator(this);
    validator.setValidationListener(new Validator.ValidationListener() {
        @Override
        public void onValidationSucceeded() {
            view.hideKeyboard();
            user.setFirstName(binding.etFirstName.getText().toString());
            user.setLastName(binding.etLastName.getText().toString());
            user.setAge(Integer.valueOf(binding.etAge.getText().toString()));
            presenter.updateUser(user);
        }

        @Override
        public void onValidationFailed(List<ValidationError> errors) {
            for (ValidationError error : errors) {
                View view1 = error.getView();
                String message = error.getCollatedErrorMessage(EditProfileActivity.this);

                if (view1 instanceof EditText) {
                    ((EditText) view1).setError(message);
                } else {
                    EditProfileActivity.this.view.showMessage(message);
                }
            }
        }
    });
    return validator;
}
 
开发者ID:ihorvitruk,项目名称:buddysearch,代码行数:29,代码来源:EditProfileActivity.java

示例4: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(getActivity());
        if (view instanceof AppCompatEditText) {
            ((TextInputLayout) view.getParent().getParent()).setErrorEnabled(true);
            ((TextInputLayout) view.getParent().getParent()).setError(message);
        }
    }
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:12,代码来源:SessionFragment.java

示例5: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(getActivity());
        if (view instanceof AppCompatEditText) {
            ((TextInputLayout) view.getParent().getParent()).setError(message);
        }
    }
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:11,代码来源:RegisterFragment.java

示例6: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(getActivity());
        if (view instanceof AppCompatEditText) {
            ((TextInputLayout) view.getParent()).setError(message);
        }
    }
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:11,代码来源:FrgProfile.java

示例7: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(this);

        // Display error messages ;)
        if (view instanceof TextInputEditText) {
            ((TextInputEditText) view).setError(message);
        } else {
            showError(view, message);
        }
    }
}
 
开发者ID:Hotmart-Org,项目名称:zum-android,代码行数:15,代码来源:AuthenticatorActivity.java

示例8: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(this);

        if (view instanceof TextView) {
            ((TextInputLayout) view.getParent()).setError(message);
        } else {
            Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:Hotmart-Org,项目名称:zum-android,代码行数:14,代码来源:PlacesCreateActivity.java

示例9: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(this);

        if (view instanceof TextInputEditText) {
            ((TextInputEditText) view).setError(message);
        } else {
            Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:Hotmart-Org,项目名称:zum-android,代码行数:14,代码来源:SignUpActivity.java

示例10: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError mError : errors) {
        String mErrorMessage = mError.getCollatedErrorMessage(this);
        View mView = mError.getView();
        if (mView instanceof AppCompatEditText)
            ((AppCompatEditText) mView).setError(mErrorMessage);

    }
}
 
开发者ID:brunogabriel,项目名称:AndroidSocketChatRoom,代码行数:11,代码来源:ChatActivity.java

示例11: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(CreateAdmissionFragment.this.getActivity());
        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(CreateAdmissionFragment.this.getActivity(), message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:thandile,项目名称:msf_communique,代码行数:13,代码来源:CreateAdmissionFragment.java

示例12: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(UpdateAdmissionFragment.this.getActivity());

        // Display error messages ;)
        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(UpdateAdmissionFragment.this.getActivity(), message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:thandile,项目名称:msf_communique,代码行数:15,代码来源:UpdateAdmissionFragment.java

示例13: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(CreateOutcomeFragment.this.getActivity());

        // Display error messages ;)
        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(CreateOutcomeFragment.this.getActivity(), message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:thandile,项目名称:msf_communique,代码行数:15,代码来源:createOutcomeFragment.java

示例14: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(UpdateOutcomeFragment.this.getActivity());

        // Display error messages ;)
        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(UpdateOutcomeFragment.this.getActivity(), message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:thandile,项目名称:msf_communique,代码行数:15,代码来源:UpdateOutcomeFragment.java

示例15: onValidationFailed

import com.mobsandgeeks.saripaar.ValidationError; //导入依赖的package包/类
@Override
public void onValidationFailed(List<ValidationError> errors) {
    for (ValidationError error : errors) {
        View view = error.getView();
        String message = error.getCollatedErrorMessage(UpdateEnrollmentFragment.this.getActivity());

        // Display error messages ;)
        if (view instanceof EditText) {
            ((EditText) view).setError(message);
        } else {
            Toast.makeText(UpdateEnrollmentFragment.this.getActivity(), message, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:thandile,项目名称:msf_communique,代码行数:15,代码来源:UpdateEnrollmentFragment.java


注:本文中的com.mobsandgeeks.saripaar.ValidationError类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。