Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PillView(context).run {
bind(pillViewModel)
measure(
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
)
val bitmap = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_4444)
val canvas = Canvas(bitmap)
layout(0, 0, measuredWidth, measuredHeight)
draw(canvas)
bitmap
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment