From e78f48af5329b999f4ffc271830dd9f9330bb141 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 14 Aug 2024 14:00:31 +0200 Subject: [PATCH] Fix Signed-off-by: alperozturk --- .../com/owncloud/android/ui/activity/DrawerActivity.java | 5 +++++ .../owncloud/android/ui/activity/FileDisplayActivity.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index 98d03372eb1f..378fec5eb0f2 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -460,6 +460,7 @@ private void setupDrawerMenu(NavigationView navigationView) { return true; }); + User account = accountManager.getUser(); filterDrawerMenu(navigationView.getMenu(), account); } @@ -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); diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index 434052172c38..3fc80bd01bbd 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -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(); } }