Skip to content

upd: move setup earlier #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions topics/compose/compose-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ functionality to other platforms and helps observe lifecycle states in common co
To use the multiplatform `Lifecycle` implementation, add the following dependency to your `commonMain` source set:

```kotlin
commonMain.dependencies {
implementation("org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:%composeLifecycleVersion%")
kotlin {
// ...
sourceSets {
// ...
commonMain.dependencies {
// ...
implementation("org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:%composeLifecycleVersion%")
}
// ...
}
}
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:%composeLifecycleVersion%"}

## States and events

Expand Down
3 changes: 2 additions & 1 deletion topics/compose/compose-navigation-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Compose Multiplatform adopts the [Jetpack Compose approach to navigation](https:

## Setup

To use the navigation library, add the following dependency to your `commonMain` source set:
To use the Navigation library, add the following dependency to your `commonMain` source set:

```kotlin
kotlin {
Expand All @@ -26,6 +26,7 @@ kotlin {
}
}
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="org.jetbrains.androidx.navigation:navigation-compose:%composeNavigationVersion%"}

> Compose Multiplatform %composeVersion% requires Navigation library version %composeNavigationVersion%.
>
Expand Down
23 changes: 22 additions & 1 deletion topics/compose/compose-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the library solves basic navigation problems:
* Support uniform animations and transitions when navigating, as well as allow for common patterns such as
back gestures with minimal additional work.

If you feel comfortable enough with the basics, move on to [Compose Multiplatform Navigation setup](compose-navigation-routing.md),
If you feel comfortable enough with the basics, move on to [](compose-navigation-routing.md),
to learn how to leverage the Navigation library in cross-platform projects.
Otherwise, read on to learn about fundamental concepts the library works with.

Expand Down Expand Up @@ -48,6 +48,27 @@ Keeping these concepts in mind, the Navigation library implements basic rules to

## Basic navigation example

To use the Navigation library, add the following dependency to your `commonMain` source set:

```kotlin
kotlin {
// ...
sourceSets {
// ...
commonMain.dependencies {
// ...
implementation("org.jetbrains.androidx.navigation:navigation-compose:%composeNavigationVersion%")
}
// ...
}
}
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="org.jetbrains.androidx.navigation:navigation-compose:%composeNavigationVersion%"}

> Compose Multiplatform %composeVersion% requires Navigation library version %composeNavigationVersion%.
>
{style="note"}

There is an order in which it makes sense to tackle the necessary steps to set up your navigation:

1. Define your routes.
Expand Down
1 change: 1 addition & 0 deletions topics/compose/compose-viewmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ kotlin {
}
}
```
{initial-collapse-state="collapsed" collapsible="true" collapsed-title="org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:%composeViewmodelVersion%"}

## Using ViewModel in common code

Expand Down