Skip to content

Instantly share code, notes, and snippets.

@LDRAlighieri
Last active February 3, 2024 07:05
Show Gist options
  • Save LDRAlighieri/f556fe99446b303e0b2826052667c55e to your computer and use it in GitHub Desktop.
Save LDRAlighieri/f556fe99446b303e0b2826052667c55e to your computer and use it in GitHub Desktop.
Example of Fiberglass lazy column
@Composable
private fun FiberglassColumnContent() {
val items: List<FiberglassItem> = remember {
buildList {
val count = 4
repeat(count) {
val number = it + 1
add(TitleItem("Block №$number"))
add(LoremIpsumItem(20 * number))
if (number < count) add(SpacerItem(16))
}
}
}
FiberglassLazyColumn(
items = items,
itemSlots = mapOf(
SpacerItem::class to spacerItemSlot(),
TitleItem::class to titleItemSlot(),
LoremIpsumItem::class to loremIpsumSlot()
),
modifier = Modifier.fillMaxSize(),
contentPadding = PaddingValues(
top = AppTheme.dimensions.topGuideline,
bottom = WindowInsets.navigationBars
.only(WindowInsetsSides.Bottom)
.asPaddingValues()
.calculateBottomPadding() + AppTheme.dimensions.bottomGuideline
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment