fix scroll button hiding issue

pull/375/head
Ryan ZHAO 4 years ago
parent 60ee602b04
commit e6975e5984

@ -213,11 +213,11 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
DispatchQueue.main.async {
if unreadCount > 0, let viewItem = self.viewItems[ifValid: self.viewItems.count - Int(unreadCount)], let interactionID = viewItem.interaction.uniqueId {
self.scrollToInteraction(with: interactionID, position: .top, isAnimated: false)
self.scrollButton.alpha = self.getScrollButtonOpacity()
self.unreadCountView.alpha = self.scrollButton.alpha
} else {
self.scrollToBottom(isAnimated: false)
}
self.scrollButton.alpha = self.getScrollButtonOpacity()
}
}
}
@ -301,9 +301,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
let newContentOffsetY = self.messagesTableView.contentOffset.y + min(lastPageTop, 0) + newHeight - self.messagesTableView.keyboardHeight
self.messagesTableView.contentOffset.y = max(self.messagesTableView.contentOffset.y, newContentOffsetY)
self.messagesTableView.keyboardHeight = newHeight
if (newHeight > 200) {
self.scrollButton.alpha = 0
}
self.scrollButton.alpha = self.getScrollButtonOpacity()
}
@objc func handleKeyboardWillHideNotification(_ notification: Notification) {

Loading…
Cancel
Save