diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java index 5de9478cae..45850a27fb 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -211,9 +211,6 @@ public class PreviewImageFragment extends FileFragment implements Injectable { OCFile videoOfLivePhoto = getFile().videoOfLivePhoto; - // Automatically play live photo - playLivePhoto(videoOfLivePhoto); - // For replay functionality setOnLongClickListener binding.image.setOnLongClickListener(v -> { playLivePhoto(videoOfLivePhoto); @@ -222,9 +219,9 @@ public class PreviewImageFragment extends FileFragment implements Injectable { } } - private void toggleActionBarVisibility(boolean hide) { + private void hideActionBar() { PreviewImageActivity activity = (PreviewImageActivity) requireActivity(); - activity.toggleActionBarVisibility(hide); + activity.toggleActionBarVisibility(true); } private void playLivePhoto(OCFile file) { @@ -232,7 +229,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable { return; } - toggleActionBarVisibility(true); + hideActionBar(); Fragment mediaFragment = PreviewMediaFragment.newInstance(file, accountManager.getUser(), 0, true, true); FragmentManager fragmentManager = requireActivity().getSupportFragmentManager(); diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java index 02a6bb66ff..86d6b8f41e 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java @@ -390,9 +390,18 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene return; } + showActionBar(); + requireActivity().getSupportFragmentManager().popBackStack(); } + private void showActionBar() { + Activity currentActivity = requireActivity(); + if (currentActivity instanceof PreviewImageActivity activity) { + activity.toggleActionBarVisibility(false); + } + } + private void setupVideoView() { binding.exoplayerView.setPlayer(exoPlayer); LinearLayout linearLayout = binding.exoplayerView.findViewById(R.id.exo_center_controls);