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
32f56c75
Commit
32f56c75
authored
Sep 18, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomListFragment.kt
parent
7444b8ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
RoomListFragment.kt
...rocket/android/fragment/chatroom/list/RoomListFragment.kt
+18
-10
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/list/RoomListFragment.kt
View file @
32f56c75
...
...
@@ -9,7 +9,7 @@ import android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.layouthelper.chatroom.list.RoomFileListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomMemberListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.Room
Pinned
MessagesAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomMessagesAdapter
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.User
import
kotlinx.android.synthetic.main.fragment_room_list.*
...
...
@@ -60,12 +60,13 @@ class RoomListFragment : Fragment(), RoomListContract.View {
override
fun
onViewCreated
(
view
:
View
?,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
presenter
=
RoomListPresenter
(
context
,
this
)
requestData
()
}
override
fun
onResume
()
{
super
.
onResume
()
private
fun
requestData
()
{
when
(
actionId
)
{
R
.
id
.
action_pinned_messages
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_pinned_message_title
)
presenter
.
requestPinnedMessages
(
roomId
,
roomType
,
hostname
,
...
...
@@ -73,6 +74,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
}
R
.
id
.
action_favorite_messages
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_favorite_message_title
)
presenter
.
requestFavoriteMessages
(
roomId
,
roomType
,
hostname
,
...
...
@@ -80,6 +82,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
}
R
.
id
.
action_file_list
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_file_list_title
)
presenter
.
requestFileList
(
roomId
,
roomType
,
hostname
,
...
...
@@ -87,6 +90,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
}
R
.
id
.
action_member_list
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_member_list_title
)
presenter
.
requestMemberList
(
roomId
,
roomType
,
hostname
,
...
...
@@ -97,38 +101,42 @@ class RoomListFragment : Fragment(), RoomListContract.View {
}
override
fun
showPinnedMessages
(
dataSet
:
ArrayList
<
Message
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
}
else
{
recyclerView
.
adapter
=
Room
PinnedMessagesAdapter
(
dataSet
,
hostname
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
adapter
=
Room
MessagesAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
override
fun
showFavoriteMessages
(
dataSet
:
ArrayList
<
Message
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
}
else
{
recyclerView
.
adapter
=
Room
PinnedMessagesAdapter
(
dataSet
,
hostname
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
adapter
=
Room
MessagesAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_favorite_message_to_show
))
}
else
{
recyclerView
.
adapter
=
RoomFileListAdapter
(
dataSet
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
override
fun
showMemberList
(
dataSet
:
ArrayList
<
User
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_member_list_to_show
))
}
else
{
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
...
...
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