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
d27a602a
Commit
d27a602a
authored
Jul 24, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RocketChatUserStatusProvider
parent
6592f416
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
40 deletions
+24
-40
RocketChatUserStatusProvider.java
...rocket/android/renderer/RocketChatUserStatusProvider.java
+0
-40
RocketChatUserStatusProvider.kt
...t/rocket/android/renderer/RocketChatUserStatusProvider.kt
+24
-0
No files found.
app/src/main/java/chat/rocket/android/renderer/RocketChatUserStatusProvider.java
deleted
100644 → 0
View file @
6592f416
package
chat
.
rocket
.
android
.
renderer
;
import
android.support.annotation.DrawableRes
;
import
chat.rocket.android.R
;
import
chat.rocket.android.widget.helper.UserStatusProvider
;
import
chat.rocket.core.models.User
;
public
class
RocketChatUserStatusProvider
implements
UserStatusProvider
{
private
static
RocketChatUserStatusProvider
instance
;
private
RocketChatUserStatusProvider
()
{
}
public
static
RocketChatUserStatusProvider
getInstance
()
{
if
(
instance
==
null
)
{
instance
=
new
RocketChatUserStatusProvider
();
}
return
instance
;
}
@Override
@DrawableRes
public
int
getStatusResId
(
String
status
)
{
if
(
User
.
STATUS_ONLINE
.
equals
(
status
))
{
return
R
.
drawable
.
userstatus_online
;
}
else
if
(
User
.
STATUS_AWAY
.
equals
(
status
))
{
return
R
.
drawable
.
userstatus_away
;
}
else
if
(
User
.
STATUS_BUSY
.
equals
(
status
))
{
return
R
.
drawable
.
userstatus_busy
;
}
else
if
(
User
.
STATUS_OFFLINE
.
equals
(
status
))
{
return
R
.
drawable
.
userstatus_offline
;
}
// unknown status is rendered as "offline" status.
return
R
.
drawable
.
userstatus_offline
;
}
}
app/src/main/java/chat/rocket/android/renderer/RocketChatUserStatusProvider.kt
0 → 100644
View file @
d27a602a
package
chat.rocket.android.renderer
import
chat.rocket.android.R
import
chat.rocket.android.widget.helper.UserStatusProvider
import
chat.rocket.core.models.User
object
RocketChatUserStatusProvider
:
UserStatusProvider
{
override
fun
getStatusResId
(
status
:
String
?):
Int
{
var
userStatusDrawableId
=
R
.
drawable
.
userstatus_offline
when
(
status
)
{
User
.
STATUS_ONLINE
->
{
userStatusDrawableId
=
R
.
drawable
.
userstatus_online
}
User
.
STATUS_AWAY
->
{
userStatusDrawableId
=
R
.
drawable
.
userstatus_away
}
User
.
STATUS_BUSY
->
{
userStatusDrawableId
=
R
.
drawable
.
userstatus_busy
}
}
return
userStatusDrawableId
}
}
\ 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