diff --git a/common/src/main/java/com/yunbao/common/adapter/SudTitleSelectAdapter.java b/common/src/main/java/com/yunbao/common/adapter/SudTitleSelectAdapter.java index 82bf6df02..b51026f63 100644 --- a/common/src/main/java/com/yunbao/common/adapter/SudTitleSelectAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/SudTitleSelectAdapter.java @@ -45,7 +45,6 @@ public class SudTitleSelectAdapter extends RecyclerView.Adapter { } } }); - } @Override diff --git a/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java new file mode 100644 index 000000000..cf707a69f --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java @@ -0,0 +1,57 @@ +package com.yunbao.common.dialog; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.text.TextUtils; +import android.view.View; +import android.widget.TextView; + +import com.yunbao.common.R; +import com.yunbao.common.utils.DialogUitl; + +public class GuardBuyTipsDialog { + + /** + * + * @param context + * @param coin 钻石 + * @param content 购买类型名称 + * @param simpleCallback + */ + public static void showBuyOrRenewDialog(Context context, String coin, String content, DialogUitl.SimpleCallback simpleCallback) { + if (context instanceof Activity) { + if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { + return; + } + } + + final Dialog dialog = new Dialog(context, R.style.dialog2); + dialog.setContentView(R.layout.dialog_guard_buy_tips); + dialog.setCancelable(true); + dialog.setCanceledOnTouchOutside(true); + if (!TextUtils.isEmpty(coin)) { + TextView contentTextView = dialog.findViewById(R.id.content); + contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin)); + } + if (!TextUtils.isEmpty(content)) { + TextView buyTypeTextView = dialog.findViewById(R.id.buyType); + buyTypeTextView.setText(content); + } + dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dialog.dismiss(); + } + }); + dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + simpleCallback.onConfirmClick(dialog, ""); + dialog.dismiss(); + } + }); + dialog.show(); + } + +} diff --git a/common/src/main/res/drawable/guard_buy_tips_bg.xml b/common/src/main/res/drawable/guard_buy_tips_bg.xml new file mode 100644 index 000000000..66300b845 --- /dev/null +++ b/common/src/main/res/drawable/guard_buy_tips_bg.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/common/src/main/res/drawable/guard_buy_tips_sure_bg.xml b/common/src/main/res/drawable/guard_buy_tips_sure_bg.xml new file mode 100644 index 000000000..bafb39e8f --- /dev/null +++ b/common/src/main/res/drawable/guard_buy_tips_sure_bg.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/common/src/main/res/layout/dialog_guard_buy_tips.xml b/common/src/main/res/layout/dialog_guard_buy_tips.xml new file mode 100644 index 000000000..e8c8ac40b --- /dev/null +++ b/common/src/main/res/layout/dialog_guard_buy_tips.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + +