Skip to content

Commit 020e89e

Browse files
author
Chris Banes
committed
Fix Rotation Directions on Flip
1 parent 050d74c commit 020e89e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

library/src/com/handmark/pulltorefresh/library/internal/FlipLoadingLayout.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ public class FlipLoadingLayout extends LoadingLayout {
3434

3535
public FlipLoadingLayout(Context context, Mode mode, TypedArray attrs) {
3636
super(context, mode, attrs);
37+
38+
final int rotateAngle = mode == Mode.PULL_DOWN_TO_REFRESH ? 180 : -180;
3739

38-
mRotateAnimation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
40+
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
3941
0.5f);
4042
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
4143
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
4244
mRotateAnimation.setFillAfter(true);
4345

44-
mResetRotateAnimation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF, 0.5f,
46+
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
4547
Animation.RELATIVE_TO_SELF, 0.5f);
4648
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
4749
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);

0 commit comments

Comments
 (0)