-
Notifications
You must be signed in to change notification settings - Fork 47
Description
▲ ▲ ▲ /!\ This is a draft▲ ▲ ▲
🚧
Lately, @jenzz created this 3 PRs to dispatch more callbacks :
- Dispatch onActivityResult as part of ActivityLightCycle #45
- Dispatch onWindowFocusChanged as part of ActivityLightCycle #46
- Dispatch onPostCreate & onConfigurationChanged as part of ActivityLightCycle #47
This exposes the fact that currently the LC API is not consistent. For example ActivityLightCycle provides onCreate, onOptionsItemSelected but not onPostCreate.
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 add onCreateOptionsMenu since it was decided it would be the responsibility of the activity to inflate layouts.
Let's rethink the API
Goals
- Define a consistent API for LC
Proposals
Activity
// TODO
Fragment
// TODO