Updates fragment dejunk
- Reuse stream item views. Simplified the view layout for this.
(In this CL we still inflate views, rather than creating them in code.
Even without doing that performance now seems good enough.)
- Decode HTML into CharSequence in ContactLoader
- Removed ContactTileImageContainer and created
LayoutSuppressingImageView and LayoutSuppressingQuickContactBadge
Bug 5982899
Change-Id: I5cbd816a290a50fca9a964b921d934061915aee1
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index b7cc87d..195eb78 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -74,6 +74,8 @@
public class ContactLoader extends Loader<ContactLoader.Result> {
private static final String TAG = "ContactLoader";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
private final Uri mRequestedUri;
private Uri mLookupUri;
private boolean mLoadGroupMetaData;
@@ -1076,6 +1078,17 @@
cursor.close();
}
+ // Pre-decode all HTMLs
+ final long start = System.currentTimeMillis();
+ for (StreamItemEntry streamItem : streamItems) {
+ streamItem.decodeHtml(getContext());
+ }
+ final long end = System.currentTimeMillis();
+ if (DEBUG) {
+ Log.d(TAG, "Decoded HTML for " + streamItems.size() + " items, took "
+ + (end - start) + " ms");
+ }
+
// Now retrieve any photo records associated with the stream items.
if (!streamItems.isEmpty()) {
if (result.isUserProfile()) {