Releases: ComposeGears/Tiamat
Releases · ComposeGears/Tiamat
Tiamat 1.2.0
General
- enable
explicitApi
#52 for library modules - Add support SavedStateHandle for TiamatViewModel #49
- add
rememberSaveableViewModel
&koinSaveableTiamatViewModel
functions to create saveable view models
Version updates
kotlin = 2.0.0 -> 2.0.20
koin-compose = 4.0.0-RC1 -> 4.0.0
Examples
- update ViewModels examples with saveable models
Fixes
ComposeModelCoroutineScope
marked as internal (was unintended visible outside of library)TiamatViewModel.viewModelScope
type changed fromComposeModelCoroutineScope
->CoroutineScope
Full Changelog: release/v1.1.1...release/v1.2.0
Tiamat 1.1.1
Fixes
- fix sample app may crash when: StorageMode=SaveState + send deeplink + notCleartFreeArgs ( DeeplinkData class was not parcelable, now it is) + use
don't keep activities
system mode + hide app - fix
freeArgs
&navResult
usesremember
and not provides new state upon clear (it is was cleared under the hood tho).
Changes
freeArgs
&navResult
are nowState
, callingclear(NavResult/FreeArgs)
functions will cause state to update and recompose related composables
Contributors
Special thanks to: @maxlordks
Full Changelog: release/v1.1.0...release/v1.1.1
Tiamat 1.1.0
General
- add
clearNavResult
(#33) to be able clear passed nav result (eg: usingresult
to perform 1-time-action and clear it not to handle again during navigation) - add
NavController .getSavedState
andNavController .loadFromSavedState
functions to be able store/resore state manually - add
NavController.popToTop(... orElse: NavController.() -> Unit)
param to be able manually handle situation when there is nothing to pop to, default value will navigate to target destination - refactor
NavController.back
functions to work better with nullability BackStackEditScope
gotremoveRecent
andremoveAll
functions to make it easyer to edit backstack- update dependencies
IMPORTANT
- "io.insert-koin:koin-compose:4.0.0-RC1" - tiamat-koint use RC1 version of koin dependency
Examples
- add WASM target (yep, you can run it in the browser now)
- add Koin integration example (to be clear - we move it from specific platforms into general due to koint is now support wasm)
- add CustomStateSaver, example of how to manually store/restore navController state (you can save it to file if you want)
Fixes
- fix app silent-crush on Android when using
ResetOnDataLoss
storage mode together with unbundelable classes in params
Changes
- renamed
StorageMode.Savable
->StorageMode.SavedState
as it was a confusion, name did not represent actual storage place - renamed
StorageMode.ResetOnDataLoss
->StorageMode.Memory
as it was a confusion, name did not represent actual storage place
Full Changelog: release/v1.1.0-rc02...release/v1.1.0
Tiamat 1.1.0-rc02
General
- Version changes:
jetbrains-compose
: 1.6.2 -> 1.6.10kotlin
: 1.9.23 -> 2.0.0io.insert-koin:koin-core
: 3.5.4 -> 3.5.6
Examples
- refactor example app structure, external libraries features may be added to specified (supported) platforms
- add Wasm example
- separates koin example from others (Wasm support not yet released from early version)
New
- Wasm support
- Add
back
navController's action now containsinclusive
param, used together withback(to = ??, inclusive=??)
NavDestinationScope
is now implementsAnimatedVisibilityScope
and supported android shared transition (ps shared transition is till bugged when use more than 3 states, see https://issuetracker.google.com/issues/341909321)
Known issues on Android
java.lang.IllegalStateException: CompositionLocal LocalLifecycleOwner not present
workaround is to add this into root app element :
@Composable
private fun LocalLifecycleWorkaround(content: @Composable () -> Unit) {
CompositionLocalProvider(
androidx.lifecycle.compose.LocalLifecycleOwner provides androidx.compose.ui.platform.LocalLifecycleOwner.current,
content = content
)
}
More details: https://issuetracker.google.com/issues/336842920#comment14
Tiamat 1.1.0-rc01
General
- Refactor in-memory storage from using "cache to Map<,>" to "hold same object instance in memory"
NavDestinationEntry
removed (replaced withNavEntry
)NavEntry
- marked as public class, provides actual entry data (destination + args) and extension-create-funStorageMode
:- changed to
enum
IgnoreDataLoss
storage mode - removed as useless
- changed to
rememberNavController
:onCreated
renamed toconfiguration
to better represent actual behavior (called after bothcreate
andrestore
actions)
NavController.getBackStack
new returnList<NavEntry<*>>
(actual instances of entries)NavController.currentNavEntry
marked as public and now can be read/observed
Fixes
- fix koin may create duplicate of viewmodels
New
- Add
rememberSharedViewModel
andkoinSharedTiamatViewModel
shared (scoped into current/provided navController) view model access - Extend viewmodels examples with shared model usage example
Tiamat 1.0.4
Fixes
- Fix NavController +
Savable
storage mode may start blank
Tiamat + Tiamat-koin v1.0.3
General
- JB Compose version up
1.6.1
- Kotlin version up
1.9.23
- Add
NavDestinationEntry
class to representNavDestination
within navArgs + freeArgs
// building NavDestinationEntry
// constructor
val de : NavDestinationEntry = NavDestinationEntry(SomeScreen, navArgsValue , freeArgsValue)
// base ext
val de : NavDestinationEntry = SomeScreen.toEntry(navArgsValue , freeArgsValue)
// ext functuions
val de : NavDestinationEntry = SomeScreen.navArgs(navArgsValue).freeArgs(freeArgsValue)
// infix form
val de : NavDestinationEntry = SomeScreen navArgs navArgsValue freeArgs freeArgsValue
- Add
rememberNavController
overloads to be able to pass initial navArgs/freeArgs
// flat args
fun <T> rememberNavController(
key: String? = null,
storageMode: StorageMode? = null,
startDestination: NavDestination<T>?,
startDestinationNavArgs: T? = null,
startDestinationFreeArgs: Any? = null,
destinations: Array<NavDestination<*>>,
onCreated: NavController.() -> Unit = {}
)
// bundled args
fun <T> rememberNavController(
key: String? = null,
storageMode: StorageMode? = null,
startDestination: NavDestinationEntry<T>?,
destinations: Array<NavDestination<*>>,
onCreated: NavController.() -> Unit = {}
)
- Add
onCreated: NavController.() -> Unit = {}
intorememberNavController
optional param to be able self configure controller right after being created/restored. Common usage is to perform initial navigation. See deep-link example - Improve
NavEntry
by making it generic class to mirror (as internal item)NavDestinationEntry
- Add
NavController.findNavController(key: String): NavController?
fun to find parent[or current] navController within providedkey
- Add
NavController.getBackStackEntries():List<NavDestinationEntry>
to get back stack entries (dest + args)
Examples
- Update deeplink example
- #9 2-pane layout example added Root.kt
- #16 Multi-module interaction example added TwoPaneResizableExample.kt
Fixes
- Fix
NavContentTransform
animations may have size transform or being played for 1 frame - Fix
BackStackAlteration.kt
some devices do not recompose list of bs-screens upon changing
v 1.0.2
General
- Add
freeArgs
as additional nav param (useful to deeplinks & metadata + some rare cases) #8 #10 - minor internal improve in
NavDestinationScope<*>.*
ext's (navArgs, navResult..), direct access to data instead of usingMap
- improve internal data storage
- Set minSDK 21 for Android
- Update compose up to 1.6.0
- Introduce Koin + TiamatViewModel integration
tiamatViewModel
&tiamatViewModelOf
functiond to defined insidemodule
- Composable
koinTiamatViewModel
function to get instance - example KoinIntegration.kt
Examples
- Add deeplink example
- Update tabs example (in-tab nested navigation)
- ViewModels add coroutine usage example
Fixes
- fix recomposition not happen if same destinations follow ont by one in the backstack
- root nav controller now release all resources upond destruction (leaving composition)
- fix android lifecycle initial state where updated within small delay
- fix iOS unable to generate autokey for models
Changes
- renamed
StorageMode.DataStore.ResetOnDataLoss
->StorageMode.ResetOnDataLoss
- renamed
StorageMode.DataStore.IgnoreDataLoss
->StorageMode.IgnoreDataLoss
rememberNavController
key: Any? = null
->key: String? = null
(key is now string, we need stable class to be used here)
v 1.0.1
Initial release