ScaleView 选择器:包括弧形刻度尺选择器和直线型刻度尺选择器
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.yhongm:ScaleView:master'
}
<com.yhongm.scale_core.ScaleView
android:id="@+id/arc_scaleview"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerInParent="true"
app:arcLineColor="#ff0000"
app:drawLineSpace="1"
app:drawTextSpace="5"
app:everyScaleValue="1"
app:indicatorColor="#1cffaf"
app:scaleLineColor="#0000ff"
app:scaleMin="200"
app:scaleNum="30"
app:shape="arc"
app:scaleSpace="1"
app:scaleTextColor="#0000ff"
app:scaleUnit="单位"
app:selectTextColor="#1fffff" />
app:shape="arc" arc为弧形,line为直尺形
app:arcLineColor="#ff0000" 弧线颜色
app:drawLineSpace="1" 刻度线间距
app:drawTextSpace="5" 刻度值间隔
app:everyScaleValue="1" 滑动像素与刻度值的比例
app:indicatorColor="#1cffaf" 中间指示器颜色
app:scaleLineColor="#0000ff" 刻度线颜色
app:scaleMin="200" 选择器最小值
app:scaleTextColor="#0000ff" 刻度值颜色
app:selectTextColor="#111111" 选中值颜色
2,实现setSelectScaleListener监听刻度值变化