After we download attachments, get rid of the "old" attachment views

This commit is contained in:
Jesse Vincent 2010-07-19 01:54:55 +00:00
parent 2ee5b49cf2
commit 6ef923be91
2 changed files with 20 additions and 0 deletions

View file

@ -194,5 +194,6 @@
<Button android:id="@+id/download_remainder"
android:text="@string/message_view_download_remainder"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_width="fill_parent" />
</merge>

View file

@ -326,6 +326,22 @@ public class MessageView extends K9Activity implements OnClickListener
});
}
public void removeAllAttachments()
{
runOnUiThread(new Runnable()
{
public void run()
{
for (int i = 0, count = mAttachments.getChildCount(); i < count; i++)
{
mAttachments.removeView(mAttachments.getChildAt(i));
}
}
});
}
public void setAttachmentsEnabled(final boolean enabled)
{
runOnUiThread(new Runnable()
@ -1966,6 +1982,9 @@ public class MessageView extends K9Activity implements OnClickListener
MessageView.this.mMessage = message;
mHandler.removeAllAttachments();
String text;
Part part = MimeUtility.findFirstPartByMimeType(mMessage, "text/html");
if (part == null)