Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Modal Pages do not fill screen when in Fullscreen #10364

Closed
ewerspej opened this issue Sep 28, 2022 · 28 comments · Fixed by #19903
Closed

[Android] Modal Pages do not fill screen when in Fullscreen #10364

ewerspej opened this issue Sep 28, 2022 · 28 comments · Fixed by #19903

Comments

@ewerspej
Copy link

ewerspej commented Sep 28, 2022

Description

On Android 12.0, modal pages do not cover the entire screen when going into fullscreen and hiding system and navigation bars. It appears that modal pages are not pushed up all the way, because the content is not centered correctly, either. This occurs with real devices (in my case Samsung S10 + S22), but not in emulators.

Steps to Reproduce

  1. Create a new MAUI App project
  2. Add a modal page
  3. Enable full screen mode in Android
  4. Debug App on Android
  5. Open Modal page

Expected behavior: The modal page fills the entire screen when fullscreen is enabled
Actual behavior: The modal page is not pushed up all the way and the underlying page is still visible

Link to public reproduction project repository

https://github.com/ewerspej/dotnet-maui-bug-repro-modal-fullscreen

Version with bug

7.0.100-rc.1.22431.12

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12.0

Did you find any workaround?

No

Relevant log output

No response

@ewerspej ewerspej added the t/bug Something isn't working label Sep 28, 2022
@PureWeen
Copy link
Member

@ewerspej can you give me some more specifics it seems to work fine for me?

image

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label Sep 28, 2022
@ghost
Copy link

ghost commented Sep 28, 2022

Hi @ewerspej. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ewerspej
Copy link
Author

ewerspej commented Sep 28, 2022

@ewerspej can you give me some more specifics it seems to work fine for me?

I'm running it on a Samsung S22 with Android 12.0. My dev environment is Windows 10 running Visual Studio 17.4 Preview 2.1 and the latest .NET 7.0 RC1.

What other kind of information are you thinking of?
How did you try to reproduce it? Have you tried a real device?

I can reliably reproduce it with the example repo as well as with one of the apps I'm working on (which is why I reported this).

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 28, 2022
@ewerspej
Copy link
Author

ewerspej commented Sep 29, 2022

@PureWeen It seems to work fine with Android emulators, but on my Android 12.0 devices (Samsung Galaxy S10 + S22) it's definitely displayed incorrectly as you can see in the screenshots that are attached in the repository.

Maybe this has to do with the insets for the front camera which is integrated in the screen of newer smartphone models?

@rachelkang rachelkang added this to the Backlog milestone Sep 29, 2022
@ghost
Copy link

ghost commented Sep 29, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ewerspej
Copy link
Author

I hope it makes it to the next release then, because fullscreen support is important for many apps that want to provide an immersive experience. Thanks for taking it up.

@ewerspej
Copy link
Author

@rachelkang @PureWeen

Update

It appears that this is a general MAUI or Shell issue with Android on Samsung devices. This issue is also reproducible with non-modal pages that are created via Shell navigation. The status bar area, which on many Samsung devices features a cutout for the front camera, turns black when opening any type of Page (modals are just slightly worse because their content isn't placed right) and when going back to the previous page, it stays black despite having it set to a different color.

@jwestes
Copy link

jwestes commented Apr 13, 2023

I am seeing the same behavior on a Google Pixel 6, but only in landscape orientation. Portrait works as expected. I'm running Visual Studio 2022 - 17.5.4 Pixel is running Android 13 - March 5, 2023

@PureWeen PureWeen removed the s/needs-attention Issue has more information and needs another look label Apr 13, 2023
@PureWeen
Copy link
Member

@jwestes can you include a screen shot?

@jwestes
Copy link

jwestes commented Apr 13, 2023

Screenshot_20230413-153457

Screenshot_20230413-153506

@duandre
Copy link

duandre commented Apr 17, 2023

I am seeing the same behavior on a Motorola edge 20 pro in landscape orientation

@jrc14
Copy link

jrc14 commented Apr 18, 2023

This issue is also impacting me, on a Google Pixel 6 device. It looks fine in landscape mode, but in portrait mode there is a gap, as described above.
Phone is running Android 13 (system update 1 Feb 2023, security update 5 Mar 2023). Build environment is VS 17.5.3

This issue is blocking me from releasing the app!

@PureWeen
Copy link
Member

@duandre @jrc14 are you using full screen settings like the issue here dictates or are you doing something else?

@duandre
Copy link

duandre commented Apr 18, 2023

@PureWeen Yes, I am. I am trying to reproduce a video in full screen and landscape orientation with MediaElement in a modal page. When the modal page is pushed up the underlying page is still visible

@jrc14
Copy link

jrc14 commented Apr 19, 2023

@PureWeen yes, this is the same issue with full screen settings. In my case, I have Shell app that, from one of the shell tabs is using Shell.Current.GoToAsync to display a ContentPage with PresentationMode.Modal, and in that page's code-behind it is switching into full-screen mode by calling insetsController.Hide(WindowInsets.Type....Bars()). The result is that everything in the ContentPage is being pushed down the screen (so, like with duandre's case, the content of the earlier page on the stack is showing through).
I note that I can change this behaviour by modifying mainActivity.Window.Attributes.LayoutInDisplayCutoutMode. If I set it to Always then, in Portrait mode, the gap doesn't appear and my modal page ends up in the right place (overlapping the cutout, so the camera lens takes a chunk out of the top-centre of my page content). This is not a complete fix for the problem because my modal ContentPage is now displaced when the phone is in Landscape mode. I didn't find one single setting for LayoutInDisplayCutoutMode that gives me a reliably correct appearance in both Portrait and Landscape, full-screen and non-full-screen. Nor is the behaviour completely repeatable (sometimes the layout I get is different, depending on the series of switches I do between full/non-full-screen and landscape/portrait).

@duandre
Copy link

duandre commented Apr 19, 2023

@jrc14 @PureWeen just an update: in my case I realize my problem was occurring when controls of MediaElement was shown. I set ShouldShowPlaybackControls="False" and the problem with modal stopped.

@davibittencourtome
Copy link

Any news about the modal page not showing in fullscreen ?
Any workaround?

@homeyf homeyf added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Jun 7, 2023
@ghost
Copy link

ghost commented Jun 7, 2023

Hi @ewerspej. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@homeyf
Copy link

homeyf commented Jun 7, 2023

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Not repro on Android platform with sample project.
https://github.com/ewerspej/dotnet-maui-bug-repro-modal-fullscreen
image

@ewerspej
Copy link
Author

ewerspej commented Jun 7, 2023

The issue has indeed been improved with VS 17.7.0 Preview 1.0, but the status bar is still visible when using fullscreen and immersive mode on Android (Samsumg Galaxy S22):

The status bar should be hidden by modal pages, at least that's how it used to be in Xamarin.Forms when fullscreen and immersive mode were enabled.

I do not consider this fixed, yet, because if I remove Shell.PresentationMode="ModalAnimated" from the Page's root element, then it shows up as a normal page and that covers the entire screen - including the status bar.

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jun 7, 2023
@mhrastegari
Copy link

Same issue on Pixel 3 emulator

@jrc14
Copy link

jrc14 commented Aug 31, 2023

Any update on this issue. It still persists, and in the latest visual studio version, even my work-around (with mainActivity.Window.Attributes.LayoutInDisplayCutoutMode) no longer works.

@joelcm16
Copy link

Any updates about it? I've @ewerspej problem

@tschramme86
Copy link

Same here. Issue is still reproducible even on MAUI 8.0.3. Hope it will get fixed soon.

@PavloLukianets
Copy link
Contributor

@PureWeen here is another repro, would be cool to have at least a direction where to search for the fix. It looks like the content is being shifted down for some reason (see the nav buttons below)

Archive.zip

Screenshot_1704825852

@jwestes
Copy link

jwestes commented Jan 9, 2024

Is there any progress on this? I'm getting close to being ready for release and it looks terrible. It has been well over a year since this was reported and there has been nothing but discussion.

@PATRICKdallat
Copy link

@PavloLukianets
When is this fix projected for release?

@PavloLukianets
Copy link
Contributor

@PavloLukianets When is this fix projected for release?

ahaaha, i am not on the MAUI team) ask @davidortinau or @Redth :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.