Skip to content

Commit

Permalink
Merge pull request #1677 from Infomaniak/tablet-focus
Browse files Browse the repository at this point in the history
Make sure ThreadFragment is displayed after rotation
  • Loading branch information
FabianDevel authored Feb 5, 2024
2 parents f8d298f + 07a0d12 commit 508ab76
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -192,4 +193,10 @@ abstract class TwoPaneFragment : Fragment() {
)
}
}

private fun ensureThreadIsDisplayed(orientation: Int) {
if (orientation == Configuration.ORIENTATION_PORTRAIT && twoPaneViewModel.isInThreadInPhoneMode(requireContext())) {
slidingPaneLayout.openPaneNoAnimation()
}
}
}

0 comments on commit 508ab76

Please sign in to comment.