avoiding recalculating static toolbar height

This commit is contained in:
Adam Brown 2022-10-02 17:23:17 +01:00 committed by Adam Brown
parent eb497be421
commit 19724ea5b3
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ fun DirectoryScreen(directoryViewModel: DirectoryViewModel) {
)
val toolbarHeight = 72.dp
val toolbarHeightPx = with(LocalDensity.current) { toolbarHeight.roundToPx().toFloat() }
val density = LocalDensity.current
val toolbarHeightPx = remember { with(density) { toolbarHeight.roundToPx().toFloat() } }
val toolbarOffsetHeightPx = remember { mutableStateOf(0f) }
directoryViewModel.ObserveEvents(listState, toolbarOffsetHeightPx)