|
@@ -54,6 +54,7 @@ public class ScHtmlFragment extends BaseFragment<FgScHomeWebBinding> implements
|
|
|
private boolean isNeedRefresh = false;
|
|
|
private boolean isLoadError = false;
|
|
|
private boolean isLoadCompleted = false;
|
|
|
+ private boolean isReceiveHeight = false;
|
|
|
|
|
|
@Override
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
@@ -342,6 +343,7 @@ public class ScHtmlFragment extends BaseFragment<FgScHomeWebBinding> implements
|
|
|
if (isDetached()) {
|
|
|
return;
|
|
|
}
|
|
|
+ isReceiveHeight = true;
|
|
|
//为了规避H5页面的错误状态页比如404页面显示在了首页,所以这里在收到相应回调后更高布局样式
|
|
|
changeWebViewParentHeight(height);
|
|
|
showWebView();
|
|
@@ -351,11 +353,17 @@ public class ScHtmlFragment extends BaseFragment<FgScHomeWebBinding> implements
|
|
|
if (mViewBinding != null) {
|
|
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mViewBinding.viewParent.getLayoutParams();
|
|
|
layoutParams.height = SizeUtils.dp2px(height);
|
|
|
- layoutParams.topMargin =SizeUtils.dp2px(12);
|
|
|
+ layoutParams.topMargin = SizeUtils.dp2px(12);
|
|
|
mViewBinding.viewParent.setLayoutParams(layoutParams);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void checkReload() {
|
|
|
+ if (!isReceiveHeight) {
|
|
|
+ reloadWeb();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private class WebClient extends HttpsServerCertWebViewClient {
|
|
|
//页面开始载入时调用
|
|
|
|