As CommonsWare mentioned, you don't have to download the Android source repository to inspect the resources; just go to <android-sdk-dir>/platforms/android-X.X/data/res/
. However, if you start using these you will quickly become disappointed to find that most of them are not available through the android.R
class. Most of the time I have to import them into my Eclipse workspace anyway. :-(
My favorite resources are the drawables that show differently based on a control's focused/pressed/disabled states (like android.R.drawable.btn_default). I use those or tweak them to create custom buttons for my apps. As you can see if you look at /data/res/drawable/btn_default.xml
, they are defined as a <selector>
XML element, which gets inflated into a StateListDrawable
at runtime. You could also create your own StateListDrawables and they're super useful, both as View backgrounds and as a button's "compound drawable" (see TextView.setCompoundDrawables()
).