From 8434a4887cf7df786c2d594c59c889a7a9ed2cc5 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 25 Sep 2024 11:55:21 +0200 Subject: [PATCH] remove variable assignments Signed-off-by: alperozturk --- .../ui/activity/FileDisplayActivity.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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 b7ddb9b5f4..15529897b6 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 @@ -1019,27 +1019,22 @@ public class FileDisplayActivity extends FileActivity @SuppressFBWarnings("ITC_INHERITANCE_TYPE_CHECKING") @Override public void onBackPressed() { - final boolean isDrawerOpen = isDrawerOpen(); - if (isDrawerOpen) { + if (isDrawerOpen()) { super.onBackPressed(); return; } - final boolean isSearchOpen = isSearchOpen(); - if (isSearchOpen) { + if (isSearchOpen()) { resetSearchAction(); return; } - final Fragment leftFragment = getLeftFragment(); - if (leftFragment instanceof OCFileListFragment listOfFiles) { - OCFile currentDir = getCurrentDir(); - if (isRoot(currentDir)) { + if (getLeftFragment() instanceof OCFileListFragment listOfFiles) { + if (isRoot(getCurrentDir())) { finish(); - return; + } else { + browseUp(listOfFiles); } - - browseUp(listOfFiles); } else { popBack(); }