evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 459 forks source link

Fling vertically cause StackOverflowError #121

Open SparkleBirdie opened 6 years ago

SparkleBirdie commented 6 years ago

col number is 16 row number is 250

java.lang.StackOverflowError: stack size 8MB at android.support.v7.widget.ChildHelper.getChildAt(ChildHelper.java:180) at android.support.v7.widget.RecyclerView$LayoutManager.getChildAt(RecyclerView.java:8552) at android.support.v7.widget.LinearLayoutManager.getChildClosestToEnd(LinearLayoutManager.java:1703) at android.support.v7.widget.LinearLayoutManager.updateLayoutState(LinearLayoutManager.java:1185) at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1331) at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1077) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.scrollVerticallyBy(CellLayoutManager.java:100) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener.onScrolled(VerticalRecyclerViewListener.java:168) at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4844) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1844) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.scrollVerticallyBy(CellLayoutManager.java:100) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener.onScrolled(VerticalRecyclerViewListener.java:168) at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4844) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1844) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.scrollVerticallyBy(CellLayoutManager.java:100) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener.onScrolled(VerticalRecyclerViewListener.java:168) at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4844) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1844) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.scrollVerticallyBy(CellLayoutManager.java:100) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener.onScrolled(VerticalRecyclerViewListener.java:168) at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4844) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1844) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.scrollVerticallyBy(CellLayoutManager.java:100) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1815) at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722) at com.evrencoskun.tableview.listener.scroll.VerticalRecyclerViewListener.onScrolled(VerticalRecyclerViewListener.java:168) at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4844) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1844) 05-27 21:17:19.754 25972-25972/com.tianyu.futures E/AndroidRuntime: at android.support.v7.widget.RecyclerView.scrollBy(RecyclerView.java:1722)

evrencoskun commented 6 years ago

Hi @SparkleBirdie ,

Which version do you use?

If you got this situation on 0.8.8 version, please try with 0.8.7 version as well.

How can I get the same situation? Please write the steps with a clear explanation.

SparkleBirdie commented 6 years ago

@evrencoskun Thank you. I got it on 0.8.8 my activity holds a parent fragment tabhost + fragments(5) in this parent fragment the tableviews lies in each of these five fragments. fling one of them cause the issue decrease fling factor / set column width would be better

sonique6784 commented 6 years ago

I'm experiencing the same issue. the reason is in VerticalRecyclerViewListener::onScrolled , scrollBy() is call, which cause the dispatchOnScrolled() which cause a call to VerticalRecyclerViewListener::onScrolled9() again, which create an infinite loop.