Skip to content

2.2.0-alpha03

Pre-release
Pre-release
Compare
Choose a tag to compare
@arkivanov arkivanov released this 31 Oct 22:07
  • Fixed Pages(onPageSelected) callback called multiple times and not rendering the current page sometimes (#503)
  • Added pushNew extension function for StackNavigator (#499, #514)
  • Refactored predictive back animation, added PredictiveBackAnimatable API (#507, #515)

New pushNew navigation function

This release introduces the new navigation function for Child Stack: pushNew. It allows pushing a configuration only if it's not already on top of the stack. Can be useful for pushing components on button clicks, etc. Please see the updated docs.

Updated Predictive Back Gesture API

This release contains some improvements for the Predictive Back Gesture API, bringing it closer to become stable. The new API allows creating more complex custom transitions.

Migration if not using custom transitions

- import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.predictiveBackAnimation
+ import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.predictiveback.predictiveBackAnimation

Migration if using custom transitions

- import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.predictiveBackAnimation
+ import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.predictiveback.predictiveBackAnimatable
+ import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.predictiveback.predictiveBackAnimation
    Children(
        stack = component.childStack,
        modifier = modifier,
        animation = predictiveBackAnimation(
            backHandler = component.backHandler,
            animation = stackAnimation(fade() + scale()),
-           exitModifier = { progress, edge -> ... },
-           enterModifier = { progress, edge -> ... },
+           selector = { initialBackEvent, _, _ ->
+               predictiveBackAnimatable(
+                   initialBackEvent = initialBackEvent,
+                   exitModifier = { progress, edge -> ... },
+                   enterModifier = { progress, edge -> ... },
+               )
+           },
            onBack = component::onBackClicked,
        ),
    ) {
        ...
    }

Versions and dependencies

Kotlin: 1.9.10
Essenty: 1.3.0-alpha02
kotlinx-serialization: 1.6.0
parcelize-darwin: 0.2.2

extensions-compose-jetpack

Jetpack Compose: 1.5.0
Jetpack Compose Compiler: 1.5.3

extensions-compose-jetbrains

JetBrains Compose: 1.5.1