Skip to content

Commit 35d56f8

Browse files
sumengsumeng
authored andcommitted
语音泡泡增加highlight状态
1 parent c6947f5 commit 35d56f8

7 files changed

Lines changed: 21 additions & 1 deletion

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@
527527
7E335D9D1B6F5E94003D0F3D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E335D9A1B6F5E94003D0F3D /* [email protected] */; };
528528
7E335D9E1B6F5E94003D0F3D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E335D9B1B6F5E94003D0F3D /* [email protected] */; };
529529
7E335D9F1B6F5E94003D0F3D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E335D9C1B6F5E94003D0F3D /* [email protected] */; };
530+
7E774C251B870DC70026E5AB /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E774C231B870DC70026E5AB /* [email protected] */; };
531+
7E774C261B870DC70026E5AB /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E774C241B870DC70026E5AB /* [email protected] */; };
530532
7E8E597F1B6F91C40083CA02 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E8E59791B6F91C40083CA02 /* [email protected] */; };
531533
7E8E59801B6F91C40083CA02 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E8E597A1B6F91C40083CA02 /* [email protected] */; };
532534
7E8E59811B6F91C40083CA02 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E8E597B1B6F91C40083CA02 /* [email protected] */; };
@@ -1669,6 +1671,8 @@
16691671
7E335D9A1B6F5E94003D0F3D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16701672
7E335D9B1B6F5E94003D0F3D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16711673
7E335D9C1B6F5E94003D0F3D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1674+
7E774C231B870DC70026E5AB /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1675+
7E774C241B870DC70026E5AB /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16721676
7E8E59791B6F91C40083CA02 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16731677
7E8E597A1B6F91C40083CA02 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16741678
7E8E597B1B6F91C40083CA02 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -2451,7 +2455,9 @@
24512455
4E6383B11B32640900D98648 /* [email protected] */,
24522456
4E6383B21B32640900D98648 /* [email protected] */,
24532457
4E6383B51B32640900D98648 /* [email protected] */,
2458+
7E774C231B870DC70026E5AB /* [email protected] */,
24542459
4E6383B31B32640900D98648 /* [email protected] */,
2460+
7E774C241B870DC70026E5AB /* [email protected] */,
24552461
4E6383B41B32640900D98648 /* [email protected] */,
24562462
4E6383B61B32640900D98648 /* [email protected] */,
24572463
);
@@ -4668,6 +4674,7 @@
46684674
8B3516501B6CE9460049BC45 /* [email protected] in Resources */,
46694675
4EE1A23D1B5F3834004284F1 /* [email protected] in Resources */,
46704676
4E5C06E81AC2B34800F427C5 /* [email protected] in Resources */,
4677+
7E774C261B870DC70026E5AB /* [email protected] in Resources */,
46714678
8EA6D19A19E240C40076D59C /* [email protected] in Resources */,
46724679
8E8F7B3019EF6306006BA8BD /* [email protected] in Resources */,
46734680
4E07D30D1A4A9F45009EDDF2 /* [email protected] in Resources */,
@@ -4686,6 +4693,7 @@
46864693
4EF17EE41B3C3112003CDD2D /* [email protected] in Resources */,
46874694
4EAE06C01B7B51AF00179F4B /* [email protected] in Resources */,
46884695
8EA6D18F19E240C40076D59C /* [email protected] in Resources */,
4696+
7E774C251B870DC70026E5AB /* [email protected] in Resources */,
46894697
8EA6D16A19E240C40076D59C /* [email protected] in Resources */,
46904698
4E96E7E51A1B537E0037C098 /* [email protected] in Resources */,
46914699
4E90F89E1AF709C100B44F03 /* topic-ios.html in Resources */,
1.1 KB
Loading
-1.74 KB
Loading
1.49 KB
Loading
-1.47 KB
Loading

Coding_iOS/Views/AudioView/BubblePlayView.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,32 @@ - (void)sizeToFit {
7575
}
7676
}
7777

78+
- (void)setHighlighted:(BOOL)highlighted {
79+
[super setHighlighted:highlighted];
80+
_bgImageView.highlighted = highlighted;
81+
}
82+
7883
- (void)setType:(BubbleType)type {
7984
_type = type;
8085
UIImage *bgImage = nil;
86+
UIImage *bgHlImage = nil;
8187
UIImage *playImage = nil;
8288
if (type == BubbleTypeRight) {
8389
bgImage = [UIImage imageNamed:@"messageRight_bg_img"];
8490
bgImage = [bgImage resizableImageWithCapInsets:UIEdgeInsetsMake(18, 30, bgImage.size.height - 19, bgImage.size.width - 31)];
91+
bgHlImage = [UIImage imageNamed:@"messageRight_bg_highlight_img"];
92+
bgHlImage = [bgHlImage resizableImageWithCapInsets:UIEdgeInsetsMake(18, 30, bgImage.size.height - 19, bgImage.size.width - 31)];
8593
playImage = [UIImage imageNamed:@"bubble_right_play_2"];
8694
}
8795
else {
8896
bgImage = [UIImage imageNamed:@"messageLeft_bg_img"];
8997
bgImage = [bgImage resizableImageWithCapInsets:UIEdgeInsetsMake(18, 30, bgImage.size.height - 19, bgImage.size.width - 31)];
98+
bgHlImage = [UIImage imageNamed:@"messageLeft_bg_highlight_img"];
99+
bgHlImage = [bgHlImage resizableImageWithCapInsets:UIEdgeInsetsMake(18, 30, bgImage.size.height - 19, bgImage.size.width - 31)];
90100
playImage = [UIImage imageNamed:@"bubble_left_play_2"];
91101
}
92102
_bgImageView.image = bgImage;
103+
_bgImageView.highlightedImage = bgHlImage;
93104
_playImageView.size = playImage.size;
94105
_playImageView.image = playImage;
95106
//refresh play state

Coding_iOS/Views/Cell/MessageCell.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
9090
else if ([reuseIdentifier isEqualToString:kCellIdentifier_MessageVoice]) {
9191
if (!_voiceView) {
9292
_voiceView = [[BubblePlayView alloc] initWithFrame:CGRectMake(0, 0, kMessageCell_ContentWidth, 40)];
93-
_voiceView.showBgImg = NO;
9493
[_bgImgView addSubview:_voiceView];
9594
}
9695
}
@@ -223,6 +222,7 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
223222
_contentLabel.textColor = [UIColor blackColor];
224223
_bgImgView.frame = bgImgViewFrame;
225224
if (_voiceView) {
225+
bgImg = nil; //使用bubbleView的背景
226226
_voiceView.type = BubbleTypeLeft;
227227
}
228228
}else{
@@ -234,6 +234,7 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
234234
_contentLabel.textColor = [UIColor blackColor];
235235
_bgImgView.frame = bgImgViewFrame;
236236
if (_voiceView) {
237+
bgImg = nil; //使用bubbleView的背景
237238
_voiceView.type = BubbleTypeRight;
238239
}
239240
}

0 commit comments

Comments
 (0)