I will share the image below that I want to develop my message bubble in Native Android
I have written some code in Custom Drawable XML please have a look and I will share the image what it looks like, first see the code:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<rotate
android:fromDegrees="55"
android:pivotX="100%"
android:pivotY="0%"
android:toDegrees="0">
<shape android:shape="rectangle">
<corners android:radius="10dp" />
<solid android:color="#00A1E4" />
</shape>
</rotate>
</item>
<item android:right="28dp">
<shape android:shape="rectangle">
<solid android:color="#00A1E4" />
<corners android:radius="10dp" />
</shape>
</item>
the above code looks like this
Please help me on how to make like the first image.
Thanks
You can use the
ShapeAppearanceModel
to apply a customEdgeTreatment
to a widget for eaxmple aCardView
:Then you can apply a custom
ShapeAppearanceModel
using the builtinMarkerEdgeTreatment
that draws an arrow on the edge given the radius of a circle. Something like:You can also customize the shape of the edge extending the
EdgeTreatment
and overriding thegetEdgePath
method.Note: it requires at least the version
1.2.0
of the Material Components Library.