mirror of
https://github.com/immich-app/immich
synced 2025-06-07 03:38:25 +00:00
fix(mobile): double swipe (#18749)
debug: double swipe issue Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
0e81c20cbb
commit
44d49b9671
@ -223,7 +223,8 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
heroAttributes: _getHeroAttributes(asset),
|
heroAttributes: _getHeroAttributes(asset),
|
||||||
filterQuality: FilterQuality.high,
|
filterQuality: FilterQuality.high,
|
||||||
tightMode: true,
|
tightMode: true,
|
||||||
minScale: PhotoViewComputedScale.contained,
|
initialScale: PhotoViewComputedScale.contained * 0.99,
|
||||||
|
minScale: PhotoViewComputedScale.contained * 0.99,
|
||||||
errorBuilder: (context, error, stackTrace) => ImmichImage(
|
errorBuilder: (context, error, stackTrace) => ImmichImage(
|
||||||
asset,
|
asset,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
@ -238,9 +239,9 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
onDragUpdate: (_, details, __) => handleSwipeUpDown(details),
|
onDragUpdate: (_, details, __) => handleSwipeUpDown(details),
|
||||||
heroAttributes: _getHeroAttributes(asset),
|
heroAttributes: _getHeroAttributes(asset),
|
||||||
filterQuality: FilterQuality.high,
|
filterQuality: FilterQuality.high,
|
||||||
initialScale: 1.0,
|
initialScale: PhotoViewComputedScale.contained * 0.99,
|
||||||
maxScale: 1.0,
|
maxScale: 1.0,
|
||||||
minScale: 1.0,
|
minScale: PhotoViewComputedScale.contained * 0.99,
|
||||||
basePosition: Alignment.center,
|
basePosition: Alignment.center,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: context.width,
|
width: context.width,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'package:immich_mobile/widgets/photo_view/src/controller/photo_view_controller_delegate.dart'
|
import 'package:immich_mobile/widgets/photo_view/src/controller/photo_view_controller_delegate.dart'
|
||||||
show PhotoViewControllerDelegate;
|
show PhotoViewControllerDelegate;
|
||||||
|
|
||||||
@ -7,7 +6,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
|
|||||||
HitCorners _hitCornersX() {
|
HitCorners _hitCornersX() {
|
||||||
final double childWidth = scaleBoundaries.childSize.width * scale;
|
final double childWidth = scaleBoundaries.childSize.width * scale;
|
||||||
final double screenWidth = scaleBoundaries.outerSize.width;
|
final double screenWidth = scaleBoundaries.outerSize.width;
|
||||||
if (screenWidth >= childWidth) {
|
if (screenWidth - childWidth > -0.001) {
|
||||||
return const HitCorners(true, true);
|
return const HitCorners(true, true);
|
||||||
}
|
}
|
||||||
final x = -position.dx;
|
final x = -position.dx;
|
||||||
@ -18,7 +17,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
|
|||||||
HitCorners _hitCornersY() {
|
HitCorners _hitCornersY() {
|
||||||
final double childHeight = scaleBoundaries.childSize.height * scale;
|
final double childHeight = scaleBoundaries.childSize.height * scale;
|
||||||
final double screenHeight = scaleBoundaries.outerSize.height;
|
final double screenHeight = scaleBoundaries.outerSize.height;
|
||||||
if (screenHeight >= childHeight) {
|
if (screenHeight - childHeight > -0.001) {
|
||||||
return const HitCorners(true, true);
|
return const HitCorners(true, true);
|
||||||
}
|
}
|
||||||
final y = -position.dy;
|
final y = -position.dy;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user