Android animation, moving and rotating at same time
<p>I am working on animating an image view and that moves to the right and rotates at the same time. I can get the item to move using</p>

<pre><code>    animation = new TranslateAnimation(0, level, 0, 0);
animation.setDuration(1000);
animation.setRepeatCount(0);
animation.setFillAfter(true);
</code></pre>

<p>Level is the variable I have defined at the time. I know the code for rotate is</p>

<pre><code>RotateAnimation rotate = new RotateAnimation(0,rotate,0,0);
    rotate.setDuration(1000);
    rotate.setRepeatCount(0);
    animation.setFillAfter(true);
    bPick.setAnimation(rotate);
</code></pre>

<p>Again rotate is variable I have defined at the top.</p>

<p>My question is, how do I combine these two? I have tried using a thread </p>

<pre><code>    private Runnable myThread = new Runnable() {

    @Override
    public void run() {
        while (level &lt; 100) {
            try {
                myHandle.sendMessage(myHandle.obtainMessage());
                Thread.sleep(15);
            } catch (Throwable t) {
            }
        }

    }

    Handler myHandle = new Handler() {

        @Override
        public void handleMessage(Message msg) {

            level++;
            animation = new TranslateAnimation(0, level, 0, 0);
            animation.setDuration(1000);
            animation.setRepeatCount(0);
            animation.setFillAfter(true);
            bPick.setAnimation(animation);

        }
    };
};
</code></pre>

<p>That will have it move to the right fine, however if I try adding in rotation as well, it doesnt work, or it will crash.</p>

<p>Any help would be much appreciated, cheers</p>

<p>EDIT</p>

<p>The reason I require this is that I have a gauge with a pick.</p>

<p><img src="http://i.stack.imgur.com/RZwTN.png" alt="Pick left"></p>

<p>I require the gauge pick to move to the right while slowly rotating to the right. How much it moves to the right is based on a int variable set up. It will go from 0 - 100. 0 being the start position and 100, it will be moved to the right and look like this </p>

<p><img src="http://i.stack.imgur.com/xIHJp.png" alt="Pick right"></p>
