I have a ListView
that gets data from a JSON on an AWS S3 server, but there's too much data on each item to display by default, there wouldn't be enough items on the screen at once, along with it looking like complete ass.
So I set out to make the items expandable on the user tapping it. I attempted solutions from here, but it's failure to work has just left me with the conclusion the those solutions are meant for one TextView
, and not multiple TextView
s nestled inside a LinearLayout
.
Here's list_item.xml
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin">
<TextView
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="2dip"
android:textStyle="bold"
android:textColor="@color/colorAccent"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/expandable">
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d5d" />
<TextView
android:id="@+id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d40" />
<TextView
android:id="@+id/telephone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d40" />
<TextView
android:id="@+id/county"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#6438"
android:textStyle="bold"
android:textSize="20px"/>
</LinearLayout>
</LinearLayout>
I hope there's a solution to this. The result doesn't have to be animated or beautiful, but that would be appreciated. But really, I want a quick, practical solution that can be scaled to include more information and items, maybe with multiple open at once, if possible.
Thank you in advance.