|
|
@@ -80,6 +80,8 @@ static const CGFloat kMediaCornerRadius = 4.0f;
|
|
|
|
|
|
@property (nonatomic,strong) NSArray *matchesArray;
|
|
|
|
|
|
+@property (nonatomic, strong) UIActivityIndicatorView *indicatorView;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
|
|
|
@@ -179,6 +181,13 @@ static const CGFloat kMediaCornerRadius = 4.0f;
|
|
|
// 初始化发送失败按钮
|
|
|
[self setupResendButton];
|
|
|
|
|
|
+ self.indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
|
|
+ self.indicatorView.color = UIColor.whiteColor;
|
|
|
+ [self.contentView addSubview:self.indicatorView];
|
|
|
+ [self.indicatorView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerY.equalTo(self.bubbleImageView);
|
|
|
+ make.right.equalTo(self.bubbleImageView.mas_left).mas_offset(-8);
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -750,32 +759,34 @@ static const CGFloat kMediaCornerRadius = 4.0f;
|
|
|
// 配置发送进度
|
|
|
- (void)setupSendingProgress {
|
|
|
// 只有发送方才显示进度或失败按钮
|
|
|
- if (!_messageModel.isSender || !_messageModel.isUploadFile) {
|
|
|
- [self hideProgressView];
|
|
|
- [self hideResendButton];
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (self.messageModel.isSent) {
|
|
|
+ if (!_messageModel.isSender || self.messageModel.isSent) {
|
|
|
[self hideProgressView];
|
|
|
[self hideResendButton];
|
|
|
+ [self.indicatorView stopAnimating];
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ self.indicatorView.hidden = self.messageModel.isUploadFile;
|
|
|
switch (self.messageModel.fileUploadStatus) {
|
|
|
case FileUploadCompleted:
|
|
|
[self hideProgressView];
|
|
|
[self hideResendButton];
|
|
|
+ [self.indicatorView stopAnimating];
|
|
|
break;
|
|
|
|
|
|
- case FileUploading:
|
|
|
- [self showProgressView];
|
|
|
+ case FileUploading:{
|
|
|
[self hideResendButton];
|
|
|
- break;
|
|
|
-
|
|
|
+ if (self.messageModel.isUploadFile) {
|
|
|
+ [self showProgressView];
|
|
|
+ } else {
|
|
|
+ [self.indicatorView startAnimating];
|
|
|
+ }
|
|
|
+ }break;
|
|
|
+
|
|
|
case FileUploadFail:
|
|
|
[self showResendButton];
|
|
|
[self hideProgressView];
|
|
|
+ [self.indicatorView stopAnimating];
|
|
|
break;
|
|
|
}
|
|
|
|