ExpandableCardView
ExpandableCardView copied to clipboard
Innerview not showing fully
Hello,
This could be an issue with the innerview. Could you share the innerview xml?
Thanks,
Alessandro
<LinearLayout 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="wrap_content" android:orientation="vertical" android:padding="20dp">
<TextView
android:id="@+id/sub_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="@dimen/sub_title_text_size" />
<TextView
android:id="@+id/sub_title1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sub_title"
android:textSize="@dimen/sub_title_text_size" />
<TextView
android:id="@+id/sub_title2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sub_title"
android:textSize="@dimen/sub_title_text_size" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:text="Alessandro Sperotti" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Departure Airport"
android:text="Milano Malpensa (MXP)" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:text="My Reservation Code"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OAKTHXBAI"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
If the text views are single line, then working fine, but if text views are multi line with 4 or 5 lines then issue occurs
RIghtly said @codebeginner092 , The below inner_view.xml also faces the same issue... The last radiobutton gets cropped a bit from top and bottom and its text disappears too....This could be the issue with the hieght to which the card is allowed to expand, i guess....
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_3"
android:textSize="16sp"
android:id="@+id/q3_textView"
android:textColor="@color/textColor"
android:padding="8dp"/>
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/q3_radioGroup">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_3_malloc"
android:textSize="16sp"
android:textColor="@android:color/black"
android:id="@+id/q3_1_radioButton"
android:padding="8dp"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_3_alloc"
android:textSize="16sp"
android:textColor="@android:color/black"
android:id="@+id/q3_2_radioButton"
android:padding="8dp"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_3_new"
android:textSize="16sp"
android:textColor="@android:color/black"
android:id="@+id/q3_3_radioButton"
android:padding="8dp"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_3_new_malloc"
android:textSize="16sp"
android:textColor="@android:color/black"
android:id="@+id/q3_4_radioButton"
android:padding="8dp"/>
</RadioGroup>
Hello, thanks for your feedback. I will look into it as soon as possible and will let you know, thanks!
Alessandro
Hi Alessandro, One more feature which I would like to suggest to add in this library is of cardElevation
and cardCornerRadius
like the ones we've in the default cardview. I forked your repository and tried to implement these, but since i'm a newbie in it, it's a bit difficult for me.
Gaurav Atul
Has this issue been resolved, facing the same error here
Hello,
Have you tried wrapping all your textviews inside a single ViewGroup (LinearLayout, RelativeLayout, whatever) in your inner view layout file?
Alessandro
This is what I tried
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.alespero.expandablecardview.ExpandableCardView
android:id="@+id/profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="@dimen/card_horizontal_margin"
android:layout_marginRight="@dimen/card_horizontal_margin"
android:layout_marginTop="5dp"
app:expandOnClick="true"
android:background="@color/custom_tab_color"
app:icon="@drawable/ic_person"
app:inner_view="@layout/mycustomview"
app:title="Passengers" />
</LinearLayout>
mycustomview below
<LinearLayout
android:id="@+id/parent_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
And dynamically added elements to parent_layout which is inside a linear layout
I have this problem too. The card height adjustment is not flexible for dynamically add.
Has this issue been resolved??
Hi, same issue here! Is there any workaround for this? Regards!
The problem is not about the wrapping layouts's 'layout_height:[wrap_content|match_parent]', it is related to the textview height when it has multiple lines....
Also that is my problem am facing.. Any one help us concerning with innerview not showing full
app:inner_view="@layout/mycustomview"
In your mycustomerview.xml ADD USE THIS CODE IT WORKS FOR ME
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
************* YOUR CONTENT **********************
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Any update on this issue? Experiencing this as well. And didn't found a working workaround or fix yet. I am willing to fix the issue in my fork of this project but can't really figure out how.