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
1f0a3536
Commit
1f0a3536
authored
Jul 24, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update and rename class.
parent
66d709c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
Avatar.kt
app/src/main/java/chat/rocket/android/helper/Avatar.kt
+0
-27
RocketChatUserAvatar.kt
...n/java/chat/rocket/android/helper/RocketChatUserAvatar.kt
+17
-0
No files found.
app/src/main/java/chat/rocket/android/helper/Avatar.kt
deleted
100644 → 0
View file @
66d709c3
package
chat.rocket.android.helper
import
chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.android.widget.RocketChatAvatar
import
java.net.URLEncoder
class
Avatar
(
val
absoluteUrl
:
AbsoluteUrl
?,
val
username
:
String
)
{
val
imageUrl
:
String
/** REMARK
* This is often a SVG image (see Rocket.Chat:server/startup/avatar.js)
*/
get
()
{
val
avatarUrl
=
"/avatar/"
+
URLEncoder
.
encode
(
username
,
"UTF-8"
)
if
(
absoluteUrl
==
null
)
{
return
avatarUrl
}
return
absoluteUrl
.
from
(
"/avatar/"
+
URLEncoder
.
encode
(
username
,
"UTF-8"
))
}
/**
* render avatar into RocketChatAvatar.
*/
fun
into
(
rocketChatAvatar
:
RocketChatAvatar
)
{
rocketChatAvatar
.
loadImage
(
imageUrl
)
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/helper/RocketChatUserAvatar.kt
0 → 100644
View file @
1f0a3536
package
chat.rocket.android.helper
import
java.net.URLEncoder
class
RocketChatUserAvatar
(
val
hostname
:
String
,
val
username
:
String
)
{
val
imageUri
:
String
/** REMARK
* This is often a SVG image (see Rocket.Chat:server/startup/avatar.js).
*/
get
()
{
return
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
"/avatar/"
+
URLEncoder
.
encode
(
username
,
"UTF-8"
)
}
}
\ No newline at end of file
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