From 3e28520bad8e478eca28dcab813671618dace3ba Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Mon, 13 Jul 2026 19:47:53 +0200 Subject: [PATCH] [Mono.Android] Remove dead `ViewTreeObserver.cs` The entire body of `Android.Views/ViewTreeObserver.cs` was disabled with `#if false`, so it compiled to nothing more than an empty `public partial class ViewTreeObserver { }`. The actual `ViewTreeObserver` type is produced by the binding generator, so this hand-written partial contributed nothing to the compiled assembly and its public API surface is unchanged by the removal. Delete the dead file and its explicit `` entry in `Mono.Android.csproj` (the project lists sources explicitly, so the entry must be removed too). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7898fa8d-194d-4aad-8d0f-9eb18d8d1f7f --- .../Android.Views/ViewTreeObserver.cs | 40 ------------------- src/Mono.Android/Mono.Android.csproj | 1 - 2 files changed, 41 deletions(-) delete mode 100644 src/Mono.Android/Android.Views/ViewTreeObserver.cs diff --git a/src/Mono.Android/Android.Views/ViewTreeObserver.cs b/src/Mono.Android/Android.Views/ViewTreeObserver.cs deleted file mode 100644 index bafa1bbb409..00000000000 --- a/src/Mono.Android/Android.Views/ViewTreeObserver.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -using Java.Interop; - -namespace Android.Views { - - public partial class ViewTreeObserver { -#if false - -#region "Event implementation for Android.Views.ViewTreeObserver.IOnGlobalLayoutListener" - public event EventHandler GlobalLayout { - add { - global::Java.Interop.EventHelper.AddEventHandler( - ref weak_implementor_AddOnGlobalLayoutListener, - __CreateIOnGlobalLayoutListenerImplementor, - AddOnGlobalLayoutListener, - __h => __h.Handler += value); - } - remove { -#if ANDROID_16 - if (global::Android.OS.Build.VERSION.SdkInt >= global::Android.OS.BuildVersionCodes.JellyBean) - global::Java.Interop.EventHelper.RemoveEventHandler( - ref weak_implementor_AddOnGlobalLayoutListener, - Android.Views.ViewTreeObserver.IOnGlobalLayoutListenerImplementor.__IsEmpty, - RemoveOnGlobalLayoutListener, - __h => __h.Handler -= value); - else -#endif - global::Java.Interop.EventHelper.RemoveEventHandler( - ref weak_implementor_AddOnGlobalLayoutListener, - Android.Views.ViewTreeObserver.IOnGlobalLayoutListenerImplementor.__IsEmpty, - RemoveGlobalOnLayoutListener, - __h => __h.Handler -= value); - } - } -#endregion - -#endif // false - } -} diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index da87e0ef57d..73941e44b8d 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -294,7 +294,6 @@ -