Improved displayMetrics method for density values