2012-07-25 42 views
0

我正在旋转图像,现在想运行System.out.println(“Transformation done!”);改造完成后。方法是:完成图像转换后要做些什么

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); 

    } 
+1

你的想法背后是什么,这段代码只是计算动画所需的信息。转换是即时计算的。你想知道什么时候动画完成? – RaphMclee 2012-07-25 20:27:18

+0

是的,我想知道它何时完成。 – chief 2012-07-25 20:38:50

+0

问题处理[在这里SO](http://stackoverflow.com/questions/2214735/android-animationdrawable-and-knowing-when-animation-ends)。 – RaphMclee 2012-07-26 06:08:57

回答

0

该问题处理here at SO。这个问题可能是在提供链接的帖子中处理的问题的重复。

在其他职位,他们建议在动画的持续时间接力。或者在时间间隔内检查视图是否仍在动画中。这些解决方案都不适合您。

编辑:但这可能:-)

用户想知道年底的动画AnimationListener。 http://developer.android.com/reference/android/view/animation/Animation.html#setAnimationListener%28android.view.animation.Animation.AnimationListener%29