Handle Scrolling in Android AppbarLayout - android

I need to handle the scrolling behaviour in my app. I have a screen with Colloapsing toolbar and tablayout viewpager. In this tablayout i have 3 tables.
First tab is content description. Second Tab and Thired Tab contains the List items.
Here the content of description and the list items is small i want to disable the appbar scrolling for each tab. If the content is large or list item is larger have to enable the appbar scrolling. Can any one know how to handle this..

Related

Programmatically scroll FAB back in

I am using coordinator layout with tabs, some of which (the tabs) contain a recycler view whilst some don't. All the tabs contain a floating action button. On scrolling the recycler view with the in one of the tabs, the floating action button is scrolled off by the coordinator layout. However, when I switch to the tab without the recycler view, and not being able to scroll, the tab remains scrolled off the screen (as it was done in the tab with a recycler).
How do I bring back the floating action button back when there is no way of scrolling in the tab without the recycler or any scroll mechanism?
Turned out to be a simply solution of translating the fab back in. floatingActionButton.setTranslationY(0.0f);

How to change tabs on a TabLayout when scrolling through a ScrollView?

I added a TabLayout to my layout XML, and instead of the classic ViewPager, I just have one NestedScrollView. My problem is when I try to change tabs depending on the position of the page (e.g., OnScrollChangeListener), I use tabLayout.getTabAt(3).select();, but it screws up the tabs before it.
Any tabs before the 4th tab (getTabAt(3) == 4th tab) become unselectable. When I click it, it just selects the 4th tab.

How to hide viewpager tabs on scrolling listview.?

Scenario: I have three fragments in ViewPager. I have one list in one fragment.
Problem:I want to hide viewpager tabs and show only toolbar and list only?
Can anyone solve my problem

Scroll to top of ViewPager tab

I have a ViewPager with 4 tabs. One of the tabs has a RecyclerView and I want to be able to scroll to the top of the fragment/RecylerView when I press on the the current fragments tab.
How can I accomplish this?

Getting the width of an action bar tab

I want to have an action bar with tabs and a viewPager for the body in order to be able to scroll the tabs.
I also want to have a view to "underline" the selected tab, and have it move when I scroll the viewPager.
Is there a way to get the size of the tab? Since I'm different devices the tabs may be scrollable I can't just divide the size of the screen by the amount of tabs..
I want it to be something like this:

Categories

Resources