How can I use ready-made xmls from ../data/res/drawable?
I want to use some prepared selectors
from AndroidSDK_HOME/platforms/API/data/res/drawable
but I'm not sure what way can I do it. By means of copying them to my w开发者_运维百科orkspace I need to copy all associated with this drawable
images, which isn't convenient.
A selector is just a way of grouping and specifying a set of different drawables for different states, so you certainly need the drawables the selectors refer to. You have two options:
Edit the selectors to refer to android.R.drawable.xxx instead of R.drawable.xxx. i.e. tweak the selectors to use the drawables in Android itself rather than your own project (make sure they exist in the platform version you are targeting, and make sure they are publicly accessible - some are not and have private visibility).
Copy the drawables into your project. For some or all you may need to do this, but beware copyright, and where you copy them copy them for all densities (hdpi, mdpi, etc). In particular don't use any imagery from Google's commercial apps (Google Maps, etc).
精彩评论