refactor display of the download button

This commit is contained in:
Jesse Vincent 2011-02-11 12:11:21 -05:00
parent 9deea33426
commit abc921093c
2 changed files with 5 additions and 1 deletions

View file

@ -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);
}
});
}

View file

@ -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 {