From 050434023e0984d5d371e1c59e380ed94c2ac84e Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 21 Jan 2020 11:41:03 -0700 Subject: [PATCH] Fade out unread and star indicators when possible. Issue #1683 --- .../Cell/MasterTimelineTableViewCell.swift | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 5733b02ae..906f9d812 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -178,12 +178,25 @@ private extension MasterTimelineTableViewCell { } func updateUnreadIndicator() { - showOrHideView(unreadIndicatorView, cellData.read || cellData.starred) - unreadIndicatorView.setNeedsDisplay() + if !unreadIndicatorView.isHidden && cellData.read && !cellData.starred { + UIView.animate(withDuration: 0.66, animations: { self.unreadIndicatorView.alpha = 0 }) { _ in + self.unreadIndicatorView.isHidden = true + self.unreadIndicatorView.alpha = 1 + } + } else { + showOrHideView(unreadIndicatorView, cellData.read || cellData.starred) + } } func updateStarView() { - showOrHideView(starView, !cellData.starred) + if !starView.isHidden && cellData.read && !cellData.starred { + UIView.animate(withDuration: 0.66, animations: { self.starView.alpha = 0 }) { _ in + self.starView.isHidden = true + self.starView.alpha = 1 + } + } else { + showOrHideView(starView, !cellData.starred) + } } func updateIconImage() {