动态列表直播中

This commit is contained in:
chenshuanglin
2023-03-14 11:02:52 +08:00
parent 40f3567b96
commit 94434d2525
3 changed files with 49 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
146567DC29B1D6A900A1F5B9 /* XPNewHomeNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567DB29B1D6A900A1F5B9 /* XPNewHomeNavView.m */; };
146567E229B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */; };
146567E529B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */; };
14A0CF3B29C014B400B2375A /* moment_living.svga in Resources */ = {isa = PBXBuildFile; fileRef = 14A0CF3A29C014B400B2375A /* moment_living.svga */; };
14B65C6529BECD8A00EC02EF /* XPMineMomentTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14B65C6429BECD8A00EC02EF /* XPMineMomentTableViewCell.m */; };
14B65C6B29BF439E00EC02EF /* home_living.svga in Resources */ = {isa = PBXBuildFile; fileRef = 14B65C6A29BF439E00EC02EF /* home_living.svga */; };
14C1F15429B86DF0000A960F /* XPMineMoreTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C1F15329B86DF0000A960F /* XPMineMoreTableViewCell.m */; };
@@ -1284,6 +1285,7 @@
146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeHeaderView.m; sourceTree = "<group>"; };
146567E329B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFindNewFriendTableViewCell.h; sourceTree = "<group>"; };
146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFindNewFriendTableViewCell.m; sourceTree = "<group>"; };
14A0CF3A29C014B400B2375A /* moment_living.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = moment_living.svga; sourceTree = "<group>"; };
14B65C6329BECD8A00EC02EF /* XPMineMomentTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineMomentTableViewCell.h; sourceTree = "<group>"; };
14B65C6429BECD8A00EC02EF /* XPMineMomentTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMomentTableViewCell.m; sourceTree = "<group>"; };
14B65C6A29BF439E00EC02EF /* home_living.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = home_living.svga; sourceTree = "<group>"; };
@@ -7473,6 +7475,7 @@
E8A1E45C276220B100B294CA /* Sources */ = {
isa = PBXGroup;
children = (
14A0CF3A29C014B400B2375A /* moment_living.svga */,
14B65C6A29BF439E00EC02EF /* home_living.svga */,
E887531529BB1B4F0017A41A /* candy_tree.mp4 */,
E839806729027D4A0084BFC8 /* room_wish_gift_sendCelebrate.svga */,
@@ -9320,6 +9323,7 @@
E80EC81728ACD84000D133C5 /* emoji_134@2x.png in Resources */,
E80EC88328ACD84000D133C5 /* emoji_70@2x.png in Resources */,
E8E859E428264D8800EE4857 /* index.html in Resources */,
14A0CF3B29C014B400B2375A /* moment_living.svga in Resources */,
E80EC89528ACD84000D133C5 /* emoji_99@2x.png in Resources */,
E80EC89128ACD84000D133C5 /* emoji_133@2x.png in Resources */,
E839806829027D4A0084BFC8 /* room_wish_gift_sendCelebrate.svga in Resources */,

View File

@@ -8,6 +8,7 @@
#import "XPMomentListCollectionViewCell.h"
#import "ThemeColor.h"
#import <Masonry.h>
#import <SVGA.h>
#import "NetImageView.h"
#import "NSArray+Safe.h"
@@ -29,6 +30,8 @@
@property (nonatomic, strong) NetImageView *avatarImageView;
///
@property (nonatomic, strong) UILabel *nickLabel;
@property (nonatomic, strong) UIView *livingView;
@property (nonatomic, strong) SVGAPlayer *noteView;
@end
@@ -41,6 +44,14 @@
self.contentView.clipsToBounds = YES;
[self createUI];
SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithNamed:@"moment_living" inBundle:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
if (videoItem != nil) {
self.noteView.videoItem = videoItem;
[self.noteView startAnimation];
}
} failureBlock:nil];
}
return self;
}
@@ -59,6 +70,9 @@
[self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.nickLabel];
[self.avatarImageView addSubview:self.livingView];
[self.livingView addSubview:self.noteView];
[self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
@@ -86,6 +100,14 @@
make.centerY.mas_equalTo(self.avatarImageView);
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(4);
}];
[self.livingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
[self.noteView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(8, 8));
}];
}
#pragma mark - Getters And Setters
@@ -107,6 +129,11 @@
self.titleLabel.text = _monentsInfo.content;
self.likeBtn.selected = _monentsInfo.isLike;
self.countLabel.text = _monentsInfo.likeCount.length > 0 ? _monentsInfo.likeCount : @"0";
if ([_monentsInfo.inRoomUid integerValue] == 0) {
self.livingView.hidden = YES;
}else{
self.livingView.hidden = NO;
}
}
}
@@ -169,6 +196,8 @@
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 24/2;
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_avatarImageView.layer.borderWidth = 1;
_avatarImageView.layer.borderColor = [UIColor colorWithWhite:0.8 alpha:1].CGColor;
}
return _avatarImageView;
}
@@ -183,4 +212,20 @@
return _nickLabel;
}
- (UIView *)livingView {
if (!_livingView) {
_livingView = [[UIView alloc] init];
_livingView.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0.5];
_livingView.hidden = YES;
}
return _livingView;
}
- (SVGAPlayer *)noteView {
if (!_noteView) {
_noteView = [[SVGAPlayer alloc] init];
}
return _noteView;
}
@end

Binary file not shown.