@@ -28,96 +28,6 @@ A detailed breakdown available in this [Medium article](https://proandroiddev.co
2828- ☠️ A ` SavedStateHandle ` to restore state gracefully after the process death. (for Android)
2929- 🚉 Multiplatform! Supports Android, WearOS, Desktop, iOS and Web
3030
31- ## Adding to your project
32-
33- Decompose-Router is published on Maven Central
34- ``` kotlin
35- repositories {
36- mavenCentral()
37- // or for snapshot builds
38- maven(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
39- }
40- ```
41-
42- Include the dependency in ` commonMain ` . Latest version [ ![ Maven Central] ( https://img.shields.io/maven-central/v/io.github.xxfast/decompose-router?color=blue )] ( https://search.maven.org/search?q=g:io.github.xxfast )
43-
44- > ** Note**
45- > Check for compatible versions of Compose Multiplatform, Decompose and Essenty in the [ Version Catalog] ( gradle/libs.versions.toml )
46-
47- <details >
48- <summary >1. With version catalog</summary >
49-
50- ** libs.version.toml**
51- ``` toml
52- [versions ]
53- # Check in gradle/libs.versions.toml
54-
55- [libraries ]
56- # For Compose Multiplatform
57- decompose-router = { module = " io.github.xxfast:decompose-router" , version.ref = " decompose-router" }
58-
59- # For Compose Wear
60- decompose-router-wear = { module = " io.github.xxfast:decompose-router-wear" , version.ref = " decompose-router" }
61-
62- # You will need to also bring in decompose and essenty
63- decompose = { module = " com.arkivanov.decompose:decompose" , version.ref = " decompose" }
64- decompose-compose-multiplatform = { module = " com.arkivanov.decompose:extensions-compose-jetbrains" , version.ref = " decompose" }
65- essenty-parcelable = { module = " com.arkivanov.essenty:parcelable" , version.ref = " essenty" }
66- ```
67-
68- ** build.gradle.kts**
69- ``` kotlin
70- sourceSets {
71- // For Compose Multiplatform
72- val commonMain by getting {
73- dependencies {
74- implementation(libs.decompose.router)
75-
76- // You will probably need to also bring in decompose and essenty
77- implementation(libs.decompose)
78- implementation(libs.decompose.compose.multiplatform)
79- implementation(libs.essenty.parcelable)
80- }
81- }
82-
83- // For Compose Wear
84- val androidMain by getting {
85- dependencies {
86- implementation(libs.decompose.router.wear)
87- }
88- }
89- }
90- ```
91- </details >
92-
93- <details >
94- <summary >2. Without version catalog</summary >
95-
96- ** build.gradle.kts**
97- ``` kotlin
98- sourceSets {
99- // For Compose Multiplatform
100- val commonMain by getting {
101- dependencies {
102- implementation(" io.github.xxfast:decompose-router:${versions.decompose- router} " )
103-
104- // You will need to also bring in decompose and essenty
105- implementation(" com.arkivanov.decompose:decompose:${versions.decompose} " )
106- implementation(" com.arkivanov.decompose:extensions-compose-jetbrains:${versions.decompose} " )
107- implementation(" com.arkivanov.essenty:parcelable:${versions.essenty} " )
108- }
109- }
110-
111- // For Compose Wear
112- val androidMain by getting {
113- dependencies {
114- implementation(" io.github.xxfast:decompose-router-wear:${versions.decompose- router} " )
115- }
116- }
117- }
118- ```
119- </details >
120-
12131## At a glance
12232
12333``` kotlin
@@ -166,51 +76,11 @@ class DetailInstance(savedState: SavedStateHandle, detail: String) : InstanceKee
16676}
16777```
16878
169- ## Platform configurations 🚉
170-
171- ### Android / WearOS
172-
173- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/src/androidMain/kotlin/io/github/xxfast/decompose/router/app/MainActivity.kt#L15-L30
174-
175- ### Desktop
176-
177- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/src/desktopMain/kotlin/io/github/xxfast/decompose/router/app/Application.kt#L17-L36
178-
179- ### iOS
180-
181- Make sure to create your root router context outside of ` ComposeUIViewController ` 's composable lambda and pass it in to ` LocalRouterContext `
182-
183- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/src/iosMain/kotlin/io/github/xxfast/decompose/router/app/Application.kt#L39-L59
184-
185- > [ !IMPORTANT]
186- > You will need to tie root ` RouterContext ` 's lifecycle to an ` AppDelegate ` .
187-
188- <details >
189- <summary >Kotlin app delegate</summary >
190- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/src/iosMain/kotlin/io/github/xxfast/decompose/router/app/AppDelegate.kt#L18-L52
191- </details >
192-
193- <details >
194- <summary >SwiftUI App / Swift UIKit AppDelegat</summary >
195-
196- #### UIKitAppDelegate
197- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/ios/ios/UIKitAppDelegate.swift#L5-L29
198-
199- #### SwiftUIApp
200-
201- https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/ios/ios/SwiftUIApp.swift#L12-L55
202- Read more on the docs [ here] ( https://arkivanov.github.io/Decompose/getting-started/quick-start/#ios-with-swiftui )
203-
204- > [ !NOTE]
205- > To invoke decompose router's ` defaultRouterContext() ` from swift, you will need to export decompose-router from your shared module
206- > https://github.com/xxfast/Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/build.gradle.kts#L25-L36
207- </details>
208-
209- ### Web
79+ ### Installation and Usage
21080
211- https://github.com/xxfast/ Decompose-Router/blob/98e6d62ed067c01f10d73c769a73fe1d7afbf49d/app/src/jsMain/kotlin/io/github/xxfast/decompose/router/app/Application.kt#L12-L26
81+ Documentation [ here ] ( https://xxfast. github.io/ Decompose-Router/ )
21282
213- </ details >
83+ API Reference [ here ] ( https://xxfast.github.io/Decompose-Router//docs/ )
21484
21585## Licence
21686
0 commit comments