Implements data collapsing in the contact card.
Provides a Collapsible interface that can implemented used by any class
whose data items can be collapsed upon one another. Also provides a
utility function for collapsing a list of items into a list of collapsed
items.
Uses this interface to collapse data items in the contact view card.
ViewEntrys with the same data, mimetype, intent action, auxIntent action
and action item are collapsed and shown as a single item. If the user
makes this item default, all data rows represented will be made primary,
and one will be chosen (arbitrarily) to be super primary.
diff --git a/src/com/android/contacts/ContactEntryAdapter.java b/src/com/android/contacts/ContactEntryAdapter.java
index 2f8b109..11c862a 100644
--- a/src/com/android/contacts/ContactEntryAdapter.java
+++ b/src/com/android/contacts/ContactEntryAdapter.java
@@ -80,6 +80,7 @@
* Base class for adapter entries.
*/
public static class Entry {
+ public int type = -1;
public String label;
public String data;
public Uri uri;
@@ -92,6 +93,7 @@
* Helper for making subclasses parcelable.
*/
protected void writeToParcel(Parcel p) {
+ p.writeInt(type);
p.writeString(label);
p.writeString(data);
p.writeParcelable(uri, 0);
@@ -104,6 +106,7 @@
* Helper for making subclasses parcelable.
*/
protected void readFromParcel(Parcel p) {
+ type = p.readInt();
label = p.readString();
data = p.readString();
uri = p.readParcelable(null);