etsy / AndroidStaggeredGrid

An Android staggered grid view which supports multiple columns with rows of varying sizes.
https://github.com/etsy/AndroidStaggeredGrid
4.76k stars 1.13k forks source link

setSelection does not work. #195

Open ahmed-alamir opened 8 years ago

ahmed-alamir commented 8 years ago

Expected behavior from a GridView is to change scroll making the item passed to setSelection at the very top. This does not happen, the top item remains at 0.

CongBaDo commented 8 years ago

I am facing this problem, does anyone have solution?

mrdjohnson commented 8 years ago

call set selection in the scroll listener?

@Override public void onScroll(final AbsListView view, final int firstVisibleItem, final int visibleItemCount, final int totalItemCount) { staggeredGridView.setSelection(firstVisibleItem); }