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

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" <Button android:id="@+id/download_remainder"
android:text="@string/message_view_download_remainder" android:text="@string/message_view_download_remainder"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:layout_width="fill_parent" /> android:layout_width="fill_parent" />
</merge> </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) public void setAttachmentsEnabled(final boolean enabled)
{ {
runOnUiThread(new Runnable() runOnUiThread(new Runnable()
@ -1966,6 +1982,9 @@ public class MessageView extends K9Activity implements OnClickListener
MessageView.this.mMessage = message; MessageView.this.mMessage = message;
mHandler.removeAllAttachments();
String text; String text;
Part part = MimeUtility.findFirstPartByMimeType(mMessage, "text/html"); Part part = MimeUtility.findFirstPartByMimeType(mMessage, "text/html");
if (part == null) if (part == null)