diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 6270ea826..d79b6aec6 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -1270,6 +1270,7 @@ NS_ASSUME_NONNULL_BEGIN [self.bubbleStrokeView removeFromSuperview]; [self.footerView removeFromSuperview]; + [self.footerView prepareForReuse]; for (UIView *subview in self.stackView.subviews) { [subview removeFromSuperview]; diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.h b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.h index 4f04b3848..bc138e7b8 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.h +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.h @@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN - (CGSize)measureWithConversationViewItem:(ConversationViewItem *)viewItem; +- (void)prepareForReuse; + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m index 609c63d3b..c6dd06e91 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m @@ -5,6 +5,7 @@ #import "OWSMessageFooterView.h" #import "DateUtil.h" #import "Signal-Swift.h" +#import NS_ASSUME_NONNULL_BEGIN @@ -114,6 +115,7 @@ NS_ASSUME_NONNULL_BEGIN case MessageReceiptStatusUploading: case MessageReceiptStatusSending: statusIndicatorImage = [UIImage imageNamed:@"message_status_sending"]; + [self animateSpinningIcon]; break; case MessageReceiptStatusSent: case MessageReceiptStatusSkipped: @@ -146,6 +148,19 @@ NS_ASSUME_NONNULL_BEGIN } } +- (void)animateSpinningIcon +{ + CABasicAnimation *animation; + animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + animation.toValue = @(M_PI * 2.0); + const CGFloat kPeriodSeconds = 1.f; + animation.duration = kPeriodSeconds; + animation.cumulative = YES; + animation.repeatCount = HUGE_VALF; + + [self.statusIndicatorImageView.layer addAnimation:animation forKey:@"animation"]; +} + - (void)configureLabelsWithConversationViewItem:(ConversationViewItem *)viewItem { OWSAssert(viewItem); @@ -184,6 +199,11 @@ NS_ASSUME_NONNULL_BEGIN return statusMessage; } +- (void)prepareForReuse +{ + [self.statusIndicatorImageView.layer removeAllAnimations]; +} + @end NS_ASSUME_NONNULL_END