0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-11 01:18:24 -05:00

increase delay for hero animation

This commit is contained in:
mertalev 2024-11-16 23:34:48 -05:00
parent 381fe5c2fd
commit 03211c43f9
No known key found for this signature in database
GPG key ID: CA85EF6600C9E8AD
2 changed files with 10 additions and 7 deletions

View file

@ -106,7 +106,7 @@ class GalleryViewerPage extends HookConsumerWidget {
return null; return null;
}, },
[], const [],
); );
void showInfo() { void showInfo() {

View file

@ -169,7 +169,7 @@ class NativeVideoViewerPage extends HookConsumerWidget {
// if opening a remote video from a hero animation, delay initialization to avoid a stutter // if opening a remote video from a hero animation, delay initialization to avoid a stutter
if (!asset.isLocal && isCurrent) { if (!asset.isLocal && isCurrent) {
await Future.delayed(const Duration(milliseconds: 150)); await Future.delayed(const Duration(milliseconds: 200));
} }
videoSource.value = videoSourceRes; videoSource.value = videoSourceRes;
@ -376,7 +376,6 @@ class NativeVideoViewerPage extends HookConsumerWidget {
nc.onPlaybackStatusChanged.addListener(onPlaybackStatusChanged); nc.onPlaybackStatusChanged.addListener(onPlaybackStatusChanged);
nc.onPlaybackReady.addListener(onPlaybackReady); nc.onPlaybackReady.addListener(onPlaybackReady);
nc.onPlaybackEnded.addListener(onPlaybackEnded); nc.onPlaybackEnded.addListener(onPlaybackEnded);
nc.loadVideoSource(videoSource.value!); nc.loadVideoSource(videoSource.value!);
controller.value = nc; controller.value = nc;
@ -429,12 +428,12 @@ class NativeVideoViewerPage extends HookConsumerWidget {
WakelockPlus.disable(); WakelockPlus.disable();
}; };
}, },
[], const [],
); );
final video = aspectRatio.value != null final video = aspectRatio.value != null
? Center( ? Center(
key: ValueKey(asset.id), key: ValueKey(asset),
child: AspectRatio( child: AspectRatio(
key: ValueKey(asset), key: ValueKey(asset),
aspectRatio: aspectRatio.value!, aspectRatio: aspectRatio.value!,
@ -452,11 +451,15 @@ class NativeVideoViewerPage extends HookConsumerWidget {
children: [ children: [
// This remains under the video to avoid flickering // This remains under the video to avoid flickering
// For motion videos, this is the image portion of the asset // For motion videos, this is the image portion of the asset
image, Center(key: ValueKey(asset.id), child: image),
if (video != null) if (video != null)
asset.isVideo asset.isVideo
? video ? video
: Visibility.maintain(visible: showMotionVideo, child: video), : Visibility.maintain(
key: ValueKey(asset),
visible: showMotionVideo,
child: video,
),
if (showControls) const Center(child: CustomVideoPlayerControls()), if (showControls) const Center(child: CustomVideoPlayerControls()),
], ],
); );