Add unread count to the timeline

This commit is contained in:
Maurice Parker
2019-09-30 20:01:02 -05:00
parent ed2257a4f4
commit 77ba42f102
6 changed files with 74 additions and 12 deletions

View File

@@ -479,7 +479,8 @@ private extension MasterTimelineViewController {
}
titleView.label.text = coordinator.timelineName
updateTitleUnreadCount()
if coordinator.timelineFetcher is Feed {
titleView.heightAnchor.constraint(equalToConstant: 44.0).isActive = true
let tap = UITapGestureRecognizer(target: self, action:#selector(showFeedInspector(_:)))
@@ -500,10 +501,17 @@ private extension MasterTimelineViewController {
}
func updateUI() {
updateTitleUnreadCount()
markAllAsReadButton.isEnabled = coordinator.isTimelineUnreadAvailable
firstUnreadButton.isEnabled = coordinator.isTimelineUnreadAvailable
}
func updateTitleUnreadCount() {
if let unreadCountProvider = coordinator.timelineFetcher as? UnreadCountProvider {
titleView?.unreadCountView.unreadCount = unreadCountProvider.unreadCount
}
}
func updateProgressIndicatorIfNeeded() {
if !coordinator.isThreePanelMode {
navigationController?.updateAccountRefreshProgressIndicator()