2

I'm working on a custom RecyclerView and I need to make rows of images that expand/collapse when scrolling. I did everything except the last row won't expand because the scroll has reached it's end and onScrolled is not called anymore.

My first workaround was, to make custom Adapter and add a footer there, but that is not very efficient for a CustomRecyclerView.

I also extended LinearLayoutManager, is it possible I could create a footer there or expand the scroll range? I tried overriding the computeVerticalScrollRange but it had no effect on the scrolling whatsoever.

I would like to make scroll longer for expandedHeight - collapsedHeight

so I was thinking of making this:

@Override
public int computeVerticalScrollRange(RecyclerView.State state) {
    return (super.computeVerticalScrollRange(state) + (maxHeight - minHeight));
}

Unfortunately as I said, nothing was changed. This method was overriden in LayoutManager, I also tried to override it in RecycleView but same result.

slorangex
  • 1,334
  • 2
  • 12
  • 25

0 Answers0