-1

Currently I'm working on a layout that includes some imageViews. The thing is I need to create a drawable for a Nexus 5X because it is using the drawable from the folder drawable-xxhdpi (which it makes sense but there is something that I don't like how it looks like).

I tried making a folder with the next names:

  • drawable-w420dp
  • drawable-w420dp-xxhdpi

But I haven't succeeded in it yet. I have seen a lot of examples with values and layouts. The only option that comes to my mind now is to create a specific layout but I think that is too much for two images.

Some of the pages I have been searching:

Thanks in advance

Leandro Ocampo
  • 1,894
  • 18
  • 38
  • sorry I normally hate seeing this, but you should really go [here](https://developer.android.com/guide/practices/screens_support.html) and read up and get your head around this. You might be misnaming your folders. Android chooses the resource that fits the situation, so if you have drawable.png in your drawable and drawable-xxxhdpi folder, and you use a xxxhdpi device, the system will pick from the appropriate folder, and then the basic drawable folder otherwise. Also, check [this](http://stackoverflow.com/questions/33739945/putting-screen-densities-into-the-correct-bucket/33789580) question – Saik Caskey Dec 20 '16 at 17:37
  • @SaikCaskey Man... because you hate seeing this does not mean that it is a bad question. First you should read my question carefully before giving a comment and even before a downvote. Anyway I will edit my answer and add the pages I' ve been searching. – Leandro Ocampo Dec 20 '16 at 18:29
  • hey wow, I meant I hate seeing "you should really go here and read this generic doc" but I felt it had to be done, I didn't downvote you chum – Saik Caskey Dec 21 '16 at 09:45
  • @SaikCaskey Hi!! I found an answer to my question. You are welcome to check it out and share your knowledge =) – Leandro Ocampo Jan 10 '17 at 20:34
  • Glad you got sorted – Saik Caskey Jan 11 '17 at 09:44

1 Answers1

0

After searching a lot and discussing about this topic I found a big mistake in the way I was working. The thing is that you should use this selectors for layouts only not for drawables. The only way to distinguish drawables is using the well known system hdpi, xhdpi, xxhdpi, etc.

The conclusion in this link gave me a better understanding: https://android-developers.googleblog.com/2011/07/new-tools-for-managing-screen-sizes.html

We strongly recommend that developers start using the new layout selectors ...

I used another approach (Canvas) to deal with my problem. The problem that originated this is out of this question - answer.

I hope it will help someone

Leandro Ocampo
  • 1,894
  • 18
  • 38