From 9a43b1b02bbee87b6bd57c88fea963f6ad54918c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Thu, 1 Jul 2021 15:47:42 +0200 Subject: [PATCH] Implement PlaceholderColor property in SearchBarHandlers --- .../Android/Renderers/SearchBarRenderer.cs | 1 + .../Core/src/WinUI/SearchBarRenderer.cs | 1 + .../Pages/Controls/SearchBarPage.xaml | 11 +++++++ src/Core/src/Core/IEditor.cs | 9 +----- src/Core/src/Core/IPlaceholder.cs | 9 +++++- .../SearchBar/SearchBarHandler.Android.cs | 9 ++++-- .../SearchBar/SearchBarHandler.Standard.cs | 1 + .../SearchBar/SearchBarHandler.Windows.cs | 15 +++++++++ .../Handlers/SearchBar/SearchBarHandler.cs | 1 + .../SearchBar/SearchBarHandler.iOS.cs | 7 +++- .../Platform/Android/SearchViewExtensions.cs | 28 ++++++++++++++-- .../Platform/Windows/SearchBarExtensions.cs | 14 ++++++++ .../src/Platform/iOS/SearchBarExtensions.cs | 20 ++++++++++-- .../SearchBarHandlerTests.Android.cs | 32 +++++++++++++++++-- src/Core/tests/DeviceTests/Stubs/EntryStub.cs | 2 ++ .../tests/DeviceTests/Stubs/SearchBarStub.cs | 2 ++ 16 files changed, 143 insertions(+), 19 deletions(-) diff --git a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs index 30c6aad454cc..6176969e3aea 100644 --- a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs @@ -248,6 +248,7 @@ void UpdatePlaceholder() Control.SetQueryHint(Element.Placeholder); } + [PortHandler] void UpdatePlaceholderColor() { _hintColorSwitcher?.UpdateTextColor(_editText, Element.PlaceholderColor, _editText.SetHintTextColor); diff --git a/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs b/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs index 903154e3a687..25f99c48c0cc 100644 --- a/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/WinUI/SearchBarRenderer.cs @@ -238,6 +238,7 @@ void UpdatePlaceholder() Control.PlaceholderText = Element.Placeholder ?? string.Empty; } + [PortHandler] void UpdatePlaceholderColor() { if (_queryTextBox == null) diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/SearchBarPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/SearchBarPage.xaml index d96f684ae3cd..200cb08644bd 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/SearchBarPage.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/SearchBarPage.xaml @@ -21,6 +21,17 @@ Style="{StaticResource Headline}"/> +