An open source library for the Android immersive notification bar Systembartint simple to use

Source: Internet
Author: User

Systembartint Link: https://github.com/jgilfelt/SystemBarTint

The first to listen to this concept is in the MI4 press conference, rebels advocated a concept, let the original Enron, Black notice bar, into the theme of the app with the color, after degrees Niang, learned from 4.4, Android already has this concept (Immersivemode).

The effect is as follows:

The use of the method is relatively simple, the official gave an example:

public class Matchactionbaractivity extends Activity {@Overrideprotected void onCreate (Bundle savedinstancestate) { Super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_match_actionbar); if (Build.VERSION.SDK_INT >= Build.version_codes. KITKAT) {Settranslucentstatus (true);} Systembartintmanager Tintmanager = new Systembartintmanager (this); tintmanager.setstatusbartintenabled (true); Tintmanager.setstatusbartintresource (R.COLOR.STATUSBAR_BG);//notification bar required color} @TargetApi private void Settranslucentstatus (Boolean on) {Window win = GetWindow (); Windowmanager.layoutparams winparams = Win.getattributes (); final int bits = WindowManager.LayoutParams.FLAG_ Translucent_status;if (ON) {winparams.flags |= bits;} else {winparams.flags &= ~bits;} Win.setattributes (Winparams);}}




An open source library for the Android immersive notification bar Systembartint simple to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.