speedView.addSections(Section(.25f, Color.LTGRAY) // section from 0% to 25%
, Section(.50f, Color.YELLOW) // section from 25% to 50%
, Section(.75f, Color.BLUE)// section from 50% to 75%
, Section(1f, Color.RED)// section from 75% to 100%
// or simply if you need to add 5 sections equal to each others:
speedView.makeSections(5)
)
- new support of (no section)
OnSectionChangeListener
now used Section class:
speedView.onSectionChangeListener = object :OnSectionChangeListener {
override fun onSectionChangeListener(previousSection: Section?, newSection: Section?) {
if (newSection == null)
// there is no section here!
return
if (newSection.speedOffset == 1f)
// last section
speedView.addNote(TextNote(context, "slow down"))
}
}
- remove 3D Effects from TubeSpeedometer (
isWithEffects3D) .
- change indicator width and color:
speedView.indicator.width = ...
speedView.indicator.color = ...
- Sections and indicator are now Observable by its speedometer.
- add
sv_centerCircleRadius
.
- custom default ticks.
- all speedometers are open.