Why Nexus 6 density is 560 dpi?

前端 未结 3 989
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 17:33

How to prepare resources for Nexus 6? If I put images to xxxhdpi they will scale down and lose quality. I put images to xxhdpi they will scale up and lose quality. Why deve

相关标签:
3条回答
  • 2020-12-05 17:48

    I think it's a valid question. Some devices are between supported dpis( xxhdpi & xxxhdpi), using images will do unnecessary software scaling . I don't bother about the quality difference but it will affect the startup performance of the application. Check variable willscale in BitmapFatory , if this is true the platform will do unnecessary extra software scaling. Ideally hardware ui should scale this directly using openGL ES.

    0 讨论(0)
  • 2020-12-05 17:51

    You can use drawable-560dpi for 560 dpi. drawable-560dpi and drawable-xxxhdpi images are in same resolution.

    0 讨论(0)
  • 2020-12-05 18:08

    In the case of the Nexus 6, the manufacturer chose a quantized density of 560 (adb shell getprop ro.sf.lcd_density), even though the physical density is about 493 (getResources().getDisplayMetrics().toString()). Understanding why they might do this requires understanding the meaning of the quantized density and how it affects image resource rendering, which is explained here.

    In short, the quantized density of 560 means that the scale factor employed to load/render images will be 3.5. In the words of D. Hackborn, 'The density ... is an abstract density bucket the device manufacturer has decided makes sense for their UI to run in. This is what is used to evaluate things like "dp" units and select and scale bitmaps from resources.'

    0 讨论(0)
提交回复
热议问题