use of android.graphics.drawable.shapes.OvalShape in project DatePicker by AigeStudio.
the class MonthView method createCircle.
private BGCircle createCircle(float x, float y) {
OvalShape circle = new OvalShape();
circle.resize(0, 0);
ShapeDrawable drawable = new ShapeDrawable(circle);
BGCircle circle1 = new BGCircle(drawable);
circle1.setX(x);
circle1.setY(y);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
circle1.setRadius(circleRadius);
}
drawable.getPaint().setColor(mTManager.colorBGCircle());
return circle1;
}
use of android.graphics.drawable.shapes.OvalShape in project UltimateAndroid by cymcsg.
the class FloatingActionButton method createDrawable.
private Drawable createDrawable(int color) {
OvalShape ovalShape = new OvalShape();
ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
shapeDrawable.getPaint().setColor(color);
if (mShadow) {
LayerDrawable layerDrawable = new LayerDrawable(new Drawable[] { getResources().getDrawable(R.drawable.floating_acition_button_shadow), shapeDrawable });
int shadowSize = getDimension(mType == TYPE_NORMAL ? R.dimen.fab_shadow_size : R.dimen.fab_mini_shadow_size);
layerDrawable.setLayerInset(1, shadowSize, shadowSize, shadowSize, shadowSize);
return layerDrawable;
} else {
return shapeDrawable;
}
}
use of android.graphics.drawable.shapes.OvalShape in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FloatingActionButton method createCircleDrawable.
private Drawable createCircleDrawable(int color, float strokeWidth) {
int alpha = Color.alpha(color);
int opaqueColor = opaque(color);
ShapeDrawable fillDrawable = new ShapeDrawable(new OvalShape());
final Paint paint = fillDrawable.getPaint();
paint.setAntiAlias(true);
paint.setColor(opaqueColor);
Drawable[] layers = { fillDrawable, createInnerStrokesDrawable(opaqueColor, strokeWidth) };
LayerDrawable drawable = alpha == 255 || !mStrokeVisible ? new LayerDrawable(layers) : new TranslucentLayerDrawable(alpha, layers);
int halfStrokeWidth = (int) (strokeWidth / 2f);
drawable.setLayerInset(1, halfStrokeWidth, halfStrokeWidth, halfStrokeWidth, halfStrokeWidth);
return drawable;
}
use of android.graphics.drawable.shapes.OvalShape in project coins-android by bubelov.
the class StaticClusterRenderer method makeClusterBackground.
private LayerDrawable makeClusterBackground() {
mColoredCircleBackground = new ShapeDrawable(new OvalShape());
ShapeDrawable outline = new ShapeDrawable(new OvalShape());
// Transparent white.
outline.getPaint().setColor(Color.WHITE);
LayerDrawable background = new LayerDrawable(new Drawable[] { outline, mColoredCircleBackground });
int strokeWidth = (int) (mDensity * 1.5f);
background.setLayerInset(1, strokeWidth, strokeWidth, strokeWidth, strokeWidth);
return background;
}
Aggregations