Created
April 9, 2019 16:59
-
-
Save timrijckaert/64033d09c186957988b9685f537dc288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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