Skip to content

armgit / ente

Public Imported from GitHub
0

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

Redesign date widget in full screen memory and add cta for jump to date

ashilkn484bcb70b047
diff --git a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
index d9bf3a2f4e..64869ea681 100644
--- a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
@@ -14,6 +14,7 @@ import "package:photos/models/memories/memory.dart";
import "package:photos/service_locator.dart";
import "package:photos/services/smart_memories_service.dart";
import "package:photos/theme/colors.dart";
+import "package:photos/theme/ente_theme.dart";
import "package:photos/theme/text_style.dart";
import "package:photos/ui/actions/file/file_actions.dart";
import "package:photos/ui/home/memories/custom_listener.dart";
@@ -21,7 +22,9 @@ import "package:photos/ui/home/memories/memory_progress_indicator.dart";
import "package:photos/ui/viewer/file/file_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
import "package:photos/ui/viewer/file_details/favorite_widget.dart";
+import "package:photos/ui/viewer/gallery/jump_to_date_gallery.dart";
import "package:photos/utils/file_util.dart";
+import "package:photos/utils/navigation_util.dart";
import "package:photos/utils/share_util.dart";
//There are two states of variables that FullScreenMemory depends on:
@@ -328,7 +331,11 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
onTap: () => Navigator.pop(context),
child: const Padding(
padding: EdgeInsets.fromLTRB(4, 8, 8, 8),
- child: Icon(Icons.close, color: Colors.white),
+ child: Icon(
+ Icons.close,
+ color: Colors.white,
+ size: 20,
+ ),
),
),
builder: (context, value, child) {
@@ -361,19 +368,51 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
Row(
children: [
child!,
- Text(
- SmartMemoriesService.getDateFormatted(
- creationTime: inheritedData
- .memories[value].file.creationTime!,
- context: context,
+ GestureDetector(
+ onTap: () => routeToPage(
+ context,
+ JumpToDateGallery(
+ fileToJumpTo:
+ inheritedData.memories[value].file,
+ ),
),
- style: Theme.of(context)
- .textTheme
- .titleMedium!
- .copyWith(
- fontSize: 14,
- color: Colors.white,
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(4),
+ // color: fillFaintDark,
+ color: blurStrokeFaintDark,
+ border: Border.all(
+ color: strokeFaintDark,
+ width: 1,
),
+ ),
+ child: Row(
+ children: [
+ const SizedBox(width: 2),
+ Padding(
+ padding: const EdgeInsets.all(2.0),
+ child: Text(
+ SmartMemoriesService.getDateFormatted(
+ creationTime: inheritedData
+ .memories[value]
+ .file
+ .creationTime!,
+ context: context,
+ ),
+ style: getEnteTextTheme(context)
+ .miniMuted
+ .copyWith(color: textBaseDark),
+ ),
+ ),
+ const SizedBox(width: 4),
+ const Icon(
+ Icons.keyboard_arrow_right_outlined,
+ size: 14,
+ color: blurStrokeBaseDark,
+ ),
+ ],
+ ),
+ ),
),
],
),
diff --git a/mobile/apps/photos/lib/ui/viewer/file_details/creation_time_item_widget.dart b/mobile/apps/photos/lib/ui/viewer/file_details/creation_time_item_widget.dart
index 735b1ac07b..7a1b415e7a 100644
--- a/mobile/apps/photos/lib/ui/viewer/file_details/creation_time_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file_details/creation_time_item_widget.dart
@@ -4,6 +4,8 @@ import 'package:photos/models/file/file.dart';
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/info_item_widget.dart";
import "package:photos/ui/viewer/date/edit_date_sheet.dart";
+import "package:photos/ui/viewer/gallery/jump_to_date_gallery.dart";
+import "package:photos/utils/navigation_util.dart";
import "package:photos/utils/standalone/date_time.dart";
class CreationTimeItem extends StatefulWidget {
@@ -22,24 +24,29 @@ class _CreationTimeItemState extends State<CreationTimeItem> {
widget.file.creationTime!,
isUtc: true,
).toLocal();
- return InfoItemWidget(
- key: const ValueKey("Creation time"),
- leadingIcon: Icons.calendar_today_outlined,
- title: DateFormat.yMMMEd(Localizations.localeOf(context).languageCode)
- .format(dateTime),
- subtitleSection: Future.value([
- Text(
- getTimeIn12hrFormat(dateTime) + " " + dateTime.timeZoneName,
- style: getEnteTextTheme(context).miniMuted,
- ),
- ]),
- editOnTap: ((widget.file.ownerID == null ||
- widget.file.ownerID == widget.currentUserID) &&
- widget.file.uploadedFileID != null)
- ? () {
- _showDateTimePicker(widget.file);
- }
- : null,
+ return GestureDetector(
+ onTap: () {
+ routeToPage(context, JumpToDateGallery(fileToJumpTo: widget.file));
+ },
+ child: InfoItemWidget(
+ key: const ValueKey("Creation time"),
+ leadingIcon: Icons.calendar_today_outlined,
+ title: DateFormat.yMMMEd(Localizations.localeOf(context).languageCode)
+ .format(dateTime),
+ subtitleSection: Future.value([
+ Text(
+ getTimeIn12hrFormat(dateTime) + " " + dateTime.timeZoneName,
+ style: getEnteTextTheme(context).miniMuted,
+ ),
+ ]),
+ editOnTap: ((widget.file.ownerID == null ||
+ widget.file.ownerID == widget.currentUserID) &&
+ widget.file.uploadedFileID != null)
+ ? () {
+ _showDateTimePicker(widget.file);
+ }
+ : null,
+ ),
);
}