123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // TXChatMusicMessage.m
- // TUIChat
- //
- // Created by 王智 on 2023/8/10.
- //
- #import "TXChatMusicMessage.h"
- #define TXHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
- @implementation TXChatMusicMessage
- + (TUIMessageCellData *)getCellData:(V2TIMMessage *)message {
- NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.customElem.data options:NSJSONReadingAllowFragments error:nil];
- TXChatMusicMessage *cellData = [[TXChatMusicMessage alloc] initWithDirection:message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming];
- cellData.innerMessage = message;
- cellData.msgID = message.msgID;
-
- cellData.songName = param[@"songName"];
- cellData.teacherAvatar = param[@"teacherAvatar"];
- cellData.teacherName = param[@"teacherName"];
- cellData.chargeType = param[@"chargeType"];
- cellData.songAuth = param[@"songAuth"];
- cellData.musicTagNames = param[@"musicTagNames"];
- cellData.songId = param[@"songId"];
-
- return cellData;
- }
- + (NSString *)getDisplayString:(V2TIMMessage *)message {
- return @"[曲谱分享]";
- }
- - (CGSize)contentSize {
-
- CGFloat width = ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.height : [UIScreen mainScreen].bounds.size.width);
- return CGSizeMake(width, 100+20);
- }
- @end
|