I have chat list view in which sender name should be left aligned and receiver’s reply should be on right side, and then vice a versa when receiver becomes sender.
Here is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<TextView android:id="@+id/chatmessagename"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textSize="16sp" android:textStyle="bold"
android:paddingBottom="1dp" />
<TextView android:id="@+id/chatmessagedate"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:autoLink="none" />
<TextView android:id="@+id/chatmessagetext"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/chatmessagename"
android:autoLink="all" />
Now at runtime i want to change textview’s layout_alignParentRight value. Is it possible to do ?
Try: