Asad Mukhtar
08/17/2022, 12:59 PMsindrenm
08/17/2022, 1:04 PM@Composable
fun Skeleton() {
Column {
Text("Some heading", Modifier.placeholder(true))
Text("Some body text", Modifier.placeholder(true))
// In place of an image, for instance:
Box(Modifier.clip(RoundedCornerShape(16.dp).placeholder(true))
}
}
sindrenm
08/17/2022, 1:05 PMModifier.placeholder(true, highlight = PlaceholderHighlight.shimmer())
sindrenm
08/17/2022, 1:07 PM.placeholder.material
package and assumes a MaterialTheme
being set. If that's not the case, there are alternatives in the .placeholder
package (no .material
, which allows setting the colors and shapes and stuff manually.sindrenm
08/17/2022, 1:07 PM