SystemBarTint, an open-source library in the Android immersive notification bar, is easy to use and the android immersive Status Bar

Source: Internet
Author: User

SystemBarTint, an open-source library in the Android immersive notification bar, is easy to use and the android immersive Status Bar

SystemBarTint link: https://github.com/jgilfelt/SystemBarTint

The concept was first heard at the MI4 press conference. A concept advocated by rebuss turned the original bright and black notification bar into a color consistent with the APP theme, it was learned that Android already had this concept (ImmersiveMode) starting from 4.4.

The effect is as follows:

The usage is relatively simple. An official example is provided:

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); tintMa Nager. setStatusBarTintResource (R. color. statusbar_bg); // color required in the notification bar} @ TargetApi (19) 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 );}}




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.