Closed ashraful29 closed 8 years ago
Hi @ashraful29 ,
can you provide code snippet for Paginate setuping and how do you add more items into the list. Can you confirm that this item (that takes full span) is the last item on a certain page?
There is Paginate Initialization code.. Where newSpanCount is number of Grid Column
int threshold=4;
paginate = Paginate.with(listProduct, this)
.setLoadingTriggerThreshold(threshold)
.setLoadingListItemSpanSizeLookup(new LoadingListItemSpanLookup() {
@Override
public int getSpanSize() {
return newSpanCount ;
}
})
.build();
And below code is adding more items...
int range = productAdapter.getItemCount();
// productAdapter.products.addAll(productsResponse.getProducts());
productAdapter.addAll(productsResponse.getProducts());
loading = false;
System.out.print("Size" + productList.size());
productAdapter.notifyItemRangeInserted(range,productsResponse.getProducts().size());
productAdapter.notifyDataSetChanged();
And The item which take full span is the first item in a particular page when loading more..
What's the implementation of productAdapter.addAll(items)
- do you call any adapter related callbacks inside that method?
Why do you call both notifyItemRangeInserted(int positionStart, itemCount)
and notifyDataSetChanged()
?
Check the sample for the example for RecyclerView + GridLayoutManager with span = 2.
Since long inactivity on this issue, I will close it for now. Feel free to reopen it if you still have problems with this.
Sometime The RecyclerView Item Take Whole row og GridLayoutManger On load more Action I upload below image for understanding the problem.