groupsHavingNavigation.add(groupName);
}
}
listGroup.removeAll(groupsHavingNavigation);
UIVirtualList virtualList = getChild(UIVirtualList.class);
final int pageSize = 6;
Iterator<List<?>> source = new Iterator<List<?>>() {
int currentIndex = 0;
@Override
public boolean hasNext() {
return currentIndex < listGroup.size();
}
@Override
public List<String> next() {
if (hasNext()) {
List<String> list = new ArrayList<String>(pageSize);
for (int i = currentIndex; i < currentIndex + pageSize; i++) {
if (i < listGroup.size()) {
list.add(listGroup.get(i));
} else {
break;
}
}
//
currentIndex += pageSize;
return list;
} else {
throw new NoSuchElementException();
}
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
virtualList.dataBind(source);
}