Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
02b66cc73a |
@@ -235,4 +235,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 80d17907323e578d6ed774b6c6bbdb99cf9cde74
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
COCOAPODS: 1.12.1
|
||||
|
@@ -11197,7 +11197,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.nnbc123.voice;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -11230,7 +11230,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.nnbc123.voice;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@@ -31,7 +31,7 @@
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
|
@@ -71,12 +71,43 @@
|
||||
|
||||
if(roomInfo.roomBackground.picUrl.length > 0){
|
||||
|
||||
|
||||
if([roomInfo.roomBackground.picUrl containsString:@".svga"]){
|
||||
@weakify(self);
|
||||
[self.parserManager loadSvgaWithURL:[NSURL URLWithString:[roomInfo.backPic stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@strongify(self);
|
||||
if (videoItem != nil) {
|
||||
self.svgDisplayView.hidden = NO;
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
} else {//高大于宽
|
||||
CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度
|
||||
if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
} else {//小于屏幕高度,
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
}
|
||||
self.svgDisplayView.loops = INT_MAX;
|
||||
self.svgDisplayView.clearsAfterStop = NO;
|
||||
self.svgDisplayView.videoItem = videoItem;
|
||||
[self.svgDisplayView startAnimation];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
[XCHUDTool showErrorWithMessage:@"贵族专属背景图加载失败"];
|
||||
}];
|
||||
}else{
|
||||
[self.svgDisplayView stopAnimation];
|
||||
self.svgDisplayView.hidden = YES;
|
||||
[self.backImageView loadImageWithUrl:roomInfo.roomBackground.picUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
||||
self.backImageView.image = image;
|
||||
}];
|
||||
self.backImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +116,7 @@
|
||||
self.backImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
if ([roomInfo.backPic containsString:@".svga"]) { //房间背景是SVGA动态背景
|
||||
@weakify(self);
|
||||
[self.parserManager loadSvgaWithURL:[NSURL URLWithString:roomInfo.backPic] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
[self.parserManager loadSvgaWithURL:[NSURL URLWithString:[roomInfo.backPic stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@strongify(self);
|
||||
if (videoItem != nil) {
|
||||
self.svgDisplayView.hidden = NO;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// Created by duoban on 2023/7/26.
|
||||
//
|
||||
|
||||
#import <SVGA.h>
|
||||
#import "XPRoomSettingBackImageChooseView.h"
|
||||
@interface XPRoomSettingBackImageChooseView()
|
||||
@property(nonatomic,strong) UIView *bgView;
|
||||
@@ -16,6 +16,9 @@
|
||||
@property(nonatomic,strong) UIButton *cancelBtn;
|
||||
///确认
|
||||
@property(nonatomic,strong) UIButton *verifyBtn;
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
|
||||
@property (nonatomic,strong) SVGAImageView *bgSvgaView;
|
||||
@end
|
||||
@implementation XPRoomSettingBackImageChooseView
|
||||
|
||||
@@ -31,6 +34,7 @@
|
||||
[self addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.titleVeiw];
|
||||
[self.bgView addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.bgSvgaView];
|
||||
[self.bgImageView addSubview:self.bgPreview];
|
||||
[self.bgPreview addSubview:self.previewLabel];
|
||||
[self.bgView addSubview:self.cancelBtn];
|
||||
@@ -53,7 +57,9 @@
|
||||
make.height.mas_equalTo(kGetScaleWidth(400));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
[self.bgSvgaView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgImageView);
|
||||
}];
|
||||
[self.bgPreview mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.bottom.equalTo(self.bgImageView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(38));
|
||||
@@ -76,7 +82,21 @@
|
||||
- (void)setModel:(XPRoomSettingBackImageItemModel *)model{
|
||||
_model = model;
|
||||
_titleVeiw.text = _model.name;
|
||||
if([_model.picUrl containsString:@".svga"]){
|
||||
[self.parser parseWithURL:[NSURL URLWithString:[_model.picUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.bgSvgaView.loops = INT_MAX;
|
||||
self.bgSvgaView.clearsAfterStop = YES;
|
||||
self.bgSvgaView.hidden = NO;
|
||||
self.bgSvgaView.videoItem = videoItem;
|
||||
[self.bgSvgaView startAnimation];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
self.bgSvgaView.hidden = YES;
|
||||
if([_model.viewUrl hasPrefix:@"http"]){
|
||||
_bgImageView.imageUrl = _model.viewUrl;
|
||||
|
||||
@@ -161,5 +181,19 @@
|
||||
}
|
||||
return _verifyBtn;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser{
|
||||
if(!_parser){
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
- (SVGAImageView *)bgSvgaView {
|
||||
if (!_bgSvgaView) {
|
||||
_bgSvgaView = [[SVGAImageView alloc]init];
|
||||
_bgSvgaView.backgroundColor = [UIColor clearColor];
|
||||
_bgSvgaView.userInteractionEnabled = NO;
|
||||
_bgSvgaView.hidden = YES;
|
||||
}
|
||||
return _bgSvgaView;
|
||||
}
|
||||
@end
|
||||
|
@@ -6,12 +6,15 @@
|
||||
//
|
||||
|
||||
#import "XPRoomSettingBackImageItemCell.h"
|
||||
|
||||
#import <SVGA.h>
|
||||
@interface XPRoomSettingBackImageItemCell()
|
||||
@property(nonatomic,strong) NetImageView *bgImageView;
|
||||
@property(nonatomic,strong) UIImageView *selectView;
|
||||
@property(nonatomic,strong) UILabel *titleVeiw;
|
||||
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
|
||||
@property (nonatomic,strong) SVGAImageView *bgSvgaView;
|
||||
@end
|
||||
|
||||
@implementation XPRoomSettingBackImageItemCell
|
||||
@@ -25,6 +28,7 @@
|
||||
}
|
||||
-(void)installUI{
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.bgSvgaView];
|
||||
[self.bgImageView addSubview:self.selectView];
|
||||
[self.contentView addSubview:self.titleVeiw];
|
||||
}
|
||||
@@ -33,6 +37,9 @@
|
||||
make.leading.trailing.top.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(288));
|
||||
}];
|
||||
[self.bgSvgaView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgImageView);
|
||||
}];
|
||||
|
||||
[self.selectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(20));
|
||||
@@ -49,6 +56,23 @@
|
||||
_selectView.hidden = !_model.isUsed;
|
||||
_bgImageView.layer.borderWidth = _model.isUsed ? 2:0;
|
||||
_titleVeiw.text = _model.name;
|
||||
self.bgImageView.image = nil;
|
||||
self.bgSvgaView.hidden = YES;
|
||||
if([_model.picUrl containsString:@".svga"]){
|
||||
[self.parser parseWithURL:[NSURL URLWithString:[_model.picUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.bgSvgaView.loops = INT_MAX;
|
||||
self.bgSvgaView.clearsAfterStop = YES;
|
||||
self.bgSvgaView.hidden = NO;
|
||||
self.bgSvgaView.videoItem = videoItem;
|
||||
[self.bgSvgaView startAnimation];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
if([_model.picUrl hasPrefix:@"http"]){
|
||||
_bgImageView.imageUrl = _model.picUrl;
|
||||
|
||||
@@ -83,5 +107,19 @@
|
||||
}
|
||||
return _titleVeiw;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser{
|
||||
if(!_parser){
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
- (SVGAImageView *)bgSvgaView {
|
||||
if (!_bgSvgaView) {
|
||||
_bgSvgaView = [[SVGAImageView alloc]init];
|
||||
_bgSvgaView.backgroundColor = [UIColor clearColor];
|
||||
_bgSvgaView.userInteractionEnabled = NO;
|
||||
_bgSvgaView.hidden = YES;
|
||||
}
|
||||
return _bgSvgaView;
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user