diff --git a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart index 9948ab4cc9..558a350c1f 100644 --- a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart +++ b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart @@ -795,6 +795,7 @@ class GalleryViewerPage extends HookConsumerWidget { tag: isFromDto ? '${a.remoteId}-$heroOffset' : a.id + heroOffset, + transitionOnUserGestures: true, ), filterQuality: FilterQuality.high, tightMode: true, diff --git a/mobile/lib/modules/search/services/person.service.g.dart b/mobile/lib/modules/search/services/person.service.g.dart index e66c6c2aa6..b80b439d1d 100644 Binary files a/mobile/lib/modules/search/services/person.service.g.dart and b/mobile/lib/modules/search/services/person.service.g.dart differ diff --git a/mobile/lib/modules/settings/providers/app_settings.provider.g.dart b/mobile/lib/modules/settings/providers/app_settings.provider.g.dart index 692dcf7c05..a9954382a7 100644 Binary files a/mobile/lib/modules/settings/providers/app_settings.provider.g.dart and b/mobile/lib/modules/settings/providers/app_settings.provider.g.dart differ diff --git a/mobile/lib/routing/custom_transition_builders.dart b/mobile/lib/routing/custom_transition_builders.dart new file mode 100644 index 0000000000..610edd8185 --- /dev/null +++ b/mobile/lib/routing/custom_transition_builders.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class CustomTransitionsBuilders { + const CustomTransitionsBuilders._(); + + static const ZoomPageTransitionsBuilder zoomPageTransitionsBuilder = + ZoomPageTransitionsBuilder(); + + static const RouteTransitionsBuilder zoomedPage = _zoomedPage; + + static Widget _zoomedPage( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return zoomPageTransitionsBuilder.buildTransitions( + // Empty PageRoute<> object, only used to pass allowSnapshotting to ZoomPageTransitionsBuilder + PageRouteBuilder( + allowSnapshotting: true, + fullscreenDialog: false, + pageBuilder: (context, animation, secondaryAnimation) => + const SizedBox.shrink(), + ), + context, + animation, + secondaryAnimation, + child, + ); + } +} diff --git a/mobile/lib/routing/router.dart b/mobile/lib/routing/router.dart index dfb87a4ae5..67407b7e26 100644 --- a/mobile/lib/routing/router.dart +++ b/mobile/lib/routing/router.dart @@ -43,6 +43,7 @@ import 'package:immich_mobile/modules/search/views/search_page.dart'; import 'package:immich_mobile/modules/search/views/search_result_page.dart'; import 'package:immich_mobile/modules/settings/views/settings_page.dart'; import 'package:immich_mobile/routing/auth_guard.dart'; +import 'package:immich_mobile/routing/custom_transition_builders.dart'; import 'package:immich_mobile/routing/duplicate_guard.dart'; import 'package:immich_mobile/routing/backup_permission_guard.dart'; import 'package:immich_mobile/shared/models/asset.dart'; @@ -86,9 +87,10 @@ part 'router.gr.dart'; ], transitionsBuilder: TransitionsBuilders.fadeIn, ), - AutoRoute( + CustomRoute( page: GalleryViewerPage, guards: [AuthGuard, DuplicateGuard], + transitionsBuilder: CustomTransitionsBuilders.zoomedPage, ), AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]), AutoRoute( diff --git a/mobile/lib/routing/router.gr.dart b/mobile/lib/routing/router.gr.dart index 583aa11251..d54f8aeda1 100644 --- a/mobile/lib/routing/router.gr.dart +++ b/mobile/lib/routing/router.gr.dart @@ -63,7 +63,7 @@ class _$AppRouter extends RootStackRouter { }, GalleryViewerRoute.name: (routeData) { final args = routeData.argsAs(); - return MaterialPageX( + return CustomPage( routeData: routeData, child: GalleryViewerPage( key: args.key, @@ -75,6 +75,9 @@ class _$AppRouter extends RootStackRouter { isOwner: args.isOwner, sharedAlbumId: args.sharedAlbumId, ), + transitionsBuilder: CustomTransitionsBuilders.zoomedPage, + opaque: true, + barrierDismissible: false, ); }, VideoViewerRoute.name: (routeData) { diff --git a/mobile/lib/shared/providers/api.provider.g.dart b/mobile/lib/shared/providers/api.provider.g.dart index 4bc7e93d1c..421d554314 100644 Binary files a/mobile/lib/shared/providers/api.provider.g.dart and b/mobile/lib/shared/providers/api.provider.g.dart differ diff --git a/mobile/lib/utils/immich_app_theme.dart b/mobile/lib/utils/immich_app_theme.dart index 4313da60f9..e2ed6cd56c 100644 --- a/mobile/lib/utils/immich_app_theme.dart +++ b/mobile/lib/utils/immich_app_theme.dart @@ -20,7 +20,7 @@ final immichThemeProvider = StateProvider((ref) { } }); -ThemeData base = ThemeData( +final ThemeData base = ThemeData( chipTheme: const ChipThemeData( side: BorderSide.none, ), @@ -30,7 +30,7 @@ ThemeData base = ThemeData( ), ); -ThemeData immichLightTheme = ThemeData( +final ThemeData immichLightTheme = ThemeData( useMaterial3: true, brightness: Brightness.light, primarySwatch: Colors.indigo, @@ -153,7 +153,7 @@ ThemeData immichLightTheme = ThemeData( ), ); -ThemeData immichDarkTheme = ThemeData( +final ThemeData immichDarkTheme = ThemeData( useMaterial3: true, brightness: Brightness.dark, primarySwatch: Colors.indigo,