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.
com.DavidNingthoujam.ScreenOrientationFix.aix (9.5 KB)
Source Code on GitHub: GitHub - DavidNingthou/Orientation-Fix: This extension of app inventor fixes orientation problem in app inventor and it's distors.