feat(autojs): UiSelector.indexInParent
This commit is contained in:
@@ -396,6 +396,11 @@ public class UiGlobalSelector {
|
||||
return this;
|
||||
}
|
||||
|
||||
public UiGlobalSelector indexInParent(int index) {
|
||||
mFilters.add(new IntFilter(IntFilter.INDEX_IN_PARENT, index));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public UiGlobalSelector filter(final BooleanFilter.BooleanSupplier filter) {
|
||||
mFilters.add(new DfsFilter() {
|
||||
|
||||
@@ -96,6 +96,18 @@ public class IntFilter extends DfsFilter {
|
||||
}
|
||||
};
|
||||
|
||||
public static final IntProperty INDEX_IN_PARENT = new IntProperty() {
|
||||
@Override
|
||||
public int get(UiObject object) {
|
||||
return object.indexInParent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "indexInParent";
|
||||
}
|
||||
};
|
||||
|
||||
private IntProperty mIntProperty;
|
||||
private int mValue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user