wcoder / Xamarin.Plugin.DeviceOrientation

Cross-platform plugin to work with screen orientation of mobile device.
MIT License
61 stars 19 forks source link

CurrentOrientation is reversed on some Android tablets #25

Open Huaba93 opened 4 years ago

Huaba93 commented 4 years ago

CrossDeviceOrientation.Current.CurrentOrientation is reversed on some Android tablets. 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 or any smartphone.

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 be replaced with a more recent solution

probably related to #10