use of de.djuelg.neuronizer.presentation.ui.flexibleadapter.TodoListItemViewModel in project Neuronizer by djuelg.
the class TodoListFragment method permanentDeleteItems.
public void permanentDeleteItems(List<Integer> positions) {
if (mAdapter == null || mPresenter == null)
return;
for (int position : positions) {
AbstractFlexibleItem adapterItem = mAdapter.getItem(position);
if (adapterItem != null) {
switch(adapterItem.getLayoutRes()) {
case R.layout.todo_list_header:
if (mActionModeHelper != null)
mActionModeHelper.destroyActionModeIfCan();
mPresenter.deleteHeader(((TodoListHeaderViewModel) adapterItem).getHeader().getUuid());
break;
case R.layout.todo_list_item:
mPresenter.deleteItem(((TodoListItemViewModel) adapterItem).getItem().getUuid());
break;
}
}
mAdapter.removeItem(position);
}
mListener.onUpdateAllWidgets(50);
}
Aggregations