Skip to content

3. AwesomeSpeedometer

Anas Altair edited this page Mar 11, 2017 · 4 revisions

amazing speedometer.

simple usage

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.

special methods

// 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);

special Attributes

app:sv_speedometerWidth="70dp" <!-- def : 60dp -->
app:sv_indicatorWidth="#30dp" <!-- def : 25dp -->
app:sv_speedometerColor="#ef3737"
app:sv_trianglesColor="#25b9b4"