Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix gallery layout not updating on orientation change

ashilkn905114417fc0
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 4d1d71f0e9..f7ce549d35 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -611,6 +611,15 @@ class GalleryState extends State<Gallery> {
return widget.loadingWidget;
}
+ // Check if width changed due to orientation change and update gallery groups
+ if (galleryGroups.widthAvailable != widthAvailable) {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) {
+ _updateGalleryGroups();
+ }
+ });
+ }
+
final shouldEnableSwipeSelection =
flagService.internalUser && widget.limitSelectionToOne == false;