Refine back navigation for main activity

This commit is contained in:
Mygod
2016-12-24 22:49:34 +08:00
parent cceb4ad9d7
commit 7de4a01db2
@@ -448,7 +448,10 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
}
override def onBackPressed(): Unit =
if (currentFragment != profilesFragment) displayFragment(profilesFragment) else super.onBackPressed()
if (drawer.isDrawerOpen) drawer.closeDrawer() else if (currentFragment != profilesFragment) {
displayFragment(profilesFragment)
drawer.setSelection(DRAWER_PROFILES)
} else super.onBackPressed()
override def onStop() {
super.onStop()