From 2e489d4093c45bcf394a9d1554120fc29df82ff3 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 23 Oct 2019 11:08:34 -0500 Subject: [PATCH] Rollback timeline unread and star animations --- .../Cell/MasterTimelineTableViewCell.swift | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 24f7b725b..0a240370e 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -187,30 +187,12 @@ private extension MasterTimelineTableViewCell { } func updateUnreadIndicator() { - let hide = cellData.read || cellData.starred - self.unreadIndicatorView.isHidden = hide - self.unreadIndicatorView.frame.size = !hide ? CGSize.zero : MasterTimelineDefaultCellLayout.unreadCircleSize - UIView.animate( - withDuration: 0.5, - delay: 0.0, - usingSpringWithDamping: 0.5, - initialSpringVelocity: 0.2, - animations: { - self.unreadIndicatorView.frame.size = !hide ? MasterTimelineDefaultCellLayout.unreadCircleSize : CGSize.zero - }) + showOrHideView(unreadIndicatorView, cellData.read || cellData.starred) + unreadIndicatorView.setNeedsDisplay() } func updateStarView() { - self.starView.isHidden = !self.cellData.starred - self.starView.frame.size = self.cellData.starred ? CGSize.zero : MasterTimelineDefaultCellLayout.starSize - UIView.animate( - withDuration: 0.5, - delay: 0.0, - usingSpringWithDamping: 0.5, - initialSpringVelocity: 0.2, - animations: { - self.starView.frame.size = self.cellData.starred ? MasterTimelineDefaultCellLayout.starSize : CGSize.zero - }) + showOrHideView(starView, !cellData.starred) } func updateAvatar() { @@ -251,6 +233,10 @@ private extension MasterTimelineTableViewCell { } } + func showOrHideView(_ view: UIView, _ shouldHide: Bool) { + shouldHide ? hideView(view) : showView(view) + } + func updateSubviews() { updateTitleView() updateSummaryView()