Closed GoogleCodeExporter closed 9 years ago
See if this helps
getResources().getDisplayMetrics().density;
This will give you:
0.75 - ldpi
1.0 - mdpi
1.5 - hdpi
2.0 - xhdpi
3.0 - xxdpi
Original comment by halabel...@google.com
on 2 Dec 2012 at 10:18
Or, we can try this as well.
Instead of using setTextSize(20), we use this:
setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
This should have android automatically scale the text size depending on density.
Original comment by IMPINC...@gmail.com
on 2 Dec 2012 at 10:34
The UNIT_SP method didn't work, and I can't manage to make this work with
DISPLAY_METRICS. I did it by checking the build level. This is certainly not
the
right thing in the long run, but it seems to work for now.
Original comment by halatmit...@gmail.com
on 3 Dec 2012 at 4:11
Original comment by halatmit...@gmail.com
on 4 Dec 2012 at 2:25
Original comment by halatmit...@gmail.com
on 15 Dec 2012 at 3:12
Original issue reported on code.google.com by
halabel...@google.com
on 2 Dec 2012 at 10:11