Skip to content

Instantly share code, notes, and snippets.

@koyachi
Created November 18, 2009 13:05
Show Gist options
  • Save koyachi/237826 to your computer and use it in GitHub Desktop.
Save koyachi/237826 to your computer and use it in GitHub Desktop.
package org.buffr.Sketch20091118_02;
import android.app.Activity;
import android.os.Bundle;
import android.content.Context;
import android.graphics.*;
import android.view.View;
public class Sketch20091118_02 extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(new _00B4F5(this));
}
private static class _00B4F5 extends View {
private Paint myPaint = new Paint();
private int color = 0x00B4F5;
public _00B4F5(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
myPaint.setColor(0xFF000000 | color);
canvas.drawRect(0,0, canvas.getWidth(), canvas.getHeight(), myPaint);
color+=0x01;
invalidate();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment