BitmapView can be a member class
Change-Id: I172cfc0bcad780e99469ac01c9ba7467befe53de
This commit is contained in:
@@ -287,31 +287,28 @@ public class Desktop
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "onCreate - set content view\n");
|
Log.i(TAG, "onCreate - set content view\n");
|
||||||
setContentView(new BitmapView(this, this));
|
setContentView(new BitmapView());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class BitmapView extends android.view.View
|
class BitmapView extends android.view.View
|
||||||
{
|
{
|
||||||
Desktop mDesktop;
|
|
||||||
Bitmap mBitmap;
|
Bitmap mBitmap;
|
||||||
|
|
||||||
public BitmapView(Context context, Desktop desktop)
|
public BitmapView()
|
||||||
{
|
{
|
||||||
super(context);
|
super(Desktop.this);
|
||||||
mDesktop = desktop;
|
|
||||||
mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888);
|
mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected void onDraw(Canvas canvas) {
|
@Override protected void onDraw(Canvas canvas) {
|
||||||
// canvas.drawColor(0xFF1ABCDD);
|
// canvas.drawColor(0xFF1ABCDD);
|
||||||
|
|
||||||
mDesktop.renderVCL(mBitmap);
|
renderVCL(mBitmap);
|
||||||
canvas.drawBitmap(mBitmap, 0, 0, null);
|
canvas.drawBitmap(mBitmap, 0, 0, null);
|
||||||
|
|
||||||
// re-call ourselves a bit later ...
|
// re-call ourselves a bit later ...
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// vim:set shiftwidth=4 softtabstop=4 expandtab:
|
// vim:set shiftwidth=4 softtabstop=4 expandtab:
|
||||||
|
Reference in New Issue
Block a user