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
7a1137be
Commit
7a1137be
authored
Sep 19, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomListPresenter.kt
parent
68f894ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
RoomListPresenter.kt
...ocket/android/fragment/chatroom/list/RoomListPresenter.kt
+4
-3
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/list/RoomListPresenter.kt
View file @
7a1137be
...
@@ -6,6 +6,7 @@ import android.util.Log
...
@@ -6,6 +6,7 @@ import android.util.Log
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.api.rest.RestApiHelper
import
chat.rocket.android.api.rest.RestApiHelper
import
chat.rocket.android.helper.OkHttpHelper
import
chat.rocket.android.helper.OkHttpHelper
import
chat.rocket.android.helper.UrlHelper
import
chat.rocket.core.SyncState
import
chat.rocket.core.SyncState
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.User
import
chat.rocket.core.models.User
...
@@ -182,8 +183,6 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View):
...
@@ -182,8 +183,6 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View):
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
if
(
response
.
isSuccessful
)
{
if
(
response
.
isSuccessful
)
{
val
jSONObject
=
JSONObject
(
response
.
body
()
?.
string
())
val
jSONObject
=
JSONObject
(
response
.
body
()
?.
string
())
Log
.
i
(
"REST"
,
"= "
+
jSONObject
)
val
filesJSONArray
=
jSONObject
.
get
(
"files"
)
as
JSONArray
val
filesJSONArray
=
jSONObject
.
get
(
"files"
)
as
JSONArray
val
filesJSONArrayLength
=
filesJSONArray
.
length
()
val
filesJSONArrayLength
=
filesJSONArray
.
length
()
...
@@ -199,7 +198,9 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View):
...
@@ -199,7 +198,9 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View):
}
}
val
pathJSONArrayLength
=
pathJSONArray
.
length
()
val
pathJSONArrayLength
=
pathJSONArray
.
length
()
val
dataSet
=
ArrayList
<
String
>(
pathJSONArrayLength
)
val
dataSet
=
ArrayList
<
String
>(
pathJSONArrayLength
)
(
0
until
pathJSONArrayLength
).
mapTo
(
dataSet
)
{
pathJSONArray
.
get
(
it
).
toString
()
}
(
0
until
pathJSONArrayLength
).
mapTo
(
dataSet
)
{
UrlHelper
.
getUrlForFile
(
pathJSONArray
.
get
(
it
).
toString
(),
userId
,
token
)
}
mainHandler
.
post
{
view
.
showFileList
(
dataSet
)
}
mainHandler
.
post
{
view
.
showFileList
(
dataSet
)
}
}
else
{
}
else
{
...
...
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