docs: RootAutomator

This commit is contained in:
hyb1996
2017-08-15 20:17:27 +08:00
parent 9e23d9c245
commit a72147fcf2
3 changed files with 4 additions and 22 deletions

View File

@@ -1,12 +1,13 @@
module.exports = function(__runtime__, scope){
function RootAutomator(){
this.__ra__ = Object.create(new com.stardust.autojs.runtime.api.RootAutomator(scope.context));
this.__ra__ = Object.create(new com.stardust.autojs.runtime.api.RootAutomator(scope.context));
var methods = ["sendEvent", "touch", "setScreenMetrics", "touchX", "touchY", "sendSync", "sendMtSync", "tap",
"swipe", "press", "longPress", "touchDown", "touchUp", "touchMove", "getDefaultId", "setDefaultId", "exit"];
for(var i = 0; i < methods.length; i++){
var method = methods[i];
this[method] = this.__ra__[method].bind(this.__ra__);
}
return this;
}
var p = RootAutomator.prototype;
return RootAutomator;