Search in sources :

Example 1 with EditItemInteractor

use of de.djuelg.neuronizer.domain.interactors.todolist.EditItemInteractor in project Neuronizer by djuelg.

the class DisplayTodoListPresenterImpl method syncSubItems.

private void syncSubItems(List<ISectionable> subItems) {
    List<ISectionable> reversedItems = Lists.reverse(Optional.fromNullable(subItems).or(new ArrayList<ISectionable>(0)));
    for (ISectionable vm : reversedItems) {
        TodoListItem item = ((TodoListItemViewModel) vm).getItem();
        EditItemInteractor interactor = new EditItemInteractorImpl(mExecutor, mMainThread, this, repository, item.getUuid(), item.getTitle(), reversedItems.indexOf(vm), item.isImportant(), item.getDetails(), item.isDone(), ((TodoListItemViewModel) vm).getHeader().getHeader().getUuid());
        interactor.execute();
    }
}
Also used : EditItemInteractor(de.djuelg.neuronizer.domain.interactors.todolist.EditItemInteractor) TodoListItemViewModel(de.djuelg.neuronizer.presentation.ui.flexibleadapter.TodoListItemViewModel) ArrayList(java.util.ArrayList) EditItemInteractorImpl(de.djuelg.neuronizer.domain.interactors.todolist.impl.EditItemInteractorImpl) ISectionable(eu.davidea.flexibleadapter.items.ISectionable) TodoListItem(de.djuelg.neuronizer.domain.model.todolist.TodoListItem)

Example 2 with EditItemInteractor

use of de.djuelg.neuronizer.domain.interactors.todolist.EditItemInteractor in project Neuronizer by djuelg.

the class ItemPresenterImpl method editItem.

@Override
public void editItem(String uuid, String title, int position, boolean important, String details, boolean done, String parentTodoListUuid, String parentHeaderUuid) {
    // initialize the interactor
    EditItemInteractor interactor = new EditItemInteractorImpl(mExecutor, mMainThread, this, repository, uuid, title, position, important, details, done, parentHeaderUuid);
    // run the interactor
    interactor.execute();
}
Also used : EditItemInteractor(de.djuelg.neuronizer.domain.interactors.todolist.EditItemInteractor) EditItemInteractorImpl(de.djuelg.neuronizer.domain.interactors.todolist.impl.EditItemInteractorImpl)

Aggregations

EditItemInteractor (de.djuelg.neuronizer.domain.interactors.todolist.EditItemInteractor)2 EditItemInteractorImpl (de.djuelg.neuronizer.domain.interactors.todolist.impl.EditItemInteractorImpl)2 TodoListItem (de.djuelg.neuronizer.domain.model.todolist.TodoListItem)1 TodoListItemViewModel (de.djuelg.neuronizer.presentation.ui.flexibleadapter.TodoListItemViewModel)1 ISectionable (eu.davidea.flexibleadapter.items.ISectionable)1 ArrayList (java.util.ArrayList)1