Skip to content

Instantly share code, notes, and snippets.

@LDRAlighieri
Last active February 3, 2024 07:04
Show Gist options
  • Save LDRAlighieri/532025cbccfe32519f0f4844ec40614d to your computer and use it in GitHub Desktop.
Save LDRAlighieri/532025cbccfe32519f0f4844ec40614d to your computer and use it in GitHub Desktop.
Example of Fiberglass screen slots for items
fun spacerItemSlot(): FiberglassLazyItemSlot = { _, item ->
Spacer(modifier = Modifier.height((item as SpacerItem).height.dp))
}
fun titleItemSlot(): FiberglassLazyItemSlot = { _, item ->
Text(
text = (item as TitleItem).title,
modifier = Modifier.padding(horizontal = AppTheme.dimensions.horizontalGuideline),
color = AppTheme.colors.onBackground,
style = AppTheme.typography.headlineMedium
)
}
fun loremIpsumSlot(): FiberglassLazyItemSlot = { _, item ->
Text(
text = (item as LoremIpsumItem).text,
modifier = Modifier.padding(horizontal = AppTheme.dimensions.horizontalGuideline),
color = AppTheme.colors.onBackground,
style = AppTheme.typography.bodyMedium,
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment