tapOnly.setText("Tap me! ---");
this.clearAllGestures(tapOnly);
tapOnly.registerInputProcessor(new TapProcessor(app));
tapOnly.addGestureListener(TapProcessor.class, new IGestureEventListener() {
public boolean processGestureEvent(MTGestureEvent ge) {
TapEvent te = (TapEvent)ge;
switch (te.getId()) {
case MTGestureEvent.GESTURE_DETECTED:
tapOnly.setFillColor(new MTColor(220,220,220,255));
break;
case MTGestureEvent.GESTURE_UPDATED:
break;
case MTGestureEvent.GESTURE_ENDED:
if (te.isTapped()){
if (tapOnly.getText().endsWith("--"))
tapOnly.setText("Tap me! -|-");
else
tapOnly.setText("Tap me! ---");
}
tapOnly.setFillColor(textAreaColor);
break;
}
return false;
}
});
this.getCanvas().addChild(tapOnly);
tapOnly.setAnchor(PositionAnchor.UPPER_LEFT);
tapOnly.setPositionGlobal(new Vector3D(1*horizontalPad,0,0));
//Double Tap gesture
final MTTextArea doubleTap = new MTTextArea(mtApplication, font);
doubleTap.setFillColor(textAreaColor);
doubleTap.setStrokeColor(textAreaColor);
doubleTap.setText("Double Tap me! ---");
this.clearAllGestures(doubleTap);
doubleTap.registerInputProcessor(new TapProcessor(app, 25, true, 350));
doubleTap.addGestureListener(TapProcessor.class, new IGestureEventListener() {
public boolean processGestureEvent(MTGestureEvent ge) {
TapEvent te = (TapEvent)ge;
if (te.isDoubleTap()){
if (doubleTap.getText().endsWith("--"))
doubleTap.setText("Double Tap me! -|-");
else
doubleTap.setText("Double Tap me! ---");
}