Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
416deb2d
Commit
416deb2d
authored
Feb 25, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ChatMessageAdapter: delay message shortened and shown after usual time stamp.
parent
08d03ebb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
ChatMessageAdapter.java
...ava/com/xabber/android/ui/adapter/ChatMessageAdapter.java
+7
-7
chat_viewer.xml
app/src/main/res/values-ru/chat_viewer.xml
+3
-3
chat_viewer.xml
app/src/main/res/values/chat_viewer.xml
+2
-2
No files found.
app/src/main/java/com/xabber/android/ui/adapter/ChatMessageAdapter.java
View file @
416deb2d
...
@@ -215,18 +215,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
...
@@ -215,18 +215,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
}
}
if
(
isMUC
)
{
if
(
isMUC
)
{
append
(
builder
,
resource
,
new
TextAppearanceSpan
(
activity
,
R
.
style
.
ChatHeader_
Na
me
));
append
(
builder
,
resource
,
new
TextAppearanceSpan
(
activity
,
R
.
style
.
ChatHeader_
Ti
me
));
append
(
builder
,
divider
,
new
TextAppearanceSpan
(
activity
,
R
.
style
.
ChatHeader
));
append
(
builder
,
divider
,
new
TextAppearanceSpan
(
activity
,
R
.
style
.
ChatHeader
));
}
}
Date
delayTimestamp
=
messageItem
.
getDelayTimestamp
();
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
())
{
if
(
messageItem
.
isUnencypted
())
{
append
(
builder
,
activity
.
getString
(
R
.
string
.
otr_unencrypted_message
),
append
(
builder
,
activity
.
getString
(
R
.
string
.
otr_unencrypted_message
),
...
@@ -250,6 +244,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
...
@@ -250,6 +244,12 @@ public class ChatMessageAdapter extends BaseAdapter implements UpdatableAdapter
String
time
=
StringUtils
.
getSmartTimeText
(
activity
,
messageItem
.
getTimestamp
());
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
);
((
TextView
)
view
.
findViewById
(
R
.
id
.
message_time
)).
setText
(
time
);
if
(
incoming
)
{
if
(
incoming
)
{
...
...
app/src/main/res/values-ru/chat_viewer.xml
View file @
416deb2d
<?xml version="1.0" encoding="utf-8"?>
<?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 -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_status.png -->
<string
name=
"action_status_text"
>
%1$s установил статус: %2$s
</string>
<string
name=
"action_status_text"
>
%1$s установил статус: %2$s
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_status.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_status.png -->
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_account_is_offline.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_account_is_offline.png -->
<string
name=
"account_is_offline"
>
Сообщения будут доставлены после подключения к сети
</string>
<string
name=
"account_is_offline"
>
Сообщения будут доставлены после подключения к сети
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<!-- 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 -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string
name=
"chat_input_hint"
>
Введите сообщение
</string>
<string
name=
"chat_input_hint"
>
Введите сообщение
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<string
name=
"chat_state_paused"
>
Ввел текст ...
</string>
<string
name=
"chat_state_paused"
>
Ввел текст ...
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<!-- 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 -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_option_menu_extra.png -->
<string
name=
"export_chat"
>
Сохранить чат
</string>
<string
name=
"export_chat"
>
Сохранить чат
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
...
...
app/src/main/res/values/chat_viewer.xml
View file @
416deb2d
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_account_is_offline.png -->
<!-- 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>
<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 -->
<!-- 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 -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<string
name=
"chat_input_hint"
>
Type your message here
</string>
<string
name=
"chat_input_hint"
>
Type your message here
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_switch.png -->
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_paused.png -->
<string
name=
"chat_state_paused"
>
Entered text …
</string>
<string
name=
"chat_state_paused"
>
Entered text …
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer.png -->
<!-- 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 -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/chat_viewer_option_menu_extra.png -->
<string
name=
"export_chat"
>
Export chat
</string>
<string
name=
"export_chat"
>
Export chat
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/export_chat_done.png -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment