public class CardShadowDrawable
extends Drawable
Modifier and Type | Method and Description |
---|---|
void |
draw(Canvas canvas) |
int |
getOpacity() |
static int |
getShadowBottom(float shadowSize) |
static int |
getShadowBottom(float shadowSize,
float shadowDy) |
static int |
getShadowLeft(float shadowSize) |
static int |
getShadowLeft(float shadowSize,
float shadowDx) |
static int |
getShadowRight(float shadowSize) |
static int |
getShadowRight(float shadowSize,
float shadowDx) |
static int |
getShadowTop(float shadowSize) |
static int |
getShadowTop(float shadowSize,
float shadowDy) |
void |
setAlpha(int alpha) |
void |
setColorFilter(ColorFilter cf) |
public void setAlpha(int alpha)
public static int getShadowLeft(float shadowSize, float shadowDx)
shadowSize
- shadowDx
- Light source offset applied horizontally, i.e. if shadowDx is 0, the shadows on
the left and right sides are both equal to shadowSize. If shadowDx is positive, the light
source moves to the left side, hence left shadow is decreased by shadowDx while right
shadow is increased by shadowDx. If shadowDx is negative, light source moves to the right
side and left and right shadows are adjusted accordingly.public static int getShadowLeft(float shadowSize)
shadowSize
- public static int getShadowRight(float shadowSize, float shadowDx)
shadowSize
- shadowDx
- Light source offset applied horizontally, i.e. if shadowDx is 0, the shadows on
the left and right sides are both equal to shadowSize. If shadowDx is positive, the light
source moves to the left side, hence left shadow is decreased by shadowDx while right
shadow is increased by shadowDx. If shadowDx is negative, light source moves to the right
side and left and right shadows are adjusted accordingly.public static int getShadowRight(float shadowSize)
shadowSize
- public static int getShadowTop(float shadowSize, float shadowDy)
shadowSize
- shadowDy
- Light source offset applied vertically, i.e. if shadowDy is 0, the shadows on
the top and bottom sides are both equal to shadowSize. If shadowDy is positive, the light
source moves to the top side, hence top shadow is decreased by shadowDy while bottom shadow
is increased by shadowDy. If shadowDy is negative, light source moves to the bottom side
and top and bottom shadows are adjusted accordingly.public static int getShadowTop(float shadowSize)
shadowSize
- public static int getShadowBottom(float shadowSize, float shadowDy)
shadowSize
- shadowDy
- Light source offset applied vertically, i.e. if shadowDy is 0, the shadows on
the top and bottom sides are both equal to shadowSize. If shadowDy is positive, the light
source moves to the top side, hence top shadow is decreased by shadowDy while bottom shadow
is increased by shadowDy. If shadowDy is negative, light source moves to the bottom side
and top and bottom shadows are adjusted accordingly.public static int getShadowBottom(float shadowSize)
shadowSize
- public void setColorFilter(ColorFilter cf)
public int getOpacity()
public void draw(Canvas canvas)