Skip to content

Commit

Permalink
commonize home section list size
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed May 10, 2024
1 parent 9a1d42f commit e97509f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class PopularNextSeasonRepository(
) {
fun toGraphQL() = SeasonQuery(
page = Optional.present(page),
perPage = Optional.present(10),
perPage = Optional.present(20),
adultContent = if (nsfw) {
Optional.absent()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PopularSeasonRepository(
) {
fun toGraphQL() = SeasonQuery(
page = Optional.present(page),
perPage = Optional.present(10),
perPage = Optional.present(20),
adultContent = if (nsfw) {
Optional.absent()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fun HomeScreen(component: HomeComponent) {
onClick = {
imagePicker.launch()
},
expanded = listState.isScrollingUp(),
expanded = listState.isScrollingUp() && listState.canScrollForward,
icon = {
Icon(
imageVector = Icons.Filled.CameraEnhance,
Expand Down Expand Up @@ -167,7 +167,6 @@ fun HomeScreen(component: HomeComponent) {
item {
ScheduleOverview(
flow = component.airing,
onMoreClick = { },
onMediumClick = component::details
)
}
Expand All @@ -176,15 +175,13 @@ fun HomeScreen(component: HomeComponent) {
DefaultOverview(
title = "Trending",
flow = component.trending,
onMoreClick = { },
onMediumClick = component::details
)
}
item {
DefaultOverview(
title = "Popular",
flow = component.popularNow,
onMoreClick = { },
onMediumClick = component::details
)
}
Expand All @@ -193,7 +190,6 @@ fun HomeScreen(component: HomeComponent) {
DefaultOverview(
title = "Popular Next",
flow = component.popularNext,
onMoreClick = { },
onMediumClick = component::details
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import kotlinx.coroutines.flow.Flow
fun DefaultOverview(
title: String,
flow: Flow<CollectionState>,
onMoreClick: () -> Unit,
onMediumClick: (Medium) -> Unit,
) {
Column(
Expand All @@ -45,16 +44,6 @@ fun DefaultOverview(
style = MaterialTheme.typography.headlineMedium,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.weight(1f))
IconButton(
onClick = onMoreClick,
enabled = state.isSuccess
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowForwardIos,
contentDescription = null
)
}
}

when (val current = state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import kotlinx.coroutines.flow.Flow
@Composable
fun ScheduleOverview(
flow: Flow<AiringTodayRepository.State>,
onMoreClick: () -> Unit,
onMediumClick: (Medium) -> Unit
) {
Column(
Expand Down

0 comments on commit e97509f

Please sign in to comment.