public class CardShadowDrawable
extends Drawable
Modifier and Type | Field and Description |
---|---|
static float |
UNDEFINED |
Constructor and Description |
---|
CardShadowDrawable() |
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) |
void |
setCornerRadius(float radius) |
void |
setHideBottomShadow(boolean hideBottomShadow) |
void |
setHideTopShadow(boolean hideTopShadow) |
void |
setShadowDx(float shadowDx) |
void |
setShadowDy(float shadowDy) |
void |
setShadowEndColor(int shadowEndColor) |
void |
setShadowLeftSizeOverride(float shadowLeftSize) |
void |
setShadowRightSizeOverride(float shadowRightSizeOverride) |
void |
setShadowSize(float shadowSize) |
void |
setShadowStartColor(int shadowStartColor) |
public static final float UNDEFINED
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)
public void setShadowStartColor(int shadowStartColor)
public void setShadowEndColor(int shadowEndColor)
public void setCornerRadius(float radius)
public void setShadowSize(float shadowSize)
public void setShadowDx(float shadowDx)
public void setShadowDy(float shadowDy)
public void setHideTopShadow(boolean hideTopShadow)
public void setHideBottomShadow(boolean hideBottomShadow)
public void setShadowLeftSizeOverride(float shadowLeftSize)
public void setShadowRightSizeOverride(float shadowRightSizeOverride)