//
//  ALTopicCardObject.m
//  GMAlpha
//
//  Created by zhb on 2018/11/23.
//  Copyright © 2018 Gengmei. All rights reserved.
//

#import "ALTopicCardObject.h"
// topics.replies.comments
@implementation ALTopicReplyCommentObject @end


// topic.replies.user
@implementation ALTopicReplyUserObject @end


// topics.images
@implementation ALTopicCardImageObject

@end



// topics.author
@implementation ALTopicCardAuthorObject

@end


// topic.recommend_list
@implementation ALTopicCardRecommentObject

@end


// topics.replies
@implementation ALTopicCardReplieObject

@end


// topics
@implementation ALTopicCardObject

- (void)doOptimize {
    self.contentNumLines = 6;
    
    self.sourceContent = [NSString stringWithFormat:@"%@", self.content];
    self.transContent = [NSString stringWithFormat:@"%@", self.content];

    NSInteger maxCount = MIN(3, self.replies.count);
    self.sourceReplyArray = [NSMutableArray array];
    self.transReplyArray = [NSMutableArray array];
    for (NSInteger i = 0; i < maxCount; i++) {
        ALTopicCardReplieObject *obj = self.replies[i];
        NSString *string = obj.content;
        [self.sourceReplyArray addObject:[string mutableCopy]];
        [self.transReplyArray addObject:[string mutableCopy]];
    }
}



@end




//// data.topics
//@implementation ALTopicCardObject
//- (void)doOptimize {
//    NSDictionary *attr = @{NSFontAttributeName:[UIFont gmFont:15], NSForegroundColorAttributeName:UIColor.headlineText};
//    self.attrContent = [[NSAttributedString alloc] initWithString:[self.content stringByAppendingString:@"去就文规范的的r去就文规范的的去就文规范的的去就文规范的的去的范的的去就文规范的的去的的范的的去就文规范的的去的123"] attributes:attr];
//    self.allContentSize = [self.attrContent sizeForBoundingRectSize:CGSizeMake(MAINSCREEN_WIDTH - 30, MAXFLOAT)];
//    if (self.allContentSize.height > 130) { // 105
//        self.contentSize = CGSizeMake(self.contentSize.width, 130);
//        self.isExculsionViewHidden = NO;
//    } else {
//        self.contentSize = self.allContentSize;
//        self.isExculsionViewHidden = YES;
//    }
//
//}
//@end
