add setText and add group memeber script

This commit is contained in:
hyb1996
2017-07-12 11:47:32 +08:00
parent e5cc3ef4f9
commit fcfb3a69e0
9 changed files with 97 additions and 42 deletions

View File

@@ -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);