-
-
Notifications
You must be signed in to change notification settings - Fork 324
3. AwesomeSpeedometer
Anas Altair edited this page Mar 11, 2017
·
4 revisions
amazing speedometer.
add to xml
Layout:
<com.github.anastr.speedviewlib.AwesomeSpeedometer
android:id="@+id/awesomeSpeedometer"
android:layout_width="300dp"
android:layout_height="wrap_content" />
define speedometer in the code.
AwesomeSpeedometer awesomeSpeedometer= (AwesomeSpeedometer) findViewById(R.id.awesomeSpeedometer);
// change speed to 50 Km/h
awesomeSpeedometer.speedTo(50);
you can see all methods And Attributes at Get Started - Wiki.
// change ring color, have fun with this method
awesomeSpeedometer.setSpeedometerColor(Color.RED);
// change Triangles Color (around the speedometer)
awesomeSpeedometer.setTrianglesColor(Color.GREEN);
// change center indicator width (center triangle)
awesomeSpeedometer.setIndicatorWidth(15);
app:sv_speedometerWidth="70dp" <!-- def : 60dp -->
app:sv_indicatorWidth="#30dp" <!-- def : 25dp -->
app:sv_speedometerColor="#ef3737"
app:sv_trianglesColor="#25b9b4"
if you have any idea, image, template please open new issue and give me the image , and i well try to add it to the Library, it must be possible to drawn, if you like this library you can support it.