This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
#7956 [Shell] Unable to focus and unfocus search handler for Android #14375
Closed
Closed
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35ac0e0
#7956 SearchHandler XAML declared. Focused and Unfocused EventHandler…
19a9ada
#7956 InheritedSearchHandler XAML declared. Focused and Unfocused Eve…
eb30d5c
Added the FocusChange EventHandler to AppCompatAutoCompleteTextView _…
828ba2f
override of OnFocused and OnUnfocus methods on InheritedSearchHandler.
15ff9ed
ammends derived from @pictos code review.
a097670
Update Xamarin.Forms.Platform.Android/Renderers/ShellSearchView.cs
germancoines db148b1
indentation
8c93095
Merge branch '5.0.0' into fix-7956
germancoines 20c2cb6
Merge branch '5.0.0' into fix-7956
germancoines 8c112be
Merge branch '5.0.0' into fix-7956
jsuarezruiz ffae0ea
Merge branch '5.0.0' into fix-7956
jsuarezruiz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7956.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<local:TestShell xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
xmlns:local="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns:issues="clr-namespace:Xamarin.Forms.Controls.Issues" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue7956"> | ||
|
||
<ShellContent Title="SearchHandler Focus"> | ||
<ContentPage> | ||
<StackLayout> | ||
<Label Text="Please, click on the Shell SearchHandler search box above, in order to fire the Focus EventHandler. This test will pass if: on focus, you see another text below saying 'Focus EventHandler triggered!'; on unfocus, you see another text below saying 'Focus EventHandler triggered!'. If nothing happens, or only one of the two previous cases happen, this test would have failed." | ||
Padding="10"/> | ||
<Label x:Name="lblFocus" Text="Focus EventHandler triggered!'" IsVisible="false" /> | ||
<Label x:Name="lblUnfocus" Text="Unfocus EventHandler triggered!'" IsVisible="false" /> | ||
</StackLayout> | ||
<Shell.SearchHandler> | ||
<SearchHandler Focused="SearchHandler_Focused" Unfocused="SearchHandler_Unfocused"/> | ||
</Shell.SearchHandler> | ||
</ContentPage> | ||
</ShellContent> | ||
|
||
</local:TestShell> |
42 changes: 42 additions & 0 deletions
42
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7956.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections.Generic; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7956, "[Shell] Unable to focus and unfocus search handler for Android", | ||
PlatformAffected.Android)] | ||
public partial class Issue7956 : TestShell | ||
{ | ||
public Issue7956() | ||
{ | ||
BindingContext = this; | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
|
||
} | ||
|
||
private void SearchHandler_Focused(object sender, System.EventArgs e) | ||
{ | ||
lblFocus.IsVisible = true; | ||
lblUnfocus.IsVisible = false; | ||
} | ||
private void SearchHandler_Unfocused(object sender, System.EventArgs e) | ||
{ | ||
lblFocus.IsVisible = false; | ||
lblUnfocus.IsVisible = true; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7956_1.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<local:TestShell xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
xmlns:local="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns:issues="clr-namespace:Xamarin.Forms.Controls.Issues" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue7956_1"> | ||
|
||
<ShellContent Title="SearchHandler Focus"> | ||
<ContentPage> | ||
<StackLayout> | ||
<Label Text="Please, click on the Shell SearchHandler search box above, in order to fire the Focus EventHandler. This test will pass if: on focus, you see another text below saying 'Focus EventHandler triggered!'; on unfocus, you see another text below saying 'Focus EventHandler triggered!'. If nothing happens, or only one of the two previous cases happen, this test would have failed." | ||
Padding="10"/> | ||
<Label x:Name="lblFocus" Text="Focus EventHandler triggered!'" IsVisible="false" /> | ||
<Label x:Name="lblUnfocus" Text="Unfocus EventHandler triggered!'" IsVisible="false" /> | ||
</StackLayout> | ||
<Shell.SearchHandler> | ||
<issues:InheritedSearchHandler Focused="SearchHandler_Focused" Unfocused="SearchHandler_Unfocused"/> | ||
</Shell.SearchHandler> | ||
</ContentPage> | ||
</ShellContent> | ||
|
||
</local:TestShell> |
54 changes: 54 additions & 0 deletions
54
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7956_1.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Collections.Generic; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7956, "[Shell] Unable to focus and unfocus search handler for Android", | ||
PlatformAffected.Android, issueTestNumber:1)] | ||
public partial class Issue7956_1 : TestShell | ||
{ | ||
public Issue7956_1() | ||
{ | ||
BindingContext = this; | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
|
||
} | ||
|
||
private void SearchHandler_Focused(object sender, System.EventArgs e) | ||
{ | ||
lblFocus.IsVisible = true; | ||
lblUnfocus.IsVisible = false; | ||
} | ||
private void SearchHandler_Unfocused(object sender, System.EventArgs e) | ||
{ | ||
lblFocus.IsVisible = false; | ||
lblUnfocus.IsVisible = true; | ||
} | ||
} | ||
|
||
public class InheritedSearchHandler : SearchHandler | ||
{ | ||
protected override void OnFocused() | ||
{ | ||
base.OnFocused(); | ||
} | ||
protected override void OnUnfocus() | ||
{ | ||
base.OnUnfocus(); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.