Struct android_activity::AndroidApp
source · [−]pub struct AndroidApp { /* private fields */ }Implementations
sourceimpl AndroidApp
impl AndroidApp
sourcepub fn native_window<'a>(&self) -> Option<NativeWindow>
pub fn native_window<'a>(&self) -> Option<NativeWindow>
Queries the current NativeWindow for the application.
This will only return Some(window) between
[AndroidAppMainEvent::InitWindow] and [AndroidAppMainEvent::TerminateWindow]
events.
sourcepub fn poll_events<F>(&self, timeout: Option<Duration>, callback: F) where
F: FnMut(PollEvent<'_>),
pub fn poll_events<F>(&self, timeout: Option<Duration>, callback: F) where
F: FnMut(PollEvent<'_>),
Polls for any events associated with this AndroidApp and processes those events
(such as lifecycle events) via the given callback.
It’s important to use this API for polling, and not call [ALooper_pollAll] directly since
some events require pre- and post-processing either side of the callback. For correct
behavior events should be handled immediately, before returning from the callback and
not simply queued for batch processing later. For example the existing NativeWindow
is accessible during a MainEvent::TerminateWindow callback and will be
set to None once the callback returns, and this is also synchronized with the Java
main thread. The MainEvent::SaveState event is also synchronized with the
Java main thread.
sourcepub fn create_waker(&self) -> AndroidAppWaker
pub fn create_waker(&self) -> AndroidAppWaker
Creates a means to wake up the main loop while it is blocked waiting for
events within [poll_events()].
sourcepub fn config(&self) -> ConfigurationRef
pub fn config(&self) -> ConfigurationRef
Returns a (cheaply clonable) reference to this application’s [Configuration]
sourcepub fn content_rect(&self) -> Rect
pub fn content_rect(&self) -> Rect
Queries the current content rectangle of the window; this is the area where the window’s content should be placed to be seen by the user.
sourcepub fn asset_manager(&self) -> AssetManager
pub fn asset_manager(&self) -> AssetManager
Queries the Asset Manager instance for the application.
Use this to access binary assets bundled inside your application’s .apk file.
pub fn enable_motion_axis(&self, axis: Axis)
pub fn disable_motion_axis(&self, axis: Axis)
pub fn input_events<'b, F>(&self, callback: F) where
F: FnMut(&InputEvent),
sourcepub fn sdk_version() -> i32
pub fn sdk_version() -> i32
The user-visible SDK version of the framework
Also referred to as Build.VERSION_CODES
sourcepub fn internal_data_path(&self) -> Option<PathBuf>
pub fn internal_data_path(&self) -> Option<PathBuf>
Path to this application’s internal data directory
sourcepub fn external_data_path(&self) -> Option<PathBuf>
pub fn external_data_path(&self) -> Option<PathBuf>
Path to this application’s external data directory
Trait Implementations
sourceimpl Clone for AndroidApp
impl Clone for AndroidApp
sourcefn clone(&self) -> AndroidApp
fn clone(&self) -> AndroidApp
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AndroidApp
impl Debug for AndroidApp
sourceimpl Hash for AndroidApp
impl Hash for AndroidApp
sourceimpl PartialEq<AndroidApp> for AndroidApp
impl PartialEq<AndroidApp> for AndroidApp
impl Eq for AndroidApp
Auto Trait Implementations
impl RefUnwindSafe for AndroidApp
impl Send for AndroidApp
impl Sync for AndroidApp
impl Unpin for AndroidApp
impl UnwindSafe for AndroidApp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more