Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
dalafiarisamuel committed Jul 3, 2024
1 parent 96eb954 commit d8ba5a3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand All @@ -32,7 +33,7 @@ fun CollapsingToolbarBase(
mutableStateOf(MutableTransitionState(true))
}

val scrollDp = toolbarHeight + toolbarOffset.dp
val scrollDp by derivedStateOf { toolbarHeight + toolbarOffset.dp }

val animatedCardSize by animateDpAsState(
targetValue = if (scrollDp <= minShrinkHeight) minShrinkHeight else scrollDp,
Expand Down

0 comments on commit d8ba5a3

Please sign in to comment.