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
2188241b
Commit
2188241b
authored
Feb 27, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Drawable tinting
parent
98812bdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
ChatRoomActivity.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
+1
-0
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+17
-4
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
View file @
2188241b
...
@@ -6,6 +6,7 @@ import android.content.Intent
...
@@ -6,6 +6,7 @@ import android.content.Intent
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.Drawable
import
android.os.Bundle
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v4.app.Fragment
import
android.support.v7.app.AppCompatActivity
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.util.extensions.addFragment
import
chat.rocket.android.util.extensions.addFragment
import
chat.rocket.android.util.extensions.textContent
import
chat.rocket.android.util.extensions.textContent
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
2188241b
...
@@ -3,6 +3,7 @@ package chat.rocket.android.chatrooms.ui
...
@@ -3,6 +3,7 @@ package chat.rocket.android.chatrooms.ui
import
DateTimeHelper
import
DateTimeHelper
import
DrawableHelper
import
DrawableHelper
import
android.content.Context
import
android.content.Context
import
android.graphics.drawable.Drawable
import
android.support.v4.content.ContextCompat
import
android.support.v4.content.ContextCompat
import
android.support.v7.widget.RecyclerView
import
android.support.v7.widget.RecyclerView
import
android.view.View
import
android.view.View
...
@@ -70,18 +71,30 @@ class ChatRoomsAdapter(private val context: Context,
...
@@ -70,18 +71,30 @@ class ChatRoomsAdapter(private val context: Context,
}
}
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
textView
.
textContent
=
chatRoom
.
name
var
drawable
:
Drawable
?
=
null
when
(
chatRoom
.
type
)
{
when
(
chatRoom
.
type
)
{
is
RoomType
.
Channel
->
{
is
RoomType
.
Channel
->
{
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_channel
,
context
)
)
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_channel
,
context
)
}
}
is
RoomType
.
PrivateGroup
->
{
is
RoomType
.
PrivateGroup
->
{
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
context
)
)
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
context
)
}
}
is
RoomType
.
DirectMessage
->
{
is
RoomType
.
DirectMessage
->
{
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_dm
,
context
)
)
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_dm
,
context
)
}
}
}
}
textView
.
textContent
=
chatRoom
.
name
drawable
?.
let
{
DrawableHelper
.
wrapDrawable
(
it
)
DrawableHelper
.
tintDrawable
(
it
,
context
,
when
(
chatRoom
.
alert
||
chatRoom
.
unread
>
0
)
{
true
->
R
.
color
.
colorPrimaryText
false
->
R
.
color
.
colorSecondaryText
})
DrawableHelper
.
compoundDrawable
(
textView
,
it
)
}
}
}
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
private
fun
bindLastMessageDateTime
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
...
...
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