Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BlazorWebView/src/Maui/Android/BlazorWebChromeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
{
class BlazorWebChromeClient : WebChromeClient
{
public override bool OnCreateWindow(Android.Webkit.WebView? view, bool isDialog, bool isUserGesture, Message? resultMsg)
public override bool OnCreateWindow(global::Android.Webkit.WebView? view, bool isDialog, bool isUserGesture, Message? resultMsg)
{
if (view?.Context is not null)
{
Expand All @@ -29,7 +29,7 @@ public override bool OnCreateWindow(Android.Webkit.WebView? view, bool isDialog,
return false;
}

public override bool OnShowFileChooser(Android.Webkit.WebView? view, IValueCallback? filePathCallback, FileChooserParams? fileChooserParams)
public override bool OnShowFileChooser(global::Android.Webkit.WebView? view, IValueCallback? filePathCallback, FileChooserParams? fileChooserParams)
{
if (filePathCallback is null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using Android.Webkit;
using Android.Widget;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -32,7 +33,7 @@ protected override AWebView CreatePlatformView()
var blazorAndroidWebView = new BlazorAndroidWebView(Context!)
{
#pragma warning disable 618 // This can probably be replaced with LinearLayout(LayoutParams.MatchParent, LayoutParams.MatchParent); just need to test that theory
LayoutParameters = new Android.Widget.AbsoluteLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent, 0, 0)
LayoutParameters = new AbsoluteLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent, 0, 0)
#pragma warning restore 618
};
#pragma warning restore CA1416, CA1412, CA1422 // Validate platform compatibility
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Cells/Cell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void OnParentPropertyChanging(object sender, PropertyChangingEventArgs e)
// This is used by ListView to pass data to the GetCell call
// Ideally we can pass these as arguments to ToHandler
// But we'll do that in a different smaller more targeted PR
internal Android.Views.View ConvertView { get; set; }
internal global::Android.Views.View ConvertView { get; set; }
#elif IOS
internal UIKit.UITableViewCell ReusableCell { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#if WINDOWS
using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
#elif ANDROID
using Android.Content;
using PlatformView = Android.Views.View;
#elif IOS
using PlatformView = UIKit.UIView;
Expand Down Expand Up @@ -64,7 +65,7 @@ public abstract partial class VisualElementRenderer<TElement> : IPlatformViewHan
protected bool AutoPackage { get; set; } = true;

#if ANDROID
public VisualElementRenderer(Android.Content.Context context) : this(context, VisualElementRendererMapper, VisualElementRendererCommandMapper)
public VisualElementRenderer(Context context) : this(context, VisualElementRendererMapper, VisualElementRendererCommandMapper)
{
}
#else
Expand All @@ -75,7 +76,7 @@ public VisualElementRenderer() : this(VisualElementRendererMapper, VisualElement


#if ANDROID
protected VisualElementRenderer(Android.Content.Context context, IPropertyMapper mapper, CommandMapper? commandMapper = null)
protected VisualElementRenderer(Context context, IPropertyMapper mapper, CommandMapper? commandMapper = null)
#else
protected VisualElementRenderer(IPropertyMapper mapper, CommandMapper? commandMapper = null)
#endif
Expand Down
11 changes: 8 additions & 3 deletions src/Controls/src/Core/DragAndDrop/PlatformDragEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using System;
#if ANDROID
using Android.Views;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -49,14 +54,14 @@ public void SetDropProposal(UIKit.UIDropProposal dropProposal)
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
public AView Sender { get; }

/// <summary>
/// Gets the event containing information for drag and drop status.
/// </summary>
public Android.Views.DragEvent DragEvent { get; }
public DragEvent DragEvent { get; }

internal PlatformDragEventArgs(Android.Views.View sender, Android.Views.DragEvent dragEvent)
internal PlatformDragEventArgs(AView sender, DragEvent dragEvent)
{
Sender = sender;
DragEvent = dragEvent;
Expand Down
25 changes: 16 additions & 9 deletions src/Controls/src/Core/DragAndDrop/PlatformDragStartingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
using System;

#if ANDROID
using Android.Content;
using Android.Views;
using DragShadowBuilder = Android.Views.View.DragShadowBuilder;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -91,19 +98,19 @@ public void SetPrefersFullSizePreviews(Func<UIKit.UIDragInteraction, UIKit.IUIDr
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
public AView Sender { get; }

/// <summary>
/// Gets the event containing information for drag and drop status.
/// </summary>
public Android.Views.MotionEvent MotionEvent { get; }
public MotionEvent MotionEvent { get; }

internal Android.Views.View.DragShadowBuilder? DragShadowBuilder { get; private set; }
internal Android.Content.ClipData? ClipData { get; private set; }
internal DragShadowBuilder? DragShadowBuilder { get; private set; }
internal ClipData? ClipData { get; private set; }
internal Java.Lang.Object? LocalData { get; private set; }
internal Android.Views.DragFlags? DragFlags { get; private set; }
internal DragFlags? DragFlags { get; private set; }

internal PlatformDragStartingEventArgs(Android.Views.View sender, Android.Views.MotionEvent motionEvent)
internal PlatformDragStartingEventArgs(AView sender, MotionEvent motionEvent)
{
Sender = sender;
MotionEvent = motionEvent;
Expand All @@ -113,7 +120,7 @@ internal PlatformDragStartingEventArgs(Android.Views.View sender, Android.Views.
/// Sets the drag shadow when dragging begins.
/// </summary>
/// <param name="dragShadowBuilder">The custom drag shadow builder to use.</param>
public void SetDragShadowBuilder(Android.Views.View.DragShadowBuilder dragShadowBuilder)
public void SetDragShadowBuilder(DragShadowBuilder dragShadowBuilder)
{
DragShadowBuilder = dragShadowBuilder;
}
Expand All @@ -122,7 +129,7 @@ public void SetDragShadowBuilder(Android.Views.View.DragShadowBuilder dragShadow
/// Sets the clip data when dragging begins.
/// </summary>
/// <param name="clipData">The custom clip data to use.</param>
public void SetClipData(Android.Content.ClipData clipData)
public void SetClipData(ClipData clipData)
{
ClipData = clipData;
}
Expand All @@ -140,7 +147,7 @@ public void SetLocalData(Java.Lang.Object localData)
/// Sets the drag flags when dragging begins.
/// </summary>
/// <param name="dragFlags">The custom drag flags to use.</param>
public void SetDragFlags(Android.Views.DragFlags dragFlags)
public void SetDragFlags(DragFlags dragFlags)
{
DragFlags = dragFlags;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using System;

#if ANDROID
using Android.Views;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -73,14 +79,14 @@ internal PlatformDropCompletedEventArgs(UIKit.UIView? sender, UIKit.UIDropIntera
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
public AView Sender { get; }

/// <summary>
/// Gets the event containing information for drag and drop status.
/// </summary>
public Android.Views.DragEvent DragEvent { get; }
public DragEvent DragEvent { get; }

internal PlatformDropCompletedEventArgs(Android.Views.View sender, Android.Views.DragEvent dragEvent)
internal PlatformDropCompletedEventArgs(AView sender, DragEvent dragEvent)
{
Sender = sender;
DragEvent = dragEvent;
Expand Down
11 changes: 8 additions & 3 deletions src/Controls/src/Core/DragAndDrop/PlatformDropEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using System;

#if ANDROID
using Android.Views;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -35,14 +40,14 @@ internal PlatformDropEventArgs(UIKit.UIView? sender, UIKit.UIDropInteraction dro
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
public AView Sender { get; }

/// <summary>
/// Gets the event containing information for drag and drop status.
/// </summary>
public Android.Views.DragEvent DragEvent { get; }
public DragEvent DragEvent { get; }

internal PlatformDropEventArgs(Android.Views.View sender, Android.Views.DragEvent dragEvent)
internal PlatformDropEventArgs(AView sender, DragEvent dragEvent)
{
Sender = sender;
DragEvent = dragEvent;
Expand Down
5 changes: 3 additions & 2 deletions src/Controls/src/Core/Element/Element.Android.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Maui.Controls.Platform;
using AView = Android.Views.View;

namespace Microsoft.Maui.Controls
{
Expand All @@ -7,13 +8,13 @@ public partial class Element
public static void MapAutomationPropertiesIsInAccessibleTree(IElementHandler handler, Element element)
{
Platform.AutomationPropertiesProvider.SetImportantForAccessibility(
handler.PlatformView as Android.Views.View, element);
handler.PlatformView as AView, element);
}

public static void MapAutomationPropertiesExcludedWithChildren(IElementHandler handler, Element element)
{
Platform.AutomationPropertiesProvider.SetImportantForAccessibility(
handler.PlatformView as Android.Views.View, element);
handler.PlatformView as AView, element);
}

static void MapAutomationPropertiesIsInAccessibleTree(IElementHandler handler, IElement element)
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Embedding/EmbeddingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class EmbeddingExtensions
internal static MauiAppBuilder UseMauiEmbedding(this MauiAppBuilder builder)
{
#if ANDROID
var platformApplication = (Android.App.Application)Android.App.Application.Context;
var platformApplication = (global::Android.App.Application)global::Android.App.Application.Context;
#elif IOS || MACCATALYST
var platformApplication = UIKit.UIApplication.SharedApplication.Delegate;
#elif WINDOWS
Expand Down
12 changes: 9 additions & 3 deletions src/Controls/src/Core/PlatformPointerEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using System;

#if ANDROID
using Android.Views;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -27,14 +33,14 @@ internal PlatformPointerEventArgs(UIKit.UIView sender, UIKit.UIGestureRecognizer
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
public AView Sender { get; }

/// <summary>
/// Gets the native event or handler attached to the view.
/// </summary>
public Android.Views.MotionEvent MotionEvent { get; }
public MotionEvent MotionEvent { get; }

internal PlatformPointerEventArgs(Android.Views.View sender, Android.Views.MotionEvent motionEvent)
internal PlatformPointerEventArgs(AView sender, MotionEvent motionEvent)
{
Sender = sender;
MotionEvent = motionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
namespace Microsoft.Maui.Controls
#if ANDROID
using Android.Webkit;
using AView = Android.Views.View;
#endif

namespace Microsoft.Maui.Controls
{
public class PlatformWebViewProcessTerminatedEventArgs
{
#if ANDROID
internal PlatformWebViewProcessTerminatedEventArgs(Android.Views.View? sender, Android.Webkit.RenderProcessGoneDetail? renderProcessGoneDetail)
internal PlatformWebViewProcessTerminatedEventArgs(AView? sender, RenderProcessGoneDetail? renderProcessGoneDetail)
{
Sender = sender;
RenderProcessGoneDetail = renderProcessGoneDetail;
Expand All @@ -12,12 +17,12 @@ internal PlatformWebViewProcessTerminatedEventArgs(Android.Views.View? sender, A
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View? Sender { get; }
public AView? Sender { get; }

/// <summary>
/// Gets the native event or handler attached to the view.
/// </summary>
public Android.Webkit.RenderProcessGoneDetail? RenderProcessGoneDetail { get; }
public RenderProcessGoneDetail? RenderProcessGoneDetail { get; }
#elif IOS || MACCATALYST
internal PlatformWebViewProcessTerminatedEventArgs(WebKit.WKWebView sender)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Core/maps/src/Handlers/Map/MapHandler.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using Android.OS;
using Android.Views;
using Java.Lang;
using Java.Util.Logging;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -316,7 +317,7 @@ internal void UpdateVisibleRegion(LatLng pos)
VirtualView.VisibleRegion = new MapSpan(new Devices.Sensors.Location(pos.Latitude, pos.Longitude), dlat, dlong);
}

void MapViewLayoutChange(object? sender, Android.Views.View.LayoutChangeEventArgs e)
void MapViewLayoutChange(object? sender, View.LayoutChangeEventArgs e)
{
InitialUpdate();
}
Expand Down
15 changes: 9 additions & 6 deletions src/Core/src/ActivationState.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#nullable enable
using System;
#if ANDROID
using Android.OS;
#endif

namespace Microsoft.Maui
{
public class ActivationState : IActivationState
{
#if __ANDROID__
public ActivationState(IMauiContext context, Android.OS.Bundle? savedInstance)
#if ANDROID
public ActivationState(IMauiContext context, Bundle? savedInstance)
: this(context, GetPersistedState(savedInstance))
{
SavedInstance = savedInstance;
Expand Down Expand Up @@ -46,16 +49,16 @@ public ActivationState(IMauiContext context, IPersistedState state)

public IPersistedState State { get; }

#if __ANDROID__
public Android.OS.Bundle? SavedInstance { get; }
#if ANDROID
public Bundle? SavedInstance { get; }
#elif WINDOWS
public UI.Xaml.LaunchActivatedEventArgs? LaunchActivatedEventArgs { get; }
#elif TIZEN
public Tizen.Applications.Bundle? SavedInstance { get; }
#endif

#if __ANDROID__
static PersistedState GetPersistedState(Android.OS.Bundle? state)
#if ANDROID
static PersistedState GetPersistedState(Bundle? state)
{
var dict = new PersistedState();

Expand Down
7 changes: 5 additions & 2 deletions src/Core/src/Core/Extensions/ITextInputExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
#if ANDROID
using Android.Text;
#endif

namespace Microsoft.Maui
{
Expand Down Expand Up @@ -43,8 +46,8 @@ public static bool TextWithinMaxLength(this ITextInput textInput, string? text,
}
#endif

#if __ANDROID__
public static void UpdateText(this ITextInput textInput, Android.Text.TextChangedEventArgs e)
#if ANDROID
public static void UpdateText(this ITextInput textInput, TextChangedEventArgs e)
{
if (e.Text is Java.Lang.ICharSequence cs)
textInput.UpdateText(cs.ToString());
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Embedding/EmbeddingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal static class EmbeddingExtensions
internal static MauiAppBuilder UseMauiEmbedding(this MauiAppBuilder builder, PlatformApplication? platformApplication = null)
{
#if ANDROID
platformApplication ??= (Android.App.Application)Android.App.Application.Context;
platformApplication ??= (global::Android.App.Application)global::Android.App.Application.Context;
#elif IOS || MACCATALYST
platformApplication ??= UIKit.UIApplication.SharedApplication.Delegate;
#elif WINDOWS
Expand Down
Loading
Loading