Commit 416deb2d authored by Grigory Fedorov's avatar Grigory Fedorov

ChatMessageAdapter: delay message shortened and shown after usual time stamp.

parent 08d03ebb
......@@ -215,18 +215,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
}
if (isMUC) {
append(builder, resource, new TextAppearanceSpan(activity, R.style.ChatHeader_Name));
append(builder, resource, new TextAppearanceSpan(activity, R.style.ChatHeader_Time));
append(builder, divider, new TextAppearanceSpan(activity, R.style.ChatHeader));
}
Date delayTimestamp = messageItem.getDelayTimestamp();
if (delayTimestamp != null) {
String delay = activity.getString(incoming ? R.string.chat_delay : R.string.chat_typed,
StringUtils.getSmartTimeText(activity, delayTimestamp));
append(builder, delay, new TextAppearanceSpan(activity, R.style.ChatHeader_Delay));
append(builder, divider, new TextAppearanceSpan(activity, R.style.ChatHeader));
}
if (messageItem.isUnencypted()) {
append(builder, activity.getString(R.string.otr_unencrypted_message),
......@@ -250,6 +244,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
String time = StringUtils.getSmartTimeText(activity, messageItem.getTimestamp());
if (delayTimestamp != null) {
String delay = activity.getString(incoming ? R.string.chat_delay : R.string.chat_typed,
StringUtils.getSmartTimeText(activity, delayTimestamp));
time += " (" + delay + ")";
}
((TextView)view.findViewById(R.id.message_time)).setText(time);
if (incoming) {
......
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_status.png -->
<string name="action_status_text">%1$s установил статус: %2$s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_status.png -->
......@@ -11,7 +11,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_account_is_offline.png -->
<string name="account_is_offline">Сообщения будут доставлены после подключения к сети</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_delay">Сообщение было отправлено в %s</string>
<string name="chat_delay">отправлено в %s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_input_hint">Введите сообщение</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
......@@ -109,7 +109,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<string name="chat_state_paused">Ввел текст ...</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_typed">Сообщение было набрано в %s</string>
<string name="chat_typed">набрано в %s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_option_menu_extra.png -->
<string name="export_chat">Сохранить чат</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
......
......@@ -11,7 +11,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_account_is_offline.png -->
<string name="account_is_offline">You are currently offline. Messages you send will be delivered next time you connect.</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_delay">Message was sent at %s</string>
<string name="chat_delay">sent at %s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_input_hint">Type your message here</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
......@@ -109,7 +109,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<string name="chat_state_paused">Entered text …</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string name="chat_typed">Message was entered at %s</string>
<string name="chat_typed">entered at %s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_option_menu_extra.png -->
<string name="export_chat">Export chat</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment