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.

Allow to use custom LayoutManagers on the RecyclerView

See original GitHub issue

Hi,

I’d like to report a crash that happens while the library tries to bind a view if we use a LayoutManager different than a LinearLayoutManager or StaggeredGridLayoutManager. This is happening on the version 5.0.0-rc1 and 5.0.0-SNAPSHOT built on 2017.02.15.

Here’s the StackTrace I’m getting :

java.lang.ClassCastException: com.beloo.widget.chipslayoutmanager.ChipsLayoutManager cannot be cast to android.support.v7.widget.LinearLayoutManager
at eu.davidea.flexibleadapter.utils.Utils.findLastVisibleItemPosition(Utils.java:347)
at eu.davidea.flexibleadapter.AnimatorAdapter.animateView(AnimatorAdapter.java:369)
at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1880)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6312)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5258)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5521)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5363)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5359)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fillWithLayouter(ChipsLayoutManager.java:858)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fill(ChipsLayoutManager.java:821)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.onLayoutChildren(ChipsLayoutManager.java:719)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3506)
at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2969)

Thank you !

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
davideascommented, Apr 22, 2017

Custom layout manager are now supported, it will be available from next Snapshot. You’ll need to implement the IFlexibleLayoutManager. See the new FlexibleLayoutManager as working example.

1reaction
davideascommented, Feb 27, 2017

@Christophe668, i will think about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a RecyclerView LayoutManager – Part 1
The LayoutManager API allows powerful and complex layout recycling because it ... @Override public void onLayoutChildren(RecyclerView.
Read more >
Customize your RecyclerView - Android Developers
The RecyclerView uses a layout manager to position the individual items on the screen and determine when to reuse item views that are...
Read more >
A custom LayoutManager case: Bumble Beeline - Medium
A custom LayoutManager extends RecyclerView.LayoutManager. This abstract class requires only one method to be implemented: generateDefaultLayoutParams() . This ...
Read more >
Using the RecyclerView | CodePath Android Cliffnotes
LayoutManager that allows any item layouts including horizontal lists or ... You will have to override two main methods: one to inflate the...
Read more >
android - RecyclerView with custom LayoutManager not show ...
Looking at the source of RecyclerView and LinearLayoutManager it seems that a custom LayoutManager has to implement these methods to show ...
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