I have such item xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/messageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="5dp">
<TextView
android:id="@+id/newDayTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textAlignment="center"
android:textColor="@color/white"
android:visibility="gone" />
<TextView
android:id="@+id/messageData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/newDayTv"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" />
<TextView
android:id="@+id/messageText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messageData"
android:layout_margin="10dp" />
</RelativeLayout>
and I would like to change its alignment like layout_alignParentEnd
and similars one. I saw this question but as you can see at this question TS used two layouts, and maybe it will be possible to use one xml and only change its gravity? I also saw this question but I didn't manage to solve my problem.