refactor: move some classes in package api to package core
This commit is contained in:
@@ -47,4 +47,4 @@ require("__general__")(__runtime__, this);
|
||||
})(__that__);
|
||||
|
||||
__importClass__(android.view.KeyEvent);
|
||||
__importClass__(com.stardust.autojs.runtime.api.Shell);
|
||||
__importClass__(com.stardust.autojs.core.util.Shell);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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.core.inputevent.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++){
|
||||
|
||||
@@ -70,15 +70,15 @@ module.exports = function(__runtime__, scope){
|
||||
function getColorDetector(color, algorithm, threshold){
|
||||
switch(algorithm){
|
||||
case "rgb":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.RGBDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.RGBDistanceDetector(color, threshold);
|
||||
case "equal":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.EqualityDetector(color);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.EqualityDetector(color);
|
||||
case "diff":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.DifferenceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.DifferenceDetector(color, threshold);
|
||||
case "rgb+":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.WeightedRGBDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.WeightedRGBDistanceDetector(color, threshold);
|
||||
case "hs":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.HSDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.HSDistanceDetector(color, threshold);
|
||||
}
|
||||
throw new Error("Unknown algorithm: " + algorithm);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ module.exports = function(__runtime__, scope){
|
||||
}
|
||||
|
||||
ui.findViewByStringId = function(view, id){
|
||||
return com.stardust.autojs.runtime.api.ui.JsViewHelper.findViewByStringId(view, id);
|
||||
return com.stardust.autojs.core.ui.JsViewHelper.findViewByStringId(view, id);
|
||||
}
|
||||
|
||||
function decorate(view){
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
module.exports = function(__runtime__, scope){
|
||||
scope.newInjectableWebClient = function(){
|
||||
return new com.stardust.autojs.runtime.api.InjectableWebClient(org.mozilla.javascript.Context.getCurrentContext(), scope);
|
||||
return new com.stardust.autojs.core.web.InjectableWebClient(org.mozilla.javascript.Context.getCurrentContext(), scope);
|
||||
}
|
||||
|
||||
scope.newInjectableWebView = function(activity){
|
||||
return new com.stardust.autojs.runtime.api.InjectableWebView(scope.activity, org.mozilla.javascript.Context.getCurrentContext(), scope);
|
||||
return new com.stardust.autojs.core.web.InjectableWebView(scope.activity, org.mozilla.javascript.Context.getCurrentContext(), scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user