mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Fix crash in PlayerFragment onConfigurationChanged handler
This commit is contained in:
committed by
Niels van Velzen
parent
8c36133fca
commit
1c58e9c151
@@ -242,7 +242,7 @@ class PlayerFragment : Fragment(), BackPressInterceptor {
|
||||
*/
|
||||
private fun updateFullscreenState(configuration: Configuration) {
|
||||
// Do not handle any orientation changes while being in Picture-in-Picture mode
|
||||
if (AndroidVersion.isAtLeastN && requireActivity().isInPictureInPictureMode) {
|
||||
if (AndroidVersion.isAtLeastN && activity?.isInPictureInPictureMode == true) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -408,6 +408,8 @@ class PlayerFragment : Fragment(), BackPressInterceptor {
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
if (!isAdded) return@post
|
||||
|
||||
updateFullscreenState(newConfig)
|
||||
playerGestureHelper.handleConfiguration(newConfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user