Closed leyvien closed 4 years ago
My app crash when use gridlayoutmanager in pagination
Hi @leyvien. We checked OmegaRecyclerView, GridLayoutManager and pagination and we couldn't reproduce your crash. Can you provide us an example ?
Hi @R12rus Sorry for the late reply I already figured out,it not relate to GridLayoutManager , sometime my API return empty list then i add and call notifyItemInserted, then the crash happen, i don't know this error relate to RecyclerView or you library or my fault(happen frequently when try to scroll fast)
One more thing, with GridLayoutManager the ErrorView, and LoadingView position not put at the bottom like the LinearLayoutManager, how can i put it into the bottom Thank you for great Library!!!
@leyvien Please check out our example - PaginationActivity. Change layout code to
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.omega_r.omegarecyclerview.pagination_example.PaginationActivity">
<com.omega_r.libs.omegarecyclerview.OmegaRecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:paginationLayout="@layout/item_progress"
app:layoutManager="GridLayoutManager"
app:spanCount="2"
app:paginationErrorLayout="@layout/item_error_loading"/>
</FrameLayout>
ErrorView and LoadingView now at the bottom. If you change app:spanCount to 3 - LoadingView will be the last position in the list.
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{2eca69b position=21 id=-1, oldPos=20, pLpos:20 scrap [attachedScrap] tmpDetached no parent} com.omega_r.libs.omegarecyclerview