cachapa / ExpandableLayout

An expandable layout container for Android
Apache License 2.0
2.34k stars 273 forks source link

Multiple RecyclerViews #51

Closed egevirgen closed 6 years ago

egevirgen commented 6 years ago

Hello, I am using a vertical RecyclerView and in every item of this RecyclerView I have a horizontal RecyclerView. What I'm trying to achieve is when I click on an item of vertical one, its horizontal child should expand. It works actually, but my inner RecyclerView's items are disappearing after expanding. If I call adapter.notifyDataSetChanged when State==Expanded inner recyclerview shows properly, but as you can imagine I cannot see expanding animation if I do that. Besides, I'm fetching photos from firebase and whenever I call notifyDataSetChanged this causes heavy network operation again and again.

Long story short, is there a way prevent my inner RecyclerView being disappearing so I won't need to call notifyDataSetChanged again? Thanks in advance.

cachapa commented 6 years ago

Did you set a specific height on your nested RecyclerViews? What you describe might happen If you're using "wrap_content" since the RV would have height=0 before the data has been fetched and that might be causing the issue. Generally, nesting recyclerviews is something you should avoid for performance reasons anyway since each nested RV will be inflating a lot of views in real time while scrolling.

In any case, this issue tracker isn't meant for general Android support and this doesn't seem to be an issue with ExpandableLayout so I'm closing the issue.