dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.96k stars 1.71k forks source link

[Android] CarouselView many issues with CurrentItem bindings #23023

Open dainius-r opened 2 months ago

dainius-r commented 2 months ago

Description

I have found many issues with CarouselView control specially with CurrentItem property binding changes. I don't know if it is best to put all in one bug report, it's easier to test all of them in with attached test project, if needed could create GitHub issues for separate bug tracking. This is a project to reproduce issues: CarouselViewTest.zip

  1. Critical Issue - when reloading carousel items (more that ~6), and selecting item at the end of list, CurrentItem property changes, but carousel still shows first item in the list image
  2. When selecting item with bounded property, it's value (same value) changes second time image
  3. When reloading carousel items with code _viewModel.CarouselItems = new ObservableCollection<string>(_items), bounded property first change to 0 unnecessary, then null and then 0, should this be only 0, or null and 0? image
  4. When set IsScrollAnimated="True" and selecting item from 0 to 6, items is selected (unless 1 critical issue is done), but bounded property change values are all over the place image
  5. After manually selecting CurrentItem (selecting by bounded property change) and then drag a little bit to a side CarouselView visible view, release drag, then view is left stuck in-between image
  6. When dragging currently visible view of CarouselView, but not releasing the drag action, CurrentItem bounded value changes, on a point when next item view is visible enough, and then changes back to previous value when dragging back, and this change is occurring when drag action is still not released image

Steps to Reproduce

  1. Start app, press reload button, press select 7, expect visible view 7, actual result 0
  2. Start app, press select 0, expect "Property changed: 0" one time, actual result two times
  3. Start app, press reload items, expect "Property changed: 0", actual result "Property changed: 0,Property changed: null,Property changed: 0"
  4. Start app, press Toggle ScrlAnim, press select 6, expect "Property changed: 6", actual result "Property changed: 6, ... and many other property changes.."
  5. Start app, press select 0, drag carousel item visible view to a side, expect "visible view snapped to back or to next visible view", actual result "visible view stuck in-between two visible views"
  6. Start app, drag visible view to a side when next visible is visible enough, then drag back to original view, release drag action, expect "not property changes", actual result "Property changed: 1,Property changed: 0"

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

net8.0-android34.0

Did you find any workaround?

Some issues like double property change is not impactful, others did not find workaround

Relevant log output

No response

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

RoiChen001 commented 2 months ago

Can repro this issue at Android platform on the latest 17.11.0 Preview 2.0(8.0.21&8.0.40).