Skip to content

5. PointerSpeedometer

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

speedometer with pointer lite and Sweep color .

simple usage

add to xml Layout:

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

define speedometer in the code.

PointerSpeedometer pointerSpeedometer= (PointerSpeedometer) findViewById(R.id.pointerSpeedometer);

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

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

special methods

// in this speedometer, you can change UnitText Size
pointerSpeedometer.setUnitTextSize(15); //def : 5dp
// change the point color
pointerSpeedometer.setPointerColor(Color.RED);
// change Sweep speedometer color
pointerSpeedometer.setSpeedometerColor(Color.GREEN);

special Attributes

app:sv_speedometerColor="#ffb26b" <!-- def : #eeeeee -->
app:sv_pointerColor="#ffff00" <!-- def : WHITE -->
app:sv_unitTextSize="15dp" <!-- def : 11dp -->