Commit b558158f by ludi

礼物下载有bug

parent 39fff5a8
Showing with 1090 additions and 235 deletions
......@@ -1015,6 +1015,12 @@ NSString * const kMD5GiftResourceKey = @"kMD5GiftResourceKey";
[self checkResourceDownloadWithResourceUrl:strongModel.darkRes resourceMd5:strongModel.darkMd5 gid:strongModel.mid success:^{
} failure:^(NSString *msg, int code) {
}];
if (strongModel.audioresource != nil && strongModel.audioresource.length > 0) {
// 下载座驾声音
[self checkResourceDownloadWithResourceUrl:strongModel.audioresource resourceMd5:nil gid:strongModel.audioresource success:^{
} failure:^(NSString *msg, int code) {
}];
}
}
}];
});
......
......@@ -40,4 +40,7 @@
///座驾等级(1:经典、2:豪华、3:名贵、4:限量、5:定制)
@property (nonatomic, assign) NSInteger carGrade;
/// 播放座驾音效
-(void)fus_playMotorAudioIfNeeded;
@end
......@@ -7,7 +7,36 @@
//
#import "FUSMotorDataModel.h"
#import "FUSCommon/FUSCommon-Swift.h"
#import "FUSCacheDataShare.h"
@implementation FUSMotorDataModel
- (void)fus_playMotorAudioIfNeeded{
BOOL audioresourceIsNull = [NSString isNullWithString:self.audioresource];
BOOL localEnterRoomCarAudioSwitch = [FUSCacheDataShare shareStore].settingInitDataModel.localEnterRoomCarAudioSwitch == YES;
BOOL myselfIsOnMic = [FUSRouter liveRouter].selfOnMicList;
BOOL isNotAnchor = ![[FUSRouter liveRouter] isAnchor];
BOOL isPlayOnSpeaker = [[FUSAudioHelper shareInstance] isPlayOnSpeaker];
if (!audioresourceIsNull
&& localEnterRoomCarAudioSwitch
&& ((!myselfIsOnMic
&& isNotAnchor)
|| !isPlayOnSpeaker)) {
if ([[FUSGiftDataCenter sharedCenter] fus_checkGiftResourceExitWithURL:self.audioresource]) {
NSString *filePath = [FUSConfig.sharedInstanced.pathConfigs downloadResourcePath:self.audioresource pathMd5:self.audioresource];
[[FUSAudioHelper shareInstance] stop];
[[FUSAudioHelper shareInstance] playWithFilePath:filePath progress:^(NSTimeInterval currentTime) {
} playToEndHandler:^{
}];
}
}
}
@end
......@@ -1368,8 +1368,8 @@ typedef NS_ENUM(NSInteger, DisplayAt) {
CGFloat keyboardHeight = keyboardFrame.size.height;
[FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
[FUSKeyboardShowHelper sharedInstance].isShow = YES;
// [FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
// [FUSKeyboardShowHelper sharedInstance].isShow = YES;
animationMovementOnKeyboardShow = keyboardHeight - (UIView.fus_screenH - self.animation.height) + 70;
......@@ -1395,7 +1395,7 @@ typedef NS_ENUM(NSInteger, DisplayAt) {
}];
}
[FUSKeyboardShowHelper sharedInstance].isShow = false;
// [FUSKeyboardShowHelper sharedInstance].isShow = false;
}
/**
......
......@@ -71,3 +71,9 @@ extern NSString * const UDKEY_COMMON_GUIDE_PAY_TIPS_CONTENT;
@interface FUSCommonStoreUDKey : NSObject
/// 直播间经常座驾音效开关
+(NSString *)fus_enterMotorAudio;
@end
......@@ -69,5 +69,11 @@ NSString * const UDKEY_COMMON_VOICE_SIGN_DEMO_LIST = @"UDKEY_COMMON_VOICE_SIGN_D
// 直播间”撩一下”储值tips
NSString * const UDKEY_COMMON_GUIDE_PAY_TIPS_CONTENT = @"UDKEY_COMMON_GUIDE_PAY_TIPS_CONTENT";
@implementation FUSCommonStoreUDKey
/// 直播间经常座驾音效开关
+ (NSString *)fus_enterMotorAudio{
return @"/Common/CommonStoreUDKey/enterMotorAudio";
}
@end
......@@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isAudience;
- (BOOL)hasUserInMic;
- (BOOL)selfOnMicList;
- (BOOL)isRoomVisable;
- (BOOL)isMinimize;
- (NSInteger)fus_liveScopeType;
......
......@@ -72,12 +72,6 @@ NS_ASSUME_NONNULL_BEGIN
/// 用户直播间入场消息折叠开关(0:关、1:开)默认是开
@property (nonatomic, assign) NSInteger enterRoomMsgFoldSwitch;
/// 座驾入场座驾音效控制按钮开关(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarAudioShowSwitch;
/// 座驾入场座驾音效默认选项(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarDefaultOption;
/// 平台商城应用开关(0:关、1:开)
@property (nonatomic, assign) NSInteger platformStoreShowSwitch;
......@@ -119,6 +113,13 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) FUSSettingFusiConfigModel *fusiConfig;
/// 座驾入场座驾音效控制按钮开关(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarAudioShowSwitch;
/// 座驾入场座驾音效默认选项(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarDefaultOption;
/// 座驾入场座驾音效控制按钮开关(0:关、1:开)
@property (nonatomic, assign) NSInteger localEnterRoomCarAudioSwitch;
@end
NS_ASSUME_NONNULL_END
......@@ -6,9 +6,25 @@
//
#import "FUSSettingInitDataModel.h"
#import "FUSCommonUDKeys.h"
@implementation FUSSettingInitDataModel
@synthesize localEnterRoomCarAudioSwitch = _localEnterRoomCarAudioSwitch;
- (NSInteger)localEnterRoomCarAudioSwitch{
if (self.enterRoomCarAudioShowSwitch == 1) {
if ([[NSUserDefaults standardUserDefaults] valueForKey:FUSCommonStoreUDKey.fus_enterMotorAudio] != nil) {
return [[[NSUserDefaults standardUserDefaults] valueForKey:FUSCommonStoreUDKey.fus_enterMotorAudio] integerValue];
}else {
return self.enterRoomCarDefaultOption;
}
}else {
return 0;
}
}
- (void)setLocalEnterRoomCarAudioSwitch:(NSInteger)localEnterRoomCarAudioSwitch{
[[NSUserDefaults standardUserDefaults] setValue:[NSString stringWithFormat:@"%ld",localEnterRoomCarAudioSwitch] forKey:FUSCommonStoreUDKey.fus_enterMotorAudio];
}
//嵌套的 model
+ (NSDictionary *)modelContainerPropertyGenericClass {
......
......@@ -5,22 +5,94 @@
// Created by 盘世煜 on 2020/7/2.
// Copyright © 2024年 FusiClub. All rights reserved.
//
//ludy: 改造了监听模式为多播代理,以前仅仅是作为传递作用,注意看一看bug
import UIKit
@objc public protocol FUSKeyboardShowHelperDelegate: AnyObject {
func fus_keyboardStatusDidChange(isShow: Bool, keyBoardFrame: CGRect)
}
public class FUSKeyboardShowHelper: NSObject {
@objc public static let sharedInstance = FUSKeyboardShowHelper()
private override init() {
}
private var delegates = NSHashTable<AnyObject>.weakObjects()
@objc public var isShow = false
///是否抬起键盘,只读
@objc public var isShow: Bool {
get {
return p_isShow
}
set {
}
}
private var p_isShow = false
@objc public var keyboardFrame = CGRect()
///当前键盘frame,只读
@objc public var keyboardFrame: CGRect {
get {
return p_keyboardFrame
}
set {
}
}
private var p_keyboardFrame = CGRectZero
@objc public var webpMotorContent_Y = 0.0
@objc public var motorContent_Y = 0.0
private override init() {
super.init()
// 监听键盘弹出通知
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
// 监听键盘收回通知
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
deinit {
// 移除通知观察者
NotificationCenter.default.removeObserver(self)
}
@objc public func star() {
//没什么意义,只是为了在开始的时候激活一下单利,然后又不让xcode报黄
}
// 添加代理
@objc public func addDelegate(_ delegate: AnyObject) {
delegates.add(delegate)
}
// 移除代理
@objc public func removeDelegate(_ delegate: AnyObject) {
delegates.remove(delegate)
}
// 多播通知代理键盘状态变化
private func notifyDelegates(isShow: Bool, keyBoardFrame: CGRect) {
self.p_keyboardFrame = keyBoardFrame
self.p_isShow = isShow
for delegate in delegates.allObjects {
if let keyboardDelegate = delegate as? FUSKeyboardShowHelperDelegate {
keyboardDelegate.fus_keyboardStatusDidChange(isShow: isShow, keyBoardFrame: keyBoardFrame)
}
}
}
@objc private func keyboardWillShow(_ notification: Notification) {
if let userInfo = notification.userInfo,
let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
// 通知代理键盘弹出
notifyDelegates(isShow: true, keyBoardFrame: keyboardFrame)
}
}
@objc private func keyboardWillHide(_ notification: Notification) {
// 通知代理键盘收回
notifyDelegates(isShow: false, keyBoardFrame: CGRectZero)
}
}
......@@ -33,6 +33,9 @@ typedef NS_ENUM(NSInteger, AudioOutputType) {
// 是否正在播放中
@property (nonatomic, assign, readonly) BOOL isPlaying;
/// 是否正在使用外放
@property (nonatomic, assign, readonly) BOOL isPlayOnSpeaker;
/**
创建单例
*/
......
......@@ -210,6 +210,16 @@
return _player.isPlaying;
}
- (BOOL)isPlayOnSpeaker{
AVAudioSessionRouteDescription *currentRoute = AVAudioSession.sharedInstance.currentRoute;
for (AVAudioSessionPortDescription *outPut in currentRoute.outputs) {
if (outPut.portType == AVAudioSessionPortBuiltInSpeaker) {
return YES;
}
}
return NO;
}
#pragma mark - Record
/**
开始录音
......
......@@ -7,7 +7,7 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>77</integer>
<integer>75</integer>
</dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict>
......
......@@ -99,6 +99,8 @@
00BA21432D155E69000CC4C9 /* FUSIncomeAgreementAlertView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00BA21392D155E69000CC4C9 /* FUSIncomeAgreementAlertView.h */; };
00BA21442D155E69000CC4C9 /* FUSLiveAgreementConfirmSectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00BA213D2D155E69000CC4C9 /* FUSLiveAgreementConfirmSectionView.h */; };
00BA21452D155E69000CC4C9 /* FUSLiveAgreementAlertView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00BA213B2D155E69000CC4C9 /* FUSLiveAgreementAlertView.h */; };
00BD441F2D1EAA740099A96F /* FUSCarEnterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00BD441E2D1EAA740099A96F /* FUSCarEnterView.m */; };
00BD44202D1EAA740099A96F /* FUSCarEnterView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00BD441D2D1EAA740099A96F /* FUSCarEnterView.h */; };
BE189D972C733B450008418B /* FSRActiveModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE189CE52C733B450008418B /* FSRActiveModel.h */; };
BE189D982C733B450008418B /* FSRActiveModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE189CE62C733B450008418B /* FSRActiveModel.m */; };
BE189D992C733B450008418B /* FSRActiveMotorEffectModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE189CE72C733B450008418B /* FSRActiveMotorEffectModel.h */; };
......@@ -1433,6 +1435,8 @@
00BA213C2D155E69000CC4C9 /* FUSLiveAgreementAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSLiveAgreementAlertView.m; sourceTree = "<group>"; };
00BA213D2D155E69000CC4C9 /* FUSLiveAgreementConfirmSectionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSLiveAgreementConfirmSectionView.h; sourceTree = "<group>"; };
00BA213E2D155E69000CC4C9 /* FUSLiveAgreementConfirmSectionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSLiveAgreementConfirmSectionView.m; sourceTree = "<group>"; };
00BD441D2D1EAA740099A96F /* FUSCarEnterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSCarEnterView.h; sourceTree = "<group>"; };
00BD441E2D1EAA740099A96F /* FUSCarEnterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSCarEnterView.m; sourceTree = "<group>"; };
842ED23FEE639B8A5B65A322 /* Pods-FUSShowRoomModule.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSShowRoomModule.debug.xcconfig"; path = "Target Support Files/Pods-FUSShowRoomModule/Pods-FUSShowRoomModule.debug.xcconfig"; sourceTree = "<group>"; };
97F831FBE9C41BC899CF9232 /* Pods-FUSShowRoomModule.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSShowRoomModule.release.xcconfig"; path = "Target Support Files/Pods-FUSShowRoomModule/Pods-FUSShowRoomModule.release.xcconfig"; sourceTree = "<group>"; };
B8B2CC1956F16144828BF43D /* Pods_FUSShowRoomModule.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FUSShowRoomModule.framework; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -3541,6 +3545,8 @@
BED656D82C5B745D00668116 /* FUSLiveScrollView.m */,
BED656D92C5B745D00668116 /* FUSLiveTimeRecordView.h */,
BED656DA2C5B745D00668116 /* FUSLiveTimeRecordView.m */,
00BD441D2D1EAA740099A96F /* FUSCarEnterView.h */,
00BD441E2D1EAA740099A96F /* FUSCarEnterView.m */,
BED656DB2C5B745D00668116 /* FUSMotorsView.h */,
BED656DC2C5B745D00668116 /* FUSMotorsView.m */,
BED656DD2C5B745D00668116 /* FUSMotorWEBPView.h */,
......@@ -5275,6 +5281,7 @@
BED658B92C5B745E00668116 /* FUSHalfWebViewCollectionViewCell.h in Headers */,
BED65AB62C5B745F00668116 /* FUSHomePageViewController.h in Headers */,
BED6591D2C5B745E00668116 /* FUSBulletMessageBaseView.h in Headers */,
00BD44202D1EAA740099A96F /* FUSCarEnterView.h in Headers */,
BE189DC72C733B460008418B /* FSREnterEffectRoomGuarderViewController.h in Headers */,
BED6586D2C5B745E00668116 /* VELPictureInPictureController.h in Headers */,
BE189DEB2C733B460008418B /* FSREffectTableViewCell.h in Headers */,
......@@ -6258,6 +6265,7 @@
BE189DDA2C733B460008418B /* FSRPKViewController.m in Sources */,
BED659DF2C5B745F00668116 /* FUSPKStyleModel.m in Sources */,
BED65A762C5B745F00668116 /* FUSWarningView.m in Sources */,
00BD441F2D1EAA740099A96F /* FUSCarEnterView.m in Sources */,
BED658C32C5B745E00668116 /* FUSProgressActivityView.m in Sources */,
BED65A9D2C5B745F00668116 /* FUSShowBroadcastGuideAlertView.m in Sources */,
BED65ADC2C5B746000668116 /* FUSBaoFangAnchorModel.m in Sources */,
......
......@@ -7,7 +7,7 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>76</integer>
<integer>74</integer>
</dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict>
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_enter_room_normal399_70@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -15,6 +15,7 @@
#import "FUSBulletsScreenView.h"
#import "FUSMotorsView.h"
#import "FUSCarEnterView.h"
#import "FUSLiveHeadPusherView.h"
#import "FUSPopularListView.h"
#import "FUSLiveChatInputHelper.h"
......@@ -167,13 +168,16 @@ UIGestureRecognizerDelegate
*/
@property (nonatomic, strong) UIView *bulletsOriginalView;
/**
座驾 View
*/
@property (nonatomic, strong) FUSMotorsView *motorsView;
///**
// 座驾 View
// */
//@property (nonatomic, strong) FUSMotorsView *motorsView;
//
//// 用于显示大效果的座驾 View
//@property (nonatomic, strong) FUSMotorWEBPView *webpMotorsView;
// 用于显示大效果的座驾 View
@property (nonatomic, strong) FUSMotorWEBPView *webpMotorsView;
///显示座驾的view
@property (nonatomic, strong) FUSCarEnterView *carEnterView;
/**
主播模式 HeaderView
......@@ -1453,9 +1457,9 @@ UIGestureRecognizerDelegate
[weakSelf fus_updateChatTableYKeyboardShow:weakSelf.isKeyboard];
}];
// if (weakSelf.carEnterView) {
// [weakSelf.carEnterView ffSetCarBottomOffset:0 withAnimate:YES];
// }
if (weakSelf.carEnterView) {
[weakSelf.carEnterView fus_setCarBottomOffset:0 withAnimate:YES];
}
};
self.chatFastInputView.sendFastInputMsgHandler = ^(FUSRoomQuickChatListModel * _Nonnull model) {
......@@ -1476,9 +1480,9 @@ UIGestureRecognizerDelegate
[self fus_updateChatTableYKeyboardShow:self.isKeyboard];
}];
// if (self.carEnterView) {
// [self.carEnterView ffSetCarBottomOffset:-self.chatFastInputView.height withAnimate:YES];
// }
if (self.carEnterView) {
[self.carEnterView fus_setCarBottomOffset:-self.chatFastInputView.height withAnimate:YES];
}
}
- (void)initLinkMicroViewWithAmount:(NSInteger)viewAmount needReloadData:(BOOL)reload{
......@@ -2318,87 +2322,87 @@ UIGestureRecognizerDelegate
/**
接收珍爱团进入包房通知
*/
- (void)recieveFansGroupEnterNotification:(NSNotification *)notification {
if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
// 审核状态下屏蔽座驾
return;
}
FUSSocketMessageModel *socketMessageModel = notification.object;
// 检测
if (![[[[FUSLiveHelper shareInstance]roomInfoModel]roomId] isEqualToString:[NSString stringWithFormat:@"%d", socketMessageModel.extend1]]) {
return;
}
if ([FUSGiftCenter fus_shareGiftCenter].isGiftAnimating) {
return;
}
NSDictionary *dict = [socketMessageModel fus_getJsonDict];
if (![FUSLiveChatDataSourceHelper fus_checkActiveCanShowWithDict:dict]) {
return;
}
NSDictionary *userDict = [dict objectForKey:@"user"];
NSDictionary *vehicleDict = [dict objectForKey:@"vehicle"];
NSDictionary *tipDict = [dict objectForKey:@"tips"];
if ([NSDictionary isNull:tipDict]) {
tipDict = [NSString converToDictionaryWithJsonString:socketMessageModel.jsondata];
}
[FUSMotorsView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
dispatch_async(dispatch_get_main_queue(), ^{
// 如果正在播放大礼物,则不显示座驾
if ([FUSGiftCenter fus_shareGiftCenter].animation) {
return;
}
[self.motorsView fus_stopAnimation];
[self.motorsView removeFromSuperview];
[self.webpMotorsView fus_stopAnimation];
[self.webpMotorsView removeFromSuperview];
if (self.pusherAcitivtyView) {
BOOL isPushModel = self.scrollView.offsetX < self.scrollView.width / 2.0;
if (isPushModel) {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.pusherChatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
} else {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.bottomToolView.height - self.chatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
}
} else {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.fus_chatTextViewHeight - TABLE_VIEW_HEIGHT - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
}
_motorsView.userInteractionEnabled = NO;
[[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.motorsView];
[_motorsView setAnimationDidEnd:^(UIView *animatingView) {
[animatingView removeFromSuperview];
}];
__weak typeof(self) weakSelf = self;
[self.motorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
[weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
userInfoModel:model
shouldRequestData:YES
showManagerBtn:YES
enableAtBtn:YES];
}];
[self.motorsView fus_setupMotorsViewWithTipAttr:attributedString
uid:[[userDict objectForKey:@"realUid"] description]
motorImageUrl:nil
level:[userDict objectForKey:@"realLevel"]
ishidden:[[userDict objectForKey:@"isHide"] boolValue]];
[weakSelf.motorsView fus_startEnterAnimation];
});
}];
}
//- (void)recieveFansGroupEnterNotification:(NSNotification *)notification {
// if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
// // 审核状态下屏蔽座驾
// return;
// }
//
// FUSSocketMessageModel *socketMessageModel = notification.object;
//
// // 检测
// if (![[[[FUSLiveHelper shareInstance]roomInfoModel]roomId] isEqualToString:[NSString stringWithFormat:@"%d", socketMessageModel.extend1]]) {
// return;
// }
//
// if ([FUSGiftCenter fus_shareGiftCenter].isGiftAnimating) {
// return;
// }
//
// NSDictionary *dict = [socketMessageModel fus_getJsonDict];
// if (![FUSLiveChatDataSourceHelper fus_checkActiveCanShowWithDict:dict]) {
// return;
// }
// NSDictionary *userDict = [dict objectForKey:@"user"];
// NSDictionary *vehicleDict = [dict objectForKey:@"vehicle"];
// NSDictionary *tipDict = [dict objectForKey:@"tips"];
//
// if ([NSDictionary isNull:tipDict]) {
// tipDict = [NSString converToDictionaryWithJsonString:socketMessageModel.jsondata];
// }
//
// [FUSMotorsView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
//
// dispatch_async(dispatch_get_main_queue(), ^{
// // 如果正在播放大礼物,则不显示座驾
// if ([FUSGiftCenter fus_shareGiftCenter].animation) {
// return;
// }
// [self.motorsView fus_stopAnimation];
// [self.motorsView removeFromSuperview];
//
// [self.webpMotorsView fus_stopAnimation];
// [self.webpMotorsView removeFromSuperview];
//
// if (self.pusherAcitivtyView) {
//
// BOOL isPushModel = self.scrollView.offsetX < self.scrollView.width / 2.0;
//
// if (isPushModel) {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.pusherChatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// } else {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.bottomToolView.height - self.chatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// }
//
// } else {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.fus_chatTextViewHeight - TABLE_VIEW_HEIGHT - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// }
// _motorsView.userInteractionEnabled = NO;
// [[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.motorsView];
//
//
//
// [_motorsView setAnimationDidEnd:^(UIView *animatingView) {
// [animatingView removeFromSuperview];
// }];
// __weak typeof(self) weakSelf = self;
// [self.motorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
// [weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
// userInfoModel:model
// shouldRequestData:YES
// showManagerBtn:YES
// enableAtBtn:YES];
// }];
//
// [self.motorsView fus_setupMotorsViewWithTipAttr:attributedString
// uid:[[userDict objectForKey:@"realUid"] description]
// motorImageUrl:nil
// level:[userDict objectForKey:@"realLevel"]
// ishidden:[[userDict objectForKey:@"isHide"] boolValue]];
// [weakSelf.motorsView fus_startEnterAnimation];
// });
// }];
//}
/**
接收座驾进入包房通知
......@@ -2436,105 +2440,154 @@ UIGestureRecognizerDelegate
NSString *mid = [vehicleDict[@"mid"] description];
FUSMotorDataModel *motorModel = [FUSGiftDataCenter sharedCenter].motorGiftDict[mid];
// 2.1.0: 座驾新增
if ([NSString isNull:motorModel.darkRes]) {
// 没有资源文件,使用旧版座驾显示
[FUSMotorsView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
dispatch_async(dispatch_get_main_queue(), ^{
// 如果正在播放大礼物,则不显示座驾
if ([FUSGiftCenter fus_shareGiftCenter].animation) {
return;
}
[self.motorsView fus_stopAnimation];
[self.motorsView removeFromSuperview];
[self.webpMotorsView fus_stopAnimation];
[self.webpMotorsView removeFromSuperview];
if (self.pusherAcitivtyView) {
BOOL isPushModel = self.scrollView.offsetX < self.scrollView.width / 2.0;
if (isPushModel) {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.pusherChatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
} else {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.bottomToolView.height - self.chatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
}
} else {
self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.fus_chatTextViewHeight - TABLE_VIEW_HEIGHT - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
}
_motorsView.userInteractionEnabled = NO;
[[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.motorsView];
//新版本代码
//ludy 座驾入场的动画
//如果正在播放的座驾等级高于现在进入的,则丢弃
if ( self.carEnterView && self.carEnterView.motorModel.carGrade > motorModel.carGrade) {
return;
}
MJWeakSelf
[FUSCarEnterView fus_attributedContentForDataict:dict complete:^(NSMutableAttributedString * _Nonnull attributedString) {
// 如果正在播放大礼物,则不显示座驾
if ([FUSGiftCenter fus_shareGiftCenter].animation) {
return;
}
[weakSelf.carEnterView fus_stopAnimation];
[_motorsView setAnimationDidEnd:^(UIView *animatingView) {
[animatingView removeFromSuperview];
}];
__weak typeof(self) weakSelf = self;
[self.motorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
[weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
userInfoModel:model
shouldRequestData:YES
showManagerBtn:YES
enableAtBtn:YES];
}];
[self.motorsView fus_setupMotorsViewWithTipAttr:attributedString
uid:[[userDict objectForKey:@"realUid"] description]
motorImageUrl:[vehicleDict objectForKey:@"resource"]
level:[userDict objectForKey:@"realLevel"]
ishidden:[[userDict objectForKey:@"isHide"] boolValue]];
[weakSelf.motorsView fus_startEnterAnimation];
});
}];
} else {
// 有资源文件,使用 webp View 显示
weakSelf.carEnterView = nil;
weakSelf.carEnterView = [[FUSCarEnterView alloc] initWithFrame:UIView.fus_screenFrame];
weakSelf.carEnterView.hidden = NO;
[FUSMotorWEBPView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
dispatch_async(dispatch_get_main_queue(), ^{
// 如果正在播放大礼物,则不显示座驾
if ([FUSGiftCenter fus_shareGiftCenter].animation) {
return;
}
[self.motorsView fus_stopAnimation];
[self.motorsView removeFromSuperview];
[self.webpMotorsView fus_stopAnimation];
[self.webpMotorsView removeFromSuperview];
__weak typeof(self) weakSelf = self;
// 有资源文件,使用 webp View 显示
self.webpMotorsView = nil;
self.webpMotorsView = [[FUSMotorWEBPView alloc] initWithFrame:UIView.fus_screenFrame];
self.webpMotorsView.hidden = NO;
self.webpMotorsView.userInteractionEnabled = NO;
[[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.webpMotorsView];
[self.webpMotorsView setAnimationDidEnd:^(UIView *animatingView) {
[animatingView removeFromSuperview];
weakSelf.webpMotorsView = nil;
}];
[self.webpMotorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
[weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
userInfoModel:model
shouldRequestData:YES
showManagerBtn:YES
enableAtBtn:YES];
}];
[self.webpMotorsView fus_setupMotorsViewWithMid:mid
tipAttr:attributedString
ishidden:[[userDict objectForKey:@"isHide"] boolValue]
level:[userDict objectForKey:@"realLevel"]
uid:[[userDict objectForKey:@"realUid"] description]];
});
weakSelf.carEnterView.userInteractionEnabled = NO;
[[weakSelf fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:weakSelf.carEnterView];
if (weakSelf.chatFastInputView && weakSelf.chatFastInputView.isHidden == NO) {
[weakSelf.carEnterView fus_setCarBottomOffset:-weakSelf.chatFastInputView.height withAnimate:YES];
}
[weakSelf.carEnterView setAnimationDidEnd:^(UIView *animatingView) {
[animatingView removeFromSuperview];
weakSelf.carEnterView = nil;
}];
}
[weakSelf.carEnterView setTapContentHandler:^(FUSRoomUserInfoModel * _Nonnull model) {
[weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
userInfoModel:model
shouldRequestData:YES
showManagerBtn:YES
enableAtBtn:YES];
}];
[weakSelf.carEnterView fus_setupMotorsViewWithMid:mid
tipAttr:attributedString ishidden:[[userDict objectForKey:@"isHide"] boolValue]
level:[userDict objectForKey:@"realLevel"]
imageURL:[vehicleDict objectForKey:@"resource"]
uid:[[userDict objectForKey:@"realUid"] description]];
}];
// 2.1.0: 座驾新增
// if ([NSString isNull:motorModel.darkRes]) {
// // 没有资源文件,使用旧版座驾显示
// [FUSMotorsView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
//
// dispatch_async(dispatch_get_main_queue(), ^{
// // 如果正在播放大礼物,则不显示座驾
// if ([FUSGiftCenter fus_shareGiftCenter].animation) {
// return;
// }
// [self.motorsView fus_stopAnimation];
// [self.motorsView removeFromSuperview];
//
// [self.webpMotorsView fus_stopAnimation];
// [self.webpMotorsView removeFromSuperview];
//
// if (self.pusherAcitivtyView) {
//
// BOOL isPushModel = self.scrollView.offsetX < self.scrollView.width / 2.0;
//
// if (isPushModel) {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.pusherChatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// } else {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.bottomToolView.height - self.chatTableView.height - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// }
//
// } else {
// self.motorsView = [[FUSMotorsView alloc]initWithFrame:CGRectMake(0, self.height - self.fus_chatTextViewHeight - TABLE_VIEW_HEIGHT - 6 - MOTORS_VIEW_HEIGHT - 6 - (@available(iOS 11.0, *)?UIView.fus_SafeBottom:0), MOTORS_VIEW_WIDTH, MOTORS_VIEW_HEIGHT)];
// }
// _motorsView.userInteractionEnabled = NO;
// [[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.motorsView];
//
//
//
// [_motorsView setAnimationDidEnd:^(UIView *animatingView) {
// [animatingView removeFromSuperview];
// }];
// __weak typeof(self) weakSelf = self;
// [self.motorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
// [weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
// userInfoModel:model
// shouldRequestData:YES
// showManagerBtn:YES
// enableAtBtn:YES];
// }];
//
// [self.motorsView fus_setupMotorsViewWithTipAttr:attributedString
// uid:[[userDict objectForKey:@"realUid"] description]
// motorImageUrl:[vehicleDict objectForKey:@"resource"]
// level:[userDict objectForKey:@"realLevel"]
// ishidden:[[userDict objectForKey:@"isHide"] boolValue]];
// [weakSelf.motorsView fus_startEnterAnimation];
// });
// }];
// } else {
//
// [FUSMotorWEBPView attributedContentForTipDict:tipDict isHide:[[userDict objectForKey:@"isHide"] boolValue] complete:^(NSMutableAttributedString *attributedString) {
//
// dispatch_async(dispatch_get_main_queue(), ^{
// // 如果正在播放大礼物,则不显示座驾
// if ([FUSGiftCenter fus_shareGiftCenter].animation) {
// return;
// }
// [self.motorsView fus_stopAnimation];
// [self.motorsView removeFromSuperview];
//
// [self.webpMotorsView fus_stopAnimation];
// [self.webpMotorsView removeFromSuperview];
//
// __weak typeof(self) weakSelf = self;
// // 有资源文件,使用 webp View 显示
// self.webpMotorsView = nil;
// self.webpMotorsView = [[FUSMotorWEBPView alloc] initWithFrame:UIView.fus_screenFrame];
// self.webpMotorsView.hidden = NO;
//
// self.webpMotorsView.userInteractionEnabled = NO;
// [[self fus_viewWithLayer:FUSLiveFunctionLayerEffects] addSubview:self.webpMotorsView];
//
// [self.webpMotorsView setAnimationDidEnd:^(UIView *animatingView) {
// [animatingView removeFromSuperview];
// weakSelf.webpMotorsView = nil;
// }];
//
// [self.webpMotorsView setTapContentHandler:^(FUSRoomUserInfoModel *model) {
//
// [weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive
// userInfoModel:model
// shouldRequestData:YES
// showManagerBtn:YES
// enableAtBtn:YES];
// }];
// [self.webpMotorsView fus_setupMotorsViewWithMid:mid
// tipAttr:attributedString
// ishidden:[[userDict objectForKey:@"isHide"] boolValue]
// level:[userDict objectForKey:@"realLevel"]
// uid:[[userDict objectForKey:@"realUid"] description]];
// });
// }];
// }
}
/**
......@@ -2734,12 +2787,14 @@ UIGestureRecognizerDelegate
// 海外 2.1.0 大礼物效果时移除座驾效果
if (aniModel.giftModel.level.integerValue <= 3) {
[weakSelf.motorsView fus_stopAnimation];
[weakSelf.motorsView removeFromSuperview];
weakSelf.motorsView = nil;
[weakSelf.webpMotorsView fus_stopAnimation];
[weakSelf.webpMotorsView removeFromSuperview];
weakSelf.webpMotorsView = nil;
// [weakSelf.motorsView fus_stopAnimation];
// [weakSelf.motorsView removeFromSuperview];
// weakSelf.motorsView = nil;
// [weakSelf.webpMotorsView fus_stopAnimation];
// [weakSelf.webpMotorsView removeFromSuperview];
// weakSelf.webpMotorsView = nil;
[weakSelf.carEnterView fus_stopAnimation];
weakSelf.carEnterView = nil;
} else {
}
}];
......@@ -2789,17 +2844,20 @@ UIGestureRecognizerDelegate
// 获取数量
aniModel.num = [NSString stringWithFormat:@"%ld", (long)count];
MJWeakSelf
// 发送礼物
[[FUSGiftCenter fus_shareGiftCenter] fus_addGiftAnimationWithModel:aniModel];
// 海外 2.1.0 大礼物效果时移除座驾效果
if (giftModel.level.integerValue <= 3) {
[_motorsView fus_stopAnimation];
[_motorsView removeFromSuperview];
_motorsView = nil;
[_webpMotorsView fus_stopAnimation];
[_webpMotorsView removeFromSuperview];
_webpMotorsView = nil;
// [_motorsView fus_stopAnimation];
// [_motorsView removeFromSuperview];
// _motorsView = nil;
// [_webpMotorsView fus_stopAnimation];
// [_webpMotorsView removeFromSuperview];
// _webpMotorsView = nil;
[weakSelf.carEnterView fus_stopAnimation];
weakSelf.carEnterView = nil;
}
}else{
......@@ -3239,8 +3297,10 @@ UIGestureRecognizerDelegate
- (void)recieveStartWholeEffectAnimation{
[_motorsView fus_stopAnimation];
[_webpMotorsView fus_stopAnimation];
// [_motorsView fus_stopAnimation];
// [_webpMotorsView fus_stopAnimation];
[self.carEnterView fus_stopAnimation];
self.carEnterView = nil;
}
/**
......@@ -4885,13 +4945,16 @@ UIGestureRecognizerDelegate
// [_chatInputView fus_cleanChatInputView];
[_motorsView fus_stopAnimation];
[_motorsView removeFromSuperview];
_motorsView = nil;
// [_motorsView fus_stopAnimation];
// [_motorsView removeFromSuperview];
// _motorsView = nil;
//
// [_webpMotorsView fus_stopAnimation];
// [_webpMotorsView removeFromSuperview];
// _webpMotorsView = nil;
[_webpMotorsView fus_stopAnimation];
[_webpMotorsView removeFromSuperview];
_webpMotorsView = nil;
[self.carEnterView fus_stopAnimation];
self.carEnterView = nil;
[_likeNoticeView removeFromSuperview];
_likeNoticeView = nil;
......@@ -5915,6 +5978,7 @@ UIGestureRecognizerDelegate
_pushLinkMicroView.alpha = 1 - alpha;
_linkMicroView.alpha = alpha;
_carEnterView.alpha = alpha;
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
......
......@@ -60,6 +60,9 @@ NS_ASSUME_NONNULL_BEGIN
// 是否自己闭的麦
@property (nonatomic, assign) BOOL selfCloseMic;
/// 自己是否在麦上
@property (nonatomic, assign, readonly) BOOL selfOnMicList;
//view的数量
@property (nonatomic, assign) NSInteger viewAmount;
......
......@@ -1331,6 +1331,15 @@
return _emptyModel;
}
- (BOOL)selfOnMicList{
for (FUSLinkMicroModel *model in self.models) {
if (model.uid == [FUSCacheDataShare shareStore].userDetailInfo.uid) {
return YES;
}
}
return NO;
}
#pragma mark - setter
/// 本地音频静音
......
//
// FUSCarEnterView.h
// LiveRoom
//
// Created by aaa on 2023/9/25.
//
#import <UIKit/UIKit.h>
#import "FUSLiveChatInputTextView.h"
#define CONTENTLABEL_HEIGHT 25
#define BASELEVLE_CAR_WIDTH 120/2.0f
#define BOTTOM_MARGIN (UIView.fus_SafeBottom + CHAT_TEXT_INPUT_PART_HEIGHT)
#define CONTENTVIEW_HEIGHT BASELEVLE_CAR_WIDTH * 8
NS_ASSUME_NONNULL_BEGIN
@interface FUSCarEnterView : UIView
/**
动画结束回调
*/
@property (nonatomic, copy) void(^animationDidEnd)(UIView *animatingView);
/**
点击回调
*/
@property (nonatomic, copy) void(^tapContentHandler)(FUSRoomUserInfoModel *model);
///播放中的座驾信息
@property (nonatomic, strong) FUSMotorDataModel *motorModel;
/**
是否正在动画中
*/
@property (nonatomic, assign) BOOL isAnimating;
/**
开始进场动画
*/
- (void)fus_startEnterAnimation;
/**
停止动画
*/
- (void)fus_stopAnimation;
/// 设置下座驾下面的偏移量
-(void)fus_setCarBottomOffset:(CGFloat)carBottomOffset withAnimate:(BOOL)animate;
/// 根据座驾设置view
/// - Parameters:
/// - mid: mid 座驾 ID
/// - tipAttr: 富文本:xxx开着xxx来了
/// - ishidden: 是否是隐身用户
/// - uid: uid
- (void)fus_setupMotorsViewWithMid:(NSString *)mid
tipAttr:(NSMutableAttributedString *)tipAttr
ishidden:(BOOL)ishidden
level:(NSString *)level
imageURL:(NSString *)imageURL
uid:(NSString *)uid;
/**
根据 tip 异步线程创建富文本,complete已经返回主线程
*/
+ (void)fus_attributedContentForDataict:(NSDictionary *)dataDict
complete:(void(^)(NSMutableAttributedString *attributedString))complete;
@end
NS_ASSUME_NONNULL_END
//
// FUSCarEnterView.m
// LiveRoom
//
// Created by aaa on 2023/9/25.
//
#import "FUSCarEnterView.h"
#import <YYKit/YYKit.h>
#import <Masonry/Masonry.h>
#import <FUSFoundation/FUSFoundation-Swift.h>
#define MOTOR_FONT [UIFont systemFontOfSize:16]
#define CONTENT_MARGIN 0
///文字内容开头的冗余
#define CONTENTLABEL_MARGIN 12
@interface FUSCarEnterView () <FUSKeyboardShowHelperDelegate>
/**
内容 View,里面承载了显示的label,1.2.3级的image,第4级的image另外显示
*/
@property (nonatomic, strong) UIView *contentView;
/**
内容 Label,第1级的image在label里面
*/
@property (nonatomic, strong) YYLabel *contentLabel;
/**
content Label 背景 View
*/
//@property (nonatomic, strong) UIImageView *bgImageView;
// 背景渐变 View
@property (nonatomic, strong) UIImageView *bgGradientView;
/// 用于显示 WEBP 效果的 ImageView
@property (nonatomic, strong) YYAnimatedImageView *carImageView;
// 持有 UID
@property (nonatomic, copy) NSString *uid;
//座驾主人信息
@property (nonatomic, strong) FUSRoomUserInfoModel *model;
///动画进场时间
@property (nonatomic, assign) CGFloat animateEnterDuration;
///动画停留时间
@property (nonatomic, assign) CGFloat animateStayDuration;
///静态图片
@property (nonatomic, copy) NSString *carImageURL;
/// 下面的间距
@property (nonatomic, assign) CGFloat carBottomOffset;
@end
@implementation FUSCarEnterView
#pragma mark - Init
/**
初始化方法
@param frame Frame
@return 实例
*/
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initUI];
}
return self;
}
#pragma mark - UI
/**
搭建 UI
*/
- (void)initUI
{
self.layer.masksToBounds = YES;
self.userInteractionEnabled = YES;
self.animateEnterDuration = 0.5f;
self.animateStayDuration = 2.0f;
self.carBottomOffset = 0;
self.contentView = [[UIView alloc] initWithFrame:CGRectMake(-self.width, self.height - CONTENTVIEW_HEIGHT - BOTTOM_MARGIN + self.carBottomOffset, self.width - CONTENT_MARGIN * 2, CONTENTVIEW_HEIGHT)];
[self addSubview:self.contentView];
self.bgGradientView = [[UIImageView alloc] initWithFrame:CGRectMake(8, self.contentView.height - 35, self.width * 0.8f + CONTENTLABEL_MARGIN, 35)];
self.bgGradientView.contentMode = UIViewContentModeScaleToFill;
[self.contentView addSubview:self.bgGradientView];
//内容label
self.contentLabel = [[YYLabel alloc] initWithFrame:CGRectMake(CONTENTLABEL_MARGIN, (self.bgGradientView.height - CONTENTLABEL_HEIGHT)/2.0f, self.width * 0.8f, CONTENTLABEL_HEIGHT)];
_contentLabel.shadowColor = [UIColor colorWithHex:@"040000" alpha:0.5];
_contentLabel.shadowOffset = CGSizeMake(1, 1);
_contentLabel.shadowBlurRadius = 1;
[self.bgGradientView addSubview:self.contentLabel];
//移动的那个座驾webp
self.carImageView = [[YYAnimatedImageView alloc] init];
self.carImageView.contentMode = UIViewContentModeScaleAspectFit;
self.carImageView.backgroundColor = [UIColor clearColor];
// self.carImageView.hidden = YES;
[self.contentView addSubview:self.carImageView];
// 注册键盘弹起通知
[[FUSKeyboardShowHelper sharedInstance] addDelegate:self];
_contentView.userInteractionEnabled = YES;
_contentLabel.userInteractionEnabled = YES;
[self.contentLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapContent:)]];
}
- (void)dealloc{
[[FUSKeyboardShowHelper sharedInstance] removeDelegate:self];
}
#pragma mark - Public Method
- (void)fus_setupMotorsViewWithMid:(NSString *)mid tipAttr:(NSMutableAttributedString *)tipAttr ishidden:(BOOL)ishidden level:(NSString *)level imageURL:(id)imageURL uid:(NSString *)uid{
self.hidden = YES;
self.carImageURL = imageURL;
if (FUSLiveHelper.shareInstance.currentFunctionView.currentMode == FUSFunctionModePushMode) {
NSMutableAttributedString *mAttr = [[NSMutableAttributedString alloc] initWithAttributedString:tipAttr];
[mAttr addAttribute:NSFontAttributeName value:[UIFont fus_themeFont:18] range:NSMakeRange(0, tipAttr.length)];
tipAttr = [mAttr copy];
}
// NSString *bgIndex = [BFModule(DataCenterService) levelModel:level.integerValue].carPower;
// if (ishidden) {
// bgIndex = @"0";
// }
//
// if ([NSString isNullWithString:bgIndex]) {
// bgIndex = @"1";
// }
self.model = [[FUSRoomUserInfoModel alloc] init];
self.model.uid = uid;
self.model.realUid = uid;
self.model.isHide = @(ishidden).description;
//LUDY这里需要改成统一的背景,原本的宽高是207x44,现在是272x35,可能会有问题,留意一下
// NSString *imageName = [NSString stringWithFormat:@"live_enter_room_level_%@",bgIndex];
NSString *imageName = @"live_enter_room_normal399_70";
UIImage *bgImage = [FUSShowRoomCenterBunble imageNamed:imageName];
//规定下拉伸
// self.bgGradientView.image = [bgImage resizableImageWithCapInsets:UIEdgeInsetsMake(10, 20, bgImage.size.height - 20, bgImage.size.width - 40) resizingMode:UIImageResizingModeStretch];
self.bgGradientView.image = [bgImage stretchableImageWithLeftCapWidth:floor(bgImage.size.width/2) topCapHeight:floor(bgImage.size.height/2)];
//神秘人隐藏座驾
self.carImageView.hidden = ishidden;
CGFloat width = [tipAttr boundingRectWithSize:CGSizeMake(UIView.fus_screenW * 0.8, self.contentLabel.height) options:NSStringDrawingUsesLineFragmentOrigin context:nil].size.width;
self.contentLabel.width = width;
self.bgGradientView.width = width + CONTENTLABEL_MARGIN + 20;
// [self.bgGradientView yartl_resetFrameToFitRTL];
// [self.contentLabel yartl_resetFrameToFitRTL];
self.contentLabel.attributedText = tipAttr;
self.uid = uid;
self.motorModel = [FUSGiftDataCenter sharedCenter].motorGiftDict[mid];
self.contentView.x = -UIView.fus_screenW;
[self fus_SetupCarImageViewWithCarGard:self.motorModel.carGrade];
//有图像资源的下图像资源,或者直接取图像
if (self.motorModel.darkRes) {
MJWeakSelf
[[FUSGiftDataCenter sharedCenter] fus_fetchWebpResourceWithResourceUrl:self.motorModel.darkRes resourceMd5:self.motorModel.darkMd5 completion:^(YYImage *yyImage) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if ([yyImage isKindOfClass:[YYImage class]]) {
((YYImage *)yyImage).preloadAllAnimatedImageFrames = YES;
}
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.carImageView.image = yyImage;
[weakSelf fus_startEnterAnimation];
});
});
});
}];
}else {
//没图像资源的给静态图
[self.carImageView setWebImageWithSubURLString:self.carImageURL];
[self fus_startEnterAnimation];
}
}
/**
开始进场动画
*/
- (void)fus_startEnterAnimation
{
if ( [FUSKeyboardShowHelper sharedInstance].isShow ) {
CGRect keyboardFrame = [FUSKeyboardShowHelper sharedInstance].keyboardFrame;
[self fus_restContentYWithKeyboardFrame:keyboardFrame withAnimate:NO];
}
[self.motorModel fus_playMotorAudioIfNeeded];
_carImageView.animationRepeatCount = 1;
_carImageView.contentMode = UIViewContentModeScaleAspectFit;
_contentView.x = -UIView.fus_screenW;
_carImageView.alpha = 0;
self.hidden = NO;
CGFloat enterDuration = 0.5f;
self.carImageView.alpha = 1;
[self.carImageView startAnimating];
self.isAnimating = YES;
[UIView animateWithDuration:self.animateEnterDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
self.contentView.x = CONTENT_MARGIN;
} completion:^(BOOL finished) {
[UIView animateWithDuration:enterDuration delay:self.animateStayDuration options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.contentView.x = UIView.fus_screenW;
} completion:^(BOOL finished) {
self.isAnimating = NO;
if (self.animationDidEnd) {
self.animationDidEnd(self);
}
}];
}];
}
- (void)fus_setCarBottomOffset:(CGFloat)carBottomOffset withAnimate:(BOOL)animate{
if (carBottomOffset == self.carBottomOffset) {
return;
}
if (animate) {
[UIView animateWithDuration:0.25 animations:^{
self.contentView.y = self.contentView.y - self.carBottomOffset + carBottomOffset;
}];
}else {
self.contentView.y = self.contentView.y - self.carBottomOffset + carBottomOffset;
}
self.carBottomOffset = carBottomOffset;
}
/**
停止动画
*/
- (void)fus_stopAnimation
{
[[FUSAudioHelper shareInstance] stop];
[self.contentView.layer removeAllAnimations];
[self.layer removeAllAnimations];
_carImageView.image = nil;
[self removeAllSubviews];
_animationDidEnd = nil;
_isAnimating = NO;
[self removeFromSuperview];
}
+ (void)fus_attributedContentForDataict:(NSDictionary *)dataDict complete:(void (^)(NSMutableAttributedString * _Nonnull))complete{
if (!complete) {
return;
}
NSDictionary *tipDict = [dataDict objectForKey:@"tips"];
if ([NSDictionary isNullWithDictionary:tipDict]) {
return;
}
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSString *content = [FUSFormatContentHelper fus_getContentFromDict:tipDict];
NSInteger lang = FUSLocalizationHelper.fus_currentLanguage.languageID.integerValue;
CGFloat imageW = 45.0*0.75;
CGFloat imageH = 27*0.75;
if (![NSString isNullWithString:content]) {
NSMutableAttributedString *attributedString = [NSMutableAttributedString fus_attributeStringWithHTMLString:content
baseColor:@"ffffff"
font:[UIFont fus_themeFont:13]
imgHeight:imageH
imgWidth:imageW];
dispatch_sync(dispatch_get_main_queue(), ^{
//ludy:下面是增加团标和金牌标志的,现在不要了
// NSDictionary *groupValueDict = dataDict[@"groupValue"];
// NSDictionary *userDict = dataDict[@"user"];
// if ( [groupValueDict[@"userGrade"] intValue] > 0 && ![userDict[@"isHide"] boolValue]) {
//
// UIView *groupNameView = [BFModule(PersonalPageService) fansGroupNameViewWithFrame:CGRectMake(0, 0, 60, 20) groupName:groupValueDict[@"groupName"] level:[groupValueDict[@"userGrade"] intValue] superGroup:[groupValueDict[@"superMedal"] boolValue]];
// NSAttributedString *groupNameAttr = [NSAttributedString attachmentStringWithContent:groupNameView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(groupNameView.width,groupNameView.height) alignToFont:[UIFont ff_default:13] alignment:YYTextVerticalAlignmentCenter];
// [attributedString insertAttributedString:groupNameAttr atIndex:0];
//
// }
complete(attributedString);
});
return ;
}
NSString *msg = [tipDict objectForKey:@"msg"];
NSArray *colors = [tipDict objectForKey:@"color"];
NSArray *marks = [tipDict objectForKey:@"mark"];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:msg ? msg : @"" attributes:@{NSFontAttributeName:[UIFont fus_themeFont:13],NSForegroundColorAttributeName:[UIColor whiteColor]}];
if (attr.length == 0) {
dispatch_sync(dispatch_get_main_queue(), ^{
complete(attr);
});
return ;
}
// 正则识别等级
NSString *regularStr = @"(\#LV:[0-9]+\#)";
NSError *error;
// 正则搜索
NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:regularStr
options:NSRegularExpressionCaseInsensitive
error:&error];
// 获取搜索结果数组
NSMutableArray *matchArr = [NSMutableArray arrayWithArray:[regularExpression matchesInString:msg options:NSMatchingReportProgress range:NSMakeRange(0, msg.length)]];
if (marks.count > 0 && colors.count > 0) {
// 循环遍历 mark
for (NSInteger i = marks.count - 1; i >= 0; i--) {
// 取出标记位置与颜色
NSString *markStr = [marks objectAtIndex:i];
NSString *colorStr = [colors objectAtIndex:i];
// 解析出位置
NSArray *markArr = [markStr componentsSeparatedByString:@"-"];
NSInteger location = [[markArr firstObject] integerValue];
NSInteger length = [[markArr lastObject] integerValue] - location + 1;
[attr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHex:colorStr alpha:1] range:NSMakeRange(location, length)];
}
}
NSString *pointRangeStr = tipDict[@"position"];
NSArray *pointPosArr = [pointRangeStr componentsSeparatedByString:@"-"];
pointPosArr = @[[NSString stringWithFormat:@"%ld", [[pointPosArr firstObject] integerValue]],
[NSString stringWithFormat:@"%ld", [[pointPosArr lastObject] integerValue] + 2]];
for (NSString *pointPos in pointPosArr) {
if (pointPos.integerValue < 0 ||
pointPos.integerValue >= attr.length) {
break;
}
NSAttributedString *levelAttr = [NSAttributedString attachmentStringWithContent:[FUSShowRoomCenterBunble imageNamed:@"live_motor_point_bg"] contentMode:UIViewContentModeCenter attachmentSize:CGSizeMake(8,20) alignToFont:[UIFont fus_themeFont:13] alignment:YYTextVerticalAlignmentCenter];
[attr insertAttributedString:levelAttr atIndex:pointPos.integerValue];
}
for (NSTextCheckingResult *result in matchArr) {
// 等级有值
if (result) {
// 等级有值
NSRange levelRange = [result range];
NSMutableString *levelStr = [NSMutableString stringWithString:[msg substringWithRange:levelRange]];
[levelStr replaceOccurrencesOfString:@"#" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, levelStr.length)];
[levelStr replaceOccurrencesOfString:@"LV:" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, levelStr.length)];
// 移除
[attr replaceCharactersInRange:levelRange withString:@""];
if (levelStr.integerValue > 0) {
UIImage *levelImage = [UIImage fus_imageWithLevel:levelStr.integerValue];
if (levelImage) {
CGFloat height = 14;
CGFloat width = height / levelImage.size.height * levelImage.size.width;
NSAttributedString *levelAttr = [NSAttributedString attachmentStringWithContent:levelImage contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(width, height) alignToFont:[UIFont fus_themeFont:15] alignment:YYTextVerticalAlignmentCenter];
[attr appendAttributedString:levelAttr];
}
// 有等级
// FFLevelModel *levelModel = [BFModule(DataCenterService) levelModel:levelStr.integerValue];;
//
// UIImageView *downloadView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 45, 27)];
// downloadView.contentMode = UIViewContentModeScaleAspectFit;
// // 创建 attachment
// NSAttributedString *levelAttr = [NSAttributedString attachmentStringWithContent:downloadView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(45,27) alignToFont:[UIFont ff_default:13] alignment:YYTextVerticalAlignmentCenter];
// [attr insertAttributedString:levelAttr atIndex:levelRange.location];
// [downloadView oc_setWebImage:levelModel.icon placeholderImage:nil];
}
}
}
dispatch_sync(dispatch_get_main_queue(), ^{
complete(attr);
});
return;
});
}
#pragma mark - Action
/**
点击 Label 事件
@param tap 手势事件
*/
- (void)onTapContent:(UITapGestureRecognizer *)tap
{
if (_tapContentHandler) {
_tapContentHandler(self.model);
}
}
#pragma mark notification
- (void)fus_keyboardStatusDidChangeWithIsShow:(BOOL)isShow keyBoardFrame:(CGRect)keyBoardFrame{
if (isShow) {
[self fus_restContentYWithKeyboardFrame:keyBoardFrame withAnimate:YES];
}else{
[UIView animateWithDuration:.35 animations:^{
self.contentView.y = self.height - CONTENTVIEW_HEIGHT - BOTTOM_MARGIN + self.carBottomOffset;
}];
}
}
- (void)fus_restContentYWithKeyboardFrame:(CGRect)keyboardFrame withAnimate:(bool)animate{
CGFloat keyboardHeight = keyboardFrame.size.height;
if (animate) {
[UIView animateWithDuration:.35 animations:^{
self.contentView.y = self.height - keyboardHeight - self.contentView.height - CHAT_TEXT_VIEW_HEIGHT - 8 + self.carBottomOffset;
}];
}else {
self.contentView.y = self.height - keyboardHeight - self.contentView.height - CHAT_TEXT_VIEW_HEIGHT - 8 + self.carBottomOffset;
}
}
#pragma mark helper
///重制所有图形
-(void)fus_ResetContentView{
if (self.contentView.x >= 0) {
self.contentView.x = -self.width;
}
[self.carImageView stopAnimating];
}
/// 根据等级创建座驾的webp位置
/// - Parameter level: 1-5
-(void)fus_SetupCarImageViewWithCarGard:(NSInteger)gard{
[self.carImageView stopAnimating];
if ( gard == 1 || gard == 2) {
self.animateEnterDuration = 0.5f;
self.animateStayDuration = 2.0f;
} else if ( gard == 3 || gard == 4 || gard > 4 ) {
self.animateEnterDuration = 2.0f;
self.animateStayDuration = 2.5f;
}
// self.animateEnterDuration = 2.0f;
// self.animateStayDuration = 22.5f;
CGFloat carWidth = BASELEVLE_CAR_WIDTH;
switch (gard) {
case 1:
case 2:
carWidth = pow(2, gard - 1) * BASELEVLE_CAR_WIDTH;
break;
case 3:
carWidth = pow(2, 1) * BASELEVLE_CAR_WIDTH * 2;
break;
case 4:
case 5:
carWidth = pow(2, 1) * BASELEVLE_CAR_WIDTH * 2 * 1.5;
break;
default:
break;
}
self.carImageView.frame = CGRectMake(self.contentLabel.width - carWidth * 0.15f, self.contentView.height - carWidth + carWidth * 0.1f, carWidth, carWidth);
if ( CGRectGetMaxX(self.carImageView.frame) > self.contentView.width ) {
//如果直接尾随会超出屏幕,那么就紧贴着屏幕左边定位
[self.carImageView setX:self.contentView.width - carWidth];
}
}
@end
#if 0 //这里是dataDict的一个返回,参考一下结构
{"user":{"addr":"中國大陸","age":32,"country":"CN","face":"/user/boy.png","gag":0,"guardian":-1,"haveGem":0,"inPay":0,"isHide":0,"isdisplay":0,"isnew":0,"lang":2,"lev":8,"level":9,"nickname":"Lydia","ownerIsDisplay":0,"privilege":{"firstChargePower":0,"guardHeight":0,"guardIcon":"","guardWidth":0,"medalIcon":"","notVip":false,"richPower":1,"tailHeight":0,"tailWidth":0,"vip":true},"realLevel":9,"realUid":11123698,"sex":0,"uid":11123698,"userType":0,"xingzuo":"獅子座"},"vehicle":{"audioresource":"","carGrade":2,"color":"","makewords":"{UNAME}开着{CAR}来了!","mid":2406,"mname":"BMW 750L","periods":0,"resource":"/motroing/d4b3c3736ef54257a0e258aa71516895.png","shopresource":"/motroing/7f9604c584d747f4b556af9306e8cd38.webp"},"tips":{"msg":" #LV:9# Lydia 开着BMW 750L来了!","clickParam":[{"uid":11123698}],"color":["e0e0e0"],"clickMark":["8-12"],"clickType":[1],"mark":["8-12"],"imgMark":[1],"imgType":["NONE"],"position":"8-12","isHide":0,"lang":2,"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","multiContents":[{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":1},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":2},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":4},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":5},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>‏‪Lydia‬‏<\/font><\/a> 开着<font >‏‪BMW 750L‬‏<\/font>来了!","lang":7},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":8},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":9},{"content":" <img src=https://big.bgp.ourpow.com/comm/userlevel/v3/9.png /> <a style=text-decoration:none; href=firefly://firefly.live?clickType=1&uid=11123698&isHide=0><font color=#e0e0e0>Lydia<\/font><\/a> 开着<font >BMW 750L<\/font>来了!","lang":10}]},"position":"8-12","carGrade":2,"userGrade":0,"groupValue":{"superMedal":1,"groupName":"","userGrade":0},"code":1}
#endif
......@@ -317,7 +317,7 @@
- (void)fus_restContentY:(CGRect)keyboardFrame{
CGFloat keyboardHeight = keyboardFrame.size.height;
[FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
// [FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
CGFloat animationMovementOnKeyboardShow = self.height - self.contentView.y - keyboardHeight - BULLETS_LIST_HEIGHT - self.contentView.height - 10;
......@@ -325,7 +325,7 @@
return;
}
[FUSKeyboardShowHelper sharedInstance].isShow = YES;
// [FUSKeyboardShowHelper sharedInstance].isShow = YES;
[UIView animateWithDuration:.35 animations:^{
......@@ -353,7 +353,7 @@
// 接收键盘收回通知
- (void)recieveKeyboardWillHideNotification:(NSNotification *)notification
{
[FUSKeyboardShowHelper sharedInstance].isShow = false;
// [FUSKeyboardShowHelper sharedInstance].isShow = false;
[UIView animateWithDuration:.35 animations:^{
if (@available(iOS 11.0, *)) {
......
......@@ -658,7 +658,7 @@
- (void)fus_restContentY:(CGRect)keyboardFrame{
CGFloat keyboardHeight = keyboardFrame.size.height;
[FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
// [FUSKeyboardShowHelper sharedInstance].keyboardFrame = keyboardFrame;
CGFloat animationMovementOnKeyboardShow = self.y - self.height - 10 - keyboardHeight;
......@@ -666,7 +666,7 @@
return;
}
[FUSKeyboardShowHelper sharedInstance].isShow = YES;
// [FUSKeyboardShowHelper sharedInstance].isShow = YES;
[UIView animateWithDuration:.35 animations:^{
......@@ -695,7 +695,7 @@
// 接收键盘收回通知
- (void)recieveKeyboardWillHideNotification:(NSNotification *)notification
{
[FUSKeyboardShowHelper sharedInstance].isShow = false;
// [FUSKeyboardShowHelper sharedInstance].isShow = false;
[UIView animateWithDuration:.35 animations:^{
......
......@@ -68,6 +68,10 @@
return [FUSLiveHelper shareInstance].currentFunctionView.linkMicroView.micListArr.count > 0;
}
- (BOOL)selfOnMicList{
return [FUSLiveHelper shareInstance].currentFunctionView.linkMicroView.selfOnMicList;
}
- (BOOL)isRoomVisable {
return [FUSLiveHelper shareInstance].isRoomVisable;
}
......
......@@ -7,12 +7,12 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>74</integer>
<integer>76</integer>
</dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>75</integer>
<integer>77</integer>
</dict>
</dict>
</dict>
......
......@@ -108,7 +108,7 @@
- (void)keyBoardWillChangeFrame:(NSNotification*)notification{
CGRect frame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
[FUSKeyboardShowHelper sharedInstance].keyboardFrame = frame;
// [FUSKeyboardShowHelper sharedInstance].keyboardFrame = frame;
CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
CGFloat toolBarHeight = self.replyInputView.frame.size.height;
......@@ -120,7 +120,7 @@
- (void)keyBoardWillHideChangeFrame:(NSNotification*)notification{
[FUSKeyboardShowHelper sharedInstance].keyboardFrame = CGRectZero;
// [FUSKeyboardShowHelper sharedInstance].keyboardFrame = CGRectZero;
CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView animateWithDuration:duration animations:^{
......
......@@ -553,6 +553,8 @@
// 请求sh状态
[self checkAppStatus];
[[FUSKeyboardShowHelper sharedInstance] star];
return YES;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment