Skip to content

armgit / ente

Public Imported from GitHub
0

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

search result screen design changes

laurenspriem86f83ac30d45
diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
index 5b22c89027..80883985cc 100644
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@ -34,6 +34,7 @@ import "package:photos/l10n/l10n.dart";
import "package:photos/models/collection/collection.dart";
import "package:photos/models/collection/collection_items.dart";
import "package:photos/models/file/file.dart";
+import "package:photos/models/search/index_of_indexed_stack.dart";
import "package:photos/models/selected_albums.dart";
import "package:photos/models/selected_files.dart";
import "package:photos/service_locator.dart";
@@ -788,8 +789,26 @@ class _HomeWidgetState extends State<HomeWidget> {
///screens the have different appbar colours.
appBar: PreferredSize(
preferredSize: const Size.fromHeight(0),
- child: AppBar(
- backgroundColor: getEnteColorScheme(context).backgroundBase,
+ child: ValueListenableBuilder<bool>(
+ valueListenable: isOnSearchTabNotifier,
+ builder: (context, isOnSearchTab, _) {
+ return AnimatedBuilder(
+ animation: IndexOfStackNotifier(),
+ builder: (context, _) {
+ final colorScheme = getEnteColorScheme(context);
+ final resultsBackground = EnteTheme.isDark(context)
+ ? const Color.fromRGBO(22, 22, 22, 1)
+ : colorScheme.backgroundElevated2;
+ final isSearchResults =
+ isOnSearchTab && IndexOfStackNotifier().index == 1;
+ return AppBar(
+ backgroundColor: isSearchResults
+ ? resultsBackground
+ : colorScheme.backgroundBase,
+ );
+ },
+ );
+ },
),
),
resizeToAvoidBottomInset: false,
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
index 891ddc3a5b..45f3db0dae 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
@@ -112,8 +112,27 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final resultsBackground = EnteTheme.isDark(context)
+ ? const Color.fromRGBO(22, 22, 22, 1)
+ : colorScheme.backgroundElevated2;
+ final sectionWidgets = _buildSectionWidgets(context);
+ if (_resultsCount > 0) {
+ sectionWidgets.insert(
+ 0,
+ Padding(
+ padding: const EdgeInsets.fromLTRB(4, 4, 4, 12),
+ child: Text(
+ AppLocalizations.of(context).searchResultCount(
+ count: _resultsCount,
+ ),
+ style: textTheme.smallBold.copyWith(color: colorScheme.textMuted),
+ ),
+ ),
+ );
+ }
return Scaffold(
- backgroundColor: colorScheme.backgroundBase,
+ backgroundColor: resultsBackground,
body: Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: Column(
@@ -125,7 +144,7 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
padding: EdgeInsets.only(
bottom: (MediaQuery.sizeOf(context).height / 2) + 50,
),
- children: _buildSectionWidgets(context),
+ children: sectionWidgets,
),
),
],
@@ -337,14 +356,12 @@ class _SearchResultsSectionWidget extends StatelessWidget {
final showTypeLabel = results.length > 1;
final children = <Widget>[];
for (int i = 0; i < results.length; i++) {
- final radius = BorderRadius.vertical(
- top: i == 0 ? const Radius.circular(20) : Radius.zero,
- bottom:
- i == results.length - 1 ? const Radius.circular(20) : Radius.zero,
- );
+ final radius = BorderRadius.circular(20);
children.add(
- ClipRRect(
+ Material(
+ color: colorScheme.backgroundElevated,
borderRadius: radius,
+ clipBehavior: Clip.antiAlias,
child: SearchResultsWidgetGenerator(
results[i],
borderRadius: radius,
@@ -356,13 +373,7 @@ class _SearchResultsSectionWidget extends StatelessWidget {
),
);
if (i != results.length - 1) {
- children.add(
- Divider(
- height: 1,
- thickness: 1,
- color: colorScheme.strokeFainter,
- ),
- );
+ children.add(const SizedBox(height: 4));
}
}
@@ -375,7 +386,7 @@ class _SearchResultsSectionWidget extends StatelessWidget {
children: [
Container(
decoration: BoxDecoration(
- color: colorScheme.fillFaint,
+ color: colorScheme.strokeFainter,
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.all(6),
@@ -393,14 +404,7 @@ class _SearchResultsSectionWidget extends StatelessWidget {
],
),
),
- Container(
- decoration: BoxDecoration(
- color: colorScheme.backgroundElevated,
- borderRadius: BorderRadius.circular(20),
- border: Border.all(color: colorScheme.strokeFainter),
- ),
- child: Column(children: children),
- ),
+ Column(children: children),
],
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
index cc1f399c96..e2ca6de377 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
@@ -60,10 +60,15 @@ class _SearchTabState extends State<SearchTab> {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
+ final resultsBackground = EnteTheme.isDark(context)
+ ? const Color.fromRGBO(22, 22, 22, 1)
+ : colorScheme.backgroundElevated2;
+ final headerColor =
+ index == 1 ? resultsBackground : colorScheme.backgroundBase;
return Column(
children: [
ColoredBox(
- color: colorScheme.backgroundBase,
+ color: headerColor,
child: const SafeArea(
bottom: false,
child: SearchWidget(),