需求暫存

This commit is contained in:
edwinQQQ
2025-03-24 16:09:48 +08:00
parent e27b564fdc
commit d9850e2c8b
13 changed files with 120 additions and 68 deletions

View File

@@ -58,7 +58,10 @@
} else {
NSString * messageText = model.message.text;
if (!messageText || (model.message.messageType != NIMMessageTypeTip && model.message.messageType != NIMMessageTypeText)) {
messageText = YMLocalizedString(@"MessageContentText0");
// messageText = YMLocalizedString(@"MessageContentText0");
messageText = [NSString stringWithFormat:@"%@\n%@",
YMLocalizedString(@"MessageContentText0"),
model.message.rawAttachContent];
}
QEmotionHelper *faceManager = [QEmotionHelper sharedEmotionHelper];
NSMutableAttributedString * attribute = [faceManager attributedStringByText:messageText font:[UIFont systemFontOfSize:13]];

View File

@@ -35,7 +35,10 @@
self.isSelf = [[NIMSDK sharedSDK].loginManager.currentAccount isEqualToString:message.from];
NSString * messageText = message.text;
if (!messageText) {
messageText = YMLocalizedString(@"MessageTextModel0");
// messageText = YMLocalizedString(@"MessageContentText0");
messageText = [NSString stringWithFormat:@"%@\n%@",
YMLocalizedString(@"MessageContentText0"),
message.rawAttachContent];
}
CGFloat width = [UILabel getWidthWithText:messageText height:kGetScaleWidth(36) font:kFontMedium(14)];

View File

@@ -25,7 +25,10 @@
}
}
if (!messageText) {
messageText = YMLocalizedString(@"MessageTextClickModel0");
// messageText = YMLocalizedString(@"MessageContentText0");
messageText = [NSString stringWithFormat:@"%@\n%@",
YMLocalizedString(@"MessageContentText0"),
message.rawAttachContent];
}
CGSize dstRect = CGSizeMake(CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2, MAXFLOAT);

View File

@@ -15,7 +15,10 @@
self.messageType = SessionMessageType_Text;
NSString * messageText = message.text;
if (!messageText) {
messageText = YMLocalizedString(@"MessageTextModel0");
// messageText = YMLocalizedString(@"MessageContentText0");
messageText = [NSString stringWithFormat:@"%@\n%@",
YMLocalizedString(@"MessageContentText0"),
message.rawAttachContent];
}
CGSize dstRect = CGSizeMake(CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2, MAXFLOAT);
QEmotionHelper *faceManager = [QEmotionHelper sharedEmotionHelper];

View File

@@ -103,9 +103,7 @@
[self.topicView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kMOMENTS_TEXT_TOPIC_HEIGHT);
}];
// [self.photoView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.width.mas_equalTo(KScreenWidth-30);
// }];
[self.toolBarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self.backView);
make.top.mas_equalTo(self.stackView.mas_bottom).mas_offset(10);
@@ -257,6 +255,7 @@
}
}
}
-(void)setMineMomentsInfo:(MomentsInfoModel *)mineMonentsInfo{
_mineMomentsInfo = mineMonentsInfo;
if (_mineMomentsInfo) {
@@ -277,9 +276,9 @@
make.height.mas_equalTo(0);
}];
}
CGFloat contentHeight = [XPMomentsLayoutConfig momentsContentHeight:_mineMomentsInfo] + 24;
self.topicView.hidden = _mineMomentsInfo.worldId <= 0;
if(_mineMomentsInfo.squareTop && _mineMomentsInfo.content.length == 0){
@@ -291,9 +290,9 @@
make.height.mas_equalTo(contentHeight);
}];
}
}
}
- (void)setMomentsInfo:(MomentsInfoModel *)monentsInfo {
_momentsInfo = monentsInfo;
if (_momentsInfo) {
@@ -318,7 +317,7 @@
CGFloat contentHeight = [XPMomentsLayoutConfig momentsContentHeight:_momentsInfo] + 24;
self.topicView.hidden = monentsInfo.worldId <= 0;
self.topicView.hidden = monentsInfo.worldId <= 0;
if(_momentsInfo.topicTop && _momentsInfo.content.length == 0){
[self.textView mas_updateConstraints:^(MASConstraintMaker *make) {
@@ -329,7 +328,6 @@
make.height.mas_equalTo(contentHeight);
}];
}
}
}

View File

@@ -189,7 +189,7 @@ UIKIT_EXTERN NSString *kRequestTicket;
}];
if (_momentsInfo) {
NSInteger row = [self.datasource indexOfObject:_momentsInfo];
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
}
}

View File

@@ -8,6 +8,10 @@
#import <Foundation/Foundation.h>
#import <SVGA.h>
NS_ASSUME_NONNULL_BEGIN
@class PIUniversalBannerItemModel;
@interface PIUniversalBannerModel : NSObject
@property(nonatomic,copy) NSDictionary *template;

View File

@@ -137,7 +137,6 @@ XPRoomGraffitiGiftAnimationViewDelegate
@property(nonatomic, assign) BOOL isPlayOfB;
@property(nonatomic, strong) NSMutableArray<PIBaseAnimationViewModel *> *animationListB; //
@property(nonatomic, assign) CGFloat broadCastHieght;
@property(nonatomic, assign) BOOL isLuckyGiftAnimation;
@property (nonatomic, strong) NetImageView *imageLoader;
@property (nonatomic, strong) SVGAImageView *datingEffectView;
@property (nonatomic, strong) NSMutableArray<AttachmentModel *> *sailingQueue;
@@ -147,8 +146,8 @@ XPRoomGraffitiGiftAnimationViewDelegate
@property (nonatomic,strong) SVGAImageView *luckyGiftEffectView; ///
@property (nonatomic, strong) VAPView *luckyVapGiftEffectView; ///VAP
@property(nonatomic, strong) PIUniversalBannerView *tempUniversalBanner; //
//@property(nonatomic, strong) PIUniversalBannerView *tempUniversalBanner; //
@property(nonatomic, strong) NSMutableArray <PIUniversalBannerView *>* universalBannerViewCaches;
@end
@implementation RoomAnimationView
@@ -165,10 +164,11 @@ XPRoomGraffitiGiftAnimationViewDelegate
[self pop_removeAllAnimations];
if (_giftEffectTimer) {
dispatch_source_cancel(self.giftEffectTimer);
self.giftEffectTimer = nil;
if (_giftEffectTimer && !dispatch_source_testcancel(_giftEffectTimer)) {
dispatch_source_cancel(_giftEffectTimer);
_giftEffectTimer = nil;
}
if (_giftEffectsQueue) {
self.giftEffectsQueue = NULL;
}
@@ -463,6 +463,54 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
#pragma mark - Method: Banner
- (void)inserBannerModelToQueue:(id)obj {
[self.roomBannertModelsQueueV2 addObject:obj];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
}
- (void)sortBannerQueue {
#if DEBUG
AttachmentModel *attachmentModel = [self.roomBannertModelsQueueV2 xpSafeObjectAtIndex:0];
if (attachmentModel) {
NSLog(@"内容:%@ | %@", [attachmentModel.data objectForKey:@"roomUid"], [attachmentModel.data objectForKey:@"uidList"]);
}
#endif
// TODO: >>
// MARK: ID
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
NSString *currentRoomUid = @(roomInfo.uid).stringValue;
NSString *currentUid = [AccountInfoStorage instance].getUid;
[self.roomBannertModelsQueueV2 sortUsingComparator:^NSComparisonResult(AttachmentModel * _Nonnull obj1, AttachmentModel * _Nonnull obj2) {
// obj1
NSArray *obj1UidList = [obj1.data valueForKey:@"uidList"];
NSString *obj1RoomUid = [obj1.data valueForKey:@"roomUid"];
BOOL obj1IsCurrentUser = obj1UidList && [obj1UidList containsObject:currentUid];
BOOL obj1IsCurrentRoom = obj1RoomUid && [obj1RoomUid isEqualToString:currentRoomUid];
// obj2
NSArray *obj2UidList = [obj2.data valueForKey:@"uidList"];
NSString *obj2RoomUid = [obj2.data valueForKey:@"roomUid"];
BOOL obj2IsCurrentUser = obj2UidList && [obj2UidList containsObject:currentUid];
BOOL obj2IsCurrentRoom = obj2RoomUid && [obj2RoomUid isEqualToString:currentRoomUid];
if (obj1IsCurrentUser && !obj2IsCurrentUser) {
return NSOrderedAscending;
} else if (!obj1IsCurrentUser && obj2IsCurrentUser) {
return NSOrderedDescending;
} else if (obj1IsCurrentRoom && !obj2IsCurrentRoom) {
return NSOrderedAscending;
} else if (!obj1IsCurrentRoom && obj2IsCurrentRoom) {
return NSOrderedDescending;
} else {
return NSOrderedSame;
}
}];
}
- (void)processNextRoomEffectAttachment {
//
if (self.roomBannertModelsQueueV2.count == 0) {
@@ -473,6 +521,8 @@ XPRoomGraffitiGiftAnimationViewDelegate
if (self.isRoomBannerV2Displaying) {
return;
}
[self sortBannerQueue];
//
AttachmentModel *nextAttachment = [self.roomBannertModelsQueueV2 firstObject];
@@ -510,12 +560,12 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
}
- (void)receiveLuckyPackageBanner:(AttachmentModel *)obj {
[self.roomBannertModelsQueueV2 addObject:obj];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
}
//- (void)receiveLuckyPackageBanner:(AttachmentModel *)obj {
// [self.roomBannertModelsQueueV2 addObject:obj];
// if (!self.isRoomBannerV2Displaying) {
// [self processNextRoomEffectAttachment];
// }
//}
- (void)playLuckyPackageBanner:(AttachmentModel *)obj {
if (!obj.data) {
@@ -539,10 +589,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
- (void)receiveRoomGiftBanner:(AttachmentModel *)obj {
[self.roomBannertModelsQueueV2 addObject:obj];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
[self inserBannerModelToQueue:obj];
}
- (void)playRoomGiftBanner:(AttachmentModel *)obj {
@@ -563,10 +610,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
- (void)receiveCPEvent:(AttachmentModel *)attachment {
[self.roomBannertModelsQueueV2 addObject:attachment];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
[self inserBannerModelToQueue:attachment];
}
- (void)playCPBinding:(AttachmentModel *)attachment {
@@ -611,10 +655,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
- (void)receiveLuckGiftBanner:(AttachmentModel *)attachment {
[self.roomBannertModelsQueueV2 addObject:attachment];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
[self inserBannerModelToQueue:attachment];
}
- (void)playLuckyWinningBanner:(AttachmentModel *)nextAttachment {
@@ -654,10 +695,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
- (void)receiveGameBanner:(AttachmentModel *)attachment {
[self.roomBannertModelsQueueV2 addObject:attachment];
if (!self.isRoomBannerV2Displaying) {
[self processNextRoomEffectAttachment];
}
[self inserBannerModelToQueue:attachment];
}
- (void)playGameBanner:(AttachmentModel *)attachment {
@@ -835,7 +873,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
} else {
if (![NSString isEmpty:receiveInfo.mp4Url] || ![NSString isEmpty:receiveInfo.vggUrl]) {
[self.svgaQueue addObject:receiveInfo];
[self addToSvgaQueue:receiveInfo];
}
}
@@ -862,7 +900,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
model.isBatch = receiveInfo.isBatch;
model.targetAvatar = receiveInfo.targetAvatar;
model.targetNick = receiveInfo.targetNick;
[self.svgaQueue addObject:model];
[self addToSvgaQueue:model];
} else if (obj.hasVggPic && roomInfo.hasAnimationEffect) {
GiftReceiveInfoModel * model = [[GiftReceiveInfoModel alloc] init];
model.mp4Url = obj.viewUrl;
@@ -874,7 +912,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
model.isBatch = receiveInfo.isBatch;
model.targetAvatar = receiveInfo.targetAvatar;
model.targetNick = receiveInfo.targetNick;
[self.svgaQueue addObject:model];
[self addToSvgaQueue:model];
}
}];
}
@@ -907,7 +945,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
[self createGiftSvgaAnimation:receiveModel];
});
}else {
[self.svgaQueue removeObjectAtIndex:0];
[self removeFromSvgaQueueAtIndex:0];
self.isPlayingGiftEffect = NO;
}
}
@@ -965,11 +1003,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
@kWeakify(self);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@kStrongify(self);
dispatch_async(self.giftEffectsQueue, ^{
if (self.svgaQueue.count > 0) {
[self.svgaQueue removeObjectAtIndex:0];
}
});
[self removeFromSvgaQueueAtIndex:0];
});
}
@@ -1103,6 +1137,8 @@ XPRoomGraffitiGiftAnimationViewDelegate
self.vapGiftEffectView.hidden = YES;
[self.vapGiftEffectView setMute:YES];
[self.vapGiftEffectView stopHWDMP4];
[self.vapGiftEffectView removeFromSuperview];
self.vapGiftEffectView = nil;
}
- (void)playPAGFailure {
@@ -2045,6 +2081,20 @@ XPRoomGraffitiGiftAnimationViewDelegate
return _svgaQueue;
}
- (void)addToSvgaQueue:(GiftReceiveInfoModel *)model {
dispatch_async(self.giftEffectsQueue, ^{
[self.svgaQueue addObject:model];
});
}
- (void)removeFromSvgaQueueAtIndex:(NSInteger)index {
dispatch_async(self.giftEffectsQueue, ^{
if (index < self.svgaQueue.count) {
[self.svgaQueue removeObjectAtIndex:index];
}
});
}
- (XPRoomGiftAnimationParser *)vapParser {
if (!_vapParser) {
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
@@ -2203,7 +2253,6 @@ XPRoomGraffitiGiftAnimationViewDelegate
- (void)createBigPrizeAnimation:(PIBaseAnimationViewModel *)prizeModel {
self.isPlayOfB = YES;
CGFloat top = (kNavigationHeight + 15);
self.isLuckyGiftAnimation = YES;
XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 71)];
luckyGiftEffectView.delegate = self;
[self.topContainer addSubview:luckyGiftEffectView];
@@ -2671,7 +2720,10 @@ XPRoomGraffitiGiftAnimationViewDelegate
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
bannerView.isSvga = isSvga;
bannerView.delegate = self;
self.tempUniversalBanner = bannerView;
if (!_universalBannerViewCaches) {
_universalBannerViewCaches = @[].mutableCopy;
}
[self.universalBannerViewCaches addObject:bannerView];
@kWeakify(bannerView);
@kWeakify(self);
[bannerView setAllowToPlay:^{
@@ -2698,6 +2750,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
@kStrongify(self);
if (finished) {
[bannerView removeFromSuperview];
[self.universalBannerViewCaches removeObject:bannerView];
self.isPlayOfB = NO;
if(self.animationListB.count > 0){
[self.animationListB removeObjectAtIndex:0];

View File

@@ -12,7 +12,7 @@
#import "RoomInfoModel.h"
#import "ClientConfig.h"
//
#define ownerTopMargin 35
#define ownerTopMargin 100//35
// 58 + 5
#define ownerWidth (45 + 5) * kScreenScale
// 12 10

View File

@@ -468,15 +468,12 @@
"MessageOpenLiveModel0" = "الآن %@ متصل";
"MessageTextClickModel0" = "نوع الرسالة غير معروف";
"PKIDLoginViewController2" = "يرجى التواصل مع خدمة العملاء";
"PKIDLoginViewController3" = "LINE: pekoyuyin";
"PKIDLoginViewController4" = "فهمت";
"MessageLevelUpgradeModel0" = "تهانينا! وصلت مستوى جاذبيتك إلى المستوى %@";
"MessageLevelUpgradeModel1" = "تهانينا! وصل مستواك إلى المستوى %@";
"MessageTextModel0" = "نوع الرسالة غير معروف";
"MessageTweetModel0" = "هذا لحساب ارتفاع السطر";
"MessageContentTweetView0" = "هذا لحساب ارتفاع السطر";
@@ -2612,15 +2609,12 @@ ineHeadView12" = "الحمل";
"MessageOpenLiveModel0" = "تم الانتقال إلى %@";
"MessageTextClickModel0" = "نوع الرسالة غير معروف";
"PKIDLoginViewController2" = "يرجى الاتصال بخدمة العملاء للمساعدة";
"PKIDLoginViewController4" = "فهمت";
"MessageLevelUpgradeModel0" = "تهانينا! لقد وصلت إلى مستوى سحرية %@";
"MessageLevelUpgradeModel1" = "تهانينا! لقد وصلت إلى مستوى %@";
"MessageTextModel0" = "نوع الرسالة غير معروف";
"MessageTweetModel0" = "هذا مثال على حساب ارتفاع السطر";
"MessageContentTweetView0" = "هذا مثال على حساب ارتفاع السطر";

View File

@@ -158,15 +158,12 @@
"MessageOpenLiveModel0" = "%@ is online now";
"MessageTextClickModel0" = "Unknown message type";
"PKIDLoginViewController2" = "Please contact customer service";
"PKIDLoginViewController3" = "LINEpekoyuyin";
"PKIDLoginViewController4" = "I understand";
"MessageLevelUpgradeModel0" = "Congratulations! Your charm level has reached %@";
"MessageLevelUpgradeModel1" = "Congratulations! Your level has reached %@";
"MessageTextModel0" = "Unknown message type";
"MessageTweetModel0" = "This is to calculate the height of a line";
"MessageContentTweetView0" = "This is to calculate the height of a line";

View File

@@ -1923,15 +1923,12 @@
"MessageOpenLiveModel0" = "%@ yayında";
"MessageTextClickModel0" = "Bilinmeyen mesaj türü";
"PKIDLoginViewController2" = "Lütfen müşteri hizmetleriyle iletişime geçin";
"PKIDLoginViewController3" = "LINE: pekoyuyin";
"PKIDLoginViewController4" = "Tamam";
"MessageLevelUpgradeModel0" = "Tebrikler! Çekicilik seviyeniz %@ seviyesine ulaştı";
"MessageLevelUpgradeModel1" = "Tebrikler! Seviyeniz %@ seviyesine ulaştı";
"MessageTextModel0" = "Bilinmeyen mesaj türü";
"MessageTweetModel0" = "Bu bir satırın yüksekliğini hesaplamak";
"MessageContentTweetView0" = "Bu bir satırın yüksekliğini hesaplamak";

View File

@@ -1967,15 +1967,12 @@
"MessageOpenLiveModel0" = "%@ 上線了";
"MessageTextClickModel0" = "未知消息類型";
"PKIDLoginViewController2" = "請聯繫客服處理";
"PKIDLoginViewController3" = "LINEpekoyuyin";
"PKIDLoginViewController4" = "我知道了";
"MessageLevelUpgradeModel0" = "恭喜!您的魅力等級已到達%@";
"MessageLevelUpgradeModel1" = "恭喜!您的等級已到達%@";
"MessageTextModel0" = "未知消息類型";
"MessageTweetModel0" = "這個是計算一行的高度的";
"MessageContentTweetView0" = "這個是計算一行的高度的";