优化PK排位赛固定高度

This commit is contained in:
zlzw 2022-12-01 17:29:01 +08:00
parent 72f7e00dd5
commit 1eff58aca1
2 changed files with 6 additions and 2 deletions

View File

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

View File

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