From 49d87c3c75c58e52a9095ace054e8a7dfba633cb Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Tue, 21 Nov 2017 20:12:31 +0100 Subject: [PATCH] Fixed bugg where message was still marked as unread after returning from detail screen + bumped kotlin to version 1.1.60 --- app/build.gradle | 3 +++ app/src/main/AndroidManifest.xml | 3 +-- .../main/java/ch/dissem/apps/abit/MessageDetailFragment.kt | 4 ++-- build.gradle | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bb27ff3..aa7ff0c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,6 +39,9 @@ android { signingConfig signingConfigs.release } } + packagingOptions { + exclude 'META-INF/core.kotlin_module' + } testOptions { unitTests { includeAndroidResources = true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 45aef4f..69c46cc 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,8 +19,7 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" - android:name="android.support.multidex.MultiDexApplication" - tools:replace="android:allowBackup"> + android:name="android.support.multidex.MultiDexApplication"> 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 bc7f377..ff630b3 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt @@ -106,9 +106,9 @@ class MessageDetailFragment : Fragment() { text.linksClickable = true text.setTextIsSelectable(true) - val removed = item.labels.removeAll { it.type == Label.Type.UNREAD } val messageRepo = Singleton.getMessageRepository(ctx) - if (removed) { + if (item.isUnread()) { + Singleton.labeler.markAsRead(item) (activity as? MainActivity)?.updateUnread() messageRepo.save(item) } diff --git a/build.gradle b/build.gradle index a8cdb8e..140b4b2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.1.51' + ext.kotlin_version = '1.1.60' ext.anko_version = '0.10.2' repositories { jcenter()