Xamarin.forms: [Bug] [Android] Horizontal CollectionView issues with SnapPointsAlignment = Center and Event Parameters

Created on 2 May 2020  路  3Comments  路  Source: xamarin/Xamarin.Forms

Description

Horizontal CollectionView has issues with SnapPointsAlignment = Center on Android.

  • Snapping center is not working.
  • ItemsViewScrolledEventArgs is broken on API 23. FirstVisibleItemIndex and CenterItemIndex are always same

Steps to Reproduce

  1. Run the project below and compare Android and iOS behavior

-OR-

  1. Setup a collection view with <LinearItemsLayout Orientation="Horizontal" SnapPointsType="Mandatory" SnapPointsAlignment="Center" />
  2. Compare iOS and Android behavior
  3. Check Scrolled event on Android API 23

Expected Behavior

  1. Snapping center works on Android
  2. Scrolled event values are correct

Actual Behavior

  1. Snapping center is broken.
  2. Scrolled event values are incorrect on Android. First and Center item index are always the same.

Basic Information

  • Version with issue: 4.6.0.726
  • Last known good version: -
  • IDE: 8.5.2 (build 13)
  • Platform Target Frameworks:

    • iOS: 11.4

    • Android: API 23 for event issue, API 23 - 28 for snapping issue

Screenshots

iOS (Working as expected)

May-02-2020 18-23-29

Android (Bug)

May-02-2020 18-16-21

Reproduction Link

horizontaldatepicker.zip

Workaround

No workaround possible

collectionview Android bug

Most helpful comment

How can the CollectionView be considered stable if things like this are just... broken?

This needs to be fixed sooner than 5.0.0.

All 3 comments

Quiet disapointing that this is not working as expected. I am in a position where I can't use CarouselView because of this, in my eyes, critical bug: https://github.com/xamarin/Xamarin.Forms/issues/10865
And now I figured out that I can't fall back to Horizontal CollectionView because a feature that has been released is not working as expected (Snapping).

We're in a position where we can't get a basic horizontal view with the posibility of snapping + changing the collection on the fly (reorder the collection or adding / removing items to it).

I realize that CarouselView is in preview, but we should at least be able to fallback to the well known released CollectionView that was supposed to enable us to do these kind of things. Adding all of this stuff (especially snapping) by using BindableLayout seems like a rabbithole for us consumers to have to dig in to.

Why is this on the milestone of 5.0.0 and not sooner?

How can the CollectionView be considered stable if things like this are just... broken?

This needs to be fixed sooner than 5.0.0.

Was this page helpful?
0 / 5 - 0 ratings