1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-13 21:15:08 -05:00

simplify our "should we animate" checks in messageview (also, we now

honor the animation preference when using the volume keys to navigate)
This commit is contained in:
Jesse Vincent 2010-12-13 00:37:31 +00:00
parent b0e4d9cdff
commit 2451dde1bc
2 changed files with 18 additions and 18 deletions

View File

@ -98,11 +98,11 @@ public class K9Activity extends Activity
{ {
return mDateFormat; 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 // right to left swipe
if (e1.getX() - e2.getX() > min_distance && Math.abs(velocityX) > min_velocity) 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) else if (e2.getX() - e1.getX() > min_distance && Math.abs(velocityX) > min_velocity)
{ {
onPrevious(true); onPrevious();
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -266,7 +266,7 @@ public class MessageView extends K9Activity implements OnClickListener
{ {
if (K9.useVolumeKeysForNavigationEnabled()) if (K9.useVolumeKeysForNavigationEnabled())
{ {
onNext(true); onNext();
return true; return true;
} }
} }
@ -274,7 +274,7 @@ public class MessageView extends K9Activity implements OnClickListener
{ {
if (K9.useVolumeKeysForNavigationEnabled()) if (K9.useVolumeKeysForNavigationEnabled())
{ {
onPrevious(true); onPrevious();
return true; return true;
} }
} }
@ -342,13 +342,13 @@ public class MessageView extends K9Activity implements OnClickListener
case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_J:
case KeyEvent.KEYCODE_P: case KeyEvent.KEYCODE_P:
{ {
onPrevious(K9.showAnimations()); onPrevious();
return true; return true;
} }
case KeyEvent.KEYCODE_N: case KeyEvent.KEYCODE_N:
case KeyEvent.KEYCODE_K: case KeyEvent.KEYCODE_K:
{ {
onNext(K9.showAnimations()); onNext();
return true; return true;
} }
case KeyEvent.KEYCODE_Z: case KeyEvent.KEYCODE_Z:
@ -1507,19 +1507,19 @@ public class MessageView extends K9Activity implements OnClickListener
if (mLastDirection == NEXT && mNextMessage != null) if (mLastDirection == NEXT && mNextMessage != null)
{ {
onNext(K9.showAnimations()); onNext();
} }
else if (mLastDirection == PREVIOUS && mPreviousMessage != null) else if (mLastDirection == PREVIOUS && mPreviousMessage != null)
{ {
onPrevious(K9.showAnimations()); onPrevious();
} }
else if (mNextMessage != null) else if (mNextMessage != null)
{ {
onNext(K9.showAnimations()); onNext();
} }
else if (mPreviousMessage != null) else if (mPreviousMessage != null)
{ {
onPrevious(K9.showAnimations()); onPrevious();
} }
else else
{ {
@ -1727,7 +1727,7 @@ public class MessageView extends K9Activity implements OnClickListener
} }
@Override @Override
protected void onNext(boolean animate) protected void onNext()
{ {
if (mNextMessage == null) if (mNextMessage == null)
{ {
@ -1738,7 +1738,7 @@ public class MessageView extends K9Activity implements OnClickListener
disableButtons(); disableButtons();
if (animate) if (K9.showAnimations())
{ {
mTopView.startAnimation(outToLeftAnimation()); mTopView.startAnimation(outToLeftAnimation());
} }
@ -1749,7 +1749,7 @@ public class MessageView extends K9Activity implements OnClickListener
} }
@Override @Override
protected void onPrevious(boolean animate) protected void onPrevious()
{ {
if (mPreviousMessage == null) if (mPreviousMessage == null)
{ {
@ -1761,7 +1761,7 @@ public class MessageView extends K9Activity implements OnClickListener
disableButtons(); disableButtons();
if (animate) if (K9.showAnimations())
{ {
mTopView.startAnimation(inFromRightAnimation()); mTopView.startAnimation(inFromRightAnimation());
} }
@ -1942,11 +1942,11 @@ public class MessageView extends K9Activity implements OnClickListener
break; break;
case R.id.next: case R.id.next:
case R.id.next_scrolling: case R.id.next_scrolling:
onNext(K9.showAnimations()); onNext();
break; break;
case R.id.previous: case R.id.previous:
case R.id.previous_scrolling: case R.id.previous_scrolling:
onPrevious(K9.showAnimations()); onPrevious();
break; break;
case R.id.download: case R.id.download:
onDownloadAttachment((Attachment) view.getTag()); onDownloadAttachment((Attachment) view.getTag());