@Override protected boolean drawChild(@NonNull Canvas canvas, @NonNull View child, long drawingTime) { if (child instanceof ShadowView && (!Carbon.IS_LOLLIPOP_OR_HIGHER || ((RenderingModeView) child).getRenderingMode() == RenderingMode.Software || ((ShadowView) child).getElevationShadowColor() != null)) { ShadowView shadowView = (ShadowView) child; shadowView.drawShadow(canvas); } if (child instanceof RippleView) { RippleView rippleView = (RippleView) child; RippleDrawable rippleDrawable = rippleView.getRippleDrawable(); if (rippleDrawable != null && rippleDrawable.getStyle() == RippleDrawable.Style.Borderless) { int saveCount = canvas.save(); canvas.translate(child.getLeft(), child.getTop()); canvas.concat(child.getMatrix()); rippleDrawable.draw(canvas); canvas.restoreToCount(saveCount); } } return super.drawChild(canvas, child, drawingTime); }