diff --git a/SampleApp/SampleApp.Android/AndroidHasFocus.cs b/SampleApp/SampleApp.Android/AndroidHasFocus.cs index dac330baf02ddfd27b0eca97d4d9697a41eecb10..4764b5f5c1ec993c882d90f814a10c555183f48f 100644 --- a/SampleApp/SampleApp.Android/AndroidHasFocus.cs +++ b/SampleApp/SampleApp.Android/AndroidHasFocus.cs @@ -1,58 +1,19 @@ using System; -using System.Threading.Tasks; -using Android.Content; -using Android.Views.Accessibility; -using SampleApp.CustomRenderers; -using SampleApp.Droid; +using Android.Views; +using fun5.Droid; +using SampleApp.DependencyServices; using Xamarin.Forms; using Xamarin.Forms.Platform.Android; -[assembly: ExportRenderer(typeof(CustomLabel), typeof(AndroidHasFocus))] -namespace SampleApp.Droid +[assembly: Dependency(typeof(focusAndroid))] +namespace fun5.Droid { - public class AndroidHasFocus : LabelRenderer + public class focusAndroid : IIsFocused { - Context context; - - public AndroidHasFocus(Context context) : base(context) + public bool isFocused(Xamarin.Forms.View v) { - this.context = context; + return v.GetRenderer().View.IsAccessibilityFocused; } - - protected override void OnElementChanged(ElementChangedEventArgs