Each page in this section describe the usage, format, and syntax for a certain type
of app resource
that you can provide in your project resources directory (res/
).
Here's a brief summary of each page:
- Animation Resources
- Define pre-determined animations.
Tween animations are saved inres/anim/
and accessed from theR.anim
class.
Frame animations are saved inres/drawable/
and accessed from theR.drawable
class. - Color State List Resource
- Define a color resources that changes based on the View state.
Saved inres/color/
and accessed from theR.color
class. - Drawable Resources
- Define various graphics with bitmaps or XML.
Saved inres/drawable/
and accessed from theR.drawable
class. - Layout Resource
- Define the layout for your application UI.
Saved inres/layout/
and accessed from theR.layout
class. - Menu Resource
- Define the contents of your application menus.
Saved inres/menu/
and accessed from theR.menu
class. - String Resources
- Define strings, string arrays, and plurals (and include string formatting and styling).
Saved inres/values/
and accessed from theR.string
,R.array
, andR.plurals
classes. - Style Resource
- Define the look and format for UI elements.
Saved inres/values/
and accessed from theR.style
class. - Font Resources
- Define font families and include custom fonts in XML.
Saved inres/font/
and accessed from theR.font
class. - More Resource Types
- Define other primitive values as static resources, including the following:
- Bool
- XML resource that carries a boolean value.
- Color
- XML resource that carries a color value (a hexadecimal color).
- Dimension
- XML resource that carries a dimension value (with a unit of measure).
- ID
- XML resource that provides a unique identifier for application resources and components.
- Integer
- XML resource that carries an integer value.
- Integer Array
- XML resource that provides an array of integers.
- Typed Array
- XML resource that provides a
TypedArray
(which you can use for an array of drawables).