From 1eff58aca14eba4997ccec7a30d26e31fea8005f Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 1 Dec 2022 17:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96PK=E6=8E=92=E4=BD=8D=E8=B5=9B?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/dialog/LiveHDDialogFragment.java | 6 +++++- .../main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index e654fa9ce..fe8dcf21a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -60,6 +60,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { private String roomId; private DialogInterface.OnShowListener listener; private TextView htmlError; + private boolean isSetHeight =false; public LiveHDDialogFragment() { @@ -173,6 +174,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { findViewById(R.id.title_laout).setVisibility(View.VISIBLE); } if (bundle.getInt("height", -1) != -1) { + isSetHeight =true; LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1)); mWebView.setLayoutParams(params); } @@ -193,7 +195,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment { @Override public void onPageFinished(WebView view, String url) { - view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)"); + if(!isSetHeight) { + view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)"); + } if (listener != null) { listener.onShow(LiveHDDialogFragment.this.getDialog()); listener = null; diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index d357397c7..8a547e1c7 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1666,7 +1666,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; bundle.putString("url", url); - //bundle.putInt("height", DpUtil.dp2px(600)); + bundle.putInt("height",DpUtil.dp2px(500)); bundle.putInt("show_type", 0); bundle.putString("roomId", mLiveUid); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();