Skip to content

Commit 71817f2

Browse files
Merge commit '8ac7f9' into footer-fixes
* commit '8ac7f9': Fixed: Auto-scrolling to the most bottom row even if this is not necessary. Also, some logging stuff was removed.
2 parents 5625e90 + 8ac7f90 commit 71817f2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Classes/AQGridView.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ - (BOOL) isAnimatingUpdates
423423

424424
- (void) updateContentRectWithOldMaxLocation: (CGPoint) oldMaxLocation gridSize: (CGSize) gridSize
425425
{
426+
// The following line prevents an update leading to unneccessary auto-scrolling
427+
// Before this fix, AQGridView animation always caused scrolling to the most bottom line
428+
if (CGSizeEqualToSize(self.contentSize, gridSize)) return;
429+
426430
// update content size
427431
self.contentSize = gridSize;
428432

Classes/AQGridViewUpdateInfo.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
730730
// indices of items visible from old grid
731731
NSIndexSet * oldVisibleIndices = [_oldGridData indicesOfCellsInRect: contentRect];
732732

733-
NSLog( @"Updating from original content rect %@", NSStringFromCGRect(contentRect) );
733+
// The line below is commented because it produces too many logs
734+
// NSLog( @"Updating from original content rect %@", NSStringFromCGRect(contentRect) );
734735

735736
if ( (isVertical) && (maxY > gridSize.height) )
736737
{
@@ -759,7 +760,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
759760
[_gridView updateGridViewBoundsForNewGridData: _newGridData];
760761
}
761762

762-
NSLog( @"Updated content rect: %@", NSStringFromCGRect(contentRect) );
763+
// The line below is fixed because it produces too many logs
764+
//NSLog( @"Updated content rect: %@", NSStringFromCGRect(contentRect) );
763765
NSIndexSet * newVisibleIndices = [_newGridData indicesOfCellsInRect: contentRect];
764766

765767
NSMutableSet * newVisibleCells = [[NSMutableSet alloc] initWithSet: _gridView.animatingCells];

0 commit comments

Comments
 (0)