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
4a29236c
Commit
4a29236c
authored
Nov 28, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix back-key behavior
parent
39fbcb80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+1
-1
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+9
-2
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
4a29236c
...
@@ -54,7 +54,7 @@ public class MainActivity extends AbstractAuthedActivity {
...
@@ -54,7 +54,7 @@ public class MainActivity extends AbstractAuthedActivity {
private
boolean
closeSidebarIfNeeded
()
{
private
boolean
closeSidebarIfNeeded
()
{
// REMARK: Tablet UI doesn't have SlidingPane!
// REMARK: Tablet UI doesn't have SlidingPane!
SlidingPaneLayout
pane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sliding_pane
);
SlidingPaneLayout
pane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sliding_pane
);
if
(
pane
!=
null
&&
pane
.
isOpen
())
{
if
(
pane
!=
null
&&
pane
.
is
Slideable
()
&&
pane
.
is
Open
())
{
pane
.
closePane
();
pane
.
closePane
();
return
true
;
return
true
;
}
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
4a29236c
...
@@ -12,6 +12,7 @@ import android.widget.Toast;
...
@@ -12,6 +12,7 @@ import android.widget.Toast;
import
chat.rocket.android.R
;
import
chat.rocket.android.R
;
import
chat.rocket.android.helper.LoadMoreScrollListener
;
import
chat.rocket.android.helper.LoadMoreScrollListener
;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.SyncState
;
import
chat.rocket.android.model.SyncState
;
...
@@ -31,7 +32,7 @@ import timber.log.Timber;
...
@@ -31,7 +32,7 @@ import timber.log.Timber;
/**
/**
* Chat room screen.
* Chat room screen.
*/
*/
public
class
RoomFragment
extends
AbstractChatRoomFragment
{
public
class
RoomFragment
extends
AbstractChatRoomFragment
implements
OnBackPressListener
{
private
RealmHelper
realmHelper
;
private
RealmHelper
realmHelper
;
private
String
roomId
;
private
String
roomId
;
...
@@ -131,11 +132,13 @@ public class RoomFragment extends AbstractChatRoomFragment {
...
@@ -131,11 +132,13 @@ public class RoomFragment extends AbstractChatRoomFragment {
}
}
}
}
private
void
closeSideMenuIfNeeded
()
{
private
boolean
closeSideMenuIfNeeded
()
{
DrawerLayout
drawerLayout
=
(
DrawerLayout
)
rootView
.
findViewById
(
R
.
id
.
drawer_layout
);
DrawerLayout
drawerLayout
=
(
DrawerLayout
)
rootView
.
findViewById
(
R
.
id
.
drawer_layout
);
if
(
drawerLayout
!=
null
&&
drawerLayout
.
isDrawerOpen
(
GravityCompat
.
END
))
{
if
(
drawerLayout
!=
null
&&
drawerLayout
.
isDrawerOpen
(
GravityCompat
.
END
))
{
drawerLayout
.
closeDrawer
(
GravityCompat
.
END
);
drawerLayout
.
closeDrawer
(
GravityCompat
.
END
);
return
true
;
}
}
return
false
;
}
}
private
void
onRenderRoom
(
RoomSubscription
roomSubscription
)
{
private
void
onRenderRoom
(
RoomSubscription
roomSubscription
)
{
...
@@ -208,4 +211,8 @@ public class RoomFragment extends AbstractChatRoomFragment {
...
@@ -208,4 +211,8 @@ public class RoomFragment extends AbstractChatRoomFragment {
roomObserver
.
unsub
();
roomObserver
.
unsub
();
super
.
onPause
();
super
.
onPause
();
}
}
@Override
public
boolean
onBackPressed
()
{
return
closeSideMenuIfNeeded
();
}
}
}
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