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

Opening the ImageViewer automatically dismisses the StatusBar on Android #15

Closed
murad-alm opened this issue May 19, 2022 · 5 comments · Fixed by #19
Closed

Opening the ImageViewer automatically dismisses the StatusBar on Android #15

murad-alm opened this issue May 19, 2022 · 5 comments · Fixed by #19
Labels
Android bug Something isn't working

Comments

@murad-alm
Copy link

murad-alm commented May 19, 2022

Describe the Issue

When the function showImageViewer() is called, the top Bar (Status Bar) in Android is automatically dismissed. Passing the argument immersive as false doesn't change this behaviour.

Expected behavior

The StatusBar shouldn't be hidden after returning from the "view image" screen.

Other Information

Before opening the ImageViewer:

      

After opening the ImageViewer:

      

Edit: typo

@murad-alm murad-alm changed the title Opening the ImageViewer automatically dismisses the TopBar on Android Opening the ImageViewer automatically dismisses the StatusBar on Android May 19, 2022
@jfahrenkrug
Copy link
Collaborator

@murad-alm Thank you for this thorough bug report. We'll take a look soon.

@jfahrenkrug jfahrenkrug added bug Something isn't working Android labels May 19, 2022
@murad-alm
Copy link
Author

Solution Attempt 1:

Added this line
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
To the initState() function solved this behaviour when exiting the "viewImage" Screen with the top right x button.

Problem:

When using the back button (or swipe gesture) to close the Image/screen, this issue remains.

@murad-alm
Copy link
Author

murad-alm commented May 19, 2022

Strange Behaviour:

The onViewerDismissed() parameter/function is not being called when the dialog is closed by a back swipe or by using the back button.

Edit: this might be an issue on its own, but i thought i would add it to this issue, as it was a part of my attempt to solve this issue.

@murad-alm
Copy link
Author

Workaround:

Setting the immersive: flase and useSafeArea: true would keep the StatusBar visible in the dialog and after closing it.
That being said, it is a workaround and for people who don't want the StatusBar to be visible when an Image Dialog is opened (as in my case), this might not be the answer.

Most importantly, and as mentioned in #15 (comment), the onViewerDismissed() bug should be fixed, as a back swipe or a back button press is more natural for mobile users than seeking the x button in the upper right corner (IMO).

@jfahrenkrug I'm interested to hear your opinion/answer :)

@jfahrenkrug
Copy link
Collaborator

@murad-alm Sorry for the delay. I've put up a PR here that should fix your issue: #19 Could you confirm that this does indeed fix things? Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android bug Something isn't working
Projects
None yet
2 participants