Skip to content

armgit / ente

Public Imported from GitHub
0

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

Minor UI fixed

AmanRajSinghMourya41acc9fd0263
diff --git a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
index b6879055b1..c01e12c299 100644
--- a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
+++ b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
@@ -61,7 +61,7 @@ class _CollectionFlexGridViewWidgetState
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 40,
diff --git a/mobile/apps/locker/lib/ui/components/file_list_widget.dart b/mobile/apps/locker/lib/ui/components/file_list_widget.dart
index 5cc260dc08..98de4c8550 100644
--- a/mobile/apps/locker/lib/ui/components/file_list_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/file_list_widget.dart
@@ -19,6 +19,7 @@ import "package:locker/services/files/sync/metadata_updater_service.dart";
import "package:locker/services/files/sync/models/file.dart";
import "package:locker/services/info_file_service.dart";
import "package:locker/ui/components/file_edit_dialog.dart";
+import "package:locker/ui/components/file_popup_menu_builder.dart";
import "package:locker/ui/components/item_list_view.dart";
import "package:locker/ui/components/share_link_dialog.dart";
import "package:locker/ui/pages/account_credentials_page.dart";
@@ -60,8 +61,8 @@ class FileListWidget extends StatelessWidget {
child: Row(
children: [
SizedBox(
- height: 60,
- width: 60,
+ height: 40,
+ width: 40,
child: _buildFileIcon(),
),
const SizedBox(width: 12),
@@ -143,7 +144,10 @@ class FileListWidget extends StatelessWidget {
),
),
itemBuilder: (BuildContext context) {
- return _buildPopupMenuItems(context);
+ return FilePopupMenuBuilder.buildPopupMenuItems(
+ context,
+ overflowActions,
+ );
},
),
),
@@ -156,70 +160,6 @@ class FileListWidget extends StatelessWidget {
);
}
- List<PopupMenuItem<String>> _buildPopupMenuItems(BuildContext context) {
- if (overflowActions != null && overflowActions!.isNotEmpty) {
- return overflowActions!
- .map(
- (action) => PopupMenuItem<String>(
- value: action.id,
- child: Row(
- children: [
- const HugeIcon(
- icon: HugeIcons.strokeRoundedFile02,
- size: 16,
- ),
- const SizedBox(width: 8),
- Text(action.label),
- ],
- ),
- ),
- )
- .toList();
- } else {
- return [
- PopupMenuItem<String>(
- value: 'edit',
- child: Row(
- children: [
- const HugeIcon(
- icon: HugeIcons.strokeRoundedEdit02,
- size: 16,
- ),
- const SizedBox(width: 8),
- Text(context.l10n.edit),
- ],
- ),
- ),
- PopupMenuItem<String>(
- value: 'share_link',
- child: Row(
- children: [
- const HugeIcon(
- icon: HugeIcons.strokeRoundedShare03,
- size: 16,
- ),
- const SizedBox(width: 8),
- Text(context.l10n.share),
- ],
- ),
- ),
- PopupMenuItem<String>(
- value: 'delete',
- child: Row(
- children: [
- const HugeIcon(
- icon: HugeIcons.strokeRoundedDelete01,
- size: 16,
- ),
- const SizedBox(width: 8),
- Text(context.l10n.delete),
- ],
- ),
- ),
- ];
- }
- }
-
void _handleMenuAction(BuildContext context, String action) {
if (overflowActions != null && overflowActions!.isNotEmpty) {
final customAction = overflowActions!.firstWhere(
diff --git a/mobile/apps/locker/lib/ui/components/file_popup_menu_builder.dart b/mobile/apps/locker/lib/ui/components/file_popup_menu_builder.dart
new file mode 100644
index 0000000000..481258d703
--- /dev/null
+++ b/mobile/apps/locker/lib/ui/components/file_popup_menu_builder.dart
@@ -0,0 +1,73 @@
+import "package:flutter/material.dart";
+import "package:hugeicons/hugeicons.dart";
+import "package:locker/l10n/l10n.dart";
+import "package:locker/ui/components/item_list_view.dart";
+
+class FilePopupMenuBuilder {
+ static List<PopupMenuItem<String>> buildPopupMenuItems(
+ BuildContext context,
+ List<OverflowMenuAction>? overflowActions,
+ ) {
+ if (overflowActions != null && overflowActions.isNotEmpty) {
+ return overflowActions
+ .map(
+ (action) => PopupMenuItem<String>(
+ value: action.id,
+ child: Row(
+ children: [
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedFile02,
+ size: 16,
+ ),
+ const SizedBox(width: 8),
+ Text(action.label),
+ ],
+ ),
+ ),
+ )
+ .toList();
+ } else {
+ return [
+ PopupMenuItem<String>(
+ value: 'edit',
+ child: Row(
+ children: [
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedEdit02,
+ size: 16,
+ ),
+ const SizedBox(width: 8),
+ Text(context.l10n.edit),
+ ],
+ ),
+ ),
+ PopupMenuItem<String>(
+ value: 'share_link',
+ child: Row(
+ children: [
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedShare03,
+ size: 16,
+ ),
+ const SizedBox(width: 8),
+ Text(context.l10n.share),
+ ],
+ ),
+ ),
+ PopupMenuItem<String>(
+ value: 'delete',
+ child: Row(
+ children: [
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedDelete01,
+ size: 16,
+ ),
+ const SizedBox(width: 8),
+ Text(context.l10n.delete),
+ ],
+ ),
+ ),
+ ];
+ }
+ }
+}
diff --git a/mobile/apps/locker/lib/ui/components/file_row_widget.dart b/mobile/apps/locker/lib/ui/components/file_row_widget.dart
index 214d75fb1d..da6f4d9012 100644
--- a/mobile/apps/locker/lib/ui/components/file_row_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/file_row_widget.dart
@@ -1,8 +1,10 @@
import "package:ente_ui/theme/ente_theme.dart";
import "package:flutter/material.dart";
+import "package:hugeicons/hugeicons.dart";
import "package:locker/models/selected_files.dart";
import "package:locker/services/files/sync/models/file.dart";
import "package:locker/services/info_file_service.dart";
+import "package:locker/ui/components/file_popup_menu_builder.dart";
import "package:locker/ui/components/item_list_view.dart";
import "package:locker/utils/file_icon_utils.dart";
import "package:locker/utils/info_item_utils.dart";
@@ -61,21 +63,45 @@ class FileRowWidget extends StatelessWidget {
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 40,
width: 40,
child: _buildFileIcon(),
),
- const SizedBox(height: 12),
- Text(
- file.displayName,
- style: textTheme.bodyBold,
- textAlign: TextAlign.left,
- overflow: TextOverflow.ellipsis,
- maxLines: 2,
+ const Spacer(),
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Expanded(
+ child: Text(
+ file.displayName,
+ style: textTheme.body,
+ textAlign: TextAlign.left,
+ overflow: TextOverflow.ellipsis,
+ maxLines: 2,
+ ),
+ ),
+ const SizedBox(width: 4),
+ PopupMenuButton<String>(
+ // onSelected: (value) =>
+ // _handleMenuAction(context, value),
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedMoreVertical,
+ color: getEnteColorScheme(context).iconColor,
+ ),
+ itemBuilder: (BuildContext context) {
+ return FilePopupMenuBuilder.buildPopupMenuItems(
+ context,
+ overflowActions,
+ );
+ },
+ ),
+ ],
),
+ const SizedBox(height: 4),
],
),
);
diff --git a/mobile/apps/locker/lib/ui/components/item_list_view.dart b/mobile/apps/locker/lib/ui/components/item_list_view.dart
index d9dad946be..3565a57ede 100644
--- a/mobile/apps/locker/lib/ui/components/item_list_view.dart
+++ b/mobile/apps/locker/lib/ui/components/item_list_view.dart
@@ -141,7 +141,7 @@ class _ItemListViewState extends State<ItemListView> {
crossAxisCount: 2,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
- childAspectRatio: 1.3,
+ childAspectRatio: 1.6,
),
itemCount: _sortedItems.length,
itemBuilder: (context, index) => _buildItem(index),
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 19fbdf624d..f8151ad1b1 100644
--- a/mobile/apps/locker/lib/ui/components/recents_section_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/recents_section_widget.dart
@@ -720,7 +720,6 @@ class _FilterChip extends StatelessWidget {
child: GestureDetector(
onTap: onTap,
child: Container(
- margin: const EdgeInsets.symmetric(vertical: 4),
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
decoration: BoxDecoration(
color:
@@ -732,7 +731,7 @@ class _FilterChip extends StatelessWidget {
children: [
Text(
label,
- style: textTheme.mini,
+ style: textTheme.small,
),
AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
diff --git a/mobile/apps/locker/lib/utils/file_icon_utils.dart b/mobile/apps/locker/lib/utils/file_icon_utils.dart
index 1aa8b887c7..cd6284c47b 100644
--- a/mobile/apps/locker/lib/utils/file_icon_utils.dart
+++ b/mobile/apps/locker/lib/utils/file_icon_utils.dart
@@ -87,17 +87,14 @@ class FileIconUtils {
return icon;
}
- return Padding(
- padding: const EdgeInsets.all(10.0),
- child: Container(
- decoration: BoxDecoration(
- color: config.backgroundColor,
- borderRadius: BorderRadius.circular(12),
- ),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: icon,
- ),
+ return Container(
+ decoration: BoxDecoration(
+ color: config.backgroundColor,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: icon,
),
);
}
diff --git a/mobile/apps/locker/lib/utils/info_item_utils.dart b/mobile/apps/locker/lib/utils/info_item_utils.dart
index 6f662e6b28..1982a77a37 100644
--- a/mobile/apps/locker/lib/utils/info_item_utils.dart
+++ b/mobile/apps/locker/lib/utils/info_item_utils.dart
@@ -60,19 +60,14 @@ class InfoItemUtils {
return icon;
}
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: Container(
- height: 48,
- width: 48,
- decoration: BoxDecoration(
- color: config.backgroundColor,
- borderRadius: BorderRadius.circular(12),
- ),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: icon,
- ),
+ return Container(
+ decoration: BoxDecoration(
+ color: config.backgroundColor,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: icon,
),
);
}