#[rustfmt::skip] // This file has been automatically generated by `jnim` from `NativeActivity.class`. // DO NOT EDIT use jnim::*; use crate::android::app::Activity; use crate::android::view::InputQueueCallback; use crate::android::view::InputQueueCallbackObject; use crate::android::view::SurfaceHolderCallback; use crate::android::view::SurfaceHolderCallback2; use crate::android::view::SurfaceHolderCallback2Object; use crate::android::view::SurfaceHolderCallbackObject; use crate::android::view::ViewTreeObserverOnGlobalLayoutListener; use crate::android::view::ViewTreeObserverOnGlobalLayoutListenerObject; pub struct NativeActivity { __object: JObject, __supper: Activity, __surface_holder_callback2: SurfaceHolderCallback2Object, __surface_holder_callback: SurfaceHolderCallbackObject, __input_queue_callback: InputQueueCallbackObject, __view_tree_observer_on_global_layout_listener: ViewTreeObserverOnGlobalLayoutListenerObject, } impl JNameMaker for NativeActivity { const JAVA_PATH: &'static [u8] = b"android/app/NativeActivity\0"; } impl JPlainMarker for NativeActivity { fn class(env: Option<&JEnv>) -> Option { static CACHE: CachedID = CachedID::new(); CACHE.get(|| JEnv::env(env)?.find_class(Self::JAVA_PATH)) } } impl core::ops::Deref for NativeActivity { type Target = Activity; fn deref(&self) -> &Self::Target { &self.__supper } } impl AsRef for NativeActivity { fn as_ref(&self) -> &Activity { &self.__supper } } impl AsRef for NativeActivity { fn as_ref(&self) -> &JObject { &self.__object } } // impl interfaces impl SurfaceHolderCallback2 for NativeActivity {} impl AsRef for NativeActivity { fn as_ref(&self) -> &SurfaceHolderCallback2Object { &self.__surface_holder_callback2 } } impl SurfaceHolderCallback for NativeActivity {} impl AsRef for NativeActivity { fn as_ref(&self) -> &SurfaceHolderCallbackObject { &self.__surface_holder_callback } } impl InputQueueCallback for NativeActivity {} impl AsRef for NativeActivity { fn as_ref(&self) -> &InputQueueCallbackObject { &self.__input_queue_callback } } impl ViewTreeObserverOnGlobalLayoutListener for NativeActivity {} impl AsRef for NativeActivity { fn as_ref(&self) -> &ViewTreeObserverOnGlobalLayoutListenerObject { &self.__view_tree_observer_on_global_layout_listener } } // field impl NativeActivity { pub const META_DATA_FUNC_NAME: &'static str = "android.app.func_name"; pub const META_DATA_LIB_NAME: &'static str = "android.app.lib_name"; } // method impl NativeActivity { pub fn on_create<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::os::Bundle) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onCreate\0", b"(Landroid/os/Bundle;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_destroy<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onDestroy\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_pause<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onPause\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_resume<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onResume\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_save_instance_state<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::os::Bundle) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onSaveInstanceState\0", b"(Landroid/os/Bundle;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_start<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onStart\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_stop<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onStop\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_configuration_changed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::content::res::Configuration) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onConfigurationChanged\0", b"(Landroid/content/res/Configuration;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_low_memory<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onLowMemory\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_window_focus_changed<'a>(&'a self, env: &'a JEnv, arg0: JBool) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onWindowFocusChanged\0", b"(Z)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn surface_created<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"surfaceCreated\0", b"(Landroid/view/SurfaceHolder;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn surface_changed<'a>( &'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject, arg1: JInt, arg2: JInt, arg3: JInt, ) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"surfaceChanged\0", b"(Landroid/view/SurfaceHolder;III)V\0"))? .call(env, self.as_ref(), (arg0, arg1, arg2, arg3)) } pub fn surface_redraw_needed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"surfaceRedrawNeeded\0", b"(Landroid/view/SurfaceHolder;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn surface_destroyed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"surfaceDestroyed\0", b"(Landroid/view/SurfaceHolder;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_input_queue_created<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::InputQueue) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onInputQueueCreated\0", b"(Landroid/view/InputQueue;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_input_queue_destroyed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::InputQueue) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onInputQueueDestroyed\0", b"(Landroid/view/InputQueue;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_global_layout<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onGlobalLayout\0", b"()V\0"))? .call(env, self.as_ref(), ()) } } #[test] fn test_type_zero() { assert_eq!(0, std::mem::size_of::()); }