1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-02 00:25:10 -04:00

Extract "disable buttons" on messageview and disable buttons before

shifting to the next message
This commit is contained in:
Jesse Vincent 2010-07-11 15:31:11 +00:00
parent 0a848d6526
commit 00199de3bb

View File

@ -918,12 +918,7 @@ public class MessageView extends K9Activity implements OnClickListener
// If moving isn't support at all, then all of them must be disabled anyway.
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
{
mArchive.setEnabled(false);
mMove.setEnabled(false);
mSpam.setEnabled(false);
mArchiveScrolling.setEnabled(false);
mMoveScrolling.setEnabled(false);
mSpamScrolling.setEnabled(false);
disableButtons();
}
else
{
@ -989,6 +984,17 @@ public class MessageView extends K9Activity implements OnClickListener
}
}
private void disableButtons()
{
mArchive.setEnabled(false);
mMove.setEnabled(false);
mSpam.setEnabled(false);
mArchiveScrolling.setEnabled(false);
mMoveScrolling.setEnabled(false);
mSpamScrolling.setEnabled(false);
}
private void setOnClickListener(int viewCode)
{
View thisView = findViewById(viewCode);
@ -1333,10 +1339,15 @@ public class MessageView extends K9Activity implements OnClickListener
return;
}
mLastDirection = NEXT;
disableButtons();
if (animate)
{
mTopView.startAnimation(outToLeftAnimation());
}
displayMessage(mNextMessage);
next.requestFocus();
}
@ -1351,6 +1362,9 @@ public class MessageView extends K9Activity implements OnClickListener
}
mLastDirection = PREVIOUS;
disableButtons();
if (animate)
{
mTopView.startAnimation(inFromRightAnimation());