Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob][photos] Add illustrated empty states

Aman Raj689724df297c
diff --git a/mobile/apps/photos/assets/2.0x/empty_state_album_search.png b/mobile/apps/photos/assets/2.0x/empty_state_album_search.png
new file mode 100644
index 0000000000..1caa125bb1
Binary files /dev/null and b/mobile/apps/photos/assets/2.0x/empty_state_album_search.png differ
diff --git a/mobile/apps/photos/assets/2.0x/empty_state_links.png b/mobile/apps/photos/assets/2.0x/empty_state_links.png
new file mode 100644
index 0000000000..4983e5d068
Binary files /dev/null and b/mobile/apps/photos/assets/2.0x/empty_state_links.png differ
diff --git a/mobile/apps/photos/assets/2.0x/empty_state_trash.png b/mobile/apps/photos/assets/2.0x/empty_state_trash.png
new file mode 100644
index 0000000000..e2bd937053
Binary files /dev/null and b/mobile/apps/photos/assets/2.0x/empty_state_trash.png differ
diff --git a/mobile/apps/photos/assets/3.0x/empty_state_album_search.png b/mobile/apps/photos/assets/3.0x/empty_state_album_search.png
new file mode 100644
index 0000000000..fb6a0d25eb
Binary files /dev/null and b/mobile/apps/photos/assets/3.0x/empty_state_album_search.png differ
diff --git a/mobile/apps/photos/assets/3.0x/empty_state_links.png b/mobile/apps/photos/assets/3.0x/empty_state_links.png
new file mode 100644
index 0000000000..4d4e16b64e
Binary files /dev/null and b/mobile/apps/photos/assets/3.0x/empty_state_links.png differ
diff --git a/mobile/apps/photos/assets/3.0x/empty_state_trash.png b/mobile/apps/photos/assets/3.0x/empty_state_trash.png
new file mode 100644
index 0000000000..ad9e2bc680
Binary files /dev/null and b/mobile/apps/photos/assets/3.0x/empty_state_trash.png differ
diff --git a/mobile/apps/photos/assets/empty_state_album_search.png b/mobile/apps/photos/assets/empty_state_album_search.png
new file mode 100644
index 0000000000..8e5853439b
Binary files /dev/null and b/mobile/apps/photos/assets/empty_state_album_search.png differ
diff --git a/mobile/apps/photos/assets/empty_state_links.png b/mobile/apps/photos/assets/empty_state_links.png
new file mode 100644
index 0000000000..3c3d43fa58
Binary files /dev/null and b/mobile/apps/photos/assets/empty_state_links.png differ
diff --git a/mobile/apps/photos/assets/empty_state_trash.png b/mobile/apps/photos/assets/empty_state_trash.png
new file mode 100644
index 0000000000..c5b5f19311
Binary files /dev/null and b/mobile/apps/photos/assets/empty_state_trash.png differ
diff --git a/mobile/apps/photos/changes/illustrated-empty-states.md b/mobile/apps/photos/changes/illustrated-empty-states.md
new file mode 100644
index 0000000000..d9d9a60ce0
--- /dev/null
+++ b/mobile/apps/photos/changes/illustrated-empty-states.md
@@ -0,0 +1 @@
+- Added empty states for album search, links, and trash.
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index a89ba6da7a..77b3edbeb0 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -1266,6 +1266,7 @@
"photosAddedByYouWillBeRemovedFromTheAlbum": "Photos added by you will be removed from the album",
"youveNoFilesInThisAlbumThatCanBeDeleted": "You've no files in this album that can be deleted",
"youDontHaveAnyArchivedItems": "You don't have any archived items.",
+ "deletedItemsStayHereForThirtyDays": "Deleted items stay here for 30 days",
"ignoredFolderUploadReason": "Some files in this album are ignored from upload because they had previously been deleted from Ente.",
"resetIgnoredFiles": "Reset ignored files",
"deviceFilesAutoUploading": "Files added to this device album will automatically get uploaded to Ente.",
@@ -1294,6 +1295,7 @@
"searchByExamples": "• Album names (e.g. \"Camera\")\n• Types of files (e.g. \"Videos\", \".gif\")\n• Years and months (e.g. \"2022\", \"January\")\n• Holidays (e.g. \"Christmas\")\n• Photo descriptions (e.g. “#fun”)",
"youCanTrySearchingForADifferentQuery": "You can try searching for a different query.",
"noResultsFound": "No results found",
+ "noMatchesFound": "No matches found!",
"addedBy": "Added by {emailOrName}",
"loadingExifData": "Loading EXIF data...",
"viewAllExifData": "View all EXIF data",
@@ -1699,6 +1701,7 @@
"enableMaps": "Enable Maps",
"links": "Links",
"noLinksYet": "No links yet",
+ "activeLinksWillShowUpHere": "Active links will show up here",
"quickLinks": "Quick links",
"selectItemsToAdd": "Select items to add",
"addSelected": "Add selected",
diff --git a/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart b/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart
index 1e68ff2cd2..c0e544902e 100644
--- a/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart
@@ -38,7 +38,7 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {
static const sectionBottomPadding = 16.0;
static const titleVerticalPadding = 8.0;
static const listTopPadding = 8.0;
- static const gridItemTextHeight = 48.0;
+ static const gridItemTextHeight = 52.0;
@override
void initState() {
diff --git a/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart b/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart
deleted file mode 100644
index e720f3176f..0000000000
--- a/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-import "package:flutter/material.dart";
-import "package:photos/theme/ente_theme.dart";
-
-class SoftIconButton extends StatelessWidget {
- final Widget icon;
- final VoidCallback onTap;
- final GestureTapDownCallback? onTapDown;
-
- const SoftIconButton({
- super.key,
- required this.icon,
- required this.onTap,
- this.onTapDown,
- });
-
- @override
- Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
- return GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTapDown: onTapDown,
- onTap: onTap,
- child: Container(
- padding: const EdgeInsets.all(10),
- decoration: BoxDecoration(
- color: colorScheme.fill,
- borderRadius: BorderRadius.circular(12),
- ),
- child: icon,
- ),
- );
- }
-}
diff --git a/mobile/apps/photos/lib/ui/components/empty_state_component.dart b/mobile/apps/photos/lib/ui/components/empty_state_component.dart
new file mode 100644
index 0000000000..93317e85f0
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/components/empty_state_component.dart
@@ -0,0 +1,44 @@
+import "package:ente_components/ente_components.dart";
+import "package:flutter/material.dart";
+
+class EmptyStateComponent extends StatelessWidget {
+ const EmptyStateComponent({
+ required this.assetPath,
+ required this.title,
+ this.textWidth = 285,
+ this.spacing = 20,
+ this.padding = const EdgeInsets.all(24),
+ super.key,
+ });
+
+ final String assetPath;
+ final String title;
+ final double textWidth;
+ final double spacing;
+ final EdgeInsetsGeometry padding;
+
+ @override
+ Widget build(BuildContext context) {
+ final colors = context.componentColors;
+ return Center(
+ child: Padding(
+ padding: padding,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Image.asset(assetPath),
+ SizedBox(height: spacing),
+ SizedBox(
+ width: textWidth,
+ child: Text(
+ title,
+ textAlign: TextAlign.center,
+ style: TextStyles.display2.copyWith(color: colors.textBase),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/components/popup_menu/ente_popup_menu_button.dart b/mobile/apps/photos/lib/ui/components/popup_menu/ente_popup_menu_button.dart
index 6bf84afc3f..ae42b4ca63 100644
--- a/mobile/apps/photos/lib/ui/components/popup_menu/ente_popup_menu_button.dart
+++ b/mobile/apps/photos/lib/ui/components/popup_menu/ente_popup_menu_button.dart
@@ -1,9 +1,9 @@
import "dart:async";
+import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/components/buttons/soft_icon_button.dart";
class EntePopupMenuOption<T> {
const EntePopupMenuOption({
@@ -53,15 +53,12 @@ class EntePopupMenuButton<T> extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
final child = this.child;
if (child == null) {
- return SoftIconButton(
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedMoreVertical,
- size: 18,
- color: colorScheme.textBase,
- ),
+ return IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(icon: HugeIcons.strokeRoundedMoreVertical),
onTap: () => _showMenu(context),
);
}
diff --git a/mobile/apps/photos/lib/ui/components/searchable_appbar.dart b/mobile/apps/photos/lib/ui/components/searchable_appbar.dart
index 91f5c5ebfd..e4d9dc00cd 100644
--- a/mobile/apps/photos/lib/ui/components/searchable_appbar.dart
+++ b/mobile/apps/photos/lib/ui/components/searchable_appbar.dart
@@ -1,8 +1,6 @@
import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
-import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/components/buttons/soft_icon_button.dart";
class SearchableAppBar extends StatefulWidget {
final Widget title;
@@ -90,7 +88,6 @@ class _SearchableAppBarState extends State<SearchableAppBar> {
@override
Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
return SliverAppBar(
floating: !widget.pinned,
pinned: widget.pinned,
@@ -122,12 +119,10 @@ class _SearchableAppBarState extends State<SearchableAppBar> {
: [
Padding(
padding: widget.searchIconPadding,
- child: SoftIconButton(
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedSearch01,
- size: 18,
- color: colorScheme.textBase,
- ),
+ child: IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(icon: HugeIcons.strokeRoundedSearch01),
onTap: _activateSearch,
),
),
diff --git a/mobile/apps/photos/lib/ui/tabs/albums_tab.dart b/mobile/apps/photos/lib/ui/tabs/albums_tab.dart
index 90c4200238..edc352c01b 100644
--- a/mobile/apps/photos/lib/ui/tabs/albums_tab.dart
+++ b/mobile/apps/photos/lib/ui/tabs/albums_tab.dart
@@ -26,6 +26,7 @@ import "package:photos/ui/collections/collection_list_page.dart";
import "package:photos/ui/collections/device/device_folders_vertical_grid_view.dart";
import "package:photos/ui/collections/flex_grid_view.dart";
import "package:photos/ui/common/loading_widget.dart";
+import "package:photos/ui/components/empty_state_component.dart";
import "package:photos/ui/components/popup_menu/ente_popup_menu_button.dart";
import "package:photos/ui/tabs/albums/albums_manage_sheet.dart";
import "package:photos/ui/tabs/albums/empty_states/on_ente_empty_state.dart";
@@ -452,18 +453,12 @@ class _AlbumsTabState extends State<AlbumsTab>
}
Widget _buildGlobalSearchEmptyStateSliver(AppLocalizations strings) {
- final colors = context.componentColors;
return SliverFillRemaining(
hasScrollBody: false,
- child: Center(
- child: Padding(
- padding: const EdgeInsets.all(24),
- child: Text(
- strings.noResultsFound,
- textAlign: TextAlign.center,
- style: TextStyles.body.copyWith(color: colors.textLight),
- ),
- ),
+ child: EmptyStateComponent(
+ assetPath: "assets/empty_state_album_search.png",
+ title: strings.noMatchesFound,
+ textWidth: 240,
),
);
}
diff --git a/mobile/apps/photos/lib/ui/tabs/shared/all_links_page.dart b/mobile/apps/photos/lib/ui/tabs/shared/all_links_page.dart
index 695058efce..10e2eb1b30 100644
--- a/mobile/apps/photos/lib/ui/tabs/shared/all_links_page.dart
+++ b/mobile/apps/photos/lib/ui/tabs/shared/all_links_page.dart
@@ -12,13 +12,12 @@ import "package:photos/models/collection/collection.dart";
import "package:photos/models/collection/collection_items.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/services/memory_share_service.dart";
-import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/actions/collection/collection_sharing_actions.dart";
import "package:photos/ui/components/alert_bottom_sheet.dart";
import "package:photos/ui/components/buttons/button_widget.dart"
show ButtonAction;
import "package:photos/ui/components/buttons/button_widget_v2.dart";
-import "package:photos/ui/components/buttons/soft_icon_button.dart";
+import "package:photos/ui/components/empty_state_component.dart";
import "package:photos/ui/sharing/memory_link_details_sheet.dart";
import "package:photos/ui/tabs/shared/memory_link_item.dart";
import "package:photos/ui/tabs/shared/quick_link_album_item.dart";
@@ -155,14 +154,13 @@ class _AllLinksPageState extends State<AllLinksPage> {
@override
Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
final linkItems = <Object>[...widget.quickLinks, ...widget.memoryShares];
final hasLinks = linkItems.isNotEmpty;
final linksCount = widget.quickLinks.length + widget.memoryShares.length;
return Scaffold(
- backgroundColor: context.componentColors.backgroundBase,
+ backgroundColor: colors.backgroundBase,
body: AppBarComponent(
title: AppLocalizations.of(context).links,
subtitle: AppLocalizations.of(context).itemCount(count: linksCount),
@@ -173,12 +171,13 @@ class _AllLinksPageState extends State<AllLinksPage> {
switchInCurve: Curves.easeOut,
switchOutCurve: Curves.easeIn,
child: _hasSelection
- ? SoftIconButton(
+ ? IconButtonComponent(
key: const ValueKey("delete_links"),
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
icon: HugeIcon(
icon: HugeIcons.strokeRoundedDelete01,
- size: 18,
- color: colorScheme.warning500,
+ color: colors.warning,
),
onTap: _removeSelectedLinks,
)
@@ -244,15 +243,9 @@ class _AllLinksPageState extends State<AllLinksPage> {
if (!hasLinks)
SliverFillRemaining(
hasScrollBody: false,
- child: Center(
- child: Padding(
- padding: const EdgeInsets.all(32),
- child: Text(
- AppLocalizations.of(context).noLinksYet,
- style: textTheme.bodyMuted,
- textAlign: TextAlign.center,
- ),
- ),
+ child: EmptyStateComponent(
+ assetPath: "assets/empty_state_links.png",
+ title: AppLocalizations.of(context).activeLinksWillShowUpHere,
),
),
],
diff --git a/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart b/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
index 2f4723e039..fd252f387b 100644
--- a/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
+++ b/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
@@ -1,8 +1,8 @@
+import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
import "package:photos/db/files_db.dart";
import "package:photos/generated/l10n.dart";
import 'package:photos/models/file/file.dart';
-import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/collection_share_badge.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
@@ -41,8 +41,7 @@ class MemoryLinkAlbumItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return GestureDetector(
behavior: HitTestBehavior.opaque,
@@ -54,9 +53,9 @@ class MemoryLinkAlbumItem extends StatelessWidget {
constraints: const BoxConstraints(minHeight: _rowHeight),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
- color: colorScheme.fill,
+ color: colors.fillBase,
border: Border.all(
- color: isSelected ? colorScheme.strokeDark : colorScheme.fill,
+ color: isSelected ? colors.strokeDark : colors.fillBase,
),
borderRadius: const BorderRadius.all(Radius.circular(_cardRadius)),
),
@@ -130,7 +129,9 @@ class MemoryLinkAlbumItem extends StatelessWidget {
AppLocalizations.of(
context,
).itemCount(count: fileCount ?? 0),
- style: textTheme.smallMuted,
+ style: TextStyles.mini.copyWith(
+ color: colors.textLight,
+ ),
maxLines: 1,
softWrap: false,
overflow: TextOverflow.ellipsis,
diff --git a/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart b/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
index a503aa0e62..39eea6c5d0 100644
--- a/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
+++ b/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
@@ -1,9 +1,9 @@
+import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
import "package:photos/generated/l10n.dart";
import 'package:photos/models/collection/collection.dart';
import 'package:photos/models/file/file.dart';
import "package:photos/services/collections_service.dart";
-import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/collection_share_badge.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
@@ -27,8 +27,7 @@ class QuickLinkAlbumItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool isSelected = selectedQuickLinks.contains(c);
- final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
+ final colors = context.componentColors;
return AnimatedContainer(
curve: Curves.easeOut,
@@ -36,9 +35,9 @@ class QuickLinkAlbumItem extends StatelessWidget {
constraints: const BoxConstraints(minHeight: _rowHeight),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
- color: colorScheme.fill,
+ color: colors.fillBase,
border: Border.all(
- color: isSelected ? colorScheme.strokeDark : colorScheme.fill,
+ color: isSelected ? colors.strokeDark : colors.fillBase,
),
borderRadius: const BorderRadius.all(Radius.circular(_cardRadius)),
),
@@ -117,7 +116,9 @@ class QuickLinkAlbumItem extends StatelessWidget {
AppLocalizations.of(
context,
).itemCount(count: snapshot.data!),
- style: textTheme.smallMuted,
+ style: TextStyles.mini.copyWith(
+ color: colors.textLight,
+ ),
maxLines: 1,
softWrap: false,
overflow: TextOverflow.ellipsis,
@@ -125,8 +126,8 @@ class QuickLinkAlbumItem extends StatelessWidget {
}
return Text(
"",
- style: textTheme.small.copyWith(
- color: colorScheme.textMuted,
+ style: TextStyles.mini.copyWith(
+ color: colors.textLight,
),
maxLines: 1,
softWrap: false,
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart b/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
index 3d44965f65..8d98d27c9b 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
@@ -11,6 +11,7 @@ import "package:photos/generated/l10n.dart";
import 'package:photos/models/gallery_type.dart';
import 'package:photos/models/selected_files.dart';
import 'package:photos/ui/common/bottom_shadow.dart';
+import "package:photos/ui/components/empty_state_component.dart";
import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';
import 'package:photos/ui/viewer/gallery/gallery.dart';
import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';
@@ -64,6 +65,10 @@ class TrashPage extends StatelessWidget {
selectedFiles: _selectedFiles,
header: _headerWidget(),
initialFiles: null,
+ emptyState: EmptyStateComponent(
+ assetPath: "assets/empty_state_trash.png",
+ title: AppLocalizations.of(context).deletedItemsStayHereForThirtyDays,
+ ),
);
return GalleryBoundariesProvider(