I'm trying to create a LinearLayout with the left view width being 80% of its parents width and the second view taking up the remaining space. How do I accomplish this?

I'm trying to create a LinearLayout with the left view width being 80% of its parents width and the second view taking up the remaining space. How do I accomplish this?

Trying using android:layout_weight when defining your child Views.
For view 1 use a layout weight of 0.8 and view 2 use a layout weight of 0.2
Example xml would be :
android:layout_weight=".8"
Like this:
Don't forget to set the width to 0.
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".8"
android:background="@color/blue" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".2"
android:background="@color/red" />