Skip to content

Commit

Permalink
Precaution against UnifiedDisplayView flickering
Browse files Browse the repository at this point in the history
Finer management of rowHeightArray, when a bottom cell get finished before upper cells.

Conflicts:
	src/UnifiedDisplayView.m
  • Loading branch information
barijaona committed Apr 5, 2014
1 parent 385bc34 commit 971ca46
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/UnifiedDisplayView.m
Expand Up @@ -345,7 +345,12 @@ - (void)webViewLoadFinished:(NSNotification *)notification
if (row < [rowHeightArray count])
[rowHeightArray replaceObjectAtIndex:row withObject:[NSNumber numberWithFloat:fittingHeight]];
else
{ NSInteger toAdd = row - [rowHeightArray count] ;
for (NSInteger i = 0 ; i < toAdd ; i++) {
[rowHeightArray addObject:[NSNumber numberWithFloat:DEFAULT_CELL_HEIGHT]];
}
[rowHeightArray addObject:[NSNumber numberWithFloat:fittingHeight]];
}
[cell setInProgress:NO];
[articleList reloadRowAtIndex:row];
}
Expand Down Expand Up @@ -927,7 +932,10 @@ - (CGFloat)listView:(PXListView*)aListView heightOfRow:(NSUInteger)row
CGFloat height;
if (row >= [rowHeightArray count])
{
[rowHeightArray addObject:[NSNumber numberWithFloat:DEFAULT_CELL_HEIGHT]];
NSInteger toAdd = row - [rowHeightArray count] + 1 ;
for (NSInteger i = 0 ; i < toAdd ; i++) {
[rowHeightArray addObject:[NSNumber numberWithFloat:DEFAULT_CELL_HEIGHT]];
}
return (CGFloat)DEFAULT_CELL_HEIGHT;
}
else
Expand Down

0 comments on commit 971ca46

Please sign in to comment.