You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
indicator is Observable by its Speedometer, so.. one indicator must be added to one speedometer.
and so, to change width or color you can call immediately speedometer.indicator.width = 20f or speedometer.indicator.color = Color.BLUE without tack care of invalidate the SpeedView, because it's observing any change to indicator and do auto invalidate.
also you can change width and color in XML:
sv_indicatorColor=""
sv_indicatorWidth=""
ImageIndicator
you can add custom indicator, just add indicator's image to your drawable folder, and use ImageIndicator Object.
must set the center of indicator in the center of image, and the indicator towards the top,just like this one:
to create object you cans use: ImageIndicator(context: Context, resource: Int) eysly, but we Recommend to use ImageIndicator(context: Context, resource: Int, width: Int, height: Int) to add custom width and height for indicator.
val imageIndicator =ImageIndicator(getApplicationContext(), R.drawable.image_indicator1)
speedometer.indicator = imageIndicator