Skip to content

Commit

Permalink
Update decompose to v2.2.0-compose-experimental-beta02
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Nov 27, 2023
1 parent c95166a commit 76ef42f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ napier = "2.6.1"
kotlinx_coroutines = "1.7.3"
kotlinx_date_time = "0.4.1"
kotlinx_immutable_collections = "0.3.6"
decompose = "2.1.4-compose-experimental"
decompose = "2.2.0-compose-experimental-beta02"
essenty = "1.3.0"
androidx_activity = "1.8.1"
androidx_appcompat = "1.6.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.Stac
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.StackAnimator
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.fade
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.plus
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
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.stackAnimation
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.stackAnimator
import com.arkivanov.essenty.backhandler.BackEvent
Expand All @@ -45,8 +46,13 @@ internal actual fun <C : Any, T : Any> backAnimation(
predictiveBackAnimation(
backHandler = backHandler,
animation = stackAnimation(fade() + scale()),
enterModifier = { progress, _ -> Modifier.enterModifier(progress) },
exitModifier = { progress, edge -> Modifier.exitModifier(progress, edge) },
selector = { initialBackEvent, _, _ ->
predictiveBackAnimatable(
initialBackEvent = initialBackEvent,
enterModifier = { progress, _ -> Modifier.enterModifier(progress) },
exitModifier = { progress, edge -> Modifier.exitModifier(progress, edge) },
)
},
onBack = onBack,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import com.arkivanov.decompose.ExperimentalDecomposeApi
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.StackAnimation
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.StackAnimator
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.isFront
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
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.stackAnimation
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.stackAnimator
import com.arkivanov.essenty.backhandler.BackHandler
Expand All @@ -38,8 +39,13 @@ internal actual fun <C : Any, T : Any> backAnimation(
predictiveBackAnimation(
backHandler = backHandler,
animation = stackAnimation(iosLikeSlide()),
exitModifier = { progress, _ -> Modifier.slideExitModifier(progress = progress) },
enterModifier = { progress, _ -> Modifier.slideEnterModifier(progress = progress) },
selector = { initialBackEvent, _, _ ->
predictiveBackAnimatable(
initialBackEvent = initialBackEvent,
exitModifier = { progress, _ -> Modifier.slideExitModifier(progress = progress) },
enterModifier = { progress, _ -> Modifier.slideEnterModifier(progress = progress) },
)
},
onBack = onBack,
)

Expand Down

0 comments on commit 76ef42f

Please sign in to comment.