use of de.djuelg.neuronizer.domain.comparator.PositionComparator in project Neuronizer by djuelg.
the class DisplayTodoListPresenterImpl method createSubItemList.
private List<TodoListItemViewModel> createSubItemList(TodoListHeaderViewModel headerVM, List<TodoListItem> items) {
Collections.sort(items, new PositionComparator());
List<TodoListItemViewModel> itemVMs = new ArrayList<>();
for (TodoListItem item : items) {
itemVMs.add(new TodoListItemViewModel(headerVM, item));
}
return itemVMs;
}
use of de.djuelg.neuronizer.domain.comparator.PositionComparator in project Neuronizer by djuelg.
the class DisplayTodoListPresenterImpl method onTodoListRetrieved.
@Override
public void onTodoListRetrieved(List<TodoListSection> sections) {
Collections.sort(sections, new PositionComparator());
List<AbstractFlexibleItem> headerVMs = new ArrayList<>(sections.size());
for (TodoListSection section : sections) {
TodoListHeaderViewModel headerVM = new TodoListHeaderViewModel(section.getHeader());
headerVM.setSubItems(createSubItemList(headerVM, Lists.newArrayList(section.getItems())));
headerVMs.add(headerVM);
}
mView.onTodoListLoaded(headerVMs);
}
use of de.djuelg.neuronizer.domain.comparator.PositionComparator in project Neuronizer by djuelg.
the class WidgetListFactory method onDataSetChanged.
@Override
public void onDataSetChanged() {
itemList.clear();
List<TodoListSection> sections = Lists.newArrayList(repository.getSectionsOfTodoListId(uuid));
Collections.sort(sections, new PositionComparator());
for (TodoListSection section : sections) {
itemList.add(section.getHeader());
List<TodoListItem> items = Lists.newArrayList(section.getItems());
Collections.sort(items, new PositionComparator());
itemList.addAll(items);
}
}
use of de.djuelg.neuronizer.domain.comparator.PositionComparator in project Neuronizer by djuelg.
the class ItemPresenterImpl method onHeadersRetrieved.
@Override
public void onHeadersRetrieved(List<TodoListHeader> headers) {
Collections.sort(headers, new PositionComparator());
mView.onHeadersLoaded(headers);
}
Aggregations