From 7fe7178b275c3c8078de2211d2b6acfe7fb39848 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 11 Nov 2022 11:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=8F=9C=E5=8D=95=E7=9A=84=E5=B1=95?= =?UTF-8?q?=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/event/CustomDrawerPopupEvent.java | 33 +++++++++++++++++++ .../common/views/CustomDrawerPopupView.java | 30 +++++++++++++++-- .../common/views/MoreMenuPopupView.java | 30 +++++++++++++++++ common/src/main/res/layout/view_more_menu.xml | 3 ++ .../live/activity/LiveAudienceActivity.java | 22 +++++++++++++ 5 files changed, 115 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java b/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java index 0eea98f33..0d383cd5e 100644 --- a/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java +++ b/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java @@ -13,6 +13,39 @@ public class CustomDrawerPopupEvent extends BaseModel { private String htmlUrl; //是否半屏展示 private boolean screen = false; + //系统消息 + private boolean systemNotice = false; + //在线客服 + private boolean online = false; + //举报 + private boolean reportLayout = false; + + public boolean isSystemNotice() { + return systemNotice; + } + + public CustomDrawerPopupEvent setSystemNotice(boolean systemNotice) { + this.systemNotice = systemNotice; + return this; + } + + public boolean isOnline() { + return online; + } + + public CustomDrawerPopupEvent setOnline(boolean online) { + this.online = online; + return this; + } + + public boolean isReportLayout() { + return reportLayout; + } + + public CustomDrawerPopupEvent setReportLayout(boolean reportLayout) { + this.reportLayout = reportLayout; + return this; + } public String getHtmlUrl() { return htmlUrl; diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index 0c93c300a..a9c09413c 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -127,6 +127,8 @@ public class CustomDrawerPopupView extends DrawerPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + dismiss(); + } }); @@ -134,7 +136,7 @@ public class CustomDrawerPopupView extends DrawerPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu)); + XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu)); builder.hasShadowBg(false) .isDestroyOnDismiss(true) .isLightStatusBar(false) @@ -185,16 +187,38 @@ public class CustomDrawerPopupView extends DrawerPopupView { void slideSetting(); void floatSetting(); + + void systemNotice(); + + void online(); + + void reportLayout(); } @Subscribe(threadMode = ThreadMode.MAIN) public void OnCustomDrawerPopupEvent(CustomDrawerPopupEvent event) { if (callBack != null) { - callBack.informationTransfer(event); - callBack.funGamesID(event.getActivityId()); + if (!TextUtils.isEmpty(event.getRightsInterests())) { + callBack.informationTransfer(event); + } + if (event.getActivityId() != 0) { + callBack.funGamesID(event.getActivityId()); + } if (!TextUtils.isEmpty(event.getHtmlUrl())) { callBack.showerHtml(event.getHtmlUrl(), event.isScreen()); } + if (event.isSystemNotice()) { + dismiss(); + callBack.systemNotice(); + } + if (event.isOnline()) { + dismiss(); + callBack.online(); + } + if (event.isReportLayout()) { + dismiss(); + callBack.reportLayout(); + } } //是否关闭弹窗 if (event.isDisMiss()) { diff --git a/common/src/main/java/com/yunbao/common/views/MoreMenuPopupView.java b/common/src/main/java/com/yunbao/common/views/MoreMenuPopupView.java index 87f9a0449..a60ff4b59 100644 --- a/common/src/main/java/com/yunbao/common/views/MoreMenuPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/MoreMenuPopupView.java @@ -6,6 +6,9 @@ import androidx.annotation.NonNull; import com.lxj.xpopup.core.AttachPopupView; import com.yunbao.common.R; +import com.yunbao.common.event.CustomDrawerPopupEvent; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; public class MoreMenuPopupView extends AttachPopupView { public MoreMenuPopupView(@NonNull Context context) { @@ -19,6 +22,33 @@ public class MoreMenuPopupView extends AttachPopupView { @Override protected void onCreate() { + //系统通知 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + Bus.get().post(new CustomDrawerPopupEvent() + .setDisMiss(true).setSystemNotice(true)); + } + }); + //在线客服 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + Bus.get().post(new CustomDrawerPopupEvent() + .setDisMiss(true).setOnline(true)); + } + }); + //举报 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.report_layout), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + Bus.get().post(new CustomDrawerPopupEvent() + .setDisMiss(true).setReportLayout(true)); + } + }); } } diff --git a/common/src/main/res/layout/view_more_menu.xml b/common/src/main/res/layout/view_more_menu.xml index d14a11dd9..18c3290d9 100644 --- a/common/src/main/res/layout/view_more_menu.xml +++ b/common/src/main/res/layout/view_more_menu.xml @@ -13,6 +13,7 @@ android:gravity="center_vertical">