From abc921093c02d0045d3010f4654589934f7e0109 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 11 Feb 2011 12:11:21 -0500 Subject: [PATCH] refactor display of the download button --- src/com/fsck/k9/activity/MessageView.java | 3 ++- src/com/fsck/k9/view/SingleMessageView.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index ee4a488bd..c6629fb7b 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1185,7 +1185,7 @@ public class MessageView extends K9Activity implements OnClickListener { @Override public void loadMessageForViewFinished(Account account, String folder, String uid, - Message message) { + final Message message) { if (!mMessageReference.uid.equals(uid) || !mMessageReference.folderName.equals(folder) || !mMessageReference.accountUuid.equals(account.getUuid())) { return; @@ -1193,6 +1193,7 @@ public class MessageView extends K9Activity implements OnClickListener { mHandler.post(new Runnable() { public void run() { setProgressBarIndeterminateVisibility(false); + mMessageView.setShowDownloadButton(message); } }); } diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 163c5b2e1..4213a75e9 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -96,6 +96,9 @@ public class SingleMessageView extends LinearLayout { } catch (Exception me) { Log.e(K9.LOG_TAG, "setHeaders - error", me); } + } + + public void setShowDownloadButton(Message message) { if (message.isSet(Flag.X_DOWNLOADED_FULL)) { mDownloadRemainder.setVisibility(View.GONE); } else {