Skip to content

Commit

Permalink
Fix modal page push in immersive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloLukianets committed Jan 15, 2024
1 parent 3f99858 commit a2526ea
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,16 @@ Task PresentModal(Page modal, bool animated)
NavAnimationInProgress = true;
if (animated)
{
modalContainer.TranslationY = GetModalParentView().Height;
modalContainer?.Animate()?.TranslationY(0)?.SetInterpolator(new DecelerateInterpolator(1))?.SetDuration(300)?.SetListener(new GenericAnimatorListener
var translationValue = 0;
var windowInsets = ViewCompat.GetRootWindowInsets(parentView);
if (windowInsets is not null && !windowInsets.IsVisible(WindowInsetsCompat.Type.StatusBars()))
{
var statusBarHeight = _window.PlatformActivity.GetStatusBarHeight();
translationValue -= statusBarHeight;
}

modalContainer.TranslationY = parentView.Height;
modalContainer?.Animate()?.TranslationY(translationValue)?.SetInterpolator(new DecelerateInterpolator(1))?.SetDuration(300)?.SetListener(new GenericAnimatorListener
{
OnEnd = a =>
{
Expand Down

0 comments on commit a2526ea

Please sign in to comment.