зеркало из https://github.com/DeGsoft/maui-linux.git
[Android] Remove changes to IVisualElementRenderer so it remains backwards compatible (#5398)
* return IVisualElementRenderer to previous state * set to internal
This commit is contained in:
Родитель
a08e954eaa
Коммит
70a2a628a5
|
@ -21,7 +21,8 @@ namespace Xamarin.Forms.Platform.Android
|
|||
IImageRendererController,
|
||||
AView.IOnFocusChangeListener,
|
||||
AView.IOnClickListener,
|
||||
AView.IOnTouchListener
|
||||
AView.IOnTouchListener,
|
||||
ILayoutChanges
|
||||
{
|
||||
bool _inputTransparent;
|
||||
bool _disposed;
|
||||
|
|
|
@ -15,7 +15,9 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
{
|
||||
renderer.ElementPropertyChanged += OnElementPropertyChanged;
|
||||
renderer.ElementChanged += OnElementChanged;
|
||||
renderer.LayoutChange += OnLayoutChange;
|
||||
|
||||
if(renderer is ILayoutChanges layoutChanges)
|
||||
layoutChanges.LayoutChange += OnLayoutChange;
|
||||
}
|
||||
|
||||
static void OnLayoutChange(object sender, global::Android.Views.View.LayoutChangeEventArgs e)
|
||||
|
@ -28,7 +30,8 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
{
|
||||
renderer.ElementPropertyChanged -= OnElementPropertyChanged;
|
||||
renderer.ElementChanged -= OnElementChanged;
|
||||
renderer.LayoutChange -= OnLayoutChange;
|
||||
if (renderer is ILayoutChanges layoutChanges)
|
||||
layoutChanges.LayoutChange -= OnLayoutChange;
|
||||
|
||||
if (renderer.View is ImageView imageView)
|
||||
imageView.SetImageDrawable(null);
|
||||
|
|
|
@ -11,7 +11,8 @@ using Android.Support.V4.View;
|
|||
|
||||
namespace Xamarin.Forms.Platform.Android.FastRenderers
|
||||
{
|
||||
internal sealed class ImageRenderer : AImageView, IVisualElementRenderer, IImageRendererController, IViewRenderer, ITabStop
|
||||
internal sealed class ImageRenderer : AImageView, IVisualElementRenderer, IImageRendererController, IViewRenderer, ITabStop,
|
||||
ILayoutChanges
|
||||
{
|
||||
bool _disposed;
|
||||
Image _element;
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
using System;
|
||||
using ALayoutChangeEventArgs = Android.Views.View.LayoutChangeEventArgs;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
internal interface ILayoutChanges
|
||||
{
|
||||
event EventHandler<ALayoutChangeEventArgs> LayoutChange;
|
||||
}
|
||||
}
|
|
@ -29,7 +29,5 @@ namespace Xamarin.Forms.Platform.Android
|
|||
void SetLabelFor(int? id);
|
||||
|
||||
void UpdateLayout();
|
||||
|
||||
event EventHandler<ALayoutChangeEventArgs> LayoutChange;
|
||||
}
|
||||
}
|
|
@ -31,12 +31,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
remove { _elementPropertyChanged -= value; }
|
||||
}
|
||||
|
||||
event EventHandler<AView.LayoutChangeEventArgs> IVisualElementRenderer.LayoutChange
|
||||
{
|
||||
add =>_flyoutRenderer.AndroidView.LayoutChange += value;
|
||||
remove => _flyoutRenderer.AndroidView.LayoutChange -= value;
|
||||
}
|
||||
|
||||
VisualElement IVisualElementRenderer.Element => Element;
|
||||
|
||||
VisualElementTracker IVisualElementRenderer.Tracker => null;
|
||||
|
|
|
@ -144,6 +144,7 @@
|
|||
<Compile Include="GetDesiredSizeDelegate.cs" />
|
||||
<Compile Include="IBorderVisualElementRenderer.cs" />
|
||||
<Compile Include="IDeviceInfoProvider.cs" />
|
||||
<Compile Include="ILayoutChanges.cs" />
|
||||
<Compile Include="ITabStop.cs" />
|
||||
<Compile Include="IPickerRenderer.cs" />
|
||||
<Compile Include="PickerManager.cs" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче