This repository has been archived by the owner on May 1, 2024. It is now read-only.
[iOS, Android] Fix when we call ReloadData on CollectionView, Fix issue adding item to start of Collection on ANdroid #10450
Merged
Conversation
This file contains 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
…ew after showing a modal
rmarinho
changed the title
[iOS] Improve when we call ReloadData on CollectionVIew
[iOS] Fix when we call ReloadData on CollectionView
Apr 25, 2020
samhouts
added
p/iOS 🍎
a/collectionview
a/carouselview
i/high
Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often
t/bug 🐛
labels
Apr 25, 2020
Not sure if we should still would remove this check https://github.com/xamarin/Xamarin.Forms/blob/4.6.0/Xamarin.Forms.Platform.iOS/CollectionView/ObservableItemsSource.cs#L287
In the issue i created Window is null because we were showing a Modal and going back to the page with collectionview |
PureWeen
suggested changes
Apr 25, 2020
Xamarin.Forms.Platform.iOS/CollectionView/ObservableItemsSource.cs
Outdated
Show resolved
Hide resolved
PureWeen
approved these changes
Apr 27, 2020
hartez
approved these changes
Apr 27, 2020
samhouts
added
the
blocker
Issue blocks next stable release. Prioritize fixing and reviewing this issue.
label
Apr 27, 2020
samhouts
suggested changes
Apr 28, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failed on Android API 19
PureWeen
approved these changes
Apr 28, 2020
rmarinho
changed the title
[iOS] Fix when we call ReloadData on CollectionView
[iOS, Android] Fix when we call ReloadData on CollectionView, Fix issue adding item to start of Collection on ANdroid
Apr 28, 2020
samhouts
approved these changes
Apr 28, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
a/carouselview
a/collectionview
blocker
Issue blocks next stable release. Prioritize fixing and reviewing this issue.
i/high
Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often
p/Android
p/iOS 🍎
t/bug 🐛
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
I found that #9911 introduced a new concept of Reload the CollectionView if it wasn't visible and an update to the items was in progress.
Seems this approach doesn't work well when we push a modal on top of the CollectionView and then on dispose we add/remove items from the CollectionView. This was actually preventing the item from being removed. So my first try was to remove the check for
_collectionViewController.View.Window == null
, this worked but was going around the real problem.It seems that also the
_batchUpdating.WaitAsync()
on the Reload method isn't working as expected, it was getting stuck because there were no available threads on the_batchUpdating
semaphore. The problem was after a BatchUpdates was executed (for example add a item) the semaphore wasn't releasing and making the threads available. So the next time for example if it wanted to Reload it was getting stuck.Fix issue on Android that Scrolling to the current position when adding an item would scroll the last item.
This is actual a regression from previous versions.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Added UITest 10300
Click Add
Click Delete
Click Close,
You should see the item
2
PR Checklist