Don't try to show thumbnail for unloaded attachments

Bug: 3292689
Change-Id: I7575cb891f0b46c4a8564b5d2c4907025d91c639
This commit is contained in:
Marc Blank 2010-12-21 12:37:40 -08:00
parent 8b9f2a7284
commit 9c4458dcd7
1 changed files with 5 additions and 7 deletions

View File

@ -48,8 +48,6 @@ import android.content.Loader;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
@ -1151,6 +1149,11 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O
attachmentView.setVisibility(View.VISIBLE);
attachmentLoad.setVisibility(View.INVISIBLE);
attachmentCancel.setVisibility(View.GONE);
Bitmap previewIcon = getPreviewIcon(attachmentInfo);
if (previewIcon != null) {
attachmentIcon.setImageBitmap(previewIcon);
}
} else {
// Show "Load"; hide "View" and "Save"
attachmentSave.setVisibility(View.INVISIBLE);
@ -1186,11 +1189,6 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O
attachmentName.setText(attachmentInfo.name);
attachmentInfoView.setText(Utility.formatSize(mContext, attachmentInfo.size));
Bitmap previewIcon = getPreviewIcon(attachmentInfo);
if (previewIcon != null) {
attachmentIcon.setImageBitmap(previewIcon);
}
mAttachments.addView(view);
mAttachments.setVisibility(View.VISIBLE);
}