From e18a0d7c6577e87fd09a30d6c50c285cd208ee20 Mon Sep 17 00:00:00 2001 From: huangjian Date: Tue, 31 May 2022 18:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=AE=B1=E5=85=81=E8=AE=B8=E4=B8=AD?= =?UTF-8?q?=E5=A5=96=E6=B6=88=E6=81=AF=E5=BC=80=E5=85=B3=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erban/avroom/widget/MessageView.java | 5 +++++ .../widget/dialog/BoxMoreDialog.java | 17 +++++++++-------- .../res/layout/dialog_box_more.xml | 1 - 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/yizhuan/erban/avroom/widget/MessageView.java b/app/src/main/java/com/yizhuan/erban/avroom/widget/MessageView.java index 236708719..69448e2cb 100644 --- a/app/src/main/java/com/yizhuan/erban/avroom/widget/MessageView.java +++ b/app/src/main/java/com/yizhuan/erban/avroom/widget/MessageView.java @@ -1,6 +1,8 @@ package com.yizhuan.erban.avroom.widget; +import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_BOX; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE; +import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_BOX_ME; import static com.yizhuan.xchat_android_core.redpackage.RedPackageTypeKt.ALL_DIAMOND; import static com.yizhuan.xchat_android_core.redpackage.RedPackageTypeKt.ALL_GIFT; import static com.yizhuan.xchat_android_core.redpackage.RedPackageTypeKt.ROOM_DIAMOND; @@ -1631,6 +1633,9 @@ public class MessageView extends FrameLayout { if (attachment.getPrizeNum() > 1) { text.append(" x" + attachment.getPrizeNum() + " ", new ForegroundColorSpan(roomTipColor)); } + if (attachment.getSecond() == CUSTOM_MSG_SUB_BOX_ME) { + text.append("仅自己可见", new ForegroundColorSpan(Color.WHITE)); + } tvContent.setText(text.build()); } diff --git a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/BoxMoreDialog.java b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/BoxMoreDialog.java index b65692733..bf10b0d2a 100644 --- a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/BoxMoreDialog.java +++ b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/BoxMoreDialog.java @@ -53,18 +53,19 @@ public class BoxMoreDialog extends BaseBindingDialog { closeDialog(); }); - if (sendMessageSwitchLevel != 0 && UserUtils.getExpLevel() >= sendMessageSwitchLevel) { - binding.flMsgSwitch.setVisibility(View.VISIBLE); - updateMsgSwitch(DemoCache.readNeedBoxMsg()); - binding.ivSwitch.setOnClickListener(v -> { + boolean canSwitch = sendMessageSwitchLevel != 0 && UserUtils.getExpLevel() >= sendMessageSwitchLevel; + + updateMsgSwitch(canSwitch && DemoCache.readNeedBoxMsg()); + binding.ivSwitch.setOnClickListener(v -> { + if (canSwitch) { boolean sendMsg = !DemoCache.readNeedBoxMsg(); updateMsgSwitch(sendMsg); DemoCache.saveNeedBoxMsg(sendMsg); SingleToastUtil.showToast("设置成功!"); - }); - } else { - binding.flMsgSwitch.setVisibility(View.GONE); - } + } else { + SingleToastUtil.showToast("财富值达到" + sendMessageSwitchLevel + "级可用,快去升级吧!"); + } + }); } private void updateMsgSwitch(boolean sendMsg) { diff --git a/app/src/module_treasure_box/res/layout/dialog_box_more.xml b/app/src/module_treasure_box/res/layout/dialog_box_more.xml index f20bd83f3..c1f38b9d3 100644 --- a/app/src/module_treasure_box/res/layout/dialog_box_more.xml +++ b/app/src/module_treasure_box/res/layout/dialog_box_more.xml @@ -60,7 +60,6 @@