skydoves / ExpandableLayout

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

General Sizing (Height) Issues #9

Closed joeShuff closed 4 years ago

joeShuff commented 4 years ago

Library Version is 1.0.4

Describe the Bug:

I had the following problem when trying to implement your library. I was using a deprecated expandable layout library and I decided to switch to yours. My existing solution had a header (parent) layout of height ?attr/actionBarSize so I assumed I'd just be able to reuse these layouts. I converted them to support your system of having a parent and child layout and got it compiling.

I noticed that there was a gap between my parent and secondary layout and couldn't figure out why. After looking into the source for the library I found the issue to be in the resource file ExpandableLayout/expandablelayout/src/main/res/layout/expandable_layout_parent.xml

This layout defines the height of the parent to be a static 36dp rather than adapt to the custom view the developer chooses to be the parent view.

Also, I noticed a few issues when calculating the height of the secondary layout, it being larger than the source layout file. I will open a pull request that should shed some more light on the subject.

Expected Behavior: I expect the parent layout to be the size of the layout I define as the parentLayout.

I expect the secondary layout to be the exact size that I define in the layout file, not larger.

thegamer123 commented 4 years ago

@skydoves please try to fix it asap

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.

joeShuff commented 4 years ago

Hey thanks for addressing this! I know I said I was going to open a pull request but I just couldn't get a fix consistently working so I will just delete my forked repo!

Great work!