How to rotate ImageView at low pace
<p>I’ve build a compass app which is working perfectly fine but there is only one issue with it and it’s the animation, basically I’m rotating an ImageView(a nidle image) using matrix.setRotate onSensorChanged method in SensorEventListener. The nidle is rotating but on very fast pace which don’t seems good. What I want is to rotate the image at low pace. Just like IPhone built in compass. Your expert advice is required.</p>

<pre><code>privateSensorEventListener mySensorEventListener= newSensorEventListener() {
            .
            .
            .
public void onSensorChanged(SensorEvent event) {
            .
            .
            .
            azimuth= (int) event.values[0];
            allowRotating=true;
            dialer.post(new RotateRunnable(azimuth));
            .
            .
            .
}};        
</code></pre>

<p>Runnable which is called if sensor data changed</p>

<pre><code>private class RotateRunnable implementsRunnable {

    private int Degrees;    
    public Rotate Runnable(intDegrees) {
        this.Degrees= Degrees;
    }

    public void run() {
        if(allowRotating) {
            rotateDialer(Degrees);
            dialer.post(this);
        }
    }

}
</code></pre>

<p>Method which rotates the image</p>

<pre><code>private void rotateDialer(int Degrees) {

    matrix.setRotate(360-Degrees, dialerWidth/ 2, dialerHeight/ 2);
    dialer.setScaleType(ScaleType.MATRIX);
    dialer.setImageMatrix(matrix);
    allowRotating=false;
}
</code></pre>
