Skip to content
Browse files

Merge pull request #59 from myell0w/master

Added delegate method to inform the delegate when animated updates finished
  • Loading branch information...
2 parents 7e96dca + 150b372 commit 25eb8c4059c7099c69c7aa07957e6c607c776e00 @AlanQuatermain committed
Showing with 336 additions and 329 deletions.
  1. +26 −22 Classes/AQGridView.h
  2. +310 −307 Classes/AQGridView.m
View
48 Classes/AQGridView.h
@@ -1,25 +1,25 @@
/*
* AQGridView.h
* AQGridView
- *
+ *
* Created by Jim Dovey on 10/2/2010.
* Copyright 2010 Kobo Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of the project's author nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -80,6 +80,9 @@ typedef enum {
- (void) gridView: (AQGridView *) gridView didSelectItemAtIndex: (NSUInteger) index numFingersTouch:(NSUInteger)numFingers;
- (void) gridView: (AQGridView *) gridView didDeselectItemAtIndex: (NSUInteger) index;
+// Called after animated updates finished
+- (void) gridViewDidEndUpdateAnimation:(AQGridView *) gridView;
+
// NOT YET IMPLEMENTED
- (void) gridView: (AQGridView *) gridView gestureRecognizer: (UIGestureRecognizer *) recognizer activatedForItemAtIndex: (NSUInteger) index;
@@ -95,38 +98,38 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
@interface AQGridView : UIScrollView
{
id<AQGridViewDataSource> _dataSource;
-
+
AQGridViewData * _gridData;
NSMutableArray * _updateInfoStack;
NSInteger _animationCount;
-
+
CGRect _visibleBounds;
NSRange _visibleIndices;
NSMutableArray * _visibleCells;
NSMutableDictionary * _reusableGridCells;
-
+
NSSet * _animatingCells;
NSIndexSet * _animatingIndices;
-
+
NSMutableIndexSet * _highlightedIndices;
UIView * _touchedContentView; // weak reference
-
+
UIView * _backgroundView;
UIColor * _separatorColor;
-
+
NSInteger _reloadingSuspendedCount;
NSInteger _displaySuspendedCount;
-
+
NSInteger _updateCount;
-
+
NSUInteger _selectedIndex;
NSUInteger _pendingSelectionIndex;
-
+
CGPoint _touchBeganPosition;
-
+
UIView * _headerView;
UIView * _footerView;
-
+
struct
{
unsigned resizesCellWidths:1;
@@ -145,7 +148,7 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
unsigned isAnimatingUpdates:1; // unused, see _animationCount instead
unsigned requiresSelection:1;
unsigned contentSizeFillsBounds:1;
-
+
unsigned delegateWillDisplayCell:1;
unsigned delegateWillSelectItem:1;
unsigned delegateWillSelectItemMultiTouch:1;
@@ -155,11 +158,12 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
unsigned delegateDidDeselectItem:1;
unsigned delegateGestureRecognizerActivated:1;
unsigned delegateAdjustGridCellFrame:1;
-
+ unsigned delegateDidEndUpdateAnimation:1;
+
unsigned dataSourceGridCellSize:1;
-
+
unsigned int isEditing:1;
-
+
unsigned __RESERVED__:1;
} _flags;
}
@@ -265,4 +269,4 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
// The width/height values returned by this function will be rounded UP to the nearest denominator of the screen width.
- (CGSize) portraitGridCellSizeForGridView: (AQGridView *) gridView;
-@end
+@end
View
617 Classes/AQGridView.m
310 additions, 307 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 25eb8c4

Please sign in to comment.
Something went wrong with that request. Please try again.