Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticks don't show properly when overriding OnPrintTickLabel #177

Closed
Mas7erMind opened this issue Apr 29, 2020 · 4 comments
Closed

Ticks don't show properly when overriding OnPrintTickLabel #177

Mas7erMind opened this issue Apr 29, 2020 · 4 comments
Labels
Bug report Participants report a bug Bug bug!!

Comments

@Mas7erMind
Copy link

Mas7erMind commented Apr 29, 2020

I'm trying to change ticks label on the TubeSpeedometer to only show character "|" instead of numbers. To do so, I override the OnPrintTickLabel function (in Java):

meterCores = findViewById(R.id.meter_cores); meterCores.setMaxSpeed(nb_max_cores); meterCores.setOnPrintTickLabel((integer, aFloat) -> { return "|"; });

But when I run the code, this is what I get:
image

I think it's because I change the max speed at run time meterCores.setMaxSpeed(nb_max_cores);, and the OnPrintTickLabel function has already been called at this point.

@Mas7erMind Mas7erMind added the Bug report Participants report a bug label Apr 29, 2020
@anastr anastr added the Bug bug!! label Apr 30, 2020
@anastr
Copy link
Owner

anastr commented Apr 30, 2020

that's a bug! thanks for reporting.

@Mas7erMind
Copy link
Author

Ok. In the meantime is there a way to force the meter to redraw itself?

@anastr
Copy link
Owner

anastr commented May 3, 2020

Quick fix is to reset ticks after setMaxSpeed.

@anastr
Copy link
Owner

anastr commented Jul 27, 2020

fixed in v1.5.3.

@anastr anastr closed this as completed Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Participants report a bug Bug bug!!
Projects
None yet
Development

No branches or pull requests

2 participants