Skip to content

armgit / ente

Public Imported from GitHub
0

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

user feedback with updated text and layout in InformationPage.

AmanRajSinghMourya18a864559b6f
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 4fbfe44cff..135fa7983b 100644
--- a/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart
@@ -1,3 +1,5 @@
+import "package:dotted_border/dotted_border.dart";
+import "package:ente_ui/components/title_bar_title_widget.dart";
import 'package:ente_ui/theme/ente_theme.dart';
import 'package:flutter/material.dart';
import 'package:locker/l10n/l10n.dart';
@@ -54,6 +56,14 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
}
}
+ void _onUncategorizedSelected() {
+ // Clear all selected collections when uncategorized is selected
+ final collectionIdsCopy = Set<int>.from(widget.selectedCollectionIds);
+ for (final id in collectionIdsCopy) {
+ widget.onToggleCollection(id);
+ }
+ }
+
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
@@ -62,70 +72,36 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(
- context.l10n.addToCollection,
- style: textTheme.h3.copyWith(
- color: colorScheme.textBase,
- ),
+ TitleBarTitleWidget(
+ title: context.l10n.addToCollection,
),
- const SizedBox(height: 12),
- _availableCollections.isEmpty
- ? InkWell(
- onTap: _createNewCollection,
- borderRadius: BorderRadius.circular(20),
- child: Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 18,
- vertical: 14,
- ),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(20),
- border: Border.all(
- color: colorScheme.strokeMuted,
- width: 1,
- ),
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Icon(
- Icons.add,
- size: 16,
- color: colorScheme.textMuted,
- ),
- const SizedBox(width: 4),
- Text(
- context.l10n.newCollection,
- style: textTheme.small.copyWith(
- color: colorScheme.textMuted,
- fontWeight: FontWeight.w500,
- ),
- ),
- ],
- ),
- ),
- )
- : Wrap(
- spacing: 8,
- runSpacing: 8,
- children: [
- // Collection chips
- for (final collection in _availableCollections)
- _buildCollectionChip(
- collection: collection,
- isSelected:
- widget.selectedCollectionIds.contains(collection.id),
- onTap: () => widget.onToggleCollection(collection.id),
- colorScheme: colorScheme,
- textTheme: textTheme,
- ),
- // "New collection" chip
- _buildNewCollectionChip(
- colorScheme: colorScheme,
- textTheme: textTheme,
- ),
- ],
+ const SizedBox(height: 24),
+ Wrap(
+ spacing: 8,
+ runSpacing: 12,
+ children: [
+ _buildUncategorizedChip(
+ context.l10n.uncategorized,
+ widget.selectedCollectionIds.isEmpty,
+ _onUncategorizedSelected,
+ colorScheme,
+ textTheme,
+ ),
+ for (final collection in _availableCollections)
+ _buildCollectionChip(
+ collection: collection,
+ isSelected:
+ widget.selectedCollectionIds.contains(collection.id),
+ onTap: () => widget.onToggleCollection(collection.id),
+ colorScheme: colorScheme,
+ textTheme: textTheme,
),
+ _buildNewCollectionChip(
+ colorScheme: colorScheme,
+ textTheme: textTheme,
+ ),
+ ],
+ ),
],
);
}
@@ -139,19 +115,16 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
}) {
final collectionName = collection.name ?? context.l10n.unnamedCollection;
- return InkWell(
+ return GestureDetector(
onTap: onTap,
- borderRadius: BorderRadius.circular(20),
- child: Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 18,
- vertical: 14,
- ),
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
decoration: BoxDecoration(
color: isSelected
- ? colorScheme.primary300.withOpacity(0.15)
+ ? colorScheme.primary700.withValues(alpha: 0.2)
: colorScheme.fillFaint,
- borderRadius: BorderRadius.circular(20),
+ borderRadius: const BorderRadius.all(Radius.circular(24.0)),
border: Border.all(
color: isSelected ? colorScheme.primary700 : Colors.transparent,
width: 1,
@@ -160,45 +133,73 @@ class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {
child: Text(
collectionName,
style: textTheme.small.copyWith(
- color: isSelected ? colorScheme.primary700 : colorScheme.textMuted,
- fontWeight: FontWeight.w500,
+ color: isSelected ? colorScheme.primary700 : colorScheme.textBase,
),
),
),
);
}
- Widget _buildNewCollectionChip({
- required colorScheme,
- required textTheme,
- }) {
- return InkWell(
- onTap: _createNewCollection,
- borderRadius: BorderRadius.circular(20),
- child: Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 12,
- vertical: 10,
- ),
+ Widget _buildUncategorizedChip(
+ String name,
+ bool isSelected,
+ VoidCallback onTap,
+ colorScheme,
+ textTheme,
+ ) {
+ return GestureDetector(
+ onTap: onTap,
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(20),
+ color: isSelected
+ ? colorScheme.primary700.withValues(alpha: 0.2)
+ : colorScheme.fillFaint,
+ borderRadius: const BorderRadius.all(Radius.circular(24.0)),
border: Border.all(
- color: colorScheme.strokeMuted,
+ color: isSelected ? colorScheme.primary700 : Colors.transparent,
width: 1,
),
),
+ child: Text(
+ name,
+ style: textTheme.small.copyWith(
+ color: isSelected ? colorScheme.primary700 : colorScheme.textBase,
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _buildNewCollectionChip({
+ required colorScheme,
+ required textTheme,
+ }) {
+ return GestureDetector(
+ onTap: () async {
+ await _createNewCollection();
+ },
+ child: DottedBorder(
+ options: const RoundedRectDottedBorderOptions(
+ padding: EdgeInsets.symmetric(vertical: 14, horizontal: 16),
+ strokeWidth: 1,
+ color: Color(0xFF6B6B6B),
+ dashPattern: [5, 5],
+ radius: Radius.circular(24),
+ ),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
- Icons.add,
- size: 16,
+ Icons.add_rounded,
+ size: 18,
color: colorScheme.textMuted,
),
- const SizedBox(width: 4),
+ const SizedBox(width: 6),
Text(
context.l10n.newCollection,
- style: textTheme.small.copyWith(
+ style: textTheme.body.copyWith(
color: colorScheme.textMuted,
fontWeight: FontWeight.w500,
),
diff --git a/mobile/apps/locker/lib/ui/pages/base_info_page.dart b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
index aa211d65db..807564e359 100644
--- a/mobile/apps/locker/lib/ui/pages/base_info_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
@@ -86,12 +86,15 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>
try {
final collections = await CollectionService.instance.getCollections();
setState(() {
- _availableCollections = collections;
+ // Filter out uncategorized collection (it will be shown separately)
+ _availableCollections = collections
+ .where((c) => c.type != CollectionType.uncategorized)
+ .toList();
// Pre-select a default collection if available
- if (collections.isNotEmpty) {
- final defaultCollection = collections.firstWhere(
+ if (_availableCollections.isNotEmpty) {
+ final defaultCollection = _availableCollections.firstWhere(
(c) => c.name == context.l10n.informationCollectionName,
- orElse: () => collections.first,
+ orElse: () => _availableCollections.first,
);
_selectedCollectionIds = {defaultCollection.id};
}
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 dd42c6ad8d..f97530d9a1 100644
--- a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
+++ b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
@@ -223,7 +223,7 @@ class _FileUploadScreenState extends State<FileUploadScreen> {
height: 60,
child: _buildFileIcon(fileName),
),
- const SizedBox(width: 12),
+ const SizedBox(width: 6),
Flexible(
child: Text(
fileName,
@@ -309,9 +309,11 @@ class _FileUploadScreenState extends State<FileUploadScreen> {
onTap: onTap,
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
- padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
+ padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
decoration: BoxDecoration(
- color: isSelected ? colorScheme.primary300 : colorScheme.fillFaint,
+ color: isSelected
+ ? colorScheme.primary700.withValues(alpha: 0.2)
+ : colorScheme.fillFaint,
borderRadius: const BorderRadius.all(Radius.circular(24.0)),
border: Border.all(
color: isSelected ? colorScheme.primary700 : Colors.transparent,
@@ -344,7 +346,7 @@ class _FileUploadScreenState extends State<FileUploadScreen> {
},
child: DottedBorder(
options: const RoundedRectDottedBorderOptions(
- padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
+ padding: EdgeInsets.symmetric(vertical: 14, horizontal: 16),
strokeWidth: 1,
color: Color(0xFF6B6B6B),
dashPattern: [5, 5],
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index 675e893416..9be229e126 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -20,6 +20,7 @@ import 'package:locker/services/collections/models/collection.dart';
import 'package:locker/services/files/sync/models/file.dart';
import "package:locker/ui/collections/collection_flex_grid_view.dart";
import "package:locker/ui/collections/section_title.dart";
+import "package:locker/ui/components/menu_item_widget.dart";
import 'package:locker/ui/components/recents_section_widget.dart';
import 'package:locker/ui/components/search_result_view.dart';
import 'package:locker/ui/mixins/search_mixin.dart';
@@ -730,7 +731,6 @@ class _HomePageState extends UploaderPageState<HomePage>
valueListenable: _isFabOpen,
builder: (context, isFabOpen, child) {
final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
return Stack(
children: [
@@ -746,127 +746,67 @@ class _HomePageState extends UploaderPageState<HomePage>
Positioned(
right: 64,
bottom: 64,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- if (isFabOpen)
- SlideTransition(
- position: Tween<Offset>(
- begin: const Offset(0, 1),
- end: Offset.zero,
- ).animate(
- CurvedAnimation(
- parent: _animationController,
- curve: Curves.easeOutCubic,
+ child: SlideTransition(
+ position: Tween<Offset>(
+ begin: const Offset(0, 1),
+ end: Offset.zero,
+ ).animate(
+ CurvedAnimation(
+ parent: _animationController,
+ curve: Curves.easeOutCubic,
+ ),
+ ),
+ child: FadeTransition(
+ opacity: _animation,
+ child: Container(
+ width: 200,
+ decoration: BoxDecoration(
+ color: colorScheme.backdropBase,
+ borderRadius: BorderRadius.circular(16),
+ border: Border.all(color: colorScheme.strokeFaint),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withValues(alpha: 0.08),
+ blurRadius: 15,
+ offset: const Offset(0, 4),
),
- ),
- child: FadeTransition(
- opacity: _animation,
- child: Container(
- width: 200,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(16),
- border: Border.all(color: colorScheme.strokeFaint),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withValues(alpha: 0.08),
- blurRadius: 15,
- offset: const Offset(0, 4),
- ),
- ],
+ ],
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ MenuItemWidget(
+ label: context.l10n.saveInformation,
+ icon: HugeIcon(
+ icon: HugeIcons.strokeRoundedFile01,
+ color: colorScheme.primary700,
+ size: 20,
),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Material(
- borderRadius: const BorderRadius.only(
- topLeft: Radius.circular(15),
- topRight: Radius.circular(15),
- ),
- child: InkWell(
- onTap: () {
- _toggleFab();
- _showInformationDialog();
- },
- borderRadius: const BorderRadius.only(
- topLeft: Radius.circular(15),
- topRight: Radius.circular(15),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 16,
- vertical: 16,
- ),
- child: Row(
- children: [
- HugeIcon(
- icon: HugeIcons.strokeRoundedFile01,
- color: colorScheme.primary700,
- size: 20,
- ),
- const SizedBox(width: 12),
- Expanded(
- child: Text(
- context.l10n.saveInformation,
- style: textTheme.body,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- Divider(
- height: 1,
- thickness: 1,
- color: colorScheme.strokeFaint,
- ),
- Material(
- borderRadius: const BorderRadius.only(
- bottomLeft: Radius.circular(15),
- bottomRight: Radius.circular(15),
- ),
- child: InkWell(
- onTap: () {
- _toggleFab();
- addFile();
- },
- borderRadius: const BorderRadius.only(
- bottomLeft: Radius.circular(15),
- bottomRight: Radius.circular(15),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 16,
- vertical: 16,
- ),
- child: Row(
- children: [
- HugeIcon(
- icon:
- HugeIcons.strokeRoundedFileUpload,
- color: colorScheme.primary700,
- size: 20,
- ),
- const SizedBox(width: 12),
- Expanded(
- child: Text(
- context.l10n.saveDocument,
- style: textTheme.body,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
+ isFirst: true,
+ isLast: false,
+ onTap: () {
+ _toggleFab();
+ _showInformationDialog();
+ },
+ ),
+ MenuItemWidget(
+ label: context.l10n.saveDocument,
+ icon: HugeIcon(
+ icon: HugeIcons.strokeRoundedFileUpload,
+ color: colorScheme.primary700,
+ size: 20,
),
+ isFirst: false,
+ isLast: true,
+ onTap: () {
+ _toggleFab();
+ addFile();
+ },
),
- ),
+ ],
),
- ],
+ ),
+ ),
),
),
Positioned(
diff --git a/mobile/apps/locker/lib/ui/pages/information_page.dart b/mobile/apps/locker/lib/ui/pages/information_page.dart
index 05de89c86a..09c4f38dfe 100644
--- a/mobile/apps/locker/lib/ui/pages/information_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/information_page.dart
@@ -44,10 +44,20 @@ class InformationPage extends StatelessWidget {
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- const Padding(
- padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
- child: TitleBarTitleWidget(
- title: "Save Information",
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const TitleBarTitleWidget(
+ title: "Save Information",
+ ),
+ const SizedBox(height: 8),
+ Text(
+ "Save important information that can be shared and passed down to loved ones.",
+ style: textTheme.smallMuted,
+ ),
+ ],
),
),
SingleChildScrollView(