小菜单的展开

This commit is contained in:
18401019693 2022-11-11 11:38:46 +08:00
parent 9dcc23960e
commit 7fe7178b27
5 changed files with 115 additions and 3 deletions

View File

@ -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;

View File

@ -127,6 +127,8 @@ public class CustomDrawerPopupView extends DrawerPopupView {
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
}
});
@ -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) {
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()) {

View File

@ -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));
}
});
}
}

View File

@ -13,6 +13,7 @@
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/system_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
@ -34,6 +35,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
@ -55,6 +57,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/report_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"

View File

@ -787,6 +787,28 @@ public class LiveAudienceActivity extends LiveActivity {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.FLOAT_SETTING));
}
@Override
public void systemNotice() {
Bus.get().post(new LiveAudienceEvent()
.setBean(mLiveBean)
.setType(LiveAudienceEvent.LiveAudienceType.NOTICE));
}
@Override
public void online() {
Bus.get().post(new LiveAudienceEvent()
.setBean(mLiveBean)
.setType(LiveAudienceEvent.LiveAudienceType.ONLINE));
}
@Override
public void reportLayout() {
Bus.get().post(new LiveAudienceEvent()
.setBean(mLiveBean)
.setType(LiveAudienceEvent.LiveAudienceType.REPORT));
}
});
new XPopup.Builder(mContext)
.hasShadowBg(false)