Delete timeline unread count animation. Issue #1174

This commit is contained in:
Maurice Parker 2019-10-25 15:03:13 -05:00
parent 74c9290e6a
commit cf7ea99cb6
1 changed files with 4 additions and 12 deletions

View File

@ -453,7 +453,7 @@ private extension MasterTimelineViewController {
} }
titleView.label.text = coordinator.timelineName titleView.label.text = coordinator.timelineName
updateTitleUnreadCount(animate: false) updateTitleUnreadCount()
if coordinator.timelineFetcher is Feed { if coordinator.timelineFetcher is Feed {
titleView.heightAnchor.constraint(equalToConstant: 44.0).isActive = true titleView.heightAnchor.constraint(equalToConstant: 44.0).isActive = true
@ -475,7 +475,7 @@ private extension MasterTimelineViewController {
} }
func updateUI() { func updateUI() {
updateTitleUnreadCount(animate: true) updateTitleUnreadCount()
updateToolbar() updateToolbar()
} }
@ -484,17 +484,9 @@ private extension MasterTimelineViewController {
firstUnreadButton.isEnabled = coordinator.isTimelineUnreadAvailable firstUnreadButton.isEnabled = coordinator.isTimelineUnreadAvailable
} }
func updateTitleUnreadCount(animate: Bool) { func updateTitleUnreadCount() {
if let unreadCountProvider = coordinator.timelineFetcher as? UnreadCountProvider { if let unreadCountProvider = coordinator.timelineFetcher as? UnreadCountProvider {
if animate {
UIView.animate(withDuration: 0.3) {
self.titleView?.unreadCountView.unreadCount = unreadCountProvider.unreadCount self.titleView?.unreadCountView.unreadCount = unreadCountProvider.unreadCount
self.titleView?.setNeedsLayout()
self.titleView?.layoutIfNeeded()
}
} else {
self.titleView?.unreadCountView.unreadCount = unreadCountProvider.unreadCount
}
} }
} }