noties / Scrollable

Android scrollable tabs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hiding/Showing Header Not Working

ayz4sci opened this issue · comments

Thanks for this API.

I implemented a logic whereby I hide the header when a particular ViewPager tab is selected. I do this inside the onPageSelected, but it doesn't seems to work but it works inside the currently showing ViewPager Tab Fragment onResume.

Please how do I resolve this so that it works in the viewpager onPageSelected function.

I've resolved it.

This is the hide logic:
scrollableLayout.setMaxScrollY(0);
headerView.getLayoutParams().height = 0;

The headerView visibility was set to gone in another place before the onPageSelected is called, hence the scrollableLayout couldn't hide the header based on logic above. Instead it shows a blank space.

Would still require some clarification and understanding of why this happens.

Well, I think you you call ScrollableLayout.scrollTo(0) method to hide header and return always false from CanScrollVerticallyDelegate for a page without header.