To get started with SegmentSeekBarView in your Android XML project,
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Lastly, add the following dependency to your app's build.gradle.kts (Kotlin) or build.gradle (Groovy) file:
Kotlin
dependencies {
implementation("com.github.osawant023:SegmentSeekBarView:$currentVersion")
}Groovy
dependencies {
implementation 'com.github.osawant023:SegmentSeekBarView:$currentVersion'
} segmentProgressView.setSegments(
barHeight = 20,
value = 50f ,
max = 100f ,
badgeWidth = 15,
badgeHeight = 15,
newSegments = arrayListOf(
SegmentData(
"Segment 1",
ContextCompat.getColor(this, R.color.red1),
"25"
),
SegmentData(
"Segment 2",
ContextCompat.getColor(this, R.color.red2),
"50"
),
SegmentData(
"Segment 3",
ContextCompat.getColor(this, R.color.red3),
"75"
),
SegmentData(
"Segment 4",
ContextCompat.getColor(this, R.color.red4),
"100"
)
),
)
segmentProgressView.invalidate()