1.0.19 feat:个性化房间背景-free 部分 / 首页支持 API 更新 UI
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
///礼物
|
||||
@property (nonatomic,strong) NetImageView *giftImageView;
|
||||
///礼物内容
|
||||
@property (nonatomic,strong) UILabel *giftContentLabel;
|
||||
@property (nonatomic,strong) UILabel *giftNameLabel;
|
||||
@property (nonatomic,strong) UILabel *giftCountLabel;
|
||||
///去围观
|
||||
@property(nonatomic,strong) UIButton *goButton;
|
||||
|
||||
@@ -40,20 +41,28 @@
|
||||
NSInteger height = kGetScaleWidth(110);
|
||||
NSInteger y = kStatusBarHeight;
|
||||
|
||||
RoomHighValueGiftBannerAnimation *banner = [[RoomHighValueGiftBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, y, KScreenWidth, height)];
|
||||
__block RoomHighValueGiftBannerAnimation *banner = [[RoomHighValueGiftBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, y, KScreenWidth, height)];
|
||||
banner.animationComplete = complete;
|
||||
|
||||
banner.senderScrollLabel.text = @"roomUidinteger($int64) (query)";
|
||||
banner.roomNameScrollLabel.text = @"roomUidinteger($int64) (query)";
|
||||
banner.giftNameLabel.text = @"yijgish";
|
||||
banner.giftCountLabel.text = @"x!0";
|
||||
|
||||
[superView addSubview:banner];
|
||||
|
||||
@kWeakify(banner);
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
banner.frame = CGRectMake(0, y, KScreenWidth, height);
|
||||
} completion:^(BOOL finished) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(112.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
banner.frame = CGRectMake(-KScreenWidth, y, KScreenWidth, height);
|
||||
} completion:^(BOOL finished) {
|
||||
@kStrongify(banner);
|
||||
if (banner.animationComplete) {
|
||||
banner.animationComplete();
|
||||
}
|
||||
[banner removeFromSuperview];
|
||||
}];
|
||||
});
|
||||
@@ -101,6 +110,50 @@
|
||||
make.trailing.mas_equalTo(kGetScaleWidth(-106));
|
||||
make.size.mas_equalTo(CGSizeMake(46, 46));
|
||||
}];
|
||||
|
||||
[self addSubview:self.senderScrollLabel];
|
||||
[self.senderScrollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(38);
|
||||
make.leading.mas_equalTo(self.senderAvatarView.mas_trailing).offset(4);
|
||||
make.trailing.mas_equalTo(self.giftImageView.mas_leading).offset(-4);
|
||||
make.height.mas_equalTo(16);
|
||||
}];
|
||||
|
||||
[self addSubview:self.giftNameLabel];
|
||||
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.senderScrollLabel.mas_bottom).offset(4);
|
||||
make.leading.mas_equalTo(self.senderAvatarView.mas_trailing).offset(4);
|
||||
make.height.mas_equalTo(16);
|
||||
}];
|
||||
|
||||
[self addSubview:self.giftCountLabel];
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.giftNameLabel);
|
||||
make.leading.mas_equalTo(self.giftNameLabel.mas_trailing).offset(7);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
UIImageView *room = [[UIImageView alloc] initWithImage:kImage(@"gift_banner_room")];
|
||||
[self addSubview:room];
|
||||
[room mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(2);
|
||||
make.top.mas_equalTo(self.giftImageView);
|
||||
make.width.height.mas_equalTo(11);
|
||||
}];
|
||||
|
||||
[self addSubview:self.roomNameScrollLabel];
|
||||
[self.roomNameScrollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(room);
|
||||
make.leading.mas_equalTo(room.mas_trailing).offset(2);
|
||||
make.trailing.mas_equalTo(self).offset(-34);
|
||||
}];
|
||||
|
||||
[self addSubview:self.goButton];
|
||||
[self.goButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(8);
|
||||
make.top.mas_equalTo(self.roomNameScrollLabel.mas_bottom).offset(1);
|
||||
make.size.mas_equalTo(CGSizeMake(55, 20));
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +189,7 @@
|
||||
if(!_senderScrollLabel){
|
||||
_senderScrollLabel = [[MarqueeLabel alloc] init];
|
||||
_senderScrollLabel.scrollDuration = 6.0;
|
||||
_senderScrollLabel.textColor = [UIColor whiteColor];
|
||||
_senderScrollLabel.fadeLength = 8.0f;
|
||||
_senderScrollLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
@@ -145,6 +199,7 @@
|
||||
- (MarqueeLabel *)roomNameScrollLabel{
|
||||
if(!_roomNameScrollLabel){
|
||||
_roomNameScrollLabel = [[MarqueeLabel alloc] init];
|
||||
_roomNameScrollLabel.textColor = [UIColor whiteColor];
|
||||
_roomNameScrollLabel.scrollDuration = 6.0;
|
||||
_roomNameScrollLabel.fadeLength = 8.0f;
|
||||
_roomNameScrollLabel.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -165,13 +220,22 @@
|
||||
return _giftImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)giftContentLabel {
|
||||
if (!_giftContentLabel) {
|
||||
_giftContentLabel = [[UILabel alloc] init];
|
||||
_giftContentLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftContentLabel.font = kFontHeavy(16);
|
||||
- (UILabel *)giftNameLabel {
|
||||
if (!_giftNameLabel) {
|
||||
_giftNameLabel = [[UILabel alloc] init];
|
||||
_giftNameLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftNameLabel.font = kFontMedium(11);
|
||||
}
|
||||
return _giftContentLabel;
|
||||
return _giftNameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)giftCountLabel {
|
||||
if (!_giftCountLabel) {
|
||||
_giftCountLabel = [[UILabel alloc] init];
|
||||
_giftCountLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftCountLabel.font = kFontMedium(17);
|
||||
}
|
||||
return _giftCountLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)goButton{
|
||||
|
||||
Reference in New Issue
Block a user