Ensure toScrolledContainerColor uses the correct easing function (#450)

This commit is contained in:
Brian Yencho 2023-12-28 18:06:12 -06:00 committed by Álison Fernandes
parent 3f0e44d42f
commit 6665f20af9

View file

@ -1,5 +1,6 @@
package com.x8bit.bitwarden.ui.platform.base.util
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.ui.graphics.Color
@ -22,6 +23,8 @@ fun TopAppBarScrollBehavior.toScrolledContainerColor(
return lerp(
start = expandedColor,
stop = collapsedColor,
fraction = progressFraction,
// The easing function here matches what is currently in TopAppBarColors.containerColor and
// is necessary to match to the app bar color through the full range of motion.
fraction = FastOutLinearInEasing.transform(progressFraction),
)
}