ExpandableRelativeLayout auto expanded even if the app:ael_expanded is set to false
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.
@comeondude The same is right for ExpandableWeightLayout also. Even if 'expanded' is true, this bug appears.
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 . :)
Hi @AAkira, Was this issue resolved ?
PS - Thanks for the awesome library
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
// .............
}
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.