Open Bracefor opened 6 years ago
@Bracefor, thanks for your report!
I published a new version of the plugin: https://www.nuget.org/packages/Plugin.DeviceOrientation/1.0.7
For the fix, look at this section: https://github.com/wcoder/Xamarin.Plugin.DeviceOrientation#xamarinforms-android
Could you please check this version, and tell me about your results?
@wcoder
This bug still exists. On some Android tablets CrossDeviceOrientation.Current.CurrentOrientation
is reversed. I guess this is because some tablets are in landscape mode by default. We could reproduce this with
I suspect there are many more devices with this problem. we could't reproduce it with emulators.
@wcoder I could also reproduce on a Samsung Galaxy Tab 4
activity.Resources.Configuration.Orientation
returns Landscape
activity.WindowManager.DefaultDisplay.Rotation
returns Rotation180
and is converted by your plugin to DeviceOrientations.PortraitFlipped
but this is wrong
activity.WindowManager.DefaultDisplay
is deprecated since API Level 11, this should really be replaced with a more recent solution
On iOS, everything is perfectly fine, but as soon as I use this on Android, everything is switched around? When I rotate the device and print out the orientation, it says it is Landscape, when it is actually Portrait?
Here is my custom Image class where the error exists: