Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23d47958 authored by Mark Wagner's avatar Mark Wagner
Browse files

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.
parent 52e37725
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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,