Skip to content

Commit

Permalink
Scroll to the top of collapsed comments (regression fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Jun 23, 2016
1 parent 775351f commit ec2771a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ public void handleCommentVisibilityToggle(final RedditCommentView view) {

mCommentListingManager.notifyCommentChanged(item);
mCommentListingManager.updateHiddenStatus();

final LinearLayoutManager layoutManager = (LinearLayoutManager)mRecyclerView.getLayoutManager();
final int position = layoutManager.getPosition(view);

if(position == layoutManager.findFirstVisibleItemPosition()) {
layoutManager.scrollToPositionWithOffset(position, 0);
}
}
}

Expand Down

0 comments on commit ec2771a

Please sign in to comment.