use of android.graphics.drawable.shapes.RoundRectShape in project FlexibleAdapter by davideas.
the class DrawableUtils method getRippleMask.
private static Drawable getRippleMask(@ColorInt int color) {
float[] outerRadii = new float[8];
// 3 is the radius of final ripple, instead of 3 we can give required final radius
Arrays.fill(outerRadii, 3);
RoundRectShape r = new RoundRectShape(outerRadii, null, null);
ShapeDrawable shapeDrawable = new ShapeDrawable(r);
shapeDrawable.getPaint().setColor(color);
return shapeDrawable;
}
use of android.graphics.drawable.shapes.RoundRectShape in project android-viewbadger by jgilfelt.
the class BadgeView method getDefaultBackground.
private ShapeDrawable getDefaultBackground() {
int r = dipToPixels(DEFAULT_CORNER_RADIUS_DIP);
float[] outerR = new float[] { r, r, r, r, r, r, r, r };
RoundRectShape rr = new RoundRectShape(outerR, null, null);
ShapeDrawable drawable = new ShapeDrawable(rr);
drawable.getPaint().setColor(badgeColor);
return drawable;
}
use of android.graphics.drawable.shapes.RoundRectShape in project FastAdapter by mikepenz.
the class FastAdapterUIUtils method getRippleMask.
/**
* helper to create an ripple mask with the given color and radius
*
* @param color the color
* @param radius the radius
* @return the mask drawable
*/
private static Drawable getRippleMask(int color, int radius) {
float[] outerRadius = new float[8];
Arrays.fill(outerRadius, radius);
RoundRectShape r = new RoundRectShape(outerRadius, null, null);
ShapeDrawable shapeDrawable = new ShapeDrawable(r);
shapeDrawable.getPaint().setColor(color);
return shapeDrawable;
}
use of android.graphics.drawable.shapes.RoundRectShape in project PhotoNoter by yydcdut.
the class TextDrawable method drawBorder.
/**
* 画边界
*
* @param canvas
*/
private void drawBorder(Canvas canvas) {
RectF rect = new RectF(getBounds());
//上下左右都加个borderThickness / 2长度
rect.inset(borderThickness / 2, borderThickness / 2);
if (shape instanceof OvalShape) {
//椭圆
canvas.drawOval(rect, borderPaint);
} else if (shape instanceof RoundRectShape) {
//圆角Rect
canvas.drawRoundRect(rect, radius, radius, borderPaint);
} else {
//Rect
canvas.drawRect(rect, borderPaint);
}
}
use of android.graphics.drawable.shapes.RoundRectShape in project AndroidDevelop by 7449.
the class BadgeView method getDefaultBackground.
private ShapeDrawable getDefaultBackground() {
int r = dipToPixels(DEFAULT_CORNER_RADIUS_DIP);
float[] outerR = new float[] { r, r, r, r, r, r, r, r };
RoundRectShape rr = new RoundRectShape(outerR, null, null);
ShapeDrawable drawable = new ShapeDrawable(rr);
drawable.getPaint().setColor(badgeColor);
return drawable;
}
Aggregations