diff options
author | Scott Main <smain@google.com> | 2010-02-09 18:48:27 -0800 |
---|---|---|
committer | Scott Main <smain@google.com> | 2010-04-08 17:10:06 -0700 |
commit | f940a1f316ddbed760f6f3ab9a3e4f2112909381 (patch) | |
tree | e6f8e43848d440592adef52c0ffcca95df47f0d3 /docs/html/guide/topics/graphics/2d-graphics.jd | |
parent | 5945579e4ed8fbe6dae6adaa4c222b321c2ec80b (diff) | |
download | frameworks_base-f940a1f316ddbed760f6f3ab9a3e4f2112909381.zip frameworks_base-f940a1f316ddbed760f6f3ab9a3e4f2112909381.tar.gz frameworks_base-f940a1f316ddbed760f6f3ab9a3e4f2112909381.tar.bz2 |
cherry-pick from master: Icf079f5f45b1745a8d54f504e28dbbb52c6f7c96
docs: rewrite resources documentation
Huge overhaul. Includes all new dev guides about how resources are used
on Android and how to provide alternatives, including how to handle
runtime configuration changes (restarts). Plus all new reference
docs for all the resource types (drawables, strings, menus, etc.).
Change-Id: I12e819d2c5fc11e062281d8fe442c3037e92000a
Diffstat (limited to 'docs/html/guide/topics/graphics/2d-graphics.jd')
-rw-r--r-- | docs/html/guide/topics/graphics/2d-graphics.jd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd index 051427b..e46dbb4 100644 --- a/docs/html/guide/topics/graphics/2d-graphics.jd +++ b/docs/html/guide/topics/graphics/2d-graphics.jd @@ -442,7 +442,7 @@ class is the basis for frame animations.</p> <p>While you can define the frames of an animation in your code, using the {@link android.graphics.drawable.AnimationDrawable} class API, it's more simply accomplished with a single XML file that lists the frames that compose the animation. Like the tween animation above, the XML file for this kind -of animation belongs in the <code>res/anim/</code> directory of your Android project. In this case, +of animation belongs in the <code>res/drawable/</code> directory of your Android project. In this case, the instructions are the order and duration for each frame of the animation.</p> <p>The XML file consists of an <code><animation-list></code> element as the root node and a series @@ -459,7 +459,7 @@ Here's an example XML file for a frame-by-frame animation:</p> <p>This animation runs for just three frames. By setting the <code>android:oneshot</code> attribute of the list to <var>true</var>, it will cycle just once then stop and hold on the last frame. If it is set <var>false</var> then -the animation will loop. With this XML saved as <code>rocket_thrust.xml</code> in the <code>res/anim/</code> directory +the animation will loop. With this XML saved as <code>rocket_thrust.xml</code> in the <code>res/drawable/</code> directory of the project, it can be added as the background image to a View and then called to play. Here's an example Activity, in which the animation is added to an {@link android.widget.ImageView} and then animated when the screen is touched:</p> <pre> @@ -470,7 +470,7 @@ public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.main); ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image); - rocketImage.setBackgroundResource(R.anim.rocket_thrust); + rocketImage.setBackgroundResource(R.drawable.rocket_thrust); rocketAnimation = (AnimationDrawable) rocketImage.getBackground(); } |