|
@@ -160,7 +160,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
LinearLayout ll_activity_html;
|
|
|
private String mImageBase64;
|
|
|
private boolean isNeedResetScreenOrientation = true;
|
|
|
-
|
|
|
+ private boolean isResetOrientation = false;
|
|
|
private DownloadHelper.OnEventListener mEventListener;
|
|
|
|
|
|
@Override
|
|
@@ -248,7 +248,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
setStatusBarTextColor(intent.getBooleanExtra("statusBarTextColor", false));
|
|
|
if (isHideTitle) {
|
|
|
headerBbarView.setVisibility(View.GONE);
|
|
|
- viewStatusbar.setVisibility(View.VISIBLE);
|
|
|
+ viewStatusbar.setVisibility(View.GONE);
|
|
|
}
|
|
|
if (!TextUtils.isEmpty(titleStr)) {
|
|
|
tvTitle.setText(titleStr);
|
|
@@ -1195,20 +1195,18 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
callback.onCustomViewHidden();
|
|
|
return;
|
|
|
}
|
|
|
- LOG.i("w:"+view.getWidth());
|
|
|
- LOG.i("h:"+view.getHeight());
|
|
|
mCustomView = view;
|
|
|
mCustomView.setVisibility(View.VISIBLE);
|
|
|
mCustomViewCallback = callback;
|
|
|
- int appScreenHeight = ScreenUtils.getAppScreenHeight();
|
|
|
- int appScreenWidth = ScreenUtils.getAppScreenWidth();
|
|
|
- FrameLayout.LayoutParams layoutParams =new FrameLayout.LayoutParams(appScreenHeight,appScreenWidth);
|
|
|
- mLayout.addView(mCustomView,layoutParams);
|
|
|
+ mLayout.addView(mCustomView, getVideoLayoutParams());
|
|
|
mLayout.setVisibility(View.VISIBLE);
|
|
|
mLayout.bringToFront();
|
|
|
headerBbarView.setVisibility(View.GONE);
|
|
|
//设置横屏
|
|
|
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
|
|
+ if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
|
|
+ isResetOrientation = true;
|
|
|
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 取消全屏调用的方法
|
|
@@ -1228,11 +1226,26 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
|
|
|
}
|
|
|
headerBbarView.setVisibility(View.GONE);
|
|
|
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//竖屏
|
|
|
+ if (isResetOrientation) {
|
|
|
+ isResetOrientation = false;
|
|
|
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//竖屏
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private FrameLayout.LayoutParams getVideoLayoutParams() {
|
|
|
+ int appScreenHeight = ScreenUtils.getAppScreenHeight();
|
|
|
+ int appScreenWidth = ScreenUtils.getAppScreenWidth();
|
|
|
+ FrameLayout.LayoutParams layoutParams;
|
|
|
+ if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
|
|
+ layoutParams = new FrameLayout.LayoutParams(appScreenWidth, appScreenHeight);
|
|
|
+ } else {
|
|
|
+ layoutParams = new FrameLayout.LayoutParams(appScreenHeight, appScreenWidth);
|
|
|
+ }
|
|
|
+ return layoutParams;
|
|
|
+ }
|
|
|
+
|
|
|
private ValueCallback mUploadCallbackAboveL;
|
|
|
|
|
|
public void setUploadMsg(ValueCallback uploadMsg) {
|