below is my XML code, I have multi expandable list view (5) each one with a different adapter, and all the views are inside the vertical scroll view. but when clicking on the header of each expandable item it shows the items but not expands ( it shows all items within the header first set height)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".screens.home.ui.dailyreportes.DailyReportsDetailsFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayoutCompat3"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ExpandableListView
android:id="@+id/elv_work_logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
>
</ExpandableListView>
<ExpandableListView
android:id="@+id/elv_equipment_logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/elv_work_logs"
app:layout_constraintVertical_bias="0.0"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
>
</ExpandableListView>
<ExpandableListView
android:id="@+id/elv_material_delivery_logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/elv_equipment_logs"
app:layout_constraintVertical_bias="0.0"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
>
</ExpandableListView>
<ExpandableListView
android:id="@+id/elv_activity_logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/elv_material_delivery_logs"
app:layout_constraintVertical_bias="0.0"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
>
</ExpandableListView>
<ExpandableListView
android:id="@+id/elv_schedule_delays_logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/elv_activity_logs"
app:layout_constraintVertical_bias="0.0"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
>
</ExpandableListView>
</androidx.constraintlayout.widget.ConstraintLayout>
for each child layout, I tried match_parent and wrap_content but got the same result.
And also you won't need the scrollView as the ExpandableListView is scrollable by default.
You can refer here