Last active
February 3, 2024 07:05
-
-
Save LDRAlighieri/f556fe99446b303e0b2826052667c55e to your computer and use it in GitHub Desktop.
Example of Fiberglass lazy column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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