Mods to the ContactHeaderWidget to be able to have it display strings
as passed in by the caller. For example we may want to use this in the case when there is no contact in a given circumstance.
This commit is contained in:
@@ -233,6 +233,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
|
||||
if (c.moveToFirst()) {
|
||||
long contactId = c.getLong(EMAIL_LOOKUP_CONTACT_ID_COLUMN_INDEX);
|
||||
bindFromContactId(contactId);
|
||||
} else {
|
||||
bindStatic(emailAddress, "");
|
||||
}
|
||||
} finally {
|
||||
if (c != null) {
|
||||
@@ -257,6 +259,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
|
||||
if (c.moveToFirst()) {
|
||||
long contactId = c.getLong(PHONE_LOOKUP_CONTACT_ID_COLUMN_INDEX);
|
||||
bindFromContactId(contactId);
|
||||
} else {
|
||||
bindStatic(number, "");
|
||||
}
|
||||
} finally {
|
||||
if (c != null) {
|
||||
@@ -265,6 +269,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
public void bindStatic(String main, String secondary) {
|
||||
mDisplayNameView.setText(main);
|
||||
mStatusView.setText(secondary);
|
||||
mStarredView.setVisibility(View.GONE);
|
||||
mPhotoView.setImageBitmap(loadPlaceholderPhoto(null));
|
||||
}
|
||||
|
||||
protected void redrawHeader() {
|
||||
if (mContactDataUri != null) {
|
||||
mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, mContactDataUri, HEADER_PROJECTION,
|
||||
|
||||
Reference in New Issue
Block a user