π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][locker] Remove unused image assets (#11143)
Aman Rajaa9887f5bf6e
diff --git a/mobile/apps/locker/assets/2.0x/file_lock.png b/mobile/apps/locker/assets/2.0x/file_lock.pngdeleted file mode 100644index 2f0ae3e20f..0000000000Binary files a/mobile/apps/locker/assets/2.0x/file_lock.png and /dev/null differdiff --git a/mobile/apps/locker/assets/2.0x/loading_photos_background.png b/mobile/apps/locker/assets/2.0x/loading_photos_background.pngdeleted file mode 100644index 520afbe559..0000000000Binary files a/mobile/apps/locker/assets/2.0x/loading_photos_background.png and /dev/null differdiff --git a/mobile/apps/locker/assets/2.0x/loading_photos_background_dark.png b/mobile/apps/locker/assets/2.0x/loading_photos_background_dark.pngdeleted file mode 100644index 31f41cbb4e..0000000000Binary files a/mobile/apps/locker/assets/2.0x/loading_photos_background_dark.png and /dev/null differdiff --git a/mobile/apps/locker/assets/2.0x/locker-logo.png b/mobile/apps/locker/assets/2.0x/locker-logo.pngdeleted file mode 100644index a13c8961b3..0000000000Binary files a/mobile/apps/locker/assets/2.0x/locker-logo.png and /dev/null differdiff --git a/mobile/apps/locker/assets/2.0x/recovery_key_sorry.png b/mobile/apps/locker/assets/2.0x/recovery_key_sorry.pngdeleted file mode 100644index df9a929629..0000000000Binary files a/mobile/apps/locker/assets/2.0x/recovery_key_sorry.png and /dev/null differdiff --git a/mobile/apps/locker/assets/2.0x/warning-yellow.png b/mobile/apps/locker/assets/2.0x/warning-yellow.pngdeleted file mode 100644index d466b66b03..0000000000Binary files a/mobile/apps/locker/assets/2.0x/warning-yellow.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/file_lock.png b/mobile/apps/locker/assets/3.0x/file_lock.pngdeleted file mode 100644index 629dd53833..0000000000Binary files a/mobile/apps/locker/assets/3.0x/file_lock.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/loading_photos_background.png b/mobile/apps/locker/assets/3.0x/loading_photos_background.pngdeleted file mode 100644index 8dece3fe9f..0000000000Binary files a/mobile/apps/locker/assets/3.0x/loading_photos_background.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/loading_photos_background_dark.png b/mobile/apps/locker/assets/3.0x/loading_photos_background_dark.pngdeleted file mode 100644index 551f9edcb1..0000000000Binary files a/mobile/apps/locker/assets/3.0x/loading_photos_background_dark.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/locker-logo.png b/mobile/apps/locker/assets/3.0x/locker-logo.pngdeleted file mode 100644index cf4357f55e..0000000000Binary files a/mobile/apps/locker/assets/3.0x/locker-logo.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/recovery_key_sorry.png b/mobile/apps/locker/assets/3.0x/recovery_key_sorry.pngdeleted file mode 100644index 75831f9b8d..0000000000Binary files a/mobile/apps/locker/assets/3.0x/recovery_key_sorry.png and /dev/null differdiff --git a/mobile/apps/locker/assets/3.0x/warning-yellow.png b/mobile/apps/locker/assets/3.0x/warning-yellow.pngdeleted file mode 100644index a396f2a2cb..0000000000Binary files a/mobile/apps/locker/assets/3.0x/warning-yellow.png and /dev/null differdiff --git a/mobile/apps/locker/assets/file_lock.png b/mobile/apps/locker/assets/file_lock.pngdeleted file mode 100644index 7416a8305d..0000000000Binary files a/mobile/apps/locker/assets/file_lock.png and /dev/null differdiff --git a/mobile/apps/locker/assets/loading_photos_background.png b/mobile/apps/locker/assets/loading_photos_background.pngdeleted file mode 100644index 8dece3fe9f..0000000000Binary files a/mobile/apps/locker/assets/loading_photos_background.png and /dev/null differdiff --git a/mobile/apps/locker/assets/loading_photos_background_dark.png b/mobile/apps/locker/assets/loading_photos_background_dark.pngdeleted file mode 100644index 551f9edcb1..0000000000Binary files a/mobile/apps/locker/assets/loading_photos_background_dark.png and /dev/null differdiff --git a/mobile/apps/locker/assets/locker-logo.png b/mobile/apps/locker/assets/locker-logo.pngdeleted file mode 100644index 3e4e946573..0000000000Binary files a/mobile/apps/locker/assets/locker-logo.png and /dev/null differdiff --git a/mobile/apps/locker/assets/recovery_key_sorry.png b/mobile/apps/locker/assets/recovery_key_sorry.pngdeleted file mode 100644index 70964cb79a..0000000000Binary files a/mobile/apps/locker/assets/recovery_key_sorry.png and /dev/null differdiff --git a/mobile/apps/locker/assets/warning-yellow.png b/mobile/apps/locker/assets/warning-yellow.pngdeleted file mode 100644index f6a48e2c15..0000000000Binary files a/mobile/apps/locker/assets/warning-yellow.png and /dev/null differdiff --git a/mobile/apps/locker/lib/models/ui_section_type.dart b/mobile/apps/locker/lib/models/ui_section_type.dartdeleted file mode 100644index 6bf623a869..0000000000--- a/mobile/apps/locker/lib/models/ui_section_type.dart+++ /dev/null@@ -1 +0,0 @@-enum UISectionType { incomingCollections, outgoingCollections, homeCollections }diff --git a/mobile/apps/locker/lib/services/collections/collections_service.dart b/mobile/apps/locker/lib/services/collections/collections_service.dartindex 1708c12808..a4c15a8b15 100644--- a/mobile/apps/locker/lib/services/collections/collections_service.dart+++ b/mobile/apps/locker/lib/services/collections/collections_service.dart@@ -16,7 +16,6 @@ import 'package:locker/events/collections_updated_event.dart';import 'package:locker/events/user_details_refresh_event.dart';import "package:locker/services/collections/collections_api_client.dart";import 'package:locker/services/collections/models/collection.dart';-import "package:locker/services/collections/models/collection_items.dart";import "package:locker/services/collections/models/files_split.dart";import "package:locker/services/collections/models/public_url.dart";import 'package:locker/services/configuration.dart';@@ -241,27 +240,6 @@ class CollectionService {return null;}- Future<SharedCollections> getSharedCollections() async {- final List<Collection> outgoing = [];- final List<Collection> incoming = [];- final List<Collection> quickLinks = [];-- final List<Collection> collections = await getCollections();-- for (final c in collections) {- if (c.owner.id == Configuration.instance.getUserID()) {- if (c.hasSharees || c.hasLink && !c.isQuickLinkCollection()) {- outgoing.add(c);- } else if (c.isQuickLinkCollection()) {- quickLinks.add(c);- }- } else {- incoming.add(c);- }- }- return SharedCollections(outgoing, incoming, quickLinks);- }-Future<List<Collection>> getCollectionsForFile(EnteFile file) async {return _db.getCollectionsForFile(file);}diff --git a/mobile/apps/locker/lib/services/collections/models/collection_items.dart b/mobile/apps/locker/lib/services/collections/models/collection_items.dartdeleted file mode 100644index 438e7bb86c..0000000000--- a/mobile/apps/locker/lib/services/collections/models/collection_items.dart+++ /dev/null@@ -1,9 +0,0 @@-import "package:locker/services/collections/models/collection.dart";--class SharedCollections {- final List<Collection> outgoing;- final List<Collection> incoming;- final List<Collection> quickLinks;-- SharedCollections(this.outgoing, this.incoming, this.quickLinks);-}diff --git a/mobile/apps/locker/lib/ui/components/file_upload_sheet.dart b/mobile/apps/locker/lib/ui/components/file_upload_sheet.dartdeleted file mode 100644index 288c3d4e5e..0000000000--- a/mobile/apps/locker/lib/ui/components/file_upload_sheet.dart+++ /dev/null@@ -1,179 +0,0 @@-import 'dart:io';--import 'package:ente_ui/components/base_bottom_sheet.dart';-import 'package:ente_ui/components/buttons/button_widget.dart';-import 'package:ente_ui/components/buttons/models/button_type.dart';-import 'package:ente_ui/components/text_input_widget.dart';-import 'package:ente_ui/theme/ente_theme.dart';-import 'package:ente_ui/utils/toast_util.dart';-import 'package:flutter/material.dart';-import 'package:locker/l10n/l10n.dart';-import 'package:locker/services/collections/models/collection.dart';-import 'package:locker/ui/components/collection_selection_widget.dart';-import 'package:locker/utils/file_icon_utils.dart';-import 'package:path/path.dart' as path;--class FileUploadSheetResult {- final String note;- final List<Collection> selectedCollections;-- FileUploadSheetResult({- required this.note,- required this.selectedCollections,- });-}--class FileUploadSheet extends StatefulWidget {- final File file;- final List<Collection> collections;- final Collection? selectedCollection;-- const FileUploadSheet({- super.key,- required this.file,- required this.collections,- this.selectedCollection,- });-- @override- State<FileUploadSheet> createState() => _FileUploadSheetState();-}--class _FileUploadSheetState extends State<FileUploadSheet> {- final TextEditingController _noteController = TextEditingController();- final Set<int> _selectedCollectionIds = <int>{};- List<Collection> _availableCollections = [];-- @override- void initState() {- super.initState();- _availableCollections = List.from(widget.collections);- if (widget.selectedCollection != null) {- _selectedCollectionIds.add(widget.selectedCollection!.id);- }- }-- @override- void dispose() {- _noteController.dispose();- super.dispose();- }-- void _toggleCollection(int collectionId) {- setState(() {- if (_selectedCollectionIds.contains(collectionId)) {- _selectedCollectionIds.remove(collectionId);- } else {- _selectedCollectionIds.add(collectionId);- }- });- }-- void _onCollectionsUpdated(List<Collection> updatedCollections) {- setState(() {- _availableCollections = updatedCollections;- });- }-- Future<void> _onSave() async {- final selectedCollections = _availableCollections- .where((c) => _selectedCollectionIds.contains(c.id))- .toList();-- if (selectedCollections.isEmpty) {- showToast(context, context.l10n.pleaseSelectAtLeastOneCollection);- return;- }-- final result = FileUploadSheetResult(- note: _noteController.text.trim(),- selectedCollections: selectedCollections,- );-- Navigator.of(context).pop(result);- }-- String get _fileName {- return path.basename(widget.file.path);- }-- @override- Widget build(BuildContext context) {- final colorScheme = getEnteColorScheme(context);- final textTheme = getEnteTextTheme(context);-- return Column(- mainAxisSize: MainAxisSize.min,- crossAxisAlignment: CrossAxisAlignment.start,- children: [- Row(- children: [- FileIconUtils.getFileIcon(- _fileName,- size: 24,- showBackground: false,- ),- const SizedBox(width: 8),- Expanded(- child: Text(- _fileName,- style: textTheme.body,- overflow: TextOverflow.ellipsis,- ),- ),- ],- ),- const SizedBox(height: 20),- CollectionSelectionWidget(- collections: _availableCollections,- selectedCollectionIds: _selectedCollectionIds,- onToggleCollection: _toggleCollection,- onCollectionsUpdated: _onCollectionsUpdated,- title: context.l10n.collections,- ),- const SizedBox(height: 16),- Text(- context.l10n.note,- style: textTheme.small.copyWith(color: colorScheme.textBase),- ),- const SizedBox(height: 8),- TextInputWidget(- hintText: context.l10n.optionalNote,- initialValue: _noteController.text,- onChange: (value) => _noteController.text = value,- maxLength: 500,- textCapitalization: TextCapitalization.sentences,- ),- const SizedBox(height: 20),- SizedBox(- width: double.infinity,- child: ButtonWidget(- buttonType: ButtonType.primary,- labelText: context.l10n.upload,- onTap: _onSave,- isDisabled: _selectedCollectionIds.isEmpty,- ),- ),- ],- );- }-}--Future<FileUploadSheetResult?> showFileUploadSheet(- BuildContext context, {- required File file,- required List<Collection> collections,- Collection? selectedCollection,-}) async {- return showBaseBottomSheet<FileUploadSheetResult>(- context,- title: context.l10n.upload,- headerSpacing: 20,- isKeyboardAware: true,- child: FileUploadSheet(- file: file,- collections: collections,- selectedCollection: selectedCollection,- ),- );-}diff --git a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart b/mobile/apps/locker/lib/ui/pages/all_collections_page.dartindex 53139b91a6..f263637f13 100644--- a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart+++ b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart@@ -8,7 +8,6 @@ import "package:hugeicons/hugeicons.dart";import 'package:locker/events/collections_updated_event.dart';import 'package:locker/l10n/l10n.dart';import 'package:locker/models/selected_collections.dart';-import 'package:locker/models/ui_section_type.dart';import 'package:locker/services/collections/collections_service.dart';import 'package:locker/services/collections/models/collection.dart';import "package:locker/ui/components/empty_state_widget.dart";@@ -21,12 +20,7 @@ import 'package:locker/utils/collection_sort_util.dart';import 'package:logging/logging.dart';class AllCollectionsPage extends StatefulWidget {- final UISectionType viewType;-- const AllCollectionsPage({- super.key,- this.viewType = UISectionType.homeCollections,- });+ const AllCollectionsPage({super.key});@overrideState<AllCollectionsPage> createState() => _AllCollectionsPageState();@@ -55,9 +49,7 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {if (!mounted) return;await _loadCollections(showLoading: false);});- if (widget.viewType == UISectionType.homeCollections) {- showUncategorized = true;- }+ showUncategorized = true;}@override@@ -76,20 +68,7 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {}try {- List<Collection> collections = [];-- if (widget.viewType == UISectionType.homeCollections) {- collections = await CollectionService.instance.getCollections();- } else if (widget.viewType == UISectionType.outgoingCollections ||- widget.viewType == UISectionType.incomingCollections) {- final sharedCollections = await CollectionService.instance- .getSharedCollections();- if (widget.viewType == UISectionType.outgoingCollections) {- collections = sharedCollections.outgoing;- } else if (widget.viewType == UISectionType.incomingCollections) {- collections = sharedCollections.incoming;- }- }+ final collections = await CollectionService.instance.getCollections();final regularCollections = <Collection>[];Collection? uncategorized;@@ -105,13 +84,8 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {CollectionSortUtil.sortCollections(regularCollections);_sortedCollections = List.from(regularCollections);- _uncategorizedCollection =- widget.viewType == UISectionType.homeCollections- ? uncategorized- : null;- _uncategorizedFileCount =- uncategorized != null &&- widget.viewType == UISectionType.homeCollections+ _uncategorizedCollection = uncategorized;+ _uncategorizedFileCount = uncategorized != null? (await CollectionService.instance.getFilesInCollection(uncategorized,)).length@@ -234,7 +208,7 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- TitleBarTitleWidget(title: _getTitle(context)),+ TitleBarTitleWidget(title: context.l10n.collections),Text(_sortedCollections.length.toString() + " items",style: textTheme.smallMuted,@@ -364,15 +338,4 @@ class _AllCollectionsPageState extends State<AllCollectionsPage> {),);}-- String _getTitle(BuildContext context) {- switch (widget.viewType) {- case UISectionType.homeCollections:- return context.l10n.collections;- case UISectionType.outgoingCollections:- return context.l10n.sharedByYou;- case UISectionType.incomingCollections:- return context.l10n.sharedWithYou;- }- }}diff --git a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dartindex 3c237c7d33..116ea09495 100644--- a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart+++ b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart@@ -9,11 +9,20 @@ import "package:hugeicons/hugeicons.dart";import 'package:locker/l10n/l10n.dart';import 'package:locker/services/collections/models/collection.dart';import 'package:locker/ui/components/collection_selection_widget.dart';-import 'package:locker/ui/components/file_upload_sheet.dart';import "package:locker/ui/components/gradient_button.dart";import "package:locker/utils/file_icon_utils.dart";import 'package:path/path.dart' as path;+class FileUploadScreenResult {+ final String note;+ final List<Collection> selectedCollections;++ FileUploadScreenResult({+ required this.note,+ required this.selectedCollections,+ });+}+class FileUploadScreen extends StatefulWidget {final List<File> files;final List<Collection> collections;@@ -193,7 +202,7 @@ class _FileUploadScreenState extends State<FileUploadScreen> {(c) => _selectedCollectionIds.contains(c.id),).toList();- final result = FileUploadSheetResult(+ final result = FileUploadScreenResult(note: '',selectedCollections: selectedCollections,);diff --git a/mobile/apps/locker/lib/ui/pages/uploader_page.dart b/mobile/apps/locker/lib/ui/pages/uploader_page.dartindex 26736689de..e03e5b1043 100644--- a/mobile/apps/locker/lib/ui/pages/uploader_page.dart+++ b/mobile/apps/locker/lib/ui/pages/uploader_page.dart@@ -14,7 +14,6 @@ import 'package:locker/services/collections/collections_service.dart';import 'package:locker/services/collections/models/collection.dart';import 'package:locker/services/files/sync/metadata_updater_service.dart';import 'package:locker/services/files/upload/file_upload_service.dart';-import 'package:locker/ui/components/file_upload_sheet.dart';import "package:locker/ui/components/gradient_button.dart";import 'package:locker/ui/pages/file_upload_screen.dart';import 'package:logging/logging.dart';@@ -73,7 +72,7 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {// Navigate to upload screen to get collection selectionfinal uploadResult = await Navigator.of(context)- .push<FileUploadSheetResult>(+ .push<FileUploadScreenResult>(MaterialPageRoute(builder: (context) => FileUploadScreen(files: files,