I'm making a messaging app. It works fine. In the conversation activity, I have a custom List View that inflates an xml layout as shown below:
but I want to put an image instead of green background like this:
this is my current xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#79ff93">
<ListView
android:id="@+id/listMessages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/divider"
android:divider="@null"
android:dividerHeight="0dp"
android:padding="0dip"
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"
tools:listitem="@layout/message_left" />
<RelativeLayout
android:id="@+id/divider"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_above="@+id/relSendMessage"
android:background="@color/off_white" />
<RelativeLayout
android:id="@+id/relSendMessage"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:background="@android:color/white"
android:paddingLeft="10dp">
<EditText
android:id="@+id/messageBodyField"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/sendButton"
android:layout_alignTop="@+id/sendButton"
android:layout_marginBottom="-4dp"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/sendButton"
android:background="@android:color/white"
android:hint="@string/message_hint"
android:textColor="@android:color/black"
android:textSize="14sp" />
<Button
android:id="@+id/sendButton"
android:layout_width="72dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_margin="4dp"
android:background="@drawable/button_send" />
</RelativeLayout>
Thank you guys.