Reexport winit::platform::android::activity::* in bevy_winit (#11011)

# Objective

- Fixes #10630

## Solution

- Reexport winit::platform::android::activity::* in bevy_init

---------

Co-authored-by: François <mockersf@gmail.com>
This commit is contained in:
Pablo García Ruiz 2023-12-19 21:15:03 +01:00 committed by GitHub
parent 4852233298
commit dc8fc6cb34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -12,7 +12,7 @@ pub fn bevy_main(_attr: TokenStream, item: TokenStream) -> TokenStream {
TokenStream::from(quote! {
#[no_mangle]
#[cfg(target_os = "android")]
fn android_main(android_app: bevy::winit::AndroidApp) {
fn android_main(android_app: bevy::winit::android_activity::AndroidApp) {
let _ = bevy::winit::ANDROID_APP.set(android_app);
main();
}

View file

@ -47,7 +47,7 @@ use bevy_window::{
use bevy_window::{PrimaryWindow, RawHandleWrapper};
#[cfg(target_os = "android")]
pub use winit::platform::android::activity::AndroidApp;
pub use winit::platform::android::activity as android_activity;
use winit::{
event::{self, DeviceEvent, Event, StartCause, WindowEvent},
@ -63,7 +63,8 @@ use crate::web_resize::{CanvasParentResizeEventChannel, CanvasParentResizePlugin
/// [`AndroidApp`] provides an interface to query the application state as well as monitor events
/// (for example lifecycle and input events).
#[cfg(target_os = "android")]
pub static ANDROID_APP: std::sync::OnceLock<AndroidApp> = std::sync::OnceLock::new();
pub static ANDROID_APP: std::sync::OnceLock<android_activity::AndroidApp> =
std::sync::OnceLock::new();
/// A [`Plugin`] that uses `winit` to create and manage windows, and receive window and input
/// events.