FileDocCategorySizeDatePackage
FakeView.javaAPI DocAndroid 5.1 API2420Thu Mar 12 22:22:40 GMT 2015com.android.fakeoemfeatures

FakeView

public class FakeView extends android.view.View
Dummy view to emulate stuff an OEM may want to do.

Fields Summary
static final long
TICK_DELAY
static final int
MSG_TICK
final android.os.Handler
mHandler
final android.graphics.Paint
mPaint
final Random
mRandom
Constructors Summary
public FakeView(android.content.Context context)


       
        super(context);
    
Methods Summary
protected voidonAttachedToWindow()

        super.onAttachedToWindow();
        mHandler.sendEmptyMessageDelayed(MSG_TICK, TICK_DELAY);
    
protected voidonDetachedFromWindow()

        super.onDetachedFromWindow();
        mHandler.removeMessages(MSG_TICK);
    
protected voidonDraw(android.graphics.Canvas canvas)

        super.onDraw(canvas);
        canvas.drawColor(0xff000000);
        mPaint.setTextSize(mRandom.nextInt(40) + 10);
        mPaint.setColor(0xff000000 + mRandom.nextInt(0x1000000));
        int x = mRandom.nextInt(getWidth()) - (getWidth()/2);
        int y = mRandom.nextInt(getHeight());
        canvas.drawText("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",
                x, y, mPaint);