Loading core/java/com/android/internal/widget/ContactHeaderWidget.java +14 −4 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Data; import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.Presence; import android.provider.ContactsContract.RawContacts; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.provider.SocialContract.Activities; Loading @@ -61,12 +62,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList private TextView mPhoneticNameView; private CheckBox mStarredView; private ImageView mPhotoView; private ImageView mPresenceView; private TextView mStatusView; private int mNoPhotoResource; private QueryHandler mQueryHandler; protected long mContactId; protected Uri mContactDataUri; protected Uri mContactSummaryUri; protected Uri mContactUri; protected Uri mStatusUri; Loading @@ -84,12 +86,14 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList Contacts.DISPLAY_NAME, Contacts.STARRED, Contacts.PHOTO_ID, Contacts.PRESENCE_STATUS, }; protected static final int HEADER_DISPLAY_NAME_COLUMN_INDEX = 0; //TODO: We need to figure out how we're going to get the phonetic name. //static final int HEADER_PHONETIC_NAME_COLUMN_INDEX protected static final int HEADER_STARRED_COLUMN_INDEX = 1; protected static final int HEADER_PHOTO_ID_COLUMN_INDEX = 2; protected static final int HEADER_PRESENCE_STATUS_COLUMN_INDEX = 3; //Projection used for finding the most recent social status. protected static final String[] SOCIAL_PROJECTION = new String[] { Loading Loading @@ -144,6 +148,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList mPhotoView.setOnClickListener(this); mPhotoView.setOnLongClickListener(this); mPresenceView = (ImageView) findViewById(R.id.presence); mStatusView = (TextView)findViewById(R.id.status); // Set the photo with a random "no contact" image Loading Loading @@ -250,7 +256,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList public void bindFromContactId(long contactId) { mContactId = contactId; mContactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, mContactId); mContactDataUri = Uri.withAppendedPath(mContactUri, Contacts.Data.CONTENT_DIRECTORY); mContactSummaryUri = ContentUris.withAppendedId(Contacts.CONTENT_SUMMARY_URI, mContactId); mStatusUri = ContentUris.withAppendedId( SocialContract.Activities.CONTENT_CONTACT_STATUS_URI, mContactId); redrawHeader(); Loading Loading @@ -317,8 +323,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList } protected void redrawHeader() { if (mContactDataUri != null) { mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, mContactDataUri, HEADER_PROJECTION, if (mContactSummaryUri != null) { mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, mContactSummaryUri, HEADER_PROJECTION, null, null, null); } Loading Loading @@ -352,6 +358,10 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList photoBitmap = loadPlaceholderPhoto(null); } mPhotoView.setImageBitmap(photoBitmap); //Set the presence status int presence = c.getInt(HEADER_PRESENCE_STATUS_COLUMN_INDEX); mPresenceView.setImageResource(Presence.getPresenceIconResourceId(presence)); } } Loading core/res/res/layout-ja/contact_header_name.xml +4 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" android:textAppearance="?android:attr/textAppearanceLargeInverse" android:textColor="@android:color/secondary_text_light" /> Loading @@ -32,6 +34,8 @@ <TextView android:id="@+id/phonetic_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" android:textAppearance="?android:attr/textAppearanceSmallInverse" android:textColor="@android:color/secondary_text_light" /> Loading core/res/res/layout/contact_header.xml +7 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,13 @@ </LinearLayout> <ImageView android:id="@+id/presence" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="3dip" android:paddingRight="6dip"/> <CheckBox android:id="@+id/star" android:layout_width="wrap_content" Loading core/res/res/layout/contact_header_name.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLargeInverse" android:textColor="@android:color/secondary_text_light" android:maxLines="2" android:singleLine="true" android:ellipsize="end" /> Loading
core/java/com/android/internal/widget/ContactHeaderWidget.java +14 −4 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Data; import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.Presence; import android.provider.ContactsContract.RawContacts; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.provider.SocialContract.Activities; Loading @@ -61,12 +62,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList private TextView mPhoneticNameView; private CheckBox mStarredView; private ImageView mPhotoView; private ImageView mPresenceView; private TextView mStatusView; private int mNoPhotoResource; private QueryHandler mQueryHandler; protected long mContactId; protected Uri mContactDataUri; protected Uri mContactSummaryUri; protected Uri mContactUri; protected Uri mStatusUri; Loading @@ -84,12 +86,14 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList Contacts.DISPLAY_NAME, Contacts.STARRED, Contacts.PHOTO_ID, Contacts.PRESENCE_STATUS, }; protected static final int HEADER_DISPLAY_NAME_COLUMN_INDEX = 0; //TODO: We need to figure out how we're going to get the phonetic name. //static final int HEADER_PHONETIC_NAME_COLUMN_INDEX protected static final int HEADER_STARRED_COLUMN_INDEX = 1; protected static final int HEADER_PHOTO_ID_COLUMN_INDEX = 2; protected static final int HEADER_PRESENCE_STATUS_COLUMN_INDEX = 3; //Projection used for finding the most recent social status. protected static final String[] SOCIAL_PROJECTION = new String[] { Loading Loading @@ -144,6 +148,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList mPhotoView.setOnClickListener(this); mPhotoView.setOnLongClickListener(this); mPresenceView = (ImageView) findViewById(R.id.presence); mStatusView = (TextView)findViewById(R.id.status); // Set the photo with a random "no contact" image Loading Loading @@ -250,7 +256,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList public void bindFromContactId(long contactId) { mContactId = contactId; mContactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, mContactId); mContactDataUri = Uri.withAppendedPath(mContactUri, Contacts.Data.CONTENT_DIRECTORY); mContactSummaryUri = ContentUris.withAppendedId(Contacts.CONTENT_SUMMARY_URI, mContactId); mStatusUri = ContentUris.withAppendedId( SocialContract.Activities.CONTENT_CONTACT_STATUS_URI, mContactId); redrawHeader(); Loading Loading @@ -317,8 +323,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList } protected void redrawHeader() { if (mContactDataUri != null) { mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, mContactDataUri, HEADER_PROJECTION, if (mContactSummaryUri != null) { mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, mContactSummaryUri, HEADER_PROJECTION, null, null, null); } Loading Loading @@ -352,6 +358,10 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList photoBitmap = loadPlaceholderPhoto(null); } mPhotoView.setImageBitmap(photoBitmap); //Set the presence status int presence = c.getInt(HEADER_PRESENCE_STATUS_COLUMN_INDEX); mPresenceView.setImageResource(Presence.getPresenceIconResourceId(presence)); } } Loading
core/res/res/layout-ja/contact_header_name.xml +4 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" android:textAppearance="?android:attr/textAppearanceLargeInverse" android:textColor="@android:color/secondary_text_light" /> Loading @@ -32,6 +34,8 @@ <TextView android:id="@+id/phonetic_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" android:textAppearance="?android:attr/textAppearanceSmallInverse" android:textColor="@android:color/secondary_text_light" /> Loading
core/res/res/layout/contact_header.xml +7 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,13 @@ </LinearLayout> <ImageView android:id="@+id/presence" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="3dip" android:paddingRight="6dip"/> <CheckBox android:id="@+id/star" android:layout_width="wrap_content" Loading
core/res/res/layout/contact_header_name.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLargeInverse" android:textColor="@android:color/secondary_text_light" android:maxLines="2" android:singleLine="true" android:ellipsize="end" />