Rollback timeline unread and star animations
This commit is contained in:
parent
430a4a37bf
commit
2e489d4093
@ -187,30 +187,12 @@ private extension MasterTimelineTableViewCell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateUnreadIndicator() {
|
func updateUnreadIndicator() {
|
||||||
let hide = cellData.read || cellData.starred
|
showOrHideView(unreadIndicatorView, cellData.read || cellData.starred)
|
||||||
self.unreadIndicatorView.isHidden = hide
|
unreadIndicatorView.setNeedsDisplay()
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateStarView() {
|
func updateStarView() {
|
||||||
self.starView.isHidden = !self.cellData.starred
|
showOrHideView(starView, !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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateAvatar() {
|
func updateAvatar() {
|
||||||
@ -251,6 +233,10 @@ private extension MasterTimelineTableViewCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func showOrHideView(_ view: UIView, _ shouldHide: Bool) {
|
||||||
|
shouldHide ? hideView(view) : showView(view)
|
||||||
|
}
|
||||||
|
|
||||||
func updateSubviews() {
|
func updateSubviews() {
|
||||||
updateTitleView()
|
updateTitleView()
|
||||||
updateSummaryView()
|
updateSummaryView()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user