Skip to content

Commit 74d6da0

Browse files
authored
Fix Android CollectionView crash during list reloads (#892)
1 parent 7c92b6f commit 74d6da0

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
## [60.2.11]
2+
- [CollectionView][Android] Fixed crash when deferred item decoration updates ran after the RecyclerView was detached during list reloads.
3+
14
## [60.2.10]
25
- [ScrollView][Android] Rolled back Microsoft.Maui.Controls from 10.0.60 to 10.0.51 due to an Android scroll regression.
36

7+
48
## [60.2.9]
59
- Fixed issue where CallerMemberName was not passed on OnPropertyChanged override. Affects ContentPage, Button, Chip, ContextMenuItem, ContextMenuSeparatorItem, ImageButton, ActivityIndicator and SingleLineInputField.
610

src/library/DIPS.Mobile.UI/Components/Lists/CollectionView/Android/CollectionViewHandler.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,20 @@ private class CellStateObserver(ReorderableItemsViewAdapter adapter) : RecyclerV
428428

429429
private void ScheduleUpdate()
430430
{
431-
adapter.m_recyclerView?.Post(() =>
431+
var recyclerView = adapter.m_recyclerView;
432+
recyclerView?.Post(() =>
432433
{
433-
adapter.m_recyclerView.InvalidateItemDecorations();
434+
if (!ReferenceEquals(adapter.m_recyclerView, recyclerView))
435+
return;
436+
437+
recyclerView.InvalidateItemDecorations();
434438
adapter.UpdateAllVisibleCells();
435-
adapter.m_recyclerView?.Post(() =>
439+
recyclerView.Post(() =>
436440
{
437-
adapter.m_recyclerView.InvalidateItemDecorations();
441+
if (!ReferenceEquals(adapter.m_recyclerView, recyclerView))
442+
return;
443+
444+
recyclerView.InvalidateItemDecorations();
438445
adapter.UpdateAllVisibleCells();
439446
});
440447
});

0 commit comments

Comments
 (0)