1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-16 06:25:06 -05:00

Small code cleanup

This commit is contained in:
cketti 2012-02-22 22:56:05 +01:00
parent 0ef9c516be
commit 2b54599c2b
2 changed files with 6 additions and 7 deletions

View File

@ -977,10 +977,7 @@ public class MessageView extends K9Activity implements OnClickListener {
} }
if (resetMessageViewState) { if (resetMessageViewState) {
mMessageView.showMessageWebView(true); mMessageView.onShowMessage();
mMessageView.showAttachments(false);
mMessageView.showShowAttachmentsAction(hasAttachments);
mMessageView.showShowMessageAction(false);
} }
} catch (MessagingException e) { } catch (MessagingException e) {

View File

@ -43,6 +43,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener {
private View mShowMessageAction; private View mShowMessageAction;
private View mShowAttachmentsAction; private View mShowAttachmentsAction;
private boolean mShowPictures; private boolean mShowPictures;
private boolean mHasAttachments;
private Button mDownloadRemainder; private Button mDownloadRemainder;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private Contacts mContacts; private Contacts mContacts;
@ -134,14 +135,14 @@ public class SingleMessageView extends LinearLayout implements OnClickListener {
mHiddenAttachments.setVisibility(View.VISIBLE); mHiddenAttachments.setVisibility(View.VISIBLE);
} }
private void onShowMessage() { public void onShowMessage() {
showShowMessageAction(false); showShowMessageAction(false);
showAttachments(false); showAttachments(false);
showShowAttachmentsAction(mHasAttachments);
showMessageWebView(true); showMessageWebView(true);
showShowAttachmentsAction(true);
} }
private void onShowAttachments() { public void onShowAttachments() {
showMessageWebView(false); showMessageWebView(false);
showShowAttachmentsAction(false); showShowAttachmentsAction(false);
showShowMessageAction(true); showShowMessageAction(true);
@ -290,6 +291,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener {
showShowPicturesAction(true); showShowPicturesAction(true);
} }
} }
mHasAttachments = ((LocalStore.LocalMessage) message).hasAttachments();
} else { } else {
loadBodyFromUrl("file:///android_asset/empty.html"); loadBodyFromUrl("file:///android_asset/empty.html");
} }