Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-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
AloqaIM-Android
Commits
4eeec3df
Unverified
Commit
4eeec3df
authored
Oct 02, 2018
by
Divyanshu Bhargava
Committed by
GitHub
Oct 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #57 from RocketChat/develop
merge
parents
5d7f2ed6
067edc43
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
299 additions
and
13 deletions
+299
-13
MessageParser.kt
...src/main/java/chat/rocket/android/helper/MessageParser.kt
+4
-8
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+2
-4
strings.xml
app/src/main/res/values-tr/strings.xml
+292
-0
build.gradle
build.gradle
+1
-1
No files found.
app/src/main/java/chat/rocket/android/helper/MessageParser.kt
View file @
4eeec3df
...
...
@@ -143,23 +143,19 @@ class MessageParser @Inject constructor(
override
fun
visit
(
document
:
Document
)
{
val
text
=
builder
.
text
()
val
mentionsList
=
mentions
.
toMutableList
().
also
{
it
.
add
(
"@all"
)
it
.
add
(
"@here"
)
}.
distinct
()
mentionsList
.
forEach
{
var
offset
=
0
mentions
.
forEach
{
val
mentionMe
=
it
==
currentUser
||
it
==
"@all"
||
it
==
"@here"
var
offset
=
text
.
indexOf
(
string
=
it
,
startIndex
=
0
,
ignoreCase
=
false
)
offset
=
text
.
indexOf
(
string
=
it
,
startIndex
=
offset
,
ignoreCase
=
false
)
while
(
offset
>
-
1
)
{
val
textColor
=
if
(
mentionMe
)
myselfTextColor
else
othersTextColor
val
backgroundColor
=
if
(
mentionMe
)
myselfBackgroundColor
else
othersBackgroundColor
val
usernameSpan
=
MentionSpan
(
backgroundColor
,
textColor
,
radius
,
padding
,
mentionMe
)
// Add 1 to end offset to include the @.
val
end
=
offset
+
it
.
length
builder
.
setSpan
(
usernameSpan
,
offset
,
end
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
offset
=
text
.
indexOf
(
string
=
"@$it"
,
startIndex
=
end
,
ignoreCase
=
false
)
offset
=
text
.
indexOf
(
string
=
it
,
startIndex
=
end
,
ignoreCase
=
false
)
}
}
}
...
...
app/src/main/res/values-ru-rRU/strings.xml
View file @
4eeec3df
...
...
@@ -130,10 +130,8 @@
<string
name=
"msg_delete_description"
>
Вы уверены, что хотите удалить это сообщение?
</string>
<string
name=
"msg_channel_name"
>
Название канала
</string>
<string
name=
"msg_search"
>
Поиск
</string>
<!-- TODO - Add proper translation -->
<string
name=
"msg_view_more"
>
view more
</string>
<!-- TODO - Add proper translation -->
<string
name=
"msg_view_less"
>
view less
</string>
<string
name=
"msg_view_more"
>
больше
</string>
<string
name=
"msg_view_less"
>
меньше
</string>
<!-- Create channel messages -->
<string
name=
"msg_private_channel"
>
Приватный
</string>
...
...
app/src/main/res/values-tr/strings.xml
0 → 100644
View file @
4eeec3df
This diff is collapsed.
Click to expand it.
build.gradle
View file @
4eeec3df
...
...
@@ -10,7 +10,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.2.0
-rc03
'
classpath
'com.android.tools.build:gradle:3.2.0'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath
"org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath
'com.google.gms:google-services:4.0.2'
...
...
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