The Android KitKat has a new feature that allows you to set the background of the mobile status bar, keep the style of the phone's entire interface consistent, and look very refreshing, which is the default style of Android L on this year's Google I/O. Now let's see how we can add this to our program with this cool black freak pulling off the slag-sky function. One.
Android 4.4 offers a transparent system UI style to the status bar and navigation bar, so that you don't have to face the dark two black bars every day before, and you can adjust to the same style as the activity to form a complete theme.
The first thing to do is to open the transparent theme function of the activity, which can be used to inherit the theme of the subject. Translucentdecor the theme, and then set the Subject property of Android:windowtranslucentnavigation or Android:windowtranslucentstatus to true. Alternatively, open the Flag_translucent_navigation or Flag_translucent_status window logo in the activity's code. Since the transparent theme cannot be used in previous versions of 4.4, the system style is no different from the previous one, which is to see no change, this is a compatibility mode, which can be compatible with API 10.
Activate a theme
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
Create an administrative instance of the status bar
Systembartintmanager Tintmanager = new Systembartintmanager (this);
Activate status bar settings
Tintmanager.setstatusbartintenabled (TRUE);
Activate navigation bar settings
Tintmanager.setnavigationbartintenabled (TRUE);
}
Set the status bar color and picture
Set a color to the system bar
Tintmanager.settintcolor (Color.parsecolor ("#99000FF"));
Set a style background to the navigation bar
Tintmanager.setnavigationbartintresource (R.drawable.my_tint);
Set a status bar resource
Tintmanager.setstatusbartintdrawable (mydrawable);
4. Open Source Download Address