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
2093a1a7
Commit
2093a1a7
authored
Sep 29, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomListFragment.kt
parent
63eeb947
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
RoomListFragment.kt
...rocket/android/fragment/chatroom/list/RoomListFragment.kt
+27
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/list/RoomListFragment.kt
View file @
2093a1a7
...
...
@@ -9,8 +9,10 @@ import android.view.View
import
android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.helper.EndlessRecyclerViewScrollListener
import
chat.rocket.android.layouthelper.chatroom.list.RoomFileListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomMemberListAdapter
import
chat.rocket.android.layouthelper.chatroom.list.RoomMessagesAdapter
import
chat.rocket.core.models.Attachment
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.User
import
kotlinx.android.synthetic.main.fragment_room_list.*
...
...
@@ -84,6 +86,14 @@ class RoomListFragment : Fragment(), RoomListContract.View {
userId
,
offset
)
}
R
.
id
.
action_file_list
->
{
presenter
.
requestFileList
(
roomId
,
roomType
,
hostname
,
token
,
userId
,
offset
)
}
R
.
id
.
action_favorite_messages
->
{
presenter
.
requestFavoriteMessages
(
roomId
,
roomType
,
...
...
@@ -139,8 +149,23 @@ class RoomListFragment : Fragment(), RoomListContract.View {
}
}
// TODO (after REST api fixes)
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>,
total
:
String
)
{}
override
fun
showFileList
(
dataSet
:
ArrayList
<
Attachment
>,
total
:
String
)
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_file_list_title
,
total
)
if
(
recyclerView
.
adapter
==
null
)
{
recyclerView
.
adapter
=
RoomFileListAdapter
(
dataSet
)
val
linearLayoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
recyclerView
.
layoutManager
=
linearLayoutManager
if
(
dataSet
.
size
>=
50
)
{
recyclerView
.
addOnScrollListener
(
object
:
EndlessRecyclerViewScrollListener
(
linearLayoutManager
)
{
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
recyclerView
:
RecyclerView
?)
{
loadNextDataFromApi
(
page
)
}
})
}
}
else
{
(
recyclerView
.
adapter
as
RoomFileListAdapter
).
addDataSet
(
dataSet
)
}
}
override
fun
showMemberList
(
dataSet
:
ArrayList
<
User
>,
total
:
String
)
{
activity
.
title
=
getString
(
R
.
string
.
fragment_room_list_member_list_title
,
total
)
...
...
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