Android : Show time in message blocks

on Thursday, October 9, 2014


I have message blocks.I want to show time right bottom of the message.This is my xml:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">


<LinearLayout
android:id="@+id/blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/mes7"
android:layout_marginRight="6dp"
android:layout_marginLeft="6dp"
android:clickable="false">
<TextView
android:id="@+id/messageBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="4dp"
android:layout_marginRight="6dp"
android:gravity="left"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="1dp"
android:text="Test Message"
android:typeface="sans"
android:textSize="14sp"/>

<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_marginRight="5dp"
android:text="19:40"
android:textSize="10sp"/>
</LinearLayout>
</LinearLayout>


I have no problem with short messages but when message prolonged date is not showing.Here you can see:


enter image description here


And one more thing:I want to do margin from left edge but I can't.


How can I do these ?


0 comments:

Post a Comment