Making animation frame from images in Android (Part 1)

Hi readers,
In these tutorial, I present 2 ways to make an animation frame (sequence of frames) from similar images. It's look like GIF image on web.
At this part, our solution is creating a subclass of ImageView and loading one by one image to the view (each image displayed in a period of time (at onDraw() method)).

Before coding:
- Prepare a series of PNG images with the individual frames of your animation.
- Add them  to your project’s drawable folder, as you might do with any still bitmap image you’d use in your UI.

Now, start making view component, AnimationImageView source code like this: Declaring an activity (AnimationActivity) to Test it! :)
Layout (activity_animation.xml): Okey, finally, running program, we can see result like:
pic name pic name pic name
In part 2, I will present another way to make this!

UPDATE: Part 2 AVAILABLE!

Share


Previous post
« Prev Post
Next post
Next Post »