feat: rounded corners compat

This commit is contained in:
rebelonion 2024-03-25 23:07:45 -05:00
parent f177e2cf7c
commit 954fdde1c4
3 changed files with 47 additions and 5 deletions

View file

@ -22,8 +22,8 @@ class BitmapUtil {
return output
}
fun convertDrawableToBitmap(drawable: Drawable): Bitmap {
val bitmap = Bitmap.createBitmap(100, 300, Bitmap.Config.ARGB_8888)
fun convertDrawableToBitmap(drawable: Drawable, width: Int, height: Int): Bitmap {
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
drawable.setBounds(0, 0, canvas.width, canvas.height)
drawable.draw(canvas)