Attachments in Conversation List: Backend changes so that the appropriate
attachments are passed to the UI. Implement PhotoManager so we can start showing
images.
Upon sync, we extract two image attachments from the first unread message, and
add them to the conversations table.
UI changes as well.
Load BEST if that is available, else load SIMPLE.
No vertical dividers in attachment previews.
Attachment previews are above labels.
Round badge appears for unread conversations when there are more images than
shown. Only appears after the previews have loaded.
Clicking on the attachment previews launches photoviewer.
Attempt to load bigger images than necessary to prevent reloading during mark
read/unread and rotate.
Show animated loading icon while previews are loading.
Previews load from top to bottom, from left to right.
Big performance improvements:
No longer decoding bitmap on UI thread. This kills most of the jank.
Only load when we are not scrolling. This kills a lot of jank.
Remaining jank will be delt with later:
DividedImageCanvas.setDimensions() creates a huge empty bitmap on the UI
thread, which causes a GC. ath will fix.
Multiple images in one line now load whatever's ready first. Added tracing.
Bitmap cache given more memory.
Following ath's advice, decode Bitmap from InputStream rather than byte[]. Don't
compress into BitmapHolder. Only use the bigger Bitmap cache.
Bug: 7481049
Change-Id: Icf823f56abc9345e6d0b800a1e6d45444d8fa028
diff --git a/res/layout/conversation_attachment_previews.xml b/res/layout/conversation_attachment_previews.xml
new file mode 100644
index 0000000..eb7ce25
--- /dev/null
+++ b/res/layout/conversation_attachment_previews.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/attachment_previews"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/attachment_preview_margin_top"
+ android:layout_marginLeft="@dimen/attachment_preview_margin_side"
+ android:layout_marginRight="@dimen/attachment_preview_margin_side"
+ android:visibility="gone" >
+ <!--todo:markwei get font color, typeface, and size from channah-->
+ <TextView
+ android:id="@+id/ap_overflow"
+ android:layout_width="@dimen/ap_overflow_count_diameter"
+ android:layout_height="@dimen/ap_overflow_count_diameter"
+ android:layout_marginRight="@dimen/ap_margin_side"
+ android:layout_marginBottom="@dimen/ap_margin_side"
+ android:layout_gravity="bottom|right"
+ android:includeFontPadding="false"
+ android:textStyle="bold"
+ android:textSize="12sp"/>
+ <!--todo:markwei get actual spinner asset from channah-->
+ <ImageView
+ android:id="@+id/ap_progress_bar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:src="@drawable/spinner_holo" />
+</FrameLayout>
\ No newline at end of file