Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] update memories cards sizing to new design

Priyanshu Dangare79c0d3fd2dd7
diff --git a/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart b/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart
index 57fc198315..5a101da38e 100644
--- a/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart
@@ -67,10 +67,16 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
final screenWidth = MediaQuery.sizeOf(context).width;
final screenHeight = MediaQuery.sizeOf(context).height;
if (screenWidth < screenHeight) {
- _memoryWidth = min(screenWidth * .4352, 240);
+ _memoryWidth = min(
+ screenWidth * (MemoryCoverWidget.defaultWidth / 376.0),
+ MemoryCoverWidget.defaultWidth * 1.5,
+ );
_memoryheight = _memoryWidth * MemoryCoverWidget.aspectRatio;
} else {
- _memoryWidth = min(screenHeight * .35, 128);
+ _memoryWidth = min(
+ screenHeight * .3,
+ MemoryCoverWidget.defaultWidth * 1.5,
+ );
_memoryheight = _memoryWidth * MemoryCoverWidget.aspectRatio;
}
}
diff --git a/mobile/apps/photos/lib/ui/home/memories/memory_cover_widget.dart b/mobile/apps/photos/lib/ui/home/memories/memory_cover_widget.dart
index be70387903..84b7d408e9 100644
--- a/mobile/apps/photos/lib/ui/home/memories/memory_cover_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/memory_cover_widget.dart
@@ -14,8 +14,10 @@ class MemoryCoverWidget extends StatefulWidget {
final List<SmartMemory> allMemories;
final double height;
final double width;
+ static const defaultWidth = 145.011;
+ static const defaultHeight = 210.5;
static const outerStrokeWidth = 1.0;
- static const aspectRatio = 236.924 / 163.214;
+ static const aspectRatio = defaultHeight / defaultWidth;
static const gap = 5.0;
final int currentMemoryIndex;
@@ -73,11 +75,9 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
child: Container(
height: widget.height,
width: widget.width,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(22),
- ),
+ decoration: BoxDecoration(borderRadius: BorderRadius.circular(18)),
child: ClipRRect(
- borderRadius: BorderRadius.circular(22),
+ borderRadius: BorderRadius.circular(18),
child: Container(
foregroundDecoration: isSeen
? const BoxDecoration(