Skip to content

armgit / ente

Public Imported from GitHub
0

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

update on device empty state with ducky illustration

Prateek Sunal8b2948f19691
diff --git a/mobile/apps/photos/assets/2.0x/ducky_folders.png b/mobile/apps/photos/assets/2.0x/ducky_folders.png
new file mode 100644
index 0000000000..49e439b04a
Binary files /dev/null and b/mobile/apps/photos/assets/2.0x/ducky_folders.png differ
diff --git a/mobile/apps/photos/assets/3.0x/ducky_folders.png b/mobile/apps/photos/assets/3.0x/ducky_folders.png
new file mode 100644
index 0000000000..1b1768aca8
Binary files /dev/null and b/mobile/apps/photos/assets/3.0x/ducky_folders.png differ
diff --git a/mobile/apps/photos/assets/ducky_folders.png b/mobile/apps/photos/assets/ducky_folders.png
new file mode 100644
index 0000000000..9da7f61024
Binary files /dev/null and b/mobile/apps/photos/assets/ducky_folders.png differ
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 87fe59fddc..0507d3fa24 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -892,6 +892,8 @@
"clickOnTheOverflowMenu": "β€’ Click on the overflow menu",
"click": "β€’ Click",
"nothingToSeeHere": "Nothing to see here! πŸ‘€",
+ "selectFolders": "Select folders",
+ "toViewAndBackupOnEnte": " to view and\nbackup on ente.",
"unarchiveAlbum": "Unarchive album",
"archiveAlbum": "Archive album",
"calculating": "Calculating...",
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart
new file mode 100644
index 0000000000..d704b7acc1
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart
@@ -0,0 +1,51 @@
+import 'package:flutter/material.dart';
+import 'package:photos/generated/l10n.dart';
+import 'package:photos/theme/ente_theme.dart';
+
+class DeviceFoldersEmptyState extends StatelessWidget {
+ const DeviceFoldersEmptyState({super.key});
+
+ static const Color _selectFoldersGreen = Color(0xFF08C225);
+
+ @override
+ Widget build(BuildContext context) {
+ final textTheme = getEnteTextTheme(context);
+
+ return Center(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Image.asset(
+ "assets/ducky_folders.png",
+ width: 138,
+ height: 120,
+ ),
+ const SizedBox(height: 16),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 10),
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: AppLocalizations.of(context).selectFolders,
+ style: textTheme.small.copyWith(
+ color: _selectFoldersGreen,
+ ),
+ ),
+ TextSpan(
+ text: AppLocalizations.of(context).toViewAndBackupOnEnte,
+ style: textTheme.smallMuted,
+ ),
+ ],
+ ),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
index 8a8e7feff7..27db148dff 100644
--- a/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
+++ b/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
@@ -82,10 +82,7 @@ class _DeviceFoldersGridViewState extends State<DeviceFoldersGridView> {
// If permission was skipped, show add folders prompt
if (hasSkippedPermission) {
- return SizedBox(
- height: sideOfThumbnail + 46,
- child: _buildAddFoldersState(context),
- );
+ return _buildAddFoldersState(context);
}
return SizedBox(
@@ -138,32 +135,47 @@ class _DeviceFoldersGridViewState extends State<DeviceFoldersGridView> {
}
Widget _buildAddFoldersState(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
+ const selectFoldersGreen = Color(0xFF08C225);
return Center(
child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text.rich(
- TextSpan(
- children: [
- TextSpan(
- text: "Select folders",
- style: TextStyle(
- color: colorScheme.primary500,
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Image.asset(
+ "assets/ducky_folders.png",
+ width: 138,
+ height: 120,
+ ),
+ const SizedBox(height: 16),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 10),
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: AppLocalizations.of(context).selectFolders,
+ style: textTheme.small.copyWith(
+ color: selectFoldersGreen,
+ ),
+ recognizer: TapGestureRecognizer()
+ ..onTap = () async {
+ await handleFolderSelectionBackupFlow(context);
+ if (mounted) setState(() {});
+ },
+ ),
+ TextSpan(
+ text: AppLocalizations.of(context).toViewAndBackupOnEnte,
+ style: textTheme.smallMuted,
+ ),
+ ],
),
- recognizer: TapGestureRecognizer()
- ..onTap = () async {
- await handleFolderSelectionBackupFlow(context);
- },
- ),
- const TextSpan(
- text: " to view and back up on ente",
+ textAlign: TextAlign.center,
),
- ],
- ),
- style: textTheme.smallMuted,
- textAlign: TextAlign.center,
+ ),
+ ],
),
),
);
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
index fe0c2f58f0..8584bcf2eb 100644
--- a/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
+++ b/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
@@ -11,9 +11,9 @@ import 'package:photos/events/local_photos_updated_event.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/models/device_collection.dart';
import "package:photos/ui/collections/device/device_folder_item.dart";
+import "package:photos/ui/collections/device/device_folders_empty_state.dart";
import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/components/searchable_appbar.dart';
-import 'package:photos/ui/viewer/gallery/empty_state.dart';
import "package:photos/utils/standalone/debouncer.dart";
class DeviceFolderVerticalGridView extends StatefulWidget {
@@ -149,7 +149,9 @@ class _DeviceFolderVerticalGridViewBodyState
albumsCountInCrossAxis;
return deviceCollections.isEmpty
- ? const SliverFillRemaining(child: EmptyState())
+ ? const SliverFillRemaining(
+ child: DeviceFoldersEmptyState(),
+ )
: SliverPadding(
padding: const EdgeInsets.only(
left: horizontalPadding / 2,
diff --git a/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart b/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
index 684bae72b6..23b1092575 100644
--- a/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
+++ b/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
@@ -5,6 +5,7 @@ import 'package:logging/logging.dart';
import "package:photos/core/configuration.dart";
import 'package:photos/core/event_bus.dart';
import "package:photos/events/album_sort_order_change_event.dart";
+import "package:photos/events/backup_folders_updated_event.dart";
import 'package:photos/events/collection_updated_event.dart';
import "package:photos/events/favorites_service_init_complete_event.dart";
import 'package:photos/events/local_photos_updated_event.dart';
@@ -12,6 +13,7 @@ import 'package:photos/events/user_logged_out_event.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/models/collection/collection.dart';
import "package:photos/models/selected_albums.dart";
+import "package:photos/service_locator.dart";
import 'package:photos/services/collections_service.dart';
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/collections/button/archived_button.dart";
@@ -50,6 +52,7 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
late StreamSubscription<FavoritesServiceInitCompleteEvent>
_favoritesServiceInitCompleteEvent;
late StreamSubscription<AlbumSortOrderChangeEvent> _albumSortOrderChangeEvent;
+ late StreamSubscription<BackupFoldersUpdatedEvent> _backupFoldersUpdatedEvent;
String _loadReason = "init";
final _scrollController = ScrollController();
@@ -97,6 +100,11 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
_loadReason = event.reason;
setState(() {});
});
+ _backupFoldersUpdatedEvent =
+ Bus.instance.on<BackupFoldersUpdatedEvent>().listen((event) {
+ _loadReason = event.reason;
+ if (mounted) setState(() {});
+ });
}
@override
@@ -137,33 +145,9 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
slivers: [
SliverToBoxAdapter(
child: SectionOptions(
- onTap: () {
- unawaited(
- routeToPage(
- context,
- DeviceFolderVerticalGridView(
- appTitle: SectionTitle(
- title: AppLocalizations.of(context).onDevice,
- ),
- tag: "OnDeviceAppTitle",
- ),
- ),
- );
- },
- Hero(
- tag: "OnDeviceAppTitle",
- child: SectionTitle(
- title: AppLocalizations.of(context).onDevice,
- ),
- ),
- trailingWidget: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- IconButtonWidget(
- icon: Icons.search,
- iconButtonType: IconButtonType.secondary,
- iconColor: colorScheme.blurStrokePressed,
- onTap: () {
+ onTap: backupPreferenceService.hasSkippedOnboardingPermission
+ ? null
+ : () {
unawaited(
routeToPage(
context,
@@ -172,19 +156,49 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
title: AppLocalizations.of(context).onDevice,
),
tag: "OnDeviceAppTitle",
- startInSearchMode: true,
),
),
);
},
- ),
- IconButtonWidget(
- icon: Icons.chevron_right,
- iconButtonType: IconButtonType.secondary,
- iconColor: colorScheme.blurStrokePressed,
- ),
- ],
+ Hero(
+ tag: "OnDeviceAppTitle",
+ child: SectionTitle(
+ title: AppLocalizations.of(context).onDevice,
+ ),
),
+ trailingWidget: backupPreferenceService
+ .hasSkippedOnboardingPermission
+ ? null
+ : Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ IconButtonWidget(
+ icon: Icons.search,
+ iconButtonType: IconButtonType.secondary,
+ iconColor: colorScheme.blurStrokePressed,
+ onTap: () {
+ unawaited(
+ routeToPage(
+ context,
+ DeviceFolderVerticalGridView(
+ appTitle: SectionTitle(
+ title:
+ AppLocalizations.of(context).onDevice,
+ ),
+ tag: "OnDeviceAppTitle",
+ startInSearchMode: true,
+ ),
+ ),
+ );
+ },
+ ),
+ IconButtonWidget(
+ icon: Icons.chevron_right,
+ iconButtonType: IconButtonType.secondary,
+ iconColor: colorScheme.blurStrokePressed,
+ ),
+ ],
+ ),
),
),
const SliverToBoxAdapter(child: DeviceFoldersGridView()),
@@ -295,6 +309,7 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
_scrollController.dispose();
_debouncer.cancelDebounceTimer();
_albumSortOrderChangeEvent.cancel();
+ _backupFoldersUpdatedEvent.cancel();
super.dispose();
}