summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/VisualElementRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementRenderer.cs77
1 files changed, 0 insertions, 77 deletions
diff --git a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
index 68f5d7d4..c2c96eac 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
@@ -23,10 +23,6 @@ namespace Xamarin.Forms.Platform.Android
VisualElementRendererFlags _flags = VisualElementRendererFlags.AutoPackage | VisualElementRendererFlags.AutoTrack;
- string _defaultContentDescription;
- bool? _defaultFocusable;
- string _defaultHint;
- int? _defaultLabelFor;
InnerGestureListener _gestureListener;
VisualElementPackager _packager;
PropertyChangedEventHandler _propertyChangeHandler;
@@ -213,9 +209,6 @@ namespace Xamarin.Forms.Platform.Android
if (element != null && !string.IsNullOrEmpty(element.AutomationId))
SetAutomationId(element.AutomationId);
- SetContentDescription();
- SetFocusable();
-
Performance.Stop();
}
@@ -307,12 +300,6 @@ namespace Xamarin.Forms.Platform.Android
UpdateBackgroundColor();
else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
InputTransparent = Element.InputTransparent;
- else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
- SetContentDescription();
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
- SetContentDescription();
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
- SetFocusable();
}
protected override void OnLayout(bool changed, int l, int t, int r, int b)
@@ -342,62 +329,6 @@ namespace Xamarin.Forms.Platform.Android
ContentDescription = id;
}
- protected virtual void SetContentDescription()
- {
- if (Element == null)
- return;
-
- if (SetHint())
- return;
-
- if (_defaultContentDescription == null)
- _defaultContentDescription = ContentDescription;
-
- var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- ContentDescription = elemValue;
- else
- ContentDescription = _defaultContentDescription;
- }
-
- protected virtual void SetFocusable()
- {
- if (Element == null)
- return;
-
- if (!_defaultFocusable.HasValue)
- _defaultFocusable = Focusable;
-
- Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
- }
-
- protected virtual bool SetHint()
- {
- if (Element == null)
- return false;
-
- var textView = this as global::Android.Widget.TextView;
- if (textView == null)
- return false;
-
- // Let the specified Title/Placeholder take precedence, but don't set the ContentDescription (won't work anyway)
- if (((Element as Picker)?.Title ?? (Element as Entry)?.Placeholder ?? (Element as EntryCell)?.Placeholder) != null)
- return true;
-
- if (_defaultHint == null)
- _defaultHint = textView.Hint;
-
- var elemValue = string.Join(". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- textView.Hint = elemValue;
- else
- textView.Hint = _defaultHint;
-
- return true;
- }
-
protected void SetPackager(VisualElementPackager packager)
{
_packager = packager;
@@ -424,14 +355,6 @@ namespace Xamarin.Forms.Platform.Android
UpdateGestureRecognizers();
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- if (_defaultLabelFor == null)
- _defaultLabelFor = LabelFor;
-
- LabelFor = (int)(id ?? _defaultLabelFor);
- }
-
void SubscribeGestureRecognizers(VisualElement element)
{
var view = element as View;