public SelectableRoundedCornerDrawable(Bitmap bitmap, Resources r) {
mbBitmap = bitmap;
mmBitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
if (bitmap != null) {
mmBitmapWidth = bitmap.getScaledWidth(r.getDisplayMetrics());
mmBitmapHeight = bitmap.getScaledHeight(r.getDisplayMetrics());
} else {
mmBitmapWidth = mmBitmapHeight = -1;
}
mmBitmapRect.set(0, 0, mmBitmapWidth, mmBitmapHeight);
mmBitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mmBitmapPaint.setStyle(Paint.Style.FILL);
mmBitmapPaint.setShader(mmBitmapShader);
mmBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mmBorderPaint.setStyle(Paint.Style.STROKE);
mmBorderPaint.setColor(mmBorderColor.getColorForState(getState(), DEFAULT_BORDER_COLOR));
mmBorderPaint.setStrokeWidth(mmBorderWidth);
}
SelectableRoundedImageView.java 文件源码
java
阅读 48
收藏 0
点赞 0
评论 0
项目:BBSSDK-for-Android
作者:
评论列表
文章目录