本文整理汇总了Java中cn.pedant.SweetAlert.SweetAlertDialog.OnSweetClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java SweetAlertDialog.OnSweetClickListener方法的具体用法?Java SweetAlertDialog.OnSweetClickListener怎么用?Java SweetAlertDialog.OnSweetClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.pedant.SweetAlert.SweetAlertDialog
的用法示例。
在下文中一共展示了SweetAlertDialog.OnSweetClickListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showAlertDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void showAlertDialog(String title, String message, String confirmBtn, SweetAlertDialog.OnSweetClickListener confirmClickListener) {
if (dialog == null || !dialog.isShowing()) {
dialog = new SweetAlertDialog(this).setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sweetAlertDialog) {
sweetAlertDialog.dismiss();
}
});
}
dialog.changeAlertType(SweetAlertDialog.WARNING_TYPE);
dialog.setContentText(message).setTitleText(title)
.setConfirmText(confirmBtn)
.setConfirmClickListener(confirmClickListener);
if(confirmClickListener != null) {
dialog.setCancelText(getString(R.string.cancel)).showCancelButton(true);
} else {
dialog.showCancelButton(false);
}
if (!dialog.isShowing()) {
dialog.show();
}
dialog.setOnDismissListener(null);
}
示例2: alertWithButton
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void alertWithButton(String title, String msg, final Activity activity,
SweetAlertDialog.OnSweetClickListener onClickListener) {
new SweetAlertDialog(activity, SweetAlertDialog.NORMAL_TYPE)
.setTitleText(title)
.setContentText(msg)
.setConfirmClickListener(onClickListener)
.setConfirmText("OK")
.show();
}
示例3: showWarningDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public static void showWarningDialog(Context context, String title, String content, SweetAlertDialog.OnSweetClickListener listener) {
if (mDialog != null) {
mDialog = null;
}
mDialog = new SweetAlertDialog(context, SweetAlertDialog.WARNING_TYPE)
.setTitleText(title)
.setContentText(content)
.setConfirmText("确定")
.setCancelText("取消")
.setConfirmClickListener(listener);
mDialog.show();
}
示例4: showErrorDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public static void showErrorDialog(Context context, String title, String content, SweetAlertDialog.OnSweetClickListener listener) {
if (mDialog != null) {
mDialog = null;
}
mDialog = new SweetAlertDialog(context, SweetAlertDialog.ERROR_TYPE)
.setConfirmText("确定")
.setTitleText(title)
.setContentText(content)
.setConfirmClickListener(listener);
mDialog.show();
}
示例5: showAlertDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void showAlertDialog(String title, String message, SweetAlertDialog.OnSweetClickListener confirmClickListener) {
if (getActivity() != null) {
((BaseActivity) getActivity()).showAlertDialog(title, message, confirmClickListener);
}
}
示例6: showAlertDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
/**
* Show an alert message
*/
void showAlertDialog(String title, String message, SweetAlertDialog.OnSweetClickListener confirmClickListener);