0

I need to display a book that is all images, and I want to change the image by swiping, with an effect that the next page comes above the previous page (from the left edge, simple and not page curl etc.) to give the user the feeling that he indeed changed the page.

I tried with a gallery but I didnt succeed, because a swipe would change a lot of pictures and other stuff. So should I use an ImageView, if so, which animation is the best for what I described?
Or is there another widget?

Omar
  • 7,835
  • 14
  • 62
  • 108
  • Have you considered the Gallery ? – Jean-Philippe Roy Mar 09 '12 at 20:06
  • @Jean-PhilippeRoy I've mentioned gallery in the question. – Omar Mar 09 '12 at 20:19
  • Sorry about this, must've misread. :( – Jean-Philippe Roy Mar 09 '12 at 20:28
  • Your best solution is the gallery widget. Can you describe what is not working so that we help you? – weakwire Mar 09 '12 at 23:15
  • @weakwire The effect I want is that when I drag the image from the edge, the new page comes over the current page, while the current page stays and doesnt move. In the gallery, a swipe would skip multiple pages and it doesnt provide the animation I'm looking for. The animation in the gallery is that the current image goes while the new image comes. I want that the current image stays while the new image comes over it – Omar Mar 10 '12 at 10:18

1 Answers1

0

do you want an animation like this? http://www.youtube.com/watch?v=kBnrnt3bavE This is done with the gallery widget. First to make a book style swipe extend the gallery and override onFling

@Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
            float velocityY) {
            return super.onFling(e1, e2, 0, 0);
    }

This will swipe images one by one. Now for the one page over the other issue. You have to override

protected boolean getChildStaticTransformation(View child, Transformation t) 

and do the transformation yourself. . Check my answer here on how to make 3d cubes. is the same princible 3D cube transition in Android

Community
  • 1
  • 1
weakwire
  • 9,284
  • 8
  • 53
  • 78