1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

use a single layout inflater for loading attachments

This commit is contained in:
Jesse Vincent 2011-02-11 12:13:18 -05:00
parent e099337c52
commit 0d0415e705

View File

@ -33,7 +33,7 @@ public class SingleMessageView extends LinearLayout {
private View mShowPicturesSection; private View mShowPicturesSection;
private boolean mShowPictures; private boolean mShowPictures;
private Button mDownloadRemainder; private Button mDownloadRemainder;
private Activity mActivity; private LayoutInflater mInflater;
public void initialize(Activity activity, Boolean isScreenReaderActive) { public void initialize(Activity activity, Boolean isScreenReaderActive) {
@ -47,8 +47,7 @@ public class SingleMessageView extends LinearLayout {
mShowPicturesSection = findViewById(R.id.show_pictures_section); mShowPicturesSection = findViewById(R.id.show_pictures_section);
mShowPictures = false; mShowPictures = false;
mActivity = activity; mInflater = activity.getLayoutInflater();
mDownloadRemainder = (Button) findViewById(R.id.download_remainder); mDownloadRemainder = (Button) findViewById(R.id.download_remainder);
mMessageContentView.configure(); mMessageContentView.configure();
@ -174,8 +173,7 @@ public class SingleMessageView extends LinearLayout {
&& part.getHeader("Content-ID") != null) { && part.getHeader("Content-ID") != null) {
return; return;
} }
LayoutInflater inflater = mActivity.getLayoutInflater(); AttachmentView view = (AttachmentView)mInflater.inflate(R.layout.message_view_attachment, null);
AttachmentView view = (AttachmentView)inflater.inflate(R.layout.message_view_attachment, null);
if (view.populateFromPart(part, message, account, controller, listener)) { if (view.populateFromPart(part, message, account, controller, listener)) {
addAttachment(view); addAttachment(view);
} }