nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model&modelize: introduce default parameters
[nit.git]
/
lib
/
android
/
android.nit
diff --git
a/lib/android/android.nit
b/lib/android/android.nit
index
b10bfbf
..
584b89b
100644
(file)
--- a/
lib/android/android.nit
+++ b/
lib/android/android.nit
@@
-16,17
+16,15
@@
# Android services and implementation of app.nit
#
# Android services and implementation of app.nit
#
-# To use this module and compile for Android, you must install the
-# Android SDK (with API level 10) and NDK (with the API level 9).
-# The tools `android`, `ndk-build` and `ant` must be in your PATH.
-#
# This module provides basic logging facilities, advanced logging can be
# achieved by importing `android::log`.
module android
import platform
import native_app_glue
# This module provides basic logging facilities, advanced logging can be
# achieved by importing `android::log`.
module android
import platform
import native_app_glue
+import dalvik
private import log
private import log
+private import android_data_store
# Uses Android logs to print everything
redef fun print(text) do log_write(priority_info, app.log_prefix.to_cstring, text.to_s.to_cstring)
# Uses Android logs to print everything
redef fun print(text) do log_write(priority_info, app.log_prefix.to_cstring, text.to_s.to_cstring)
@@
-47,4
+45,45
@@
redef class App
super
window_closing
end
super
window_closing
end
+
+ # Is the application currently paused?
+ var paused = true
+
+ redef fun window_created
+ do
+ super
+ paused = false
+ end
+
+ redef fun window_closing
+ do
+ paused = true
+ super
+ end
+
+ redef fun pause
+ do
+ paused = true
+ super
+ end
+
+ redef fun resume
+ do
+ paused = false
+ super
+ end
+
+ redef fun lost_focus
+ do
+ paused = true
+ super
+ end
+
+ redef fun gained_focus
+ do
+ paused = false
+ super
+ end
+
+ redef fun destroy do exit 0
end
end