Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid animation XML issues
    primarykey
    data
    text
    <p>I'm trying to use Android's animation framework to have my ImageView move in a diamond pattern. Here's my animation.xml:</p> <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="true"&gt; &lt;translate android:fromXDelta="40%p" android:toXDelta="90%p" android:fromYDelta="10%p" android:toYDelta="40%p" android:duration="500" android:startOffset="0"/&gt; &lt;translate android:fromXDelta="90%p" android:toXDelta="40%p" android:fromYDelta="40%p" android:toYDelta="90%p" android:duration="500" android:startOffset="500"/&gt; &lt;translate android:fromXDelta="40%p" android:toXDelta="10%p" android:fromYDelta="90%p" android:toYDelta="40%p" android:duration="500" android:startOffset="1000"/&gt; &lt;translate android:fromXDelta="10%p" android:toXDelta="40%p" android:fromYDelta="40%p" android:toYDelta="10%p" android:duration="500" android:startOffset="1500"/&gt; &lt;/set&gt; </code></pre> <p>My layout:</p> <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon"/&gt; &lt;/FrameLayout&gt; </code></pre> <p>And my onStart:</p> <pre><code>protected void onStart() { super.onStart(); ImageView img = (ImageView)findViewById(R.id.img); Animation a = AnimationUtils.loadAnimation(this, R.anim.diamond); img.startAnimation(a); } </code></pre> <p>When I start my application all I see is a blank screen for 2 seconds then my image pops into the upper-left corner of the screen. If I remove all but one of the translate animations I will see the image move in a diagonal line.</p> <p>I would prefer to use XML to define the animation and not Java.</p> <p>Does anyone have any insight into how I can see the entire animation? </p> <p>-Dan</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