diff --git a/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewV2Fragment.kt b/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewV2Fragment.kt index fc9367b50..7c3f80179 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewV2Fragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewV2Fragment.kt @@ -185,6 +185,15 @@ class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v private fun initializeFullScreenUi() { fullscreenHelper.configureToolbarLayout(binding.toolbarCutoutSpacer, binding.toolbar) fullscreenHelper.showAndHideWithSystemUI(requireActivity().window, binding.toolbarLayout, binding.mediaPreviewDetailsContainer) + fullscreenHelper.hideSystemUI() + + lifecycleDisposable += viewModel.state.map { + it.isInSharedAnimation to it.loadState + }.distinctUntilChanged().subscribe { (isInSharedAnimation, loadState) -> + if (!isInSharedAnimation && loadState == MediaPreviewV2State.LoadState.MEDIA_READY) { + fullscreenHelper.showSystemUI() + } + } } private fun bindCurrentState(currentState: MediaPreviewV2State) {