Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created July 30, 2021 13:35
Show Gist options
  • Save PatilShreyas/a0780bcb1f949201d2398001c5cb8513 to your computer and use it in GitHub Desktop.
Save PatilShreyas/a0780bcb1f949201d2398001c5cb8513 to your computer and use it in GitHub Desktop.
@Composable
fun Social() {
// ... Previous part
val inlineDividerContent = mapOf(
Pair(
// This tells the [CoreText] to replace the placeholder string "[divider]" by
// the composable given in the [InlineTextContent] object.
dividerId,
InlineTextContent(
// Placeholder tells text layout the expected size and vertical alignment of
// children composable.
Placeholder(
width = 0.15.em,
height = 0.90.em,
placeholderVerticalAlign = PlaceholderVerticalAlign.TextCenter
)
) {
Box(
modifier = Modifier
.rotate(15f)
.fillMaxSize()
.clip(RectangleShape)
.background(Color.DarkGray)
)
}
)
)
BasicText(text = text, inlineContent = inlineDividerContent, style = TextStyle(fontSize = 17.sp))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment