Created
August 13, 2021 19:05
-
-
Save worstkiller/2d2179442b693cd716410ad4128c5070 to your computer and use it in GitHub Desktop.
facebook canvas conposable
This file contains 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
@Composable | |
fun facebookIcon() { | |
val assetManager = LocalContext.current.assets | |
val paint = Paint().apply { | |
textAlign = Paint.Align.CENTER | |
textSize = 200f | |
color = Color.White.toArgb() | |
typeface = Typeface.createFromAsset(assetManager, "FACEBOLF.OTF") | |
} | |
Canvas( | |
modifier = Modifier | |
.size(100.dp) | |
.padding(16.dp) | |
) { | |
drawRoundRect( | |
color = Color(0xFF1776d1), | |
cornerRadius = CornerRadius(20f, 20f) | |
) | |
drawContext.canvas.nativeCanvas.drawText("f", center.x + 25, center.y + 90, paint) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment