Move Android backend to winit-android (#4250)

This commit is contained in:
Mads Marquart 2025-05-24 13:29:53 +02:00 committed by GitHub
parent 04482d5a2e
commit b1f8d778a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 102 additions and 76 deletions

View file

@ -328,6 +328,26 @@ impl winit_core::event_loop::run_on_demand::EventLoopExtRunOnDemand for EventLoo
}
}
#[cfg(android_platform)]
impl winit_android::EventLoopExtAndroid for EventLoop {
fn android_app(&self) -> &winit_android::activity::AndroidApp {
&self.event_loop.android_app
}
}
#[cfg(android_platform)]
impl winit_android::EventLoopBuilderExtAndroid for EventLoopBuilder {
fn with_android_app(&mut self, app: winit_android::activity::AndroidApp) -> &mut Self {
self.platform_specific.android_app = Some(app);
self
}
fn handle_volume_keys(&mut self) -> &mut Self {
self.platform_specific.ignore_volume_keys = false;
self
}
}
/// ```compile_error
/// use winit::event_loop::run_on_demand::EventLoopExtRunOnDemand;
/// use winit::event_loop::EventLoop;