|
@@ -54,6 +54,7 @@ import com.cooleshow.base.ui.activity.BaseActivity;
|
|
|
import com.cooleshow.base.utils.AndroidBug5497Workaround;
|
|
|
import com.cooleshow.base.utils.AppUtils;
|
|
|
import com.cooleshow.base.utils.ClipboardUtils;
|
|
|
+import com.cooleshow.base.utils.LOG;
|
|
|
import com.cooleshow.base.utils.LogUtils;
|
|
|
import com.cooleshow.base.utils.MyFileUtils;
|
|
|
import com.cooleshow.base.utils.PermissionUtils;
|
|
@@ -147,6 +148,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
RelativeLayout rl_activity_html;
|
|
|
LinearLayout ll_activity_html;
|
|
|
private String mImageBase64;
|
|
|
+ private boolean isNeedResetScreenOrientation =true;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -223,6 +225,9 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
setRequestedOrientation(orientation);
|
|
|
|
|
|
}
|
|
|
+ int c_orientation = intent.getIntExtra("c_orientation", ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
|
+ isNeedResetScreenOrientation = c_orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
|
|
+ LOG.i("c_orientation:"+c_orientation+"--isNeedResetScreenOrientation:"+isNeedResetScreenOrientation);
|
|
|
|
|
|
setStatusBarTextColor(intent.getBooleanExtra("statusBarTextColor", false));
|
|
|
if (isHideTitle) {
|
|
@@ -985,6 +990,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
webView.goBack();
|
|
|
}
|
|
|
} else {
|
|
|
+ checkScreenOrientation();
|
|
|
super.onBackPressed();
|
|
|
}
|
|
|
} else {
|
|
@@ -1457,6 +1463,21 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void finish() {
|
|
|
+ checkScreenOrientation();
|
|
|
+ super.finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void checkScreenOrientation() {
|
|
|
+ LOG.i("isNeedResetScreenOrientation:"+isNeedResetScreenOrientation);
|
|
|
+ if(isNeedResetScreenOrientation){
|
|
|
+ if(getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){
|
|
|
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|