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