Skip to content

Commit

Permalink
Merge pull request #13448 from nextcloud/backport/13415/stable-3.29
Browse files Browse the repository at this point in the history
[stable-3.29] BugFix - Preserve Selected Drawer Tab State When App Returns to Foreground
  • Loading branch information
AndyScherzinger authored Aug 26, 2024
2 parents c4ca457 + e78f48a commit 92d0d9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ private void setupDrawerMenu(NavigationView navigationView) {
return true;
});


User account = accountManager.getUser();
filterDrawerMenu(navigationView.getMenu(), account);
}
Expand Down Expand Up @@ -1050,6 +1051,10 @@ protected void onPostCreate(Bundle savedInstanceState) {
updateQuotaLink();
}

public int getCheckedMenuItem() {
return mCheckedMenuItem;
}

@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,12 @@ private void setDrawerAllFiles() {
setDrawerMenuItemChecked(R.id.nav_on_device);
setupToolbar();
} else {
setDrawerMenuItemChecked(R.id.nav_all_files);
int lastMenuItem = getCheckedMenuItem();
if (lastMenuItem == Menu.NONE) {
lastMenuItem = R.id.nav_all_files;
}

setDrawerMenuItemChecked(lastMenuItem);
setupHomeSearchToolbarWithSortAndListButtons();
}
}
Expand Down

0 comments on commit 92d0d9f

Please sign in to comment.