麦位显示上的优化
This commit is contained in:
@@ -97,11 +97,19 @@
|
||||
|
||||
- (void)configMicroState:(MicroStateModel *)micState {
|
||||
self.micStateImageView.hidden = micState.micState == MicroMicStateType_Open;
|
||||
UIImage *image;
|
||||
if (micState.posState == MicroPosStateType_Free) {
|
||||
self.avatarImageView.image = [UIImage imageNamed:@"room_position_normal"];
|
||||
image = [UIImage imageNamed:@"room_position_normal"];
|
||||
} else {
|
||||
self.avatarImageView.image = [UIImage imageNamed:@"room_position_lock"];
|
||||
image = [UIImage imageNamed:@"room_position_lock"];
|
||||
}
|
||||
CGSize scaledToSize = CGSizeMake(self.frame.size.width, self.frame.size.width);
|
||||
UIGraphicsBeginImageContextWithOptions(scaledToSize, false, 0.0);
|
||||
// 缩小 “1” 点儿,防止默认背景的边缘被裁减。
|
||||
[image drawInRect:CGRectMake(1, 1, scaledToSize.width - 2, scaledToSize.height - 2)];
|
||||
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
self.avatarImageView.backgroundColor = [UIColor colorWithPatternImage:newImage];
|
||||
self.postionLabel.text = [NSString stringWithFormat:@"%d", micState.position + 1];
|
||||
}
|
||||
|
||||
@@ -118,6 +126,7 @@
|
||||
self.nickLabel.text = userInfo.nick;
|
||||
}
|
||||
} else {
|
||||
self.avatarImageView.image = nil;
|
||||
[self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];
|
||||
}
|
||||
}
|
||||
@@ -127,7 +136,6 @@
|
||||
if (!_avatarImageView) {
|
||||
_avatarImageView = [[NetImageView alloc] init];
|
||||
_avatarImageView.userInteractionEnabled = YES;
|
||||
_avatarImageView.image = [UIImage imageNamed:@"room_position_normal"];
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
@@ -42,12 +42,14 @@
|
||||
return;
|
||||
}
|
||||
self.isAnimationing = YES;
|
||||
self.firstView.hidden = NO;
|
||||
[self animationWithLayer:self.firstView];
|
||||
|
||||
}
|
||||
///结束声波动画
|
||||
- (void)stopWaveAnimation {
|
||||
self.isAnimationing = NO;
|
||||
self.firstView.hidden = YES;
|
||||
[self.firstView.layer removeAllAnimations];
|
||||
}
|
||||
|
||||
@@ -55,6 +57,7 @@
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.firstView];
|
||||
self.firstView.hidden = YES;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user