Skip to content

Commit

Permalink
Additional fixes for Fast Scroll Thumb
Browse files Browse the repository at this point in the history
  • Loading branch information
yvolk committed Mar 27, 2014
1 parent ab61eaf commit 685df90
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/org/andstatus/app/TimelineActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1219,11 +1219,13 @@ protected void onPreExecute() {
}

private void prepareListForChanges() {
if ( (activity.getListAdapter() != null)
&& !loadOneMorePage) {
Cursor emptyCursor = new MatrixCursor(activity.getProjection());
((SimpleCursorAdapter) activity.getListAdapter()).changeCursor(emptyCursor);
activity.mCursor = emptyCursor;
if ( (activity.getListAdapter() == null)
|| ((activity.getListAdapter() != null)
&& !loadOneMorePage)
) {
DbUtils.closeSilently(activity.mCursor);
activity.mCursor = new MatrixCursor(activity.getProjection());
activity.createListAdapter();
}
}

Expand Down Expand Up @@ -1311,9 +1313,8 @@ private boolean changeListContent() {
cursorSet = true;
}
if (!cursorSet) {
DbUtils.closeSilently(activity.mCursor);
activity.mCursor = cursor;
activity.createListAdapter();
((SimpleCursorAdapter) activity.getListAdapter()).changeCursor(cursor);
activity.mCursor = cursor;
}
}
return doRestorePosition;
Expand Down

0 comments on commit 685df90

Please sign in to comment.