-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Xamarin.Forms.Device.Idiom return Desktop instead of Phone while Xamarin.Essentials.DeviceInfo.Idiom return idiom correct #11166
Comments
Great! Another Xiaomi device and another results... This destroys my app completely :( Code used to render page:
Can you fix this in Xamarin Forms 4.5? |
Does it only occur for Xaomi devices? |
@jsuarezruiz, Can you speed up the merge of your fixes? This bug causes a lot of crashes in my recently released project. |
Devices where bug occurs, just for now more than 1 thousand crashes, and rising (2 days old app) :/ Xiaomi Redmi Note 8 Pro |
Workaround: Set the Default value for OnIdiom |
For now i found solution to override OnIdiom for every occurence in my code...
And use this like that:
Its lame but for me its working, On c# usage is like this:
@lucas-zimerman |
@samhouts i think i found problem. here you are cheking for Xamarin.Forms/Xamarin.Forms.Platform.Android/Forms.cs Lines 399 to 414 in 719fc7a
|
Essentials do right thing. Forms don't. EDIT: I've just saw that you have opened PR that fixes this. Its a over month and still not merged ... :( |
Bump, do you plan to merge this PR? |
i found cleaner workaround for this issue. Simply set Device.Idiom property via reflection on app start
|
Description
Returns inconsistent values from Forms and Essentials.
Steps to Reproduce
Expected Behavior
Xamarin.Forms.Device.Idiom and Xamarin.Essentials.DeviceInfo.Idiom behave in same way.
Actual Behavior
Xamarin.Forms.Device.Idiom returns TargetIdiom.Desktop
Xamarin.Essentials.DeviceInfo.Idiom returns DeviceIdiom.Phone
Basic Information
Screenshots
XF 4.7
![Screenshot 2020-06-22 at 16 19 42](https://user-images.githubusercontent.com/7996711/85298431-5a3ffa80-b4a4-11ea-960b-d8cea61852bc.png)
![Screenshot_2020-06-22-16-18-42-189_com companyname idiomtest](https://user-images.githubusercontent.com/7996711/85299279-5f517980-b4a5-11ea-993e-d40fb263b407.jpg)
XF 4.4
![Screenshot_2020-06-22-16-16-39-629_com companyname idiomtest](https://user-images.githubusercontent.com/7996711/85299304-66788780-b4a5-11ea-869f-107a42e8bb7e.jpg)
Additional Info
It's a similar issue to xamarin/Essentials#1027
The text was updated successfully, but these errors were encountered: