To provide size distribution without hard coding it, in xml ,you need to do following steps
1. Use "android:weightSum" attribute in parent container and "android:layout_weight" in inner view.
2. In inner view when you are using android:layout_weight, you need to provide "android:layout_height='0'" (if you are dividing it vertically) or "android:layout_width='0dp'" (if you are diving it horizontally).
3. android:weightSum in parent should be summation if all layout_weight in inner view.
Example: Below code shows vertically two 50% linear layout design.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">50%</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:removed="@color/colorAccent">50%
</LinearLayout>
</LinearLayout>
Let me know if that helps.