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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations