修改侧边栏跳转问题

This commit is contained in:
18401019693 2023-04-14 16:09:02 +08:00
parent 90c7483dbc
commit 32e3584fef
4 changed files with 33 additions and 14 deletions

View File

@ -493,6 +493,7 @@ public class JavascriptInterfaceUtils {
/**
* 设置webView高度
*
* @param useDp 是否用dp换算
*/
@JavascriptInterface
@ -515,6 +516,7 @@ public class JavascriptInterfaceUtils {
/**
* 社区分享
*
* @param avatar 头像
* @param link 分享连接
*/
@ -527,10 +529,17 @@ public class JavascriptInterfaceUtils {
.setMethod("androidCommunityShare")
.setData(json.toJSONString()));
}
@JavascriptInterface
public void androidInviteShare(String url) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidInviteShare")
.setData(url));
}
@JavascriptInterface
public void closeLiveRoom() {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("closeLiveRoom"));
}
}

View File

@ -58,6 +58,7 @@ import com.yunbao.common.dialog.SlideSettingsDialog;
import com.yunbao.common.dialog.YoursystemisolderDialog;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
@ -752,6 +753,15 @@ public class LiveAudienceActivity extends LiveActivity {
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
if (!TextUtils.isEmpty(event.getMethod())) {
if (TextUtils.equals(event.getMethod(), "closeLiveRoom")) {
onBackPressed();
}
}
}
/**
* 跳转页面或者弹窗展示
*

View File

@ -338,7 +338,8 @@ public class LiveAudienceEvent extends BaseModel {
LIVE_PK_ING(59, "PK中"),
LIVE_PK_END(60, "PK结束"),
XYD_COMPLETE(62, "心愿单完成"),
WISH_LIST_PROGRESS(61, "心愿单进度");
WISH_LIST_PROGRESS(61, "心愿单进度"),
CLOSE_LIVE_ROOM(62, "关闭直播间");
private int type;
private String name;

View File

@ -1939,7 +1939,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
flipper.startFlipping();
flipper.setOnClickListener(view -> {
ToastUtil.show(String.valueOf(flipper.getDisplayedChild()));
Bundle bundle = new Bundle();
String path = model.getHourchartH5Url();
if (!path.startsWith("/")) {