This lesson teaches you to

You should also read

Try it out

This lesson describes how to dim the system bars (that is, the status and the navigation
bars) on Android 4.0 (API level 14) and higher. Android does not provide a built-in way to dim the
system bars on earlier versions.

When you use this approach, the content doesn't resize, but the icons in the system bars
visually recede. As soon as the user touches either the status bar or the navigation bar area of
the screen, both bars become fully visible. The advantage of this
approach is that the bars are still present but their details are obscured, thus
creating an immersive experience without sacrificing easy access to the bars.

As soon as the user touches the status or navigation bar, the flag is cleared,
causing the bars to be undimmed. Once the flag has been cleared, your app needs to reset
it if you want to dim the bars again.

Figure 1 shows a gallery image in which the navigation bar is dimmed (note that the Gallery app
completely hides the status bar; it doesn't dim it). Notice that the navigation bar (right
side of the image) has faint white dots on it to represent the navigation controls:

Figure 1. Dimmed system bars.

Figure 2 shows the same gallery image, but with the system bars displayed: