Search in sources :

Example 46 with ViewOutlineProvider

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

the class TextView 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) AutoSizeTextView(carbon.view.AutoSizeTextView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) MaxSizeView(carbon.view.MaxSizeView) ValidStateView(carbon.view.ValidStateView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) TextAppearanceView(carbon.view.TextAppearanceView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 47 with ViewOutlineProvider

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

the class RecyclerView 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) 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 48 with ViewOutlineProvider

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

the class EditText 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) TextView(android.widget.TextView) InputView(carbon.view.InputView) AutoSizeTextView(carbon.view.AutoSizeTextView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) MaxSizeView(carbon.view.MaxSizeView) ValidStateView(carbon.view.ValidStateView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) TextAppearanceView(carbon.view.TextAppearanceView) StateAnimatorView(carbon.view.StateAnimatorView)

Example 49 with ViewOutlineProvider

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

the class FlowLayout 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 50 with ViewOutlineProvider

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

the class DrawerLayout 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)55 Outline (android.graphics.Outline)54 View (android.view.View)54 TextView (android.widget.TextView)24 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)17 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