Set Navigation Bar Transparent
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
or add <item name= "Android:windowtranslucentnavigation" in theme >true</item>
/** * Convenience function to set the flag bits as specified in flags, as * per {@link #setFlags}. * @param flags the flag bits to be set. * @see #setFlags * @see #clearFlags */public void addflags (int flags) { setflags (flags, flags); }
/** * Set The flags of the window, as per the * {@link windowmanager.layoutparams windowmanager.layoutparams} * Flags. * * <p>note that some flags must being set before the window decoration is * created * {@link #setContentView (View, Android.view.ViewGroup.LayoutParams)} or * {@link #getDecorView ()}: * {@link Windo Wmanager.layoutparams#flag_layout_in_screen} and * {@link Windowmanager.layoutparams#flag_layout_inset_decor}. These * 'll be set to the based on the {@link Android. r.attr#windowisfloating} * attribute. * * @param flags The new window flags (see WINDOWMANAGER.LAYOUTPARAMS). * @param mask which of the window flag bits to modify. * @see #addFlags * @see #clearFlags */public void setflags (int flags, int mask) {final WINDOWMANAGER.L Ayoutparams attrs = GetAttributes (); Attrs.flags = (Attrs.flags&~mask) | (Flags&mask); if ((MASK&WINDOWMANAGER.LAyoutparams.flag_needs_menu_key)! = 0) {attrs.privateflags |= WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEED S_menu_key; } mforcedwindowflags |= Mask; if (mcallback! = null) {mcallback.onwindowattributeschanged (attrs); } }
which
Attrs.flags = (Attrs.flags&~mask) | (Flags&mask);
Who can explain the meaning of this line of code? I've forgotten everything I've learned.
So
public boolean existflag (int flags) { windowmanager.layoutparams attrs= GetWindow (). GetAttributes (); if (Attrs.flags = = ((attrs.flags&~flags) | (flags&flags))) { return true; } return false;}
KitKat on the validation pass.