Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 1.46 KB

README.md

File metadata and controls

34 lines (19 loc) · 1.46 KB

ScreenRotationTest1

Rotating Exodux Box screen Demo 1

Mainly we get get the runtime and read 'persist.sys.app.rotation' property (we get 'middle-port' by default):

private String getSystemProperty(String propertyName) {

Or, by same way, we can set the 'persist.sys.app.rotation' property to 'original' or other:

private void setSystemProperty(String propertyName, String propertyValue) {

Then we can rotate by

A) setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

or

B) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

By default, the value is 'middle-port', but we can change to 'original' by getting the runtime. If we use 'original' value the behabiour will be as a mobile phone or tablet and your app will not be locked to landscape.

HOW TO USE THE APP:

Button 'Swap Rotation Mode' switches between 'original' and 'middle-port', the current value will be displayed. Buttom 'Set Portrait Mode' will swap the screen orientation to portrait. Button 'Set Landscape Mode' will swap the screen orientation to landscape.

If we want a properly portrait usage, first change mode to 'original', then set to portrait.

Compiled APK is available, just donwload the file: app-debug.apk

Images: https://github.com/Javimetal/ScreenRotationTest1/wiki