Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some compressed elements in LinearLayout when I expand ExpandableLayout below #9

Open
ferPrieto opened this issue Aug 14, 2016 · 1 comment

Comments

@ferPrieto
Copy link

I am using a RecyclerView to show some elements and comparing to your sample I don't see the error. The adapter, that I am using, has some layouts inside it and when I expand the textView I defined as expandable it shows this text perfectly, but the rest elements are compressed... This is my xml:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include layout="@layout/layout_top_timeline" />

    <include layout="@layout/layout_middle_timeline" />

    <include layout="@layout/layout_bottom_timeline" />

    <TextView
        android:id="@+id/description_video" 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginLeft="14dp"
        android:layout_weight="0.13"
        android:text="@string/txt_timeline"
        android:textColor="#484b4c"
        android:textSize="14sp" />

    <com.kyo.expandablelayout.ExpandableLayout
        android:id="@+id/expandable_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/description_expanded"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="14dp"
            android:text="@string/txt_timeline"
            android:textColor="#484b4c"
            android:textSize="14sp"
            app:canExpand="true" />
    </com.kyo.expandablelayout.ExpandableLayout>




    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/line_separator_tab" />

    <TextView
        android:id="@+id/bt_view_all"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.1"
        android:background="@null"
        android:gravity="center"
        android:scaleType="fitCenter"
        android:text="View all" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/line_separator_tab" />

</LinearLayout>

<FrameLayout
    android:layout_width="64dp"
    android:layout_height="64dp"
    android:layout_marginLeft="14dp"
    android:layout_marginTop="9dp">

    <ImageView
        android:id="@+id/iv_user_picture"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:src="@drawable/icon_profile_picture_placeholder"
        app:srcCompat="@drawable/icon_profile_picture_placeholder" />

    <ImageView
        android:id="@+id/iv_reaction_emoji"
        android:layout_width="@dimen/default_icon_button"
        android:layout_height="@dimen/default_icon_button"
        android:contentDescription="@string/cd_reaction_face"
        android:scaleType="fitXY" />
</FrameLayout>

In java there is nothing special to show... I only call toggleExpansion() to do it. Using weights in your sample it works perfectly, but not in my case...Thanks

@KyoSherlock
Copy link
Owner

KyoSherlock commented Aug 15, 2016

If the compressed elements are TextView using weights(@+id/description_video and @+id/bt_view_all), this is a normal result, even if it's not what you want. The weight uses the remaining space that will change in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants