Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add new PNG assets for collection and file deletion icons

AmanRajSinghMourya6282dcb8d49d
diff --git a/mobile/apps/locker/assets/2.0x/delete_icon.png b/mobile/apps/locker/assets/2.0x/collection_delete_icon.png
similarity index 100%
rename from mobile/apps/locker/assets/2.0x/delete_icon.png
rename to mobile/apps/locker/assets/2.0x/collection_delete_icon.png
diff --git a/mobile/apps/locker/assets/2.0x/file_delete_icon.png b/mobile/apps/locker/assets/2.0x/file_delete_icon.png
new file mode 100644
index 0000000000..1f8d1ffc21
Binary files /dev/null and b/mobile/apps/locker/assets/2.0x/file_delete_icon.png differ
diff --git a/mobile/apps/locker/assets/3.0x/delete_icon.png b/mobile/apps/locker/assets/3.0x/collection_delete_icon.png
similarity index 100%
rename from mobile/apps/locker/assets/3.0x/delete_icon.png
rename to mobile/apps/locker/assets/3.0x/collection_delete_icon.png
diff --git a/mobile/apps/locker/assets/3.0x/file_delete_icon.png b/mobile/apps/locker/assets/3.0x/file_delete_icon.png
new file mode 100644
index 0000000000..e49a288046
Binary files /dev/null and b/mobile/apps/locker/assets/3.0x/file_delete_icon.png differ
diff --git a/mobile/apps/locker/assets/delete_icon.png b/mobile/apps/locker/assets/collection_delete_icon.png
similarity index 100%
rename from mobile/apps/locker/assets/delete_icon.png
rename to mobile/apps/locker/assets/collection_delete_icon.png
diff --git a/mobile/apps/locker/assets/file_delete_icon.png b/mobile/apps/locker/assets/file_delete_icon.png
new file mode 100644
index 0000000000..49c3f27573
Binary files /dev/null and b/mobile/apps/locker/assets/file_delete_icon.png differ
diff --git a/mobile/apps/locker/lib/services/collections/collections_service.dart b/mobile/apps/locker/lib/services/collections/collections_service.dart
index 4b26b3d78b..e2d00ee261 100644
--- a/mobile/apps/locker/lib/services/collections/collections_service.dart
+++ b/mobile/apps/locker/lib/services/collections/collections_service.dart
@@ -110,7 +110,7 @@ class CollectionService {
}
await Future.wait(fileFutures);
if (updatedCollections.isNotEmpty) {
- Bus.instance.fire(CollectionsUpdatedEvent());
+ Bus.instance.fire(CollectionsUpdatedEvent('sync'));
}
}
@@ -237,7 +237,7 @@ class CollectionService {
await _db.addFilesToCollection(collection, [file]);
// Fire event to update UI
- Bus.instance.fire(CollectionsUpdatedEvent());
+ Bus.instance.fire(CollectionsUpdatedEvent('add_to_collection'));
if (runSync) {
// Also sync to ensure we have the latest state from server
@@ -259,7 +259,7 @@ class CollectionService {
await _db.deleteFilesFromCollection(collection, [file]);
// Fire event to update UI
- Bus.instance.fire(CollectionsUpdatedEvent());
+ Bus.instance.fire(CollectionsUpdatedEvent('trash_file'));
// Also sync to ensure we have the latest state
await sync();
diff --git a/mobile/apps/locker/lib/ui/components/delete_confirmation_dialog.dart b/mobile/apps/locker/lib/ui/components/delete_confirmation_dialog.dart
index 84ae6b47f1..b12396b042 100644
--- a/mobile/apps/locker/lib/ui/components/delete_confirmation_dialog.dart
+++ b/mobile/apps/locker/lib/ui/components/delete_confirmation_dialog.dart
@@ -9,6 +9,7 @@ Future<ButtonResult?> showDeleteConfirmationDialog(
required String title,
required String body,
required String deleteButtonLabel,
+ required String assetPath,
}) {
return showModalBottomSheet<ButtonResult>(
context: context,
@@ -19,6 +20,7 @@ Future<ButtonResult?> showDeleteConfirmationDialog(
title: title,
body: body,
deleteButtonLabel: deleteButtonLabel,
+ assetPath: assetPath,
);
},
);
@@ -28,11 +30,13 @@ class _DeleteConfirmationBottomSheet extends StatelessWidget {
final String title;
final String body;
final String deleteButtonLabel;
+ final String assetPath;
const _DeleteConfirmationBottomSheet({
required this.title,
required this.body,
required this.deleteButtonLabel,
+ required this.assetPath,
});
@override
@@ -77,7 +81,7 @@ class _DeleteConfirmationBottomSheet extends StatelessWidget {
],
),
const SizedBox(height: 8),
- Image.asset('assets/delete_icon.png'),
+ Image.asset(assetPath),
const SizedBox(height: 24),
Text(
title,
diff --git a/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart b/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart
index 06a83204c8..6c08894b85 100644
--- a/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart
+++ b/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart
@@ -2,7 +2,6 @@ import "package:ente_ui/components/buttons/gradient_button.dart";
import 'package:ente_ui/theme/ente_theme.dart';
import 'package:flutter/material.dart';
import 'package:locker/l10n/l10n.dart';
-import 'package:locker/services/collections/collections_service.dart';
import 'package:locker/services/collections/models/collection.dart';
import 'package:locker/services/files/sync/models/file.dart';
import 'package:locker/ui/components/collection_selection_widget.dart';
@@ -49,15 +48,6 @@ class _FileEditDialogState extends State<FileEditDialog> {
_titleController.text = widget.file.displayName;
_captionController.text = widget.file.caption ?? '';
-
- CollectionService.instance
- .getCollectionsForFile(widget.file)
- .then((fileCollections) {
- for (final collection in fileCollections) {
- _selectedCollectionIds.add(collection.id);
- }
- setState(() {});
- });
}
@override
@@ -119,7 +109,6 @@ class _FileEditDialogState extends State<FileEditDialog> {
return Dialog(
backgroundColor: colorScheme.backgroundBase,
- insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 360),
child: Container(
@@ -134,7 +123,7 @@ class _FileEditDialogState extends State<FileEditDialog> {
),
],
),
- padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -168,8 +157,8 @@ class _FileEditDialogState extends State<FileEditDialog> {
height: 36,
width: 36,
decoration: BoxDecoration(
- color: colorScheme.backdropBase,
- borderRadius: BorderRadius.circular(18),
+ shape: BoxShape.circle,
+ color: colorScheme.backgroundElevated,
),
child: const Icon(
Icons.close_rounded,
diff --git a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
index 5e5cfc4f37..e36c69ca12 100644
--- a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
@@ -195,8 +195,9 @@ class FilePopupMenuWidget extends StatelessWidget {
final result = await showDeleteConfirmationDialog(
context,
title: context.l10n.areYouSure,
- body: context.l10n.deleteMultipleCollectionsDialogBody(1),
+ body: context.l10n.deleteMultipleFilesDialogBody(1),
deleteButtonLabel: context.l10n.yesDeleteFiles(1),
+ assetPath: "assets/file_delete_icon.png",
);
if (result?.action == ButtonAction.first && context.mounted) {
diff --git a/mobile/apps/locker/lib/ui/components/input_dialog_sheet.dart b/mobile/apps/locker/lib/ui/components/input_dialog_sheet.dart
index d44f3ff981..6f9272991f 100644
--- a/mobile/apps/locker/lib/ui/components/input_dialog_sheet.dart
+++ b/mobile/apps/locker/lib/ui/components/input_dialog_sheet.dart
@@ -77,86 +77,85 @@ class _InputDialogSheetState extends State<InputDialogSheet> {
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
- return Container(
- width: 400,
- decoration: BoxDecoration(
- color: colorScheme.backdropBase,
- borderRadius: BorderRadius.circular(24),
- ),
- padding: const EdgeInsets.symmetric(horizontal: 24),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const SizedBox(height: 24),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- widget.title,
- style: textTheme.largeBold,
- ),
- GestureDetector(
- onTap: () => Navigator.of(context).pop(),
- child: Container(
- decoration: BoxDecoration(
- color: colorScheme.backgroundElevated,
- shape: BoxShape.circle,
+ return SizedBox(
+ width: 360,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 24,
+ vertical: 24,
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ widget.title,
+ style: textTheme.largeBold,
+ ),
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Container(
+ decoration: BoxDecoration(
+ color: colorScheme.backgroundElevated,
+ shape: BoxShape.circle,
+ ),
+ padding: const EdgeInsets.all(6),
+ child: Icon(
+ Icons.close,
+ color: colorScheme.textBase,
+ size: 20,
+ ),
),
- padding: const EdgeInsets.all(6),
- child: Icon(
- Icons.close,
- color: colorScheme.textBase,
- size: 20,
+ ),
+ ],
+ ),
+ const SizedBox(height: 24),
+ TextField(
+ controller: _textController,
+ autofocus: true,
+ textCapitalization: widget.textCapitalization,
+ maxLength: widget.maxLength,
+ decoration: InputDecoration(
+ hintText: widget.hintText,
+ hintStyle: textTheme.body.copyWith(
+ color: colorScheme.textMuted,
+ ),
+ filled: true,
+ fillColor: colorScheme.fillFaint,
+ contentPadding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 16,
+ ),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(16),
+ borderSide: BorderSide.none,
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(16),
+ borderSide: BorderSide(
+ color: colorScheme.strokeFaint,
),
),
+ counterText: "",
),
- ],
- ),
- const SizedBox(height: 24),
- TextField(
- controller: _textController,
- autofocus: true,
- textCapitalization: widget.textCapitalization,
- maxLength: widget.maxLength,
- decoration: InputDecoration(
- hintText: widget.hintText,
- hintStyle: textTheme.body.copyWith(
- color: colorScheme.textMuted,
+ style: textTheme.body.copyWith(
+ color: colorScheme.textBase,
),
- filled: true,
- fillColor: colorScheme.fillFaint,
- contentPadding: const EdgeInsets.symmetric(
- horizontal: 16,
- vertical: 16,
- ),
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(8),
- borderSide: BorderSide.none,
- ),
- focusedBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(8),
- borderSide: BorderSide(
- color: colorScheme.strokeFaint,
- ),
- ),
- counterText: "",
+ onSubmitted: (_) => _onSubmit(),
),
- style: textTheme.body.copyWith(
- color: colorScheme.textBase,
- ),
- onSubmitted: (_) => _onSubmit(),
- ),
- const SizedBox(height: 36),
- SizedBox(
- width: double.infinity,
- child: GradientButton(
- onTap: _isSubmitting ? null : _onSubmit,
- text: widget.submitButtonLabel,
+ const SizedBox(height: 36),
+ SizedBox(
+ width: double.infinity,
+ child: GradientButton(
+ onTap: _isSubmitting ? null : _onSubmit,
+ text: widget.submitButtonLabel,
+ ),
),
- ),
- const SizedBox(height: 24),
- ],
+ ],
+ ),
),
);
}
@@ -174,17 +173,29 @@ Future<dynamic> showInputDialogSheet(
}) async {
final result = await showDialog<dynamic>(
context: context,
- builder: (context) => Dialog(
- child: InputDialogSheet(
- title: title,
- hintText: hintText,
- submitButtonLabel: submitButtonLabel,
- onSubmit: onSubmit,
- initialValue: initialValue,
- textCapitalization: textCapitalization,
- maxLength: maxLength,
- ),
- ),
+ builder: (dialogContext) {
+ final colorScheme = getEnteColorScheme(dialogContext);
+ return Dialog(
+ backgroundColor: colorScheme.backdropBase,
+ clipBehavior: Clip.antiAlias,
+ insetPadding: const EdgeInsets.symmetric(
+ horizontal: 24,
+ vertical: 24,
+ ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(24),
+ ),
+ child: InputDialogSheet(
+ title: title,
+ hintText: hintText,
+ submitButtonLabel: submitButtonLabel,
+ onSubmit: onSubmit,
+ initialValue: initialValue,
+ textCapitalization: textCapitalization,
+ maxLength: maxLength,
+ ),
+ );
+ },
);
return result;
diff --git a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
index e396f39219..c570f9bce6 100644
--- a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
@@ -10,6 +10,7 @@ import 'package:locker/models/selected_collections.dart';
import 'package:locker/services/collections/collections_service.dart';
import 'package:locker/services/collections/models/collection.dart';
import 'package:locker/services/trash/trash_service.dart';
+import "package:locker/ui/components/empty_state_widget.dart";
import 'package:locker/ui/components/item_list_view.dart';
import 'package:locker/ui/pages/collection_page.dart';
import 'package:locker/ui/pages/trash_page.dart';
@@ -205,20 +206,13 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.start,
children: [
- const Icon(
- Icons.folder_open,
- size: 64,
- color: Colors.grey,
- ),
- const SizedBox(height: 16),
- Text(
- context.l10n.noCollectionsFound,
- style: textTheme.large.copyWith(
- color: Colors.grey,
- ),
- textAlign: TextAlign.center,
+ const EmptyStateWidget(
+ assetPath: 'assets/empty_state.png',
+ title: "No collection found",
+ subtitle: "",
+ showBorder: false,
),
const SizedBox(height: 20),
if (_uncategorizedCollection != null && showUncategorized)
diff --git a/mobile/apps/locker/lib/ui/sharing/share_collection_bottom_sheet.dart b/mobile/apps/locker/lib/ui/sharing/share_collection_bottom_sheet.dart
index e5c60ec6d9..3df3c22e0d 100644
--- a/mobile/apps/locker/lib/ui/sharing/share_collection_bottom_sheet.dart
+++ b/mobile/apps/locker/lib/ui/sharing/share_collection_bottom_sheet.dart
@@ -111,12 +111,12 @@ class _ShareCollectionBottomSheetState
_buildPublicLinkSection(colorScheme, textTheme),
const SizedBox(height: 12),
_buildShareLinkButton(),
+ const SizedBox(height: 24),
+ _buildAdvancedOptionsRow(colorScheme, textTheme),
+ const SizedBox(height: 24),
] else ...[
_buildCompactActionsCard(colorScheme, textTheme),
],
- const SizedBox(height: 24),
- _buildAdvancedOptionsRow(colorScheme, textTheme),
- const SizedBox(height: 24),
],
),
),
diff --git a/mobile/apps/locker/lib/utils/collection_actions.dart b/mobile/apps/locker/lib/utils/collection_actions.dart
index 8a5b7629f4..83579b762e 100644
--- a/mobile/apps/locker/lib/utils/collection_actions.dart
+++ b/mobile/apps/locker/lib/utils/collection_actions.dart
@@ -198,6 +198,7 @@ class CollectionActions {
title: context.l10n.areYouSure,
body: context.l10n.deleteCollectionDialogBody(collectionName),
deleteButtonLabel: context.l10n.yesDeleteCollections(1),
+ assetPath: "assets/collection_delete_icon.png",
);
if (result?.action != ButtonAction.first && context.mounted) {