Take the 2-minute tour ×

I am developing one chat application and i want to create a chat screen layout like following screen.Chat Screen layout

Currently i am using ListView for my chat texts but the problem is that to read the long chats i have to scroll down,my screen does not scrolls automatically.

I want this bubble kind of chat layout.
How do i develop this kind of chat layout.
If you have any idea about this please share with me.


share|improve this question

4 Answers 4

up vote 5 down vote accepted

What you need here is a layout with a header and footer part, having as a main view a ListView.

This ListView should have a custom Adapter to show the message items.

To achieve this bubble-like display, your itemRenderer should be able to deal with states (fromMe - fromOther).

To have the bubbles, you should attach different backgroundDrawable (bubble 9patches pointing to the left and right) to different states.

If you have stuck somewhere, share the relevant code snippets and logcat output, so we can help you further.

share|improve this answer

U need the Following
1) A ListActivity, ListView XML Layout.
2) BaseAdapter which ListActivity Uses.
3) BaseAdapter getView will inflate each Row.
4) In Each Row have a row View with you bubble images and your chat text.
5) In Listview Footer have a EditText View to Type Chat.

Use these for reference.. http://developer.android.com/reference/android/app/ListActivity.html


share|improve this answer
Mark answer if Useful.. –  NitZRobotKoder May 14 '12 at 7:48

try looking at this for creating a custom view for listView.

I would create a parent View and an incoming one and outgoing one that inherit from it and change color and gravity according to the one they are.

share|improve this answer

OK if I understand you correctly all you need to do is implement auto-scroll for the Listview.

if so then try calling smoothScrollToPosition each time something is added. I don't know what your class looks like but maybe can run something like this (pseudo code)

share|improve this answer

Your Answer


