Skip to content

Commit

Permalink
Reexport winit::platform::android::activity::* in bevy_winit (#11011)
Browse files Browse the repository at this point in the history
# Objective

- Fixes #10630

## Solution

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

---------

Co-authored-by: François <[email protected]>
  • Loading branch information
hecksmosis and mockersf authored Dec 19, 2023
1 parent 4852233 commit dc8fc6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_derive/src/bevy_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
5 changes: 3 additions & 2 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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.
Expand Down

0 comments on commit dc8fc6c

Please sign in to comment.