File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
lib/java/com/google/android/material/shadow Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -72,22 +72,21 @@ public ShadowRenderer() {
7272 }
7373
7474 public ShadowRenderer (int color ) {
75+ shadowPaint = new Paint ();
7576 setShadowColor (color );
7677
7778 transparentPaint .setColor (Color .TRANSPARENT );
7879 cornerShadowPaint = new Paint (Paint .DITHER_FLAG );
7980 cornerShadowPaint .setStyle (Paint .Style .FILL );
8081
81- shadowPaint = new Paint ();
82- shadowPaint .setColor (shadowStartColor );
83-
8482 edgeShadowPaint = new Paint (cornerShadowPaint );
8583 }
8684
8785 public void setShadowColor (int color ) {
8886 shadowStartColor = ColorUtils .setAlphaComponent (color , COLOR_ALPHA_START );
8987 shadowMiddleColor = ColorUtils .setAlphaComponent (color , COLOR_ALPHA_MIDDLE );
9088 shadowEndColor = ColorUtils .setAlphaComponent (color , COLOR_ALPHA_END );
89+ shadowPaint .setColor (shadowStartColor );
9190 }
9291
9392 /** Draws an edge shadow on the canvas in the current bounds with the matrix transform applied. */
You can’t perform that action at this time.
0 commit comments