TUIChatConfig_Minimalist.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. //
  2. // TUIChatConfig_Minimalist.m
  3. // TUIChat
  4. //
  5. // Created by Tencent on 2024/7/16.
  6. // Copyright © 2024 Tencent. All rights reserved.
  7. #import "TUIChatConfig_Minimalist.h"
  8. #import <TUICore/TUIConfig.h>
  9. #import <TIMCommon/TUIMessageCellLayout.h>
  10. #import <TIMCommon/TUIMessageCell.h>
  11. #import <TIMCommon/TIMConfig.h>
  12. #import <TIMCommon/TUIBubbleMessageCell_Minimalist.h>
  13. #import <TIMCommon/TUISystemMessageCellData.h>
  14. #import <TIMCommon/TIMCommonMediator.h>
  15. #import <TIMCommon/TUIEmojiMeditorProtocol.h>
  16. #import "TUIBaseChatViewController_Minimalist.h"
  17. #import "TUITextMessageCell_Minimalist.h"
  18. #import "TUIEmojiConfig.h"
  19. #import "TUIChatConversationModel.h"
  20. #import "TUIVoiceMessageCellData.h"
  21. @interface TUIChatConfig_Minimalist()<TUIChatEventListener>
  22. @end
  23. @implementation TUIChatConfig_Minimalist
  24. + (TUIChatConfig_Minimalist *)sharedConfig {
  25. static dispatch_once_t onceToken;
  26. static TUIChatConfig_Minimalist *config;
  27. dispatch_once(&onceToken, ^{
  28. config = [[TUIChatConfig_Minimalist alloc] init];
  29. });
  30. return config;
  31. }
  32. - (instancetype)init {
  33. self = [super init];
  34. if (self) {
  35. TUIChatConfig.defaultConfig.eventConfig.chatEventListener = self;
  36. }
  37. return self;
  38. }
  39. - (void)setEnableTypingIndicator:(BOOL)enable {
  40. [TUIChatConfig defaultConfig].enableTypingStatus = enable;
  41. }
  42. - (BOOL)enableTypingIndicator {
  43. return [TUIChatConfig defaultConfig].enableTypingStatus;
  44. }
  45. - (void)setBackgroudColor:(UIColor *)backgroudColor {
  46. [TUIChatConfig defaultConfig].backgroudColor = backgroudColor;
  47. }
  48. - (UIColor *)backgroudColor {
  49. return [TUIChatConfig defaultConfig].backgroudColor;
  50. }
  51. - (void)setBackgroudImage:(UIImage *)backgroudImage {
  52. [TUIChatConfig defaultConfig].backgroudImage = backgroudImage;
  53. }
  54. - (UIImage *)backgroudImage {
  55. return [TUIChatConfig defaultConfig].backgroudImage;
  56. }
  57. - (void)setAvatarStyle:(TUIAvatarStyle_Minimalist)avatarStyle {
  58. [TUIConfig defaultConfig].avatarType = (TUIKitAvatarType)avatarStyle;
  59. }
  60. - (TUIAvatarStyle_Minimalist)avatarStyle {
  61. return (TUIAvatarStyle_Minimalist)[TUIConfig defaultConfig].avatarType;
  62. }
  63. - (void)setAvatarCornerRadius:(CGFloat)avatarCornerRadius {
  64. [TUIConfig defaultConfig].avatarCornerRadius = avatarCornerRadius;
  65. }
  66. - (CGFloat)avatarCornerRadius {
  67. return [TUIConfig defaultConfig].avatarCornerRadius;
  68. }
  69. - (void)setDefaultAvatarImage:(UIImage *)defaultAvatarImage {
  70. [TUIConfig defaultConfig].defaultAvatarImage = defaultAvatarImage;
  71. }
  72. - (UIImage *)defaultAvatarImage {
  73. return [TUIConfig defaultConfig].defaultAvatarImage;
  74. }
  75. - (void)setEnableGroupGridAvatar:(BOOL)enableGroupGridAvatar {
  76. [TUIConfig defaultConfig].enableGroupGridAvatar = enableGroupGridAvatar;
  77. }
  78. - (BOOL)enableGroupGridAvatar {
  79. return [TUIConfig defaultConfig].enableGroupGridAvatar;
  80. }
  81. - (void)setIsMessageReadReceiptNeeded:(BOOL)isMessageReadReceiptNeeded {
  82. [TUIChatConfig defaultConfig].msgNeedReadReceipt = isMessageReadReceiptNeeded;
  83. }
  84. - (BOOL)isMessageReadReceiptNeeded {
  85. return [TUIChatConfig defaultConfig].msgNeedReadReceipt;
  86. }
  87. - (void)setTimeIntervalForAllowedMessageRecall:(NSUInteger)timeIntervalForAllowedMessageRecall {
  88. [TUIChatConfig defaultConfig].timeIntervalForMessageRecall = timeIntervalForAllowedMessageRecall;
  89. }
  90. - (NSUInteger)timeIntervalForAllowedMessageRecall {
  91. return [TUIChatConfig defaultConfig].timeIntervalForMessageRecall;
  92. }
  93. - (void)setEnableFloatWindowForCall:(BOOL)enableFloatWindowForCall {
  94. [TUIChatConfig defaultConfig].enableFloatWindowForCall = enableFloatWindowForCall;
  95. }
  96. - (BOOL)enableFloatWindowForCall {
  97. return [TUIChatConfig defaultConfig].enableFloatWindowForCall;
  98. }
  99. - (void)setEnableMultiDeviceForCall:(BOOL)enableMultiDeviceForCall {
  100. [TUIChatConfig defaultConfig].enableMultiDeviceForCall = enableMultiDeviceForCall;
  101. }
  102. - (BOOL)enableMultiDeviceForCall {
  103. return [TUIChatConfig defaultConfig].enableMultiDeviceForCall;
  104. }
  105. - (void)setHideVideoCallButton:(BOOL)hideVideoCallButton {
  106. [TUIChatConfig defaultConfig].enableVideoCall = !hideVideoCallButton;
  107. }
  108. - (void)setEnableAndroidCustomRing:(BOOL)enableAndroidCustomRing {
  109. [TUIConfig defaultConfig].enableCustomRing = enableAndroidCustomRing;
  110. }
  111. - (BOOL)enableAndroidCustomRing {
  112. return [TUIConfig defaultConfig].enableCustomRing;
  113. }
  114. - (BOOL)hideVideoCallButton {
  115. return ![TUIChatConfig defaultConfig].enableVideoCall;
  116. }
  117. - (void)setHideAudioCallButton:(BOOL)hideAudioCallButton {
  118. [TUIChatConfig defaultConfig].enableAudioCall = !hideAudioCallButton;
  119. }
  120. - (BOOL)hideAudioCallButton {
  121. return ![TUIChatConfig defaultConfig].enableAudioCall;
  122. }
  123. + (void)hideItemsWhenLongPressMessage:(TUIChatItemWhenLongPressMessage_Minimalist)items {
  124. [TUIChatConfig defaultConfig].enablePopMenuReplyAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Reply);
  125. [TUIChatConfig defaultConfig].enablePopMenuEmojiReactAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_EmojiReaction);
  126. [TUIChatConfig defaultConfig].enablePopMenuReferenceAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Quote);
  127. [TUIChatConfig defaultConfig].enablePopMenuPinAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Pin);
  128. [TUIChatConfig defaultConfig].enablePopMenuRecallAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Recall);
  129. [TUIChatConfig defaultConfig].enablePopMenuTranslateAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Translate);
  130. [TUIChatConfig defaultConfig].enablePopMenuConvertAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Convert);
  131. [TUIChatConfig defaultConfig].enablePopMenuForwardAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Forward);
  132. [TUIChatConfig defaultConfig].enablePopMenuSelectAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Select);
  133. [TUIChatConfig defaultConfig].enablePopMenuCopyAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Copy);
  134. [TUIChatConfig defaultConfig].enablePopMenuDeleteAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Delete);
  135. [TUIChatConfig defaultConfig].enablePopMenuInfoAction = !(items & TUIChatItemWhenLongPressMessage_Minimalist_Info);
  136. }
  137. - (void)setIsExcludedFromUnreadCount:(BOOL)isExcludedFromUnreadCount {
  138. [TUIConfig defaultConfig].isExcludedFromUnreadCount = isExcludedFromUnreadCount;
  139. }
  140. - (BOOL)isExcludedFromUnreadCount {
  141. return [TUIConfig defaultConfig].isExcludedFromUnreadCount;
  142. }
  143. - (void)setIsExcludedFromLastMessage:(BOOL)isExcludedFromLastMessage {
  144. [TUIConfig defaultConfig].isExcludedFromLastMessage = isExcludedFromLastMessage;
  145. }
  146. - (BOOL)isExcludedFromLastMessage {
  147. return [TUIConfig defaultConfig].isExcludedFromLastMessage;
  148. }
  149. - (void)setMaxAudioRecordDuration:(CGFloat)maxAudioRecordDuration {
  150. [TUIChatConfig defaultConfig].maxAudioRecordDuration = maxAudioRecordDuration;
  151. }
  152. - (CGFloat)maxAudioRecordDuration {
  153. return [TUIChatConfig defaultConfig].maxAudioRecordDuration;
  154. }
  155. - (void)setMaxVideoRecordDuration:(CGFloat)maxVideoRecordDuration {
  156. [TUIChatConfig defaultConfig].maxVideoRecordDuration = maxVideoRecordDuration;
  157. }
  158. - (CGFloat)maxVideoRecordDuration {
  159. return [TUIChatConfig defaultConfig].maxVideoRecordDuration;
  160. }
  161. + (void)setPlayingSoundMessageViaSpeakerByDefault {
  162. if ([TUIVoiceMessageCellData getAudioplaybackStyle] == TUIVoiceAudioPlaybackStyleHandset) {
  163. [TUIVoiceMessageCellData changeAudioPlaybackStyle];
  164. }
  165. }
  166. + (void)setCustomTopView:(UIView *)view {
  167. [TUIBaseChatViewController_Minimalist setCustomTopView:view];
  168. }
  169. - (void)registerCustomMessage:(NSString *)businessID
  170. messageCellClassName:(NSString *)cellName
  171. messageCellDataClassName:(NSString *)cellDataName {
  172. [[TUIChatConfig defaultConfig] registerCustomMessage:businessID
  173. messageCellClassName:cellName
  174. messageCellDataClassName:cellDataName
  175. styleType:TUIChatRegisterCustomMessageStyleTypeMinimalist];
  176. }
  177. #pragma mark - TUIChatEventListener
  178. - (BOOL)onUserIconClicked:(UIView *)view messageCellData:(TUIMessageCellData *)celldata {
  179. if ([self.delegate respondsToSelector:@selector(onUserAvatarClicked:messageCellData:)]) {
  180. return [self.delegate onUserAvatarClicked:view messageCellData:celldata];
  181. }
  182. return NO;
  183. }
  184. - (BOOL)onUserIconLongClicked:(UIView *)view messageCellData:(TUIMessageCellData *)celldata {
  185. if ([self.delegate respondsToSelector:@selector(onUserAvatarLongPressed:messageCellData:)]) {
  186. return [self.delegate onUserAvatarLongPressed:view messageCellData:celldata];
  187. }
  188. return NO;
  189. }
  190. - (BOOL)onMessageClicked:(UIView *)view messageCellData:(TUIMessageCellData *)celldata {
  191. if ([self.delegate respondsToSelector:@selector(onMessageClicked:messageCellData:)]) {
  192. return [self.delegate onMessageClicked:view messageCellData:celldata];
  193. }
  194. return NO;
  195. }
  196. - (BOOL)onMessageLongClicked:(UIView *)view messageCellData:(TUIMessageCellData *)celldata {
  197. if ([self.delegate respondsToSelector:@selector(onMessageLongPressed:messageCellData:)]) {
  198. return [self.delegate onMessageLongPressed:view messageCellData:celldata];
  199. }
  200. return NO;
  201. }
  202. @end
  203. @implementation TUIChatConfig_Minimalist (MessageStyle)
  204. - (void)setSendNicknameFont:(UIFont *)sendNicknameFont {
  205. TUIMessageCell_Minimalist.outgoingNameFont = sendNicknameFont;
  206. }
  207. - (UIFont *)sendNicknameFont {
  208. return TUIMessageCell_Minimalist.outgoingNameFont;
  209. }
  210. - (void)setReceiveNicknameFont:(UIFont *)receiveNicknameFont {
  211. TUIMessageCell_Minimalist.incommingNameFont = receiveNicknameFont;
  212. }
  213. - (UIFont *)receiveNicknameFont {
  214. return TUIMessageCell_Minimalist.incommingNameFont;
  215. }
  216. - (void)setSendNicknameColor:(UIColor *)sendNicknameColor {
  217. TUIMessageCell_Minimalist.outgoingNameColor = sendNicknameColor;
  218. }
  219. - (UIColor *)sendNicknameColor {
  220. return TUIMessageCell_Minimalist.outgoingNameColor;
  221. }
  222. - (void)setReceiveNicknameColor:(UIColor *)receiveNicknameColor {
  223. TUIMessageCell_Minimalist.incommingNameColor = receiveNicknameColor;
  224. }
  225. - (UIColor *)receiveNicknameColor {
  226. return TUIMessageCell_Minimalist.incommingNameColor;
  227. }
  228. - (void)setSendTextMessageFont:(UIFont *)sendTextMessageFont {
  229. TUITextMessageCell_Minimalist.outgoingTextFont = sendTextMessageFont;
  230. }
  231. - (UIFont *)sendTextMessageFont {
  232. return TUITextMessageCell_Minimalist.outgoingTextFont;
  233. }
  234. - (void)setReceiveTextMessageFont:(UIFont *)receiveTextMessageFont {
  235. TUITextMessageCell_Minimalist.incommingTextFont = receiveTextMessageFont;
  236. }
  237. - (UIFont *)receiveTextMessageFont {
  238. return TUITextMessageCell_Minimalist.incommingTextFont;
  239. }
  240. - (void)setSendTextMessageColor:(UIColor *)sendTextMessageColor {
  241. TUITextMessageCell_Minimalist.outgoingTextColor = sendTextMessageColor;
  242. }
  243. - (UIColor *)sendTextMessageColor {
  244. return TUITextMessageCell_Minimalist.outgoingTextColor;
  245. }
  246. - (void)setReceiveTextMessageColor:(UIColor *)receiveTextMessageColor {
  247. TUITextMessageCell_Minimalist.incommingTextColor = receiveTextMessageColor;
  248. }
  249. - (UIColor *)receiveTextMessageColor {
  250. return TUITextMessageCell_Minimalist.incommingTextColor;
  251. }
  252. @end
  253. typedef NS_ENUM(NSInteger, UIMessageCellLayoutType) {
  254. UIMessageCellLayoutTypeText,
  255. UIMessageCellLayoutTypeImage,
  256. UIMessageCellLayoutTypeVideo,
  257. UIMessageCellLayoutTypeVoice,
  258. UIMessageCellLayoutTypeOther,
  259. UIMessageCellLayoutTypeSystem
  260. };
  261. @implementation TUIChatConfig_Minimalist (MessageLayout)
  262. - (TUIMessageCellLayout *)sendTextMessageLayout {
  263. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeText isSender:YES];
  264. }
  265. - (TUIMessageCellLayout *)receiveTextMessageLayout {
  266. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeText isSender:NO];
  267. }
  268. - (TUIMessageCellLayout *)sendImageMessageLayout {
  269. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeImage isSender:YES];
  270. }
  271. - (TUIMessageCellLayout *)receiveImageMessageLayout {
  272. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeImage isSender:NO];
  273. }
  274. - (TUIMessageCellLayout *)sendVoiceMessageLayout {
  275. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeVoice isSender:YES];
  276. }
  277. - (TUIMessageCellLayout *)receiveVoiceMessageLayout {
  278. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeVoice isSender:NO];
  279. }
  280. - (TUIMessageCellLayout *)sendVideoMessageLayout {
  281. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeVideo isSender:YES];
  282. }
  283. - (TUIMessageCellLayout *)receiveVideoMessageLayout {
  284. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeVideo isSender:NO];
  285. }
  286. - (TUIMessageCellLayout *)sendMessageLayout {
  287. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeOther isSender:YES];
  288. }
  289. - (TUIMessageCellLayout *)receiveMessageLayout {
  290. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeOther isSender:NO];
  291. }
  292. - (TUIMessageCellLayout *)systemMessageLayout {
  293. return [self getMessageLayoutOfType:UIMessageCellLayoutTypeSystem isSender:NO];
  294. }
  295. - (TUIMessageCellLayout *)getMessageLayoutOfType:(UIMessageCellLayoutType)type isSender:(BOOL)isSender {
  296. TUIMessageCellLayout *innerLayout = nil;
  297. switch (type) {
  298. case UIMessageCellLayoutTypeText: {
  299. innerLayout = isSender ? [TUIMessageCellLayout outgoingTextMessageLayout] : [TUIMessageCellLayout incommingTextMessageLayout];
  300. break;
  301. }
  302. case UIMessageCellLayoutTypeImage: {
  303. innerLayout = isSender ? [TUIMessageCellLayout outgoingImageMessageLayout] : [TUIMessageCellLayout incommingImageMessageLayout];
  304. break;
  305. }
  306. case UIMessageCellLayoutTypeVideo: {
  307. innerLayout = isSender ? [TUIMessageCellLayout outgoingVideoMessageLayout] : [TUIMessageCellLayout incommingVideoMessageLayout];
  308. break;
  309. }
  310. case UIMessageCellLayoutTypeVoice: {
  311. innerLayout = isSender ? [TUIMessageCellLayout outgoingVoiceMessageLayout] : [TUIMessageCellLayout incommingVoiceMessageLayout];
  312. break;
  313. }
  314. case UIMessageCellLayoutTypeOther: {
  315. innerLayout = isSender ? [TUIMessageCellLayout outgoingMessageLayout] : [TUIMessageCellLayout incommingMessageLayout];
  316. break;
  317. }
  318. case UIMessageCellLayoutTypeSystem: {
  319. innerLayout = [TUIMessageCellLayout systemMessageLayout];
  320. break;
  321. }
  322. }
  323. return innerLayout;
  324. }
  325. - (void)setSystemMessageBackgroundColor:(UIColor *)systemMessageBackgroundColor {
  326. TUISystemMessageCellData.textBackgroundColor = systemMessageBackgroundColor;
  327. }
  328. - (UIColor *)systemMessageBackgroundColor {
  329. return TUISystemMessageCellData.textBackgroundColor;
  330. }
  331. - (void)setSystemMessageTextFont:(UIFont *)systemMessageTextFont {
  332. TUISystemMessageCellData.textFont = systemMessageTextFont;
  333. }
  334. - (UIFont *)systemMessageTextFont {
  335. return TUISystemMessageCellData.textFont;
  336. }
  337. - (void)setSystemMessageTextColor:(UIColor *)systemMessageTextColor {
  338. TUISystemMessageCellData.textColor = systemMessageTextColor;
  339. }
  340. - (UIColor *)systemMessageTextColor {
  341. return TUISystemMessageCellData.textColor;
  342. }
  343. @end
  344. @implementation TUIChatConfig_Minimalist (MessageBubble)
  345. - (void)setEnableMessageBubbleStyle:(BOOL)enableMessageBubbleStyle {
  346. [TIMConfig defaultConfig].enableMessageBubble = enableMessageBubbleStyle;
  347. }
  348. - (BOOL)enableMessageBubbleStyle {
  349. return [TIMConfig defaultConfig].enableMessageBubble;
  350. }
  351. - (void)setSendLastBubbleBackgroundImage:(UIImage *)sendLastBubbleBackgroundImage {
  352. [TUIBubbleMessageCell_Minimalist setOutgoingBubble:sendLastBubbleBackgroundImage];
  353. }
  354. - (UIImage *)sendLastBubbleBackgroundImage {
  355. return [TUIBubbleMessageCell_Minimalist outgoingBubble];
  356. }
  357. - (void)setSendBubbleBackgroundImage:(UIImage *)sendBubbleBackgroundImage {
  358. [TUIBubbleMessageCell_Minimalist setOutgoingSameBubble:sendBubbleBackgroundImage];
  359. }
  360. - (UIImage *)sendBubbleBackgroundImage {
  361. return [TUIBubbleMessageCell_Minimalist outgoingSameBubble];
  362. }
  363. - (void)setReceiveLastBubbleBackgroundImage:(UIImage *)receiveLastBubbleBackgroundImage {
  364. [TUIBubbleMessageCell_Minimalist setIncommingBubble:receiveLastBubbleBackgroundImage];
  365. }
  366. - (UIImage *)receiveLastBubbleBackgroundImage {
  367. return [TUIBubbleMessageCell_Minimalist incommingBubble];
  368. }
  369. - (void)setReceiveBubbleBackgroundImage:(UIImage *)receiveBubbleBackgroundImage {
  370. [TUIBubbleMessageCell_Minimalist setIncommingSameBubble:receiveBubbleBackgroundImage];
  371. }
  372. - (UIImage *)receiveBubbleBackgroundImage {
  373. return [TUIBubbleMessageCell_Minimalist incommingSameBubble];
  374. }
  375. - (void)setSendHighlightBubbleBackgroundImage:(UIImage *)sendHighlightBackgroundImage {
  376. [TUIBubbleMessageCell_Minimalist setOutgoingHighlightedBubble:sendHighlightBackgroundImage];
  377. }
  378. - (UIImage *)sendHighlightBubbleBackgroundImage {
  379. return [TUIBubbleMessageCell_Minimalist outgoingHighlightedBubble];
  380. }
  381. - (void)setReceiveHighlightBubbleBackgroundImage:(UIImage *)receiveHighlightBubbleBackgroundImage {
  382. [TUIBubbleMessageCell_Minimalist setIncommingHighlightedBubble:receiveHighlightBubbleBackgroundImage];
  383. }
  384. - (UIImage *)receiveHighlightBubbleBackgroundImage {
  385. return [TUIBubbleMessageCell_Minimalist incommingHighlightedBubble];
  386. }
  387. - (void)setSendAnimateLightBubbleBackgroundImage:(UIImage *)sendAnimateLightBackgroundImage {
  388. [TUIBubbleMessageCell_Minimalist setOutgoingAnimatedHighlightedAlpha20:sendAnimateLightBackgroundImage];
  389. }
  390. - (UIImage *)sendAnimateLightBubbleBackgroundImage {
  391. return [TUIBubbleMessageCell_Minimalist outgoingAnimatedHighlightedAlpha20];
  392. }
  393. - (void)setReceiveAnimateLightBubbleBackgroundImage:(UIImage *)receiveAnimateLightBubbleBackgroundImage {
  394. [TUIBubbleMessageCell_Minimalist setIncommingAnimatedHighlightedAlpha20:receiveAnimateLightBubbleBackgroundImage];
  395. }
  396. - (UIImage *)receiveAnimateLightBubbleBackgroundImage {
  397. return [TUIBubbleMessageCell_Minimalist incommingAnimatedHighlightedAlpha20];
  398. }
  399. - (void)setSendAnimateDarkBubbleBackgroundImage:(UIImage *)sendAnimateDarkBackgroundImage {
  400. [TUIBubbleMessageCell_Minimalist setOutgoingAnimatedHighlightedAlpha50:sendAnimateDarkBackgroundImage];
  401. }
  402. - (UIImage *)sendAnimateDarkBubbleBackgroundImage {
  403. return [TUIBubbleMessageCell_Minimalist outgoingAnimatedHighlightedAlpha50];
  404. }
  405. - (void)setReceiveAnimateDarkBubbleBackgroundImage:(UIImage *)receiveAnimateDarkBubbleBackgroundImage {
  406. [TUIBubbleMessageCell_Minimalist setIncommingAnimatedHighlightedAlpha50:receiveAnimateDarkBubbleBackgroundImage];
  407. }
  408. - (UIImage *)receiveAnimateDarkBubbleBackgroundImage {
  409. return [TUIBubbleMessageCell_Minimalist incommingAnimatedHighlightedAlpha50];
  410. }
  411. @end
  412. @implementation TUIChatConfig_Minimalist (InputBar)
  413. - (id<TUIChatInputBarConfigDataSource>)inputBarDataSource {
  414. return [TUIChatConfig defaultConfig].inputBarDataSource;
  415. }
  416. - (void)setInputBarDataSource:(id<TUIChatInputBarConfigDataSource>)inputBarDataSource {
  417. [TUIChatConfig defaultConfig].inputBarDataSource = inputBarDataSource;
  418. }
  419. - (void)setShowInputBar:(BOOL)showInputBar {
  420. [TUIChatConfig defaultConfig].enableMainPageInputBar = showInputBar;
  421. }
  422. - (BOOL)showInputBar {
  423. return ![TUIChatConfig defaultConfig].enableMainPageInputBar;
  424. }
  425. + (void)hideItemsInMoreMenu:(TUIChatInputBarMoreMenuItem)items {
  426. [TUIChatConfig defaultConfig].enableWelcomeCustomMessage = !(items & TUIChatInputBarMoreMenuItem_CustomMessage);
  427. [TUIChatConfig defaultConfig].showRecordVideoButton = !(items & TUIChatInputBarMoreMenuItem_RecordVideo);
  428. [TUIChatConfig defaultConfig].showTakePhotoButton = !(items & TUIChatInputBarMoreMenuItem_TakePhoto);
  429. [TUIChatConfig defaultConfig].showAlbumButton = !(items & TUIChatInputBarMoreMenuItem_Album);
  430. [TUIChatConfig defaultConfig].showFileButton = !(items & TUIChatInputBarMoreMenuItem_File);
  431. }
  432. - (void)addStickerGroup:(TUIFaceGroup *)group {
  433. id<TUIEmojiMeditorProtocol> service = [[TIMCommonMediator share] getObject:@protocol(TUIEmojiMeditorProtocol)];
  434. [service appendFaceGroup:group];
  435. }
  436. @end