-
-
Notifications
You must be signed in to change notification settings - Fork 324
7. ImageSpeedometer
Anas Altair edited this page Dec 25, 2016
·
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:imageSpeedometer="@drawable/your_image" />
to remove speed text and unit text just add:
app:speedTextColor="@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:imageSpeedometer="@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.