Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Jetcaster] Improve scrolling in Home screen #1274

Merged
merged 4 commits into from
Feb 28, 2024
Merged

Conversation

arriolac
Copy link
Contributor

Changes:

  • Support scrolling entire content in home screen
  • Fix PreviewHomeContent
  • Remove non-screen composable view model usages

It would be great to also support collapsing the toolbar while scrolling but that might be better accomplished when migrating Jetcaster to Material3.

jetcaster_scrolling.webm
@arriolac arriolac requested a review from a team as a code owner February 27, 2024 19:17
@arriolac arriolac force-pushed the chris/jetcaster_scrolling branch 3 times, most recently from 239c2cb to 18fb54e Compare February 27, 2024 19:34
Changes:
* Support scrolling entire content in home screen
* Fix `PreviewHomeContent`
* Remove non-screen composable view model usages
Copy link
Member

@bentrengrove bentrengrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small nits, feel free to fix up and then merge

if (featuredPodcasts.isNotEmpty()) {
Spacer(Modifier.height(16.dp))
stickyHeader {
if (homeCategories.isNotEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It should be the other way around I think?

if (homeCategories.isNotEmpty()) {
   stickyHeader {}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed it

Comment on lines 282 to 290
)
}
}
}
}
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is super nested, consider breaking it apart into multiple composables where it makes sense

.windowInsetsTopHeight(WindowInsets.statusBars)
)
val scrimColor = MaterialTheme.colors.primary.copy(alpha = 0.38f)
Scaffold(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need the Scaffold? Looks like it is sitting in a Column already that maybe could just be used seeing as its just a TopAppBar and then LazyColumn

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking a Scaffold would be good if we want the top app bar to dismiss while scrolling. Since I haven't implemented that yet (requires M3) I'll remove the Scaffold for now 👍

@arriolac arriolac merged commit b14eb5b into main Feb 28, 2024
3 checks passed
@arriolac arriolac deleted the chris/jetcaster_scrolling branch February 28, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants