Skip to content

Commit

Permalink
Rename a function
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezaeiii committed Dec 25, 2024
1 parent c25dac3 commit 4b072cd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private fun <T : TMDbItem> LazyTMDbItemGrid(lazyTMDbItems: LazyPagingItems<T>, o
Alignment.CenterHorizontally,
),
content = {
gridItemWithSpan {
fullSpanGridItem {
Spacer(
Modifier.windowInsetsTopHeight(
WindowInsets.statusBars.add(WindowInsets(top = 56.dp)),
Expand All @@ -113,7 +113,7 @@ private fun <T : TMDbItem> LazyTMDbItemGrid(lazyTMDbItems: LazyPagingItems<T>, o

when (lazyTMDbItems.loadState.append) {
is LoadState.Loading -> {
gridItemWithSpan {
fullSpanGridItem {
LoadingRow(modifier = Modifier.padding(vertical = TMDb_8_dp))
}
}
Expand All @@ -123,7 +123,7 @@ private fun <T : TMDbItem> LazyTMDbItemGrid(lazyTMDbItems: LazyPagingItems<T>, o
(lazyTMDbItems.loadState.append as? LoadState.Error)?.error?.message
?: return@LazyVerticalGrid

gridItemWithSpan {
fullSpanGridItem {
ErrorScreen(
message = message,
modifier = Modifier.padding(vertical = TMDb_8_dp),
Expand All @@ -138,7 +138,7 @@ private fun <T : TMDbItem> LazyTMDbItemGrid(lazyTMDbItems: LazyPagingItems<T>, o
)
}

fun LazyGridScope.gridItemWithSpan(content: @Composable () -> Unit) {
private fun LazyGridScope.fullSpanGridItem(content: @Composable () -> Unit) {
item(span = { GridItemSpan(maxLineSpan) }) {
content()
}
Expand Down

0 comments on commit 4b072cd

Please sign in to comment.