lsjwzh / RecyclerViewPager

Deprecated
Apache License 2.0
3.53k stars 667 forks source link

getCurrentPosition return wrong value after deleting/removingitem from recycler view #118

Open langhoangal opened 8 years ago

langhoangal commented 8 years ago

After deleting/removing item from recycler view, call getCurrentPosition() it still return the old position.

vishuhm911 commented 8 years ago

Hello, bro

I am not able to add it in the project. i always gets failed to resolve.

Singwai commented 8 years ago

did you call notifyDataSetChanged or notifyItem* method? You need to do it every time you update your data in the adapter.

langhoangal commented 8 years ago

Sure, i did, but it still return wrong value. I think that it related to the scroll animation (when remove item). If i try to call getCurrentPosition after (delay) 100ms then it work.

langhoangal commented 8 years ago

@vishuhm911 i think that you can open an new issues for that :)

BongJaeChoi commented 7 years ago

i have same issue. after removeitem(position) getcurrentpoision is weird

BongJaeChoi commented 7 years ago

i solved ...manager.findFirstVisibleItemPosition()

HasanShaikh commented 7 years ago

@BongJaeChoi I am trying to get the current item position in my activity from layout manager like this, position = layoutManager.findFirstVisibleItemPosition(); if i scroll right it gives the correct position but it gives wrong position when scroll left. Please let me know how to fix this.