I have an animation-list drawable with 100 frames, and its working fine. But now I want to jump to a specific frame and then start the animation from that frame. So is it possible in animation-list drawable
No. There's no built-in way to do this. You're gonna have to create a separate animation which starts from whichever frame you need.
Related
I have the following animation. Here it show 4 circles simultaneously.
I tried it using multiple views. Like two imageview one on other and applied zoom in and out and translationy animation.
But I want to know If it is possible with single view. If yes then how ?
Thanks in Advance
It is possible if you create an Animation Drawable with different frames inside it. Then you can set this drawable as an image resource and start/stop animation.
All you need is different frames of your animation. You can do that by using some tools available online.
One of which is https://ezgif.com/split
Refer this for animation drawable:
Display an animated PNG image to my layout in android using XML
All the best!
Basically, I have images that I'd like to to update them sequentially into the same view to create custom ProgressBar.
I found Tumblr to do just that with their ProgressBar(ImageView?).
Here I put the animation side-by-side to show how the image actually cross-fade from Aa into a camera.
Exactly what I wanted:
Cross-fading effect
Indeterminate
Use the same view (I dumped view hierarchy to check)
Animation during transition (The image actually pop a little when spinning and cross-fading into the next image)
So far I have tried:
1. Frame Animation,
this allows for unlimited item(s) with definable durtion. However, it
doesn't cross-fade the image and there's no way to listen to the
transition's event to apply other animation, etc.
2. Transition Drawable, this allows cross-fading between EXACTLY two drawables. So this doesn't allow for the number of items and interminate duration as well.
I also came across CrossFadeDrawable by Romain Guy just now but it looks like it's only coded to support only two Drawable.
Right now I am not very sure if I'm approaching in the right direction or is there something I need to learn in order to do this kid of effect?
I'm not sure if you are approaching this direction but isn't this what you are looking for:
http://www.youtube.com/watch?v=atH3o2uh_94
I am developing a 2d android strategy game, it runs on SurfaceView, so I can't(or can I?) use LibGdx's particle system. And I would like to make a raining effect, I am aiming for something like this( http://ridingwiththeriver.files.wordpress.com/2010/09/rain-fall-animation.gif ), I don't need the splash effect in the end (although that would be superb, but probably would take up a lot of system resources). How could I achieve that raining effect? Any ideas?
There's one similar code from JakeWharton called DroidFlake. It seem like snowfall effect but worthy to check DroidFlake
The easiest would be to put the rain drops in a PNG with alpha and display that at the end. You would only need a few frames to make it smooth, but it would eat up a bit of resources if this were a full screen image.
If you cannot afford this, you could put each distinct raindrop in a smaller PNG file with alpha, then display this (these) single PNG(s) multiple times. This would reduce the memory used a lot, although your rendering code will get a bit more complex, and depending on how many drops you have, it might affect performance.
A trade-off between the two would be to have a PNG file that contains more drops, but not for the full screen, and display that a few times.
You could have another frame (or frames) where the raindrop splashed, which you could display before ending the animation of each drop, or you could have the final frame in the large PNG contain the splashes.
There are many ways of doing this. You could create a sprite sheet like:
In that spritesheet, you could simply have a drop of water advance in each frame until it reaches the bottom and you create the splash effect. You then need to be able to animate it (very easy). You can then create multiple instances of the image, or draw the one image multiple times to create the rain storm.
I need to use animations in the app. Is it better to use frame-to-frame ImageView animations or to use video animations? Video animations are SWF (which I can probably convert to mp4).
The animations last up to 4s what would be around 80 images in one frame-to-frame animation. This is the layout of the app.
A different animation will appear in the red area based on which button on the right side is pressed.
Now, which approach is best to use?
I know that frame-to-frame approach may create an app with a lot of MBs.
I also do not know if video approach could make smooth animations? Can I play SWF files inside the such layout or I would have to convert each into mp4 in order to use this app on pre-Android-2.2 mobile phones.
Please advise!
For an ImageView, I assume you will be doing the animation by repeatedly calling the invalidate method. This will not give you a high frame rate. To do real-time animation, you need a SurfaceView or subclass thereof, perhaps a VideoView.
i am using frame animation to display set of images one after the other and it works fine , except that the transition between the images is not good .I need smooth transition like ,the first image fades out and the next image fades in.How to achieve such transition in the frame animation.Thanks in advance.
As a workaround you may increase a number of frames in your animation by adding faded images to simulate smooth transition.