In my android app I have this scenario –
I have a Gallery where I have to display some images.
I have a total of 13 images each of which I get by calling a function with some parameters.
Now in my adapter for gallery I can only pass 7 images at a time and when the user scrolls through the gallery I should update the gallery items.
eg. My images are {0,1,2,3,4,5,6,7,8,9,10,11,12}.
First time I can only get and show {3,4,5,6,7,8,9} with 6 at center-display
now if the user scrolls rightwards I want to remove 3 from the left end and add 10 at the right end so that the adapter array becomes {4,5,6,7,8,9,10} with 7 at center and so on.
Similarly if the user scrolls leftward i want to remove 9 from right end and add 2 at the left end so that the adapter array becomes {2,3,4,5,6,7,8} with 5 at the center.
I am using LinkedList for storing my items
How can I achieve this.
Please Help.
Just use a custom class extends Gallery, Override
onFling()detect gesture(left or right) and do your operation of removing.