plus some fixes to resource references and other misc revisions Change-Id: I7b498858d9d0ecfd8cf9bad48c08c93047d597b8
77 lines
3.4 KiB
Plaintext
77 lines
3.4 KiB
Plaintext
page.title=Resource Types
|
|
parent.title=Application Resources
|
|
parent.link=index.html
|
|
@jd:body
|
|
|
|
<div id="qv-wrapper">
|
|
<div id="qv">
|
|
<h2>See also</h2>
|
|
<ol>
|
|
<li><a href="providing-resources.html">Providing Resources</a></li>
|
|
<li><a href="accessing-resources.html">Accessing Resources</a></li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
|
|
<p>Each of the documents in this section describe the usage, format and syntax for a certain type
|
|
of application resource that you can provide in your resources directory ({@code res/}).</p>
|
|
|
|
<p>Here's a brief summary of each resource type:</p>
|
|
|
|
<div class="sidebox-wrapper">
|
|
<div class="sidebox">
|
|
<h2>{@code R.id} Is Not a Resource</h2>
|
|
|
|
<p>You will often use an {@code R.id} integer to handle {@link android.view.View} objects in
|
|
your UI. Although the {@code id} is a subclass of the {@code R} class, it is not considered a
|
|
"resource" because it is not a reference to an externalized application resource. The {@code id}
|
|
is simply a unique identifier that allows you to handle elements in your UI by instantiating
|
|
objects with {@link android.app.Activity#findViewById(int) findViewById()}.</p>
|
|
|
|
<p>For information about using {@code R.id} with your UI, see <a
|
|
href="{@docRoot}guide/topics/ui/declaring-layout.html#attributes">Declaring Layout</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<dl>
|
|
<dt><a href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a></dt>
|
|
<dd>Define pre-determined animations.<br/>
|
|
Tween animations are saved in {@code res/anim/} and accessed from the {@code R.anim} class.<br/>
|
|
Frame animations are saved in {@code res/drawable/} and accessed from the {@code R.drawable} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/color-list-resource.html">Color State List Resource</a></dt>
|
|
<dd>Define a color resources that changes based on the View state.<br/>
|
|
Saved in {@code res/color/} and accessed from the {@code R.color} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a></dt>
|
|
<dd>Define various graphics with bitmaps or XML.<br/>
|
|
Saved in {@code res/drawable/} and accessed from the {@code R.drawable} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/layout-resource.html">Layout Resource</a></dt>
|
|
<dd>Define the layout for your application UI.<br/>
|
|
Saved in {@code res/layout/} and accessed from the {@code R.layout} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a></dt>
|
|
<dd>Define the contents of your application menus.<br/>
|
|
Saved in {@code res/menu/} and accessed from the {@code R.menu} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/string-resource.html">String Resources</a></dt>
|
|
<dd>Define strings, string arrays, and plurals (and include string formatting and styling).<br/>
|
|
Saved in {@code res/values/} and accessed from the {@code R.string}, {@code R.array},
|
|
and {@code R.plurals} classes.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/style-resource.html">Style Resource</a></dt>
|
|
<dd>Define the look and format for UI elements.<br/>
|
|
Saved in {@code res/values/} and accessed from the {@code R.style} class.</dd>
|
|
<dt><a href="{@docRoot}guide/topics/resources/more-resources.html">More Resource Types</a></dt>
|
|
<dd>Define values such as booleans, integers, dimensions, colors, and other arrays.<br/>
|
|
Saved in {@code res/values/} but each accessed from unique {@code R} sub-classes (such as {@code
|
|
R.bool}, {@code R.integer}, {@code R.dimen}, etc.).</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|