Skip to content

Commit

Permalink
Uses ResponsiveListHeader in Browse Screen (#2236)
Browse files Browse the repository at this point in the history
* Update list header and padding

* Uses respondiveListHeader

* 🤖 Updates screenshots

---------

Co-authored-by: kul3r4 <[email protected]>
  • Loading branch information
kul3r4 and kul3r4 authored May 20, 2024
1 parent 19b4441 commit 298a9ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import com.google.android.horologist.composables.SectionedList
import com.google.android.horologist.compose.layout.ScalingLazyColumnState
import com.google.android.horologist.compose.layout.ScreenScaffold
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ListHeaderDefaults.firstItemPadding
import com.google.android.horologist.compose.material.ResponsiveListHeader
import com.google.android.horologist.compose.material.Title
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.media.ui.R
Expand Down Expand Up @@ -87,19 +89,15 @@ public class BrowseScreenScope {
content: BrowseScreenSectionScope<T>.() -> Unit,
) {
val scope = BrowseScreenSectionScope<T>().apply(content)
val firstSectionAdded = sections.isEmpty()
sections.add(
Section(
state = state,
headerContent = {
Title(
textId = titleId,
modifier = if (firstSectionAdded) {
Modifier.padding(bottom = 8.dp)
} else {
Modifier.padding(top = 8.dp, bottom = 8.dp)
},
)
ResponsiveListHeader(
contentPadding = firstItemPadding(),
) {
Text(text = stringResource(id = titleId))
}
},
loadingContent = scope.loadingContent,
loadedContent = scope.loadedContent,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 298a9ea

Please sign in to comment.