Search in sources :

Example 1 with BaseModel

use of de.djuelg.neuronizer.domain.model.BaseModel in project Neuronizer by djuelg.

the class PreviewFragment method editItem.

private void editItem(int position) {
    PreviewViewModel previewVM = mAdapter.getItem(position);
    if (previewVM != null) {
        BaseModel preview = previewVM.getPreview().getBaseItem();
        if (preview instanceof TodoList) {
            showEditTodoListDialog(this, preview.getUuid(), preview.getTitle(), preview.getPosition());
        } else if (preview instanceof Note) {
            showEditNoteDialog(this, preview.getUuid(), preview.getTitle(), preview.getPosition());
        }
        mAdapter.notifyItemChanged(position);
    }
}
Also used : BaseModel(de.djuelg.neuronizer.domain.model.BaseModel) PreviewViewModel(de.djuelg.neuronizer.presentation.ui.flexibleadapter.PreviewViewModel) Note(de.djuelg.neuronizer.domain.model.preview.Note) TodoList(de.djuelg.neuronizer.domain.model.preview.TodoList)

Aggregations

BaseModel (de.djuelg.neuronizer.domain.model.BaseModel)1 Note (de.djuelg.neuronizer.domain.model.preview.Note)1 TodoList (de.djuelg.neuronizer.domain.model.preview.TodoList)1 PreviewViewModel (de.djuelg.neuronizer.presentation.ui.flexibleadapter.PreviewViewModel)1