ExpandableLayout icon indicating copy to clipboard operation
ExpandableLayout copied to clipboard

ExpandableRelativeLayout auto expanded even if the app:ael_expanded is set to false

Open masudias opened this issue 9 years ago • 5 comments

When inflating the layout from a Fragment, the ExpandableRelativeLayout auto expands even if the app:ael_expanded is set to false. I've checked the value of isExpanded inside onCreateView function and it returns false. This is the strange thing actually, when the keyboard opens the ExpandableRelativeLayout collapses. My ExpandableRelativeLayout contains EditText and yes the EditTexts are not focused. First I thought, the EditTexts are focusing automatically, that's why this is happening. I disabled the EditText focus, but the result is still the same.

masudias avatar Feb 15 '16 12:02 masudias

@comeondude The same is right for ExpandableWeightLayout also. Even if 'expanded' is true, this bug appears.

zanctor avatar Feb 22 '16 17:02 zanctor

I had the same problem .i was using view pager. even if i set 'expanded' to false. the layout remains open. i tried many things, all ending in problems where layout wont pop up anymore. Expanable layout as a fragment in view pager. Atlast i was able to solve the problem

At first the layout was like [CoordinatorLayout] [Viewpager] [/CoordinatorLayout]

I changed layout to [RelativeLayout] [CoordinatorLayout] [Viewpager] [/CoordinatorLayout] [/RelativeLayout]

and the expandable layout works like in activity! remains closed and pop up on click. Discovered accidentally . :)

victorileaf avatar Mar 21 '16 08:03 victorileaf

Hi @AAkira, Was this issue resolved ?

PS - Thanks for the awesome library

ghost avatar Jul 29 '16 07:07 ghost

Guys first check the state of the expandable when creating it. Even if it is expanded before for bug or somethings else you can collapse it by code. I solved my problem this way. I hope this may help you.

private boolean expandState = false;
@Override
public void onCreate(Bundle savedInstanceState)
 {
    if(!expandState)
    {
         expandableRelativeLayout.collapse();
    }
    // Other things with expandableRelativeLayout
    // ............. 
}

fahimshahrierrasel avatar Oct 23 '16 15:10 fahimshahrierrasel

This issue still can be reproduced.

    <com.github.aakira.expandablelayout.ExpandableRelativeLayout

                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_marginTop="@dimen/double_margin_map"
                android:id="@+id/about_offer"
                app:ael_expanded="false"
                app:ael_duration="500"
                app:ael_orientation="vertical"

        >

            <include
                    layout="@layout/terms_of_use"
            />
        </com.github.aakira.expandablelayout.ExpandableRelativeLayout>

above XML results in expanded ExpandableRelativeLayout by-default. This behaviour is same even in IntelliJ idea layout preview.

ghost avatar May 12 '17 12:05 ghost