-1

I would like show my text messages like this in picture that i have attached. Please give me some hints on that...

enter image description here

Sample text that i like to have:

muktoshuvro
  • 440
  • 1
  • 7
  • 26
  • Hello, your question is very vast. You should precise what you have already done and what is the thing you don't know (creating a list of content, have different text colors, apply a bubble effect, ...). – eyal-lezmy Jul 22 '12 at 14:15
  • You will find help here : http://stackoverflow.com/questions/4436165/creating-iphone-style-bubble-list-view-in-android http://stackoverflow.com/questions/7454225/bubble-chat-issue-android-listview http://stackoverflow.com/questions/4023232/android-listview-style-like-text-messages-conversations – Ron Jul 22 '12 at 14:49
  • Also see this : http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:transcriptMode – Ron Jul 22 '12 at 15:10
  • -1 no research effort, not a question. – sschrass Jul 22 '12 at 15:51

1 Answers1

2

First, I would create a small empty speech balloon as a 9-patch. This will be used as your TextView background and will expand as necessary to encompass the text. I guess you'll need to create one for every color you intend to use unless someone can tell me how to add color to such a thing.

Next, I would create a layout.xml file that contains some sort of container widget (LinearLayout or RelativeLayout probably) that holds a single TextView that occupies the left half of the container. Make another that puts the TextView in the right half.

Inside the container, put a TextView that uses the above-mentioned 9-patch image as the background.

Then, I would use a ListView for the overall container for your text messages. Construct an Adapter subclass that manages your list of text messages and uses a LayoutInflator to expand the above-mentioned layout.xml files to return the Views to be displayed by the ListView.

That's how I would do it anyway. Implementation details are left as an exercise for the reader.

Edward Falk
  • 9,991
  • 11
  • 77
  • 112