[iOS] Changing carousel view orientation with disabled loop - fix#28545
Merged
PureWeen merged 2 commits intodotnet:inflight/currentfrom Mar 23, 2025
Merged
[iOS] Changing carousel view orientation with disabled loop - fix#28545PureWeen merged 2 commits intodotnet:inflight/currentfrom
PureWeen merged 2 commits intodotnet:inflight/currentfrom
Conversation
Contributor
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/rebase |
b481eea to
64a50ae
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
reviewed
Mar 21, 2025
| bool _isRotating; | ||
|
|
||
| public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) | ||
| { |
Member
There was a problem hiding this comment.
let s say the initial view is horizontal, and then I rotate to vertical, don t I still need to reload the data?
Contributor
Author
There was a problem hiding this comment.
We want to reload the data. And it will reload because previousTraitCollection.VerticalSizeClass would be compact and TraitCollection.VerticalSizeClass regular
mattleibow
approved these changes
Mar 23, 2025
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
pushed a commit
that referenced
this pull request
Mar 26, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
PureWeen
pushed a commit
that referenced
this pull request
Mar 28, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 2, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 3, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 8, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
bhavanesh2001
pushed a commit
to bhavanesh2001/maui
that referenced
this pull request
Apr 11, 2025
…tnet#28545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
PureWeen
pushed a commit
that referenced
this pull request
Apr 11, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 11, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 14, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
github-actions bot
pushed a commit
that referenced
this pull request
Apr 15, 2025
…8545) * [iOS] Changing carousel view orientation with disabled loop - fix * Added snapshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
When the device orientation changes, the ViewDidLayoutSubviews method is triggered. Inside this method, _carouselViewLoopManager.CenterIfNeeded(CollectionView, IsHorizontal) is called. This eventually leads to CollectionView.ReloadData(), which ensures proper sizing adjustments when the orientation changes.
However, if the carousel view is not looping, _carouselViewLoopManager.CenterIfNeeded is not invoked. To fix this, I call _carouselViewLoopManager.CenterIfNeeded inside TraitCollectionDidChange when the carousel view does not have looping enabled.
Issues Fixed
Fixes #28523
Screen.Recording.2025-03-21.at.00.57.25.mov
Screen.Recording.2025-03-21.at.01.27.41.mov