Skip to content

armgit / ente

Public Imported from GitHub
0

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

Update ui for collection list

AmanRajSinghMourya8943308e715d
diff --git a/mobile/apps/locker/lib/ui/components/collection_row_widget.dart b/mobile/apps/locker/lib/ui/components/collection_row_widget.dart
index 5fb2f1c857..8c4808cd1f 100644
--- a/mobile/apps/locker/lib/ui/components/collection_row_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/collection_row_widget.dart
@@ -28,70 +28,77 @@ class CollectionRowWidget extends StatelessWidget {
final updateTime =
DateTime.fromMicrosecondsSinceEpoch(collection.updationTime);
- return InkWell(
+ final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
+
+ final collectionRowWidget = Flexible(
+ flex: 6,
+ child: Row(
+ children: [
+ SizedBox(
+ height: 60,
+ width: 48,
+ child: Icon(
+ Icons.folder_open,
+ color: collection.type == CollectionType.favorites
+ ? colorScheme.primary500
+ : Colors.grey,
+ size: 22,
+ ),
+ ),
+ const SizedBox(width: 8),
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ collection.name ?? 'Unnamed Collection',
+ overflow: TextOverflow.ellipsis,
+ maxLines: 1,
+ style: textTheme.body,
+ ),
+ Text(
+ formatDate(context, updateTime),
+ style: textTheme.small.copyWith(
+ color: getEnteColorScheme(context).textMuted,
+ ),
+ overflow: TextOverflow.ellipsis,
+ maxLines: 1,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+
+ return GestureDetector(
onTap: () => _openCollection(context),
+ behavior: HitTestBehavior.opaque,
child: Container(
- padding: EdgeInsets.fromLTRB(16.0, 2, 16.0, isLastItem ? 8 : 2),
decoration: BoxDecoration(
- border: isLastItem
- ? null
- : Border(
- bottom: BorderSide(
- color: Theme.of(context).dividerColor.withAlpha(30),
- width: 0.5,
- ),
- ),
+ border: Border.all(
+ color: colorScheme.strokeFaint,
+ ),
+ borderRadius: const BorderRadius.all(Radius.circular(6)),
),
child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Expanded(
- flex: 2,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Icon(
- Icons.folder_open,
- color: collection.type == CollectionType.favorites
- ? getEnteColorScheme(context).primary500
- : Colors.grey,
- size: 20,
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Text(
- collection.name ?? 'Unnamed Collection',
- overflow: TextOverflow.ellipsis,
- maxLines: 1,
- style: getEnteTextTheme(context).body,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- Expanded(
+ collectionRowWidget,
+ Flexible(
flex: 1,
- child: Text(
- formatDate(context, updateTime),
- style: getEnteTextTheme(context).small.copyWith(
- color: Theme.of(context).textTheme.bodySmall?.color,
- ),
- overflow: TextOverflow.ellipsis,
- maxLines: 1,
- ),
- ),
- PopupMenuButton<String>(
- onSelected: (value) => _handleMenuAction(context, value),
- icon: const Icon(
- Icons.more_vert,
- size: 20,
+ child: PopupMenuButton<String>(
+ onSelected: (value) => _handleMenuAction(context, value),
+ icon: const Icon(
+ Icons.more_vert,
+ size: 20,
+ ),
+ itemBuilder: (BuildContext context) {
+ return _buildPopupMenuItems(context);
+ },
),
- itemBuilder: (BuildContext context) {
- return _buildPopupMenuItems(context);
- },
),
],
),
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 927d05ce96..cc68a8f4a4 100644
--- a/mobile/apps/locker/lib/ui/components/item_list_view.dart
+++ b/mobile/apps/locker/lib/ui/components/item_list_view.dart
@@ -1,6 +1,5 @@
-
import 'package:ente_ui/theme/ente_theme.dart';
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
import 'package:locker/l10n/l10n.dart';
import 'package:locker/services/collections/models/collection.dart';
import 'package:locker/services/files/sync/models/file.dart';
@@ -139,31 +138,30 @@ class _ItemListViewState extends State<ItemListView> {
return _buildDefaultEmptyState(context);
}
- return Card(
- margin: EdgeInsets.zero,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- if (widget.enableSorting) _buildSortingHeader(context),
- ListView.builder(
- shrinkWrap: true,
- physics: const NeverScrollableScrollPhysics(),
- padding: EdgeInsets.zero,
- itemCount: _sortedItems.length,
- itemBuilder: (context, index) {
- final item = _sortedItems[index];
- final isLastItem = index == _sortedItems.length - 1;
- return ListItemWidget(
- item: item,
- collections: widget.collections,
- fileOverflowActions: widget.fileOverflowActions,
- collectionOverflowActions: widget.collectionOverflowActions,
- isLastItem: isLastItem,
- );
- },
- ),
- ],
- ),
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ if (widget.enableSorting) _buildSortingHeader(context),
+ ListView.separated(
+ separatorBuilder: (context, index) {
+ return const SizedBox(height: 8);
+ },
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: _sortedItems.length,
+ itemBuilder: (context, index) {
+ final item = _sortedItems[index];
+ final isLastItem = index == _sortedItems.length - 1;
+ return ListItemWidget(
+ item: item,
+ collections: widget.collections,
+ fileOverflowActions: widget.fileOverflowActions,
+ collectionOverflowActions: widget.collectionOverflowActions,
+ isLastItem: isLastItem,
+ );
+ },
+ ),
+ ],
);
}
@@ -196,14 +194,6 @@ class _ItemListViewState extends State<ItemListView> {
Widget _buildSortingHeader(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- color: Theme.of(context).dividerColor,
- width: 0.1,
- ),
- ),
- ),
child: Row(
children: [
Expanded(
@@ -232,7 +222,7 @@ class _ItemListViewState extends State<ItemListView> {
? Icons.arrow_upward
: Icons.arrow_downward,
size: 16,
- color: Theme.of(context).primaryColor,
+ color: getEnteColorScheme(context).textMuted,
),
],
),
@@ -265,7 +255,7 @@ class _ItemListViewState extends State<ItemListView> {
? Icons.arrow_upward
: Icons.arrow_downward,
size: 16,
- color: Theme.of(context).primaryColor,
+ color: getEnteColorScheme(context).textMuted,
),
],
),