http://developer.android.com/reference/android/widget/GridView.html
The default way the elements of the array is put in a GridView is
zigzagging left-right-down.
e.g. array {1,2,3,4,5,6,7,8,9,10} becomes
by default (with columns fixed to 3)
1,2,3
4,5,6
7,8,9
10
Is there a way to get to zigzag up-down-right (with rows fixed to 3)?
1,4,7,10
2,5,8
3,6,9
Also I like to be able to enforce a column move in getView. Free
zigzag style: No fixed number of columns columns or rows:
For instance in free up-down-right zigzag
1,5,6,9
2, 7,10
3, 8
4
In free left-right-down zigzag
1,2
3
4,5,6,7
8,9,10
And then in getView with a command tell the GridView to go to the next
column or row.
I now kind of solved it with row and column data in a database table,
sort it in a query and inserting dummy elements to the array to get
the right layout, but I wonder if there is a more direct and efficient
way to this. The database is also larger and filled with presentation
data which is undesirable.
e.g. in free up-down-right zigzag
I have 10 domain data elements but with inserting 6 dummy elements the
array size is increased to 16.
It would be more efficient to keep the array size 10.
Or are there alternative views which do this job better?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en