-
Notifications
You must be signed in to change notification settings - Fork 72
Library architecture and design
Welcome to Magellan! We're working hard on an update; this is the work-in-progress documentation for that update. For the old documentation, see our old wiki page, Magellan 1.x Home. If you have questions/comments/suggestions for the new documentation, please submit an issue and we'll explain ourselves better.
This page describes the class hierarchy of Magellan, including extension points for customization. For help getting started, see Thinking in Magellan and our README. The diagrams have been made with mermaid.js (in their live editor), and are all linked to their editable source. Here's the full diagram in mermaid's live editor, to make editing this wiki page easier.
The core
library deals with the basics of lifecycle propagation. All provided implementations are built on these interfaces and classes, and any custom implementation should, too. It includes:
-
LifecycleAware
interface. An object that implements this is able to accept lifecycle events from a parent. -
LifecycleOwner
interface. An object that implements this is able to have childLifecycleAware
objects, and is responsible for managing these children's lifecycle events. -
LifecycleAwareComponent
abstract class. A default implementation of aLifecycleAware
object that is also aLifecycleOwner
. -
Displayable
interface. An object that implements this can be shown on the screen. -
Navigable
interface. An object that implements this can be navigated to, or stored on a backstack. A union ofLifecycleAware
andDisplayable
. -
LinearNavigator
class: aLifecycleAwareComponent
that manages a backstack ofNavigable
s and handles transitions between them. - A handful of
LifecycleAwareComponents
, likeShown
/CreatedCoroutineScope
,DialogComponent
,ViewComponent
, and more.
On top of this, we provide an opinionated ViewBinding-based implementation, including:
-
Step
abstract class: aLifecycleAwareComponent
that is alsoNavigable
. Its associated view is constructed and accessed through view binding and has an associatedCoroutineScope
for management of asynchronous tasks. -
Journey
abstract class: aStep
that has aLinearNavigator
to navigate between child steps and keep a backstack.
And, soon, we'll have a Jetpack-Compose-based implementation, including:
-
ComposeStep
abstract class: aNavigable
that is just like theStep
above, but with compose support instead of ViewBinding support. -
ComposeJourney
abstract class: aComposeStep
with aLinearNavigator
that works with compose. - A handful of extension functions and wrapper classes that facilitate interoperation between view-based and compose-based
Displayable
s.
Coming soon!
- Custom
LifecycleAware
components - Custom navigators
- Custom view types
magellan-core
magellan-viewbinding
magellan-compose
magellan-compose-interop
magellan-legacy
Made with 💚 by the Wealthfront Android Team.