Rotating Landscape apps on Android

Hi, Landscape only apps don’t appear to be able to rotate (flip 180) on Android - enabling portrait allows then to rotate but also gives portrait views - not sure if this is an Android limitation or a Juce issue?

thx

Hey. If you open AndroidManifest.xml in your project and change:

android:screenOrientation="landscape"

to

android:screenOrientation="landscape|reverseLandscape"

does it solve the issue on your device?

1 Like

thx. will give it a go in the morning

Hi,

android:screenOrientation=“sensorLandscape”

is what’s needed. I’ve tried to override this using the custom XML element, but it appears to get overwritten by the screen orientation field.

Thanks for investigating!

To achieve custom screen orientation you need the following (I’ve just tried this locally):

<manifest>
<application>
<activity android:screenOrientation="sensorLandscape">
</activity>
</application>
</manifest>

On iOS when landscape is enabled we enable both landscape and reverse landscape and I think we should do the same for Android. I will do that.

lovely, thanks

Ok, from now on when choosing Portrait and Landscape screen orientation in Projucer, the resulting setting will be:

  1. for APIs 1-8: landscape (old behaviour, single landscape orientation allowed)
  2. for APIs 9-17: sensor landscape (both landscape and reverse landscape will be allowed, device rotation will determine which landscape to use)
  3. for APIs 18 onwards: user landscape (same as sensor landscape but also honouring user’s screen rotation lock setting)

The change is on develop, added in commit bb7b8e6

2 Likes