Skip to main content

Posts

Showing posts from March, 2013

Interactive Headers for StickyGridHeaders

Tonight, I added touch events to the section headers for StickyGridHeadersGridView . Unfortunately, as the headers in the  StickyGridHeadersGridView  live outside the internal GridView list implementation, I had to implement my own touch event handling rather than simply wrapping around that which is provided by  GridView . Unfortunately, adding tap and long press actions in a ViewGroup is moderately complicated and in this case it is made considerable more complicated as  StickyGridHeadersGridView  is a subclass of AbsListView . AbsListView  takes over the touch events at various stages and has an internal state tracker for determining the current user action, be it flinging , scrolling , long pressing , or tapping, there are some other internal states too. Anyway, the solution to correctly implementing interactive headers for  StickyGridHeaders'  was to read the events before the underlying GridView  receives them and block (consume) the specific cases where the user is tapping