skydoves / ProgressView

🌊 A polished and flexible ProgressView, fully customizable with animations.
Apache License 2.0
789 stars 57 forks source link

Label size specified programmatically are not in sp #2

Closed ispbox closed 5 years ago

ispbox commented 5 years ago

If I specify label size from code, it looks like it is measured in pixels. Here is the code from library:

this.labelView.setTextSize(TypedValue.COMPLEX_UNIT_PX, labelSize)

I can propose to change it to

this.labelView.setTextSize(labelSize)

because this way you will specify size in sp, not in pixels. This is how all controls in android work. Your default value of 12f is very small because of px units instead of sp.

ispbox commented 5 years ago

Because of this I have to specify label size in such a strange manner: labelSize = 14f * getResources().getDisplayMetrics().scaledDensity

skydoves commented 5 years ago

@ispbox Hi, thank you for your issue! It will be included on next version soon. Thank you :)

ispbox commented 5 years ago

Thanks a lot :)

skydoves commented 5 years ago

@ispbox Released version 1.0.2. Thank you for your issue.

ispbox commented 5 years ago

@skydoves Thanks a lot, works good :)