Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Last active October 17, 2022 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/cb35807e5c5037d03cf00a9b7fd366db to your computer and use it in GitHub Desktop.
Save victorbrndls/cb35807e5c5037d03cf00a9b7fd366db to your computer and use it in GitHub Desktop.
Box(modifier = modifier.width(boxWidth)) {
// this is the background that moves to hightlight what's currently selected
Box(
modifier = Modifier
.offset(x = selectionOffsetX)
.width(selectionWidth)
.height(buttonHeight)
.background(Purple20, selectionShape)
)
Row {
Button(
modifier = Modifier
...
.clickable(
// remove ripple from button
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = { onSelected(...) }
)
)
Button(
modifier = Modifier
...
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = { onSelected(...) }
)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment