Hello All,
Looking to create a view like radar in android.
- Step 1:- Find the java file along this blog and add it to your project.
- Step 2: In your xml use this class to create view.
<com.example.RadarView
android:id="@+id/radarView"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_gravity="center_horizontal"
/>
- Step 3: Now in your oncreate of activity intialize the view and set the variables as per requirements.
RadarView mRadarView = null;
mRadarView = (RadarView) findViewById(R.id.radarView);
mRadarView.setShowCircles(true);
if (mRadarView != null) mRadarView.stopAnimation();
- Step 4: there are several methods in the Radarview class where you can set different attributes to your view. EG.
mRadarView.setShowCircles(true);
mRadarView.setFrameRate(100);
- Step 5: This is it you are ready to use it now, The main methods that you need to know are startanimation();
- stopanimation();
Fore more info click on this link for the demo.
Happy Coding.
0 Comment(s)