I am making chat app and I want to align text message to right side of parrent (which in that case is LinearLayout).
And here is my XML code for this layout:
<LinearLayout
android:id="@+id/chatMessages"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/background2"
android:text="Losowy tekst"
android:textSize="25dp"></TextView>
</LinearLayout>
So please help me, how can I do it.