FlexibleAdapter icon indicating copy to clipboard operation
FlexibleAdapter copied to clipboard

FlexibleAdapter return to RecyclerView position changes

Open InspectorZheleshka opened this issue 6 years ago • 2 comments

Version 5.0.1 The problem is: I have RecyclerView with sticky headers and several items related to each header. When I change my view to another and return back to view with RecyclerView, position of items in RecyclerView changes (I call update adapter data method with content items each time I return back to this view). Usually it scrolls down by several positions. Amount of positions is not determined.

The question is: how could i scroll back to relevant position. I tried to use RecyclerView scroll methods, but result is quite disappointing, because it scrolls content wrong in very unpredictable way.

I tried to use FastScroller, but i don't actually understand how to use it correctly and could it be used for such purposes.

I suppose that there are some ways to scroll content using FlexibleAdapter features, but i can't find any solutions of this problem on the Web.

InspectorZheleshka avatar Jan 15 '19 15:01 InspectorZheleshka

@InspectorZheleshka, strange. Are you trying to scroll via code or manually? FastScroller sync has been fixed in 5.0.5.

davideas avatar Jan 21 '19 21:01 davideas

@davideas, i have already tried to scroll it via code, using RecyclerView default functions, e.g. scrollTo(...), scrollToPosition(...): [ I tried to use RecyclerView scroll methods, but result is quite disappointing, because it scrolls content wrong in very unpredictable way.] Talking about FastScroller: I haven't used it in my project by default. But I have tried to use FastScroller to scroll RecyclerView to the required position (before changing view) via code, I thought it could help to deal with this bug. But all functions I have tried moved FastScroller element on screen, not the FastScroller slider. So I don't even understand is it a good idea to use FastScroller to scroll RecyclerView via code. Maybe there are some other features?

Here are some screenshots to show you what is my problem. Steps:

  1. Scroll to some position
  2. Change my view to details
  3. Press [back] button and navigate to my list. You can see, that list content have been scrolled by several positions. That is my problem, it automatically scrolls itself every time.

screenshot_1548677949 screenshot_1548677952 screenshot_1548677957

InspectorZheleshka avatar Jan 28 '19 12:01 InspectorZheleshka