Programmatically scroll FAB back in

Viewed 45

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?

1 Answers

Turned out to be a simply solution of translating the fab back in. floatingActionButton.setTranslationY(0.0f);

Related