@Test public void perform() throws Exception { ScrollAction action = new ScrollAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD, 0); UiObject root = new TestUiObject(5); action.perform(root); System.out.println(TestUiObject.max); assertEquals(1, TestUiObject.count); }
@Override public boolean perform(UiObject root) { List<UiObject> scrollableNodes = findScrollableNodes(root); boolean result = mIndex < scrollableNodes.size() && scrollableNodes.get(mIndex).performAction(mAction); recycle(scrollableNodes, root); return result; }
ScrollAction extends SimpleAction { @Override public boolean perform(UiObject root) { List<UiObject> scrollableNodes = findScrollableNodes(root); boolean result = mIndex < scrollableNodes.size() && scrollableNodes.get(mIndex).performAction(mAction); recycle(scrollableNodes, root); return result; } }
ScrollAction extends SimpleAction { @Override public boolean perform(UiObject root) { List<UiObject> scrollableNodes = findScrollableNodes(root); boolean result = mIndex < scrollableNodes.size() && scrollableNodes.get(mIndex).performAction(mAction); recycle(scrollableNodes, root); return result; } ScrollAction(int action, int i); }
ScrollAction extends SimpleAction { @Override public boolean perform(UiObject root) { List<UiObject> scrollableNodes = findScrollableNodes(root); boolean result = mIndex < scrollableNodes.size() && scrollableNodes.get(mIndex).performAction(mAction); recycle(scrollableNodes, root); return result; } ScrollAction(int action, int i); @Override boolean perform(UiObject root); }
ScrollAction extends SimpleAction { @Override public boolean perform(UiObject root) { List<UiObject> scrollableNodes = findScrollableNodes(root); boolean result = mIndex < scrollableNodes.size() && scrollableNodes.get(mIndex).performAction(mAction); recycle(scrollableNodes, root); return result; } ScrollAction(int action, int i); @Override boolean perform(UiObject root);  }