Skip to content

Commit 150b372

Browse files
committed
Added delegate method to inform when animated updates finished
1 parent 87f8f48 commit 150b372

File tree

2 files changed

+336
-329
lines changed

2 files changed

+336
-329
lines changed

Classes/AQGridView.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/*
22
* AQGridView.h
33
* AQGridView
4-
*
4+
*
55
* Created by Jim Dovey on 10/2/2010.
66
* Copyright 2010 Kobo Inc. All rights reserved.
7-
*
7+
*
88
* Redistribution and use in source and binary forms, with or without
99
* modification, are permitted provided that the following conditions
1010
* are met:
11-
*
11+
*
1212
* Redistributions of source code must retain the above copyright notice,
1313
* this list of conditions and the following disclaimer.
14-
*
14+
*
1515
* Redistributions in binary form must reproduce the above copyright
1616
* notice, this list of conditions and the following disclaimer in the
1717
* documentation and/or other materials provided with the distribution.
18-
*
18+
*
1919
* Neither the name of the project's author nor the names of its
2020
* contributors may be used to endorse or promote products derived from
2121
* this software without specific prior written permission.
22-
*
22+
*
2323
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2424
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2525
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -80,6 +80,9 @@ typedef enum {
8080
- (void) gridView: (AQGridView *) gridView didSelectItemAtIndex: (NSUInteger) index numFingersTouch:(NSUInteger)numFingers;
8181
- (void) gridView: (AQGridView *) gridView didDeselectItemAtIndex: (NSUInteger) index;
8282

83+
// Called after animated updates finished
84+
- (void) gridViewDidEndUpdateAnimation:(AQGridView *) gridView;
85+
8386
// NOT YET IMPLEMENTED
8487
- (void) gridView: (AQGridView *) gridView gestureRecognizer: (UIGestureRecognizer *) recognizer activatedForItemAtIndex: (NSUInteger) index;
8588

@@ -95,38 +98,38 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
9598
@interface AQGridView : UIScrollView
9699
{
97100
id<AQGridViewDataSource> _dataSource;
98-
101+
99102
AQGridViewData * _gridData;
100103
NSMutableArray * _updateInfoStack;
101104
NSInteger _animationCount;
102-
105+
103106
CGRect _visibleBounds;
104107
NSRange _visibleIndices;
105108
NSMutableArray * _visibleCells;
106109
NSMutableDictionary * _reusableGridCells;
107-
110+
108111
NSSet * _animatingCells;
109112
NSIndexSet * _animatingIndices;
110-
113+
111114
NSMutableIndexSet * _highlightedIndices;
112115
UIView * _touchedContentView; // weak reference
113-
116+
114117
UIView * _backgroundView;
115118
UIColor * _separatorColor;
116-
119+
117120
NSInteger _reloadingSuspendedCount;
118121
NSInteger _displaySuspendedCount;
119-
122+
120123
NSInteger _updateCount;
121-
124+
122125
NSUInteger _selectedIndex;
123126
NSUInteger _pendingSelectionIndex;
124-
127+
125128
CGPoint _touchBeganPosition;
126-
129+
127130
UIView * _headerView;
128131
UIView * _footerView;
129-
132+
130133
struct
131134
{
132135
unsigned resizesCellWidths:1;
@@ -145,7 +148,7 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
145148
unsigned isAnimatingUpdates:1; // unused, see _animationCount instead
146149
unsigned requiresSelection:1;
147150
unsigned contentSizeFillsBounds:1;
148-
151+
149152
unsigned delegateWillDisplayCell:1;
150153
unsigned delegateWillSelectItem:1;
151154
unsigned delegateWillSelectItemMultiTouch:1;
@@ -155,11 +158,12 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
155158
unsigned delegateDidDeselectItem:1;
156159
unsigned delegateGestureRecognizerActivated:1;
157160
unsigned delegateAdjustGridCellFrame:1;
158-
161+
unsigned delegateDidEndUpdateAnimation:1;
162+
159163
unsigned dataSourceGridCellSize:1;
160-
164+
161165
unsigned int isEditing:1;
162-
166+
163167
unsigned __RESERVED__:1;
164168
} _flags;
165169
}
@@ -265,4 +269,4 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
265269
// The width/height values returned by this function will be rounded UP to the nearest denominator of the screen width.
266270
- (CGSize) portraitGridCellSizeForGridView: (AQGridView *) gridView;
267271

268-
@end
272+
@end

0 commit comments

Comments
 (0)