Example usage for android.support.v4.view WindowInsetsCompat isRound

List of usage examples for android.support.v4.view WindowInsetsCompat isRound

Introduction

In this page you can find the example usage for android.support.v4.view WindowInsetsCompat isRound.

Prototype

public boolean isRound() 

Source Link

Usage

From source file:ticwear.design.widget.CoordinatorLayout.java

private void setWindowInsets(WindowInsetsCompat insets) {
    if (mLastInsets != insets) {
        mLastInsets = insets;/*from www . j av  a2  s .  co m*/
        mDrawStatusBarBackground = insets != null && insets.getSystemWindowInsetTop() > 0;

        if (insets != null) {
            if (insets.isRound()) {
                if (!(mEdgeGlowTop instanceof CrescentEdgeEffect)) {
                    mEdgeGlowTop = new CrescentEdgeEffect(getContext());
                    mEdgeGlowBottom = new CrescentEdgeEffect(getContext());
                }
            } else {
                if (!(mEdgeGlowTop instanceof ClassicEdgeEffect)) {
                    mEdgeGlowTop = new ClassicEdgeEffect(getContext());
                    mEdgeGlowBottom = new ClassicEdgeEffect(getContext());
                }
            }

            mScrollBarHelper.setIsRound(insets.isRound());
        }

        setWillNotDraw(!mDrawStatusBarBackground && getBackground() == null && mEdgeGlowTop == null);
        dispatchChildApplyWindowInsets(insets);
        requestLayout();
    }
}