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
56422eca
Commit
56422eca
authored
Feb 24, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add room-type in room-name
parent
8bab94e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
ChatRoomActivity.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
+20
-1
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+16
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
View file @
56422eca
package
chat.rocket.android.chatroom.ui
import
DrawableHelper
import
android.content.Context
import
android.content.Intent
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.app.AppCompatActivity
import
chat.rocket.android.R
import
chat.rocket.android.util.extensions.addFragment
import
chat.rocket.android.util.extensions.textContent
import
chat.rocket.common.model.RoomType
import
dagger.android.AndroidInjection
import
dagger.android.AndroidInjector
import
dagger.android.DispatchingAndroidInjector
...
...
@@ -73,6 +74,24 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
setSupportActionBar
(
toolbar
)
supportActionBar
?.
setDisplayShowTitleEnabled
(
false
)
text_room_name
.
textContent
=
chatRoomName
when
(
chatRoomType
)
{
RoomType
.
CHANNEL
.
toString
()
->
{
text_room_name
.
textContent
=
"#"
+
chatRoomName
}
RoomType
.
PRIVATE_GROUP
.
toString
()
->
{
val
drawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_lock_black_24dp
,
this
)
DrawableHelper
.
wrapDrawable
(
drawable
)
DrawableHelper
.
tintDrawable
(
drawable
,
this
,
R
.
color
.
white
)
DrawableHelper
.
compoundDrawable
(
text_room_name
,
drawable
)
text_room_name
.
textContent
=
chatRoomName
}
RoomType
.
DIRECT_MESSAGE
.
toString
()
->
{
text_room_name
.
textContent
=
"@"
+
chatRoomName
}
else
->
{
text_room_name
.
textContent
=
chatRoomName
}
}
toolbar
.
setNavigationOnClickListener
{
finishActivity
()
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
56422eca
package
chat.rocket.android.chatrooms.ui
import
DateTimeHelper
import
DrawableHelper
import
android.content.Context
import
android.support.v4.content.ContextCompat
import
android.support.v7.widget.RecyclerView
...
...
@@ -69,7 +70,21 @@ class ChatRoomsAdapter(private val context: Context,
}
private
fun
bindName
(
chatRoom
:
ChatRoom
,
textView
:
TextView
)
{
textView
.
content
=
chatRoom
.
name
when
(
chatRoom
.
type
)
{
is
RoomType
.
Channel
->
{
textView
.
textContent
=
"#"
+
chatRoom
.
name
}
is
RoomType
.
PrivateGroup
->
{
DrawableHelper
.
compoundDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_lock_black_24dp
,
context
))
textView
.
textContent
=
chatRoom
.
name
}
is
RoomType
.
DirectMessage
->
{
textView
.
textContent
=
"@"
+
chatRoom
.
name
}
else
->
{
textView
.
textContent
=
chatRoom
.
name
}
}
}
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