app.nit: document platform specific triggers for each app.nit callbacks
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 Jul 2016 15:49:24 +0000 (11:49 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 Jul 2016 16:18:53 +0000 (12:18 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/app/app_base.nit

index 2a73e83..434990c 100644 (file)
@@ -50,29 +50,57 @@ abstract class AppComponent
        # The application is being created
        #
        # You should build the UI at this time.
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onCreate`
+       # * iOS: `UIApplicationDelegate application:didFinishLaunchingWithOptions`
        fun on_create do end
 
        # The application enters the active state, it is in the foreground and interactive
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onResume`
+       # * iOS: `UIApplicationDelegate applicationDidBecomeActive`
        fun on_resume do end
 
        # The application leaves the active state but is still partially visible
        #
-       # It may still be visible in the background.
        # It may then go back to `on_resume` or `on_stop`.
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onPause`
+       # * iOS: `UIApplicationDelegate applicationWillResignActive`
        fun on_pause do end
 
        # The application is completely hidden from the user
        #
        # It may then be destroyed or go back to a paused state with `on_restart`.
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onStop`
+       # * iOS: `UIApplicationDelegate applicationDidEnterBackground`
        fun on_stop do end
 
        # The application returns to a visible state from a previous `on_stop`
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onRestart`
+       # * iOS: `UIApplicationDelegate applicationWillEnterForeground`
        fun on_restart do end
 
        # The application may be destroyed soon, save its state for a future `on_restore_state`
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onSaveInstanceState`
+       # * iOS: `UIApplicationDelegate applicationDidEnterBackground`
        fun on_save_state do end
 
        # The application is launching, restore its state from a previous `on_save_state`
+       #
+       # Triggers are platform specific:
+       # * Android: `Activity.onCreate`, _not_ `Activity.onRestoreInstanceState`
+       #   as it is trigged only if there is a previous Android specific save state.
+       # * iOS: `UIApplicationDelegate applicationDidEnterBackground`
        fun on_restore_state do end
 end