private static Shader createRadialGradient ( @ NonNull final Orientation orientation , final int bitmapSize , final float radius ) { PointF center = new PointF ( ) ; switch ( orientation ) { case TOP_LEFT : center . x = bitmapSize ; center . y = bitmapSize ; break ; case TOP_RIGHT : center . y = bitmapSize ; break ; case BOTTOM_LEFT : center . x = bitmapSize ; break ; case BOTTOM_RIGHT : break ; default : throw new IllegalArgumentException ( "Invalid orientation: " + orientation ) ; } return new RadialGradient ( center . x , center . y , radius , Color . TRANSPARENT , Color . BLACK , Shader . TileMode . CLAMP ) ; }
Creates and returns a shader which can be used to draw a shadow which located at a corner of an elevated view .