Skip to content

Commit

Permalink
fix example insets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhirkevich committed Aug 5, 2024
1 parent 0d2366e commit 011598d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
Expand Down Expand Up @@ -73,6 +74,7 @@ import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.layout.Measurable
import androidx.compose.ui.layout.SubcomposeLayout
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -146,6 +148,13 @@ internal fun LottieFilesScreen(
val pageCount by viewModel.pageCount.collectAsState()
val gridState = rememberLazyGridState()

val keyboard = LocalSoftwareKeyboardController.current
LaunchedEffect(gridState.isScrollInProgress){
if (gridState.isScrollInProgress){
keyboard?.hide()
}
}

LaunchedEffect(files) {
gridState.animateScrollToItem(0)
}
Expand Down Expand Up @@ -277,6 +286,7 @@ internal fun LottieFilesScreen(
},
modifier = Modifier
.fillMaxWidth()
.navigationBarsPadding()
.padding(
horizontal = 24.dp,
vertical = 12.dp
Expand Down

0 comments on commit 011598d

Please sign in to comment.