• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SweetAlertDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cn.pedant.SweetAlert.SweetAlertDialog的典型用法代码示例。如果您正苦于以下问题:Java SweetAlertDialog类的具体用法?Java SweetAlertDialog怎么用?Java SweetAlertDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SweetAlertDialog类属于cn.pedant.SweetAlert包,在下文中一共展示了SweetAlertDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: displayResult

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
private void displayResult(CalculateViewModel.CalculationResult result){
    if(result.didFail()){ //Show message if failed to calculate
        showToast(result.getMessage());
    }else{ //Display result
        new SweetAlertDialog(this, result.isApproved() ? SweetAlertDialog.SUCCESS_TYPE : SweetAlertDialog.WARNING_TYPE)
                .setTitleText(result.getTitle())
                .setContentText(result.getMessage())
                .setConfirmText(getString(R.string.text_accept))
                .show();

        //Notify event to analytics
        AnalyticsManager.eventCalculate(this,mCourse,result.getGrade());

    }

}
 
开发者ID:Bruno125,项目名称:Unofficial-Ups,代码行数:17,代码来源:CalculateActivity.java


示例2: prePayment

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
 * 提款
 */
@Click(R.id.btn_payment)
void prePayment() {
    String payee = tv_payee.getText().toString();
    String receive_bank = tv_receive_bank.getText().toString().trim();
    String bankAccount = tv_bankAccount.getText().toString().trim();
    String pay_amount = tv_pay_amount.getText().toString().trim();

    if (TextUtils.isEmpty(payee)) {
        ToastUtil.showToast(this, "请输入收款单位");
    } else if (TextUtils.isEmpty(receive_bank)) {
        ToastUtil.showToast(this, "请输入收款银行");
    } else if (TextUtils.isEmpty(bankAccount)) {
        ToastUtil.showToast(this, "请输入银行账号");
    } else if (TextUtils.isEmpty(pay_amount)) {
        ToastUtil.showToast(this, "请输入支付金额");
    } else if (Double.valueOf(pay_amount) > generalAccount) {
        ToastUtil.showToast(this, "支付金额超过普通账户余额");
    } else {
        pDialog = new SweetAlertDialog(T_PaymentActivity.this, SweetAlertDialog.PROGRESS_TYPE).setTitleText("正在提款...");
        pDialog.setCancelable(false);
        pDialog.show();
        payment(payee, receive_bank, bankAccount, pay_amount);
    }

}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:29,代码来源:T_PaymentActivity.java


示例3: clickNotice

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Click(R.id.btn_notice)
void clickNotice() {
    String receiptDate = tv_receiptDate.getText().toString().trim();
    String foreignName = tv_foreignName.getText().toString().trim();

    if (TextUtils.isEmpty(receiptDate)) {
        ToastUtil.showToast(this, "请选择付汇日期");
    } else if (TextUtils.isEmpty(receiptTypeValue)) {
        ToastUtil.showToast(this, "请选择付汇类型");
    } else if (TextUtils.isEmpty(foreignName)) {
        ToastUtil.showToast(this, "请选择外商");
    } else {
        String saleOrder = tv_saleOrder.getText().toString().trim();
        String receiptBank = et_receiptBank.getText().toString().trim();
        String currency = tv_currency.getText().toString().trim();
        String amount = et_amount.getText().toString().trim();
        String customerRemark = et_customerRemark.getText().toString().trim();

        pDialog = new SweetAlertDialog(T_NewNoticeForeignExchangeActivity.this, SweetAlertDialog.PROGRESS_TYPE).setTitleText("正在创建水单通知...");
        pDialog.setCancelable(false);
        pDialog.show();
        notice(receiptDate, foreignName, receiptTypeValue, saleOrder, receiptBank, currency, amount, customerRemark);
    }

}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:26,代码来源:T_NewNoticeForeignExchangeActivity.java


示例4: onPostExecute

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
protected void onPostExecute(String s)
{
    super.onPostExecute(s);
    if(ip==null)
    {
        new SweetAlertDialog(getActivity(), SweetAlertDialog.NORMAL_TYPE)
                .setTitleText("Your IP")
                .setContentText("Check your internet connection and try again")
                .show();
    }

    else
    {
        new SweetAlertDialog(getActivity(), SweetAlertDialog.NORMAL_TYPE)
                .setTitleText("Your IP")
                .setContentText("Your IP Address is : "+ip)
                .show();
    }
}
 
开发者ID:akashdeepsingh9988,项目名称:Cybernet-VPN,代码行数:21,代码来源:MenuListFragment.java


示例5: onClick

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
    if (piece==0){
        new SweetAlertDialog(getActivity(), SweetAlertDialog.ERROR_TYPE)
                .setTitleText("ADET")
                .setContentText("Lütfen seçmiş olduğunuz ürüne adet bilgisi giriniz.")
                .show();
    }else{
        ProductBasket productBasket = new ProductBasket(productID, piece);
        databaseReference.push().setValue(productBasket);
        new SweetAlertDialog(getActivity(), SweetAlertDialog.SUCCESS_TYPE)
                .setTitleText("EKLENDİ")
                .setContentText("Ürün sepete eklendi.")
                .show();
    }
    closeKeyword();
}
 
开发者ID:yusufcakal,项目名称:RestaurantApp,代码行数:18,代码来源:DetailPrıductFragment.java


示例6: onItemClick

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    //Intent ıntent = new Intent(this, DeskBasketActivity.class);
    Intent ıntent = new Intent(this, DeskOrdersActivity.class);
    ıntent.putExtra("orderId",deskListGlobal.get(position).getOrderId());
    String status = deskListGlobal.get(position).getStatus();
    if (status.equals("0")){
        new SweetAlertDialog(this)
                .setTitleText("Masa Boş")
                .show();
    }else if (status.equals("1")){
        startActivity(ıntent);
        overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
    }else if (status.equals("2")){
        new SweetAlertDialog(this)
                .setTitleText("Sipariş zaten onaylandı.")
                .show();
    }
}
 
开发者ID:yusufcakal,项目名称:RestaurantApp,代码行数:20,代码来源:StaffDeskActivity.java


示例7: showNote

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
private void showNote() {
    new SweetAlertDialog(AboutActivity.this, SweetAlertDialog.WARNING_TYPE)
            .setTitleText("免责声明")
            .setContentText(
                            "1.本app为非盈利开源项目,任何拷贝复制的相同项目与本app无关" +
                            "\n2.后台数据储存由Bmob云服务提供,作者承诺不会对后台用户数据进行任何操作" +
                            "\n3.任何加密技术都有被破解的可能性,由此造成的损失与本app及作者无关" +
                            "\n4.作为作者,建议用户自己申请Bmob云服务进行私人信息储存,相关教程请点击设置页面【修改签名】")
            .setConfirmText("好的我知道啦")
            .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sDialog) {
                    SPUtils.put("first_in", "第一次进入app");
                    sDialog.cancel();
                }
            })
            .show();

}
 
开发者ID:paradoxie,项目名称:DizzyPassword,代码行数:20,代码来源:AboutActivity.java


示例8: 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


示例9: confirmSend

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
 *
 */
public void confirmSend(final String address, final String amount, final String txFee) {

    new SweetAlertDialog(getBaseActivity(), SweetAlertDialog.NORMAL_TYPE)
            .setTitleText("Confirm Send?")
            .setContentText("You want to send " + amount + " (Estimated Fee: "+txFee+") \n to : " + address)
            .setConfirmText("Yes, Send!")
            .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sDialog) {
                    getBaseActivity().sendCoins(address, amount, CoinManagerFactory.BITCOIN);
                    sDialog.dismissWithAnimation();
                    getBaseActivity().showMenuSelection(0);
                }
            })
            .setCancelText("Cancel")
            .setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sweetAlertDialog) {
                    sweetAlertDialog.cancel();
                }
            })
            .show();
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:27,代码来源:SendFragment.java


示例10: clickReply

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
 * 点击了回复
 */
private void clickReply(final User replyUser, final Comment comment) {
    new SweetAlertDialog(this, SweetAlertDialog.EDIT_TYPE)
            .setTitleText("回复:" + replyUser.getNickname())
            .showConfirmButton(true)
            .showCancelButton(true)
            .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sweetAlertDialog) {
                    sweetAlertDialog.dismissWithAnimation();
                    if (!"".equals(sweetAlertDialog.getEditText())) {
                        presenter.addReply(replyUser, comment, sweetAlertDialog.getEditText());
                    }
                }
            })
            .show();
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:20,代码来源:ReadArticleActivity.java


示例11: uploadArticleSuccess

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
public void uploadArticleSuccess() {
    if (dialog != null && dialog.isShowing()) {
        dialog.setTitleText(getString(R.string.release_success));
        dialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
        dialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
            @Override
            public void onClick(SweetAlertDialog sweetAlertDialog) {
                dialog.dismissWithAnimation();
                finish();
            }
        });
    }
    ToastUtil.getInstance().showLongT(R.string.release_success);
    PreferenceData.clearPreference();
    mEditViewHolder.title.setText("");
    mEditViewHolder.content.setText("");
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:19,代码来源:EditorActivity.java


示例12: saveArticleSuccess

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
public void saveArticleSuccess() {
    if (dialog != null && dialog.isShowing()) {
        dialog.setTitleText(getString(R.string.save_success));
        dialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
        dialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
            @Override
            public void onClick(SweetAlertDialog sweetAlertDialog) {
                dialog.dismissWithAnimation();
                finish();
            }
        });
    }
    ToastUtil.getInstance().showLongT(R.string.save_success);

}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:17,代码来源:EditorActivity.java


示例13: editInfo

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
 * 编辑昵称/手机号
 */
private void editInfo(final int titleId) {
    new SweetAlertDialog(this, SweetAlertDialog.EDIT_TYPE)
            .setTitleText(getString(titleId))
            .showCancelButton(true)
            .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sweetAlertDialog) {
                    sweetAlertDialog.dismissWithAnimation();
                    switch (titleId) {
                        case R.string.edit_nickname:
                            presenter.requestChangeNickname(sweetAlertDialog.getEditText());
                            break;
                        case R.string.edit_phone_number:
                            presenter.requestChangePhone(sweetAlertDialog.getEditText());
                            break;
                        case R.string.edit_email:
                            presenter.requestChangeEmail(sweetAlertDialog.getEditText());
                            break;
                    }
                }
            })
            .show();
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:27,代码来源:EditUserInfoActivity.java


示例14: changeAlertType

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@ReactMethod
public void changeAlertType(String alertType) {
  switch (alertType) {
    case "normal":
      sweetAlertDialog.changeAlertType(SweetAlertDialog.NORMAL_TYPE);
      break;
    case "error":
      sweetAlertDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
      break;
    case "success":
      sweetAlertDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
      break;
    case "warning":
      sweetAlertDialog.changeAlertType(SweetAlertDialog.WARNING_TYPE);
      break;
    case "progress":
      sweetAlertDialog.changeAlertType(SweetAlertDialog.PROGRESS_TYPE);
      break;
    default:
      sweetAlertDialog.changeAlertType(SweetAlertDialog.NORMAL_TYPE);
      break;
  }
}
 
开发者ID:Clip-sub,项目名称:react-native-sweet-alert,代码行数:24,代码来源:RNSweetAlertModule.java


示例15: 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


示例16: downloadCompleted

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
public void downloadCompleted(Boolean sucess, CharSequence errorMsg) {
    if (updateProgressDialog != null
            && updateProgressDialog.isShowing()) {
        updateProgressDialog.dismiss();
    }
    if (sucess) {
        update();
    } else {
        new SweetAlertDialog(mContext, SweetAlertDialog.NORMAL_TYPE)
                .setTitleText(mContext.getString(R.string.dialog_error_title))
                .setContentText(mContext.getString(R.string.dialog_downfailed_msg))
                .setConfirmText(mContext.getString(R.string.dialog_downfailed_btnnext))
                .setCancelText(mContext.getString(R.string.dialog_update_btnnext))
                .setConfirmClickListener((dialog) -> downloadPackage())
                .show();
    }
}
 
开发者ID:Lazyeraser,项目名称:DereHelper,代码行数:18,代码来源:UpdateManager.java


示例17: onLogging

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
     * 是否正在登录中
     * @param isLogging
     */
    private void onLogging(boolean isLogging) {
        if (isLogging) {
            btnLogin.setClickable(false);
            btnLogin.setTextColor(getResources().getColor(R.color.btn_long_normal));
            showDialog();
//            btnLogin.setVisibility(View.GONE);
//            googleProgressBar.setVisibility(View.VISIBLE);
        } else {
            btnLogin.postDelayed(new Runnable() {
                @Override
                public void run() {
//                    googleProgressBar.setVisibility(View.GONE);
//                    btnLogin.setVisibility(View.VISIBLE);
                    btnLogin.setClickable(true);
                    btnLogin.setTextColor(getResources().getColor(R.color.btn_login_press));
                    dialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
                    dialog.dismissWithAnimation();
                }
            }, 1000);
        }
    }
 
开发者ID:xujiaji,项目名称:HaiNaBaiChuan,代码行数:26,代码来源:LoginFragment.java


示例18: editInfo

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
/**
 * 编辑昵称/手机号
 */
private void editInfo(final int titleId) {
    new SweetAlertDialog(getActivity(), SweetAlertDialog.EDIT_TYPE)
            .setTitleText(getString(titleId))
            .showCancelButton(true)
            .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                @Override
                public void onClick(SweetAlertDialog sweetAlertDialog) {
                    sweetAlertDialog.dismissWithAnimation();
                    switch (titleId) {
                        case R.string.edit_nickname:
                            presenter.requestChangeNickname(sweetAlertDialog.getEditText());
                            break;
                        case R.string.edit_phone_number:
                            presenter.requestChangePhone(sweetAlertDialog.getEditText());
                            break;
                        case R.string.edit_email:
                            presenter.requestChangeEmail(sweetAlertDialog.getEditText());
                            break;
                    }
                }
            })
            .show();
}
 
开发者ID:xujiaji,项目名称:HaiNaBaiChuan,代码行数:27,代码来源:EditUserInfoFragment.java


示例19: uploadArticleSuccess

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
public void uploadArticleSuccess() {
    if (dialog != null && dialog.isShowing()) {
        dialog.setTitleText(getString(R.string.release_success));
        dialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
        dialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
            @Override
            public void onClick(SweetAlertDialog sweetAlertDialog) {
                dialog.dismissWithAnimation();
                MainActivity.clickBack();
            }
        });
    }
    ToastUtil.getInstance().showLongT(R.string.release_success);
    PreferenceData.clearPreference();
    mEditViewHolder.title.setText("");
    mEditViewHolder.content.setText("");
}
 
开发者ID:xujiaji,项目名称:HaiNaBaiChuan,代码行数:19,代码来源:EditorFragment.java


示例20: onCreate

import cn.pedant.SweetAlert.SweetAlertDialog; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_data_viewer);
    Bundle bundle = getIntent().getExtras();
    mDBController = new DBMetadataCollector();
    mDBController.setActiveTable(bundle.getInt(DBViewer.TABLE_NUM, 0));
    ScrollTableView scrollTableView = (ScrollTableView) findViewById(R.id.scroll_table_view);
    scrollTableView.setListener(this);
    va = new ViewAdapter(mDBController.getActiveTable(), scrollTableView);
    if (va.isNotEmpty()) {
        va.createView();
    } else {
        alertWithButton("Notice", "Empty table!", this,
                new SweetAlertDialog.OnSweetClickListener() {
                    @Override
                    public void onClick(SweetAlertDialog sweetAlertDialog) {
                        DataViewerActivity.this.finish();
                    }
                });
    }
}
 
开发者ID:ProgComRapadura,项目名称:RebDroid,代码行数:23,代码来源:DataViewerActivity.java



注:本文中的cn.pedant.SweetAlert.SweetAlertDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Logger类代码示例发布时间:2022-05-21
下一篇:
Java DocumentResult类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap