Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] revamp memories cards design

Priyanshu Dangarefdeadd911a4d
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 ede3b8d096..cfafab1d39 100644
--- a/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/memories_widget.dart
@@ -65,10 +65,15 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
void didChangeDependencies() {
super.didChangeDependencies();
final screenWidth = MediaQuery.sizeOf(context).width;
- //factor will be 2 for most phones in portrait mode
- final factor = (screenWidth / 220).ceil();
- _memoryWidth = screenWidth / (factor * 2);
- _memoryheight = _memoryWidth / MemoryCoverWidget.aspectRatio;
+ final screenHeight = MediaQuery.sizeOf(context).height;
+
+ if (screenWidth < screenHeight) {
+ _memoryheight = screenHeight / 4.0;
+ _memoryWidth = _memoryheight / MemoryCoverWidget.aspectRatio;
+ } else {
+ _memoryheight = screenWidth / 3.0;
+ _memoryWidth = _memoryheight / MemoryCoverWidget.aspectRatio;
+ }
}
@override
@@ -198,6 +203,9 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
return SizedBox(
height: _memoryheight + MemoryCoverWidget.outerStrokeWidth * 2,
child: ListView.builder(
+ padding: const EdgeInsets.symmetric(
+ horizontal: MemoryCoverWidget.gap / 2.0,
+ ),
physics: const AlwaysScrollableScrollPhysics(
parent: BouncingScrollPhysics(),
),
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 fb42324350..72a734eeee 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
@@ -1,3 +1,4 @@
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:photos/models/memories/memory.dart";
@@ -15,8 +16,8 @@ class MemoryCoverWidget extends StatefulWidget {
final double height;
final double width;
static const outerStrokeWidth = 1.0;
- static const aspectRatio = 0.68;
- static const horizontalPadding = 2.5;
+ static const aspectRatio = 3.0 / 2.0;
+ static const gap = 5.0;
final String title;
final List<String> allTitle;
final int currentMemoryIndex;
@@ -54,7 +55,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
return Padding(
padding: const EdgeInsets.symmetric(
- horizontal: MemoryCoverWidget.horizontalPadding,
+ horizontal: MemoryCoverWidget.gap / 2.0,
),
child: GestureDetector(
onTap: () async {
@@ -83,10 +84,10 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
),
]
: [...shadowFloatFaintestLight],
- borderRadius: BorderRadius.circular(5),
+ borderRadius: BorderRadius.circular(22),
),
child: ClipRRect(
- borderRadius: BorderRadius.circular(5),
+ borderRadius: BorderRadius.circular(22),
child: Container(
foregroundDecoration: isSeen
? const BoxDecoration(
@@ -120,24 +121,22 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
),
),
Positioned(
- bottom: 8,
+ bottom: 0,
child: SizedBox(
width: widget.width,
child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ padding: const EdgeInsets.all(16.0),
child: Hero(
tag: title,
- child: Center(
- child: Text(
- title,
- style: getEnteTextTheme(context).miniBold
- .copyWith(
- color: isSeen
- ? textFaintDark
- : Colors.white,
- ),
- textAlign: TextAlign.left,
+ child: Text(
+ title,
+ style: getEnteTextTheme(context).body.copyWith(
+ fontSize: widget.height * 0.09,
+ fontFamily: TextStyles.outfitFontFamily,
+ color: isSeen ? textFaintDark : Colors.white,
+ fontWeight: .w500,
),
+ textAlign: TextAlign.left,
),
),
),