public class BaseShadowButton
extends AppCompatButton
| Modifier and Type | Field and Description |
|---|---|
protected android.graphics.Paint |
mBackgroundPaint |
protected int |
mHeight |
protected int |
mRadius |
protected android.graphics.RectF |
mRectF |
protected int |
mShapeType |
protected int |
mWidth |
static int |
SHAPE_TYPE_RECTANGLE |
static int |
SHAPE_TYPE_ROUND |
| Constructor and Description |
|---|
BaseShadowButton(android.content.Context context) |
BaseShadowButton(android.content.Context context,
android.util.AttributeSet attrs) |
BaseShadowButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
eraseOriginalBackgroundColor(int color) |
int |
getRadius() |
int |
getShapeType() |
protected void |
init(android.content.Context context,
android.util.AttributeSet attrs) |
protected void |
onDraw(android.graphics.Canvas canvas) |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
setRadius(int radius)
Set the radius if the shape type is SHAPE_TYPE_ROUND.
|
void |
setShapeType(int shapeType)
Set the shape type.
|
void |
setUnpressedColor(int color)
Set the unpressed color.
|
public static final int SHAPE_TYPE_ROUND
public static final int SHAPE_TYPE_RECTANGLE
protected int mWidth
protected int mHeight
protected android.graphics.Paint mBackgroundPaint
protected int mShapeType
protected int mRadius
protected android.graphics.RectF mRectF
public BaseShadowButton(android.content.Context context)
public BaseShadowButton(android.content.Context context,
android.util.AttributeSet attrs)
public BaseShadowButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
protected void init(android.content.Context context,
android.util.AttributeSet attrs)
protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
protected void onDraw(android.graphics.Canvas canvas)
protected void eraseOriginalBackgroundColor(int color)
public void setUnpressedColor(int color)
color - the color of the backgroundpublic int getShapeType()
public void setShapeType(int shapeType)
shapeType - SHAPE_TYPE_ROUND or SHAPE_TYPE_RECTANGLEpublic int getRadius()
public void setRadius(int radius)
radius - by px.