Each page in this section describes 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 resource 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 hexadecimal color value.
- 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.