Simple Gauge Library 0.3.0
What New
Gauge Type | Whats New |
---|---|
Half Gauge | Add option to set min/max value color |
All Gauge's | Add option to set value color |
All Gauge's | Add option to set custom value formatter |
HalfGauge
set custom color for value and min and max
halfGauge.setValueColor(Color.BLUE)
halfGauge.setMaxValueTextColor(Color.RED)
halfGauge.setMaxValueTextColor(Color.GREEN)
gauge.setValueColor(Color.BLACK)
All Gauge's
Set custom value formatter
Kotlin
arcGauge.setFormatter(ValueFormatter {
it.toInt().toString()
})
Java
arcGauge.setFormatter(new ValueFormatter() {
@Override
public String getFormattedValue(double value) {
int intValue = Double.valueOf(value).intValue();
return String.valueOf(intValue);
}
});
or implement ValueFormatter interface
public class MyValueFormatter implements ValueFormatter {
@Override
public String getFormattedValue(double value) {
int intValue = Double.valueOf(value).intValue();
return String.valueOf(intValue);
}
}