How to design shape for Android TextView?

Viewed 2026

I am designing a chat application . I have to design chat UI like below image .

I can design the whole UI with Cardview , but the thing which I am stuck is that rounded shape TextView(Background color - green) .

How can I get that Shape for TextView ?

Chat UI

1 Answers

It's pretty easy, just look at Android 9 patch drawables:
official documentation
And you should create "bubble.9.png" file similar to what I've done:
bubble.9.png
And then you should set this image as TextView background

Related