Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons rendering inconsistently #11

Open
MatthewKapteyn opened this issue Feb 9, 2024 · 18 comments
Open

Icons rendering inconsistently #11

MatthewKapteyn opened this issue Feb 9, 2024 · 18 comments

Comments

@MatthewKapteyn
Copy link

If the inputs are being generated dynamically or part of a larger page, icons can appear to be massive or be missing entirely. The touch events still work but they aren't visible. Happens when providing custom icons too.

looking at the code i can see why, the post load 100ms delay to wait until things are hopefully visible before swapping icons doesn't seem to work consistently. Hoping to find a better method.

Will investigate further and provide screenshots. For now i've just disabled icons in my fork and moved the touch event to the Entry textbox.

@sebarslan
Copy link
Owner

Hello @MatthewKapteyn ,

Thank you for reporting the issue. I will carefully consider and investigate to find the best solution for this problem. If anyone else has additional ideas, feel free to share them.

Best regards,

@nmano2188
Copy link

I'm also experiencing the same. Any workaround?

@sebarslan
Copy link
Owner

I have now checked the “SetCalendarIcon” method so that it is not async. Could you please try again? If possible can you send me a sample code that doesn't work?
Thanks

@MatthewKapteyn
Copy link
Author

I tried it out but the issue persists. What i found was that loading more than handful of these controls on a page leads to a huge drain on resources. A demo page will start to lag trying to create more than 5-10 of them. When this happens the 100ms delay is not enough and any non-default icon will fail to load.

Unfortunately this is because the Maui Image control for the icon has the same performance problems as Xamarin. I've replaced the Image control with an FFImage control. This allows for using the original 100ms delay and you can load as many NullableDateTimePicker controls on the page as you want.

I've mocked up a torture test here

https://github.com/MatthewKapteyn/Maui.NullableDateTimePicker/blob/6c3522a2a4c83e20050cf7743f9e062ed125c08a/Maui.NullableDateTimePicker.Samples.Net8/MainPage.xaml.cs#L24

https://github.com/MatthewKapteyn/Maui.NullableDateTimePicker/blob/6c3522a2a4c83e20050cf7743f9e062ed125c08a/Maui.NullableDateTimePicker.Samples.Net8/MainPage.xaml#L41

@sebarslan
Copy link
Owner

Hi @MatthewKapteyn

Thank you very much for your suggestion and example. I will try and find the most suitable solution.

Best Regards

@sebarslan
Copy link
Owner

hello everyone
I did something about the icon display issue, can you try again? When I tried it, the icons were visible. If this problem still persists, I will try FFImageLoading.

I also added selection based on 12 hour format. Thanks again for this idea @MatthewKapteyn :)

Best Regards

@MatthewKapteyn
Copy link
Author

Awesome! Hey thanks for porting in that 12hour feature, better looking than what i did.

In regards to performance it's still a bit laggy with the 50+ scrolling torture test but much improved. Using custom icons that are small enough are ok too.

I'll still have to test it out in a different project that loads a lot more fields into a page to see if the icon issue comes back but i think this will work great for most people.

@sebarslan
Copy link
Owner

Thank you for your testing and ideas, if you have any other ideas or requests, you can share them.
Best Regards

@NijishaN
Copy link

NijishaN commented Mar 13, 2024

Still experiencing the same issue. Any workaround?
Screenshot_1710310220

@sebarslan
Copy link
Owner

Hello @NijishaN ,
Are the standard icons inconsistent or are you experiencing the same issue with your own icons?
I think it would make sense to include the 'FFImage' library that @MatthewKapteyn mentioned in the project in the next version.

@NijishaN
Copy link

NijishaN commented Mar 14, 2024

Hello @NijishaN , Are the standard icons inconsistent or are you experiencing the same issue with your own icons? I think it would make sense to include the 'FFImage' library that @MatthewKapteyn mentioned in the project in the next version.

Thankyou for your response @sebarslan. Experiencing the issue with my own icons as well as the standard icons.

@sebarslan
Copy link
Owner

Hi @NijishaN
can you try this again?
Thanks

@NijishaN
Copy link

NijishaN commented Apr 4, 2024

Hello @sebarslan, Still experiencing the issue.

@sebarslan
Copy link
Owner

Hello @NijishaN

Thank you very much for the test.
I used image button instead of image.
Please can you try again?
If the same problem persists, I will use FFImage-Library.

@NijishaN
Copy link

NijishaN commented Apr 5, 2024

Hi @sebarslan , I downloaded Sebarslan.Maui.NullableDateTime pakage from nuget package manager.

Before selecting the date the icon was in expected size
Screenshot_1712291956

After selecting the date the icon size was increased.
Screenshot_1712291966

Expected behavior : The icon should be the same as it was before selecting the date or It would be better if you add IconSize property for this control.
Thanks.

@sebarslan
Copy link
Owner

Hi @NijishaN
Thank you very much for the test.
I'm reverting the change.
Can you send me a sample where I can test for inconsistent icons?
Thanks

@NijishaN
Copy link

NijishaN commented Apr 5, 2024

Hello @sebarslan
https://github.com/NijishaN/SampleNullableDateTimePicker
Icon size is always large in this sample application.

@sebarslan
Copy link
Owner

Hi @NijishaN
Thank you very much for your example.
I made an edit regarding the icon size.
If possible can you test again?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants