1

I am trying to animate something like radar scanning on map. I have design it as well. Please check image I am adding. I have tried it using circular progress bar. But didn't succeed. Please guide me with proper approach.

Community
  • 1
  • 1
user2980181
  • 307
  • 1
  • 3
  • 13
  • 1
    One approach could be to rotate the bitmap, see: http://stackoverflow.com/questions/1930963/rotating-a-view-in-android and http://stackoverflow.com/questions/18983631/rotating-an-image-bitmap-with-animation-android – AndrewBloom Oct 19 '15 at 18:27
  • I don't have any image or bitmap. Actually I am drawing circle on map with radius and wants a animation where needle moves like in watches which reflect as scanning that radius. – user2980181 Oct 19 '15 at 18:34
  • are the icons bitmaps? you could draw the circle on a bitmap and rotate that. – AndrewBloom Oct 20 '15 at 13:35
  • This looks like what you are looking for: [GoogleMapsAnimations](https://github.com/aarsy/GoogleMapsAnimations) – RonTLV Dec 04 '17 at 10:06

3 Answers3

2

There is a library available for radar scan view here https://github.com/gpfduoduo/RadarScanView

user2980181
  • 307
  • 1
  • 3
  • 13
1

This is an example of a Sweep Gradient. Well, perhaps it also has a radial gradient overlay as well, but that is besides the point.

Perhaps this will help you: https://stackoverflow.com/a/9054550/2066079

Then, it's just a matter of animating it. Take a look at this example: How to animate gradient?

Community
  • 1
  • 1
dberm22
  • 3,147
  • 1
  • 30
  • 46
0

its very easy Step 1. add Image in xml layout. Step 2. go to java or activity file then rotate the image.

Activity Code:-

ImageView scanner = (ImageView) findViewById(R.id.scann);
        RotateAnimation rotate = new RotateAnimation(0, 360, 
        Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        rotate.setDuration(1500);
        rotate.setRepeatCount(3);
        rotate.setInterpolator(new LinearInterpolator());
        scanner.startAnimation(rotate);
DCorrigan
  • 598
  • 1
  • 8
  • 17
Lucky Agarwal
  • 41
  • 1
  • 1