mirror of
https://github.com/immich-app/immich.git
synced 2025-06-02 13:14:54 -04:00
fix(mobile): improve hero animation (#3636)
This commit is contained in:
parent
a8b01dc21a
commit
e9b0840f01
@ -62,11 +62,17 @@ class ThumbnailImage extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildImage(Asset asset) {
|
Widget buildImage(Asset asset) {
|
||||||
var image = ImmichImage(
|
var image = SizedBox(
|
||||||
asset,
|
|
||||||
width: 300,
|
width: 300,
|
||||||
height: 300,
|
height: 300,
|
||||||
|
child: Hero(
|
||||||
|
tag: asset.id + heroOffset,
|
||||||
|
child: ImmichImage(
|
||||||
|
asset,
|
||||||
useGrayBoxPlaceholder: useGrayBoxPlaceholder,
|
useGrayBoxPlaceholder: useGrayBoxPlaceholder,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (!multiselectEnabled || !isSelected) {
|
if (!multiselectEnabled || !isSelected) {
|
||||||
return image;
|
return image;
|
||||||
@ -114,8 +120,6 @@ class ThumbnailImage extends HookConsumerWidget {
|
|||||||
onSelect?.call();
|
onSelect?.call();
|
||||||
HapticFeedback.heavyImpact();
|
HapticFeedback.heavyImpact();
|
||||||
},
|
},
|
||||||
child: Hero(
|
|
||||||
tag: asset.id + heroOffset,
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -181,7 +185,6 @@ class ThumbnailImage extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,6 +276,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
|||||||
filterQuality: pageOption.filterQuality,
|
filterQuality: pageOption.filterQuality,
|
||||||
basePosition: pageOption.basePosition,
|
basePosition: pageOption.basePosition,
|
||||||
disableGestures: pageOption.disableGestures,
|
disableGestures: pageOption.disableGestures,
|
||||||
|
heroAttributes: pageOption.heroAttributes,
|
||||||
child: pageOption.child,
|
child: pageOption.child,
|
||||||
)
|
)
|
||||||
: PhotoView(
|
: PhotoView(
|
||||||
@ -306,21 +307,9 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
|||||||
basePosition: pageOption.basePosition,
|
basePosition: pageOption.basePosition,
|
||||||
disableGestures: pageOption.disableGestures,
|
disableGestures: pageOption.disableGestures,
|
||||||
errorBuilder: pageOption.errorBuilder,
|
errorBuilder: pageOption.errorBuilder,
|
||||||
|
heroAttributes: pageOption.heroAttributes,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pageOption.heroAttributes != null) {
|
|
||||||
return Hero(
|
|
||||||
tag: pageOption.heroAttributes!.tag,
|
|
||||||
createRectTween: pageOption.heroAttributes!.createRectTween,
|
|
||||||
flightShuttleBuilder: pageOption.heroAttributes!.flightShuttleBuilder,
|
|
||||||
placeholderBuilder: pageOption.heroAttributes!.placeholderBuilder,
|
|
||||||
transitionOnUserGestures: pageOption.heroAttributes!.transitionOnUserGestures,
|
|
||||||
child: ClipRect(
|
|
||||||
child: photoView,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ClipRect(
|
return ClipRect(
|
||||||
child: photoView,
|
child: photoView,
|
||||||
);
|
);
|
||||||
|
@ -405,7 +405,7 @@ class PhotoViewCoreState extends State<PhotoViewCore>
|
|||||||
gaplessPlayback: widget.gaplessPlayback ?? false,
|
gaplessPlayback: widget.gaplessPlayback ?? false,
|
||||||
filterQuality: widget.filterQuality,
|
filterQuality: widget.filterQuality,
|
||||||
width: scaleBoundaries.childSize.width * scale,
|
width: scaleBoundaries.childSize.width * scale,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.cover,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user