Commit b39f8f7a authored by Adrien Maglo's avatar Adrien Maglo
Browse files

Animated cover view: slow down the animation and use a constant speed

parent c049db76
...@@ -26,8 +26,8 @@ import android.graphics.Paint; ...@@ -26,8 +26,8 @@ import android.graphics.Paint;
import android.graphics.Rect; import android.graphics.Rect;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.view.animation.Transformation; import android.view.animation.Transformation;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
...@@ -95,9 +95,9 @@ public class AnimatedCoverView extends View { ...@@ -95,9 +95,9 @@ public class AnimatedCoverView extends View {
mCurrentMove == ANIMATION_MOVE_1 ? rect.bottom - scaledImageHeight : 0); mCurrentMove == ANIMATION_MOVE_1 ? rect.bottom - scaledImageHeight : 0);
int animationDuration = scaledImageHeight == rect.bottom ? int animationDuration = scaledImageHeight == rect.bottom ?
(scaledImageWidth - rect.right) * 15 : (scaledImageHeight - rect.bottom) * 15; (scaledImageWidth - rect.right) * 60 : (scaledImageHeight - rect.bottom) * 60;
mCurrentAnim.setDuration(animationDuration); mCurrentAnim.setDuration(animationDuration);
mCurrentAnim.setInterpolator(new AccelerateDecelerateInterpolator()); mCurrentAnim.setInterpolator(new LinearInterpolator());
mCurrentAnim.initialize(mImage.getWidth(), mImage.getHeight(), rect.right, rect.bottom); mCurrentAnim.initialize(mImage.getWidth(), mImage.getHeight(), rect.right, rect.bottom);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment