本文整理汇总了Java中cn.pedant.SweetAlert.SweetAlertDialog.setCancelable方法的典型用法代码示例。如果您正苦于以下问题:Java SweetAlertDialog.setCancelable方法的具体用法?Java SweetAlertDialog.setCancelable怎么用?Java SweetAlertDialog.setCancelable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.pedant.SweetAlert.SweetAlertDialog
的用法示例。
在下文中一共展示了SweetAlertDialog.setCancelable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: askRestart
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
private void askRestart(){
SweetAlertDialog sweetAlertDialog = new SweetAlertDialog(mContext, SweetAlertDialog.WARNING_TYPE)
.setTitleText(getString(R.string.locale_changed))
.setContentText(getString(R.string.locale_changed_need_restart))
.setConfirmText("OK")
.setConfirmClickListener(dialog -> {
Intent intent = getBaseContext().getPackageManager()
.getLaunchIntentForPackage(getBaseContext().getPackageName());
PendingIntent restartIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);
AlarmManager mgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
if(Build.VERSION.SDK_INT < 19){
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 500, restartIntent);
}else{
mgr.setExact(AlarmManager.RTC, System.currentTimeMillis() + 500, restartIntent);
}
System.exit(0);
});
sweetAlertDialog.setCancelable(false);
sweetAlertDialog.show();
}
示例2: showNoConnectionDialog
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
/**
* Display a dialog that user has no internet connection
* @param ctx1
*
* Code from: http://osdir.com/ml/Android-Developers/2009-11/msg05044.html
*/
public static void showNoConnectionDialog(Context ctx1) {
final Context ctx = ctx1;
final SweetAlertDialog builder = new SweetAlertDialog(ctx, SweetAlertDialog.SUCCESS_TYPE);
builder.setCancelable(true);
builder.setContentText("Open internet connection");
builder.setTitle("No connection error!");
builder.setConfirmText("Open wirless.");
builder.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sweetAlertDialog) {
ctx.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
builder.dismissWithAnimation();
}
});
builder.show();
}
示例3: onValidationSucceeded
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
@Override
public void onValidationSucceeded() {
SweetAlertDialog loadingDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
String topicTitle = topicTitleView.getText().toString();
String topicBody = topicBodyView.getText().toString();
int nodeId = Integer.parseInt(selectNodeView.getTag().toString());
topic.setTitle(topicTitle);
topic.setBody(topicBody);
topic.setNodeId(nodeId);
getPresenter().publish(topic, loadingDialog);
loadingDialog.getProgressHelper().setBarColor(Color.parseColor("#4394DA"));
loadingDialog.setContentText(getString(R.string.submitting));
loadingDialog.setCancelable(false);
loadingDialog.show();
}
示例4: validationContent
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
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);
}
示例5: disableEdit
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void disableEdit() {
mDisableEdit = true;
mPersonalNameEt.setEnabled(false);
mPersonalNickEt.setEnabled(false);
mPersonalGenderTv.setEnabled(false);
mPersonalAreaEt.setEnabled(false);
mPersonalJobEt.setEnabled(false);
mPersonalHobbyEt.setEnabled(false);
mPersonalLanguageEt.setEnabled(false);
mPersonalSignEt.setEnabled(false);
mSubmitDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
mSubmitDialog.setTitleText(getString(R.string.ct_data_submiting));
mSubmitDialog.setCancelable(false);
mSubmitDialog.show();
}
示例6: HMultimedia
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HMultimedia(AdapterMultimedia adapterMultimedia, int offset, int idProyecto, Context context) {
this.adapterMultimedia = adapterMultimedia;
this.offset = offset;
this.idProyecto =idProyecto;
this.context = context;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例7: HUsuarioInteresa
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HUsuarioInteresa(int idUsuario, List<Integer> intereses, Context context, AdapterAreasInteres back, Set<Integer> posicionAreasInicial, ArrayList<Area> areasBack) {
this.idUsuario = idUsuario;
this.intereses = intereses;
this.context = context;
this.back = back;
this.areasBack =areasBack;
this.posicionAreasInicial = posicionAreasInicial;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例8: HProyectos
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HProyectos(AdapterProyecto adapterProyecto, int offset, Context context) {
this.adapterProyecto = adapterProyecto;
this.offset = offset;
this.context=context;
proyectos = new ArrayList<>();
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例9: HSeguir
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HSeguir(boolean eleminar, Usuario seguido, Context context, Button seguirUsuario, TextView seguidoresUsuario) {
this.seguido = seguido;
this.context=context;
this.seguirUSuario=seguirUsuario;
this.seguidoresUsuario=seguidoresUsuario;
this.seguidor = Sesion.getUsuario(context);
this.eleminar = eleminar;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例10: onPreExecute
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
pDialog.show();
}
示例11: onPreExecute
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
avances = new ArrayList<>();
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
pDialog.show();
}
示例12: HNotificaciones
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HNotificaciones(AdapterNotificacion adapterNotificacion, int offset, Context context) {
this.adapterNotificacion = adapterNotificacion;
this.offset = offset;
this.context = context;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
notificacions = new ArrayList<>();
}
示例13: HPublicacion
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HPublicacion(Context context, Publicacion publicacion,int tipo,int id) {
this.context = context;
this.publicacion = publicacion;
this.tipo = tipo;
this.id =id;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例14: HBuenaIdea
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public HBuenaIdea(boolean eliminar, Context context, Proyecto proyecto, ImageView buenaidea, TextView buenaidea_contador) {
this.eliminar = eliminar;
this.context=context;
this.proyecto=proyecto;
this.buenaidea=buenaidea;
this.buenaidea_contador=buenaidea_contador;
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
}
示例15: onPreExecute
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
usuarios=new ArrayList<>();
pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Cargando...");
pDialog.setCancelable(false);
pDialog.show();
}