Update sync status of note in UI after deleting and restoring it

This commit is contained in:
stefan-niedermann 2020-01-06 17:55:36 +01:00
parent 465b1c6863
commit 27e2e4601f

View file

@ -598,6 +598,17 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
Log.v(TAG, "Item deleted through swipe ----------------------------------------------");
Snackbar.make(swipeRefreshLayout, R.string.action_note_deleted, Snackbar.LENGTH_LONG)
.setAction(R.string.action_undo, (View v) -> {
db.getNoteServerSyncHelper().addCallbackPush(new ICallback() {
@Override
public void onFinish() {
refreshLists();
}
@Override
public void onScheduled() {
}
});
db.addNoteAndSync(dbNote.getAccountId(), dbNote);
refreshLists();
Snackbar.make(swipeRefreshLayout, R.string.action_note_restored, Snackbar.LENGTH_SHORT)