5

I'm trying to build a simple chat application for Android (using the Native SDK), and I'm having some trouble on structuring a nice layout for the UI , specially for the EditText and TextView elements. I'd like to create something like the Whatsapp App for Android:

enter image description here

The goal is to create a shape with this pointy edges in both of the elements. I've done some research and found out that I got to structure a resource file with the shape tag, and add it to the android:background attribute. But I just can't figure out how am I going to create those pointy edges as in the image. Any help is appreciated!

Ismael Di Vita
  • 1,806
  • 1
  • 20
  • 35
  • 1
    I think it would be pretty complicated (if possible) to do this as a shape. It would be much easier to create this background a [9-patch PNG](https://developer.android.com/guide/topics/resources/drawable-resource.html#NinePatch). – Marcin Koziński Jul 05 '16 at 22:16
  • 1
    You could draw this manually as a custom `Drawable`, but it would probably be much easier to have someone mock it up as a background image (in photoshop or whatever) that you can then just set as the background to the EditText. – NoChinDeluxe Jul 05 '16 at 22:34
  • 1
    9-patch do the trick, create image in ilustrator or another image editor with borders and corner right top like you want, and create a 9-patch with Android Studio – Adonys Jul 05 '16 at 22:45
  • Thank you guys! Just managed to solve the problem. I didn't know how the 9 patch drawable worked. – Igor de Medeiros Jul 10 '16 at 19:00

0 Answers0