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
cdb9ad25
Commit
cdb9ad25
authored
Dec 27, 2017
by
Aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes typo in pinned messages fragment
parent
bc498fc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+1
-1
RoomListPresenter.kt
...ocket/android/fragment/chatroom/list/RoomListPresenter.kt
+10
-5
strings.xml
app/src/main/res/values/strings.xml
+2
-2
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
cdb9ad25
...
@@ -94,7 +94,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -94,7 +94,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
}
else
{
}
else
{
connectivityManager
.
keepAliveServer
();
connectivityManager
.
keepAliveServer
();
presenter
.
bindView
(
this
);
presenter
.
bindView
(
this
);
presenter
.
loadSignedInServers
(
hostname
);
//
presenter.loadSignedInServers(hostname);
roomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
roomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/list/RoomListPresenter.kt
View file @
cdb9ad25
...
@@ -23,13 +23,14 @@ import java.sql.Timestamp
...
@@ -23,13 +23,14 @@ import java.sql.Timestamp
* Created by Filipe de Lima Brito (filipedelimabrito@gmail.com) on 9/22/17.
* Created by Filipe de Lima Brito (filipedelimabrito@gmail.com) on 9/22/17.
*/
*/
class
RoomListPresenter
(
val
context
:
Context
,
val
view
:
RoomListContract
.
View
)
:
RoomListContract
.
Presenter
{
class
RoomListPresenter
(
val
context
:
Context
,
val
view
:
RoomListContract
.
View
)
:
RoomListContract
.
Presenter
{
private
lateinit
var
TAG
:
String
override
fun
requestPinnedMessages
(
roomId
:
String
,
override
fun
requestPinnedMessages
(
roomId
:
String
,
roomType
:
String
,
roomType
:
String
,
hostname
:
String
,
hostname
:
String
,
token
:
String
,
token
:
String
,
userId
:
String
,
userId
:
String
,
offset
:
Int
)
{
offset
:
Int
)
{
TAG
=
"pinned"
view
.
showWaitingView
(
true
)
view
.
showWaitingView
(
true
)
OkHttpHelper
.
getClient
()
OkHttpHelper
.
getClient
()
.
newCall
(
RestApiHelper
.
getRequestForPinnedMessages
(
roomId
,
.
newCall
(
RestApiHelper
.
getRequestForPinnedMessages
(
roomId
,
...
@@ -53,7 +54,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
...
@@ -53,7 +54,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
if
(
response
.
isSuccessful
)
{
if
(
response
.
isSuccessful
)
{
val
result
=
response
.
body
()
?.
string
()
val
result
=
response
.
body
()
?.
string
()
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
handleMessagesJson
(
result
,
true
)
handleMessagesJson
(
result
,
true
,
TAG
)
}
}
}
else
{
}
else
{
showErrorMessage
(
response
.
message
())
showErrorMessage
(
response
.
message
())
...
@@ -68,6 +69,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
...
@@ -68,6 +69,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
token
:
String
,
token
:
String
,
userId
:
String
,
userId
:
String
,
offset
:
Int
)
{
offset
:
Int
)
{
TAG
=
"favorite"
view
.
showWaitingView
(
true
)
view
.
showWaitingView
(
true
)
OkHttpHelper
.
getClient
()
OkHttpHelper
.
getClient
()
.
newCall
(
RestApiHelper
.
getRequestForFavoriteMessages
(
roomId
,
.
newCall
(
RestApiHelper
.
getRequestForFavoriteMessages
(
roomId
,
...
@@ -91,7 +93,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
...
@@ -91,7 +93,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
if
(
response
.
isSuccessful
)
{
if
(
response
.
isSuccessful
)
{
val
result
=
response
.
body
()
?.
string
()
val
result
=
response
.
body
()
?.
string
()
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
handleMessagesJson
(
result
,
false
)
handleMessagesJson
(
result
,
false
,
TAG
)
}
}
}
else
{
}
else
{
showErrorMessage
(
response
.
message
())
showErrorMessage
(
response
.
message
())
...
@@ -180,7 +182,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
...
@@ -180,7 +182,7 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
OkHttpHelper
.
getClient
().
dispatcher
().
cancelAll
()
OkHttpHelper
.
getClient
().
dispatcher
().
cancelAll
()
}
}
private
fun
handleMessagesJson
(
json
:
String
,
isPinnedMessage
:
Boolean
)
{
private
fun
handleMessagesJson
(
json
:
String
,
isPinnedMessage
:
Boolean
,
TAG
:
String
)
{
try
{
try
{
val
jSONObject
=
JSONObject
(
json
)
val
jSONObject
=
JSONObject
(
json
)
val
messagesJSONArray
=
jSONObject
.
getJSONArray
(
"messages"
)
val
messagesJSONArray
=
jSONObject
.
getJSONArray
(
"messages"
)
...
@@ -204,7 +206,10 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
...
@@ -204,7 +206,10 @@ class RoomListPresenter(val context: Context, val view: RoomListContract.View) :
}
}
if
(
dataSet
.
isEmpty
()
&&
!
hasItem
)
{
if
(
dataSet
.
isEmpty
()
&&
!
hasItem
)
{
showEmptyViewMessage
(
context
.
getString
(
R
.
string
.
fragment_room_list_no_favorite_message_to_show
))
if
(
TAG
.
equals
(
"favorite"
))
showEmptyViewMessage
(
context
.
getString
(
R
.
string
.
fragment_room_list_no_favorite_message_to_show
))
else
if
(
TAG
.
equals
(
"pinned"
))
showEmptyViewMessage
(
context
.
getString
(
R
.
string
.
fragment_room_list_no_pinned_message_to_show
))
}
else
{
}
else
{
if
(
dataSet
.
isNotEmpty
())
{
if
(
dataSet
.
isNotEmpty
())
{
hasItem
=
true
hasItem
=
true
...
...
app/src/main/res/values/strings.xml
View file @
cdb9ad25
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
<string
name=
"fragment_room_list_file_list_title"
>
File list (%s)
</string>
<string
name=
"fragment_room_list_file_list_title"
>
File list (%s)
</string>
<string
name=
"fragment_room_list_member_list_title"
>
Member list (%s)
</string>
<string
name=
"fragment_room_list_member_list_title"
>
Member list (%s)
</string>
<string
name=
"fragment_room_list_could_not_load_your_request"
>
Could not load your request.\n%s.
</string>
<string
name=
"fragment_room_list_could_not_load_your_request"
>
Could not load your request.\n%s.
</string>
<string
name=
"fragment_room_list_no_pinned_message_to_show"
>
No pinned message to show
</string>
<string
name=
"fragment_room_list_no_pinned_message_to_show"
>
No pinned message
s
to show
</string>
<string
name=
"fragment_room_list_no_favorite_message_to_show"
>
No favorite message to show
</string>
<string
name=
"fragment_room_list_no_favorite_message_to_show"
>
No favorite message
s
to show
</string>
<string
name=
"fragment_room_list_no_file_list_to_show"
>
No file list to show
</string>
<string
name=
"fragment_room_list_no_file_list_to_show"
>
No file list to show
</string>
<string
name=
"fragment_room_list_no_member_list_to_show"
>
No member list to show
</string>
<string
name=
"fragment_room_list_no_member_list_to_show"
>
No member list to show
</string>
...
...
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