I am a newbie to android development.Now i would like to do gallery view as circular like image as below.The things is that i want to enlarge the center image when user scroll from left to right and right to left. Is there any tutorials for that ?
what I want is the image that's been swiped need to be enlarged while it's at the center. I thought I could do it with Gallery. but the example from the android developer is not the one I want. :(
youcan try:
I created my own tutorial for this: http://evgeni-shafran.blogspot.com/2011/08/tutorial-custom-gallery-circular-and.html
For it to be circular you need to make it think that it have A LOT of items, a lot more then you really have.
And then by making position= position % items.length you create something like (I will show it for 3 items) : 1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3 And then go to the middle so even if the scroll a lot he wont come near to the end. 1,2,3,1,2,3,1,2,3,->1<-,2,3,1,2,3,1,2,3,1,2,3
For it to be selected: you need to override setOnItemSelectedListener and manipulate the size. dont forget to save a reference to your last view so when you get to the next one you can make it look regular, not enlarged.
I implemented both of this in my tutorial listed above
If you want to enlarge the center selected image there is one possible way. On your onItemSelected method, just call an animation to zoom the object. The property of gallery is that it is always center-locked. So the center element will be always selected. Hope that will work..
Do remember that you will have to store the previous view as when the element is move away from center it should be put to the normal size.
So you can have two views - prevView and currView.
Do the animation on the currView.
Thanks,
Sen