Loading app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +0 −6 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ open class MessageList : private lateinit var searchView: SearchView private var drawer: K9Drawer? = null private var openFolderTransaction: FragmentTransaction? = null private var menu: Menu? = null private var progressBar: ProgressBar? = null private var messageViewPlaceHolder: PlaceholderFragment? = null private var messageListFragment: MessageListFragment? = null Loading Loading @@ -926,7 +925,6 @@ open class MessageList : override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.message_list_option, menu) this.menu = menu // setup search view val searchItem = menu.findItem(R.id.search) Loading Loading @@ -1236,10 +1234,6 @@ open class MessageList : invalidateMenu() } override fun disableDeleteAction() { menu!!.findItem(R.id.delete).isEnabled = false } private fun showDefaultTitleView() { if (messageListFragment != null) { messageListFragment!!.updateTitle() Loading app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt +11 −4 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ class MessageViewFragment : lateinit var messageReference: MessageReference private var currentAttachmentViewInfo: AttachmentViewInfo? = null private var isDeleteMenuItemDisabled: Boolean = false /** * Set this to `true` when the fragment should be considered active. When active, the fragment adds its actions to Loading Loading @@ -192,7 +193,10 @@ class MessageViewFragment : override fun onPrepareOptionsMenu(menu: Menu) { if (!isActive) return menu.findItem(R.id.delete).isVisible = K9.isMessageViewDeleteActionVisible menu.findItem(R.id.delete).apply { isVisible = K9.isMessageViewDeleteActionVisible isEnabled = !isDeleteMenuItemDisabled } val showToggleUnread = !isOutbox menu.findItem(R.id.toggle_unread).isVisible = showToggleUnread Loading Loading @@ -378,14 +382,18 @@ class MessageViewFragment : } private fun delete() { // Disable the delete button after it has been tapped (to try to prevent accidental clicks) fragmentListener.disableDeleteAction() disableDeleteMenuItem() fragmentListener.showNextMessageOrReturn() messagingController.deleteMessage(messageReference) } private fun disableDeleteMenuItem() { isDeleteMenuItemDisabled = true invalidateMenu() } private fun onRefile(destinationFolderId: Long?) { if (destinationFolderId == null || !messagingController.isMoveCapable(account)) { return Loading Loading @@ -799,7 +807,6 @@ class MessageViewFragment : fun onForward(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onForwardAsAttachment(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onEditAsNewMessage(messageReference: MessageReference) fun disableDeleteAction() fun onReplyAll(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onReply(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun setProgress(enable: Boolean) Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +0 −6 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ open class MessageList : private lateinit var searchView: SearchView private var drawer: K9Drawer? = null private var openFolderTransaction: FragmentTransaction? = null private var menu: Menu? = null private var progressBar: ProgressBar? = null private var messageViewPlaceHolder: PlaceholderFragment? = null private var messageListFragment: MessageListFragment? = null Loading Loading @@ -926,7 +925,6 @@ open class MessageList : override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.message_list_option, menu) this.menu = menu // setup search view val searchItem = menu.findItem(R.id.search) Loading Loading @@ -1236,10 +1234,6 @@ open class MessageList : invalidateMenu() } override fun disableDeleteAction() { menu!!.findItem(R.id.delete).isEnabled = false } private fun showDefaultTitleView() { if (messageListFragment != null) { messageListFragment!!.updateTitle() Loading
app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt +11 −4 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ class MessageViewFragment : lateinit var messageReference: MessageReference private var currentAttachmentViewInfo: AttachmentViewInfo? = null private var isDeleteMenuItemDisabled: Boolean = false /** * Set this to `true` when the fragment should be considered active. When active, the fragment adds its actions to Loading Loading @@ -192,7 +193,10 @@ class MessageViewFragment : override fun onPrepareOptionsMenu(menu: Menu) { if (!isActive) return menu.findItem(R.id.delete).isVisible = K9.isMessageViewDeleteActionVisible menu.findItem(R.id.delete).apply { isVisible = K9.isMessageViewDeleteActionVisible isEnabled = !isDeleteMenuItemDisabled } val showToggleUnread = !isOutbox menu.findItem(R.id.toggle_unread).isVisible = showToggleUnread Loading Loading @@ -378,14 +382,18 @@ class MessageViewFragment : } private fun delete() { // Disable the delete button after it has been tapped (to try to prevent accidental clicks) fragmentListener.disableDeleteAction() disableDeleteMenuItem() fragmentListener.showNextMessageOrReturn() messagingController.deleteMessage(messageReference) } private fun disableDeleteMenuItem() { isDeleteMenuItemDisabled = true invalidateMenu() } private fun onRefile(destinationFolderId: Long?) { if (destinationFolderId == null || !messagingController.isMoveCapable(account)) { return Loading Loading @@ -799,7 +807,6 @@ class MessageViewFragment : fun onForward(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onForwardAsAttachment(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onEditAsNewMessage(messageReference: MessageReference) fun disableDeleteAction() fun onReplyAll(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun onReply(messageReference: MessageReference, decryptionResultForReply: Parcelable?) fun setProgress(enable: Boolean) Loading