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
[Android] TalkBack now reads name and helptext on buttons. #5237
Closed
Closed
Changes from 2 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
5fcc2c4
[Android] TalkBack now reads name and helptext on buttons.
ryl a778196
Merge branch 'master' into automation-name-helptext
rmarinho 1cc5905
Merge branch 'master' into automation-name-helptext
ryl fad3863
Updates based on feedback.
ryl cafc793
simplification of uitest
afb3c9c
Merge branch 'master' into automation-name-helptext
samhouts 647c700
Only execute 5150 UI Test on the Android platform.
ryl 81494ff
Work around AutomationId.
ryl 537458d
Fixed label text.
ryl a968a07
Merge branch 'master' of github.com:xamarin/Xamarin.Forms into automa…
ryl c003484
Merge branch 'master' into automation-name-helptext
ryl 0e70ac1
Testing some more components.
ryl f218b44
Update GitInfo.txt
samhouts 1a5c736
fix Profile FrameEnd call (#9117)
PureWeen 590d03f
Merge branch '4.5.0'
rmarinho 0accce0
Fix SeachBarRenderer CreateNativeControl issue (#8946)
LuoyeAn 75497c6
Merge branch '4.5.0'
PureWeen 392c957
Merge branch '4.5.0'
samhouts deba0e8
Merge branch '4.5.0'
samhouts a445bda
Add UWP display prompt (#8720)
bmacombe 05f5756
Added IconColor property for managing navigation icon color (#5185)
AndreiMisiukevich c658b2e
Update bug_report.md (#8688)
jfversluis 7a52542
Merge branch '4.5.0'
StephaneDelcroix 9790106
Add null check to GetIconColor (#9172)
hartez df5dc1c
[Android] Fix color filter usage on API29 (#9180)
rmarinho 4c3e2b2
Set not previewer flag early (#8406)
PureWeen 240e805
Implements ListView Header and Footer for WPF (#8443)
BarryNolte 655fa00
Merge branch '4.5.0'
samhouts e3a62fb
Merge branch '4.5.0'
rmarinho cbccb71
Merge branch '4.5.0'
rmarinho 5cb0c60
Merge branch '4.5.0'
rmarinho b486522
[Android,iOS,UWP,WPF] MediaElement control (#3482)
peterfoot 3f84ee0
Map circles (#7401)
jcmanke c4f5077
Merge branch '4.5.0'
rmarinho e6a90a4
Apply fading effect on DetailPage for MasterDetailPage on iOS (#7437)
akamud 62f21cd
Fix 4459 - Update UWP BoxViewRenderer to fully support corner radius …
bmacombe d202323
Adds Cookies to the WebView fixing #Issue3262 (#8169)
CliffAgius 30228a2
Merge branch '4.5.0'
samhouts 05f4474
Merge branch '4.5.0'
PureWeen 7120ce9
Merge branch '4.5.0'
PureWeen 4338e9b
Merge branch '4.5.0'
PureWeen d338be0
Merge branch '4.5.0'
PureWeen 0571796
Add prompt dialog to nuspec (#9398)
PureWeen c6c8369
fix broken link in PULL_REQUEST_TEMPLATE.md (#9391)
artemious7 0f86601
Adds HotRestart conditional compilation (#9298)
emaf 54df1ab
Implemented BindableLayout EmptyView (#7686) fixes #6932
jfversluis 97104bc
[Enhancement] Removed internal access modifier from Material (#7879) …
andreas-nesheim fad9f63
Preserve the macOS assembly from the linker (#8572)
mattleibow 4d93343
Added context switching befor UpdateAspect() method call (#9154) fixe…
yurkinh ff06a9b
Merge branch '4.5.0'
rmarinho f0087cb
Replacement ActivityIndicator for WPF (#9389) fixes #9372
peterfoot 85bd80e
Merge branch '4.5.0'
samhouts 53b9789
Merge branch '4.5.0'
PureWeen 058696b
Updating readme for VS 2019 and Android 29 requirements (#9472)
hartez 038a8c6
Merge branch '4.5.0'
PureWeen 6bd199b
Merge branch '4.5.0'
PureWeen bbb07f6
Adding null check for picker items (#9478) fixes #2674
sahi82 da444e1
Update CONTRIBUTING.md
hartez 42a5122
fixes #9435 (#9490) fixes #9435
AndreiMisiukevich 2ed8786
[iOS] Fix NRE if the detaail renderer wasn't created (#9496)
rmarinho feb457e
Fixed broken link in CONTRIBUTING.md (#9518)
thisisthekap 188ec34
Merge branch '4.5.0'
rmarinho ed2ba43
Merge branch '4.5.0'
rmarinho 166935d
WebView cookie changes fixes (#9508)
PureWeen 44d7434
Expose UISearchBarStyle through platform-specific (#8811)
jcmanke cdb2b41
[Android] Optimize RecalculateSpanPositions method (#8746)
kvpt 1b4c6e2
[iOS] SelectedImageTintColor to TintColor (#8620)
jfversluis 6a23b84
Merge branch '4.5.0'
PureWeen 08007a8
Fix unbalanced performance start/stop call. (#8622)
kvpt c5bea02
FormsFontIcon added (#9587)
melimion 758bdd3
Merge branch '4.5.0'
rmarinho 91d30c9
RadioButton Implementation (#8910) fixes #2404 closes #5349
jfversluis 728e41d
[WPF] Fix typo
rmarinho a796678
[Android] Fix BottomNavigationItemView issue with MasterDetailPage (#…
kvpt 17a0497
Merge branch '4.5.0'
samhouts 6a41de3
Update VS 2015 -> Visual Studio for Windows (#9643)
dottienet adc0987
Merge branch '4.5.0'
PureWeen f30d423
[WPF] Fix typo
rmarinho 0eade95
Merge branch '4.5.0'
rmarinho efb4779
Add more platform tests (#9011)
hartez 524e340
Merge branch 'master' into automation-name-helptext
ryl d3d45a8
Updated to support AndroidX packages.
ryl 164d0a3
Matching master.
ryl 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
45 changes: 45 additions & 0 deletions
45
Xamarin.Forms.ControlGallery.Android/ContentDescriptionEffectRenderer.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,45 @@ | ||
using System.ComponentModel; | ||
using AViews = Android.Views; | ||
using AWidget = Android.Widget; | ||
using Xamarin.Forms; | ||
using Xamarin.Forms.ControlGallery.Android; | ||
using Xamarin.Forms.Controls.Issues; | ||
using Xamarin.Forms.Platform.Android; | ||
|
||
[assembly: ExportEffect(typeof(ContentDescriptionEffectRenderer), ContentDescriptionEffect.EffectName)] | ||
namespace Xamarin.Forms.ControlGallery.Android | ||
{ | ||
public class ContentDescriptionEffectRenderer : PlatformEffect | ||
{ | ||
|
||
protected override void OnAttached() | ||
{ | ||
} | ||
|
||
protected override void OnDetached() | ||
{ | ||
} | ||
|
||
protected override void OnElementPropertyChanged(PropertyChangedEventArgs args) | ||
{ | ||
var button = Element as Button; | ||
var viewGroup = Control as AViews.ViewGroup; | ||
var nativeButton = Control as AWidget.Button; | ||
|
||
if (nativeButton != null && viewGroup != null && viewGroup.ChildCount > 0) | ||
{ | ||
nativeButton = viewGroup.GetChildAt(0) as AWidget.Button; | ||
} | ||
|
||
if (button == null || nativeButton == null) | ||
{ | ||
return; | ||
} | ||
|
||
button.SetValue( | ||
ContentDescriptionEffectProperties.ContentDescriptionProperty, | ||
nativeButton.ContentDescription); | ||
} | ||
|
||
} | ||
} |
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
113 changes: 113 additions & 0 deletions
113
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5150.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,113 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using CategoryAttribute = NUnit.Framework.CategoryAttribute; | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
|
||
public static class ContentDescriptionEffectProperties | ||
{ | ||
public static readonly BindableProperty ContentDescriptionProperty = BindableProperty.CreateAttached( | ||
"ContentDescription", | ||
typeof(string), | ||
typeof(ContentDescriptionEffectProperties), | ||
null, | ||
propertyChanged: OnContentDescriptionChanged ); | ||
|
||
public static string GetContentDescription(BindableObject view) | ||
{ | ||
return (string)view.GetValue(ContentDescriptionProperty); | ||
} | ||
|
||
public static void SetContentDescription(BindableObject view, string value) | ||
{ | ||
view.SetValue(ContentDescriptionProperty, value); | ||
} | ||
|
||
static void OnContentDescriptionChanged(BindableObject bindable, object oldValue, object newValue) | ||
{ | ||
System.Diagnostics.Debug.WriteLine($"Old value = {oldValue}, new value = {newValue}"); | ||
} | ||
paymicro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
public class ContentDescriptionEffect : RoutingEffect | ||
{ | ||
public const string EffectName = "ContentDescriptionEffect"; | ||
|
||
public ContentDescriptionEffect() : base($"{Issues.Effects.ResolutionGroupName}.{EffectName}") | ||
{ | ||
} | ||
} | ||
|
||
#if UITEST | ||
[Category(UITestCategories.Button)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 5150, "AutomationProperties.Name, AutomationProperties.HelpText on Button not read by Android TalkBack", PlatformAffected.Android)] | ||
public class Issue5150 : TestContentPage // or TestMasterDetailPage, etc ... | ||
{ | ||
|
||
private void Configure(Button button, Label label, StackLayout layout, string buttonText, string buttonName = null, string buttonHelp = null) | ||
paymicro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
button.Text = buttonText; | ||
button.Effects.Add(new ContentDescriptionEffect()); | ||
button.SetValue(AutomationProperties.NameProperty, buttonName); | ||
button.SetValue(AutomationProperties.HelpTextProperty, buttonHelp); | ||
button.PropertyChanged += (object sender, PropertyChangedEventArgs e) => { | ||
if (e.PropertyName == ContentDescriptionEffectProperties.ContentDescriptionProperty.PropertyName) | ||
{ | ||
var element = sender as Button; | ||
paymicro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var desc = (string)element.GetValue(ContentDescriptionEffectProperties.ContentDescriptionProperty); | ||
label.Text = desc; | ||
paymicro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}; | ||
layout.Children.Add(button); | ||
layout.Children.Add(label); | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
var layout = new StackLayout(); | ||
|
||
var ButtonWithTextAndName = new Button(); | ||
var ButtonWithTextAndNameLabel = new Label(); | ||
Configure(ButtonWithTextAndName, ButtonWithTextAndNameLabel, layout, "Button 1", buttonName: "Name 1"); | ||
|
||
var ButtonWithTextAndHelp = new Button(); | ||
var ButtonWithTextAndHelpLabel = new Label(); | ||
Configure(ButtonWithTextAndHelp, ButtonWithTextAndHelpLabel, layout, "Button 2", buttonHelp: "Help 2."); | ||
|
||
var ButtonWithTextAndNameAndHelp = new Button(); | ||
var ButtonWithTextAndNameAndHelpLabel = new Label(); | ||
Configure(ButtonWithTextAndNameAndHelp, ButtonWithTextAndNameAndHelpLabel, layout, "Button 3", "Name 3", "Help 3."); | ||
|
||
Content = layout; | ||
} | ||
|
||
#if UITEST | ||
[Test] | ||
public void Issue5150Test() | ||
{ | ||
RunningApp.Screenshot ("I am at Issue 5150"); | ||
|
||
RunningApp.WaitForElement (q => q.Text("Name 1")); | ||
RunningApp.Screenshot ("I see the label Name 1"); | ||
|
||
RunningApp.WaitForElement(q => q.Text("Button 2. Help 2.")); | ||
RunningApp.Screenshot("I see the label Button 2. Help 2."); | ||
|
||
RunningApp.WaitForElement(q => q.Text("Name 3. Help 3.")); | ||
RunningApp.Screenshot("I see the label Name 3. Help 3."); | ||
} | ||
#endif | ||
} | ||
} |
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.