Skip to content

Commit

Permalink
Frame Compatibility Handlers (#4210)
Browse files Browse the repository at this point in the history
* Frame Compat Handlers

* - gallery fixes

* - fix up property change and autopackaging

* - add mappers

* - fix up frame renderer mappers

* - fix WinUI Measure calls

* - fix containerview return

* - fix android measure

* - fix layout call

* - fix handler registrations

* - clean up apphost registration

* - disable swipeview on iOS for now

* - fix iOS shadow

* - revert mapper fix

* - simplify containerview check

Co-authored-by: Redth <jondick@gmail.com>
  • Loading branch information
PureWeen and Redth authored Jan 21, 2022
1 parent 863b2f7 commit e567ad2
Show file tree
Hide file tree
Showing 30 changed files with 917 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
}
}

public class CustomFrameRenderer5724 :
#if !LEGACY_RENDERERS
Compatibility.Platform.Android.FastRenderers.FrameRenderer
#else
FrameRenderer
#endif
public class CustomFrameRenderer5724 : Handlers.Compatibility.FrameRenderer
{
public CustomFrameRenderer5724(Context context) : base(context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: ExportRenderer(typeof(CustomFrame9974), typeof(_9774CustomRenderer))]
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.iOS.CustomRenderers
{
public class _9774CustomRenderer : FrameRenderer
public class _9774CustomRenderer : Handlers.Compatibility.FrameRenderer
{
public _9774CustomRenderer()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: ExportRenderer(typeof(CustomFrame10348), typeof(_CustomFrame10348Renderer))]
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.iOS.CustomRenderers
{
public class _CustomFrame10348Renderer : FrameRenderer
public class _CustomFrame10348Renderer : Handlers.Compatibility.FrameRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ protected override void Dispose(bool disposing)
}
}

public class PerformanceTrackingFrame : FrameRenderer, IDrawnObservable
public class PerformanceTrackingFrame : Handlers.Compatibility.FrameRenderer, IDrawnObservable
{
readonly SubviewWatcher<PerformanceTrackingFrame> _watcher;
int _Drawn;
Expand Down
2 changes: 2 additions & 0 deletions src/Compatibility/Core/src/Android/AppCompat/FrameRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using Android.Content;

namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat
{
// This version of FrameRenderer is here for backward compatibility with anyone referencing
// FrameRenderer from this namespace
[Obsolete("Use Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer instead")]
public class FrameRenderer : FastRenderers.FrameRenderer
{
public FrameRenderer(Context context) : base(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers
{
[Obsolete("Use Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer instead")]
public class FrameRenderer : CardView, IVisualElementRenderer, IViewRenderer, ITabStop
{
float _defaultElevation = -1f;
Expand Down
4 changes: 2 additions & 2 deletions src/Compatibility/Core/src/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ static MauiAppBuilder SetupDefaults(this MauiAppBuilder builder)
handlers.AddHandler(typeof(ViewCell), typeof(Handlers.Compatibility.ViewCellRenderer));
handlers.AddHandler(typeof(SwitchCell), typeof(Handlers.Compatibility.SwitchCellRenderer));
handlers.AddHandler(typeof(TableView), typeof(Handlers.Compatibility.TableViewRenderer));

handlers.TryAddCompatibilityRenderer(typeof(Frame), typeof(FrameRenderer));
handlers.AddHandler(typeof(Frame), typeof(Handlers.Compatibility.FrameRenderer));
handlers.TryAddCompatibilityRenderer(typeof(BoxView), typeof(BoxRenderer));
handlers.TryAddCompatibilityRenderer(typeof(Entry), typeof(EntryRenderer));
handlers.TryAddCompatibilityRenderer(typeof(Editor), typeof(EditorRenderer));
Expand Down
Loading

0 comments on commit e567ad2

Please sign in to comment.