public class RoundDrawable
extends Drawable
| 构造器和说明 |
|---|
RoundDrawable(Bitmap bitmap) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
draw(Canvas canvas) |
static Bitmap |
drawableToBitmap(Drawable drawable) |
static RoundDrawable |
fromBitmap(Bitmap bitmap) |
static Drawable |
fromDrawable(Drawable drawable) |
Bitmap |
getBitmap() |
int |
getOpacity() |
protected void |
onBoundsChange(Rect bounds) |
void |
setAlpha(int alpha) |
RoundDrawable |
setBorderColor(int borderColor) |
RoundDrawable |
setBorderWidth(float borderWidth) |
RoundDrawable |
setCircle(boolean circle) |
void |
setColorFilter(ColorFilter colorFilter) |
RoundDrawable |
setConner(float corner,
float topLeft,
float topRight,
float bottomLeft,
float bottomRight) |
void |
setParams(ImageView.ScaleType scaleType,
float borderWidth,
int borderColor,
boolean circle,
float corner,
float topLeft,
float topRight,
float bottomLeft,
float bottomRight)
统一设置参数
|
RoundDrawable |
setScaleType(ImageView.ScaleType scaleType) |
protected void onBoundsChange(Rect bounds)
public void setAlpha(int alpha)
public void setColorFilter(@Nullable
ColorFilter colorFilter)
public int getOpacity()
public void draw(@NonNull
Canvas canvas)
public Bitmap getBitmap()
public void setParams(ImageView.ScaleType scaleType,
float borderWidth,
int borderColor,
boolean circle,
float corner,
float topLeft,
float topRight,
float bottomLeft,
float bottomRight)
public RoundDrawable setScaleType(ImageView.ScaleType scaleType)
public RoundDrawable setCircle(boolean circle)
public RoundDrawable setBorderWidth(float borderWidth)
public RoundDrawable setBorderColor(int borderColor)
public RoundDrawable setConner(float corner, float topLeft, float topRight, float bottomLeft, float bottomRight)
public static RoundDrawable fromBitmap(Bitmap bitmap)
public static Drawable fromDrawable(Drawable drawable)
public static Bitmap drawableToBitmap(Drawable drawable)