Guest User

Untitled

a guest
Jan 21st, 2019
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. protected void onDraw(Canvas canvas) {
  2. super.onDraw(canvas);
  3. rectF.set(20, 20, this.get_Width() - this.get_Width()/10, this.get_Width() - this.get_Width()/10);
  4. RadialGradient gradient = new RadialGradient(200, 200, 200, 0xFFFFFFFF,
  5. 0xFF000000, android.graphics.Shader.TileMode.CLAMP);
  6. Paint mPaint = new Paint();
  7. mPaint.setDither(true);
  8. mPaint.setShader(gradient);
  9. canvas.drawCircle(getWidth()/2, getHeight()/2, getWidth()/3, getGradient());
  10. invalidate();
  11. }
  12.  
  13. @Override
  14. public void onAttachedToWindow() {
  15. super.onAttachedToWindow();
  16. Window window = getWindow();
  17. // Eliminates color banding
  18. window.setFormat(PixelFormat.RGBA_8888);
  19. }
  20.  
  21. Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
Add Comment
Please, Sign In to add comment