mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
fix(automator): click always return true if the widget with text exists
This commit is contained in:
parent
a00bd293b3
commit
34fb18cba3
@ -46,14 +46,14 @@ public class ActionFactory {
|
||||
return new SearchTargetAction(action, new FilterAction.EditableFilter(index)) {
|
||||
|
||||
@Override
|
||||
protected void performAction(UiObject node) {
|
||||
protected boolean performAction(UiObject node) {
|
||||
Bundle args = new Bundle();
|
||||
if (action == AccessibilityNodeInfo.ACTION_SET_TEXT) {
|
||||
args.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, text);
|
||||
} else {
|
||||
args.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, node.text() + text);
|
||||
}
|
||||
node.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, args);
|
||||
return node.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -25,16 +25,15 @@ public abstract class SearchTargetAction extends FilterAction {
|
||||
boolean performed = false;
|
||||
for (UiObject node : nodes) {
|
||||
node = searchTarget(node);
|
||||
if (node != null) {
|
||||
performAction(node);
|
||||
if (node != null && performAction(node)) {
|
||||
performed = true;
|
||||
}
|
||||
}
|
||||
return performed;
|
||||
}
|
||||
|
||||
protected void performAction(UiObject node) {
|
||||
node.performAction(mAction);
|
||||
protected boolean performAction(UiObject node) {
|
||||
return node.performAction(mAction);
|
||||
}
|
||||
|
||||
public int getAction() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user