-
Notifications
You must be signed in to change notification settings - Fork 52
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
Showing system ui without overlaying the application (GameActivity) #96
Comments
I think I got around this problem like this: https://github.com/torokati44/ruffle-android/blob/effa0b926797116b08d14117db1ab6fa0dd2d5c9/app/ruffle/src/main/java/rs/ruffle/FullscreenNativeActivity.java#L87-L105 |
Thanks @torokati44 that is indeed useful! Unfortunately now every touch event seems to be offset by the status bar height, I guess that is what you use the get_loc_on_screen function for? I'm able to work around this by modifying the winit android implementation by offsetting the pointer position with the contentRect: let location = PhysicalPosition {
x: (pointer.x() - self.android_app.content_rect().left as f32) as _,
y: (pointer.y() - self.android_app.content_rect().top as f32) as _,
}; This does work but feels really wrong, I'm surprised that this isn't handled by the GameActivity code. I'd expect all events to be relative to the surface area, but I guess they don't expect you to modify the surface area size / position and want you to handle any insets in the application?. |
Yep!
Same.
For me this was one of the main points of switching from |
I fixed this just by adding display insets listener inside To support cutouts at Below is my code snippet you can call at
At Rust code you can have something like this at any file, (
Works perfectly at egui :) |
My application is not a game but rather an app using egui as ui, so I'd like to show the android status bar and navigation buttons while my app is open.
I would expect, that if you don't call hideSystemUI and call setDecorFitsSystemWindows with true (in the agdk-eframe example), that the app fits within the system ui.
While the system ui is shown sucessfully, it now overlays the top and the bottom part of the app (in the eframe example, the top bar where you select the different demos is completely hidden by the status bar on my device).
Seems like the underlying SurfaceView created by the GameActivity doesn't respect the setDecorFitsSystemWindows flag. I also tried setting various flags on the views I was able to access in onCreate but I haven't found a reliable way to make the surface view fit inside the system ui.
I also tried updating all the android libraries to the latest version, hoping it'd be a bug in one of them, but it didn't make a difference.
The text was updated successfully, but these errors were encountered: