greedo-layout-for-android icon indicating copy to clipboard operation
greedo-layout-for-android copied to clipboard

Find last visible item postion?

Open eneim opened this issue 8 years ago • 6 comments

I see you have findFirstVisibleItemPosition() for now. Is there any plan for findLastVisibleItemPosition ?

eneim avatar Mar 11 '16 03:03 eneim

Hello @eneim! :)

See https://github.com/500px/greedo-layout-for-android/issues/4

beltex avatar Mar 11 '16 04:03 beltex

Hi thanks for mentioning.

As for comment on that issue, I suppose (for Example) current LinearLayoutManager#findLastVisibleItemPosition() doesn't need to know your items ahead of time. I just tell you the last laid out item's adapter position. Therefore, it could be known after your each layout call. Simply saying, after you finish laid out all the item, this method return the adapter position of the last item which is visible on screen at that moment. Hope this make sense.

eneim avatar Mar 16 '16 03:03 eneim

Hey @eneim, findLastVisibleItemPosition() was added in #14. Let me know if it is working for you.

JVillella avatar Mar 29 '16 03:03 JVillella

Good news. Thanks. I'll try it right-away.

eneim avatar Mar 29 '16 04:03 eneim

@JVillella

It doesn't work on my end.

It returns the last position in the list's data store, even if it is not visible. Always return the last item in the list.

eshkoliGilad avatar Apr 27 '16 20:04 eshkoliGilad

@eshkoliGilad Me too, have you resolve your problem? Hope your help, thank you.

kibozh avatar Jul 18 '18 15:07 kibozh