I want to set 3 expandablelistview in single screen i want to add multiple expandablelistview
XmlLayout
//this is my scorllview
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".fragments.FragmentTestWellnessScoreBoard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/llHealth"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvHealthTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:layout_margin="@dimen/margin_10"
android:text="Health"/>
<ExpandableListView
android:id="@+id/elHealth"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="@+id/llChallenge"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvChallengeTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:layout_margin="@dimen/margin_10"
android:text="Challenge"/>
<ExpandableListView
android:id="@+id/elChallenge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/llRisk"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvRiskTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:layout_margin="@dimen/margin_10"
android:text="Risk"/>
<ExpandableListView
android:id="@+id/elRisk"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
i want to set one by one adapter when user click i don't know how to set multiple expandableList? Java File
private TestWellnessScoreBoardExpandableListAdapter mHealthaAdapter;
private TestWellnessScoreBoardExpandableListAdapter mChallengeAdapter;
private TestWellnessScoreBoardExpandableListAdapter mRiskAdapter;
private ExpandableListView elHealth;
private ExpandableListView elChallenge;
private ExpandableListView elRisk;
// this is my click listener to set adapter
private View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tvHealthTitle:
mHealthaAdapter = new TestWellnessScoreBoardExpandableListAdapter(getActivity(), mWellnessResult.getWellnessArrayList());
elHealth.setAdapter(mHealthaAdapter);
break;
case R.id.tvChallengeTitle:
mChallengeAdapter = new TestWellnessScoreBoardExpandableListAdapter(getActivity(), mWellnessResult.getWellnessArrayList());
elChallenge.setAdapter(mChallengeAdapter);
break;
case R.id.tvRiskTitle:
mRiskAdapter = new TestWellnessScoreBoardExpandableListAdapter(getActivity(), mWellnessResult.getWellnessArrayList());
elRisk.setAdapter(mRiskAdapter);
break;
}
}
};
Every thing is work fine but view not showing showing in full screen but its not showing in full screen
NestedScrollView
– CoupleRecyclerView
, using some suitable expandable-item library, to allow you to have your three collections be managed by a single widget. – Longevous