diff --git a/topics/compose/compose-lifecycle.md b/topics/compose/compose-lifecycle.md index f07d8ec1..28bd1c2d 100644 --- a/topics/compose/compose-lifecycle.md +++ b/topics/compose/compose-lifecycle.md @@ -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 diff --git a/topics/compose/compose-navigation-routing.md b/topics/compose/compose-navigation-routing.md index dc5d6d16..5aa4f0f3 100644 --- a/topics/compose/compose-navigation-routing.md +++ b/topics/compose/compose-navigation-routing.md @@ -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 { @@ -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%. > diff --git a/topics/compose/compose-navigation.md b/topics/compose/compose-navigation.md index 5a91d007..76eb6c34 100644 --- a/topics/compose/compose-navigation.md +++ b/topics/compose/compose-navigation.md @@ -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. @@ -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. diff --git a/topics/compose/compose-viewmodel.md b/topics/compose/compose-viewmodel.md index 31881207..a8cd68e4 100644 --- a/topics/compose/compose-viewmodel.md +++ b/topics/compose/compose-viewmodel.md @@ -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