Skip to content

armgit / ente

Public Imported from GitHub
0

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

UI changes

vishnukvmd4d030217342d
diff --git a/mobile/apps/locker/ios/Podfile.lock b/mobile/apps/locker/ios/Podfile.lock
index 44cd9f143d..f48e53c41f 100644
--- a/mobile/apps/locker/ios/Podfile.lock
+++ b/mobile/apps/locker/ios/Podfile.lock
@@ -194,38 +194,38 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS:
- app_links: 76b66b60cc809390ca1ad69bfd66b998d2387ac7
- cupertino_http: 94ac07f5ff090b8effa6c5e2c47871d48ab7c86c
- device_info_plus: 335f3ce08d2e174b9fdc3db3db0f4e3b1f66bd89
+ app_links: f3e17e4ee5e357b39d8b95290a9b2c299fca71c6
+ cupertino_http: 947a233f40cfea55167a49f2facc18434ea117ba
+ device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
- file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
- file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6
+ file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49
+ file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
- flutter_email_sender: aa1e9772696691d02cd91fea829856c11efb8e58
- flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
- flutter_local_authentication: 989278c681612f1ee0e36019e149137f114b9d7f
- flutter_secure_storage: 2c2ff13db9e0a5647389bff88b0ecac56e3f3418
- fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
- listen_sharing_intent: fe0b9a59913cc124dd6cbd55cd9f881de5f75759
- local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391
- objective_c: 89e720c30d716b036faf9c9684022048eee1eee2
- open_file_ios: 5ff7526df64e4394b4fe207636b67a95e83078bb
+ flutter_email_sender: e03bdda7637bcd3539bfe718fddd980e9508efaa
+ flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
+ flutter_local_authentication: 1172a4dd88f6306dadce067454e2c4caf07977bb
+ flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
+ fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f
+ listen_sharing_intent: 74a842adcbcf7bedf7bbc938c749da9155141b9a
+ local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
+ objective_c: 77e887b5ba1827970907e10e832eec1683f3431d
+ open_file_ios: 461db5853723763573e140de3193656f91990d9e
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
- package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
- path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
- photo_manager: 1d80ae07a89a67dfbcae95953a1e5a24af7c3e62
- privacy_screen: 3159a541f5d3a31bea916cfd4e58f9dc722b3fd4
+ package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
+ path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
+ photo_manager: 81954a1bf804b6e882d0453b3b6bc7fad7b47d3d
+ privacy_screen: 1a131c052ceb3c3659934b003b0d397c2381a24e
SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a
Sentry: da60d980b197a46db0b35ea12cb8f39af48d8854
- sentry_flutter: 27892878729f42701297c628eb90e7c6529f3684
- share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
- shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
- sodium_libs: 6c6d0e83f4ee427c6464caa1f1bdc2abf3ca0b7f
- sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
+ sentry_flutter: 2df8b0aab7e4aba81261c230cbea31c82a62dd1b
+ share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
+ shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
+ sodium_libs: 1faae17af662384acbd13e41867a0008cd2e2318
+ sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
- ua_client_hints: 92fe0d139619b73ec9fcb46cc7e079a26178f586
- url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
+ ua_client_hints: aeabd123262c087f0ce151ef96fa3ab77bfc8b38
+ url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
PODFILE CHECKSUM: d2d3220ea22664a259778d9e314054751db31361
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arb
index ce34267583..7f68abcebb 100644
--- a/mobile/apps/locker/lib/l10n/app_en.arb
+++ b/mobile/apps/locker/lib/l10n/app_en.arb
@@ -359,12 +359,12 @@
"saveInformation": "Save information",
"saveToLocker": "Save to Locker",
"saveDocumentTitle": "Document",
- "saveDocumentDescription": "Upload items to to be preserved",
- "informationDescription": "Save information to be shared or passed down to loved ones.",
+ "saveDocumentDescription": "Upload important docs",
+ "informationDescription": "Save and share information with loved ones.",
"personalNote": "Note",
"personalNoteDescription": "Write down thoughts and instructions",
"physicalRecords": "Place",
- "physicalRecordsDescription": "Share locations to important items",
+ "physicalRecordsDescription": "Save locations of physical items",
"accountCredentials": "Secret",
"accountCredentialsDescription": "Preserve account credentials.",
"editSecret": "Edit secret",
diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dart
index b2bfcd8edc..d96835afdb 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart
@@ -1075,13 +1075,13 @@ abstract class AppLocalizations {
/// No description provided for @saveDocumentDescription.
///
/// In en, this message translates to:
- /// **'Upload items to to be preserved'**
+ /// **'Upload important docs'**
String get saveDocumentDescription;
/// No description provided for @informationDescription.
///
/// In en, this message translates to:
- /// **'Save information to be shared or passed down to loved ones.'**
+ /// **'Save and share information with loved ones.'**
String get informationDescription;
/// No description provided for @personalNote.
@@ -1105,7 +1105,7 @@ abstract class AppLocalizations {
/// No description provided for @physicalRecordsDescription.
///
/// In en, this message translates to:
- /// **'Share locations to important items'**
+ /// **'Save locations of physical items'**
String get physicalRecordsDescription;
/// No description provided for @accountCredentials.
diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
index 4237b44bd5..7ce4b52e48 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
@@ -564,11 +564,11 @@ class AppLocalizationsEn extends AppLocalizations {
String get saveDocumentTitle => 'Document';
@override
- String get saveDocumentDescription => 'Upload items to to be preserved';
+ String get saveDocumentDescription => 'Upload important docs';
@override
String get informationDescription =>
- 'Save information to be shared or passed down to loved ones.';
+ 'Save and share information with loved ones.';
@override
String get personalNote => 'Note';
@@ -580,7 +580,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get physicalRecords => 'Place';
@override
- String get physicalRecordsDescription => 'Share locations to important items';
+ String get physicalRecordsDescription => 'Save locations of physical items';
@override
String get accountCredentials => 'Secret';
diff --git a/mobile/apps/locker/lib/ui/components/usage_card_widget.dart b/mobile/apps/locker/lib/ui/components/usage_card_widget.dart
index a44521f96e..f5c1c0a9ee 100644
--- a/mobile/apps/locker/lib/ui/components/usage_card_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/usage_card_widget.dart
@@ -46,8 +46,8 @@ class _UsageCardWidgetState extends State<UsageCardWidget> {
return Container(
padding: const EdgeInsets.symmetric(
- horizontal: 12,
- vertical: 14,
+ horizontal: 16,
+ vertical: 20,
),
decoration: BoxDecoration(
color: colorScheme.primary700,
@@ -65,6 +65,7 @@ class _UsageCardWidgetState extends State<UsageCardWidget> {
padding: const EdgeInsets.all(8.0),
child: const HugeIcon(
icon: HugeIcons.strokeRoundedCloudUpload,
+ color: Colors.white,
),
),
const SizedBox(width: 12),
@@ -88,7 +89,9 @@ class _UsageCardWidgetState extends State<UsageCardWidget> {
NumberFormat().format(usedCount),
NumberFormat().format(maxFileCount),
),
- style: textTheme.smallMuted,
+ style: textTheme.smallMuted.copyWith(
+ color: Colors.white,
+ ),
)
: SizedBox(
width: 60,
diff --git a/mobile/apps/locker/lib/ui/pages/account_credentials_page.dart b/mobile/apps/locker/lib/ui/pages/account_credentials_page.dart
index 6f648c43b3..cce79a19b5 100644
--- a/mobile/apps/locker/lib/ui/pages/account_credentials_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/account_credentials_page.dart
@@ -10,6 +10,7 @@ class AccountCredentialsPage extends BaseInfoPage<AccountCredentialData> {
super.key,
super.mode = InfoPageMode.edit,
super.existingFile,
+ super.onCancelWithoutSaving,
});
@override
diff --git a/mobile/apps/locker/lib/ui/pages/base_info_page.dart b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
index 6c05f71bae..223c29544b 100644
--- a/mobile/apps/locker/lib/ui/pages/base_info_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
@@ -19,11 +19,13 @@ enum InfoPageMode { view, edit }
abstract class BaseInfoPage<T extends InfoData> extends StatefulWidget {
final InfoPageMode mode;
final EnteFile? existingFile; // The file to edit, or null for new files
+ final VoidCallback? onCancelWithoutSaving;
const BaseInfoPage({
super.key,
this.mode = InfoPageMode.edit,
this.existingFile,
+ this.onCancelWithoutSaving,
});
}
@@ -474,7 +476,18 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>
return;
}
+ _popAndMaybeNotifyCancel();
+ }
+
+ void _popAndMaybeNotifyCancel() {
+ final shouldNotify =
+ widget.existingFile == null && widget.onCancelWithoutSaving != null;
Navigator.of(context).pop();
+ if (shouldNotify) {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ widget.onCancelWithoutSaving?.call();
+ });
+ }
}
@override
diff --git a/mobile/apps/locker/lib/ui/pages/emergency_contact_page.dart b/mobile/apps/locker/lib/ui/pages/emergency_contact_page.dart
index 152e738ac0..a1ccac4fd7 100644
--- a/mobile/apps/locker/lib/ui/pages/emergency_contact_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/emergency_contact_page.dart
@@ -9,6 +9,7 @@ class EmergencyContactPage extends BaseInfoPage<EmergencyContactData> {
super.key,
super.mode = InfoPageMode.edit,
super.existingFile,
+ super.onCancelWithoutSaving,
});
@override
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index 0b34347694..e34c5b3853 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -101,6 +101,7 @@ class CustomLockerAppBar extends StatelessWidget
context.l10n.locker,
style: textTheme.h3Bold.copyWith(
color: Colors.white,
+ fontFamily: 'Montserrat',
),
),
),
diff --git a/mobile/apps/locker/lib/ui/pages/personal_note_page.dart b/mobile/apps/locker/lib/ui/pages/personal_note_page.dart
index e4577bca29..e2e77781cf 100644
--- a/mobile/apps/locker/lib/ui/pages/personal_note_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/personal_note_page.dart
@@ -14,6 +14,7 @@ class PersonalNotePage extends BaseInfoPage<PersonalNoteData> {
super.key,
super.mode = InfoPageMode.edit,
super.existingFile,
+ super.onCancelWithoutSaving,
});
@override
diff --git a/mobile/apps/locker/lib/ui/pages/physical_records_page.dart b/mobile/apps/locker/lib/ui/pages/physical_records_page.dart
index 1fd3b1b155..64681232eb 100644
--- a/mobile/apps/locker/lib/ui/pages/physical_records_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/physical_records_page.dart
@@ -10,6 +10,7 @@ class PhysicalRecordsPage extends BaseInfoPage<PhysicalRecordData> {
super.key,
super.mode = InfoPageMode.edit,
super.existingFile,
+ super.onCancelWithoutSaving,
});
@override
diff --git a/mobile/apps/locker/lib/ui/pages/save_page.dart b/mobile/apps/locker/lib/ui/pages/save_page.dart
index 51db9b474e..ce208427c5 100644
--- a/mobile/apps/locker/lib/ui/pages/save_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/save_page.dart
@@ -7,9 +7,11 @@ import "package:ente_ui/theme/text_style.dart";
import 'package:flutter/material.dart';
import 'package:hugeicons/hugeicons.dart';
import 'package:locker/l10n/l10n.dart';
+import 'package:locker/models/info/info_item.dart';
import 'package:locker/ui/pages/account_credentials_page.dart';
import 'package:locker/ui/pages/personal_note_page.dart';
import 'package:locker/ui/pages/physical_records_page.dart';
+import 'package:locker/utils/info_item_utils.dart';
enum SaveOptionType {
document,
@@ -20,7 +22,7 @@ enum SaveOptionType {
Future<void> showSaveBottomSheet(
BuildContext context, {
- required Future<void> Function() onUploadDocument,
+ required Future<bool> Function() onUploadDocument,
}) {
final colorScheme = getEnteColorScheme(context);
return showModalBottomSheet<void>(
@@ -50,7 +52,7 @@ class SaveBottomSheet extends StatelessWidget {
});
final BuildContext rootContext;
- final Future<void> Function() onUploadDocument;
+ final Future<bool> Function() onUploadDocument;
@override
Widget build(BuildContext context) {
@@ -145,10 +147,10 @@ class SaveBottomSheet extends StatelessWidget {
_buildSaveOption(
context,
rootContext: rootContext,
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedPencilEdit02,
+ icon: InfoItemUtils.getInfoIcon(
+ InfoType.note,
+ showBackground: false,
size: 24,
- color: colorScheme.primary700,
),
title: context.l10n.personalNote,
description: context.l10n.personalNoteDescription,
@@ -160,10 +162,10 @@ class SaveBottomSheet extends StatelessWidget {
_buildSaveOption(
context,
rootContext: rootContext,
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedFolder02,
+ icon: InfoItemUtils.getInfoIcon(
+ InfoType.physicalRecord,
+ showBackground: false,
size: 24,
- color: colorScheme.primary700,
),
title: context.l10n.physicalRecords,
description: context.l10n.physicalRecordsDescription,
@@ -175,10 +177,10 @@ class SaveBottomSheet extends StatelessWidget {
_buildSaveOption(
context,
rootContext: rootContext,
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedUserEdit01,
+ icon: InfoItemUtils.getInfoIcon(
+ InfoType.accountCredential,
+ showBackground: false,
size: 24,
- color: colorScheme.primary700,
),
title: context.l10n.accountCredentials,
description: context.l10n.accountCredentialsDescription,
@@ -201,7 +203,7 @@ class SaveBottomSheet extends StatelessWidget {
Widget _buildSaveOption(
BuildContext sheetContext, {
required BuildContext rootContext,
- required HugeIcon icon,
+ required Widget icon,
required String title,
required String description,
required SaveOptionType type,
@@ -253,24 +255,53 @@ class SaveBottomSheet extends StatelessWidget {
}
void _handleSaveOption(BuildContext context, SaveOptionType type) {
+ final navigator = Navigator.of(context);
+ void reopenSheet() {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (!navigator.mounted) {
+ return;
+ }
+ showSaveBottomSheet(
+ navigator.context,
+ onUploadDocument: onUploadDocument,
+ );
+ });
+ }
+
switch (type) {
case SaveOptionType.document:
- unawaited(onUploadDocument());
+ unawaited(
+ onUploadDocument().then((didUpload) {
+ if (!didUpload) {
+ reopenSheet();
+ }
+ }),
+ );
return;
case SaveOptionType.note:
Navigator.of(context).push(
- MaterialPageRoute(builder: (context) => const PersonalNotePage()),
+ MaterialPageRoute(
+ builder: (context) => PersonalNotePage(
+ onCancelWithoutSaving: reopenSheet,
+ ),
+ ),
);
break;
case SaveOptionType.physicalRecord:
Navigator.of(context).push(
- MaterialPageRoute(builder: (context) => const PhysicalRecordsPage()),
+ MaterialPageRoute(
+ builder: (context) => PhysicalRecordsPage(
+ onCancelWithoutSaving: reopenSheet,
+ ),
+ ),
);
break;
case SaveOptionType.credentials:
Navigator.of(context).push(
MaterialPageRoute(
- builder: (context) => const AccountCredentialsPage(),
+ builder: (context) => AccountCredentialsPage(
+ onCancelWithoutSaving: reopenSheet,
+ ),
),
);
break;
diff --git a/mobile/apps/locker/lib/ui/pages/uploader_page.dart b/mobile/apps/locker/lib/ui/pages/uploader_page.dart
index 4cb12249a4..9764e9fa52 100644
--- a/mobile/apps/locker/lib/ui/pages/uploader_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/uploader_page.dart
@@ -31,7 +31,7 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
void onFileUploadComplete();
/// Opens a file picker dialog and uploads the selected file
- Future<void> addFile() async {
+ Future<bool> addFile() async {
final FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.any,
allowMultiple: true,
@@ -44,12 +44,15 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
.toList();
if (selectedFiles.isNotEmpty) {
- await uploadFiles(selectedFiles);
+ return await uploadFiles(selectedFiles);
}
}
+
+ return false;
}
- Future<void> uploadFiles(List<File> files) async {
+ Future<bool> uploadFiles(List<File> files) async {
+ var didUpload = false;
final progressDialog = createProgressDialog(
context,
context.l10n.uploadedFilesProgress(0, files.length),
@@ -82,6 +85,7 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
uploadResult != null && uploadResult.selectedCollections.isNotEmpty;
if (isUncategorizedUpload || isRegularUpload) {
+ didUpload = true;
if (isUncategorizedUpload) {
// Get the uncategorized collection for upload
final uncategorizedCollection = await CollectionService.instance
@@ -159,5 +163,7 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
await progressDialog.hide();
}
}
+
+ return didUpload;
}
}
diff --git a/mobile/apps/locker/lib/utils/info_item_utils.dart b/mobile/apps/locker/lib/utils/info_item_utils.dart
index 1982a77a37..b15516c99b 100644
--- a/mobile/apps/locker/lib/utils/info_item_utils.dart
+++ b/mobile/apps/locker/lib/utils/info_item_utils.dart
@@ -23,12 +23,12 @@ class InfoItemUtils {
backgroundColor: Color.fromRGBO(255, 152, 0, 0.06),
),
InfoType.physicalRecord: InfoIconConfig(
- icon: HugeIcons.strokeRoundedFolder01,
+ icon: HugeIcons.strokeRoundedBriefcase01,
color: Color.fromRGBO(156, 39, 176, 1),
backgroundColor: Color.fromRGBO(156, 39, 176, 0.06),
),
InfoType.accountCredential: InfoIconConfig(
- icon: HugeIcons.strokeRoundedKey01,
+ icon: HugeIcons.strokeRoundedLockPassword,
color: Color.fromRGBO(16, 113, 255, 1),
backgroundColor: Color.fromRGBO(16, 113, 255, 0.06),
),