noties / Scrollable

Android scrollable tabs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bugs with a very large header height

sidey opened this issue · comments

commented

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

commented

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.

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

commented

@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());

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