I've come across a situation which I need help with.
I have an app with #SupportedOrientations: unspecified
If the device is in landscape mode and I rotate the device about its horizontal axis (so that it stays in landscape mode) then at a roll of about 35deg the screen will flip - but Pause/Resume do not fire.
Similarly if the device is in portrait mode and I rotate the device about its vertical axis (so it stays in portrait mode) then at a pitch of about 35deg the screen will flip - again Pause/Resume do not fire.
Because Pause/Resume do not fire I have no absolute way of detecting the screen flip has happened.
I need to know when this happens because I am using a barcode reader library whose preview gets screwed up when the screen flips and I need to reinitialize the library to correct this.
I have played around with monitoring pitch and roll via Phone.PhoneOrientation and this works after a fashion but it is problematic in 2 ways:
(1) You have to pick a threshold pitch/roll at which to do the barcode library re-initialization - I have established purely by experimentation that 35-40 deg works on my Samsung S5 - but what if it is different on other devices?
(2) It is essential that the barcode library re-initialization occurs after the screen flips - meaning the threshold of (1) has to be correct otherwise you achieve nothing.
Any help would be appreciated...
I have an app with #SupportedOrientations: unspecified
If the device is in landscape mode and I rotate the device about its horizontal axis (so that it stays in landscape mode) then at a roll of about 35deg the screen will flip - but Pause/Resume do not fire.
Similarly if the device is in portrait mode and I rotate the device about its vertical axis (so it stays in portrait mode) then at a pitch of about 35deg the screen will flip - again Pause/Resume do not fire.
Because Pause/Resume do not fire I have no absolute way of detecting the screen flip has happened.
I need to know when this happens because I am using a barcode reader library whose preview gets screwed up when the screen flips and I need to reinitialize the library to correct this.
I have played around with monitoring pitch and roll via Phone.PhoneOrientation and this works after a fashion but it is problematic in 2 ways:
(1) You have to pick a threshold pitch/roll at which to do the barcode library re-initialization - I have established purely by experimentation that 35-40 deg works on my Samsung S5 - but what if it is different on other devices?
(2) It is essential that the barcode library re-initialization occurs after the screen flips - meaning the threshold of (1) has to be correct otherwise you achieve nothing.
Any help would be appreciated...