Fabrizio Russo Radar Custom View


2014/07/20   Radar Custom View

Released on GitHub an android custom view to show a radar component (with animation)

The view component exposed two simple methofs to start and stop the animation.
The animation effect simulates the drag effect visible on the typical green phosphor of the radar.

Here a semaple activity to show how start and stop the animation


public class TestActivity extends Activity {

	// radarView in your activity
    RadarView mRadarView = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		// Find a reference to view
        mRadarView = (RadarView) findViewById(R.id.radarView);
        mRadarView.setShowCircles(true);
	}

	// start the animation 
    public void stopAnimation(View view) {
        if (mRadarView != null) mRadarView.stopAnimation();
    }

	// stop the aanimation
    public void startAniamtion(View view) {
        if (mRadarView != null) mRadarView.startAnimation();
    }
    
}