Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple tween animation example
    primarykey
    data
    text
    <p>I'm trying to implement the "hyperspace" tween animation described at <a href="http://developer.android.com/guide/topics/resources/animation-resource.html">http://developer.android.com/guide/topics/resources/animation-resource.html</a> ("Animation Resources") - however it does not seem to work as written. When I run the application, I just get a blank view below the application title bar. What am I doing wrong? </p> <p>Per the example, here is my code. I've created res/anim/hyperspace_jump.xml:</p> <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"&gt; &lt;scale android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromXScale="1.0" android:toXScale="1.4" android:fromYScale="1.0" android:toYScale="0.6" android:pivotX="50%" android:pivotY="50%" android:fillAfter="false" android:duration="700" /&gt; &lt;set android:interpolator="@android:anim/accelerate_interpolator" android:startOffset="700"&gt; &lt;scale android:fromXScale="1.4" android:toXScale="0.0" android:fromYScale="0.6" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:duration="400" /&gt; &lt;rotate android:fromDegrees="0" android:toDegrees="-45" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:duration="400" /&gt; &lt;/set&gt; &lt;/set&gt; </code></pre> <p>I've also created a layout/main.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /&gt; &lt;ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageView&gt; &lt;/LinearLayout&gt; </code></pre> <p>Finally I have an activity:</p> <pre><code>package com.tomoreilly.geology; import android.app.Activity; import android.os.Bundle; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView image = (ImageView) findViewById(R.id.ImageView01); Animation hyperspaceJump = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump); image.startAnimation(hyperspaceJump); } } </code></pre> <p>Yet I do not see any animation when I run the app. Am I missing some detail that is not covered in the "Animation Resources" example?</p> <p>Thanks, Tom</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload