add: module floaty; events.on('exit')

This commit is contained in:
hyb1996
2017-12-06 13:18:36 +08:00
parent 346487b0ef
commit e33ce733d5
12 changed files with 448 additions and 25 deletions

View File

@@ -0,0 +1,37 @@
module.exports = function(__runtime__, scope){
var floaty = {};
floaty.window = function(layout){
if(typeof(layout) == 'xml'){
layout = layout.toString();
}
return wrap(__runtime__.floaty.window(layout));
}
function wrap(window){
var proxyObject = new com.stardust.autojs.rhino.ProxyJavaObject(scope, window, window.getClass());
proxyObject.__proxy__ = {
set: function(name, value){
window[name] = value;
},
get: function(name) {
var value = window[name];
if(typeof(value) == 'undefined'){
value = window.getView(name);
if(!value){
value = undefined;
}else{
value = scope.ui.__decorate__(value);
}
}
return value;
}
};
return proxyObject;
}
return floaty;
}