-
-
Notifications
You must be signed in to change notification settings - Fork 324
4. RaySpeedometer
Anas Altair edited this page Jul 27, 2020
·
5 revisions
speedometer with Blur Effects and without indicator.
add to xml
Layout:
<com.github.anastr.speedviewlib.RaySpeedometer
android:id="@+id/raySpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
define speedometer in the code.
RaySpeedometer raySpeedometer= (RaySpeedometer) findViewById(R.id.raySpeedometer);
// change speed to 50 Km/h
raySpeedometer.speedTo(50);
you can see all methods And Attributes at Get Started - Wiki.
// change the degree between the marks
raySpeedometer.setDegreeBetweenMark(3); //def : 5
// change marks width
raySpeedometer.setRayMarkWidth(2); //def : 3dp
// change Ray (the lines) color
raySpeedometer.setRayColor(Color.RED);
// set or remove Blur Effects.
raySpeedometer.setWithEffects(false);
// change Background Color of speed text.
raySpeedometer.setSpeedBackgroundColor(Color.RED);
app:sv_withEffects="false" <!-- def : true -->
app:sv_speedBackgroundColor="#000077"
app:sv_rayColor="#d8ff0000" <!-- def : WHITE -->
app:sv_degreeBetweenMark="7" <!-- def : 5 -->
app:sv_rayMarkWidth="5dp" <!-- def : 3dp -->
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.