skydoves / ExpandableLayout

🦚 An expandable layout that shows a two-level layout with an indicator.
Apache License 2.0
825 stars 54 forks source link

The expandable layout height doesn't wrap the contained listView #7

Closed MohamedHatemAbdu closed 4 years ago

MohamedHatemAbdu commented 4 years ago

Why in your demo , when i decrease the number of items in the list, the expandable view doesn't wrap the list height as below ?

image

MohamedHatemAbdu commented 4 years ago

@skydoves
I played a little with ExpandableLayoutclass and after i added the below line it works with me fine. but in fact i don't why ? image image

Could you advise ?

skydoves commented 4 years ago

@MohamedHatemAbdu Hi, I think if the secondlayout is a RecyclerView, the flow will go to the ViewGroup case. Because RecyclerView is a ViewGroup.

RecyclerView is a ViewGroup but It doesn't have any View child via added addView. So I think using child.measuredHeight is more correct instead of using setMeasureHeight. Thank you for your issue :)

This will be applied to the next release!

MohamedHatemAbdu commented 4 years ago

@skydoves There is another issue :

The recyclerviewdoesn't retain it's status correctly. If you have many items in the list and you expanded only the first item in the list, may be you find other items in the list expanded (but you didn't expand them) due to the recycling.

And i think this issue due to we save the status of expanding in Expandablelayoutview itself through a Boolean var isExpandable.

Imran-ss commented 4 years ago

This will be applied to the next release!

Hi @skydoves when are you planning to release this? I am also getting same issue.

skydoves commented 4 years ago

Hi, I fixed the measuring function internally, it's released a new version 1.0.5. If you check working well in a new version, this issue will be closed. Thank you for your issue :)

skydoves commented 4 years ago

Duplicated #5.