JackKirk Well-Known Member Licensed User Longtime User Mar 17, 2019 #1 In this post: https://www.b4x.com/android/forum/t...hers-that-are-only-portait.46170/#post-284875 Erel says: "You can change the supported orientations at runtime." I would like to know how to do this.
In this post: https://www.b4x.com/android/forum/t...hers-that-are-only-portait.46170/#post-284875 Erel says: "You can change the supported orientations at runtime." I would like to know how to do this.
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2019 #2 The complete statement is: "After several failed attempts I can say that there is no reliable way to do it. You can change the supported orientations at runtime. However the orientation will not change until the user rotates the device. As I see it, it is not really useful." You can try this: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Upvote 0
The complete statement is: "After several failed attempts I can say that there is no reliable way to do it. You can change the supported orientations at runtime. However the orientation will not change until the user rotates the device. As I see it, it is not really useful." You can try this: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845
JackKirk Well-Known Member Licensed User Longtime User Mar 17, 2019 #3 Erel said: You can try this: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Click to expand... Erel, I have already looked at this and put it in a test app. What that code does (from what I can see) is actually force the orientation to change - but only if the desired orientation is a "supported orientation". I want to be able to change the "supported orientation/s" at run time - which is what I thought your post was saying could be done. Thanks... Upvote 0
Erel said: You can try this: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Click to expand... Erel, I have already looked at this and put it in a test app. What that code does (from what I can see) is actually force the orientation to change - but only if the desired orientation is a "supported orientation". I want to be able to change the "supported orientation/s" at run time - which is what I thought your post was saying could be done. Thanks...
Erel B4X founder Staff member Licensed User Longtime User Mar 18, 2019 #4 What exactly are you trying to solve? Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Upvote 0
What exactly are you trying to solve? Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594
JackKirk Well-Known Member Licensed User Longtime User Mar 18, 2019 #5 Erel said: What exactly are you trying to solve? Click to expand... My app is basically all portrait. Except when showing a video or a webpage where I want the user to have the ability to change the orientation by reorienting the phone. And snap back to portrait when the user leaves the video or webpage. Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... This looks promising - I'm guessing you would have to have: #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight Upvote 0
Erel said: What exactly are you trying to solve? Click to expand... My app is basically all portrait. Except when showing a video or a webpage where I want the user to have the ability to change the orientation by reorienting the phone. And snap back to portrait when the user leaves the video or webpage. Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... This looks promising - I'm guessing you would have to have: #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
JackKirk Well-Known Member Licensed User Longtime User Mar 21, 2019 #6 Erel, is: Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... what you meant when you said "You can change the supported orientations at runtime." I would appreciate the clarification... Upvote 0
Erel, is: Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... what you meant when you said "You can change the supported orientations at runtime." I would appreciate the clarification...
Erel B4X founder Staff member Licensed User Longtime User Mar 21, 2019 #7 I've tried several things and they didn't work. I recommend you to return false from shouldAutoRotate and set the orientation yourself with: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Upvote 0
I've tried several things and they didn't work. I recommend you to return false from shouldAutoRotate and set the orientation yourself with: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845
JackKirk Well-Known Member Licensed User Longtime User Mar 21, 2019 #8 Erel, Sorry but: Erel said: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Click to expand... is not what I want to do - I want to give the user the ability (i.e. option) to rotate the view on certain pages - not automatically force a change of orientation. This is what: Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... gives. The only untidy part about the latter is that when you return to a portrait-only page you may be in landscape and lock yourself into it. I have an idea that sort of solves this - I will write it up as a code snippet. Upvote 0
Erel, Sorry but: Erel said: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845 Click to expand... is not what I want to do - I want to give the user the ability (i.e. option) to rotate the view on certain pages - not automatically force a change of orientation. This is what: Erel said: Might be relevant: https://www.b4x.com/android/forum/threads/disable-autorotate-on-a-single-view.80699/#post-511594 Click to expand... gives. The only untidy part about the latter is that when you return to a portrait-only page you may be in landscape and lock yourself into it. I have an idea that sort of solves this - I will write it up as a code snippet.
JackKirk Well-Known Member Licensed User Longtime User Mar 22, 2019 #9 JackKirk said: I have an idea that sort of solves this - I will write it up as a code snippet. Click to expand... See: https://www.b4x.com/android/forum/t...s-in-an-essentially-portrait-only-app.104006/ Upvote 0
JackKirk said: I have an idea that sort of solves this - I will write it up as a code snippet. Click to expand... See: https://www.b4x.com/android/forum/t...s-in-an-essentially-portrait-only-app.104006/