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
8fffc648
Commit
8fffc648
authored
Jan 04, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using UrlHelper to get avatar URL.
parent
65ed323a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+8
-6
No files found.
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
8fffc648
...
...
@@ -9,10 +9,12 @@ import android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.helper.UrlHelper
import
chat.rocket.android.util.inflate
import
chat.rocket.android.util.setVisibility
import
chat.rocket.android.util.textContent
import
chat.rocket.common.model.BaseRoom.RoomType
import
chat.rocket.core.internal.rest.me
import
chat.rocket.core.model.ChatRoom
import
com.facebook.drawee.view.SimpleDraweeView
import
kotlinx.android.synthetic.main.item_chat.view.*
...
...
@@ -28,9 +30,9 @@ class ChatRoomsAdapter(private var dataSet: MutableList<ChatRoom>, private val c
holder
.
chatName
.
textContent
=
chatRoomName
if
(
chatRoom
.
type
==
RoomType
.
ONE_TO_ONE
)
{
// TODO Check the best way to get the current server url.
val
canonicalUrl
=
chatRoom
.
client
.
restUrl
.
toString
()
// TODO get safe URL
holder
.
userAvatar
.
setImageURI
(
canonicalUrl
+
"avatar/"
+
chatRoomName
)
holder
.
userAvatar
.
setImageURI
(
UrlHelper
.
getAvatarUrl
(
canonicalUrl
,
chatRoomName
))
holder
.
userAvatar
.
setVisibility
(
true
)
}
else
{
holder
.
roomAvatar
.
setImageDrawable
(
DrawableHelper
.
getTextDrawable
(
chatRoomName
))
...
...
@@ -59,9 +61,9 @@ class ChatRoomsAdapter(private var dataSet: MutableList<ChatRoom>, private val c
holder
.
lastMessage
.
textContent
=
message
}
// TODO Change to MySelf
chatRoom
.
user
?.
username
->
{
holder
.
lastMessage
.
textContent
=
context
.
getString
(
R
.
string
.
msg_you
)
+
": $message"
}
//
chatRoom.user?.username -> {
//
holder.lastMessage.textContent = context.getString(R.string.msg_you) + ": $message"
//
}
else
->
{
holder
.
lastMessage
.
textContent
=
"@$senderUsername: $message"
}
...
...
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