CarousselViewChallange VibeDesenvolvimento #36
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.
Submission description
I've rebuilt a screen from a clients app, that we've been waiting for a long time to use a native caroussel on it.
Before
After
I tried to use a
CarousselViewon the bottom (the small cards) with theNumberOfSideItemsproperty, but it only moved one by one, and when I tried some fast swipes it sometimes didn't even move from one card to another, or had some weir behaviours, and also the cards had a weird width. So I then moved from theCarousselViewto theCollectionViewwith theSnapPointsAlignmentactive, that as for the time I haven't tried yet, worked gracefully.What went well
Everything was very smooth, transitioning from the library I previously use to the new native view had no hiccups or drawbacks.
What didn't go well
I couldn't catch the problem when I was recording (It magically didn't occur while I was doing it...). But after I added the
CollectionViewto one of the cards on theCarousselViewit sometimes broke the scrolling (might be hard to explain on text, but I'll try).Attempt to explain:
When I scrolled the Colleciton up and down and then tried to scroll the Caroussel sideways, the Caroussel stopped snapping to the border of the screen, and stayed anywhere I left it, like, "half-and-half". It didn't happened all the time, but when I was testing, it occurred frequently (but not when I was recording...).
Another thing that made me uncomfortable was that when I had the
PeekAreaInsetsproperty on I could not centralize the first and the last cards because of the peek of the next one. It really annoyed me... 😅Missing or desired things
Page indicators
One thing that other already mentioned, but I'll say it again, Page indicators!!! It should be a thing with the Caroussel. (BTW I'm working aside on a library that implements it, maybe tonight it will be on my github, I didn't add on this PR because i would not finish in time for the challenge...)
Force centralize
It would be a blast if there is a way to always centralize the card on its parent
ViewElementeven when thePeekAreaInsetsare set.Anything else
That's all, I think...