T1StatusLayout.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // T1StatusLayout.h
  3. // YYKitExample
  4. //
  5. // Created by guoyaoyuan on 15/10/10.
  6. // Copyright (C) 2015 ibireme. All rights reserved.
  7. //
  8. #import "YYKit.h"
  9. #import "T1Model.h"
  10. #define kT1CellPadding 12
  11. #define kT1CellInnerPadding 6
  12. #define kT1CellExtendedPadding 30
  13. #define kT1AvatarSize 48
  14. #define kT1ImagePadding 4
  15. #define kT1ConversationSplitHeight 25
  16. #define kT1ContentLeft (kT1CellPadding + kT1AvatarSize + kT1CellInnerPadding)
  17. #define kT1ContentWidth (kScreenWidth - 2 * kT1CellPadding - kT1AvatarSize - kT1CellInnerPadding)
  18. #define kT1QuoteContentWidth (kT1ContentWidth - 2 * kT1CellPadding)
  19. #define kT1ActionsHeight 6
  20. #define kT1TextContainerInset 4
  21. #define kT1UserNameFontSize 14
  22. #define kT1UserNameSubFontSize 12
  23. #define kT1TextFontSize 14
  24. #define kT1ActionFontSize 12
  25. #define kT1UserNameColor UIColorHex(292F33)
  26. #define kT1UserNameSubColor UIColorHex(8899A6)
  27. #define kT1CellBGHighlightColor [UIColor colorWithWhite:0.000 alpha:0.041]
  28. #define kT1TextColor UIColorHex(292F33)
  29. #define kT1TextHighlightedColor UIColorHex(1A91DA)
  30. #define kT1TextActionsColor UIColorHex(8899A6)
  31. #define kT1TextHighlightedBackgroundColor UIColorHex(ebeef0)
  32. #define kT1TextActionRetweetColor UIColorHex(19CF86)
  33. #define kT1TextActionFavoriteColor UIColorHex(FAB81E)
  34. @interface T1StatusLayout : NSObject
  35. @property (nonatomic, strong) T1Tweet *tweet;
  36. @property (nonatomic, strong) T1Conversation *conversation;
  37. - (void)layout;
  38. @property (nonatomic, assign) CGFloat height;
  39. @property (nonatomic, assign) CGFloat paddingTop;
  40. @property (nonatomic, assign) CGFloat textTop;
  41. @property (nonatomic, assign) CGFloat textHeight;
  42. @property (nonatomic, assign) CGFloat imagesTop;
  43. @property (nonatomic, assign) CGFloat imagesHeight;
  44. @property (nonatomic, assign) CGFloat quoteTop;
  45. @property (nonatomic, assign) CGFloat quoteHeight;
  46. @property (nonatomic, assign) BOOL showTopLine;
  47. @property (nonatomic, assign) BOOL isConversationSplit;
  48. @property (nonatomic, assign) BOOL showConversationTopJoin;
  49. @property (nonatomic, assign) BOOL showConversationBottomJoin;
  50. @property (nonatomic, strong) YYTextLayout *socialTextLayout;
  51. @property (nonatomic, strong) YYTextLayout *nameTextLayout;
  52. @property (nonatomic, strong) YYTextLayout *dateTextLayout;
  53. @property (nonatomic, strong) YYTextLayout *textLayout;
  54. @property (nonatomic, strong) YYTextLayout *quotedNameTextLayout;
  55. @property (nonatomic, strong) YYTextLayout *quotedTextLayout;
  56. @property (nonatomic, strong) YYTextLayout *retweetCountTextLayout;
  57. @property (nonatomic, strong) YYTextLayout *favoriteCountTextLayout;
  58. @property (nonatomic, strong) NSArray<T1Media *> *images;
  59. @property (nonatomic, readonly) T1Tweet *displayedTweet;
  60. - (YYTextLayout *)retweetCountTextLayoutForTweet:(T1Tweet *)tweet;
  61. - (YYTextLayout *)favoriteCountTextLayoutForTweet:(T1Tweet *)tweet;
  62. @end