summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorSamantha Houts <samhouts@users.noreply.github.com>2017-05-10 10:20:57 -0700
committerRui Marinho <me@ruimarinho.net>2017-05-10 18:23:00 +0100
commitab1f669f9f87bc0c9823929e6497bc3b1a4018d6 (patch)
tree5cdb6d84147912651727dd4fd27073acb68ef117 /Xamarin.Forms.Platform.Android
parent5a472237b3b3f92cdaf5992a68a0afa0d49f4149 (diff)
downloadxamarin-forms-ab1f669f9f87bc0c9823929e6497bc3b1a4018d6.tar.gz
xamarin-forms-ab1f669f9f87bc0c9823929e6497bc3b1a4018d6.tar.bz2
xamarin-forms-ab1f669f9f87bc0c9823929e6497bc3b1a4018d6.zip
[All] Rename Accessibility -> AutomationProperties (#912)
* [All] Renamed Accessibility -> AutomationProperties * Update docs * Restore doc summaries * Revert unintended csproj changes
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs (renamed from Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs)24
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Android/ViewRenderer.cs10
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementRenderer.cs12
-rw-r--r--Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj2
6 files changed, 30 insertions, 30 deletions
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs b/Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs
index 29327dcd..6d34c6b5 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs
@@ -4,7 +4,7 @@ using Android.Widget;
namespace Xamarin.Forms.Platform.Android.FastRenderers
{
- internal class AccessibilityProvider : IDisposable
+ internal class AutomationPropertiesProvider : IDisposable
{
const string GetFromElement = "GetValueFromElement";
string _defaultContentDescription;
@@ -14,7 +14,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
IVisualElementRenderer _renderer;
- public AccessibilityProvider(IVisualElementRenderer renderer)
+ public AutomationPropertiesProvider(IVisualElementRenderer renderer)
{
_renderer = renderer;
_renderer.ElementPropertyChanged += OnElementPropertyChanged;
@@ -88,8 +88,8 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
string value = contentDescription;
if (value == GetFromElement)
{
- value = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty),
- (string)Element.GetValue(Accessibility.HintProperty));
+ value = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty),
+ (string)Element.GetValue(AutomationProperties.HelpTextProperty));
}
if (!string.IsNullOrWhiteSpace(value))
@@ -115,7 +115,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
}
Control.Focusable =
- (bool)(value ?? (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+ (bool)(value ?? (bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
}
bool SetHint(string hint = GetFromElement)
@@ -145,8 +145,8 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
string value = hint;
if (value == GetFromElement)
{
- value = string.Join(". ", (string)Element.GetValue(Accessibility.NameProperty),
- (string)Element.GetValue(Accessibility.HintProperty));
+ value = string.Join(". ", (string)Element.GetValue(AutomationProperties.NameProperty),
+ (string)Element.GetValue(AutomationProperties.HelpTextProperty));
}
textView.Hint = !string.IsNullOrWhiteSpace(value) ? value : _defaultHint;
@@ -159,7 +159,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
if (Element == null || Control == null)
return;
- var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+ var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
if (elemValue != null)
{
@@ -193,19 +193,19 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+ if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
{
SetContentDescription();
}
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
{
SetContentDescription();
}
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
{
SetFocusable();
}
- else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName)
{
SetLabeledBy();
}
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
index 05e0471b..9632f2bb 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
@@ -27,7 +27,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
bool _isDisposed;
bool _inputTransparent;
readonly Lazy<TextColorSwitcher> _textColorSwitcher;
- readonly AccessibilityProvider _accessibilityProvider;
+ readonly AutomationPropertiesProvider _automationPropertiesProvider;
readonly EffectControlProvider _effectControlProvider;
VisualElementTracker _tracker;
@@ -36,7 +36,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
public ButtonRenderer() : base(Forms.Context)
{
- _accessibilityProvider = new AccessibilityProvider(this);
+ _automationPropertiesProvider = new AutomationPropertiesProvider(this);
_effectControlProvider = new EffectControlProvider(this);
_textColorSwitcher = new Lazy<TextColorSwitcher>(() => new TextColorSwitcher(TextColors));
@@ -179,7 +179,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
SetOnTouchListener(null);
RemoveOnAttachStateChangeListener(this);
- _accessibilityProvider?.Dispose();
+ _automationPropertiesProvider?.Dispose();
_tracker?.Dispose();
if (Element != null)
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
index 34ea7e34..0112481d 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
@@ -13,7 +13,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
IVisualElementRenderer _renderer;
readonly GestureManager _gestureManager;
- readonly AccessibilityProvider _accessibilityProvider;
+ readonly AutomationPropertiesProvider _automatiomPropertiesProvider;
readonly EffectControlProvider _effectControlProvider;
public VisualElementRenderer(IVisualElementRenderer renderer)
@@ -22,7 +22,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
_renderer.ElementPropertyChanged += OnElementPropertyChanged;
_renderer.ElementChanged += OnElementChanged;
_gestureManager = new GestureManager(_renderer);
- _accessibilityProvider = new AccessibilityProvider(_renderer);
+ _automatiomPropertiesProvider = new AutomationPropertiesProvider(_renderer);
_effectControlProvider = new EffectControlProvider(_renderer?.View);
}
@@ -64,7 +64,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
if (disposing)
{
_gestureManager?.Dispose();
- _accessibilityProvider?.Dispose();
+ _automatiomPropertiesProvider?.Dispose();
if (_renderer != null)
{
diff --git a/Xamarin.Forms.Platform.Android/ViewRenderer.cs b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
index 842fc5c2..1cf77594 100644
--- a/Xamarin.Forms.Platform.Android/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
@@ -127,7 +127,7 @@ namespace Xamarin.Forms.Platform.Android
if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
UpdateIsEnabled();
- else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName)
SetLabeledBy();
}
@@ -177,7 +177,7 @@ namespace Xamarin.Forms.Platform.Android
if (_defaultContentDescription == null)
_defaultContentDescription = Control.ContentDescription;
- var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+ var elemValue = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
if (!string.IsNullOrWhiteSpace(elemValue))
Control.ContentDescription = elemValue;
@@ -199,7 +199,7 @@ namespace Xamarin.Forms.Platform.Android
if (!_defaultFocusable.HasValue)
_defaultFocusable = Control.Focusable;
- Control.Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+ Control.Focusable = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
}
protected override bool SetHint()
@@ -223,7 +223,7 @@ namespace Xamarin.Forms.Platform.Android
if (_defaultHint == null)
_defaultHint = textView.Hint;
- var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.HintProperty)))) ? "" : ". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+ var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.HelpTextProperty)))) ? "" : ". ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
if (!string.IsNullOrWhiteSpace(elemValue))
textView.Hint = elemValue;
@@ -305,7 +305,7 @@ namespace Xamarin.Forms.Platform.Android
if (Element == null || Control == null)
return;
- var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+ var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
if (elemValue != null)
{
diff --git a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
index fc0d0436..747956c3 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
@@ -316,11 +316,11 @@ namespace Xamarin.Forms.Platform.Android
{
if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
UpdateBackgroundColor();
- else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
SetContentDescription();
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
SetContentDescription();
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+ else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
SetFocusable();
else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
UpdateInputTransparent();
@@ -366,7 +366,7 @@ namespace Xamarin.Forms.Platform.Android
if (_defaultContentDescription == null)
_defaultContentDescription = ContentDescription;
- var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+ var elemValue = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
if (!string.IsNullOrWhiteSpace(elemValue))
ContentDescription = elemValue;
@@ -382,7 +382,7 @@ namespace Xamarin.Forms.Platform.Android
if (!_defaultFocusable.HasValue)
_defaultFocusable = Focusable;
- Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+ Focusable = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
}
protected virtual bool SetHint()
@@ -401,7 +401,7 @@ namespace Xamarin.Forms.Platform.Android
if (_defaultHint == null)
_defaultHint = textView.Hint;
- var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.HintProperty)))) ? "" : ". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+ var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.HelpTextProperty)))) ? "" : ". ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
if (!string.IsNullOrWhiteSpace(elemValue))
textView.Hint = elemValue;
diff --git a/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj b/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
index 5100b873..5d43f6c1 100644
--- a/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
+++ b/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
@@ -104,7 +104,7 @@
<Compile Include="AndroidTitleBarVisibility.cs" />
<Compile Include="AppCompat\FrameRenderer.cs" />
<Compile Include="Extensions\JavaObjectExtensions.cs" />
- <Compile Include="FastRenderers\AccessibilityProvider.cs" />
+ <Compile Include="FastRenderers\AutomationPropertiesProvider.cs" />
<Compile Include="FastRenderers\ButtonRenderer.cs" />
<Compile Include="AppCompat\FormsViewPager.cs" />
<Compile Include="AppCompat\FragmentContainer.cs" />