Search in sources :

Example 41 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project Carbon by ZieIony.

the class RelativeLayout method updateCorners.

private void updateCorners() {
    if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
        if (!Carbon.isShapeRect(shapeModel, boundsRect))
            setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                if (Carbon.isShapeRect(shapeModel, boundsRect)) {
                    outline.setRect(0, 0, getWidth(), getHeight());
                } else {
                    shadowDrawable.setBounds(0, 0, getWidth(), getHeight());
                    shadowDrawable.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);
                    shadowDrawable.getOutline(outline);
                }
            }
        });
    }
    boundsRect.set(shadowDrawable.getBounds());
    shadowDrawable.getPathForSize(getWidth(), getHeight(), cornersMask);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 42 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project Carbon by ZieIony.

the class GridLayout method updateCorners.

private void updateCorners() {
    if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
        if (!Carbon.isShapeRect(shapeModel, boundsRect))
            setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                if (Carbon.isShapeRect(shapeModel, boundsRect)) {
                    outline.setRect(0, 0, getWidth(), getHeight());
                } else {
                    shadowDrawable.setBounds(0, 0, getWidth(), getHeight());
                    shadowDrawable.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);
                    shadowDrawable.getOutline(outline);
                }
            }
        });
    }
    boundsRect.set(shadowDrawable.getBounds());
    shadowDrawable.getPathForSize(getWidth(), getHeight(), cornersMask);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 43 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project Carbon by ZieIony.

the class ImageView method updateCorners.

private void updateCorners() {
    if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
        if (!Carbon.isShapeRect(shapeModel, boundsRect))
            setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                if (Carbon.isShapeRect(shapeModel, boundsRect)) {
                    outline.setRect(0, 0, getWidth(), getHeight());
                } else {
                    shadowDrawable.setBounds(0, 0, getWidth(), getHeight());
                    shadowDrawable.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);
                    shadowDrawable.getOutline(outline);
                }
            }
        });
    }
    boundsRect.set(shadowDrawable.getBounds());
    shadowDrawable.getPathForSize(getWidth(), getHeight(), cornersMask);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) TintedView(carbon.view.TintedView) ShadowView(carbon.view.ShadowView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 44 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project Carbon by ZieIony.

the class LinearLayout method updateCorners.

private void updateCorners() {
    if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
        if (!Carbon.isShapeRect(shapeModel, boundsRect))
            setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                if (Carbon.isShapeRect(shapeModel, boundsRect)) {
                    outline.setRect(0, 0, getWidth(), getHeight());
                } else {
                    shadowDrawable.setBounds(0, 0, getWidth(), getHeight());
                    shadowDrawable.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);
                    shadowDrawable.getOutline(outline);
                }
            }
        });
    }
    boundsRect.set(shadowDrawable.getBounds());
    shadowDrawable.getPathForSize(getWidth(), getHeight(), cornersMask);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 45 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project Carbon by ZieIony.

the class FrameLayout method updateCorners.

private void updateCorners() {
    if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
        if (!Carbon.isShapeRect(shapeModel, boundsRect))
            setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                if (Carbon.isShapeRect(shapeModel, boundsRect)) {
                    outline.setRect(0, 0, getWidth(), getHeight());
                } else {
                    shadowDrawable.setBounds(0, 0, getWidth(), getHeight());
                    shadowDrawable.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);
                    shadowDrawable.getOutline(outline);
                }
            }
        });
    }
    boundsRect.set(shadowDrawable.getBounds());
    shadowDrawable.getPathForSize(getWidth(), getHeight(), cornersMask);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView)

Aggregations

ViewOutlineProvider (android.view.ViewOutlineProvider)56 Outline (android.graphics.Outline)55 View (android.view.View)55 TextView (android.widget.TextView)25 AnimatedView (carbon.animation.AnimatedView)17 RippleView (carbon.drawable.ripple.RippleView)17 MarginView (carbon.view.MarginView)17 MaxSizeView (carbon.view.MaxSizeView)17 RevealView (carbon.view.RevealView)16 ShadowView (carbon.view.ShadowView)16 ShapeModelView (carbon.view.ShapeModelView)16 StateAnimatorView (carbon.view.StateAnimatorView)16 StrokeView (carbon.view.StrokeView)16 TouchMarginView (carbon.view.TouchMarginView)16 VisibleView (carbon.view.VisibleView)16 TargetApi (android.annotation.TargetApi)12 ComponentView (carbon.component.ComponentView)12 InsetView (carbon.view.InsetView)12 TransformationView (carbon.view.TransformationView)12 BehaviorView (carbon.view.BehaviorView)10