2.0 KiB
description
| description |
|---|
| Voyager 1.0.0 brings API stability and the first deprecation cycle. |
Migration to 1.0.0
ScreenModel
New Module
Now the ScreenModel API has its own module and no longer are available in voyager-core, if you are using ScreenModel you should declare the dependency cafe.adriel.voyager:voyager-screenmodel (see Setup).
Navigation level ScreenModel
Since 1.0.0-rc08 we have introduced the ScreenModel scoped at Navigator Lifecycle, now the API is no longer marked as Experimental.
Deprecation cycle
Since 1.0.0-rc08 we have renamed the extension coroutineScope to screenModelScope, now it was removed from 1.0.0, if you are still using it, just replace with screenModelScope.
AndroidScreen
The module voyager-androidx and AndroidScreen was removed! Since 1.0.0-rc06 we have introduced a new API called NavigatorScreenLifecycleProvider that provides by default the previous behavior of AndroidScreenLifecycleOwner on Android target for all Screen.
Important notice: AndroidScreen, different from Screen, it holds the Screen.key as a uniqueScreenKey, this is a pretty common requirement, to avoid issues and weird behaviors, we recommend continuing to specify a uniqueScreenKey if you are not, we also recommend creating a abstract class UniqueScreen to replace your AndroidScreen implementation.
abstract class UniqueScreen : Screen {
override val key: ScreenKey = uniqueScreenKey
}
APIs promote to Stable
- All Navigator scoped ScreenModels API
NavigatorLifecycleStoreandNavigatorDisposableTabDisposable
Deprecation cycle
ScreenLifecycleStore.get: Useregisteror newgetfunction instead.Stack.lastOrNull: UselastItemOrNullinsteadNavigator.last: UselastIteminsteadScreenModel.coroutineScope: UsescreenModelScopeinsteadScreenModelStore.remove: UseonDisposeinstead.Tab.title: Useoptionsinstead.Tab.icon: Useoptionsinstead.