Material Design - floating action button hiding in listview scroll (like in google+)

13,475

Solution 1

this project has couple of example of hiding and showing fab button, actionbar and tabs.

https://github.com/lawloretienne/QuickReturn

Solution 2

Google plus doesn't use ListView, it uses the new RecyclerView the new RecyclerView have an OnScrollListener that receives pixels scrolled. They then use standard View animations and transformations to move the thing out of view. With View.setTranslationY(val); and View.animate().setTranslationYBy(val);

Share:
13,475
CQM
Author by

CQM

Updated on July 17, 2022

Comments

  • CQM
    CQM almost 2 years

    Hello how do I hide a floating action button when scrolling down like in the Google+ app?

    I have seen various ways of detecting scrolling in a listview, but what I've seen so far is only detecting the rendering of child cells as they move on/off screen. This isn't what Google+ is doing at all and this won't work for me because I have a large header cell and it is painfully obvious that the floating action button does not disappear fast enough.

    Any insight appreciated