ExpandableCardView icon indicating copy to clipboard operation
ExpandableCardView copied to clipboard

Innerview not showing fully

Open codebeginner092 opened this issue 6 years ago • 15 comments

screenshot_20180601-095904

codebeginner092 avatar Jun 01 '18 04:06 codebeginner092

Hello,

This could be an issue with the innerview. Could you share the innerview xml?

Thanks,

Alessandro

AleSpero avatar Jun 01 '18 07:06 AleSpero

<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

codebeginner092 avatar Jun 01 '18 08:06 codebeginner092

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>

gtl23 avatar Jun 29 '18 09:06 gtl23

Hello, thanks for your feedback. I will look into it as soon as possible and will let you know, thanks!

Alessandro

AleSpero avatar Jun 29 '18 10:06 AleSpero

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

gtl23 avatar Jun 29 '18 11:06 gtl23

Has this issue been resolved, facing the same error here

tobioyelekan avatar Aug 06 '18 09:08 tobioyelekan

Hello,

Have you tried wrapping all your textviews inside a single ViewGroup (LinearLayout, RelativeLayout, whatever) in your inner view layout file?

Alessandro

AleSpero avatar Aug 07 '18 19:08 AleSpero

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

codebeginner092 avatar Aug 08 '18 04:08 codebeginner092

I have this problem too. The card height adjustment is not flexible for dynamically add.

skacuk avatar Aug 20 '18 20:08 skacuk

Has this issue been resolved??

codebeginner092 avatar Sep 06 '18 05:09 codebeginner092

Hi, same issue here! Is there any workaround for this? Regards!

mblasi avatar Jul 14 '19 01:07 mblasi

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....

mblasi avatar Jul 14 '19 02:07 mblasi

Also that is my problem am facing.. Any one help us concerning with innerview not showing full

Ndack avatar Sep 26 '19 23:09 Ndack

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>

Ndack avatar Sep 26 '19 23:09 Ndack

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.

Stjin avatar Feb 03 '20 19:02 Stjin