nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add some runtime error in nitin.input
[nit.git]
/
lib
/
android
/
vibration.nit
diff --git
a/lib/android/vibration.nit
b/lib/android/vibration.nit
index
430e047
..
cef49ee
100644
(file)
--- a/
lib/android/vibration.nit
+++ b/
lib/android/vibration.nit
@@
-28,31
+28,31
@@
extern class Vibrator in "Java" `{ android.os.Vibrator `}
super JavaObject
# Vibrate for `n` miliseconds
super JavaObject
# Vibrate for `n` miliseconds
- fun vibrate(n: Int) in "Java" `{ recv.vibrate(n); `}
+ fun vibrate(n: Int) in "Java" `{ self.vibrate(n); `}
# Does this devices has a vibrator
#
# TODO activate in API 11
# Does this devices has a vibrator
#
# TODO activate in API 11
- #fun exists: Bool in "Java" `{ return recv.hasVibrator(); `}
+ #fun exists: Bool in "Java" `{ return self.hasVibrator(); `}
# Turn off the vibration
# Turn off the vibration
- fun cancel in "Java" `{ recv.cancel(); `}
+ fun cancel in "Java" `{ self.cancel(); `}
# HACK for bug #845
redef fun new_global_ref import sys, Sys.jni_env `{
# HACK for bug #845
redef fun new_global_ref import sys, Sys.jni_env `{
- Sys sys = Vibrator_sys(recv);
+ Sys sys = Vibrator_sys(self);
JNIEnv *env = Sys_jni_env(sys);
JNIEnv *env = Sys_jni_env(sys);
- return (*env)->NewGlobalRef(env, recv);
+ return (*env)->NewGlobalRef(env, self);
`}
end
redef class App
# Get the handle to this device vibrator as a global ref
var vibrator: Vibrator is lazy do
`}
end
redef class App
# Get the handle to this device vibrator as a global ref
var vibrator: Vibrator is lazy do
- var v = vibrator_native(native_activity)
+ var v = vibrator_native(native_context)
return v.new_global_ref
end
return v.new_global_ref
end
- private fun vibrator_native(context: NativeActivity): Vibrator in "Java" `{
+ private fun vibrator_native(context: NativeContext): Vibrator in "Java" `{
android.os.Vibrator v = (android.os.Vibrator)
context.getSystemService(android.content.Context.VIBRATOR_SERVICE);
return v;
android.os.Vibrator v = (android.os.Vibrator)
context.getSystemService(android.content.Context.VIBRATOR_SERVICE);
return v;