本文整理匯總了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);