Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix dialog

AmanRajSinghMourya043fb5c061b7
diff --git a/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
index 135fa7983b..eff1735768 100644
--- a/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
@@ -11,6 +11,7 @@ class CollectionSelectionWidget extends StatefulWidget {
final Set<int> selectedCollectionIds;
final Function(int) onToggleCollection;
final Function(List<Collection>)? onCollectionsUpdated;
+ final Widget? titleWidget;
const CollectionSelectionWidget({
super.key,
@@ -18,6 +19,7 @@ class CollectionSelectionWidget extends StatefulWidget {
required this.selectedCollectionIds,
required this.onToggleCollection,
this.onCollectionsUpdated,
+ this.titleWidget,
});
@override
@@ -72,9 +74,10 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- TitleBarTitleWidget(
- title: context.l10n.addToCollection,
- ),
+ widget.titleWidget ??
+ TitleBarTitleWidget(
+ title: context.l10n.addToCollection,
+ ),
const SizedBox(height: 24),
Wrap(
spacing: 8,
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 e3230cea0f..06a83204c8 100644
--- a/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart
+++ b/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart
@@ -1,6 +1,4 @@
-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/components/buttons/gradient_button.dart";
import 'package:ente_ui/theme/ente_theme.dart';
import 'package:flutter/material.dart';
import 'package:locker/l10n/l10n.dart';
@@ -8,7 +6,6 @@ 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';
-import 'package:locker/utils/file_icon_utils.dart';
import 'package:locker/utils/snack_bar_utils.dart';
class FileEditDialogResult {
@@ -66,7 +63,6 @@ class _FileEditDialogState extends State<FileEditDialog> {
@override
void dispose() {
_titleController.dispose();
- _captionController.dispose();
super.dispose();
}
@@ -122,96 +118,121 @@ class _FileEditDialogState extends State<FileEditDialog> {
final textTheme = getEnteTextTheme(context);
return Dialog(
- backgroundColor: colorScheme.backgroundElevated,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- child: Container(
- width: 400,
- constraints: const BoxConstraints(maxHeight: 600),
- padding: const EdgeInsets.all(20),
- child: 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.largeBold,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ],
- ),
- const SizedBox(height: 20),
- Text(
- context.l10n.title,
- style: textTheme.small.copyWith(
- color: colorScheme.textBase,
- ),
- ),
- const SizedBox(height: 8),
- TextInputWidget(
- hintText: context.l10n.fileTitle,
- initialValue: _titleController.text,
- onChange: (value) => _titleController.text = value,
- maxLength: 200,
- textCapitalization: TextCapitalization.words,
- ),
- const SizedBox(height: 16),
- Text(
- context.l10n.note,
- style: textTheme.small.copyWith(
- color: colorScheme.textBase,
+ backgroundColor: colorScheme.backgroundBase,
+ insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 360),
+ child: Container(
+ decoration: BoxDecoration(
+ color: colorScheme.backdropBase,
+ borderRadius: BorderRadius.circular(28),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.08),
+ blurRadius: 24,
+ offset: const Offset(0, 12),
),
- ),
- const SizedBox(height: 8),
- TextInputWidget(
- hintText: context.l10n.optionalNote,
- initialValue: _captionController.text,
- onChange: (value) => _captionController.text = value,
- maxLength: 500,
- textCapitalization: TextCapitalization.sentences,
- ),
- const SizedBox(height: 16),
- CollectionSelectionWidget(
- collections: _availableCollections,
- selectedCollectionIds: _selectedCollectionIds,
- onToggleCollection: _toggleCollection,
- onCollectionsUpdated: _onCollectionsUpdated,
- ),
- const SizedBox(height: 20),
- Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Flexible(
- child: ButtonWidget(
- buttonType: ButtonType.secondary,
- labelText: context.l10n.cancel,
+ ],
+ ),
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "Rename your document",
+ style: textTheme.largeBold,
+ ),
+ const SizedBox(height: 4),
+ Text(
+ _fileName,
+ style: textTheme.small.copyWith(
+ color: colorScheme.textMuted,
+ ),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
+ ),
+ ),
+ GestureDetector(
onTap: _onCancel,
+ child: Container(
+ height: 36,
+ width: 36,
+ decoration: BoxDecoration(
+ color: colorScheme.backdropBase,
+ borderRadius: BorderRadius.circular(18),
+ ),
+ child: const Icon(
+ Icons.close_rounded,
+ size: 20,
+ ),
+ ),
),
- ),
- const SizedBox(width: 12),
- Flexible(
- child: ButtonWidget(
- buttonType: ButtonType.primary,
- labelText: context.l10n.save,
- onTap: _onSave,
- isDisabled: _selectedCollectionIds.isEmpty,
+ ],
+ ),
+ const SizedBox(height: 20),
+ TextField(
+ controller: _titleController,
+ decoration: InputDecoration(
+ hintText: "Enter a new name for your document",
+ 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(8),
+ borderSide: BorderSide.none,
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(8),
+ borderSide: BorderSide(
+ color: colorScheme.strokeFaint,
+ ),
+ ),
+ counterText: "",
+ ),
+ maxLength: 200,
+ style: textTheme.body.copyWith(
+ color: colorScheme.textBase,
+ ),
+ ),
+ const SizedBox(height: 24),
+ CollectionSelectionWidget(
+ collections: _availableCollections,
+ selectedCollectionIds: _selectedCollectionIds,
+ onToggleCollection: _toggleCollection,
+ onCollectionsUpdated: _onCollectionsUpdated,
+ titleWidget: Text(
+ "Move to collection",
+ style: textTheme.largeBold,
+ ),
+ ),
+ const SizedBox(height: 28),
+ SizedBox(
+ width: double.infinity,
+ child: GradientButton(
+ onTap: () async {
+ await _onSave();
+ },
+ text: context.l10n.save,
),
- ],
- ),
- ],
+ ),
+ ],
+ ),
),
),
);
@@ -225,7 +246,6 @@ Future<FileEditDialogResult?> showFileEditDialog(
}) async {
return showDialog<FileEditDialogResult>(
context: context,
- barrierColor: getEnteColorScheme(context).backdropBase,
builder: (context) => FileEditDialog(
file: file,
collections: collections,
diff --git a/mobile/apps/locker/lib/ui/components/recents_section_widget.dart b/mobile/apps/locker/lib/ui/components/recents_section_widget.dart
index 0bc8487339..61720bb0cc 100644
--- a/mobile/apps/locker/lib/ui/components/recents_section_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/recents_section_widget.dart
@@ -719,7 +719,8 @@ class _FilterChip extends StatelessWidget {
child: GestureDetector(
onTap: onTap,
child: Container(
- padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
+ constraints: const BoxConstraints(minHeight: 40),
+ padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
decoration: BoxDecoration(
color:
isSelected ? colorScheme.primary700 : colorScheme.backdropBase,
@@ -779,31 +780,33 @@ class _FilterClearButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final accentColor = colorScheme.warning500;
+ final backgroundColor = accentColor.withOpacity(0.12);
+
return GestureDetector(
onTap: onTap,
child: Container(
- margin: const EdgeInsets.symmetric(vertical: 4),
- padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
+ constraints: const BoxConstraints(minHeight: 48),
+ padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
decoration: BoxDecoration(
- color: colorScheme.fillFaint,
- border: Border.all(
- color: colorScheme.strokeMuted,
- width: 1,
- ),
+ color: backgroundColor,
borderRadius: const BorderRadius.all(Radius.circular(24.0)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
- Icon(
- Icons.clear_all,
- size: 14,
- color: colorScheme.textMuted,
+ HugeIcon(
+ icon: HugeIcons.strokeRoundedDelete02,
+ size: 16,
+ color: accentColor,
),
const SizedBox(width: 4),
Text(
context.l10n.clear,
- style: textTheme.miniMuted,
+ style: textTheme.small.copyWith(
+ color: accentColor,
+ fontWeight: FontWeight.w600,
+ ),
),
],
),
diff --git a/mobile/apps/locker/lib/ui/pages/collection_page.dart b/mobile/apps/locker/lib/ui/pages/collection_page.dart
index 251c0ae69a..64c77d0d3c 100644
--- a/mobile/apps/locker/lib/ui/pages/collection_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/collection_page.dart
@@ -284,7 +284,7 @@ class _CollectionPageState extends UploaderPageState<CollectionPage>
collectionViewType == CollectionViewType.quickLink) {
items.add(
PopupMenuItem<String>(
- value: 'rename',
+ value: 'edit',
height: 0,
padding: EdgeInsets.zero,
child: MenuItemWidget(
diff --git a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
index cfef9d7540..d01ab1f193 100644
--- a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
+++ b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
@@ -347,7 +347,7 @@ class _FileUploadScreenState extends State<FileUploadScreen> {
options: const RoundedRectDottedBorderOptions(
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 16),
strokeWidth: 1,
- color: Color(0xFF6B6B6B),
+ color: Color.fromRGBO(82, 82, 82, 0.6),
dashPattern: [5, 5],
radius: Radius.circular(24),
),
diff --git a/mobile/apps/locker/lib/utils/collection_actions.dart b/mobile/apps/locker/lib/utils/collection_actions.dart
index d20b498f7c..8a5b7629f4 100644
--- a/mobile/apps/locker/lib/utils/collection_actions.dart
+++ b/mobile/apps/locker/lib/utils/collection_actions.dart
@@ -77,7 +77,7 @@ class CollectionActions {
Collection collection, {
VoidCallback? onSuccess,
}) async {
- await showTextInputDialog(
+ await showInputDialogSheet(
context,
title: context.l10n.renameCollection,
initialValue: collection.name ?? '',