Skip to content

Commit

Permalink
Merge pull request #560 from Softeq/feature/bindable-recycler-view-ad…
Browse files Browse the repository at this point in the history
…apter-interface-updates

BindableRecyclerViewAdapter: added ability to dispose internal subscriptions without disposing the base Java.Lang.Object
  • Loading branch information
pavel-leonenko authored Sep 17, 2024
2 parents 954d185 + dc88678 commit 1300fce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public override void OnViewRecycled(Java.Lang.Object holder)
base.OnViewRecycled(holder);
}

public void StopListeningToSourceUpdates() => _subscription?.Dispose();

protected virtual RecyclerView.ViewHolder OnCreateHeaderViewHolder(ViewGroup parent)
{
return CreateViewHolder(parent, HeaderViewHolder);
Expand Down Expand Up @@ -394,7 +396,7 @@ protected virtual RecyclerView.ViewHolder OnCreateSectionFooterViewHolder(ViewGr
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_subscription?.Dispose();
StopListeningToSourceUpdates();
}

protected void ReloadMapping()
Expand Down

0 comments on commit 1300fce

Please sign in to comment.