jess-anders / two-way-gridview

An Android GridView that can be configured to scroll horizontally or vertically
650 stars 261 forks source link

Issues with currently selected items. #29

Open RedshirtMB opened 9 years ago

RedshirtMB commented 9 years ago

It seem like the twowaygridview doesn't handle focus change properly. Take for example the following scenario.

grid layout

Both Alpha and Gamma grid are scrolling horizontally and both only have one row. Pressing UP on the d-pad from Gamma always transfers focus to Alpha-6 (the the last visible item on Alpha). Pressing down from Alpha always sets the focus to Gamma-A.

I've tried using onFocusChangeListeners and calling either setSelection(position) or manually calling the OnItemSelectedListener but both are ignored. Should the default focus not be position 0 on first entry, and the last selected position on re-entry?