Skip to content

[Android] CarouselView many issues with CurrentItem bindings #23023

@dainius-r

Description

@dainius-r

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions