diff --git a/app/src/main/java/com/infomaniak/mail/ui/main/folder/TwoPaneFragment.kt b/app/src/main/java/com/infomaniak/mail/ui/main/folder/TwoPaneFragment.kt index c281cb6aae..2fa09953fb 100644 --- a/app/src/main/java/com/infomaniak/mail/ui/main/folder/TwoPaneFragment.kt +++ b/app/src/main/java/com/infomaniak/mail/ui/main/folder/TwoPaneFragment.kt @@ -82,6 +82,7 @@ abstract class TwoPaneFragment : Fragment() { override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) updateDrawerLockMode() + ensureThreadIsDisplayed(newConfig.orientation) } private fun setupSlidingPane() = with(slidingPaneLayout) { @@ -192,4 +193,10 @@ abstract class TwoPaneFragment : Fragment() { ) } } + + private fun ensureThreadIsDisplayed(orientation: Int) { + if (orientation == Configuration.ORIENTATION_PORTRAIT && twoPaneViewModel.isInThreadInPhoneMode(requireContext())) { + slidingPaneLayout.openPaneNoAnimation() + } + } }