I have a ShapeDrawable Object in my class in the form of an arc.
ShapeDrawable progressArc = new ShapeDrawable(new ArcShape(120, 12));
Now I would like to use a radial gradient effect on the color and also display just a ring instead of a filled arc. Does the Android SDK provide such a feature?
Currently using the below code, I get a gradient on the circle.
progressArc.setIntrinsicHeight(500);
progressArc.setIntrinsicWidth(500);
Shader shader1 = new LinearGradient(5, -5, 35, 0, new int[] { 0xFF33B5E5,0xFFFFFFFF }, null, Shader.TileMode.MIRROR);
progressArc.getPaint().setShader(shader1);
progressArc.getPaint().setStrokeWidth(1);
progressArc.getPaint().setColor(Color.RED);
progressArc.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);