Skip to content

8. ProgressiveGauge

Anas Altair edited this page Mar 9, 2017 · 1 revision

Linear Gauge.

simple usage

add to xml Layout:

<com.github.anastr.speedviewlib.ProgressiveGauge
        android:id="@+id/progressiveGauge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

define speedometer in the code.

ProgressiveGauge progressiveGauge= (ProgressiveGauge) findViewById(R.id.progressiveGauge);

// change speed to 50 Km/h
progressiveGauge.speedTo(50);

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

special methods

// change Orientation
progressiveGauge.setOrientation(LinearGauge.Orientation.VERTICAL);
// change the color of progress
progressiveGauge.setSpeedometerColor(Color.GREEN);
// change the color of background progress
progressiveGauge.setSpeedometerBackColor(Color.GRAY);

special Attributes

app:sv_orientation="VERTICAL" <!-- def : HORIZONTAL -->
app:sv_speedometerColor="#dc4ae1" <!-- def : CYAN -->
app:sv_speedometerBackColor="#b3b3b3" <!-- def : #d6d7d7 -->