How to make a Linear and a Relative Layout share horizontal space as percentages?
The LinearLayout on the left needs to have a percentage width of the screen, and the RelativeLayout on the right can just take up what remains. I had this as two LinearLayout's and it worked fine because I could use the layout_weight attribute, defining width as a percentage, sorta like so:
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight=".20"
But now I need the layout on the right to be a RelativeLayout, and can't figure out how to preserve the desired percentages since RelativeLayout does not have a layout_weight attribute. What I need looks something like:

In RelativeLayout documentation:
Here's the
ConstraintLayoutversion:To answer for the question conditions if no way to use ConstraintLayout:
Using
android:layout_weightin a View that is wrapped in aRelativeLayoutis prohibited asRelativeLayoutdoesn't provide that attribute for the underlying views (notice attributes start withlayout_are back to the parent layout which isRelativeLayout).The same way, using
android:layout_weightin aRelativeLayoutthat doesn't mean that it's back to theRelativeLayoutitself, but to its parent layout which is already aLinearLayoutSo, this will work normally either it's
LinearLayoutor aRelativeLayout: