Browse Source
Make mobile TryGetPlatformHandle consistent (#18483 )
* Use AndroidViewControlHandle for android toplevel handle
* Use UIViewControlHandle for iOS toplevel handle
* Use JSObjectControlHandle for browser toplevel handle
* Revert NativeControlHostImpl changes
pull/18487/head
Maxwell Katz
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
7 additions and
2 deletions
src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
src/Browser/Avalonia.Browser/BrowserTopLevelImpl.cs
src/iOS/Avalonia.iOS/AvaloniaView.cs
@ -78,7 +78,8 @@ namespace Avalonia.Android.Platform.SkiaPlatform
_ systemNavigationManager = new AndroidSystemNavigationManagerImpl ( avaloniaView . Context as IActivityNavigationService ) ;
Surfaces = new object [ ] { _ gl , _f ramebuffer , Handle } ;
Surfaces = new object [ ] { _ gl , _f ramebuffer , _ view } ;
Handle = new AndroidViewControlHandle ( _ view ) ;
}
public IInputRoot ? InputRoot { get ; private set ; }
@ -102,7 +103,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
internal InvalidationAwareSurfaceView InternalView = > _ view ;
public double DesktopScaling = > RenderScaling ;
public IPlatformHandle Handle = > _ view ;
public IPlatformHandle Handle { get ; }
public IEnumerable < object > Surfaces { get ; }
@ -70,6 +70,8 @@ namespace Avalonia.Browser
_ surface . SizeChanged + = OnSizeChanged ;
_ surface . ScalingChanged + = OnScalingChanged ;
Compositor = _ surface . Compositor ;
Handle = new JSObjectControlHandle ( container ) ;
}
private void OnScalingChanged ( )
@ -156,6 +156,8 @@ namespace Avalonia.iOS
public TopLevelImpl ( AvaloniaView view )
{
_ view = view ;
Handle = new UIViewControlHandle ( _ view ) ;
_ nativeControlHost = new NativeControlHostImpl ( view ) ;
#if TVOS
_ storageProvider = null ;