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

Add a selected state to onItemClick #77

Closed premnirmal closed 10 years ago

premnirmal commented 10 years ago

This is a request to allow selector states on gridItems.

Similar to regular listviews, when a grid/list item is clicked, the view should show a selector press state:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:drawable="@drawable/pressed_background" android:state_activated="true"/>
  <item android:drawable="@drawable/pressed_background" android:state_checked="true"/>
  <item android:drawable="@drawable/pressed_background" android:state_selected="true"/>
  <item android:drawable="@drawable/pressed_background" android:state_pressed="true"/>
</selector>

Right now press states only work on the header or footer of StaggeredGridView, not on GridItems. Also, if the view of the grid item has a pressState attached to it, it doesn't change to a selector state when pressed.

liangsaifei commented 10 years ago

please read the TODO list

TODO The StaggeredGridView does not support the following:

Item selector drawables Item long press event Scroll bars Row dividers Edge effect Fading edge Overscroll

denizmveli commented 10 years ago

Duplicate and has been addressed. In the Etsy app we set the selector and the click listener on the adapter item.