Merge branch 'charlesmchen/sendingAnimation'

pull/1/head
Matthew Chen
commit 2559b7b8fd

@ -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];

@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
- (CGSize)measureWithConversationViewItem:(ConversationViewItem *)viewItem;
- (void)prepareForReuse;
@end
NS_ASSUME_NONNULL_END

@ -5,6 +5,7 @@
#import "OWSMessageFooterView.h"
#import "DateUtil.h"
#import "Signal-Swift.h"
#import <QuartzCore/QuartzCore.h>
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

Loading…
Cancel
Save