FileDocCategorySizeDatePackage
TrackingPatternView.javaAPI DocAndroid 1.5 API2193Wed May 06 22:42:00 BST 2009com.android.server.status

TrackingPatternView

public class TrackingPatternView extends android.view.View

Fields Summary
private android.graphics.Bitmap
mTexture
private android.graphics.Paint
mPaint
private int
mTextureWidth
private int
mTextureHeight
Constructors Summary
public TrackingPatternView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);

        mTexture = BitmapFactory.decodeResource(getResources(), 
                com.android.internal.R.drawable.status_bar_background);
        mTextureWidth = mTexture.getWidth();
        mTextureHeight = mTexture.getHeight();

        mPaint = new Paint();
        mPaint.setDither(false);
    
Methods Summary
public voidonDraw(android.graphics.Canvas canvas)

        final Bitmap texture = mTexture;
        final Paint paint = mPaint;

        final int width = getWidth();
        final int height = getHeight();

        final int textureWidth = mTextureWidth;
        final int textureHeight = mTextureHeight;

        Log.d("TrackingPatternView", "width=" + width + " textureWidth=" + textureWidth);

        int x = 0;
        int y;

        while (x < width) {
            y = 0;
            while (y < height) {
                canvas.drawBitmap(texture, x, y, paint);
                y += textureHeight;
            }
            x += textureWidth;
        }