Skip to content

Commit

Permalink
Move types in the Platform folder into the Platform namespaces (#3495)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Nov 26, 2021
1 parent ff062dd commit b09979d
Show file tree
Hide file tree
Showing 339 changed files with 628 additions and 1,532 deletions.
1 change: 1 addition & 0 deletions src/Compatibility/ControlGallery/src/Android/Activity1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppLinks;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;
using AColor = Android.Graphics.Color;

[assembly: Dependency(typeof(CacheService))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;
using Microsoft.Maui.Graphics;
using AMenuItemCompat = AndroidX.Core.View.MenuItemCompat;
using AView = Android.Views.View;
Expand Down Expand Up @@ -131,7 +132,7 @@ protected override void UpdateMenuItemIcon(Context context, IMenuItem menuItem,
if (toolBarItem.IconImageSource is FileImageSource fileImageSource)
{
var name = IOPath.GetFileNameWithoutExtension(fileImageSource.File);
var id = context.GetDrawableId(name);
var id = ResourceManager.GetDrawableId(context, name);
if (id != 0)
{
if ((int)Build.VERSION.SdkInt >= 21)
Expand Down
102 changes: 0 additions & 102 deletions src/Compatibility/ControlGallery/src/Android/DrawableExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;
using static Android.Widget.CompoundButton;

namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Android;
using Microsoft.Maui.Controls.Compatibility.ControlGallery.GalleryPages.CollectionViewGalleries.AlternateLayoutGalleries;
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Platform;
using ARect = Android.Graphics.Rect;
using AView = Android.Views.View;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Android;
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Platform;
using AView = Android.Views.View;

[assembly: ExportRenderer(typeof(Bugzilla38989._38989CustomViewCell), typeof(_38989CustomViewCellRenderer))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;

[assembly: ExportRenderer(typeof(Bugzilla59457.Bugzilla59457Entry), typeof(_59457CustomRenderer))]
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Android
Expand Down
1 change: 1 addition & 0 deletions src/Compatibility/ControlGallery/src/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;
using Microsoft.Maui.Hosting;
using ObjCRuntime;
using UIKit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;

[assembly: ExportEffect(typeof(GradientEffect), Issue6334.EffectName)]
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.iOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;
using ObjCRuntime;
using UIKit;
using static Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Issue6368;
Expand All @@ -23,8 +24,8 @@ protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
if (e.NewElement != null)
{
this.Layer.CornerRadius = 10;
this.Layer.BorderColor = Maui.ColorExtensions.ToCGColor(Maui.ColorExtensions.ToColor(UIColor.FromRGB(3, 169, 244)));
this.Layer.BackgroundColor = Maui.ColorExtensions.ToCGColor(Colors.GhostWhite);
this.Layer.BorderColor = UIColor.FromRGB(3, 169, 244).CGColor;
this.Layer.BackgroundColor = Colors.GhostWhite.ToCGColor();
this.Layer.BorderWidth = 1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;

[assembly: ExportRenderer(typeof(Issue11132Control), typeof(_11132CustomRenderer))]
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.iOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Platform;
using ObjCRuntime;
using UIKit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ void UpdateToolbar()

Color navIconColor = NavigationPage.GetIconColor(Current);
if (navIconColor != null && bar.NavigationIcon != null)
DrawableExtensions.SetColorFilter(bar.NavigationIcon, navIconColor, FilterMode.SrcAtop);
bar.NavigationIcon.SetColorFilter(navIconColor, FilterMode.SrcAtop);

bar.Title = currentPage?.Title ?? string.Empty;

Expand Down
5 changes: 0 additions & 5 deletions src/Compatibility/Core/src/Android/ColorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public static ColorStateList ToAndroidPreserveDisabled(this Color color, ColorSt
return new ColorStateList(States, new[] { color.ToAndroid().ToArgb(), disabled });
}

public static Color ToColor(this AColor color)
{
return Color.FromUint((uint)color.ToArgb());
}

internal static ColorStateList ToDefaultColorStateList(this Color color)
{
return ToDefaultColorStateList(color.ToAndroid());
Expand Down
147 changes: 0 additions & 147 deletions src/Compatibility/Core/src/Android/ContextExtensions.cs

This file was deleted.

3 changes: 3 additions & 0 deletions src/Compatibility/Core/src/GlobalNamespaces.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global using Microsoft.Maui;
global using Microsoft.Maui.Handlers;
global using Microsoft.Maui.Platform;
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void UpdateColor()
}
else
{
Control.Foreground = Maui.ColorExtensions.ToNative(color);
Control.Foreground = color.ToNative();
}
}

Expand Down

0 comments on commit b09979d

Please sign in to comment.