Closed AKTanara closed 3 years ago
Hi @AKTanara .
In your example, you're using background resource instead of setImageSpeedometer
or app:sv_image
attribute.
I think the problem in your indicator image, it has a transparent gap on its both sides. May you try one of the provided indicators (Like app:sv_indicator="NeedleIndicator"
) to make sure that it's on the correct position? If that so, you need to draw the ticks on the image using an external software to fix your issue.
They are on the same vertical line, it's the braces that causes the issue. Maybe if you change textTypeface
could fix the issue.
Hi @anastr Thanks for your quick and comprehensive reply and sorry for my late replay.
setImageSpeedometer
solved my issue for good. I don't know how much time and effort are you putting on this project but I think it might be a good idea to add setImageSpeedometer
method also to types other than ImageSpeedometer.textTypeface
you mean to put the text first in a typeface and then passing it to setUnit
instead of a simple string? I would appreciate if you could provide me with a line of example code.
Attaching the image just to show how satisfied and pleased I am with the result:
Hello @AKTanara I'm happy to see people contented with my library. I'll point out some of my answers.
ImageSpeedometers
is added to avoid drawing too many shapes directly on the canvas
- which costs GPU and memory -. Adding images to other speedometers does make no sense, drawing stuff on top of an image is an unpredictable process and it may consume the main thread.sv_speedTextTypeface
attribute in this demo file to see what does it mean, the font file exists in the assets folder.Hi Sorry for my late reply. I tried the typeface and different fonts but the parenthesis is always miss aligned. I think I should find some other solution for that. But please let me know if you decided to resolve this minor issue... And again thanks for the whole library and previous replies. Regards
It's not posable to fix this programmatically, it's about the font and parentheses style. For example if we write here '(A)' you'll notice the same vertical alignment.
I think in no near future there will be any competitors for this library... Saw huge projects that are using this amazing job as their backbone.
I have three issues and would be thankful if you could take a look into.
gauge.setBackgroundResource(R.drawable.dial);
As you can see in the image, when I set tick texts and use padding to bring the text more to center and turn rotation off, text is ununiformly spaced from center and needs some padding to shift tick texts up. It is probably because of turned off rotation. By the way it causes a minor aesthetic issue.
Again, as you can see in the image, When choosing different sizes for
setSpeedTextSize
&setUnitTextSize
there is some alignment issue. Is there any workarounds?Thanks again for the great job and the effort you put to maintain it.