Search in sources :

Example 96 with ShapeDrawable

use of android.graphics.drawable.ShapeDrawable 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

ShapeDrawable (android.graphics.drawable.ShapeDrawable)96 OvalShape (android.graphics.drawable.shapes.OvalShape)44 Paint (android.graphics.Paint)32 Drawable (android.graphics.drawable.Drawable)24 LayerDrawable (android.graphics.drawable.LayerDrawable)24 StateListDrawable (android.graphics.drawable.StateListDrawable)17 SuppressLint (android.annotation.SuppressLint)16 ClipDrawable (android.graphics.drawable.ClipDrawable)16 Bitmap (android.graphics.Bitmap)15 BitmapDrawable (android.graphics.drawable.BitmapDrawable)15 BitmapShader (android.graphics.BitmapShader)14 RoundRectShape (android.graphics.drawable.shapes.RoundRectShape)14 AnimationDrawable (android.graphics.drawable.AnimationDrawable)13 ColorDrawable (android.graphics.drawable.ColorDrawable)9 RectShape (android.graphics.drawable.shapes.RectShape)8 Shape (android.graphics.drawable.shapes.Shape)7 Canvas (android.graphics.Canvas)6 Resources (android.content.res.Resources)5 Shader (android.graphics.Shader)5 TypedArray (android.content.res.TypedArray)4