本文整理汇总了Java中cn.pedant.SweetAlert.SweetAlertDialog.ERROR_TYPE属性的典型用法代码示例。如果您正苦于以下问题:Java SweetAlertDialog.ERROR_TYPE属性的具体用法?Java SweetAlertDialog.ERROR_TYPE怎么用?Java SweetAlertDialog.ERROR_TYPE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cn.pedant.SweetAlert.SweetAlertDialog
的用法示例。
在下文中一共展示了SweetAlertDialog.ERROR_TYPE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onValidationFailed
@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;
}
}
}
示例2: validationContent
public void validationContent() {
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
SweetAlertDialog loadingDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
String reply = topicBodyView.getText().toString();
if (reply.trim().length() < 2) {
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.body_input_error));
errorDialog.show();
return;
}
loadingDialog.getProgressHelper().setBarColor(Color.parseColor("#4394DA"));
loadingDialog.setContentText(getString(R.string.submitting));
loadingDialog.setCancelable(false);
loadingDialog.show();
getPresenter().request(topicId, reply, loadingDialog);
}
示例3: verifyProfile
private void verifyProfile() {
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
SweetAlertDialog loadingDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
String username = userNameView.getText().toString();
String city = addressView.getText().toString();
String twitter = twitterView.getText().toString();
String github = githubView.getText().toString();
String blog = blogView.getText().toString();
String des = desView.getText().toString();
if (TextUtils.isEmpty(username)) {
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.username_error));
errorDialog.show();
return;
}
userInfo.setName(username);
userInfo.setCity(city);
userInfo.setTwitterAccount(twitter);
userInfo.setGithubName(github);
userInfo.setPersonalWebsite(blog);
userInfo.setIntroduction(des);
loadingDialog.getProgressHelper().setBarColor(Color.parseColor("#4394DA"));
loadingDialog.setContentText(getString(R.string.submitting));
loadingDialog.setCancelable(false);
loadingDialog.show();
getPresenter().request(userInfo);
loadingDialog.dismiss();
}
示例4: onNetWorkError
public void onNetWorkError(Throwable throwable) {
Logger.e(throwable.getMessage());
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.publish_error));
errorDialog.show();
}
示例5: onNetWorkError
public void onNetWorkError(Throwable throwable, SweetAlertDialog loadingDialog) {
Logger.e(throwable.getMessage());
loadingDialog.dismiss();
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.publish_error));
errorDialog.show();
}
示例6: trySubmit
public void trySubmit() {
String validate = validateSubmit();
if (TextUtils.isEmpty(validate)) {
showSubmitProgressing();
if (isAllBitMapUploaded()) {
submit();
}
} else {
SweetAlertDialog loadDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
loadDialog.setTitleText(validate);
loadDialog.setConfirmText(getString(R.string.ct_i_know));
loadDialog.setCancelable(false);
loadDialog.show();
}
}