Skip to content

Instantly share code, notes, and snippets.

@fievx
Last active September 23, 2018 12:19
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 fievx/aba53f45cc8651df91584ae521d994c0 to your computer and use it in GitHub Desktop.
Save fievx/aba53f45cc8651df91584ae521d994c0 to your computer and use it in GitHub Desktop.
findViewById<TextView>(R.id.tv_round_outline).apply {
val provider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, view.width, view.height, view.height / 2f)
}
}
outlineProvider = provider
clipToOutline = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment