Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
rewrite the library in kotlin
this version may be unstable.. if you had any issue with kotlin Go back to version 1.3.1
// add 4 decimal places for speedText.
speedometer.setSpeedTextFormat(4);
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;
}
});
min and max speed in float #64 .
new indicator light effect #78 (beta).
new effect behind the indicator, it still unstable if you like to use this effect just use sv_withIndicatorLight="true"
and you can customize its color sv_indicatorLightColor="#BB0000FF"
new notes positions.
if you were using CenterIndicator
for Note position, change to QuarterSpeedometer
if you were using TopIndicator
, change to TopSpeedometer
.
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.
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.getCorrectSpeed(), getCorrectIntSpeed()
and replace with getCurrentSpeed(), getCurrentIntSpeed()
, No correction anymore.setMinMaxSpeed(minSpeed, maxSpeed)
method.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.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.setSpeedTextColor()
method.