class CircleGlow extends View public CircleGlow Context context super

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class CircleGlow extends View {
public CircleGlow(Context context) {
super(context);
this.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
public CircleGlow(Context context, AttributeSet attrs) {
super(context, attrs);
this.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
@Override
public void draw(Canvas canvas) {
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setDither(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(getLayoutParams().height / 10);
paint.setColor(PowerButtonFragment.COLOR_CYAN);
BlurMaskFilter blurMaskFilter = new BlurMaskFilter(getLayoutParams().height / 16, BlurMaskFilter.Blur.NORMAL);
paint.setMaskFilter(blurMaskFilter);
canvas.drawCircle(getLayoutParams().width / 2,
getLayoutParams().height / 2,
(getLayoutParams().width / 2) - (getLayoutParams().height / 10) - (getLayoutParams().height / 50),
paint);
}
}