Minor layout updates.
Name and content now use the same size font.
diff --git a/res/layout-finger/social_list_item.xml b/res/layout-finger/social_list_item.xml
index 3e6644d..588cbd8 100644
--- a/res/layout-finger/social_list_item.xml
+++ b/res/layout-finger/social_list_item.xml
@@ -16,7 +16,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:paddingBottom="2dip">
<ImageView
android:id="@+id/sourceIcon"
@@ -25,6 +26,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
+ android:layout_marginTop="2dip"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
@@ -39,6 +41,7 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
+ android:layout_marginTop="1dip"
android:layout_marginRight="8dip"
android:background="@drawable/contact_picture_border_in_list"
@@ -56,6 +59,8 @@
android:layout_alignWithParentIfMissing="true"
android:lineSpacingMultiplier="0.9"
+ android:maxLines="6"
+ android:textAppearance="?android:attr/textAppearanceSmall"
/>
<TextView
@@ -64,8 +69,7 @@
android:layout_height="wrap_content"
android:layout_toRightOf="@id/photo"
android:layout_below="@id/content"
- android:layout_marginTop="2dip"
- android:layout_marginBottom="5dip"
+ android:layout_marginTop="8dip"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
diff --git a/src/com/android/contacts/SocialStreamActivity.java b/src/com/android/contacts/SocialStreamActivity.java
index 486ee22..c3d8997 100644
--- a/src/com/android/contacts/SocialStreamActivity.java
+++ b/src/com/android/contacts/SocialStreamActivity.java
@@ -47,7 +47,7 @@
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.format.DateUtils;
-import android.text.style.TextAppearanceSpan;
+import android.text.style.StyleSpan;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
@@ -152,8 +152,7 @@
private final LayoutInflater mInflater;
private final ContactsCache mContactsCache;
private final MappingCache mMappingCache;
- private final TextAppearanceSpan mTextAppearanceName;
- private final TextAppearanceSpan mTextAppearanceStatus;
+ private final StyleSpan mTextStyleName;
private static class SocialHolder {
ImageView photo;
@@ -170,10 +169,7 @@
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mContactsCache = contactsCache;
mMappingCache = mappingCache;
- mTextAppearanceName =
- new TextAppearanceSpan(mContext, android.R.style.TextAppearance_Medium);
- mTextAppearanceStatus =
- new TextAppearanceSpan(mContext, android.R.style.TextAppearance_Small);
+ mTextStyleName = new StyleSpan(android.graphics.Typeface.BOLD);
}
@Override
@@ -187,14 +183,17 @@
// TODO: trigger async query to find actual name and photo instead
// of using this lazy caching mechanism
- holder.photo.setImageBitmap(mContactsCache.getPhoto(contactId));
+ Bitmap photo = mContactsCache.getPhoto(contactId);
+ if (photo != null) {
+ holder.photo.setImageBitmap(photo);
+ } else {
+ holder.photo.setImageResource(R.drawable.ic_contact_list_picture);
+ }
holder.contentBuilder.clear();
holder.contentBuilder.append(name);
- holder.contentBuilder.append(": ");
+ holder.contentBuilder.append(" ");
holder.contentBuilder.append(title);
- holder.contentBuilder.setSpan(mTextAppearanceName, 0, name.length() + 2, 0);
- holder.contentBuilder.setSpan(mTextAppearanceStatus, name.length() + 2,
- holder.contentBuilder.length(), 0);
+ holder.contentBuilder.setSpan(mTextStyleName, 0, name.length(), 0);
holder.content.setText(holder.contentBuilder);
CharSequence relativePublished = DateUtils.getRelativeTimeSpanString(published,