Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob][photos] Search field fixes (#1464)

Ashil45942f793188
diff --git a/mobile/lib/generated/intl/messages_cs.dart b/mobile/lib/generated/intl/messages_cs.dart
index 86ecd6893b..8db8489d33 100644
--- a/mobile/lib/generated/intl/messages_cs.dart
+++ b/mobile/lib/generated/intl/messages_cs.dart
@@ -55,6 +55,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Modify your query, or try searching for"),
"moveToHiddenAlbum":
MessageLookupByLibrary.simpleMessage("Move to hidden album"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"selectALocation":
MessageLookupByLibrary.simpleMessage("Select a location"),
"selectALocationFirst":
diff --git a/mobile/lib/generated/intl/messages_de.dart b/mobile/lib/generated/intl/messages_de.dart
index 9005de2dcf..442cae9198 100644
--- a/mobile/lib/generated/intl/messages_de.dart
+++ b/mobile/lib/generated/intl/messages_de.dart
@@ -1213,6 +1213,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Scanne diesen Code mit \ndeiner Authentifizierungs-App"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection":
MessageLookupByLibrary.simpleMessage("Alben"),
"searchByAlbumNameHint":
diff --git a/mobile/lib/generated/intl/messages_en.dart b/mobile/lib/generated/intl/messages_en.dart
index 59180d26ce..eef309aa5d 100644
--- a/mobile/lib/generated/intl/messages_en.dart
+++ b/mobile/lib/generated/intl/messages_en.dart
@@ -1175,6 +1175,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Scan this barcode with\nyour authenticator app"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection":
MessageLookupByLibrary.simpleMessage("Albums"),
"searchByAlbumNameHint":
diff --git a/mobile/lib/generated/intl/messages_es.dart b/mobile/lib/generated/intl/messages_es.dart
index 5bba2d9a0a..a6294d4a43 100644
--- a/mobile/lib/generated/intl/messages_es.dart
+++ b/mobile/lib/generated/intl/messages_es.dart
@@ -1044,6 +1044,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Escanea este código QR con tu aplicación de autenticación"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchByAlbumNameHint":
MessageLookupByLibrary.simpleMessage("Nombre del álbum"),
"searchByExamples": MessageLookupByLibrary.simpleMessage(
diff --git a/mobile/lib/generated/intl/messages_fr.dart b/mobile/lib/generated/intl/messages_fr.dart
index 5f21ec77b1..82125afcca 100644
--- a/mobile/lib/generated/intl/messages_fr.dart
+++ b/mobile/lib/generated/intl/messages_fr.dart
@@ -1182,6 +1182,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Scannez ce code-barres avec\nvotre application d\'authentification"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection":
MessageLookupByLibrary.simpleMessage("Albums"),
"searchByAlbumNameHint":
diff --git a/mobile/lib/generated/intl/messages_it.dart b/mobile/lib/generated/intl/messages_it.dart
index c20931418f..e6db5b380f 100644
--- a/mobile/lib/generated/intl/messages_it.dart
+++ b/mobile/lib/generated/intl/messages_it.dart
@@ -1137,6 +1137,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Scansione questo codice QR\ncon la tua app di autenticazione"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchByAlbumNameHint":
MessageLookupByLibrary.simpleMessage("Nome album"),
"searchByExamples": MessageLookupByLibrary.simpleMessage(
diff --git a/mobile/lib/generated/intl/messages_ko.dart b/mobile/lib/generated/intl/messages_ko.dart
index 15b4acf260..c91d849f6e 100644
--- a/mobile/lib/generated/intl/messages_ko.dart
+++ b/mobile/lib/generated/intl/messages_ko.dart
@@ -55,6 +55,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Modify your query, or try searching for"),
"moveToHiddenAlbum":
MessageLookupByLibrary.simpleMessage("Move to hidden album"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"selectALocation":
MessageLookupByLibrary.simpleMessage("Select a location"),
"selectALocationFirst":
diff --git a/mobile/lib/generated/intl/messages_nl.dart b/mobile/lib/generated/intl/messages_nl.dart
index a86943e505..5f2b0903b5 100644
--- a/mobile/lib/generated/intl/messages_nl.dart
+++ b/mobile/lib/generated/intl/messages_nl.dart
@@ -1206,6 +1206,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Scan deze barcode met\nje authenticator app"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection":
MessageLookupByLibrary.simpleMessage("Albums"),
"searchByAlbumNameHint":
diff --git a/mobile/lib/generated/intl/messages_no.dart b/mobile/lib/generated/intl/messages_no.dart
index 294292a3d4..0e5bd97b21 100644
--- a/mobile/lib/generated/intl/messages_no.dart
+++ b/mobile/lib/generated/intl/messages_no.dart
@@ -77,6 +77,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Modify your query, or try searching for"),
"moveToHiddenAlbum":
MessageLookupByLibrary.simpleMessage("Move to hidden album"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"selectALocation":
MessageLookupByLibrary.simpleMessage("Select a location"),
"selectALocationFirst":
diff --git a/mobile/lib/generated/intl/messages_pl.dart b/mobile/lib/generated/intl/messages_pl.dart
index fea153d71b..b3a922b0ae 100644
--- a/mobile/lib/generated/intl/messages_pl.dart
+++ b/mobile/lib/generated/intl/messages_pl.dart
@@ -171,6 +171,7 @@ class MessageLookup extends MessageLookupByLibrary {
"resetPasswordTitle":
MessageLookupByLibrary.simpleMessage("Zresetuj hasło"),
"saveKey": MessageLookupByLibrary.simpleMessage("Zapisz klucz"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"selectALocation":
MessageLookupByLibrary.simpleMessage("Select a location"),
"selectALocationFirst":
diff --git a/mobile/lib/generated/intl/messages_pt.dart b/mobile/lib/generated/intl/messages_pt.dart
index 3168451dff..0747cfa826 100644
--- a/mobile/lib/generated/intl/messages_pt.dart
+++ b/mobile/lib/generated/intl/messages_pt.dart
@@ -1217,6 +1217,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage(
"Escaneie este código de barras com\nseu aplicativo autenticador"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection":
MessageLookupByLibrary.simpleMessage("Álbuns"),
"searchByAlbumNameHint":
diff --git a/mobile/lib/generated/intl/messages_zh.dart b/mobile/lib/generated/intl/messages_zh.dart
index 73d2ae0f5e..7f4c0accf8 100644
--- a/mobile/lib/generated/intl/messages_zh.dart
+++ b/mobile/lib/generated/intl/messages_zh.dart
@@ -988,6 +988,7 @@ class MessageLookup extends MessageLookupByLibrary {
"scanCode": MessageLookupByLibrary.simpleMessage("扫描二维码/条码"),
"scanThisBarcodeWithnyourAuthenticatorApp":
MessageLookupByLibrary.simpleMessage("用您的身份验证器应用\n扫描此条码"),
+ "search": MessageLookupByLibrary.simpleMessage("Search"),
"searchAlbumsEmptySection": MessageLookupByLibrary.simpleMessage("相册"),
"searchByAlbumNameHint": MessageLookupByLibrary.simpleMessage("相册名称"),
"searchByExamples": MessageLookupByLibrary.simpleMessage(
diff --git a/mobile/lib/generated/l10n.dart b/mobile/lib/generated/l10n.dart
index 89b71a76a9..3fa9c2209a 100644
--- a/mobile/lib/generated/l10n.dart
+++ b/mobile/lib/generated/l10n.dart
@@ -8553,6 +8553,16 @@ class S {
args: [],
);
}
+
+ /// `Search`
+ String get search {
+ return Intl.message(
+ 'Search',
+ name: 'search',
+ desc: '',
+ args: [],
+ );
+ }
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
diff --git a/mobile/lib/l10n/intl_cs.arb b/mobile/lib/l10n/intl_cs.arb
index 6b7a4933bc..e7d3747252 100644
--- a/mobile/lib/l10n/intl_cs.arb
+++ b/mobile/lib/l10n/intl_cs.arb
@@ -17,5 +17,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_de.arb b/mobile/lib/l10n/intl_de.arb
index 8bb844df3f..0e5807e1e8 100644
--- a/mobile/lib/l10n/intl_de.arb
+++ b/mobile/lib/l10n/intl_de.arb
@@ -1203,5 +1203,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_en.arb b/mobile/lib/l10n/intl_en.arb
index 9d1c7bcf92..7115c69508 100644
--- a/mobile/lib/l10n/intl_en.arb
+++ b/mobile/lib/l10n/intl_en.arb
@@ -1211,5 +1211,6 @@
"invalidEndpointMessage": "Sorry, the endpoint you entered is invalid. Please enter a valid endpoint and try again.",
"endpointUpdatedMessage": "Endpoint updated successfully",
"customEndpoint": "Connected to {endpoint}",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_es.arb b/mobile/lib/l10n/intl_es.arb
index 7dff210367..6515371fa5 100644
--- a/mobile/lib/l10n/intl_es.arb
+++ b/mobile/lib/l10n/intl_es.arb
@@ -979,5 +979,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_fr.arb b/mobile/lib/l10n/intl_fr.arb
index d44d093c1c..1d8e5f6d3a 100644
--- a/mobile/lib/l10n/intl_fr.arb
+++ b/mobile/lib/l10n/intl_fr.arb
@@ -1160,5 +1160,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_it.arb b/mobile/lib/l10n/intl_it.arb
index 9e884ed9e4..c9655dd065 100644
--- a/mobile/lib/l10n/intl_it.arb
+++ b/mobile/lib/l10n/intl_it.arb
@@ -1122,5 +1122,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_ko.arb b/mobile/lib/l10n/intl_ko.arb
index 6b7a4933bc..e7d3747252 100644
--- a/mobile/lib/l10n/intl_ko.arb
+++ b/mobile/lib/l10n/intl_ko.arb
@@ -17,5 +17,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_nl.arb b/mobile/lib/l10n/intl_nl.arb
index 120e4a2071..98302c20c6 100644
--- a/mobile/lib/l10n/intl_nl.arb
+++ b/mobile/lib/l10n/intl_nl.arb
@@ -1198,5 +1198,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_no.arb b/mobile/lib/l10n/intl_no.arb
index 0b777b3538..8908eadb01 100644
--- a/mobile/lib/l10n/intl_no.arb
+++ b/mobile/lib/l10n/intl_no.arb
@@ -31,5 +31,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_pl.arb b/mobile/lib/l10n/intl_pl.arb
index d358d4d2c4..13d740614d 100644
--- a/mobile/lib/l10n/intl_pl.arb
+++ b/mobile/lib/l10n/intl_pl.arb
@@ -118,5 +118,6 @@
"addViewers": "{count, plural, zero {Add viewer} one {Add viewer} other {Add viewers}}",
"addCollaborators": "{count, plural, zero {Add collaborator} one {Add collaborator} other {Add collaborators}}",
"longPressAnEmailToVerifyEndToEndEncryption": "Long press an email to verify end to end encryption.",
- "createCollaborativeLink": "Create collaborative link"
+ "createCollaborativeLink": "Create collaborative link",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_pt.arb b/mobile/lib/l10n/intl_pt.arb
index 37b1041a9a..765ce3e1d3 100644
--- a/mobile/lib/l10n/intl_pt.arb
+++ b/mobile/lib/l10n/intl_pt.arb
@@ -1211,5 +1211,6 @@
"invalidEndpointMessage": "Desculpe, o endpoint que você inseriu é inválido. Por favor, insira um endpoint válido e tente novamente.",
"endpointUpdatedMessage": "Endpoint atualizado com sucesso",
"customEndpoint": "Conectado a {endpoint}",
- "createCollaborativeLink": "Criar link colaborativo"
+ "createCollaborativeLink": "Criar link colaborativo",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_zh.arb b/mobile/lib/l10n/intl_zh.arb
index 439643162a..4a991c7735 100644
--- a/mobile/lib/l10n/intl_zh.arb
+++ b/mobile/lib/l10n/intl_zh.arb
@@ -1211,5 +1211,6 @@
"invalidEndpointMessage": "抱歉,您输入的端点无效。请输入有效的端点,然后重试。",
"endpointUpdatedMessage": "端点更新成功",
"customEndpoint": "已连接至 {endpoint}",
- "createCollaborativeLink": "创建协作链接"
+ "createCollaborativeLink": "创建协作链接",
+ "search": "Search"
}
\ No newline at end of file
diff --git a/mobile/lib/ui/viewer/search/search_widget.dart b/mobile/lib/ui/viewer/search/search_widget.dart
index 2beaa1ec19..1c6c7b693f 100644
--- a/mobile/lib/ui/viewer/search/search_widget.dart
+++ b/mobile/lib/ui/viewer/search/search_widget.dart
@@ -5,6 +5,7 @@ import "package:flutter/scheduler.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/clear_and_unfocus_search_bar_event.dart";
import "package:photos/events/tab_changed_event.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/search/index_of_indexed_stack.dart";
import "package:photos/models/search/search_result.dart";
import "package:photos/services/search_service.dart";
@@ -130,17 +131,14 @@ class SearchWidgetState extends State<SearchWidget> {
color: colorScheme.backgroundBase,
child: Container(
color: colorScheme.fillFaint,
- child: TextFormField(
+ child: TextField(
controller: textController,
focusNode: focusNode,
style: Theme.of(context).textTheme.titleMedium,
// Below parameters are to disable auto-suggestion
- enableSuggestions: false,
- autocorrect: false,
// Above parameters are to disable auto-suggestion
decoration: InputDecoration(
- //TODO: Extract string
- hintText: "Search",
+ hintText: S.of(context).search,
filled: true,
fillColor: getEnteColorScheme(context).fillFaint,
border: const UnderlineInputBorder(
@@ -161,6 +159,9 @@ class SearchWidgetState extends State<SearchWidget> {
minHeight: 44,
minWidth: 44,
),
+ contentPadding: const EdgeInsets.symmetric(
+ vertical: 8,
+ ),
prefixIcon: Hero(
tag: "search_icon",
child: Icon(
@@ -168,6 +169,7 @@ class SearchWidgetState extends State<SearchWidget> {
color: colorScheme.strokeFaint,
),
),
+
/*Using valueListenableBuilder inside a stateful widget because this widget is only rebuild when
setState is called when deboucncing is over and the spinner needs to be shown while debouncing */
suffixIcon: ValueListenableBuilder(