setScreenOrientation (reverseLandscape)

moster67

Expert
Licensed User
Longtime User
EDIT - resolved

I have my tablet in a protection-case which also permits me to keep the tablet in an upright position so it is suitable for watching films etc.

One annoyance is that sometimes I cannot use it since in landscape-mode, the video is shown up-side-down. Then I found a great player (VPlayer) which permits me to use reverse landscape-mode and I resolved easily this problem.

Now one of my user is asking me the same thing for my app i.e. the possibility to force my videoview (using he Vitamio plugin I posted some time ago) to show the streaming video in landscape-reverse mode.

Unless I have missed something, I think we can use the Phone-library to set only Portrait and Landscape and not modes such as reverse-landscape or reverse-portrait and other modes. I had a look at the official ANdroid-SDK, namely here:

R.attr | Android Developers

and noted that this can be done.

So now I am wondering if I can use those "extra" display-modes in B4A using perhaps the Reflection-library? If yes, anyone who could show the necessary code to get it working?

Many thanks in advance.
 
Last edited:

moster67

Expert
Licensed User
Longtime User
Stupid me....I didn't try using existing methods before writing.

It is enough to replace the 0 (for landscape) with 8 (for reverse-landscape) like this:

B4X:
ChangeOrientation.SetScreenOrientation(8)

I was convinced that the accepted parameters in B4A would only be 1 or 0 but it seems to work :sign0060:
 
Last edited:
Upvote 0
Top