Skip to content

Commit

Permalink
fix: Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
omerhabib26 committed Jul 30, 2024
1 parent 07c1b8f commit 804fe2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridItemSpanScope
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.grid.rememberLazyGridState
Expand Down Expand Up @@ -163,7 +162,6 @@ private fun AllEnrolledCoursesView(
val scaffoldState = rememberScaffoldState()
val scrollState = rememberLazyGridState()
val columns = if (windowSize.isTablet) 3 else 2
val span: (LazyGridItemSpanScope) -> GridItemSpan = { GridItemSpan(columns) }
val pullRefreshState = rememberPullRefreshState(
refreshing = state.refreshing,
onRefresh = { onAction(AllEnrolledCoursesAction.SwipeRefresh) }
Expand Down Expand Up @@ -329,7 +327,7 @@ private fun AllEnrolledCoursesView(
}
)
}
item(span = span) {
item(span = { GridItemSpan(columns) }) {
if (state.canLoadMore) {
Box(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -256,7 +255,9 @@ private fun WhatsNewScreenPortrait(
verticalArrangement = Arrangement.spacedBy(24.dp),
) {
HorizontalPager(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier
.fillMaxWidth()
.weight(1.0f),
verticalAlignment = Alignment.Top,
state = pagerState
) { page ->
Expand All @@ -268,7 +269,6 @@ private fun WhatsNewScreenPortrait(
contentDescription = null
)
}
Spacer(modifier = Modifier.weight(1.0f))
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(20.dp),
Expand Down

0 comments on commit 804fe2d

Please sign in to comment.