From 60715059f7688ee05696eb1c087736e08b854612 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Sun, 17 Nov 2024 00:02:22 -0500 Subject: [PATCH] ensure dimensions for memory cards --- .../pages/common/native_video_viewer.page.dart | 2 ++ mobile/lib/widgets/memories/memory_card.dart | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mobile/lib/pages/common/native_video_viewer.page.dart b/mobile/lib/pages/common/native_video_viewer.page.dart index eccda3fcd9..dfa2af0327 100644 --- a/mobile/lib/pages/common/native_video_viewer.page.dart +++ b/mobile/lib/pages/common/native_video_viewer.page.dart @@ -61,6 +61,8 @@ class NativeVideoViewerPage extends HookConsumerWidget { // If the swipe is canceled, `currentAsset` will not have changed and video A will continue to play. final currentAsset = useState(ref.read(currentAssetProvider)); final isCurrent = currentAsset.value == asset; + + // used to show the placeholder during hero animations for remote videos to avoid a stutter final isVisible = useState(asset.isLocal || asset.isMotionPhoto); final log = Logger('NativeVideoViewerPage'); diff --git a/mobile/lib/widgets/memories/memory_card.dart b/mobile/lib/widgets/memories/memory_card.dart index 477003c497..4954d0bfcc 100644 --- a/mobile/lib/widgets/memories/memory_card.dart +++ b/mobile/lib/widgets/memories/memory_card.dart @@ -68,13 +68,17 @@ class MemoryCard extends StatelessWidget { } else { return Hero( tag: 'memory-${asset.id}', - child: NativeVideoViewerPage( - key: ValueKey(asset.id), - asset: asset, - showControls: false, - image: SizedBox.expand( - child: ImmichImage( + child: SizedBox( + width: context.width, + height: context.height, + child: NativeVideoViewerPage( + key: ValueKey(asset.id), + asset: asset, + showControls: false, + image: ImmichImage( asset, + width: context.width, + height: context.height, fit: fit, ), ),