Merge branch 'charlesmchen/sendingAnimation'

pull/1/head
Matthew Chen 7 years ago
commit 2559b7b8fd

@ -1270,6 +1270,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.bubbleStrokeView removeFromSuperview]; [self.bubbleStrokeView removeFromSuperview];
[self.footerView removeFromSuperview]; [self.footerView removeFromSuperview];
[self.footerView prepareForReuse];
for (UIView *subview in self.stackView.subviews) { for (UIView *subview in self.stackView.subviews) {
[subview removeFromSuperview]; [subview removeFromSuperview];

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

@ -5,6 +5,7 @@
#import "OWSMessageFooterView.h" #import "OWSMessageFooterView.h"
#import "DateUtil.h" #import "DateUtil.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import <QuartzCore/QuartzCore.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -114,6 +115,7 @@ NS_ASSUME_NONNULL_BEGIN
case MessageReceiptStatusUploading: case MessageReceiptStatusUploading:
case MessageReceiptStatusSending: case MessageReceiptStatusSending:
statusIndicatorImage = [UIImage imageNamed:@"message_status_sending"]; statusIndicatorImage = [UIImage imageNamed:@"message_status_sending"];
[self animateSpinningIcon];
break; break;
case MessageReceiptStatusSent: case MessageReceiptStatusSent:
case MessageReceiptStatusSkipped: 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 - (void)configureLabelsWithConversationViewItem:(ConversationViewItem *)viewItem
{ {
OWSAssert(viewItem); OWSAssert(viewItem);
@ -184,6 +199,11 @@ NS_ASSUME_NONNULL_BEGIN
return statusMessage; return statusMessage;
} }
- (void)prepareForReuse
{
[self.statusIndicatorImageView.layer removeAllAnimations];
}
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

Loading…
Cancel
Save