-
-
Notifications
You must be signed in to change notification settings - Fork 326
Usage
you can change the default start degree 135
and End Degree 405
easily.
in XML use app:startDegree
and app:endDegree
attributes :
<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="300dp"
android:layout_height="wrap_content"
app:startDegree="180"
app:endDegree="360" />
in code use setStartDegree(int)
and setEndDegree(int)
methods :
speedView.setStartDegree(180);
speedView.setEndDegree(270);
now you can change the long of lowSpeed and mediumSpeed segments.
in XML use lowSpeedPercent
and mediumSpeedPercent
attributes :
<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="300dp"
android:layout_height="wrap_content"
app:lowSpeedPercent="50"
app:mediumSpeedPercent="75" />
in code use setLowSpeedPercent(int)
and setMediumSpeedPercent(int)
methods :
speedView.setLowSpeedPercent(25);
speedView.setMediumSpeedPercent(75);
if you want to add Right to Left language (like Arabic) just use app:speedometerTextRightToLeft="true"
attribute in XML, and setSpeedometerTextRightToLeft(true)
method in code.
look at the text in this 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.