What are the types of drawables?
How to access drawables via xml and code
3 ways to instantiate drawables
Android system variables(public and private)
User created xml variables
Drawables vs images
is anything that can be drawn to the
android screen and you will be storing them in res/drawable folder.
properties (size,gradient,color etc) in xml and gives an effect on the ui
similar to an image.
- Bitmap File
- Nine-Patch File
- Layer List
- State List Level
- Transition Drawable
- Inset Drawable
- Clip Drawable
- Scale Drawable
one at a time full with code examples.
widget/view. It can be accessed from either xml resource file or in java code:
file names become id’s for the resource, so my_image.png becomes my_image, so
goes for the xml’s.
Using an image found in your drawable resource
Using an xml file that defines the drawable
properties to android, still located in res/drawables
Using normal class constructors totally in code
apps that come with the system. most of these drawables are available to the
programmer to use in his apps.
error, this is to protect the developer and his app because any resource that
is not in the public SDK is subject to extensive change or even removal in subsequent versions.
you un-jar it.
stunning, if you only know how to use them well, I must say they are very much
under used by developers.
tool bars and even the activity backgrounds use drawables extensively.
define in xml and use in your apps.
devices with varying screen size.
you may have to provide upto 4 versions of the same image drawable to take care
of the different device screens.
screen size, so you only have to define it once.
has a way you can wrap it around an object in xml, such that at run time the
image.png remains opaque. We shall see this in later posts.