Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
Fix problem with navigation and ViewPager.
1.5.20
.sv_marksNumber
: set custom number of marks.sv_marksPadding
: padding from speedometer edge.sv_markHeight
and sv_markWidth
: size of marks.sv_markStyle
: ROUND or BUTT.markColor
: color of marks.Style
class now moved out of Section
class.Style.SQUARE
is Deprecated, use Style.BUTT
.sv_rayMarkWidth
now points to the ray marks instead of sv_markWidth
.speedometer.ticks = arrayListOf(0f, .25f, .5f, .75f, 1f)
, old way ~speedometer.ticks = arrayListOf(0f, 25f, 50f, 75f, 100f)
~Section(0f, .6f, 0xFF00FF00.toInt())
section.width = ..
section.padding = ..
sv_sectionStyle
:
Section.Style.SQUARE
Section.Style.ROUND
doOnSections
extension.OnPrintTickLabel
interface to OnPrintTickLabelListener
'typealias'.SpeedTextFormat
with SpeedTextListener
'typealias' #173.minSpeed
& maxSpeed
directly.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)
)
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"))
}
}
speedView.indicator.width = ...
speedView.indicator.color = ...
sv_centerCircleRadius
.