bluelinelabs / bluelinelabs/Conductor

Compatibility with Android Architecture Components

Open
#395 44 comments 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.9k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

I believe that the issues raised in https://github.com/bluelinelabs/Conductor/issues/302 merit addressing.

Due to tight coupling with Fragments, the Arch Component library doesn't play nicely with Conductor. Controllers must use their Activity as their VM provider, which binds them to the Activity lifecycle. This implies some serious problems

1. The ViewModel will be retained for the lifetime of the Activity - forever for many Conductor apps that use a single Activity
2. Controllers that are used in multiple places in one Activity all share the same ViewModel. This is obviously a problem for more generically designed Controllers (eg. a controller that displays a news article) but also means that Controllers that are disposed and re-added later are provided a stale ViewModel. (A workaround for this is to supply a unique key to the ViewModelProvider)

In addition, the current implementation of the experimental `LifecycleController` does not have parity with Activities/Fragments in that LiveData will continue to emit data to the controller after the underlying Activity is stopped.

I'll repeat what I said in the linked issue because I think it is important,

> I simply consider AC to be so strong that even minor trouble integrating it with other libs should be addressed as a priority. I forsee AC to be a strong part of the future of Android development and it's important to keep up in the formative stages.

I'm not sure how these problems can be solved.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked issue #302 and the experimental LifecycleController implementation. Compare its behavior with the Activity/Fragment lifecycle around ViewModelProvider and LiveData; done means resolving the controller scoping and stopped-Activity emission problems described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.