Adding basic on/off screen event handling to the sample background plugin.

This commit is contained in:
Derek Sollenberger
2010-02-23 08:52:16 -05:00
parent c363d4e72b
commit 5b67414517

View File

@@ -185,11 +185,18 @@ int16 BackgroundPlugin::handleEvent(const ANPEvent* evt) {
gLogI.log(kError_ANPLogType, " ------ %p the plugin did not request draw events", inst());
break;
case kLifecycle_ANPEventType:
if (evt->data.lifecycle.action == kOnLoad_ANPLifecycleAction) {
gLogI.log(kDebug_ANPLogType, " ------ %p the plugin received an onLoad event", inst());
return 1;
switch (evt->data.lifecycle.action) {
case kOnLoad_ANPLifecycleAction:
gLogI.log(kDebug_ANPLogType, " ------ %p onLoad", inst());
return 1;
case kOnScreen_ANPLifecycleAction:
gLogI.log(kDebug_ANPLogType, " ------ %p onScreen", inst());
return 1;
case kOffScreen_ANPLifecycleAction:
gLogI.log(kDebug_ANPLogType, " ------ %p offScreen", inst());
return 1;
}
break;
break; // end kLifecycle_ANPEventType
case kTouch_ANPEventType:
if (kDown_ANPTouchAction == evt->data.touch.action)
return kHandleLongPress_ANPTouchResult | kHandleDoubleTap_ANPTouchResult;