question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FlexBoxLayoutManager Scrolling Issue

See original GitHub issue

I have a RecyclerView that has a FlexboxLayoutManager (as new FlexboxLayoutManager(FlexDirection.ROW)).

When I add an item to the RecyclerView I want to scroll to the newest item using scrollToPosition(adapter.getItemCount() - 1).

The problem is that when I do that, after filling a line, the next scroll causes the first column of the last row to scroll to the top of the RecyclerView, and the rest of the RecyclerView is filled with empty space so all the items above it are scrolled off the screen.

You can see this behavior in the sample app of this library that uses FlexboxLayoutManager (in the flexbox branch). Just click the FAB to start adding items.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
thagikuracommented, Feb 24, 2017

Found that there was an issue in the layout logic when scrollTo position was called with a new item in the adapter.

I’ll release a fixed version anytime soon.

0reactions
thagikuracommented, Mar 22, 2017

Should be fixed by #231.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FlexboxLayoutManager item flickering on scrolling of another ...
The first recyclerview item is flickering when scrolling on another recyclerView. It's working fine when item count of RecyclerView 1 is less ...
Read more >
RecyclerView within NestedScrollView Scrolling Issue - Medium
Now what kinda problem occurred when we used nestedScrollView and put recyclerView inside nestedScrollView , it scrolls at various speeds depending on gestures....
Read more >
Build flexible layouts with FlexboxLayout
LayoutManager , now you can make use of the Flexbox functionalities in a scrollable container in much more memory-efficient way.
Read more >
flexbox-layout changelog - Awesome Android | LibHunt
#2; FlexboxLayoutManager can now scroll both directions #215 ... #283; Fixes the issue that the index of the view becomes inconsistent #311 ...
Read more >
Flexbox inside the RecyclerView as a LayoutManager ...
Flexbox with a large number of items in a scrollable container! ... FlexboxLayout, FlexboxLayoutManager (RecyclerView) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found