Skip to content

Commit

Permalink
- move compatibility handler to compatibility library
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Jan 12, 2022
1 parent 5c576a8 commit 97a812a
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/Compatibility/Core/src/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.LifecycleEvents;
using Microsoft.Maui.Controls.Handlers.Compatibility;

#if __ANDROID__
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
Expand Down Expand Up @@ -79,6 +80,15 @@ static MauiAppBuilder SetupDefaults(this MauiAppBuilder builder)
handlers.TryAddCompatibilityRenderer(typeof(TextCell), typeof(TextCellRenderer));
handlers.TryAddCompatibilityRenderer(typeof(ViewCell), typeof(ViewCellRenderer));
handlers.TryAddCompatibilityRenderer(typeof(SwitchCell), typeof(SwitchCellRenderer));
#elif ANDROID
handlers.AddHandler(typeof(ListView), typeof(ListViewRenderer));
handlers.AddHandler(typeof(Cell), typeof(CellRenderer));
handlers.AddHandler(typeof(ImageCell), typeof(ImageCellRenderer));
handlers.AddHandler(typeof(EntryCell), typeof(EntryCellRenderer));
handlers.AddHandler(typeof(TextCell), typeof(TextCellRenderer));
handlers.AddHandler(typeof(ViewCell), typeof(ViewCellRenderer));
handlers.AddHandler(typeof(SwitchCell), typeof(SwitchCellRenderer));

#endif

#if __ANDROID__ || __IOS__ || WINDOWS || MACCATALYST
Expand Down
11 changes: 0 additions & 11 deletions src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ public static partial class AppHostBuilderExtensions
#if WINDOWS || ANDROID
{ typeof(NavigationPage), typeof(NavigationViewHandler) },
{ typeof(Toolbar), typeof(ToolbarHandler) },
#endif
#if ANDROID
{ typeof(TabbedPage), typeof(Controls.Handlers.TabbedPageHandler) },
{ typeof(FlyoutPage), typeof(FlyoutViewHandler) },
{ typeof(ListView), typeof(Controls.Handlers.Compatibility.ListViewRenderer) },
{ typeof(Cell), typeof(Controls.Handlers.Compatibility.CellRenderer) },
{ typeof(ImageCell), typeof(Handlers.Compatibility.ImageCellRenderer) },
{ typeof(EntryCell), typeof(Handlers.Compatibility.EntryCellRenderer) },
{ typeof(TextCell), typeof(Handlers.Compatibility.TextCellRenderer) },
{ typeof(ViewCell), typeof(Handlers.Compatibility.ViewCellRenderer) },
{ typeof(SwitchCell), typeof(Handlers.Compatibility.SwitchCellRenderer) },
#endif
};

Expand Down

0 comments on commit 97a812a

Please sign in to comment.