heavyrain2012 4 years ago
parent
commit
7b1507f3df
38 changed files with 399 additions and 45 deletions
  1. 24 0
      wfuikit/WFChatUIKit.xcodeproj/project.pbxproj
  2. 1 1
      wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserCollectionViewCell.h
  3. 1 1
      wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserCollectionViewCell.m
  4. 1 1
      wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserTableViewCell.h
  5. 1 1
      wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserTableViewCell.m
  6. 1 1
      wfuikit/WFChatUIKit/Contacts/Support/WFCUSelectedUserInfo.h
  7. 1 1
      wfuikit/WFChatUIKit/Contacts/Support/WFCUSelectedUserInfo.m
  8. 1 1
      wfuikit/WFChatUIKit/Contacts/Support/WFCUUserSectionKeySupport.h
  9. 1 1
      wfuikit/WFChatUIKit/Contacts/Support/WFCUUserSectionKeySupport.m
  10. 1 1
      wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserSearchResultViewController.h
  11. 1 1
      wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserSearchResultViewController.m
  12. 1 1
      wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserViewController.h
  13. 1 1
      wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserViewController.m
  14. 1 1
      wfuikit/WFChatUIKit/ConversationSetting/ViewController/WFCUGroupFilesViewController.h
  15. 1 1
      wfuikit/WFChatUIKit/ConversationSetting/ViewController/WFCUGroupFilesViewController.m
  16. 45 0
      wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeBaseCell.h
  17. 131 0
      wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeBaseCell.m
  18. 17 0
      wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeTextCell.h
  19. 51 0
      wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeTextCell.m
  20. 1 1
      wfuikit/WFChatUIKit/MessageList/Cell/MediaMessageGridViewCell.h
  21. 1 1
      wfuikit/WFChatUIKit/MessageList/Cell/MediaMessageGridViewCell.m
  22. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUCompositeMessageViewController.h
  23. 99 13
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUCompositeMessageViewController.m
  24. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUMediaMessageGridViewController.h
  25. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUMediaMessageGridViewController.m
  26. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUQuoteViewController.h
  27. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUQuoteViewController.m
  28. 1 1
      wfuikit/WFChatUIKit/MessageList/ViewController/WFCUUserMessageListViewController.h
  29. 1 1
      wfuikit/WFChatUIKit/Voip/Conference/WFCUCreateConferenceViewController.h
  30. 1 1
      wfuikit/WFChatUIKit/Voip/Conference/WFCUCreateConferenceViewController.m
  31. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewCell.h
  32. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewCell.m
  33. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewLayout.h
  34. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewLayout.m
  35. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUPortraitCollectionViewCell.h
  36. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUPortraitCollectionViewCell.m
  37. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUWaitingAnimationView.h
  38. 1 1
      wfuikit/WFChatUIKit/Voip/WFCUWaitingAnimationView.m

+ 24 - 0
wfuikit/WFChatUIKit.xcodeproj/project.pbxproj

@@ -360,6 +360,10 @@
 		2F56F6A92529E43900B829C4 /* WFCUCompositeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F56F6A72529E43900B829C4 /* WFCUCompositeCell.m */; };
 		2F56F6B42529EE0F00B829C4 /* WFCUCompositeMessageViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F56F6B22529EE0F00B829C4 /* WFCUCompositeMessageViewController.h */; };
 		2F56F6B52529EE0F00B829C4 /* WFCUCompositeMessageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F56F6B32529EE0F00B829C4 /* WFCUCompositeMessageViewController.m */; };
+		2F56F6BA252A07AF00B829C4 /* WFCUCompositeBaseCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F56F6B8252A07AF00B829C4 /* WFCUCompositeBaseCell.h */; };
+		2F56F6BB252A07AF00B829C4 /* WFCUCompositeBaseCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F56F6B9252A07AF00B829C4 /* WFCUCompositeBaseCell.m */; };
+		2F56F6BF252A088100B829C4 /* WFCUCompositeTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F56F6BD252A088100B829C4 /* WFCUCompositeTextCell.h */; };
+		2F56F6C0252A088100B829C4 /* WFCUCompositeTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F56F6BE252A088100B829C4 /* WFCUCompositeTextCell.m */; };
 		2F5EB43C22C2E21A00BC8C90 /* GroupManageTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F5EB43A22C2E21A00BC8C90 /* GroupManageTableViewController.h */; };
 		2F5EB43D22C2E21A00BC8C90 /* GroupManageTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F5EB43B22C2E21A00BC8C90 /* GroupManageTableViewController.m */; };
 		2F5EB44022C2E6BB00BC8C90 /* ManagerTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F5EB43E22C2E6BB00BC8C90 /* ManagerTableViewController.h */; };
@@ -761,6 +765,10 @@
 		2F56F6A72529E43900B829C4 /* WFCUCompositeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WFCUCompositeCell.m; sourceTree = "<group>"; };
 		2F56F6B22529EE0F00B829C4 /* WFCUCompositeMessageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WFCUCompositeMessageViewController.h; sourceTree = "<group>"; };
 		2F56F6B32529EE0F00B829C4 /* WFCUCompositeMessageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WFCUCompositeMessageViewController.m; sourceTree = "<group>"; };
+		2F56F6B8252A07AF00B829C4 /* WFCUCompositeBaseCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WFCUCompositeBaseCell.h; sourceTree = "<group>"; };
+		2F56F6B9252A07AF00B829C4 /* WFCUCompositeBaseCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WFCUCompositeBaseCell.m; sourceTree = "<group>"; };
+		2F56F6BD252A088100B829C4 /* WFCUCompositeTextCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WFCUCompositeTextCell.h; sourceTree = "<group>"; };
+		2F56F6BE252A088100B829C4 /* WFCUCompositeTextCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WFCUCompositeTextCell.m; sourceTree = "<group>"; };
 		2F5EB43A22C2E21A00BC8C90 /* GroupManageTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GroupManageTableViewController.h; sourceTree = "<group>"; };
 		2F5EB43B22C2E21A00BC8C90 /* GroupManageTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GroupManageTableViewController.m; sourceTree = "<group>"; };
 		2F5EB43E22C2E6BB00BC8C90 /* ManagerTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ManagerTableViewController.h; sourceTree = "<group>"; };
@@ -1044,6 +1052,7 @@
 		2F550EB3217F5CC000F56C26 /* Cell */ = {
 			isa = PBXGroup;
 			children = (
+				2F56F6B7252A078500B829C4 /* CompositeCell */,
 				2F550EC8217F5CC000F56C26 /* WFCUCallSummaryCell.h */,
 				2F550EB7217F5CC000F56C26 /* WFCUCallSummaryCell.m */,
 				2F550EC1217F5CC000F56C26 /* WFCUFileCell.h */,
@@ -1680,6 +1689,17 @@
 			path = Utilities;
 			sourceTree = "<group>";
 		};
+		2F56F6B7252A078500B829C4 /* CompositeCell */ = {
+			isa = PBXGroup;
+			children = (
+				2F56F6B8252A07AF00B829C4 /* WFCUCompositeBaseCell.h */,
+				2F56F6B9252A07AF00B829C4 /* WFCUCompositeBaseCell.m */,
+				2F56F6BD252A088100B829C4 /* WFCUCompositeTextCell.h */,
+				2F56F6BE252A088100B829C4 /* WFCUCompositeTextCell.m */,
+			);
+			path = CompositeCell;
+			sourceTree = "<group>";
+		};
 		2F9CE41921BFE5A4005E1BE1 /* Channel */ = {
 			isa = PBXGroup;
 			children = (
@@ -1756,6 +1776,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				2F55122A217F5CC300F56C26 /* WFCUUtilities.h in Headers */,
+				2F56F6BF252A088100B829C4 /* WFCUCompositeTextCell.h in Headers */,
 				2F518FEF235ED5B300FA3D58 /* WFCUAppServiceProvider.h in Headers */,
 				2F36433321C136C400904CAB /* WFCUFavChannelTableViewController.h in Headers */,
 				2F5511F3217F5CC300F56C26 /* UITabBar+badge.h in Headers */,
@@ -1886,6 +1907,7 @@
 				2F551210217F5CC300F56C26 /* WFCUContactSelectTableViewCell.h in Headers */,
 				2BDF57A024AD70C8003C1F08 /* DNAlbumTableViewController.h in Headers */,
 				2F5511E0217F5CC300F56C26 /* TYAlertFadeAnimation.h in Headers */,
+				2F56F6BA252A07AF00B829C4 /* WFCUCompositeBaseCell.h in Headers */,
 				2F5EB44C22C2F36A00BC8C90 /* GroupMemberControlTableViewController.h in Headers */,
 				2F5511E4217F5CC300F56C26 /* YLImageView.h in Headers */,
 				2F551214217F5CC300F56C26 /* WFCUAddFriendViewController.h in Headers */,
@@ -2047,6 +2069,7 @@
 			files = (
 				2F551105217F5CC200F56C26 /* CCHMapViewDelegateProxy.m in Sources */,
 				2F551224217F5CC300F56C26 /* WFCUMyPortraitViewController.m in Sources */,
+				2F56F6C0252A088100B829C4 /* WFCUCompositeTextCell.m in Sources */,
 				2F5511F9217F5CC300F56C26 /* UIView+Screenshot.m in Sources */,
 				2F55116D217F5CC200F56C26 /* AFNetworkReachabilityManager.m in Sources */,
 				2BDF57B324AD70C8003C1F08 /* DNAlbumCell.m in Sources */,
@@ -2054,6 +2077,7 @@
 				2F5510EB217F5CC200F56C26 /* WFCUSelectedFileCollectionViewCell.m in Sources */,
 				2F5510EC217F5CC200F56C26 /* WFCUVoiceRecordView.m in Sources */,
 				2F551127217F5CC200F56C26 /* VideoPlayerKit.m in Sources */,
+				2F56F6BB252A07AF00B829C4 /* WFCUCompositeBaseCell.m in Sources */,
 				2BDF57AB24AD70C8003C1F08 /* DNAssetsViewCell.m in Sources */,
 				14349FA724362A6600FE38B3 /* WFCUSeletedUserViewController.m in Sources */,
 				2BDF57B224AD70C8003C1F08 /* DNUnAuthorizedTipsView.m in Sources */,

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserCollectionViewCell.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserCollectionViewCell.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUSelectedUserCollectionViewCell.h"

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserTableViewCell.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/5.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Cell/WFCUSelectedUserTableViewCell.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/5.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUSelectedUserTableViewCell.h"

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Support/WFCUSelectedUserInfo.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/5.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <WFChatClient/WFCCUserInfo.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Support/WFCUSelectedUserInfo.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/5.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUSelectedUserInfo.h"

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Support/WFCUUserSectionKeySupport.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <Foundation/Foundation.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/Support/WFCUUserSectionKeySupport.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUUserSectionKeySupport.h"

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserSearchResultViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserSearchResultViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUSeletedUserSearchResultViewController.h"

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/2.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Contacts/ViewController/WFCUSeletedUserViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Zack Zhang on 2020/4/2.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUSeletedUserViewController.h"

+ 1 - 1
wfuikit/WFChatUIKit/ConversationSetting/ViewController/WFCUGroupFilesViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/8/2.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/ConversationSetting/ViewController/WFCUGroupFilesViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/8/2.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUGroupFilesViewController.h"

+ 45 - 0
wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeBaseCell.h

@@ -0,0 +1,45 @@
+//
+//  WFCUCompositeBaseCell.h
+//  WFChatUIKit
+//
+//  Created by Tom Lee on 2020/10/4.
+//  Copyright © 2020 WildFireChat. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+@class WFCCMessage;
+NS_ASSUME_NONNULL_BEGIN
+
+#define COMPOSITE_CELL_PORTRAIT_WIDTH 48
+#define COMPOSITE_CELL_PORTRAIT_PADDING 16
+
+#define COMPOSITE_CELL_TOP_PADDING 8
+#define COMPOSITE_CELL_BUTTOM_PADDING 8
+#define COMPOSITE_CELL_RIGHT_PADDING 8
+
+#define COMPOSITE_CELL_NAME_LABEL_HEIGHT 20
+#define COMPOSITE_CELL_NAME_LABEL_FONT 14
+
+#define COMPOSITE_CELL_TIME_LABEL_WIDTH 80
+#define COMPOSITE_CELL_TIME_LABEL_HEIGHT 20
+#define COMPOSITE_CELL_TIME_LABEL_FONT 12
+
+#define COMPOSITE_CELL_NAME_CONTENT_PADDING 8
+
+#define COMPOSITE_CELL_LINE_HEIGHT 1
+
+@interface WFCUCompositeBaseCell : UITableViewCell
++ (instancetype)cellOfMessage:(WFCCMessage *)message;
++ (CGFloat)heightForMessage:(WFCCMessage *)message;
+
+//子类需要实现这个方法来计算内容区大小
++ (CGFloat)heightForMessageContent:(WFCCMessage *)message;
+
+@property(nonatomic, strong)WFCCMessage *message;
+@property(nonatomic, assign)BOOL hiddenPortrait;
+@property(nonatomic, assign)BOOL lastMessage;
+
++ (CGRect)contentFrame;
+@end
+
+NS_ASSUME_NONNULL_END

+ 131 - 0
wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeBaseCell.m

@@ -0,0 +1,131 @@
+//
+//  WFCUCompositeBaseCell.m
+//  WFChatUIKit
+//
+//  Created by Tom Lee on 2020/10/4.
+//  Copyright © 2020 WildFireChat. All rights reserved.
+//
+
+#import "WFCUCompositeBaseCell.h"
+#import "WFCUCompositeTextCell.h"
+#import <WFChatClient/WFCChatClient.h>
+#import <SDWebImage/SDWebImage.h>
+
+@interface WFCUCompositeBaseCell ()
+@property(nonatomic, strong)UIImageView *portraitImageView;
+@property(nonatomic, strong)UILabel *nameLabel;
+@property(nonatomic, strong)UILabel *timeLabel;
+@property(nonatomic, strong)UIView *line;
+@end
+
+@implementation WFCUCompositeBaseCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
++ (instancetype)cellOfMessage:(WFCCMessage *)message {
+    if ([message.content isKindOfClass:[WFCCTextMessageContent class]]) {
+        
+        WFCUCompositeTextCell *cell = [[WFCUCompositeTextCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([message.content class])];
+        for (UIView *view in cell.contentView.subviews) {
+            [view removeFromSuperview];
+        }
+        return cell;
+    }
+    return nil;
+}
+
++ (CGFloat)heightForMessage:(WFCCMessage *)message {
+    return COMPOSITE_CELL_TOP_PADDING + COMPOSITE_CELL_NAME_LABEL_HEIGHT + COMPOSITE_CELL_NAME_CONTENT_PADDING + [self heightForMessageContent:message] + COMPOSITE_CELL_BUTTOM_PADDING + COMPOSITE_CELL_LINE_HEIGHT;
+}
+
++ (CGFloat)heightForMessageContent:(WFCCMessage *)message {
+    return 0;
+}
+
++ (CGRect)contentFrame {
+    CGFloat x = COMPOSITE_CELL_PORTRAIT_PADDING + COMPOSITE_CELL_PORTRAIT_WIDTH + COMPOSITE_CELL_PORTRAIT_PADDING;
+    CGFloat y = COMPOSITE_CELL_TOP_PADDING+COMPOSITE_CELL_NAME_LABEL_HEIGHT+COMPOSITE_CELL_NAME_CONTENT_PADDING;
+    CGFloat w = [UIScreen mainScreen].bounds.size.width - x - COMPOSITE_CELL_RIGHT_PADDING;
+    return CGRectMake(x, y, w, 0);
+}
+
+- (void)setMessage:(WFCCMessage *)message {
+    WFCCUserInfo *userInfo = [[WFCCIMService sharedWFCIMService] getUserInfo:message.fromUser refresh:NO];
+    
+    if (self.hiddenPortrait) {
+        _portraitImageView.hidden = YES;
+    } else {
+        self.portraitImageView.hidden = NO;
+        [self.portraitImageView sd_setImageWithURL:[NSURL URLWithString:userInfo.portrait] placeholderImage:[UIImage imageNamed:@"PersonlChat"]];
+    }
+    
+    self.nameLabel.text = userInfo.displayName;
+    
+    NSDate *from = [[NSDate alloc] initWithTimeIntervalSince1970:message.serverTime/1000];
+    
+    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+    [dateFormatter setDateFormat:@"MM-dd HH:mm"];
+    [dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
+    
+    self.timeLabel.text = [dateFormatter stringFromDate:from];
+    
+    CGFloat x;
+    CGFloat cellHeight = [self.class heightForMessage:message];
+    if (self.lastMessage) {
+        x = COMPOSITE_CELL_RIGHT_PADDING;
+    } else {
+        x = COMPOSITE_CELL_PORTRAIT_PADDING + COMPOSITE_CELL_PORTRAIT_WIDTH + COMPOSITE_CELL_PORTRAIT_PADDING;
+    }
+    self.line.frame = CGRectMake(x, cellHeight-1, [UIScreen mainScreen].bounds.size.width-x-COMPOSITE_CELL_RIGHT_PADDING, 1);
+}
+
+- (UIImageView *)portraitImageView {
+    if (!_portraitImageView) {
+        _portraitImageView = [[UIImageView alloc] initWithFrame:CGRectMake(COMPOSITE_CELL_PORTRAIT_PADDING, COMPOSITE_CELL_TOP_PADDING, COMPOSITE_CELL_PORTRAIT_WIDTH, COMPOSITE_CELL_PORTRAIT_WIDTH)];
+        [self.contentView addSubview:_portraitImageView];
+    }
+    return _portraitImageView;
+}
+
+- (UILabel *)nameLabel {
+    if (!_nameLabel) {
+        CGFloat x = COMPOSITE_CELL_PORTRAIT_PADDING + COMPOSITE_CELL_PORTRAIT_WIDTH + COMPOSITE_CELL_PORTRAIT_PADDING;
+        CGFloat w = [UIScreen mainScreen].bounds.size.width - x -
+        - COMPOSITE_CELL_RIGHT_PADDING - COMPOSITE_CELL_TIME_LABEL_WIDTH - COMPOSITE_CELL_RIGHT_PADDING;
+        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, COMPOSITE_CELL_TOP_PADDING, w, COMPOSITE_CELL_NAME_LABEL_HEIGHT)];
+        [_nameLabel setFont:[UIFont systemFontOfSize:COMPOSITE_CELL_NAME_LABEL_FONT]];
+        _nameLabel.textColor = [UIColor grayColor];
+        [self.contentView addSubview:_nameLabel];
+    }
+    return _nameLabel;
+}
+
+- (UILabel *)timeLabel {
+    if (!_timeLabel) {
+        CGFloat x = [UIScreen mainScreen].bounds.size.width - COMPOSITE_CELL_TIME_LABEL_WIDTH - COMPOSITE_CELL_RIGHT_PADDING;
+        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, COMPOSITE_CELL_TOP_PADDING, COMPOSITE_CELL_TIME_LABEL_WIDTH, COMPOSITE_CELL_TIME_LABEL_HEIGHT)];
+        [_timeLabel setFont:[UIFont systemFontOfSize:COMPOSITE_CELL_TIME_LABEL_FONT]];
+        _timeLabel.textAlignment = NSTextAlignmentRight;
+        _timeLabel.textColor = [UIColor grayColor];
+        [self.contentView addSubview:_timeLabel];
+    }
+    return _timeLabel;
+}
+- (UIView *)line {
+    if (!_line) {
+        _line = [[UIView alloc] init];
+        _line.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.f];
+        [self.contentView addSubview:_line];
+    }
+    return _line;
+}
+@end

+ 17 - 0
wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeTextCell.h

@@ -0,0 +1,17 @@
+//
+//  WFCUCompositeTextCell.h
+//  WFChatUIKit
+//
+//  Created by Tom Lee on 2020/10/4.
+//  Copyright © 2020 WildFireChat. All rights reserved.
+//
+
+#import "WFCUCompositeBaseCell.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface WFCUCompositeTextCell : WFCUCompositeBaseCell
+@property(nonatomic, strong)UILabel *contentLabel;
+@end
+
+NS_ASSUME_NONNULL_END

+ 51 - 0
wfuikit/WFChatUIKit/MessageList/Cell/CompositeCell/WFCUCompositeTextCell.m

@@ -0,0 +1,51 @@
+//
+//  CompositeTextTableViewCell.m
+//  WFChatUIKit
+//
+//  Created by Tom Lee on 2020/10/4.
+//  Copyright © 2020 WildFireChat. All rights reserved.
+//
+
+#import "WFCUCompositeTextCell.h"
+#import <WFChatClient/WFCChatClient.h>
+#import "WFCUUtilities.h"
+
+
+@implementation WFCUCompositeTextCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
++ (CGFloat)heightForMessageContent:(WFCCMessage *)message {
+    WFCCTextMessageContent *txtContent = (WFCCTextMessageContent *)message.content;
+    CGRect frame = [self.class contentFrame];
+    CGSize size = [WFCUUtilities getTextDrawingSize:txtContent.text font:[UIFont systemFontOfSize:18] constrainedSize:CGSizeMake(frame.size.width, 8000)];
+    return size.height;
+}
+
+- (void)setMessage:(WFCCMessage *)message {
+    [super setMessage:message];
+    WFCCTextMessageContent *txtCnt = (WFCCTextMessageContent *)message.content;
+    CGRect frame = [self.class contentFrame];
+    frame.size.height = [self.class heightForMessageContent:message];
+    self.contentLabel.frame = frame;
+    self.contentLabel.text = txtCnt.text;
+}
+
+- (UILabel *)contentLabel {
+    if (!_contentLabel) {
+        _contentLabel = [[UILabel alloc] initWithFrame:CGRectZero];
+        _contentLabel.numberOfLines = 0;
+        [self.contentView addSubview:_contentLabel];
+    }
+    return _contentLabel;
+}
+@end

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/Cell/MediaMessageGridViewCell.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/7/1.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/Cell/MediaMessageGridViewCell.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/7/1.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "MediaMessageGridViewCell.h"

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUCompositeMessageViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/10/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 99 - 13
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUCompositeMessageViewController.m

@@ -3,15 +3,18 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/10/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUCompositeMessageViewController.h"
 #import <WFChatClient/WFCChatClient.h>
+#import "WFCUUtilities.h"
+#import "WFCUCompositeBaseCell.h"
+#import "WFCUCompositeTextCell.h"
 
-
-@interface WFCUCompositeMessageViewController ()
-
+@interface WFCUCompositeMessageViewController () <UITableViewDelegate, UITableViewDataSource>
+@property(nonatomic, strong)UITableView *tableView;
+@property(nonatomic, strong)NSMutableArray<WFCCMessage *> *messages;
 @end
 
 @implementation WFCUCompositeMessageViewController
@@ -19,16 +22,99 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     self.view.backgroundColor = [UIColor whiteColor];
+    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
+    
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    self.messages = [[NSMutableArray alloc] initWithArray:self.compositeContent.messages];
+    
+    [self setupTableHeaderView];
+    
+    self.title = self.compositeContent.targetName;
+    
+    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
+    [self.tableView reloadData];
+    
+    [self.view addSubview:self.tableView];
 }
-
-/*
-#pragma mark - Navigation
-
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+- (void)setupTableHeaderView {
+#define HEADER_HEIGHT 30
+#define HEADER_FONT_SIZE 16
+#define HEADER_LINE_PADDING 16
+    NSDate *from = [[NSDate alloc] initWithTimeIntervalSince1970:self.messages.firstObject.serverTime/1000];
+    NSDate *to = [[NSDate alloc] initWithTimeIntervalSince1970:self.messages.lastObject.serverTime/1000];
+    
+    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
+    [dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
+    
+    NSString *fromString = [dateFormatter stringFromDate:from];
+    NSString *toString = [dateFormatter stringFromDate:to];
+    
+    CGFloat width = self.view.frame.size.width;
+    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, HEADER_HEIGHT)];
+    NSString *timeString;
+    if ([fromString isEqualToString:toString]) {
+        timeString = fromString;
+    } else {
+        timeString = [NSString stringWithFormat:@"%@ 至 %@", fromString, toString];
+    }
+    CGSize size = [WFCUUtilities getTextDrawingSize:timeString font:[UIFont systemFontOfSize:HEADER_FONT_SIZE] constrainedSize:CGSizeMake(width, HEADER_HEIGHT)];
+    
+    UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(HEADER_LINE_PADDING, HEADER_HEIGHT/2, (width-size.width)/2-HEADER_LINE_PADDING-HEADER_LINE_PADDING, 1)];
+    leftLine.backgroundColor = [UIColor grayColor];
+    [headerView addSubview:leftLine];
+    
+    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake((width-size.width)/2, (HEADER_HEIGHT-size.height)/2, size.width, size.height)];
+    label.text = timeString;
+    label.textColor = [UIColor grayColor];
+    label.font = [UIFont systemFontOfSize:HEADER_FONT_SIZE];
+    [headerView addSubview:label];
+    
+    UIView *rightLine = [[UIView alloc] initWithFrame:CGRectMake((width+size.width)/2+HEADER_LINE_PADDING, HEADER_HEIGHT/2, (width-size.width)/2-HEADER_LINE_PADDING-HEADER_LINE_PADDING, 1)];
+    rightLine.backgroundColor = [UIColor grayColor];
+    [headerView addSubview:rightLine];
+    
+    self.tableView.tableHeaderView = headerView;
+}
+#pragma mark - UITableViewDataSource
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.compositeContent.messages.count;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    WFCCMessage *msg = self.messages[indexPath.row];
+    WFCUCompositeBaseCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([msg.content class])];
+    if (!cell) {
+        cell = [WFCUCompositeBaseCell cellOfMessage:msg];
+    }
+    
+    if (indexPath.row == self.messages.count-1) {
+        cell.lastMessage = YES;
+    } else {
+        cell.lastMessage = NO;
+    }
+    
+    BOOL sameUser = NO;
+    if (indexPath.row != 0) {
+        WFCCMessage *premsg = self.messages[indexPath.row-1];
+        if ([premsg.fromUser isEqualToString:msg.fromUser]) {
+            sameUser = YES;
+        }
+    }
+    cell.hiddenPortrait = sameUser;
+    
+    cell.message = msg;
+    return cell;
 }
-*/
 
+-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    WFCCMessage *msg = self.messages[indexPath.row];
+    WFCUCompositeBaseCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([msg.content class])];
+    if (!cell) {
+        cell = [WFCUCompositeBaseCell cellOfMessage:msg];
+    }
+    
+    return [cell.class heightForMessage:msg];
+}
 @end

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUMediaMessageGridViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/7/1.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUMediaMessageGridViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/7/1.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUMediaMessageGridViewController.h"

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUQuoteViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/10/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUQuoteViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/10/4.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUQuoteViewController.h"

+ 1 - 1
wfuikit/WFChatUIKit/MessageList/ViewController/WFCUUserMessageListViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/8/19.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/Conference/WFCUCreateConferenceViewController.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/6/17.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/Conference/WFCUCreateConferenceViewController.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/6/17.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUCreateConferenceViewController.h"

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewCell.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/20.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewCell.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/20.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import "WFCUParticipantCollectionViewCell.h"

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewLayout.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/21.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUParticipantCollectionViewLayout.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/21.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import "WFCUParticipantCollectionViewLayout.h"

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUPortraitCollectionViewCell.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/20.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUPortraitCollectionViewCell.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by dali on 2020/1/20.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 #if WFCU_SUPPORT_VOIP
 #import "WFCUPortraitCollectionViewCell.h"

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUWaitingAnimationView.h

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/2/23.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
wfuikit/WFChatUIKit/Voip/WFCUWaitingAnimationView.m

@@ -3,7 +3,7 @@
 //  WFChatUIKit
 //
 //  Created by Tom Lee on 2020/2/23.
-//  Copyright © 2020 Tom Lee. All rights reserved.
+//  Copyright © 2020 WildFireChat. All rights reserved.
 //
 
 #import "WFCUWaitingAnimationView.h"