Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In <a href="https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util/DisplayMetrics.java" rel="noreferrer">android.util.DisplayMetrics</a>, you can see that scaling factor is <strong>0.00625</strong>:</p> <pre><code>/** * Scaling factor to convert a density in DPI units to the density scale. * @hide */ public static final float DENSITY_DEFAULT_SCALE = 1.0f / DENSITY_DEFAULT; </code></pre> <p>Where as <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_DEFAULT" rel="noreferrer">DENSITY_DEFAULT</a> is 160 --> scaling factor = 1.0f / 160 = 0.00625.</p> <pre><code>sizeScale = DENSITY_DEFAULT_SCALE * DENSITY_DPI </code></pre> <p>From this:</p> <ul> <li><strong>ldpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_LOW" rel="noreferrer">120</a> -> <strong>0.75</strong></li> <li><strong>mdpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_MEDIUM" rel="noreferrer">160</a> -> <strong>1.0</strong></li> <li><strong>hdpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_HIGH" rel="noreferrer">240</a> -> <strong>1.5</strong></li> <li><strong>xhdpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_XHIGH" rel="noreferrer">320</a> -> <strong>2.0</strong></li> <li><strong>xxhdpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_XXHIGH" rel="noreferrer">480</a> -> <strong>3.0</strong></li> <li><strong>xxxhdpi</strong> = 0.00625 * <a href="http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_XXXHIGH" rel="noreferrer">640</a> -> <strong>4.0</strong></li> </ul> <p>Not exactly a rocket science, but hope this will be useful for someone :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload