add setText and add group memeber script
This commit is contained in:
@@ -88,7 +88,7 @@ module.exports = function(__runtime__, scope){
|
||||
}, arguments);
|
||||
}
|
||||
|
||||
automator.input = function(a, b){
|
||||
automator.setText = function(a, b){
|
||||
if(arguments.length == 1){
|
||||
return __runtime__.automator.setText(__runtime__.automator.editable(-1), a);
|
||||
}else{
|
||||
@@ -96,8 +96,16 @@ module.exports = function(__runtime__, scope){
|
||||
}
|
||||
}
|
||||
|
||||
automator.input = function(a, b){
|
||||
if(arguments.length == 1){
|
||||
return __runtime__.automator.appendText(__runtime__.automator.editable(-1), a);
|
||||
}else{
|
||||
return __runtime__.automator.appendText(__runtime__.automator.editable(a), b);
|
||||
}
|
||||
}
|
||||
|
||||
scope.__asGlobal__(__runtime__.automator, ['back', 'home', 'powerDialog', 'notifications', 'quickSettings', 'recents', 'splitScreen']);
|
||||
scope.__asGlobal__(automator, ['click', 'longClick', 'press', 'swipe', 'gesture', 'gestures', 'gestureAsync', 'gesturesAsync', 'scrollDown', 'scrollUp', 'input']);
|
||||
scope.__asGlobal__(automator, ['click', 'longClick', 'press', 'swipe', 'gesture', 'gestures', 'gestureAsync', 'gesturesAsync', 'scrollDown', 'scrollUp', 'input', 'setText']);
|
||||
|
||||
return automator;
|
||||
}
|
||||
|
||||
@@ -109,12 +109,20 @@ public class SimpleActionAutomator {
|
||||
return performAction(target.createAction(AccessibilityNodeInfo.ACTION_SELECT));
|
||||
}
|
||||
|
||||
@ScriptInterface
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public boolean setText(ActionTarget target, String text) {
|
||||
mScriptRuntime.requiresApi(Build.VERSION_CODES.LOLLIPOP);
|
||||
return performAction(target.createAction(AccessibilityNodeInfo.ACTION_SET_TEXT, text));
|
||||
}
|
||||
|
||||
@ScriptInterface
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public boolean appendText(ActionTarget target, String text) {
|
||||
mScriptRuntime.requiresApi(Build.VERSION_CODES.LOLLIPOP);
|
||||
return performAction(target.createAction(UiObject.ACTION_APPEND_TEXT, text));
|
||||
}
|
||||
|
||||
@ScriptInterface
|
||||
public boolean back() {
|
||||
return performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
|
||||
|
||||
Reference in New Issue
Block a user