Reputation: 7384
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
Upvotes: 1
Views: 198