Code example for BlurMaskFilter

0
    this.topColor = topColor;
    this.bottomColor = bottomColor;
    this.borderColor = borderColor;
    this.innerPaneColor = innerPaneColor;
    this.shadowSize = shadowSize;
    this.blurMaskFilter = new BlurMaskFilter(shadowSize, Blur.INNER);
  } 
 
  @Override 
  public void draw(Canvas canvas) {
    if (isCanvasRectEmpty()) { 
      return; 
    } 
 
    Paint paint = this.paint;
 
    // First of all, render the shadow. 
    paint.reset();
    paint.setAntiAlias(true);
    paint.setColor(0x80000000);
    paint.setShadowLayer(shadowSize * 0.6f, shadowSize, shadowSize, 0xFF404040);