android - How to create a chat screen similar to whatsapp in material design? -
basically confused xml file each chat entry content wrapped whatsapp. have tried doing using framelayout
, relativelayout
didn't work. message not wrapped around time.
<framelayout android:id="@+id/chat_mine" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:background="@drawable/chat_bg_white" > <textview android:id="@+id/chat_text_mine" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="65dp" android:gravity="center|left" android:text="h" android:textsize="@dimen/font_size3" /> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" > <textview android:id="@+id/chat_time_mine" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|bottom" android:gravity="right|bottom" android:singleline="true" android:text=" 2:00 am" android:textsize="@dimen/font_size4" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_delivered" /> </linearlayout> </framelayout>
not sure trying ask here ? if understand correct, edit frame layout show first. see contents in ur preview.
<framelayout android:id="@+id/chat_mine" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="right" android:background="@drawable/chat_bg_white" >
Comments
Post a Comment