prevent app rendering under the status bar in android
This commit is contained in:
parent
cc970d90ed
commit
75b72f63b0
11
src/lib.rs
11
src/lib.rs
@ -1,13 +1,22 @@
|
|||||||
#![warn(clippy::all, rust_2018_idioms)]
|
#![warn(clippy::all, rust_2018_idioms)]
|
||||||
|
|
||||||
pub mod app;
|
pub mod app;
|
||||||
pub use app::TemplateApp;
|
|
||||||
|
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn android_main(app: winit::platform::android::activity::AndroidApp) {
|
fn android_main(app: winit::platform::android::activity::AndroidApp) {
|
||||||
|
use winit::platform::android::activity::WindowManagerFlags;
|
||||||
use winit::platform::android::EventLoopBuilderExtAndroid;
|
use winit::platform::android::EventLoopBuilderExtAndroid;
|
||||||
|
|
||||||
|
// Disable LAYOUT_IN_SCREEN to keep app from drawing under the status bar
|
||||||
|
// winit does not currently do anything with MainEvent::InsetsChanged events
|
||||||
|
app.set_window_flags(
|
||||||
|
WindowManagerFlags::empty(),
|
||||||
|
WindowManagerFlags::LAYOUT_IN_SCREEN,
|
||||||
|
);
|
||||||
|
// Alternatively we can hide the system bars by setting the app to fullscreen
|
||||||
|
//app.set_window_flags(WindowManagerFlags::FULLSCREEN, WindowManagerFlags::empty());
|
||||||
|
|
||||||
android_logger::init_once(
|
android_logger::init_once(
|
||||||
android_logger::Config::default().with_max_level(log::LevelFilter::Debug),
|
android_logger::Config::default().with_max_level(log::LevelFilter::Debug),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user