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
b9d112bf
Commit
b9d112bf
authored
Aug 29, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomToolbar.java
parent
4b4c84f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
25 deletions
+8
-25
RoomToolbar.java
...src/main/java/chat/rocket/android/widget/RoomToolbar.java
+8
-25
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RoomToolbar.java
View file @
b9d112bf
...
...
@@ -17,6 +17,7 @@ import android.view.View;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
chat.rocket.android.widget.helper.DrawableHelper
;
import
com.amulyakhare.textdrawable.TextDrawable
;
import
java.lang.reflect.Field
;
...
...
@@ -103,23 +104,24 @@ public class RoomToolbar extends Toolbar {
}
public
void
showUserStatusIcon
(
int
status
)
{
wrapDrawable
(
userStatusDrawable
);
DrawableHelper
.
INSTANCE
.
wrapDrawable
(
userStatusDrawable
);
Context
context
=
getContext
();
switch
(
status
)
{
case
STATUS_ONLINE:
tintDrawable
(
userStatusDrawable
,
R
.
color
.
color_user_status_online
);
DrawableHelper
.
INSTANCE
.
tintDrawable
(
userStatusDrawable
,
context
,
R
.
color
.
color_user_status_online
);
break
;
case
STATUS_BUSY:
tintDrawable
(
userStatusDrawable
,
R
.
color
.
color_user_status_busy
);
DrawableHelper
.
INSTANCE
.
tintDrawable
(
userStatusDrawable
,
context
,
R
.
color
.
color_user_status_busy
);
break
;
case
STATUS_AWAY:
tintDrawable
(
userStatusDrawable
,
R
.
color
.
color_user_status_away
);
DrawableHelper
.
INSTANCE
.
tintDrawable
(
userStatusDrawable
,
context
,
R
.
color
.
color_user_status_away
);
break
;
case
STATUS_OFFLINE:
tintDrawable
(
userStatusDrawable
,
R
.
color
.
color_user_status_offline
);
DrawableHelper
.
INSTANCE
.
tintDrawable
(
userStatusDrawable
,
context
,
R
.
color
.
color_user_status_offline
);
break
;
default
:
tintDrawable
(
userStatusDrawable
,
R
.
color
.
color_user_status_offline
);
DrawableHelper
.
INSTANCE
.
tintDrawable
(
userStatusDrawable
,
context
,
R
.
color
.
color_user_status_offline
);
break
;
}
...
...
@@ -128,25 +130,6 @@ public class RoomToolbar extends Toolbar {
userStatusImage
.
setVisibility
(
VISIBLE
);
}
/**
* Wraps a drawable to be used for example for tinting.
* @param drawable The drawable to wrap.
* @see #tintDrawable(Drawable, int)
*/
private
void
wrapDrawable
(
Drawable
drawable
)
{
DrawableCompat
.
wrap
(
drawable
);
}
/**
* REMARK: You MUST always wrap the drawable before tint it.
* @param drawable The drawable to tint.
* @param color The color to tint the drawable.
* @see #wrapDrawable(Drawable)
*/
private
void
tintDrawable
(
Drawable
drawable
,
int
color
)
{
DrawableCompat
.
setTint
(
drawable
,
ContextCompat
.
getColor
(
getContext
(),
color
));
}
public
void
setUnreadBudge
(
int
numUnreadChannels
,
int
numMentionsSum
)
{
if
(
getNavigationIcon
()
==
null
)
{
return
;
...
...
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