diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/mail/browse/MessageAttachmentTile.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/mail/browse/MessageAttachmentTile.java b/src/com/android/mail/browse/MessageAttachmentTile.java index fa80799d4..f77f023d2 100644 --- a/src/com/android/mail/browse/MessageAttachmentTile.java +++ b/src/com/android/mail/browse/MessageAttachmentTile.java @@ -28,6 +28,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.widget.ProgressBar; import com.android.ex.photo.Intents; import com.android.ex.photo.Intents.PhotoViewIntentBuilder; @@ -58,6 +59,7 @@ public class MessageAttachmentTile extends AttachmentTile implements OnClickList private View mTextContainer; private final AttachmentActionHandler mActionHandler; + private ProgressBar mProgress; private static final String LOG_TAG = LogTag.getLogTag(); @@ -104,6 +106,7 @@ public class MessageAttachmentTile extends AttachmentTile implements OnClickList super.onFinishInflate(); mTextContainer = findViewById(R.id.attachment_tile_text_container); + mProgress = (ProgressBar) findViewById(R.id.attachment_progress); setOnClickListener(this); } @@ -146,6 +149,14 @@ public class MessageAttachmentTile extends AttachmentTile implements OnClickList } public void updateProgress(boolean showDeterminateProgress) { + if (mAttachment.isDownloading()) { + mProgress.setMax(mAttachment.size); + mProgress.setProgress(mAttachment.downloadedSize); + mProgress.setIndeterminate(!showDeterminateProgress); + mProgress.setVisibility(VISIBLE); + } else { + mProgress.setVisibility(GONE); + } } public void onUpdateStatus() { |