Copyright notice: This article is the original article of [he calls himself Mr. Zhang], please indicate the source, otherwise prohibit the reprint.

If mobile access is poor, use the – > Github version

Content is continuously updated, updated date: 2016-07-26

1. Icon Launcher

Place it in mipmap-*dpi and file ic_launcher.png

  • LDPI (Low Density Screen, 120 DPI), its icon size is 36 x 36 px.

  • MDPI (Medium Density Screen, 160 DPI), its icon size is 48 x 48 px.

  • HDPI (High Density Screen, 240 DPI), its icon size is 72 x 72 px.

  • Xhdpi (Extra-high Density Screen, 320 DPI), its icon size is 96 x 96 px.

  • Xxhdpi (XX – High Density Screen, 480 DPI), its icon size is 144 x 144 px.

  • Xxxhdpi (XXX – High Density Screen, 640 DPI), its icon size is 192 x 192 px.

2. Opacity hex value

The opacity Hexadecimal values
100% FF
95% F2
90% E6
85% D9
80% CC
75% BF
70% B3
65% A6
60% 99
55% 8C
50% 80
45% 73
40% 66
35% 59
30% 4D
25% 40
20% 33
15% 26
10% 1A
5% 0D
0% 00

3. Conversion and relationship between DP and PX

Conversion of each DPI:

Data Summary Table:

The name of the Corresponding DPI Proportion (based on MDPI 1) And px conversion relationship
lpdi 120 DPI 0.75 1 dp = 0.75px
mdpi 160 DPI 1 1 dp = 1 px
hdpi 240 DPI 1.5 1 dp = 1.5 px
xhdpi 320 DPI 2 1 dp = 2 px
xxhdpi 480 DPI 3 1 dp = 3 px
xxxhdpi 640 DPI 4 1 dp = 4 px

Dp to px

Given here: 400 dp * 240 dp, the corresponding image resolutions are:

  • Lpdi tail 300px * 180px
  • “Mdpi tail” 400 px * 240 px
  • “Hdpi tail” 600 px * 360 px
  • Xhdpi x 800 x 480 px
  • Xxhdpi tail 1200px * 720px
  • Xxxhdpi tail 1600px * 960px

Px to dp

When converting px into DP, it is necessary to know what DPI standard is used to design it. Dp can be obtained according to the conversion relation table. For example, in a UI designed according to xxHDPI standard, the resolution of one of the cut images is 600px * 360px. According to the conversion relation table, under XXHDPI standard, 1 dp = 3 px, the corresponding DP is 200 DP * 120 DP.

PS:

You can follow me on Github, CSDN and Weibo