Show a placeholder contact icon if no photo is available.
Ben Komalo [Sun, 24 Oct 2010 20:44:51 +0000 (13:44 -0700)]
Change-Id: If8df3129107ba00477b116e48bb3574c83ad0b73

res/drawable-hdpi/default_contact_photo.png [new file with mode: 0644]
res/drawable-mdpi/default_contact_photo.png [new file with mode: 0644]
src/com/android/apps/tag/record/VCardRecord.java

diff --git a/res/drawable-hdpi/default_contact_photo.png b/res/drawable-hdpi/default_contact_photo.png
new file mode 100644 (file)
index 0000000..a60565a
Binary files /dev/null and b/res/drawable-hdpi/default_contact_photo.png differ
diff --git a/res/drawable-mdpi/default_contact_photo.png b/res/drawable-mdpi/default_contact_photo.png
new file mode 100644 (file)
index 0000000..3a338e8
Binary files /dev/null and b/res/drawable-mdpi/default_contact_photo.png differ
index b0080f8..640a44e 100644 (file)
@@ -228,7 +228,8 @@ public class VCardRecord implements ParsedNdefRecord, OnClickListener {
             if (mCachedPhoto != null) {
                 ((ImageView) result.findViewById(R.id.photo)).setImageDrawable(mCachedPhoto);
             } else {
-                // TODO: get placeholder image.
+                ((ImageView) result.findViewById(R.id.photo)).setImageDrawable(
+                        activity.getResources().getDrawable(R.drawable.default_contact_photo));
             }
 
             if (mCachedName != null) {