Has anyone ever done a basic “scanning animation” on an image?

I study that you have a basic red scan from the image displayed on the image, in time, back and forth, so that it looks like the image is being scanned. Has anyone ever done this, knew how easy it is, or they can point me in the right direction, how to do it?

Thanks!

+7
android image animation
source share
1 answer

Step # 1: Create a PNG file (or possibly ShapeDrawable ) that is your scan panel, with the appropriate transparency as you see fit.

Step # 2: add an ImageView to your RelativeLayout that contains the image from step # 1, it may have android:visible="gone" from the start. Make sure the ImageView is a later child of the RelativeLayout than your ImageView that you are scanning, so it will be displayed on top.

Step # 3: Use TranslateAnimation to animate ImageView from step # 2 (after being visible) with whatever template you want.

Step # 4: When the animation is complete (through the AnimationListener ), do an ImageView again to return you to the state you were in before the animation started.

+14
source share

All Articles