traex / ExpandableLayout

Implementation of ExpandableListview with custom header and custom content.
MIT License
1.64k stars 361 forks source link

Bug? contentLayout never full width if orientation = vertical #52

Open taar1 opened 8 years ago

taar1 commented 8 years ago

Generally it works fine but something is behaving very strange. I have this expandable list:

<com.andexert.expandablelayout.library.ExpandableLayout
            android:id="@+id/socialmediaLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/md_material_blue_600"
            app:el_contentLayout="@layout/layout_socialmedia_body"
            app:el_duration="400"
            app:el_headerLayout="@layout/layout_socialmedia_header" />

and this is the layout of "layout_socialmedia_body":

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <EditText
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:gravity="center"
        android:hint="Hello World !"
        android:textColor="@android:color/white"
        android:background="#c0392b"/>

    <Button
        android:layout_below="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="click ME !"/>

</LinearLayout>

When I now tap on the header to expand the list, the body layout displays but only uses about 30% of the screen width, even though I defined it with "match_parent". It only seems to happen if I define the LinearLayout orientation to "vertical", if I define it "horizontal" the view actually uses the full width of the screen. Also if I change LinearLayout to RelativeLayout it also uses the full width of the screen. The only time it doesn't work is if I use LinearLayout together with orientation "vertcal".

I assume this is a bug? Please fix, thank you :)

zeero0 commented 6 years ago

Is it already fixed?