Merge pull request #5145 from k9mail/message_list_back_button
Go to Unified Inbox when pressing back in message list
This commit is contained in:
commit
998c5d1fbf
1 changed files with 13 additions and 5 deletions
|
@ -586,12 +586,20 @@ open class MessageList :
|
|||
showMessageList()
|
||||
} else {
|
||||
if (isDrawerEnabled && account != null && supportFragmentManager.backStackEntryCount == 0) {
|
||||
val defaultFolderId = defaultFolderProvider.getDefaultFolder(account!!)
|
||||
val currentFolder = if (singleFolderMode) search!!.folderIds[0] else null
|
||||
if (currentFolder == null || defaultFolderId != currentFolder) {
|
||||
openFolderImmediately(defaultFolderId)
|
||||
if (K9.isShowUnifiedInbox) {
|
||||
if (search!!.id != SearchAccount.UNIFIED_INBOX) {
|
||||
openUnifiedInbox()
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
val defaultFolderId = defaultFolderProvider.getDefaultFolder(account!!)
|
||||
val currentFolder = if (singleFolderMode) search!!.folderIds[0] else null
|
||||
if (currentFolder == null || defaultFolderId != currentFolder) {
|
||||
openFolderImmediately(defaultFolderId)
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
|
|
Loading…
Reference in a new issue