fix hyb1996-guest/AutoJsIssueReport#1341 and replace JavaAdapter to ProxyObject in ui module to avoid compilation to class file

This commit is contained in:
hyb1996
2017-05-17 14:47:45 +08:00
parent c4ec951a10
commit b3fad201f7
70 changed files with 366 additions and 289 deletions

View File

@@ -45,7 +45,7 @@ module.exports = function(__runtime__, scope){
function toStrokes(args){
var screenMetrics = __runtime__.getScreenMetrics();
var len = args.length;
var strokes = [];
var strokes = java.lang.reflect.Array.newInstance(android.accessibilityservice.GestureDescription.StrokeDescription, len);
for(var i = 0; i < len; i++){
var gesture = args[i];
var pointsIndex = 1;
@@ -63,7 +63,7 @@ module.exports = function(__runtime__, scope){
for(var j = pointsIndex + 1; j < gestureLen; j++){
path.lineTo(screenMetrics.scaleX(gesture[j][0]), screenMetrics.scaleY(gesture[j][1]));
}
strokes.push(new android.accessibilityservice.GestureDescription.StrokeDescription(path, start, delay));
strokes[i] = new android.accessibilityservice.GestureDescription.StrokeDescription(path, start, delay);
}
return strokes;
}