From d40e6438d67e81fa5a2f8348dc2fc753c8e4b400 Mon Sep 17 00:00:00 2001 From: Mattia Date: Wed, 30 Sep 2020 10:48:49 +0200 Subject: [PATCH] update fun5 --- .../SampleApp.Android/AndroidHasFocus.cs | 57 +- .../Resources/Resource.designer.cs | 556 +++++++++--------- .../SampleApp.Android.csproj | 2 +- SampleApp/SampleApp.iOS/SampleApp.iOS.csproj | 2 +- SampleApp/SampleApp.iOS/iOSFocusEvents.cs | 1 - SampleApp/SampleApp.iOS/iOSHasFocus.cs | 64 +- .../DependencyServices/IIsFocused.cs | 10 + SampleApp/SampleApp/SampleApp.csproj | 2 +- SampleApp/SampleApp/Views/Functionality5.xaml | 6 +- .../SampleApp/Views/Functionality5.xaml.cs | 51 +- 10 files changed, 364 insertions(+), 387 deletions(-) create mode 100644 SampleApp/SampleApp/DependencyServices/IIsFocused.cs diff --git a/SampleApp/SampleApp.Android/AndroidHasFocus.cs b/SampleApp/SampleApp.Android/AndroidHasFocus.cs index dac330ba..4764b5f5 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