by jgilfelt

jgilfelt / SystemBarTint

[DEPRECATED] Apply background tinting to the Android system UI when using KitKat translucent modes

5.4K Stars 1.5K Forks Last release: over 6 years ago (v1.0.3) Apache License 2.0 63 Commits 3 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Android System Bar Tint

Apply background tinting to the Android system UI when using KitKat translucent modes.


Android 4.4 (KitKat) introduced translucent system UI styling for status and navigation bars. These styles are great for wallpaper based activities like the home screen launcher, but the minimal background protection provided makes them less useful for other types of activity unless you supply your own backgrounds inside your layout. Determining the size, position and existence of the system UI for a given device configuration can be non-trivial.

This library offers a simple way to create a background "tint" for the system bars, be it a color value or Drawable. By default it will give you a semi-opaque black background that will be useful for full-bleed content screens where persistent system UI is still important - like when placed over a map or photo grid.


You must first enable translucency in your Activity - either by using or inheriting from one of the various

themes, by setting the
theme attributes to
or by applying the
flags to your Activity window in code.

If translucency is not enabled or your app is running on a platform version earlier than API 19, the system UI will appear as normal. You should not enable tinting when using fullscreen or immersive window modes. You can safely use this library on Android versions back to API 10.

To enable the tint:

protected void onCreate(Bundle savedInstanceState) {
    // create our manager instance after the content view is set
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    // enable status bar tint
    // enable navigation bar tint

To provide custom tint color values or drawables:

// set a custom tint color for all system bars
// set a custom navigation bar resource
// set a custom status bar drawable


Developers should not need to concern themselves with the size or positioning of the system UI. Use

in conjunction with
to achieve the optimal layout for full bleed content screens that need to be padded within the system UI bounds. However, certain elements like the
provided by Google Play Services may force you to determine the pixel insets for the system bars in order to provide the appropriate layout effect.

Use the

class provided by
to access those inset values:
SystemBarConfig config = tintManager.getConfig();
map.setPadding(0, config.getPixelInsetTop(), config.getPixelInsetRight(), config.getPixelInsetBottom());


Download and include the JAR in your project, or add the dependency in your

dependencies {
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'

This repository also includes a sample app which you can download from Google Play:

Android app on Google Play


Author: Jeff Gilfelt

Sample app uses Android-Color-Picker by chiralcode


Copyright 2013 readyState Software Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.