Skip to content

armgit / ente

Public Imported from GitHub
0

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

Improve Locker collection selector scrolling

aman-pilot6ccdd9ee6081
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 c13204d929..20fd1e4c7f 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
@@ -59,6 +59,8 @@ class _AddToCollectionSheetState extends State<AddToCollectionSheet> {
@override
Widget build(BuildContext context) {
+ final maxCollectionListHeight = MediaQuery.sizeOf(context).height * 0.6;
+
return BottomSheetComponent(
title: context.l10n.addToCollection,
content: CollectionSelectionWidget(
@@ -66,6 +68,7 @@ class _AddToCollectionSheetState extends State<AddToCollectionSheet> {
selectedCollectionIds: _selectedCollectionIds,
onToggleCollection: _toggleCollection,
onCollectionsUpdated: _onCollectionsUpdated,
+ maxHeight: maxCollectionListHeight,
title: context.l10n.collections,
),
actions: [
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 f53574c825..8ec59f7143 100644
--- a/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
@@ -13,6 +13,7 @@ class CollectionSelectionWidget extends StatefulWidget {
final Set<int> selectedCollectionIds;
final Function(int) onToggleCollection;
final Function(List<Collection>)? onCollectionsUpdated;
+ final double maxHeight;
final String title;
@@ -22,6 +23,7 @@ class CollectionSelectionWidget extends StatefulWidget {
required this.selectedCollectionIds,
required this.onToggleCollection,
this.onCollectionsUpdated,
+ this.maxHeight = 168,
required this.title,
});
@@ -134,20 +136,23 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
children: [
if (widget.title.isNotEmpty) ...[
Text(widget.title, style: TextStyles.bodyBold),
- const SizedBox(height: 12),
+ const SizedBox(height: 8),
],
ClipRRect(
borderRadius: BorderRadius.circular(16),
child: ConstrainedBox(
- constraints: const BoxConstraints(maxHeight: 168),
- child: Scrollbar(
- controller: _scrollController,
- thumbVisibility: true,
- radius: const Radius.circular(4),
- child: SingleChildScrollView(
+ constraints: BoxConstraints(maxHeight: widget.maxHeight),
+ child: SizedBox(
+ width: double.infinity,
+ child: Scrollbar(
controller: _scrollController,
- padding: const EdgeInsets.only(right: 12, bottom: 12),
- child: Wrap(spacing: 8, runSpacing: 12, children: chips),
+ thumbVisibility: true,
+ radius: const Radius.circular(4),
+ child: SingleChildScrollView(
+ controller: _scrollController,
+ padding: const EdgeInsets.only(right: 12, bottom: 12),
+ child: Wrap(spacing: 8, runSpacing: 12, children: chips),
+ ),
),
),
),