public class ScaleImageViewWrapper extends ViewWrapper<SubsamplingScaleImageView>
{
private string draweventname;
private BA savedba;
@BA.Hide
public void innerInitialize(BA ba, String eventName, boolean keepOldObject)
{
if (!keepOldObject) {
setObject(new CircleView(ba.context, ba, eventName));
}
super.innerInitialize(ba, eventName, true);
draweventname = eventName + "_ondraw" ;
savedba = ba
// Pass something to the CircleView so that it can call DrawEvent
}
private DrawEvent(Canvas canvas)
{
savedba.raiseEvent2(this, true, draweventname, false, new Object() { canvas));
}
@Hide
private static class CircleView extends SubsamplingScaleImageView {
public BA ba;
public String eventName;
public CanvasWrapper cw;
public CircleView (Context context, BA ba, String eventName) {
super(context);
this.ba = ba;
this.eventName = eventName;
cw = new CanvasWrapper();
cw.Initialize2(Bitmap.createBitmap(2, 2, Config.ARGB_8888)); //the bitmap is only used to initialize CanvasWrapper. Note that Canvas.getBitmap will not return something meaningful.
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
cw.canvas = canvas
ba.raiseEvent(cw, eventName + "_ondraw");
}
}
}