Show private message timestamp in grey below content.

This commit is contained in:
akwizgran
2014-02-26 20:59:18 +00:00
parent 52cf47619f
commit e479bf0a4d
2 changed files with 15 additions and 13 deletions

View File

@@ -9,4 +9,5 @@
<color name="compose_background">#FFFFFF</color>
<color name="horizontal_border">#CCCCCC</color>
<color name="no_posts">#AAAAAA</color>
<color name="private_message_date">#AAAAAA</color>
</resources>

View File

@@ -48,18 +48,6 @@ class ConversationAdapter extends ArrayAdapter<ConversationItem> {
if(header.isRead()) background = res.getColor(R.color.read_background);
else background = res.getColor(R.color.unread_background);
TextView date = new TextView(ctx);
date.setId(1);
date.setLayoutParams(MATCH_WRAP);
if(header.isLocal()) date.setGravity(RIGHT);
else date.setGravity(LEFT);
date.setTextSize(14);
date.setBackgroundColor(background);
date.setPadding(pad, pad, pad, 0);
long timestamp = header.getTimestamp();
date.setText(DateUtils.getRelativeTimeSpanString(ctx, timestamp));
layout.addView(date);
View content;
if(item.getBody() == null) {
TextView ellipsis = new TextView(ctx);
@@ -77,9 +65,22 @@ class ConversationAdapter extends ArrayAdapter<ConversationItem> {
content.setId(2);
content.setLayoutParams(MATCH_WRAP);
content.setBackgroundColor(background);
content.setPadding(pad, 0, pad, pad);
content.setPadding(pad, pad, pad, 0);
layout.addView(content);
TextView date = new TextView(ctx);
date.setId(1);
date.setLayoutParams(MATCH_WRAP);
if(header.isLocal()) date.setGravity(RIGHT);
else date.setGravity(LEFT);
date.setTextSize(14);
date.setTextColor(res.getColor(R.color.private_message_date));
date.setBackgroundColor(background);
date.setPadding(pad, 0, pad, pad);
long timestamp = header.getTimestamp();
date.setText(DateUtils.getRelativeTimeSpanString(ctx, timestamp));
layout.addView(date);
return layout;
}
}