Skip to content

Commit

Permalink
chore: Adjust check
Browse files Browse the repository at this point in the history
(cherry picked from commit 1cf85d7)
  • Loading branch information
MartinZikmund authored and mergify[bot] committed Feb 11, 2025
1 parent fe873d1 commit e78b7cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/Uno.UI/UI/Xaml/Application.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,13 @@ static partial void StartPartial(ApplicationInitializationCallback callback)
/// </remarks>
private DateTimeOffset GetSuspendingOffset() => DateTimeOffset.Now.AddSeconds(5);

partial void ApplySystemOverlaysTheming() => NativeWindowWrapper.Instance?.ApplySystemOverlaysTheming();
partial void ApplySystemOverlaysTheming()
{
// This is needed only due to the fact that currently Instance accessor creates the wrapper
// eagerly - which could then happen too early. Will no longer be needed when un-singletoned.
if (InitializationComplete)
{
NativeWindowWrapper.Instance.ApplySystemOverlaysTheming();
}
}
}
5 changes: 1 addition & 4 deletions src/Uno.UI/UI/Xaml/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,7 @@ private void SetRequestedTheme(ApplicationTheme requestedTheme)

internal void OnRequestedThemeChanged()
{
if (InitializationComplete)
{
ApplySystemOverlaysTheming();
}
ApplySystemOverlaysTheming();
OnResourcesChanged(ResourceUpdateReason.ThemeResource);
}

Expand Down

0 comments on commit e78b7cb

Please sign in to comment.