badoo / badoo/MVICore

Reusing Features in a RecyclerView

Open
#142 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Kotlin
Stars
1.3k
Forks
88
PR merge metrics
No merged PRs in 30d

Description

We have a variety of complicated cards to use in a RecyclerView and we would like to use a Feature for each card. The cards observe multiple Observable sources, and need to be disposed of properly when recycled/backgrounded/etc.

1) Should we be calling .dispose() on a Feature that belongs to a card that is being recycled?

2) Is there a way to re-use a Feature after it has been .disposed()? We would rather not have to allocate new Features in onBindViewHolder() as the object allocations can lead to GC/jank.

3) How does the Binder that we use play into this? Do we need to call .dispose() on it as well? Or is that unnecessary if we are calling .dispose() on each bound Feature when it's no longer needed?

Thank you!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the RecyclerView card lifecycle described here, especially onBindViewHolder and the Feature/Binder disposal questions. Review how recycling and backgrounding affect those objects; done means the guidance answers all three reuse and disposal questions without ambiguity.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.