Your pixel handling seems wrong
Posted: Sun Mar 17, 2013 11:22 pm
I've noticed that if I set a font size of 18, it looks ok on my Nexus 4, but on my Galaxy Mini (with horrible resolution) the font is LARGE. I believe your APIs expect "pixel count", which doesn't reflect what you see on a real device. Instead, DPs (device independent pixels) should be used.
Is it up to the API consumer (me) to make the conversion? E.g. when setting the font size of 18 pixels, I would instead calculate the physical pixel size and convert from "12 dip". On my Nexus 4 this would become 18 pixels. On my Galaxy Mini it would probably be some 12 pixels.
I see this in your code:
That explains why my chart looks like an anabola freak on my Galaxy Mini
Is it up to the API consumer (me) to make the conversion? E.g. when setting the font size of 18 pixels, I would instead calculate the physical pixel size and convert from "12 dip". On my Nexus 4 this would become 18 pixels. On my Galaxy Mini it would probably be some 12 pixels.
I see this in your code:
Code: Select all
transient public static final int DEFAULTSIZE = 10;