summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail
diff options
context:
space:
mode:
authorPaul Westbrook <pwestbro@google.com>2012-10-13 12:21:58 -0700
committerPaul Westbrook <pwestbro@google.com>2012-10-13 16:55:58 -0700
commit90528f425e09a72b1505c3a1066051ab5a3a67b4 (patch)
tree17a1d9c367e26a254a9631e08aeac45d160030d1 /src/com/android/mail
parent949ea2185d79e3e266662766cfa07cf748493e3a (diff)
downloadandroid_packages_apps_UnifiedEmail-90528f425e09a72b1505c3a1066051ab5a3a67b4.tar.gz
android_packages_apps_UnifiedEmail-90528f425e09a72b1505c3a1066051ab5a3a67b4.tar.bz2
android_packages_apps_UnifiedEmail-90528f425e09a72b1505c3a1066051ab5a3a67b4.zip
Show progress on attachment tiles
Bug: 7298245 Change-Id: I8f7b4e449b652d27e22b2f553292f4f4b5de27a4
Diffstat (limited to 'src/com/android/mail')
-rw-r--r--src/com/android/mail/browse/MessageAttachmentTile.java11
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() {