anastr / SpeedView

Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
Apache License 2.0
1.28k stars 321 forks source link

I wasn't be able to add my own picture as indicator. #229

Closed softwaretk closed 2 years ago

softwaretk commented 2 years ago

Hi I want to use my own Indicator ->png picture

This is my Code: (My Main Activity is in Java)

val imageIndicator = ImageIndicator(getApplicationContext(), R.drawable.path846_1); imageSpeedometer.indicator = imageIndicator;

val in line 1 is red cannot resolve symbol 'val'

.indicator in line 2 is red 'indicator' has private access in 'com.github.anastr.speedviewlib.Speedometer'

Or is this Code only for kotlin?

anastr commented 2 years ago

Looks like you are using Kotlin code in Java file. Just use the setter and getter methods for java like setIndicator()

vaidik1011 commented 2 years ago

ImageIndicator imageIndicator = new ImageIndicator(getApplicationContext(), getResources().getDrawable(R.drawable.image_indicator1)); binding.imageSpeedometer.setIndicator(imageIndicator);