Skip to content

6. TubeSpeedometer

Anas Altair edited this page Jul 16, 2021 · 4 revisions

speedometer with 3D Effects.

simple usage

add to xml Layout:

<com.github.anastr.speedviewlib.TubeSpeedometer
        android:id="@+id/tubeSpeedometer"
        android:layout_width="300dp"
        android:layout_height="wrap_content" />

define speedometer in the code.

val tubeSpeedometer = ...

// change MAX speed to 320
tubeSpeedometer.maxSpeed = 320f
// change speed to 140 Km/h
tubeSpeedometer.speedTo(140f)

you can see all methods And Attributes at Get Started - Wiki.

special methods

// change Speedometer background Color.
tubeSpeedometer.speedometerBackColor = Color.GRAY

special Attributes

app:sv_speedometerBackColor="#000077"