zabolotnev
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
7 additions and
3 deletions
-
src/Android/Avalonia.Android/AvaloniaActivity.cs
-
src/Android/Avalonia.Android/AvaloniaView.cs
|
|
|
@ -122,6 +122,9 @@ public class AvaloniaActivity : AppCompatActivity, IAvaloniaActivity |
|
|
|
{ |
|
|
|
attributes.LayoutInDisplayCutoutMode = LayoutInDisplayCutoutMode.ShortEdges; |
|
|
|
} |
|
|
|
|
|
|
|
// We inform the ContentView that it has become visible. OnVisibleChanged() sometimes doesn't get called. Issue #15807.
|
|
|
|
_view?.OnVisibilityChanged(true); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnDestroy() |
|
|
|
|
|
|
|
@ -68,9 +68,9 @@ namespace Avalonia.Android |
|
|
|
OnVisibilityChanged(visibility == ViewStates.Visible); |
|
|
|
} |
|
|
|
|
|
|
|
private void OnVisibilityChanged(bool isVisible) |
|
|
|
internal void OnVisibilityChanged(bool isVisible) |
|
|
|
{ |
|
|
|
if (isVisible) |
|
|
|
if (isVisible && _timerSubscription == null) |
|
|
|
{ |
|
|
|
if (AvaloniaLocator.Current.GetService<IRenderTimer>() is ChoreographerTimer timer) |
|
|
|
{ |
|
|
|
@ -84,10 +84,11 @@ namespace Avalonia.Android |
|
|
|
(insetsManager as AndroidInsetsManager)?.ApplyStatusBarState(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else if (!isVisible && _timerSubscription != null) |
|
|
|
{ |
|
|
|
_root.StopRendering(); |
|
|
|
_timerSubscription?.Dispose(); |
|
|
|
_timerSubscription = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|