@Override
public void onDestroy() {
+ if (mMagnificationController != null) {
+ mMagnificationController.cancelAnimation();
+ }
mScreenStateObserver.destroy();
mWindowManager.setMagnificationCallbacks(null);
}
return mCurrentMagnificationSpec.scale > 1.0f;
}
- public void reset(boolean animate) {
+ public void cancelAnimation() {
if (mTransformationAnimator.isRunning()) {
mTransformationAnimator.cancel();
}
+ }
+
+ public void reset(boolean animate) {
+ cancelAnimation();
mCurrentMagnificationSpec.clear();
if (animate) {
animateMangificationSpec(mSentMagnificationSpec,
centerY) == 0) {
return;
}
- if (mTransformationAnimator.isRunning()) {
- mTransformationAnimator.cancel();
- }
+ cancelAnimation();
if (DEBUG_MAGNIFICATION_CONTROLLER) {
Slog.i(LOG_TAG, "scale: " + scale + " offsetX: " + centerX
+ " offsetY: " + centerY);