2017-10-10 22:13:54 +02:00
|
|
|
//
|
2018-05-30 16:45:25 +02:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-10-10 22:13:54 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2018-06-25 21:20:17 +02:00
|
|
|
@class ConversationStyle;
|
2018-06-22 19:48:23 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@protocol ConversationViewLayoutItem <NSObject>
|
|
|
|
|
2018-08-09 16:47:43 +02:00
|
|
|
- (CGSize)cellSize;
|
2017-10-10 22:13:54 +02:00
|
|
|
|
2018-06-25 21:00:45 +02:00
|
|
|
- (CGFloat)vSpacingWithPreviousLayoutItem:(id<ConversationViewLayoutItem>)previousLayoutItem;
|
2018-06-22 19:48:23 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
@protocol ConversationViewLayoutDelegate <NSObject>
|
|
|
|
|
|
|
|
- (NSArray<id<ConversationViewLayoutItem>> *)layoutItems;
|
|
|
|
|
2017-10-16 02:46:48 +02:00
|
|
|
- (CGFloat)layoutHeaderHeight;
|
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
2017-10-11 15:58:20 +02:00
|
|
|
// A new lean and efficient layout for conversation view designed to
|
|
|
|
// handle our edge cases (e.g. full-width unread indicators, etc.).
|
2017-10-10 22:13:54 +02:00
|
|
|
@interface ConversationViewLayout : UICollectionViewLayout
|
|
|
|
|
|
|
|
@property (nonatomic, weak) id<ConversationViewLayoutDelegate> delegate;
|
2017-11-22 20:57:33 +01:00
|
|
|
@property (nonatomic, readonly) BOOL hasLayout;
|
2018-05-30 16:45:25 +02:00
|
|
|
@property (nonatomic, readonly) BOOL hasEverHadLayout;
|
2018-06-25 21:20:17 +02:00
|
|
|
@property (nonatomic, readonly) ConversationStyle *conversationStyle;
|
2018-06-22 19:48:23 +02:00
|
|
|
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
|
2018-08-09 16:47:43 +02:00
|
|
|
- (instancetype)initWithConversationStyle:(ConversationStyle *)conversationStyle;
|
2017-10-11 20:45:02 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|