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
Show 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
...
@@ -9,7 +9,7 @@ import android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.layouthelper.chatroom.list.RoomFileListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomFileListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomMemberListAdapter
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.Message
import
chat.rocket.core.models.User
import
chat.rocket.core.models.User
import
kotlinx.android.synthetic.main.fragment_room_list.*
import
kotlinx.android.synthetic.main.fragment_room_list.*
...
@@ -60,12 +60,13 @@ class RoomListFragment : Fragment(), RoomListContract.View {
...
@@ -60,12 +60,13 @@ class RoomListFragment : Fragment(), RoomListContract.View {
override
fun
onViewCreated
(
view
:
View
?,
savedInstanceState
:
Bundle
?)
{
override
fun
onViewCreated
(
view
:
View
?,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
super
.
onViewCreated
(
view
,
savedInstanceState
)
presenter
=
RoomListPresenter
(
context
,
this
)
presenter
=
RoomListPresenter
(
context
,
this
)
requestData
()
}
}
override
fun
onResume
()
{
private
fun
requestData
()
{
super
.
onResume
()
when
(
actionId
)
{
when
(
actionId
)
{
R
.
id
.
action_pinned_messages
->
{
R
.
id
.
action_pinned_messages
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_pinned_message_title
)
presenter
.
requestPinnedMessages
(
roomId
,
presenter
.
requestPinnedMessages
(
roomId
,
roomType
,
roomType
,
hostname
,
hostname
,
...
@@ -73,6 +74,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
...
@@ -73,6 +74,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
userId
)
}
}
R
.
id
.
action_favorite_messages
->
{
R
.
id
.
action_favorite_messages
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_favorite_message_title
)
presenter
.
requestFavoriteMessages
(
roomId
,
presenter
.
requestFavoriteMessages
(
roomId
,
roomType
,
roomType
,
hostname
,
hostname
,
...
@@ -80,6 +82,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
...
@@ -80,6 +82,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
userId
)
}
}
R
.
id
.
action_file_list
->
{
R
.
id
.
action_file_list
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_file_list_title
)
presenter
.
requestFileList
(
roomId
,
presenter
.
requestFileList
(
roomId
,
roomType
,
roomType
,
hostname
,
hostname
,
...
@@ -87,6 +90,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
...
@@ -87,6 +90,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
)
userId
)
}
}
R
.
id
.
action_member_list
->
{
R
.
id
.
action_member_list
->
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_member_list_title
)
presenter
.
requestMemberList
(
roomId
,
presenter
.
requestMemberList
(
roomId
,
roomType
,
roomType
,
hostname
,
hostname
,
...
@@ -97,38 +101,42 @@ class RoomListFragment : Fragment(), RoomListContract.View {
...
@@ -97,38 +101,42 @@ class RoomListFragment : Fragment(), RoomListContract.View {
}
}
override
fun
showPinnedMessages
(
dataSet
:
ArrayList
<
Message
>)
{
override
fun
showPinnedMessages
(
dataSet
:
ArrayList
<
Message
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
}
else
{
}
else
{
recyclerView
.
adapter
=
Room
PinnedMessagesAdapter
(
dataSet
,
hostname
)
recyclerView
.
adapter
=
Room
MessagesAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
}
}
override
fun
showFavoriteMessages
(
dataSet
:
ArrayList
<
Message
>)
{
override
fun
showFavoriteMessages
(
dataSet
:
ArrayList
<
Message
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
}
else
{
}
else
{
recyclerView
.
adapter
=
Room
PinnedMessagesAdapter
(
dataSet
,
hostname
)
recyclerView
.
adapter
=
Room
MessagesAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
fals
e
)
}
}
}
}
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>)
{
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_favorite_message_to_show
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_favorite_message_to_show
))
}
else
{
}
else
{
recyclerView
.
adapter
=
RoomFileListAdapter
(
dataSet
)
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
>)
{
override
fun
showMemberList
(
dataSet
:
ArrayList
<
User
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_member_list_to_show
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_member_list_to_show
))
}
else
{
}
else
{
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
)
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
tru
e
)
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