9
9
#import " LLMessageRecordingCell.h"
10
10
#import " UIKit+LLExt.h"
11
11
#import " LLMessageVoiceCell.h"
12
+ #import " LLColors.h"
12
13
13
14
#define RECORD_ANIMATION_KEY @" RecordAnimate"
14
15
@@ -18,6 +19,8 @@ @interface LLMessageRecordingCell ()
18
19
19
20
@property (nonatomic ) UIImageView *downloadingImageView;
20
21
22
+ @property (nonatomic ) UILabel *durationLabel;
23
+
21
24
@property (nonatomic ) CAKeyframeAnimation *keyFrameAnimation;
22
25
23
26
@end
@@ -44,6 +47,12 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
44
47
45
48
[self .contentView insertSubview: self .downloadingImageView belowSubview: self .bubbleImage];
46
49
50
+ _durationLabel = [[UILabel alloc ] initWithFrame: CGRectMake (0 , OFFSET_Y, 60 , AVATAR_HEIGHT)];
51
+ _durationLabel.textColor = kLLTextColor_lightGray_7 ;
52
+ _durationLabel.font = [UIFont systemFontOfSize: 16 ];
53
+ _durationLabel.textAlignment = NSTextAlignmentRight;
54
+ [self .contentView addSubview: _durationLabel];
55
+
47
56
}
48
57
49
58
return self;
@@ -67,6 +76,10 @@ - (void)prepareForUse:(BOOL)isFromMe {
67
76
68
77
self.downloadingImageView .frame = self.bubbleImage .frame ;
69
78
[self .bubbleImage.layer addAnimation: self .keyFrameAnimation forKey: RECORD_ANIMATION_KEY];
79
+
80
+ frame = self.durationLabel .frame ;
81
+ frame.origin .x = CGRectGetMinX (self.bubbleImage .frame ) - CGRectGetWidth (frame) - 8 + BUBBLE_LEFT_BLANK;
82
+ self.durationLabel .frame = frame;
70
83
}
71
84
}
72
85
@@ -109,6 +122,10 @@ - (void)setMessageModel:(LLMessageModel *)messageModel {
109
122
}
110
123
111
124
125
+ - (void )updateDurationLabel : (int )duration {
126
+ _durationLabel.text = [NSString stringWithFormat: @" %d '" , duration];
127
+ }
128
+
112
129
+ (CGFloat )heightForModel : (LLMessageModel *)model {
113
130
return AVATAR_HEIGHT + CONTENT_SUPER_BOTTOM + OFFSET_Y;
114
131
}
0 commit comments