mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
pressing back should close drawer.
This commit is contained in:
parent
0e2055f34d
commit
be4a479c56
@ -237,10 +237,25 @@ public abstract class BaseActivity<V extends BaseMvp.FAView, P extends BasePrese
|
||||
} else if (item.getItemId() == R.id.pinnedMenu) {
|
||||
PinnedReposActivity.startActivity(this);
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.mainView) {
|
||||
Intent intent = new Intent(this, MainView.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
finishAffinity();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public void onBackPressed() {
|
||||
if (drawer == null || !drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
super.onBackPressed();
|
||||
} else if (drawer != null && drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
protected void showNavToRepoItem() {
|
||||
if (extraNav != null) {
|
||||
extraNav.getMenu().findItem(R.id.navToRepo).setVisible(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user