summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-06-08 15:30:25 -0600
committerGitHub <noreply@github.com>2017-06-08 15:30:25 -0600
commitac865bb0347246660b924e39b9f417121598c52d (patch)
treeab3ca573ae778677beb57825366f03db95be9ce1 /Xamarin.Forms.Platform.Android
parent3a0aa901641e60aacc1213ff9db94d5b7c3107b3 (diff)
downloadxamarin-forms-ac865bb0347246660b924e39b9f417121598c52d.tar.gz
xamarin-forms-ac865bb0347246660b924e39b9f417121598c52d.tar.bz2
xamarin-forms-ac865bb0347246660b924e39b9f417121598c52d.zip
Update View Enabled property when IsEnabled changes (#968)
* Actually update Enabled on Android renderers * Fix test number
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementTracker.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs
index b02fa0c4..f4436209 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs
@@ -160,6 +160,8 @@ namespace Xamarin.Forms.Platform.Android
UpdateTranslationX();
else if (e.PropertyName == VisualElement.TranslationYProperty.PropertyName)
UpdateTranslationY();
+ else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
+ UpdateIsEnabled();
}
void HandleRedrawNeeded(object sender, EventArg<VisualElement> e)
@@ -382,6 +384,11 @@ namespace Xamarin.Forms.Platform.Android
aview.TranslationY = _context.ToPixels(view.TranslationY);
}
+ void UpdateIsEnabled()
+ {
+ _renderer.View.Enabled = _renderer.Element.IsEnabled;
+ }
+
class AttachTracker : Object, AView.IOnAttachStateChangeListener
{
public static readonly AttachTracker Instance = new AttachTracker();