noties / Scrollable

Android scrollable tabs
Apache License 2.0
1.24k stars 229 forks source link

bugs with a very large header height #22

Closed sidey closed 7 years ago

sidey commented 9 years ago

Hi Dimitry, if the header's height was longer than the screen height, it works not well

sidey commented 9 years ago

I fixed it,only if the container of header (such as LinearLayout in your example) has an EXACTLY HEIGHT. if the header container's height was "WRAP_CONTENT" , the measuredHeight of this container is smaller than the sum of children's measuredHeight, which cause onLayout in ScrollableLayout works not well.

noties commented 9 years ago

Hi! Well, yes, it works well when the size is fixed. I intentionally did so keeping in mind the performance. I guess I could add the possibility to specify wrap_content for the header in future versions

Xinng commented 8 years ago

@w4lle @noties I solve it by this link. I add a global layout listener for the header view addOnGlobalLayoutListener. In the callback method onGlobalLayout set the max scrollable distance for the scrollable layout : scrollable_layout.setMaxScrollY(mHeader.getHeight());

noties commented 7 years ago

There is an autoMaxScroll option now (for a long time actually), that automatically calculates maxScroll and keeps it updated (listens via GlobalLayoutListener)