diff --git a/src/org/thoughtcrime/securesms/ConversationListItem.java b/src/org/thoughtcrime/securesms/ConversationListItem.java index c33f89ba36..16cdd63241 100644 --- a/src/org/thoughtcrime/securesms/ConversationListItem.java +++ b/src/org/thoughtcrime/securesms/ConversationListItem.java @@ -21,7 +21,6 @@ import android.content.Intent; import android.content.res.TypedArray; import android.graphics.Typeface; import android.net.Uri; -import android.os.Build; import android.os.Handler; import android.provider.Contacts.Intents; import android.provider.ContactsContract.QuickContact; @@ -35,7 +34,6 @@ import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; -import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.model.ThreadRecord; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.Recipients; @@ -43,7 +41,8 @@ import org.thoughtcrime.securesms.util.DateUtils; import org.thoughtcrime.securesms.util.Emoji; import java.util.Set; -import java.util.concurrent.ThreadFactory; + +import static org.thoughtcrime.securesms.util.SpanUtil.color; /** * A view that displays the element in a list of multiple conversation threads. @@ -57,6 +56,9 @@ public class ConversationListItem extends RelativeLayout { private final static String TAG = ConversationListItem.class.getSimpleName(); + private final static Typeface BOLD_TYPEFACE = Typeface.create("sans-serif", Typeface.BOLD); + private final static Typeface LIGHT_TYPEFACE = Typeface.create("sans-serif-light", Typeface.NORMAL); + private Context context; private Set selectedThreads; private Recipients recipients; @@ -66,7 +68,6 @@ public class ConversationListItem extends RelativeLayout private TextView dateView; private long count; private boolean read; - private ImageView contactPhotoImage; private final Handler handler = new Handler(); @@ -108,12 +109,16 @@ public class ConversationListItem extends RelativeLayout Emoji.EMOJI_SMALL, new Emoji.InvalidatingPageLoadedListener(subjectView)), TextView.BufferType.SPANNABLE); + this.subjectView.setTypeface(read ? LIGHT_TYPEFACE : BOLD_TYPEFACE); - if (thread.getDate() > 0) - this.dateView.setText(DateUtils.getRelativeTimeSpanString(thread.getDate(), - System.currentTimeMillis(), - DateUtils.MINUTE_IN_MILLIS, - DateUtils.FORMAT_ABBREV_RELATIVE)); + if (thread.getDate() > 0) { + CharSequence date = DateUtils.getRelativeTimeSpanString(thread.getDate(), + System.currentTimeMillis(), + DateUtils.MINUTE_IN_MILLIS, + DateUtils.FORMAT_ABBREV_RELATIVE); + dateView.setText(read ? date : color(getResources().getColor(R.color.textsecure_primary), date)); + dateView.setTypeface(read ? LIGHT_TYPEFACE : BOLD_TYPEFACE); + } setBackground(read, batchMode); setContactPhoto(this.recipients.getPrimaryRecipient());