use of de.djuelg.neuronizer.domain.model.preview.Note in project Neuronizer by djuelg.
the class RenameNoteInteractorImpl method run.
@Override
public void run() {
final Optional<Note> outDatedItem = repository.note().get(uuid);
if (outDatedItem.isPresent()) {
final Note updatedItem = title.equals(outDatedItem.get().getTitle()) ? outDatedItem.get().update(title, position) : outDatedItem.get().update(title, position).updateLastChange();
repository.note().update(updatedItem);
mMainThread.post(new Runnable() {
@Override
public void run() {
callback.onNoteUpdated(updatedItem);
}
});
}
}
use of de.djuelg.neuronizer.domain.model.preview.Note in project Neuronizer by djuelg.
the class EditNoteBodyInteractorImpl method run.
@Override
public void run() {
final Optional<Note> outDatedItem = repository.note().get(uuid);
if (outDatedItem.isPresent()) {
if (!outDatedItem.get().getBody().equals(body)) {
final Note updatedItem = outDatedItem.get().update(body).updateLastChange();
// repository.note().update(updatedItem); // not needed because of Importance increasing
Importance.increase(repository, updatedItem);
mMainThread.post(new Runnable() {
@Override
public void run() {
callback.onNoteUpdated(updatedItem);
}
});
}
}
}
Aggregations