Closed ghost closed 5 years ago
Hi, sorry but there's not enough information in the screenshots to be able to figure out what the problem is. You could try removing ExpandableLayout to see if the problem is being caused by it.
It seems to be related to how you're setting the height. ExpandableLayout works best when the size of the children is fixed. Is your parent recycler view set to wrap_content? That might cause the issue.
Please forgive me for deleting my own comment here, because I post a apart of UI that I have not been allowed from my boss (this app is not yet published). Yeah, I set wrap_content
<net.cachapa.expandablelayout.ExpandableLayout
android:id="@+id/expandable_layout_am_invoices"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:el_duration="@android:integer/config_mediumAnimTime"
app:el_expanded="false"
app:el_parallax="0.5">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_am_invoices"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:paddingLeft="8dp"
android:paddingRight="8dp"></android.support.v7.widget.RecyclerView>
</net.cachapa.expandablelayout.ExpandableLayout>
But I don't understand a reason, why the Activity does not have this issue, the code is same
I meant the parent recycler view. Also, having a recycler view inside Expandable layout maynot be the best way to solve what you have since it might cause the recycler view to misjudge its own size.
You mean I should have a layout (such as LinearLayout) which contains recyclerview and that layout inside expandablelayout? Or I should set fixed size for parent layout of recyclerview?
I mean putting a recyclerview inside the expandable layout is a bad idea because recyclerview sizes its children asynchronously. You're essentially asking the recyclerview to size it's children while it's collapsed and hidden.
Nesting recyclerviews is a bad idea anyway for performance reasons.
So what should I do to get that animation. I want ExpandableLayout to expanded/collapsed a list of CardView items, maybe not use RecyclerView. Or I should set height for RecyclerView? You can recommend me a solution?
If you use a regular linearlayout instead of a recyclerview it should work fine
Thank you. Now, let me try.
Hi, I think the issue was solved, my team agreed that the plan is to keep the child Views size fixed. Expanded / collapsed animation in your ExpandableLayout is so smooth. Thank you so much.
np, happy you were able to fix it
Hi, I have an issue and I hope you can help me. My app is using your library for collapsing/expanding the horizontal RecyclerView, which is in a Fragment, but items in RecyclerView were cut content (I don't know it is cut or compressed). This problem only occurs when my application is built on a device of 720x1280 size. When running with a larger size like 1440x2880, this problem does not occur. Note, this problem occurs with content view of Fragment, while Activity is not (no matter which size), because I use your library on Activity for the same layout. And finally, please forgive me because my English is not very good. Thank you so much.