1

I would like to implement a cardflip animation. It basicaly should rotate the card by 180 degrees and show different content (but with same structure, It's intended like a filter) I tried to animate the view by 90 degrees then change the layout and the rotation to 270 degrees and then rotate again by 90 degrees, but obviously the resulting animation is anything but fluent:) the layout operation in the middle of it is way too expensive..

I tried to use those new ViewOverlays for that, but I cant get that working. My idea was to capture current layout to Bitmap, then mirror the image, alter the actual content of the layout and then in preDrawListener apply the overlay and rotate the view by 180 degrees..then run the animation and when in half just hide the overlay (I guess that should be fast). But Everytime I call getDrawingCache on my View, the returned bitmap is -1 x -1 pixels..And that regardless on whether I call setDrawingCacheEnabled(true) or not.. Do you know where could be the problem with getting the view snapshot in the bitmap? Or just do you know about some good tutorial regarding this problematics? (Please dont answer with link at the android card flip animation demo, because it is related to fragment transaction - I want to animate just parts of my views.:)

I can post some code I have, but I think it's no needed..But when you think it could help you getting better into my problem, just left there a comment, and I will post it for you:) Thanks

simekadam
  • 7,334
  • 11
  • 56
  • 79
  • have you seen this http://developer.android.com/training/animation/cardflip.html? – Emmanuel Sep 22 '13 at 15:36
  • ... (Please dont answer with link at the android card flip animation demo, because it is related to fragment transaction - I want to animate just parts of my views.:) :) – simekadam Sep 22 '13 at 22:52
  • In that tutorial they teach you how to define the proper object animator set on .xml. You can use that animator set and apply it to your `View`. You can animate almost anything using the `ObjectAnimator` class. http://developer.android.com/guide/topics/graphics/prop-animation.html#object-animator – Emmanuel Sep 23 '13 at 04:33
  • I might not described my problem correctly. My problem is not HOW TO ANIMATE, actually rotating a View is very simple. My problem is that I need to do both anomation and relayout at the same time | do relayout first, but hide it behind captured image of the previous UI state and the rotate.. – simekadam Sep 23 '13 at 15:27

0 Answers0