api: threads, files

This commit is contained in:
hyb1996
2017-12-27 16:47:32 +08:00
parent 25e9c90bf4
commit 729958d419
26 changed files with 652 additions and 339 deletions

View File

@@ -1,7 +1,18 @@
module.exports = function(__runtime__, scope){
importClass(android.view.KeyEvent);
var events = Object.create(__runtime__.events);
var keys = {
"home": KeyEvent.KEYCODE_HOME,
"menu": KeyEvent.KEYCODE_MENU,
"back": KeyEvent.KEYCODE_BACK,
"volume_up": KeyEvent.KEYCODE_VOLUME_UP,
"volume_down": KeyEvent.KEYCODE_VOLUME_DOWN
}
scope.keys = keys;
return events;
}

View File

@@ -1,6 +1,9 @@
module.exports = function(__runtime__, scope){
var files = com.stardust.pio.PFiles;
var files = Object.create(com.stardust.pio.PFiles);
files.cwd = function(){
return scope.engines.myEngine().cwd();
}
scope.files = files;
scope.open = function(path, mode, encoding, bufferSize){
if(arguments.length == 1){