mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 09:12:57 +02:00
Mobile performance improvements (#417)
* First performance tweaks (caching and rendering improvemetns) * Revert asset response caching * 3-step image loading in asset viewer * Prevent panning and zooming until full-scale version is loaded * Loading indicator * Adapt to gallery PR * Cleanup * Dart format * Fix exif sheet * Disable three stage loading until settings are available
This commit is contained in:
parent
46f4905259
commit
b46e834220
13 changed files with 159 additions and 81 deletions
mobile/lib/routing
|
@ -46,10 +46,7 @@ class _$AppRouter extends RootStackRouter {
|
|||
return MaterialPageX<dynamic>(
|
||||
routeData: routeData,
|
||||
child: GalleryViewerPage(
|
||||
key: args.key,
|
||||
assetList: args.assetList,
|
||||
asset: args.asset,
|
||||
thumbnailRequestUrl: args.thumbnailRequestUrl));
|
||||
key: args.key, assetList: args.assetList, asset: args.asset));
|
||||
},
|
||||
ImageViewerRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<ImageViewerRouteArgs>();
|
||||
|
@ -57,13 +54,14 @@ class _$AppRouter extends RootStackRouter {
|
|||
routeData: routeData,
|
||||
child: ImageViewerPage(
|
||||
key: args.key,
|
||||
imageUrl: args.imageUrl,
|
||||
heroTag: args.heroTag,
|
||||
thumbnailUrl: args.thumbnailUrl,
|
||||
asset: args.asset,
|
||||
authToken: args.authToken,
|
||||
isZoomedFunction: args.isZoomedFunction,
|
||||
isZoomedListener: args.isZoomedListener));
|
||||
isZoomedListener: args.isZoomedListener,
|
||||
onLoadingCompleted: args.onLoadingCompleted,
|
||||
onLoadingStart: args.onLoadingStart,
|
||||
threeStageLoading: args.threeStageLoading));
|
||||
},
|
||||
VideoViewerRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<VideoViewerRouteArgs>();
|
||||
|
@ -258,25 +256,18 @@ class GalleryViewerRoute extends PageRouteInfo<GalleryViewerRouteArgs> {
|
|||
GalleryViewerRoute(
|
||||
{Key? key,
|
||||
required List<AssetResponseDto> assetList,
|
||||
required AssetResponseDto asset,
|
||||
required String thumbnailRequestUrl})
|
||||
required AssetResponseDto asset})
|
||||
: super(GalleryViewerRoute.name,
|
||||
path: '/gallery-viewer-page',
|
||||
args: GalleryViewerRouteArgs(
|
||||
key: key,
|
||||
assetList: assetList,
|
||||
asset: asset,
|
||||
thumbnailRequestUrl: thumbnailRequestUrl));
|
||||
key: key, assetList: assetList, asset: asset));
|
||||
|
||||
static const String name = 'GalleryViewerRoute';
|
||||
}
|
||||
|
||||
class GalleryViewerRouteArgs {
|
||||
const GalleryViewerRouteArgs(
|
||||
{this.key,
|
||||
required this.assetList,
|
||||
required this.asset,
|
||||
required this.thumbnailRequestUrl});
|
||||
{this.key, required this.assetList, required this.asset});
|
||||
|
||||
final Key? key;
|
||||
|
||||
|
@ -284,11 +275,9 @@ class GalleryViewerRouteArgs {
|
|||
|
||||
final AssetResponseDto asset;
|
||||
|
||||
final String thumbnailRequestUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GalleryViewerRouteArgs{key: $key, assetList: $assetList, asset: $asset, thumbnailRequestUrl: $thumbnailRequestUrl}';
|
||||
return 'GalleryViewerRouteArgs{key: $key, assetList: $assetList, asset: $asset}';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,24 +286,26 @@ class GalleryViewerRouteArgs {
|
|||
class ImageViewerRoute extends PageRouteInfo<ImageViewerRouteArgs> {
|
||||
ImageViewerRoute(
|
||||
{Key? key,
|
||||
required String imageUrl,
|
||||
required String heroTag,
|
||||
required String thumbnailUrl,
|
||||
required AssetResponseDto asset,
|
||||
required String authToken,
|
||||
required void Function() isZoomedFunction,
|
||||
required ValueNotifier<bool> isZoomedListener})
|
||||
required ValueNotifier<bool> isZoomedListener,
|
||||
required void Function() onLoadingCompleted,
|
||||
required void Function() onLoadingStart,
|
||||
required bool threeStageLoading})
|
||||
: super(ImageViewerRoute.name,
|
||||
path: '/image-viewer-page',
|
||||
args: ImageViewerRouteArgs(
|
||||
key: key,
|
||||
imageUrl: imageUrl,
|
||||
heroTag: heroTag,
|
||||
thumbnailUrl: thumbnailUrl,
|
||||
asset: asset,
|
||||
authToken: authToken,
|
||||
isZoomedFunction: isZoomedFunction,
|
||||
isZoomedListener: isZoomedListener));
|
||||
isZoomedListener: isZoomedListener,
|
||||
onLoadingCompleted: onLoadingCompleted,
|
||||
onLoadingStart: onLoadingStart,
|
||||
threeStageLoading: threeStageLoading));
|
||||
|
||||
static const String name = 'ImageViewerRoute';
|
||||
}
|
||||
|
@ -322,22 +313,19 @@ class ImageViewerRoute extends PageRouteInfo<ImageViewerRouteArgs> {
|
|||
class ImageViewerRouteArgs {
|
||||
const ImageViewerRouteArgs(
|
||||
{this.key,
|
||||
required this.imageUrl,
|
||||
required this.heroTag,
|
||||
required this.thumbnailUrl,
|
||||
required this.asset,
|
||||
required this.authToken,
|
||||
required this.isZoomedFunction,
|
||||
required this.isZoomedListener});
|
||||
required this.isZoomedListener,
|
||||
required this.onLoadingCompleted,
|
||||
required this.onLoadingStart,
|
||||
required this.threeStageLoading});
|
||||
|
||||
final Key? key;
|
||||
|
||||
final String imageUrl;
|
||||
|
||||
final String heroTag;
|
||||
|
||||
final String thumbnailUrl;
|
||||
|
||||
final AssetResponseDto asset;
|
||||
|
||||
final String authToken;
|
||||
|
@ -346,9 +334,15 @@ class ImageViewerRouteArgs {
|
|||
|
||||
final ValueNotifier<bool> isZoomedListener;
|
||||
|
||||
final void Function() onLoadingCompleted;
|
||||
|
||||
final void Function() onLoadingStart;
|
||||
|
||||
final bool threeStageLoading;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ImageViewerRouteArgs{key: $key, imageUrl: $imageUrl, heroTag: $heroTag, thumbnailUrl: $thumbnailUrl, asset: $asset, authToken: $authToken, isZoomedFunction: $isZoomedFunction, isZoomedListener: $isZoomedListener}';
|
||||
return 'ImageViewerRouteArgs{key: $key, heroTag: $heroTag, asset: $asset, authToken: $authToken, isZoomedFunction: $isZoomedFunction, isZoomedListener: $isZoomedListener, onLoadingCompleted: $onLoadingCompleted, onLoadingStart: $onLoadingStart, threeStageLoading: $threeStageLoading}';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue