Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between scaledDensity and density in Android`s DisplayMetrics class?

Tags:

android

TextView compute text size value with scaledDensity instead of density. so what`s the difference between these two values?

like image 661
zhqin Avatar asked Apr 18 '14 03:04

zhqin


1 Answers

DisplayMetrics#scaledDensity

A scaling factor for fonts displayed on the display. This is the same as density, except that it may be adjusted in smaller increments at runtime based on a user preference for the font size.

DisplayMetrics#Density

The logical density of the display. This is a scaling factor for the Density Independent Pixel unit, where one DIP is one pixel on an approximately 160 dpi screen.

like image 63
Nambi Avatar answered Sep 22 '22 14:09

Nambi