Sorbh / kdgaugeView

KdGaugeView is a simple and customizable Gauge / Speedometer control for Android.
62 stars 35 forks source link

Added Multi-Colored Progress Bar #4

Closed rafayk7 closed 5 years ago

rafayk7 commented 5 years ago

Allows customization for the progress bar to be multi-colored, and to specify the start/end for each color.

To use, simply instantiate the gauge and allocate the colors and changeValues attributes and the gauge will follow the new progress bar drawing rules.

gauge = findViewById<KdGaugeView>(R.id.gaugeView)
var colors = intArrayOf(Color.RED, Color.YELLOW, Color.GREEN, Color.BLUE, Color.BLACK)
var changeValues = floatArrayOf(0.1f, 0.3f, 0.5f, 0.7f, 1f)

gauge.colors = colors
gauge.changeValues = changeValues

Preview: view1 view21