0

I am rotating an image and would like to, for now, run System.out.println("Transformation done!"); after the transformation has completed. The method is:

protected void applyTransformation(float interpolatedTime, Transformation t) {

final float fromDegrees = mFromDegrees;
float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

final float centerX = mCenterX;
final float centerY = mCenterY;
final Camera camera = mCamera;

final Matrix matrix = t.getMatrix();

camera.save();
camera.rotateX(degrees);
camera.getMatrix(matrix);
camera.restore();

matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);

    }
chief
  • 730
  • 1
  • 9
  • 19
  • 1
    What is your idea behind that, this code just calculates the information necessary for the animation. The transformation is calculated instantly. Did you want to know when the Animation is finished ??? – RaphMclee Jul 25 '12 at 20:27
  • Yes I want to know when it is finished. – chief Jul 25 '12 at 20:38
  • The issue is handled [here at SO](http://stackoverflow.com/questions/2214735/android-animationdrawable-and-knowing-when-animation-ends). – RaphMclee Jul 26 '12 at 06:08

1 Answers1

0

The issue is handled here at SO. This issue might be a duplicate of the question handled in the post a gave the link to.

In the other post they suggest to relay on the duration of the animation. Or to check in time intervals if the view is still in an animation. None off these solutions might work for you.

Edit: But this might :-)

User the AnimationListener of the animation you want to know the end of. http://developer.android.com/reference/android/view/animation/Animation.html#setAnimationListener%28android.view.animation.Animation.AnimationListener%29

Community
  • 1
  • 1
RaphMclee
  • 1,623
  • 13
  • 16