Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ protected virtual void SearchHandlerPropertyChanged(object sender, System.Compon
{
UpdateTextTransform();
}
else if (e.Is(SearchHandler.PlaceholderProperty))
{
UpdatePlaceholder();
}
else if (e.Is(SearchHandler.PlaceholderColorProperty))
{
UpdatePlaceholderColor();
Expand Down Expand Up @@ -115,6 +119,11 @@ void UpdateFont()
_editText.SetTextSize(ComplexUnitType.Sp, (float)_searchHandler.FontSize);
}

void UpdatePlaceholder()
{
_editText.Hint = _searchHandler.Placeholder;
}

void UpdatePlaceholderColor()
{
_editText.UpdatePlaceholderColor(_searchHandler.PlaceholderColor);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue28634.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28634, "[Android] SearchHandler Placeholder Text", PlatformAffected.Android)]
public class Issue28634 : TestShell
{

protected override void Init()
{
this.FlyoutBehavior = FlyoutBehavior.Flyout;

var shellContent = new ShellContent
{
Title = "Home",
Route = "MainPage",
Content = new Issue28634ContentPage() { Title = "Home" }
};

Items.Add(shellContent);

}
class Issue28634ContentPage : ContentPage
{
public Issue28634ContentPage()
{

var searchHandler = new SearchHandler
{
Placeholder = "Type a fruit name to search",
PlaceholderColor = Colors.Red,
};

var button = new Button
{
Text = "Change SearchHandler Placeholder",
AutomationId = "button",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
};
button.Clicked += (s, e) =>
{
searchHandler.Placeholder = "Type a vegetable name to search";
};

Shell.SetSearchHandler(this, searchHandler);

Content = button;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue28634 : _IssuesUITest
{
public override string Issue => "[Android] SearchHandler Placeholder Text";

public Issue28634(TestDevice device)
: base(device)
{ }

[Test]
[Category(UITestCategories.Shell)]
public void VerifySearchHandlerPlaceholderText()
{
App.WaitForElement("button");
App.Tap("button");
VerifyScreenshot();
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading