mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(mobile): use zoomedpagetransition for galleryvieweroute (#5495)
Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
7702560b12
commit
d5f6584e1d
@ -795,6 +795,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
tag: isFromDto
|
tag: isFromDto
|
||||||
? '${a.remoteId}-$heroOffset'
|
? '${a.remoteId}-$heroOffset'
|
||||||
: a.id + heroOffset,
|
: a.id + heroOffset,
|
||||||
|
transitionOnUserGestures: true,
|
||||||
),
|
),
|
||||||
filterQuality: FilterQuality.high,
|
filterQuality: FilterQuality.high,
|
||||||
tightMode: true,
|
tightMode: true,
|
||||||
|
BIN
mobile/lib/modules/search/services/person.service.g.dart
generated
BIN
mobile/lib/modules/search/services/person.service.g.dart
generated
Binary file not shown.
Binary file not shown.
31
mobile/lib/routing/custom_transition_builders.dart
Normal file
31
mobile/lib/routing/custom_transition_builders.dart
Normal file
@ -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<double> animation,
|
||||||
|
Animation<double> 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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -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/search/views/search_result_page.dart';
|
||||||
import 'package:immich_mobile/modules/settings/views/settings_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/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/duplicate_guard.dart';
|
||||||
import 'package:immich_mobile/routing/backup_permission_guard.dart';
|
import 'package:immich_mobile/routing/backup_permission_guard.dart';
|
||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
@ -86,9 +87,10 @@ part 'router.gr.dart';
|
|||||||
],
|
],
|
||||||
transitionsBuilder: TransitionsBuilders.fadeIn,
|
transitionsBuilder: TransitionsBuilders.fadeIn,
|
||||||
),
|
),
|
||||||
AutoRoute(
|
CustomRoute(
|
||||||
page: GalleryViewerPage,
|
page: GalleryViewerPage,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [AuthGuard, DuplicateGuard],
|
||||||
|
transitionsBuilder: CustomTransitionsBuilders.zoomedPage,
|
||||||
),
|
),
|
||||||
AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]),
|
AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]),
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
|
@ -63,7 +63,7 @@ class _$AppRouter extends RootStackRouter {
|
|||||||
},
|
},
|
||||||
GalleryViewerRoute.name: (routeData) {
|
GalleryViewerRoute.name: (routeData) {
|
||||||
final args = routeData.argsAs<GalleryViewerRouteArgs>();
|
final args = routeData.argsAs<GalleryViewerRouteArgs>();
|
||||||
return MaterialPageX<dynamic>(
|
return CustomPage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: GalleryViewerPage(
|
child: GalleryViewerPage(
|
||||||
key: args.key,
|
key: args.key,
|
||||||
@ -75,6 +75,9 @@ class _$AppRouter extends RootStackRouter {
|
|||||||
isOwner: args.isOwner,
|
isOwner: args.isOwner,
|
||||||
sharedAlbumId: args.sharedAlbumId,
|
sharedAlbumId: args.sharedAlbumId,
|
||||||
),
|
),
|
||||||
|
transitionsBuilder: CustomTransitionsBuilders.zoomedPage,
|
||||||
|
opaque: true,
|
||||||
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
VideoViewerRoute.name: (routeData) {
|
VideoViewerRoute.name: (routeData) {
|
||||||
|
BIN
mobile/lib/shared/providers/api.provider.g.dart
generated
BIN
mobile/lib/shared/providers/api.provider.g.dart
generated
Binary file not shown.
@ -20,7 +20,7 @@ final immichThemeProvider = StateProvider<ThemeMode>((ref) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ThemeData base = ThemeData(
|
final ThemeData base = ThemeData(
|
||||||
chipTheme: const ChipThemeData(
|
chipTheme: const ChipThemeData(
|
||||||
side: BorderSide.none,
|
side: BorderSide.none,
|
||||||
),
|
),
|
||||||
@ -30,7 +30,7 @@ ThemeData base = ThemeData(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData immichLightTheme = ThemeData(
|
final ThemeData immichLightTheme = ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
primarySwatch: Colors.indigo,
|
primarySwatch: Colors.indigo,
|
||||||
@ -153,7 +153,7 @@ ThemeData immichLightTheme = ThemeData(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData immichDarkTheme = ThemeData(
|
final ThemeData immichDarkTheme = ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
primarySwatch: Colors.indigo,
|
primarySwatch: Colors.indigo,
|
||||||
|
Loading…
Reference in New Issue
Block a user