use of com.gwtmobile.phonegap.client.Event.Callback in project GwtMobile by dennisjzh.
the class KitchenSink method onModuleLoad.
@Override
public void onModuleLoad() {
if (Utils.isAndroid() || Utils.isIOS()) {
if (Utils.isAndroid()) {
Event.onBackButton(new Event.Callback() {
@Override
public void onEventFired() {
onBackKeyDown();
}
});
}
Event.onDeviceReady(new Callback() {
@Override
public void onEventFired() {
new Timer() {
@Override
public void run() {
if (mainUi == null) {
Utils.Console("Loading main ui...");
mainUi = new MainUi();
Page.load(mainUi);
} else {
this.cancel();
}
}
}.scheduleRepeating(50);
}
});
} else {
mainUi = new MainUi();
Page.load(mainUi);
}
}
use of com.gwtmobile.phonegap.client.Event.Callback in project GwtMobile by dennisjzh.
the class EventUi method onLoad.
@Override
public void onLoad() {
super.onLoad();
BackButton back = (BackButton) header.getLeftButton();
back.setReturnParameter("Back");
Event.onDeviceReady(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onDeviceReady<br/>" + text.getHTML());
}
});
Event.onPause(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onPause<br/>" + text.getHTML());
}
});
Event.onResume(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onResume<br/>" + text.getHTML());
}
});
Event.onBackButton(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onBackButton<br/>" + text.getHTML());
}
});
Event.onMenuButton(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onMenuButton<br/>" + text.getHTML());
}
});
Event.onSearchButton(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onSearchButton<br/>" + text.getHTML());
}
});
Event.onOnline(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onOnline<br/>" + text.getHTML());
}
});
Event.onOffline(new Callback() {
@Override
public void onEventFired() {
text.setHTML((new Date()).toString() + ": onOffline<br/>" + text.getHTML());
}
});
}
Aggregations