Merge "Update styles for wait screens." into jb-ub-mail
diff --git a/res/drawable-hdpi/default_image.png b/res/drawable-hdpi/default_image.png
new file mode 100644
index 0000000..43e8744
--- /dev/null
+++ b/res/drawable-hdpi/default_image.png
Binary files differ
diff --git a/res/drawable-mdpi/default_image.png b/res/drawable-mdpi/default_image.png
new file mode 100644
index 0000000..e66e04a
--- /dev/null
+++ b/res/drawable-mdpi/default_image.png
Binary files differ
diff --git a/res/drawable-xhdpi/default_image.png b/res/drawable-xhdpi/default_image.png
new file mode 100644
index 0000000..88118a8
--- /dev/null
+++ b/res/drawable-xhdpi/default_image.png
Binary files differ
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dc96b79..5e04654 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -561,7 +561,7 @@
     <!-- Displayed for one second after user saves message as draft [CHAR LIMIT=50]-->
     <string name="message_saved">Message saved as draft.</string>
     <!-- Displayed for one second while message is being sent [CHAR LIMIT=50]-->
-    <string name="sending_message">Sending message\u2026</string>
+    <string name="sending_message">Sending message to outbox\u2026</string>
     <!-- Displayed for one second after trying to send with invalid recipients [CHAR LIMIT=50]-->
     <string name="invalid_recipient">The address <xliff:g id="wrongemail" example="foo@@gmail..com">%s</xliff:g> is invalid.</string>
     <!-- Shown in HTML to allow the user to see quoted text; should match Gmail web UI. 25B6 is Unicode for a right-pointing triangle. [CHAR LIMIT=50] -->
diff --git a/src/com/android/mail/photo/MailPhotoViewActivity.java b/src/com/android/mail/photo/MailPhotoViewActivity.java
index 0991513..e25289d 100644
--- a/src/com/android/mail/photo/MailPhotoViewActivity.java
+++ b/src/com/android/mail/photo/MailPhotoViewActivity.java
@@ -184,9 +184,17 @@
         }
 
         updateActionItems();
+    }
+
+    @Override
+    public void onFragmentVisible(PhotoViewFragment fragment) {
+        super.onFragmentVisible(fragment);
+
+        final Attachment attachment = getCurrentAttachment();
         updateProgressAndEmptyViews(fragment, attachment);
     }
 
+
     /**
      * Updates the empty views of the fragment based upon the current
      * state of the attachment.
@@ -195,6 +203,7 @@
      */
     private void updateProgressAndEmptyViews(
             PhotoViewFragment fragment, final Attachment attachment) {
+
         final ProgressBarWrapper progressBar = fragment.getPhotoProgressBar();
         final TextView emptyText = fragment.getEmptyText();
         final ImageView retryButton = fragment.getRetryButton();
@@ -204,7 +213,7 @@
             progressBar.setMax(attachment.size);
             progressBar.setProgress(attachment.downloadedSize);
             progressBar.setIndeterminate(false);
-        } else {
+        } else if (fragment.isProgressBarNeeded()) {
             progressBar.setIndeterminate(true);
         }
 
diff --git a/src/com/android/mail/providers/Attachment.java b/src/com/android/mail/providers/Attachment.java
index fee998d..4488fab 100644
--- a/src/com/android/mail/providers/Attachment.java
+++ b/src/com/android/mail/providers/Attachment.java
@@ -25,6 +25,7 @@
 import com.android.mail.providers.UIProvider.AttachmentDestination;
 import com.android.mail.providers.UIProvider.AttachmentState;
 import com.android.mail.utils.LogTag;
+import com.android.mail.utils.LogUtils;
 import com.google.common.collect.Lists;
 
 import org.json.JSONArray;
@@ -189,6 +190,16 @@
                 originExtras == null ? "" : originExtras, ""));
     }
 
+    @Override
+    public String toString() {
+        try {
+            return toJSON().toString();
+        } catch (JSONException e) {
+            LogUtils.e(LOG_TAG, e, "JSONException in toString");
+            return super.toString();
+        }
+    }
+
     private static Uri parseOptionalUri(String uriString) {
         return uriString == null ? null : Uri.parse(uriString);
     }