daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 377 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top