當前位置: 首頁>>代碼示例>>Java>>正文


Java SweetAlertDialog.show方法代碼示例

本文整理匯總了Java中cn.pedant.SweetAlert.SweetAlertDialog.show方法的典型用法代碼示例。如果您正苦於以下問題:Java SweetAlertDialog.show方法的具體用法?Java SweetAlertDialog.show怎麽用?Java SweetAlertDialog.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cn.pedant.SweetAlert.SweetAlertDialog的用法示例。


在下文中一共展示了SweetAlertDialog.show方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findOffLineDate

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
private void findOffLineDate() {

        pDialog = new SweetAlertDialog(MainActivity.this, SweetAlertDialog.PROGRESS_TYPE);
        pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
        pDialog.setTitleText("離線數據加載中...");
        pDialog.show();
        mAccountBeans = SPUtils.getDataList("beans", AccountBean.class);

        mTestStackAdapter = new TestStackAdapter(MainActivity.this, mAccountBeans);
        mStackView.setAdapter(mTestStackAdapter);
        mTestStackAdapter.notifyDataSetChanged();
        new Handler().postDelayed(
                new Runnable() {
                    @Override
                    public void run() {
                        //為什麽不能把TEST_DATA拿出來單獨處理一次,會出現ANR
                        mTestStackAdapter.updateData(Arrays.asList(DesUtil.getRandomFromArray(TEST_DATAS, mAccountBeans.size())));
                        pDialog.dismiss();
                    }
                }
                , 1500
        );
    }
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:24,代碼來源:MainActivity.java

示例2: 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();
}
 
開發者ID:Lazyeraser,項目名稱:DereHelper,代碼行數:21,代碼來源:MainActivity.java

示例3: exportUser

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
void exportUser() {
  SweetAlertDialog sw=new SweetAlertDialog(getActivity(), SweetAlertDialog.PROGRESS_TYPE);
    sw.show();
    try {
        ExcelUtil excelUtils = new ExcelUtil(jobName, modleList);
        File file = excelUtils.create();
        ExcelUtil.openFileByOtherApp(getActivity(), file);
        if (sw.isShowing()) {
            sw.dismiss();
        }
    } catch (Exception e) {
        LogUtils.e("導出excel", e.getMessage());
        if (sw.isShowing()) {
            sw.dismiss();
        }
    }
}
 
開發者ID:woniukeji,項目名稱:jianguo,代碼行數:18,代碼來源:FilterFragment.java

示例4: 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();
}
 
開發者ID:talayhan,項目名稱:vibeapp,代碼行數:24,代碼來源:MainActivity.java

示例5: onOptionsItemSelected

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    switch (id) {
        case R.id.menu_share:
            onShareItemSelected();
            break;

        case R.id.menu_report:
            SweetAlertDialog successDialog = new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE);

            successDialog.setTitleText(getString(R.string.success_title));
            successDialog.setContentText(getString(R.string.report_success));
            successDialog.show();

            break;
    }
    return super.onOptionsItemSelected(item);
}
 
開發者ID:CycloneAxe,項目名稱:phphub-android,代碼行數:21,代碼來源:TopicDetailsActivity.java

示例6: 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();
}
 
開發者ID:CycloneAxe,項目名稱:phphub-android,代碼行數:19,代碼來源:TopicPublishActivity.java

示例7: 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);
}
 
開發者ID:CycloneAxe,項目名稱:phphub-android,代碼行數:20,代碼來源:TopicReplyActivity.java

示例8: 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();
}
 
開發者ID:MoonRune,項目名稱:CuiTrip,代碼行數:18,代碼來源:SelfActivity.java

示例9: 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();
}
 
開發者ID:nen155,項目名稱:TFG-SmartU-La-red-social,代碼行數:9,代碼來源:HSubirImagen.java

示例10: 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();
}
 
開發者ID:nen155,項目名稱:TFG-SmartU-La-red-social,代碼行數:10,代碼來源:HAvances.java

示例11: 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();
}
 
開發者ID:nen155,項目名稱:TFG-SmartU-La-red-social,代碼行數:10,代碼來源:HUsuarios.java

示例12: onPreExecute

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
@Override
protected void onPreExecute() {
    comentarios = new ArrayList<>();
    pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
    pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
    pDialog.setTitleText("Cargando...");
    pDialog.setCancelable(false);
    pDialog.show();
}
 
開發者ID:nen155,項目名稱:TFG-SmartU-La-red-social,代碼行數:10,代碼來源:HComentarios.java

示例13: showUploadArticleProgress

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
@Override
public void showUploadArticleProgress() {
    dialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
    dialog.setTitleText(getString(R.string.now_releasing_article));
    dialog.setCancelable(false);
    dialog.show();
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:8,代碼來源:EditorActivity.java

示例14: showDialog

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
@Override
public void showDialog() {
    dialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
    dialog.setTitleText("正在登錄");
    dialog.showCancelButton(false);
    dialog.show();
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:8,代碼來源:LoginActivity.java

示例15: showDefaultDialog

import cn.pedant.SweetAlert.SweetAlertDialog; //導入方法依賴的package包/類
public void showDefaultDialog(Activity activity,String content)
{
    dialog=new SweetAlertDialog(activity);
    dialog.changeAlertType(SweetAlertDialog.PROGRESS_TYPE);
    dialog.getProgressHelper().setBarColor(Color.parseColor("#2f76d4"));
    dialog.setTitleText(content);
    dialog.setCancelable(false);
    dialog.show();
}
 
開發者ID:CuiBow,項目名稱:dagger_mvp,代碼行數:10,代碼來源:SweetAlertUtils.java


注:本文中的cn.pedant.SweetAlert.SweetAlertDialog.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。