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

Make all fields of AttachmentView private

This commit is contained in:
cketti 2014-10-20 20:14:04 -04:00
parent 0ced8746af
commit 4a6c52947d
2 changed files with 12 additions and 8 deletions

View File

@ -46,16 +46,16 @@ import com.fsck.k9.provider.AttachmentProvider;
public class AttachmentView extends FrameLayout implements OnClickListener, OnLongClickListener { public class AttachmentView extends FrameLayout implements OnClickListener, OnLongClickListener {
private Context mContext; private Context mContext;
public Button viewButton; private Button viewButton;
public Button downloadButton; private Button downloadButton;
public LocalAttachmentBodyPart part; private LocalAttachmentBodyPart part;
private Message mMessage; private Message mMessage;
private Account mAccount; private Account mAccount;
private MessagingController mController; private MessagingController mController;
private MessagingListener mListener; private MessagingListener mListener;
public String name; private String name;
public String contentType; private String contentType;
public long size; private long size;
private AttachmentFileDownloadCallback callback; private AttachmentFileDownloadCallback callback;
@ -89,6 +89,11 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
public void showFileBrowser(AttachmentView caller); public void showFileBrowser(AttachmentView caller);
} }
public void setButtonsEnabled(boolean enabled) {
viewButton.setEnabled(enabled);
downloadButton.setEnabled(enabled);
}
/** /**
* Populates this view with information about the attachment. * Populates this view with information about the attachment.
* <p> * <p>

View File

@ -607,8 +607,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
public void setAttachmentsEnabled(boolean enabled) { public void setAttachmentsEnabled(boolean enabled) {
for (int i = 0, count = mAttachments.getChildCount(); i < count; i++) { for (int i = 0, count = mAttachments.getChildCount(); i < count; i++) {
AttachmentView attachment = (AttachmentView) mAttachments.getChildAt(i); AttachmentView attachment = (AttachmentView) mAttachments.getChildAt(i);
attachment.viewButton.setEnabled(enabled); attachment.setButtonsEnabled(enabled);
attachment.downloadButton.setEnabled(enabled);
} }
} }