🚀 the most concise android seekview
implementation 'org.ithot.android.view:seek:0.1.0'
- XML
<org.ithot.android.view.SeekView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/seek_view"
android:layout_width="300dp"
android:layout_height="50dp"
app:indicatorColor="#ffffff"
app:indicatorRadius="10dp"
app:indicatorShadowColor="#cccccc"
app:indicatorShadowEnable="true"
app:indicatorShadowRadius="3dp"
app:onStep="onStep"
app:seekBackgroundColor="#8e8e93"
app:seekForegroundColor="#8bc34a"
app:seekHeight="10dp"
app:seekShadowColor="#ff0000"
app:seekShadowEnable="true"
app:seekShadowRadius="3dp" />
- Code
SeekView sv = (SeekView)findViewById(R.id.seek_view);
// set progress
sv.init(20);
// set progress range map based
sv.init(20, -20, 30);
// set common callback
sv.setSVCallback(new SVCallback() {
@Override
// progress 0 ~ 100
public void step(int progress) {
}
// start() touch start
// end() touch end
});
// set range mapped callback
sv.setSVCallback(new SVRangeMapCallback(-20, 30) {
@Override
// progress -20 ~ 30
public void step(int progress) {
}
// start() touch start
// end() touch end
});
name | type | sample | description |
---|---|---|---|
indicatorRadius | dimension reference |
10dp @dimen/ | the circle indicator radius |
indicatorColor | color reference |
#FFFFFF @color/ | this circle indicator color |
indicatorShadowEnable | boolean |
true false | enable circle indicator shadow |
indicatorShadowRadius | dimension reference |
2dp @dimen/ | circle indicator shadow radius |
indicatorShadowColor | color reference |
#000000 @color/ | circle indicator shadow color |
seekHeight | dimension reference |
7dp @dimen/ | seek view height |
seekBackgroundColor | color reference |
#CCCCCC @color/ | seek view background color |
seekForegroundColor | color reference |
#00FFFF @color/ | seek view foreground color |
seekShadowEnable | boolean |
true false | seek view shadow enabled |
seekShadowColor | color reference |
#000000 @color/ | seek view shadow color |
seekShadowRadius | dimension reference |
2dp @dimen/ | seek view shadow radius |
touchEnable | boolean |
true false | enable touch control |
onStep | string |
onStep | if not setSVCallback then you can config onStep to work see example |