From f465ce66dd5308eaa2e6bb85b500dd81172de531 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 6 Jun 2022 12:56:29 +0530 Subject: [PATCH 1/3] manage flipping header in All inboxes and inbox --- .../java/com/fsck/k9/fragment/MessageListFragment.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index e021b14045..763be02662 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -5,6 +5,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle import android.os.Parcelable +import android.util.Log import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem @@ -357,8 +358,12 @@ class MessageListFragment : isNewMessagesView -> getString(R.string.new_messages_title) isManualSearch -> getString(R.string.search_results) isThreadDisplay -> threadTitle ?: "" - isSingleFolderMode -> currentFolder!!.displayName - else -> "" + else -> { + when{ + isSingleFolderMode -> currentFolder!!.displayName + else ->"" + } + } } val subtitle = account.let { account -> -- GitLab From 9f855327a18da19b5fb3494039b5ebd6b5bc12ff Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 6 Jun 2022 13:01:01 +0530 Subject: [PATCH 2/3] code refine : remove un-used import --- .../src/main/java/com/fsck/k9/fragment/MessageListFragment.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 763be02662..94c653d0ca 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -5,7 +5,6 @@ import android.content.Context import android.content.Intent import android.os.Bundle import android.os.Parcelable -import android.util.Log import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem -- GitLab From c91c630b0bc28ee2cc0e1044bc022e45691629da Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 14 Jun 2022 11:40:47 +0600 Subject: [PATCH 3/3] 5557-flipping-page-header issue: https://gitlab.e.foundation/e/backlog/-/issues/5557 On folderListObserver add extra check if the current folder is unified inbox or not. Also block updateing the title bar if the currentFolder is null or in loading state. --- .../com/fsck/k9/fragment/MessageListFragment.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 94c653d0ca..000efbb3dd 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -160,7 +160,10 @@ class MessageListFragment : if (!isUnifiedInbox && currentFolder != null) { foldersViewModel.getFolderListLiveData().observe(this) { folderList -> folderList.folders.forEach { - if (it.folder.id == currentFolder?.databaseId) { + if (isUnifiedInbox) { + return@observe + } + if (currentFolder != null && !currentFolder!!.loading && it.folder.id == currentFolder!!.databaseId) { unreadMessageCount = it.unreadMessageCount setWindowTitle() return@forEach @@ -357,12 +360,8 @@ class MessageListFragment : isNewMessagesView -> getString(R.string.new_messages_title) isManualSearch -> getString(R.string.search_results) isThreadDisplay -> threadTitle ?: "" - else -> { - when{ - isSingleFolderMode -> currentFolder!!.displayName - else ->"" - } - } + isSingleFolderMode -> currentFolder!!.displayName + else -> "" } val subtitle = account.let { account -> -- GitLab