Search in sources :

Example 46 with OvalShape

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;
}
Also used : LayerDrawable(android.graphics.drawable.LayerDrawable) ShapeDrawable(android.graphics.drawable.ShapeDrawable) OvalShape(android.graphics.drawable.shapes.OvalShape) Point(com.google.maps.android.geometry.Point) SuppressLint(android.annotation.SuppressLint)

Example 47 with OvalShape

use of android.graphics.drawable.shapes.OvalShape in project android_packages_apps_crDroidSettings by crdroidandroid.

the class ColorPickerPreference method createOvalShape.

private static ShapeDrawable createOvalShape(int size, int color) {
    ShapeDrawable shape = new ShapeDrawable(new OvalShape());
    shape.setIntrinsicHeight(size);
    shape.setIntrinsicWidth(size);
    shape.getPaint().setColor(color);
    return shape;
}
Also used : ShapeDrawable(android.graphics.drawable.ShapeDrawable) OvalShape(android.graphics.drawable.shapes.OvalShape)

Example 48 with OvalShape

use of android.graphics.drawable.shapes.OvalShape in project android_packages_apps_crDroidSettings by crdroidandroid.

the class FloatingActionButton method createOuterStrokeDrawable.

private Drawable createOuterStrokeDrawable(float strokeWidth) {
    ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());
    final Paint paint = shapeDrawable.getPaint();
    paint.setAntiAlias(true);
    paint.setStrokeWidth(strokeWidth);
    paint.setStyle(Style.STROKE);
    paint.setColor(Color.BLACK);
    paint.setAlpha(opacityToAlpha(0.02f));
    return shapeDrawable;
}
Also used : ShapeDrawable(android.graphics.drawable.ShapeDrawable) Paint(android.graphics.Paint) OvalShape(android.graphics.drawable.shapes.OvalShape)

Aggregations

OvalShape (android.graphics.drawable.shapes.OvalShape)48 ShapeDrawable (android.graphics.drawable.ShapeDrawable)44 Paint (android.graphics.Paint)20 SuppressLint (android.annotation.SuppressLint)12 ColorDrawable (android.graphics.drawable.ColorDrawable)9 StateListDrawable (android.graphics.drawable.StateListDrawable)9 LayerDrawable (android.graphics.drawable.LayerDrawable)8 Drawable (android.graphics.drawable.Drawable)6 ImageView (android.widget.ImageView)5 LinearGradient (android.graphics.LinearGradient)4 Shader (android.graphics.Shader)4 ShaderFactory (android.graphics.drawable.ShapeDrawable.ShaderFactory)4 View (android.view.View)3 Bitmap (android.graphics.Bitmap)2 Rect (android.graphics.Rect)2 RectF (android.graphics.RectF)2 RoundRectShape (android.graphics.drawable.shapes.RoundRectShape)2 FloatingActionButton (android.support.design.widget.FloatingActionButton)2 LinearInterpolator (android.view.animation.LinearInterpolator)2 RelativeLayout (android.widget.RelativeLayout)2