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
5b60ea7a
Commit
5b60ea7a
authored
Oct 03, 2017
by
Rafael Kellermann Streit
Committed by
GitHub
Oct 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #504 from RocketChat/fix/issue-59d07b3abe077a4dcc8dd244
Multiple minor issues fixes
parents
8d985b42
5f3d17ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
44 deletions
+60
-44
DDPClientImpl.java
.../src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
+9
-6
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+7
-7
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+42
-30
SidebarMainFragment.java
.../rocket/android/fragment/sidebar/SidebarMainFragment.java
+2
-1
No files found.
android-ddp/src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
View file @
5b60ea7a
...
...
@@ -174,7 +174,7 @@ public class DDPClientImpl {
disposables
.
clear
();
}
},
err
->
task
.
s
etError
(
new
DDPClientCallback
.
Ping
.
Timeout
(
client
))
err
->
task
.
tryS
etError
(
new
DDPClientCallback
.
Ping
.
Timeout
(
client
))
)
);
...
...
@@ -213,7 +213,7 @@ public class DDPClientImpl {
"error"
))
{
String
_id
=
response
.
optString
(
"id"
);
if
(
id
.
equals
(
_id
))
{
task
.
s
etError
(
new
DDPSubscription
.
NoSub
.
Error
(
client
,
id
,
task
.
tryS
etError
(
new
DDPSubscription
.
NoSub
.
Error
(
client
,
id
,
response
.
optJSONObject
(
"error"
)));
disposables
.
clear
();
}
...
...
@@ -284,7 +284,7 @@ public class DDPClientImpl {
String
_id
=
response
.
optString
(
"id"
);
if
(
id
.
equals
(
_id
))
{
if
(!
response
.
isNull
(
"error"
))
{
task
.
s
etError
(
new
DDPClientCallback
.
RPC
.
Error
(
client
,
id
,
task
.
tryS
etError
(
new
DDPClientCallback
.
RPC
.
Error
(
client
,
id
,
response
.
optJSONObject
(
"error"
)));
}
else
{
String
result
=
response
.
optString
(
"result"
);
...
...
@@ -296,7 +296,7 @@ public class DDPClientImpl {
},
err
->
{
if
(
err
instanceof
TimeoutException
)
{
task
.
s
etError
(
new
DDPClientCallback
.
RPC
.
Timeout
(
client
));
task
.
tryS
etError
(
new
DDPClientCallback
.
RPC
.
Timeout
(
client
));
}
}
)
...
...
@@ -427,7 +427,7 @@ public class DDPClientImpl {
}
},
err
->
{
task
.
trySetError
(
new
Exception
(
err
));
setTaskError
(
task
,
new
Exception
(
err
));
disposables
.
clear
();
}
)
...
...
@@ -442,7 +442,10 @@ public class DDPClientImpl {
}
}
private
void
setTaskError
(
TaskCompletionSource
<?
extends
RxWebSocketCallback
.
Base
>
task
,
Throwable
throwable
)
{
private
void
setTaskError
(
TaskCompletionSource
task
,
Throwable
throwable
)
{
if
(
task
.
getTask
().
isCompleted
())
{
return
;
}
if
(
throwable
instanceof
Exception
)
{
task
.
setError
((
Exception
)
throwable
);
}
else
{
...
...
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
5b60ea7a
...
...
@@ -121,14 +121,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
}
}
});
}
if
(
toolbar
!=
null
)
{
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
pane
.
openPane
();
}
});
if
(
toolbar
!=
null
)
{
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
pane
.
openPane
();
}
});
}
}
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
5b60ea7a
...
...
@@ -34,6 +34,7 @@ import chat.rocket.android.fragment.sidebar.SidebarMainFragment;
import
chat.rocket.android.helper.AbsoluteUrlHelper
;
import
chat.rocket.android.helper.FileUploadHelper
;
import
chat.rocket.android.helper.LoadMoreScrollListener
;
import
chat.rocket.android.helper.Logger
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.helper.RecyclerViewAutoScrollManager
;
import
chat.rocket.android.helper.RecyclerViewScrolledToBottomListener
;
...
...
@@ -49,6 +50,7 @@ import chat.rocket.android.layouthelper.extra_action.upload.AbstractUploadAction
import
chat.rocket.android.layouthelper.extra_action.upload.AudioUploadActionItem
;
import
chat.rocket.android.layouthelper.extra_action.upload.ImageUploadActionItem
;
import
chat.rocket.android.layouthelper.extra_action.upload.VideoUploadActionItem
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.renderer.RocketChatUserStatusProvider
;
import
chat.rocket.android.service.ConnectivityManager
;
import
chat.rocket.android.service.temp.DeafultTempSpotlightRoomCaller
;
...
...
@@ -340,28 +342,30 @@ public class RoomFragment extends AbstractChatRoomFragment implements
SlidingPaneLayout
subPane
=
getActivity
().
findViewById
(
R
.
id
.
sub_sliding_pane
);
sidebarFragment
=
(
SidebarMainFragment
)
getActivity
().
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
sidebar_fragment_container
);
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
PanelSlideListener
()
{
@Override
public
void
onPanelSlide
(
View
view
,
float
v
)
{
messageFormManager
.
enableComposingText
(
false
);
sidebarFragment
.
clearSearchViewFocus
();
//Ref: ActionBarDrawerToggle#setProgress
toolbar
.
setNavigationIconProgress
(
v
);
}
if
(
pane
!=
null
)
{
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
PanelSlideListener
()
{
@Override
public
void
onPanelSlide
(
View
view
,
float
v
)
{
messageFormManager
.
enableComposingText
(
false
);
sidebarFragment
.
clearSearchViewFocus
();
//Ref: ActionBarDrawerToggle#setProgress
toolbar
.
setNavigationIconProgress
(
v
);
}
@Override
public
void
onPanelOpened
(
View
view
)
{
toolbar
.
setNavigationIconVerticalMirror
(
true
);
}
@Override
public
void
onPanelOpened
(
View
view
)
{
toolbar
.
setNavigationIconVerticalMirror
(
true
);
}
@Override
public
void
onPanelClosed
(
View
view
)
{
messageFormManager
.
enableComposingText
(
true
);
toolbar
.
setNavigationIconVerticalMirror
(
false
);
subPane
.
closePane
();
closeUserActionContainer
();
}
});
@Override
public
void
onPanelClosed
(
View
view
)
{
messageFormManager
.
enableComposingText
(
true
);
toolbar
.
setNavigationIconVerticalMirror
(
false
);
subPane
.
closePane
();
closeUserActionContainer
();
}
});
}
}
public
void
closeUserActionContainer
()
{
...
...
@@ -537,6 +541,8 @@ public class RoomFragment extends AbstractChatRoomFragment implements
try
{
inputContentInfo
.
releasePermission
();
}
catch
(
Exception
e
)
{
RCLog
.
e
(
e
);
Logger
.
report
(
e
);
}
return
true
;
...
...
@@ -552,9 +558,11 @@ public class RoomFragment extends AbstractChatRoomFragment implements
@Override
public
void
setupWith
(
RocketChatAbsoluteUrl
rocketChatAbsoluteUrl
)
{
token
=
rocketChatAbsoluteUrl
.
getToken
();
userId
=
rocketChatAbsoluteUrl
.
getUserId
();
messageListAdapter
.
setAbsoluteUrl
(
rocketChatAbsoluteUrl
);
if
(
rocketChatAbsoluteUrl
!=
null
)
{
token
=
rocketChatAbsoluteUrl
.
getToken
();
userId
=
rocketChatAbsoluteUrl
.
getUserId
();
messageListAdapter
.
setAbsoluteUrl
(
rocketChatAbsoluteUrl
);
}
}
@Override
...
...
@@ -657,12 +665,16 @@ public class RoomFragment extends AbstractChatRoomFragment implements
}
private
void
showRoomListFragment
(
int
actionId
)
{
Intent
intent
=
new
Intent
(
getActivity
(),
RoomActivity
.
class
).
putExtra
(
"actionId"
,
actionId
)
.
putExtra
(
"roomId"
,
roomId
)
.
putExtra
(
"roomType"
,
roomType
)
.
putExtra
(
"hostname"
,
hostname
)
.
putExtra
(
"token"
,
token
)
.
putExtra
(
"userId"
,
userId
);
startActivity
(
intent
);
//TODO: oddly sometimes getActivity() yields null. Investigate the situations this might happen
//and fix it, removing this null-check
if
(
getActivity
()
!=
null
)
{
Intent
intent
=
new
Intent
(
getActivity
(),
RoomActivity
.
class
).
putExtra
(
"actionId"
,
actionId
)
.
putExtra
(
"roomId"
,
roomId
)
.
putExtra
(
"roomType"
,
roomType
)
.
putExtra
(
"hostname"
,
hostname
)
.
putExtra
(
"token"
,
token
)
.
putExtra
(
"userId"
,
userId
);
startActivity
(
intent
);
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainFragment.java
View file @
5b60ea7a
...
...
@@ -19,6 +19,7 @@ import com.jakewharton.rxbinding2.support.v7.widget.RxSearchView;
import
com.jakewharton.rxbinding2.widget.RxCompoundButton
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
bolts.Task
;
...
...
@@ -58,7 +59,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
private
RoomListAdapter
adapter
;
private
SearchView
searchView
;
private
TextView
loadMoreResultsText
;
private
List
<
RoomSidebar
>
roomSidebarList
;
private
List
<
RoomSidebar
>
roomSidebarList
=
Collections
.
emptyList
()
;
private
Disposable
spotlightDisposable
;
private
String
hostname
;
private
static
final
String
HOSTNAME
=
"hostname"
;
...
...
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