Skip to content

Commit

Permalink
Add a couple of inline screenshots of the tutorial UI (#1189)
Browse files Browse the repository at this point in the history
<img width="1585" alt="Screenshot 2024-02-07 at 6 18 37 PM"
src="https://github.com/slackhq/circuit/assets/1361086/24978dd8-b18f-4f5d-a995-87f37340e92c">
<img width="1505" alt="Screenshot 2024-02-07 at 6 18 47 PM"
src="https://github.com/slackhq/circuit/assets/1361086/be657590-a89b-434d-b53f-ea3db1c96472">
  • Loading branch information
ZacSweers authored Feb 8, 2024
1 parent 6825e3c commit 4229d0f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
Binary file added docs/images/tutorial_detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tutorial_inbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,18 @@ See the [states and events](states-and-events.md) guide for more information.

## Create your UI

Next, let's define a `Ui` for our `InboxScreen`. A `Ui` is a simple composable function that takes `State` and `Modifier` parameters. It's responsible for rendering the state. You should write this like a standard composable. In this case, we'll use a `LazyColumn` to render a list of emails.
=== "Inbox"
<div class="result" markdown>

![Preview](../images/tutorial_inbox.png){ align=left width=300 }

Next, let's define a `Ui` for our `InboxScreen`. A `Ui` is a simple composable function that
takes `State` and `Modifier` parameters.

// TODO side by side screenshot?
It's responsible for rendering the state. You should write this like a standard composable. In
this case, we'll use a `LazyColumn` to render a list of emails.

</div>

```kotlin title="InboxScreen.kt"
@Composable
Expand Down Expand Up @@ -311,7 +320,19 @@ CircuitCompositionLocals(circuit) {

## Add a detail screen

Now that we have navigation set up, let's add a detail screen to our app to navigate to. First, let's define a `DetailScreen` and state.
=== "Detail"
<div class="result" markdown>

![Preview](../images/tutorial_detail.png){ align=left width=300 }

Now that we have navigation set up, let's add a detail screen to our app to navigate to.

This screen will show the content of a specific email from the inbox, and in a real app would
also show content like the chain history.

</div>

First, let's define a `DetailScreen` and state.

=== "Android"
```kotlin title="DetailScreen.kt"
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ markdown_extensions:
alternate_style: true
- tables
- admonition
- attr_list
- md_in_html

nav:
- 'Introduction': index.md
Expand Down

0 comments on commit 4229d0f

Please sign in to comment.