From 2451dde1bc31bdc5df9fbe9dd9ed594720b0f8f6 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 13 Dec 2010 00:37:31 +0000 Subject: [PATCH] simplify our "should we animate" checks in messageview (also, we now honor the animation preference when using the volume keys to navigate) --- src/com/fsck/k9/activity/K9Activity.java | 8 +++---- src/com/fsck/k9/activity/MessageView.java | 28 +++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/com/fsck/k9/activity/K9Activity.java b/src/com/fsck/k9/activity/K9Activity.java index d0fa760e8..b37b95319 100644 --- a/src/com/fsck/k9/activity/K9Activity.java +++ b/src/com/fsck/k9/activity/K9Activity.java @@ -98,11 +98,11 @@ public class K9Activity extends Activity { return mDateFormat; } - protected void onNext(boolean animate) + protected void onNext() { } - protected void onPrevious(boolean animate) + protected void onPrevious() { } @@ -153,11 +153,11 @@ public class K9Activity extends Activity // right to left swipe if (e1.getX() - e2.getX() > min_distance && Math.abs(velocityX) > min_velocity) { - onNext(true); + onNext(); } else if (e2.getX() - e1.getX() > min_distance && Math.abs(velocityX) > min_velocity) { - onPrevious(true); + onPrevious(); } } catch (Exception e) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 45afd6ae5..6f9b8b18a 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -266,7 +266,7 @@ public class MessageView extends K9Activity implements OnClickListener { if (K9.useVolumeKeysForNavigationEnabled()) { - onNext(true); + onNext(); return true; } } @@ -274,7 +274,7 @@ public class MessageView extends K9Activity implements OnClickListener { if (K9.useVolumeKeysForNavigationEnabled()) { - onPrevious(true); + onPrevious(); return true; } } @@ -342,13 +342,13 @@ public class MessageView extends K9Activity implements OnClickListener case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_P: { - onPrevious(K9.showAnimations()); + onPrevious(); return true; } case KeyEvent.KEYCODE_N: case KeyEvent.KEYCODE_K: { - onNext(K9.showAnimations()); + onNext(); return true; } case KeyEvent.KEYCODE_Z: @@ -1507,19 +1507,19 @@ public class MessageView extends K9Activity implements OnClickListener if (mLastDirection == NEXT && mNextMessage != null) { - onNext(K9.showAnimations()); + onNext(); } else if (mLastDirection == PREVIOUS && mPreviousMessage != null) { - onPrevious(K9.showAnimations()); + onPrevious(); } else if (mNextMessage != null) { - onNext(K9.showAnimations()); + onNext(); } else if (mPreviousMessage != null) { - onPrevious(K9.showAnimations()); + onPrevious(); } else { @@ -1727,7 +1727,7 @@ public class MessageView extends K9Activity implements OnClickListener } @Override - protected void onNext(boolean animate) + protected void onNext() { if (mNextMessage == null) { @@ -1738,7 +1738,7 @@ public class MessageView extends K9Activity implements OnClickListener disableButtons(); - if (animate) + if (K9.showAnimations()) { mTopView.startAnimation(outToLeftAnimation()); } @@ -1749,7 +1749,7 @@ public class MessageView extends K9Activity implements OnClickListener } @Override - protected void onPrevious(boolean animate) + protected void onPrevious() { if (mPreviousMessage == null) { @@ -1761,7 +1761,7 @@ public class MessageView extends K9Activity implements OnClickListener disableButtons(); - if (animate) + if (K9.showAnimations()) { mTopView.startAnimation(inFromRightAnimation()); } @@ -1942,11 +1942,11 @@ public class MessageView extends K9Activity implements OnClickListener break; case R.id.next: case R.id.next_scrolling: - onNext(K9.showAnimations()); + onNext(); break; case R.id.previous: case R.id.previous_scrolling: - onPrevious(K9.showAnimations()); + onPrevious(); break; case R.id.download: onDownloadAttachment((Attachment) view.getTag());