Skip to content

[Android] ItemsUpdatingScrollMode in CarouselView #30106

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jun 21, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issues Fixed

Fixes #29415

Before After
Screen.Recording.2025-06-21.at.10.37.12.mov
Screen.Recording.2025-06-21.at.10.35.06.mov

@Copilot Copilot AI review requested due to automatic review settings June 21, 2025 08:40
@kubaflo kubaflo requested a review from a team as a code owner June 21, 2025 08:40
@kubaflo kubaflo requested review from Aguilex and tj-devel709 June 21, 2025 08:40
@kubaflo kubaflo self-assigned this Jun 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses the scrolling behavior for the CarouselView on Android by updating how items changes are handled when the collection is modified, which in turn fixes the issue reported in #29415.

  • Removed the conditional block that called UpdateAdapter() and ScrollToPosition() when Carousel.Loop was true
  • Introduced unconditional calls to UpdateAdapter() and ScrollToPosition() in the add/remove item flow to ensure proper scroll updates
Comments suppressed due to low confidence (2)

src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs:300

  • The unconditional call to UpdateAdapter() now applies regardless of the Carousel.Loop setting. Please verify that this change produces the intended behavior for both looping and non-looping scenarios.
						UpdateAdapter();

src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs:301

  • With the removal of the conditional, ScrollToPosition(carouselPosition) is now called unconditionally. Please confirm that this is the desired behavior for accurately positioning the carousel when items are added or removed.
						ScrollToPosition(carouselPosition);

@kubaflo kubaflo added platform/android area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Jun 21, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jun 21, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution platform/android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] ItemsUpdatingScrollMode in CarouselView Not Working as expected
2 participants