Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape
APACHE-2.0 License
Bot releases are visible (Hide)
Published by anastr almost 3 years ago
New feature to change the indicator position and the rotation point #45.
speedometer.setFulcrum(xOffset = .5f, yOffset = .7f)
Published by anastr almost 3 years ago
Published by anastr about 3 years ago
Fix problem with navigation and ViewPager.
Published by anastr about 3 years ago
1.5.20
.Published by anastr over 3 years ago
Published by anastr over 3 years ago
Published by anastr about 4 years ago
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)
Published by anastr over 4 years ago
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.Published by anastr almost 5 years ago
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
.Published by anastr about 5 years ago
Published by anastr over 5 years ago
rewrite the library in kotlin
this version may be unstable.. if you had any issue with kotlin Go back to version 1.3.1
Published by anastr about 6 years ago
// add 4 decimal places for speedText.
speedometer.setSpeedTextFormat(4);
Published by anastr over 6 years ago
if you have been using old version of this library please read this to end.
this update coming with:
SpannableString
like this:speedometer.setOnPrintTickLabel(new OnPrintTickLabel() {
@Override
public CharSequence getTickLabel(int tickPosition, float tick) {
if (tick == 0) {
SpannableString s = new SpannableString(String.format(Locale.getDefault(), "%d", (int)tick));
s.setSpan(new ForegroundColorSpan(0xffff1117), 0, 1, 0); // change first char color to Red.
return s;
}
// null means draw default tick.
return null;
}
});
sv_withIndicatorLight="true"
and you can customize its color sv_indicatorLightColor="#BB0000FF"
CenterIndicator
for Note position, change to QuarterSpeedometer
TopIndicator
, change to TopSpeedometer
.Published by anastr almost 7 years ago
53284d9 issue #56 ,Now you can use wrap_content
for both layout_width & layout_height for speedometer family:
<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
ea2e6cb issue #50, speed text and unit text will no longer be incomplete for all fonts.
78965d7 issue #61, No more random rotation after using sv_minSpeed
and sv_maxSpeed
attributes.
Published by anastr about 7 years ago
OnPrintTickLabel
interface #35 .setTicks(0, 10, 60, ...)
method #39.getCorrectSpeed
,getCorrectIntSpeed
) use (getCurrentSpeed
,getCurrentIntSpeed
).sv_withPointer
attribute 5cc9e41.sv_indicatorColor
and sv_indicatorWidth
attributes ed09701.Published by anastr over 7 years ago
getCorrectSpeed(), getCorrectIntSpeed()
and replace with getCurrentSpeed(), getCurrentIntSpeed()
, No correction anymore.setMinMaxSpeed(minSpeed, maxSpeed)
method.Published by anastr over 7 years ago
by now, Gauge
class is the base class for all Speedometers and Gauges,
and Speedometer
class is extended Gauge
to build custom Circle Speedometers.
sv_
" to all attributes to fix conflicts issue, #20 fixed.Gauge
class, the base class for all speedometers and gauges.sv_speedTextPadding
attribute.sv_cutPadding
attribute to fix indicator cutting #12 when change speedometerMod.getCorrectIntSpeed()
.decelerate
value to 0.1f.Published by anastr almost 8 years ago
unitUnderSpeedText
(boolean) change relationship between unitText and speedText, (Under each, side by side).unitSpeedInterval
space between unitText and speedText.speedTextTypeface
,textTypeface
.speedPercentTo(percent, moveDuration)
method.setIndicator(Indicator indicator)
method.setIndicatorAt(int speed)
method (move the indicator without Animation).indicatorColor
is material blue.startDegree and endDegree
issues).speedPercentTo(int)
, setStartDegree(int)
, setEndDegree(int)
.setSpeedometerWidth
, setPadding
).startDegree and endDegree
together using new setStartEndDegree (int startDegree, int endDegree)
method.Published by anastr almost 8 years ago
setSpeedTextColor()
method.