There is a bug in the App Inventor framework that causes a screen orientation flip issue. The “orientation” option for screen orientation does not behave as expected, resulting in unintended behavior. This extension solves the problem by using reflection to access the ScreenOrientation.class, which is part of the App Inventor framework. It modifies its internal state to replace the “unspecified” screen orientation value with “User” for all screens, thus correcting the issue.
This extension is similar to one made by Sumit and does not have any blocks. To use it, simply drag it to Screen1 and it will work automatically.
The extension has some working conditions, however. When auto-rotation is off, it will work for the following conditions:
If you have a single screen
If you have only 2 screens in portrait and landscape mode
If you have multiple screens in portrait orientation.
When auto-rotation is on, the flip will only occur upon the first launch of the app, but switching screens should work fine afterward.
Please note that this is my first extension, and I am still in the learning phase. Feel free to experiment with the code and make any necessary changes. Thank you for your understanding.
Congratulations for this, man
Double congratulations for making it open source.
As it is open source, I hope Niotron and others builders incorpore your code in the builders.
The extension currently does not seem to work properly when auto rotation is on. There is no solution yet. Also, most users have it off anyway.
Remember, this is just a temporary solution because of the limitations on extensions. Devs should fix it internally in order to completely fix the issue.
I agree. Extensions can only be a “band-aid” solution to a problem and at most be a workaround. Deep down, this does not solve the problem itself. It is up to the developers to actually “cure the wound” and fix the problem.
To ignore auto rotation for Portrait apps. Add this to the menifest for every screen.
android:screenOrientation=“portrait”
I tried making the extension add it, it adds but as a duplicate. Seems like we can’t replace the original screen values. If you still want the extension to add and just delete the original screen manifest data than i can provide you the extension.