aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-02-22 21:22:31 +0100
committerChristian Schneppe <christian@pix-art.de>2017-02-22 21:22:31 +0100
commit20db67fd023dba5e3276609d98db187783afbcc3 (patch)
treeaa0d863c4b01bab776e9d4e646b42bb8718a311c /src/main/java/de/pixart/messenger
parent0bc4f95a540a06d71b597a27850c90295887783e (diff)
show dates correctly
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index f2127b48e..74ee1324d 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -1275,9 +1275,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
if (max == 0 || (max <= 1 && showLoadMoreMessages(conversation))){
this.messageList.add(0, Message.createDateMessage(conversation, getString(R.string.start_chatting)));
} else if ((max > 0 && !showLoadMoreMessages(conversation)) || (max > 1 && showLoadMoreMessages(conversation))) {
+ String date = first;
for (int i = (max - 1); i > 0; --i) {
String last = sdf.format(this.messageList.get(i).getTimeSent());
- String date = first;
if (!last.equals(first)) {
if (i < (max - 1)) {
if (today.equals(first)) {
@@ -1288,7 +1288,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
first = last;
}
- this.messageList.add(0, Message.createDateMessage(conversation, first));
+ if (today.equals(first)) {
+ date = getString(R.string.today);
+ }
+ this.messageList.add(0, Message.createDateMessage(conversation, date));
}
}
}