user9609225
user9609225

Reputation:

Android: creating a bubble with a pointing corner?

In most of the well-known chat apps (messenger, WhatsApp...) you notice that they use different kinds of chat bubbles.

first kind:

A bubble with 4 rounded corners.

second kind:

A bubble with 3 rounded corners and 1 corner pointing outside(represents the beginning of the new conversation).

My attempt:

I tried using XML drawable layer list to create the effect of the pointing corner. But it doesn't seem like the best approach.

My question:

There aren't enough questions about this issue, so my question is What do these apps use? What is recommended?

Thanks.

Upvotes: 0

Views: 269

Answers (1)

Ak9637
Ak9637

Reputation: 990

They basically use a 9-patch image as background to their views

try this http://tekeye.uk/android/examples/ui/android-9-patch-image-files

also https://developer.android.com/studio/write/draw9patch.html

Upvotes: 1

Related Questions