mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
Add locale time formatting to system messages
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
e9d0fca9d8
commit
2fca50cc9b
1 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,7 @@ import android.view.ViewGroup;
|
|||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||
import com.nextcloud.talk.utils.DateUtils;
|
||||
import com.nextcloud.talk.utils.DisplayUtils;
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||
|
@ -53,6 +54,9 @@ public class SystemMessageViewHolder extends MessageHolders.IncomingTextMessageV
|
|||
@Inject
|
||||
Context context;
|
||||
|
||||
@Inject
|
||||
DateUtils dateUtils;
|
||||
|
||||
protected ViewGroup background;
|
||||
|
||||
public SystemMessageViewHolder(View itemView) {
|
||||
|
@ -101,6 +105,10 @@ public class SystemMessageViewHolder extends MessageHolders.IncomingTextMessageV
|
|||
|
||||
text.setText(messageString);
|
||||
|
||||
if (time != null) {
|
||||
time.setText(dateUtils.getLocalTimeStringFromTimestamp(message.getTimestamp()));
|
||||
}
|
||||
|
||||
itemView.setTag(REPLYABLE_VIEW_TAG, message.getReplyable());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue