From 987f8bb82af4ecfbfc936e36221ddeefc92fd055 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Thu, 2 May 2024 10:42:37 +0200 Subject: [PATCH] Fix header Signed-off-by: alperozturk --- .../ui/preview/PreviewImageActivity.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java index 3db46f80e0..b053d7f1d7 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java @@ -119,7 +119,8 @@ public class PreviewImageActivity extends FileActivity implements setupDrawer(); // ActionBar - updateActionBarTitleAndHomeButton(null); + OCFile chosenFile = IntentExtensionsKt.getParcelableArgument(getIntent(), FileActivity.EXTRA_FILE, OCFile.class); + updateActionBarTitleAndHomeButton(chosenFile); if (actionBar != null) { viewThemeUtils.files.setWhiteBackButton(this, actionBar); @@ -387,17 +388,13 @@ public class PreviewImageActivity extends FileActivity implements public void onPageSelected(int position) { savedPosition = position; hasSavedPosition = true; + + OCFile currentFile = previewImagePagerAdapter.getFileAt(position); + if (!isDownloadWorkStarted) { requestWaitingForBinder = true; } else { - OCFile currentFile = previewImagePagerAdapter.getFileAt(position); - if (currentFile != null) { - if (getSupportActionBar() != null) { - getSupportActionBar().setTitle(currentFile.getFileName()); - } - setDrawerIndicatorEnabled(false); - if (currentFile.isEncrypted() && !currentFile.isDown() && !previewImagePagerAdapter.pendingErrorAt(position)) { requestForDownload(currentFile); @@ -408,6 +405,12 @@ public class PreviewImageActivity extends FileActivity implements } } + if (currentFile != null) { + if (getSupportActionBar() != null) { + getSupportActionBar().setTitle(currentFile.getFileName()); + } + setDrawerIndicatorEnabled(false); + } } /**