mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 01:29:04 +03: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 viewportHeight = MediaQuery.heightOf(context);
|
||||||
final imageHeight = _getImageHeight(viewportWidth, viewportHeight, displayAsset);
|
final imageHeight = _getImageHeight(viewportWidth, viewportHeight, displayAsset);
|
||||||
|
|
||||||
final margin = (viewportHeight - imageHeight) / 2;
|
final detailsOffset = (viewportHeight + imageHeight - kMinInteractiveDimension) / 2;
|
||||||
final overflowBoxHeight = margin + imageHeight - (kMinInteractiveDimension / 2);
|
final snapTarget = viewportHeight / 3;
|
||||||
_snapOffset = (margin + imageHeight) - (viewportHeight / 4);
|
|
||||||
|
_snapOffset = detailsOffset - snapTarget;
|
||||||
|
|
||||||
if (_proxyScrollController.hasClients) {
|
if (_proxyScrollController.hasClients) {
|
||||||
_proxyScrollController.snapPosition.snapOffset = _snapOffset;
|
_proxyScrollController.snapPosition.snapOffset = _snapOffset;
|
||||||
@@ -429,7 +430,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
|||||||
ignoring: !_showingDetails,
|
ignoring: !_showingDetails,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: overflowBoxHeight),
|
SizedBox(height: detailsOffset),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onVerticalDragStart: _beginDrag,
|
onVerticalDragStart: _beginDrag,
|
||||||
onVerticalDragUpdate: _updateDrag,
|
onVerticalDragUpdate: _updateDrag,
|
||||||
@@ -438,7 +439,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
|||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
opacity: _showingDetails ? 1.0 : 0.0,
|
opacity: _showingDetails ? 1.0 : 0.0,
|
||||||
duration: Durations.short2,
|
duration: Durations.short2,
|
||||||
child: AssetDetails(minHeight: _snapOffset + viewportHeight - overflowBoxHeight),
|
child: AssetDetails(minHeight: viewportHeight - snapTarget),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user