-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] LC 2.0 API. #48
Comments
Hello, We would love to collect your feedback here, that would help us to design the next version of LightCycles. Please comment here. Non-exhaustive of things that would help :
Cheers cc @vkotovv @doridori @ejohansson @MehdiChouag @farmazon3000 @guavabot @xrigau @janogonzalez |
|
I was excited initially about the lib, but ended up not using it. The blocker is related to As @michaelengland said, I don't need the Activity/Fragment in all the calls because they can be injected. I only need to know the stages in the lifecycle. I would prefer:
|
Hello, I finally took some time to summarize the feedbacks we received. Lexicon
Pseudo-code :
NeedsLightCycle
Pseudo-code :
LifeCycle (activity or fragment)
Host
|
Based on that, here are our requirements for the v2. cc @michaelengland Must
Should
Won't
Does it make sense ? |
If I may add something, should we add automatic binding too? (If it's possible and doesn't decrease performances) |
Good point ! We could do that before v2. Actually, I found this : #36 Pardon the poor description : ) ! |
This mostly enable presenters (which are light cycles) to use views (implemented by Fragment, Activity, …). - Dispatcher : aware of the Android life cycle (Activity, SupportFragment, Fragment) - Host : the activity/fragment as viewed by the light cycle. It can be a view. #48
…hich can be implemented by Fragment or Activity classes. - Dispatcher: dispatch the Android life cycle (Activity, SupportFragment, Fragment) to LightCycles. - Host: the activity/fragment as viewed by the light cycle. It can be a view. - LightCycle: notified of the life cycle with the Host as a parameter. #48
…hich can be implemented by Fragment or Activity classes. - Dispatcher: dispatch the Android life cycle (Activity, SupportFragment, Fragment) to LightCycles. - Host: the activity/fragment as viewed by the light cycle. It can be a view. - LightCycle: notified of the life cycle with the Host as a parameter. #48
…hich can be implemented by Fragment or Activity classes. (#87) - Dispatcher: dispatch the Android life cycle (Activity, SupportFragment, Fragment) to LightCycles. - Host: the activity/fragment as viewed by the light cycle. It can be a view. - LightCycle: notified of the life cycle with the Host as a parameter. #48
▲ ▲ ▲ /!\ This is a draft▲ ▲ ▲
🚧
Lately, @jenzz created this 3 PRs to dispatch more callbacks :
This exposes the fact that currently the LC API is not consistent. For example ActivityLightCycle provides
onCreate
,onOptionsItemSelected
but notonPostCreate
.Context
Initially, LightCycle were meant to remove the boilerplate to hook up a presenter to an Activity/Fragment lifecycle. The library was basically handling the same callbacks than ActivityLifecycleCallbacks. But, as we used it more and more across the SoundCloud app and other companies apps, we ended adding others callbacks as we felt the need.
We even added
boolean onOptionsItemSelected(T activity, MenuItem item);
. On the other hand, we decided to not addonCreateOptionsMenu
since it was decided it would be the responsibility of the activity to inflate layouts.Let's rethink the API
Goals
Proposals
Activity
// TODO
Fragment
// TODO
The text was updated successfully, but these errors were encountered: