I have a relativelayout, and in it two textviews. Textview 1 is aligned top and left with parent. Textview 2 is aligned to the right of textview 1, and to the right with parent. This creates a problem if the text in 1 is too long, meaning that 1 will push 2 out of the screen worst case.
How do I get these two to "sacrifice" from text nr 1 instead of 2? min width does not seem to work. My final goal is to ellipsize text 1, but seems to hinge on the textview to be sized correctly in the first place.
Here is the xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/TextView02"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/TextView01"
android:text="I am number 2"
android:gravity="right"
android:lines="1"
android:minWidth="32sp">
</TextView>
<TextView android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/TextView01"
android:layout_alignParentLeft="true"
android:textSize="22sp"
android:layout_width="wrap_content"
android:lines="1"
android:text="sd sd asd sad asd asd saasd a">
</TextView>
</RelativeLayout>