Android - large and blurry graphics

I have a graphic designer who helps me in developing the user interface. We start with screenshots of my current user interface using my Nexus One (800x485). Then he imposes a new art on old screenshots in Photoshop and creates transparent PNG. Then I take this, plug it in my application and, to my horror, these images look large and blurry (about 35% more). When I check the images, they are created with a resolution of 72 dpi, so I really don't know why this is happening. Any ideas?

+3
source share
2 answers

You need to put the graphics in the correct configuration directory for the target screen. If they are designed for N1, this 800x480 screen is a high-density screen, so the graphics need to go to drawable-hdpi. Not in the general directory with the ability to draw, which is considered mdpi for backward compatibility.

+5
source

I edited my answer as it was wrong.

Another idea, how do you handle your draws? (if you are using custom view, you can post the code if this does not help).

I ask because there is a trap when drawing with dimensions:

do you use

bitmap.getScaledWidth

instead

bitmap.getWidth

which can lead to inaccurate / large images.

The current idea that I have in mind is: (easier to explain with an example):

you have image 100 * 100

is displayed

.

, res dp , .

, . , .

0

Source: https://habr.com/ru/post/1779917/


All Articles