moster67 Expert Licensed User Longtime User Aug 8, 2012 #1 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: Aug 8, 2012
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.
moster67 Expert Licensed User Longtime User Aug 8, 2012 #2 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: Code: 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: Aug 8, 2012 Upvote 0
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: Code: ChangeOrientation.SetScreenOrientation(8) I was convinced that the accepted parameters in B4A would only be 1 or 0 but it seems to work :sign0060:
alfcen Well-Known Member Licensed User Longtime User Sep 23, 2012 #3 You may also wish to consider automatic rotation using the Manifest Editor: SetActivityAttribute(main,android:screenOrientation, "sensorLandscape") This will take you further: <activity> | Android Developers Upvote 0
You may also wish to consider automatic rotation using the Manifest Editor: SetActivityAttribute(main,android:screenOrientation, "sensorLandscape") This will take you further: <activity> | Android Developers