use of android.graphics.drawable.ShapeDrawable 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.ShapeDrawable in project Bitocle by mthli.
the class DefaultHeaderTransformer method applyProgressBarSettings.
private void applyProgressBarSettings() {
if (mHeaderProgressBar != null) {
ShapeDrawable shape = new ShapeDrawable();
shape.setShape(new RectShape());
shape.getPaint().setColor(mProgressDrawableColor);
ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL);
mHeaderProgressBar.setProgressDrawable(clipDrawable);
}
}
use of android.graphics.drawable.ShapeDrawable in project MaterialLibrary by DeveloperPaul123.
the class MaterialFABMenuItem method getShapeDrawable.
private Drawable getShapeDrawable(int color) {
ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());
final Paint fillPaint = shapeDrawable.getPaint();
fillPaint.setAntiAlias(true);
fillPaint.setColor(color);
return shapeDrawable;
}
use of android.graphics.drawable.ShapeDrawable 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;
}
use of android.graphics.drawable.ShapeDrawable in project UltimateAndroid by cymcsg.
the class AddFloatingActionButton method getIconDrawable.
@Override
Drawable getIconDrawable() {
final float iconSize = getDimension(R.dimen.fab_icon_size);
final float iconHalfSize = iconSize / 2f;
final float plusSize = getDimension(R.dimen.fab_plus_icon_size);
final float plusHalfStroke = getDimension(R.dimen.fab_plus_icon_stroke) / 2f;
final float plusOffset = (iconSize - plusSize) / 2f;
final Shape shape = new Shape() {
@Override
public void draw(Canvas canvas, Paint paint) {
canvas.drawRect(plusOffset, iconHalfSize - plusHalfStroke, iconSize - plusOffset, iconHalfSize + plusHalfStroke, paint);
canvas.drawRect(iconHalfSize - plusHalfStroke, plusOffset, iconHalfSize + plusHalfStroke, iconSize - plusOffset, paint);
}
};
ShapeDrawable drawable = new ShapeDrawable(shape);
final Paint paint = drawable.getPaint();
paint.setColor(mPlusColor);
paint.setStyle(Style.FILL);
paint.setAntiAlias(true);
return drawable;
}
Aggregations