-1

The task is to make chat dialog to be like this image how can i make the background of every item to match this design i'm thinking about using card view but how can i add the extra slice for every item please help.

enter image description here

Update:

Here's the image for anyone in need:

enter image description here

Muhammad
  • 516
  • 1
  • 5
  • 20
  • It's just a recyclerview with different items. http://stackoverflow.com/questions/25914003/recyclerview-and-handling-different-type-of-row-inflation – DoronK Jul 20 '16 at 17:50
  • Thanks man but i mean the item itself how can i make the background itself to match this design i'm thinking about using card view but how can i make the extra slice on the right side and left side – Muhammad Jul 20 '16 at 17:56
  • Png image with padding (Imageview) inside a layout – DoronK Jul 20 '16 at 17:58
  • Is it going to expand if the text is large. – Muhammad Jul 20 '16 at 17:59

1 Answers1

1

You need to provide special images with extension .9.png. It calls 9-Patch files.

Here is more info about them.

In short, you need to create a simple png file with message background and in border of image mark extensible parts of image by black lines. Thus you will have opportunity to resize your image, but don't affect to it corners, for example, or some parts, that you don't want to resize.

Hope this helps.

Here is image to show, what can be achieved: enter image description here

enter image description here

Michael Spitsin
  • 2,424
  • 2
  • 15
  • 29