diff --git a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart index 9948ab4cc..558a350c1 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 e66c6c2aa..b80b439d1 100644 --- a/mobile/lib/modules/search/services/person.service.g.dart +++ b/mobile/lib/modules/search/services/person.service.g.dart @@ -6,7 +6,7 @@ part of 'person.service.dart'; // RiverpodGenerator // ************************************************************************** -String _$personServiceHash() => r'3fc3dcf4603c7b55c0deae65f39f6c212eea492b'; +String _$personServiceHash() => r'cde0a9c029d16ddde2adcd58ae8c863bf8cc1fed'; /// See also [personService]. @ProviderFor(personService) 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 692dcf7c0..a9954382a 100644 --- a/mobile/lib/modules/settings/providers/app_settings.provider.g.dart +++ b/mobile/lib/modules/settings/providers/app_settings.provider.g.dart @@ -7,7 +7,7 @@ part of 'app_settings.provider.dart'; // ************************************************************************** String _$appSettingsServiceHash() => - r'957a65af6967701112f3076b507f9738fec4b7be'; + r'45ea609a91d250290431a7a08a14d16b37c7515d'; /// See also [appSettingsService]. @ProviderFor(appSettingsService) diff --git a/mobile/lib/routing/custom_transition_builders.dart b/mobile/lib/routing/custom_transition_builders.dart new file mode 100644 index 000000000..610edd818 --- /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 dfb87a4ae..67407b7e2 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 583aa1125..d54f8aeda 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 4bc7e93d1..421d55431 100644 --- a/mobile/lib/shared/providers/api.provider.g.dart +++ b/mobile/lib/shared/providers/api.provider.g.dart @@ -6,7 +6,7 @@ part of 'api.provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$apiServiceHash() => r'03cbd33147a7058d56175e532ac47e1aa4858c6d'; +String _$apiServiceHash() => r'5b8beddb448316bdae5e3963ff77601653715729'; /// See also [apiService]. @ProviderFor(apiService) diff --git a/mobile/lib/utils/immich_app_theme.dart b/mobile/lib/utils/immich_app_theme.dart index 4313da60f..e2ed6cd56 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,