mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
fix(mobile) uses clamping scroll physics on android (#1503)
This commit is contained in:
parent
bb84464216
commit
2c356ec87f
1 changed files with 1 additions and 16 deletions
|
@ -259,7 +259,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
? const NeverScrollableScrollPhysics() // Don't allow paging while scrolled in
|
? const NeverScrollableScrollPhysics() // Don't allow paging while scrolled in
|
||||||
: (Platform.isIOS
|
: (Platform.isIOS
|
||||||
? const BouncingScrollPhysics() // Use bouncing physics for iOS
|
? const BouncingScrollPhysics() // Use bouncing physics for iOS
|
||||||
: const ImmichPageViewScrollPhysics() // Use heavy physics for Android
|
: const ClampingScrollPhysics() // Use heavy physics for Android
|
||||||
),
|
),
|
||||||
itemCount: assetList.length,
|
itemCount: assetList.length,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
|
@ -349,18 +349,3 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ImmichPageViewScrollPhysics extends ScrollPhysics {
|
|
||||||
const ImmichPageViewScrollPhysics({super.parent});
|
|
||||||
|
|
||||||
@override
|
|
||||||
ImmichPageViewScrollPhysics applyTo(ScrollPhysics? ancestor) {
|
|
||||||
return ImmichPageViewScrollPhysics(parent: buildParent(ancestor)!);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
SpringDescription get spring => const SpringDescription(
|
|
||||||
mass: 100,
|
|
||||||
stiffness: 100,
|
|
||||||
damping: .90,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue