Android测速仪视图:velocimeter-view
jopen
9年前
一个Android测速仪视图:velocimeter-view。
使用说明:
Sample video:
app示例:
https://play.google.com/store/apps/details?id=com.github.glomadrian.velocimeter
默认颜色
<com.github.glomadrian.velocimeterlibrary.VelocimeterView android:layout_gravity="center" android:id="@+id/velocimeter" android:layout_width="250dp" android:layout_height="250dp" />
自定义属性及颜色:
<com.github.glomadrian.velocimeterlibrary.VelocimeterView android:layout_gravity="center" android:id="@+id/velocimeter" android:layout_width="250dp" android:layout_height="250dp" app:inside_progress_color="@color/inside_progress" app:external_progress_color="@color/external_progress" app:progress_blur_color="@color/external_progress" app:bottom_velocimeter_color="@color/bottom_velocimeter" app:internal_velocimeter_color="@color/internal_velocimeter" app:needle_color="@color/needle" app:needle_blur_color="@color/needle" app:digital_number_color="@color/digital_number" app:digital_number_blur_color="@color/digital_number" app:show_bottom_bar="false" app:max="100" app:units="kmh" />
要使用自定义属性,记得添加这个:
xmlns:app="http://schemas.android.com/apk/res-auto"
Gradle
添加 repository
repositories { maven { url "http://dl.bintray.com/glomadrian/maven" } }
添加依赖:
compile 'com.github.glomadrian:velocimeterlibrary:1.1@aar'