Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing different density drawables in the folder

I have 2 doubts regarding storing the drawables in respective folders ie.. ldpi, mdpi..Which I couldn't find an answer anywhere.

  1. I have folders like this:

enter image description here

Since I have all the possible folder names ie.., ldpi, mdpi, hdpi, xhdpi, xxhdpi should I delete the default drawable folder?

Or Should I move all the files from drawable-mdpi to the default drawable folder and delete the drawable-mdpi folder?

  1. I am using few xml files as drawables, which are selectors, custom backgrounds etc.. Which contain the image references like

    <item android:drawable="@drawable/ic_vote_clicked" android:state_pressed="true"/>
    <item android:drawable="@drawable/ic_vote_clicked" android:state_focused="true"/>
    <item android:drawable="@drawable/ic_vote"/>
    

Where should I place these xml files? In every folder? Or the default drawable folder?

Anyways the pngs like @drawable/ic_vote are in every folder.

like image 343
user1537779 Avatar asked Dec 20 '22 23:12

user1537779


1 Answers

Anything that is not DPI related should go in the drawables folder.

Anything else that is dpi related, should be in the relevant DPI folder.

There is no reason to delete any of the folders.

So your xml files should be in the drawable folder.

Also, it doesnt matter what folder they are in, you still reference them with @drawable/ and it finds the right one.

like image 68
IAmGroot Avatar answered Jan 05 '23 06:01

IAmGroot