summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorTom Taylor <tomtaylor@google.com>2010-01-11 14:11:46 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-01-11 14:11:46 -0800
commit1edd8277440c83ef44e0128e86afb8c002e49b17 (patch)
tree340088a073a99750417ceb31d7b64640858fe62c /core
parent50a3977c619be113bb35fb7fd53874effad6dbe4 (diff)
parentac65121351f88a890d73a9911f705b7f8f663cd8 (diff)
downloadframeworks_base-1edd8277440c83ef44e0128e86afb8c002e49b17.zip
frameworks_base-1edd8277440c83ef44e0128e86afb8c002e49b17.tar.gz
frameworks_base-1edd8277440c83ef44e0128e86afb8c002e49b17.tar.bz2
Merge "Hide unused fields" into eclair
Diffstat (limited to 'core')
-rw-r--r--core/java/com/android/internal/widget/ContactHeaderWidget.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/java/com/android/internal/widget/ContactHeaderWidget.java b/core/java/com/android/internal/widget/ContactHeaderWidget.java
index 19debec..33fd936 100644
--- a/core/java/com/android/internal/widget/ContactHeaderWidget.java
+++ b/core/java/com/android/internal/widget/ContactHeaderWidget.java
@@ -119,12 +119,12 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
int CONTACT_STATUS_RES_PACKAGE = 8;
int CONTACT_STATUS_LABEL = 9;
}
-
+
private interface PhotoQuery {
String[] COLUMNS = new String[] {
Photo.PHOTO
};
-
+
int PHOTO = 0;
}
@@ -241,13 +241,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
case TOKEN_PHOTO_QUERY: {
//Set the photo
Bitmap photoBitmap = null;
- if (cursor != null && cursor.moveToFirst()
+ if (cursor != null && cursor.moveToFirst()
&& !cursor.isNull(PhotoQuery.PHOTO)) {
byte[] photoData = cursor.getBlob(PhotoQuery.PHOTO);
photoBitmap = BitmapFactory.decodeByteArray(photoData, 0,
photoData.length, null);
}
-
+
if (photoBitmap == null) {
photoBitmap = loadPlaceholderPhoto(null);
}
@@ -261,7 +261,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
case TOKEN_CONTACT_INFO: {
if (cursor != null && cursor.moveToFirst()) {
bindContactInfo(cursor);
- Uri lookupUri = Contacts.getLookupUri(cursor.getLong(ContactQuery._ID),
+ Uri lookupUri = Contacts.getLookupUri(cursor.getLong(ContactQuery._ID),
cursor.getString(ContactQuery.LOOKUP_KEY));
startPhotoQuery(cursor.getLong(ContactQuery.PHOTO_ID), lookupUri);
invalidate();
@@ -277,6 +277,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
} else {
String phoneNumber = (String) cookie;
setDisplayName(phoneNumber, null);
+ setSocialSnippet(null);
mPhotoView.assignContactFromPhone(phoneNumber, true);
}
break;
@@ -290,6 +291,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
} else {
String emailAddress = (String) cookie;
setDisplayName(emailAddress, null);
+ setSocialSnippet(null);
mPhotoView.assignContactFromEmail(emailAddress, true);
}
break;
@@ -374,6 +376,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
public void setSocialSnippet(CharSequence snippet) {
if (snippet == null) {
mStatusView.setVisibility(View.GONE);
+ mStatusAttributionView.setVisibility(View.GONE);
} else {
mStatusView.setText(snippet);
mStatusView.setVisibility(View.VISIBLE);
@@ -446,7 +449,9 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
*
*/
public void wipeClean() {
+ setDisplayName(null, null);
setPhoto(null);
+ setSocialSnippet(null);
mContactUri = null;
mExcludeMimes = null;
}
@@ -457,11 +462,11 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
}
protected void startPhotoQuery(long photoId, Uri lookupKey) {
- mQueryHandler.startQuery(TOKEN_PHOTO_QUERY, lookupKey,
+ mQueryHandler.startQuery(TOKEN_PHOTO_QUERY, lookupKey,
ContentUris.withAppendedId(Data.CONTENT_URI, photoId), PhotoQuery.COLUMNS,
null, null, null);
}
-
+
/**
* Bind the contact details provided by the given {@link Cursor}.
*/