Android Tutorial: Creating Buttons That Appear Conditionally on Scroll

Profile Picture of Aris Papadopoulo
Aris Papadopoulo
Android Software Engineer
Android app with a button of the bottom of the screen

Imagine you’re scrolling down a very long screen (this is a common situation with Privacy Policies). As you scroll down the ‘Accept’ button scrolls off the screen. This is a short but helpful Android Tutorial for fixing this UX problem.

I will show you how to place the button in an alternative position: the bottom of the screen. When the original button reappears, the button at the bottom should disappear (which means that you should never have both buttons visible on the screen).

The support library provides us with two components that are very useful for this Android tutorial:

The button at the bottom of the screen can be implemented with the help of a Bottom Sheet component.

For identifying the scrolling behavior and triggering the appearance of the Bottom Sheet, we can use a Coordinator Layout.

Looking to hire an Android Developer?
Our experienced talent team use our advanced platform and their expertise to filter out unsuitable candidates, so you only review the best matches.
Hire Developers

Android Authority has published two quite helpful tutorials, with source code on Github for these two components:

- Bottom Sheets

Coordinator Layout

So, the first step is quite straightforward: add the button at the bottom as a Bottom Sheet.

Originally published on Feb 9, 2018Last updated on Oct 28, 2025