Skip to content

9. ImageLinearGauge

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

Linear Gauge with custom image.

simple usage

add to xml Layout:

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

define speedometer in the code.

ImageLinearGauge imageLinearGauge= (ImageLinearGauge) findViewById(R.id.imageLinearGauge);

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

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

special methods

// ...

special Attributes

app:sv_orientation="VERTICAL" <!-- def : HORIZONTAL -->
app:sv_image="@drawable/your_image"
app:sv_speedometerBackColor="#9e9e9e" <!-- def : #d6d7d7 -->

when yo change orientation, image will not flip.