I want to design a layout composed from: a toolbar at the top of the layout (which should take 20% of the screen), then, vertically,underneath, a ViewPager (which should take 60% of the screen) and then, still vertically underneath, a BottomSheet (which should take 20% of the screen when it is collapsed and to take 100% of the screen when it is expanded).
Now I have declared the bottomsheet like this:
<LinearLayout
android:id="@+id/BSSECONDTOOLBAR"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="???"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
android:layout_gravity="bottom"
android:gravity="bottom"
android:background="#f44242" />
Since this should be a direct child of a CoordinatorLayout I cannot use the layout_weight attribute.
My question is how do I set the BottomSheet height in percentage?