diff --git a/README.md b/README.md
index 6136718..8e7d246 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,7 @@ Why Tiamat?
- Easy to use
- Allow to pass ANY types as data, even lambdas (!under small condition)
- Customizable transitions
+- Customizable save-state logic
Setup
-----
@@ -139,6 +140,7 @@ The scope provides a number of composable functions:
- `freeArgs` - free type arguments, useful to store metadata or pass deeplink info
- `clearFreeArgs` - clear free type arguments (eg: clear handled deeplink info)
- `navResult` - provide the data passed to `NavControllr:back(screen, navResult)` as result
+- `clearNavResult` - clear passed nav result (eg: you want to show notification base on result and clear it not to re-show)
- `rememberViewModel` - create or provide view model scoped(linked) to current screen
- `rememberSharedViewModel` - create or provide view model scoped(linked) to current/provided `NavController`
@@ -177,13 +179,13 @@ NavController will keep the screens data, view models, and states during navigat
### Storage mode
-- `null` - will take parent NavController mode or `ResetOnDataLoss` for root controller
-- `StorageMode.Savable` - will store data in `savable` storage (eg: Android -> Bundle)
+- `null` - will take parent NavController mode or `Memory` for root controller
+- `StorageMode.SavedState` - will store data in `savable` storage (eg: Android -> Bundle)
> [!IMPORTANT]
> Only 'Savable' types of params & args will be available to use
>
> eg: Android - Parcelable + any bundlable primitives
-- `StorageMode.ResetOnDataLoss` - store data in memory, allow to use any types of args & params (including lambdas). Reset nav controller upon data loss
+- `StorageMode.Memory` - store data in memory, allow to use any types of args & params (including lambdas). Reset nav controller upon data loss
### Known limitations
@@ -258,6 +260,7 @@ Custom transition:
- [DataPassingResult.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/DataPassingResult.kt) - How to provide result
- [ViewModels.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/ViewModels.kt) - ViewModels usage
- [CustomTransition.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/CustomTransition.kt) - Custom animations/transition
+- [CustomStateSaver.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/CustomStateSaver.kt) - Custom save/restore state
- [Root.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/multimodule/Root.kt) - Multi-module communication example (using Signals/Broadcast-api)
- [BackStackAlteration.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/BackStackAlteration.kt) - Alteration(modification) of backstack (deeplinks)
- [TwoPaneResizableExample.kt](example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/TwoPaneResizableExample.kt) - 2 pane example (list+details, dynamic switch between 1-pane or 2-pane layout)
@@ -338,6 +341,14 @@ Web: `./gradlew example:app:composeApp:wasmJsBrowserRun`
iOS: run XCode project or else use [KMM](https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile) plugin iOS target
+## Contributors
+
+Thank you for your help! ❤️
+
+
+
+
+
# License
```
diff --git a/example/app/composeApp/src/androidMain/kotlin/composegears/tiamat/example/platform/SavedStateScreen.kt b/example/app/composeApp/src/androidMain/kotlin/composegears/tiamat/example/platform/SavedStateScreen.kt
index 0c776a4..0307ca9 100644
--- a/example/app/composeApp/src/androidMain/kotlin/composegears/tiamat/example/platform/SavedStateScreen.kt
+++ b/example/app/composeApp/src/androidMain/kotlin/composegears/tiamat/example/platform/SavedStateScreen.kt
@@ -30,7 +30,7 @@ val SavedStateScreen by navDestination {
Column {
TextCaption("In order to test this behaviour (IMPORTANT):")
TextCaption("• go ./example/composeApp/src/commonMain/kotlin/App.kt")
- TextCaption("• change storageMode to StorageMode.Savable")
+ TextCaption("• change storageMode to StorageMode.SavedState")
TextCaption("• !!WARNING!! other screens may not work due to this changes!!")
TextCaption("• compile android app")
TextCaption("• go to developer settings of your device")
@@ -44,7 +44,7 @@ val SavedStateScreen by navDestination {
TextCaption("eg: primitives, parcelable (see: SaveableStateRegistry.canBeSaved)")
val savableNavController = rememberNavController(
key = "savableNavController",
- storageMode = StorageMode.Savable,
+ storageMode = StorageMode.SavedState,
startDestination = SavableDataExampleScreenRoot,
destinations = arrayOf(
SavableDataExampleScreenRoot,
diff --git a/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/App.kt b/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/App.kt
index cc74267..18447b0 100644
--- a/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/App.kt
+++ b/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/App.kt
@@ -27,7 +27,7 @@ fun App(
Surface {
val rootNavController = rememberNavController(
key = "rootNavController",
- storageMode = StorageMode.ResetOnDataLoss,
+ storageMode = StorageMode.Memory,
startDestination = MainScreen,
destinations = arrayOf(
MainScreen,
@@ -51,6 +51,7 @@ fun App(
CustomTransitionRoot,
CustomTransitionScreen1,
CustomTransitionScreen2,
+ CustomStateSaverRoot,
MultiModuleRoot,
BackStackAlterationRoot,
TwoPaneResizableRoot,
diff --git a/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/CustomStateSaver.kt b/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/CustomStateSaver.kt
new file mode 100644
index 0000000..ce7830c
--- /dev/null
+++ b/example/app/composeApp/src/commonMain/kotlin/composegears/tiamat/example/CustomStateSaver.kt
@@ -0,0 +1,64 @@
+package composegears.tiamat.example
+
+import androidx.compose.foundation.border
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.composegears.tiamat.Navigation
+import com.composegears.tiamat.StorageMode
+import com.composegears.tiamat.navDestination
+import com.composegears.tiamat.rememberNavController
+import composegears.tiamat.example.ui.core.SimpleScreen
+import composegears.tiamat.example.ui.core.TextBody
+import composegears.tiamat.example.ui.core.TextButton
+
+val CustomStateSaverRoot by navDestination {
+ SimpleScreen("Custom state saver") {
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ var savedState by remember { mutableStateOf