How I can create the attached shape with GenericSh...
# compose
a
How I can create the attached shape with GenericShape?
🧵 1
I tried this code but it doesn't seem to work!
Copy code
val contentTypeShape = GenericShape { size, _ ->
            lineTo(size.width.getValueOfPercentage(90), 0f)

            addArc(
                oval = Rect(
                    0f,
                    -25f,
                    size.width,
                    size.height.plus(25f)
                ),
                -90f, 180f
            )

            lineTo(0f, size.height)

            lineTo(0f, 0f)

        }
z
You can overlay two Composable in box one text with rounded corner background another is icon with circle background
a
Nice idea, I'll try it
c
If you have access to Figma, you can draw it there and use this plugin to export it as a shape class: https://www.figma.com/community/plugin/1054248779295272882/Shape-Composer
However, you may need to make some adjustments in the code if you want it to scale properly to the text and icon size (assuming those may grow/shrink over time)