Closed GoogleCodeExporter closed 9 years ago
A suggested fixed version of scroll:
public boolean scroll(int direction) {
final ArrayList<View> viewList = viewFetcher.getViews(null, true);
final ArrayList<ListView> listViews = RobotiumUtils.filterViews(ListView.class, viewList);
boolean allFinished = true;
boolean containsScrollViews = false;
if (listViews.size() > 0) {
containsScrollViews = true;
for (int i = 0; i < listViews.size(); i++) {
allFinished = allFinished && scrollList(ListView.class, i, direction, listViews);
}
}
final ArrayList<GridView> gridViews = RobotiumUtils.filterViews(GridView.class, viewList);
if (gridViews.size() > 0) {
containsScrollViews = true;
allFinished = allFinished && scrollList(GridView.class, 0, direction, gridViews);
}
final ArrayList<ScrollView> scrollViews = RobotiumUtils.filterViews(ScrollView.class, viewList);
if (scrollViews.size() > 0) {
containsScrollViews = true;
allFinished = allFinished && scrollScrollView(direction, scrollViews);
}
return allFinished && containsScrollViews;
}
This works for me.
Original comment by gaz...@gmail.com
on 6 Sep 2011 at 8:58
Thanks for this.
Original comment by renasr...@gmail.com
on 13 Sep 2011 at 8:28
This is a design choice. Making Robotium search multiple lists introduces
issues with list rich applications. One needs to click the correct tab first
and then use searchText to search that specific list.
Original comment by renasr...@gmail.com
on 14 Nov 2011 at 6:32
Original issue reported on code.google.com by
gaz...@gmail.com
on 6 Sep 2011 at 8:43