Merge pull request #6144 from thundernest/GH-6141_fix_action_mode
Fix action mode when switching from split view to message view
This commit is contained in:
commit
38a9f579be
2 changed files with 19 additions and 1 deletions
|
@ -338,6 +338,7 @@ open class MessageList :
|
|||
}
|
||||
DisplayMode.SPLIT_VIEW -> {
|
||||
messageListWasDisplayed = true
|
||||
messageListFragment?.onListVisible()
|
||||
if (messageViewFragment == null) {
|
||||
showMessageViewPlaceHolder()
|
||||
} else {
|
||||
|
@ -1469,6 +1470,7 @@ open class MessageList :
|
|||
displayMode = DisplayMode.MESSAGE_LIST
|
||||
viewSwitcher!!.showFirstView()
|
||||
|
||||
messageListFragment!!.onListVisible()
|
||||
messageListFragment!!.setActiveMessage(null)
|
||||
|
||||
setDrawerLockState()
|
||||
|
@ -1491,6 +1493,7 @@ open class MessageList :
|
|||
|
||||
private fun showMessageView() {
|
||||
displayMode = DisplayMode.MESSAGE_VIEW
|
||||
messageListFragment?.onListHidden()
|
||||
|
||||
if (!messageListWasDisplayed) {
|
||||
viewSwitcher!!.animateFirstView = false
|
||||
|
|
|
@ -133,6 +133,8 @@ class MessageListFragment :
|
|||
var isInitialized = false
|
||||
private set
|
||||
|
||||
private var isListVisible = false
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
|
||||
|
@ -1509,8 +1511,11 @@ class MessageListFragment :
|
|||
}
|
||||
|
||||
private fun resetActionMode() {
|
||||
if (selected.isEmpty()) {
|
||||
if (!isResumed) return
|
||||
|
||||
if (!isListVisible || selected.isEmpty()) {
|
||||
actionMode?.finish()
|
||||
actionMode = null
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1576,6 +1581,16 @@ class MessageListFragment :
|
|||
}
|
||||
}
|
||||
|
||||
fun onListVisible() {
|
||||
isListVisible = true
|
||||
resetActionMode()
|
||||
}
|
||||
|
||||
fun onListHidden() {
|
||||
isListVisible = false
|
||||
resetActionMode()
|
||||
}
|
||||
|
||||
val isCheckMailSupported: Boolean
|
||||
get() = allAccounts || !isSingleAccountMode || !isSingleFolderMode || isRemoteFolder
|
||||
|
||||
|
|
Loading…
Reference in a new issue