-
Notifications
You must be signed in to change notification settings - Fork 534
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]: Fullscreen issue #550
Comments
I have the same issue, indeed this is happening " It seems like Unity keeps overriding system bar configs as I've also tried using SystemChrome.setEnabledSystemUIMode to change between edgeToEdge and immersive modes to change system bars behaviour." When using SystemChrome.setEnabledSystemUIMode the navigation bar gets crazy on and off in loop. I don't want to display fullscreen, but I also don't want de navigation bar active. I was able to achieve what I want by: Unity -> Project Setting -> Resolution -> Start in fullscreen mode = true UnityWidget with both hideStatus and fullscreen set to true; On my flutter widget parente I also used SystemChrome.setEnabledSystemUIMode |
Thanks for the suggestion @droncaglio ! This made the system bars to hide altogether, but unfortunately I still have a problem with the second issue, most likely related to Unity overriding SystemChrome settings. When I go out of the video player, I would like the system bars to restore back to edgeToEdge mode. Unfortunately, the system bars will remain in immersive mode until the app restarts, even after trying to set |
same issue here |
You can actually dynamically change the fullscreen setting in Unity, besides the player settings mentioned above.
You could use the player settings toggle to boot in fullscreen and send a message from flutter when leaving the widget, to exit the fullscreen state in Unity. Heres just a little example using the example app rotation slider. Unity becomes fullscreen if the speed is > 0.
Screen_Recording_20220628-130722.mp4 |
@timbotimbo Thank you very much for the suggestion. Combining your fix with @droncaglio 's suggestion to enable hideStatus and fullscreen flags in the UnityWidget did the trick! For anyone else out there looking for a fix, here's what I did (At time of writing, I am using 2022.1.1+4 of the flutter_unity_widget and few-2022.1.1-v2.unitypackage imported to a project using 2020.3.5.f1 of the Unity Editor):
|
Describe the bug
For some reason, the navigation bar isn't hiding on Android when setting "fullscreen" boolean to true, I have "Fullscreen" unchecked in the Unity project. Additionally, the status bar doesn't restore once the Unity Player goes out of view. I even tried using unload() and pause().
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The system bars should hide when UnityWidget is built with fullscreen flag.
Screenshots
If applicable, add screenshots to help explain your problem.
OP 7 Pro Android 10:
https://user-images.githubusercontent.com/101586610/158229421-1cc08ac8-e025-4f35-a021-8192aef67def.mp4
Xperia 10 iii Android 11:
https://user-images.githubusercontent.com/101586610/158229557-26a7f904-22d3-4c7d-945b-9fdfab7694a9.mp4
Pixel 4 XL Android 12:
https://user-images.githubusercontent.com/101586610/158229614-dbe1b393-27e3-4b15-98f3-93885ca33fa7.mp4
Unity (please complete the following information):
Smartphone (please complete the following information):
Additional context
So basically, I have a 360 interactive video player created in Unity that I require in my Flutter project, so I need to hide system bars on demand. It seems like Unity keeps overriding system bar configs as I've also tried using SystemChrome.setEnabledSystemUIMode to change between edgeToEdge and immersive modes to change system bars behaviour.
The text was updated successfully, but these errors were encountered: