nitweb: fix access to query results count
[nit.git] / lib / android / game.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Android services and implementation of app.nit for gamnit and mnit
16 module game
17
18 import platform
19 import native_app_glue
20 import dalvik
21 private import log
22 private import assets
23
24 redef class App
25 redef fun init_window
26 do
27 super
28 on_create
29 on_restore_state
30 end
31
32 redef fun term_window
33 do
34 super
35 on_stop
36 end
37
38 # Is the application currently paused?
39 var paused = true
40
41 redef fun pause
42 do
43 paused = true
44 on_pause
45 super
46 end
47
48 redef fun resume
49 do
50 paused = false
51 on_resume
52 super
53 end
54
55 redef fun save_state do on_save_state
56
57 redef fun lost_focus
58 do
59 paused = true
60 super
61 end
62
63 redef fun gained_focus
64 do
65 paused = false
66 super
67 end
68 end