FileDocCategorySizeDatePackage
DrawerLayoutCompatApi21.javaAPI DocAndroid 5.1 API3700Thu Mar 12 22:22:56 GMT 2015android.support.v4.widget

DrawerLayoutCompatApi21

public class DrawerLayoutCompatApi21 extends Object
Provides functionality for DrawerLayout unique to API 21

Fields Summary
private static final int[]
THEME_ATTRS
Constructors Summary
Methods Summary
public static voidapplyMarginInsets(ViewGroup.MarginLayoutParams lp, java.lang.Object insets, int gravity)

        WindowInsets wi = (WindowInsets) insets;
        if (gravity == Gravity.LEFT) {
            wi = wi.replaceSystemWindowInsets(wi.getSystemWindowInsetLeft(),
                    wi.getSystemWindowInsetTop(), 0, wi.getSystemWindowInsetBottom());
        } else if (gravity == Gravity.RIGHT) {
            wi = wi.replaceSystemWindowInsets(0, wi.getSystemWindowInsetTop(),
                    wi.getSystemWindowInsetRight(), wi.getSystemWindowInsetBottom());
        }
        lp.leftMargin = wi.getSystemWindowInsetLeft();
        lp.topMargin = wi.getSystemWindowInsetTop();
        lp.rightMargin = wi.getSystemWindowInsetRight();
        lp.bottomMargin = wi.getSystemWindowInsetBottom();
    
public static voidconfigureApplyInsets(android.view.View drawerLayout)


         
        if (drawerLayout instanceof DrawerLayoutImpl) {
            drawerLayout.setOnApplyWindowInsetsListener(new InsetsListener());
            drawerLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }
    
public static voiddispatchChildInsets(android.view.View child, java.lang.Object insets, int gravity)

        WindowInsets wi = (WindowInsets) insets;
        if (gravity == Gravity.LEFT) {
            wi = wi.replaceSystemWindowInsets(wi.getSystemWindowInsetLeft(),
                    wi.getSystemWindowInsetTop(), 0, wi.getSystemWindowInsetBottom());
        } else if (gravity == Gravity.RIGHT) {
            wi = wi.replaceSystemWindowInsets(0, wi.getSystemWindowInsetTop(),
                    wi.getSystemWindowInsetRight(), wi.getSystemWindowInsetBottom());
        }
        child.dispatchApplyWindowInsets(wi);
    
public static android.graphics.drawable.DrawablegetDefaultStatusBarBackground(android.content.Context context)

        final TypedArray a = context.obtainStyledAttributes(THEME_ATTRS);
        try {
            return a.getDrawable(0);
        } finally {
            a.recycle();
        }
    
public static intgetTopInset(java.lang.Object insets)

        return insets != null ? ((WindowInsets) insets).getSystemWindowInsetTop() : 0;