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
c160213e
Commit
c160213e
authored
Sep 19, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomListFragment.kt
parent
2f0fbf84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
RoomListFragment.kt
...rocket/android/fragment/chatroom/list/RoomListFragment.kt
+15
-6
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/list/RoomListFragment.kt
View file @
c160213e
...
...
@@ -22,6 +22,7 @@ class RoomListFragment : Fragment(), RoomListContract.View {
lateinit
var
token
:
String
lateinit
var
userId
:
String
lateinit
var
presenter
:
RoomListPresenter
var
isDataRequested
:
Boolean
=
false
companion
object
{
fun
newInstance
(
actionId
:
Int
,
...
...
@@ -60,7 +61,14 @@ 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
()
if
(!
isDataRequested
)
{
requestData
()
isDataRequested
=
true
}
}
private
fun
requestData
()
{
...
...
@@ -111,36 +119,37 @@ class RoomListFragment : Fragment(), RoomListContract.View {
}
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
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_
favorite
_message_to_show
))
}
else
{
waitingView
.
visibility
=
View
.
GONE
recyclerView
.
adapter
=
RoomMessagesAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
}
}
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>)
{
waitingView
.
visibility
=
View
.
GONE
if
(
dataSet
.
isEmpty
())
{
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_f
avorite_message
_to_show
))
showMessage
(
getString
(
R
.
string
.
fragment_room_list_no_f
ile_list
_to_show
))
}
else
{
waitingView
.
visibility
=
View
.
GONE
recyclerView
.
adapter
=
RoomFileListAdapter
(
dataSet
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
}
}
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
{
waitingView
.
visibility
=
View
.
GONE
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
,
hostname
,
context
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
}
}
override
fun
showMessage
(
message
:
String
)
{
waitingView
.
visibility
=
View
.
GONE
messageText
.
text
=
message
messageText
.
visibility
=
View
.
VISIBLE
}
...
...
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