Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #4 Only fullscreen opaque activities can request orientation #6

Closed
wants to merge 1 commit into from

Conversation

guok2046
Copy link
Contributor

close #4

@shifujun shifujun self-requested a review June 20, 2019 05:18
Copy link
Collaborator

@shifujun shifujun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确定该问题是否为Android8.0的bug,并已经在9.0上修复后。如果是的话,单独提供一个Android8.0上使用屏幕旋转Activity的例子,或者只写在文档里即可。

@@ -56,6 +57,8 @@ public ComponentName onBindContainerActivity(ComponentName pluginActivity) {
/**
* 这里配置对应的对应关系
*/
case "com.tencent.shadow.sample.plugin.app.lib.usecases.activity.TestActivityOrientation":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样可能会暗示需要屏幕旋转的Activity不能有透明色。

@guok2046
Copy link
Contributor Author

guok2046 commented Jun 20, 2019

问题的原因是8.0系统上Activity 在onCreate的时候会判断3个条件,如果3个条件都命中了,则抛出异常。这三个条件分别是
1.tagetSDKVersion 大于 O
2.先获取配置的orientation信息,判断是否配置了横竖屏
3.判断当前window的style属性,是否配置了transparent或floating或swipeToDismiss
image
image
image

@marsyu
Copy link

marsyu commented Jun 26, 2019

可以做如下设置 android:screenOrientation="behind",让当前的activity跟随前一个activity的方向

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only fullscreen opaque activities can request orientation
3 participants