kerams
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
13 additions and
0 deletions
-
src/Android/Avalonia.Android/AvaloniaView.cs
-
src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs
|
|
|
@ -39,6 +39,7 @@ namespace Avalonia.Android |
|
|
|
OnConfigurationChanged(); |
|
|
|
|
|
|
|
_view.InternalView.SurfaceWindowCreated += InternalView_SurfaceWindowCreated; |
|
|
|
_view.InternalView.SurfaceWindowDestroyed += InternalView_SurfaceWindowDestroyed; |
|
|
|
|
|
|
|
_accessHelper = new AvaloniaAccessHelper(this); |
|
|
|
ViewCompat.SetAccessibilityDelegate(this, _accessHelper); |
|
|
|
@ -51,9 +52,18 @@ namespace Avalonia.Android |
|
|
|
if (Visibility == ViewStates.Visible) |
|
|
|
{ |
|
|
|
OnVisibilityChanged(true); |
|
|
|
|
|
|
|
_root?.InvalidateMeasure(); |
|
|
|
Invalidate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void InternalView_SurfaceWindowDestroyed(object? sender, EventArgs e) |
|
|
|
{ |
|
|
|
OnVisibilityChanged(false); |
|
|
|
_surfaceCreated = false; |
|
|
|
} |
|
|
|
|
|
|
|
internal TopLevelImpl TopLevelImpl => _view; |
|
|
|
internal TopLevel? TopLevel => _root; |
|
|
|
|
|
|
|
|
|
|
|
@ -18,6 +18,8 @@ namespace Avalonia.Android |
|
|
|
private double _scaling = 1; |
|
|
|
|
|
|
|
public event EventHandler? SurfaceWindowCreated; |
|
|
|
public event EventHandler? SurfaceWindowDestroyed; |
|
|
|
|
|
|
|
public PixelSize Size => _size; |
|
|
|
public double Scaling => _scaling; |
|
|
|
|
|
|
|
@ -61,6 +63,7 @@ namespace Avalonia.Android |
|
|
|
.Log(this, "InvalidationAwareSurfaceView Destroyed"); |
|
|
|
ReleaseNativeWindowHandle(); |
|
|
|
_size = new PixelSize(1, 1); |
|
|
|
SurfaceWindowDestroyed?.Invoke(this, EventArgs.Empty); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void SurfaceRedrawNeeded(ISurfaceHolder holder) |
|
|
|
|