Skip to content

Commit 508ab76

Browse files
authored
Merge pull request #1677 from Infomaniak/tablet-focus
Make sure ThreadFragment is displayed after rotation
2 parents f8d298f + 07a0d12 commit 508ab76

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/main/java/com/infomaniak/mail/ui/main/folder/TwoPaneFragment.kt

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ abstract class TwoPaneFragment : Fragment() {
8282
override fun onConfigurationChanged(newConfig: Configuration) {
8383
super.onConfigurationChanged(newConfig)
8484
updateDrawerLockMode()
85+
ensureThreadIsDisplayed(newConfig.orientation)
8586
}
8687

8788
private fun setupSlidingPane() = with(slidingPaneLayout) {
@@ -192,4 +193,10 @@ abstract class TwoPaneFragment : Fragment() {
192193
)
193194
}
194195
}
196+
197+
private fun ensureThreadIsDisplayed(orientation: Int) {
198+
if (orientation == Configuration.ORIENTATION_PORTRAIT && twoPaneViewModel.isInThreadInPhoneMode(requireContext())) {
199+
slidingPaneLayout.openPaneNoAnimation()
200+
}
201+
}
195202
}

0 commit comments

Comments
 (0)