mirror of
https://github.com/immich-app/immich.git
synced 2026-02-21 10:10:33 +09:00
chore(mobile): reduce the asset details snap target (#26343)
We were snapping to 75%, but 66.6% may be more natural. Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -382,9 +382,10 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
||||
final viewportHeight = MediaQuery.heightOf(context);
|
||||
final imageHeight = _getImageHeight(viewportWidth, viewportHeight, displayAsset);
|
||||
|
||||
final margin = (viewportHeight - imageHeight) / 2;
|
||||
final overflowBoxHeight = margin + imageHeight - (kMinInteractiveDimension / 2);
|
||||
_snapOffset = (margin + imageHeight) - (viewportHeight / 4);
|
||||
final detailsOffset = (viewportHeight + imageHeight - kMinInteractiveDimension) / 2;
|
||||
final snapTarget = viewportHeight / 3;
|
||||
|
||||
_snapOffset = detailsOffset - snapTarget;
|
||||
|
||||
if (_proxyScrollController.hasClients) {
|
||||
_proxyScrollController.snapPosition.snapOffset = _snapOffset;
|
||||
@@ -429,7 +430,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
||||
ignoring: !_showingDetails,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: overflowBoxHeight),
|
||||
SizedBox(height: detailsOffset),
|
||||
GestureDetector(
|
||||
onVerticalDragStart: _beginDrag,
|
||||
onVerticalDragUpdate: _updateDrag,
|
||||
@@ -438,7 +439,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
||||
child: AnimatedOpacity(
|
||||
opacity: _showingDetails ? 1.0 : 0.0,
|
||||
duration: Durations.short2,
|
||||
child: AssetDetails(minHeight: _snapOffset + viewportHeight - overflowBoxHeight),
|
||||
child: AssetDetails(minHeight: viewportHeight - snapTarget),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user