Skip to content

Commit

Permalink
Update documentation structure
Browse files Browse the repository at this point in the history
  • Loading branch information
KovalevAndrey committed Jul 16, 2024
1 parent 7997e09 commit fd03d6d
Show file tree
Hide file tree
Showing 39 changed files with 305 additions and 305 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions documentation/index_2.x.md → documentation/2.x/index_2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ Stacks, custom pagers, custom UI components – whether for navigation, or stand

## 2.x migration guide

If you used Appyx `1.x` before, you can find a [summary of differences](2.x/migrationguide.md) here.
If you used Appyx `1.x` before, you can find a [summary of differences](migrationguide.md) here.


## 1.x documentation

This page is about Appyx `2.x` (alpha).

You can find `1.x` related documentation [here](1.x/index.md).
You can find `1.x` related documentation [here](../1.x/index.md).

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions documentation/2.x/migrationguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The library is packaged as multiple artifacts.
- Android library
- Compose Multiplatform.

Check also [Multiplatform](../navigation/multiplatform.md) documentation and the `:demos:appyx-navigation` module for code examples.
Check also [Multiplatform](navigation/multiplatform.md) documentation and the `:demos:appyx-navigation` module for code examples.

#### :appyx-interactions

Expand Down Expand Up @@ -52,7 +52,7 @@ Check also [Multiplatform](../navigation/multiplatform.md) documentation and the

#### Core

Note that [BackStack](../components/backstack.md) and [Spotlight](../components/spotlight.md) are now standalone artifacts. Check your usage, you might only need `backstack`:
Note that [BackStack](components/backstack.md) and [Spotlight](components/spotlight.md) are now standalone artifacts. Check your usage, you might only need `backstack`:

```diff
-implementation("com.bumble.appyx:core:1.x.x")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
---
title: Appyx Navigation – Composable navigation
---

# Composable navigation

[AppyxComponents](../../components/index.md) in Appyx are composable.

As a single `AppyxComponent` won't be enough for the whole of your whole app, you can use many in a composable way. That is, any managed element of a `AppyxComponent` can also host its own `AppyxComponent`.


## Nodes – structural elements for composing navigation

```Nodes``` are the main structural element in Appyx. They can form a tree.

You can think of a `Node` as a standalone unit of your app with:

- Its own `AppyxComponent`
- Its own [Lifecycle](../features/lifecycle.md)
- State restoration
- A `@Composable` view
- Business logic that's kept alive even when the view isn't added to the composition
- The ability to host generic [Plugins](../features/plugins.md) to extract extra concerns without enforcing any particular architectural pattern

This allows you to make your app's business logic also composable by leveraging `Nodes` as lifecycled components.


## Parent nodes, child nodes

`Nodes` can have other `Nodes` as children. This means you can represent your whole application as a tree of Appyx nodes.

<img src="https://i.imgur.com/iwSxuZi.png" width="450">

You can go as granular or as high-level as it fits you. This allows to keep the complexity low in individual `Nodes` by extracting responsibilities to children, as well as composing other components to build more complex functionality.


## ChildAware API

A `Node` can react to dynamically added child `Nodes` in the tree: [ChildAware API](../features/childaware.md)


## Navigation in the tree

<img src="https://i.imgur.com/hKvOs3w.gif" width="450">

Once you've structured your navigation in a composable way, you can add an `AppyxComponent` to a `Node` of this tree and make it dynamic:

- Some parts in this tree are active while others ore not
- The active parts define what state the application is in, and what the user sees on the screen
- We can change what's active by using an `AppyxComponent` on each level of the tree
- Changes will feel like navigation to the user

See [Implicit navigation](implicit-navigation.md) and [Explicit navigation](explicit-navigation.md) for building complex navigation behaviours with this approach.



## How AppyxComponents affect Nodes

`AppyxComponent` operations will typically result in:

- Adding or removing child `Nodes` of a `Node`
- Move them on and off the screen
- Change their states

As an illustration:

<img src="https://i.imgur.com/8gy3Ghb.gif" width="200"> <img src="https://i.imgur.com/N8rEPrJ.gif" width="200">

Here:

- `Back stack` illustrates adding and removing child `Nodes`
- `Tiles` illustrates changing the state of children and removing them from the `Node`

These are just two examples, you're of course not limited to using them.



## Summary

A summary of Appyx's approach to structuring applications:

- Compose your app out of `Nodes` with their own lifecycles and state
- Navigation is local, composed of individual pieces of `AppyxComponents`
- Navigation is stateful
- Navigation is unit-testable
- Nested navigation and multi-module navigation works as a default
- You're free to implement your own navigable components by utilising `AppyxComponents`
- Avoid global navigation concerns, like shared modules needing to know about the application, or the application needing to know about all its possible modules
---
title: Appyx Navigation – Composable navigation
---

# Composable navigation

[AppyxComponents](../../components/index.md) in Appyx are composable.

As a single `AppyxComponent` won't be enough for the whole of your whole app, you can use many in a composable way. That is, any managed element of a `AppyxComponent` can also host its own `AppyxComponent`.


## Nodes – structural elements for composing navigation

```Nodes``` are the main structural element in Appyx. They can form a tree.

You can think of a `Node` as a standalone unit of your app with:

- Its own `AppyxComponent`
- Its own [Lifecycle](../features/lifecycle.md)
- State restoration
- A `@Composable` view
- Business logic that's kept alive even when the view isn't added to the composition
- The ability to host generic [Plugins](../features/plugins.md) to extract extra concerns without enforcing any particular architectural pattern

This allows you to make your app's business logic also composable by leveraging `Nodes` as lifecycled components.


## Parent nodes, child nodes

`Nodes` can have other `Nodes` as children. This means you can represent your whole application as a tree of Appyx nodes.

<img src="https://i.imgur.com/iwSxuZi.png" width="450">

You can go as granular or as high-level as it fits you. This allows to keep the complexity low in individual `Nodes` by extracting responsibilities to children, as well as composing other components to build more complex functionality.


## ChildAware API

A `Node` can react to dynamically added child `Nodes` in the tree: [ChildAware API](../features/childaware.md)


## Navigation in the tree

<img src="https://i.imgur.com/hKvOs3w.gif" width="450">

Once you've structured your navigation in a composable way, you can add an `AppyxComponent` to a `Node` of this tree and make it dynamic:

- Some parts in this tree are active while others ore not
- The active parts define what state the application is in, and what the user sees on the screen
- We can change what's active by using an `AppyxComponent` on each level of the tree
- Changes will feel like navigation to the user

See [Implicit navigation](implicit-navigation.md) and [Explicit navigation](explicit-navigation.md) for building complex navigation behaviours with this approach.



## How AppyxComponents affect Nodes

`AppyxComponent` operations will typically result in:

- Adding or removing child `Nodes` of a `Node`
- Move them on and off the screen
- Change their states

As an illustration:

<img src="https://i.imgur.com/8gy3Ghb.gif" width="200"> <img src="https://i.imgur.com/N8rEPrJ.gif" width="200">

Here:

- `Back stack` illustrates adding and removing child `Nodes`
- `Tiles` illustrates changing the state of children and removing them from the `Node`

These are just two examples, you're of course not limited to using them.



## Summary

A summary of Appyx's approach to structuring applications:

- Compose your app out of `Nodes` with their own lifecycles and state
- Navigation is local, composed of individual pieces of `AppyxComponents`
- Navigation is stateful
- Navigation is unit-testable
- Nested navigation and multi-module navigation works as a default
- You're free to implement your own navigable components by utilising `AppyxComponents`
- Avoid global navigation concerns, like shared modules needing to know about the application, or the application needing to know about all its possible modules
Loading

0 comments on commit fd03d6d

Please sign in to comment.