Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Give collapsed album titles more room

r4khulb7b8204bb7e5
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/component/album_cover_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/gallery/component/album_cover_app_bar.dart
index 359fdfdab2..cc041e557e 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/component/album_cover_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/component/album_cover_app_bar.dart
@@ -857,6 +857,11 @@ class _AlbumCoverDelegate extends SliverPersistentHeaderDelegate {
) {
final collapseOffset = math.min(shrinkOffset, geometry.collapseExtent);
final collapseProgress = collapseOffset / geometry.collapseExtent;
+ final toolbarInset = ui.lerpDouble(
+ Spacing.md,
+ Spacing.xs,
+ collapseProgress,
+ )!;
final pinnedProgress =
((collapseProgress - _pinnedFadeStart) / (1 - _pinnedFadeStart)).clamp(
0.0,
@@ -933,8 +938,8 @@ class _AlbumCoverDelegate extends SliverPersistentHeaderDelegate {
topPadding +
(Spacing.lg - (collapsedHeight - _compactHeaderControlSize) / 2) *
(1 - pinnedProgress),
- left: Spacing.lg,
- right: Spacing.lg,
+ left: toolbarInset,
+ right: toolbarInset,
height: collapsedHeight,
child: SafeArea(
top: false,
@@ -970,7 +975,11 @@ class _AlbumCoverDelegate extends SliverPersistentHeaderDelegate {
),
Row(
mainAxisSize: MainAxisSize.min,
- spacing: _headerActionSpacing,
+ spacing: ui.lerpDouble(
+ _headerActionSpacing,
+ 2.0,
+ collapseProgress,
+ )!,
children: actionsBuilder(foregroundColor),
),
],
diff --git a/mobile/apps/photos/test/ui/viewer/gallery/album_cover_app_bar_test.dart b/mobile/apps/photos/test/ui/viewer/gallery/album_cover_app_bar_test.dart
index 7e8cac92a3..bafa5c4145 100644
--- a/mobile/apps/photos/test/ui/viewer/gallery/album_cover_app_bar_test.dart
+++ b/mobile/apps/photos/test/ui/viewer/gallery/album_cover_app_bar_test.dart
@@ -128,7 +128,7 @@ void main() {
);
}
final backIcon = tester.getRect(find.byIcon(Icons.arrow_back));
- expect(backIcon.left, size.width >= 1024 ? padding.left + 28 : 28);
+ expect(backIcon.left, size.width >= 1024 ? padding.left + 24 : 24);
final lastAction = tester.getRect(find.byType(IconButton).last);
expect(
lastAction.right,