Skip to content

[RFC] LC 2.0 API.  #48

@glung

Description

@glung

▲ ▲ ▲ /!\ 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 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions