I want to hide TabLayout on scrolling my content. Currently I searched the net but I found samples which hide the Toolbar, but I want to hide TabLayout. So please help me. I
While doing animation on scroll, CoordinatorLayout starts searching all the children views of AppBarLayout in a linear manner and it stops animating layouts once it finds a layout with non-scrolling tag.
Exp1:
Only layout1 will have animation
Exp2:
None of them will have animation
Exp3: If none of them have scrollFlag, none of them will have animation
Exp4: If both of them have scrollFlag, both of them will have animation
In your case, you'll need to keep toolbar outside the coordinator layout and add tablayout as a child of AppBarLayout with scrollFlags = "scroll|enterAlway"