This is probably a simple layout question but I’m being able to get what I want.
I have one LinearLayout (which is horizontal), and I want to display 2 Layouts inside, one on the left, and one of the right (which themselves have overlay, buttons, etc…). I want the right one to ALWAYS be displayed fully, and the left one to be displayed only after the right is completely displayed, if space permit.
UPDATE
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="20dp" >
<RelativeLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:singleLine="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000111" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true" />
</RelativeLayout>
</LinearLayout>
With this code, only the left side gets displayed. If I change the weight of the first RelativeLayout to 1, then both take 50% of the screen which is what I expect.
What I would please like is the right to take, if needed 100%, and if it takes less then 100%, whatever is left gets used for the left one. How can I do this please?
Thanks a lot!
Remove weight from the right, and set the left’s width to 0 and weight to 1: