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
ffbed3ef
Commit
ffbed3ef
authored
Feb 24, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate last message on channels list
parent
138bfaef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+8
-5
No files found.
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
ffbed3ef
...
...
@@ -9,6 +9,7 @@ import android.view.ViewGroup
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.helper.UrlHelper
import
chat.rocket.android.util.extensions.content
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.textContent
...
...
@@ -67,16 +68,16 @@ class ChatRoomsAdapter(private val context: Context,
}
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
textView
.
textC
ontent
=
chatRoom
.
name
textView
.
c
ontent
=
chatRoom
.
name
}
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
val
lastMessage
=
chatRoom
.
lastMessage
if
(
lastMessage
!=
null
)
{
val
localDateTime
=
DateTimeHelper
.
getLocalDateTime
(
lastMessage
.
timestamp
)
textView
.
textC
ontent
=
DateTimeHelper
.
getDate
(
localDateTime
,
context
)
textView
.
c
ontent
=
DateTimeHelper
.
getDate
(
localDateTime
,
context
)
}
else
{
textView
.
textC
ontent
=
""
textView
.
c
ontent
=
""
}
}
...
...
@@ -88,16 +89,18 @@ class ChatRoomsAdapter(private val context: Context,
val
senderUsername
=
lastMessageSender
.
username
when
(
senderUsername
)
{
chatRoom
.
name
->
{
textView
.
textC
ontent
=
message
textView
.
c
ontent
=
message
}
// TODO Change to MySelf
// chatRoom.user?.username -> {
// holder.lastMessage.textContent = context.getString(R.string.msg_you) + ": $message"
// }
else
->
{
textView
.
textC
ontent
=
"@$senderUsername: $message"
textView
.
c
ontent
=
"@$senderUsername: $message"
}
}
}
else
{
textView
.
content
=
""
}
}
...
...
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