Lecture 4: Resources and Drawables Flashcards
Static or template data will probably be stored i the __ folder
/res
What is the /res/values folder used for?
Holding the most basic datatypes
What are some of the types of .xml files that might be in the /res/values folder?
- strings.xml
- colors.xml
- styles.xml
Why would you want to store things like strings in a strings.xml file?
To keep the content (strings) away from the styling (layouts) and the code (java)
Each string is a string __ object with a __
- XML
- name attribute
When fetching a string programmatically what permissions do we have?
Read-only
It cannot be modified
What is the directory for image resources?
/res/drawable
What can you use to fetch an image resource?
@drawable/filename
How do you apply additional metadata or attributes to the image?
Use an XML file as a wrapper for the image
What are nine-patch images?
A subclass of images
They are split into 9 sectors that are scaled separately from each other to fill a space without distorting the original shape
What are nine-patches usually used for?
Borders, textboxes, and cards
What are layer lists for?
Sets a draw order for images
What are level lists for?
Lets you pick the order of images on top of eachother based on an integer level
What types of files are the level-list and layer-list objects and where are they stored?
- XML
- /res/drawable
Where are custom fonts stored?
/res/font folder