From ee2fa83019ff49237d3407ddf00ea36c7c7ae3ea Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 18:21:03 +0530 Subject: [PATCH 01/15] Reduce transition animation duration --- lib/utils/navigation_util.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/navigation_util.dart b/lib/utils/navigation_util.dart index 23b5924e9..abd30b14f 100644 --- a/lib/utils/navigation_util.dart +++ b/lib/utils/navigation_util.dart @@ -77,7 +77,7 @@ class TransparentRoute extends PageRoute { bool get maintainState => true; @override - Duration get transitionDuration => const Duration(milliseconds: 350); + Duration get transitionDuration => const Duration(milliseconds: 200); @override Widget buildPage( From 300508305ce8cde8416a89526f7c3e65d463cf4b Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 18:23:16 +0530 Subject: [PATCH 02/15] Copy change --- lib/ui/viewer/search/search_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/viewer/search/search_widget.dart b/lib/ui/viewer/search/search_widget.dart index 179de69fe..cac94b32f 100644 --- a/lib/ui/viewer/search/search_widget.dart +++ b/lib/ui/viewer/search/search_widget.dart @@ -64,7 +64,7 @@ class _SearchWidgetState extends State { child: TextFormField( style: Theme.of(context).textTheme.subtitle1, decoration: InputDecoration( - hintText: 'Search for albums, locations & files', + hintText: 'Search for albums, places & files', filled: true, contentPadding: const EdgeInsets.symmetric( horizontal: 16, From 1b308a870479eb8e6027c408b7986657e3d1ff16 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 18:26:07 +0530 Subject: [PATCH 03/15] Prevent overscroll on the search suggestions --- lib/ui/viewer/search/search_suggestions.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ui/viewer/search/search_suggestions.dart b/lib/ui/viewer/search/search_suggestions.dart index c811f06fb..3a5c830e1 100644 --- a/lib/ui/viewer/search/search_suggestions.dart +++ b/lib/ui/viewer/search/search_suggestions.dart @@ -39,6 +39,7 @@ class SearchSuggestionsWidget extends StatelessWidget { maxHeight: MediaQuery.of(context).size.height * 0.5, ), child: ListView.builder( + physics: const ClampingScrollPhysics(), shrinkWrap: true, itemCount: results.length + 1, itemBuilder: (context, index) { From 40783396cf21cb966ae709c2b1fcff18fd8b68cf Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 18:28:52 +0530 Subject: [PATCH 04/15] Prioritize location results --- lib/ui/viewer/search/search_widget.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ui/viewer/search/search_widget.dart b/lib/ui/viewer/search/search_widget.dart index cac94b32f..570fea305 100644 --- a/lib/ui/viewer/search/search_widget.dart +++ b/lib/ui/viewer/search/search_widget.dart @@ -125,16 +125,16 @@ class _SearchWidgetState extends State { Future> getSearchResultsForQuery(String query) async { final List allResults = []; - final collectionResults = - await SearchService.instance.getCollectionSearchResults(query); - for (CollectionWithThumbnail collectionResult in collectionResults) { - allResults.add(AlbumSearchResult(collectionResult)); - } final locationResults = await SearchService.instance.getLocationSearchResults(query); for (LocationSearchResult result in locationResults) { allResults.add(result); } + final collectionResults = + await SearchService.instance.getCollectionSearchResults(query); + for (CollectionWithThumbnail collectionResult in collectionResults) { + allResults.add(AlbumSearchResult(collectionResult)); + } final fileResults = await SearchService.instance.getFileSearchResults(query); for (File file in fileResults) { From 9c389aba3105c6350e419eaa3c4e8eab6671f340 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 19:15:45 +0530 Subject: [PATCH 05/15] Style changes --- lib/ente_theme_data.dart | 4 ++++ .../collection_result_widget.dart | 12 ++++++++---- .../filename_result_widget.dart | 10 ++++++---- .../location_result_widget.dart | 14 ++++++++++---- lib/ui/viewer/search/search_suggestions.dart | 5 +++-- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/lib/ente_theme_data.dart b/lib/ente_theme_data.dart index 16b665cb5..72cc081c7 100644 --- a/lib/ente_theme_data.dart +++ b/lib/ente_theme_data.dart @@ -353,6 +353,10 @@ extension CustomColorScheme on ColorScheme { Color get searchResultsColor => brightness == Brightness.light ? const Color.fromRGBO(245, 245, 245, 1.0) : const Color.fromRGBO(30, 30, 30, 1.0); + + Color get searchResultsCountTextColor => brightness == Brightness.light + ? const Color.fromRGBO(180, 180, 180, 1) + : const Color.fromRGBO(150, 150, 150, 1); } OutlinedButtonThemeData buildOutlinedButtonThemeData({ diff --git a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart index f238855d8..1e6305a4b 100644 --- a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart @@ -28,16 +28,20 @@ class AlbumSearchResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( 'Album', - style: TextStyle(fontSize: 12), + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, + ), ), - const SizedBox(height: 8), + const SizedBox(height: 6), Text( albumSearchResult.collectionWithThumbnail.collection.name, style: const TextStyle(fontSize: 18), overflow: TextOverflow.ellipsis, ), + const SizedBox(height: 2), FutureBuilder( future: FilesDB.instance.collectionFileCount( albumSearchResult.collectionWithThumbnail.collection.id, @@ -50,7 +54,7 @@ class AlbumSearchResultWidget extends StatelessWidget { style: TextStyle( color: Theme.of(context) .colorScheme - .defaultTextColor, + .searchResultsCountTextColor, ), children: [ TextSpan(text: noOfMemories.toString()), diff --git a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart index 2ef463214..d4463da78 100644 --- a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart @@ -26,17 +26,19 @@ class FileSearchResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( 'File', - style: TextStyle(fontSize: 12), + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, + ), ), - const SizedBox(height: 8), + const SizedBox(height: 6), Text( matchedFile.file.title, style: const TextStyle(fontSize: 18), overflow: TextOverflow.ellipsis, ), - const Text('1 memory') ], ), ), diff --git a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart index 00c012fae..84e4e8983 100644 --- a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart @@ -31,20 +31,26 @@ class LocationSearchResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( 'Location', - style: TextStyle(fontSize: 12), + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, + ), ), - const SizedBox(height: 8), + const SizedBox(height: 6), Text( locationSearchResult.location, style: const TextStyle(fontSize: 18), overflow: TextOverflow.ellipsis, ), + const SizedBox(height: 2), RichText( text: TextSpan( style: TextStyle( - color: Theme.of(context).colorScheme.defaultTextColor, + color: Theme.of(context) + .colorScheme + .searchResultsCountTextColor, ), children: [ TextSpan(text: noOfMemories.toString()), diff --git a/lib/ui/viewer/search/search_suggestions.dart b/lib/ui/viewer/search/search_suggestions.dart index 3a5c830e1..86820bccb 100644 --- a/lib/ui/viewer/search/search_suggestions.dart +++ b/lib/ui/viewer/search/search_suggestions.dart @@ -20,8 +20,9 @@ class SearchSuggestionsWidget extends StatelessWidget { Widget build(BuildContext context) { return SingleChildScrollView( child: Container( + margin: const EdgeInsets.only(top: 8), decoration: BoxDecoration( - color: Colors.transparent, + color: Theme.of(context).colorScheme.searchResultsColor, boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.2), @@ -34,7 +35,7 @@ class SearchSuggestionsWidget extends StatelessWidget { child: ClipRRect( borderRadius: const BorderRadius.all(Radius.circular(8)), child: Container( - margin: const EdgeInsets.only(top: 8), + margin: const EdgeInsets.only(top: 6), constraints: BoxConstraints( maxHeight: MediaQuery.of(context).size.height * 0.5, ), From 9857412428591ba3293a350fb644cfbf4db388a1 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 19:18:08 +0530 Subject: [PATCH 06/15] Add border radius to all thumbnails --- .../search_result_widgets/collection_result_widget.dart | 7 +++++-- .../search_result_widgets/filename_result_widget.dart | 5 ++++- .../search_result_widgets/location_result_widget.dart | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart index 1e6305a4b..34e202b80 100644 --- a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart @@ -80,8 +80,11 @@ class AlbumSearchResultWidget extends StatelessWidget { child: SizedBox( height: 50, width: 50, - child: ThumbnailWidget( - albumSearchResult.collectionWithThumbnail.thumbnail, + child: ClipRRect( + borderRadius: BorderRadius.circular(3), + child: ThumbnailWidget( + albumSearchResult.collectionWithThumbnail.thumbnail, + ), ), ), ) diff --git a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart index d4463da78..ecb16b84a 100644 --- a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart @@ -47,7 +47,10 @@ class FileSearchResultWidget extends StatelessWidget { child: SizedBox( height: 50, width: 50, - child: ThumbnailWidget(matchedFile.file), + child: ClipRRect( + borderRadius: BorderRadius.circular(3), + child: ThumbnailWidget(matchedFile.file), + ), ), ), ], diff --git a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart index 84e4e8983..13f2a4f25 100644 --- a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart @@ -68,7 +68,10 @@ class LocationSearchResultWidget extends StatelessWidget { child: SizedBox( height: 50, width: 50, - child: ThumbnailWidget(locationSearchResult.files[0]), + child: ClipRRect( + borderRadius: BorderRadius.circular(3), + child: ThumbnailWidget(locationSearchResult.files[0]), + ), ), ), ], From ff35f07094114f0a2eff30a62f5d44acc008f8ed Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 19:45:54 +0530 Subject: [PATCH 07/15] Extract search result thumbnail to a separate widget --- .../collection_result_widget.dart | 25 +++++---------- .../filename_result_widget.dart | 20 +++++------- .../location_result_widget.dart | 20 +++++------- .../search_result_thumbnail_widget.dart | 31 +++++++++++++++++++ 4 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 lib/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart diff --git a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart index 34e202b80..8d000a0ee 100644 --- a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:photos/db/files_db.dart'; import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/search/album_search_result.dart'; -import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; import 'package:photos/ui/viewer/gallery/collection_page.dart'; +import 'package:photos/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart'; import 'package:photos/utils/navigation_util.dart'; class AlbumSearchResultWidget extends StatelessWidget { @@ -21,9 +21,14 @@ class AlbumSearchResultWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ + SearchResultThumbnailWidget( + albumSearchResult.collectionWithThumbnail.thumbnail, + "collection_search", + ), + const SizedBox(width: 16), Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -35,7 +40,7 @@ class AlbumSearchResultWidget extends StatelessWidget { color: Theme.of(context).colorScheme.subTextColor, ), ), - const SizedBox(height: 6), + const SizedBox(height: 4), Text( albumSearchResult.collectionWithThumbnail.collection.name, style: const TextStyle(fontSize: 18), @@ -74,20 +79,6 @@ class AlbumSearchResultWidget extends StatelessWidget { ], ), ), - Hero( - tag: "collection_search" + - albumSearchResult.collectionWithThumbnail.thumbnail.tag(), - child: SizedBox( - height: 50, - width: 50, - child: ClipRRect( - borderRadius: BorderRadius.circular(3), - child: ThumbnailWidget( - albumSearchResult.collectionWithThumbnail.thumbnail, - ), - ), - ), - ) ], ), ), diff --git a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart index ecb16b84a..cf0e342eb 100644 --- a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart @@ -3,7 +3,7 @@ import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/file.dart'; import 'package:photos/models/search/file_search_result.dart'; import 'package:photos/ui/viewer/file/detail_page.dart'; -import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; +import 'package:photos/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart'; import 'package:photos/utils/navigation_util.dart'; class FileSearchResultWidget extends StatelessWidget { @@ -19,9 +19,14 @@ class FileSearchResultWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ + SearchResultThumbnailWidget( + matchedFile.file, + "file_details", + ), + const SizedBox(width: 12), Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -42,17 +47,6 @@ class FileSearchResultWidget extends StatelessWidget { ], ), ), - Hero( - tag: "file_details" + matchedFile.file.tag(), - child: SizedBox( - height: 50, - width: 50, - child: ClipRRect( - borderRadius: BorderRadius.circular(3), - child: ThumbnailWidget(matchedFile.file), - ), - ), - ), ], ), ), diff --git a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart index 13f2a4f25..49e36214d 100644 --- a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/search/location_search_result.dart'; -import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; import 'package:photos/ui/viewer/search/collections/files_in_location_page.dart'; +import 'package:photos/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart'; import 'package:photos/utils/navigation_util.dart'; class LocationSearchResultWidget extends StatelessWidget { @@ -24,9 +24,14 @@ class LocationSearchResultWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ + SearchResultThumbnailWidget( + locationSearchResult.files[0], + heroTagPrefix, + ), + const SizedBox(width: 12), Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -63,17 +68,6 @@ class LocationSearchResultWidget extends StatelessWidget { ], ), ), - Hero( - tag: heroTagPrefix + locationSearchResult.files[0].tag(), - child: SizedBox( - height: 50, - width: 50, - child: ClipRRect( - borderRadius: BorderRadius.circular(3), - child: ThumbnailWidget(locationSearchResult.files[0]), - ), - ), - ), ], ), ), diff --git a/lib/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart b/lib/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart new file mode 100644 index 000000000..bbbc6cf1a --- /dev/null +++ b/lib/ui/viewer/search/search_result_widgets/search_result_thumbnail_widget.dart @@ -0,0 +1,31 @@ +import 'package:flutter/widgets.dart'; +import 'package:photos/models/file.dart'; +import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; + +class SearchResultThumbnailWidget extends StatelessWidget { + final File file; + final String tagPrefix; + + const SearchResultThumbnailWidget( + this.file, + this.tagPrefix, { + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Hero( + tag: tagPrefix + file.tag(), + child: SizedBox( + height: 58, + width: 58, + child: ClipRRect( + borderRadius: BorderRadius.circular(3), + child: ThumbnailWidget( + file, + ), + ), + ), + ); + } +} From 78aee4e8a0b20b55493dcd48169a90ec235847c9 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 19:53:50 +0530 Subject: [PATCH 08/15] Add border radius --- lib/ui/viewer/search/search_suggestions.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ui/viewer/search/search_suggestions.dart b/lib/ui/viewer/search/search_suggestions.dart index 86820bccb..d1d8bb218 100644 --- a/lib/ui/viewer/search/search_suggestions.dart +++ b/lib/ui/viewer/search/search_suggestions.dart @@ -23,6 +23,7 @@ class SearchSuggestionsWidget extends StatelessWidget { margin: const EdgeInsets.only(top: 8), decoration: BoxDecoration( color: Theme.of(context).colorScheme.searchResultsColor, + borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.2), From 06294f274eb5e29f5ca8077aea52f0a875f395c3 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 19:55:01 +0530 Subject: [PATCH 09/15] v0.6.21 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e1e7d60c1..8d140d3f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: ente photos application # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.6.20+350 +version: 0.6.21+351 environment: sdk: ">=2.10.0 <3.0.0" From 1e047d6e4b29e28651d19f14ec4f7f0bacdb5647 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:08:43 +0530 Subject: [PATCH 10/15] Fix logger name --- lib/services/search_service.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/services/search_service.dart b/lib/services/search_service.dart index 890374d39..12e7a296a 100644 --- a/lib/services/search_service.dart +++ b/lib/services/search_service.dart @@ -12,13 +12,12 @@ import 'package:photos/models/location.dart'; import 'package:photos/models/search/location_api_response.dart'; import 'package:photos/models/search/location_search_result.dart'; import 'package:photos/services/collections_service.dart'; -import 'package:photos/services/user_service.dart'; class SearchService { Future> _cachedFilesFuture; final _dio = Network.instance.getDio(); final _config = Configuration.instance; - final _logger = Logger((UserService).toString()); + final _logger = Logger((SearchService).toString()); final _collectionService = CollectionsService.instance; static const _maximumResultsLimit = 20; From acc9386284074e1bbfdbbbefb36c74dc84c86b46 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:15:42 +0530 Subject: [PATCH 11/15] Add chevron to each search result --- .../collection_result_widget.dart | 96 ++++++++++--------- .../filename_result_widget.dart | 34 ++++--- .../location_result_widget.dart | 65 +++++++------ 3 files changed, 103 insertions(+), 92 deletions(-) diff --git a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart index 8d000a0ee..4eff878f1 100644 --- a/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/collection_result_widget.dart @@ -21,7 +21,7 @@ class AlbumSearchResultWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), child: Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center, children: [ SearchResultThumbnailWidget( @@ -29,55 +29,57 @@ class AlbumSearchResultWidget extends StatelessWidget { "collection_search", ), const SizedBox(width: 16), - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Album', - style: TextStyle( - fontSize: 12, - color: Theme.of(context).colorScheme.subTextColor, - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Album', + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, ), - const SizedBox(height: 4), - Text( - albumSearchResult.collectionWithThumbnail.collection.name, - style: const TextStyle(fontSize: 18), - overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 4), + Text( + albumSearchResult.collectionWithThumbnail.collection.name, + style: const TextStyle(fontSize: 18), + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 2), + FutureBuilder( + future: FilesDB.instance.collectionFileCount( + albumSearchResult.collectionWithThumbnail.collection.id, ), - const SizedBox(height: 2), - FutureBuilder( - future: FilesDB.instance.collectionFileCount( - albumSearchResult.collectionWithThumbnail.collection.id, - ), - builder: (context, snapshot) { - if (snapshot.hasData && snapshot.data > 0) { - final noOfMemories = snapshot.data; - return RichText( - text: TextSpan( - style: TextStyle( - color: Theme.of(context) - .colorScheme - .searchResultsCountTextColor, - ), - children: [ - TextSpan(text: noOfMemories.toString()), - TextSpan( - text: noOfMemories != 1 - ? ' memories' - : ' memory', - ), - ], + builder: (context, snapshot) { + if (snapshot.hasData && snapshot.data > 0) { + final noOfMemories = snapshot.data; + return RichText( + text: TextSpan( + style: TextStyle( + color: Theme.of(context) + .colorScheme + .searchResultsCountTextColor, ), - ); - } else { - return const SizedBox.shrink(); - } - }, - ), - ], - ), + children: [ + TextSpan(text: noOfMemories.toString()), + TextSpan( + text: + noOfMemories != 1 ? ' memories' : ' memory', + ), + ], + ), + ); + } else { + return const SizedBox.shrink(); + } + }, + ), + ], + ), + const Spacer(), + Icon( + Icons.chevron_right, + color: Theme.of(context).colorScheme.subTextColor, ), ], ), diff --git a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart index cf0e342eb..c8f5acced 100644 --- a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart @@ -27,25 +27,31 @@ class FileSearchResultWidget extends StatelessWidget { "file_details", ), const SizedBox(width: 12), - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'File', - style: TextStyle( - fontSize: 12, - color: Theme.of(context).colorScheme.subTextColor, - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'File', + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, ), - const SizedBox(height: 6), - Text( + ), + const SizedBox(height: 6), + SizedBox( + width: 220, + child: Text( matchedFile.file.title, style: const TextStyle(fontSize: 18), overflow: TextOverflow.ellipsis, ), - ], - ), + ), + ], + ), + const Spacer(), + Icon( + Icons.chevron_right, + color: Theme.of(context).colorScheme.subTextColor, ), ], ), diff --git a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart index 49e36214d..b9316045c 100644 --- a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart @@ -32,41 +32,44 @@ class LocationSearchResultWidget extends StatelessWidget { heroTagPrefix, ), const SizedBox(width: 12), - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Location', + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Location', + style: TextStyle( + fontSize: 12, + color: Theme.of(context).colorScheme.subTextColor, + ), + ), + const SizedBox(height: 6), + Text( + locationSearchResult.location, + style: const TextStyle(fontSize: 18), + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 2), + RichText( + text: TextSpan( style: TextStyle( - fontSize: 12, - color: Theme.of(context).colorScheme.subTextColor, + color: Theme.of(context) + .colorScheme + .searchResultsCountTextColor, ), - ), - const SizedBox(height: 6), - Text( - locationSearchResult.location, - style: const TextStyle(fontSize: 18), - overflow: TextOverflow.ellipsis, - ), - const SizedBox(height: 2), - RichText( - text: TextSpan( - style: TextStyle( - color: Theme.of(context) - .colorScheme - .searchResultsCountTextColor, + children: [ + TextSpan(text: noOfMemories.toString()), + TextSpan( + text: noOfMemories != 1 ? ' memories' : ' memory', ), - children: [ - TextSpan(text: noOfMemories.toString()), - TextSpan( - text: noOfMemories != 1 ? ' memories' : ' memory', - ), - ], - ), + ], ), - ], - ), + ), + ], + ), + const Spacer(), + Icon( + Icons.chevron_right, + color: Theme.of(context).colorScheme.subTextColor, ), ], ), From 313faacc987c17d39d4a4a8859bd042908802d25 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:15:55 +0530 Subject: [PATCH 12/15] v0.6.22 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 8d140d3f2..95ada5005 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: ente photos application # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.6.21+351 +version: 0.6.22+352 environment: sdk: ">=2.10.0 <3.0.0" From c3b0e7d141aa43616336400ed509adbdcd9eb716 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:20:53 +0530 Subject: [PATCH 13/15] Fix text color for light mode --- lib/ente_theme_data.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ente_theme_data.dart b/lib/ente_theme_data.dart index 72cc081c7..8cc7fd9d7 100644 --- a/lib/ente_theme_data.dart +++ b/lib/ente_theme_data.dart @@ -355,7 +355,7 @@ extension CustomColorScheme on ColorScheme { : const Color.fromRGBO(30, 30, 30, 1.0); Color get searchResultsCountTextColor => brightness == Brightness.light - ? const Color.fromRGBO(180, 180, 180, 1) + ? const Color.fromRGBO(80, 80, 80, 1) : const Color.fromRGBO(150, 150, 150, 1); } From 9e2c6354612702879e30b7bc0844c6ecb8eed3e1 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:20:56 +0530 Subject: [PATCH 14/15] Fix padding --- .../search/search_result_widgets/filename_result_widget.dart | 2 +- .../search/search_result_widgets/location_result_widget.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart index c8f5acced..7db77c36e 100644 --- a/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/filename_result_widget.dart @@ -26,7 +26,7 @@ class FileSearchResultWidget extends StatelessWidget { matchedFile.file, "file_details", ), - const SizedBox(width: 12), + const SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart index b9316045c..3ce199dc3 100644 --- a/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart +++ b/lib/ui/viewer/search/search_result_widgets/location_result_widget.dart @@ -31,7 +31,7 @@ class LocationSearchResultWidget extends StatelessWidget { locationSearchResult.files[0], heroTagPrefix, ), - const SizedBox(width: 12), + const SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ From bc75c9f719ed6da6e030512cf391e5425e75fe51 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Thu, 11 Aug 2022 20:21:11 +0530 Subject: [PATCH 15/15] v0.6.23 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 95ada5005..7a3a6a6d6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: ente photos application # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.6.22+352 +version: 0.6.23+353 environment: sdk: ">=2.10.0 <3.0.0"