-
-
Notifications
You must be signed in to change notification settings - Fork 325
7. ImageSpeedometer
Anas Altair edited this page Mar 11, 2017
·
6 revisions
speedometer to add custom image, you can design speedometer image in Photoshop or illustrator.... and add it to drawable folder, this speedometer has No indicator, look at indicators to add one.
add to xml
Layout, add app:imageSpeedometer
attribute (Required):
<com.github.anastr.speedviewlib.ImageSpeedometer
android:id="@+id/imageSpeedometer"
android:layout_width="300dp"
android:layout_height="wrap_content"
app:sv_image="@drawable/your_image" />
Recommended square image.
to remove speed text and unit text just add:
app:sv_speedTextColor="@android:color/transparent"
app:sv_unitTextColor="@android:color/transparent"
define speedometer in the code.
ImageSpeedometer imageSpeedometer = (ImageSpeedometer) findViewById(R.id.imageSpeedometer);
// change speed to 140 Km/h
imageSpeedometer.speedTo(140);
you can see all methods And Attributes at Get Started - Wiki.
// change image.
imageSpeedometer.setImageSpeedometer(R.drawable.your_image);
app:sv_image="@drawable/your_image"
if you have any idea, image, template please open new issue and give me the image , and i well try to add it to the Library, it must be possible to drawn, if you like this library you can support it.