Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][locker] Refine text input sheet labels

aman-pilotd0fee9a219ab
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arb
index 4e3851afe6..53f8145792 100644
--- a/mobile/apps/locker/lib/l10n/app_en.arb
+++ b/mobile/apps/locker/lib/l10n/app_en.arb
@@ -183,7 +183,6 @@
}
}
},
- "pleaseSelectAtLeastOneCollection": "Please select at least one collection",
"unknownItemType": "Unknown item type",
"fileDeletedSuccessfully": "Item deleted successfully",
"failedToDeleteFile": "Failed to delete item: {error}",
diff --git a/mobile/apps/locker/lib/ui/components/add_to_collection_sheet.dart b/mobile/apps/locker/lib/ui/components/add_to_collection_sheet.dart
index f026239c3a..c13204d929 100644
--- a/mobile/apps/locker/lib/ui/components/add_to_collection_sheet.dart
+++ b/mobile/apps/locker/lib/ui/components/add_to_collection_sheet.dart
@@ -48,7 +48,7 @@ class _AddToCollectionSheetState extends State<AddToCollectionSheet> {
});
}
- Future<void> _onSave() async {
+ void _onSave() {
final selectedCollections = _availableCollections
.where((c) => _selectedCollectionIds.contains(c.id))
.toList();
@@ -81,7 +81,7 @@ class _AddToCollectionSheetState extends State<AddToCollectionSheet> {
Future<AddToCollectionSheetResult?> showAddToCollectionSheet(
BuildContext context, {
required List<Collection> collections,
-}) async {
+}) {
return showBottomSheetComponent<AddToCollectionSheetResult>(
context: context,
builder: (_) => AddToCollectionSheet(collections: collections),
diff --git a/mobile/apps/locker/lib/ui/components/file_edit_sheet.dart b/mobile/apps/locker/lib/ui/components/file_edit_sheet.dart
index a56624f859..048a91976b 100644
--- a/mobile/apps/locker/lib/ui/components/file_edit_sheet.dart
+++ b/mobile/apps/locker/lib/ui/components/file_edit_sheet.dart
@@ -107,7 +107,7 @@ class _FileEditSheetState extends State<FileEditSheet> {
return uniqueCollectionsById(source);
}
- Future<void> _onSave() async {
+ void _onSave() {
final selectedCollections = _availableCollections
.where((c) => _selectedCollectionIds.contains(c.id))
.toList();
@@ -162,7 +162,7 @@ Future<FileEditSheetResult?> showFileEditSheet(
BuildContext context, {
required EnteFile file,
required List<Collection> collections,
-}) async {
+}) {
return showBottomSheetComponent<FileEditSheetResult>(
context: context,
builder: (_) => FileEditSheet(file: file, collections: collections),
diff --git a/mobile/apps/locker/lib/ui/components/text_input_sheet.dart b/mobile/apps/locker/lib/ui/components/text_input_sheet.dart
index 02092aee4f..d646ca7a27 100644
--- a/mobile/apps/locker/lib/ui/components/text_input_sheet.dart
+++ b/mobile/apps/locker/lib/ui/components/text_input_sheet.dart
@@ -13,7 +13,10 @@ Future<dynamic> showTextInputSheet(
int? maxLength = 200,
bool isPasswordInput = false,
}) {
- var currentText = initialValue ?? '';
+ final initial = initialValue ?? '';
+ var currentText = maxLength != null && initial.length > maxLength
+ ? initial.substring(0, maxLength)
+ : initial;
var isSubmitting = false;
final canSubmit = ValueNotifier<bool>(currentText.trim().isNotEmpty);
diff --git a/mobile/apps/locker/lib/ui/viewer/date/date_time_picker.dart b/mobile/apps/locker/lib/ui/viewer/date/date_time_picker.dart
index cdf47e6080..b61fe38082 100644
--- a/mobile/apps/locker/lib/ui/viewer/date/date_time_picker.dart
+++ b/mobile/apps/locker/lib/ui/viewer/date/date_time_picker.dart
@@ -17,22 +17,26 @@ Future<DateTime?> showDatePickerSheet(
decoration: BoxDecoration(
color: colorScheme.backgroundElevated,
borderRadius: const BorderRadius.only(
- topLeft: Radius.circular(12),
- topRight: Radius.circular(12),
+ topLeft: Radius.circular(20),
+ topRight: Radius.circular(20),
),
),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: DateTimePickerWidget(
- (DateTime dateTime) {
- Navigator.of(sheetContext).pop(dateTime);
- },
- () {
- Navigator.of(sheetContext).pop(null);
- },
- initialDate,
- minDateTime: minDate,
- maxDateTime: maxDate,
+ child: SafeArea(
+ top: false,
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: DateTimePickerWidget(
+ (DateTime dateTime) {
+ Navigator.of(sheetContext).pop(dateTime);
+ },
+ () {
+ Navigator.of(sheetContext).pop(null);
+ },
+ initialDate,
+ minDateTime: minDate,
+ maxDateTime: maxDate,
+ startWithTime: startWithTime,
+ ),
),
),
),