From a353e51ba81c511d7ac076c0efbe0bdff0bfe357 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 25 Jul 2023 15:25:01 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E6=A0=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/LiveGiftBean.java | 24 ++++++++++++++ .../res/layout/dialog_live_gift_popup.xml | 18 ++++++++++- common/src/main/res/values-en-rUS/string.xml | 4 +++ common/src/main/res/values-zh-rHK/strings.xml | 4 +++ common/src/main/res/values-zh-rTW/strings.xml | 4 +++ common/src/main/res/values-zh/strings.xml | 4 +++ common/src/main/res/values/strings.xml | 8 ++--- .../java/com/yunbao/live/bean/CoinModel.java | 18 +++++++++++ .../com/yunbao/live/dialog/LiveGiftPopup.java | 32 ++++++++++++++++++- 9 files changed, 110 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java index 78583150b..16f974b1d 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java @@ -43,6 +43,30 @@ public class LiveGiftBean { @JSONField(name = "gift_description") private String giftDescription; + @JSONField(name = "operate_image") + private String operateImage; + + @JSONField(name = "operate_url") + private String operateUrl; + + public String getOperateImage() { + return operateImage; + } + + public LiveGiftBean setOperateImage(String operateImage) { + this.operateImage = operateImage; + return this; + } + + public String getOperateUrl() { + return operateUrl; + } + + public LiveGiftBean setOperateUrl(String operateUrl) { + this.operateUrl = operateUrl; + return this; + } + public String getGiftDescription() { return giftDescription; } diff --git a/common/src/main/res/layout/dialog_live_gift_popup.xml b/common/src/main/res/layout/dialog_live_gift_popup.xml index 63afb262c..81361b32b 100644 --- a/common/src/main/res/layout/dialog_live_gift_popup.xml +++ b/common/src/main/res/layout/dialog_live_gift_popup.xml @@ -6,6 +6,11 @@ android:layout_gravity="bottom" android:orientation="vertical"> + + + + + + + diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 73e2c8718..26fdf25f2 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1249,6 +1249,10 @@ Limited ride And limited avatar frame %s drew %s in the lucky red envelope number Red successfully + %s experience upgrade,%s receive rewards + You have reached the highest level! + There\\\'s nothing in the package yet + Custom quantity diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 1c2e77cb7..08a2d1069 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1244,4 +1244,8 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 6d306b272..b19b12c49 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1243,4 +1243,8 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 94d89a69d..535ce85c2 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1244,6 +1244,10 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 898591650..cff72ab76 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1250,8 +1250,8 @@ Limited ride And limited avatar frame %s drew %s in the lucky red envelope number >Red successfully - 升級還需%s經驗值,升至%s即可領取獎勵 - 包裹中暫無物品哦 - 恭喜,你已達到最高等級 - 自定義數量 + %s experience upgrade,%s receive rewards + There\\\'s nothing in the package yet + You have reached the highest level! + Custom quantity diff --git a/live/src/main/java/com/yunbao/live/bean/CoinModel.java b/live/src/main/java/com/yunbao/live/bean/CoinModel.java index f80a61da8..738f09161 100644 --- a/live/src/main/java/com/yunbao/live/bean/CoinModel.java +++ b/live/src/main/java/com/yunbao/live/bean/CoinModel.java @@ -33,6 +33,15 @@ public class CoinModel extends BaseModel { private String usersPackRedDot; public String getCoin() { + long coinMoney = Long.parseLong(coin); + if (999999999 < coinMoney && coinMoney <= 999999999999L) { + coin = coin.substring(0, coin.length() - 2); + coin = coin + "k"; + } + if (999999999999L < coinMoney && coinMoney <= 999999999999999L) { + coin = coin.substring(0, coin.length() - 2); + coin = coin + "M"; + } return coin; } @@ -42,6 +51,15 @@ public class CoinModel extends BaseModel { } public String getGold() { + long goldMoney = Long.parseLong(gold); + if (999999999 < goldMoney && goldMoney <= 999999999999L) { + gold = gold.substring(0, gold.length() - 2); + gold = gold + "k"; + } + if (999999999999L < goldMoney && goldMoney <= 999999999999999L) { + gold = gold.substring(0, gold.length() - 2); + gold = gold + "M"; + } return gold; } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index aa1a30b53..4e09bb882 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -93,7 +93,7 @@ import java.util.List; * 直播间新送礼弹窗 */ public class LiveGiftPopup extends AbsDialogFragment { - private ImageView gitBackground, nobilityIcon, description, iconArrow; + private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage; private JSONArray liveGiftList; private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber; private RecyclerView giftTitle; @@ -118,6 +118,7 @@ public class LiveGiftPopup extends AbsDialogFragment { private MarqueeTextView giftDescription; private boolean isPk; + @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); @@ -167,6 +168,7 @@ public class LiveGiftPopup extends AbsDialogFragment { description = mRootView.findViewById(R.id.description); lvStr = mRootView.findViewById(R.id.lv_str); iconArrow = mRootView.findViewById(R.id.icon_arrow); + operateImage = mRootView.findViewById(R.id.operate_image); leaveHint = mRootView.findViewById(R.id.leave_hint); progressBar = mRootView.findViewById(R.id.progressBar); levelingLayout = mRootView.findViewById(R.id.leveling_layout); @@ -184,6 +186,7 @@ public class LiveGiftPopup extends AbsDialogFragment { liveGiftSend.setEnabled(false); giftNumberLayout.setVisibility(View.INVISIBLE); giftDescription.setVisibility(View.GONE); + operateImage.setVisibility(View.GONE); levelingLayout.setVisibility(View.VISIBLE); //点击包裹 ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() { @@ -282,6 +285,27 @@ public class LiveGiftPopup extends AbsDialogFragment { ImgLoader.display(getContext(), R.mipmap.icon_arrow_down, iconArrow); } }); + /** + * 礼物图片运营位跳转 + */ + ViewClicksAntiShake.clicksAntiShake(operateImage, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(CommonAppConfig.HOST) + .append(liveGiftModel.getOperateUrl()) + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&for"); + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); } private void initDate() { @@ -421,6 +445,8 @@ public class LiveGiftPopup extends AbsDialogFragment { lvStr.setText("Lv." + coinModel.getUserLevel()); int nextLeve = Integer.parseInt(coinModel.getUserLevel()); int maxLeve = Integer.parseInt(coinModel.getUserLevelMax()); + findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) && + TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE); if (maxLeve > nextLeve) { String leveNext = String.valueOf(nextLeve + 1); String userNextLevel = coinModel.getUserNextLevelRewards(); @@ -646,6 +672,10 @@ public class LiveGiftPopup extends AbsDialogFragment { giftDescription.setVisibility(View.VISIBLE); levelingLayout.setVisibility(View.GONE); } + if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) { + operateImage.setVisibility(View.VISIBLE); + ImgLoader.display(getContext(), liveGiftModel.getOperateUrl(), operateImage); + } } @Subscribe(threadMode = ThreadMode.MAIN)