Skip to content

Commit

Permalink
Merge pull request #777 from arkivanov/remove-generics-from-Predictiv…
Browse files Browse the repository at this point in the history
…eBackParams

Removed unused type parameters from the experimental PredictiveBackParams
  • Loading branch information
arkivanov authored Sep 16, 2024
2 parents 9d2f1c4 + c91435f commit 14ffffd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract interface com.arkivanov.decompose.extensions.compose.experimental.stack
abstract fun <#A1: kotlin/Any, #B1: kotlin/Any> provide(): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A1, #B1>? // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimationProvider.provide|provide(){0§<kotlin.Any>;1§<kotlin.Any>}[0]
}

final class <#A: in kotlin/Any, #B: in kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams { // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams|null[0]
final class com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams { // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams|null[0]
constructor <init>(com.arkivanov.essenty.backhandler/BackHandler, kotlin/Function0<kotlin/Unit>, kotlin/Function1<com.arkivanov.essenty.backhandler/BackEvent, com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback/PredictiveBackAnimatable?> = ...) // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams.<init>|<init>(com.arkivanov.essenty.backhandler.BackHandler;kotlin.Function0<kotlin.Unit>;kotlin.Function1<com.arkivanov.essenty.backhandler.BackEvent,com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.PredictiveBackAnimatable?>){}[0]

final val animatable // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams.animatable|{}animatable[0]
Expand All @@ -36,8 +36,8 @@ final val com.arkivanov.decompose.extensions.compose.experimental.stack.animatio
final val com.arkivanov.decompose.extensions.compose.experimental.stack.animation/com_arkivanov_decompose_extensions_compose_experimental_stack_animation_PredictiveBackParams$stableprop // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/com_arkivanov_decompose_extensions_compose_experimental_stack_animation_PredictiveBackParams$stableprop|#static{}com_arkivanov_decompose_extensions_compose_experimental_stack_animation_PredictiveBackParams$stableprop[0]

final fun (com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator).com.arkivanov.decompose.extensions.compose.experimental.stack.animation/plus(com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/plus|plus@com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator(com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator){}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation(com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator = ..., kotlin/Boolean = ..., kotlin/Function1<com.arkivanov.decompose.router.stack/ChildStack<#A, #B>, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams<#A, #B>?> = ...): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B> // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation|stackAnimation(com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator;kotlin.Boolean;kotlin.Function1<com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.PredictiveBackParams<0:0,0:1>?>){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation(kotlin/Boolean = ..., kotlin/Function1<com.arkivanov.decompose.router.stack/ChildStack<#A, #B>, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams<#A, #B>?> = ..., kotlin/Function3<com.arkivanov.decompose/Child.Created<#A, #B>, com.arkivanov.decompose/Child.Created<#A, #B>, com.arkivanov.decompose.extensions.compose.stack.animation/Direction, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator?>): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B> // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation|stackAnimation(kotlin.Boolean;kotlin.Function1<com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.PredictiveBackParams<0:0,0:1>?>;kotlin.Function3<com.arkivanov.decompose.Child.Created<0:0,0:1>,com.arkivanov.decompose.Child.Created<0:0,0:1>,com.arkivanov.decompose.extensions.compose.stack.animation.Direction,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator?>){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation(com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator = ..., kotlin/Boolean = ..., kotlin/Function1<com.arkivanov.decompose.router.stack/ChildStack<#A, #B>, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams?> = ...): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B> // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation|stackAnimation(com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator;kotlin.Boolean;kotlin.Function1<com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.PredictiveBackParams?>){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation(kotlin/Boolean = ..., kotlin/Function1<com.arkivanov.decompose.router.stack/ChildStack<#A, #B>, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/PredictiveBackParams?> = ..., kotlin/Function3<com.arkivanov.decompose/Child.Created<#A, #B>, com.arkivanov.decompose/Child.Created<#A, #B>, com.arkivanov.decompose.extensions.compose.stack.animation/Direction, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimator?>): com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B> // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/stackAnimation|stackAnimation(kotlin.Boolean;kotlin.Function1<com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.PredictiveBackParams?>;kotlin.Function3<com.arkivanov.decompose.Child.Created<0:0,0:1>,com.arkivanov.decompose.Child.Created<0:0,0:1>,com.arkivanov.decompose.extensions.compose.stack.animation.Direction,com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimator?>){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack/ChildStack(com.arkivanov.decompose.router.stack/ChildStack<#A, #B>, androidx.compose.ui/Modifier?, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B>?, kotlin/Function4<androidx.compose.animation/AnimatedVisibilityScope, com.arkivanov.decompose/Child.Created<#A, #B>, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.arkivanov.decompose.extensions.compose.experimental.stack/ChildStack|ChildStack(com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>;androidx.compose.ui.Modifier?;com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimation<0:0,0:1>?;kotlin.Function4<androidx.compose.animation.AnimatedVisibilityScope,com.arkivanov.decompose.Child.Created<0:0,0:1>,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun <#A: kotlin/Any, #B: kotlin/Any> com.arkivanov.decompose.extensions.compose.experimental.stack/ChildStack(com.arkivanov.decompose.value/Value<com.arkivanov.decompose.router.stack/ChildStack<#A, #B>>, androidx.compose.ui/Modifier?, com.arkivanov.decompose.extensions.compose.experimental.stack.animation/StackAnimation<#A, #B>?, kotlin/Function4<androidx.compose.animation/AnimatedVisibilityScope, com.arkivanov.decompose/Child.Created<#A, #B>, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.arkivanov.decompose.extensions.compose.experimental.stack/ChildStack|ChildStack(com.arkivanov.decompose.value.Value<com.arkivanov.decompose.router.stack.ChildStack<0:0,0:1>>;androidx.compose.ui.Modifier?;com.arkivanov.decompose.extensions.compose.experimental.stack.animation.StackAnimation<0:0,0:1>?;kotlin.Function4<androidx.compose.animation.AnimatedVisibilityScope,com.arkivanov.decompose.Child.Created<0:0,0:1>,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any>;1§<kotlin.Any>}[0]
final fun com.arkivanov.decompose.extensions.compose.experimental.stack.animation/com_arkivanov_decompose_extensions_compose_experimental_stack_animation_DefaultStackAnimation$stableprop_getter(): kotlin/Int // com.arkivanov.decompose.extensions.compose.experimental.stack.animation/com_arkivanov_decompose_extensions_compose_experimental_stack_animation_DefaultStackAnimation$stableprop_getter|com_arkivanov_decompose_extensions_compose_experimental_stack_animation_DefaultStackAnimation$stableprop_getter(){}[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import kotlinx.coroutines.launch
@ExperimentalDecomposeApi
internal class DefaultStackAnimation<C : Any, T : Any>(
private val disableInputDuringAnimation: Boolean,
private val predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams<C, T>?,
private val predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams?,
private val selector: (child: Child.Created<C, T>, otherChild: Child.Created<C, T>, direction: Direction) -> StackAnimator?,
) : StackAnimation<C, T> {

Expand Down Expand Up @@ -175,7 +175,7 @@ internal class DefaultStackAnimation<C : Any, T : Any>(
@Composable
private fun PredictiveBackController(
stack: ChildStack<C, T>,
predictiveBackParams: PredictiveBackParams<C, T>,
predictiveBackParams: PredictiveBackParams,
setItems: (Map<Any, AnimationItem<C, T>>) -> Unit,
) {
val scope = rememberCoroutineScope()
Expand Down Expand Up @@ -217,7 +217,7 @@ internal class DefaultStackAnimation<C : Any, T : Any>(
private inner class PredictiveBackCallback(
private val stack: ChildStack<C, T>,
private val scope: CoroutineScope,
private val predictiveBackParams: PredictiveBackParams<C, T>,
private val predictiveBackParams: PredictiveBackParams,
private val setItems: (Map<Any, AnimationItem<C, T>>) -> Unit,
) : BackCallback() {
private var animationHandler: AnimationHandler? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.arkivanov.essenty.backhandler.BackHandler
* @see com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.androidPredictiveBackAnimatable
*/
@ExperimentalDecomposeApi
class PredictiveBackParams<in C : Any, in T : Any>(
class PredictiveBackParams(
val backHandler: BackHandler,
val onBack: () -> Unit,
val animatable: (initialBackEvent: BackEvent) -> PredictiveBackAnimatable? = { null },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun interface StackAnimation<C : Any, T : Any> {
@ExperimentalDecomposeApi
fun <C : Any, T : Any> stackAnimation(
disableInputDuringAnimation: Boolean = true,
predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams<C, T>? = { null },
predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams? = { null },
selector: (child: Child.Created<C, T>, otherChild: Child.Created<C, T>, direction: Direction) -> StackAnimator?,
): StackAnimation<C, T> =
DefaultStackAnimation(
Expand All @@ -56,7 +56,7 @@ fun <C : Any, T : Any> stackAnimation(
fun <C : Any, T : Any> stackAnimation(
animator: StackAnimator = fade(),
disableInputDuringAnimation: Boolean = true,
predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams<C, T>? = { null },
predictiveBackParams: (ChildStack<C, T>) -> PredictiveBackParams? = { null },
): StackAnimation<C, T> =
DefaultStackAnimation(
disableInputDuringAnimation = disableInputDuringAnimation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ class ChildStackTest(

private fun getParameters(): List<StackAnimation<Config, Config>?> {
val predictiveBackParams1 =
PredictiveBackParams<Config, Config>(
PredictiveBackParams(
backHandler = BackDispatcher(),
onBack = {},
)

val predictiveBackParams2 =
PredictiveBackParams<Config, Config>(
PredictiveBackParams(
backHandler = BackDispatcher(),
onBack = {},
animatable = ::materialPredictiveBackAnimatable,
Expand Down

0 comments on commit 14ffffd

Please # to comment.