Skip to content

Instantly share code, notes, and snippets.

@igorescodro
Created January 25, 2025 16:57
Show Gist options
  • Save igorescodro/8a90f8cf6b644f69569f69626bf0bdc7 to your computer and use it in GitHub Desktop.
Save igorescodro/8a90f8cf6b644f69569f69626bf0bdc7 to your computer and use it in GitHub Desktop.
// [...] Composable screen code
when (state) {
MainState.Loading -> {
ShimmerProvider {
ItemCard(item = fakeData)
}
}
is MainState.Success -> {
ItemCard(item = state.itemData)
}
}
@Composable
private fun ItemCard(
item: ItemData,
modifier: Modifier = Modifier
) {
Text(
text = item.description,
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.shimmerable()
)
// [...] Remaining Composable code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment