[Android] Fix Bottom sheets not recreated in video player after an orientation change
Nicolas Pomepuy
git at videolan.org
Thu Mar 3 12:56:19 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Feb 24 14:42:58 2022 +0100| [73bcb6959f610a0b3499a1de8d5fb92173ec2c3f] | committer: Nicolas Pomepuy
Fix Bottom sheets not recreated in video player after an orientation change
> https://code.videolan.org/videolan/vlc-android/commit/73bcb6959f610a0b3499a1de8d5fb92173ec2c3f
---
.../org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
index 469a80366..74e007668 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
@@ -75,13 +75,12 @@ abstract class VLCBottomSheetDialogFragment : BottomSheetDialogFragment() {
super.onConfigurationChanged(newConfig)
return
}
- val fragmentManager = fragmentManager
- if (fragmentManager != null) {
+ if (isAdded) {
dismiss()
}
super.onConfigurationChanged(newConfig)
- if (fragmentManager != null) {
- show(fragmentManager, tag)
+ if (isAdded) {
+ show(parentFragmentManager.beginTransaction().setReorderingAllowed(false), tag)
}
}
More information about the Android
mailing list