My activity have complex layout such as expandableListView and recyclerView in one layout. I have following the answer from https://stackoverflow.com/a/19845401/4226651 it solve my problem for the simple layout, but the expandable and recycler still overlap.
This is my layout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="27dp"
android:layout_marginBottom="27dp"
android:layout_marginLeft="48dp"
android:layout_marginRight="48dp"
android:orientation="vertical"
android:weightSum="1080">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="208"
android:layout_gravity="center">
<include layout="@layout/frame_top_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="872"
android:orientation="horizontal"
android:weightSum="1920">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1323">
<ExpandableListView
android:id="@+id/exp_category"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:listSelector="@drawable/custom_selector"
android:groupIndicator="@null"
android:scrollbars="none"
android:divider="@null" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="597"
android:orientation="vertical">
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Any suggestion how to solve it?