I am looking into having a basic red-bar scan across an image displayed on an image view a vew times, back and forth, as to make it seem like a picture is being scanned. Has anyone ever done this, know how easy it is or could they point me in the right direction on how to do this?
Thanks!
Step #1: Create a PNG file (or possibly a ShapeDrawable
) that is your scan bar, with appropriate transparency as you see fit.
Step #2: Add an ImageView
to your RelativeLayout
that holds the image from step #1, possibly set to have android:visible="gone"
at the outset. Make sure the ImageView
is a later child of the RelativeLayout
than is your ImageView
that you are "scanning", so it will appear to float on top.
Step #3: Use a TranslateAnimation
to animate the ImageView
from step #2 (after making it visible) by whatever pattern you want.
Step #4: When the animation is complete (via the AnimationListener
), make the ImageView
be gone again to return you to the state you were before the animation began.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With