Permalink
Browse files

Fixes build error, also adds header support

  • Loading branch information...
1 parent 405af45 commit 7e004b40301bdce6410e182ae348f47660fc54b1 @skatou committed Jul 3, 2012
@@ -13,6 +13,7 @@
@interface XJWaterfallPathInfo : NSObject
@property (nonatomic, assign) NSUInteger column;
+@property (nonatomic, assign) CGFloat headerHeight;
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign, readonly) CGFloat height;
@@ -14,6 +14,7 @@
@interface XJWaterfallPathInfo() {
@private
NSUInteger column_;
+ CGFloat headerHeight_;
CGFloat x_;
CGFloat width_;
NSMutableArray* petalViewInfos_;
@@ -34,12 +35,13 @@ - (void) dealloc {
#pragma mark - Public methods
@synthesize column = column_;
+@synthesize headerHeight = headerHeight_;
@synthesize x = x_;
@synthesize width = width_;
- (CGFloat) height {
if ([self numberOfPetals] == 0) {
- return 0.0f;
+ return [self headerHeight];
} else {
return CGRectGetMaxY([[[self petalViewInfos] lastObject] frame]);
}
@@ -26,6 +26,7 @@
@interface XJWaterfallView : UIScrollView
@property (nonatomic, assign) id<XJWaterfallViewDataSource> dataSource;
@property (nonatomic, strong) UIView* backgroundView;
+@property (nonatomic, assign) CGFloat headerHeight;
@property (nonatomic, assign) CGFloat petalViewGap;
@property (nonatomic, assign) CGFloat rightMargin;
@@ -19,6 +19,7 @@ @interface XJWaterfallView() {
@private
__unsafe_unretained id<XJWaterfallViewDataSource> dataSource_;
UIView* backgroundView_;
+ CGFloat headerHeight_;
CGFloat petalViewGap_;
CGFloat rightMargin_;
NSArray* visiblePetalViews_;
@@ -77,7 +78,6 @@ - (id) initWithFrame:(CGRect)frame {
- (void) dealloc {
[self setDataSource:nil];
[self setBackgroundView:nil];
- [self setLoadMoreIndicator:nil];
[self setVisiblePetalViews:nil];
[self setReusablePetalViews:nil];
[self setPathInfos:nil];
@@ -113,6 +113,7 @@ - (void) setBackgroundView:(UIView*)backgroundView {
}
}
+@synthesize headerHeight = headerHeight_;
@synthesize petalViewGap = petalViewGap_;
@synthesize rightMargin = rightMargin_;
@@ -258,6 +259,7 @@ - (void) prepareParametersNeededForLayout {
XJWaterfallPathInfo* pathInfo = [[XJWaterfallPathInfo alloc] init];
[pathInfo setColumn:col];
+ [pathInfo setHeaderHeight:[self headerHeight]];
[pathInfo setX:pathStartX];
[pathInfo setWidth:pathWidth];
[pathInfos addObject:pathInfo];

0 comments on commit 7e004b4

Please sign in to comment.