Fix header

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-05-02 10:42:37 +02:00
parent 6c8c58f220
commit 987f8bb82a
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -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);
}
}
/**