Detecting device 180 degree rotation, from landscape left to landscape right

I’m trying to detect a 180 degree iOS rotation from landscape left to landscape right but the resized method is not called in this case (I guess that it’s due to the fact that width and height values aren’t changed after the rotation). Is there any way to detect such a rotation?

Desktop::getCurrentOrientation() will give the most currently known orientation.

JUCE doesn’t appear to provide the notifications for when the orientation changes though.

Audioshare functionality for iOS apps wire in Apple’s rotation handlers yourself

Thanks for the replies. At the end I have modified Juce’s ComponentPeer::handleMovedOrResized() method.

but now you have to maintain your own fork…

Indeed, but from my own experience working with JUCE, it’s usual to have to change a few things here and there in the JUCE library code . Eventually this will get addressed by JUCE developers. I have changed the JUCE method because I needed this feature for Android too (maintenance of native code for different platforms is always a pain in the long term).

That’s a solid point and should be a good motivator to make a feature request! Hopefully your change(s) are only going to be temporary. :slight_smile:

JUCE can definitely be extended to support detecting orientation changes, an action that’s not uncanny to do on mobile apps.

Juce supports orientation changes on mobile apps. The resized() method is called when there is a rotation… except in the case of a 180 degree rotation.

which is why i recommended the approach i did earlier. no forking required.

I think that’s justification enough to warrant requesting its own notification. This way you can get consistent and intuitive results.