更换项目
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// ChamberHalfHourRateMatrix.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/7.
|
||||
//
|
||||
|
||||
#import "ChamberHalfHourRateMatrix.h"
|
||||
|
||||
@implementation ChamberHalfHourRateMatrix
|
||||
|
||||
@end
|
@@ -2,16 +2,40 @@
|
||||
// PIBaseAnimationViewModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/7/10.
|
||||
// Created by duoban on 2023/7/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
GiftBannerType_Lucky,///福袋
|
||||
GiftBannerType_Love,///寻爱之旅
|
||||
GiftBannerType_Nobleman,///贵族
|
||||
GiftBannerType_kitchen,///厨房
|
||||
GiftBannerType_AnchorHour,///个播小时榜
|
||||
GiftBannerType_LicneseHour,///牌照房小时榜
|
||||
} GiftBannerType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PIBaseAnimationViewModel : NSObject
|
||||
@property (nonatomic,assign) int first;
|
||||
@property (nonatomic,assign) int second;
|
||||
|
||||
@property(nonatomic, copy)NSString *nick;
|
||||
@property(nonatomic, copy)NSString *giftName;
|
||||
@property (nonatomic,copy) NSString *luckyBagName;
|
||||
@property (nonatomic,copy) NSString *roomTitle;
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
@property (nonatomic,copy) NSString *goldPrice;
|
||||
@property (nonatomic,assign) BOOL isInRoomVisiable;
|
||||
@property(nonatomic,assign) GiftBannerType type;
|
||||
@property (nonatomic,copy) NSDictionary *data;
|
||||
|
||||
@property (nonatomic,copy) NSString *skipUrl;
|
||||
@property (nonatomic,copy) NSString *itemId;
|
||||
@property (nonatomic,copy) NSString *itemMultiple;
|
||||
@property (nonatomic,copy) NSString *diamonds;
|
||||
@property (nonatomic,copy) NSString * bannerId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// PIBaseAnimationViewModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/7/10.
|
||||
// Created by duoban on 2023/7/11.
|
||||
//
|
||||
|
||||
#import "PIBaseAnimationViewModel.h"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ChamberHalfHourRateMatrix.h
|
||||
// RoomHalfHourRankModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/7.
|
||||
@@ -9,12 +9,18 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ChamberHalfHourRateMatrix : NSObject
|
||||
@interface RoomHalfHourRankModel : NSObject
|
||||
///个播房字段
|
||||
///用户uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///昵称
|
||||
@property (nonatomic,copy) NSString *nick;
|
||||
///头像
|
||||
@property (nonatomic,copy) NSString *avatar;
|
||||
///描述
|
||||
@property (nonatomic,copy) NSString *desc;
|
||||
|
||||
///牌照房中显示
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
@end
|
||||
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// RoomHalfHourRankModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/7.
|
||||
//
|
||||
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
|
||||
@implementation RoomHalfHourRankModel
|
||||
|
||||
@end
|
@@ -9,8 +9,10 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIPresentOriflammeConsumerAbstractMatrix : NSObject
|
||||
@interface XPGiftBannerUserInfoModel : NSObject
|
||||
///
|
||||
@property (nonatomic,assign) int position;
|
||||
///
|
||||
@property (nonatomic,assign) NSInteger uid;
|
||||
@end
|
||||
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// YMGiftBannerUserInfoModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "XPGiftBannerUserInfoModel.h"
|
||||
|
||||
@implementation XPGiftBannerUserInfoModel
|
||||
|
||||
@end
|
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// YMGiftBigPrizeModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
///四级礼物的模型
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPGiftBigPrizeModel : NSObject
|
||||
///送礼物的人
|
||||
@property(nonatomic, copy)NSString *nick;
|
||||
///礼物的名称
|
||||
@property(nonatomic, copy)NSString *giftName;
|
||||
///幸运的礼物
|
||||
@property (nonatomic,copy) NSString *luckyBagName;
|
||||
///房间名称
|
||||
@property (nonatomic,copy) NSString *roomTitle;
|
||||
///yoghurtuid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///房主的uid
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
///礼物的价值
|
||||
@property (nonatomic,copy) NSString *goldPrice;
|
||||
///是否仅自己房间可见
|
||||
@property (nonatomic,assign) BOOL isInRoomVisiable;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -5,8 +5,8 @@
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "YUMIPresentBigCaptureMatrix.h"
|
||||
#import "XPGiftBigPrizeModel.h"
|
||||
|
||||
@implementation YUMIPresentBigCaptureMatrix
|
||||
@implementation XPGiftBigPrizeModel
|
||||
|
||||
@end
|
@@ -9,12 +9,17 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIPresentCompoundMatrix : NSObject
|
||||
@interface XPGiftCompoundModel : NSObject
|
||||
|
||||
///昵称
|
||||
@property(nonatomic, copy)NSString *nick;
|
||||
///礼物的名称
|
||||
@property(nonatomic, copy)NSString *giftName;
|
||||
///礼物id
|
||||
@property (nonatomic,copy) NSString *giftId;
|
||||
///用户uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///消息
|
||||
@property (nonatomic,copy) NSString *msg;
|
||||
|
||||
@end
|
@@ -5,8 +5,8 @@
|
||||
// Created by YUMI on 2022/8/5.
|
||||
//
|
||||
|
||||
#import "YUMIPresentCompoundMatrix.h"
|
||||
#import "XPGiftCompoundModel.h"
|
||||
|
||||
@implementation YUMIPresentCompoundMatrix
|
||||
@implementation XPGiftCompoundModel
|
||||
|
||||
@end
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// YUMIChamberSatelliteKitchenMatrix.h
|
||||
// XPRoomStarKitchenModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/21.
|
||||
@@ -9,14 +9,21 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberSatelliteKitchenMatrix : NSObject
|
||||
@interface XPRoomStarKitchenModel : NSObject
|
||||
@property (nonatomic,copy) NSString *skipUrl;
|
||||
///用户id
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///昵称
|
||||
@property (nonatomic,copy) NSString *nick;
|
||||
///房间id
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
///中奖选项id
|
||||
@property (nonatomic,copy) NSString *itemId;
|
||||
///倍数
|
||||
@property (nonatomic,copy) NSString *itemMultiple;
|
||||
///钻石
|
||||
@property (nonatomic,copy) NSString *diamonds;
|
||||
///bannerId
|
||||
@property (nonatomic,copy) NSString * bannerId;
|
||||
@end
|
||||
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// XPRoomStarKitchenModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/21.
|
||||
//
|
||||
|
||||
#import "XPRoomStarKitchenModel.h"
|
||||
|
||||
@implementation XPRoomStarKitchenModel
|
||||
|
||||
@end
|
@@ -1,35 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBroadCastModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
// 广播礼物的model
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, BroadCastPrototype) {
|
||||
BroadCastPrototype_Normal = 1,
|
||||
BroadCastPrototype_Middle = 2,
|
||||
|
||||
BroadCastPrototype_High = 3,
|
||||
};
|
||||
|
||||
@interface YUMIChamberPresentBroadCastMatrix : NSObject
|
||||
@property (nonatomic,assign) NSInteger giftNum;
|
||||
@property (nonatomic,copy) NSString *giftName;
|
||||
@property (nonatomic,copy) NSString *giftUrl;
|
||||
@property (nonatomic,assign) BOOL isSkipRoom;
|
||||
@property (nonatomic,assign) BroadCastPrototype levelNum;
|
||||
@property (nonatomic,assign) CGFloat notifyStaySecond;
|
||||
@property (nonatomic,copy) NSString *recvUserAvatar;
|
||||
@property (nonatomic,copy) NSString *recvUserNick;
|
||||
@property (nonatomic, copy) NSString *sendUserAvatar;
|
||||
@property (nonatomic, copy) NSString *sendUserNick;
|
||||
@property (nonatomic,assign) NSInteger roomUid;
|
||||
@property (nonatomic,copy) NSString *roomErbanNo;
|
||||
@property (nonatomic, assign) BOOL ceremonyGift;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBroadCastModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "YUMIChamberPresentBroadCastMatrix.h"
|
||||
|
||||
|
||||
|
||||
@implementation YUMIChamberPresentBroadCastMatrix
|
||||
|
||||
|
||||
@end
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// YUMIChamberSatelliteKitchenMatrix.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/21.
|
||||
//
|
||||
|
||||
#import "YUMIChamberSatelliteKitchenMatrix.h"
|
||||
|
||||
@implementation YUMIChamberSatelliteKitchenMatrix
|
||||
|
||||
@end
|
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// YMGiftBigPrizeModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
///四级礼物的模型
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PIBaseAnimationViewModel.h"
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
GiftBannerType_Lucky,///福袋
|
||||
GiftBannerType_Love,///寻爱之旅
|
||||
GiftBannerType_Nobleman,///贵族
|
||||
GiftBannerType_kitchen,///厨房
|
||||
GiftBannerType_AnchorHour,///个播小时榜
|
||||
GiftBannerType_LicneseHour,///牌照房小时榜
|
||||
} GiftBannerType;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIPresentBigCaptureMatrix : PIBaseAnimationViewModel
|
||||
@property(nonatomic, copy)NSString *nick;
|
||||
@property(nonatomic, copy)NSString *giftName;
|
||||
@property (nonatomic,copy) NSString *luckyBagName;
|
||||
@property (nonatomic,copy) NSString *roomTitle;
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
@property (nonatomic,copy) NSString *goldPrice;
|
||||
@property (nonatomic,assign) BOOL isInRoomVisiable;
|
||||
@property(nonatomic,assign) GiftBannerType type;
|
||||
@property (nonatomic,copy) NSDictionary *data;
|
||||
|
||||
@property (nonatomic,copy) NSString *skipUrl;
|
||||
@property (nonatomic,copy) NSString *itemId;
|
||||
@property (nonatomic,copy) NSString *itemMultiple;
|
||||
@property (nonatomic,copy) NSString *diamonds;
|
||||
@property (nonatomic,copy) NSString * bannerId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// YMGiftBannerUserInfoModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "YUMIPresentOriflammeConsumerAbstractMatrix.h"
|
||||
|
||||
@implementation YUMIPresentOriflammeConsumerAbstractMatrix
|
||||
|
||||
@end
|
@@ -8,10 +8,11 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ChamberHalfHourRateMatrix;
|
||||
@interface YUMIChamberKellegRateOriflammeRegard : UIView
|
||||
@class RoomHalfHourRankModel;
|
||||
@interface XPRoomAnchorRankBannerView : UIView
|
||||
|
||||
@property (nonatomic,copy) ChamberHalfHourRateMatrix * kellegRateAbstract;
|
||||
///个播小时榜信息
|
||||
@property (nonatomic,copy) RoomHalfHourRankModel * anchorRankInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// YMRoomAnchorRankBannerView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/4/15.
|
||||
//
|
||||
|
||||
#import "XPRoomAnchorRankBannerView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
///Model
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XPRoomAnchorRankBannerView()
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *bgImageView;
|
||||
///icon
|
||||
@property (nonatomic,strong) UIImageView *iconImageView;
|
||||
///头像
|
||||
@property (nonatomic,strong) NetImageView *avatImageView;
|
||||
///恭喜
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///描述
|
||||
@property (nonatomic, strong) UILabel *descLabel;
|
||||
///排行
|
||||
@property (nonatomic, strong) UILabel *rankLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomAnchorRankBannerView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.iconImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.avatImageView];
|
||||
[self addSubview:self.nickLabel];
|
||||
[self addSubview:self.descLabel];
|
||||
[self addSubview:self.rankLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(360);
|
||||
make.height.mas_equalTo(50);
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.bgImageView).mas_offset(-14);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(61);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.iconImageView.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.bgImageView).mas_offset(2);
|
||||
}];
|
||||
[self.avatImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
make.width.height.mas_equalTo(22);
|
||||
}];
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatImageView.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
[self.rankLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.descLabel.mas_right);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setAnchorRankInfo:(RoomHalfHourRankModel *)anchorRankInfo {
|
||||
_anchorRankInfo = anchorRankInfo;
|
||||
if (anchorRankInfo) {
|
||||
self.avatImageView.imageUrl = _anchorRankInfo.avatar;
|
||||
NSString *nick = _anchorRankInfo.nick;
|
||||
if(nick.length > 4) {
|
||||
nick = [NSString stringWithFormat:@"%@…", [nick substringToIndex:4]];
|
||||
}
|
||||
self.nickLabel.text = nick;
|
||||
self.descLabel.text = _anchorRankInfo.desc;
|
||||
}
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage imageNamed:@"anchor_hour_rank_bg"];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
_iconImageView = [[UIImageView alloc] init];
|
||||
_iconImageView.image = [UIImage imageNamed:@"anchor_hour_rank_icon"];
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = YMLocalizedString(@"XPRoomAnchorRankBannerView0");
|
||||
_titleLabel = label;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (NetImageView *)avatImageView {
|
||||
if (!_avatImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_avatImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatImageView.layer.masksToBounds = YES;
|
||||
_avatImageView.layer.cornerRadius = 11;
|
||||
}
|
||||
return _avatImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nickLabel {
|
||||
if (!_nickLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
|
||||
label.textColor = UIColorFromRGB(0xFFFC2C);
|
||||
_nickLabel = label;
|
||||
}
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)descLabel {
|
||||
if (!_descLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightHeavy];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
_descLabel = label;
|
||||
}
|
||||
return _descLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)rankLabel {
|
||||
if (!_rankLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightHeavy];
|
||||
label.textColor = UIColorFromRGB(0xFFFC2C);
|
||||
label.text = @"TOP1";
|
||||
_rankLabel = label;
|
||||
}
|
||||
return _rankLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -9,7 +9,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberBrightnessHitRegard : UIView
|
||||
@interface XPRoomAnimationHitView : UIView
|
||||
|
||||
@end
|
||||
|
@@ -5,14 +5,14 @@
|
||||
// Created by YUMI on 2021/11/22.
|
||||
//
|
||||
|
||||
#import "YUMIChamberBrightnessHitRegard.h"
|
||||
#import "XPRoomAnimationHitView.h"
|
||||
#import "NSArray+Safe.h"
|
||||
@implementation YUMIChamberBrightnessHitRegard
|
||||
@implementation XPRoomAnimationHitView
|
||||
|
||||
|
||||
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
|
||||
for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) {
|
||||
UIView * subView = [self.subviews secureGroalTowardsIndictowardsrix1:i];
|
||||
UIView * subView = [self.subviews safeObjectAtIndex1:i];
|
||||
CGPoint convertPoint = [subView convertPoint:point fromView:self];
|
||||
if (CGRectContainsPoint(subView.bounds, convertPoint)) {
|
||||
return [subView hitTest:convertPoint withEvent:event];
|
18
YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.h
Normal file
18
YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// YMRoomAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "XPRoomAnimationHitView.h"
|
||||
#import "RoomHostDelegate.h"
|
||||
#import "RoomGuestDelegate.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomAnimationView : XPRoomAnimationHitView <RoomGuestDelegate>
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
2162
YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m
Normal file
2162
YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m
Normal file
File diff suppressed because it is too large
Load Diff
19
YuMi/Modules/YMRoom/View/AnimationView/XPRoomCandyGiftView.h
Normal file
19
YuMi/Modules/YMRoom/View/AnimationView/XPRoomCandyGiftView.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// YMRoomCandyGiftView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomCandyGiftView : UIView
|
||||
///是否是最大的礼物
|
||||
@property (nonatomic,assign) BOOL isMaxLargeGift;
|
||||
///糖果的信息
|
||||
@property (nonatomic,copy) NSDictionary * candyInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
163
YuMi/Modules/YMRoom/View/AnimationView/XPRoomCandyGiftView.m
Normal file
163
YuMi/Modules/YMRoom/View/AnimationView/XPRoomCandyGiftView.m
Normal file
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// YMRoomCandyGiftView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/10.
|
||||
//
|
||||
|
||||
#import "XPRoomCandyGiftView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "XPSVGAPlayer.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "CandyTreeResultModel.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
@interface XPRoomCandyGiftView ()
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///糖果树特效
|
||||
@property (nonatomic,strong) XPSVGAPlayer *candyTreeView;
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///容器
|
||||
@property (nonatomic,strong) UIView *titleView;
|
||||
///显示文本内容
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomCandyGiftView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.candyTreeView];
|
||||
[self addSubview:self.backImageView];
|
||||
[self.backImageView addSubview:self.titleView];
|
||||
|
||||
[self.titleView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.candyTreeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(260);
|
||||
make.height.mas_equalTo(28);
|
||||
make.top.mas_equalTo(self.backImageView).offset(23);
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.titleView);
|
||||
make.centerY.mas_equalTo(self.titleView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setCandyInfo:(NSDictionary *)candyInfo {
|
||||
if (candyInfo) {
|
||||
CandyTreeGiftInfoModel * giftInfo = [CandyTreeGiftInfoModel modelWithDictionary:candyInfo];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
CGFloat fontSize = self.isMaxLargeGift ? 22 : 13;
|
||||
[attribute appendAttributedString:[self createAttribute:@"厉害了! " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:giftInfo.nick color:[DJDKMIMOMColor colorWithHexString:@"#FEF23E"] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:@"摘下糖果得 " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:giftInfo.prizeName color:[DJDKMIMOMColor colorWithHexString:@"#FEF23E"] fontSize:fontSize]];
|
||||
if (giftInfo.prizeNum > 1) {
|
||||
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
}
|
||||
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
paragraphStyle.lineSpacing = 4.0f;//行间距
|
||||
paragraphStyle.alignment = NSTextAlignmentCenter;
|
||||
paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||
[attribute addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attribute.length)];
|
||||
[self.candyTreeView setAttributedText:attribute forKey:@"tgs_copywriting"];
|
||||
if (self.isMaxLargeGift) {
|
||||
self.backImageView.hidden = YES;
|
||||
self.candyTreeView.hidden = NO;
|
||||
@kWeakify(self);
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/candyTree_banner.svga", API_Image_URL];
|
||||
[self.parser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.candyTreeView.loops = 1;
|
||||
self.candyTreeView.clearsAfterStop = NO;
|
||||
self.candyTreeView.videoItem = videoItem;
|
||||
|
||||
[self.candyTreeView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
} else {
|
||||
self.backImageView.hidden = NO;
|
||||
self.candyTreeView.hidden = YES;
|
||||
self.titleLabel.attributedText = attribute;
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (XPSVGAPlayer *)candyTreeView {
|
||||
if (!_candyTreeView) {
|
||||
_candyTreeView = [[XPSVGAPlayer alloc]init];
|
||||
_candyTreeView.backgroundColor = [UIColor clearColor];
|
||||
_candyTreeView.userInteractionEnabled = NO;
|
||||
}
|
||||
return _candyTreeView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
|
||||
- (UIView *)titleView {
|
||||
if (!_titleView) {
|
||||
_titleView = [[UIView alloc] init];
|
||||
_titleView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
_backImageView.image = [UIImage imageNamed:@"room_candytree_large_gift_bg"];
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.numberOfLines = 2;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMRoomDatingAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class DatingInfoModel;
|
||||
@interface XPRoomDatingAnimationView : UIView
|
||||
- (void)startAnimationWithModel:(DatingInfoModel *)model finishBlock:(void (^)(BOOL))finishBlock;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,370 @@
|
||||
//
|
||||
// YMRoomDatingAnimationView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/5.
|
||||
//
|
||||
|
||||
#import "XPRoomDatingAnimationView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
///Model
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
///Model
|
||||
#import "DatingInfoModel.h"
|
||||
|
||||
@interface XPRoomDatingAnimationView ()
|
||||
///背景
|
||||
@property (nonatomic,strong) UIView *backView;
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///播放相亲结果的SVGA
|
||||
@property (nonatomic, strong) SVGAImageView *datingSvgaImageView;
|
||||
///倒计时的背景
|
||||
@property (nonatomic,strong) UIView *cutTimeBackView;
|
||||
///倒计时
|
||||
@property (nonatomic,strong) UILabel *timeLabel;
|
||||
///分割线
|
||||
@property (nonatomic,strong) UIView *lineView;
|
||||
///关闭的按钮
|
||||
@property (nonatomic,strong) UIButton *closeButton;
|
||||
///❤的动画
|
||||
@property (nonatomic,strong) UIImageView *heartImageView;
|
||||
///
|
||||
@property (nonatomic,copy) void(^FinishBlock)(BOOL result);
|
||||
/// 定时器
|
||||
@property (nonatomic,strong) id timer;
|
||||
@end
|
||||
|
||||
@implementation XPRoomDatingAnimationView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self addSubview:self.backView];
|
||||
[self addSubview:self.datingSvgaImageView];
|
||||
[self addSubview:self.cutTimeBackView];
|
||||
[self addSubview:self.heartImageView];
|
||||
[self.cutTimeBackView addSubview:self.timeLabel];
|
||||
[self.cutTimeBackView addSubview:self.lineView];
|
||||
[self.cutTimeBackView addSubview:self.closeButton];
|
||||
[self initContrations];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Resonse
|
||||
- (void)closetButtonAction:(UIButton *)sender {
|
||||
if (self.FinishBlock) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Pirvate Method
|
||||
- (void)initContrations {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
|
||||
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.datingSvgaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.cutTimeBackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(70, 25));
|
||||
make.right.mas_equalTo(self).offset(-12);
|
||||
make.top.mas_equalTo(self).offset(41 + kSafeAreaTopHeight);
|
||||
}];
|
||||
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.cutTimeBackView).offset(13);
|
||||
make.centerY.mas_equalTo(self.cutTimeBackView);
|
||||
}];
|
||||
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.cutTimeBackView);
|
||||
make.size.mas_equalTo(CGSizeMake(0.5, 13));
|
||||
}];
|
||||
|
||||
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(14, 14));
|
||||
make.centerY.mas_equalTo(self.cutTimeBackView);
|
||||
make.left.mas_equalTo(self.lineView.mas_right).offset(8);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)stopAnimation {
|
||||
if (self.FinishBlock) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImage *)setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size image:(UIImage *)image {
|
||||
//开启图形上下文
|
||||
UIGraphicsBeginImageContext(size);
|
||||
//绘制圆角矩形
|
||||
CGRect rect = CGRectMake(0, 0, size.width, size.height);
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)];
|
||||
//将Path添加到上下文中
|
||||
CGContextAddPath(UIGraphicsGetCurrentContext(), path.CGPath);
|
||||
//裁剪上下文
|
||||
CGContextClip(UIGraphicsGetCurrentContext());
|
||||
//将图片绘制到上下文中
|
||||
[image drawInRect:rect];
|
||||
//设置绘制模式
|
||||
CGContextDrawPath(UIGraphicsGetCurrentContext(), kCGPathStroke);
|
||||
//获取图片
|
||||
UIImage *output = UIGraphicsGetImageFromCurrentImageContext();
|
||||
//关闭上下文
|
||||
UIGraphicsEndImageContext();
|
||||
//返回裁剪好的图片
|
||||
return output;
|
||||
}
|
||||
|
||||
- (CAAnimationGroup *)createRoomDatingPickAnimatioOriginPoint:(CGPoint)orginPoint destinationPoint:(CGPoint)destinationPoint {
|
||||
///刚出来的时候 进行慢慢放大的效果
|
||||
CAKeyframeAnimation * scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
||||
scaleAnimation.duration = 0.5;
|
||||
scaleAnimation.repeatCount = 1;
|
||||
scaleAnimation.values = @[@(0),@(0.2),@(0.4), @(0.6), @(0.8), @(0.9), @(1)];
|
||||
scaleAnimation.calculationMode = kCAAnimationCubic;
|
||||
scaleAnimation.removedOnCompletion = NO;
|
||||
scaleAnimation.fillMode = kCAFillModeForwards;
|
||||
///
|
||||
CAKeyframeAnimation * transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
|
||||
transformAnimation.beginTime = 0.5;
|
||||
transformAnimation.duration = 1;
|
||||
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
transformAnimation.values = @[[NSValue valueWithCGPoint:orginPoint],[NSValue valueWithCGPoint:destinationPoint]];
|
||||
transformAnimation.repeatCount = 1;
|
||||
transformAnimation.removedOnCompletion = NO;
|
||||
transformAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
CAKeyframeAnimation * desScaleformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
||||
desScaleformAnimation.beginTime = 1.5;
|
||||
desScaleformAnimation.duration = 0.5;
|
||||
desScaleformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
desScaleformAnimation.values = @[@(1), @(1.2), @(1.4), @(1.6)];
|
||||
desScaleformAnimation.repeatCount = 1;
|
||||
desScaleformAnimation.removedOnCompletion = NO;
|
||||
desScaleformAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
|
||||
CAKeyframeAnimation * opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
||||
opacityAnimation.beginTime = 1.5;
|
||||
opacityAnimation.duration = 0.5;
|
||||
opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
opacityAnimation.values = @[@(1),@(0.8),@(0.6),@(0)];
|
||||
opacityAnimation.repeatCount = 1;
|
||||
opacityAnimation.removedOnCompletion = NO;
|
||||
opacityAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
|
||||
CAAnimationGroup * group = [CAAnimationGroup animation];
|
||||
group.animations = @[scaleAnimation, transformAnimation, desScaleformAnimation, opacityAnimation];
|
||||
group.duration = 2;
|
||||
group.removedOnCompletion = NO;
|
||||
group.fillMode = kCAFillModeForwards;
|
||||
return group;;
|
||||
}
|
||||
|
||||
- (void)startBeginCutCountWithTotalTime:(int)time {
|
||||
__block int totalTime = time;
|
||||
dispatch_source_t times = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
|
||||
_timer = times;
|
||||
dispatch_source_set_timer(times, DISPATCH_TIME_NOW, 1* NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
||||
dispatch_source_set_event_handler(times, ^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (totalTime <= 5 && totalTime >= 0) {
|
||||
///开始显示倒计时
|
||||
self.cutTimeBackView.hidden = NO;
|
||||
self.timeLabel.text = [NSString stringWithFormat:@"%ds", totalTime];
|
||||
}
|
||||
if (totalTime <= 0) {
|
||||
dispatch_source_cancel(times);
|
||||
self.cutTimeBackView.hidden = YES;
|
||||
}
|
||||
totalTime--;
|
||||
});
|
||||
});
|
||||
dispatch_resume(times);
|
||||
}
|
||||
|
||||
- (void)startPickHeartPersonAnimationOriginPoint:(CGPoint)originPoint targetPoint:(CGPoint)targetPoint {
|
||||
if (originPoint.x > 0 && targetPoint.x > 0) {
|
||||
self.heartImageView.frame = CGRectMake(0, 0, 55, 55);
|
||||
self.heartImageView.hidden = YES;
|
||||
self.backView.hidden = YES;
|
||||
self.heartImageView.hidden = NO;
|
||||
self.heartImageView.center = originPoint;
|
||||
CAAnimationGroup * group = [self createRoomDatingPickAnimatioOriginPoint:originPoint destinationPoint:targetPoint];
|
||||
[self.heartImageView.layer addAnimation:group forKey:nil];
|
||||
[self performSelector:@selector(aniationDidFinish:) withObject:self.heartImageView afterDelay:(2)];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)aniationDidFinish:(UIImageView *)giftImageView{
|
||||
[giftImageView.layer removeAllAnimations];
|
||||
giftImageView.hidden = YES;
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
|
||||
- (void)startAnimationWithModel:(DatingInfoModel *)model finishBlock:(void (^)(BOOL))finishBlock {
|
||||
self.FinishBlock = finishBlock;
|
||||
if (model.hasHeart) {
|
||||
if (model.svgaUrl) {
|
||||
[self startPalySVGAWithUrl:model];
|
||||
} else {
|
||||
///如果是心动选人的话 但是没有SVGA的话 直接结束
|
||||
///播完之后直接结束这次
|
||||
if (self.FinishBlock) {
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
///不是心动选人的话 那就不用播两次 爱心的动画
|
||||
[self startPickHeartPersonAnimationOriginPoint:model.originPoint targetPoint:model.targetPoint];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
///心动结束了 直接结束此次
|
||||
if (self.FinishBlock) {
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///播放SVGA的时候 需要先播放选人的动画
|
||||
- (void)startPalySVGAWithUrl:(DatingInfoModel *)model {
|
||||
if (model.svgaUrl) {
|
||||
self.backView.hidden = NO;
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.avatar] options:SDWebImageRetryFailed progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
if (image) {
|
||||
image = [self setCornerWithRadius:200 andSize:CGSizeMake(400, 400) image:image];
|
||||
[self.datingSvgaImageView setImage:image forKey:@"z_tx"];
|
||||
}
|
||||
}];
|
||||
|
||||
NSString * title = model.nickname ? model.nickname : @"";
|
||||
if (title.length >= 5) {
|
||||
title = [NSString stringWithFormat:@"%@…", [title substringToIndex:5]];
|
||||
}
|
||||
NSMutableAttributedString * rightAttribut = [[NSMutableAttributedString alloc] initWithString:title];
|
||||
[rightAttribut addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:28], NSForegroundColorAttributeName:[UIColor whiteColor]} range:NSMakeRange(0, title.length)];
|
||||
[self.datingSvgaImageView setAttributedText:rightAttribut forKey:@"z_yhname"];
|
||||
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.targetAvatar] options:SDWebImageRetryFailed progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
if (image) {
|
||||
image = [self setCornerWithRadius:200 andSize:CGSizeMake(400, 400) image:image];
|
||||
[self.datingSvgaImageView setImage:image forKey:@"y_tx"];
|
||||
}
|
||||
}];
|
||||
NSString * leftTitle = model.targetNickname ? model.targetNickname : @"";
|
||||
if (leftTitle.length >= 5) {
|
||||
leftTitle = [NSString stringWithFormat:@"%@…", [leftTitle substringToIndex:5]];
|
||||
}
|
||||
NSMutableAttributedString * leftAttribut = [[NSMutableAttributedString alloc] initWithString:leftTitle];
|
||||
[leftAttribut addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:28], NSForegroundColorAttributeName:[UIColor whiteColor]} range:NSMakeRange(0, leftTitle.length)];
|
||||
[self.datingSvgaImageView setAttributedText:leftAttribut forKey:@"y_yhname"];
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:model.svgaUrl] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.datingSvgaImageView.hidden = NO;
|
||||
self.datingSvgaImageView.videoItem = videoItem;
|
||||
self.datingSvgaImageView.loops = 1;
|
||||
self.datingSvgaImageView.alpha = 1;
|
||||
self.datingSvgaImageView.clearsAfterStop = YES;
|
||||
[ self.datingSvgaImageView startAnimation];
|
||||
[self startBeginCutCountWithTotalTime:model.svgaSecond];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
[self performSelector:@selector(stopAnimation) withObject:nil afterDelay:model.svgaSecond];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)heartImageView {
|
||||
if (!_heartImageView) {
|
||||
_heartImageView = [[UIImageView alloc] init];
|
||||
_heartImageView.image = [UIImage imageNamed:@"room_mode_dating_pick_heart"];
|
||||
_heartImageView.hidden = YES;
|
||||
}
|
||||
return _heartImageView;
|
||||
}
|
||||
|
||||
- (UIView *)backView {
|
||||
if (!_backView) {
|
||||
_backView = [[UIView alloc] init];
|
||||
_backView.backgroundColor = UIColorRGBAlpha(0x000000, 0.3);
|
||||
_backView.hidden = YES;
|
||||
}
|
||||
return _backView;
|
||||
}
|
||||
|
||||
- (UILabel *)timeLabel {
|
||||
if (!_timeLabel) {
|
||||
_timeLabel = [[UILabel alloc] init];
|
||||
_timeLabel.text = @"5S";
|
||||
_timeLabel.font = [UIFont systemFontOfSize:15];
|
||||
_timeLabel.textColor = UIColorFromRGB(0xFFFEFE);
|
||||
}
|
||||
return _timeLabel;
|
||||
}
|
||||
|
||||
- (UIView *)cutTimeBackView {
|
||||
if (!_cutTimeBackView) {
|
||||
_cutTimeBackView = [[UIView alloc] init];
|
||||
_cutTimeBackView.backgroundColor = UIColorRGBAlpha(0x000000, 0.3);
|
||||
_cutTimeBackView.layer.masksToBounds = YES;
|
||||
_cutTimeBackView.layer.cornerRadius = 25/2;
|
||||
_cutTimeBackView.hidden = YES;
|
||||
}
|
||||
return _cutTimeBackView;
|
||||
}
|
||||
|
||||
- (UIButton *)closeButton {
|
||||
if (!_closeButton) {
|
||||
_closeButton = [UIButton buttonWithType: UIButtonTypeCustom];
|
||||
[_closeButton setImage:[UIImage imageNamed:@"common_close_white"] forState:UIControlStateNormal];
|
||||
[_closeButton addTarget:self action:@selector(closetButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_closeButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
}
|
||||
return _closeButton;
|
||||
}
|
||||
|
||||
- (UIView *)lineView {
|
||||
if (!_lineView) {
|
||||
_lineView = [[UIView alloc] init];
|
||||
_lineView.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)datingSvgaImageView {
|
||||
if (!_datingSvgaImageView) {
|
||||
_datingSvgaImageView = [[SVGAImageView alloc]init];
|
||||
_datingSvgaImageView.backgroundColor = [UIColor clearColor];
|
||||
_datingSvgaImageView.frame = self.bounds;
|
||||
_datingSvgaImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _datingSvgaImageView;
|
||||
}
|
||||
|
||||
@end
|
@@ -9,7 +9,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberImportHideTipRegard : UIView
|
||||
@interface XPRoomEnterHideTipView : UIView
|
||||
|
||||
@end
|
||||
|
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// YMRoomEnterHideTipView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/4/26.
|
||||
//
|
||||
|
||||
#import "XPRoomEnterHideTipView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
@interface XPRoomEnterHideTipView()
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIView *bgView;
|
||||
///icon
|
||||
@property (nonatomic,strong) UIImageView *iconImageView;
|
||||
///描述
|
||||
@property (nonatomic, strong) UILabel *descLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomEnterHideTipView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.iconImageView];
|
||||
[self.bgView addSubview:self.descLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(190);
|
||||
make.height.mas_equalTo(48);
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.bgView).mas_offset(12);
|
||||
make.centerY.mas_equalTo(self.bgView);
|
||||
make.width.height.mas_equalTo(32);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.iconImageView.mas_right).mas_offset(8);
|
||||
make.centerY.mas_equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = UIColorRGBAlpha(0x000000, 0.5);
|
||||
_bgView.layer.cornerRadius = 24;
|
||||
_bgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
_iconImageView = [[UIImageView alloc] init];
|
||||
_iconImageView.image = [UIImage imageNamed:@"room_enterRoom_hide"];
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)descLabel {
|
||||
if (!_descLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:14];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = @"你已隐身进入房间~";
|
||||
_descLabel = label;
|
||||
}
|
||||
return _descLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -9,7 +9,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberPresentBrightnessAnatomiser : NSObject
|
||||
@interface XPRoomGiftAnimationParser : NSObject
|
||||
|
||||
- (void)parseWithURL:(nonnull NSString *)URL
|
||||
completionBlock:(void ( ^ _Nonnull )(NSString * _Nullable videoUrl))completionBlock
|
@@ -5,14 +5,14 @@
|
||||
// Created by YUMI on 2022/3/17.
|
||||
//
|
||||
|
||||
#import "YUMIChamberPresentBrightnessAnatomiser.h"
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
#import <zlib.h>
|
||||
#import <SSZipArchive/SSZipArchive.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <AFNetworking.h>
|
||||
#import "GCDHelper.h"
|
||||
|
||||
@implementation YUMIChamberPresentBrightnessAnatomiser
|
||||
@implementation XPRoomGiftAnimationParser
|
||||
|
||||
static NSOperationQueue *parseQueue;
|
||||
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class GiftReceiveInfoModel, XPGiftBannerUserInfoModel;
|
||||
@interface XPRoomGiftBannerView : UIView
|
||||
///配上飘屏的数据
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray<XPGiftBannerUserInfoModel *> *)users;
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo;
|
||||
///重置数据
|
||||
- (void)resetData;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
369
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m
Normal file
369
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m
Normal file
@@ -0,0 +1,369 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "XPRoomGiftBannerView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
///Model
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
#import "GiftInfoModel.h"
|
||||
#import "XPGiftBannerUserInfoModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XPRoomAvatarNickView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) NetImageView *avatImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomAvatarNickView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
self.avatImageView.layer.cornerRadius = self.avatImageView.bounds.size.width / 2;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.avatImageView];
|
||||
[self addSubview:self.nickLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.nickLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.avatImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(self.avatImageView.mas_width);
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.avatImageView.mas_bottom).offset(2);
|
||||
make.width.mas_lessThanOrEqualTo(80);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (NetImageView *)avatImageView {
|
||||
if (!_avatImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_avatImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatImageView.userInteractionEnabled = YES;
|
||||
_avatImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _avatImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nickLabel {
|
||||
if (!_nickLabel) {
|
||||
_nickLabel = [[UILabel alloc] init];
|
||||
_nickLabel.font = [UIFont systemFontOfSize:12];
|
||||
_nickLabel.textColor = [UIColor whiteColor];
|
||||
_nickLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _nickLabel;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface XPRoomGiftBannerView ()
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///赠送
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *sendView;
|
||||
///接收者
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *receiveView;
|
||||
///礼物
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *giftView;
|
||||
///光圈
|
||||
@property (nonatomic,strong) UIImageView *lightImageView;
|
||||
///礼物的个数
|
||||
@property (nonatomic,strong) UILabel *giftCountLabel;
|
||||
///赠送
|
||||
@property (nonatomic,strong) UILabel *sendLabel;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPRoomGiftBannerView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
|
||||
[self.backImageView addSubview:self.sendView];
|
||||
[self.backImageView addSubview:self.sendLabel];
|
||||
[self.backImageView addSubview:self.receiveView];
|
||||
[self.backImageView addSubview:self.lightImageView];
|
||||
[self.backImageView addSubview:self.giftView];
|
||||
[self.backImageView addSubview:self.giftCountLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.sendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.backImageView).offset(49);
|
||||
make.top.equalTo(self).offset(49);
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
[self.sendLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.sendView.mas_right).offset(24);
|
||||
make.centerY.equalTo(self.sendView);
|
||||
}];
|
||||
|
||||
[self.receiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.sendLabel.mas_right).offset(24);
|
||||
make.centerY.width.equalTo(self.sendView);
|
||||
}];
|
||||
|
||||
[self.lightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.receiveView.mas_right).offset(4);
|
||||
make.centerY.equalTo(self.sendView);
|
||||
make.width.height.equalTo(@100);
|
||||
}];
|
||||
|
||||
[self.giftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.equalTo(self.sendView);
|
||||
make.center.equalTo(self.lightImageView);
|
||||
}];
|
||||
|
||||
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.giftView);
|
||||
make.right.equalTo(self.backImageView).offset(-36);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)startLightCircleAnimation {
|
||||
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
||||
animation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
|
||||
animation.duration = 1;
|
||||
animation.cumulative = YES;
|
||||
animation.repeatCount = MAXFLOAT;
|
||||
[self.lightImageView.layer addAnimation:animation forKey:@"rotationAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)resetData {
|
||||
self.sendView.avatImageView.image = nil;
|
||||
self.sendView.nickLabel.text = nil;
|
||||
self.receiveView.avatImageView.image = nil;
|
||||
self.receiveView.nickLabel.text = nil;
|
||||
self.giftView.avatImageView.image = nil;
|
||||
self.giftView.nickLabel.text = nil;
|
||||
self.giftCountLabel.text = nil;
|
||||
[self.lightImageView stopAnimating];
|
||||
}
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo{
|
||||
if (receiveInfo) {
|
||||
[self startLightCircleAnimation];
|
||||
NSInteger giftTotal = receiveInfo.giftGolds;
|
||||
GiftInfoModel *giftInfo = receiveInfo.gift;
|
||||
self.sendView.avatImageView.imageUrl = receiveInfo.sendUserAvatar;
|
||||
self.sendView.nickLabel.text = receiveInfo.sendUserNick;
|
||||
self.receiveView.nickLabel.text = receiveInfo.recvUserNick;
|
||||
self.receiveView.avatImageView.imageUrl = receiveInfo.recvUserAvatar;
|
||||
self.giftView.avatImageView.imageUrl = giftInfo.giftUrl;
|
||||
self.giftView.nickLabel.text = giftInfo.giftName;
|
||||
|
||||
self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum];
|
||||
|
||||
[self configAnimateImageByGiftTotal:giftTotal];
|
||||
}
|
||||
}
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray<XPGiftBannerUserInfoModel *> *)users {
|
||||
if (receiveInfo) {
|
||||
[self startLightCircleAnimation];
|
||||
NSInteger giftTotal = 0;
|
||||
GiftInfoModel *giftInfo = receiveInfo.gift;
|
||||
self.sendView.avatImageView.imageUrl = receiveInfo.avatar;
|
||||
self.sendView.nickLabel.text = receiveInfo.nick;
|
||||
|
||||
self.giftView.avatImageView.imageUrl = giftInfo.giftUrl;
|
||||
self.giftView.nickLabel.text = giftInfo.giftName;
|
||||
|
||||
self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum];
|
||||
/*1. 普通单人 targetUid
|
||||
2. 普通多人 targetUsers
|
||||
3. 普通全麦 targetUids
|
||||
4. 福袋 targetUid 不懂请参考此协议*/
|
||||
if (receiveInfo.targetUsers.count > 0) {
|
||||
if (receiveInfo.isBatch) { // 非全麦 多人送礼
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUsers;
|
||||
for (GiftReceiveUserInfoModel *targetUid in targetUids) {
|
||||
NSInteger position = [self findPositionByUid:targetUid.uid users:users];
|
||||
if (position == 0) {
|
||||
continue; // 收礼人已经下麦了, 则不展示
|
||||
}
|
||||
position += 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView0"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView1"), position];
|
||||
}
|
||||
}
|
||||
if (receiveInfo.targetUsers.count == 1) {
|
||||
self.receiveView.nickLabel.text = [receiveInfo.targetUsers firstObject].nick;
|
||||
self.receiveView.avatImageView.imageUrl = [receiveInfo.targetUsers firstObject].avatar;
|
||||
} else {
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = subTitle;
|
||||
}
|
||||
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
} else { // 全麦
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView2");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
}
|
||||
}else if (receiveInfo.targetUids.count > 0) {///根据协议 普通情况
|
||||
if (receiveInfo.isBatch) {
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUids;
|
||||
for (NSString * targetUid in targetUids) {
|
||||
NSInteger position = [self findPositionByUid:targetUid.integerValue users:users];
|
||||
if (position == 0) {
|
||||
continue; // 收礼人已经下麦了, 则不展示
|
||||
}
|
||||
position+= 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView3"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView4"), position];
|
||||
}
|
||||
}
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = subTitle;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
} else { // 全麦
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView5");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
}
|
||||
}else {
|
||||
self.receiveView.avatImageView.imageUrl = receiveInfo.targetAvatar;
|
||||
self.receiveView.nickLabel.text = receiveInfo.targetNick;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice;
|
||||
}
|
||||
[self configAnimateImageByGiftTotal:giftTotal];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configAnimateImageByGiftTotal:(NSInteger)giftTotal {
|
||||
if (giftTotal >= 520 && giftTotal < 4999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_low_bg"];
|
||||
}else if (giftTotal >= 4999 && giftTotal < 9999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_middle_bg"];
|
||||
}else if (giftTotal >= 9999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_high_bg"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (int)findPositionByUid:(NSInteger)uid users:(NSArray<XPGiftBannerUserInfoModel *> *)users{
|
||||
if (uid > 0) {
|
||||
for (XPGiftBannerUserInfoModel *userInfo in users) {
|
||||
if (userInfo.uid == uid) {
|
||||
return userInfo.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)sendView {
|
||||
if (!_sendView) {
|
||||
_sendView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _sendView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)receiveView {
|
||||
if (!_receiveView) {
|
||||
_receiveView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _receiveView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)giftView {
|
||||
if (!_giftView) {
|
||||
_giftView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _giftView;
|
||||
}
|
||||
|
||||
- (UILabel *)sendLabel {
|
||||
if (!_sendLabel) {
|
||||
_sendLabel = [[UILabel alloc] init];
|
||||
_sendLabel.text = YMLocalizedString(@"XPRoomGiftBannerView6");
|
||||
_sendLabel.font = [UIFont systemFontOfSize:12];
|
||||
_sendLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _sendLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)lightImageView {
|
||||
if (!_lightImageView) {
|
||||
_lightImageView = [[UIImageView alloc] init];
|
||||
_lightImageView.userInteractionEnabled = YES;
|
||||
_lightImageView.image = [UIImage imageNamed:@"room_gift_banner_light"];
|
||||
}
|
||||
return _lightImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)giftCountLabel {
|
||||
if (!_giftCountLabel) {
|
||||
_giftCountLabel = [[UILabel alloc] init];
|
||||
_giftCountLabel.font = [UIFont systemFontOfSize:20.f weight:UIFontWeightBold];
|
||||
_giftCountLabel.textColor = [DJDKMIMOMColor animationGiftNumberColor];
|
||||
}
|
||||
return _giftCountLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// YMRoomGiftBroadcastView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
// 广播横幅
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPRoomGiftBroadcastView;
|
||||
|
||||
@protocol XPRoomGiftBroadcastViewDelegate <NSObject>
|
||||
/// 点击了关闭
|
||||
- (void)xPRoomGiftBroadcastView:(XPRoomGiftBroadcastView *)view didClickClose:(GiftReceiveInfoModel *)broadcastModel;
|
||||
///点击了进入房间
|
||||
- (void)xPRoomGiftBroadcastView:(XPRoomGiftBroadcastView *)view enterRoom:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPRoomGiftBroadcastView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) GiftReceiveInfoModel *broadcastModel;
|
||||
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPRoomGiftBroadcastViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
423
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m
Normal file
423
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m
Normal file
@@ -0,0 +1,423 @@
|
||||
//
|
||||
// XPRoomGiftBroadcastView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "XPRoomGiftBroadcastView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
|
||||
///Model
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
|
||||
#define kScreenScale (CGFloat)KScreenWidth / (CGFloat)375
|
||||
|
||||
@interface XPRoomGiftUserView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic,strong) NetImageView *avatarImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *boraderImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *nickButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomGiftUserView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.avatarImageView];
|
||||
[self addSubview:self.boraderImageView];
|
||||
[self addSubview:self.nickButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.nickButton.mas_bottom);
|
||||
}];
|
||||
|
||||
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.top.mas_equalTo(self);
|
||||
make.height.width.mas_equalTo(44 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.boraderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(51 * kScreenScale, 51 * kScreenScale));
|
||||
make.center.mas_equalTo(self.avatarImageView);
|
||||
}];
|
||||
|
||||
[self.nickButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(-8 * kScreenScale);
|
||||
make.size.mas_equalTo(CGSizeMake(66 * kScreenScale, 16 * kScreenScale));
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (NetImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImageView.userInteractionEnabled = YES;
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 44 * kScreenScale/2;
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)boraderImageView {
|
||||
if (!_boraderImageView) {
|
||||
_boraderImageView = [[UIImageView alloc] init];
|
||||
_boraderImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _boraderImageView;
|
||||
}
|
||||
|
||||
- (UIButton *)nickButton {
|
||||
if (!_nickButton) {
|
||||
_nickButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_nickButton setTitleColor:[DJDKMIMOMColor giftBroadcastNickColor] forState:UIControlStateNormal];
|
||||
_nickButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
[_nickButton setBackgroundImage:[UIImage imageNamed:@"room_gift_broadcast_avatar_board"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _nickButton;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XPRoomGiftBroadcastView ()
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///赠送者
|
||||
@property (nonatomic,strong) XPRoomGiftUserView *sendView;
|
||||
///赠送
|
||||
@property (nonatomic,strong) UIImageView *sendImageView;
|
||||
///接收者
|
||||
@property (nonatomic,strong) XPRoomGiftUserView *receiveView;
|
||||
///礼物
|
||||
@property (nonatomic,strong) NetImageView *giftImageView;
|
||||
///数量
|
||||
@property (nonatomic,strong) UILabel *countLabel;
|
||||
///关闭
|
||||
@property (nonatomic,strong) UIButton *closeButton;
|
||||
///房间iD
|
||||
@property (nonatomic,strong) UILabel *roomIdLabel;
|
||||
///房间背景
|
||||
@property (nonatomic,strong) UIImageView *roomIdBgView;
|
||||
@end
|
||||
|
||||
@implementation XPRoomGiftBroadcastView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initEvents];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Response
|
||||
- (void)closeButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomGiftBroadcastView:didClickClose:)]) {
|
||||
[self.delegate xPRoomGiftBroadcastView:self didClickClose:self.broadcastModel];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didClickEnterRoom {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomGiftBroadcastView:enterRoom:)]) {
|
||||
[self.delegate xPRoomGiftBroadcastView:self enterRoom:[NSString stringWithFormat:@"%ld", self.broadcastModel.roomUid]];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
|
||||
[self.backImageView addSubview:self.closeButton];
|
||||
[self.backImageView addSubview:self.sendView];
|
||||
[self.backImageView addSubview:self.sendImageView];
|
||||
[self.backImageView addSubview:self.receiveView];
|
||||
[self.backImageView addSubview:self.giftImageView];
|
||||
[self.backImageView addSubview:self.countLabel];
|
||||
[self.backImageView addSubview:self.roomIdBgView];
|
||||
[self.roomIdBgView addSubview:self.roomIdLabel];
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
|
||||
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.mas_equalTo(self).inset(15);
|
||||
make.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(125 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.sendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-27 * kScreenScale);
|
||||
make.width.mas_equalTo(66 * kScreenScale);
|
||||
make.leading.mas_equalTo(self.backImageView).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.sendImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(30 * kScreenScale, 15 * kScreenScale));
|
||||
make.centerY.mas_equalTo(self.sendView);
|
||||
make.leading.mas_equalTo(self.sendView.mas_trailing).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.receiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.width.mas_equalTo(self.sendView);
|
||||
make.leading.mas_equalTo(self.sendImageView.mas_trailing).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60 * kScreenScale, 60 * kScreenScale));
|
||||
make.centerY.mas_equalTo(self.sendView);
|
||||
make.leading.mas_equalTo(self.receiveView.mas_trailing).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(13 * kScreenScale);
|
||||
make.centerY.mas_equalTo(self.sendView);
|
||||
}];
|
||||
|
||||
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(self.backImageView).offset(-3);
|
||||
make.top.mas_equalTo(13);
|
||||
make.size.mas_equalTo(CGSizeMake(28, 22));
|
||||
}];
|
||||
[self.roomIdBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
make.top.mas_equalTo(self.backImageView).offset(kGetScaleWidth(8.5));
|
||||
make.width.mas_equalTo(kGetScaleWidth(88.5));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
|
||||
[self.roomIdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.roomIdBgView);
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)initEvents {
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickEnterRoom)];
|
||||
[self.backImageView addGestureRecognizer:tap];
|
||||
}
|
||||
|
||||
- (void)updateSubviews:(BroadCastLevel)level {
|
||||
UIColor * nickColor;
|
||||
NSString * nickBackImageName;
|
||||
NSString * bgImageName;
|
||||
NSString *closeImageName;
|
||||
NSString *boraderImageName;
|
||||
|
||||
|
||||
switch (level) {
|
||||
case BroadCastLevel_Normal:
|
||||
{
|
||||
CGFloat kscale = (CGFloat)124/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];
|
||||
|
||||
[self.closeButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(14 * kScreenScale);
|
||||
}];
|
||||
[self.sendView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-30 * kScreenScale);
|
||||
}];
|
||||
nickColor = UIColorFromRGB(0x2F0060);
|
||||
nickBackImageName = @"room_gift_broadcast_low_normal_nick_bg";
|
||||
bgImageName = @"room_gift_broadcast_low_bg";
|
||||
closeImageName = @"room_gift_broadcast_low_close";
|
||||
boraderImageName = @"room_gift_broadcast_low_avatar_board";
|
||||
self.roomIdBgView.hidden = YES;
|
||||
}
|
||||
break;
|
||||
case BroadCastLevel_Middle:
|
||||
{
|
||||
CGFloat kscale = (CGFloat)120/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];;
|
||||
|
||||
[self.closeButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(11 * kScreenScale);
|
||||
}];
|
||||
[self.sendView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-30 * kScreenScale);
|
||||
}];
|
||||
nickColor = [UIColor whiteColor];
|
||||
nickBackImageName = @"room_gift_broadcast_middle_normal_nick_bg";
|
||||
bgImageName = @"room_gift_broadcast_middle_bg";
|
||||
closeImageName = @"room_gift_broadcast_middle_close";
|
||||
boraderImageName = @"room_gift_broadcast_middle_avatar_board";
|
||||
self.roomIdBgView.hidden = YES;
|
||||
}
|
||||
break;
|
||||
case BroadCastLevel_High:
|
||||
{
|
||||
|
||||
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(143 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.closeButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(38 * kScreenScale);
|
||||
}];
|
||||
[self.sendView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-26 * kScreenScale);
|
||||
}];
|
||||
nickColor = [UIColor whiteColor];
|
||||
nickBackImageName = @"room_gift_broadcast_high_normal_nick_bg";
|
||||
bgImageName = @"room_gift_broadcast_high_bg";
|
||||
closeImageName = @"room_gift_broadcast_high_close";
|
||||
boraderImageName = @"room_gift_broadcast_high_avatar_boardd";
|
||||
self.roomIdBgView.hidden = NO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (nickBackImageName.length > 0) {
|
||||
[self.sendView.nickButton setBackgroundImage:[UIImage imageNamed:nickBackImageName] forState:UIControlStateNormal];
|
||||
[self.receiveView.nickButton setBackgroundImage:[UIImage imageNamed:nickBackImageName] forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
if(boraderImageName.length > 0){
|
||||
self.sendView.boraderImageView.image = kImage(boraderImageName);
|
||||
self.receiveView.boraderImageView.image = kImage(boraderImageName);
|
||||
}
|
||||
if (nickColor) {
|
||||
[self.sendView.nickButton setTitleColor:nickColor forState:UIControlStateNormal];
|
||||
[self.receiveView.nickButton setTitleColor:nickColor forState:UIControlStateNormal];
|
||||
}
|
||||
[self.closeButton setBackgroundImage:kImage(closeImageName) forState:UIControlStateNormal];
|
||||
self.backImageView.image = [UIImage imageNamed:bgImageName];
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setBroadcastModel:(GiftReceiveInfoModel *)broadcastModel {
|
||||
_broadcastModel = broadcastModel;
|
||||
if (_broadcastModel) {
|
||||
if (broadcastModel.sendUserNick.length > 6) {
|
||||
broadcastModel.sendUserNick = [broadcastModel.sendUserNick substringToIndex:6];
|
||||
}
|
||||
self.sendView.avatarImageView.imageUrl = broadcastModel.sendUserAvatar;
|
||||
[self.sendView.nickButton setTitle:broadcastModel.sendUserNick forState:UIControlStateNormal];
|
||||
|
||||
if (broadcastModel.recvUserNick.length > 6) {
|
||||
broadcastModel.recvUserNick = [broadcastModel.recvUserNick substringToIndex:6];
|
||||
}
|
||||
self.receiveView.avatarImageView.imageUrl = broadcastModel.recvUserAvatar;
|
||||
[self.receiveView.nickButton setTitle:broadcastModel.recvUserNick forState:UIControlStateNormal];
|
||||
|
||||
self.giftImageView.imageUrl = broadcastModel.giftUrl;
|
||||
self.countLabel.text = [NSString stringWithFormat:@"x%ld", broadcastModel.giftNum];
|
||||
self.roomIdLabel.text = [NSString stringWithFormat:@"ID:%@", broadcastModel.roomErbanNo];
|
||||
[self updateSubviews:broadcastModel.levelNum];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (XPRoomGiftUserView *)sendView {
|
||||
if (!_sendView) {
|
||||
_sendView = [[XPRoomGiftUserView alloc] init];
|
||||
}
|
||||
return _sendView;
|
||||
}
|
||||
|
||||
- (UIImageView *)sendImageView {
|
||||
if (!_sendImageView) {
|
||||
_sendImageView = [[UIImageView alloc] init];
|
||||
_sendImageView.userInteractionEnabled = YES;
|
||||
_sendImageView.image = [UIImage imageNamed:@"room_gift_broadcast_send"];
|
||||
}
|
||||
return _sendImageView;
|
||||
}
|
||||
|
||||
- (XPRoomGiftUserView *)receiveView {
|
||||
if (!_receiveView) {
|
||||
_receiveView = [[XPRoomGiftUserView alloc] init];
|
||||
}
|
||||
return _receiveView;
|
||||
}
|
||||
- (NetImageView *)giftImageView {
|
||||
if (!_giftImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_giftImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
}
|
||||
return _giftImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
_countLabel = [[UILabel alloc] init];
|
||||
_countLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightBold];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFFDC6A),UIColorFromRGB(0xFFFFFF),UIColorFromRGB(0xFFFFFF)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
|
||||
_countLabel.textColor = [UIColor colorWithPatternImage:image];
|
||||
}
|
||||
return _countLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)closeButton {
|
||||
if (!_closeButton) {
|
||||
_closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_closeButton addTarget:self action:@selector(closeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _closeButton;
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)roomIdLabel {
|
||||
if (!_roomIdLabel) {
|
||||
_roomIdLabel = [[UILabel alloc] init];
|
||||
_roomIdLabel.font = [UIFont systemFontOfSize:12];
|
||||
_roomIdLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _roomIdLabel;
|
||||
}
|
||||
-(UIImageView *)roomIdBgView{
|
||||
if (!_roomIdBgView){
|
||||
_roomIdBgView = [UIImageView new];
|
||||
_roomIdBgView.image = kImage(@"room_gift_broadcast_high_normal_id_nick_bg");
|
||||
}
|
||||
return _roomIdBgView;
|
||||
}
|
||||
|
||||
@end
|
@@ -9,9 +9,10 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberPresentCompoundRegard : UIView
|
||||
@interface XPRoomGiftCompoundView : UIView
|
||||
|
||||
@property (nonatomic,copy) NSDictionary * compoundPresentAbstract;
|
||||
///礼物合成的信息
|
||||
@property (nonatomic,copy) NSDictionary * compoundGiftInfo;
|
||||
|
||||
@end
|
||||
|
113
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftCompoundView.m
Normal file
113
YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftCompoundView.m
Normal file
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// YMRoomGiftCompoundView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/8/5.
|
||||
//
|
||||
|
||||
#import "XPRoomGiftCompoundView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "XPGiftCompoundModel.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
@interface XPRoomGiftCompoundView ()
|
||||
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///礼物合成特效
|
||||
@property (nonatomic,strong) SVGAImageView *compoundGiftView;
|
||||
///显示文本内容
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomGiftCompoundView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.compoundGiftView];
|
||||
[self addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.compoundGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.compoundGiftView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setCompoundGiftInfo:(NSDictionary *)compoundGiftInfo {
|
||||
if (compoundGiftInfo) {
|
||||
XPGiftCompoundModel * giftInfo = [XPGiftCompoundModel modelWithDictionary:compoundGiftInfo];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
CGFloat fontSize = 22;
|
||||
NSString *nickStr = giftInfo.nick;
|
||||
if (nickStr.length > 6) {
|
||||
nickStr = [NSString stringWithFormat:@"%@…", [giftInfo.nick substringToIndex:6]];
|
||||
}
|
||||
[attribute appendAttributedString:[self createAttribute:YMLocalizedString(@"XPRoomGiftCompoundView0") color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:nickStr color:[DJDKMIMOMColor messageNickColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:giftInfo.msg color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:giftInfo.giftName color:[DJDKMIMOMColor messageNickColor] fontSize:fontSize]];
|
||||
|
||||
@kWeakify(self);
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/compound_gift_banner.svga", API_Image_URL];
|
||||
[self.parser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.compoundGiftView.loops = 1;
|
||||
self.compoundGiftView.clearsAfterStop = NO;
|
||||
self.compoundGiftView.videoItem = videoItem;
|
||||
[self.compoundGiftView setAttributedText:attribute forKey:@"noble_text_tx"];
|
||||
[self.compoundGiftView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (SVGAImageView *)compoundGiftView {
|
||||
if (!_compoundGiftView) {
|
||||
_compoundGiftView = [[SVGAImageView alloc]init];
|
||||
_compoundGiftView.backgroundColor = [UIColor clearColor];
|
||||
_compoundGiftView.userInteractionEnabled = NO;
|
||||
}
|
||||
return _compoundGiftView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// YMRoomGraffitiGiftAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/8/23.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPRoomGraffitiGiftAnimationView, AttachmentModel;
|
||||
@protocol XPRoomGraffitiGiftAnimationViewDelegate <NSObject>
|
||||
|
||||
///动画完成
|
||||
- (void)xPRoomGraffitiGiftAnimationViewCompletion:(XPRoomGraffitiGiftAnimationView *)view attachment:(AttachmentModel *)attachment;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPRoomGraffitiGiftAnimationView : UIView
|
||||
@property (nonatomic,strong) UIImage *giftImage;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPRoomGraffitiGiftAnimationViewDelegate> delegate;
|
||||
@property (nonatomic,strong) NSArray *pointArray;
|
||||
@property (nonatomic,strong) AttachmentModel *model;
|
||||
///开始涂鸦动画
|
||||
- (void)beginDrawAnimation;
|
||||
///结束涂鸦动画
|
||||
- (void)endDrawAnimation;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -5,34 +5,35 @@
|
||||
// Created by YUMI on 2022/8/23.
|
||||
//
|
||||
|
||||
#import "YUMIChamberGraffitiPresentBrightnessRegard.h"
|
||||
#import "YUMIWeakIntratemporalr.h"
|
||||
#import "XPRoomGraffitiGiftAnimationView.h"
|
||||
#import "XPWeakTimer.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "NSArray+Safe.h"
|
||||
|
||||
@interface YUMIChamberGraffitiPresentBrightnessRegard ()
|
||||
@interface XPRoomGraffitiGiftAnimationView ()
|
||||
@property (nonatomic,strong) NSTimer *timer;
|
||||
@property (nonatomic,assign) int index;
|
||||
///数据
|
||||
@property (nonatomic,strong) NSMutableArray *datasource;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberGraffitiPresentBrightnessRegard
|
||||
@implementation XPRoomGraffitiGiftAnimationView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.userInteractionEnabled = NO;
|
||||
self.timer = [YUMIWeakIntratemporalr scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(dramDoodleBrectifynessRegard) userInfo:@"" repeats:YES];
|
||||
self.timer = [XPWeakTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(dramGraffitiAnimationView) userInfo:@"" repeats:YES];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)institutePaletteBrectifyness {
|
||||
- (void)beginDrawAnimation {
|
||||
self.index = 0;
|
||||
for (int i = 0; i < self.speckGarment.count; i++) {
|
||||
NSArray * speckGarment = self.speckGarment[i];
|
||||
NSNumber * first = [speckGarment firstObject];
|
||||
NSNumber * second = [speckGarment lastObject];
|
||||
for (int i = 0; i < self.pointArray.count; i++) {
|
||||
NSArray * pointArray = self.pointArray[i];
|
||||
NSNumber * first = [pointArray firstObject];
|
||||
NSNumber * second = [pointArray lastObject];
|
||||
CGFloat x = first.floatValue / 1000.0 * KScreenWidth;
|
||||
CGFloat y = second.floatValue / 1000.0 * KScreenHeight;
|
||||
if (x <= 0 || x >= KScreenWidth || y <= 0 || y >= KScreenHeight) {
|
||||
@@ -44,32 +45,32 @@
|
||||
self.timer.fireDate = NSDate.distantPast;
|
||||
}
|
||||
|
||||
- (void)concludePaletteBrectifyness {
|
||||
- (void)endDrawAnimation {
|
||||
self.timer.fireDate = NSDate.distantFuture;
|
||||
[self.datasource removeAllObjects];
|
||||
self.index = 0;
|
||||
}
|
||||
|
||||
|
||||
- (void)dramDoodleBrectifynessRegard {
|
||||
- (void)dramGraffitiAnimationView {
|
||||
if (self.index >= (self.datasource.count -1)) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
self.timer.fireDate = NSDate.distantFuture;
|
||||
[self.datasource removeAllObjects];
|
||||
self.index = 0;
|
||||
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberDoodlePresentBrectifynessRegardImplementtowardsion:attachment:)]) {
|
||||
[self.delegate yUMIChamberDoodlePresentBrectifynessRegardImplementtowardsion:self attachment:self.model];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomGraffitiGiftAnimationViewCompletion:attachment:)]) {
|
||||
[self.delegate xPRoomGraffitiGiftAnimationViewCompletion:self attachment:self.model];
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
NSValue * valeu= [self.datasource secureGroalTowardsIndictowardsrix1:self.index];
|
||||
NSValue * valeu= [self.datasource safeObjectAtIndex1:self.index];
|
||||
CGPoint point = valeu.CGPointValue;
|
||||
UIImageView * imageView = [[UIImageView alloc] init];
|
||||
imageView.layer.masksToBounds = YES;
|
||||
imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
imageView.image = self.presentIndicate;
|
||||
imageView.image = self.giftImage;
|
||||
imageView.frame = CGRectMake(point.x, point.y, 20, 20);
|
||||
[self addSubview:imageView];
|
||||
self.index++;
|
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// YMRoomLicneseHourRankView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/13.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomHalfHourRankModel, XPRoomLicneseHourRankView;
|
||||
@protocol XPRoomLicneseHourRankViewDelegate <NSObject>
|
||||
|
||||
- (void)xPRoomLicneseHourRankView:(XPRoomLicneseHourRankView *)view rankInfo:(RoomHalfHourRankModel *)rankInfo;
|
||||
|
||||
@end
|
||||
@interface XPRoomLicneseHourRankView : UIView
|
||||
///牌照房小时榜信息
|
||||
@property (nonatomic,copy) RoomHalfHourRankModel * licneseRankInfo;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPRoomLicneseHourRankViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// YMRoomLicneseHourRankView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/13.
|
||||
//
|
||||
|
||||
#import "XPRoomLicneseHourRankView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///Model
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
|
||||
@interface XPRoomLicneseHourRankView ()
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///围观
|
||||
@property (nonatomic,strong) UIButton *enterButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomLicneseHourRankView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.enterButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(64);
|
||||
make.right.mas_equalTo(self.enterButton.mas_left).offset(-5);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.enterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(44, 20));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(self).offset(-6);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)backTapRecognizer {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomLicneseHourRankView:rankInfo:)]) {
|
||||
[self.delegate xPRoomLicneseHourRankView:self rankInfo:self.licneseRankInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setLicneseRankInfo:(RoomHalfHourRankModel *)licneseRankInfo {
|
||||
_licneseRankInfo = licneseRankInfo;
|
||||
if (_licneseRankInfo) {
|
||||
NSString *nick = _licneseRankInfo.title;
|
||||
if(nick.length > 6) {
|
||||
nick = [NSString stringWithFormat:@"%@", [nick substringToIndex:6]];
|
||||
}
|
||||
NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[UIColor whiteColor]};
|
||||
NSDictionary * hightDic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]};
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPRoomLicneseHourRankView0") attributes:dic]];
|
||||
if (nick.length > 0) {
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:hightDic]];
|
||||
}
|
||||
|
||||
if (licneseRankInfo.desc.length > 0) {
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:licneseRankInfo.desc attributes:dic]];
|
||||
}
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@"TOP1" attributes:hightDic]];
|
||||
self.titleLabel.attributedText = attribute;
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
_backImageView.image = [UIImage imageNamed:@"room_licnese_hour_rank_bg"];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backTapRecognizer)];
|
||||
[_backImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.numberOfLines = 2;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)enterButton {
|
||||
if (!_enterButton) {
|
||||
_enterButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_enterButton setTitle:YMLocalizedString(@"XPRoomLicneseHourRankView1") forState:UIControlStateNormal];
|
||||
[_enterButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_enterButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
[_enterButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xd93d5f), UIColorFromRGB(0xfff494)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_enterButton.layer.masksToBounds = YES;
|
||||
_enterButton.layer.cornerRadius = 10;
|
||||
_enterButton.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
_enterButton.layer.borderWidth = 0.5;
|
||||
_enterButton.userInteractionEnabled = NO;
|
||||
}
|
||||
return _enterButton;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// YMRoomLuckyBigPrizeView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/15.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "PIBaseAnimationViewModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPGiftBigPrizeModel, XPRoomLuckyBigPrizeView;
|
||||
@protocol XPRoomLuckyBigPrizeViewDelegate <NSObject>
|
||||
|
||||
- (void)xPRoomLuckyBigPrizeView:(XPRoomLuckyBigPrizeView *)view luckyGiftInfo:(PIBaseAnimationViewModel *)giftInfo;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPRoomLuckyBigPrizeView : UIView
|
||||
///礼物信息
|
||||
@property (nonatomic,strong) PIBaseAnimationViewModel *giftInfo;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPRoomLuckyBigPrizeViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -5,54 +5,59 @@
|
||||
// Created by YUMI on 2022/6/15.
|
||||
//
|
||||
|
||||
#import "YUMIChamberFortunateBigCaptureRegard.h"
|
||||
#import "XPRoomLuckyBigPrizeView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "SVGAParser.h"
|
||||
#import "SVGA.h"
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIPresentBigCaptureMatrix.h"
|
||||
#import "YUMISVGADisporter.h"
|
||||
///Model
|
||||
#import "XPGiftBigPrizeModel.h"
|
||||
///View
|
||||
#import "XPSVGAPlayer.h"
|
||||
|
||||
|
||||
@interface YUMIChamberFortunateBigCaptureRegard ()
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
@property (nonatomic, strong) YUMISVGADisporter *presentIndicateRegard;
|
||||
@interface XPRoomLuckyBigPrizeView ()
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
@property (nonatomic, strong) XPSVGAPlayer *giftImageView;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberFortunateBigCaptureRegard
|
||||
@implementation XPRoomLuckyBigPrizeView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.presentIndicateRegard];
|
||||
[self addSubview:self.giftImageView];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
|
||||
[self addGestureRecognizer:tap];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.presentIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
- (void)initSubViewConstraints {
|
||||
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)tapRecognizer:(UITapGestureRecognizer *)tap {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberInthecaseoftuntowardseConsiderableCaptureRegard:luckyGiftInfo:)]) {
|
||||
[self.delegate yUMIChamberInthecaseoftuntowardseConsiderableCaptureRegard:self luckyGiftInfo:self.giftInfo];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomLuckyBigPrizeView:luckyGiftInfo:)]) {
|
||||
[self.delegate xPRoomLuckyBigPrizeView:self luckyGiftInfo:self.giftInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setGiftInfo:(YUMIPresentBigCaptureMatrix *)giftInfo {
|
||||
- (void)setGiftInfo:(PIBaseAnimationViewModel*)giftInfo {
|
||||
_giftInfo = giftInfo;
|
||||
if (_giftInfo) {
|
||||
NSString * nick = _giftInfo.nick;
|
||||
@@ -61,14 +66,14 @@
|
||||
}
|
||||
CGFloat fontSize = 22;
|
||||
NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[UIColor whiteColor]};
|
||||
NSDictionary * mainDic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[DJDKMIMOMColor aplictowardsionMainPrettify]};
|
||||
NSDictionary * mainDic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]};
|
||||
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@"恭喜 " attributes:dic]];
|
||||
if (nick) {
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:mainDic]];
|
||||
}
|
||||
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:YMLocalizedString(@"YUMI_Room_Lucky_Big_Prize_View_1"),_giftInfo.luckyBagName] attributes:dic]];
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:YMLocalizedString(@"XPRoomLuckyBigPrizeView1"),_giftInfo.luckyBagName] attributes:dic]];
|
||||
if (giftInfo.goldPrice) {
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:giftInfo.goldPrice attributes:mainDic]];
|
||||
}
|
||||
@@ -76,46 +81,46 @@
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
paragraphStyle.lineSpacing = 4.0f;
|
||||
|
||||
paragraphStyle.lineSpacing = 4.0f;//行间距
|
||||
// 强制排版(从左到右)
|
||||
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedString.length)];
|
||||
if (_giftInfo.isInRoomVisiable) {
|
||||
[self.presentIndicateRegard setHidden:YES forKey:@"img_206"];
|
||||
[self.giftImageView setHidden:YES forKey:@"img_206"];
|
||||
} else {
|
||||
[self.presentIndicateRegard setHidden:NO forKey:@"img_206"];
|
||||
[self.giftImageView setHidden:NO forKey:@"img_206"];
|
||||
}
|
||||
@kWeakify(self);
|
||||
[self.presentIndicateRegard setAttributedText:attributedString forKey:@"fdpp_copywriting"];
|
||||
[self.giftImageView setAttributedText:attributedString forKey:@"fdpp_copywriting"];
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/lucky_gift_streamer.svga", API_Image_URL];
|
||||
[self.anatomiser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
[self.parser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.hidden = NO;
|
||||
self.presentIndicateRegard.hidden = NO;
|
||||
self.presentIndicateRegard.videoItem = videoItem;
|
||||
self.presentIndicateRegard.loops = 1;
|
||||
self.presentIndicateRegard.clearsAfterStop = YES;
|
||||
[self.presentIndicateRegard startAnimation];
|
||||
self.giftImageView.hidden = NO;
|
||||
self.giftImageView.videoItem = videoItem;
|
||||
self.giftImageView.loops = 1;
|
||||
self.giftImageView.clearsAfterStop = YES;
|
||||
[self.giftImageView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (YUMISVGADisporter *)presentIndicateRegard {
|
||||
if (!_presentIndicateRegard) {
|
||||
_presentIndicateRegard = [[YUMISVGADisporter alloc]init];
|
||||
_presentIndicateRegard.backgroundColor = [UIColor clearColor];
|
||||
_presentIndicateRegard.userInteractionEnabled = NO;
|
||||
- (XPSVGAPlayer *)giftImageView {
|
||||
if (!_giftImageView) {
|
||||
_giftImageView = [[XPSVGAPlayer alloc]init];
|
||||
_giftImageView.backgroundColor = [UIColor clearColor];
|
||||
_giftImageView.userInteractionEnabled = NO;
|
||||
}
|
||||
return _presentIndicateRegard;
|
||||
return _giftImageView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
return _parser;
|
||||
}
|
||||
@end
|
@@ -9,9 +9,10 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberMagnificentPrototypeUpwardsRegard : UIView
|
||||
@interface XPRoomNobleLevelUpView : UIView
|
||||
|
||||
@property (nonatomic,copy) NSDictionary * magnificentAbstract;
|
||||
///贵族升级的信息
|
||||
@property (nonatomic,copy) NSDictionary * nobleInfo;
|
||||
|
||||
@end
|
||||
|
161
YuMi/Modules/YMRoom/View/AnimationView/XPRoomNobleLevelUpView.m
Normal file
161
YuMi/Modules/YMRoom/View/AnimationView/XPRoomNobleLevelUpView.m
Normal file
@@ -0,0 +1,161 @@
|
||||
//
|
||||
// YMRoomNobleLevelUpView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/10.
|
||||
//
|
||||
|
||||
#import "XPRoomNobleLevelUpView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "NetImageView.h"
|
||||
#import <YYText/YYText.h>
|
||||
|
||||
@interface XPRoomNobleLevelUpView ()
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
|
||||
///贵族特效
|
||||
@property (nonatomic,strong) SVGAImageView *nobleView;
|
||||
|
||||
@property (nonatomic, strong) UILabel *firstLabel;
|
||||
///用户头像
|
||||
@property (nonatomic, strong) NetImageView *imageView;
|
||||
///贵族信息
|
||||
@property (nonatomic, strong) UILabel *secondLabel;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPRoomNobleLevelUpView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.nobleView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.nobleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(90);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSMutableAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:22], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setNobleInfo:(NSDictionary *)nobleInfo {
|
||||
_nobleInfo = nobleInfo;
|
||||
self.imageView.imageUrl = nobleInfo[@"avatar"];
|
||||
|
||||
if (nobleInfo) {
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:nobleInfo[@"floatPic"]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@kStrongify(self);
|
||||
self.nobleView.loops = 1;
|
||||
self.nobleView.clearsAfterStop = NO;
|
||||
self.nobleView.videoItem = videoItem;
|
||||
[self.nobleView startAnimation];
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
///绘制自定义view
|
||||
[self.nobleView setDrawingBlock:^(CALayer *contentLayer, NSInteger frameIndex) {
|
||||
@kStrongify(self);
|
||||
CGFloat height = contentLayer.bounds.size.height;
|
||||
CGFloat totalWidth = 0;
|
||||
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
[attribute appendAttributedString:[self createAttribute:@"引爆全场!恭喜 " color:[UIColor whiteColor]]];
|
||||
CGFloat width1 = [attribute.string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:22]} context:nil].size.width;
|
||||
self.firstLabel.attributedText = attribute;
|
||||
|
||||
NSMutableAttributedString * attribute1 = [[NSMutableAttributedString alloc] init];
|
||||
[attribute1 appendAttributedString:[self createAttribute:@" " color:[DJDKMIMOMColor giftBroadcastNumberColor]]];
|
||||
[attribute1 appendAttributedString:[self createAttribute:nobleInfo[@"nick"] color:[DJDKMIMOMColor giftBroadcastNumberColor]]];
|
||||
[attribute1 appendAttributedString:[self createAttribute:@" " color:[DJDKMIMOMColor giftBroadcastNumberColor]]];
|
||||
[attribute1 appendAttributedString:[self createAttribute:[NSString stringWithFormat:@"贵族身份升级为%@!", nobleInfo[@"currVipName"]] color:[UIColor whiteColor]]];
|
||||
CGFloat width2 = [attribute1.string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:22]} context:nil].size.width;
|
||||
self.secondLabel.attributedText = attribute1;
|
||||
|
||||
totalWidth += ((width1 + width2) * 12/22 + 50);
|
||||
CGFloat originL = (KScreenWidth - (totalWidth > KScreenWidth ? KScreenWidth : totalWidth)) * 0.5;
|
||||
if (KScreenHeight != 667) {///在iOS14.0上的iPhone8上,无法显示头像,暂时隐藏头像
|
||||
self.firstLabel.layer.frame = CGRectMake(originL, 0, width1, height);
|
||||
[contentLayer addSublayer:self.firstLabel.layer];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:self.imageView.image];
|
||||
imageView.layer.frame = CGRectMake(originL + width1, (height - 50) * 0.5, 50, 50);
|
||||
imageView.layer.cornerRadius = 25.0f;
|
||||
imageView.layer.masksToBounds = YES;
|
||||
[contentLayer addSublayer:imageView.layer];
|
||||
self.secondLabel.layer.frame = CGRectMake(originL + width1 + 50, 0, width2, height);
|
||||
[contentLayer addSublayer:self.secondLabel.layer];
|
||||
} else {
|
||||
totalWidth -= 50;
|
||||
CGFloat originL = (KScreenWidth - (totalWidth > KScreenWidth ? KScreenWidth : totalWidth)) * 0.5;
|
||||
self.firstLabel.layer.frame = CGRectMake(originL, 0, width1, height);
|
||||
[contentLayer addSublayer:self.firstLabel.layer];
|
||||
self.secondLabel.layer.frame = CGRectMake(originL + width1, 0, width2, height);
|
||||
[contentLayer addSublayer:self.secondLabel.layer];
|
||||
}
|
||||
} forKey:@"noble_text_tx"];
|
||||
}
|
||||
}
|
||||
|
||||
- (SVGAImageView *)nobleView {
|
||||
if (!_nobleView) {
|
||||
_nobleView = [[SVGAImageView alloc]init];
|
||||
_nobleView.backgroundColor = [UIColor clearColor];
|
||||
_nobleView.userInteractionEnabled = NO;
|
||||
}
|
||||
return _nobleView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
|
||||
- (UILabel *)firstLabel {
|
||||
if (!_firstLabel) {
|
||||
_firstLabel = [[UILabel alloc] init];
|
||||
}
|
||||
return _firstLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)secondLabel{
|
||||
if (!_secondLabel) {
|
||||
_secondLabel = [[UILabel alloc] init];
|
||||
}
|
||||
return _secondLabel;
|
||||
}
|
||||
|
||||
- (NetImageView *)imageView {
|
||||
if (!_imageView) {
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
config.autoLoad = YES;
|
||||
_imageView = [[NetImageView alloc] initWithConfig:config];
|
||||
}
|
||||
return _imageView;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// XPRoomStarKitchenBannerView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2022/12/7.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "XPRoomStarKitchenModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPRoomStarKitchenBannerView;
|
||||
@protocol XPRoomStarKitchenBannerViewDelegate <NSObject>
|
||||
|
||||
- (void)xPRoomStarKitchenBannerView:(XPRoomStarKitchenBannerView *)view didClick:(XPRoomStarKitchenModel *)starModel;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XPRoomStarKitchenBannerView : UIView
|
||||
@property (nonatomic,assign) BOOL isSvga;
|
||||
@property (nonatomic,strong) XPRoomStarKitchenModel *starModel;
|
||||
@property (nonatomic,weak) id<XPRoomStarKitchenBannerViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// XPRoomStarKitchenBannerView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2022/12/7.
|
||||
//
|
||||
#import <SVGA.h>
|
||||
#import "XPRoomStarKitchenBannerView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
@interface XPRoomStarKitchenBannerView()
|
||||
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
@property (nonatomic,strong) SVGAImageView *svgaView;
|
||||
@property (nonatomic,strong) UIImageView *bgImageView;
|
||||
@property (nonatomic,strong) UILabel *titleView;
|
||||
@property (nonatomic,strong) UIButton *clickBtn;
|
||||
|
||||
@end
|
||||
@implementation XPRoomStarKitchenBannerView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.svgaView];
|
||||
[self addSubview:self.titleView];
|
||||
[self addSubview:self.clickBtn];
|
||||
|
||||
}
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.svgaView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(21));
|
||||
make.left.mas_equalTo(kGetScaleWidth(85));
|
||||
make.bottom.equalTo(self.mas_bottom).mas_offset(-kGetScaleWidth(13.5));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(53.5));
|
||||
}];
|
||||
|
||||
[self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)setStarModel:(XPRoomStarKitchenModel *)starModel{
|
||||
_starModel = starModel;
|
||||
NSString *name = _starModel.nick.length < 7 ? _starModel.nick : [NSString stringWithFormat:@"%@...",[_starModel.nick substringWithRange:NSMakeRange(0, 6)]];
|
||||
NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomStarKitchenBannerView0"),name,_starModel.itemMultiple,_starModel.diamonds];
|
||||
[self.titleView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(_isSvga == YES && KScreenWidth == 320 ? 18 : 21));
|
||||
}];
|
||||
NSMutableAttributedString *att = [[NSMutableAttributedString alloc]initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFEF23E)} range:[title rangeOfString:name]];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x00EAFF)} range:[title rangeOfString:[NSString stringWithFormat:@" %@",_starModel.itemMultiple]]];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x00EAFF)} range:[title rangeOfString:[NSString stringWithFormat:@" %@",_starModel.diamonds]]];
|
||||
if(_isSvga == YES){
|
||||
self.bgImageView.hidden = YES;
|
||||
self.svgaView.hidden = NO;
|
||||
self.titleView.hidden = NO;
|
||||
self.titleView.attributedText = att;
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithNamed:@"Star_kitchen" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.svgaView.loops = 1;
|
||||
self.svgaView.clearsAfterStop = NO;
|
||||
self.svgaView.videoItem = videoItem;
|
||||
// [self.svgaView setAttributedText:att forKey:@"noble_text_tx"];
|
||||
[self.svgaView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
self.bgImageView.hidden = NO;
|
||||
self.titleView.hidden = NO;
|
||||
self.svgaView.hidden = YES;
|
||||
self.titleView.attributedText = att;
|
||||
}
|
||||
}
|
||||
-(void)clickAction{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(xPRoomStarKitchenBannerView:didClick:)]){
|
||||
[self.delegate xPRoomStarKitchenBannerView:self didClick:self.starModel];
|
||||
}
|
||||
}
|
||||
#pragma mark -懒加载
|
||||
- (UIImageView *)bgImageView{
|
||||
if (!_bgImageView){
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.image = [UIImage imageNamed:@"room_star_kitchen"];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
-(UILabel *)titleView{
|
||||
if (!_titleView){
|
||||
_titleView = [UILabel new];
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
_titleView.numberOfLines = 2;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
- (SVGAImageView *)svgaView {
|
||||
if (!_svgaView) {
|
||||
_svgaView= [[SVGAImageView alloc]init];
|
||||
_svgaView.backgroundColor = [UIColor clearColor];
|
||||
_svgaView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _svgaView;
|
||||
}
|
||||
-(UIButton *)clickBtn{
|
||||
if (!_clickBtn){
|
||||
_clickBtn = [UIButton new];
|
||||
[_clickBtn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
}
|
||||
return _clickBtn;
|
||||
}
|
||||
@end
|
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// YMRoomYearActivityView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by GLEN on 2022/11/26.
|
||||
// 年度活动
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPRoomYearActivityViewDelegate <NSObject>
|
||||
|
||||
///点击了进入房间
|
||||
- (void)xPRoomYearActivityViewEnterRoom:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPRoomYearActivityView : UIView
|
||||
|
||||
@property (nonatomic, strong) GiftReceiveInfoModel *model;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPRoomYearActivityViewDelegate> delegate;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
214
YuMi/Modules/YMRoom/View/AnimationView/XPRoomYearActivityView.m
Normal file
214
YuMi/Modules/YMRoom/View/AnimationView/XPRoomYearActivityView.m
Normal file
@@ -0,0 +1,214 @@
|
||||
//
|
||||
// YMRoomYearActivityView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by GLEN on 2022/11/26.
|
||||
//
|
||||
|
||||
#import "XPRoomYearActivityView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
///Model
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XPRoomYearActivityView()
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *bgImageView;
|
||||
///icon
|
||||
@property (nonatomic,strong) NetImageView *sendAvatar;
|
||||
///头像
|
||||
@property (nonatomic,strong) NetImageView *receiveAvatar;
|
||||
///恭喜
|
||||
@property (nonatomic,strong) UILabel *sendNick;
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *receiveNick;
|
||||
///描述
|
||||
@property (nonatomic, strong) UILabel *descLabel;
|
||||
///数量
|
||||
@property (nonatomic,strong) UILabel *countLabel;
|
||||
///排行
|
||||
@property (nonatomic, strong) UIButton *gotoButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomYearActivityView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.sendNick];
|
||||
[self addSubview:self.sendAvatar];
|
||||
[self addSubview:self.descLabel];
|
||||
[self addSubview:self.receiveNick];
|
||||
[self addSubview:self.receiveAvatar];
|
||||
[self addSubview:self.countLabel];
|
||||
[self addSubview:self.gotoButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(0);
|
||||
}];
|
||||
[self.sendNick mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(35*KScreenWidth/375);
|
||||
make.centerY.mas_equalTo(self.bgImageView);
|
||||
}];
|
||||
[self.sendAvatar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.sendNick.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.sendAvatar.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.receiveNick mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.descLabel.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.receiveAvatar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.receiveNick.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.receiveAvatar.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.gotoButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-31*KScreenWidth / 375);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.size.mas_equalTo(CGSizeMake(40, 18));
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(GiftReceiveInfoModel *)model {
|
||||
_model = model;
|
||||
if (model) {
|
||||
self.receiveAvatar.imageUrl = model.recvUserAvatar;
|
||||
self.sendAvatar.imageUrl = model.sendUserAvatar;
|
||||
if (model.recvUserNick.length > 4) {
|
||||
model.recvUserNick = [NSString stringWithFormat:@"%@...", [model.recvUserNick substringToIndex:4]];
|
||||
}
|
||||
if (model.sendUserNick.length > 4) {
|
||||
model.sendUserNick = [NSString stringWithFormat:@"%@...", [model.sendUserNick substringToIndex:4]];
|
||||
}
|
||||
if (model.giftName.length > 6) {
|
||||
model.giftName = [model.giftName substringToIndex:6];
|
||||
}
|
||||
self.sendNick.text = model.sendUserNick;
|
||||
self.receiveNick.text = model.recvUserNick;
|
||||
self.countLabel.text = [NSString stringWithFormat:@"%@ x%ld", model.giftName, model.giftNum];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onGotoButtonClick:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomYearActivityViewEnterRoom:)]) {
|
||||
[self.delegate xPRoomYearActivityViewEnterRoom:[NSString stringWithFormat:@"%ld", self.model.roomUid]];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage imageNamed:@"YearActivity_bg"];
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)sendAvatar {
|
||||
if (!_sendAvatar) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_sendAvatar = [[NetImageView alloc] initWithConfig:config];
|
||||
_sendAvatar.layer.masksToBounds = YES;
|
||||
_sendAvatar.layer.cornerRadius = 10;
|
||||
_sendAvatar.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor;
|
||||
_sendAvatar.layer.borderWidth = 1;
|
||||
}
|
||||
return _sendAvatar;
|
||||
}
|
||||
|
||||
- (UILabel *)sendNick {
|
||||
if (!_sendNick) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = UIColorFromRGB(0xFBC200);
|
||||
_sendNick = label;
|
||||
}
|
||||
return _sendNick;
|
||||
}
|
||||
|
||||
- (NetImageView *)receiveAvatar {
|
||||
if (!_receiveAvatar) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_receiveAvatar = [[NetImageView alloc] initWithConfig:config];
|
||||
_receiveAvatar.layer.masksToBounds = YES;
|
||||
_receiveAvatar.layer.cornerRadius = 10;
|
||||
_receiveAvatar.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor;
|
||||
_receiveAvatar.layer.borderWidth = 1;
|
||||
}
|
||||
return _receiveAvatar;
|
||||
}
|
||||
|
||||
- (UILabel *)receiveNick {
|
||||
if (!_receiveNick) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = UIColorFromRGB(0xFBC200);
|
||||
_receiveNick = label;
|
||||
}
|
||||
return _receiveNick;
|
||||
}
|
||||
|
||||
- (UILabel *)descLabel {
|
||||
if (!_descLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = YMLocalizedString(@"XPRoomYearActivityView0");
|
||||
_descLabel = label;
|
||||
}
|
||||
return _descLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
_countLabel = [[UILabel alloc] init];
|
||||
_countLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold];
|
||||
_countLabel.textColor = UIColorFromRGB(0x80F9FF);
|
||||
}
|
||||
return _countLabel;
|
||||
}
|
||||
- (UIButton *)gotoButton {
|
||||
if (!_gotoButton) {
|
||||
_gotoButton = [[UIButton alloc] init];
|
||||
[_gotoButton setBackgroundImage:[UIImage imageNamed:@"YearActivity_goto"] forState:UIControlStateNormal];
|
||||
[_gotoButton addTarget:self action:@selector(onGotoButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _gotoButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// YMRoomAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YUMIChamberBrightnessHitRegard.h"
|
||||
#import "ChamberHostRepresendtation.h"
|
||||
#import "ChamberGuestRepresendtation.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberBrightnessRegard : YUMIChamberBrightnessHitRegard <ChamberGuestRepresendtation>
|
||||
- (instancetype)initWithDelegate:(id<ChamberHostRepresendtation>)delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
File diff suppressed because it is too large
Load Diff
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// YMRoomCandyGiftView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YUMIPresentBigCaptureMatrix.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIChamberConfectioneryPresentRegard : UIView
|
||||
@property (nonatomic,assign) BOOL isLargestBignessPresent;
|
||||
@property (nonatomic,copy) NSDictionary * confectioneryAbstract;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,157 +0,0 @@
|
||||
//
|
||||
// YMRoomCandyGiftView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/10.
|
||||
//
|
||||
|
||||
#import "YUMIChamberConfectioneryPresentRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "YUMISVGADisporter.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "ConfectioneryTimberConsequentMatrix.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
@interface YUMIChamberConfectioneryPresentRegard ()
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
@property (nonatomic,strong) YUMISVGADisporter *confectioneryTimberRegard;
|
||||
@property (nonatomic,strong) UIImageView *encourageIndicateRegard;
|
||||
@property (nonatomic,strong) UIView *titleView;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberConfectioneryPresentRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.confectioneryTimberRegard];
|
||||
[self addSubview:self.encourageIndicateRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.titleView];
|
||||
|
||||
[self.titleView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.confectioneryTimberRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.encourageIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(260);
|
||||
make.height.mas_equalTo(28);
|
||||
make.top.mas_equalTo(self.encourageIndicateRegard).offset(23);
|
||||
make.centerX.mas_equalTo(self.encourageIndicateRegard);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.titleView);
|
||||
make.centerY.mas_equalTo(self.titleView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSAttributedString *)produceIdiosyncracy:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setConfectioneryAbstract:(NSDictionary *)confectioneryAbstract {
|
||||
if (confectioneryAbstract) {
|
||||
ConfectioneryTimberPresentAbstractMatrix * giftInfo = [ConfectioneryTimberPresentAbstractMatrix mtowardsrixAboutImpactbasket:confectioneryAbstract];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
CGFloat fontSize = self.isLargestBignessPresent ? 22 : 13;
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:@"厉害了! " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:giftInfo.nick color:[DJDKMIMOMColor colorAboutHexBWSttr:@"#FEF23E"] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:@"摘下糖果得 " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:giftInfo.prizeName color:[DJDKMIMOMColor colorAboutHexBWSttr:@"#FEF23E"] fontSize:fontSize]];
|
||||
if (giftInfo.prizeNum > 1) {
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
}
|
||||
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
paragraphStyle.lineSpacing = 4.0f;
|
||||
paragraphStyle.alignment = NSTextAlignmentCenter;
|
||||
paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||
[attribute addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attribute.length)];
|
||||
[self.confectioneryTimberRegard setAttributedText:attribute forKey:@"tgs_copywriting"];
|
||||
if (self.isLargestBignessPresent) {
|
||||
self.encourageIndicateRegard.hidden = YES;
|
||||
self.confectioneryTimberRegard.hidden = NO;
|
||||
@kWeakify(self);
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/candyTree_banner.svga", API_Image_URL];
|
||||
[self.anatomiser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.confectioneryTimberRegard.loops = 1;
|
||||
self.confectioneryTimberRegard.clearsAfterStop = NO;
|
||||
self.confectioneryTimberRegard.videoItem = videoItem;
|
||||
|
||||
[self.confectioneryTimberRegard startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
} else {
|
||||
self.encourageIndicateRegard.hidden = NO;
|
||||
self.confectioneryTimberRegard.hidden = YES;
|
||||
self.titleLabel.attributedText = attribute;
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (YUMISVGADisporter *)confectioneryTimberRegard {
|
||||
if (!_confectioneryTimberRegard) {
|
||||
_confectioneryTimberRegard = [[YUMISVGADisporter alloc]init];
|
||||
_confectioneryTimberRegard.backgroundColor = [UIColor clearColor];
|
||||
_confectioneryTimberRegard.userInteractionEnabled = NO;
|
||||
}
|
||||
return _confectioneryTimberRegard;
|
||||
}
|
||||
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
}
|
||||
|
||||
- (UIView *)titleView {
|
||||
if (!_titleView) {
|
||||
_titleView = [[UIView alloc] init];
|
||||
_titleView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
- (UIImageView *)encourageIndicateRegard {
|
||||
if (!_encourageIndicateRegard) {
|
||||
_encourageIndicateRegard = [[UIImageView alloc] init];
|
||||
_encourageIndicateRegard.userInteractionEnabled = YES;
|
||||
_encourageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_candytree_large_present_background"];
|
||||
}
|
||||
return _encourageIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.numberOfLines = 2;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// YMRoomDatingAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class EngagementAbstractMatrix;
|
||||
@interface YUMIChamberEngagementBrightnessRegard : UIView
|
||||
- (void)inititowardseBrectifynessAboutMtowardsrix:(EngagementAbstractMatrix *)model finishBlock:(void (^)(BOOL))finishBlock;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,356 +0,0 @@
|
||||
//
|
||||
// YMRoomDatingAnimationView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/5.
|
||||
//
|
||||
|
||||
#import "YUMIChamberEngagementBrightnessRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "EngagementAbstractMatrix.h"
|
||||
|
||||
@interface YUMIChamberEngagementBrightnessRegard ()
|
||||
@property (nonatomic,strong) UIView *encourageRegard;
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
@property (nonatomic, strong) SVGAImageView *engagementSvgaIndicateRegard;
|
||||
@property (nonatomic,strong) UIView *cutIntratemporalEncourageRegard;
|
||||
@property (nonatomic,strong) UILabel *intratemporalSequencignation;
|
||||
@property (nonatomic,strong) UIView *burlywoodRegard;
|
||||
@property (nonatomic,strong) UIButton *concludeBtuton;
|
||||
@property (nonatomic,strong) UIImageView *courageIndicateRegard;
|
||||
@property (nonatomic,copy) void(^FinishBlock)(BOOL result);
|
||||
@property (nonatomic,strong) id timer;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberEngagementBrightnessRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self addSubview:self.encourageRegard];
|
||||
[self addSubview:self.engagementSvgaIndicateRegard];
|
||||
[self addSubview:self.cutIntratemporalEncourageRegard];
|
||||
[self addSubview:self.courageIndicateRegard];
|
||||
[self.cutIntratemporalEncourageRegard addSubview:self.intratemporalSequencignation];
|
||||
[self.cutIntratemporalEncourageRegard addSubview:self.burlywoodRegard];
|
||||
[self.cutIntratemporalEncourageRegard addSubview:self.concludeBtuton];
|
||||
[self initContrtowardsions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Resonse
|
||||
- (void)concludetBtutonPerformance:(UIButton *)sender {
|
||||
if (self.FinishBlock) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Pirvate Method
|
||||
- (void)initContrtowardsions {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
|
||||
[self.encourageRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.engagementSvgaIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.cutIntratemporalEncourageRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(70, 25));
|
||||
make.right.mas_equalTo(self).offset(-12);
|
||||
make.top.mas_equalTo(self).offset(41 + kSafeAreaTopHeight);
|
||||
}];
|
||||
|
||||
[self.intratemporalSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.cutIntratemporalEncourageRegard).offset(13);
|
||||
make.centerY.mas_equalTo(self.cutIntratemporalEncourageRegard);
|
||||
}];
|
||||
|
||||
[self.burlywoodRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.cutIntratemporalEncourageRegard);
|
||||
make.size.mas_equalTo(CGSizeMake(0.5, 13));
|
||||
}];
|
||||
|
||||
[self.concludeBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(14, 14));
|
||||
make.centerY.mas_equalTo(self.cutIntratemporalEncourageRegard);
|
||||
make.left.mas_equalTo(self.burlywoodRegard.mas_right).offset(8);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)stopAnimation {
|
||||
if (self.FinishBlock) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImage *)setMonopolizeAboutRestrictions:(CGFloat)radius andSize:(CGSize)size image:(UIImage *)image {
|
||||
|
||||
UIGraphicsBeginImageContext(size);
|
||||
|
||||
CGRect rect = CGRectMake(0, 0, size.width, size.height);
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)];
|
||||
|
||||
CGContextAddPath(UIGraphicsGetCurrentContext(), path.CGPath);
|
||||
|
||||
CGContextClip(UIGraphicsGetCurrentContext());
|
||||
|
||||
[image drawInRect:rect];
|
||||
|
||||
CGContextDrawPath(UIGraphicsGetCurrentContext(), kCGPathStroke);
|
||||
|
||||
UIImage *output = UIGraphicsGetImageFromCurrentImageContext();
|
||||
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
- (CAAnimationGroup *)produceChamberEngagementExtractAnimtowardsioDerivtowardsionSpeck:(CGPoint)orginPoint destinationPoint:(CGPoint)destinationPoint {
|
||||
|
||||
CAKeyframeAnimation * scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
||||
scaleAnimation.duration = 0.5;
|
||||
scaleAnimation.repeatCount = 1;
|
||||
scaleAnimation.values = @[@(0),@(0.2),@(0.4), @(0.6), @(0.8), @(0.9), @(1)];
|
||||
scaleAnimation.calculationMode = kCAAnimationCubic;
|
||||
scaleAnimation.removedOnCompletion = NO;
|
||||
scaleAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
CAKeyframeAnimation * transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
|
||||
transformAnimation.beginTime = 0.5;
|
||||
transformAnimation.duration = 1;
|
||||
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
transformAnimation.values = @[[NSValue valueWithCGPoint:orginPoint],[NSValue valueWithCGPoint:destinationPoint]];
|
||||
transformAnimation.repeatCount = 1;
|
||||
transformAnimation.removedOnCompletion = NO;
|
||||
transformAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
CAKeyframeAnimation * desScaleformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
||||
desScaleformAnimation.beginTime = 1.5;
|
||||
desScaleformAnimation.duration = 0.5;
|
||||
desScaleformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
desScaleformAnimation.values = @[@(1), @(1.2), @(1.4), @(1.6)];
|
||||
desScaleformAnimation.repeatCount = 1;
|
||||
desScaleformAnimation.removedOnCompletion = NO;
|
||||
desScaleformAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
|
||||
CAKeyframeAnimation * opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
||||
opacityAnimation.beginTime = 1.5;
|
||||
opacityAnimation.duration = 0.5;
|
||||
opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
||||
opacityAnimation.values = @[@(1),@(0.8),@(0.6),@(0)];
|
||||
opacityAnimation.repeatCount = 1;
|
||||
opacityAnimation.removedOnCompletion = NO;
|
||||
opacityAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
|
||||
CAAnimationGroup * group = [CAAnimationGroup animation];
|
||||
group.animations = @[scaleAnimation, transformAnimation, desScaleformAnimation, opacityAnimation];
|
||||
group.duration = 2;
|
||||
group.removedOnCompletion = NO;
|
||||
group.fillMode = kCAFillModeForwards;
|
||||
return group;;
|
||||
}
|
||||
|
||||
- (void)inititowardseBeginDeficitucedComputtowardsionAboutGeneralIntrtowardsemporal:(int)time {
|
||||
__block int totalTime = time;
|
||||
dispatch_source_t times = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
|
||||
_timer = times;
|
||||
dispatch_source_set_timer(times, DISPATCH_TIME_NOW, 1* NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
||||
dispatch_source_set_event_handler(times, ^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (totalTime <= 5 && totalTime >= 0) {
|
||||
|
||||
self.cutIntratemporalEncourageRegard.hidden = NO;
|
||||
self.intratemporalSequencignation.text = [NSString stringWithFormat:@"%ds", totalTime];
|
||||
}
|
||||
if (totalTime <= 0) {
|
||||
dispatch_source_cancel(times);
|
||||
self.cutIntratemporalEncourageRegard.hidden = YES;
|
||||
}
|
||||
totalTime--;
|
||||
});
|
||||
});
|
||||
dispatch_resume(times);
|
||||
}
|
||||
|
||||
- (void)inititowardseExtractCourageFetowardsureBrectifynessDerivtowardsionSpeck:(CGPoint)originPoint targetPoint:(CGPoint)targetPoint {
|
||||
if (originPoint.x > 0 && targetPoint.x > 0) {
|
||||
self.courageIndicateRegard.frame = CGRectMake(0, 0, 55, 55);
|
||||
self.courageIndicateRegard.hidden = YES;
|
||||
self.encourageRegard.hidden = YES;
|
||||
self.courageIndicateRegard.hidden = NO;
|
||||
self.courageIndicateRegard.center = originPoint;
|
||||
CAAnimationGroup * group = [self produceChamberEngagementExtractAnimtowardsioDerivtowardsionSpeck:originPoint destinationPoint:targetPoint];
|
||||
[self.courageIndicateRegard.layer addAnimation:group forKey:nil];
|
||||
[self performSelector:@selector(anitowardsionDidAccomplish:) withObject:self.courageIndicateRegard afterDelay:(2)];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)anitowardsionDidAccomplish:(UIImageView *)presentIndicateRegard{
|
||||
[presentIndicateRegard.layer removeAllAnimations];
|
||||
presentIndicateRegard.hidden = YES;
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
|
||||
- (void)inititowardseBrectifynessAboutMtowardsrix:(EngagementAbstractMatrix *)model finishBlock:(void (^)(BOOL))finishBlock {
|
||||
self.FinishBlock = finishBlock;
|
||||
if (model.hasHeart) {
|
||||
if (model.svgaUrl) {
|
||||
[self inititowardsePalySVGAAboutWeebsite:model];
|
||||
} else {
|
||||
|
||||
|
||||
if (self.FinishBlock) {
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
[self inititowardseExtractCourageFetowardsureBrectifynessDerivtowardsionSpeck:model.originPoint targetPoint:model.targetPoint];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
||||
if (self.FinishBlock) {
|
||||
self.FinishBlock(YES);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)inititowardsePalySVGAAboutWeebsite:(EngagementAbstractMatrix *)model {
|
||||
if (model.svgaUrl) {
|
||||
self.encourageRegard.hidden = NO;
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.avatar] options:SDWebImageRetryFailed progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
if (image) {
|
||||
image = [self setMonopolizeAboutRestrictions:200 andSize:CGSizeMake(400, 400) image:image];
|
||||
[self.engagementSvgaIndicateRegard setImage:image forKey:@"z_tx"];
|
||||
}
|
||||
}];
|
||||
|
||||
NSString * title = model.nickname ? model.nickname : @"";
|
||||
if (title.length >= 5) {
|
||||
title = [NSString stringWithFormat:@"%@…", [title substringToIndex:5]];
|
||||
}
|
||||
NSMutableAttributedString * rightAttribut = [[NSMutableAttributedString alloc] initWithString:title];
|
||||
[rightAttribut addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:28], NSForegroundColorAttributeName:[UIColor whiteColor]} range:NSMakeRange(0, title.length)];
|
||||
[self.engagementSvgaIndicateRegard setAttributedText:rightAttribut forKey:@"z_yhname"];
|
||||
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.targetAvatar] options:SDWebImageRetryFailed progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
if (image) {
|
||||
image = [self setMonopolizeAboutRestrictions:200 andSize:CGSizeMake(400, 400) image:image];
|
||||
[self.engagementSvgaIndicateRegard setImage:image forKey:@"y_tx"];
|
||||
}
|
||||
}];
|
||||
NSString * leftTitle = model.targetNickname ? model.targetNickname : @"";
|
||||
if (leftTitle.length >= 5) {
|
||||
leftTitle = [NSString stringWithFormat:@"%@…", [leftTitle substringToIndex:5]];
|
||||
}
|
||||
NSMutableAttributedString * leftAttribut = [[NSMutableAttributedString alloc] initWithString:leftTitle];
|
||||
[leftAttribut addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:28], NSForegroundColorAttributeName:[UIColor whiteColor]} range:NSMakeRange(0, leftTitle.length)];
|
||||
[self.engagementSvgaIndicateRegard setAttributedText:leftAttribut forKey:@"y_yhname"];
|
||||
@kWeakify(self);
|
||||
[self.anatomiser parseWithURL:[NSURL URLWithString:model.svgaUrl] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.engagementSvgaIndicateRegard.hidden = NO;
|
||||
self.engagementSvgaIndicateRegard.videoItem = videoItem;
|
||||
self.engagementSvgaIndicateRegard.loops = 1;
|
||||
self.engagementSvgaIndicateRegard.alpha = 1;
|
||||
self.engagementSvgaIndicateRegard.clearsAfterStop = YES;
|
||||
[ self.engagementSvgaIndicateRegard startAnimation];
|
||||
[self inititowardseBeginDeficitucedComputtowardsionAboutGeneralIntrtowardsemporal:model.svgaSecond];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
[self performSelector:@selector(stopAnimation) withObject:nil afterDelay:model.svgaSecond];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)courageIndicateRegard {
|
||||
if (!_courageIndicateRegard) {
|
||||
_courageIndicateRegard = [[UIImageView alloc] init];
|
||||
_courageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_mode_dating_pick_heart"];
|
||||
_courageIndicateRegard.hidden = YES;
|
||||
}
|
||||
return _courageIndicateRegard;
|
||||
}
|
||||
|
||||
- (UIView *)encourageRegard {
|
||||
if (!_encourageRegard) {
|
||||
_encourageRegard = [[UIView alloc] init];
|
||||
_encourageRegard.backgroundColor = UIColorRGBAlpha(0x000000, 0.3);
|
||||
_encourageRegard.hidden = YES;
|
||||
}
|
||||
return _encourageRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)intratemporalSequencignation {
|
||||
if (!_intratemporalSequencignation) {
|
||||
_intratemporalSequencignation = [[UILabel alloc] init];
|
||||
_intratemporalSequencignation.text = @"5S";
|
||||
_intratemporalSequencignation.font = [UIFont systemFontOfSize:15];
|
||||
_intratemporalSequencignation.textColor = UIColorFromRGB(0xFFFEFE);
|
||||
}
|
||||
return _intratemporalSequencignation;
|
||||
}
|
||||
|
||||
- (UIView *)cutIntratemporalEncourageRegard {
|
||||
if (!_cutIntratemporalEncourageRegard) {
|
||||
_cutIntratemporalEncourageRegard = [[UIView alloc] init];
|
||||
_cutIntratemporalEncourageRegard.backgroundColor = UIColorRGBAlpha(0x000000, 0.3);
|
||||
_cutIntratemporalEncourageRegard.layer.masksToBounds = YES;
|
||||
_cutIntratemporalEncourageRegard.layer.cornerRadius = 25/2;
|
||||
_cutIntratemporalEncourageRegard.hidden = YES;
|
||||
}
|
||||
return _cutIntratemporalEncourageRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)concludeBtuton {
|
||||
if (!_concludeBtuton) {
|
||||
_concludeBtuton = [UIButton buttonWithType: UIButtonTypeCustom];
|
||||
[_concludeBtuton setImage:[UIImage imageNamed:@"yumi_same_close_white"] forState:UIControlStateNormal];
|
||||
[_concludeBtuton addTarget:self action:@selector(concludetBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_concludeBtuton setEnlargeEdgeAboutApex:10 right:10 bottom:10 left:10];
|
||||
}
|
||||
return _concludeBtuton;
|
||||
}
|
||||
|
||||
- (UIView *)burlywoodRegard {
|
||||
if (!_burlywoodRegard) {
|
||||
_burlywoodRegard = [[UIView alloc] init];
|
||||
_burlywoodRegard.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
return _burlywoodRegard;
|
||||
}
|
||||
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)engagementSvgaIndicateRegard {
|
||||
if (!_engagementSvgaIndicateRegard) {
|
||||
_engagementSvgaIndicateRegard = [[SVGAImageView alloc]init];
|
||||
_engagementSvgaIndicateRegard.backgroundColor = [UIColor clearColor];
|
||||
_engagementSvgaIndicateRegard.frame = self.bounds;
|
||||
_engagementSvgaIndicateRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _engagementSvgaIndicateRegard;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// YMRoomLuckyBigPrizeView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/15.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class YUMIPresentBigCaptureMatrix, YUMIChamberFortunateBigCaptureRegard;
|
||||
@protocol FBCChamberLuckyBigPrizeRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)yUMIChamberInthecaseoftuntowardseConsiderableCaptureRegard:(YUMIChamberFortunateBigCaptureRegard *)view luckyGiftInfo:(YUMIPresentBigCaptureMatrix *)giftInfo;
|
||||
|
||||
@end
|
||||
|
||||
@interface YUMIChamberFortunateBigCaptureRegard : UIView
|
||||
@property (nonatomic,strong) YUMIPresentBigCaptureMatrix *giftInfo;
|
||||
@property (nonatomic,weak) id<FBCChamberLuckyBigPrizeRegardRepresendtation> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// YMRoomGraffitiGiftAnimationView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/8/23.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class YUMIChamberGraffitiPresentBrightnessRegard, AttachmentMatrix;
|
||||
@protocol FBCChamberGraffitiPresentAnimationRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)yUMIChamberDoodlePresentBrectifynessRegardImplementtowardsion:(YUMIChamberGraffitiPresentBrightnessRegard *)view attachment:(AttachmentMatrix *)attachment;
|
||||
|
||||
@end
|
||||
|
||||
@interface YUMIChamberGraffitiPresentBrightnessRegard : UIView
|
||||
@property (nonatomic,strong) UIImage *presentIndicate;
|
||||
@property (nonatomic,weak) id<FBCChamberGraffitiPresentAnimationRegardRepresendtation> delegate;
|
||||
@property (nonatomic,strong) NSArray *speckGarment;
|
||||
@property (nonatomic,strong) AttachmentMatrix *model;
|
||||
- (void)institutePaletteBrectifyness;
|
||||
- (void)concludePaletteBrectifyness;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,89 +0,0 @@
|
||||
//
|
||||
// YMRoomEnterHideTipView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/4/26.
|
||||
//
|
||||
|
||||
#import "YUMIChamberImportHideTipRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
@interface YUMIChamberImportHideTipRegard()
|
||||
|
||||
@property (nonatomic,strong) UIView *backgroundRegard;
|
||||
@property (nonatomic,strong) UIImageView *figureIndicateRegard;
|
||||
@property (nonatomic, strong) UILabel *sequenceSequencignation;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberImportHideTipRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backgroundRegard];
|
||||
[self.backgroundRegard addSubview:self.figureIndicateRegard];
|
||||
[self.backgroundRegard addSubview:self.sequenceSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.backgroundRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(190);
|
||||
make.height.mas_equalTo(48);
|
||||
}];
|
||||
[self.figureIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backgroundRegard).mas_offset(12);
|
||||
make.centerY.mas_equalTo(self.backgroundRegard);
|
||||
make.width.height.mas_equalTo(32);
|
||||
}];
|
||||
[self.sequenceSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.figureIndicateRegard.mas_right).mas_offset(8);
|
||||
make.centerY.mas_equalTo(self.backgroundRegard);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)backgroundRegard {
|
||||
if (!_backgroundRegard) {
|
||||
_backgroundRegard = [[UIView alloc] init];
|
||||
_backgroundRegard.backgroundColor = UIColorRGBAlpha(0x000000, 0.5);
|
||||
_backgroundRegard.layer.cornerRadius = 24;
|
||||
_backgroundRegard.layer.masksToBounds = YES;
|
||||
}
|
||||
return _backgroundRegard;
|
||||
}
|
||||
|
||||
- (UIImageView *)figureIndicateRegard {
|
||||
if (!_figureIndicateRegard) {
|
||||
_figureIndicateRegard = [[UIImageView alloc] init];
|
||||
_figureIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_enterRoom_hide"];
|
||||
}
|
||||
return _figureIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)sequenceSequencignation {
|
||||
if (!_sequenceSequencignation) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:14];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = @"你已隐身进入房间~";
|
||||
_sequenceSequencignation = label;
|
||||
}
|
||||
return _sequenceSequencignation;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,169 +0,0 @@
|
||||
//
|
||||
// YMRoomAnchorRankBannerView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/4/15.
|
||||
//
|
||||
|
||||
#import "YUMIChamberKellegRateOriflammeRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "ChamberHalfHourRateMatrix.h"
|
||||
#import "NetIndicateRegard.h"
|
||||
|
||||
@interface YUMIChamberKellegRateOriflammeRegard()
|
||||
|
||||
@property (nonatomic,strong) UIImageView *backgroundIndicateRegard;
|
||||
@property (nonatomic,strong) UIImageView *figureIndicateRegard;
|
||||
@property (nonatomic,strong) NetIndicateRegard *avatIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UILabel *monicerSequencignation;
|
||||
@property (nonatomic, strong) UILabel *sequenceSequencignation;
|
||||
@property (nonatomic, strong) UILabel *rateSequencignation;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberKellegRateOriflammeRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backgroundIndicateRegard];
|
||||
[self addSubview:self.figureIndicateRegard];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.avatIndicateRegard];
|
||||
[self addSubview:self.monicerSequencignation];
|
||||
[self addSubview:self.sequenceSequencignation];
|
||||
[self addSubview:self.rateSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.backgroundIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(360);
|
||||
make.height.mas_equalTo(50);
|
||||
}];
|
||||
[self.figureIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backgroundIndicateRegard).mas_offset(-14);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(61);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.figureIndicateRegard.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.backgroundIndicateRegard).mas_offset(2);
|
||||
}];
|
||||
[self.avatIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
make.width.height.mas_equalTo(22);
|
||||
}];
|
||||
[self.monicerSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatIndicateRegard.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
[self.sequenceSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.monicerSequencignation.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
[self.rateSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.sequenceSequencignation.mas_right);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setKellegRateAbstract:(ChamberHalfHourRateMatrix *)kellegRateAbstract {
|
||||
_kellegRateAbstract = kellegRateAbstract;
|
||||
if (kellegRateAbstract) {
|
||||
self.avatIndicateRegard.imageUrl = _kellegRateAbstract.avatar;
|
||||
NSString *nick = _kellegRateAbstract.nick;
|
||||
if(nick.length > 4) {
|
||||
nick = [NSString stringWithFormat:@"%@…", [nick substringToIndex:4]];
|
||||
}
|
||||
self.monicerSequencignation.text = nick;
|
||||
self.sequenceSequencignation.text = _kellegRateAbstract.desc;
|
||||
}
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIImageView *)backgroundIndicateRegard {
|
||||
if (!_backgroundIndicateRegard) {
|
||||
_backgroundIndicateRegard = [[UIImageView alloc] init];
|
||||
_backgroundIndicateRegard.image = [UIImage imageNamed:@"yumi_anchor_hour_order_background"];
|
||||
}
|
||||
return _backgroundIndicateRegard;
|
||||
}
|
||||
|
||||
- (UIImageView *)figureIndicateRegard {
|
||||
if (!_figureIndicateRegard) {
|
||||
_figureIndicateRegard = [[UIImageView alloc] init];
|
||||
_figureIndicateRegard.image = [UIImage imageNamed:@"yumi_anchor_hour_order_pic"];
|
||||
}
|
||||
return _figureIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = YMLocalizedString(@"YUMI_Room_Anchor_Rank_Banner_View_0");
|
||||
_titleLabel = label;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (NetIndicateRegard *)avatIndicateRegard {
|
||||
if (!_avatIndicateRegard) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_avatIndicateRegard = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
_avatIndicateRegard.layer.masksToBounds = YES;
|
||||
_avatIndicateRegard.layer.cornerRadius = 11;
|
||||
}
|
||||
return _avatIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)monicerSequencignation {
|
||||
if (!_monicerSequencignation) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
|
||||
label.textColor = UIColorFromRGB(0xFFFC2C);
|
||||
_monicerSequencignation = label;
|
||||
}
|
||||
return _monicerSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)sequenceSequencignation {
|
||||
if (!_sequenceSequencignation) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightHeavy];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
_sequenceSequencignation = label;
|
||||
}
|
||||
return _sequenceSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)rateSequencignation {
|
||||
if (!_rateSequencignation) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:13 weight:UIFontWeightHeavy];
|
||||
label.textColor = UIColorFromRGB(0xFFFC2C);
|
||||
label.text = @"TOP1";
|
||||
_rateSequencignation = label;
|
||||
}
|
||||
return _rateSequencignation;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// YMRoomLicneseHourRankView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/13.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ChamberHalfHourRateMatrix, YUMIChamberLicneseHourRateRegard;
|
||||
@protocol FBCChamberLicneseHourRankRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)yUMIChamberLicneseStundeRtowardseRegard:(YUMIChamberLicneseHourRateRegard *)view rateAbstract:(ChamberHalfHourRateMatrix *)rateAbstract;
|
||||
|
||||
@end
|
||||
@interface YUMIChamberLicneseHourRateRegard : UIView
|
||||
@property (nonatomic,copy) ChamberHalfHourRateMatrix * licneseRateAbstract;
|
||||
@property (nonatomic,weak) id<FBCChamberLicneseHourRankRegardRepresendtation> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,126 +0,0 @@
|
||||
//
|
||||
// YMRoomLicneseHourRankView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/6/13.
|
||||
//
|
||||
|
||||
#import "YUMIChamberLicneseHourRateRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ChamberHalfHourRateMatrix.h"
|
||||
|
||||
@interface YUMIChamberLicneseHourRateRegard ()
|
||||
|
||||
@property (nonatomic,strong) UIImageView *encourageIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UIButton *importBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberLicneseHourRateRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.encourageIndicateRegard];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.importBtuton];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.encourageIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(64);
|
||||
make.right.mas_equalTo(self.importBtuton.mas_left).offset(-5);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.importBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(44, 20));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(self).offset(-6);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)encourageBetowardsRecognition {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberLicneseStundeRtowardseRegard:rateAbstract:)]) {
|
||||
[self.delegate yUMIChamberLicneseStundeRtowardseRegard:self rateAbstract:self.licneseRateAbstract];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setLicneseRateAbstract:(ChamberHalfHourRateMatrix *)licneseRateAbstract {
|
||||
_licneseRateAbstract = licneseRateAbstract;
|
||||
if (_licneseRateAbstract) {
|
||||
NSString *nick = _licneseRateAbstract.title;
|
||||
if(nick.length > 6) {
|
||||
nick = [NSString stringWithFormat:@"%@", [nick substringToIndex:6]];
|
||||
}
|
||||
NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[UIColor whiteColor]};
|
||||
NSDictionary * hightDic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor aplictowardsionMainPrettify]};
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"YUMI_Room_Licnese_Hour_Rank_View_0") attributes:dic]];
|
||||
if (nick.length > 0) {
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:hightDic]];
|
||||
}
|
||||
|
||||
if (licneseRateAbstract.desc.length > 0) {
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:licneseRateAbstract.desc attributes:dic]];
|
||||
}
|
||||
[attribute appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@"TOP1" attributes:hightDic]];
|
||||
self.titleLabel.attributedText = attribute;
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)encourageIndicateRegard {
|
||||
if (!_encourageIndicateRegard) {
|
||||
_encourageIndicateRegard = [[UIImageView alloc] init];
|
||||
_encourageIndicateRegard.userInteractionEnabled = YES;
|
||||
_encourageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_licnese_hour_order_background"];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(encourageBetowardsRecognition)];
|
||||
[_encourageIndicateRegard addGestureRecognizer:tap];
|
||||
}
|
||||
return _encourageIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.numberOfLines = 2;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)importBtuton {
|
||||
if (!_importBtuton) {
|
||||
_importBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_importBtuton setTitle:YMLocalizedString(@"YUMI_Room_Licnese_Hour_Rank_View_1") forState:UIControlStateNormal];
|
||||
[_importBtuton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_importBtuton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
[_importBtuton setBackgroundImage:[UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[UIColorFromRGB(0xd93d5f), UIColorFromRGB(0xfff494)] gradientType:GradientGenreTopToBottom imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_importBtuton.layer.masksToBounds = YES;
|
||||
_importBtuton.layer.cornerRadius = 10;
|
||||
_importBtuton.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
_importBtuton.layer.borderWidth = 0.5;
|
||||
_importBtuton.userInteractionEnabled = NO;
|
||||
}
|
||||
return _importBtuton;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,156 +0,0 @@
|
||||
//
|
||||
// YMRoomNobleLevelUpView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/1/10.
|
||||
//
|
||||
|
||||
#import "YUMIChamberMagnificentPrototypeUpwardsRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "NetIndicateRegard.h"
|
||||
#import <YYText/YYText.h>
|
||||
|
||||
@interface YUMIChamberMagnificentPrototypeUpwardsRegard ()
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
|
||||
@property (nonatomic,strong) SVGAImageView *magnificentRegard;
|
||||
|
||||
@property (nonatomic, strong) UILabel *thresholdSequencignation;
|
||||
@property (nonatomic, strong) NetIndicateRegard *imageView;
|
||||
@property (nonatomic, strong) UILabel *instantSequencignation;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation YUMIChamberMagnificentPrototypeUpwardsRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.magnificentRegard];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.magnificentRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(90);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSMutableAttributedString *)produceIdiosyncracy:(NSString * )text color:(UIColor *)color {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:22], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setMagnificentAbstract:(NSDictionary *)magnificentAbstract {
|
||||
_magnificentAbstract = magnificentAbstract;
|
||||
self.imageView.imageUrl = magnificentAbstract[@"avatar"];
|
||||
|
||||
if (magnificentAbstract) {
|
||||
@kWeakify(self);
|
||||
[self.anatomiser parseWithURL:[NSURL URLWithString:magnificentAbstract[@"floatPic"]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@kStrongify(self);
|
||||
self.magnificentRegard.loops = 1;
|
||||
self.magnificentRegard.clearsAfterStop = NO;
|
||||
self.magnificentRegard.videoItem = videoItem;
|
||||
[self.magnificentRegard startAnimation];
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
|
||||
[self.magnificentRegard setDrawingBlock:^(CALayer *contentLayer, NSInteger frameIndex) {
|
||||
@kStrongify(self);
|
||||
CGFloat height = contentLayer.bounds.size.height;
|
||||
CGFloat totalWidth = 0;
|
||||
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:@"引爆全场!恭喜 " color:[UIColor whiteColor]]];
|
||||
CGFloat width1 = [attribute.string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:22]} context:nil].size.width;
|
||||
self.thresholdSequencignation.attributedText = attribute;
|
||||
|
||||
NSMutableAttributedString * attribute1 = [[NSMutableAttributedString alloc] init];
|
||||
[attribute1 appendAttributedString:[self produceIdiosyncracy:@" " color:[DJDKMIMOMColor presentBroadcastDigitalPrettify]]];
|
||||
[attribute1 appendAttributedString:[self produceIdiosyncracy:magnificentAbstract[@"nick"] color:[DJDKMIMOMColor presentBroadcastDigitalPrettify]]];
|
||||
[attribute1 appendAttributedString:[self produceIdiosyncracy:@" " color:[DJDKMIMOMColor presentBroadcastDigitalPrettify]]];
|
||||
[attribute1 appendAttributedString:[self produceIdiosyncracy:[NSString stringWithFormat:@"贵族身份升级为%@!", magnificentAbstract[@"currVipName"]] color:[UIColor whiteColor]]];
|
||||
CGFloat width2 = [attribute1.string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:22]} context:nil].size.width;
|
||||
self.instantSequencignation.attributedText = attribute1;
|
||||
|
||||
totalWidth += ((width1 + width2) * 12/22 + 50);
|
||||
CGFloat originL = (KScreenWidth - (totalWidth > KScreenWidth ? KScreenWidth : totalWidth)) * 0.5;
|
||||
if (KScreenHeight != 667) {
|
||||
self.thresholdSequencignation.layer.frame = CGRectMake(originL, 0, width1, height);
|
||||
[contentLayer addSublayer:self.thresholdSequencignation.layer];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:self.imageView.image];
|
||||
imageView.layer.frame = CGRectMake(originL + width1, (height - 50) * 0.5, 50, 50);
|
||||
imageView.layer.cornerRadius = 25.0f;
|
||||
imageView.layer.masksToBounds = YES;
|
||||
[contentLayer addSublayer:imageView.layer];
|
||||
self.instantSequencignation.layer.frame = CGRectMake(originL + width1 + 50, 0, width2, height);
|
||||
[contentLayer addSublayer:self.instantSequencignation.layer];
|
||||
} else {
|
||||
totalWidth -= 50;
|
||||
CGFloat originL = (KScreenWidth - (totalWidth > KScreenWidth ? KScreenWidth : totalWidth)) * 0.5;
|
||||
self.thresholdSequencignation.layer.frame = CGRectMake(originL, 0, width1, height);
|
||||
[contentLayer addSublayer:self.thresholdSequencignation.layer];
|
||||
self.instantSequencignation.layer.frame = CGRectMake(originL + width1, 0, width2, height);
|
||||
[contentLayer addSublayer:self.instantSequencignation.layer];
|
||||
}
|
||||
} forKey:@"noble_text_tx"];
|
||||
}
|
||||
}
|
||||
|
||||
- (SVGAImageView *)magnificentRegard {
|
||||
if (!_magnificentRegard) {
|
||||
_magnificentRegard = [[SVGAImageView alloc]init];
|
||||
_magnificentRegard.backgroundColor = [UIColor clearColor];
|
||||
_magnificentRegard.userInteractionEnabled = NO;
|
||||
}
|
||||
return _magnificentRegard;
|
||||
}
|
||||
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
}
|
||||
|
||||
- (UILabel *)thresholdSequencignation {
|
||||
if (!_thresholdSequencignation) {
|
||||
_thresholdSequencignation = [[UILabel alloc] init];
|
||||
}
|
||||
return _thresholdSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)instantSequencignation{
|
||||
if (!_instantSequencignation) {
|
||||
_instantSequencignation = [[UILabel alloc] init];
|
||||
}
|
||||
return _instantSequencignation;
|
||||
}
|
||||
|
||||
- (NetIndicateRegard *)imageView {
|
||||
if (!_imageView) {
|
||||
NetIndicateDisposition *config = [[NetIndicateDisposition alloc]init];
|
||||
config.deparatmentMaintainrietary = [UIIndicateConstant deficiencyIntelligenceportraitDepapossessor];
|
||||
config.autoChamber = YES;
|
||||
_imageView = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
}
|
||||
return _imageView;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,109 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftCompoundView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/8/5.
|
||||
//
|
||||
|
||||
#import "YUMIChamberPresentCompoundRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "YUMIPresentCompoundMatrix.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
@interface YUMIChamberPresentCompoundRegard ()
|
||||
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
@property (nonatomic,strong) SVGAImageView *compoundPresentRegard;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberPresentCompoundRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.compoundPresentRegard];
|
||||
[self addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.compoundPresentRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.compoundPresentRegard);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSAttributedString *)produceIdiosyncracy:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setCompoundPresentAbstract:(NSDictionary *)compoundPresentAbstract {
|
||||
if (compoundPresentAbstract) {
|
||||
YUMIPresentCompoundMatrix * giftInfo = [YUMIPresentCompoundMatrix mtowardsrixAboutImpactbasket:compoundPresentAbstract];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
CGFloat fontSize = 22;
|
||||
NSString *nickStr = giftInfo.nick;
|
||||
if (nickStr.length > 6) {
|
||||
nickStr = [NSString stringWithFormat:@"%@…", [giftInfo.nick substringToIndex:6]];
|
||||
}
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:YMLocalizedString(@"YUMI_Room_Gift_Compound_View_0") color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:nickStr color:[DJDKMIMOMColor communictowardsionMonicerPrettify] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:giftInfo.msg color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self produceIdiosyncracy:giftInfo.giftName color:[DJDKMIMOMColor communictowardsionMonicerPrettify] fontSize:fontSize]];
|
||||
|
||||
@kWeakify(self);
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/compound_gift_banner.svga", API_Image_URL];
|
||||
[self.anatomiser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.compoundPresentRegard.loops = 1;
|
||||
self.compoundPresentRegard.clearsAfterStop = NO;
|
||||
self.compoundPresentRegard.videoItem = videoItem;
|
||||
[self.compoundPresentRegard setAttributedText:attribute forKey:@"noble_text_tx"];
|
||||
[self.compoundPresentRegard startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (SVGAImageView *)compoundPresentRegard {
|
||||
if (!_compoundPresentRegard) {
|
||||
_compoundPresentRegard = [[SVGAImageView alloc]init];
|
||||
_compoundPresentRegard.backgroundColor = [UIColor clearColor];
|
||||
_compoundPresentRegard.userInteractionEnabled = NO;
|
||||
}
|
||||
return _compoundPresentRegard;
|
||||
}
|
||||
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class PresentAchieveAbstractMatrix, YUMIPresentOriflammeConsumerAbstractMatrix;
|
||||
@interface YUMIChamberPresentOriflammeRegard : UIView
|
||||
- (void)prohibitipositionPresentOriflamme:(PresentAchieveAbstractMatrix *)receiveInfo users:(NSArray<YUMIPresentOriflammeConsumerAbstractMatrix *> *)users;
|
||||
- (void)resetData;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,337 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "YUMIChamberPresentOriflammeRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "PresentAchieveAbstractMatrix.h"
|
||||
#import "PresentAbstractMatrix.h"
|
||||
#import "YUMIPresentOriflammeConsumerAbstractMatrix.h"
|
||||
#import "NetIndicateRegard.h"
|
||||
|
||||
@interface YUMIChamberAvatarNickRegard : UIView
|
||||
@property (nonatomic,strong) NetIndicateRegard *avatIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *monicerSequencignation;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberAvatarNickRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
self.avatIndicateRegard.layer.cornerRadius = self.avatIndicateRegard.bounds.size.width / 2;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.avatIndicateRegard];
|
||||
[self addSubview:self.monicerSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.monicerSequencignation.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.avatIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(self.avatIndicateRegard.mas_width);
|
||||
}];
|
||||
|
||||
[self.monicerSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.avatIndicateRegard.mas_bottom).offset(2);
|
||||
make.width.mas_lessThanOrEqualTo(80);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (NetIndicateRegard *)avatIndicateRegard {
|
||||
if (!_avatIndicateRegard) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_avatIndicateRegard = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
_avatIndicateRegard.userInteractionEnabled = YES;
|
||||
_avatIndicateRegard.layer.masksToBounds = YES;
|
||||
}
|
||||
return _avatIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)monicerSequencignation {
|
||||
if (!_monicerSequencignation) {
|
||||
_monicerSequencignation = [[UILabel alloc] init];
|
||||
_monicerSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_monicerSequencignation.textColor = [UIColor whiteColor];
|
||||
_monicerSequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _monicerSequencignation;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface YUMIChamberPresentOriflammeRegard ()
|
||||
@property (nonatomic,strong) UIImageView *encourageIndicateRegard;
|
||||
@property (nonatomic,strong) YUMIChamberAvatarNickRegard *dischargeRegard;
|
||||
@property (nonatomic,strong) YUMIChamberAvatarNickRegard *achieveRegard;
|
||||
@property (nonatomic,strong) YUMIChamberAvatarNickRegard *presentRegard;
|
||||
@property (nonatomic,strong) UIImageView *lightIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *presentComputationSequencignation;
|
||||
@property (nonatomic,strong) UILabel *dischargeSequencignation;
|
||||
@end
|
||||
|
||||
|
||||
@implementation YUMIChamberPresentOriflammeRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.encourageIndicateRegard];
|
||||
|
||||
[self.encourageIndicateRegard addSubview:self.dischargeRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.dischargeSequencignation];
|
||||
[self.encourageIndicateRegard addSubview:self.achieveRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.lightIndicateRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.presentRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.presentComputationSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.encourageIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.dischargeRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.encourageIndicateRegard).offset(49);
|
||||
make.top.equalTo(self).offset(49);
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
[self.dischargeSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.dischargeRegard.mas_right).offset(24);
|
||||
make.centerY.equalTo(self.dischargeRegard);
|
||||
}];
|
||||
|
||||
[self.achieveRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.dischargeSequencignation.mas_right).offset(24);
|
||||
make.centerY.width.equalTo(self.dischargeRegard);
|
||||
}];
|
||||
|
||||
[self.lightIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.achieveRegard.mas_right).offset(4);
|
||||
make.centerY.equalTo(self.dischargeRegard);
|
||||
make.width.height.equalTo(@100);
|
||||
}];
|
||||
|
||||
[self.presentRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.equalTo(self.dischargeRegard);
|
||||
make.center.equalTo(self.lightIndicateRegard);
|
||||
}];
|
||||
|
||||
|
||||
[self.presentComputationSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.presentRegard);
|
||||
make.right.equalTo(self.encourageIndicateRegard).offset(-36);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)inititowardseShiningCircleBrectifyness {
|
||||
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
||||
animation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
|
||||
animation.duration = 1;
|
||||
animation.cumulative = YES;
|
||||
animation.repeatCount = MAXFLOAT;
|
||||
[self.lightIndicateRegard.layer addAnimation:animation forKey:@"rotationAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)resetData {
|
||||
self.dischargeRegard.avatIndicateRegard.image = nil;
|
||||
self.dischargeRegard.monicerSequencignation.text = nil;
|
||||
self.achieveRegard.avatIndicateRegard.image = nil;
|
||||
self.achieveRegard.monicerSequencignation.text = nil;
|
||||
self.presentRegard.avatIndicateRegard.image = nil;
|
||||
self.presentRegard.monicerSequencignation.text = nil;
|
||||
self.presentComputationSequencignation.text = nil;
|
||||
[self.lightIndicateRegard stopAnimating];
|
||||
}
|
||||
|
||||
- (void)prohibitipositionPresentOriflamme:(PresentAchieveAbstractMatrix *)receiveInfo users:(NSArray<YUMIPresentOriflammeConsumerAbstractMatrix *> *)users {
|
||||
if (receiveInfo) {
|
||||
[self inititowardseShiningCircleBrectifyness];
|
||||
NSInteger giftTotal = 0;
|
||||
PresentAbstractMatrix *giftInfo = receiveInfo.gift;
|
||||
self.dischargeRegard.avatIndicateRegard.imageUrl = receiveInfo.avatar;
|
||||
self.dischargeRegard.monicerSequencignation.text = receiveInfo.nick;
|
||||
|
||||
self.presentRegard.avatIndicateRegard.imageUrl = giftInfo.giftUrl;
|
||||
self.presentRegard.monicerSequencignation.text = giftInfo.giftName;
|
||||
|
||||
self.presentComputationSequencignation.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum];
|
||||
|
||||
if (receiveInfo.targetUsers.count > 0) {
|
||||
if (receiveInfo.isBatch) {
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUsers;
|
||||
for (PresentAchieveConsumerAbstractMatrix *targetUid in targetUids) {
|
||||
NSInteger position = [self prohibiticoveryPolariztowardsionByCid:targetUid.uid users:users];
|
||||
if (position == 0) {
|
||||
continue;
|
||||
}
|
||||
position += 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"YUMI_Room_Gift_Banner_View_0"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"YUMI_Room_Gift_Banner_View_1"), position];
|
||||
}
|
||||
}
|
||||
if (receiveInfo.targetUsers.count == 1) {
|
||||
self.achieveRegard.monicerSequencignation.text = [receiveInfo.targetUsers firstObject].nick;
|
||||
self.achieveRegard.avatIndicateRegard.imageUrl = [receiveInfo.targetUsers firstObject].avatar;
|
||||
} else {
|
||||
self.achieveRegard.avatIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_all_mic"];
|
||||
self.achieveRegard.monicerSequencignation.text = subTitle;
|
||||
}
|
||||
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
} else {
|
||||
self.achieveRegard.avatIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_all_mic"];
|
||||
self.achieveRegard.monicerSequencignation.text = YMLocalizedString(@"YUMI_Room_Gift_Banner_View_2");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
}
|
||||
}else if (receiveInfo.targetUids.count > 0) {
|
||||
if (receiveInfo.isBatch) {
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUids;
|
||||
for (NSString * targetUid in targetUids) {
|
||||
NSInteger position = [self prohibiticoveryPolariztowardsionByCid:targetUid.integerValue users:users];
|
||||
if (position == 0) {
|
||||
continue;
|
||||
}
|
||||
position+= 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"YUMI_Room_Gift_Banner_View_3"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"YUMI_Room_Gift_Banner_View_4"), position];
|
||||
}
|
||||
}
|
||||
self.achieveRegard.avatIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_all_mic"];
|
||||
self.achieveRegard.monicerSequencignation.text = subTitle;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
} else {
|
||||
self.achieveRegard.avatIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_all_mic"];
|
||||
self.achieveRegard.monicerSequencignation.text = YMLocalizedString(@"YUMI_Room_Gift_Banner_View_5");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
}
|
||||
}else {
|
||||
self.achieveRegard.avatIndicateRegard.imageUrl = receiveInfo.targetAvatar;
|
||||
self.achieveRegard.monicerSequencignation.text = receiveInfo.targetNick;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice;
|
||||
}
|
||||
[self prohibitipositionAnimtowardseIndictowardseByPresentGeneral:giftTotal];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prohibitipositionAnimtowardseIndictowardseByPresentGeneral:(NSInteger)giftTotal {
|
||||
if (giftTotal >= 520 && giftTotal < 4999) {
|
||||
self.encourageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_banner_low_background"];
|
||||
}else if (giftTotal >= 4999 && giftTotal < 9999) {
|
||||
self.encourageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_banner_middle_background"];
|
||||
}else if (giftTotal >= 9999) {
|
||||
self.encourageIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_banner_high_background"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (int)prohibiticoveryPolariztowardsionByCid:(NSInteger)uid users:(NSArray<YUMIPresentOriflammeConsumerAbstractMatrix *> *)users{
|
||||
if (uid > 0) {
|
||||
for (YUMIPresentOriflammeConsumerAbstractMatrix *userInfo in users) {
|
||||
if (userInfo.uid == uid) {
|
||||
return userInfo.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
|
||||
- (UIImageView *)encourageIndicateRegard {
|
||||
if (!_encourageIndicateRegard) {
|
||||
_encourageIndicateRegard = [[UIImageView alloc] init];
|
||||
_encourageIndicateRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _encourageIndicateRegard;
|
||||
}
|
||||
|
||||
- (YUMIChamberAvatarNickRegard *)dischargeRegard {
|
||||
if (!_dischargeRegard) {
|
||||
_dischargeRegard = [[YUMIChamberAvatarNickRegard alloc] init];
|
||||
}
|
||||
return _dischargeRegard;
|
||||
}
|
||||
|
||||
- (YUMIChamberAvatarNickRegard *)achieveRegard {
|
||||
if (!_achieveRegard) {
|
||||
_achieveRegard = [[YUMIChamberAvatarNickRegard alloc] init];
|
||||
}
|
||||
return _achieveRegard;
|
||||
}
|
||||
|
||||
- (YUMIChamberAvatarNickRegard *)presentRegard {
|
||||
if (!_presentRegard) {
|
||||
_presentRegard = [[YUMIChamberAvatarNickRegard alloc] init];
|
||||
}
|
||||
return _presentRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)dischargeSequencignation {
|
||||
if (!_dischargeSequencignation) {
|
||||
_dischargeSequencignation = [[UILabel alloc] init];
|
||||
_dischargeSequencignation.text = YMLocalizedString(@"YUMI_Room_Gift_Banner_View_6");
|
||||
_dischargeSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_dischargeSequencignation.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _dischargeSequencignation;
|
||||
}
|
||||
|
||||
- (UIImageView *)lightIndicateRegard {
|
||||
if (!_lightIndicateRegard) {
|
||||
_lightIndicateRegard = [[UIImageView alloc] init];
|
||||
_lightIndicateRegard.userInteractionEnabled = YES;
|
||||
_lightIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_banner_light"];
|
||||
}
|
||||
return _lightIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)presentComputationSequencignation {
|
||||
if (!_presentComputationSequencignation) {
|
||||
_presentComputationSequencignation = [[UILabel alloc] init];
|
||||
_presentComputationSequencignation.font = [UIFont systemFontOfSize:20.f weight:UIFontWeightBold];
|
||||
_presentComputationSequencignation.textColor = [DJDKMIMOMColor brectifynessPresentDigitalPrettify];
|
||||
}
|
||||
return _presentComputationSequencignation;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBroadcastView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
// 广播横幅
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class YUMIChamberPresentBroadCastMatrix, YUMIChamberPresentPingbackRegard;
|
||||
|
||||
@protocol FBCChamberPresentPingbackRegardRepresendtation <NSObject>
|
||||
- (void)yUMIChamberPresentBroadcastRegard:(YUMIChamberPresentPingbackRegard *)view didClickClose:(YUMIChamberPresentBroadCastMatrix *)pingencourageMatrix;
|
||||
- (void)yUMIChamberPresentBroadcastRegard:(YUMIChamberPresentPingbackRegard *)view enterRoom:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
@interface YUMIChamberPresentPingbackRegard : UIView
|
||||
@property (nonatomic,strong) YUMIChamberPresentBroadCastMatrix *pingencourageMatrix;
|
||||
|
||||
@property (nonatomic,weak) id<FBCChamberPresentPingbackRegardRepresendtation> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,401 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBroadcastView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "YUMIChamberPresentPingbackRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIChamberPresentBroadCastMatrix.h"
|
||||
#import "NetIndicateRegard.h"
|
||||
#import "YUMIChamberYearImportpriseRegard.h"
|
||||
|
||||
#define kScreenScale (CGFloat)KScreenWidth / (CGFloat)375
|
||||
|
||||
@interface YUMIChamberExternalizeConsumerRegard : UIView
|
||||
|
||||
@property (nonatomic,strong) NetIndicateRegard *intelligenceportraitIndicateRegard;
|
||||
@property (nonatomic,strong) UIImageView *boraderIndicateRegard;
|
||||
@property (nonatomic,strong) UIButton *monicerBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberExternalizeConsumerRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.intelligenceportraitIndicateRegard];
|
||||
[self addSubview:self.boraderIndicateRegard];
|
||||
[self addSubview:self.monicerBtuton];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.monicerBtuton.mas_bottom);
|
||||
}];
|
||||
|
||||
|
||||
[self.intelligenceportraitIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.top.mas_equalTo(self);
|
||||
make.height.width.mas_equalTo(44 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.boraderIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(51 * kScreenScale, 51 * kScreenScale));
|
||||
make.center.mas_equalTo(self.intelligenceportraitIndicateRegard);
|
||||
}];
|
||||
|
||||
[self.monicerBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.intelligenceportraitIndicateRegard.mas_bottom).offset(-8 * kScreenScale);
|
||||
make.size.mas_equalTo(CGSizeMake(66 * kScreenScale, 16 * kScreenScale));
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (NetIndicateRegard *)intelligenceportraitIndicateRegard {
|
||||
if (!_intelligenceportraitIndicateRegard) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_intelligenceportraitIndicateRegard = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
_intelligenceportraitIndicateRegard.userInteractionEnabled = YES;
|
||||
_intelligenceportraitIndicateRegard.layer.masksToBounds = YES;
|
||||
_intelligenceportraitIndicateRegard.layer.cornerRadius = 44 * kScreenScale/2;
|
||||
}
|
||||
return _intelligenceportraitIndicateRegard;
|
||||
}
|
||||
|
||||
- (UIImageView *)boraderIndicateRegard {
|
||||
if (!_boraderIndicateRegard) {
|
||||
_boraderIndicateRegard = [[UIImageView alloc] init];
|
||||
_boraderIndicateRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _boraderIndicateRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)monicerBtuton {
|
||||
if (!_monicerBtuton) {
|
||||
_monicerBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_monicerBtuton setTitleColor:[DJDKMIMOMColor presentBroadcastMonicerPrettify] forState:UIControlStateNormal];
|
||||
_monicerBtuton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
[_monicerBtuton setBackgroundImage:[UIImage imageNamed:@"yumi_scope_present_broadcast_avatar_board"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _monicerBtuton;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface YUMIChamberPresentPingbackRegard ()<FBCChamberYearActivityRegardRepresendtation>
|
||||
@property (nonatomic,strong) UIImageView *encourageIndicateRegard;
|
||||
@property (nonatomic,strong) YUMIChamberExternalizeConsumerRegard *dischargeRegard;
|
||||
@property (nonatomic,strong) UIImageView *dischargeIndicateRegard;
|
||||
@property (nonatomic,strong) YUMIChamberExternalizeConsumerRegard *achieveRegard;
|
||||
@property (nonatomic,strong) NetIndicateRegard *presentIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *computationSequencignation;
|
||||
@property (nonatomic,strong) UIButton *concludeBtuton;
|
||||
@property (nonatomic,strong) UILabel *chamberIdSequencignation;
|
||||
@property (nonatomic, strong) YUMIChamberYearImportpriseRegard *ceremonyRegard;
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberPresentPingbackRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[self initOccurrences];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Response
|
||||
- (void)concludeBtutonPerformance:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberPresentBroadcastRegard:didClickClose:)]) {
|
||||
[self.delegate yUMIChamberPresentBroadcastRegard:self didClickClose:self.pingencourageMatrix];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didTicktackImportChamber {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberPresentBroadcastRegard:enterRoom:)]) {
|
||||
[self.delegate yUMIChamberPresentBroadcastRegard:self enterRoom:[NSString stringWithFormat:@"%ld", self.pingencourageMatrix.roomUid]];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.encourageIndicateRegard];
|
||||
|
||||
[self.encourageIndicateRegard addSubview:self.concludeBtuton];
|
||||
[self.encourageIndicateRegard addSubview:self.dischargeRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.dischargeIndicateRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.achieveRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.presentIndicateRegard];
|
||||
[self.encourageIndicateRegard addSubview:self.computationSequencignation];
|
||||
[self.encourageIndicateRegard addSubview:self.chamberIdSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
CGFloat kscale = (CGFloat)125/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
|
||||
[self.encourageIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
make.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];
|
||||
|
||||
[self.dischargeRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.encourageIndicateRegard).offset(41 * kScreenScale);
|
||||
make.width.mas_equalTo(66 * kScreenScale);
|
||||
make.left.mas_equalTo(self.encourageIndicateRegard).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.dischargeIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(30 * kScreenScale, 15 * kScreenScale));
|
||||
make.centerY.mas_equalTo(self.dischargeRegard);
|
||||
make.left.mas_equalTo(self.dischargeRegard.mas_right).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.achieveRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.width.mas_equalTo(self.dischargeRegard);
|
||||
make.left.mas_equalTo(self.dischargeIndicateRegard.mas_right).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.presentIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60 * kScreenScale, 60 * kScreenScale));
|
||||
make.centerY.mas_equalTo(self.dischargeRegard);
|
||||
make.left.mas_equalTo(self.achieveRegard.mas_right).offset(13 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.computationSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.presentIndicateRegard.mas_right).offset(13 * kScreenScale);
|
||||
make.centerY.mas_equalTo(self.dischargeRegard);
|
||||
}];
|
||||
|
||||
[self.concludeBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.encourageIndicateRegard).offset(-3);
|
||||
make.top.mas_equalTo(13);
|
||||
make.size.mas_equalTo(CGSizeMake(28, 22));
|
||||
}];
|
||||
|
||||
[self.chamberIdSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.encourageIndicateRegard);
|
||||
make.top.mas_equalTo(self.encourageIndicateRegard).offset(10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initOccurrences {
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTicktackImportChamber)];
|
||||
[self.encourageIndicateRegard addGestureRecognizer:tap];
|
||||
}
|
||||
|
||||
- (void)refurbishMetroviews:(BroadCastPrototype)level {
|
||||
NSString * nickBackImageName;
|
||||
UIColor * nickColor;
|
||||
NSString * bgImageName;
|
||||
switch (level) {
|
||||
case BroadCastPrototype_Normal:
|
||||
{
|
||||
CGFloat kscale = (CGFloat)124/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
[self.encourageIndicateRegard mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];
|
||||
|
||||
[self.concludeBtuton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(14 * kScreenScale);
|
||||
}];
|
||||
nickBackImageName = @"room_gift_broadcast_normal_nick_bg";
|
||||
nickColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
bgImageName = @"room_gift_broadcast_low_bg";
|
||||
self.chamberIdSequencignation.hidden = YES;
|
||||
}
|
||||
break;
|
||||
case BroadCastPrototype_Middle:
|
||||
{
|
||||
CGFloat kscale = (CGFloat)120/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
[self.encourageIndicateRegard mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];;
|
||||
|
||||
[self.concludeBtuton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(11 * kScreenScale);
|
||||
}];
|
||||
|
||||
nickBackImageName = @"room_gift_broadcast_higher_nick_bg";
|
||||
nickColor = [DJDKMIMOMColor presentBroadcastMonicerPrettify];
|
||||
bgImageName = @"room_gift_broadcast_middle_bg";
|
||||
self.chamberIdSequencignation.hidden = YES;
|
||||
}
|
||||
break;
|
||||
case BroadCastPrototype_High:
|
||||
{
|
||||
CGFloat kscale = (CGFloat)143/ (CGFloat)345;
|
||||
CGFloat width = KScreenWidth - 30;
|
||||
[self.encourageIndicateRegard mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];
|
||||
|
||||
[self.concludeBtuton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(33 * kScreenScale);
|
||||
}];
|
||||
|
||||
nickBackImageName = @"room_gift_broadcast_higher_nick_bg";
|
||||
nickColor = [DJDKMIMOMColor presentBroadcastMonicerPrettify];
|
||||
bgImageName = @"room_gift_broadcast_high_bg";
|
||||
self.chamberIdSequencignation.hidden = NO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (nickBackImageName.length > 0) {
|
||||
[self.dischargeRegard.monicerBtuton setBackgroundImage:[UIImage imageNamed:nickBackImageName] forState:UIControlStateNormal];
|
||||
[self.achieveRegard.monicerBtuton setBackgroundImage:[UIImage imageNamed:nickBackImageName] forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
if (nickColor) {
|
||||
[self.dischargeRegard.monicerBtuton setTitleColor:nickColor forState:UIControlStateNormal];
|
||||
[self.achieveRegard.monicerBtuton setTitleColor:nickColor forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
self.encourageIndicateRegard.image = [UIImage imageNamed:bgImageName];
|
||||
}
|
||||
|
||||
#pragma mark - FBCChamberYearActivityRegardRepresendtation
|
||||
- (void)yUMIChamberAnnmuImportpriseRegardImportChamber:(NSString *)roomUid {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberPresentBroadcastRegard:enterRoom:)]) {
|
||||
[self.delegate yUMIChamberPresentBroadcastRegard:self enterRoom:roomUid];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPingencourageMatrix:(YUMIChamberPresentBroadCastMatrix *)pingencourageMatrix {
|
||||
_pingencourageMatrix = pingencourageMatrix;
|
||||
if (_pingencourageMatrix) {
|
||||
if (pingencourageMatrix.sendUserNick.length > 6) {
|
||||
pingencourageMatrix.sendUserNick = [pingencourageMatrix.sendUserNick substringToIndex:6];
|
||||
}
|
||||
if(pingencourageMatrix.ceremonyGift) {
|
||||
for (UIView *subView in self.subviews) {
|
||||
[subView removeFromSuperview];
|
||||
}
|
||||
[self addSubview:self.ceremonyRegard];
|
||||
CGFloat kscale = (CGFloat)90/ (CGFloat)375;
|
||||
CGFloat width = KScreenWidth;
|
||||
[self.ceremonyRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.right.mas_equalTo(self);
|
||||
make.height.mas_equalTo(width * kscale);
|
||||
}];
|
||||
self.ceremonyRegard.model = pingencourageMatrix;
|
||||
return;
|
||||
}
|
||||
self.dischargeRegard.intelligenceportraitIndicateRegard.imageUrl = pingencourageMatrix.sendUserAvatar;
|
||||
[self.dischargeRegard.monicerBtuton setTitle:pingencourageMatrix.sendUserNick forState:UIControlStateNormal];
|
||||
|
||||
if (pingencourageMatrix.recvUserNick.length > 6) {
|
||||
pingencourageMatrix.recvUserNick = [pingencourageMatrix.recvUserNick substringToIndex:6];
|
||||
}
|
||||
self.achieveRegard.intelligenceportraitIndicateRegard.imageUrl = pingencourageMatrix.recvUserAvatar;
|
||||
[self.achieveRegard.monicerBtuton setTitle:pingencourageMatrix.recvUserNick forState:UIControlStateNormal];
|
||||
|
||||
self.presentIndicateRegard.imageUrl = pingencourageMatrix.giftUrl;
|
||||
self.computationSequencignation.text = [NSString stringWithFormat:@"x%ld", pingencourageMatrix.giftNum];
|
||||
self.chamberIdSequencignation.text = [NSString stringWithFormat:@"ID:%@", pingencourageMatrix.roomErbanNo];
|
||||
[self refurbishMetroviews:pingencourageMatrix.levelNum];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)encourageIndicateRegard {
|
||||
if (!_encourageIndicateRegard) {
|
||||
_encourageIndicateRegard = [[UIImageView alloc] init];
|
||||
_encourageIndicateRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _encourageIndicateRegard;
|
||||
}
|
||||
|
||||
- (YUMIChamberExternalizeConsumerRegard *)dischargeRegard {
|
||||
if (!_dischargeRegard) {
|
||||
_dischargeRegard = [[YUMIChamberExternalizeConsumerRegard alloc] init];
|
||||
}
|
||||
return _dischargeRegard;
|
||||
}
|
||||
|
||||
- (UIImageView *)dischargeIndicateRegard {
|
||||
if (!_dischargeIndicateRegard) {
|
||||
_dischargeIndicateRegard = [[UIImageView alloc] init];
|
||||
_dischargeIndicateRegard.userInteractionEnabled = YES;
|
||||
_dischargeIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_present_broadcast_send"];
|
||||
}
|
||||
return _dischargeIndicateRegard;
|
||||
}
|
||||
|
||||
- (YUMIChamberExternalizeConsumerRegard *)achieveRegard {
|
||||
if (!_achieveRegard) {
|
||||
_achieveRegard = [[YUMIChamberExternalizeConsumerRegard alloc] init];
|
||||
}
|
||||
return _achieveRegard;
|
||||
}
|
||||
- (NetIndicateRegard *)presentIndicateRegard {
|
||||
if (!_presentIndicateRegard) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_presentIndicateRegard = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
}
|
||||
return _presentIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)computationSequencignation {
|
||||
if (!_computationSequencignation) {
|
||||
_computationSequencignation = [[UILabel alloc] init];
|
||||
_computationSequencignation.font = [UIFont fontWithName:@"PingFang-SC-Heavy" size:20];
|
||||
_computationSequencignation.textColor = [DJDKMIMOMColor presentBroadcastDigitalPrettify];
|
||||
}
|
||||
return _computationSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)concludeBtuton {
|
||||
if (!_concludeBtuton) {
|
||||
_concludeBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_concludeBtuton setImage:[UIImage imageNamed:@"yumi_scope_present_broadcast_close"] forState:UIControlStateNormal];
|
||||
[_concludeBtuton setImage:[UIImage imageNamed:@"yumi_scope_present_broadcast_close"] forState:UIControlStateSelected];
|
||||
[_concludeBtuton addTarget:self action:@selector(concludeBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _concludeBtuton;
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)chamberIdSequencignation {
|
||||
if (!_chamberIdSequencignation) {
|
||||
_chamberIdSequencignation = [[UILabel alloc] init];
|
||||
_chamberIdSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_chamberIdSequencignation.textColor = [DJDKMIMOMColor presentBroadcastMonicerPrettify];
|
||||
}
|
||||
return _chamberIdSequencignation;
|
||||
}
|
||||
|
||||
- (YUMIChamberYearImportpriseRegard *)ceremonyRegard {
|
||||
if(!_ceremonyRegard) {
|
||||
_ceremonyRegard = [[YUMIChamberYearImportpriseRegard alloc] init];
|
||||
_ceremonyRegard.delegate = self;
|
||||
}
|
||||
return _ceremonyRegard;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// YUMIChamberSatelliteKitchenOriflammeRegard.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2022/12/7.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YUMIPresentBigCaptureMatrix.h"
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class YUMIChamberSatelliteKitchenOriflammeRegard;
|
||||
@protocol FBCChamberStarKitchenBannerRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)yUMIChamberStowardselliteKitchenOriflammeRegard:(YUMIChamberSatelliteKitchenOriflammeRegard *)view didClick:(YUMIPresentBigCaptureMatrix *)starMatrix;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface YUMIChamberSatelliteKitchenOriflammeRegard : UIView
|
||||
@property (nonatomic,assign) BOOL isSvga;
|
||||
@property (nonatomic,strong) YUMIPresentBigCaptureMatrix *starMatrix;
|
||||
@property (nonatomic,weak) id<FBCChamberStarKitchenBannerRegardRepresendtation> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,137 +0,0 @@
|
||||
//
|
||||
// YUMIChamberSatelliteKitchenOriflammeRegard.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2022/12/7.
|
||||
//
|
||||
#import <SVGA.h>
|
||||
#import "YUMIChamberSatelliteKitchenOriflammeRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
@interface YUMIChamberSatelliteKitchenOriflammeRegard()
|
||||
|
||||
@property (strong, nonatomic) SVGAParser *anatomiser;
|
||||
@property (nonatomic,strong) SVGAImageView *svgaRegard;
|
||||
@property (nonatomic,strong) UIImageView *backgroundIndicateRegard;
|
||||
@property (nonatomic,strong) UILabel *titleView;
|
||||
@property (nonatomic,strong) UIButton *ticktackBtuton;
|
||||
|
||||
@end
|
||||
@implementation YUMIChamberSatelliteKitchenOriflammeRegard
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backgroundIndicateRegard];
|
||||
[self addSubview:self.svgaRegard];
|
||||
[self addSubview:self.titleView];
|
||||
[self addSubview:self.ticktackBtuton];
|
||||
|
||||
}
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.backgroundIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.svgaRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(21));
|
||||
make.left.mas_equalTo(kGetScaleWidth(85));
|
||||
make.bottom.equalTo(self.mas_bottom).mas_offset(-kGetScaleWidth(13.5));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(53.5));
|
||||
}];
|
||||
|
||||
[self.ticktackBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)setStarMatrix:(YUMIPresentBigCaptureMatrix *)starMatrix{
|
||||
_starMatrix = starMatrix;
|
||||
NSString *name = _starMatrix.nick.length < 7 ? _starMatrix.nick : [NSString stringWithFormat:@"%@...",[_starMatrix.nick substringWithRange:NSMakeRange(0, 6)]];
|
||||
NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomStarKitchenBannerView0"),name,_starMatrix.itemMultiple,_starMatrix.diamonds];
|
||||
[self.titleView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(_isSvga == YES && KScreenWidth == 320 ? 18 : 21));
|
||||
}];
|
||||
NSMutableAttributedString *att = [[NSMutableAttributedString alloc]initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFEF23E)} range:[title rangeOfString:name]];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x00EAFF)} range:[title rangeOfString:[NSString stringWithFormat:@" %@",_starMatrix.itemMultiple]]];
|
||||
[att addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x00EAFF)} range:[title rangeOfString:[NSString stringWithFormat:@" %@",_starMatrix.diamonds]]];
|
||||
if(_isSvga == YES){
|
||||
self.backgroundIndicateRegard.hidden = YES;
|
||||
self.svgaRegard.hidden = NO;
|
||||
self.titleView.hidden = NO;
|
||||
self.titleView.attributedText = att;
|
||||
@kWeakify(self);
|
||||
[self.anatomiser parseWithNamed:@"Star_kitchen" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.svgaRegard.loops = 1;
|
||||
self.svgaRegard.clearsAfterStop = NO;
|
||||
self.svgaRegard.videoItem = videoItem;
|
||||
|
||||
[self.svgaRegard startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
self.backgroundIndicateRegard.hidden = NO;
|
||||
self.titleView.hidden = NO;
|
||||
self.svgaRegard.hidden = YES;
|
||||
self.titleView.attributedText = att;
|
||||
}
|
||||
}
|
||||
-(void)ticktackPerformance{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberStowardselliteKitchenOriflammeRegard:didClick:)]){
|
||||
[self.delegate yUMIChamberStowardselliteKitchenOriflammeRegard:self didClick:self.starMatrix];
|
||||
}
|
||||
}
|
||||
#pragma mark -懒加载
|
||||
- (UIImageView *)backgroundIndicateRegard{
|
||||
if (!_backgroundIndicateRegard){
|
||||
_backgroundIndicateRegard = [UIImageView new];
|
||||
_backgroundIndicateRegard.image = [UIImage imageNamed:@"yumi_scope_star_kitchen"];
|
||||
_backgroundIndicateRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backgroundIndicateRegard;
|
||||
}
|
||||
-(UILabel *)titleView{
|
||||
if (!_titleView){
|
||||
_titleView = [UILabel new];
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
_titleView.numberOfLines = 2;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
- (SVGAParser *)anatomiser {
|
||||
if (!_anatomiser) {
|
||||
_anatomiser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _anatomiser;
|
||||
}
|
||||
- (SVGAImageView *)svgaRegard {
|
||||
if (!_svgaRegard) {
|
||||
_svgaRegard= [[SVGAImageView alloc]init];
|
||||
_svgaRegard.backgroundColor = [UIColor clearColor];
|
||||
_svgaRegard.userInteractionEnabled = YES;
|
||||
}
|
||||
return _svgaRegard;
|
||||
}
|
||||
-(UIButton *)ticktackBtuton{
|
||||
if (!_ticktackBtuton){
|
||||
_ticktackBtuton = [UIButton new];
|
||||
[_ticktackBtuton addTarget:self action:@selector(ticktackPerformance) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
}
|
||||
return _ticktackBtuton;
|
||||
}
|
||||
@end
|
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// YMRoomYearActivityView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by GLEN on 2022/11/26.
|
||||
// 年度活动
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YUMIChamberPresentBroadCastMatrix.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol FBCChamberYearActivityRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)yUMIChamberAnnmuImportpriseRegardImportChamber:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
@interface YUMIChamberYearImportpriseRegard : UIView
|
||||
|
||||
@property (nonatomic, strong) YUMIChamberPresentBroadCastMatrix *model;
|
||||
@property (nonatomic,weak) id<FBCChamberYearActivityRegardRepresendtation> delegate;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,202 +0,0 @@
|
||||
//
|
||||
// YMRoomYearActivityView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by GLEN on 2022/11/26.
|
||||
//
|
||||
|
||||
#import "YUMIChamberYearImportpriseRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ChamberHalfHourRateMatrix.h"
|
||||
#import "NetIndicateRegard.h"
|
||||
|
||||
@interface YUMIChamberYearImportpriseRegard()
|
||||
|
||||
@property (nonatomic,strong) UIImageView *backgroundIndicateRegard;
|
||||
@property (nonatomic,strong) NetIndicateRegard *dischargeIntelligenceportrait;
|
||||
@property (nonatomic,strong) NetIndicateRegard *achieveIntelligenceportrait;
|
||||
@property (nonatomic,strong) UILabel *dischargeMonicer;
|
||||
@property (nonatomic,strong) UILabel *achieveMonicer;
|
||||
@property (nonatomic, strong) UILabel *sequenceSequencignation;
|
||||
@property (nonatomic,strong) UILabel *computationSequencignation;
|
||||
@property (nonatomic, strong) UIButton *gotoBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIChamberYearImportpriseRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backgroundIndicateRegard];
|
||||
[self addSubview:self.dischargeMonicer];
|
||||
[self addSubview:self.dischargeIntelligenceportrait];
|
||||
[self addSubview:self.sequenceSequencignation];
|
||||
[self addSubview:self.achieveMonicer];
|
||||
[self addSubview:self.achieveIntelligenceportrait];
|
||||
[self addSubview:self.computationSequencignation];
|
||||
[self addSubview:self.gotoBtuton];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.backgroundIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(0);
|
||||
}];
|
||||
[self.dischargeMonicer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(35*KScreenWidth/375);
|
||||
make.centerY.mas_equalTo(self.backgroundIndicateRegard);
|
||||
}];
|
||||
[self.dischargeIntelligenceportrait mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.dischargeMonicer.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
[self.sequenceSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.dischargeIntelligenceportrait.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.achieveMonicer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.sequenceSequencignation.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.achieveIntelligenceportrait mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.achieveMonicer.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
[self.computationSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.achieveIntelligenceportrait.mas_right).mas_offset(3);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.gotoBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-31*KScreenWidth / 375);
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.size.mas_equalTo(CGSizeMake(40, 18));
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(YUMIChamberPresentBroadCastMatrix *)model {
|
||||
_model = model;
|
||||
if (model) {
|
||||
self.achieveIntelligenceportrait.imageUrl = model.recvUserAvatar;
|
||||
self.dischargeIntelligenceportrait.imageUrl = model.sendUserAvatar;
|
||||
if (model.recvUserNick.length > 4) {
|
||||
model.recvUserNick = [NSString stringWithFormat:@"%@...", [model.recvUserNick substringToIndex:4]];
|
||||
}
|
||||
if (model.sendUserNick.length > 4) {
|
||||
model.sendUserNick = [NSString stringWithFormat:@"%@...", [model.sendUserNick substringToIndex:4]];
|
||||
}
|
||||
if (model.giftName.length > 6) {
|
||||
model.giftName = [model.giftName substringToIndex:6];
|
||||
}
|
||||
self.dischargeMonicer.text = model.sendUserNick;
|
||||
self.achieveMonicer.text = model.recvUserNick;
|
||||
self.computationSequencignation.text = [NSString stringWithFormat:@"%@ x%ld", model.giftName, model.giftNum];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onGotoBtutonTicktack:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(yUMIChamberAnnmuImportpriseRegardImportChamber:)]) {
|
||||
[self.delegate yUMIChamberAnnmuImportpriseRegardImportChamber:[NSString stringWithFormat:@"%ld", self.model.roomUid]];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIImageView *)backgroundIndicateRegard {
|
||||
if (!_backgroundIndicateRegard) {
|
||||
_backgroundIndicateRegard = [[UIImageView alloc] init];
|
||||
_backgroundIndicateRegard.image = [UIImage imageNamed:@"yumi_YearActivity_background"];
|
||||
_backgroundIndicateRegard.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _backgroundIndicateRegard;
|
||||
}
|
||||
|
||||
- (NetIndicateRegard *)dischargeIntelligenceportrait {
|
||||
if (!_dischargeIntelligenceportrait) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_dischargeIntelligenceportrait = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
_dischargeIntelligenceportrait.layer.masksToBounds = YES;
|
||||
_dischargeIntelligenceportrait.layer.cornerRadius = 10;
|
||||
_dischargeIntelligenceportrait.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor;
|
||||
_dischargeIntelligenceportrait.layer.borderWidth = 1;
|
||||
}
|
||||
return _dischargeIntelligenceportrait;
|
||||
}
|
||||
|
||||
- (UILabel *)dischargeMonicer {
|
||||
if (!_dischargeMonicer) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = UIColorFromRGB(0xFBC200);
|
||||
_dischargeMonicer = label;
|
||||
}
|
||||
return _dischargeMonicer;
|
||||
}
|
||||
|
||||
- (NetIndicateRegard *)achieveIntelligenceportrait {
|
||||
if (!_achieveIntelligenceportrait) {
|
||||
NetIndicateDisposition * config = [[NetIndicateDisposition alloc]init];
|
||||
config.imageType = ImageGenreUserIcon;
|
||||
_achieveIntelligenceportrait = [[NetIndicateRegard alloc] initWithConfig:config];
|
||||
_achieveIntelligenceportrait.layer.masksToBounds = YES;
|
||||
_achieveIntelligenceportrait.layer.cornerRadius = 10;
|
||||
_achieveIntelligenceportrait.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor;
|
||||
_achieveIntelligenceportrait.layer.borderWidth = 1;
|
||||
}
|
||||
return _achieveIntelligenceportrait;
|
||||
}
|
||||
|
||||
- (UILabel *)achieveMonicer {
|
||||
if (!_achieveMonicer) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = UIColorFromRGB(0xFBC200);
|
||||
_achieveMonicer = label;
|
||||
}
|
||||
return _achieveMonicer;
|
||||
}
|
||||
|
||||
- (UILabel *)sequenceSequencignation {
|
||||
if (!_sequenceSequencignation) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.font = [UIFont systemFontOfSize:12];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = YMLocalizedString(@"YUMI_Room_Year_Activity_View_0");
|
||||
_sequenceSequencignation = label;
|
||||
}
|
||||
return _sequenceSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)computationSequencignation {
|
||||
if (!_computationSequencignation) {
|
||||
_computationSequencignation = [[UILabel alloc] init];
|
||||
_computationSequencignation.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold];
|
||||
_computationSequencignation.textColor = UIColorFromRGB(0x80F9FF);
|
||||
}
|
||||
return _computationSequencignation;
|
||||
}
|
||||
- (UIButton *)gotoBtuton {
|
||||
if (!_gotoBtuton) {
|
||||
_gotoBtuton = [[UIButton alloc] init];
|
||||
[_gotoBtuton setBackgroundImage:[UIImage imageNamed:@"yumi_YearActivity_goto"] forState:UIControlStateNormal];
|
||||
[_gotoBtuton addTarget:self action:@selector(onGotoBtutonTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _gotoBtuton;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user