question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background Image Size overrides all size settings

See original GitHub issue

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.

  1. When I set background image, image size overrides all size settings and thereafter, the only way to resize the gauge is to resize the image in an external software. Is that how it is meant to be or I’m doing sth wrong? gauge.setBackgroundResource(R.drawable.dial);
<com.github.anastr.speedviewlib.ImageSpeedometer
        android:id="@+id/speedView"
        android:layout_width="50dp"
        android:layout_height="50dp"
        app:sv_centerCircleColor="@android:color/transparent"/>

2021-09-03_233300

  1. 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.

  2. 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anastrcommented, Sep 17, 2021

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.

1reaction
anastrcommented, Sep 9, 2021

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.
  • By changing the typeface it means to change the font. Take a look at sv_speedTextTypeface attribute in this demo file to see what does it mean, the font file exists in the assets folder.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resizing background images with background-size - CSS
The background-size CSS property lets you resize the background image of an element, overriding the default behavior of tiling the image at ...
Read more >
html - background overwrites background-size - Stack Overflow
As I understand it this is because the background shorthand implicitly sets ALL the properties it represents, not just the ones you specify,...
Read more >
Perfect Full Page Background Image - CSS-Tricks
We set a fixed and centered background on it, then adjust it's size using background-size set to the cover keyword. Works in: Safari...
Read more >
A Deep Dive Into object-fit And background-size In CSS
The object-fit property defines how the content of a replaced element such as img or video should be resized to fit its container....
Read more >
how do i control the size of the background image?
There's a CSS3 property ('background-size') for sizing background images. SharePoint adds the background image class '.ms-backgroundImage' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found