Here is my XML. I'm adding the text dynamically and setting it as wrap_content in the XML, but afterwards the textview does not seem to be resizing based on the contained text. I'm using an expandable layout to expand on click from https://github.com/AAkira/ExpandableLayout. I'm assuming one of the parent heights have been set wrong, but I've check pretty much all combinations and nothing seems to be helping. Setting the height as hardcoded (500dp) works perfectly fine. Can anyone help me out? Thanks!
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:card_view="http://schemas.android.com/tools">
<ScrollView
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cardviewTwitterMessages"
android:layout_marginBottom="8dp"
card_view:cardElevation="4dp"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/expandableButton1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:drawableLeft="@android:drawable/arrow_down_float"
android:onClick="expandableButton1"
android:paddingRight="10dp"
android:text="Recent Tweets"
android:textColor="#fff" />
<com.github.aakira.expandablelayout.ExpandableRelativeLayout
android:id="@+id/expandableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/expandableButton1"
android:background="#fff"
android:padding="16dp"
app:ael_duration="400"
app:ael_expanded="false"
app:ael_interpolator="bounce"
app:ael_orientation="vertical">
<TextView
android:textColorLink="@color/colorPrimary"
android:id="@+id/TwitterMessagesText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="50"/>
</com.github.aakira.expandablelayout.ExpandableRelativeLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_input_add"
android:tint="#fdfdfd" />
</android.support.design.widget.CoordinatorLayout>