From f4b6bcb8d93a2bb34814b85f858138eb56d3b9cf Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 15 Sep 2017 15:25:32 +0200 Subject: [PATCH] Some fixes around deleting/trashing messages --- .../java/ch/dissem/apps/abit/MessageDetailFragment.kt | 3 ++- .../java/ch/dissem/apps/abit/MessageListFragment.kt | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt index fb881c5..c6cb099 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt @@ -166,10 +166,11 @@ class MessageDetailFragment : Fragment() { return true } R.id.delete -> { - Singleton.labeler.delete(item) if (isInTrash(item)) { + Singleton.labeler.delete(item) messageRepo.remove(item) } else { + Singleton.labeler.delete(item) messageRepo.save(item) } activity.onBackPressed() diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.kt b/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.kt index ccf6fc1..03ff998 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.kt @@ -241,12 +241,16 @@ class MessageListFragment : Fragment(), ListHolder