@ -19,8 +19,8 @@ using Avalonia.Input.Raw;
using Avalonia.Input.TextInput ;
using Avalonia.OpenGL.Egl ;
using Avalonia.Platform ;
using Avalonia.Platform.Surfaces ;
using Avalonia.Platform.Storage ;
using Avalonia.Platform.Surfaces ;
using Avalonia.Rendering.Composition ;
using Java.Lang ;
using ClipboardManager = Android . Content . ClipboardManager ;
@ -39,7 +39,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
private readonly Clipboard _ clipboard ;
private readonly AndroidLauncher ? _l auncher ;
private readonly AndroidScreens ? _ screens ;
private SurfaceViewImpl _ view ;
private SurfaceViewImpl ? _ view ;
private WindowTransparencyLevel _ transparencyLevel ;
public TopLevelImpl ( AvaloniaView avaloniaView , bool placeOnTop = false )
@ -78,8 +78,8 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public IInputRoot ? InputRoot { get ; private set ; }
public Size ClientSize = > _ view . Size . ToSize ( RenderScaling ) ;
public double RenderScaling = > _ view . Scaling ;
public Size ClientSize = > _ view ? . Size . ToSize ( RenderScaling ) ? ? default ;
public double RenderScaling = > _ view ? . Scaling ? ? 1 ;
public Action ? Closed { get ; set ; }
@ -91,9 +91,9 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public Action < double > ? ScalingChanged { get ; set ; }
public View View = > _ view ;
public View ? View = > _ view ;
internal InvalidationAwareSurfaceView InternalView = > _ view ;
internal InvalidationAwareSurfaceView ? InternalView = > _ view ;
public double DesktopScaling = > RenderScaling ;
public IPlatformHandle Handle { get ; }
@ -126,8 +126,8 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public virtual void Dispose ( )
{
_ systemNavigationManager . Dispose ( ) ;
_ view . Dispose ( ) ;
_ view = null ! ;
_ view ? . Dispose ( ) ;
_ view = null ;
}
protected void OnResized ( Size size )
@ -193,7 +193,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
// ReSharper disable once CompareOfFloatsByEqualityOperator
if ( newScaling ! = _ oldScaling )
{
_ oldScaling = newScaling ;
_ oldScaling = newScaling ;
_ tl . ScalingChanged ? . Invoke ( newScaling ) ;
}
}
@ -232,7 +232,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public void SetFrameThemeVariant ( PlatformThemeVariant themeVariant )
{
if ( _ insetsManager ! = null )
if ( _ insetsManager ! = null )
{
_ insetsManager . SystemBarTheme = themeVariant switch
{
@ -245,12 +245,12 @@ namespace Avalonia.Android.Platform.SkiaPlatform
AppCompatDelegate . DefaultNightMode = themeVariant = = PlatformThemeVariant . Light ? AppCompatDelegate . ModeNightNo : AppCompatDelegate . ModeNightYes ;
}
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels = > new AcrylicPlatformCompensationLevels ( 1 , 1 , 1 ) ;
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels = > new ( 1 , 1 , 1 ) ;
IntPtr EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Handle = > ( ( IPlatformHandle ) _ view ) . Handle ;
IntPtr EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Handle = > ( _ view as IPlatformHandle ) ? . Handle ? ? default ;
bool EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfoWithWaitPolicy . SkipWaits = > true ;
PixelSize EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Size = > _ view . Size ;
double EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Scaling = > _ view . Scaling ;
PixelSize EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Size = > _ view ? . Size ? ? default ;
double EglGlPlatformSurface . IEglWindowGlPlatformSurfaceInfo . Scaling = > _ view ? . Scaling ? ? default ;
internal AndroidKeyboardEventsHelper < TopLevelImpl > KeyboardHelper = > _ keyboardHelper ;
@ -258,7 +258,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public void SetTransparencyLevelHint ( IReadOnlyList < WindowTransparencyLevel > transparencyLevels )
{
if ( _ view . Context is not AvaloniaActivity activity )
if ( _ view ? . Context is not AvaloniaActivity activity )
return ;
foreach ( var level in transparencyLevels )
@ -341,7 +341,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
return _ insetsManager ;
}
if ( featureType = = typeof ( IClipboard ) )
if ( featureType = = typeof ( IClipboard ) )
{
return _ clipboard ;
}
@ -355,7 +355,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
{
return _ screens ;
}
return null ;
}
@ -386,7 +386,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
internal void TextInput ( string text )
{
if ( Input ! = null )
if ( Input ! = null )
{
var args = new RawTextInputEventArgs ( AndroidKeyboardDevice . Instance ! , ( ulong ) SystemClock . UptimeMillis ( ) , InputRoot ! , text ) ;