From 4fabf3aba3f66104db267e8e6017719a1c0ab0b1 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 20 Mar 2024 13:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/DragonSendMoneyListAdapter.java | 8 +- .../common/dialog/GuardBuyTipsDialog.java | 64 ++++++++++++---- .../common/http/live/LiveNetManager.java | 11 ++- .../views/DragonSendMoneyListViewHolder.java | 2 +- .../main/res/layout/dialog_guard_buy_tips.xml | 51 ++++++++++--- .../src/main/res/layout/dragon_rule_popup.xml | 2 +- common/src/main/res/values-en-rUS/string.xml | 2 + common/src/main/res/values-zh-rHK/strings.xml | 2 + common/src/main/res/values-zh-rTW/strings.xml | 2 + common/src/main/res/values-zh/strings.xml | 2 + common/src/main/res/values/strings.xml | 2 + .../yunbao/live/dialog/DragonExpirePopup.java | 18 ++++- .../live/dialog/DragonSendMoneyListPopup.java | 75 ++++++++++++------- .../live/dialog/DragonSendsMoneyPopup.java | 27 ++++--- .../live/dialog/LiveBuyGuardDialog.java | 23 +++++- .../yunbao/live/dialog/LiveGuardDialog.java | 20 ++++- .../yunbao/live/views/LiveRoomViewHolder.java | 6 +- .../src/main/res/layout/dialog_live_guard.xml | 3 +- 18 files changed, 238 insertions(+), 82 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java b/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java index b51d454d3..fd0eddc56 100644 --- a/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java @@ -20,12 +20,18 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter { RecyclerView send_money_list; boolean isAnchor; SparseArray countDownMap; + boolean isAttention; public DragonSendMoneyListAdapter setAnchor(boolean anchor) { isAnchor = anchor; return this; } + public DragonSendMoneyListAdapter setAttention(boolean attention) { + isAttention = attention; + return this; + } + public List getMoneyLongListModels() { return moneyLongListModels; } @@ -70,7 +76,7 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter { // if (time > 0) { // // } - sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor); + sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor,isAttention); } diff --git a/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java index 4db488c31..2f1e3a7f7 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsDialog.java @@ -5,21 +5,25 @@ import android.app.Dialog; import android.content.Context; import android.text.TextUtils; import android.view.View; +import android.widget.Button; import android.widget.TextView; import com.yunbao.common.R; +import com.yunbao.common.bean.GuardGetGuardUserInfoModel; import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.WordUtil; public class GuardBuyTipsDialog { /** - * * @param context - * @param coin 钻石 - * @param content 购买类型名称 + * @param coin 钻石 + * @param content 购买类型名称 * @param simpleCallback */ - public static void showBuyOrRenewDialog(Context context, String coin, String content, boolean isOpen,DialogUitl.SimpleCallback simpleCallback) { + public static void showBuyOrRenewDialog(Context context, String coin, String content, + boolean isOpen, GuardGetGuardUserInfoModel mGuardUserInfoModel, int guardType, + DialogUitl.SimpleCallback simpleCallback) { if (context instanceof Activity) { if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { return; @@ -30,25 +34,49 @@ public class GuardBuyTipsDialog { dialog.setContentView(R.layout.dialog_guard_buy_tips); dialog.setCancelable(true); dialog.setCanceledOnTouchOutside(true); - if (!isOpen){ + Button btn_confirm = dialog.findViewById(R.id.btn_confirm); + TextView content1 = dialog.findViewById(R.id.content1); + TextView content2 = dialog.findViewById(R.id.content2); + TextView contentTextView = dialog.findViewById(R.id.content); + TextView buyTypeTextView = dialog.findViewById(R.id.buyType); + content1.setVisibility(View.VISIBLE); + contentTextView.setVisibility(View.VISIBLE); + buyTypeTextView.setVisibility(View.VISIBLE); + content2.setVisibility(View.GONE); + if (!isOpen) { 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+"】"); + buyTypeTextView.setText("【" + content + "】"); } - }else { + } else { if (!TextUtils.isEmpty(coin)) { - TextView contentTextView = dialog.findViewById(R.id.content); contentTextView.setText(context.getString(R.string.guard_buy_tips_2, coin)); } if (!TextUtils.isEmpty(content)) { - TextView buyTypeTextView = dialog.findViewById(R.id.buyType); - buyTypeTextView.setText("【"+content+"】"); + buyTypeTextView.setText("【" + content + "】"); } } + if (mGuardUserInfoModel != null) { + if (mGuardUserInfoModel.getGuardType() != 0) { + if (guardType < mGuardUserInfoModel.getGuardType()) { + content1.setVisibility(View.GONE); + contentTextView.setVisibility(View.GONE); + buyTypeTextView.setVisibility(View.GONE); + content2.setVisibility(View.VISIBLE); + + } else if (guardType==mGuardUserInfoModel.getGuardType()){ + content1.setVisibility(View.GONE); + }else { + content1.setVisibility(View.VISIBLE); + } + } else { + content1.setVisibility(View.GONE); + } + } else { + content1.setVisibility(View.GONE); + } dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() { @Override @@ -56,11 +84,17 @@ public class GuardBuyTipsDialog { dialog.dismiss(); } }); - dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() { + btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm"); + btn_confirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - simpleCallback.onConfirmClick(dialog, ""); - dialog.dismiss(); + if (content2.getVisibility()==View.VISIBLE){ + dialog.dismiss(); + }else { + simpleCallback.onConfirmClick(dialog, ""); + dialog.dismiss(); + } + } }); dialog.show(); diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 4c7420f1e..2da882d1f 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -2993,7 +2993,12 @@ public class LiveNetManager { @Override public void accept(ResponseModel stringResponseModel) throws Exception { if (callback != null) { - callback.onSuccess(stringResponseModel.getData().getMsg()); + if (stringResponseModel.getData().getCode() == 0) { + callback.onSuccess(stringResponseModel.getData().getMsg()); + } else { + callback.onError(stringResponseModel.getData().getMsg()); + } + } } }, new Consumer() { @@ -3129,9 +3134,9 @@ public class LiveNetManager { } - public void guardGetRewards( String liveUid,HttpCallback callback) { + public void guardGetRewards(String liveUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .guardGetRewards("2",liveUid) + .guardGetRewards("2", liveUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { diff --git a/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java b/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java index 0c714056d..ca5f0d7d8 100644 --- a/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java @@ -39,7 +39,7 @@ public class DragonSendMoneyListViewHolder extends RecyclerView.ViewHolder { send_benefits = itemView.findViewById(R.id.send_benefits); } - public void setData(sendMoneyLongListModel model, DragonSendMoneyListClicksCallBack callBack,boolean isAnchor) { + public void setData(sendMoneyLongListModel model, DragonSendMoneyListClicksCallBack callBack,boolean isAnchor, boolean isAttention) { ImgLoader.display(itemView.getContext(), model.getUserAvatar(), live_avatar); user_nicename.setText(String.valueOf(model.getUserNicename())); gold_num.setText(String.valueOf(model.getGoldNum())); diff --git a/common/src/main/res/layout/dialog_guard_buy_tips.xml b/common/src/main/res/layout/dialog_guard_buy_tips.xml index fd56edb3d..7f6c3be40 100644 --- a/common/src/main/res/layout/dialog_guard_buy_tips.xml +++ b/common/src/main/res/layout/dialog_guard_buy_tips.xml @@ -1,14 +1,14 @@ + android:textSize="14dp" + android:visibility="invisible" /> + android:textStyle="italic|bold" + android:visibility="invisible" /> + + +